/*jslint plusplus: true */
/*globals getgravc: true, dpper: true, dspace: true
*/
/*global mag: true, dot: true, sign: true
*/
/*global document: true
*/
/*global nm2m: true, ft2m: true, jday : true
*/
/*global opsmode: true
*/
/*global
alert: true,
debug: true,
window: true
*/
/*global gstime: true, opsmode:true, xke:true, j2:true */
/*globals days2mdh: true */
/*global mag: true, small: true, infinite: true, twopi: true, angl: true,
halfpi: true, newtonnu: true, cross: true, dot: true, sign: true,
UNDEFINED: true,
*/
/*globals getgravc: true, dpper: true, dspace: true */
/*global getgravc: true, initl: true, dscom: true, dpper: true, dsinit: true,
sgp4: true
*/
/*global twoline2rv: true, sgp4: true, invjday: true, rv2coe: true,
tumin: true, mu: true, radiusearthkm: true, xke: true,
j2: true, j3: true, j4: true, j3oj2: true, opsmode: true,
input: true,
document: true,
getgravc: true,
alert: true,
outfile: true,
fprintf1: true,
sprintf: true,
debug: true,
*/
/*global
getgravc: true,
debug: true,
days2mdh: true,
jday: true,
input: true, // reads from HTML by id="prompt string"
sgp4init: true,
tumin: true, mu: true, radiusearthkm:true, xke: true, j2: true, j3: true, j4: true, j3oj2: true,
*/
// -----------------------------------------------------------------------------
//
// isat
//
// This is the combined code of the translated Miura's MATLAB for minification.
//
// -----------------------------------------------------------------------------
// angl.js
//
! function() {
var e, t, r;
! function(i) {
function n(e, t) { return w.call(e, t) }
function o(e, t) { var r, i, n, o, a, s, l, u, c, h, d = t && t.split("/"),
m = g.map,
p = m && m["*"] || {}; if (e && "." === e.charAt(0))
if (t) { for (d = d.slice(0, d.length - 1), e = d.concat(e.split("/")), u = 0; u < e.length; u += 1)
if (h = e[u], "." === h) e.splice(u, 1), u -= 1;
else if (".." === h) { if (1 === u && (".." === e[2] || ".." === e[0])) break;
u > 0 && (e.splice(u - 1, 2), u -= 2) } e = e.join("/") } else 0 === e.indexOf("./") && (e = e.substring(2)); if ((d || p) && m) { for (r = e.split("/"), u = r.length; u > 0; u -= 1) { if (i = r.slice(0, u).join("/"), d)
for (c = d.length; c > 0; c -= 1)
if (n = m[d.slice(0, c).join("/")], n && (n = n[i])) { o = n, a = u; break }
if (o) break;!s && p && p[i] && (s = p[i], l = u) }!o && s && (o = s, a = l), o && (r.splice(0, a, o), e = r.join("/")) } return e }
function a(e, t) { return function() { return m.apply(i, C.call(arguments, 0).concat([e, t])) } }
function s(e) { return function(t) { return o(t, e) } }
function l(e) { return function(t) { v[e] = t } }
function u(e) { if (n(y, e)) { var t = y[e];
delete y[e], _[e] = !0, d.apply(i, t) } if (!n(v, e) && !n(_, e)) throw new Error("No " + e); return v[e] }
function c(e) { var t, r = e ? e.indexOf("!") : -1; return r > -1 && (t = e.substring(0, r), e = e.substring(r + 1, e.length)), [t, e] }
function h(e) { return function() { return g && g.config && g.config[e] || {} } } var d, m, p, f, v = {},
y = {},
g = {},
_ = {},
w = Object.prototype.hasOwnProperty,
C = [].slice;
p = function(e, t) { var r, i = c(e),
n = i[0]; return e = i[1], n && (n = o(n, t), r = u(n)), n ? e = r && r.normalize ? r.normalize(e, s(t)) : o(e, t) : (e = o(e, t), i = c(e), n = i[0], e = i[1], n && (r = u(n))), { f: n ? n + "!" + e : e, n: e, pr: n, p: r } }, f = { require: function(e) { return a(e) }, exports: function(e) { var t = v[e]; return "undefined" != typeof t ? t : v[e] = {} }, module: function(e) { return { id: e, uri: "", exports: v[e], config: h(e) } } }, d = function(e, t, r, o) { var s, c, h, d, m, g, w = []; if (o = o || e, "function" == typeof r) { for (t = !t.length && r.length ? ["require", "exports", "module"] : t, m = 0; m < t.length; m += 1)
if (d = p(t[m], o), c = d.f, "require" === c) w[m] = f.require(e);
else if ("exports" === c) w[m] = f.exports(e), g = !0;
else if ("module" === c) s = w[m] = f.module(e);
else if (n(v, c) || n(y, c) || n(_, c)) w[m] = u(c);
else { if (!d.p) throw new Error(e + " missing " + c);
d.p.load(d.n, a(o, !0), l(c), {}), w[m] = v[c] } h = r.apply(v[e], w), e && (s && s.exports !== i && s.exports !== v[e] ? v[e] = s.exports : h === i && g || (v[e] = h)) } else e && (v[e] = r) }, e = t = m = function(e, t, r, n, o) { return "string" == typeof e ? f[e] ? f[e](t) : u(p(e, t).f) : (e.splice || (g = e, t.splice ? (e = t, t = r, r = null) : e = i), t = t || function() {}, "function" == typeof r && (r = n, n = o), n ? d(i, e, t, r) : setTimeout(function() { d(i, e, t, r) }, 4), m) }, m.config = function(e) { return g = e, g.deps && m(g.deps, g.callback), m }, r = function(e, t, r) { t.splice || (r = t, t = []), n(v, e) || n(y, e) || (y[e] = [e, t, r]) }, r.amd = { jQuery: !0 } }(), r("Core/defined", [], function() { "use strict"; var e = function(e) { return void 0 !== e }; return e }), r("Core/freezeObject", ["./defined"], function(e) { "use strict"; var t = Object.freeze; return e(t) || (t = function(e) { return e }), t }), r("Core/defaultValue", ["./freezeObject"], function(e) { "use strict"; var t = function(e, t) { return void 0 !== e ? e : t }; return t.EMPTY_OBJECT = e({}), t }), r("Core/DeveloperError", ["./defined"], function(e) { "use strict"; var t = function(e) { this.name = "DeveloperError", this.message = e; var t = new Error;
this.stack = t.stack }; return t.prototype.toString = function() { var t = this.name + ": " + this.message; return e(this.stack) && (t += "\n" + this.stack.toString()), t }, t }), r("Core/Cartesian3", ["./defaultValue", "./defined", "./DeveloperError", "./freezeObject"], function(e, t, r, i) { "use strict"; var n = function(t, r, i) { this.x = e(t, 0), this.y = e(r, 0), this.z = e(i, 0) };
n.fromSpherical = function(i, o) { if (!t(i)) throw new r("spherical is required");
t(o) || (o = new n); var a = i.clock,
s = i.cone,
l = e(i.magnitude, 1),
u = l * Math.sin(s); return o.x = u * Math.cos(a), o.y = u * Math.sin(a), o.z = l * Math.cos(s), o }, n.fromArray = function(i, o, a) { if (!t(i)) throw new r("values is required."); if (o + 3 > i.length) throw new r("offset + 3 is greater than the length of the array."); return o = e(o, 0), t(a) || (a = new n), a.x = i[o + 0], a.y = i[o + 1], a.z = i[o + 2], a }, n.fromElements = function(e, r, i, o) { return t(o) ? (o.x = e, o.y = r, o.z = i, o) : new n(e, r, i) }, n.clone = function(e, r) { return t(e) ? t(r) ? (r.x = e.x, r.y = e.y, r.z = e.z, r) : new n(e.x, e.y, e.z) : void 0 }, n.fromCartesian4 = n.clone, n.packedLength = 3, n.pack = function(i, n, o) { if (!t(i)) throw new r("value is required"); if (!t(n)) throw new r("array is required");
o = e(o, 0), n[o++] = i.x, n[o++] = i.y, n[o] = i.z }, n.unpack = function(i, o, a) { if (!t(i)) throw new r("array is required"); return o = e(o, 0), t(a) || (a = new n), a.x = i[o++], a.y = i[o++], a.z = i[o], a }, n.getMaximumComponent = function(e) { if (!t(e)) throw new r("cartesian is required"); return Math.max(e.x, e.y, e.z) }, n.getMinimumComponent = function(e) { if (!t(e)) throw new r("cartesian is required"); return Math.min(e.x, e.y, e.z) }, n.magnitudeSquared = function(e) { if (!t(e)) throw new r("cartesian is required"); return e.x * e.x + e.y * e.y + e.z * e.z }, n.magnitude = function(e) { return Math.sqrt(n.magnitudeSquared(e)) }; var o = new n;
n.distance = function(e, i) { if (!t(e) || !t(i)) throw new r("left and right are required."); return n.subtract(e, i, o), n.magnitude(o) }, n.normalize = function(e, i) { if (!t(e)) throw new r("cartesian is required"); var o = n.magnitude(e); return t(i) ? (i.x = e.x / o, i.y = e.y / o, i.z = e.z / o, i) : new n(e.x / o, e.y / o, e.z / o) }, n.dot = function(e, i) { if (!t(e)) throw new r("left is required"); if (!t(i)) throw new r("right is required"); return e.x * i.x + e.y * i.y + e.z * i.z }, n.multiplyComponents = function(e, i, o) { if (!t(e)) throw new r("left is required"); if (!t(i)) throw new r("right is required"); return t(o) ? (o.x = e.x * i.x, o.y = e.y * i.y, o.z = e.z * i.z, o) : new n(e.x * i.x, e.y * i.y, e.z * i.z) }, n.add = function(e, i, o) { if (!t(e)) throw new r("left is required"); if (!t(i)) throw new r("right is required"); return t(o) ? (o.x = e.x + i.x, o.y = e.y + i.y, o.z = e.z + i.z, o) : new n(e.x + i.x, e.y + i.y, e.z + i.z) }, n.subtract = function(e, i, o) { if (!t(e)) throw new r("left is required"); if (!t(i)) throw new r("right is required"); return t(o) ? (o.x = e.x - i.x, o.y = e.y - i.y, o.z = e.z - i.z, o) : new n(e.x - i.x, e.y - i.y, e.z - i.z) }, n.multiplyByScalar = function(e, i, o) { if (!t(e)) throw new r("cartesian is required"); if ("number" != typeof i) throw new r("scalar is required and must be a number."); return t(o) ? (o.x = e.x * i, o.y = e.y * i, o.z = e.z * i, o) : new n(e.x * i, e.y * i, e.z * i) }, n.divideByScalar = function(e, i, o) { if (!t(e)) throw new r("cartesian is required"); if ("number" != typeof i) throw new r("scalar is required and must be a number."); return t(o) ? (o.x = e.x / i, o.y = e.y / i, o.z = e.z / i, o) : new n(e.x / i, e.y / i, e.z / i) }, n.negate = function(e, i) { if (!t(e)) throw new r("cartesian is required"); return t(i) ? (i.x = -e.x, i.y = -e.y, i.z = -e.z, i) : new n(-e.x, -e.y, -e.z) }, n.abs = function(e, i) { if (!t(e)) throw new r("cartesian is required"); return t(i) ? (i.x = Math.abs(e.x), i.y = Math.abs(e.y), i.z = Math.abs(e.z), i) : new n(Math.abs(e.x), Math.abs(e.y), Math.abs(e.z)) }; var a = new n;
n.lerp = function(e, i, o, s) { if (!t(e)) throw new r("start is required."); if (!t(i)) throw new r("end is required."); if ("number" != typeof o) throw new r("t is required and must be a number."); return n.multiplyByScalar(i, o, a), s = n.multiplyByScalar(e, 1 - o, s), n.add(a, s, s) }; var s = new n,
l = new n;
n.angleBetween = function(e, i) { if (!t(e)) throw new r("left is required"); if (!t(i)) throw new r("right is required");
n.normalize(e, s), n.normalize(i, l); var o = n.dot(s, l),
a = n.cross(s, l, s).magnitude(); return Math.atan2(a, o) }; var u = new n; return n.mostOrthogonalAxis = function(e, i) { if (!t(e)) throw new r("cartesian is required."); var o = n.normalize(e, u); return n.abs(o, o), i = o.x <= o.y ? o.x <= o.z ? n.clone(n.UNIT_X, i) : n.clone(n.UNIT_Z, i) : o.y <= o.z ? n.clone(n.UNIT_Y, i) : n.clone(n.UNIT_Z, i) }, n.equals = function(e, r) { return e === r || t(e) && t(r) && e.x === r.x && e.y === r.y && e.z === r.z }, n.equalsEpsilon = function(e, i, n) { if ("number" != typeof n) throw new r("epsilon is required and must be a number."); return e === i || t(e) && t(i) && Math.abs(e.x - i.x) <= n && Math.abs(e.y - i.y) <= n && Math.abs(e.z - i.z) <= n }, n.cross = function(e, i, o) { if (!t(e)) throw new r("left is required"); if (!t(i)) throw new r("right is required"); var a = e.x,
s = e.y,
l = e.z,
u = i.x,
c = i.y,
h = i.z,
d = s * h - l * c,
m = l * u - a * h,
p = a * c - s * u; return t(o) ? (o.x = d, o.y = m, o.z = p, o) : new n(d, m, p) }, n.ZERO = i(new n(0, 0, 0)), n.UNIT_X = i(new n(1, 0, 0)), n.UNIT_Y = i(new n(0, 1, 0)), n.UNIT_Z = i(new n(0, 0, 1)), n.prototype.getMaximumComponent = function() { return n.getMaximumComponent(this) }, n.prototype.getMinimumComponent = function() { return n.getMinimumComponent(this) }, n.prototype.clone = function(e) { return n.clone(this, e) }, n.prototype.magnitudeSquared = function() { return n.magnitudeSquared(this) }, n.prototype.magnitude = function() { return n.magnitude(this) }, n.prototype.normalize = function(e) { return n.normalize(this, e) }, n.prototype.dot = function(e) { return n.dot(this, e) }, n.prototype.multiplyComponents = function(e, t) { return n.multiplyComponents(this, e, t) }, n.prototype.add = function(e, t) { return n.add(this, e, t) }, n.prototype.subtract = function(e, t) { return n.subtract(this, e, t) }, n.prototype.multiplyByScalar = function(e, t) { return n.multiplyByScalar(this, e, t) }, n.prototype.divideByScalar = function(e, t) { return n.divideByScalar(this, e, t) }, n.prototype.negate = function(e) { return n.negate(this, e) }, n.prototype.abs = function(e) { return n.abs(this, e) }, n.prototype.lerp = function(e, t, r) { return n.lerp(this, e, t, r) }, n.prototype.angleBetween = function(e) { return n.angleBetween(this, e) }, n.prototype.mostOrthogonalAxis = function(e) { return n.mostOrthogonalAxis(this, e) }, n.prototype.equals = function(e) { return n.equals(this, e) }, n.prototype.equalsEpsilon = function(e, t) { return n.equalsEpsilon(this, e, t) }, n.prototype.toString = function() { return "(" + this.x + ", " + this.y + ", " + this.z + ")" }, n.prototype.cross = function(e, t) { return n.cross(this, e, t) }, n }), r("Core/Enumeration", ["./defined"], function(e) { "use strict"; var t = function(t, r, i) { if (this.value = t, this.name = r, e(i))
for (var n in i) i.hasOwnProperty(n) && (this[n] = i[n]) }; return t.prototype.valueOf = function() { return this.value }, t.prototype.toString = function() { return this.name }, t }), r("Core/Intersect", ["./Enumeration"], function(e) { "use strict"; var t = { OUTSIDE: new e(-1, "OUTSIDE"), INTERSECTING: new e(0, "INTERSECTING"), INSIDE: new e(1, "INSIDE") }; return t }), r("Core/AxisAlignedBoundingBox", ["./defaultValue", "./defined", "./DeveloperError", "./Cartesian3", "./Intersect"], function(e, t, r, i, n) { "use strict"; var o = function(r, n, o) { this.minimum = i.clone(e(r, i.ZERO)), this.maximum = i.clone(e(n, i.ZERO)), t(o) ? o = i.clone(o) : (o = i.add(this.minimum, this.maximum), i.multiplyByScalar(o, .5, o)), this.center = o };
o.fromPoints = function(e, r) { if (t(r) || (r = new o), !t(e) || 0 === e.length) return r.minimum = i.clone(i.ZERO, r.minimum), r.maximum = i.clone(i.ZERO, r.maximum), r.center = i.clone(i.ZERO, r.center), r; for (var n = e[0].x, a = e[0].y, s = e[0].z, l = e[0].x, u = e[0].y, c = e[0].z, h = e.length, d = 1; h > d; d++) { var m = e[d],
p = m.x,
f = m.y,
v = m.z;
n = Math.min(p, n), l = Math.max(p, l), a = Math.min(f, a), u = Math.max(f, u), s = Math.min(v, s), c = Math.max(v, c) } var y = r.minimum;
y.x = n, y.y = a, y.z = s; var g = r.maximum;
g.x = l, g.y = u, g.z = c; var _ = i.add(y, g, r.center); return i.multiplyByScalar(_, .5, _), r }, o.clone = function(e, r) { return t(e) ? t(r) ? (r.minimum = i.clone(e.minimum, r.minimum), r.maximum = i.clone(e.maximum, r.maximum), r.center = i.clone(e.center, r.center), r) : new o(e.minimum, e.maximum) : void 0 }, o.equals = function(e, r) { return e === r || t(e) && t(r) && i.equals(e.center, r.center) && i.equals(e.minimum, r.minimum) && i.equals(e.maximum, r.maximum) }; var a = new i; return o.intersect = function(e, o) { if (!t(e)) throw new r("box is required."); if (!t(o)) throw new r("plane is required.");
a = i.subtract(e.maximum, e.minimum, a); var s = i.multiplyByScalar(a, .5, a),
l = s.x * Math.abs(o.x) + s.y * Math.abs(o.y) + s.z * Math.abs(o.z),
u = i.dot(e.center, o) + o.w; return u - l > 0 ? n.INSIDE : 0 > u + l ? n.OUTSIDE : n.INTERSECTING }, o.prototype.clone = function(e) { return o.clone(this, e) }, o.prototype.intersect = function(e) { return o.intersect(this, e) }, o.prototype.equals = function(e) { return o.equals(this, e) }, o }), r("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 r; for (this.mti == this.N + 1 && this.init_genrand(5489), r = 0; r < this.N - this.M; r++) e = this.mt[r] & this.UPPER_MASK | this.mt[r + 1] & this.LOWER_MASK, this.mt[r] = this.mt[r + this.M] ^ e >>> 1 ^ t[1 & e]; for (; r < this.N - 1; r++) e = this.mt[r] & this.UPPER_MASK | this.mt[r + 1] & this.LOWER_MASK, this.mt[r] = this.mt[r + (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 ^= 2636928640 & e << 7, e ^= 4022730752 & e << 15, e ^= e >>> 18, e >>> 0 }, e.prototype.random = function() { return this.genrand_int32() * (1 / 4294967296) }, e }), r("Core/Math", ["./defaultValue", "./defined", "./DeveloperError", "../ThirdParty/mersenne-twister"], function(e, t, r, i) { "use strict"; var n = {};
n.EPSILON1 = .1, n.EPSILON2 = .01, n.EPSILON3 = .001, n.EPSILON4 = 1e-4, n.EPSILON5 = 1e-5, n.EPSILON6 = 1e-6, n.EPSILON7 = 1e-7, n.EPSILON8 = 1e-8, n.EPSILON9 = 1e-9, n.EPSILON10 = 1e-10, n.EPSILON11 = 1e-11, n.EPSILON12 = 1e-12, n.EPSILON13 = 1e-13, n.EPSILON14 = 1e-14, n.EPSILON15 = 1e-15, n.EPSILON16 = 1e-16, n.EPSILON17 = 1e-17, n.EPSILON18 = 1e-18, n.EPSILON19 = 1e-19, n.EPSILON20 = 1e-20, n.GRAVITATIONALPARAMETER = 3986004418e5, n.SOLAR_RADIUS = 6995e5, n.SIXTY_FOUR_KILOBYTES = 65536, n.sign = function(e) { return e > 0 ? 1 : 0 > e ? -1 : 0 }, n.sinh = function(e) { var t = Math.pow(Math.E, e),
r = Math.pow(Math.E, -1 * e); return .5 * (t - r) }, n.cosh = function(e) { var t = Math.pow(Math.E, e),
r = Math.pow(Math.E, -1 * e); return .5 * (t + r) }, n.lerp = function(e, t, r) { return (1 - r) * e + r * t }, n.PI = Math.PI, n.ONE_OVER_PI = 1 / Math.PI, n.PI_OVER_TWO = .5 * Math.PI, n.PI_OVER_THREE = Math.PI / 3, n.PI_OVER_FOUR = Math.PI / 4, n.PI_OVER_SIX = Math.PI / 6, n.THREE_PI_OVER_TWO = .5 * 3 * Math.PI, n.TWO_PI = 2 * Math.PI, n.ONE_OVER_TWO_PI = 1 / (2 * Math.PI), n.RADIANS_PER_DEGREE = Math.PI / 180, n.DEGREES_PER_RADIAN = 180 / Math.PI, n.RADIANS_PER_ARCSECOND = n.RADIANS_PER_DEGREE / 3600, n.toRadians = function(e) { return e * n.RADIANS_PER_DEGREE }, n.toDegrees = function(e) { return e * n.DEGREES_PER_RADIAN }, n.convertLongitudeRange = function(e) { var t = n.TWO_PI,
r = e - Math.floor(e / t) * t; return r < -Math.PI ? r + t : r >= Math.PI ? r - t : r }, n.negativePiToPi = function(e) { for (var t = n.EPSILON10, r = n.PI, i = n.TWO_PI; - (r + t) > e;) e += i; if (-r > e) return -r; for (; e > r + t;) e -= i; return e > r ? r : e }, n.zeroToTwoPi = function(e) { var t = e % n.TWO_PI; return 0 > t ? (t + n.TWO_PI) % n.TWO_PI : t }, n.equalsEpsilon = function(t, r, i) { return i = e(i, 0), Math.abs(t - r) <= i }; var o = [1];
n.factorial = function(e) { if ("number" != typeof e || 0 > e) throw new r("A number greater than or equal to 0 is required."); var t = o.length; if (e >= t)
for (var i = o[t - 1], n = t; e >= n; n++) o.push(i * n); return o[e] }, n.incrementWrap = function(t, i, n) { if (n = e(n, 0), n >= i) throw new r("Maximum value must be greater than minimum value."); return ++t, t > i && (t = n), t }, n.isPowerOfTwo = function(t) { if ("number" != typeof t || 0 > t) throw new r("A number greater than or equal to 0 is required."); var i = e(t, 0); return 0 !== i && 0 === (i & i - 1) }, n.clamp = function(e, t, r) { return t > e ? t : e > r ? r : e }; var a = new i; return n.setRandomNumberSeed = function(e) { if (!t(e)) throw new r("seed is required.");
a = new i(e) }, n.nextRandomNumber = function() { return a.random() }, n }), r("Core/Cartographic", ["./defaultValue", "./defined", "./DeveloperError", "./freezeObject", "./Math"], function(e, t, r, i, n) { "use strict"; var o = function(t, r, i) { this.longitude = e(t, 0), this.latitude = e(r, 0), this.height = e(i, 0) }; return o.fromDegrees = function(r, i, a, s) { return r = n.toRadians(e(r, 0)), i = n.toRadians(e(i, 0)), a = e(a, 0), t(s) ? (s.longitude = r, s.latitude = i, s.height = a, s) : new o(r, i, a) }, o.clone = function(e, r) { return t(e) ? t(r) ? (r.longitude = e.longitude, r.latitude = e.latitude, r.height = e.height, r) : new o(e.longitude, e.latitude, e.height) : void 0 }, o.equals = function(e, r) { return e === r || t(e) && t(r) && e.longitude === r.longitude && e.latitude === r.latitude && e.height === r.height }, o.equalsEpsilon = function(e, i, n) { if ("number" != typeof n) throw new r("epsilon is required and must be a number."); return e === i || t(e) && t(i) && Math.abs(e.longitude - i.longitude) <= n && Math.abs(e.latitude - i.latitude) <= n && Math.abs(e.height - i.height) <= n }, o.toString = function(e) { if (!t(e)) throw new r("cartographic is required"); return "(" + e.longitude + ", " + e.latitude + ", " + e.height + ")" }, o.ZERO = i(new o(0, 0, 0)), o.prototype.clone = function(e) { return o.clone(this, e) }, o.prototype.equals = function(e) { return o.equals(this, e) }, o.prototype.equalsEpsilon = function(e, t) { return o.equalsEpsilon(this, e, t) }, o.prototype.toString = function() { return o.toString(this) }, o }), r("Core/Ellipsoid", ["./freezeObject", "./defaultValue", "./defined", "./DeveloperError", "./Math", "./Cartesian3", "./Cartographic"], function(e, t, r, i, n, o, a) { "use strict"; var s = function(e, r, a) { if (e = t(e, 0), r = t(r, 0), a = t(a, 0), 0 > e || 0 > r || 0 > a) throw new i("All radii components must be greater than or equal to zero.");
this._radii = new o(e, r, a), this._radiiSquared = new o(e * e, r * r, a * a), this._radiiToTheFourth = new o(e * e * e * e, r * r * r * r, a * a * a * a), this._oneOverRadii = new o(0 === e ? 0 : 1 / e, 0 === r ? 0 : 1 / r, 0 === a ? 0 : 1 / a), this._oneOverRadiiSquared = new o(0 === e ? 0 : 1 / (e * e), 0 === r ? 0 : 1 / (r * r), 0 === a ? 0 : 1 / (a * a)), this._minimumRadius = Math.min(e, r, a), this._maximumRadius = Math.max(e, r, a), this._centerToleranceSquared = n.EPSILON1 };
s.clone = function(e, t) { if (!r(e)) return void 0; var i = e._radii; return r(t) ? (o.clone(i, t._radii), o.clone(e._radiiSquared, t._radiiSquared), o.clone(e._radiiToTheFourth, t._radiiToTheFourth), o.clone(e._oneOverRadii, t._oneOverRadii), o.clone(e._oneOverRadiiSquared, t._oneOverRadiiSquared), t._minimumRadius = e._minimumRadius, t._maximumRadius = e._maximumRadius, t._centerToleranceSquared = e._centerToleranceSquared, t) : new s(i.x, i.y, i.z) }, s.fromCartesian3 = function(e) { return r(e) ? new s(e.x, e.y, e.z) : new s }, s.WGS84 = e(new s(6378137, 6378137, 6356752.314245179)), s.UNIT_SPHERE = e(new s(1, 1, 1)), s.prototype.getRadii = function() { return this._radii }, s.prototype.getRadiiSquared = function() { return this._radiiSquared }, s.prototype.getRadiiToTheFourth = function() { return this._radiiToTheFourth }, s.prototype.getOneOverRadii = function() { return this._oneOverRadii }, s.prototype.getOneOverRadiiSquared = function() { return this._oneOverRadiiSquared }, s.prototype.getMinimumRadius = function() { return this._minimumRadius }, s.prototype.getMaximumRadius = function() { return this._maximumRadius }, s.prototype.clone = function(e) { return s.clone(this, e) }, s.prototype.geocentricSurfaceNormal = o.normalize, s.prototype.geodeticSurfaceNormalCartographic = function(e, t) { if (!r(e)) throw new i("cartographic is required."); var n = e.longitude,
a = e.latitude,
s = Math.cos(a),
l = s * Math.cos(n),
u = s * Math.sin(n),
c = Math.sin(a); return r(t) || (t = new o), t.x = l, t.y = u, t.z = c, o.normalize(t, t) }, s.prototype.geodeticSurfaceNormal = function(e, t) { return t = o.multiplyComponents(e, this._oneOverRadiiSquared, t), o.normalize(t, t) }; var l = new o,
u = new o;
s.prototype.cartographicToCartesian = function(e, t) { var r = l,
i = u;
this.geodeticSurfaceNormalCartographic(e, r), o.multiplyComponents(this._radiiSquared, r, i); var n = Math.sqrt(o.dot(r, i)); return o.divideByScalar(i, n, i), o.multiplyByScalar(r, e.height, r), o.add(i, r, t) }, s.prototype.cartographicArrayToCartesianArray = function(e, t) { if (!r(e)) throw new i("cartographics is required."); var n = e.length;
r(t) ? t.length = n : t = new Array(n); for (var o = 0; n > o; o++) t[o] = this.cartographicToCartesian(e[o], t[o]); return t }; var c = new o,
h = new o,
d = new o;
s.prototype.cartesianToCartographic = function(e, t) { var i = this.scaleToGeodeticSurface(e, h); if (!r(i)) return void 0; var s = this.geodeticSurfaceNormal(i, c),
l = o.subtract(e, i, d),
u = Math.atan2(s.y, s.x),
m = Math.asin(s.z),
p = n.sign(o.dot(l, e)) * o.magnitude(l); return r(t) ? (t.longitude = u, t.latitude = m, t.height = p, t) : new a(u, m, p) }, s.prototype.cartesianArrayToCartographicArray = function(e, t) { if (!r(e)) throw new i("cartesians is required."); var n = e.length;
r(t) ? t.length = n : t = new Array(n); for (var o = 0; n > o; ++o) t[o] = this.cartesianToCartographic(e[o], t[o]); return t }; var m, p = new o; return s.prototype.scaleToGeodeticSurface = function(e, t) { if (!r(e)) throw new i("cartesian is required."); var a = e.x,
s = e.y,
l = e.z,
u = this._oneOverRadii,
c = u.x,
h = u.y,
d = u.z,
f = a * a * c * c,
v = s * s * h * h,
y = l * l * d * d,
g = f + v + y,
_ = Math.sqrt(1 / g),
w = o.multiplyByScalar(e, _, m); if (g < this._centerToleranceSquared) return isFinite(_) ? o.clone(w, t) : void 0; var C = this._oneOverRadiiSquared,
x = C.x,
S = C.y,
E = C.z,
b = p;
b.x = 2 * w.x * x, b.y = 2 * w.y * S, b.z = 2 * w.z * E; var T, A, M, P, D, I, O, R, L, z, N, F = (1 - _) * o.magnitude(e) / (.5 * o.magnitude(b)),
B = 0;
do { F -= B, M = 1 / (1 + F * x), P = 1 / (1 + F * S), D = 1 / (1 + F * E), I = M * M, O = P * P, R = D * D, L = I * M, z = O * P, N = R * D, T = f * I + v * O + y * R - 1, A = f * L * x + v * z * S + y * N * E; var V = -2 * A;
B = T / V } while (Math.abs(T) > n.EPSILON12); return r(t) ? (t.x = a * M, t.y = s * P, t.z = l * D, t) : new o(a * M, s * P, l * D) }, s.prototype.scaleToGeocentricSurface = function(e, t) { if (!r(e)) throw new i("cartesian is required."); var n = e.x,
a = e.y,
s = e.z,
l = this._oneOverRadiiSquared,
u = 1 / Math.sqrt(n * n * l.x + a * a * l.y + s * s * l.z); return o.multiplyByScalar(e, u, t) }, s.prototype.transformPositionToScaledSpace = function(e, t) { return o.multiplyComponents(e, this._oneOverRadii, t) }, s.prototype.equals = function(e) { return this === e || r(e) && o.equals(this._radii, e._radii) }, s.prototype.toString = function() { return this._radii.toString() }, s }), r("Core/GeographicProjection", ["./defaultValue", "./defined", "./Cartesian3", "./Cartographic", "./Ellipsoid"], function(e, t, r, i, n) { "use strict"; var o = function(t) { this._ellipsoid = e(t, n.WGS84), this._semimajorAxis = this._ellipsoid.getMaximumRadius(), this._oneOverSemimajorAxis = 1 / this._semimajorAxis }; return o.prototype.getEllipsoid = function() { return this._ellipsoid }, o.prototype.project = function(e, i) { var n = this._semimajorAxis,
o = e.longitude * n,
a = e.latitude * n,
s = e.height; return t(i) ? (i.x = o, i.y = a, i.z = s, i) : new r(o, a, s) }, o.prototype.unproject = function(e, r) { var n = this._oneOverSemimajorAxis,
o = e.x * n,
a = e.y * n,
s = e.z; return t(r) ? (r.longitude = o, r.latitude = a, r.height = s, r) : new i(o, a, s) }, o }), r("Core/BoundingRectangle", ["./defaultValue", "./defined", "./DeveloperError", "./Cartographic", "./GeographicProjection", "./Intersect"], function(e, t, r, i, n, o) { "use strict"; var a = function(t, r, i, n) { this.x = e(t, 0), this.y = e(r, 0), this.width = e(i, 0), this.height = e(n, 0) };
a.fromPoints = function(e, r) { if (t(r) || (r = new a), !t(e) || 0 === e.length) return r.x = 0, r.y = 0, r.width = 0, r.height = 0, r; for (var i = e.length, n = e[0].x, o = e[0].y, s = e[0].x, l = e[0].y, u = 1; i > u; u++) { var c = e[u],
h = c.x,
d = c.y;
n = Math.min(h, n), s = Math.max(h, s), o = Math.min(d, o), l = Math.max(d, l) } return r.x = n, r.y = o, r.width = s - n, r.height = l - o, r }; var s = new n,
l = new i,
u = new i; return a.fromExtent = function(r, i, n) { if (t(n) || (n = new a), !t(r)) return n.x = 0, n.y = 0, n.width = 0, n.height = 0, n;
i = e(i, s); var o = i.project(r.getSouthwest(l)),
c = i.project(r.getNortheast(u)); return c.subtract(o, c), n.x = o.x, n.y = o.y, n.width = c.x, n.height = c.y, n }, a.clone = function(e, r) { return t(e) ? t(r) ? (r.x = e.x, r.y = e.y, r.width = e.width, r.height = e.height, r) : new a(e.x, e.y, e.width, e.height) : void 0 }, a.union = function(e, i, n) { if (!t(e)) throw new r("left is required."); if (!t(i)) throw new r("right is required.");
t(n) || (n = new a); var o = Math.min(e.x, i.x),
s = Math.min(e.y, i.y),
l = Math.max(e.x + e.width, i.x + i.width),
u = Math.max(e.y + e.height, i.y + i.height); return n.x = o, n.y = s, n.width = l - o, n.height = u - s, n }, a.expand = function(e, i, n) { if (!t(e)) throw new r("rectangle is required."); if (!t(i)) throw new r("point is required.");
n = a.clone(e, n); var o = i.x - n.x,
s = i.y - n.y; return o > n.width ? n.width = o : 0 > o && (n.width -= o, n.x = i.x), s > n.height ? n.height = s : 0 > s && (n.height -= s, n.y = i.y), n }, a.intersect = function(e, i) { if (!t(e)) throw new r("left is required."); if (!t(i)) throw new r("right is required."); var n = e.x,
a = e.y,
s = i.x,
l = i.y; return n > s + i.width || n + e.width < s || a + e.height < l || a > l + i.height ? o.OUTSIDE : o.INTERSECTING }, a.equals = function(e, r) { return e === r || t(e) && t(r) && e.x === r.x && e.y === r.y && e.width === r.width && e.height === r.height }, a.prototype.clone = function(e) { return a.clone(this, e) }, a.prototype.union = function(e, t) { return a.union(this, e, t) }, a.prototype.expand = function(e, t) { return a.expand(this, e, t) }, a.prototype.intersect = function(e) { return a.intersect(this, e) }, a.prototype.equals = function(e) { return a.equals(this, e) }, a }), r("Core/Cartesian4", ["./defaultValue", "./defined", "./DeveloperError", "./freezeObject"], function(e, t, r, i) { "use strict"; var n = function(t, r, i, n) { this.x = e(t, 0), this.y = e(r, 0), this.z = e(i, 0), this.w = e(n, 0) };
n.fromArray = function(i, o, a) { if (!t(i)) throw new r("values is required."); if (o + 4 > i.length) throw new r("offset + 4 is greater than the length of the array."); return o = e(o, 0), t(a) || (a = new n), a.x = i[o + 0], a.y = i[o + 1], a.z = i[o + 2], a.w = i[o + 3], a }, n.fromElements = function(e, r, i, o, a) { return t(a) ? (a.x = e, a.y = r, a.z = i, a.w = o, a) : new n(e, r, i, o) }, n.clone = function(e, r) { return t(e) ? t(r) ? (r.x = e.x, r.y = e.y, r.z = e.z, r.w = e.w, r) : new n(e.x, e.y, e.z, e.w) : void 0 }, n.packedLength = 4, n.pack = function(i, n, o) { if (!t(i)) throw new r("value is required"); if (!t(n)) throw new r("array is required");
o = e(o, 0), n[o++] = i.x, n[o++] = i.y, n[o++] = i.z, n[o] = i.w }, n.unpack = function(i, o, a) { if (!t(i)) throw new r("array is required"); return o = e(o, 0), t(a) || (a = new n), a.x = i[o++], a.y = i[o++], a.z = i[o++], a.w = i[o], a }, n.getMaximumComponent = function(e) { if (!t(e)) throw new r("cartesian is required"); return Math.max(e.x, e.y, e.z, e.w) }, n.getMinimumComponent = function(e) { if (!t(e)) throw new r("cartesian is required"); return Math.min(e.x, e.y, e.z, e.w) }, n.magnitudeSquared = function(e) { if (!t(e)) throw new r("cartesian is required"); return e.x * e.x + e.y * e.y + e.z * e.z + e.w * e.w }, n.magnitude = function(e) { return Math.sqrt(n.magnitudeSquared(e)) }; var o = new n;
n.distance = function(e, i) { if (!t(e) || !t(i)) throw new r("left and right are required."); return n.subtract(e, i, o), n.magnitude(o) }, n.normalize = function(e, i) { if (!t(e)) throw new r("cartesian is required"); var o = n.magnitude(e); return t(i) ? (i.x = e.x / o, i.y = e.y / o, i.z = e.z / o, i.w = e.w / o, i) : new n(e.x / o, e.y / o, e.z / o, e.w / o) }, n.dot = function(e, i) { if (!t(e)) throw new r("left is required"); if (!t(i)) throw new r("right is required"); return e.x * i.x + e.y * i.y + e.z * i.z + e.w * i.w }, n.multiplyComponents = function(e, i, o) { if (!t(e)) throw new r("left is required"); if (!t(i)) throw new r("right is required"); return t(o) ? (o.x = e.x * i.x, o.y = e.y * i.y, o.z = e.z * i.z, o.w = e.w * i.w, o) : new n(e.x * i.x, e.y * i.y, e.z * i.z, e.w * i.w) }, n.add = function(e, i, o) { if (!t(e)) throw new r("left is required"); if (!t(i)) throw new r("right is required"); return t(o) ? (o.x = e.x + i.x, o.y = e.y + i.y, o.z = e.z + i.z, o.w = e.w + i.w, o) : new n(e.x + i.x, e.y + i.y, e.z + i.z, e.w + i.w) }, n.subtract = function(e, i, o) { if (!t(e)) throw new r("left is required"); if (!t(i)) throw new r("right is required"); return t(o) ? (o.x = e.x - i.x, o.y = e.y - i.y, o.z = e.z - i.z, o.w = e.w - i.w, o) : new n(e.x - i.x, e.y - i.y, e.z - i.z, e.w - i.w) }, n.multiplyByScalar = function(e, i, o) { if (!t(e)) throw new r("cartesian is required"); if ("number" != typeof i) throw new r("scalar is required and must be a number."); return t(o) ? (o.x = e.x * i, o.y = e.y * i, o.z = e.z * i, o.w = e.w * i, o) : new n(e.x * i, e.y * i, e.z * i, e.w * i) }, n.divideByScalar = function(e, i, o) { if (!t(e)) throw new r("cartesian is required"); if ("number" != typeof i) throw new r("scalar is required and must be a number."); return t(o) ? (o.x = e.x / i, o.y = e.y / i, o.z = e.z / i, o.w = e.w / i, o) : new n(e.x / i, e.y / i, e.z / i, e.w / i) }, n.negate = function(e, i) { if (!t(e)) throw new r("cartesian is required"); return t(i) ? (i.x = -e.x, i.y = -e.y, i.z = -e.z, i.w = -e.w, i) : new n(-e.x, -e.y, -e.z, -e.w) }, n.abs = function(e, i) { if (!t(e)) throw new r("cartesian is required"); return t(i) ? (i.x = Math.abs(e.x), i.y = Math.abs(e.y), i.z = Math.abs(e.z), i.w = Math.abs(e.w), i) : new n(Math.abs(e.x), Math.abs(e.y), Math.abs(e.z), Math.abs(e.w)) }; var a = new n;
n.lerp = function(e, i, o, s) { if (!t(e)) throw new r("start is required."); if (!t(i)) throw new r("end is required."); if ("number" != typeof o) throw new r("t is required and must be a number."); return n.multiplyByScalar(i, o, a), s = n.multiplyByScalar(e, 1 - o, s), n.add(a, s, s) }; var s = new n; return n.mostOrthogonalAxis = function(e, i) { if (!t(e)) throw new r("cartesian is required."); var o = n.normalize(e, s); return n.abs(o, o), i = o.x <= o.y ? o.x <= o.z ? o.x <= o.w ? n.clone(n.UNIT_X, i) : n.clone(n.UNIT_W, i) : o.z <= o.w ? n.clone(n.UNIT_Z, i) : n.clone(n.UNIT_W, i) : o.y <= o.z ? o.y <= o.w ? n.clone(n.UNIT_Y, i) : n.clone(n.UNIT_W, i) : o.z <= o.w ? n.clone(n.UNIT_Z, i) : n.clone(n.UNIT_W, i) }, n.equals = function(e, r) { return e === r || t(e) && t(r) && e.x === r.x && e.y === r.y && e.z === r.z && e.w === r.w }, n.equalsEpsilon = function(e, i, n) { if ("number" != typeof n) throw new r("epsilon is required and must be a number."); return e === i || t(e) && t(i) && Math.abs(e.x - i.x) <= n && Math.abs(e.y - i.y) <= n && Math.abs(e.z - i.z) <= n && Math.abs(e.w - i.w) <= n }, n.ZERO = i(new n(0, 0, 0, 0)), n.UNIT_X = i(new n(1, 0, 0, 0)), n.UNIT_Y = i(new n(0, 1, 0, 0)), n.UNIT_Z = i(new n(0, 0, 1, 0)), n.UNIT_W = i(new n(0, 0, 0, 1)), n.prototype.getMaximumComponent = function() { return n.getMaximumComponent(this) }, n.prototype.getMinimumComponent = function() { return n.getMinimumComponent(this) }, n.prototype.clone = function(e) { return n.clone(this, e) }, n.prototype.magnitudeSquared = function() { return n.magnitudeSquared(this) }, n.prototype.magnitude = function() { return n.magnitude(this) }, n.prototype.normalize = function(e) { return n.normalize(this, e) }, n.prototype.dot = function(e) { return n.dot(this, e) }, n.prototype.multiplyComponents = function(e, t) { return n.multiplyComponents(this, e, t) }, n.prototype.add = function(e, t) { return n.add(this, e, t) }, n.prototype.subtract = function(e, t) { return n.subtract(this, e, t) }, n.prototype.multiplyByScalar = function(e, t) { return n.multiplyByScalar(this, e, t) }, n.prototype.divideByScalar = function(e, t) { return n.divideByScalar(this, e, t) }, n.prototype.negate = function(e) { return n.negate(this, e) }, n.prototype.abs = function(e) { return n.abs(this, e) }, n.prototype.lerp = function(e, t, r) { return n.lerp(this, e, t, r) }, n.prototype.mostOrthogonalAxis = function(e) { return n.mostOrthogonalAxis(this, e) }, n.prototype.equals = function(e) { return n.equals(this, e) }, n.prototype.equalsEpsilon = function(e, t) { return n.equalsEpsilon(this, e, t) }, n.prototype.toString = function() { return "(" + this.x + ", " + this.y + ", " + this.z + ", " + this.w + ")" }, n }), r("Core/Interval", ["./defaultValue"], function(e) { "use strict"; var t = function(t, r) { this.start = e(t, 0), this.stop = e(r, 0) }; return t }), r("Core/Matrix3", ["./Cartesian3", "./defaultValue", "./defined", "./DeveloperError", "./freezeObject"], function(e, t, r, i, n) {
"use strict";
var o = function(e, r, i, n, o, a, s, l, u) { this[0] = t(e, 0), this[1] = t(n, 0), this[2] = t(s, 0), this[3] = t(r, 0), this[4] = t(o, 0), this[5] = t(l, 0), this[6] = t(i, 0), this[7] = t(a, 0), this[8] = t(u, 0) };
return o.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 o(e[0], e[3], e[6], e[1], e[4], e[7], e[2], e[5], e[8]) : void 0 }, o.fromColumnMajorArray = function(e, t) { if (!r(e)) throw new i("values parameter is required"); return o.clone(e, t) }, o.fromRowMajorArray = function(e, t) { if (!r(e)) throw new i("values is required."); return r(t) ? (t[0] = e[0], t[1] = e[3], t[2] = e[6], t[3] = e[1], t[4] = e[4], t[5] = e[7], t[6] = e[2], t[7] = e[5], t[8] = e[8], t) : new o(e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]) }, o.fromQuaternion = function(e, t) { if (!r(e)) throw new i("quaternion is required"); var n = e.x * e.x,
a = e.x * e.y,
s = e.x * e.z,
l = e.x * e.w,
u = e.y * e.y,
c = e.y * e.z,
h = e.y * e.w,
d = e.z * e.z,
m = e.z * e.w,
p = e.w * e.w,
f = n - u - d + p,
v = 2 * (a + m),
y = 2 * (s - h),
g = 2 * (a - m),
_ = -n + u - d + p,
w = 2 * (c + l),
C = 2 * (s + h),
x = 2 * (c - l),
S = -n - u + d + p; return r(t) ? (t[0] = f, t[1] = g, t[2] = C, t[3] = v, t[4] = _, t[5] = x, t[6] = y, t[7] = w, t[8] = S, t) : new o(f, v, y, g, _, w, C, x, S) }, o.fromScale = function(e, t) { if (!r(e)) throw new i("scale is required."); return r(t) ? (t[0] = e.x, t[1] = 0, t[2] = 0, t[3] = 0, t[4] = e.y, t[5] = 0, t[6] = 0, t[7] = 0, t[8] = e.z, t) : new o(e.x, 0, 0, 0, e.y, 0, 0, 0, e.z) }, o.fromUniformScale = function(e, t) { if ("number" != typeof e) throw new i("scale is required."); return r(t) ? (t[0] = e, t[1] = 0, t[2] = 0, t[3] = 0, t[4] = e, t[5] = 0, t[6] = 0, t[7] = 0, t[8] = e, t) : new o(e, 0, 0, 0, e, 0, 0, 0, e) }, o.fromRotationX = function(e, t) { if (!r(e)) throw new i("angle is required."); var n = Math.cos(e),
a = Math.sin(e); return r(t) ? (t[0] = 1, t[1] = 0, t[2] = 0, t[3] = 0, t[4] = n, t[5] = a, t[6] = 0, t[7] = -a, t[8] = n, t) : new o(1, 0, 0, 0, n, -a, 0, a, n) }, o.fromRotationY = function(e, t) { if (!r(e)) throw new i("angle is required."); var n = Math.cos(e),
a = Math.sin(e); return r(t) ? (t[0] = n, t[1] = 0, t[2] = -a, t[3] = 0, t[4] = 1, t[5] = 0, t[6] = a, t[7] = 0, t[8] = n, t) : new o(n, 0, a, 0, 1, 0, -a, 0, n) }, o.fromRotationZ = function(e, t) { if (!r(e)) throw new i("angle is required."); var n = Math.cos(e),
a = Math.sin(e); return r(t) ? (t[0] = n, t[1] = a, t[2] = 0, t[3] = -a, t[4] = n, t[5] = 0, t[6] = 0, t[7] = 0, t[8] = 1, t) : new o(n, -a, 0, a, n, 0, 0, 0, 1) }, o.toArray = function(e, t) { if (!r(e)) throw new i("matrix is required"); return r(t) ? (t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3], t[4] = e[4], t[5] = e[5], t[6] = e[6], t[7] = e[7], t[8] = e[8], t) : [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8]] }, o.getElementIndex = function(e, t) {
if ("number" != typeof t || 0 > t || t > 2) throw new i("row is required and must be 0, 1, or 2.");
if ("number" != typeof e || 0 > e || e > 2) throw new i("column is required and must be 0, 1, or 2.");
return 3 * e + t
}, o.getColumn = function(t, n, o) { if (!r(t)) throw new i("matrix is required."); if ("number" != typeof n || 0 > n || n > 2) throw new i("index is required and must be 0, 1, or 2."); var a = 3 * n,
s = t[a],
l = t[a + 1],
u = t[a + 2]; return r(o) ? (o.x = s, o.y = l, o.z = u, o) : new e(s, l, u) }, o.setColumn = function(e, t, n, a) { if (!r(e)) throw new i("matrix is required"); if (!r(n)) throw new i("cartesian is required"); if ("number" != typeof t || 0 > t || t > 2) throw new i("index is required and must be 0, 1, or 2.");
a = o.clone(e, a); var s = 3 * t; return a[s] = n.x, a[s + 1] = n.y, a[s + 2] = n.z, a }, o.getRow = function(t, n, o) { if (!r(t)) throw new i("matrix is required."); if ("number" != typeof n || 0 > n || n > 2) throw new i("index is required and must be 0, 1, or 2."); var a = t[n],
s = t[n + 3],
l = t[n + 6]; return r(o) ? (o.x = a, o.y = s, o.z = l, o) : new e(a, s, l) }, o.setRow = function(e, t, n, a) { if (!r(e)) throw new i("matrix is required"); if (!r(n)) throw new i("cartesian is required"); if ("number" != typeof t || 0 > t || t > 2) throw new i("index is required and must be 0, 1, or 2."); return a = o.clone(e, a), a[t] = n.x, a[t + 3] = n.y, a[t + 6] = n.z, a }, o.multiply = function(e, t, n) { if (!r(e)) throw new i("left is required"); if (!r(t)) throw new i("right is required"); var a = e[0] * t[0] + e[3] * t[1] + e[6] * t[2],
s = e[1] * t[0] + e[4] * t[1] + e[7] * t[2],
l = e[2] * t[0] + e[5] * t[1] + e[8] * t[2],
u = e[0] * t[3] + e[3] * t[4] + e[6] * t[5],
c = e[1] * t[3] + e[4] * t[4] + e[7] * t[5],
h = e[2] * t[3] + e[5] * t[4] + e[8] * t[5],
d = e[0] * t[6] + e[3] * t[7] + e[6] * t[8],
m = e[1] * t[6] + e[4] * t[7] + e[7] * t[8],
p = e[2] * t[6] + e[5] * t[7] + e[8] * t[8]; return r(n) ? (n[0] = a, n[1] = s, n[2] = l, n[3] = u, n[4] = c, n[5] = h, n[6] = d, n[7] = m, n[8] = p, n) : new o(a, u, d, s, c, m, l, h, p) }, o.multiplyByVector = function(t, n, o) { if (!r(t)) throw new i("matrix is required"); if (!r(n)) throw new i("cartesian is required"); var a = n.x,
s = n.y,
l = n.z,
u = t[0] * a + t[3] * s + t[6] * l,
c = t[1] * a + t[4] * s + t[7] * l,
h = t[2] * a + t[5] * s + t[8] * l; return r(o) ? (o.x = u, o.y = c, o.z = h, o) : new e(u, c, h) }, o.multiplyByScalar = function(e, t, n) { if (!r(e)) throw new i("matrix is required"); if ("number" != typeof t) throw new i("scalar is required and must be a number"); return r(n) ? (n[0] = e[0] * t, n[1] = e[1] * t, n[2] = e[2] * t, n[3] = e[3] * t, n[4] = e[4] * t, n[5] = e[5] * t, n[6] = e[6] * t, n[7] = e[7] * t, n[8] = e[8] * t, n) : new o(e[0] * t, e[3] * t, e[6] * t, e[1] * t, e[4] * t, e[7] * t, e[2] * t, e[5] * t, e[8] * t) }, o.negate = function(e, t) { if (!r(e)) throw new i("matrix is required"); return r(t) ? (t[0] = -e[0], t[1] = -e[1], t[2] = -e[2], t[3] = -e[3], t[4] = -e[4], t[5] = -e[5], t[6] = -e[6], t[7] = -e[7], t[8] = -e[8], t) : new o(-e[0], -e[3], -e[6], -e[1], -e[4], -e[7], -e[2], -e[5], -e[8]) }, o.transpose = function(e, t) { if (!r(e)) throw new i("matrix is required"); var n = e[0],
a = e[3],
s = e[6],
l = e[1],
u = e[4],
c = e[7],
h = e[2],
d = e[5],
m = e[8]; return r(t) ? (t[0] = n, t[1] = a, t[2] = s, t[3] = l, t[4] = u, t[5] = c, t[6] = h, t[7] = d, t[8] = m, t) : new o(n, l, h, a, u, d, s, c, m) }, o.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] }, o.equalsEpsilon = function(e, t, n) { if ("number" != typeof n) throw new i("epsilon is required and must be a number"); return e === t || r(e) && r(t) && Math.abs(e[0] - t[0]) <= n && Math.abs(e[1] - t[1]) <= n && Math.abs(e[2] - t[2]) <= n && Math.abs(e[3] - t[3]) <= n && Math.abs(e[4] - t[4]) <= n && Math.abs(e[5] - t[5]) <= n && Math.abs(e[6] - t[6]) <= n && Math.abs(e[7] - t[7]) <= n && Math.abs(e[8] - t[8]) <= n }, o.IDENTITY = n(new o(1, 0, 0, 0, 1, 0, 0, 0, 1)), o.COLUMN0ROW0 = 0, o.COLUMN0ROW1 = 1, o.COLUMN0ROW2 = 2, o.COLUMN1ROW0 = 3, o.COLUMN1ROW1 = 4, o.COLUMN1ROW2 = 5, o.COLUMN2ROW0 = 6, o.COLUMN2ROW1 = 7, o.COLUMN2ROW2 = 8, o.prototype.clone = function(e) { return o.clone(this, e) }, o.prototype.toArray = function(e) { return o.toArray(this, e) }, o.prototype.getColumn = function(e, t) { return o.getColumn(this, e, t) }, o.prototype.setColumn = function(e, t, r) { return o.setColumn(this, e, t, r) }, o.prototype.getRow = function(e, t) { return o.getRow(this, e, t) }, o.prototype.setRow = function(e, t, r) { return o.setRow(this, e, t, r) }, o.prototype.multiply = function(e, t) { return o.multiply(this, e, t) }, o.prototype.multiplyByVector = function(e, t) { return o.multiplyByVector(this, e, t) }, o.prototype.multiplyByScalar = function(e, t) { return o.multiplyByScalar(this, e, t) }, o.prototype.negate = function(e) { return o.negate(this, e) }, o.prototype.transpose = function(e) { return o.transpose(this, e) }, o.prototype.equals = function(e) { return o.equals(this, e) }, o.prototype.equalsEpsilon = function(e, t) { return o.equalsEpsilon(this, e, t) }, o.prototype.toString = function() { return "(" + this[0] + ", " + this[3] + ", " + this[6] + ")\n" + "(" + this[1] + ", " + this[4] + ", " + this[7] + ")\n" + "(" + this[2] + ", " + this[5] + ", " + this[8] + ")" }, o
}), r("Core/RuntimeError", ["./defined"], function(e) { "use strict"; var t = function(e) { this.name = "RuntimeError", this.message = e; var t = new Error;
this.stack = t.stack }; return t.prototype.toString = function() { var t = this.name + ": " + this.message; return e(this.stack) && (t += "\n" + this.stack.toString()), t }, t }), r("Core/Matrix4", ["./Cartesian3", "./Cartesian4", "./defaultValue", "./defined", "./DeveloperError", "./freezeObject", "./Math", "./Matrix3", "./RuntimeError"], function(e, t, r, i, n, o, a, s, l) { "use strict"; var u = function(e, t, i, n, o, a, s, l, u, c, h, d, m, p, f, v) { this[0] = r(e, 0), this[1] = r(o, 0), this[2] = r(u, 0), this[3] = r(m, 0), this[4] = r(t, 0), this[5] = r(a, 0), this[6] = r(c, 0), this[7] = r(p, 0), this[8] = r(i, 0), this[9] = r(s, 0), this[10] = r(h, 0), this[11] = r(f, 0), this[12] = r(n, 0), this[13] = r(l, 0), this[14] = r(d, 0), this[15] = r(v, 0) };
u.clone = function(e, t) { return i(e) ? i(t) ? (t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3], t[4] = e[4], t[5] = e[5], t[6] = e[6], t[7] = e[7], t[8] = e[8], t[9] = e[9], t[10] = e[10], t[11] = e[11], t[12] = e[12], t[13] = e[13], t[14] = e[14], t[15] = e[15], t) : new u(e[0], e[4], e[8], e[12], e[1], e[5], e[9], e[13], e[2], e[6], e[10], e[14], e[3], e[7], e[11], e[15]) : void 0 }, u.fromColumnMajorArray = function(e, t) { if (!i(e)) throw new n("values parameter is required"); return u.clone(e, t) }, u.fromRowMajorArray = function(e, t) { if (!i(e)) throw new n("values is required."); return i(t) ? (t[0] = e[0], t[1] = e[4], t[2] = e[8], t[3] = e[12], t[4] = e[1], t[5] = e[5], t[6] = e[9], t[7] = e[13], t[8] = e[2], t[9] = e[6], t[10] = e[10], t[11] = e[14], t[12] = e[3], t[13] = e[7], t[14] = e[11], t[15] = e[15], t) : new u(e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8], e[9], e[10], e[11], e[12], e[13], e[14], e[15]) }, u.fromRotationTranslation = function(e, t, r) { if (!i(e)) throw new n("rotation is required."); if (!i(t)) throw new n("translation is required."); return i(r) ? (r[0] = e[0], r[1] = e[1], r[2] = e[2], r[3] = 0, r[4] = e[3], r[5] = e[4], r[6] = e[5], r[7] = 0, r[8] = e[6], r[9] = e[7], r[10] = e[8], r[11] = 0, r[12] = t.x, r[13] = t.y, r[14] = t.z, r[15] = 1, r) : new u(e[0], e[3], e[6], t.x, e[1], e[4], e[7], t.y, e[2], e[5], e[8], t.z, 0, 0, 0, 1) }, u.fromTranslation = function(e, t) { return u.fromRotationTranslation(s.IDENTITY, e, t) }, u.fromScale = function(e, t) { if (!i(e)) throw new n("scale is required."); return i(t) ? (t[0] = e.x, t[1] = 0, t[2] = 0, t[3] = 0, t[4] = 0, t[5] = e.y, t[6] = 0, t[7] = 0, t[8] = 0, t[9] = 0, t[10] = e.z, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, t) : new u(e.x, 0, 0, 0, 0, e.y, 0, 0, 0, 0, e.z, 0, 0, 0, 0, 1) }, u.fromUniformScale = function(e, t) { if ("number" != typeof e) throw new n("scale is required."); return i(t) ? (t[0] = e, t[1] = 0, t[2] = 0, t[3] = 0, t[4] = 0, t[5] = e, t[6] = 0, t[7] = 0, t[8] = 0, t[9] = 0, t[10] = e, t[11] = 0, t[12] = 0, t[13] = 0, t[14] = 0, t[15] = 1, t) : new u(e, 0, 0, 0, 0, e, 0, 0, 0, 0, e, 0, 0, 0, 0, 1) }; var c = new e,
h = new e,
d = new e;
u.fromCamera = function(t, r) { if (!i(t)) throw new n("camera is required."); var o = t.eye,
a = t.target,
s = t.up; if (!i(o)) throw new n("camera.eye is required."); if (!i(a)) throw new n("camera.target is required."); if (!i(s)) throw new n("camera.up is required.");
e.subtract(a, o, c).normalize(c), e.cross(c, s, h).normalize(h), e.cross(h, c, d).normalize(d); var l = h.x,
m = h.y,
p = h.z,
f = c.x,
v = c.y,
y = c.z,
g = d.x,
_ = d.y,
w = d.z,
C = o.x,
x = o.y,
S = o.z,
E = l * -C + m * -x + p * -S,
b = g * -C + _ * -x + w * -S,
T = f * C + v * x + y * S; return i(r) ? (r[0] = l, r[1] = g, r[2] = -f, r[3] = 0, r[4] = m, r[5] = _, r[6] = -v, r[7] = 0, r[8] = p, r[9] = w, r[10] = -y, r[11] = 0, r[12] = E, r[13] = b, r[14] = T, r[15] = 1, r) : new u(l, m, p, E, g, _, w, b, -f, -v, -y, T, 0, 0, 0, 1) }, u.computePerspectiveFieldOfView = function(e, t, r, o, a) { if (0 >= e || e > Math.PI) throw new n("fovY must be in [0, PI)."); if (0 >= t) throw new n("aspectRatio must be greater than zero."); if (0 >= r) throw new n("near must be greater than zero."); if (0 >= o) throw new n("far must be greater than zero."); var s = Math.tan(.5 * e),
l = 1 / s,
c = l / t,
h = (o + r) / (r - o),
d = 2 * o * r / (r - o); return i(a) ? (a[0] = c, a[1] = 0, a[2] = 0, a[3] = 0, a[4] = 0, a[5] = l, a[6] = 0, a[7] = 0, a[8] = 0, a[9] = 0, a[10] = h, a[11] = -1, a[12] = 0, a[13] = 0, a[14] = d, a[15] = 0, a) : new u(c, 0, 0, 0, 0, l, 0, 0, 0, 0, h, d, 0, 0, -1, 0) }, u.computeOrthographicOffCenter = function(e, t, r, o, a, s, l) { if (!i(e)) throw new n("left is required."); if (!i(t)) throw new n("right is required."); if (!i(r)) throw new n("bottom is required."); if (!i(o)) throw new n("top is required."); if (!i(a)) throw new n("near is required."); if (!i(s)) throw new n("far is required."); var c = 1 / (t - e),
h = 1 / (o - r),
d = 1 / (s - a),
m = -(t + e) * c,
p = -(o + r) * h,
f = -(s + a) * d; return c *= 2, h *= 2, d *= -2, i(l) ? (l[0] = c, l[1] = 0, l[2] = 0, l[3] = 0, l[4] = 0, l[5] = h, l[6] = 0, l[7] = 0, l[8] = 0, l[9] = 0, l[10] = d, l[11] = 0, l[12] = m, l[13] = p, l[14] = f, l[15] = 1, l) : new u(c, 0, 0, m, 0, h, 0, p, 0, 0, d, f, 0, 0, 0, 1) }, u.computePerspectiveOffCenter = function(e, t, r, o, a, s, l) { if (!i(e)) throw new n("left is required."); if (!i(t)) throw new n("right is required."); if (!i(r)) throw new n("bottom is required."); if (!i(o)) throw new n("top is required."); if (!i(a)) throw new n("near is required."); if (!i(s)) throw new n("far is required."); var c = 2 * a / (t - e),
h = 2 * a / (o - r),
d = (t + e) / (t - e),
m = (o + r) / (o - r),
p = -(s + a) / (s - a),
f = -1,
v = -2 * s * a / (s - a); return i(l) ? (l[0] = c, l[1] = 0, l[2] = 0, l[3] = 0, l[4] = 0, l[5] = h, l[6] = 0, l[7] = 0, l[8] = d, l[9] = m, l[10] = p, l[11] = f, l[12] = 0, l[13] = 0, l[14] = v, l[15] = 0, l) : new u(c, 0, d, 0, 0, h, m, 0, 0, 0, p, v, 0, 0, f, 0) }, u.computeInfinitePerspectiveOffCenter = function(e, t, r, o, a, s) { if (!i(e)) throw new n("left is required."); if (!i(t)) throw new n("right is required."); if (!i(r)) throw new n("bottom is required."); if (!i(o)) throw new n("top is required."); if (!i(a)) throw new n("near is required."); var l = 2 * a / (t - e),
c = 2 * a / (o - r),
h = (t + e) / (t - e),
d = (o + r) / (o - r),
m = -1,
p = -1,
f = -2 * a; return i(s) ? (s[0] = l, s[1] = 0, s[2] = 0, s[3] = 0, s[4] = 0, s[5] = c, s[6] = 0, s[7] = 0, s[8] = h, s[9] = d, s[10] = m, s[11] = p, s[12] = 0, s[13] = 0, s[14] = f, s[15] = 0, s) : new u(l, 0, h, 0, 0, c, d, 0, 0, 0, m, f, 0, 0, p, 0) }, u.computeViewportTransformation = function(e, t, n, o) { e = r(e, r.EMPTY_OBJECT); var a = r(e.x, 0),
s = r(e.y, 0),
l = r(e.width, 0),
c = r(e.height, 0);
t = r(t, 0), n = r(n, 1); var h = .5 * l,
d = .5 * c,
m = .5 * (n - t),
p = h,
f = d,
v = m,
y = a + h,
g = s + d,
_ = t + m,
w = 1; return i(o) ? (o[0] = p, o[1] = 0, o[2] = 0, o[3] = 0, o[4] = 0, o[5] = f, o[6] = 0, o[7] = 0, o[8] = 0, o[9] = 0, o[10] = v, o[11] = 0, o[12] = y, o[13] = g, o[14] = _, o[15] = w, o) : new u(p, 0, 0, y, 0, f, 0, g, 0, 0, v, _, 0, 0, 0, w) }, u.toArray = function(e, t) { if (!i(e)) throw new n("matrix is required"); return i(t) ? (t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3], t[4] = e[4], t[5] = e[5], t[6] = e[6], t[7] = e[7], t[8] = e[8], t[9] = e[9], t[10] = e[10], t[11] = e[11], t[12] = e[12], t[13] = e[13], t[14] = e[14], t[15] = e[15], t) : [e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8], e[9], e[10], e[11], e[12], e[13], e[14], e[15]] }, u.getElementIndex = function(e, t) { if ("number" != typeof t || 0 > t || t > 3) throw new n("row is required and must be 0, 1, 2, or 3."); if ("number" != typeof e || 0 > e || e > 3) throw new n("column is required and must be 0, 1, 2, or 3."); return 4 * e + t }, u.getColumn = function(e, r, o) { if (!i(e)) throw new n("matrix is required."); if ("number" != typeof r || 0 > r || r > 3) throw new n("index is required and must be 0, 1, 2, or 3."); var a = 4 * r,
s = e[a],
l = e[a + 1],
u = e[a + 2],
c = e[a + 3]; return i(o) ? (o.x = s, o.y = l, o.z = u, o.w = c, o) : new t(s, l, u, c) }, u.setColumn = function(e, t, r, o) { if (!i(e)) throw new n("matrix is required"); if (!i(r)) throw new n("cartesian is required"); if ("number" != typeof t || 0 > t || t > 3) throw new n("index is required and must be 0, 1, 2, or 3.");
o = u.clone(e, o); var a = 4 * t; return o[a] = r.x, o[a + 1] = r.y, o[a + 2] = r.z, o[a + 3] = r.w, o }, u.getRow = function(e, r, o) { if (!i(e)) throw new n("matrix is required."); if ("number" != typeof r || 0 > r || r > 3) throw new n("index is required and must be 0, 1, 2, or 3."); var a = e[r],
s = e[r + 4],
l = e[r + 8],
u = e[r + 12]; return i(o) ? (o.x = a, o.y = s, o.z = l, o.w = u, o) : new t(a, s, l, u) }, u.setRow = function(e, t, r, o) { if (!i(e)) throw new n("matrix is required"); if (!i(r)) throw new n("cartesian is required"); if ("number" != typeof t || 0 > t || t > 3) throw new n("index is required and must be 0, 1, 2, or 3."); return o = u.clone(e, o), o[t] = r.x, o[t + 4] = r.y, o[t + 8] = r.z, o[t + 12] = r.w, o }, u.multiply = function(e, t, r) { if (!i(e)) throw new n("left is required"); if (!i(t)) throw new n("right is required"); var o = e[0],
a = e[1],
s = e[2],
l = e[3],
c = e[4],
h = e[5],
d = e[6],
m = e[7],
p = e[8],
f = e[9],
v = e[10],
y = e[11],
g = e[12],
_ = e[13],
w = e[14],
C = e[15],
x = t[0],
S = t[1],
E = t[2],
b = t[3],
T = t[4],
A = t[5],
M = t[6],
P = t[7],
D = t[8],
I = t[9],
O = t[10],
R = t[11],
L = t[12],
z = t[13],
N = t[14],
F = t[15],
B = o * x + c * S + p * E + g * b,
V = a * x + h * S + f * E + _ * b,
q = s * x + d * S + v * E + w * b,
k = l * x + m * S + y * E + C * b,
U = o * T + c * A + p * M + g * P,
W = a * T + h * A + f * M + _ * P,
G = s * T + d * A + v * M + w * P,
H = l * T + m * A + y * M + C * P,
j = o * D + c * I + p * O + g * R,
Y = a * D + h * I + f * O + _ * R,
X = s * D + d * I + v * O + w * R,
Z = l * D + m * I + y * O + C * R,
K = o * L + c * z + p * N + g * F,
J = a * L + h * z + f * N + _ * F,
Q = s * L + d * z + v * N + w * F,
$ = l * L + m * z + y * N + C * F; return i(r) ? (r[0] = B, r[1] = V, r[2] = q, r[3] = k, r[4] = U, r[5] = W, r[6] = G, r[7] = H, r[8] = j, r[9] = Y, r[10] = X, r[11] = Z, r[12] = K, r[13] = J, r[14] = Q, r[15] = $, r) : new u(B, U, j, K, V, W, Y, J, q, G, X, Q, k, H, Z, $) }, u.multiplyByTranslation = function(e, t, r) { if (!i(e)) throw new n("matrix is required"); if (!i(t)) throw new n("translation is required"); var o = t.x,
a = t.y,
s = t.z,
l = o * e[0] + a * e[4] + s * e[8] + e[12],
c = o * e[1] + a * e[5] + s * e[9] + e[13],
h = o * e[2] + a * e[6] + s * e[10] + e[14]; return i(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] = l, r[13] = c, r[14] = h, r[15] = e[15], r) : new u(e[0], e[4], e[8], l, e[1], e[5], e[9], c, e[2], e[6], e[10], h, e[3], e[7], e[11], e[15]) }, u.multiplyByUniformScale = function(e, t, r) { if (!i(e)) throw new n("matrix is required"); if ("number" != typeof t) throw new n("scale is required"); return 1 === t ? u.clone(e, r) : i(r) ? (r[0] = t * e[0], r[1] = t * e[1], r[2] = t * e[2], r[3] = 0, r[4] = t * e[4], r[5] = t * e[5], r[6] = t * e[6], r[7] = 0, r[8] = t * e[8], r[9] = t * e[9], r[10] = t * e[10], r[11] = 0, r[12] = e[12], r[13] = e[13], r[14] = e[14], r[15] = 1, r) : new u(t * e[0], t * e[4], t * e[8], e[12], t * e[1], t * e[5], t * e[9], e[13], t * e[2], t * e[6], t * e[10], e[14], 0, 0, 0, 1) }, u.multiplyByVector = function(e, r, o) { if (!i(e)) throw new n("matrix is required"); if (!i(r)) throw new n("cartesian is required"); var a = r.x,
s = r.y,
l = r.z,
u = r.w,
c = e[0] * a + e[4] * s + e[8] * l + e[12] * u,
h = e[1] * a + e[5] * s + e[9] * l + e[13] * u,
d = e[2] * a + e[6] * s + e[10] * l + e[14] * u,
m = e[3] * a + e[7] * s + e[11] * l + e[15] * u; return i(o) ? (o.x = c, o.y = h, o.z = d, o.w = m, o) : new t(c, h, d, m) }; var m = new t(0, 0, 0, 1); return u.multiplyByPoint = function(e, t, r) { if (!i(t)) throw new n("cartesian is required"); return m.x = t.x, m.y = t.y, m.z = t.z, u.multiplyByVector(e, m, r) }, u.multiplyByScalar = function(e, t, r) { if (!i(e)) throw new n("matrix is required"); if ("number" != typeof t) throw new n("scalar is required and must be a number"); return i(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) : new u(e[0] * t, e[4] * t, e[8] * t, e[12] * t, e[1] * t, e[5] * t, e[9] * t, e[13] * t, e[2] * t, e[6] * t, e[10] * t, e[14] * t, e[3] * t, e[7] * t, e[11] * t, e[15] * t) }, u.negate = function(e, t) { if (!i(e)) throw new n("matrix is required"); return i(t) ? (t[0] = -e[0], t[1] = -e[1], t[2] = -e[2], t[3] = -e[3], t[4] = -e[4], t[5] = -e[5], t[6] = -e[6], t[7] = -e[7], t[8] = -e[8], t[9] = -e[9], t[10] = -e[10], t[11] = -e[11], t[12] = -e[12], t[13] = -e[13], t[14] = -e[14], t[15] = -e[15], t) : new u(-e[0], -e[4], -e[8], -e[12], -e[1], -e[5], -e[9], -e[13], -e[2], -e[6], -e[10], -e[14], -e[3], -e[7], -e[11], -e[15]) }, u.transpose = function(e, t) { if (!i(e)) throw new n("matrix is required"); if (!i(t)) return new u(e[0], e[1], e[2], e[3], e[4], e[5], e[6], e[7], e[8], e[9], e[10], e[11], e[12], e[13], e[14], e[15]); var r = e[1],
o = e[2],
a = e[3],
s = e[6],
l = e[7],
c = 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] = o, t[9] = s, t[10] = e[10], t[11] = e[14], t[12] = a, t[13] = l, t[14] = c, t[15] = e[15], t }, u.equals = function(e, t) { return e === t || i(e) && i(t) && e[0] === t[0] && e[1] === t[1] && e[2] === t[2] && e[3] === t[3] && e[4] === t[4] && e[5] === t[5] && e[6] === t[6] && e[7] === t[7] && e[8] === t[8] && e[9] === t[9] && e[10] === t[10] && e[11] === t[11] && e[12] === t[12] && e[13] === t[13] && e[14] === t[14] && e[15] === t[15] }, u.equalsEpsilon = function(e, t, r) { if ("number" != typeof r) throw new n("epsilon is required and must be a number"); return e === t || i(e) && i(t) && Math.abs(e[0] - t[0]) <= r && Math.abs(e[1] - t[1]) <= r && Math.abs(e[2] - t[2]) <= r && Math.abs(e[3] - t[3]) <= r && Math.abs(e[4] - t[4]) <= r && Math.abs(e[5] - t[5]) <= r && Math.abs(e[6] - t[6]) <= r && Math.abs(e[7] - t[7]) <= r && Math.abs(e[8] - t[8]) <= r && 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 }, u.getTranslation = function(t, r) { if (!i(t)) throw new n("matrix is required"); return i(r) ? (r.x = t[12], r.y = t[13], r.z = t[14], r) : new e(t[12], t[13], t[14]) }, u.getRotation = function(e, t) { if (!i(e)) throw new n("matrix is required"); return i(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) : new s(e[0], e[4], e[8], e[1], e[5], e[9], e[2], e[6], e[10]) }, u.inverse = function(e, t) { if (!i(e)) throw new n("matrix is required"); var r = e[0],
o = e[4],
s = e[8],
c = e[12],
h = e[1],
d = e[5],
m = e[9],
p = e[13],
f = e[2],
v = e[6],
y = e[10],
g = e[14],
_ = e[3],
w = e[7],
C = e[11],
x = e[15],
S = y * x,
E = g * C,
b = v * x,
T = g * w,
A = v * C,
M = y * w,
P = f * x,
D = g * _,
I = f * C,
O = y * _,
R = f * w,
L = v * _,
z = S * d + T * m + A * p - (E * d + b * m + M * p),
N = E * h + P * m + O * p - (S * h + D * m + I * p),
F = b * h + D * d + R * p - (T * h + P * d + L * p),
B = M * h + I * d + L * m - (A * h + O * d + R * m),
V = E * o + b * s + M * c - (S * o + T * s + A * c),
q = S * r + D * s + I * c - (E * r + P * s + O * c),
k = T * r + P * o + L * c - (b * r + D * o + R * c),
U = A * r + O * o + R * s - (M * r + I * o + L * s);
S = s * p, E = c * m, b = o * p, T = c * d, A = o * m, M = s * d, P = r * p, D = c * h, I = r * m, O = s * h, R = r * d, L = o * h; var W = S * w + T * C + A * x - (E * w + b * C + M * x),
G = E * _ + P * C + O * x - (S * _ + D * C + I * x),
H = b * _ + D * w + R * x - (T * _ + P * w + L * x),
j = M * _ + I * w + L * C - (A * _ + O * w + R * C),
Y = b * y + M * g + E * v - (A * g + S * v + T * y),
X = I * g + S * f + D * y - (P * y + O * g + E * f),
Z = P * v + L * g + T * f - (R * g + b * f + D * v),
K = R * y + A * f + O * v - (I * v + L * y + M * f),
J = r * z + o * N + s * F + c * B; if (Math.abs(J) < a.EPSILON20) throw new l("matrix is not invertible because its determinate is zero."); return J = 1 / J, i(t) ? (t[0] = z * J, t[1] = N * J, t[2] = F * J, t[3] = B * J, t[4] = V * J, t[5] = q * J, t[6] = k * J, t[7] = U * J, t[8] = W * J, t[9] = G * J, t[10] = H * J, t[11] = j * J, t[12] = Y * J, t[13] = X * J, t[14] = Z * J, t[15] = K * J, t) : new u(z * J, V * J, W * J, Y * J, N * J, q * J, G * J, X * J, F * J, k * J, H * J, Z * J, B * J, U * J, j * J, K * J) }, u.inverseTransformation = function(e, t) { if (!i(e)) throw new n("matrix is required"); var r = e[0],
o = e[1],
a = e[2],
s = e[4],
l = e[5],
c = e[6],
h = e[8],
d = e[9],
m = e[10],
p = e[12],
f = e[13],
v = e[14],
y = -r * p - o * f - a * v,
g = -s * p - l * f - c * v,
_ = -h * p - d * f - m * v; return i(t) ? (t[0] = r, t[1] = s, t[2] = h, t[3] = 0, t[4] = o, t[5] = l, t[6] = d, t[7] = 0, t[8] = a, t[9] = c, t[10] = m, t[11] = 0, t[12] = y, t[13] = g, t[14] = _, t[15] = 1, t) : new u(r, o, a, y, s, l, c, g, h, d, m, _, 0, 0, 0, 1) }, u.IDENTITY = o(new u(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1)), u.COLUMN0ROW0 = 0, u.COLUMN0ROW1 = 1, u.COLUMN0ROW2 = 2, u.COLUMN0ROW3 = 3, u.COLUMN1ROW0 = 4, u.COLUMN1ROW1 = 5, u.COLUMN1ROW2 = 6, u.COLUMN1ROW3 = 7, u.COLUMN2ROW0 = 8, u.COLUMN2ROW1 = 9, u.COLUMN2ROW2 = 10, u.COLUMN2ROW3 = 11, u.COLUMN3ROW0 = 12, u.COLUMN3ROW1 = 13, u.COLUMN3ROW2 = 14, u.COLUMN3ROW3 = 15, u.prototype.clone = function(e) { return u.clone(this, e) }, u.prototype.toArray = function(e) { return u.toArray(this, e) }, u.prototype.getColumn = function(e, t) { return u.getColumn(this, e, t) }, u.prototype.setColumn = function(e, t, r) { return u.setColumn(this, e, t, r) }, u.prototype.getRow = function(e, t) { return u.getRow(this, e, t) }, u.prototype.setRow = function(e, t, r) { return u.setRow(this, e, t, r) }, u.prototype.multiply = function(e, t) { return u.multiply(this, e, t) }, u.prototype.multiplyByTranslation = function(e, t) { return u.multiplyByTranslation(this, e, t) }, u.prototype.multiplyByUniformScale = function(e, t) { return u.multiplyByUniformScale(this, e, t) }, u.prototype.multiplyByVector = function(e, t) { return u.multiplyByVector(this, e, t) }, u.prototype.multiplyByPoint = function(e, t) { return u.multiplyByPoint(this, e, t) }, u.prototype.multiplyByScalar = function(e, t) { return u.multiplyByScalar(this, e, t) }, u.prototype.negate = function(e) { return u.negate(this, e) }, u.prototype.transpose = function(e) { return u.transpose(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[0] + ", " + this[4] + ", " + this[8] + ", " + this[12] + ")\n" + "(" + this[1] + ", " + this[5] + ", " + this[9] + ", " + this[13] + ")\n" + "(" + this[2] + ", " + this[6] + ", " + this[10] + ", " + this[14] + ")\n" + "(" + this[3] + ", " + this[7] + ", " + this[11] + ", " + this[15] + ")" }, u.prototype.getTranslation = function(e) { return u.getTranslation(this, e) }, u.prototype.getRotation = function(e) { return u.getRotation(this, e) }, u.prototype.inverse = function(e) { return u.inverse(this, e) }, u.prototype.inverseTransformation = function(e) { return u.inverseTransformation(this, e) }, u }), r("Core/BoundingSphere", ["./defaultValue", "./defined", "./DeveloperError", "./Cartesian3", "./Cartesian4", "./Cartographic", "./Ellipsoid", "./GeographicProjection", "./Intersect", "./Interval", "./Matrix4"], function(e, t, r, i, n, o, a, s, l, u, c) { "use strict"; var h = function(t, r) { this.center = i.clone(e(t, i.ZERO)), this.radius = e(r, 0) },
d = new i,
m = new i,
p = new i,
f = new i,
v = new i,
y = new i,
g = new i,
_ = new i,
w = new i,
C = new i,
x = new i,
S = new i;
h.fromPoints = function(e, r) { if (t(r) || (r = new h), !t(e) || 0 === e.length) return r.center = i.ZERO.clone(r.center), r.radius = 0, r; for (var n = i.clone(e[0], g), o = i.clone(n, d), a = i.clone(n, m), s = i.clone(n, p), l = i.clone(n, f), u = i.clone(n, v), c = i.clone(n, y), E = e.length, b = 1; E > b; b++) { i.clone(e[b], n); var T = n.x,
A = n.y,
M = n.z;
T < o.x && i.clone(n, o), T > l.x && i.clone(n, l), A < a.y && i.clone(n, a), A > u.y && i.clone(n, u), M < s.z && i.clone(n, s), M > c.z && i.clone(n, c) } var P = i.magnitudeSquared(i.subtract(l, o, _)),
D = i.magnitudeSquared(i.subtract(u, a, _)),
I = i.magnitudeSquared(i.subtract(c, s, _)),
O = o,
R = l,
L = P;
D > L && (L = D, O = a, R = u), I > L && (L = I, O = s, R = c); var z = w;
z.x = .5 * (O.x + R.x), z.y = .5 * (O.y + R.y), z.z = .5 * (O.z + R.z); var N = i.magnitudeSquared(i.subtract(R, z, _)),
F = Math.sqrt(N),
B = C;
B.x = o.x, B.y = a.y, B.z = s.z; var V = x;
V.x = l.x, V.y = u.y, V.z = c.z; var q = i.multiplyByScalar(i.add(B, V, _), .5, S),
k = 0; for (b = 0; E > b; b++) { i.clone(e[b], n); var U = i.magnitude(i.subtract(n, q, _));
U > k && (k = U); var W = i.magnitudeSquared(i.subtract(n, z, _)); if (W > N) { var G = Math.sqrt(W);
F = .5 * (F + G), N = F * F; var H = G - F;
z.x = (F * z.x + H * n.x) / G, z.y = (F * z.y + H * n.y) / G, z.z = (F * z.z + H * n.z) / G } } return k > F ? (i.clone(z, r.center), r.radius = F) : (i.clone(q, r.center), r.radius = k), r }; var E = new s,
b = new i,
T = new i,
A = new o,
M = new o;
h.fromExtent2D = function(e, t, r) { return h.fromExtentWithHeights2D(e, t, 0, 0, r) }, h.fromExtentWithHeights2D = function(r, n, o, a, s) { if (t(s) || (s = new h), !t(r)) return s.center = i.ZERO.clone(s.center), s.radius = 0, s;
n = e(n, E), r.getSouthwest(A), A.height = o, r.getNortheast(M), M.height = a; var l = n.project(A, b),
u = n.project(M, T),
c = u.x - l.x,
d = u.y - l.y,
m = u.z - l.z;
s.radius = .5 * Math.sqrt(c * c + d * d + m * m); var p = s.center; return p.x = l.x + .5 * c, p.y = l.y + .5 * d, p.z = l.z + .5 * m, s }; var P = [];
h.fromExtent3D = function(r, i, n, o) { i = e(i, a.WGS84), n = e(n, 0); var s; return t(r) && (s = r.subsample(i, n, P)), h.fromPoints(s, o) }, h.fromVertices = function(e, n, o, a) { if (t(a) || (a = new h), !t(e) || 0 === e.length) return a.center = i.ZERO.clone(a.center), a.radius = 0, a; if (t(n) || (n = i.ZERO), t(o) || (o = 3), 3 > o) throw new r("stride must be 3 or greater."); var s = g;
s.x = e[0] + n.x, s.y = e[1] + n.y, s.z = e[2] + n.z; for (var l = i.clone(s, d), u = i.clone(s, m), c = i.clone(s, p), E = i.clone(s, f), b = i.clone(s, v), T = i.clone(s, y), A = e.length, M = 0; A > M; M += o) { var P = e[M] + n.x,
D = e[M + 1] + n.y,
I = e[M + 2] + n.z;
s.x = P, s.y = D, s.z = I, P < l.x && i.clone(s, l), P > E.x && i.clone(s, E), D < u.y && i.clone(s, u), D > b.y && i.clone(s, b), I < c.z && i.clone(s, c), I > T.z && i.clone(s, T) } var O = i.magnitudeSquared(i.subtract(E, l, _)),
R = i.magnitudeSquared(i.subtract(b, u, _)),
L = i.magnitudeSquared(i.subtract(T, c, _)),
z = l,
N = E,
F = O;
R > F && (F = R, z = u, N = b), L > F && (F = L, z = c, N = T); var B = w;
B.x = .5 * (z.x + N.x), B.y = .5 * (z.y + N.y), B.z = .5 * (z.z + N.z); var V = i.magnitudeSquared(i.subtract(N, B, _)),
q = Math.sqrt(V),
k = C;
k.x = l.x, k.y = u.y, k.z = c.z; var U = x;
U.x = E.x, U.y = b.y, U.z = T.z; var W = i.multiplyByScalar(i.add(k, U, _), .5, S),
G = 0; for (M = 0; A > M; M += o) { s.x = e[M] + n.x, s.y = e[M + 1] + n.y, s.z = e[M + 2] + n.z; var H = i.magnitude(i.subtract(s, W, _));
H > G && (G = H); var j = i.magnitudeSquared(i.subtract(s, B, _)); if (j > V) { var Y = Math.sqrt(j);
q = .5 * (q + Y), V = q * q; var X = Y - q;
B.x = (q * B.x + X * s.x) / Y, B.y = (q * B.y + X * s.y) / Y, B.z = (q * B.z + X * s.z) / Y } } return G > q ? (i.clone(B, a.center), a.radius = q) : (i.clone(W, a.center), a.radius = G), a }, h.fromCornerPoints = function(e, n, o) { if (!t(e) || !t(n)) throw new r("corner and oppositeCorner are required.");
t(o) || (o = new h); var a = o.center; return i.add(e, n, a), i.multiplyByScalar(a, .5, a), o.radius = i.distance(a, n), o }, h.fromEllipsoid = function(e, n) { if (!t(e)) throw new r("ellipsoid is required."); return t(n) || (n = new h), i.clone(i.ZERO, n.center), n.radius = e.getMaximumRadius(), n }, h.clone = function(e, r) { return t(e) ? t(r) ? (r.center = i.clone(e.center, r.center), r.radius = e.radius, r) : new h(e.center, e.radius) : void 0 }; var D = new i,
I = new i;
h.union = function(e, n, o) { if (!t(e)) throw new r("left is required."); if (!t(n)) throw new r("right is required.");
t(o) || (o = new h); var a = e.center,
s = n.center;
i.add(a, s, I); var l = i.multiplyByScalar(I, .5, I),
u = i.subtract(a, l, D).magnitude() + e.radius,
c = i.subtract(s, l, D).magnitude() + n.radius; return o.radius = Math.max(u, c), i.clone(l, o.center), o }; var O = new i;
h.expand = function(e, n, o) { if (!t(e)) throw new r("sphere is required."); if (!t(n)) throw new r("point is required.");
o = h.clone(e, o); var a = i.subtract(n, o.center, O).magnitude(); return a > o.radius && (o.radius = a), o }, h.intersect = function(e, n) { if (!t(e)) throw new r("sphere is required."); if (!t(n)) throw new r("plane is required."); var o = e.center,
a = e.radius,
s = i.dot(n, o) + n.w; return -a > s ? l.OUTSIDE : a > s ? l.INTERSECTING : l.INSIDE }; var R = n.UNIT_W.clone();
h.transform = function(e, n, o) { if (!t(e)) throw new r("sphere is required."); if (!t(n)) throw new r("transform is required."); return t(o) || (o = new h), c.multiplyByPoint(n, e.center, R), i.clone(R, o.center), o.radius = e.radius, o }; var L = new i;
h.getPlaneDistances = function(e, n, o, a) { if (!t(e)) throw new r("sphere is required."); if (!t(n)) throw new r("position is required."); if (!t(o)) throw new r("direction is required.");
t(a) || (a = new u); var s = i.subtract(e.center, n, L),
l = i.multiplyByScalar(o, o.dot(s), L),
c = l.magnitude(); return a.start = c - e.radius, a.stop = c + e.radius, a }; for (var z = new i, N = new i, F = new i, B = new i, V = new i, q = new o, k = new Array(8), U = 0; 8 > U; ++U) k[U] = new i; var W = new s; return h.projectTo2D = function(n, o, a) { if (!t(n)) throw new r("sphere is required.");
o = e(o, W); var s = o.getEllipsoid(),
l = n.center,
u = n.radius,
c = s.geodeticSurfaceNormal(l, z),
d = i.cross(i.UNIT_Z, c, N);
i.normalize(d, d); var m = i.cross(c, d, F);
i.normalize(m, m), i.multiplyByScalar(c, u, c), i.multiplyByScalar(m, u, m), i.multiplyByScalar(d, u, d); var p = i.negate(m, V),
f = i.negate(d, B),
v = k,
y = v[0];
i.add(c, m, y), i.add(y, d, y), y = v[1], i.add(c, m, y), i.add(y, f, y), y = v[2], i.add(c, p, y), i.add(y, f, y), y = v[3], i.add(c, p, y), i.add(y, d, y), i.negate(c, c), y = v[4], i.add(c, m, y), i.add(y, d, y), y = v[5], i.add(c, m, y), i.add(y, f, y), y = v[6], i.add(c, p, y), i.add(y, f, y), y = v[7], i.add(c, p, y), i.add(y, d, y); for (var g = v.length, _ = 0; g > _; ++_) { var w = v[_];
i.add(l, w, w); var C = s.cartesianToCartographic(w, q);
o.project(C, w) } a = h.fromPoints(v, a), l = a.center; var x = l.x,
S = l.y,
E = l.z; return l.x = E, l.y = x, l.z = S, a }, h.equals = function(e, r) { return e === r || t(e) && t(r) && i.equals(e.center, r.center) && e.radius === r.radius }, h.prototype.clone = function(e) { return h.clone(this, e) }, h.prototype.union = function(e, t) { return h.union(this, e, t) }, h.prototype.expand = function(e, t) { return h.expand(this, e, t) }, h.prototype.intersect = function(e) { return h.intersect(this, e) }, h.prototype.transform = function(e, t) { return h.transform(this, e, t) }, h.prototype.getPlaneDistances = function(e, t, r) { return h.getPlaneDistances(this, e, t, r) }, h.prototype.projectTo2D = function(e, t) { return h.projectTo2D(this, e, t) }, h.prototype.equals = function(e) { return h.equals(this, e) }, h }), r("Core/Fullscreen", ["./defined"], function(e) { "use strict"; var t, r = { requestFullscreen: void 0, exitFullscreen: void 0, fullscreenEnabled: void 0, fullscreenElement: void 0, fullscreenchange: void 0, fullscreenerror: void 0 },
i = {}; return i.supportsFullscreen = function() { if (e(t)) return t;
t = !1; var i = document.body; if ("function" == typeof i.requestFullscreen) return r.requestFullscreen = "requestFullscreen", r.exitFullscreen = "exitFullscreen", r.fullscreenEnabled = "fullscreenEnabled", r.fullscreenElement = "fullscreenElement", r.fullscreenchange = "fullscreenchange", r.fullscreenerror = "fullscreenerror", t = !0; for (var n, o = ["webkit", "moz", "o", "ms", "khtml"], a = 0, s = o.length; s > a; ++a) { var l = o[a];
n = l + "RequestFullscreen", "function" == typeof i[n] ? (r.requestFullscreen = n, t = !0) : (n = l + "RequestFullScreen", "function" == typeof i[n] && (r.requestFullscreen = n, t = !0)), n = l + "ExitFullscreen", "function" == typeof document[n] ? r.exitFullscreen = n : (n = l + "CancelFullScreen", "function" == typeof document[n] && (r.exitFullscreen = n)), n = l + "FullscreenEnabled", e(document[n]) ? r.fullscreenEnabled = n : (n = l + "FullScreenEnabled", e(document[n]) && (r.fullscreenEnabled = n)), n = l + "FullscreenElement", e(document[n]) ? r.fullscreenElement = n : (n = l + "FullScreenElement", e(document[n]) && (r.fullscreenElement = n)), n = l + "fullscreenchange", e(document["on" + n]) && (r.fullscreenchange = n), n = l + "fullscreenerror", e(document["on" + n]) && (r.fullscreenerror = n) } return t }, i.requestFullscreen = function(e) { i.supportsFullscreen() && e[r.requestFullscreen]() }, i.exitFullscreen = function() { i.supportsFullscreen() && document[r.exitFullscreen]() }, i.isFullscreenEnabled = function() { return i.supportsFullscreen() ? document[r.fullscreenEnabled] : void 0 }, i.getFullscreenElement = function() { return i.supportsFullscreen() ? document[r.fullscreenElement] : void 0 }, i.isFullscreen = function() { return i.supportsFullscreen() ? null !== i.getFullscreenElement() : void 0 }, i.getFullscreenChangeEventName = function() { return i.supportsFullscreen() ? r.fullscreenchange : void 0 }, i.getFullscreenErrorEventName = function() { return i.supportsFullscreen() ? r.fullscreenerror : void 0 }, i }), r("Core/FeatureDetection", ["./defined", "./Fullscreen"], function(e, t) { "use strict";
function r(e) { for (var t = e.split("."), r = 0, i = t.length; i > r; ++r) t[r] = parseInt(t[r], 10) }
function i() { if (!e(h)) { var t = / Chrome\/([\.0-9]+)/.exec(navigator.userAgent);
null === t ? h = !1 : (h = !0, d = r(t[1])) } return h }
function n() { return i() && d }
function o() { if (!e(m))
if (i() || !/ Safari\/[\.0-9]+/.test(navigator.userAgent)) m = !1;
else { var t = / Version\/([\.0-9]+)/.exec(navigator.userAgent);
null === t ? m = !1 : (m = !0, p = r(t[1])) }
return m }
function a() { return o() && p }
function s() { if (!e(f)) { var t = / AppleWebKit\/([\.0-9]+)(\+?)/.exec(navigator.userAgent);
null === t ? f = !1 : (f = !0, v = r(t[1]), v.isNightly = !!t[2]) } return f }
function l() { return s() && v }
function u() { if (!e(y)) { var t = / MSIE ([\.0-9]+)/.exec(navigator.userAgent);
null === t ? y = !1 : (y = !0, g = r(t[1])) } return y }
function c() { return u() && g } var h, d, m, p, f, v, y, g, _, w = { isChrome: i, chromeVersion: n, isSafari: o, safariVersion: a, isWebkit: s, webkitVersion: l, isInternetExplorer: u, internetExplorerVersion: c }; return w.supportsCrossOriginImagery = function() { return e(_) || (_ = o() && l()[0] < 536 ? !1 : "withCredentials" in new XMLHttpRequest), _ }, w.supportsFullscreen = function() { return t.supportsFullscreen() }, w.supportsTypedArrays = function() { return "undefined" != typeof ArrayBuffer }, w }), r("Core/ComponentDatatype", ["./defined", "./DeveloperError", "./FeatureDetection", "./Enumeration"], function(e, t, r, i) {
"use strict";
if (!r.supportsTypedArrays()) return {};
var n = { BYTE: new i(5120, "BYTE", { sizeInBytes: Int8Array.BYTES_PER_ELEMENT }), UNSIGNED_BYTE: new i(5121, "UNSIGNED_BYTE", { sizeInBytes: Uint8Array.BYTES_PER_ELEMENT }), SHORT: new i(5122, "SHORT", { sizeInBytes: Int16Array.BYTES_PER_ELEMENT }), UNSIGNED_SHORT: new i(5123, "UNSIGNED_SHORT", { sizeInBytes: Uint16Array.BYTES_PER_ELEMENT }), FLOAT: new i(5126, "FLOAT", { sizeInBytes: Float32Array.BYTES_PER_ELEMENT }), DOUBLE: new i(5130, "DOUBLE", { sizeInBytes: Float64Array.BYTES_PER_ELEMENT }) };
return n.validate = function(t) { return e(t) && e(t.value) && (t.value === n.BYTE.value || t.value === n.UNSIGNED_BYTE.value || t.value === n.SHORT.value || t.value === n.UNSIGNED_SHORT.value || t.value === n.FLOAT.value || t.value === n.DOUBLE.value) }, n.createTypedArray = function(r, i) { if (!e(r)) throw new t("componentDatatype is required."); if (!e(i)) throw new t("valuesOrLength is required."); switch (r.value) {
case n.BYTE.value:
return new Int8Array(i);
case n.UNSIGNED_BYTE.value:
return new Uint8Array(i);
case n.SHORT.value:
return new Int16Array(i);
case n.UNSIGNED_SHORT.value:
return new Uint16Array(i);
case n.FLOAT.value:
return new Float32Array(i);
case n.DOUBLE.value:
return new Float64Array(i);
default:
throw new t("componentDatatype is not a valid enumeration value.") } }, n.createArrayBufferView = function(r, i, o) {
if (!e(r)) throw new t("componentDatatype is required.");
if (!e(i)) throw new t("buffer is required.");
switch (r.value) {
case n.BYTE.value:
return new Int8Array(i, o);
case n.UNSIGNED_BYTE.value:
return new Uint8Array(i, o);
case n.SHORT.value:
return new Int16Array(i, o);
case n.UNSIGNED_SHORT.value:
return new Uint16Array(i, o);
case n.FLOAT.value:
return new Float32Array(i, o);
case n.DOUBLE.value:
return new Float64Array(i, o);
default:
throw new t("componentDatatype is not a valid enumeration value.")
}
}, n
}), r("Core/PrimitiveType", ["./Enumeration"], function(e) { "use strict"; var t = { POINTS: new e(0, "POINTS"), LINES: new e(1, "LINES"), LINE_LOOP: new e(2, "LINE_LOOP"), LINE_STRIP: new e(3, "LINE_STRIP"), TRIANGLES: new e(4, "TRIANGLES"), TRIANGLE_STRIP: new e(5, "TRIANGLE_STRIP"), TRIANGLE_FAN: new e(6, "TRIANGLE_FAN"), validate: function(e) { return e.value === t.POINTS.value || e.value === t.LINES.value || e.value === t.LINE_LOOP.value || e.value === t.LINE_STRIP.value || e.value === t.TRIANGLES.value || e.value === t.TRIANGLE_STRIP.value || e.value === t.TRIANGLE_FAN.value } }; return t }), r("Core/GeometryAttribute", ["./defaultValue", "./defined", "./DeveloperError"], function(e, t, r) { "use strict"; var i = function(i) { if (i = e(i, e.EMPTY_OBJECT), !t(i.componentDatatype)) throw new r("options.componentDatatype is required."); if (!t(i.componentsPerAttribute)) throw new r("options.componentsPerAttribute is required."); if (i.componentsPerAttribute < 1 || i.componentsPerAttribute > 4) throw new r("options.componentsPerAttribute must be between 1 and 4."); if (!t(i.values)) throw new r("options.values is required.");
this.componentDatatype = i.componentDatatype, this.componentsPerAttribute = i.componentsPerAttribute, this.normalize = e(i.normalize, !1), this.values = i.values }; return i }), r("Core/GeometryAttributes", ["./defaultValue"], function(e) { "use strict"; var t = function(t) { t = e(t, e.EMPTY_OBJECT), this.position = t.position, this.normal = t.normal, this.st = t.st, this.binormal = t.binormal, this.tangent = t.tangent }; return t }), r("Core/VertexFormat", ["./defaultValue", "./freezeObject"], function(e, t) { "use strict"; var r = function(t) { t = e(t, e.EMPTY_OBJECT), this.position = e(t.position, !1), this.normal = e(t.normal, !1), this.st = e(t.st, !1), this.binormal = e(t.binormal, !1), this.tangent = e(t.tangent, !1) }; return r.POSITION_ONLY = t(new r({ position: !0 })), r.POSITION_AND_NORMAL = t(new r({ position: !0, normal: !0 })), r.POSITION_NORMAL_AND_ST = t(new r({ position: !0, normal: !0, st: !0 })), r.POSITION_AND_ST = t(new r({ position: !0, st: !0 })), r.ALL = t(new r({ position: !0, normal: !0, st: !0, binormal: !0, tangent: !0 })), r.DEFAULT = r.POSITION_NORMAL_AND_ST, r }), r("Core/Geometry", ["./defaultValue", "./defined", "./DeveloperError", "./BoundingSphere"], function(e, t, r) { "use strict"; var i = function(i) { if (i = e(i, e.EMPTY_OBJECT), !t(i.attributes)) throw new r("options.attributes is required."); if (!t(i.primitiveType)) throw new r("options.primitiveType is required.");
this.attributes = i.attributes, this.indices = i.indices, this.primitiveType = i.primitiveType, this.boundingSphere = i.boundingSphere }; return i.computeNumberOfVertices = function(e) { if (!t(e)) throw new r("geometry is required."); var i = -1; for (var n in e.attributes)
if (e.attributes.hasOwnProperty(n) && t(e.attributes[n]) && t(e.attributes[n].values)) { var o = e.attributes[n],
a = o.values.length / o.componentsPerAttribute; if (i !== a && -1 !== i) throw new r("All attribute lists must have the same number of attributes.");
i = a }
return i }, i }), r("Core/BoxGeometry", ["./defined", "./DeveloperError", "./Cartesian3", "./ComponentDatatype", "./PrimitiveType", "./defaultValue", "./BoundingSphere", "./GeometryAttribute", "./GeometryAttributes", "./VertexFormat", "./Geometry"], function(e, t, r, i, n, o, a, s, l, u, c) { "use strict"; var h = new r,
d = function(i) { i = o(i, o.EMPTY_OBJECT); var n = i.minimumCorner,
a = i.maximumCorner; if (!e(n)) throw new t("options.minimumCorner is required."); if (!e(a)) throw new t("options.maximumCorner is required"); var s = o(i.vertexFormat, u.DEFAULT);
this._minimumCorner = r.clone(n), this._maximumCorner = r.clone(a), this._vertexFormat = s, this._workerName = "createBoxGeometry" }; return d.fromDimensions = function(r) { r = o(r, o.EMPTY_OBJECT); var i = r.dimensions; if (!e(i)) throw new t("options.dimensions is required."); if (i.x < 0 || i.y < 0 || i.z < 0) throw new t("All dimensions components must be greater than or equal to zero."); var n = i.multiplyByScalar(.5),
a = n.negate(),
s = n,
l = { minimumCorner: a, maximumCorner: s, vertexFormat: r.vertexFormat }; return new d(l) }, d.createGeometry = function(e) { var t, o, u = e._minimumCorner,
d = e._maximumCorner,
m = e._vertexFormat,
p = new l; if (m.position && (m.st || m.normal || m.binormal || m.tangent)) { if (m.position && (o = new Float64Array(72), o[0] = u.x, o[1] = u.y, o[2] = d.z, o[3] = d.x, o[4] = u.y, o[5] = d.z, o[6] = d.x, o[7] = d.y, o[8] = d.z, o[9] = u.x, o[10] = d.y, o[11] = d.z, o[12] = u.x, o[13] = u.y, o[14] = u.z, o[15] = d.x, o[16] = u.y, o[17] = u.z, o[18] = d.x, o[19] = d.y, o[20] = u.z, o[21] = u.x, o[22] = d.y, o[23] = u.z, o[24] = d.x, o[25] = u.y, o[26] = u.z, o[27] = d.x, o[28] = d.y, o[29] = u.z, o[30] = d.x, o[31] = d.y, o[32] = d.z, o[33] = d.x, o[34] = u.y, o[35] = d.z, o[36] = u.x, o[37] = u.y, o[38] = u.z, o[39] = u.x, o[40] = d.y, o[41] = u.z, o[42] = u.x, o[43] = d.y, o[44] = d.z, o[45] = u.x, o[46] = u.y, o[47] = d.z, o[48] = u.x, o[49] = d.y, o[50] = u.z, o[51] = d.x, o[52] = d.y, o[53] = u.z, o[54] = d.x, o[55] = d.y, o[56] = d.z, o[57] = u.x, o[58] = d.y, o[59] = d.z, o[60] = u.x, o[61] = u.y, o[62] = u.z, o[63] = d.x, o[64] = u.y, o[65] = u.z, o[66] = d.x, o[67] = u.y, o[68] = d.z, o[69] = u.x, o[70] = u.y, o[71] = d.z, p.position = new s({ componentDatatype: i.DOUBLE, componentsPerAttribute: 3, values: o })), m.normal) { var f = new Float32Array(72);
f[0] = 0, f[1] = 0, f[2] = 1, f[3] = 0, f[4] = 0, f[5] = 1, f[6] = 0, f[7] = 0, f[8] = 1, f[9] = 0, f[10] = 0, f[11] = 1, f[12] = 0, f[13] = 0, f[14] = -1, f[15] = 0, f[16] = 0, f[17] = -1, f[18] = 0, f[19] = 0, f[20] = -1, f[21] = 0, f[22] = 0, f[23] = -1, f[24] = 1, f[25] = 0, f[26] = 0, f[27] = 1, f[28] = 0, f[29] = 0, f[30] = 1, f[31] = 0, f[32] = 0, f[33] = 1, f[34] = 0, f[35] = 0, f[36] = -1, f[37] = 0, f[38] = 0, f[39] = -1, f[40] = 0, f[41] = 0, f[42] = -1, f[43] = 0, f[44] = 0, f[45] = -1, f[46] = 0, f[47] = 0, f[48] = 0, f[49] = 1, f[50] = 0, f[51] = 0, f[52] = 1, f[53] = 0, f[54] = 0, f[55] = 1, f[56] = 0, f[57] = 0, f[58] = 1, f[59] = 0, f[60] = 0, f[61] = -1, f[62] = 0, f[63] = 0, f[64] = -1, f[65] = 0, f[66] = 0, f[67] = -1, f[68] = 0, f[69] = 0, f[70] = -1, f[71] = 0, p.normal = new s({ componentDatatype: i.FLOAT, componentsPerAttribute: 3, values: f }) } if (m.st) { var v = new Float32Array(48);
v[0] = 0, v[1] = 0, v[2] = 1, v[3] = 0, v[4] = 1, v[5] = 1, v[6] = 0, v[7] = 1, v[8] = 1, v[9] = 0, v[10] = 0, v[11] = 0, v[12] = 0, v[13] = 1, v[14] = 1, v[15] = 1, v[16] = 0, v[17] = 0, v[18] = 1, v[19] = 0, v[20] = 1, v[21] = 1, v[22] = 0, v[23] = 1, v[24] = 1, v[25] = 0, v[26] = 0, v[27] = 0, v[28] = 0, v[29] = 1, v[30] = 1, v[31] = 1, v[32] = 1, v[33] = 0, v[34] = 0, v[35] = 0, v[36] = 0, v[37] = 1, v[38] = 1, v[39] = 1, v[40] = 0, v[41] = 0, v[42] = 1, v[43] = 0, v[44] = 1, v[45] = 1, v[46] = 0, v[47] = 1, p.st = new s({ componentDatatype: i.FLOAT, componentsPerAttribute: 2, values: v }) } if (m.tangent) { var y = new Float32Array(72);
y[0] = 1, y[1] = 0, y[2] = 0, y[3] = 1, y[4] = 0, y[5] = 0, y[6] = 1, y[7] = 0, y[8] = 0, y[9] = 1, y[10] = 0, y[11] = 0, y[12] = -1, y[13] = 0, y[14] = 0, y[15] = -1, y[16] = 0, y[17] = 0, y[18] = -1, y[19] = 0, y[20] = 0, y[21] = -1, y[22] = 0, y[23] = 0, y[24] = 0, y[25] = 1, y[26] = 0, y[27] = 0, y[28] = 1, y[29] = 0, y[30] = 0, y[31] = 1, y[32] = 0, y[33] = 0, y[34] = 1, y[35] = 0, y[36] = 0, y[37] = -1, y[38] = 0, y[39] = 0, y[40] = -1, y[41] = 0, y[42] = 0, y[43] = -1, y[44] = 0, y[45] = 0, y[46] = -1, y[47] = 0, y[48] = -1, y[49] = 0, y[50] = 0, y[51] = -1, y[52] = 0, y[53] = 0, y[54] = -1, y[55] = 0, y[56] = 0, y[57] = -1, y[58] = 0, y[59] = 0, y[60] = 1, y[61] = 0, y[62] = 0, y[63] = 1, y[64] = 0, y[65] = 0, y[66] = 1, y[67] = 0, y[68] = 0, y[69] = 1, y[70] = 0, y[71] = 0, p.tangent = new s({ componentDatatype: i.FLOAT, componentsPerAttribute: 3, values: y }) } if (m.binormal) { var g = new Float32Array(72);
g[0] = 0, g[1] = 1, g[2] = 0, g[3] = 0, g[4] = 1, g[5] = 0, g[6] = 0, g[7] = 1, g[8] = 0, g[9] = 0, g[10] = 1, g[11] = 0, g[12] = 0, g[13] = 1, g[14] = 0, g[15] = 0, g[16] = 1, g[17] = 0, g[18] = 0, g[19] = 1, g[20] = 0, g[21] = 0, g[22] = 1, g[23] = 0, g[24] = 0, g[25] = 0, g[26] = 1, g[27] = 0, g[28] = 0, g[29] = 1, g[30] = 0, g[31] = 0, g[32] = 1, g[33] = 0, g[34] = 0, g[35] = 1, g[36] = 0, g[37] = 0, g[38] = 1, g[39] = 0, g[40] = 0, g[41] = 1, g[42] = 0, g[43] = 0, g[44] = 1, g[45] = 0, g[46] = 0, g[47] = 1, g[48] = 0, g[49] = 0, g[50] = 1, g[51] = 0, g[52] = 0, g[53] = 1, g[54] = 0, g[55] = 0, g[56] = 1, g[57] = 0, g[58] = 0, g[59] = 1, g[60] = 0, g[61] = 0, g[62] = 1, g[63] = 0, g[64] = 0, g[65] = 1, g[66] = 0, g[67] = 0, g[68] = 1, g[69] = 0, g[70] = 0, g[71] = 1, p.binormal = new s({ componentDatatype: i.FLOAT, componentsPerAttribute: 3, values: g }) } t = new Uint16Array(36), t[0] = 0, t[1] = 1, t[2] = 2, t[3] = 0, t[4] = 2, t[5] = 3, t[6] = 6, t[7] = 5, t[8] = 4, t[9] = 7, t[10] = 6, t[11] = 4, t[12] = 8, t[13] = 9, t[14] = 10, t[15] = 8, t[16] = 10, t[17] = 11, t[18] = 14, t[19] = 13, t[20] = 12, t[21] = 15, t[22] = 14, t[23] = 12, t[24] = 18, t[25] = 17, t[26] = 16, t[27] = 19, t[28] = 18, t[29] = 16, t[30] = 20, t[31] = 21, t[32] = 22, t[33] = 20, t[34] = 22, t[35] = 23 } else o = new Float64Array(24), o[0] = u.x, o[1] = u.y, o[2] = u.z, o[3] = d.x, o[4] = u.y, o[5] = u.z, o[6] = d.x, o[7] = d.y, o[8] = u.z, o[9] = u.x, o[10] = d.y, o[11] = u.z, o[12] = u.x, o[13] = u.y, o[14] = d.z, o[15] = d.x, o[16] = u.y, o[17] = d.z, o[18] = d.x, o[19] = d.y, o[20] = d.z, o[21] = u.x, o[22] = d.y, o[23] = d.z, p.position = new s({ componentDatatype: i.DOUBLE, componentsPerAttribute: 3, values: o }), t = new Uint16Array(36), t[0] = 4, t[1] = 5, t[2] = 6, t[3] = 4, t[4] = 6, t[5] = 7, t[6] = 1, t[7] = 0, t[8] = 3, t[9] = 1, t[10] = 3, t[11] = 2, t[12] = 1, t[13] = 6, t[14] = 5, t[15] = 1, t[16] = 2, t[17] = 6, t[18] = 2, t[19] = 3, t[20] = 7, t[21] = 2, t[22] = 7, t[23] = 6, t[24] = 3, t[25] = 0, t[26] = 4, t[27] = 3, t[28] = 4, t[29] = 7, t[30] = 0, t[31] = 1, t[32] = 5, t[33] = 0, t[34] = 5, t[35] = 4; var _ = r.subtract(d, u, h),
w = .5 * _.magnitude(); return new c({ attributes: p, indices: t, primitiveType: n.TRIANGLES, boundingSphere: new a(r.ZERO, w) }) }, d }), r("Core/BoxOutlineGeometry", ["./defined", "./DeveloperError", "./Cartesian3", "./ComponentDatatype", "./PrimitiveType", "./defaultValue", "./BoundingSphere", "./Geometry", "./GeometryAttribute", "./GeometryAttributes"], function(e, t, r, i, n, o, a, s, l, u) { "use strict"; var c = new r,
h = function(r) { r = o(r, o.EMPTY_OBJECT); var i = r.minimumCorner,
n = r.maximumCorner; if (!e(i)) throw new t("options.minimumCorner is required."); if (!e(n)) throw new t("options.maximumCorner is required");
this._min = i, this._max = n, this._workerName = "createBoxOutlineGeometry" }; return h.fromDimensions = function(r) { r = o(r, o.EMPTY_OBJECT); var i = r.dimensions; if (!e(i)) throw new t("options.dimensions is required."); if (i.x < 0 || i.y < 0 || i.z < 0) throw new t("All dimensions components must be greater than or equal to zero."); var n = i.multiplyByScalar(.5),
a = n.negate(),
s = n,
l = { minimumCorner: a, maximumCorner: s }; return new h(l) }, h.createGeometry = function(e) { var t = e._min,
o = e._max,
h = new u,
d = new Uint16Array(24),
m = new Float64Array(24);
m[0] = t.x, m[1] = t.y, m[2] = t.z, m[3] = o.x, m[4] = t.y, m[5] = t.z, m[6] = o.x, m[7] = o.y, m[8] = t.z, m[9] = t.x, m[10] = o.y, m[11] = t.z, m[12] = t.x, m[13] = t.y, m[14] = o.z, m[15] = o.x, m[16] = t.y, m[17] = o.z, m[18] = o.x, m[19] = o.y, m[20] = o.z, m[21] = t.x, m[22] = o.y, m[23] = o.z, h.position = new l({ componentDatatype: i.DOUBLE, componentsPerAttribute: 3, values: m }), d[0] = 4, d[1] = 5, d[2] = 5, d[3] = 6, d[4] = 6, d[5] = 7, d[6] = 7, d[7] = 4, d[8] = 0, d[9] = 1, d[10] = 1, d[11] = 2, d[12] = 2, d[13] = 3, d[14] = 3, d[15] = 0, d[16] = 0, d[17] = 4, d[18] = 1, d[19] = 5, d[20] = 2, d[21] = 6, d[22] = 3, d[23] = 7; var p = r.subtract(o, t, c),
f = .5 * p.magnitude(); return new s({ attributes: h, indices: d, primitiveType: n.LINES, boundingSphere: new a(r.ZERO, f) }) }, h }), r("Core/Cartesian2", ["./defaultValue", "./defined", "./DeveloperError", "./freezeObject"], function(e, t, r, i) { "use strict"; var n = function(t, r) { this.x = e(t, 0), this.y = e(r, 0) };
n.fromArray = function(i, o, a) { if (!t(i)) throw new r("values is required."); if (o + 2 > i.length) throw new r("offset + 2 is greater than the length of the array."); return o = e(o, 0), t(a) || (a = new n), a.x = i[o + 0], a.y = i[o + 1], a }, n.fromElements = function(e, r, i) { return t(i) ? (i.x = e, i.y = r, i) : new n(e, r) }, n.clone = function(e, r) { return t(e) ? t(r) ? (r.x = e.x, r.y = e.y, r) : new n(e.x, e.y) : void 0 }, n.fromCartesian3 = n.clone, n.fromCartesian4 = n.clone, n.packedLength = 2, n.pack = function(i, n, o) { if (!t(i)) throw new r("value is required"); if (!t(n)) throw new r("array is required");
o = e(o, 0), n[o++] = i.x, n[o] = i.y }, n.unpack = function(i, o, a) { if (!t(i)) throw new r("array is required"); return o = e(o, 0), t(a) || (a = new n), a.x = i[o++], a.y = i[o], a }, n.getMaximumComponent = function(e) { if (!t(e)) throw new r("cartesian is required"); return Math.max(e.x, e.y) }, n.getMinimumComponent = function(e) { if (!t(e)) throw new r("cartesian is required"); return Math.min(e.x, e.y) }, n.magnitudeSquared = function(e) { if (!t(e)) throw new r("cartesian is required"); return e.x * e.x + e.y * e.y }, n.magnitude = function(e) { return Math.sqrt(n.magnitudeSquared(e)) }; var o = new n;
n.distance = function(e, i) { if (!t(e) || !t(i)) throw new r("left and right are required."); return n.subtract(e, i, o), n.magnitude(o) }, n.normalize = function(e, i) { if (!t(e)) throw new r("cartesian is required"); var o = n.magnitude(e); return t(i) ? (i.x = e.x / o, i.y = e.y / o, i) : new n(e.x / o, e.y / o) }, n.dot = function(e, i) { if (!t(e)) throw new r("left is required"); if (!t(i)) throw new r("right is required"); return e.x * i.x + e.y * i.y }, n.multiplyComponents = function(e, i, o) { if (!t(e)) throw new r("left is required"); if (!t(i)) throw new r("right is required"); return t(o) ? (o.x = e.x * i.x, o.y = e.y * i.y, o) : new n(e.x * i.x, e.y * i.y) }, n.add = function(e, i, o) { if (!t(e)) throw new r("left is required"); if (!t(i)) throw new r("right is required"); return t(o) ? (o.x = e.x + i.x, o.y = e.y + i.y, o) : new n(e.x + i.x, e.y + i.y) }, n.subtract = function(e, i, o) { if (!t(e)) throw new r("left is required"); if (!t(i)) throw new r("right is required"); return t(o) ? (o.x = e.x - i.x, o.y = e.y - i.y, o) : new n(e.x - i.x, e.y - i.y) }, n.multiplyByScalar = function(e, i, o) { if (!t(e)) throw new r("cartesian is required"); if ("number" != typeof i) throw new r("scalar is required and must be a number."); return t(o) ? (o.x = e.x * i, o.y = e.y * i, o) : new n(e.x * i, e.y * i) }, n.divideByScalar = function(e, i, o) { if (!t(e)) throw new r("cartesian is required"); if ("number" != typeof i) throw new r("scalar is required and must be a number."); return t(o) ? (o.x = e.x / i, o.y = e.y / i, o) : new n(e.x / i, e.y / i) }, n.negate = function(e, i) { if (!t(e)) throw new r("cartesian is required"); return t(i) ? (i.x = -e.x, i.y = -e.y, i) : new n(-e.x, -e.y) }, n.abs = function(e, i) { if (!t(e)) throw new r("cartesian is required"); return t(i) ? (i.x = Math.abs(e.x), i.y = Math.abs(e.y), i) : new n(Math.abs(e.x), Math.abs(e.y)) }; var a = new n;
n.lerp = function(e, i, o, s) { if (!t(e)) throw new r("start is required."); if (!t(i)) throw new r("end is required."); if ("number" != typeof o) throw new r("t is required and must be a number."); return n.multiplyByScalar(i, o, a), s = n.multiplyByScalar(e, 1 - o, s), n.add(a, s, s) }; var s = new n,
l = new n;
n.angleBetween = function(e, i) { if (!t(e)) throw new r("left is required"); if (!t(i)) throw new r("right is required"); return n.normalize(e, s), n.normalize(i, l), Math.acos(n.dot(s, l)) }; var u = new n; return n.mostOrthogonalAxis = function(e, i) { if (!t(e)) throw new r("cartesian is required."); var o = n.normalize(e, u); return n.abs(o, o), i = o.x <= o.y ? n.clone(n.UNIT_X, i) : n.clone(n.UNIT_Y, i) }, n.equals = function(e, r) { return e === r || t(e) && t(r) && e.x === r.x && e.y === r.y }, n.equalsEpsilon = function(e, i, n) { if ("number" != typeof n) throw new r("epsilon is required and must be a number."); return e === i || t(e) && t(i) && Math.abs(e.x - i.x) <= n && Math.abs(e.y - i.y) <= n }, n.ZERO = i(new n(0, 0)), n.UNIT_X = i(new n(1, 0)), n.UNIT_Y = i(new n(0, 1)), n.prototype.getMaximumComponent = function() { return n.getMaximumComponent(this) }, n.prototype.getMinimumComponent = function() { return n.getMinimumComponent(this) }, n.prototype.clone = function(e) { return n.clone(this, e) }, n.prototype.magnitudeSquared = function() { return n.magnitudeSquared(this) }, n.prototype.magnitude = function() { return n.magnitude(this) }, n.prototype.normalize = function(e) { return n.normalize(this, e) }, n.prototype.dot = function(e) { return n.dot(this, e) }, n.prototype.multiplyComponents = function(e, t) { return n.multiplyComponents(this, e, t) }, n.prototype.add = function(e, t) { return n.add(this, e, t) }, n.prototype.subtract = function(e, t) { return n.subtract(this, e, t) }, n.prototype.multiplyByScalar = function(e, t) { return n.multiplyByScalar(this, e, t) }, n.prototype.divideByScalar = function(e, t) { return n.divideByScalar(this, e, t) }, n.prototype.negate = function(e) { return n.negate(this, e) }, n.prototype.abs = function(e) { return n.abs(this, e) }, n.prototype.lerp = function(e, t, r) { return n.lerp(this, e, t, r) }, n.prototype.angleBetween = function(e) { return n.angleBetween(this, e) }, n.prototype.mostOrthogonalAxis = function(e) { return n.mostOrthogonalAxis(this, e) }, n.prototype.equals = function(e) { return n.equals(this, e) }, n.prototype.equalsEpsilon = function(e, t) { return n.equalsEpsilon(this, e, t) }, n.prototype.toString = function() { return "(" + this.x + ", " + this.y + ")" }, n }), r("Core/TridiagonalSystemSolver", ["./defined", "./DeveloperError"], function(e, t) { "use strict"; var r = {}; return r.solve = function(r, i, n, o) { if (!(e(r) && r instanceof Array)) throw new t("The array lower is required."); if (!(e(i) && i instanceof Array)) throw new t("The array diagonal is required."); if (!(e(n) && n instanceof Array)) throw new t("The array upper is required."); if (!(e(o) && o instanceof Array)) throw new t("The array right is required."); if (i.length !== o.length) throw new t("diagonal and right must have the same lengths."); if (r.length !== n.length) throw new t("lower and upper must have the same lengths."); if (r.length !== i.length - 1) throw new t("lower and upper must be one less than the length of diagonal."); var a = [],
s = [],
l = [];
a.length = n.length, s.length = l.length = o.length, a[0] = n[0] / i[0], s[0] = o[0].multiplyByScalar(1 / i[0]); for (var u, c = 1; c < a.length; ++c) u = 1 / (i[c] - a[c - 1] * r[c - 1]), a[c] = n[c] * u, s[c] = o[c].subtract(s[c - 1].multiplyByScalar(r[c - 1])), s[c] = s[c].multiplyByScalar(u); for (u = 1 / (i[c] - a[c - 1] * r[c - 1]), s[c] = o[c].subtract(s[c - 1].multiplyByScalar(r[c - 1])), s[c] = s[c].multiplyByScalar(u), l[l.length - 1] = s[s.length - 1], c = l.length - 2; c >= 0; --c) l[c] = s[c].subtract(l[c + 1].multiplyByScalar(a[c])); return l }, r }), r("Core/HermiteSpline", ["./defaultValue", "./defined", "./DeveloperError", "./Matrix4", "./Cartesian4", "./TridiagonalSystemSolver"], function(e, t, r, i, n, o) { "use strict";
function a(t, r) { var i = e(t._lastTimeIndex, 0); if (r >= t._points[i].time) { if (i + 1 < t._points.length && r < t._points[i + 1].time) return i; if (i + 2 < t._points.length && r < t._points[i + 2].time) return t._lastTimeIndex = i + 1, t._lastTimeIndex } else if (i - 1 >= 0 && r >= t._points[i - 1].time) return t._lastTimeIndex = i - 1, t._lastTimeIndex; for (i = 0; i < t._points.length - 1 && !(r >= t._points[i].time && r < t._points[i + 1].time); ++i); return i === t._points.length - 1 && (i = t._points.length - 2), t._lastTimeIndex = i, t._lastTimeIndex }
function s(e) { var t = [],
r = [],
i = [],
n = [];
t.length = i.length = e._points.length - 1, r.length = n.length = e._points.length; var a; for (t[0] = r[0] = 1, i[0] = 0, n[0] = e._points[0].tangent, a = 1; a < t.length - 1; ++a) t[a] = i[a] = 1, r[a] = 4, n[a] = e._points[a + 1].point.subtract(e._points[a - 1].point).multiplyByScalar(3);
t[a] = 0, i[a] = 1, r[a] = 4, n[a] = e._points[a + 1].point.subtract(e._points[a - 1].point).multiplyByScalar(3), r[a + 1] = 1, n[a + 1] = e._points[a + 1].tangent; var s = o.solve(t, r, i, n); for (a = 0; a < e._points.length; ++a) e._points[a].tangent = s[a] }
function l(e) { var t = [],
r = [],
i = [],
n = [];
t.length = i.length = e._points.length - 1, r.length = n.length = e._points.length; var a; for (t[0] = i[0] = 1, r[0] = 2, n[0] = e._points[1].point.subtract(e._points[0].point).multiplyByScalar(3), a = 1; a < t.length; ++a) t[a] = i[a] = 1, r[a] = 4, n[a] = e._points[a + 1].point.subtract(e._points[a - 1].point).multiplyByScalar(3);
r[a] = 2, n[a] = e._points[a].point.subtract(e._points[a - 1].point).multiplyByScalar(3); var s = o.solve(t, r, i, n); for (a = 0; a < e._points.length; ++a) e._points[a].tangent = s[a] } var u = function(e) { if (!t(e) || !(e instanceof Array) || e.length < 3) throw new r("controlPoints is required. It must be an array with at least a length of 3.");
this._points = e, this._lastTimeIndex = 0, t(this._points[0].tangent) && t(this._points[this._points.length - 1].tangent) ? t(this._points[0].tangent) && !t(this._points[1].tangent) && t(this._points[this._points.length - 1].tangent) && !t(this._points[this._points.length - 2].tangent) && s(this) : l(this) }; return u.hermiteCoefficientMatrix = new i(2, -3, 0, 1, -2, 3, 0, 0, 1, -2, 1, 0, 1, -1, 0, 0), u.prototype.getControlPoints = function() { return this._points }, u.prototype.evaluate = function(e) { if (!t(e)) throw new r("time is required."); if (e < this._points[0].time || e > this._points[this._points.length - 1].time) throw new r("time is out of range."); var i = a(this, e),
o = (e - this._points[i].time) / (this._points[i + 1].time - this._points[i].time),
s = new n(0, o * o, o);
s.x = s.y * o; var l = u.hermiteCoefficientMatrix.multiplyByPoint(s),
c = this._points[i].point.multiplyByScalar(l.x),
h = this._points[i + 1].point.multiplyByScalar(l.y),
d = this._points[i].tangent.multiplyByScalar(l.z),
m = this._points[i + 1].tangent.multiplyByScalar(l.w); return c.add(h.add(d.add(m))) }, u }), r("Core/CatmullRomSpline", ["./defaultValue", "./defined", "./DeveloperError", "./Matrix4", "./Cartesian3", "./HermiteSpline"], function(e, t, r, i, n, o) { "use strict";
function a(t, r) { var i = e(t._lastTimeIndex, 0); if (r >= t._points[i].time) { if (i + 1 < t._points.length && r < t._points[i + 1].time) return i; if (i + 2 < t._points.length && r < t._points[i + 2].time) return t._lastTimeIndex = i + 1, t._lastTimeIndex } else if (i - 1 >= 0 && r >= t._points[i - 1].time) return t._lastTimeIndex = i - 1, t._lastTimeIndex; for (i = 0; i < t._points.length - 1 && !(r >= t._points[i].time && r < t._points[i + 1].time); ++i); return i === t._points.length - 1 && (i = t._points.length - 2), t._lastTimeIndex = i, t._lastTimeIndex } var s = function(e, i, o) { if (!t(e) || !(e instanceof Array) || e.length < 3) throw new r("controlPoints is required and must be an array of objects with point and time properties, with a length of at least 3."); if (this._points = e, this._lastTimeIndex = 0, t(i)) this._ti = n.clone(i);
else { var a = n.clone(e[0].point),
s = n.clone(e[1].point),
l = n.clone(e[2].point);
this._ti = s.multiplyByScalar(2).subtract(l).subtract(a).multiplyByScalar(.5) } if (t(o)) this._to = n.clone(o);
else { var u = e.length - 1,
c = n.clone(e[u].point),
h = n.clone(e[u - 1].point),
d = n.clone(e[u - 2].point);
this._to = c.subtract(h.multiplyByScalar(2)).add(d).multiplyByScalar(.5) } }; return s.catmullRomCoefficientMatrix = new i(-.5, 1, -.5, 0, 1.5, -2.5, 0, 1, -1.5, 2, .5, 0, .5, -.5, 0, 0), s.prototype.getControlPoints = function() { return this._points }, s.prototype.getStartTangent = function() { return this._ti }, s.prototype.getEndTangent = function() { return this._to }, s.prototype.evaluate = function(e) { if (!t(e)) throw new r("time is required."); if (e < this._points[0].time || e > this._points[this._points.length - 1].time) throw new r("time is out of range."); var i = a(this, e),
l = (e - this._points[i].time) / (this._points[i + 1].time - this._points[i].time),
u = new n(0, l * l, l);
u.x = u.y * l; var c, h, d, m, p; return 0 === i ? (c = this._points[0].point, h = this._points[1].point, d = this._ti, m = this._points[2].point.subtract(c).multiplyByScalar(.5), p = o.hermiteCoefficientMatrix.multiplyByPoint(u)) : i === this._points.length - 2 ? (c = this._points[i].point, h = this._points[i + 1].point, d = h.subtract(this._points[i - 1].point).multiplyByScalar(.5), m = this._to, p = o.hermiteCoefficientMatrix.multiplyByPoint(u)) : (c = this._points[i - 1].point, h = this._points[i].point, d = this._points[i + 1].point, m = this._points[i + 2].point, p = s.catmullRomCoefficientMatrix.multiplyByPoint(u)), c = c.multiplyByScalar(p.x), h = h.multiplyByScalar(p.y), d = d.multiplyByScalar(p.z), m = m.multiplyByScalar(p.w), c.add(h.add(d.add(m))) }, s }), r("Core/IndexDatatype", ["./Enumeration", "./defined", "./DeveloperError", "./FeatureDetection", "./Math"], function(e, t, r, i, n) { "use strict"; if (!i.supportsTypedArrays()) return {}; var o = { UNSIGNED_BYTE: new e(5121, "UNSIGNED_BYTE", { sizeInBytes: Uint8Array.BYTES_PER_ELEMENT }), UNSIGNED_SHORT: new e(5123, "UNSIGNED_SHORT", { sizeInBytes: Uint16Array.BYTES_PER_ELEMENT }), UNSIGNED_INT: new e(5125, "UNSIGNED_INT", { sizeInBytes: Uint32Array.BYTES_PER_ELEMENT }) }; return o.validate = function(e) { return t(e) && t(e.value) && (e.value === o.UNSIGNED_BYTE.value || e.value === o.UNSIGNED_SHORT.value || e.value === o.UNSIGNED_INT.value) }, o.createTypedArray = function(e, i) { if (!t(e)) throw new r("numberOfVertices is required."); return e > n.SIXTY_FOUR_KILOBYTES ? new Uint32Array(i) : new Uint16Array(i) }, o }), r("Core/Quaternion", ["./Cartesian3", "./defaultValue", "./defined", "./DeveloperError", "./freezeObject", "./Math", "./Matrix3"], function(e, t, r, i, n, o, a) { "use strict"; var s, l = function(e, r, i, n) { this.x = t(e, 0), this.y = t(r, 0), this.z = t(i, 0), this.w = t(n, 0) };
l.fromAxisAngle = function(t, n, o) { if (!r(t)) throw new i("axis is required."); if ("number" != typeof n) throw new i("angle is required and must be a number."); var a = n / 2,
u = Math.sin(a);
s = e.normalize(t, s); var c = s.x * u,
h = s.y * u,
d = s.z * u,
m = Math.cos(a); return r(o) ? (o.x = c, o.y = h, o.z = d, o.w = m, o) : new l(c, h, d, m) }; var u = [1, 2, 0],
c = new Array(3);
l.fromRotationMatrix = function(e, t) { if (!r(e)) throw new i("matrix is required."); var n, o, s, h, d, m = e[a.COLUMN0ROW0],
p = e[a.COLUMN1ROW1],
f = e[a.COLUMN2ROW2],
v = m + p + f; if (v > 0) n = Math.sqrt(v + 1), d = .5 * n, n = .5 / n, o = (e[a.COLUMN2ROW1] - e[a.COLUMN1ROW2]) * n, s = (e[a.COLUMN0ROW2] - e[a.COLUMN2ROW0]) * n, h = (e[a.COLUMN1ROW0] - e[a.COLUMN0ROW1]) * n;
else { var y = u,
g = 0;
p > m && (g = 1), f > m && f > p && (g = 2); var _ = y[g],
w = y[_];
n = Math.sqrt(e[a.getElementIndex(g, g)] - e[a.getElementIndex(_, _)] - e[a.getElementIndex(w, w)] + 1); var C = c;
C[g] = .5 * n, n = .5 / n, d = (e[a.getElementIndex(w, _)] - e[a.getElementIndex(_, w)]) * n, C[_] = (e[a.getElementIndex(_, g)] + e[a.getElementIndex(g, _)]) * n, C[w] = (e[a.getElementIndex(w, g)] + e[a.getElementIndex(g, w)]) * n, o = C[0], s = C[1], h = C[2] } return r(t) ? (t.x = o, t.y = s, t.z = h, t.w = d, t) : new l(o, s, h, d) }; var h = new e,
d = new e,
m = new l,
p = new l,
f = new l;
l.packedLength = 4, l.pack = function(e, n, o) { if (!r(e)) throw new i("value is required"); if (!r(n)) throw new i("array is required");
o = t(o, 0), n[o++] = e.x, n[o++] = e.y, n[o++] = e.z, n[o] = e.w }, l.unpack = function(e, n, o) { if (!r(e)) throw new i("array is required"); return n = t(n, 0), r(o) || (o = new l), o.x = e[n], o.y = e[n + 1], o.z = e[n + 2], o.w = e[n + 3], o }, l.packedInterpolationLength = 3, l.convertPackedArrayForInterpolation = function(e, t, r, i) { l.unpack(e, 4 * r, f), f.conjugate(f); for (var n = 0, o = r - t + 1; o > n; n++) { var a = 3 * n;
l.unpack(e, 4 * (t + n), m), m.multiply(f, m), m.w < 0 && m.negate(m), m.getAxis(h); var s = m.getAngle();
i[a] = h.x * s, i[a + 1] = h.y * s, i[a + 2] = h.z * s } }, l.unpackInterpolationResult = function(e, t, i, n, o) { r(o) || (o = new l), d.x = e[0], d.y = e[1], d.z = e[2]; var a = d.magnitude(); return l.unpack(t, 4 * n, p), 0 === a ? l.clone(l.IDENTITY, m) : l.fromAxisAngle(d, a, m), m.multiply(p, o) }, l.clone = function(e, t) { return r(e) ? r(t) ? (t.x = e.x, t.y = e.y, t.z = e.z, t.w = e.w, t) : new l(e.x, e.y, e.z, e.w) : void 0 }, l.conjugate = function(e, t) { if (!r(e)) throw new i("quaternion is required"); return r(t) ? (t.x = -e.x, t.y = -e.y, t.z = -e.z, t.w = e.w, t) : new l(-e.x, -e.y, -e.z, e.w) }, l.magnitudeSquared = function(e) { if (!r(e)) throw new i("quaternion is required"); return e.x * e.x + e.y * e.y + e.z * e.z + e.w * e.w }, l.magnitude = function(e) { if (!r(e)) throw new i("quaternion is required"); return Math.sqrt(l.magnitudeSquared(e)) }, l.normalize = function(e, t) { var i = 1 / l.magnitude(e),
n = e.x * i,
o = e.y * i,
a = e.z * i,
s = e.w * i; return r(t) ? (t.x = n, t.y = o, t.z = a, t.w = s, t) : new l(n, o, a, s) }, l.inverse = function(e, t) { var r = l.magnitudeSquared(e); return t = l.conjugate(e, t), l.multiplyByScalar(t, 1 / r, t) }, l.add = function(e, t, n) { if (!r(e)) throw new i("left is required"); if (!r(t)) throw new i("right is required"); return r(n) ? (n.x = e.x + t.x, n.y = e.y + t.y, n.z = e.z + t.z, n.w = e.w + t.w, n) : new l(e.x + t.x, e.y + t.y, e.z + t.z, e.w + t.w) }, l.subtract = function(e, t, n) { if (!r(e)) throw new i("left is required"); if (!r(t)) throw new i("right is required"); return r(n) ? (n.x = e.x - t.x, n.y = e.y - t.y, n.z = e.z - t.z, n.w = e.w - t.w, n) : new l(e.x - t.x, e.y - t.y, e.z - t.z, e.w - t.w) }, l.negate = function(e, t) { if (!r(e)) throw new i("quaternion is required"); return r(t) ? (t.x = -e.x, t.y = -e.y, t.z = -e.z, t.w = -e.w, t) : new l(-e.x, -e.y, -e.z, -e.w) }, l.dot = function(e, t) { if (!r(e)) throw new i("left is required"); if (!r(t)) throw new i("right is required"); return e.x * t.x + e.y * t.y + e.z * t.z + e.w * t.w }, l.multiply = function(e, t, n) { if (!r(e)) throw new i("left is required"); if (!r(t)) throw new i("right is required"); var o = e.x,
a = e.y,
s = e.z,
u = e.w,
c = t.x,
h = t.y,
d = t.z,
m = t.w,
p = u * c + o * m + a * d - s * h,
f = u * h - o * d + a * m + s * c,
v = u * d + o * h - a * c + s * m,
y = u * m - o * c - a * h - s * d; return r(n) ? (n.x = p, n.y = f, n.z = v, n.w = y, n) : new l(p, f, v, y) }, l.multiplyByScalar = function(e, t, n) { if (!r(e)) throw new i("quaternion is required"); if ("number" != typeof t) throw new i("scalar is required and must be a number."); return r(n) ? (n.x = e.x * t, n.y = e.y * t, n.z = e.z * t, n.w = e.w * t, n) : new l(e.x * t, e.y * t, e.z * t, e.w * t) }, l.divideByScalar = function(e, t, n) { if (!r(e)) throw new i("quaternion is required"); if ("number" != typeof t) throw new i("scalar is required and must be a number."); return r(n) ? (n.x = e.x / t, n.y = e.y / t, n.z = e.z / t, n.w = e.w / t, n) : new l(e.x / t, e.y / t, e.z / t, e.w / t) }, l.getAxis = function(t, n) { if (!r(t)) throw new i("quaternion is required"); var a = t.w; if (Math.abs(a - 1) < o.EPSILON6) return r(n) ? (n.x = n.y = n.z = 0, n) : new e; var s = 1 / Math.sqrt(1 - a * a); return r(n) ? (n.x = t.x * s, n.y = t.y * s, n.z = t.z * s, n) : new e(t.x * s, t.y * s, t.z * s) }, l.getAngle = function(e) { if (!r(e)) throw new i("quaternion is required"); return Math.abs(e.w - 1) < o.EPSILON6 ? 0 : 2 * Math.acos(e.w) }; var v;
l.lerp = function(e, t, n, o) { if (!r(e)) throw new i("start is required."); if (!r(t)) throw new i("end is required."); if ("number" != typeof n) throw new i("t is required and must be a number."); return v = l.multiplyByScalar(t, n, v), o = l.multiplyByScalar(e, 1 - n, o), l.add(v, o, o) }; var y, g, _; return l.slerp = function(e, t, n, a) { if (!r(e)) throw new i("start is required."); if (!r(t)) throw new i("end is required."); if ("number" != typeof n) throw new i("t is required and must be a number."); var s = l.dot(e, t),
u = t; if (0 > s && (s = -s, u = y = l.negate(t, y)), 1 - s < o.EPSILON6) return l.lerp(e, u, n); var c = Math.acos(s); return g = l.multiplyByScalar(e, Math.sin((1 - n) * c), g), _ = l.multiplyByScalar(u, Math.sin(n * c), _), a = l.add(g, _, a), l.multiplyByScalar(a, 1 / Math.sin(c), a) }, l.equals = function(e, t) { return e === t || r(e) && r(t) && e.x === t.x && e.y === t.y && e.z === t.z && e.w === t.w }, l.equalsEpsilon = function(e, t, n) { if ("number" != typeof n) throw new i("epsilon is required and must be a number."); return e === t || r(e) && r(t) && Math.abs(e.x - t.x) <= n && Math.abs(e.y - t.y) <= n && Math.abs(e.z - t.z) <= n && Math.abs(e.w - t.w) <= n }, l.ZERO = n(new l(0, 0, 0, 0)), l.IDENTITY = n(new l(0, 0, 0, 1)), l.prototype.clone = function(e) { return l.clone(this, e) }, l.prototype.conjugate = function(e) { return l.conjugate(this, e) }, l.prototype.magnitudeSquared = function() { return l.magnitudeSquared(this) }, l.prototype.magnitude = function() { return l.magnitude(this) }, l.prototype.normalize = function(e) { return l.normalize(this, e) }, l.prototype.inverse = function(e) { return l.inverse(this, e) }, l.prototype.add = function(e, t) { return l.add(this, e, t) }, l.prototype.subtract = function(e, t) { return l.subtract(this, e, t) }, l.prototype.negate = function(e) { return l.negate(this, e) }, l.prototype.dot = function(e) { return l.dot(this, e) }, l.prototype.multiply = function(e, t) { return l.multiply(this, e, t) }, l.prototype.multiplyByScalar = function(e, t) { return l.multiplyByScalar(this, e, t) }, l.prototype.divideByScalar = function(e, t) { return l.divideByScalar(this, e, t) }, l.prototype.getAxis = function(e) { return l.getAxis(this, e) }, l.prototype.getAngle = function() { return l.getAngle(this) }, l.prototype.lerp = function(e, t, r) { return l.lerp(this, e, t, r) }, l.prototype.slerp = function(e, t, r) { return l.slerp(this, e, t, r) }, l.prototype.equals = function(e) { return l.equals(this, e) }, l.prototype.equalsEpsilon = function(e, t) { return l.equalsEpsilon(this, e, t) }, l.prototype.toString = function() { return "(" + this.x + ", " + this.y + ", " + this.z + ", " + this.w + ")" }, l }), r("Core/EllipseGeometryLibrary", ["./Cartesian3", "./Ellipsoid", "./Math", "./Matrix3", "./Quaternion"], function(e, t, r, i, n) { "use strict";
function o(t, r, o, a, h, d, m, p, f, v) { var y = t + r;
e.multiplyByScalar(a, Math.cos(y), s), e.multiplyByScalar(o, Math.sin(y), l), e.add(s, l, s); var g = Math.cos(t);
g *= g; var _ = Math.sin(t);
_ *= _; var w = d / Math.sqrt(m * g + h * _),
C = w / p; return n.fromAxisAngle(s, C, u), i.fromQuaternion(u, c), i.multiplyByVector(c, f, v), e.normalize(v, v), e.multiplyByScalar(v, p, v), v } var a = {},
s = new e,
l = new e,
u = new n,
c = new i,
h = new e,
d = new e,
m = new e,
p = new e;
a.raisePositionsToHeight = function(t, r, i) { for (var n = r.ellipsoid, o = r.height, a = r.extrudedHeight, s = i ? 2 * (t.length / 3) : t.length / 3, l = new Float64Array(3 * s), u = p, c = t.length, f = i ? c : 0, v = 0; c > v; v += 3) { var y, g = v + 1,
_ = v + 2,
w = e.fromArray(t, v, h);
w = n.scaleToGeodeticSurface(w, w), y = w.clone(d), u = n.geodeticSurfaceNormal(w, u); var C = e.multiplyByScalar(u, o, m);
w = e.add(w, C, w), i && (C = e.multiplyByScalar(u, a, C), y = e.add(y, C, y), l[v + f] = y.x, l[g + f] = y.y, l[_ + f] = y.z), l[v] = w.x, l[g] = w.y, l[_] = w.z } return l }; var f = new e,
v = new e,
y = new e; return a.computeEllipsePositions = function(t, i, n) { var a = t.semiMinorAxis,
s = t.semiMajorAxis,
l = t.rotation,
u = t.center,
c = t.granularity,
p = 2.31,
g = a * a,
_ = s * s,
w = s * a,
C = u.magnitude(),
x = e.normalize(u, f),
S = e.cross(e.UNIT_Z, u, v);
S = e.normalize(S, S); var E, b, T, A, M, P = e.cross(x, S, y),
D = 1 + Math.ceil(r.PI_OVER_TWO / c),
I = p / (D - 1),
O = 2 * D * (D + 1),
R = i ? new Array(3 * O) : void 0,
L = 0,
z = h,
N = d,
F = n ? [] : void 0,
B = n ? [] : void 0,
V = r.PI_OVER_TWO; for (E = 0; D > E && V > 0; ++E) { if (z = o(V, l, P, S, g, w, _, C, x, z), N = o(Math.PI - V, l, P, S, g, w, _, C, x, N), i) { for (R[L++] = z.x, R[L++] = z.y, R[L++] = z.z, T = 2 * E + 2, b = 1; T - 1 > b; ++b) A = b / (T - 1), M = e.lerp(z, N, A, m), R[L++] = M.x, R[L++] = M.y, R[L++] = M.z;
R[L++] = N.x, R[L++] = N.y, R[L++] = N.z } n && (B.unshift(z.x, z.y, z.z), 0 !== E && F.push(N.x, N.y, N.z)), V = r.PI_OVER_TWO - (E + 1) * I } for (D = E, E = D; E > 0; --E) { if (V = r.PI_OVER_TWO - (E - 1) * I, z = o(-V, l, P, S, g, w, _, C, x, z), N = o(V + Math.PI, l, P, S, g, w, _, C, x, N), i) { for (R[L++] = z.x, R[L++] = z.y, R[L++] = z.z, T = 2 * (E - 1) + 2, b = 1; T - 1 > b; ++b) A = b / (T - 1), M = e.lerp(z, N, A, m), R[L++] = M.x, R[L++] = M.y, R[L++] = M.z;
R[L++] = N.x, R[L++] = N.y, R[L++] = N.z } n && (B.unshift(z.x, z.y, z.z), 1 !== E && F.push(N.x, N.y, N.z)) } var q = {}; return i && (R.length !== L && (O = L / 3, R.length = L), q.positions = R, q.numPts = D), n && (q.outerPositions = B.concat(F)), q }, a }), r("Core/barycentricCoordinates", ["./Cartesian3", "./defined", "./DeveloperError"], function(e, t, r) {
"use strict";
var i = new e,
n = new e,
o = new e,
a = function(a, s, l, u, c) {
if (!(t(a) && t(s) && t(l) && t(u))) throw new r("point, p0, p1, and p2 are required.");
t(c) || (c = new e);
var h = l.subtract(s, i),
d = u.subtract(s, n),
m = a.subtract(s, o),
p = h.dot(h),
f = h.dot(d),
v = h.dot(m),
y = d.dot(d),
g = d.dot(m),
_ = 1 / (p * y - f * f);
return c.y = (y * v - f * g) * _, c.z = (p * g - f * v) * _, c.x = 1 - c.y - c.z, c
};
return a
}), r("Core/EncodedCartesian3", ["./Cartesian3", "./defined", "./DeveloperError"], function(e, t, r) { "use strict"; var i = function() { this.high = e.ZERO.clone(), this.low = e.ZERO.clone() };
i.encode = function(e, i) { if (!t(e)) throw new r("value is required");
t(i) || (i = { high: 0, low: 0 }); var n; return e >= 0 ? (n = 65536 * Math.floor(e / 65536), i.high = n, i.low = e - n) : (n = 65536 * Math.floor(-e / 65536), i.high = -n, i.low = e + n), i }; var n = { high: 0, low: 0 };
i.fromCartesian = function(e, o) { if (!t(e)) throw new r("cartesian is required");
t(o) || (o = new i); var a = o.high,
s = o.low; return i.encode(e.x, n), a.x = n.high, s.x = n.low, i.encode(e.y, n), a.y = n.high, s.y = n.low, i.encode(e.z, n), a.z = n.high, s.z = n.low, o }; var o = new i; return i.writeElements = function(e, n, a) { if (!t(e)) throw new r("cartesian is required"); if (!t(n)) throw new r("cartesianArray is required"); if ("number" != typeof a || 0 > a) throw new r("index must be a number greater than or equal to 0.");
i.fromCartesian(e, o); var s = o.high,
l = o.low;
n[a] = s.x, n[a + 1] = s.y, n[a + 2] = s.z, n[a + 3] = l.x, n[a + 4] = l.y, n[a + 5] = l.z }, i }), r("Core/QuadraticRealPolynomial", ["./DeveloperError", "./Math"], function(e, t) { "use strict";
function r(e, r, i) { var n = e + r; return t.sign(e) !== t.sign(r) && Math.abs(n / Math.max(Math.abs(e), Math.abs(r))) < i ? 0 : n } var i = {}; return i.discriminant = function(t, r, i) { if ("number" != typeof t) throw new e("a is a required number."); if ("number" != typeof r) throw new e("b is a required number."); if ("number" != typeof i) throw new e("c is a required number."); var n = r * r - 4 * t * i; return n }, i.realRoots = function(i, n, o) { if ("number" != typeof i) throw new e("a is a required number."); if ("number" != typeof n) throw new e("b is a required number."); if ("number" != typeof o) throw new e("c is a required number."); var a; if (0 === i) return 0 === n ? [] : [-o / n]; if (0 === n) { if (0 === o) return [0, 0]; var s = Math.abs(o),
l = Math.abs(i); if (l > s && s / l < t.EPSILON14) return [0, 0]; if (s > l && l / s < t.EPSILON14) return []; if (a = -o / i, 0 > a) return []; var u = Math.sqrt(a); return [-u, u] } if (0 === o) return a = -n / i, 0 > a ? [a, 0] : [0, a]; var c = n * n,
h = 4 * i * o,
d = r(c, -h, t.EPSILON14); if (0 > d) return []; var m = -.5 * r(n, t.sign(n) * Math.sqrt(d), t.EPSILON14); return n > 0 ? [m / i, o / m] : [o / m, m / i] }, i }), r("Core/CubicRealPolynomial", ["./DeveloperError", "./QuadraticRealPolynomial"], function(e, t) { "use strict";
function r(e, t, r, i) { var n, o, a = e,
s = t / 3,
l = r / 3,
u = i,
c = a * l,
h = s * u,
d = s * s,
m = l * l,
p = a * l - d,
f = a * u - s * l,
v = s * u - m,
y = 4 * p * v - f * f; if (0 > y) { var g, _, w;
d * h >= c * m ? (g = a, _ = p, w = -2 * s * p + a * f) : (g = u, _ = v, w = -u * f + 2 * l * v); var C = 0 > w ? -1 : 1,
x = -C * Math.abs(g) * Math.sqrt(-y);
o = -w + x; var S = o / 2,
E = 0 > S ? -Math.pow(-S, 1 / 3) : Math.pow(S, 1 / 3),
b = o === x ? -E : -_ / E; return n = 0 >= _ ? E + b : -w / (E * E + b * b + _), d * h >= c * m ? [(n - s) / a] : [-u / (n + l)] } var T = p,
A = -2 * s * p + a * f,
M = v,
P = -u * f + 2 * l * v,
D = Math.sqrt(y),
I = Math.sqrt(3) / 2,
O = Math.abs(Math.atan2(a * D, -A) / 3);
n = 2 * Math.sqrt(-T); var R = Math.cos(O);
o = n * R; var L = n * (-R / 2 - I * Math.sin(O)),
z = o + L > 2 * s ? o - s : L - s,
N = a,
F = z / N;
O = Math.abs(Math.atan2(u * D, -P) / 3), n = 2 * Math.sqrt(-M), R = Math.cos(O), o = n * R, L = n * (-R / 2 - I * Math.sin(O)); var B = -u,
V = 2 * l > o + L ? o + l : L + l,
q = B / V,
k = N * V,
U = -z * V - N * B,
W = z * B,
G = (l * U - s * W) / (-s * U + l * k); return G >= F ? q >= F ? q >= G ? [F, G, q] : [F, q, G] : [q, F, G] : q >= F ? [G, F, q] : q >= G ? [G, q, F] : [q, G, F] } var i = {}; return i.discriminant = function(t, r, i, n) { if ("number" != typeof t) throw new e("a is a required number."); if ("number" != typeof r) throw new e("b is a required number."); if ("number" != typeof i) throw new e("c is a required number."); if ("number" != typeof n) throw new e("d is a required number."); var o = t * t,
a = r * r,
s = i * i,
l = n * n,
u = 18 * t * r * i * n + a * s - 27 * o * l - 4 * (t * s * i + a * r * n); return u }, i.realRoots = function(i, n, o, a) { if ("number" != typeof i) throw new e("a is a required number."); if ("number" != typeof n) throw new e("b is a required number."); if ("number" != typeof o) throw new e("c is a required number."); if ("number" != typeof a) throw new e("d is a required number."); var s, l; if (0 === i) return t.realRoots(n, o, a); if (0 === n) { if (0 === o) { if (0 === a) return [0, 0, 0];
l = -a / i; var u = 0 > l ? -Math.pow(-l, 1 / 3) : Math.pow(l, 1 / 3); return [u, u, u] } return 0 === a ? (s = t.realRoots(i, 0, o), 0 === s.Length ? [0] : [s[0], 0, s[1]]) : r(i, 0, o, a) } return 0 === o ? 0 === a ? (l = -n / i, 0 > l ? [l, 0, 0] : [0, 0, l]) : r(i, n, 0, a) : 0 === a ? (s = t.realRoots(i, n, o), 0 === s.length ? [0] : s[1] <= 0 ? [s[0], s[1], 0] : s[0] >= 0 ? [0, s[0], s[1]] : [s[0], 0, s[1]]) : r(i, n, o, a) }, i }), r("Core/QuarticRealPolynomial", ["./DeveloperError", "./Math", "./CubicRealPolynomial", "./QuadraticRealPolynomial"], function(e, t, r, i) { "use strict";
function n(e, n, o, a) { var s = e * e,
l = n - 3 * s / 8,
u = o - n * e / 2 + s * e / 8,
c = a - o * e / 4 + n * s / 16 - 3 * s * s / 256,
h = r.realRoots(1, 2 * l, l * l - 4 * c, -u * u); if (h.length > 0) { var d = -e / 4,
m = h[h.length - 1]; if (Math.abs(m) < t.EPSILON14) { var p = i.realRoots(1, l, c); if (2 === p.length) { var f, v = p[0],
y = p[1]; if (v >= 0 && y >= 0) { var g = Math.sqrt(v),
_ = Math.sqrt(y); return [d - _, d - g, d + g, d + _] } if (v >= 0 && 0 > y) return f = Math.sqrt(v), [d - f, d + f]; if (0 > v && y >= 0) return f = Math.sqrt(y), [d - f, d + f] } return [] } if (m > 0) { var w = Math.sqrt(m),
C = (l + m - u / w) / 2,
x = (l + m + u / w) / 2,
S = i.realRoots(1, w, C),
E = i.realRoots(1, -w, x); return 0 !== S.length ? (S[0] += d, S[1] += d, 0 !== E.length ? (E[0] += d, E[1] += d, S[1] <= E[0] ? [S[0], S[1], E[0], E[1]] : E[1] <= S[0] ? [E[0], E[1], S[0], S[1]] : S[0] >= E[0] && S[1] <= E[1] ? [E[0], S[0], S[1], E[1]] : E[0] >= S[0] && E[1] <= S[1] ? [S[0], E[0], E[1], S[1]] : S[0] > E[0] && S[0] < E[1] ? [E[0], S[0], E[1], S[1]] : [S[0], E[0], S[1], E[1]]) : S) : 0 !== E.length ? (E[0] += d, E[1] += d, E) : [] } } return [] }
function o(e, n, o, a) { var s = o * o,
l = n * n,
u = e * e,
c = -2 * n,
h = o * e + l - 4 * a,
d = u * a - o * n * e + s,
m = r.realRoots(1, c, h, d); if (m.length > 0) { var p, f, v = m[0],
y = n - v,
g = y * y,
_ = e / 2,
w = y / 2,
C = g - 4 * a,
x = g + 4 * Math.abs(a),
S = u - 4 * v,
E = u + 4 * Math.abs(v); if (0 > v || S * x > C * E) { var b = Math.sqrt(S);
p = b / 2, f = 0 === b ? 0 : (e * w - o) / b } else { var T = Math.sqrt(C);
p = 0 === T ? 0 : (e * w - o) / T, f = T / 2 } var A, M;
0 === _ && 0 === p ? (A = 0, M = 0) : t.sign(_) === t.sign(p) ? (A = _ + p, M = v / A) : (M = _ - p, A = v / M); var P, D;
0 === w && 0 === f ? (P = 0, D = 0) : t.sign(w) === t.sign(f) ? (P = w + f, D = a / P) : (D = w - f, P = a / D); var I = i.realRoots(1, A, P),
O = i.realRoots(1, M, D); if (0 !== I.length) return 0 !== O.length ? I[1] <= O[0] ? [I[0], I[1], O[0], O[1]] : O[1] <= I[0] ? [O[0], O[1], I[0], I[1]] : I[0] >= O[0] && I[1] <= O[1] ? [O[0], I[0], I[1], O[1]] : O[0] >= I[0] && O[1] <= I[1] ? [I[0], O[0], O[1], I[1]] : I[0] > O[0] && I[0] < O[1] ? [O[0], I[0], O[1], I[1]] : [I[0], O[0], I[1], O[1]] : I; if (0 !== O.length) return O } return [] } var a = {}; return a.discriminant = function(t, r, i, n, o) { if ("number" != typeof t) throw new e("a is a required number."); if ("number" != typeof r) throw new e("b is a required number."); if ("number" != typeof i) throw new e("c is a required number."); if ("number" != typeof n) throw new e("d is a required number."); if ("number" != typeof o) throw new e("e is a required number."); var a = t * t,
s = a * t,
l = r * r,
u = l * r,
c = i * i,
h = c * i,
d = n * n,
m = d * n,
p = o * o,
f = p * o,
v = l * c * d - 4 * u * m - 4 * t * h * d + 18 * t * r * i * m - 27 * a * d * d + 256 * s * f + o * (18 * u * i * n - 4 * l * h + 16 * t * c * c - 80 * t * r * c * n - 6 * t * l * d + 144 * a * i * d) + p * (144 * t * l * i - 27 * l * l - 128 * a * c - 192 * a * r * n); return v }, a.realRoots = function(i, a, s, l, u) { if ("number" != typeof i) throw new e("a is a required number."); if ("number" != typeof a) throw new e("b is a required number."); if ("number" != typeof s) throw new e("c is a required number."); if ("number" != typeof l) throw new e("d is a required number."); if ("number" != typeof u) throw new e("e is a required number."); if (Math.abs(i) < t.EPSILON15) return r.realRoots(a, s, l, u); var c = a / i,
h = s / i,
d = l / i,
m = u / i,
p = 0 > c ? 1 : 0; switch (p += 0 > h ? p + 1 : p, p += 0 > d ? p + 1 : p, p += 0 > m ? p + 1 : p) {
case 0:
return n(c, h, d, m);
case 1:
return o(c, h, d, m);
case 2:
return o(c, h, d, m);
case 3:
return n(c, h, d, m);
case 4:
return n(c, h, d, m);
case 5:
return o(c, h, d, m);
case 6:
return n(c, h, d, m);
case 7:
return n(c, h, d, m);
case 8:
return o(c, h, d, m);
case 9:
return n(c, h, d, m);
case 10:
return n(c, h, d, m);
case 11:
return o(c, h, d, m);
case 12:
return n(c, h, d, m);
case 13:
return n(c, h, d, m);
case 14:
return n(c, h, d, m);
case 15:
return n(c, h, d, m);
default:
return void 0 } }, a }), r("Core/IntersectionTests", ["./defined", "./DeveloperError", "./Math", "./Cartesian3", "./Cartographic", "./Matrix3", "./QuadraticRealPolynomial", "./QuarticRealPolynomial"], function(e, t, r, i, n, o, a, s) { "use strict";
function l(e, t, i) { var n = e + t; return r.sign(e) !== r.sign(t) && Math.abs(n / Math.max(Math.abs(e), Math.abs(t))) < i ? 0 : n }
function u(e, t, n, u, c) { var h, d = u * u,
m = c * c,
p = (e[o.COLUMN1ROW1] - e[o.COLUMN2ROW2]) * m,
f = c * (u * l(e[o.COLUMN1ROW0], e[o.COLUMN0ROW1], r.EPSILON15) + t.y),
v = e[o.COLUMN0ROW0] * d + e[o.COLUMN2ROW2] * m + u * t.x + n,
y = m * l(e[o.COLUMN2ROW1], e[o.COLUMN1ROW2], r.EPSILON15),
g = c * (u * l(e[o.COLUMN2ROW0], e[o.COLUMN0ROW2]) + t.z),
_ = []; if (0 === g && 0 === y) { if (h = a.realRoots(p, f, v), 0 === h.length) return _; var w = h[0],
C = Math.sqrt(Math.max(1 - w * w, 0)); if (_.push(new i(u, c * w, c * -C)), _.push(new i(u, c * w, c * C)), 2 === h.length) { var x = h[1],
S = Math.sqrt(Math.max(1 - x * x, 0));
_.push(new i(u, c * x, c * -S)), _.push(new i(u, c * x, c * S)) } return _ } var E = g * g,
b = y * y,
T = p * p,
A = g * y,
M = T + b,
P = 2 * (f * p + A),
D = 2 * v * p + f * f - b + E,
I = 2 * (v * f - A),
O = v * v - E; if (0 === M && 0 === P && 0 === D && 0 === I) return _;
h = s.realRoots(M, P, D, I, O); var R = h.length; if (0 === R) return _; for (var L = 0; R > L; ++L) { var z, N = h[L],
F = N * N,
B = Math.max(1 - F, 0),
V = Math.sqrt(B);
z = r.sign(p) === r.sign(v) ? l(p * F + v, f * N, r.EPSILON12) : r.sign(v) === r.sign(f * N) ? l(p * F, f * N + v, r.EPSILON12) : l(p * F + f * N, v, r.EPSILON12); var q = l(y * N, g, r.EPSILON15),
k = z * q;
0 > k ? _.push(new i(u, c * N, c * V)) : k > 0 ? _.push(new i(u, c * N, c * -V)) : 0 !== V ? (_.push(new i(u, c * N, c * -V)), _.push(new i(u, c * N, c * V)), ++L) : _.push(new i(u, c * N, c * V)) } return _ } var c = {};
c.rayPlane = function(n, o, a) { if (!e(n)) throw new t("ray is required."); if (!e(o)) throw new t("plane is required."); var s = n.origin,
l = n.direction,
u = o.normal,
c = i.dot(u, l); if (Math.abs(c) < r.EPSILON15) return void 0; var h = (-o.distance - i.dot(u, s)) / c; return 0 > h ? void 0 : (a = l.multiplyByScalar(h, a), i.add(s, a)) }, c.rayEllipsoid = function(r, i) { if (!e(r)) throw new t("ray is required."); if (!e(i)) throw new t("ellipsoid is required."); var n, o, a, s, l, u = i.getOneOverRadii(),
c = u.multiplyComponents(r.origin),
h = u.multiplyComponents(r.direction),
d = c.magnitudeSquared(),
m = c.dot(h); if (d > 1) { if (m >= 0) return void 0; var p = m * m; if (n = d - 1, o = h.magnitudeSquared(), a = o * n, a > p) return void 0; if (p > a) { s = m * m - a, l = -m + Math.sqrt(s); var f = l / o,
v = n / l; return v > f ? { start: f, stop: v } : { start: v, stop: f } } var y = Math.sqrt(n / o); return { start: y, stop: y } } return 1 > d ? (n = d - 1, o = h.magnitudeSquared(), a = o * n, s = m * m - a, l = -m + Math.sqrt(s), { start: 0, stop: l / o }) : 0 > m ? (o = h.magnitudeSquared(), { start: 0, stop: -m / o }) : void 0 }, c.grazingAltitudeLocation = function(a, s) { if (!e(a)) throw new t("ray is required."); if (!e(s)) throw new t("ellipsoid is required."); var l = a.origin,
c = a.direction,
h = s.geodeticSurfaceNormal(l); if (i.dot(c, h) >= 0) return l; var d, m, p = e(this.rayEllipsoid(a, s)),
f = s.transformPositionToScaledSpace(c),
v = f.normalize(),
y = f.mostOrthogonalAxis(),
g = y.cross(v).normalize(),
_ = v.cross(g).normalize(),
w = new o(v.x, g.x, _.x, v.y, g.y, _.y, v.z, g.z, _.z),
C = w.transpose(),
x = o.fromScale(s.getRadii()),
S = o.fromScale(s.getOneOverRadii()),
E = new o(0, c.z, -c.y, -c.z, 0, c.x, c.y, -c.x, 0),
b = C.multiply(S).multiply(E),
T = b.multiply(x).multiply(w),
A = b.multiplyByVector(l),
M = u(T, A.negate(), 0, 0, 1),
P = M.length; if (P > 0) { for (var D = i.ZERO, I = Number.NEGATIVE_INFINITY, O = 0; P > O; ++O) { d = x.multiplyByVector(w.multiplyByVector(M[O])); var R = d.subtract(l).normalize(),
L = R.dot(c);
L > I && (I = L, D = d) } var z = s.cartesianToCartographic(D); return I = r.clamp(I, 0, 1), m = D.subtract(l).magnitude() * Math.sqrt(1 - I * I), m = p ? -m : m, s.cartographicToCartesian(new n(z.longitude, z.latitude, m)) } return void 0 }; var h = new i; return c.lineSegmentPlane = function(n, o, a, s) { if (!e(n)) throw new t("endPoint0 is required."); if (!e(o)) throw new t("endPoint1 is required."); if (!e(a)) throw new t("plane is required."); var l = i.subtract(o, n, h),
u = a.normal,
c = i.dot(u, l); if (Math.abs(c) < r.EPSILON6) return void 0; var d = i.dot(u, n),
m = -(a.distance + d) / c; return 0 > m || m > 1 ? void 0 : (e(s) || (s = new i), i.multiplyByScalar(l, m, s), i.add(n, s, s), s) }, c.trianglePlaneIntersection = function(r, n, o, a) { if (!(e(r) && e(n) && e(o) && e(a))) throw new t("p0, p1, p2, and plane are required."); var s = a.normal,
l = a.distance,
u = i.dot(s, r) + l < 0,
h = i.dot(s, n) + l < 0,
d = i.dot(s, o) + l < 0,
m = 0;
m += u ? 1 : 0, m += h ? 1 : 0, m += d ? 1 : 0; var p, f; if ((1 === m || 2 === m) && (p = new i, f = new i), 1 === m) { if (u) return c.lineSegmentPlane(r, n, a, p), c.lineSegmentPlane(r, o, a, f), { positions: [r, n, o, p, f], indices: [0, 3, 4, 1, 2, 4, 1, 4, 3] }; if (h) return c.lineSegmentPlane(n, o, a, p), c.lineSegmentPlane(n, r, a, f), { positions: [r, n, o, p, f], indices: [1, 3, 4, 2, 0, 4, 2, 4, 3] }; if (d) return c.lineSegmentPlane(o, r, a, p), c.lineSegmentPlane(o, n, a, f), { positions: [r, n, o, p, f], indices: [2, 3, 4, 0, 1, 4, 0, 4, 3] } } else if (2 === m) { if (!u) return c.lineSegmentPlane(n, r, a, p), c.lineSegmentPlane(o, r, a, f), { positions: [r, n, o, p, f], indices: [1, 2, 4, 1, 4, 3, 0, 3, 4] }; if (!h) return c.lineSegmentPlane(o, n, a, p), c.lineSegmentPlane(r, n, a, f), { positions: [r, n, o, p, f], indices: [2, 0, 4, 2, 4, 3, 1, 3, 4] }; if (!d) return c.lineSegmentPlane(r, o, a, p), c.lineSegmentPlane(n, o, a, f), { positions: [r, n, o, p, f], indices: [0, 1, 4, 0, 4, 3, 2, 3, 4] } } return void 0 }, c }), r("Core/Plane", ["./Cartesian3", "./defined", "./DeveloperError"], function(e, t, r) { "use strict"; var i = function(i, n) { if (!t(i)) throw new r("normal is required."); if (!t(n)) throw new r("distance is required.");
this.normal = e.clone(i), this.distance = n }; return i.fromPointNormal = function(n, o, a) { if (!t(n)) throw new r("point is required."); if (!t(o)) throw new r("normal is required."); var s = -e.dot(o, n); return t(a) ? (e.clone(o, a.normal), a.distance = s, a) : new i(o, s) }, i.getPointDistance = function(i, n) { if (!t(i)) throw new r("plane is required."); if (!t(n)) throw new r("point is required."); return e.dot(i.normal, n) + i.distance }, i.prototype.getPointDistance = function(e) { return i.getPointDistance(this, e) }, i }), r("Core/Tipsify", ["./defaultValue", "./defined", "./DeveloperError"], function(e, t, r) { "use strict"; var i = {}; return i.calculateACMR = function(i) { i = e(i, e.EMPTY_OBJECT); var n = i.indices,
o = i.maximumIndex,
a = e(i.cacheSize, 24); if (!t(n)) throw new r("indices is required."); var s = n.length; if (3 > s || 0 !== s % 3) throw new r("indices length must be a multiple of three."); if (0 >= o) throw new r("maximumIndex must be greater than zero."); if (3 > a) throw new r("cacheSize must be greater than two."); if (!t(o)) { o = 0; for (var l = 0, u = n[l]; s > l;) u > o && (o = u), ++l, u = n[l] } for (var c = [], h = 0; o + 1 > h; h++) c[h] = 0; for (var d = a + 1, m = 0; s > m; ++m) d - c[n[m]] > a && (c[n[m]] = d, ++d); return (d - a + 1) / (s / 3) }, i.tipsify = function(i) {
function n(e, t, r, i) { for (; t.length >= 1;) { var n = t[t.length - 1]; if (t.splice(t.length - 1, 1), e[n].numLiveTriangles > 0) return n } for (; i > a;) { if (e[a].numLiveTriangles > 0) return ++a, a - 1;++a } return -1 }
function o(e, t, r, i, o, a, s) { for (var l, u = -1, c = -1, h = 0; h < r.length;) { var d = r[h];
i[d].numLiveTriangles && (l = 0, o - i[d].timeStamp + 2 * i[d].numLiveTriangles <= t && (l = o - i[d].timeStamp), (l > c || -1 === c) && (c = l, u = d)), ++h } return -1 === u ? n(i, a, e, s) : u } i = e(i, e.EMPTY_OBJECT); var a, s = i.indices,
l = i.maximumIndex,
u = e(i.cacheSize, 24); if (!t(s)) throw new r("indices is required."); var c = s.length; if (3 > c || 0 !== c % 3) throw new r("indices length must be a multiple of three."); if (0 >= l) throw new r("maximumIndex must be greater than zero."); if (3 > u) throw new r("cacheSize must be greater than two."); var h = 0,
d = 0,
m = s[d],
p = c; if (t(l)) h = l + 1;
else { for (; p > d;) m > h && (h = m), ++d, m = s[d]; if (-1 === h) return 0;++h } for (var f = [], v = 0; h > v; v++) f[v] = { numLiveTriangles: 0, timeStamp: 0, vertexTriangles: [] };
d = 0; for (var y = 0; p > d;) f[s[d]].vertexTriangles.push(y), ++f[s[d]].numLiveTriangles, f[s[d + 1]].vertexTriangles.push(y), ++f[s[d + 1]].numLiveTriangles, f[s[d + 2]].vertexTriangles.push(y), ++f[s[d + 2]].numLiveTriangles, ++y, d += 3; var g = 0,
_ = u + 1;
a = 1; var w, C, x = [],
S = [],
E = 0,
b = [],
T = c / 3,
A = []; for (v = 0; T > v; v++) A[v] = !1; for (var M, P; - 1 !== g;) { x = [], C = f[g], P = C.vertexTriangles.length; for (var D = 0; P > D; ++D)
if (y = C.vertexTriangles[D], !A[y]) { A[y] = !0, d = y + y + y; for (var I = 0; 3 > I; ++I) M = s[d], x.push(M), S.push(M), b[E] = M, ++E, w = f[M], --w.numLiveTriangles, _ - w.timeStamp > u && (w.timeStamp = _, ++_), ++d }
g = o(s, u, x, f, _, S, h) } return b }, i }), r("Core/GeometryPipeline", ["./barycentricCoordinates", "./defaultValue", "./defined", "./DeveloperError", "./Cartesian2", "./Cartesian3", "./Cartesian4", "./Cartographic", "./EncodedCartesian3", "./Intersect", "./IntersectionTests", "./Math", "./Matrix3", "./Matrix4", "./Plane", "./GeographicProjection", "./ComponentDatatype", "./IndexDatatype", "./PrimitiveType", "./Tipsify", "./BoundingSphere", "./Geometry", "./GeometryAttribute"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C, x) {
"use strict";
function S(e, t, r, i, n) { e[t++] = r, e[t++] = i, e[t++] = i, e[t++] = n, e[t++] = n, e[t] = r }
function E(e) { for (var t = e.length, r = 6 * (t / 3), i = y.createTypedArray(t, r), n = 0, o = 0; t > o; o += 3, n += 6) S(i, n, e[o], e[o + 1], e[o + 2]); return i }
function b(e) { var t = e.length; if (t >= 3) { var r = 6 * (t - 2),
i = y.createTypedArray(t, r);
S(i, 0, e[0], e[1], e[2]); for (var n = 6, o = 3; t > o; ++o, n += 6) S(i, n, e[o - 1], e[o], e[o - 2]); return i } return new Uint16Array }
function T(e) { if (e.length > 0) { for (var t = e.length - 1, r = 6 * (t - 1), i = y.createTypedArray(t, r), n = e[0], o = 0, a = 1; t > a; ++a, o += 6) S(i, o, n, e[a], e[a + 1]); return i } return new Uint16Array }
function A(e) { var t = {}; for (var i in e)
if (e.hasOwnProperty(i) && r(e[i]) && r(e[i].values)) { var n = e[i];
t[i] = new x({ componentDatatype: n.componentDatatype, componentsPerAttribute: n.componentsPerAttribute, normalize: n.normalize, values: [] }) }
return t }
function M(e, t, i) { for (var n in t)
if (t.hasOwnProperty(n) && r(t[n]) && r(t[n].values))
for (var o = t[n], a = 0; a < o.componentsPerAttribute; ++a) e[n].values.push(o.values[i * o.componentsPerAttribute + a]) }
function P(e, t) { if (r(t))
for (var i = t.values, n = i.length, a = 0; n > a; a += 3) o.fromArray(i, a, Z), m.multiplyByPoint(e, Z, Z), i[a] = Z.x, i[a + 1] = Z.y, i[a + 2] = Z.z }
function D(e, t) { if (r(t))
for (var i = t.values, n = i.length, a = 0; n > a; a += 3) o.fromArray(i, a, Z), d.multiplyByVector(e, Z, Z), i[a] = Z.x, i[a + 1] = Z.y, i[a + 2] = Z.z }
function I(e) { var t, i = e.length,
n = {},
o = e[0].geometry.attributes; for (t in o)
if (o.hasOwnProperty(t) && r(o[t]) && r(o[t].values)) { for (var a = o[t], s = a.values.length, l = !0, u = 1; i > u; ++u) { var c = e[u].geometry.attributes[t]; if (!r(c) || a.componentDatatype.value !== c.componentDatatype.value || a.componentsPerAttribute !== c.componentsPerAttribute || a.normalize !== c.normalize) { l = !1; break } s += c.values.length } l && (n[t] = new x({ componentDatatype: a.componentDatatype, componentsPerAttribute: a.componentsPerAttribute, normalize: a.normalize, values: v.createTypedArray(a.componentDatatype, s) })) }
return n }
function O(e) { if (r(e.indices)) return e; var t = C.computeNumberOfVertices(e); if (3 > t) throw new i("The number of vertices must be at least three."); if (0 !== t % 3) throw new i("The number of vertices must be a multiple of three."); for (var n = y.createTypedArray(t, t), o = 0; t > o; ++o) n[o] = o; return e.indices = n, e }
function R(e) { var t = C.computeNumberOfVertices(e); if (3 > t) throw new i("The number of vertices must be at least three."); var r = y.createTypedArray(t, 3 * (t - 2));
r[0] = 1, r[1] = 0, r[2] = 2; for (var n = 3, o = 3; t > o; ++o) r[n++] = o - 1, r[n++] = 0, r[n++] = o; return e.indices = r, e.primitiveType = g.TRIANGLES, e }
function L(e) { var t = C.computeNumberOfVertices(e); if (3 > t) throw new i("The number of vertices must be at least 3."); var r = y.createTypedArray(t, 3 * (t - 2));
r[0] = 0, r[1] = 1, r[2] = 2, t > 3 && (r[3] = 0, r[4] = 2, r[5] = 3); for (var n = 6, o = 3; t - 1 > o; o += 2) r[n++] = o, r[n++] = o - 1, r[n++] = o + 1, t > o + 2 && (r[n++] = o, r[n++] = o + 1, r[n++] = o + 2); return e.indices = r, e.primitiveType = g.TRIANGLES, e }
function z(e) { if (r(e.indices)) return e; var t = C.computeNumberOfVertices(e); if (2 > t) throw new i("The number of vertices must be at least two."); if (0 !== t % 2) throw new i("The number of vertices must be a multiple of 2."); for (var n = y.createTypedArray(t, t), o = 0; t > o; ++o) n[o] = o; return e.indices = n, e }
function N(e) { var t = C.computeNumberOfVertices(e); if (2 > t) throw new i("The number of vertices must be at least two."); var r = y.createTypedArray(t, 2 * (t - 1));
r[0] = 0, r[1] = 1; for (var n = 2, o = 2; t > o; ++o) r[n++] = o - 1, r[n++] = o; return e.indices = r, e.primitiveType = g.LINES, e }
function F(e) { var t = C.computeNumberOfVertices(e); if (2 > t) throw new i("The number of vertices must be at least two."); var r = y.createTypedArray(t, 2 * t);
r[0] = 0, r[1] = 1; for (var n = 2, o = 2; t > o; ++o) r[n++] = o - 1, r[n++] = o; return r[n++] = t - 1, r[n] = 0, e.indices = r, e.primitiveType = g.LINES, e }
function B(e) { switch (e.primitiveType.value) {
case g.TRIANGLE_FAN.value:
return R(e);
case g.TRIANGLE_STRIP.value:
return L(e);
case g.TRIANGLES.value:
return O(e);
case g.LINE_STRIP.value:
return N(e);
case g.LINE_LOOP.value:
return F(e);
case g.LINES.value:
return z(e) } return e }
function V(e, t) { Math.abs(e.y) < h.EPSILON11 && (e.y = t ? -h.EPSILON11 : h.EPSILON11) }
function q(e, t, r, i) { e.add(t.subtract(e, ot).multiplyByScalar(e.y / (e.y - t.y), ot), r), o.clone(r, i), V(r, !0), V(i, !1) }
function k(e, t, r) { if (e.x >= 0 || t.x >= 0 || r.x >= 0) return void 0; var i = e.y < 0,
n = t.y < 0,
o = r.y < 0;
V(e, i), V(t, n), V(r, o); var a = 0;
a += i ? 1 : 0, a += n ? 1 : 0, a += o ? 1 : 0; var s = ct.indices;
1 === a ? (s[1] = 3, s[2] = 4, s[5] = 6, s[7] = 6, s[8] = 5, i ? (q(e, t, at, lt), q(e, r, st, ut), s[0] = 0, s[3] = 1, s[4] = 2, s[6] = 1) : n ? (q(t, r, at, lt), q(t, e, st, ut), s[0] = 1, s[3] = 2, s[4] = 0, s[6] = 2) : o && (q(r, e, at, lt), q(r, t, st, ut), s[0] = 2, s[3] = 0, s[4] = 1, s[6] = 0)) : 2 === a && (s[2] = 4, s[4] = 4, s[5] = 3, s[7] = 5, s[8] = 6, i ? n ? o || (q(r, e, at, lt), q(r, t, st, ut), s[0] = 0, s[1] = 1, s[3] = 0, s[6] = 2) : (q(t, r, at, lt), q(t, e, st, ut), s[0] = 2, s[1] = 0, s[3] = 2, s[6] = 1) : (q(e, t, at, lt), q(e, r, st, ut), s[0] = 1, s[1] = 2, s[3] = 1, s[6] = 0)); var l = ct.positions; return l[0] = e, l[1] = t, l[2] = r, ct.length = 3, (1 === a || 2 === a) && (l[3] = at, l[4] = st, l[5] = lt, l[6] = ut, ct.length = 7), ct }
function U(t, i, a, s, l, u, c, h) { if (r(l) || r(u) || r(c) || r(h)) { var d, m, p, f, v, y, g, _, w, C, x, S, E, b, T, A, M, P, D = s.positions,
I = D[0],
O = D[1],
R = D[2];
r(l) && (d = o.fromArray(l, 3 * t), m = o.fromArray(l, 3 * i), p = o.fromArray(l, 3 * a)), r(u) && (f = o.fromArray(u, 3 * t), v = o.fromArray(u, 3 * i), y = o.fromArray(u, 3 * a)), r(c) && (g = o.fromArray(c, 3 * t), _ = o.fromArray(c, 3 * i), w = o.fromArray(c, 3 * a)), r(h) && (C = n.fromArray(h, 2 * t), x = n.fromArray(h, 2 * i), S = n.fromArray(h, 2 * a)); for (var L = 3; L < D.length; ++L) { var z = D[L],
N = e(z, I, O, R); if (r(l)) { E = o.multiplyByScalar(d, N.x, E), b = o.multiplyByScalar(m, N.y, b), T = o.multiplyByScalar(p, N.z, T); var F = o.add(E, b);
o.add(F, T, F), o.normalize(F, F), l.push(F.x, F.y, F.z) } if (r(u)) { E = o.multiplyByScalar(f, N.x, E), b = o.multiplyByScalar(v, N.y, b), T = o.multiplyByScalar(y, N.z, T); var B = o.add(E, b);
o.add(B, T, B), o.normalize(B, B), u.push(B.x, B.y, B.z) } if (r(c)) { E = o.multiplyByScalar(g, N.x, E), b = o.multiplyByScalar(_, N.y, b), T = o.multiplyByScalar(w, N.z, T); var V = o.add(E, b);
o.add(V, T, V), o.normalize(V, V), c.push(V.x, V.y, V.z) } if (r(h)) { A = n.multiplyByScalar(C, N.x, A), M = n.multiplyByScalar(x, N.y, M), P = n.multiplyByScalar(S, N.z, P); var q = n.add(A, M);
n.add(q, P, q), h.push(q.x, q.y) } } } }
function W(e) { for (var t = e.attributes, i = t.position.values, n = r(t.normal) ? t.normal.values : void 0, a = r(t.binormal) ? t.binormal.values : void 0, s = r(t.tangent) ? t.tangent.values : void 0, l = r(t.st) ? t.st.values : void 0, u = e.indices, c = Array.prototype.slice.call(i, 0), h = r(n) ? Array.prototype.slice.call(n, 0) : void 0, d = r(a) ? Array.prototype.slice.call(a, 0) : void 0, m = r(s) ? Array.prototype.slice.call(s, 0) : void 0, p = r(l) ? Array.prototype.slice.call(l, 0) : void 0, f = [], g = u.length, _ = 0; g > _; _ += 3) { var w = u[_],
x = u[_ + 1],
S = u[_ + 2],
E = o.fromArray(i, 3 * w),
b = o.fromArray(i, 3 * x),
T = o.fromArray(i, 3 * S),
A = k(E, b, T); if (r(A))
if (c[3 * w + 1] = A.positions[0].y, c[3 * x + 1] = A.positions[1].y, c[3 * S + 1] = A.positions[2].y, A.length > 3) { for (var M = c.length / 3, P = 0; P < A.indices.length; ++P) { var D = A.indices[P];
3 > D ? f.push(u[_ + D]) : f.push(D - 3 + M) } for (var I = 3; I < A.positions.length; ++I) { var O = A.positions[I];
c.push(O.x, O.y, O.z) } U(w, x, S, A, h, d, m, p) } else f.push(w, x, S);
else f.push(w, x, S) } e.attributes.position.values = new Float64Array(c), r(h) && (t.normal.values = v.createTypedArray(t.normal.componentDatatype, h)), r(d) && (t.binormal.values = v.createTypedArray(t.binormal.componentDatatype, d)), r(m) && (t.tangent.values = v.createTypedArray(t.tangent.componentDatatype, m)), r(p) && (t.st.values = v.createTypedArray(t.st.componentDatatype, p)); var R = C.computeNumberOfVertices(e);
e.indices = y.createTypedArray(R, f) }
function G(e) { for (var t = e.attributes, i = t.position.values, n = e.indices, a = Array.prototype.slice.call(i, 0), s = [], l = p.fromPointNormal(o.ZERO, o.UNIT_Y), u = n.length, d = 0; u > d; d += 2) { var m = n[d],
f = n[d + 1],
v = o.fromArray(i, 3 * m),
g = o.fromArray(i, 3 * f); if (Math.abs(v.y) < h.EPSILON6 && (v.y = v.y < 0 ? -h.EPSILON6 : h.EPSILON6, a[3 * m + 1] = v.y), Math.abs(g.y) < h.EPSILON6 && (g.y = g.y < 0 ? -h.EPSILON6 : h.EPSILON6, a[3 * f + 1] = g.y), s.push(m), v.x < 0 || g.x < 0) { var _ = c.lineSegmentPlane(v, g, l); if (r(_)) { var w = o.multiplyByScalar(o.UNIT_Y, 5 * h.EPSILON9);
v.y < 0 && o.negate(w, w); var x = a.length / 3;
s.push(x, x + 1); var S = o.add(_, w);
a.push(S.x, S.y, S.z), o.negate(w, w), o.add(_, w, S), a.push(S.x, S.y, S.z) } } s.push(f) } e.attributes.position.values = new Float64Array(a); var E = C.computeNumberOfVertices(e);
e.indices = y.createTypedArray(E, s) }
var H = {};
H.toWireframe = function(e) { if (!r(e)) throw new i("geometry is required."); var t = e.indices; if (r(t)) { switch (e.primitiveType.value) {
case g.TRIANGLES.value:
e.indices = E(t); break;
case g.TRIANGLE_STRIP.value:
e.indices = b(t); break;
case g.TRIANGLE_FAN.value:
e.indices = T(t); break;
default:
throw new i("geometry.primitiveType must be TRIANGLES, TRIANGLE_STRIP, or TRIANGLE_FAN.") } e.primitiveType = g.LINES } return e }, H.createLineSegmentsForVectors = function(e, n, o) { if (!r(e)) throw new i("geometry is required."); if (!r(e.attributes.position)) throw new i("geometry.attributes.position is required."); if (n = t(n, "normal"), !r(e.attributes[n])) throw new i("geometry.attributes must have an attribute with the same name as the attributeName parameter, " + n + ".");
o = t(o, 1e4); for (var a = e.attributes.position.values, s = e.attributes[n].values, l = a.length, u = new Float64Array(2 * l), c = 0, h = 0; l > h; h += 3) u[c++] = a[h], u[c++] = a[h + 1], u[c++] = a[h + 2], u[c++] = a[h] + s[h] * o, u[c++] = a[h + 1] + s[h + 1] * o, u[c++] = a[h + 2] + s[h + 2] * o; var d, m = e.boundingSphere; return r(m) && (d = new w(m.center, m.radius + o)), new C({ attributes: { position: new x({ componentDatatype: v.DOUBLE, componentsPerAttribute: 3, values: u }) }, primitiveType: g.LINES, boundingSphere: d }) }, H.createAttributeIndices = function(e) { if (!r(e)) throw new i("geometry is required."); var t, n = ["position", "positionHigh", "positionLow", "position3DHigh", "position3DLow", "position2DHigh", "position2DLow", "pickColor", "normal", "st", "binormal", "tangent"],
o = e.attributes,
a = {},
s = 0,
l = n.length; for (t = 0; l > t; ++t) { var u = n[t];
r(o[u]) && (a[u] = s++) } for (var c in o) o.hasOwnProperty(c) && !r(a[c]) && (a[c] = s++); return a }, H.reorderForPreVertexCache = function(e) { if (!r(e)) throw new i("geometry is required."); var t = C.computeNumberOfVertices(e),
n = e.indices; if (r(n)) { for (var o = new Int32Array(t), a = 0; t > a; a++) o[a] = -1; for (var s, l = n, u = l.length, c = y.createTypedArray(t, u), h = 0, d = 0, m = 0; u > h;) s = o[l[h]], -1 !== s ? c[d] = s : (s = l[h], o[s] = m, c[d] = m, ++m), ++h, ++d;
e.indices = c; var p = e.attributes; for (var f in p)
if (p.hasOwnProperty(f) && r(p[f]) && r(p[f].values)) { for (var g = p[f], _ = g.values, w = 0, x = g.componentsPerAttribute, S = v.createTypedArray(g.componentDatatype, _.length); t > w;) { var E = o[w]; for (a = 0; x > a; a++) S[x * E + a] = _[x * w + a];++w } g.values = S } } return e }, H.reorderForPostVertexCache = function(e, t) { if (!r(e)) throw new i("geometry is required."); var n = e.indices; if (e.primitiveType.value === g.TRIANGLES.value && r(n)) { for (var o = n.length, a = 0, s = 0; o > s; s++) n[s] > a && (a = n[s]);
e.indices = _.tipsify({ indices: n, maximumIndex: a, cacheSize: t }) } return e }, H.fitToUnsignedShortIndices = function(e) { if (!r(e)) throw new i("geometry is required."); if (r(e.indices) && e.primitiveType.value !== g.TRIANGLES.value && e.primitiveType.value !== g.LINES.value && e.primitiveType.value !== g.POINTS.value) throw new i("geometry.primitiveType must equal to PrimitiveType.TRIANGLES, PrimitiveType.LINES, or PrimitiveType.POINTS."); var t = [],
n = C.computeNumberOfVertices(e); if (r(e.indices) && n > h.SIXTY_FOUR_KILOBYTES) { var o, a = [],
s = [],
l = 0,
u = A(e.attributes),
c = e.indices,
d = c.length;
e.primitiveType.value === g.TRIANGLES.value ? o = 3 : e.primitiveType.value === g.LINES.value ? o = 2 : e.primitiveType.value === g.POINTS.value && (o = 1); for (var m = 0; d > m; m += o) { for (var p = 0; o > p; ++p) { var f = c[m + p],
v = a[f];
r(v) || (v = l++, a[f] = v, M(u, e.attributes, f)), s.push(v) } l + o > h.SIXTY_FOUR_KILOBYTES && (t.push(new C({ attributes: u, indices: s, primitiveType: e.primitiveType, boundingSphere: e.boundingSphere })), a = [], s = [], l = 0, u = A(e.attributes)) } 0 !== s.length && t.push(new C({ attributes: u, indices: s, primitiveType: e.primitiveType, boundingSphere: e.boundingSphere })) } else t.push(e); return t };
var j = new o,
Y = new s;
H.projectTo2D = function(e, t) { if (!r(e)) throw new i("geometry is required."); if (r(e.attributes.position)) { t = r(t) ? t : new f; for (var n = t.getEllipsoid(), a = e.attributes.position.values, s = new Float64Array(a.length), l = 0, u = 0; u < a.length; u += 3) { var c = o.fromArray(a, u, j),
h = n.cartesianToCartographic(c, Y),
d = t.project(h, j);
s[l++] = d.x, s[l++] = d.y, s[l++] = d.z } e.attributes.position3D = e.attributes.position, e.attributes.position2D = new x({ componentDatatype: v.DOUBLE, componentsPerAttribute: 3, values: s }), delete e.attributes.position } return e };
var X = { high: 0, low: 0 };
H.encodeAttribute = function(e, t, n, o) { if (!r(e)) throw new i("geometry is required."); if (!r(t)) throw new i("attributeName is required."); if (!r(n)) throw new i("attributeHighName is required."); if (!r(o)) throw new i("attributeLowName is required."); var a = e.attributes[t]; if (!r(a)) throw new i("geometry must have attribute matching the attributeName argument: " + t + "."); if (a.componentDatatype.value !== v.DOUBLE.value) throw new i("The attribute componentDatatype must be ComponentDatatype.DOUBLE."); for (var s = a.values, u = s.length, c = new Float32Array(u), h = new Float32Array(u), d = 0; u > d; ++d) l.encode(s[d], X), c[d] = X.high, h[d] = X.low; var m = a.componentsPerAttribute; return e.attributes[n] = new x({ componentDatatype: v.FLOAT, componentsPerAttribute: m, values: c }), e.attributes[o] = new x({ componentDatatype: v.FLOAT, componentsPerAttribute: m, values: h }), delete e.attributes[t], e };
var Z = new o,
K = new m,
J = new d;
H.transformToWorldCoordinates = function(e) { if (!r(e)) throw new i("instance is required."); var t = e.modelMatrix; if (m.equals(t, m.IDENTITY)) return e; var n = e.geometry.attributes;
P(t, n.position), (r(n.normal) || r(n.binormal) || r(n.tangent)) && (m.inverse(t, K), m.transpose(K, K), m.getRotation(K, J), D(J, n.normal), D(J, n.binormal), D(J, n.tangent)); var a = e.geometry.boundingSphere; return r(a) && (m.multiplyByPoint(t, a.center, a.center), a.center = o.fromCartesian4(a.center)), e.modelMatrix = m.IDENTITY.clone(), e }, H.combine = function(e) { if (!r(e) || e.length < 1) throw new i("instances is required and must have length greater than zero."); var t, n, a, s, l = e.length,
u = e[0].modelMatrix,
c = r(e[0].geometry.indices),
h = e[0].geometry.primitiveType; for (n = 1; l > n; ++n) { if (!m.equals(e[n].modelMatrix, u)) throw new i("All instances must have the same modelMatrix."); if (r(e[n].geometry.indices) !== c) throw new i("All instance geometries must have an indices or not have one."); if (e[n].geometry.primitiveType.value !== h.value) throw new i("All instance geometries must have the same primitiveType.") } var d, p, f, v = I(e); for (t in v)
if (v.hasOwnProperty(t))
for (d = v[t].values, s = 0, n = 0; l > n; ++n)
for (p = e[n].geometry.attributes[t].values, f = p.length, a = 0; f > a; ++a) d[s++] = p[a]; var _; if (c) { var x = 0; for (n = 0; l > n; ++n) x += e[n].geometry.indices.length; var S = C.computeNumberOfVertices(new C({ attributes: v, primitiveType: g.POINTS })),
E = y.createTypedArray(S, x),
b = 0,
T = 0; for (n = 0; l > n; ++n) { var A = e[n].geometry.indices,
M = A.length; for (s = 0; M > s; ++s) E[b++] = T + A[s];
T += C.computeNumberOfVertices(e[n].geometry) } _ = E } var P, D = new o,
O = 0; for (n = 0; l > n; ++n) { if (P = e[n].geometry.boundingSphere, !r(P)) { D = void 0; break } o.add(P.center, D, D) } if (r(D))
for (o.divideByScalar(D, l, D), n = 0; l > n; ++n) { P = e[n].geometry.boundingSphere; var R = o.magnitude(o.subtract(P.center, D)) + P.radius;
R > O && (O = R) }
return new C({ attributes: v, indices: _, primitiveType: h, boundingSphere: r(D) ? new w(D, O) : void 0 }) };
var Q = new o,
$ = new o,
et = new o,
tt = new o;
H.computeNormal = function(e) {
if (!r(e)) throw new i("geometry is required.");
var t = e.attributes,
n = e.indices;
if (!r(t.position) || !r(t.position.values)) throw new i("geometry.attributes.position.values is required.");
if (!r(n)) throw new i("geometry.indices is required.");
if (n.length < 2 || 0 !== n.length % 3) throw new i("geometry.indices length must be greater than 0 and be a multiple of 3.");
if (e.primitiveType.value !== g.TRIANGLES.value) throw new i("geometry.primitiveType must be PrimitiveType.TRIANGLES.");
for (var a = e.attributes.position.values, s = e.attributes.position.values.length / 3, l = n.length, u = new Array(s), c = new Array(l / 3), h = new Array(l), d = 0; s > d; d++) u[d] = { indexOffset: 0, count: 0, currentCount: 0 };
var m = 0;
for (d = 0; l > d; d += 3) { var p = n[d],
f = n[d + 1],
y = n[d + 2],
_ = 3 * p,
w = 3 * f,
C = 3 * y;
$.x = a[_], $.y = a[_ + 1], $.z = a[_ + 2], et.x = a[w], et.y = a[w + 1], et.z = a[w + 2], tt.x = a[C], tt.y = a[C + 1], tt.z = a[C + 2], u[p].count++, u[f].count++, u[y].count++, et.subtract($, et), tt.subtract($, tt), c[m] = et.cross(tt), m++ }
var S = 0;
for (d = 0; s > d; d++) u[d].indexOffset += S, S += u[d].count;
m = 0;
var E;
for (d = 0; l > d; d += 3) { E = u[n[d]]; var b = E.indexOffset + E.currentCount;
h[b] = m, E.currentCount++, E = u[n[d + 1]], b = E.indexOffset + E.currentCount, h[b] = m, E.currentCount++, E = u[n[d + 2]], b = E.indexOffset + E.currentCount, h[b] = m, E.currentCount++, m++ }
var T = new Float32Array(3 * s);
for (d = 0; s > d; d++) { var A = 3 * d; if (E = u[d], E.count > 0) { for (o.ZERO.clone(Q), m = 0; m < E.count; m++) Q.add(c[h[E.indexOffset + m]], Q);
Q.normalize(Q), T[A] = Q.x, T[A + 1] = Q.y, T[A + 2] = Q.z } else T[A] = 0, T[A + 1] = 0, T[A + 2] = 1 }
return e.attributes.normal = new x({ componentDatatype: v.FLOAT, componentsPerAttribute: 3, values: T }), e
};
var rt = new o,
it = new o,
nt = new o;
H.computeBinormalAndTangent = function(e) { if (!r(e)) throw new i("geometry is required."); var t = e.attributes,
n = e.indices; if (!r(t.position) || !r(t.position.values)) throw new i("geometry.attributes.position.values is required."); if (!r(t.normal) || !r(t.normal.values)) throw new i("geometry.attributes.normal.values is required."); if (!r(t.st) || !r(t.st.values)) throw new i("geometry.attributes.st.values is required."); if (!r(n)) throw new i("geometry.indices is required."); if (n.length < 2 || 0 !== n.length % 3) throw new i("geometry.indices length must be greater than 0 and be a multiple of 3."); if (e.primitiveType.value !== g.TRIANGLES.value) throw new i("geometry.primitiveType must be PrimitiveType.TRIANGLES."); for (var a = e.attributes.position.values, s = e.attributes.normal.values, l = e.attributes.st.values, u = e.attributes.position.values.length / 3, c = n.length, h = new Array(3 * u), d = 0; d < h.length; d++) h[d] = 0; var m, p, f; for (d = 0; c > d; d += 3) { var y = n[d],
_ = n[d + 1],
w = n[d + 2];
m = 3 * y, p = 3 * _, f = 3 * w; var C = 2 * y,
S = 2 * _,
E = 2 * w,
b = a[m],
T = a[m + 1],
A = a[m + 2],
M = l[C],
P = l[C + 1],
D = l[S + 1] - P,
I = l[E + 1] - P,
O = 1 / ((l[S] - M) * I - (l[E] - M) * D),
R = (I * (a[p] - b) - D * (a[f] - b)) * O,
L = (I * (a[p + 1] - T) - D * (a[f + 1] - T)) * O,
z = (I * (a[p + 2] - A) - D * (a[f + 2] - A)) * O;
h[m] += R, h[m + 1] += L, h[m + 2] += z, h[p] += R, h[p + 1] += L, h[p + 2] += z, h[f] += R, h[f + 1] += L, h[f + 2] += z } var N = new Float32Array(3 * u),
F = new Float32Array(3 * u); for (d = 0; u > d; d++) { m = 3 * d, p = m + 1, f = m + 2; var B = o.fromArray(s, m, rt),
V = o.fromArray(h, m, nt),
q = B.dot(V);
B.multiplyByScalar(q, it), V.subtract(it, V).normalize(V), F[m] = V.x, F[p] = V.y, F[f] = V.z, B.cross(V, V).normalize(V), N[m] = V.x, N[p] = V.y, N[f] = V.z } return e.attributes.tangent = new x({ componentDatatype: v.FLOAT, componentsPerAttribute: 3, values: F }), e.attributes.binormal = new x({ componentDatatype: v.FLOAT, componentsPerAttribute: 3, values: N }), e };
var ot = new o,
at = new o,
st = new o,
lt = new o,
ut = new o,
ct = { positions: new Array(7), indices: new Array(9) };
return H.wrapLongitude = function(e) { if (!r(e)) throw new i("geometry is required."); var t = e.boundingSphere; if (r(t)) { var n = t.center.x - t.radius; if (n > 0 || w.intersect(t, a.UNIT_Y) !== u.INTERSECTING) return e } return B(e), e.primitiveType.value === g.TRIANGLES.value ? W(e) : e.primitiveType.value === g.LINES.value && G(e), e }, H
}), r("Core/GeometryInstanceAttribute", ["./defaultValue", "./defined", "./DeveloperError"], function(e, t, r) { "use strict"; var i = function(i) { if (i = e(i, e.EMPTY_OBJECT), !t(i.componentDatatype)) throw new r("options.componentDatatype is required."); if (!t(i.componentsPerAttribute)) throw new r("options.componentsPerAttribute is required."); if (i.componentsPerAttribute < 1 || i.componentsPerAttribute > 4) throw new r("options.componentsPerAttribute must be between 1 and 4."); if (!t(i.value)) throw new r("options.value is required.");
this.componentDatatype = i.componentDatatype, this.componentsPerAttribute = i.componentsPerAttribute, this.normalize = e(i.normalize, !1), this.value = i.value }; return i }), r("Core/GeometryInstance", ["./defaultValue", "./defined", "./DeveloperError", "./Matrix4", "./Geometry", "./GeometryInstanceAttribute"], function(e, t, r, i) { "use strict"; var n = function(n) { if (n = e(n, e.EMPTY_OBJECT), !t(n.geometry)) throw new r("options.geometry is required.");
this.geometry = n.geometry, this.modelMatrix = i.clone(e(n.modelMatrix, i.IDENTITY)), this.id = n.id, this.attributes = e(n.attributes, {}) }; return n }), r("Core/EllipseGeometry", ["./defaultValue", "./defined", "./BoundingSphere", "./Cartesian2", "./Cartesian3", "./Cartographic", "./ComponentDatatype", "./IndexDatatype", "./DeveloperError", "./Ellipsoid", "./EllipseGeometryLibrary", "./GeographicProjection", "./Geometry", "./GeometryPipeline", "./GeometryInstance", "./GeometryAttribute", "./GeometryAttributes", "./Math", "./Matrix3", "./PrimitiveType", "./Quaternion", "./VertexFormat"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C) { "use strict";
function x(e, t, r) { var i = t.vertexFormat,
o = t.center,
s = t.semiMajorAxis,
l = t.ellipsoid,
u = t.stRotation,
d = r ? 2 * (e.length / 3) : e.length / 3,
m = i.st ? new Float32Array(2 * d) : void 0,
p = i.normal ? new Float32Array(3 * d) : void 0,
y = i.tangent ? new Float32Array(3 * d) : void 0,
_ = i.binormal ? new Float32Array(3 * d) : void 0,
C = 0,
x = z,
S = N,
E = F,
b = new h(l),
T = b.project(l.cartesianToCartographic(o, B), V),
A = l.scaleToGeodeticSurface(o, M);
l.geodeticSurfaceNormal(A, A); for (var I = w.fromAxisAngle(A, u, L), q = g.fromQuaternion(I, R), k = e.length, U = r ? k : 0, W = 2 * (U / 3), G = 0; k > G; G += 3) { var H = G + 1,
j = G + 2,
Y = n.fromArray(e, G, M); if (i.st) { var X = g.multiplyByVector(q, Y, P),
Z = b.project(l.cartesianToCartographic(X, B), D);
Z = n.subtract(Z, T, Z), O.x = (Z.x + s) / (2 * s), O.y = (Z.y + s) / (2 * s), r && (m[C + W] = O.x, m[C + 1 + W] = O.y), m[C++] = O.x, m[C++] = O.y } x = l.geodeticSurfaceNormal(Y, x), (i.normal || i.tangent || i.binormal) && ((i.tangent || i.binormal) && (S = n.cross(n.UNIT_Z, x, S), g.multiplyByVector(q, S, S)), i.normal && (p[G] = x.x, p[H] = x.y, p[j] = x.z, r && (p[G + U] = -x.x, p[H + U] = -x.y, p[j + U] = -x.z)), i.tangent && (y[G] = S.x, y[H] = S.y, y[j] = S.z, r && (y[G + U] = -S.x, y[H + U] = -S.y, y[j + U] = -S.z)), i.binormal && (E = n.cross(x, S, E), _[G] = E.x, _[H] = E.y, _[j] = E.z, r && (_[G + U] = E.x, _[H + U] = E.y, _[j + U] = E.z))) } var K = new v; if (i.position) { var J = c.raisePositionsToHeight(e, t, r);
K.position = new f({ componentDatatype: a.DOUBLE, componentsPerAttribute: 3, values: J }) } return i.st && (K.st = new f({ componentDatatype: a.FLOAT, componentsPerAttribute: 2, values: m })), i.normal && (K.normal = new f({ componentDatatype: a.FLOAT, componentsPerAttribute: 3, values: p })), i.tangent && (K.tangent = new f({ componentDatatype: a.FLOAT, componentsPerAttribute: 3, values: y })), i.binormal && (K.binormal = new f({ componentDatatype: a.FLOAT, componentsPerAttribute: 3, values: _ })), K }
function S(e) { var t, r, i, n, o, a = new Array(2 * e * (e + 1)),
s = 0; for (n = 1; e > n; ++n) { for (i = n * (n + 1), t = (n - 1) * n, a[s++] = i++, a[s++] = t, a[s++] = i, r = 2 * n, o = 0; r - 1 > o; ++o) a[s++] = i, a[s++] = t++, a[s++] = t, a[s++] = i++, a[s++] = t, a[s++] = i;
a[s++] = i++, a[s++] = t, a[s++] = i } for (r = 2 * e, ++i, ++t, n = 0; r - 1 > n; ++n) a[s++] = i, a[s++] = t++, a[s++] = t, a[s++] = i++, a[s++] = t, a[s++] = i; for (++t, ++i, n = e - 1; n > 0; --n) { for (a[s++] = t++, a[s++] = t, a[s++] = i, r = 2 * n, o = 0; r - 1 > o; ++o) a[s++] = i, a[s++] = t++, a[s++] = t, a[s++] = i++, a[s++] = t, a[s++] = i;
a[s++] = t++, a[s++] = t++, a[s++] = i++ } return a }
function E(e) { var t = e.center;
q = n.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t, q), e.height, q), q = n.add(t, q, q); var i = new r(q, e.semiMajorAxis),
o = c.computeEllipsePositions(e, !0, !1),
a = o.positions,
l = o.numPts,
u = x(a, e, !1),
h = S(l); return h = s.createTypedArray(a.length / 3, h), { boundingSphere: i, attributes: u, indices: h } }
function b(e, t) { var r = t.vertexFormat,
i = t.center,
o = t.semiMajorAxis,
s = t.ellipsoid,
l = t.height,
u = t.extrudedHeight,
c = t.stRotation,
d = 2 * (e.length / 3),
m = new Float64Array(3 * d),
p = r.st ? new Float32Array(2 * d) : void 0,
y = r.normal ? new Float32Array(3 * d) : void 0,
_ = r.tangent ? new Float32Array(3 * d) : void 0,
C = r.binormal ? new Float32Array(3 * d) : void 0,
x = 0,
S = z,
E = N,
b = F,
T = new h(s),
A = T.project(s.cartesianToCartographic(i, B), V),
q = s.scaleToGeodeticSurface(i, M);
s.geodeticSurfaceNormal(q, q); for (var k = w.fromAxisAngle(q, c, L), U = g.fromQuaternion(k, R), W = e.length, G = 2 * (W / 3), H = 0; W > H; H += 3) { var j, Y = H + 1,
X = H + 2,
Z = n.fromArray(e, H, M); if (r.st) { var K = g.multiplyByVector(U, Z, P),
J = T.project(s.cartesianToCartographic(K, B), D);
J = n.subtract(J, A, J), O.x = (J.x + o) / (2 * o), O.y = (J.y + o) / (2 * o), p[x + G] = O.x, p[x + 1 + G] = O.y, p[x++] = O.x, p[x++] = O.y } Z = s.scaleToGeodeticSurface(Z, Z), j = Z.clone(P), S = s.geodeticSurfaceNormal(Z, S); var Q = n.multiplyByScalar(S, l, I); if (Z = n.add(Z, Q, Z), Q = n.multiplyByScalar(S, u, Q), j = n.add(j, Q, j), r.position && (m[H + W] = j.x, m[Y + W] = j.y, m[X + W] = j.z, m[H] = Z.x, m[Y] = Z.y, m[X] = Z.z), r.normal || r.tangent || r.binormal) { b = S.clone(b); var $ = n.fromArray(e, (H + 3) % W, I);
$ = $.subtract(Z, $); var et = j.subtract(Z, D);
S = et.cross($, S).normalize(S), r.normal && (y[H] = S.x, y[Y] = S.y, y[X] = S.z, y[H + W] = S.x, y[Y + W] = S.y, y[X + W] = S.z), r.tangent && (E = n.cross(b, S, E).normalize(E), _[H] = E.x, _[Y] = E.y, _[X] = E.z, _[H + W] = E.x, _[H + 1 + W] = E.y, _[H + 2 + W] = E.z), r.binormal && (C[H] = b.x, C[Y] = b.y, C[X] = b.z, C[H + W] = b.x, C[Y + W] = b.y, C[X + W] = b.z) } } var tt = new v; return r.position && (tt.position = new f({ componentDatatype: a.DOUBLE, componentsPerAttribute: 3, values: m })), r.st && (tt.st = new f({ componentDatatype: a.FLOAT, componentsPerAttribute: 2, values: p })), r.normal && (tt.normal = new f({ componentDatatype: a.FLOAT, componentsPerAttribute: 3, values: y })), r.tangent && (tt.tangent = new f({ componentDatatype: a.FLOAT, componentsPerAttribute: 3, values: _ })), r.binormal && (tt.binormal = new f({ componentDatatype: a.FLOAT, componentsPerAttribute: 3, values: C })), tt }
function T(e) { for (var t, r, i, n, o = e.length / 3, a = s.createTypedArray(o, 6 * o), l = 0, u = 0; o - 1 > u; u++) t = u, i = u + o, r = t + 1, n = r + o, a[l++] = t, a[l++] = i, a[l++] = r, a[l++] = r, a[l++] = i, a[l++] = n; return t = o - 1, i = u + o, r = 0, n = r + o, a[l++] = t, a[l++] = i, a[l++] = r, a[l++] = r, a[l++] = i, a[l++] = n, a }
function A(e) { var t = e.center,
i = e.ellipsoid,
o = e.semiMajorAxis,
a = n.multiplyByScalar(i.geodeticSurfaceNormal(t, M), e.height, M);
k.center = n.add(t, a, k.center), k.radius = o, a = n.multiplyByScalar(i.geodeticSurfaceNormal(t, a), e.extrudedHeight, a), U.center = n.add(t, a, U.center), U.radius = o; var l = c.computeEllipsePositions(e, !0, !0),
u = l.positions,
h = l.numPts,
f = l.outerPositions,
v = r.union(k, U),
y = x(u, e, !0),
g = S(h),
w = g.length;
g.length = 2 * w; for (var C = u.length / 3, E = 0; w > E; E += 3) g[E + w] = g[E + 2] + C, g[E + 1 + w] = g[E + 1] + C, g[E + 2 + w] = g[E] + C; var A = s.createTypedArray(2 * C / 3, g),
P = new d({ attributes: y, indices: A, primitiveType: _.TRIANGLES }),
D = b(f, e);
g = T(f); var I = s.createTypedArray(2 * f.length / 3, g),
O = new d({ attributes: D, indices: I, primitiveType: _.TRIANGLES }),
R = m.combine([new p({ geometry: P }), new p({ geometry: O })]); return { boundingSphere: v, attributes: R.attributes, indices: R.indices } } var M = new n,
P = new n,
D = new n,
I = new n,
O = new i,
R = new g,
L = new w,
z = new n,
N = new n,
F = new n,
B = new o,
V = new n,
q = new n,
k = new r,
U = new r,
W = function(r) { r = e(r, e.EMPTY_OBJECT); var i = r.center,
o = r.semiMajorAxis,
a = r.semiMinorAxis,
s = e(r.granularity, y.RADIANS_PER_DEGREE),
c = e(r.height, 0),
h = r.extrudedHeight,
d = t(h) && !y.equalsEpsilon(c, h, 1); if (!t(i)) throw new l("center is required."); if (!t(o)) throw new l("semiMajorAxis is required."); if (!t(a)) throw new l("semiMinorAxis is required."); if (0 >= o || 0 >= a) throw new l("Semi-major and semi-minor axes must be greater than zero."); if (a > o) throw new l("semiMajorAxis must be larger than the semiMajorAxis."); if (0 >= s) throw new l("granularity must be greater than zero.");
this._center = n.clone(i), this._semiMajorAxis = o, this._semiMinorAxis = a, this._ellipsoid = e(r.ellipsoid, u.WGS84), this._rotation = e(r.rotation, 0), this._stRotation = e(r.stRotation, 0), this._height = c, this._granularity = s, this._vertexFormat = e(r.vertexFormat, C.DEFAULT), this._extrudedHeight = h, this._extrude = d, this._workerName = "createEllipseGeometry" }; return W.createGeometry = function(e) { var t, r = { center: e._center, semiMajorAxis: e._semiMajorAxis, semiMinorAxis: e._semiMinorAxis, ellipsoid: e._ellipsoid, rotation: e._rotation, height: e._height, extrudedHeight: e._extrudedHeight, granularity: e._granularity, vertexFormat: e._vertexFormat, stRotation: e._stRotation }; return e._extrude ? (r.extrudedHeight = Math.min(e._extrudedHeight, e._height), r.height = Math.max(e._extrudedHeight, e._height), t = A(r)) : t = E(r), new d({ attributes: t.attributes, indices: t.indices, primitiveType: _.TRIANGLES, boundingSphere: t.boundingSphere }) }, W }), r("Core/CircleGeometry", ["./defaultValue", "./defined", "./DeveloperError", "./EllipseGeometry"], function(e, t, r, i) { "use strict"; var n = function(n) { n = e(n, e.EMPTY_OBJECT); var o = n.radius; if (!t(o)) throw new r("radius is required."); if (0 >= o) throw new r("radius must be greater than zero."); var a = { center: n.center, semiMajorAxis: o, semiMinorAxis: o, ellipsoid: n.ellipsoid, height: n.height, extrudedHeight: n.extrudedHeight, granularity: n.granularity, vertexFormat: n.vertexFormat, stRotation: n.stRotation };
this._ellipseGeometry = new i(a), this._workerName = "createCircleGeometry" }; return n.createGeometry = function(e) { return i.createGeometry(e._ellipseGeometry) }, n }), r("Core/EllipseOutlineGeometry", ["./defaultValue", "./defined", "./BoundingSphere", "./Cartesian3", "./ComponentDatatype", "./IndexDatatype", "./DeveloperError", "./Ellipsoid", "./EllipseGeometryLibrary", "./Geometry", "./GeometryAttribute", "./GeometryAttributes", "./Math", "./PrimitiveType"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m) { "use strict";
function p(e) { var t = e.center;
y = i.multiplyByScalar(e.ellipsoid.geodeticSurfaceNormal(t, y), e.height, y), y = i.add(t, y, y); for (var a = new r(y, e.semiMajorAxis), s = l.computeEllipsePositions(e, !1, !0).outerPositions, u = new h({ position: new c({ componentDatatype: n.DOUBLE, componentsPerAttribute: 3, values: l.raisePositionsToHeight(s, e, !1) }) }), d = s.length / 3, m = o.createTypedArray(d, 2 * d), p = 0, f = 0; d - 1 > f; f++) m[p++] = f, m[p++] = f + 1; return m[p++] = d - 1, m[p++] = 0, { boundingSphere: a, attributes: u, indices: m } }
function f(t) { var a = e(t.numberOfVerticalLines, 16);
a = Math.max(a, 0); var s = t.center,
u = t.ellipsoid,
d = t.semiMajorAxis,
m = i.multiplyByScalar(u.geodeticSurfaceNormal(s, v), t.height, v);
g.center = i.add(s, m, g.center), g.radius = d, m = i.multiplyByScalar(u.geodeticSurfaceNormal(s, m), t.extrudedHeight, m), _.center = i.add(s, m, _.center), _.radius = d; var p = l.computeEllipsePositions(t, !1, !0).outerPositions,
f = new h({ position: new c({ componentDatatype: n.DOUBLE, componentsPerAttribute: 3, values: l.raisePositionsToHeight(p, t, !0) }) });
p = f.position.values; var y = r.union(g, _),
w = p.length / 3,
C = o.createTypedArray(w, 2 * w + 2 * a);
w /= 2; for (var x = 0, S = 0; w - 1 > S; S++) C[x++] = S, C[x++] = S + 1, C[x++] = S + w, C[x++] = S + w + 1;
C[x++] = w - 1, C[x++] = 0, C[x++] = w + w - 1, C[x++] = w; var E; if (a > 0) { var b = Math.min(a, w);
E = Math.round(w / b) } var T = Math.min(E * a, w); if (a > 0)
for (S = 0; T > S; S += E) C[x++] = S, C[x++] = S + w; return { boundingSphere: y, attributes: f, indices: C } } var v = new i,
y = new i,
g = new r,
_ = new r,
w = function(r) { r = e(r, e.EMPTY_OBJECT); var n = r.center,
o = r.semiMajorAxis,
l = r.semiMinorAxis,
u = e(r.granularity, d.RADIANS_PER_DEGREE),
c = e(r.height, 0),
h = r.extrudedHeight,
m = t(h) && !d.equalsEpsilon(c, h, 1); if (!t(n)) throw new a("center is required."); if (!t(o)) throw new a("semiMajorAxis is required."); if (!t(l)) throw new a("semiMinorAxis is required."); if (0 >= o || 0 >= l) throw new a("Semi-major and semi-minor axes must be greater than zero."); if (l > o) throw new a("semiMajorAxis must be larger than the semiMajorAxis."); if (0 >= u) throw new a("granularity must be greater than zero.");
this._center = i.clone(n), this._semiMajorAxis = o, this._semiMinorAxis = l, this._ellipsoid = e(r.ellipsoid, s.WGS84), this._rotation = e(r.rotation, 0), this._height = c, this._granularity = u, this._extrudedHeight = h, this._extrude = m, this._numberOfVerticalLines = Math.max(e(r.numberOfVerticalLines, 16), 0), this._workerName = "createEllipseOutlineGeometry" }; return w.createGeometry = function(e) { var t, r = { center: e._center, semiMajorAxis: e._semiMajorAxis, semiMinorAxis: e._semiMinorAxis, ellipsoid: e._ellipsoid, rotation: e._rotation, height: e._height, extrudedHeight: e._extrudedHeight, granularity: e._granularity, numberOfVerticalLines: e._numberOfVerticalLines }; return e._extrude ? (r.extrudedHeight = Math.min(e._extrudedHeight, e._height), r.height = Math.max(e._extrudedHeight, e._height), t = f(r)) : t = p(r), new u({ attributes: t.attributes, indices: t.indices, primitiveType: m.LINES, boundingSphere: t.boundingSphere }) }, w }), r("Core/CircleOutlineGeometry", ["./defaultValue", "./defined", "./DeveloperError", "./EllipseOutlineGeometry"], function(e, t, r, i) { "use strict"; var n = function(n) { n = e(n, e.EMPTY_OBJECT); var o = n.radius; if (!t(o)) throw new r("radius is required."); if (0 >= o) throw new r("radius must be greater than zero."); var a = { center: n.center, semiMajorAxis: o, semiMinorAxis: o, ellipsoid: n.ellipsoid, height: n.height, extrudedHeight: n.extrudedHeight, granularity: n.granularity, numberOfVerticalLines: n.numberOfVerticalLines };
this._ellipseGeometry = new i(a), this._workerName = "createCircleOutlineGeometry" }; return n.createGeometry = function(e) { return i.createGeometry(e._ellipseGeometry) }, n }), r("Core/binarySearch", ["./defined", "./DeveloperError"], function(e, t) { "use strict"; var r = function(r, i, n) { if (!e(r)) throw new t("array is required."); if (!e(i)) throw new t("itemToFind is required."); if (!e(n)) throw new t("comparator is required."); for (var o, a, s = 0, l = r.length - 1; l >= s;)
if (o = ~~((s + l) / 2), a = n(r[o], i), 0 > a) s = o + 1;
else { if (!(a > 0)) return o;
l = o - 1 }
return ~(l + 1) }; return r }), r("Core/TimeConstants", [], function() { "use strict"; var e = { SECONDS_PER_MILLISECOND: .001, SECONDS_PER_MINUTE: 60, MINUTES_PER_HOUR: 60, HOURS_PER_DAY: 24, SECONDS_PER_HOUR: 3600, MINUTES_PER_DAY: 1440, SECONDS_PER_DAY: 86400, DAYS_PER_JULIAN_CENTURY: 36525, PICOSECOND: 1e-9, MODIFIED_JULIAN_DATE_DIFFERENCE: 2400000.5 }; return e }), r("Core/LeapSecond", ["./defined", "./DeveloperError"], function(e, t) { "use strict"; var r = function(r, i) { if (!e(r)) throw new t("date is required."); if (null === i || isNaN(i)) throw new t("offset is required and must be a number.");
this.julianDate = r, this.offset = i }; return r.setLeapSeconds = function(e) { if (!Array.isArray(e)) throw new t("leapSeconds is required and must be an array.");
r._leapSeconds = e, r._leapSeconds.sort(r.compareLeapSecondDate) }, r.getLeapSeconds = function() { return r._leapSeconds }, r.prototype.equals = function(e) { return this.julianDate.equals(e.julianDate) && this.offset === e.offset }, r.compareLeapSecondDate = function(e, t) { return e.julianDate.compareTo(t.julianDate) }, r._leapSeconds = [], r }), r("Core/TimeStandard", [], function() { "use strict"; var e = { UTC: 0, TAI: 1 }; return e }), r("Core/isLeapYear", ["./DeveloperError"], function(e) { "use strict";
function t(t) { if (null === t || isNaN(t)) throw new e("year is required and must be a number."); return 0 === t % 4 && 0 !== t % 100 || 0 === t % 400 } return t }), r("ThirdParty/sprintf", [], function() {
function e() { var e = /%%|%(\d+\$)?([-+\'#0 ]*)(\*\d+\$|\*|\d+)?(\.(\*\d+\$|\*|\d+))?([scboxXuideEfFgG])/g,
t = arguments,
r = 0,
i = t[r++],
n = function(e, t, r, i) { r || (r = " "); var n = e.length >= t ? "" : Array(1 + t - e.length >>> 0).join(r); return i ? e + n : n + e },
o = function(e, t, r, i, o, a) { var s = i - e.length; return s > 0 && (e = r || !o ? n(e, i, a, r) : e.slice(0, t.length) + n("", s, "0", !0) + e.slice(t.length)), e },
a = function(e, t, r, i, a, s, l) { var u = e >>> 0; return r = r && u && { 2: "0b", 8: "0", 16: "0x" }[t] || "", e = r + n(u.toString(t), s || 0, "0", !1), o(e, r, i, a, l) },
s = function(e, t, r, i, n, a) { return null != i && (e = e.slice(0, i)), o(e, "", t, r, n, a) },
l = function(e, i, l, u, c, h, d) { var m, p, f, v, y; if ("%%" == e) return "%"; for (var g = !1, _ = "", w = !1, C = !1, x = " ", S = l.length, E = 0; l && S > E; E++) switch (l.charAt(E)) {
case " ":
_ = " "; break;
case "+":
_ = "+"; break;
case "-":
g = !0; break;
case "'":
x = l.charAt(E + 1); break;
case "0":
w = !0; break;
case "#":
C = !0 }
if (u = u ? "*" == u ? +t[r++] : "*" == u.charAt(0) ? +t[u.slice(1, -1)] : +u : 0, 0 > u && (u = -u, g = !0), !isFinite(u)) throw new Error("sprintf: (minimum-)width must be finite"); switch (h = h ? "*" == h ? +t[r++] : "*" == h.charAt(0) ? +t[h.slice(1, -1)] : +h : "fFeE".indexOf(d) > -1 ? 6 : "d" == d ? 0 : void 0, y = i ? t[i.slice(0, -1)] : t[r++], d) {
case "s":
return s(String(y), g, u, h, w, x);
case "c":
return s(String.fromCharCode(+y), g, u, h, w);
case "b":
return a(y, 2, C, g, u, h, w);
case "o":
return a(y, 8, C, g, u, h, w);
case "x":
return a(y, 16, C, g, u, h, w);
case "X":
return a(y, 16, C, g, u, h, w).toUpperCase();
case "u":
return a(y, 10, C, g, u, h, w);
case "i":
case "d":
return m = +y || 0, m = Math.round(m - m % 1), p = 0 > m ? "-" : _, y = p + n(String(Math.abs(m)), h, "0", !1), o(y, p, g, u, w);
case "e":
case "E":
case "f":
case "F":
case "g":
case "G":
return m = +y, p = 0 > m ? "-" : _, f = ["toExponential", "toFixed", "toPrecision"]["efg".indexOf(d.toLowerCase())], v = ["toString", "toUpperCase"]["eEfFgG".indexOf(d) % 2], y = p + Math.abs(m)[f](h), o(y, p, g, u, w)[v]();
default:
return e } }; return i.replace(e, l) } return e }), r("Core/JulianDate", ["./DeveloperError", "./binarySearch", "./defined", "./TimeConstants", "./LeapSecond", "./TimeStandard", "./isLeapYear", "../ThirdParty/sprintf"], function(e, t, r, i, n, o, a, s) { "use strict";
function l(e) { v.julianDate = e; var r = n.getLeapSeconds(),
i = t(r, v, n.compareLeapSecondDate);
0 > i && (i = ~i), i >= r.length && (i = r.length - 1); var o = r[i].offset; if (i > 0) { var a = e.getSecondsDifference(r[i].julianDate);
a > o && (i--, o = r[i].offset) } e.addSeconds(o, e) }
function u(e, r) { v.julianDate = e; var i = n.getLeapSeconds(),
o = t(i, v, n.compareLeapSecondDate); if (0 > o && (o = ~o), 0 === o) return e.addSeconds(-i[0].offset, r); if (o >= i.length) return e.addSeconds(-i[o - 1].offset, r); var a = e.getSecondsDifference(i[o].julianDate); return 0 === a ? e.addSeconds(-i[o].offset, r) : 1 >= a ? void 0 : e.addSeconds(-i[--o].offset, r) }
function c(e, t, n) { var a = 0 | t / i.SECONDS_PER_DAY; return e += a, t -= i.SECONDS_PER_DAY * a, 0 > t && (e--, t += i.SECONDS_PER_DAY), r(n) ? (n._julianDayNumber = e, n._secondsOfDay = t, n) : new A(e, t, o.TAI) }
function h(e, t, r, n, o, a, s) { var l = 0 | (t - 14) / 12,
u = e + 4800 + l,
c = (0 | 1461 * u / 4) + (0 | 367 * (t - 2 - 12 * l) / 12) - (0 | 3 * ((u + 100) / 100) / 4) + r - 32075;
n -= 12, 0 > n && (n += 24); var h = a + (n * i.SECONDS_PER_HOUR + o * i.SECONDS_PER_MINUTE + s * i.SECONDS_PER_MILLISECOND); return h >= 43200 && (c -= 1), [c, h] }
function d(e) { return h(e.getUTCFullYear(), e.getUTCMonth() + 1, e.getUTCDate(), e.getUTCHours(), e.getUTCMinutes(), e.getUTCSeconds(), e.getUTCMilliseconds()) } var m = function(e, t, r, i, n, o, a, s) { this.year = e, this.month = t, this.day = r, this.hour = i, this.minute = n, this.second = o, this.millisecond = a, this.isLeapSecond = s },
p = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
f = 29,
v = { julianDate: void 0 },
y = /^(\d{4})$/,
g = /^(\d{4})-(\d{2})$/,
_ = /^(\d{4})-?(\d{3})$/,
w = /^(\d{4})-?W(\d{2})-?(\d{1})?$/,
C = /^(\d{4})-?(\d{2})-?(\d{2})$/,
x = /([Z+\-])?(\d{2})?:?(\d{2})?$/,
S = /^(\d{2})(\.\d+)?/.source + x.source,
E = /^(\d{2}):?(\d{2})(\.\d+)?/.source + x.source,
b = /^(\d{2}):?(\d{2}):?(\d{2})(\.\d+)?/.source + x.source,
T = "Valid ISO 8601 date string required.",
A = function(t, n, a) { this._julianDayNumber = void 0, this._secondsOfDay = void 0; var s, u; if (r(t) || r(n) || r(a)) { if (r(a)) { if (a !== o.UTC && a !== o.TAI) throw new e("timeStandard is not a known TimeStandard.") } else a = o.UTC; if (null === t || isNaN(t)) throw new e("julianDayNumber is required."); if (null === n || isNaN(n)) throw new e("julianSecondsOfDay is required.");
s = 0 | t, u = n + (t - s) * i.SECONDS_PER_DAY } else { var h = new Date,
m = d(h);
s = m[0], u = m[1], a = o.UTC } c(s, u, this), a === o.UTC && l(this) };
A.clone = function(e, t) { return r(e) ? r(t) ? (t._julianDayNumber = e._julianDayNumber, t._secondsOfDay = e._secondsOfDay, t) : new A(e._julianDayNumber, e._secondsOfDay, o.TAI) : void 0 }, A.fromDate = function(t, r) { if (!(t instanceof Date) || isNaN(t.getTime())) throw new e("date must be a valid JavaScript Date."); var i = d(t); return new A(i[0], i[1], r) }, A.fromIso8601 = function(t) { if ("string" != typeof t) throw new e(T);
t = t.replace(",", "."); var i, n, s, l = t.split("T"),
u = 1,
c = 1,
d = 0,
m = 0,
v = 0,
x = 0,
M = l[0],
P = l[1]; if (!r(M)) throw new e(T); var D; if (l = M.match(C), null !== l) { if (D = M.split("-").length - 1, D > 0 && 2 !== D) throw new e(T);
i = +l[1], u = +l[2], c = +l[3] } else if (l = M.match(g), null !== l) i = +l[1], u = +l[2];
else if (l = M.match(y), null !== l) i = +l[1];
else { var I; if (l = M.match(_), null !== l) { if (i = +l[1], I = +l[2], s = a(i), 1 > I || s && I > 366 || !s && I > 365) throw new e(T) } else { if (l = M.match(w), null === l) throw new e(T);
i = +l[1]; var O = +l[2],
R = +l[3] || 0; if (D = M.split("-").length - 1, D > 0 && (!r(l[3]) && 1 !== D || r(l[3]) && 2 !== D)) throw new e(T); var L = new Date(Date.UTC(i, 0, 4));
I = 7 * O + R - L.getUTCDay() - 3 } n = new Date(Date.UTC(i, 0, 1)), n.setUTCDate(I), u = n.getUTCMonth() + 1, c = n.getUTCDate() } if (s = a(i), 1 > u || u > 12 || 1 > c || (2 !== u || !s) && c > p[u - 1] || s && 2 === u && c > f) throw new e(T); var z; if (r(P)) { if (l = P.match(b), null !== l) { if (D = P.split(":").length - 1, D > 0 && 2 !== D && 3 !== D) throw new e(T);
d = +l[1], m = +l[2], v = +l[3], x = 1e3 * +(l[4] || 0), z = 5 } else if (l = P.match(E), null !== l) { if (D = P.split(":").length - 1, D > 0 && 1 !== D) throw new e(T);
d = +l[1], m = +l[2], v = 60 * +(l[3] || 0), z = 4 } else { if (l = P.match(S), null === l) throw new e(T);
d = +l[1], m = 60 * +(l[2] || 0), z = 3 } if (m >= 60 || v >= 61 || d > 24 || 24 === d && (m > 0 || v > 0 || x > 0)) throw new e(T); var N = l[z],
F = +l[z + 1],
B = +(l[z + 2] || 0); switch (N) {
case "+":
d -= F, m -= B; break;
case "-":
d += F, m += B; break;
case "Z":
break;
default:
m += new Date(Date.UTC(i, u - 1, c, d, m)).getTimezoneOffset() } } else m += new Date(Date.UTC(i, u - 1, c)).getTimezoneOffset(); var V = 60 === v; for (V && v--; m >= 60;) m -= 60, d++; for (; d >= 24;) d -= 24, c++; for (n = s && 2 === u ? f : p[u - 1]; c > n;) c -= n, u++, u > 12 && (u -= 12, i++), n = s && 2 === u ? f : p[u - 1]; for (; 0 > m;) m += 60, d--; for (; 0 > d;) d += 24, c--; for (; 1 > c;) u--, 1 > u && (u += 12, i--), n = s && 2 === u ? f : p[u - 1], c += n; var q = h(i, u, c, d, m, v, x),
k = new A(q[0], q[1], o.UTC); return V && k.addSeconds(1, k), k }, A.fromTotalDays = function(t, r) { if (null === t || isNaN(t)) throw new e("totalDays is required."); return new A(t, 0, r) }, A.compare = function(e, t) { var r = e._julianDayNumber - t._julianDayNumber; return 0 !== r ? r : e._secondsOfDay - t._secondsOfDay }, A.equals = function(e, t) { return e === t || r(e) && r(t) && e._julianDayNumber === t._julianDayNumber && e._secondsOfDay === t._secondsOfDay }, A.prototype.clone = function(e) { return A.clone(this, e) }, A.prototype.getTotalDays = function() { return this._julianDayNumber + this._secondsOfDay / i.SECONDS_PER_DAY }, A.prototype.getJulianDayNumber = function() { return this._julianDayNumber }, A.prototype.getJulianTimeFraction = function() { return this._secondsOfDay / i.SECONDS_PER_DAY }, A.prototype.getSecondsOfDay = function() { return this._secondsOfDay }; var M = new A(0, 0, o.TAI); return A.prototype.toGregorianDate = function() { var e = !1,
t = u(this, M);
r(t) || (this.addSeconds(-1, M), t = u(M, M), e = !0); var n = t._julianDayNumber,
o = t._secondsOfDay;
o >= 43200 && (n += 1); var a = 0 | n + 68569,
s = 0 | 4 * a / 146097;
a = 0 | a - (0 | (146097 * s + 3) / 4); var l = 0 | 4e3 * (a + 1) / 1461001;
a = 0 | a - (0 | 1461 * l / 4) + 31; var c = 0 | 80 * a / 2447,
h = 0 | a - (0 | 2447 * c / 80);
a = 0 | c / 11; var d = 0 | c + 2 - 12 * a,
p = 0 | 100 * (s - 49) + l + a,
f = 0 | o / i.SECONDS_PER_HOUR,
v = o - f * i.SECONDS_PER_HOUR,
y = 0 | v / i.SECONDS_PER_MINUTE;
v -= y * i.SECONDS_PER_MINUTE; var g = 0 | v,
_ = (v - g) / i.SECONDS_PER_MILLISECOND; return f += 12, f > 23 && (f -= 24), e && (g += 1), new m(p, d, h, f, y, g, _, e) }, A.prototype.toDate = function() { var e = this.toGregorianDate(),
t = e.second; return e.isLeapSecond && (t -= 1), new Date(Date.UTC(e.year, e.month - 1, e.day, e.hour, e.minute, t, e.millisecond)) }, A.prototype.toIso8601 = function(e) { var t, i = this.toGregorianDate(); return r(e) || 0 === i.millisecond ? r(e) && 0 !== e ? (t = (.01 * i.millisecond).toFixed(e).replace(".", "").slice(0, e), s("%04d-%02d-%02dT%02d:%02d:%02d.%sZ", i.year, i.month, i.day, i.hour, i.minute, i.second, t)) : s("%04d-%02d-%02dT%02d:%02d:%02dZ", i.year, i.month, i.day, i.hour, i.minute, i.second) : (t = (.01 * i.millisecond).toString().replace(".", ""), s("%04d-%02d-%02dT%02d:%02d:%02d.%sZ", i.year, i.month, i.day, i.hour, i.minute, i.second, t)) }, A.prototype.getSecondsDifference = function(e) { var t = this,
r = e,
n = (r._julianDayNumber - t._julianDayNumber) * i.SECONDS_PER_DAY; return n + (r._secondsOfDay - t._secondsOfDay) }, A.prototype.getMinutesDifference = function(e) { return this.getSecondsDifference(e) / i.SECONDS_PER_MINUTE }, A.prototype.getDaysDifference = function(e) { var t = this,
r = e,
n = r._julianDayNumber - t._julianDayNumber,
o = (r._secondsOfDay - t._secondsOfDay) / i.SECONDS_PER_DAY; return n + o }, A.prototype.getTaiMinusUtc = function() { v.julianDate = this; var e = n.getLeapSeconds(),
r = t(e, v, n.compareLeapSecondDate); return 0 > r && (r = ~r, --r, 0 > r && (r = 0)), e[r].offset }, A.prototype.addSeconds = function(t, r) { if (null === t || isNaN(t)) throw new e("seconds is required and must be a number."); return c(this._julianDayNumber, this._secondsOfDay + t, r) }, A.prototype.addMinutes = function(t) { if (null === t || isNaN(t)) throw new e("duration is required and must be a number."); var r = this._secondsOfDay + t * i.SECONDS_PER_MINUTE; return new A(this._julianDayNumber, r, o.TAI) }, A.prototype.addHours = function(t) { if (null === t || isNaN(t)) throw new e("duration is required and must be a number."); var r = this._secondsOfDay + t * i.SECONDS_PER_HOUR; return new A(this._julianDayNumber, r, o.TAI) }, A.prototype.addDays = function(t) { if (null === t || isNaN(t)) throw new e("duration is required and must be a number."); var r = this._julianDayNumber + t; return new A(r, this._secondsOfDay, o.TAI) }, A.prototype.lessThan = function(e) { return A.compare(this, e) < 0 }, A.prototype.lessThanOrEquals = function(e) { return A.compare(this, e) <= 0 }, A.prototype.greaterThan = function(e) { return A.compare(this, e) > 0 }, A.prototype.greaterThanOrEquals = function(e) { return A.compare(this, e) >= 0 }, A.prototype.compareTo = function(e) { return A.compare(this, e) }, A.prototype.equals = function(e) { return A.equals(this, e) }, A.prototype.equalsEpsilon = function(t, r) { if (null === r || isNaN(r)) throw new e("epsilon is required and must be number."); return Math.abs(this.getSecondsDifference(t)) <= r }, 0 === n._leapSeconds.length && (n._leapSeconds = [new n(new A(2441317, 43210, o.TAI), 10), new n(new A(2441499, 43211, o.TAI), 11), new n(new A(2441683, 43212, o.TAI), 12), new n(new A(2442048, 43213, o.TAI), 13), new n(new A(2442413, 43214, o.TAI), 14), new n(new A(2442778, 43215, o.TAI), 15), new n(new A(2443144, 43216, o.TAI), 16), new n(new A(2443509, 43217, o.TAI), 17), new n(new A(2443874, 43218, o.TAI), 18), new n(new A(2444239, 43219, o.TAI), 19), new n(new A(2444786, 43220, o.TAI), 20), new n(new A(2445151, 43221, o.TAI), 21), new n(new A(2445516, 43222, o.TAI), 22), new n(new A(2446247, 43223, o.TAI), 23), new n(new A(2447161, 43224, o.TAI), 24), new n(new A(2447892, 43225, o.TAI), 25), new n(new A(2448257, 43226, o.TAI), 26), new n(new A(2448804, 43227, o.TAI), 27), new n(new A(2449169, 43228, o.TAI), 28), new n(new A(2449534, 43229, o.TAI), 29), new n(new A(2450083, 43230, o.TAI), 30), new n(new A(2450630, 43231, o.TAI), 31), new n(new A(2451179, 43232, o.TAI), 32), new n(new A(2453736, 43233, o.TAI), 33), new n(new A(2454832, 43234, o.TAI), 34), new n(new A(2456109, 43235, o.TAI), 35)]), A }), r("Core/ClockStep", ["./Enumeration"], function(e) { "use strict"; var t = { TICK_DEPENDENT: new e(0, "TICK_DEPENDENT"), SYSTEM_CLOCK_MULTIPLIER: new e(1, "SYSTEM_CLOCK_MULTIPLIER"), SYSTEM_CLOCK: new e(2, "SYSTEM_CLOCK") }; return t }), r("Core/ClockRange", ["./Enumeration"], function(e) { "use strict"; var t = { UNBOUNDED: new e(0, "UNBOUNDED"), CLAMPED: new e(1, "CLAMPED"), LOOP_STOP: new e(2, "LOOP_STOP") }; return t }), r("Core/Event", ["./DeveloperError"], function(e) { "use strict"; var t = function() { this._listeners = [], this._scopes = [] }; return t.prototype.getNumberOfListeners = function() { return this._listeners.length }, t.prototype.addEventListener = function(t, r) { if ("function" != typeof t) throw new e("listener is required and must be a function.");
this._listeners.push(t), this._scopes.push(r); var i = this; return function() { i.removeEventListener(t, r) } }, t.prototype.removeEventListener = function(t, r) { if ("function" != typeof t) throw new e("listener is required and must be a function."); for (var i = this._listeners, n = this._scopes, o = -1, a = 0; a < i.length; a++)
if (i[a] === t && n[a] === r) { o = a; break }
if (-1 === o) throw new e("listener is not subscribed.");
i.splice(o, 1), this._scopes.splice(o, 1) }, t.prototype.raiseEvent = function() { for (var e = this._listeners, t = this._scopes, r = e.length - 1; r > -1; r--) e[r].apply(t[r], arguments) }, t }), r("Core/Clock", ["./defined", "./DeveloperError", "./JulianDate", "./ClockStep", "./ClockRange", "./Event", "./defaultValue"], function(e, t, r, i, n, o, a) { "use strict"; var s = function(s) { s = a(s, a.EMPTY_OBJECT); var l = s.startTime,
u = !e(l),
c = s.stopTime,
h = !e(c),
d = s.currentTime,
m = !e(d); if (u && h && m ? (d = new r, l = d.clone(), c = d.addDays(1)) : u && h ? (l = d.clone(), c = d.addDays(1)) : u && m ? (l = c.addDays(-1), d = l.clone()) : m && h ? (d = l.clone(), c = l.addDays(1)) : m ? d = l.clone() : h ? c = d.addDays(1) : u && (l = d.clone()), l.greaterThan(c)) throw new t("startTime must come before stopTime.");
this.startTime = l, this.stopTime = c, this.currentTime = d, this.multiplier = a(s.multiplier, 1), this.clockStep = a(s.clockStep, i.SYSTEM_CLOCK_MULTIPLIER), this.clockRange = a(s.clockRange, n.UNBOUNDED), this.shouldAnimate = a(s.shouldAnimate, !0), this.onTick = new o, this._lastSystemTime = Date.now() }; return s.prototype.tick = function() { var e = Date.now(),
t = this.currentTime,
o = this.startTime,
a = this.stopTime,
s = this.multiplier; if (this.shouldAnimate)
if (this.clockStep === i.SYSTEM_CLOCK) t = new r;
else { if (this.clockStep === i.TICK_DEPENDENT) t = t.addSeconds(s);
else { var l = e - this._lastSystemTime;
t = t.addSeconds(s * (l / 1e3)) } if (this.clockRange === n.CLAMPED) t.lessThan(o) ? t = o : t.greaterThan(a) && (t = a);
else if (this.clockRange === n.LOOP_STOP)
for (t.lessThan(o) && (t = o.clone()); t.greaterThan(a);) t = o.addSeconds(a.getSecondsDifference(t)) }
return this.currentTime = t, this._lastSystemTime = e, this.onTick.raiseEvent(this), t }, s }), r("Core/Color", ["./defaultValue", "./defined", "./freezeObject", "./DeveloperError", "./FeatureDetection", "./Math"], function(e, t, r, i, n, o) {
"use strict";
function a(e, t, r) { return 0 > r && (r += 1), r > 1 && (r -= 1), 1 > 6 * r ? e + 6 * (t - e) * r : 1 > 2 * r ? t : 2 > 3 * r ? e + 6 * (t - e) * (2 / 3 - r) : e }
var s = function(t, r, i, n) { this.red = e(t, 1), this.green = e(r, 1), this.blue = e(i, 1), this.alpha = e(n, 1) };
s.fromBytes = function(t, r, i, n) { return t = s.byteToFloat(e(t, 255)), r = s.byteToFloat(e(r, 255)), i = s.byteToFloat(e(i, 255)), n = s.byteToFloat(e(n, 255)), new s(t, r, i, n) };
var l, u, c;
n.supportsTypedArrays() && (l = new ArrayBuffer(4), u = new Uint32Array(l), c = new Uint8Array(l)), s.fromRgba = function(e) { return u[0] = e, s.fromBytes(c[0], c[1], c[2], c[3]) }, s.fromHsl = function(t, r, i, n) { t = e(t, 0) % 1, r = e(r, 0), i = e(i, 0), n = e(n, 1); var o = i,
l = i,
u = i; if (0 !== r) { var c;
c = .5 > i ? i * (1 + r) : i + r - i * r; var h = 2 * i - c;
o = a(h, c, t + 1 / 3), l = a(h, c, t), u = a(h, c, t - 1 / 3) } return new s(o, l, u, n) }, s.fromRandom = function(r, n) {
r = e(r, e.EMPTY_OBJECT);
var a = r.red;
if (!t(a)) { var l = e(r.minimumRed, 0),
u = e(r.maximumRed, 1); if (l > u) throw new i("minimumRed must be less than or equal to maximumRed");
a = l + o.nextRandomNumber() * (u - l) }
var c = r.green;
if (!t(c)) { var h = e(r.minimumGreen, 0),
d = e(r.maximumGreen, 1); if (h > d) throw new i("minimumGreen must be less than or equal to maximumGreen");
c = h + o.nextRandomNumber() * (d - h) }
var m = r.blue;
if (!t(m)) {
var p = e(r.minimumBlue, 0),
f = e(r.maximumBlue, 1);
if (p > f) throw new i("minimumBlue must be less than or equal to maximumBlue");
m = p + o.nextRandomNumber() * (f - p)
}
var v = r.alpha;
if (!t(v)) { var y = e(r.minimumAlpha, 0),
g = e(r.maximumAlpha, 1); if (y > g) throw new i("minimumAlpha must be less than or equal to maximumAlpha");
v = y + o.nextRandomNumber() * (g - y) }
return t(n) ? (n.red = a, n.green = c, n.blue = m, n.alpha = v, n) : new s(a, c, m, v)
};
var h = /^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,
d = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i,
m = /^rgba?\(\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)\s*,\s*([0-9.]+%?)(?:\s*,\s*([0-9.]+))?\s*\)$/i,
p = /^hsla?\(\s*([0-9.]+)\s*,\s*([0-9.]+%)\s*,\s*([0-9.]+%)(?:\s*,\s*([0-9.]+))?\s*\)$/i;
return s.fromCssColorString = function(r) { if (!t(r)) throw new i("color is required"); var n = s[r.toUpperCase()]; if (t(n)) return n.clone(); var o = h.exec(r); return null !== o ? new s(parseInt(o[1], 16) / 15, parseInt(o[2], 16) / 15, parseInt(o[3], 16) / 15) : (o = d.exec(r), null !== o ? new s(parseInt(o[1], 16) / 255, parseInt(o[2], 16) / 255, parseInt(o[3], 16) / 255) : (o = m.exec(r), null !== o ? new s(parseFloat(o[1]) / ("%" === o[1].substr(-1) ? 100 : 255), parseFloat(o[2]) / ("%" === o[2].substr(-1) ? 100 : 255), parseFloat(o[3]) / ("%" === o[3].substr(-1) ? 100 : 255), parseFloat(e(o[4], "1.0"))) : (o = p.exec(r), null !== o ? s.fromHsl(parseFloat(o[1]) / 360, parseFloat(o[2]) / 100, parseFloat(o[3]) / 100, parseFloat(e(o[4], "1.0"))) : void 0))) }, s.packedLength = 4, s.pack = function(r, n, o) { if (!t(r)) throw new i("value is required"); if (!t(n)) throw new i("array is required");
o = e(o, 0), n[o++] = r.red, n[o++] = r.green, n[o++] = r.blue, n[o] = r.alpha }, s.unpack = function(r, n, o) { if (!t(r)) throw new i("array is required"); return n = e(n, 0), t(o) || (o = new s), o.red = r[n++], o.green = r[n++], o.blue = r[n++], o.alpha = r[n], o }, s.byteToFloat = function(e) { return e / 255 }, s.floatToByte = function(e) { return 1 === e ? 255 : 0 | 256 * e }, s.clone = function(e, r) { return t(e) ? t(r) ? (r.red = e.red, r.green = e.green, r.blue = e.blue, r.alpha = e.alpha, r) : new s(e.red, e.green, e.blue, e.alpha) : void 0 }, s.equals = function(e, r) { return e === r || t(e) && t(r) && e.red === r.red && e.green === r.green && e.blue === r.blue && e.alpha === r.alpha }, s.prototype.clone = function(e) { return s.clone(this, e) }, s.prototype.equals = function(e) { return s.equals(this, e) }, s.prototype.equalsEpsilon = function(e, r) { return this === e || t(e) && Math.abs(this.red - e.red) <= r && Math.abs(this.green - e.green) <= r && Math.abs(this.blue - e.blue) <= r && Math.abs(this.alpha - e.alpha) <= r }, s.prototype.toString = function() { return "(" + this.red + ", " + this.green + ", " + this.blue + ", " + this.alpha + ")" }, s.prototype.toCssColorString = function() { var e = s.floatToByte(this.red),
t = s.floatToByte(this.green),
r = s.floatToByte(this.blue); return 1 === this.alpha ? "rgb(" + e + "," + t + "," + r + ")" : "rgba(" + e + "," + t + "," + r + "," + this.alpha + ")" }, s.prototype.toBytes = function() { var e = s.floatToByte(this.red),
t = s.floatToByte(this.green),
r = s.floatToByte(this.blue),
i = s.floatToByte(this.alpha); return [e, t, r, i] }, s.prototype.toRgba = function() { return c[0] = s.floatToByte(this.red), c[1] = s.floatToByte(this.green), c[2] = s.floatToByte(this.blue), c[3] = s.floatToByte(this.alpha), u[0] }, s.ALICEBLUE = r(s.fromCssColorString("#F0F8FF")), s.ANTIQUEWHITE = r(s.fromCssColorString("#FAEBD7")), s.AQUA = r(s.fromCssColorString("#00FFFF")), s.AQUAMARINE = r(s.fromCssColorString("#7FFFD4")), s.AZURE = r(s.fromCssColorString("#F0FFFF")), s.BEIGE = r(s.fromCssColorString("#F5F5DC")), s.BISQUE = r(s.fromCssColorString("#FFE4C4")), s.BLACK = r(s.fromCssColorString("#000000")), s.BLANCHEDALMOND = r(s.fromCssColorString("#FFEBCD")), s.BLUE = r(s.fromCssColorString("#0000FF")), s.BLUEVIOLET = r(s.fromCssColorString("#8A2BE2")), s.BROWN = r(s.fromCssColorString("#A52A2A")), s.BURLYWOOD = r(s.fromCssColorString("#DEB887")), s.CADETBLUE = r(s.fromCssColorString("#5F9EA0")), s.CHARTREUSE = r(s.fromCssColorString("#7FFF00")), s.CHOCOLATE = r(s.fromCssColorString("#D2691E")), s.CORAL = r(s.fromCssColorString("#FF7F50")), s.CORNFLOWERBLUE = r(s.fromCssColorString("#6495ED")), s.CORNSILK = r(s.fromCssColorString("#FFF8DC")), s.CRIMSON = r(s.fromCssColorString("#DC143C")), s.CYAN = r(s.fromCssColorString("#00FFFF")), s.DARKBLUE = r(s.fromCssColorString("#00008B")), s.DARKCYAN = r(s.fromCssColorString("#008B8B")), s.DARKGOLDENROD = r(s.fromCssColorString("#B8860B")), s.DARKGRAY = r(s.fromCssColorString("#A9A9A9")), s.DARKGREEN = r(s.fromCssColorString("#006400")), s.DARKGREY = s.DARKGRAY, s.DARKKHAKI = r(s.fromCssColorString("#BDB76B")), s.DARKMAGENTA = r(s.fromCssColorString("#8B008B")), s.DARKOLIVEGREEN = r(s.fromCssColorString("#556B2F")), s.DARKORANGE = r(s.fromCssColorString("#FF8C00")), s.DARKORCHID = r(s.fromCssColorString("#9932CC")), s.DARKRED = r(s.fromCssColorString("#8B0000")), s.DARKSALMON = r(s.fromCssColorString("#E9967A")), s.DARKSEAGREEN = r(s.fromCssColorString("#8FBC8F")), s.DARKSLATEBLUE = r(s.fromCssColorString("#483D8B")), s.DARKSLATEGRAY = r(s.fromCssColorString("#2F4F4F")), s.DARKSLATEGREY = s.DARKSLATEGRAY, s.DARKTURQUOISE = r(s.fromCssColorString("#00CED1")), s.DARKVIOLET = r(s.fromCssColorString("#9400D3")), s.DEEPPINK = r(s.fromCssColorString("#FF1493")), s.DEEPSKYBLUE = r(s.fromCssColorString("#00BFFF")), s.DIMGRAY = r(s.fromCssColorString("#696969")), s.DIMGREY = s.DIMGRAY, s.DODGERBLUE = r(s.fromCssColorString("#1E90FF")), s.FIREBRICK = r(s.fromCssColorString("#B22222")), s.FLORALWHITE = r(s.fromCssColorString("#FFFAF0")), s.FORESTGREEN = r(s.fromCssColorString("#228B22")), s.FUSCHIA = r(s.fromCssColorString("#FF00FF")), s.GAINSBORO = r(s.fromCssColorString("#DCDCDC")), s.GHOSTWHITE = r(s.fromCssColorString("#F8F8FF")), s.GOLD = r(s.fromCssColorString("#FFD700")), s.GOLDENROD = r(s.fromCssColorString("#DAA520")), s.GRAY = r(s.fromCssColorString("#808080")), s.GREEN = r(s.fromCssColorString("#008000")), s.GREENYELLOW = r(s.fromCssColorString("#ADFF2F")), s.GREY = s.GRAY, s.HONEYDEW = r(s.fromCssColorString("#F0FFF0")), s.HOTPINK = r(s.fromCssColorString("#FF69B4")), s.INDIANRED = r(s.fromCssColorString("#CD5C5C")), s.INDIGO = r(s.fromCssColorString("#4B0082")), s.IVORY = r(s.fromCssColorString("#FFFFF0")), s.KHAKI = r(s.fromCssColorString("#F0E68C")), s.LAVENDER = r(s.fromCssColorString("#E6E6FA")), s.LAVENDAR_BLUSH = r(s.fromCssColorString("#FFF0F5")), s.LAWNGREEN = r(s.fromCssColorString("#7CFC00")), s.LEMONCHIFFON = r(s.fromCssColorString("#FFFACD")), s.LIGHTBLUE = r(s.fromCssColorString("#ADD8E6")), s.LIGHTCORAL = r(s.fromCssColorString("#F08080")), s.LIGHTCYAN = r(s.fromCssColorString("#E0FFFF")), s.LIGHTGOLDENRODYELLOW = r(s.fromCssColorString("#FAFAD2")), s.LIGHTGRAY = r(s.fromCssColorString("#D3D3D3")), s.LIGHTGREEN = r(s.fromCssColorString("#90EE90")), s.LIGHTGREY = s.LIGHTGRAY, s.LIGHTPINK = r(s.fromCssColorString("#FFB6C1")), s.LIGHTSEAGREEN = r(s.fromCssColorString("#20B2AA")), s.LIGHTSKYBLUE = r(s.fromCssColorString("#87CEFA")), s.LIGHTSLATEGRAY = r(s.fromCssColorString("#778899")), s.LIGHTSLATEGREY = s.LIGHTSLATEGRAY, s.LIGHTSTEELBLUE = r(s.fromCssColorString("#B0C4DE")), s.LIGHTYELLOW = r(s.fromCssColorString("#FFFFE0")), s.LIME = r(s.fromCssColorString("#00FF00")), s.LIMEGREEN = r(s.fromCssColorString("#32CD32")), s.LINEN = r(s.fromCssColorString("#FAF0E6")), s.MAGENTA = r(s.fromCssColorString("#FF00FF")), s.MAROON = r(s.fromCssColorString("#800000")), s.MEDIUMAQUAMARINE = r(s.fromCssColorString("#66CDAA")), s.MEDIUMBLUE = r(s.fromCssColorString("#0000CD")), s.MEDIUMORCHID = r(s.fromCssColorString("#BA55D3")), s.MEDIUMPURPLE = r(s.fromCssColorString("#9370DB")), s.MEDIUMSEAGREEN = r(s.fromCssColorString("#3CB371")), s.MEDIUMSLATEBLUE = r(s.fromCssColorString("#7B68EE")), s.MEDIUMSPRINGGREEN = r(s.fromCssColorString("#00FA9A")), s.MEDIUMTURQUOISE = r(s.fromCssColorString("#48D1CC")), s.MEDIUMVIOLETRED = r(s.fromCssColorString("#C71585")), s.MIDNIGHTBLUE = r(s.fromCssColorString("#191970")), s.MINTCREAM = r(s.fromCssColorString("#F5FFFA")), s.MISTYROSE = r(s.fromCssColorString("#FFE4E1")), s.MOCCASIN = r(s.fromCssColorString("#FFE4B5")), s.NAVAJOWHITE = r(s.fromCssColorString("#FFDEAD")), s.NAVY = r(s.fromCssColorString("#000080")), s.OLDLACE = r(s.fromCssColorString("#FDF5E6")), s.OLIVE = r(s.fromCssColorString("#808000")), s.OLIVEDRAB = r(s.fromCssColorString("#6B8E23")), s.ORANGE = r(s.fromCssColorString("#FFA500")), s.ORANGERED = r(s.fromCssColorString("#FF4500")), s.ORCHID = r(s.fromCssColorString("#DA70D6")), s.PALEGOLDENROD = r(s.fromCssColorString("#EEE8AA")), s.PALEGREEN = r(s.fromCssColorString("#98FB98")), s.PALETURQUOISE = r(s.fromCssColorString("#AFEEEE")), s.PALEVIOLETRED = r(s.fromCssColorString("#DB7093")), s.PAPAYAWHIP = r(s.fromCssColorString("#FFEFD5")), s.PEACHPUFF = r(s.fromCssColorString("#FFDAB9")), s.PERU = r(s.fromCssColorString("#CD853F")), s.PINK = r(s.fromCssColorString("#FFC0CB")), s.PLUM = r(s.fromCssColorString("#DDA0DD")), s.POWDERBLUE = r(s.fromCssColorString("#B0E0E6")), s.PURPLE = r(s.fromCssColorString("#800080")), s.RED = r(s.fromCssColorString("#FF0000")), s.ROSYBROWN = r(s.fromCssColorString("#BC8F8F")), s.ROYALBLUE = r(s.fromCssColorString("#4169E1")), s.SADDLEBROWN = r(s.fromCssColorString("#8B4513")), s.SALMON = r(s.fromCssColorString("#FA8072")), s.SANDYBROWN = r(s.fromCssColorString("#F4A460")), s.SEAGREEN = r(s.fromCssColorString("#2E8B57")), s.SEASHELL = r(s.fromCssColorString("#FFF5EE")), s.SIENNA = r(s.fromCssColorString("#A0522D")), s.SILVER = r(s.fromCssColorString("#C0C0C0")), s.SKYBLUE = r(s.fromCssColorString("#87CEEB")), s.SLATEBLUE = r(s.fromCssColorString("#6A5ACD")), s.SLATEGRAY = r(s.fromCssColorString("#708090")), s.SLATEGREY = s.SLATEGRAY, s.SNOW = r(s.fromCssColorString("#FFFAFA")), s.SPRINGGREEN = r(s.fromCssColorString("#00FF7F")), s.STEELBLUE = r(s.fromCssColorString("#4682B4")), s.TAN = r(s.fromCssColorString("#D2B48C")), s.TEAL = r(s.fromCssColorString("#008080")), s.THISTLE = r(s.fromCssColorString("#D8BFD8")), s.TOMATO = r(s.fromCssColorString("#FF6347")), s.TURQUOISE = r(s.fromCssColorString("#40E0D0")), s.VIOLET = r(s.fromCssColorString("#EE82EE")), s.WHEAT = r(s.fromCssColorString("#F5DEB3")), s.WHITE = r(s.fromCssColorString("#FFFFFF")), s.WHITESMOKE = r(s.fromCssColorString("#F5F5F5")), s.YELLOW = r(s.fromCssColorString("#FFFF00")), s.YELLOWGREEN = r(s.fromCssColorString("#9ACD32")), s
}), r("Core/ColorGeometryInstanceAttribute", ["./defaultValue", "./defined", "./Color", "./ComponentDatatype", "./DeveloperError"], function(e, t, r, i, n) { "use strict"; var o = function(t, n, o, a) { t = e(t, 1), n = e(n, 1), o = e(o, 1), a = e(a, 1), this.componentDatatype = i.UNSIGNED_BYTE, this.componentsPerAttribute = 4, this.normalize = !0, this.value = new Uint8Array([r.floatToByte(t), r.floatToByte(n), r.floatToByte(o), r.floatToByte(a)]) }; return o.fromColor = function(e) { if (!t(e)) throw new n("color is required."); return new o(e.red, e.green, e.blue, e.alpha) }, o.toValue = function(e) { if (!t(e)) throw new n("color is required."); return new Uint8Array(e.toBytes()) }, o }), r("Core/CornerType", ["../Core/Enumeration"], function(e) { "use strict"; var t = { ROUNDED: new e(0, "ROUNDED"), MITERED: new e(1, "MITERED"), BEVELED: new e(2, "BEVELED") }; return t }), r("ThirdParty/Uri", [], function() {
function e(t) { if (t instanceof e) this.scheme = t.scheme, this.authority = t.authority, this.path = t.path, this.query = t.query, this.fragment = t.fragment;
else if (t) { var r = i.exec(t);
this.scheme = r[1], this.authority = r[2], this.path = r[3], this.query = r[4], this.fragment = r[5] } }
function t(e) { var t = unescape(e); return o.test(t) ? t : e.toUpperCase() }
function r(e, t, r, i) { return (t || "") + r.toLowerCase() + (i || "") } e.prototype.scheme = null, e.prototype.authority = null, e.prototype.path = "", e.prototype.query = null, e.prototype.fragment = null; var i = new RegExp("^(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\\?([^#]*))?(?:#(.*))?$");
e.prototype.getScheme = function() { return this.scheme }, e.prototype.getAuthority = function() { return this.authority }, e.prototype.getPath = function() { return this.path }, e.prototype.getQuery = function() { return this.query }, e.prototype.getFragment = function() { return this.fragment }, e.prototype.isAbsolute = function() { return !!this.scheme && !this.fragment }, e.prototype.isSameDocumentAs = function(e) { return e.scheme == this.scheme && e.authority == this.authority && e.path == this.path && e.query == this.query }, e.prototype.equals = function(e) { return this.isSameDocumentAs(e) && e.fragment == this.fragment }, e.prototype.normalize = function() { this.removeDotSegments(), this.scheme && (this.scheme = this.scheme.toLowerCase()), this.authority && (this.authority = this.authority.replace(a, r).replace(n, t)), this.path && (this.path = this.path.replace(n, t)), this.query && (this.query = this.query.replace(n, t)), this.fragment && (this.fragment = this.fragment.replace(n, t)) }; var n = /%[0-9a-z]{2}/gi,
o = /[a-zA-Z0-9\-\._~]/,
a = /(.*@)?([^@:]*)(:.*)?/;
e.prototype.resolve = function(t) { var r = new e; return this.scheme ? (r.scheme = this.scheme, r.authority = this.authority, r.path = this.path, r.query = this.query) : (r.scheme = t.scheme, this.authority ? (r.authority = this.authority, r.path = this.path, r.query = this.query) : (r.authority = t.authority, "" == this.path ? (r.path = t.path, r.query = this.query || t.query) : ("/" == this.path.charAt(0) ? (r.path = this.path, r.removeDotSegments()) : (r.path = t.authority && "" == t.path ? "/" + this.path : t.path.substring(0, t.path.lastIndexOf("/") + 1) + this.path, r.removeDotSegments()), r.query = this.query))), r.fragment = this.fragment, r }, e.prototype.removeDotSegments = function() { var e, t = this.path.split("/"),
r = [],
i = "" == t[0]; for (i && t.shift(), "" == t[0] ? t.shift() : null; t.length;) e = t.shift(), ".." == e ? r.pop() : "." != e && r.push(e);
("." == e || ".." == e) && r.push(""), i && r.unshift(""), this.path = r.join("/") }, e.resolve = function(t, r) { var i = s[t] || (s[t] = new e(t)),
n = s[r] || (s[r] = new e(r)); return i.resolve(n).toString() }; var s = {}; return e.prototype.toString = function() { var e = ""; return this.scheme && (e += this.scheme + ":"), this.authority && (e += "//" + this.authority), e += this.path, this.query && (e += "?" + this.query), this.fragment && (e += "#" + this.fragment), e }, e }), r("Core/buildModuleUrl", ["require", "./defined", "./DeveloperError", "../ThirdParty/Uri"], function(e, t, r, i) { "use strict";
function n() { for (var e = document.getElementsByTagName("script"), t = 0, r = e.length; r > t; ++t) { var i = e[t].getAttribute("src"),
n = h.exec(i); if (null !== n) return n[1] } return void 0 }
function o() { if (t(l)) return l; var e; if (e = "undefined" != typeof CESIUM_BASE_URL ? CESIUM_BASE_URL : n(), !t(e)) throw new r("Unable to determine isatCesium base URL automatically, try defining a global variable called CESIUM_BASE_URL."); return l = new i(e).resolve(new i(document.location.href)) }
function a(t) { return e.toUrl("../" + t) }
function s(e) { return new i(e).resolve(o()).toString() } var l, u, c, h = /((?:.*\/)|^)cesium[\w-]*\.js(?:\W|$)/i,
d = function(r) { t(u) || (u = t(e.toUrl) ? a : s), t(c) || (c = document.createElement("a")); var i = u(r); return c.href = i, c.href = c.href, c.href }; return d._cesiumScriptRegex = h, d }), r("Core/Iau2006XysSample", [], function() { "use strict"; var e = function(e, t, r) { this.x = e, this.y = t, this.s = r }; return e }), r("Core/clone", ["./defaultValue"], function(e) { "use strict"; var t = function(r, i) { if (null === r || "object" != typeof r) return r;
i = e(i, !1); var n = new r.constructor; for (var o in r)
if (r.hasOwnProperty(o)) { var a = r[o];
i && (a = t(a, i)), n[o] = a }
return n }; return t }), r("Core/RequestErrorEvent", ["./defined"], function(e) { "use strict"; var t = function(e, t) { this.statusCode = e, this.response = t }; return t.prototype.toString = function() { var t = "Request has failed."; return e(this.statusCode) && (t += " Status Code: " + this.statusCode), t }, t }),
function(e) { "use strict";
e("ThirdParty/when", [], function() {
function e(e, r, i, n) { return t(e).then(r, i, n) }
function t(e) { var t, r; return e instanceof i ? t = e : s(e) ? (r = a(), e.then(function(e) { r.resolve(e) }, function(e) { r.reject(e) }, function(e) { r.progress(e) }), t = r.promise) : t = n(e), t }
function r(t) { return e(t, o) }
function i(e) { this.then = e }
function n(e) { var r = new i(function(r) { try { return t(r ? r(e) : e) } catch (i) { return o(i) } }); return r }
function o(e) { var r = new i(function(r, i) { try { return i ? t(i(e)) : o(e) } catch (n) { return o(n) } }); return r }
function a() {
function e(e, t, r) { return d(e, t, r) }
function r(e) { return p(e) }
function n(e) { return p(o(e)) }
function s(e) { return m(e) } var l, u, c, h, d, m, p; return u = new i(e), l = { then: e, resolve: r, reject: n, progress: s, promise: u, resolver: { resolve: r, reject: n, progress: s } }, c = [], h = [], d = function(e, t, r) { var i, n; return i = a(), n = "function" == typeof r ? function(e) { try { i.progress(r(e)) } catch (t) { i.progress(t) } } : function(e) { i.progress(e) }, c.push(function(r) { r.then(e, t).then(i.resolve, i.reject, n) }), h.push(n), i.promise }, m = function(e) { return f(h, e), e }, p = function(e) { return e = t(e), d = e.then, p = t, m = y, f(c, e), h = c = C, e }, l }
function s(e) { return e && "function" == typeof e.then }
function l(t, r, i, n, o) { return v(2, arguments), e(t, function(t) {
function s(e) { f(e) }
function l(e) { p(e) } var u, c, h, d, m, p, f, v, g, _; if (g = t.length >>> 0, u = Math.max(0, Math.min(r, g)), h = [], c = g - u + 1, d = [], m = a(), u)
for (v = m.progress, f = function(e) { d.push(e), --c || (p = f = y, m.reject(d)) }, p = function(e) { h.push(e), --u || (p = f = y, m.resolve(h)) }, _ = 0; g > _; ++_) _ in t && e(t[_], l, s, v);
else m.resolve(h); return m.then(i, n, o) }) }
function u(e, t, r, i) {
function n(e) { return t ? t(e[0]) : e[0] } return l(e, 1, n, r, i) }
function c(e, t, r, i) { return v(1, arguments), d(e, g).then(t, r, i) }
function h() { return d(arguments, g) }
function d(t, r) { return e(t, function(t) { var i, n, o, s, l, u; if (o = n = t.length >>> 0, i = [], u = a(), o)
for (s = function(t, n) { e(t, r).then(function(e) { i[n] = e, --o || u.resolve(i) }, u.reject) }, l = 0; n > l; l++) l in t ? s(t[l], l) : --o;
else u.resolve(i); return u.promise }) }
function m(t, r) { var i = w.call(arguments, 1); return e(t, function(t) { var n; return n = t.length, i[0] = function(t, i, o) { return e(t, function(t) { return e(i, function(e) { return r(t, e, o, n) }) }) }, _.apply(t, i) }) }
function p(t, r, i) { var n = arguments.length > 2; return e(t, function(e) { return e = n ? i : e, r.resolve(e), e }, function(e) { return r.reject(e), o(e) }, r.progress) }
function f(e, t) { for (var r, i = 0; r = e[i++];) r(t) }
function v(e, t) { for (var r, i = t.length; i > e;)
if (r = t[--i], null != r && "function" != typeof r) throw new Error("arg " + i + " must be a function") }
function y() {}
function g(e) { return e } var _, w, C; return e.defer = a, e.resolve = t, e.reject = r, e.join = h, e.all = c, e.map = d, e.reduce = m, e.any = u, e.some = l, e.chain = p, e.isPromise = s, i.prototype = { always: function(e, t) { return this.then(e, e, t) }, otherwise: function(e) { return this.then(C, e) }, yield: function(e) { return this.then(function() { return e }) }, spread: function(e) { return this.then(function(t) { return c(t, function(t) { return e.apply(C, t) }) }) } }, w = [].slice, _ = [].reduce || function(e) { var t, r, i, n, o; if (o = 0, t = Object(this), n = t.length >>> 0, r = arguments, r.length <= 1)
for (;;) { if (o in t) { i = t[o++]; break } if (++o >= n) throw new TypeError } else i = r[1]; for (; n > o; ++o) o in t && (i = e(i, t[o], o, t)); return i }, e }) }("function" == typeof r && r.amd ? r : function(e) { "object" == typeof exports ? module.exports = e() : this.when = e() }), r("Core/loadWithXhr", ["./defined", "./DeveloperError", "./RequestErrorEvent", "../ThirdParty/when"], function(e, t, r, i) { "use strict"; var n = function(r, o, a) { if (!e(r)) throw new t("url is required."); return i(r, function(e) { var t = i.defer(); return n.load(e, o, a, t), t.promise }) }; return n.load = function(t, i, n, o) { var a = new XMLHttpRequest; if (a.open("GET", t, !0), e(n))
for (var s in n) n.hasOwnProperty(s) && a.setRequestHeader(s, n[s]);
e(i) && (a.responseType = i), a.onload = function() { 200 === a.status ? o.resolve(a.response) : o.reject(new r(a.status, a.response)) }, a.onerror = function() { o.reject(new r) }, a.send() }, n.defaultLoad = n.load, n }), r("Core/loadText", ["./loadWithXhr"], function(e) { "use strict"; var t = function(t, r) { return e(t, void 0, r) }; return t }), r("Core/loadJson", ["./clone", "./defined", "./loadText", "./DeveloperError"], function(e, t, r, i) { "use strict"; var n = function(n, o) { if (!t(n)) throw new i("url is required."); return t(o) && !t(o.Accept) && (o = e(o), o.Accept = "application/json,*/*;q=0.01"), r(n, o).then(function(e) { return JSON.parse(e) }) }; return n }), r("Core/Iau2006XysData", ["./buildModuleUrl", "./defaultValue", "./defined", "./Iau2006XysSample", "./JulianDate", "./loadJson", "./TimeStandard", "../ThirdParty/when"], function(e, t, r, i, n, o, a, s) { "use strict";
function l(e, t, r) { var i = h; return i._julianDayNumber = t, i._secondsOfDay = r, e._sampleZeroDateTT.getDaysDifference(i) }
function u(t, i) { if (t._chunkDownloadsInProgress[i]) return t._chunkDownloadsInProgress[i]; var n = s.defer();
t._chunkDownloadsInProgress[i] = n; var a, l = t._xysFileUrlTemplate; return a = r(l) ? l.replace("{0}", i) : e("Assets/IAU2006_XYS/IAU2006_XYS_" + i + ".json"), s(o(a), function(e) { t._chunkDownloadsInProgress[i] = !1; for (var r = t._samples, o = e.samples, a = 3 * i * t._samplesPerXysFile, s = 0, l = o.length; l > s; ++s) r[a + s] = o[s];
n.resolve() }), n.promise } var c = function(e) { e = t(e, t.EMPTY_OBJECT), this._xysFileUrlTemplate = e.xysFileUrlTemplate, this._interpolationOrder = t(e.interpolationOrder, 9), this._sampleZeroJulianEphemerisDate = t(e.sampleZeroJulianEphemerisDate, 2442396.5), this._sampleZeroDateTT = new n(this._sampleZeroJulianEphemerisDate, 0, a.TAI), this._stepSizeDays = t(e.stepSizeDays, 1), this._samplesPerXysFile = t(e.samplesPerXysFile, 1e3), this._totalSamples = t(e.totalSamples, 27426), this._samples = new Array(3 * this._totalSamples), this._chunkDownloadsInProgress = []; for (var r = this._interpolationOrder, i = this._denominators = new Array(r + 1), o = this._xTable = new Array(r + 1), s = Math.pow(this._stepSizeDays, r), l = 0; r >= l; ++l) { i[l] = s, o[l] = l * this._stepSizeDays; for (var u = 0; r >= u; ++u) u !== l && (i[l] *= l - u);
i[l] = 1 / i[l] } this._work = new Array(r + 1), this._coef = new Array(r + 1) },
h = new n(0, 0, a.TAI); return c.prototype.preload = function(e, t, r, i) { var n = l(this, e, t),
o = l(this, r, i),
a = 0 | n / this._stepSizeDays - this._interpolationOrder / 2;
0 > a && (a = 0); var c = o / this._stepSizeDays - this._interpolationOrder / 2 | 0 + this._interpolationOrder;
c >= this._totalSamples && (c = this._totalSamples - 1); for (var h = 0 | a / this._samplesPerXysFile, d = 0 | c / this._samplesPerXysFile, m = [], p = h; d >= p; ++p) m.push(u(this, p)); return s.all(m) }, c.prototype.computeXysRadians = function(e, t, n) { var o = l(this, e, t); if (0 > o) return void 0; var a = 0 | o / this._stepSizeDays; if (a >= this._totalSamples) return void 0; var s = this._interpolationOrder,
c = a - (0 | s / 2);
0 > c && (c = 0); var h = c + s;
h >= this._totalSamples && (h = this._totalSamples - 1, c = h - s, 0 > c && (c = 0)); var d = !1,
m = this._samples; if (r(m[3 * c]) || (u(this, 0 | c / this._samplesPerXysFile), d = !0), r(m[3 * h]) || (u(this, 0 | h / this._samplesPerXysFile), d = !0), d) return void 0;
r(n) ? (n.x = 0, n.y = 0, n.s = 0) : n = new i(0, 0, 0); var p, f, v = o - c * this._stepSizeDays,
y = this._work,
g = this._denominators,
_ = this._coef,
w = this._xTable; for (p = 0; s >= p; ++p) y[p] = v - w[p]; for (p = 0; s >= p; ++p) { for (_[p] = 1, f = 0; s >= f; ++f) f !== p && (_[p] *= y[f]);
_[p] *= g[p]; var C = 3 * (c + p);
n.x += _[p] * m[C++], n.y += _[p] * m[C++], n.s += _[p] * m[C] } return n }, c }), r("Core/EarthOrientationParametersSample", [], function() { "use strict"; var e = function(e, t, r, i, n) { this.xPoleWander = e, this.yPoleWander = t, this.xPoleOffset = r, this.yPoleOffset = i, this.ut1MinusUtc = n }; return e }), r("Core/EarthOrientationParameters", ["./binarySearch", "./defaultValue", "./defined", "./freezeObject", "./loadJson", "./EarthOrientationParametersSample", "./JulianDate", "./LeapSecond", "./RuntimeError", "./TimeConstants", "./TimeStandard", "../ThirdParty/when"], function(e, t, r, i, n, o, a, s, l, u, c, h) { "use strict";
function d(e, t) { return a.compare(e.julianDate, t) }
function m(t, i) { if (!r(i.columnNames)) return t._dataError = "Error in loaded EOP data: The columnNames property is required.", void 0; if (!r(i.samples)) return t._dataError = "Error in loaded EOP data: The samples property is required.", void 0; var n = i.columnNames.indexOf("modifiedJulianDateUtc"),
o = i.columnNames.indexOf("xPoleWanderRadians"),
l = i.columnNames.indexOf("yPoleWanderRadians"),
h = i.columnNames.indexOf("ut1MinusUtcSeconds"),
m = i.columnNames.indexOf("xCelestialPoleOffsetRadians"),
p = i.columnNames.indexOf("yCelestialPoleOffsetRadians"),
f = i.columnNames.indexOf("taiMinusUtcSeconds"); if (0 > n || 0 > o || 0 > l || 0 > h || 0 > m || 0 > p || 0 > f) return t._dataError = "Error in loaded EOP data: The columnNames property must include modifiedJulianDateUtc, xPoleWanderRadians, yPoleWanderRadians, ut1MinusUtcSeconds, xCelestialPoleOffsetRadians, yCelestialPoleOffsetRadians, and taiMinusUtcSeconds columns", void 0; var v = t._samples = i.samples,
y = t._dates = [];
t._dateColumn = n, t._xPoleWanderRadiansColumn = o, t._yPoleWanderRadiansColumn = l, t._ut1MinusUtcSecondsColumn = h, t._xCelestialPoleOffsetRadiansColumn = m, t._yCelestialPoleOffsetRadiansColumn = p, t._taiMinusUtcSecondsColumn = f, t._columnCount = i.columnNames.length, t._lastIndex = void 0; for (var g, _ = t._addNewLeapSeconds, w = 0, C = v.length; C > w; w += t._columnCount) { var x = v[w + n],
S = v[w + f],
E = x + u.MODIFIED_JULIAN_DATE_DIFFERENCE,
b = new a(E, S, c.TAI); if (y.push(b), _) { if (S !== g && r(g)) { var T = s.getLeapSeconds(),
A = e(T, b, d); if (0 > A) { var M = new s(b, S);
T.splice(~A, 0, M) } } g = S } } }
function p(e, t, r, i, n) { var o = r * i;
n.xPoleWander = t[o + e._xPoleWanderRadiansColumn], n.yPoleWander = t[o + e._yPoleWanderRadiansColumn], n.xPoleOffset = t[o + e._xCelestialPoleOffsetRadiansColumn], n.yPoleOffset = t[o + e._yCelestialPoleOffsetRadiansColumn], n.ut1MinusUtc = t[o + e._ut1MinusUtcSecondsColumn] }
function f(e, t, r) { return t + e * (r - t) }
function v(e, t, r, i, n, o, a) { var s = e._columnCount; if (o > t.length - 1) return a.xPoleWander = 0, a.yPoleWander = 0, a.xPoleOffset = 0, a.yPoleOffset = 0, a.ut1MinusUtc = 0, a; var l = t[n],
u = t[o]; if (l.equals(u) || i.equals(l)) return p(e, r, n, s, a), a; if (i.equals(u)) return p(e, r, o, s, a), a; var c = l.getSecondsDifference(i) / l.getSecondsDifference(u),
h = n * s,
d = o * s,
m = r[h + e._ut1MinusUtcSecondsColumn],
v = r[d + e._ut1MinusUtcSecondsColumn],
y = v - m; if (y > .5 || -.5 > y) { var g = r[h + e._taiMinusUtcSecondsColumn],
_ = r[d + e._taiMinusUtcSecondsColumn];
g !== _ && (u.equals(i) ? m = v : v -= _ - g) } return a.xPoleWander = f(c, r[h + e._xPoleWanderRadiansColumn], r[d + e._xPoleWanderRadiansColumn]), a.yPoleWander = f(c, r[h + e._yPoleWanderRadiansColumn], r[d + e._yPoleWanderRadiansColumn]), a.xPoleOffset = f(c, r[h + e._xCelestialPoleOffsetRadiansColumn], r[d + e._xCelestialPoleOffsetRadiansColumn]), a.yPoleOffset = f(c, r[h + e._yCelestialPoleOffsetRadiansColumn], r[d + e._yCelestialPoleOffsetRadiansColumn]), a.ut1MinusUtc = f(c, m, v), a } var y = function(e) { if (e = t(e, t.EMPTY_OBJECT), this._dates = void 0, this._samples = void 0, this._dateColumn = -1, this._xPoleWanderRadiansColumn = -1, this._yPoleWanderRadiansColumn = -1, this._ut1MinusUtcSecondsColumn = -1, this._xCelestialPoleOffsetRadiansColumn = -1, this._yCelestialPoleOffsetRadiansColumn = -1, this._taiMinusUtcSecondsColumn = -1, this._columnCount = 0, this._lastIndex = -1, this._downloadPromise = void 0, this._dataError = void 0, this._addNewLeapSeconds = t(e.addNewLeapSeconds, !0), r(e.data)) m(this, e.data);
else if (r(e.url)) { var i = this;
this._downloadPromise = h(n(e.url), function(e) { m(i, e) }, function() { i._dataError = "An error occurred while retrieving the EOP data from the URL " + e.url + "." }) } else m(this, { columnNames: ["dateIso8601", "modifiedJulianDateUtc", "xPoleWanderRadians", "yPoleWanderRadians", "ut1MinusUtcSeconds", "lengthOfDayCorrectionSeconds", "xCelestialPoleOffsetRadians", "yCelestialPoleOffsetRadians", "taiMinusUtcSeconds"], samples: [] }) }; return y.NONE = i({ getPromiseToLoad: function() { return h() }, compute: function(e, t) { return r(t) ? (t.xPoleWander = 0, t.yPoleWander = 0, t.xPoleOffset = 0, t.yPoleOffset = 0, t.ut1MinusUtc = 0) : t = new o(0, 0, 0, 0, 0), t } }), y.prototype.getPromiseToLoad = function() { return h(this._downloadPromise) }, y.prototype.compute = function(t, i) { if (!r(this._samples)) { if (r(this._dataError)) throw new l(this._dataError); return void 0 } if (r(i) || (i = new o(0, 0, 0, 0, 0)), 0 === this._samples.length) return i.xPoleWander = 0, i.yPoleWander = 0, i.xPoleOffset = 0, i.yPoleOffset = 0, i.ut1MinusUtc = 0, i; var n = this._dates,
s = this._lastIndex,
u = 0,
c = 0; if (r(s)) { var h = n[s],
d = n[s + 1],
m = h.lessThanOrEquals(t),
p = !r(d),
f = p || d.greaterThanOrEquals(t); if (m && f) return u = s, !p && d.equals(t) && ++u, c = u + 1, v(this, n, this._samples, t, u, c, i), i } var y = e(n, t, a.compare, this._dateColumn); return y >= 0 ? (y < n.length - 1 && n[y + 1].equals(t) && ++y, u = y, c = y) : (c = ~y, u = c - 1, 0 > u && (u = 0)), this._lastIndex = u, v(this, n, this._samples, t, u, c, i), i }, y }), r("Core/Transforms", ["./defaultValue", "./defined", "./DeveloperError", "./Iau2006XysData", "./Iau2006XysSample", "./Math", "./Matrix3", "./Matrix4", "./Cartesian2", "./Cartesian3", "./Cartesian4", "./TimeConstants", "./Ellipsoid", "./EarthOrientationParameters", "./EarthOrientationParametersSample", "../ThirdParty/when"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f) { "use strict"; var v = {},
y = new u,
g = new u,
_ = new u;
v.eastNorthUpToFixedFrame = function(i, n, a) { if (!t(i)) throw new r("origin is required."); if (o.equalsEpsilon(i.x, 0, o.EPSILON14) && o.equalsEpsilon(i.y, 0, o.EPSILON14)) { var l = o.sign(i.z); return t(a) ? (a[0] = 0, a[1] = 1, a[2] = 0, a[3] = 0, a[4] = -l, a[5] = 0, a[6] = 0, a[7] = 0, a[8] = 0, a[9] = 0, a[10] = l, a[11] = 0, a[12] = i.x, a[13] = i.y, a[14] = i.z, a[15] = 1, a) : new s(0, -l, 0, i.x, 1, 0, 0, i.y, 0, 0, l, i.z, 0, 0, 0, 1) } var c = y,
h = g,
m = _; return n = e(n, d.WGS84), n.geodeticSurfaceNormal(i, c), h.x = -i.y, h.y = i.x, h.z = 0, u.normalize(h, h), c.cross(h, m), t(a) ? (a[0] = h.x, a[1] = h.y, a[2] = h.z, a[3] = 0, a[4] = m.x, a[5] = m.y, a[6] = m.z, a[7] = 0, a[8] = c.x, a[9] = c.y, a[10] = c.z, a[11] = 0, a[12] = i.x, a[13] = i.y, a[14] = i.z, a[15] = 1, a) : new s(h.x, m.x, c.x, i.x, h.y, m.y, c.y, i.y, h.z, m.z, c.z, i.z, 0, 0, 0, 1) }; var w = new u,
C = new u,
x = new u;
v.northEastDownToFixedFrame = function(i, n, a) { if (!t(i)) throw new r("origin is required."); if (o.equalsEpsilon(i.x, 0, o.EPSILON14) && o.equalsEpsilon(i.y, 0, o.EPSILON14)) { var l = o.sign(i.z); return t(a) ? (a[0] = -l, a[1] = 0, a[2] = 0, a[3] = 0, a[4] = 0, a[5] = 1, a[6] = 0, a[7] = 0, a[8] = 0, a[9] = 0, a[10] = -l, a[11] = 0, a[12] = i.x, a[13] = i.y, a[14] = i.z, a[15] = 1, a) : new s(-l, 0, 0, i.x, 0, 1, 0, i.y, 0, 0, -l, i.z, 0, 0, 0, 1) } var c = w,
h = C,
m = x; return n = e(n, d.WGS84), n.geodeticSurfaceNormal(i, c), h.x = -i.y, h.y = i.x, h.z = 0, u.normalize(h, h), c.cross(h, m), t(a) ? (a[0] = m.x, a[1] = m.y, a[2] = m.z, a[3] = 0, a[4] = h.x, a[5] = h.y, a[6] = h.z, a[7] = 0, a[8] = -c.x, a[9] = -c.y, a[10] = -c.z, a[11] = 0, a[12] = i.x, a[13] = i.y, a[14] = i.z, a[15] = 1, a) : new s(m.x, h.x, -c.x, i.x, m.y, h.y, -c.y, i.y, m.z, h.z, -c.z, i.z, 0, 0, 0, 1) }; var S = 24110.54841,
E = 8640184.812866,
b = .093104,
T = -62e-7,
A = 1.1772758384668e-19,
M = 72921158553e-15,
P = o.TWO_PI / 86400;
v.computeTemeToPseudoFixedMatrix = function(e, i) { if (!t(e)) throw new r("date is required."); var n, s = e.addSeconds(-e.getTaiMinusUtc()),
l = s.getJulianDayNumber(),
u = s.getSecondsOfDay(),
c = l - 2451545;
n = u >= 43200 ? (c + .5) / h.DAYS_PER_JULIAN_CENTURY : (c - .5) / h.DAYS_PER_JULIAN_CENTURY; var d = S + n * (E + n * (b + n * T)),
m = d * P % o.TWO_PI,
p = M + A * (l - 2451545.5),
f = (u + .5 * h.SECONDS_PER_DAY) % h.SECONDS_PER_DAY,
v = m + p * f,
y = Math.cos(v),
g = Math.sin(v); return t(i) ? (i[0] = y, i[1] = -g, i[2] = 0, i[3] = g, i[4] = y, i[5] = 0, i[6] = 0, i[7] = 0, i[8] = 1, i) : new a(y, g, 0, -g, y, 0, 0, 0, 1) }, v.iau2006XysData = new i, v.earthOrientationParameters = m.NONE; var D = 32.184,
I = 2451545;
v.preloadIcrfFixed = function(e) { var t = e.start.getJulianDayNumber(),
r = e.start.getSecondsOfDay() + D,
i = e.stop.getJulianDayNumber(),
n = e.stop.getSecondsOfDay() + D,
o = v.iau2006XysData.preload(t, r, i, n),
a = v.earthOrientationParameters.getPromiseToLoad(); return f.all([o, a]) }, v.computeIcrfToFixedMatrix = function(e, i) { if (!t(e)) throw new r("date is required."); var n = v.computeFixedToIcrfMatrix(e, i); return t(n) ? n.transpose(i) : void 0 }; var O = new n(0, 0, 0),
R = new p(0, 0, 0, 0, 0, 0),
L = new a,
z = new a;
v.computeFixedToIcrfMatrix = function(e, i) { if (!t(e)) throw new r("date is required."); var n = v.earthOrientationParameters.compute(e, R); if (!t(n)) return void 0; var s = e.getJulianDayNumber(),
l = e.getSecondsOfDay() + D,
u = v.iau2006XysData.computeXysRadians(s, l, O); if (!t(u)) return void 0; var c = u.x + n.xPoleOffset,
d = u.y + n.yPoleOffset,
m = 1 / (1 + Math.sqrt(1 - c * c - d * d)),
p = L;
p[0] = 1 - m * c * c, p[3] = -m * c * d, p[6] = c, p[1] = -m * c * d, p[4] = 1 - m * d * d, p[7] = d, p[2] = -c, p[5] = -d, p[8] = 1 - m * (c * c + d * d); var f = a.fromRotationZ(-u.s, z),
y = p.multiply(f, L),
g = e.getJulianDayNumber(),
_ = e.getSecondsOfDay() - e.getTaiMinusUtc() + n.ut1MinusUtc,
w = g - 2451545,
C = _ / h.SECONDS_PER_DAY,
x = .779057273264 + C + .00273781191135448 * (w + C);
x = x % 1 * o.TWO_PI; var S = a.fromRotationZ(x, z),
E = y.multiply(S, L),
b = Math.cos(n.xPoleWander),
T = Math.cos(n.yPoleWander),
A = Math.sin(n.xPoleWander),
M = Math.sin(n.yPoleWander),
P = s - I + l / h.SECONDS_PER_DAY;
P /= 36525; var N = -47e-6 * P * o.RADIANS_PER_DEGREE / 3600,
F = Math.cos(N),
B = Math.sin(N),
V = z; return V[0] = b * F, V[1] = b * B, V[2] = A, V[3] = -T * B + M * A * F, V[4] = T * F + M * A * B, V[5] = -M * b, V[6] = -M * B - T * A * F, V[7] = M * F - T * A * B, V[8] = T * b, E.multiply(V, i) }; var N = new c; return v.pointToWindowCoordinates = function(e, i, n, o) { if (!t(e)) throw new r("modelViewProjectionMatrix is required."); if (!t(i)) throw new r("viewportTransformation is required."); if (!t(n)) throw new r("point is required."); var a = N; return s.multiplyByPoint(e, n, a), c.multiplyByScalar(a, 1 / a.w, a), s.multiplyByVector(i, a, a), l.fromCartesian4(a, o) }, v }), r("Core/Ray", ["./DeveloperError", "./defaultValue", "./Cartesian3"], function(e, t, r) { "use strict"; var i = function(e, i) { i = r.clone(t(i, r.ZERO)), i.equals(r.ZERO) || r.normalize(i, i), this.origin = r.clone(t(e, r.ZERO)), this.direction = i }; return i.prototype.getPoint = function(t, i) { if ("number" != typeof t) throw new e("t is a required number"); return i = r.multiplyByScalar(this.direction, t, i), r.add(this.origin, i, i) }, i }), r("Core/EllipsoidTangentPlane", ["./defaultValue", "./defined", "./DeveloperError", "./Transforms", "./AxisAlignedBoundingBox", "./IntersectionTests", "./Cartesian2", "./Cartesian3", "./Ellipsoid", "./Ray", "./Plane"], function(e, t, r, i, n, o, a, s, l, u, c) {
"use strict";
var h = function(n, o) {
if (!t(n)) throw new r("origin is required.");
if (o = e(o, l.WGS84), n = o.scaleToGeodeticSurface(n), !t(n)) throw new r("origin must not be at the center of the ellipsoid.");
var a = i.eastNorthUpToFixedFrame(n, o);
this._ellipsoid = o, this._origin = s.clone(n), this._xAxis = s.fromCartesian4(a.getColumn(0)), this._yAxis = s.fromCartesian4(a.getColumn(1));
var u = s.fromCartesian4(a.getColumn(2)),
h = -s.dot(n, n);
this._plane = new c(u, h)
},
d = new n;
h.fromPoints = function(e, i) { if (!t(e)) throw new r("cartesians is required."); var o = n.fromPoints(e, d); return new h(o.center, i) }, h.prototype.getEllipsoid = function() { return this._ellipsoid }, h.prototype.getOrigin = function() { return this._origin };
var m = new u,
p = new s;
h.prototype.projectPointOntoPlane = function(e, i) { if (!t(e)) throw new r("cartesian is required."); var n = m;
n.origin = e, s.normalize(e, n.direction); var l = o.rayPlane(n, this._plane, p); if (t(l)) { var u = l.subtract(this._origin, l),
c = this._xAxis.dot(u),
h = this._yAxis.dot(u); return t(i) ? (i.x = c, i.y = h, i) : new a(c, h) } return void 0 }, h.prototype.projectPointsOntoPlane = function(e, i) { if (!t(e)) throw new r("cartesians is required.");
t(i) || (i = []); for (var n = 0, o = e.length, a = 0; o > a; a++) { var s = this.projectPointOntoPlane(e[a], i[n]);
t(s) && (i[n] = s, n++) } return i.length = n, i };
var f = new s;
return h.prototype.projectPointsOntoEllipsoid = function(e, i) { if (!t(e)) throw new r("cartesians is required."); var n = e.length;
t(i) ? i.length = n : i = new Array(n); for (var o = this._ellipsoid, a = this._origin, l = this._xAxis, u = this._yAxis, c = f, h = 0; n > h; ++h) { var d = e[h];
l.multiplyByScalar(d.x, c); var m = i[h] = s.add(a, c, i[h]);
u.multiplyByScalar(d.y, c), s.add(m, c, m), o.scaleToGeocentricSurface(m, m) } return i }, h
}), r("Core/EllipsoidGeodesic", ["./freezeObject", "./defaultValue", "./defined", "./DeveloperError", "./Ellipsoid", "./Math", "./Cartesian3", "./Cartographic"], function(e, t, r, i, n, o, a, s) { "use strict";
function l(e) { var t = e._uSquared,
r = e._ellipsoid.getMaximumRadius(),
i = e._ellipsoid.getMinimumRadius(),
n = (r - i) / r,
o = Math.cos(e._startHeading),
a = Math.sin(e._startHeading),
s = (1 - n) * Math.tan(e._start.latitude),
l = 1 / Math.sqrt(1 + s * s),
u = l * s,
c = Math.atan2(s, o),
h = l * a,
d = h * h,
m = 1 - d,
p = Math.sqrt(m),
f = t / 4,
v = f * f,
y = v * f,
g = v * v,
_ = 1 + f - 3 * v / 4 + 5 * y / 4 - 175 * g / 64,
w = 1 - f + 15 * v / 8 - 35 * y / 8,
C = 1 - 3 * f + 35 * v / 4,
x = 1 - 5 * f,
S = _ * c - w * Math.sin(2 * c) * f / 2 - C * Math.sin(4 * c) * v / 16 - x * Math.sin(6 * c) * y / 48 - 5 * Math.sin(8 * c) * g / 512,
E = e._constants;
E.a = r, E.b = i, E.f = n, E.cosineHeading = o, E.sineHeading = a, E.tanU = s, E.cosineU = l, E.sineU = u, E.sigma = c, E.sineAlpha = h, E.sineSquaredAlpha = d, E.cosineSquaredAlpha = m, E.cosineAlpha = p, E.u2Over4 = f, E.u4Over16 = v, E.u6Over64 = y, E.u8Over256 = g, E.a0 = _, E.a1 = w, E.a2 = C, E.a3 = x, E.distanceRatio = S }
function u(e, t) { return e * t * (4 + e * (4 - 3 * t)) / 16 }
function c(e, t, r, i, n, o, a) { var s = u(e, r); return (1 - s) * e * t * (i + s * n * (a + s * o * (2 * a * a - 1))) }
function h(e, t, r, i, n, a, s) { var l, u, h, d, m, p = (t - r) / t,
f = a - i,
v = Math.atan((1 - p) * Math.tan(n)),
y = Math.atan((1 - p) * Math.tan(s)),
g = Math.cos(v),
_ = Math.sin(v),
w = Math.cos(y),
C = Math.sin(y),
x = g * w,
S = g * C,
E = _ * C,
b = _ * w,
T = f,
A = o.TWO_PI,
M = Math.cos(T),
P = Math.sin(T);
do { M = Math.cos(T), P = Math.sin(T); var D = S - b * M;
h = Math.sqrt(w * w * P * P + D * D), u = E + x * M, l = Math.atan2(h, u); var I;
0 === h ? (I = 0, d = 1) : (I = x * P / h, d = 1 - I * I), A = T, m = u - 2 * E / d, isNaN(m) && (m = 0), T = f + c(p, I, d, l, h, u, m) } while (Math.abs(T - A) > o.EPSILON12); var O = d * (t * t - r * r) / (r * r),
R = 1 + O * (4096 + O * (O * (320 - 175 * O) - 768)) / 16384,
L = O * (256 + O * (O * (74 - 47 * O) - 128)) / 1024,
z = m * m,
N = L * h * (m + L * (u * (2 * z - 1) - L * m * (4 * h * h - 3) * (4 * z - 3) / 6) / 4),
F = r * R * (l - N),
B = Math.atan2(w * P, S - b * M),
V = Math.atan2(g * P, S * M - b);
e._distance = F, e._startHeading = B, e._endHeading = V, e._uSquared = O }
function d(e, t, r, n) { var o = n.cartographicToCartesian(t, p).normalize(m),
a = n.cartographicToCartesian(r, p).normalize(p); if (Math.abs(Math.abs(o.angleBetween(a)) - Math.PI) < .0125) throw new i("geodesic position is not unique");
h(e, n.getMaximumRadius(), n.getMinimumRadius(), t.longitude, t.latitude, r.longitude, r.latitude), t.height = 0, r.height = 0, e._start = s.clone(t, e._start), e._end = s.clone(r, e._end), l(e) } var m = new a,
p = new a,
f = function(e, i, o) { var a = t(o, n.WGS84);
this._ellipsoid = a, this._start = new s, this._end = new s, this._constants = {}, this._startHeading = void 0, this._endHeading = void 0, this._distance = void 0, this._uSquared = void 0, r(e) && r(i) && d(this, e, i, a) }; return f.prototype.getSurfaceDistance = function() { if (!r(this._distance)) throw new i("start and end must be set before calling funciton getSurfaceDistance"); return this._distance }, f.prototype.setEndPoints = function(e, t) { if (!r(e)) throw new i("start cartographic position is required"); if (!r(t)) throw new i("end cartgraphic position is required");
d(this, e, t, this._ellipsoid) }, f.prototype.getStart = function() { return this._start }, f.prototype.getEnd = function() { return this._end }, f.prototype.getStartHeading = function() { if (!r(this._distance)) throw new i("start and end must be set before calling funciton getStartHeading"); return this._startHeading }, f.prototype.getEndHeading = function() { if (!r(this._distance)) throw new i("start and end must be set before calling funciton getEndHeading"); return this._endHeading }, f.prototype.interpolateUsingFraction = function(e, t) { return this.interpolateUsingSurfaceDistance(this._distance * e, t) }, f.prototype.interpolateUsingSurfaceDistance = function(e, t) { if (!r(this._distance)) throw new i("start and end must be set before calling funciton interpolateUsingSurfaceDistance"); var n = this._constants,
o = n.distanceRatio + e / n.b,
a = Math.cos(2 * o),
l = Math.cos(4 * o),
u = Math.cos(6 * o),
h = Math.sin(2 * o),
d = Math.sin(4 * o),
m = Math.sin(6 * o),
p = Math.sin(8 * o),
f = o * o,
v = o * f,
y = n.u8Over256,
g = n.u2Over4,
_ = n.u6Over64,
w = n.u4Over16,
C = 2 * v * y * a / 3 + o * (1 - g + 7 * w / 4 - 15 * _ / 4 + 579 * y / 64 - (w - 15 * _ / 4 + 187 * y / 16) * a - (5 * _ / 4 - 115 * y / 16) * l - 29 * y * u / 16) + (g / 2 - w + 71 * _ / 32 - 85 * y / 16) * h + (5 * w / 16 - 5 * _ / 4 + 383 * y / 96) * d - f * ((_ - 11 * y / 2) * h + 5 * y * d / 2) + (29 * _ / 96 - 29 * y / 16) * m + 539 * y * p / 1536,
x = Math.asin(Math.sin(C) * n.cosineAlpha),
S = Math.atan(n.a / n.b * Math.tan(x));
C -= n.sigma; var E = Math.cos(2 * n.sigma + C),
b = Math.sin(C),
T = Math.cos(C),
A = n.cosineU * T,
M = n.sineU * b,
P = Math.atan2(b * n.sineHeading, A - M * n.cosineHeading),
D = P - c(n.f, n.sineAlpha, n.cosineSquaredAlpha, C, b, T, E); return r(t) ? (t.longitude = this._start.longitude + D, t.latitude = S, t.height = 0, t) : new s(this._start.longitude + D, S, 0) }, f }), r("Core/PolylinePipeline", ["./defaultValue", "./defined", "./DeveloperError", "./Cartographic", "./Cartesian3", "./Cartesian4", "./Ellipsoid", "./EllipsoidGeodesic", "./IntersectionTests", "./Math", "./Matrix4", "./Plane"], function(e, t, r, i, n, o, a, s, l, u, c, h) { "use strict";
function d(e, t, r, i) { var o = n.angleBetween(e, t),
a = Math.ceil(o / r),
s = new Array(3 * a),
l = i.cartesianToCartographic(e, S),
u = i.cartesianToCartographic(t, E);
T.setEndPoints(l, u); var c = T.getSurfaceDistance() / a,
h = 0;
l.height = 0; var d = i.cartographicToCartesian(l, b);
s[h++] = d.x, s[h++] = d.y, s[h++] = d.z; for (var m = 1; a > m; m++) { var p = T.interpolateUsingSurfaceDistance(m * c, E);
d = i.cartographicToCartesian(p, b), s[h++] = d.x, s[h++] = d.y, s[h++] = d.z } return s }
function m(e, t, r) { var i = A; return r.geodeticSurfaceNormal(e, i), n.multiplyByScalar(i, t, i), n.add(e, i, e), e } var p = {},
f = new c,
v = new o,
y = new o,
g = new h(n.ZERO, 0),
_ = new o,
w = new h(n.ZERO, 0),
C = new n,
x = new n,
S = new i,
E = new i,
b = new n,
T = new s,
A = new n,
M = new n; return p.wrapLongitude = function(r, i) { var a = [],
s = []; if (t(r) && r.length > 0) { i = e(i, c.IDENTITY); var u = c.inverseTransformation(i, f),
d = c.multiplyByPoint(u, n.ZERO, v),
m = c.multiplyByVector(u, o.UNIT_Y, y),
p = h.fromPointNormal(d, m, g),
S = c.multiplyByVector(u, o.UNIT_X, _),
E = h.fromPointNormal(d, S, w),
b = 1;
a.push(n.clone(r[0])); for (var T = a[0], A = r.length, M = 1; A > M; ++M) { var P = r[M]; if (h.getPointDistance(E, T) < 0 || h.getPointDistance(E, P) < 0) { var D = l.lineSegmentPlane(T, P, p, C); if (t(D)) { var I = n.multiplyByScalar(m, 5e-9, x);
h.getPointDistance(p, T) < 0 && n.negate(I, I), a.push(n.add(D, I)), s.push(b + 1), n.negate(I, I), a.push(n.add(D, I)), b = 1 } } a.push(n.clone(r[M])), b++, T = P } s.push(b) } return { positions: a, lengths: s } }, p.removeDuplicates = function(e) { if (!t(e)) throw new r("positions is required."); var i = e.length; if (2 > i) return e.slice(0); var o = [];
o.push(e[0]); for (var a = 1; i > a; ++a) { var s = e[a - 1],
l = e[a];
n.equals(s, l) || o.push(l) } return o }, p.scaleToSurface = function(i, n, o) { if (!t(i)) throw new r("positions is required");
n = e(n, u.RADIANS_PER_DEGREE), o = e(o, a.WGS84); for (var s = i.length, l = [], c = 0; s - 1 > c; c++) { var h = i[c],
m = i[c + 1];
l = l.concat(d(h, m, n, o)) } var p = i[s - 1],
f = o.cartesianToCartographic(p, S);
f.height = 0; var v = o.cartographicToCartesian(f, b); return l.push(v.x, v.y, v.z), l }, p.scaleToGeodeticHeight = function(i, o, s, l) { if (!t(i)) throw new r("positions must be defined."); if (!t(o)) throw new r("height must be defined");
s = e(s, a.WGS84); var u, c, h = i.length,
d = M; if (t(l)) { if (l.length !== i.length) throw new r("result.length must be equal to positions.length");
c = l } else c = new Array(i.length); if (0 === o) { for (u = 0; h > u; u += 3) d = s.scaleToGeodeticSurface(n.fromArray(i, u, d), d), c[u] = d.x, c[u + 1] = d.y, c[u + 2] = d.z; return c } var p; if (Array.isArray(o)) { if (o.length !== h / 3) throw new r("height.length must be equal to positions.length"); for (u = 0; h > u; u += 3) p = o[u / 3], d = n.fromArray(i, u, d), d = m(d, p, s), c[u] = d.x, c[u + 1] = d.y, c[u + 2] = d.z } else
for (p = o, u = 0; h > u; u += 3) d = n.fromArray(i, u, d), d = m(d, p, s), c[u] = d.x, c[u + 1] = d.y, c[u + 2] = d.z; return c }, p }), r("Core/CorridorGeometry", ["./defined", "./DeveloperError", "./Cartesian2", "./Cartesian3", "./CornerType", "./ComponentDatatype", "./Ellipsoid", "./EllipsoidTangentPlane", "./Geometry", "./IndexDatatype", "./Math", "./Matrix3", "./PolylinePipeline", "./PrimitiveType", "./Quaternion", "./defaultValue", "./BoundingSphere", "./GeometryAttribute", "./GeometryAttributes", "./VertexFormat"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _) { "use strict";
function w(e, t, n, o) { var a = new s(n, o),
l = a.projectPointOntoPlane(n, Y),
u = a.projectPointOntoPlane(i.add(n, e, X), X),
c = a.projectPointOntoPlane(i.add(n, t, Z), Z); return c = r.subtract(c, l, c), u = r.subtract(u, l, u), c.x * u.y - c.y * u.x >= 0 }
function C(t, r, i, n) { var o = r.x,
a = r.y,
s = r.z;
e(i) && (t[i] = o, t[i + 1] = a, t[i + 2] = s), e(n) && (t[n] = s, t[n - 1] = a, t[n - 2] = o) }
function x(e, t, r, n, o, a) { var s = e.normals,
l = e.tangents,
u = e.binormals,
c = i.cross(r, t, W).normalize(W);
a.normal && C(s, t, n, o), a.binormal && C(u, r, n, o), a.tangent && C(l, c, n, o) }
function S(e, t, r, o, a) { var s = i.angleBetween(t.subtract(e, W), r.subtract(e, G)),
l = o.value === n.BEVELED.value ? 1 : Math.ceil(s / c.toRadians(5)) + 1,
u = 3 * l,
d = new Array(u);
d[u - 3] = r.x, d[u - 2] = r.y, d[u - 1] = r.z; var m;
m = a ? h.fromQuaternion(p.fromAxisAngle(e, s / l, K), J) : h.fromQuaternion(p.fromAxisAngle(e.negate(W), s / l, K), J); var f = 0;
t = t.clone(W); for (var v = 0; l > v; v++) t = m.multiplyByVector(t, t), d[f++] = t.x, d[f++] = t.y, d[f++] = t.z; return d }
function E(e, t, r) { var o = R,
a = L,
s = z,
l = e[1];
a = i.fromArray(e[1], l.length - 3, a), s = i.fromArray(e[0], 0, s), o = a.add(s, o).multiplyByScalar(.5, o); var u = S(o, a, s, n.ROUNDED, !1, r),
c = e.length - 1,
h = e[c - 1];
l = e[c], a = i.fromArray(h, h.length - 3, a), s = i.fromArray(l, 0, s), o = a.add(s, o).multiplyByScalar(.5, o); var d = S(o, a, s, n.ROUNDED, !1, r); return [u, d] }
function b(e, t, r, n, o) { var a = W; return o ? a = i.add(e, r, a) : (r = r.negate(r), a = i.add(e, r, a)), [a.x, a.y, a.z, n.x, n.y, n.z] }
function T(t, r, n, a, s, l, h) { var d, m, p, f = new g,
_ = 0,
w = 0,
S = 0; for (m = 0; m < t.length; m += 2) p = t[m].length - 3, _ += p, S += 2 * p, w += t[m + 1].length - 3; for (_ += 3, w += 3, m = 0; m < r.length; m++) { d = r[m]; var E = r[m].leftPositions;
e(E) ? (p = E.length, _ += p, S += p) : (p = r[m].rightPositions.length, w += p, S += p) } var b, T = e(l);
T && (b = l[0].length - 3, _ += b, w += b, b /= 3, S += 6 * b); var A, M, P, D, I, O, F = _ + w,
V = new Float64Array(F),
q = s.normal ? new Float32Array(F) : void 0,
k = s.tangent ? new Float32Array(F) : void 0,
U = s.binormal ? new Float32Array(F) : void 0,
H = { normals: q, tangents: k, binormals: U },
j = 0,
Y = F - 1,
X = R,
Z = L,
K = b / 2,
J = u.createTypedArray(F / 3, S),
Q = 0; if (T) { O = z, I = N; var $ = l[0]; for (X = i.fromArray(a, 0, X), Z = i.fromArray(n, 0, Z), m = 0; K > m; m++) O = i.fromArray($, 3 * (K - 1 - m), O), I = i.fromArray($, 3 * (K + m), I), C(V, I, j), C(V, O, void 0, Y), x(H, X, Z, j, Y, s), M = j / 3, D = M + 1, A = (Y - 2) / 3, P = A - 1, J[Q++] = A, J[Q++] = M, J[Q++] = P, J[Q++] = P, J[Q++] = M, J[Q++] = D, j += 3, Y -= 3 } var et = 0,
tt = 0,
rt = t[et++],
it = t[et++];
V.set(rt, j), V.set(it, Y - it.length + 1), Z = i.fromArray(n, tt, Z); var nt, ot; for (p = it.length - 3, m = 0; p > m; m += 3) nt = h.geodeticSurfaceNormal(i.fromArray(rt, m, W), W), ot = h.geodeticSurfaceNormal(i.fromArray(it, p - m, G), G), X = nt.add(ot, X).normalize(X), x(H, X, Z, j, Y, s), M = j / 3, D = M + 1, A = (Y - 2) / 3, P = A - 1, J[Q++] = A, J[Q++] = M, J[Q++] = P, J[Q++] = P, J[Q++] = M, J[Q++] = D, j += 3, Y -= 3; for (nt = h.geodeticSurfaceNormal(i.fromArray(rt, p, W), W), ot = h.geodeticSurfaceNormal(i.fromArray(it, p, G), G), X = nt.add(ot, X).normalize(X), tt += 3, m = 0; m < r.length; m++) { var at;
d = r[m]; var st, lt, ut = d.leftPositions,
ct = d.rightPositions,
ht = B,
dt = z,
mt = N; if (X = i.fromArray(a, tt, X), e(ut)) { for (x(H, X, Z, void 0, Y, s), Y -= 3, st = D, lt = P, at = 0; at < ut.length / 3; at++) ht = i.fromArray(ut, 3 * at, ht), J[Q++] = st, J[Q++] = lt - at - 1, J[Q++] = lt - at, C(V, ht, void 0, Y), dt = i.fromArray(V, 3 * (lt - at - 1), dt), mt = i.fromArray(V, 3 * st, mt), Z = dt.subtract(mt, Z).normalize(Z), x(H, X, Z, void 0, Y, s), Y -= 3;
ht = i.fromArray(V, 3 * st, ht), dt = i.fromArray(V, 3 * lt, dt).subtract(ht, dt), mt = i.fromArray(V, 3 * (lt - at), mt).subtract(ht, mt), Z = dt.add(mt, Z).normalize(Z), x(H, X, Z, j, void 0, s), j += 3 } else { for (x(H, X, Z, j, void 0, s), j += 3, st = P, lt = D, at = 0; at < ct.length / 3; at++) ht = i.fromArray(ct, 3 * at, ht), J[Q++] = st, J[Q++] = lt + at, J[Q++] = lt + at + 1, C(V, ht, j), dt = i.fromArray(V, 3 * st, dt), mt = i.fromArray(V, 3 * (lt + at), mt), Z = dt.subtract(mt, Z).normalize(Z), x(H, X, Z, j, void 0, s), j += 3;
ht = i.fromArray(V, 3 * st, ht), dt = i.fromArray(V, 3 * (lt + at), dt).subtract(ht, dt), mt = i.fromArray(V, 3 * lt, mt).subtract(ht, mt), Z = mt.add(dt, Z).negate(Z).normalize(Z), x(H, X, Z, void 0, Y, s), Y -= 3 } for (rt = t[et++], it = t[et++], rt.splice(0, 3), it.splice(it.length - 3, 3), V.set(rt, j), V.set(it, Y - it.length + 1), p = it.length - 3, tt += 3, Z = i.fromArray(n, tt, Z), at = 0; at < it.length; at += 3) nt = h.geodeticSurfaceNormal(i.fromArray(rt, at, W), W), ot = h.geodeticSurfaceNormal(i.fromArray(it, p - at, G), G), X = nt.add(ot, X).normalize(X), x(H, X, Z, j, Y, s), D = j / 3, M = D - 1, P = (Y - 2) / 3, A = P + 1, J[Q++] = A, J[Q++] = M, J[Q++] = P, J[Q++] = P, J[Q++] = M, J[Q++] = D, j += 3, Y -= 3;
j -= 3, Y += 3 } if (X = i.fromArray(a, a.length - 3, X), x(H, X, Z, j, Y, s), T) { j += 3, Y -= 3, O = z, I = N; var pt = l[1]; for (m = 0; K > m; m++) O = i.fromArray(pt, 3 * (b - m - 1), O), I = i.fromArray(pt, 3 * m, I), C(V, O, void 0, Y), C(V, I, j), x(H, X, Z, j, Y, s), D = j / 3, M = D - 1, P = (Y - 2) / 3, A = P + 1, J[Q++] = A, J[Q++] = M, J[Q++] = P, J[Q++] = P, J[Q++] = M, J[Q++] = D, j += 3, Y -= 3 } if (f.position = new y({ componentDatatype: o.DOUBLE, componentsPerAttribute: 3, values: V }), s.st) { var ft, vt, yt = new Float32Array(2 * (F / 3)),
gt = 0; if (T) { _ /= 3, w /= 3; var _t = Math.PI / (b + 1);
vt = 1 / (_ - b + 1), ft = 1 / (w - b + 1); var wt, Ct = b / 2; for (m = Ct + 1; b + 1 > m; m++) wt = c.PI_OVER_TWO + _t * m, yt[gt++] = ft * (1 + Math.cos(wt)), yt[gt++] = .5 * (1 + Math.sin(wt)); for (m = 1; w - b + 1 > m; m++) yt[gt++] = m * ft, yt[gt++] = 0; for (m = b; m > Ct; m--) wt = c.PI_OVER_TWO - m * _t, yt[gt++] = 1 - ft * (1 + Math.cos(wt)), yt[gt++] = .5 * (1 + Math.sin(wt)); for (m = Ct; m > 0; m--) wt = c.PI_OVER_TWO - _t * m, yt[gt++] = 1 - vt * (1 + Math.cos(wt)), yt[gt++] = .5 * (1 + Math.sin(wt)); for (m = _ - b; m > 0; m--) yt[gt++] = m * vt, yt[gt++] = 1; for (m = 1; Ct + 1 > m; m++) wt = c.PI_OVER_TWO + _t * m, yt[gt++] = vt * (1 + Math.cos(wt)), yt[gt++] = .5 * (1 + Math.sin(wt)) } else { for (_ /= 3, w /= 3, vt = 1 / (_ - 1), ft = 1 / (w - 1), m = 0; w > m; m++) yt[gt++] = m * ft, yt[gt++] = 0; for (m = _; m > 0; m--) yt[gt++] = (m - 1) * vt, yt[gt++] = 1 } f.st = new y({ componentDatatype: o.FLOAT, componentsPerAttribute: 2, values: yt }) } return s.normal && (f.normal = new y({ componentDatatype: o.FLOAT, componentsPerAttribute: 3, values: H.normals })), s.tangent && (f.tangent = new y({ componentDatatype: o.FLOAT, componentsPerAttribute: 3, values: H.tangents })), s.binormal && (f.binormal = new y({ componentDatatype: o.FLOAT, componentsPerAttribute: 3, values: H.binormals })), { attributes: f, indices: J, boundingSphere: v.fromVertices(V) } }
function A(e, t, r, n) { for (var o = new Array(e.length), a = new Array(e.length), s = t.multiplyByScalar(r, W), l = s.negate(G), u = 0, c = e.length - 1, h = 0; h < e.length; h += 3) { var d = i.fromArray(e, h, H),
m = d.add(l, j);
o[u++] = m.x, o[u++] = m.y, o[u++] = m.z; var p = d.add(s, j);
a[c--] = p.z, a[c--] = p.y, a[c--] = p.x } return n.push(o, a), n }
function M(e) { var t = e.granularity,
r = e.positions,
o = e.width / 2,
a = e.ellipsoid,
s = e.cornerType,
l = R,
u = L,
h = z,
m = N,
p = F,
f = B,
v = V,
y = q,
g = k,
_ = U,
C = [],
x = [],
M = [],
P = r[0],
D = r[1];
u = i.subtract(D, P, u).normalize(u), l = a.geodeticSurfaceNormal(P, l), m = l.cross(u, m).normalize(m), x.push(m.x, m.y, m.z), M.push(l.x, l.y, l.z), v = i.clone(P, v), P = D, h = u.negate(h); var I, G, H = [],
j = r.length; for (G = 1; j - 1 > G; G++) { l = a.geodeticSurfaceNormal(P, l), D = r[G + 1], u = i.subtract(D, P, u).normalize(u), p = u.add(h, p).normalize(p); var Y = !i.equalsEpsilon(p.negate(W), l, c.EPSILON2); if (Y) { p = p.cross(l, p), p = l.cross(p, p); var X = o / Math.max(.25, i.cross(p, h, W).magnitude()),
Z = w(u, h, P, a);
p = p.multiplyByScalar(X, p, p), Z ? (y = i.add(P, p, y), _ = y.add(m.multiplyByScalar(o, _), _), g = y.add(m.multiplyByScalar(2 * o, g), g), O[0] = i.clone(v, O[0]), O[1] = i.clone(_, O[1]), I = d.scaleToSurface(O, t, a), C = A(I, m, o, C), x.push(m.x, m.y, m.z), M.push(l.x, l.y, l.z), f = g.clone(f), m = l.cross(u, m).normalize(m), g = y.add(m.multiplyByScalar(2 * o, g), g), v = y.add(m.multiplyByScalar(o, v), v), s.value === n.ROUNDED.value || s.value === n.BEVELED.value ? H.push({ leftPositions: S(y, f, g, s, Z, a) }) : H.push({ leftPositions: b(P, f, p.negate(p), g, Z, t, a) })) : (g = i.add(P, p, g), _ = g.add(m.multiplyByScalar(o, _).negate(_), _), y = g.add(m.multiplyByScalar(2 * o, y).negate(y), y), O[0] = i.clone(v, O[0]), O[1] = i.clone(_, O[1]), I = d.scaleToSurface(O, t, a), C = A(I, m, o, C), x.push(m.x, m.y, m.z), M.push(l.x, l.y, l.z), f = y.clone(f), m = l.cross(u, m).normalize(m), y = g.add(m.multiplyByScalar(2 * o, y).negate(y), y), v = g.add(m.multiplyByScalar(o, v).negate(v), v), s.value === n.ROUNDED.value || s.value === n.BEVELED.value ? H.push({ rightPositions: S(g, f, y, s, Z, a) }) : H.push({ rightPositions: b(P, f, p, y, Z, t, a) })), h = u.negate(h) } P = D } l = a.geodeticSurfaceNormal(P, l), O[0] = i.clone(v, O[0]), O[1] = i.clone(P, O[1]), I = d.scaleToSurface(O, t, a), C = A(I, m, o, C), x.push(m.x, m.y, m.z), M.push(l.x, l.y, l.z); var K; return s.value === n.ROUNDED.value && (K = E(C, o, a)), T(C, H, x, M, e.vertexFormat, K, a) }
function P(e, t) { if (!(t.normal || t.binormal || t.tangent || t.st)) return e; var r, n, o = e.position.values;
(t.normal || t.binormal) && (r = e.normal.values, n = e.binormal.values); var a, s = e.position.values.length / 18,
l = 3 * s,
u = 2 * s,
c = 2 * l; if (t.normal || t.binormal || t.tangent) { var h = t.normal ? new Float32Array(6 * l) : void 0,
d = t.binormal ? new Float32Array(6 * l) : void 0,
m = t.tangent ? new Float32Array(6 * l) : void 0,
p = R,
f = L,
v = z,
y = N,
g = F,
_ = B,
w = c; for (a = 0; l > a; a += 3) { var x = w + c;
p = i.fromArray(o, a, p), f = i.fromArray(o, a + l, f), v = i.fromArray(o, (a + 3) % l, v), f = f.subtract(p, f), v = v.subtract(p, v), y = f.cross(v, y).normalize(y), t.normal && (C(h, y, x), C(h, y, x + 3), C(h, y, w), C(h, y, w + 3)), (t.tangent || t.binormal) && (_ = i.fromArray(r, a, _), t.binormal && (C(d, _, x), C(d, _, x + 3), C(d, _, w), C(d, _, w + 3)), t.tangent && (g = _.cross(y, g).normalize(g), C(m, g, x), C(m, g, x + 3), C(m, g, w), C(m, g, w + 3))), w += 6 } if (t.normal) { for (h.set(r), a = 0; l > a; a += 3) h[a + l] = -r[a], h[a + l + 1] = -r[a + 1], h[a + l + 2] = -r[a + 2];
e.normal.values = h } else e.normal = void 0; if (t.binormal ? (d.set(n), d.set(n, l), e.binormal.values = d) : e.binormal = void 0, t.tangent) { var S = e.tangent.values;
m.set(S), m.set(S, l), e.tangent.values = m } } if (t.st) { var E = e.st.values,
b = new Float32Array(6 * u);
b.set(E), b.set(E, u); for (var T = 2 * u, A = 0; 2 > A; A++) { for (b[T++] = E[0], b[T++] = E[1], a = 2; u > a; a += 2) { var M = E[a],
P = E[a + 1];
b[T++] = M, b[T++] = P, b[T++] = M, b[T++] = P } b[T++] = E[0], b[T++] = E[1] } e.st.values = b } return e }
function D(e, t, r) { r[t++] = e[0], r[t++] = e[1], r[t++] = e[2]; for (var i = 3; i < e.length; i += 3) { var n = e[i],
o = e[i + 1],
a = e[i + 2];
r[t++] = n, r[t++] = o, r[t++] = a, r[t++] = n, r[t++] = o, r[t++] = a } return r[t++] = e[0], r[t++] = e[1], r[t++] = e[2], r }
function I(e) { var t = e.vertexFormat;
e.vertexFormat = new _({ position: t.positon, normal: t.normal || t.binormal, tangent: t.tangent, binormal: t.normal || t.binormal, st: t.st }); var r = M(e),
i = e.height,
n = e.extrudedHeight,
o = e.ellipsoid,
a = r.attributes,
s = r.indices,
l = r.boundingSphere,
c = a.position.values,
h = c.length,
m = new Float64Array(6 * h),
p = new Float64Array(h);
p.set(c); var f = new Float64Array(4 * h);
c = d.scaleToGeodeticHeight(c, i, o, c), f = D(c, 0, f), p = d.scaleToGeodeticHeight(p, n, o, p), f = D(p, 2 * h, f), m.set(c), m.set(p, h), m.set(f, 2 * h), l = v.fromVertices(c, void 0, 3, l), a.position.values = m, h /= 3; var y, g = s.length,
w = h + h,
C = u.createTypedArray(m.length / 3, 2 * g + 3 * w);
C.set(s); var x = g; for (y = 0; g > y; y += 3) { var S = s[y],
E = s[y + 1],
b = s[y + 2];
C[x++] = b + h, C[x++] = E + h, C[x++] = S + h } a = P(a, t); var T, A, I, O; for (y = 0; w > y; y += 2) T = y + w, A = T + w, I = T + 1, O = A + 1, C[x++] = T, C[x++] = A, C[x++] = I, C[x++] = I, C[x++] = A, C[x++] = O; return { attributes: a, indices: C, boundingSphere: l } } var O = [new i, new i],
R = new i,
L = new i,
z = new i,
N = new i,
F = new i,
B = new i,
V = new i,
q = new i,
k = new i,
U = new i,
W = new i,
G = new i,
H = new i,
j = new i,
Y = new i,
X = new i,
Z = new i;
new i; var K = new p,
J = new h,
Q = function(r) { r = f(r, f.EMPTY_OBJECT); var i = r.positions; if (!e(i)) throw new t("options.positions is required."); var o = r.width; if (!e(o)) throw new t("options.width is required.");
this._positions = i, this._width = o, this._ellipsoid = f(r.ellipsoid, a.WGS84), this._height = f(r.height, 0), this._extrudedHeight = f(r.extrudedHeight, this._height), this._cornerType = f(r.cornerType, n.ROUNDED), this._vertexFormat = f(r.vertexFormat, _.DEFAULT), this._granularity = f(r.granularity, c.RADIANS_PER_DEGREE), this._workerName = "createCorridorGeometry" }; return Q.createGeometry = function(e) { var r = e._positions,
i = e._height,
n = e._extrudedHeight,
o = i !== n,
a = d.removeDuplicates(r); if (a.length < 2) throw new t("Count of unique positions must be greater than 1."); var s, u = e._ellipsoid,
c = e._vertexFormat,
h = { ellipsoid: u, vertexFormat: c, positions: a, width: e._width, cornerType: e._cornerType, granularity: e._granularity }; if (o) { var p = Math.max(i, n);
n = Math.min(i, n), i = p, h.height = i, h.extrudedHeight = n, s = I(h) } else s = M(h), s.attributes.position.values = c.position ? new Float64Array(d.scaleToGeodeticHeight(s.attributes.position.values, i, u, s.attributes.position.values)) : void 0; var f = s.attributes; return new l({ attributes: f, indices: s.indices, primitiveType: m.TRIANGLES, boundingSphere: s.boundingSphere }) }, Q }), r("Core/CylinderGeometryLibrary", ["./Math"], function(e) { "use strict"; var t = {}; return t.computePositions = function(t, r, i, n, o) { var a, s = .5 * t,
l = -s,
u = n + n,
c = o ? 2 * u : u,
h = new Float64Array(3 * c),
d = 0,
m = 0,
p = o ? 3 * u : 0,
f = o ? 3 * (u + n) : 3 * n; for (a = 0; n > a; a++) { var v = a / n * e.TWO_PI,
y = Math.cos(v),
g = Math.sin(v),
_ = y * i,
w = g * i,
C = y * r,
x = g * r;
h[m + p] = _, h[m + p + 1] = w, h[m + p + 2] = l, h[m + f] = C, h[m + f + 1] = x, h[m + f + 2] = s, m += 3, o && (h[d++] = _, h[d++] = w, h[d++] = l, h[d++] = C, h[d++] = x, h[d++] = s) } return h }, t }), r("Core/CylinderGeometry", ["./defaultValue", "./defined", "./DeveloperError", "./Cartesian2", "./Cartesian3", "./CylinderGeometryLibrary", "./Math", "./ComponentDatatype", "./IndexDatatype", "./PrimitiveType", "./BoundingSphere", "./Geometry", "./GeometryAttribute", "./GeometryAttributes", "./VertexFormat"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p) { "use strict"; var f = new i,
v = new n,
y = new n,
g = new n,
_ = new n,
w = function(i) { i = e(i, e.EMPTY_OBJECT); var n = i.length,
o = i.topRadius,
a = i.bottomRadius,
s = e(i.vertexFormat, p.DEFAULT),
l = e(i.slices, 128); if (!t(n) || 0 >= n) throw new r("options.length must be greater than 0."); if (!t(o) || 0 > o) throw new r("options.topRadius must be greater than 0."); if (!t(a) || 0 > a) throw new r("options.bottomRadius must be greater than 0."); if (0 === a && 0 === o) throw new r("bottomRadius and topRadius cannot both equal 0."); if (3 > l) throw new r("options.slices must be greater that 3.");
this._length = n, this._topRadius = o, this._bottomRadius = a, this._vertexFormat = s, this._slices = l, this._workerName = "createCylinderGeometry" }; return w.createGeometry = function(e) { var t, r = e._length,
i = e._topRadius,
p = e._bottomRadius,
w = e._vertexFormat,
C = e._slices,
x = C + C,
S = C + x,
E = x + x,
b = o.computePositions(r, i, p, C, !0),
T = w.st ? new Float32Array(2 * E) : void 0,
A = w.normal ? new Float32Array(3 * E) : void 0,
M = w.tangent ? new Float32Array(3 * E) : void 0,
P = w.binormal ? new Float32Array(3 * E) : void 0,
D = w.normal || w.tangent || w.binormal; if (D) { var I = w.tangent || w.binormal,
O = 0,
R = 0,
L = 0,
z = v;
z.z = 0; var N = g,
F = y; for (t = 0; C > t; t++) { var B = t / C * a.TWO_PI,
V = Math.cos(B),
q = Math.sin(B);
D && (z.x = V, z.y = q, I && (N = n.cross(n.UNIT_Z, z, N).normalize(N)), w.normal && (A[O++] = V, A[O++] = q, A[O++] = 0, A[O++] = V, A[O++] = q, A[O++] = 0), w.tangent && (M[R++] = N.x, M[R++] = N.y, M[R++] = N.z, M[R++] = N.x, M[R++] = N.y, M[R++] = N.z), w.binormal && (F = n.cross(z, N, F).normalize(F), P[L++] = F.x, P[L++] = F.y, P[L++] = F.z, P[L++] = F.x, P[L++] = F.y, P[L++] = F.z)) } for (t = 0; C > t; t++) w.normal && (A[O++] = 0, A[O++] = 0, A[O++] = -1), w.tangent && (M[R++] = 1, M[R++] = 0, M[R++] = 0), w.binormal && (P[L++] = 0, P[L++] = -1, P[L++] = 0); for (t = 0; C > t; t++) w.normal && (A[O++] = 0, A[O++] = 0, A[O++] = 1), w.tangent && (M[R++] = 1, M[R++] = 0, M[R++] = 0), w.binormal && (P[L++] = 0, P[L++] = 1, P[L++] = 0) } var k = 12 * C - 12,
U = l.createTypedArray(E, k),
W = 0,
G = 0; for (t = 0; C - 1 > t; t++) U[W++] = G, U[W++] = G + 2, U[W++] = G + 3, U[W++] = G, U[W++] = G + 3, U[W++] = G + 1, G += 2; for (U[W++] = x - 2, U[W++] = 0, U[W++] = 1, U[W++] = x - 2, U[W++] = 1, U[W++] = x - 1, t = 1; C - 1 > t; t++) U[W++] = x + t + 1, U[W++] = x + t, U[W++] = x; for (t = 1; C - 1 > t; t++) U[W++] = S, U[W++] = S + t, U[W++] = S + t + 1; var H = 0; if (w.st) { var j = Math.max(i, p); for (t = 0; E > t; t++) { var Y = n.fromArray(b, 3 * t, _);
T[H++] = (Y.x + j) / (2 * j), T[H++] = (Y.y + j) / (2 * j) } } var X = new m;
w.position && (X.position = new d({ componentDatatype: s.DOUBLE, componentsPerAttribute: 3, values: b })), w.normal && (X.normal = new d({ componentDatatype: s.FLOAT, componentsPerAttribute: 3, values: A })), w.tangent && (X.tangent = new d({ componentDatatype: s.FLOAT, componentsPerAttribute: 3, values: M })), w.binormal && (X.binormal = new d({ componentDatatype: s.FLOAT, componentsPerAttribute: 3, values: P })), w.st && (X.st = new d({ componentDatatype: s.FLOAT, componentsPerAttribute: 2, values: T })), f.x = .5 * r, f.y = Math.max(p, i); var Z = new c(n.ZERO, f.magnitude()); return new h({ attributes: X, indices: U, primitiveType: u.TRIANGLES, boundingSphere: Z }) }, w }), r("Core/CylinderOutlineGeometry", ["./defaultValue", "./defined", "./DeveloperError", "./Cartesian2", "./Cartesian3", "./CylinderGeometryLibrary", "./Math", "./ComponentDatatype", "./IndexDatatype", "./PrimitiveType", "./BoundingSphere", "./Geometry", "./GeometryAttribute", "./GeometryAttributes"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m) { "use strict"; var p = new i,
f = function(i) { i = e(i, e.EMPTY_OBJECT); var n = i.length,
o = i.topRadius,
a = i.bottomRadius,
s = e(i.slices, 128),
l = Math.max(e(i.numberOfVerticalLines, 16), 0); if (!t(n) || 0 >= n) throw new r("options.length must be greater than 0."); if (!t(o) || 0 > o) throw new r("options.topRadius must be greater than 0."); if (!t(a) || 0 > a) throw new r("options.bottomRadius must be greater than 0."); if (0 === a && 0 === o) throw new r("bottomRadius and topRadius cannot both equal 0."); if (3 > s) throw new r("options.slices must be greater that 3.");
this._length = n, this._topRadius = o, this._bottomRadius = a, this._slices = s, this._numberOfVerticalLines = l, this._workerName = "createCylinderOutlineGeometry" }; return f.createGeometry = function(e) { var t, r = e._length,
i = e._topRadius,
a = e._bottomRadius,
f = e._slices,
v = e._numberOfVerticalLines,
y = 2 * f,
g = o.computePositions(r, i, a, f, !1),
_ = 2 * f; if (v > 0) { var w = Math.min(v, f);
t = Math.round(f / w), _ += w } for (var C = l.createTypedArray(y, 2 * _), x = 0, S = 0; f - 1 > S; S++) C[x++] = S, C[x++] = S + 1, C[x++] = S + f, C[x++] = S + 1 + f; if (C[x++] = f - 1, C[x++] = 0, C[x++] = f + f - 1, C[x++] = f, v > 0)
for (S = 0; f > S; S += t) C[x++] = S, C[x++] = S + f; var E = new m;
E.position = new d({ componentDatatype: s.DOUBLE, componentsPerAttribute: 3, values: g }), p.x = .5 * r, p.y = Math.max(a, i); var b = new c(n.ZERO, p.magnitude()); return new h({ attributes: E, indices: C, primitiveType: u.LINES, boundingSphere: b }) }, f }), r("Core/DefaultProxy", [], function() { "use strict"; var e = function(e) { this.proxy = e }; return e.prototype.getURL = function(e) { return this.proxy + "?" + encodeURIComponent(e) }, e }), r("Core/EllipsoidGeometry", ["./defaultValue", "./DeveloperError", "./Cartesian3", "./Math", "./Ellipsoid", "./ComponentDatatype", "./IndexDatatype", "./PrimitiveType", "./BoundingSphere", "./Geometry", "./GeometryAttribute", "./GeometryAttributes", "./VertexFormat"], function(e, t, r, i, n, o, a, s, l, u, c, h, d) { "use strict"; var m = new r,
p = new r,
f = new r,
v = new r,
y = new r(1, 1, 1),
g = Math.cos,
_ = Math.sin,
w = function(i) { i = e(i, e.EMPTY_OBJECT); var n = e(i.radii, y),
o = e(i.stackPartitions, 64),
a = e(i.slicePartitions, 64),
s = e(i.vertexFormat, d.DEFAULT); if (3 > a) throw new t("options.slicePartitions cannot be less than three."); if (3 > o) throw new t("options.stackPartitions cannot be less than three.");
this._radii = r.clone(n), this._stackPartitions = o, this._slicePartitions = a, this._vertexFormat = s, this._workerName = "createEllipsoidGeometry" }; return w.createGeometry = function(e) { var t, d, y = e._radii,
w = n.fromCartesian3(y),
C = e._stackPartitions,
x = e._slicePartitions,
S = e._vertexFormat,
E = 2 + (C - 1) * x,
b = new Float64Array(3 * E),
T = 6 * x * (C - 1),
A = a.createTypedArray(E, T),
M = S.normal ? new Float32Array(3 * E) : void 0,
P = S.tangent ? new Float32Array(3 * E) : void 0,
D = S.binormal ? new Float32Array(3 * E) : void 0,
I = S.st ? new Float32Array(2 * E) : void 0,
O = new Array(x),
R = new Array(x); for (t = 0; x > t; t++) { var L = i.TWO_PI * t / x;
O[t] = g(L), R[t] = _(L) } var z = 0; for (b[z++] = 0, b[z++] = 0, b[z++] = y.z, t = 1; C > t; t++) { var N = Math.PI * t / C,
F = _(N),
B = y.x * F,
V = y.y * F,
q = y.z * g(N); for (d = 0; x > d; d++) b[z++] = O[d] * B, b[z++] = R[d] * V, b[z++] = q } b[z++] = 0, b[z++] = 0, b[z++] = -y.z; var k = new h;
S.position && (k.position = new c({ componentDatatype: o.DOUBLE, componentsPerAttribute: 3, values: b })); var U = 0,
W = 0,
G = 0,
H = 0; if (S.st || S.normal || S.tangent || S.binormal) { for (t = 0; E > t; t++) { var j = r.fromArray(b, 3 * t, m),
Y = w.geodeticSurfaceNormal(j, p); if (S.st && (I[U++] = Math.atan2(Y.y, Y.x) / i.TWO_PI + .5, I[U++] = Math.asin(Y.z) / Math.PI + .5), S.normal && (M[W++] = Y.x, M[W++] = Y.y, M[W++] = Y.z), S.tangent || S.binormal) { var X = f; if (0 === t || t === E - 1 ? (r.cross(r.UNIT_X, Y, X), r.normalize(X, X)) : (r.cross(r.UNIT_Z, Y, X), r.normalize(X, X)), S.tangent && (P[G++] = X.x, P[G++] = X.y, P[G++] = X.z), S.binormal) { var Z = r.cross(Y, X, v);
r.normalize(Z, Z), D[H++] = Z.x, D[H++] = Z.y, D[H++] = Z.z } } } S.st && (k.st = new c({ componentDatatype: o.FLOAT, componentsPerAttribute: 2, values: I })), S.normal && (k.normal = new c({ componentDatatype: o.FLOAT, componentsPerAttribute: 3, values: M })), S.tangent && (k.tangent = new c({ componentDatatype: o.FLOAT, componentsPerAttribute: 3, values: P })), S.binormal && (k.binormal = new c({ componentDatatype: o.FLOAT, componentsPerAttribute: 3, values: D })) } for (z = 0, t = 1; x > t; t++) A[z++] = 0, A[z++] = t, A[z++] = t + 1; for (A[z++] = 0, A[z++] = x, A[z++] = 1, t = 0; C - 2 > t; t++) { var K = t * x + 1,
J = (t + 1) * x + 1; for (d = 0; x - 1 > d; d++) A[z++] = J + d, A[z++] = J + d + 1, A[z++] = K + d + 1, A[z++] = J + d, A[z++] = K + d + 1, A[z++] = K + d;
A[z++] = J + x - 1, A[z++] = J, A[z++] = K, A[z++] = J + x - 1, A[z++] = K, A[z++] = K + x - 1 } var Q = E - 1; for (t = Q - 1; t > Q - x; t--) A[z++] = Q, A[z++] = t, A[z++] = t - 1; return A[z++] = Q, A[z++] = Q - x, A[z++] = Q - 1, new u({ attributes: k, indices: A, primitiveType: s.TRIANGLES, boundingSphere: l.fromEllipsoid(w) }) }, w }), r("Core/EllipsoidOutlineGeometry", ["./defaultValue", "./DeveloperError", "./Cartesian3", "./Math", "./Ellipsoid", "./ComponentDatatype", "./IndexDatatype", "./PrimitiveType", "./BoundingSphere", "./Geometry", "./GeometryAttribute", "./GeometryAttributes"], function(e, t, r, i, n, o, a, s, l, u, c, h) { "use strict"; var d = new r(1, 1, 1),
m = Math.cos,
p = Math.sin,
f = function(i) { i = e(i, e.EMPTY_OBJECT); var n = e(i.radii, d),
o = e(i.stackPartitions, 10),
a = e(i.slicePartitions, 8),
s = e(i.subdivisions, 128); if (1 > o) throw new t("options.stackPartitions cannot be less than 1"); if (0 > a) throw new t("options.slicePartitions cannot be less than 0"); if (0 > s) throw new t("options.subdivisions must be greater than or equal to zero.");
this._radii = r.clone(n), this._stackPartitions = o, this._slicePartitions = a, this._subdivisions = s, this._workerName = "createEllipsoidOutlineGeometry" }; return f.createGeometry = function(e) { var t, r, d, f, v, y, g = e._radii,
_ = n.fromCartesian3(g),
w = e._stackPartitions,
C = e._slicePartitions,
x = e._subdivisions,
S = x * (w + C - 1),
E = S - C + 2,
b = new Float64Array(3 * E),
T = a.createTypedArray(E, 2 * S),
A = 0,
M = new Array(x),
P = new Array(x); for (t = 0; x > t; t++) d = i.TWO_PI * t / x, M[t] = m(d), P[t] = p(d); for (t = 1; w > t; t++)
for (f = Math.PI * t / w, v = m(f), y = p(f), r = 0; x > r; r++) b[A++] = g.x * M[r] * y, b[A++] = g.y * P[r] * y, b[A++] = g.z * v; for (M.length = C, P.length = C, t = 0; C > t; t++) d = i.TWO_PI * t / C, M[t] = m(d), P[t] = p(d); for (b[A++] = 0, b[A++] = 0, b[A++] = g.z, t = 1; x > t; t++)
for (f = Math.PI * t / x, v = m(f), y = p(f), r = 0; C > r; r++) b[A++] = g.x * M[r] * y, b[A++] = g.y * P[r] * y, b[A++] = g.z * v; for (b[A++] = 0, b[A++] = 0, b[A++] = -g.z, A = 0, t = 0; w - 1 > t; ++t) { var D = t * x; for (r = 0; x - 1 > r; ++r) T[A++] = D + r, T[A++] = D + r + 1;
T[A++] = D + x - 1, T[A++] = D } var I = x * (w - 1); for (r = 1; C + 1 > r; ++r) T[A++] = I, T[A++] = I + r; for (t = 0; x - 2 > t; ++t) { var O = t * C + 1 + I,
R = (t + 1) * C + 1 + I; for (r = 0; C - 1 > r; ++r) T[A++] = R + r, T[A++] = O + r;
T[A++] = R + C - 1, T[A++] = O + C - 1 } var L = b.length / 3 - 1; for (r = L - 1; r > L - C - 1; --r) T[A++] = L, T[A++] = r; var z = new h({ position: new c({ componentDatatype: o.DOUBLE, componentsPerAttribute: 3, values: b }) }); return new u({ attributes: z, indices: T, primitiveType: s.LINES, boundingSphere: l.fromEllipsoid(_) }) }, f }), r("Core/EllipsoidalOccluder", ["./defaultValue", "./defined", "./DeveloperError", "./Cartesian3", "./BoundingSphere"], function(e, t, r, i, n) {
"use strict";
function o(e, t, r) { var i = e.transformPositionToScaledSpace(t, d),
n = i.magnitudeSquared(),
o = Math.sqrt(n),
a = i.divideByScalar(o, m);
n = Math.max(1, n), o = Math.max(1, o); var s = a.dot(r),
l = a.cross(r).magnitude(),
u = 1 / o,
c = Math.sqrt(n - 1) * u; return 1 / (s * u - l * c) }
function a(e, t, r) { return 0 >= t || t === 1 / 0 || t !== t ? void 0 : e.multiplyByScalar(t, r) }
function s(e, t) { return e.transformPositionToScaledSpace(t, p), p.normalize(p) }
var l = function(e, n) { if (!t(e)) throw new r("ellipsoid is required.");
this._ellipsoid = e, this._cameraPosition = new i, this._cameraPositionInScaledSpace = new i, this._distanceToLimbInScaledSpaceSquared = 0, t(n) && this.setCameraPosition(n) };
l.prototype.getEllipsoid = function() { return this._ellipsoid }, l.prototype.setCameraPosition = function(e) {
var t = this._ellipsoid,
r = t.transformPositionToScaledSpace(e, this._cameraPositionInScaledSpace),
n = i.magnitudeSquared(r) - 1;
i.clone(e, this._cameraPosition), this._cameraPositionInScaledSpace = r, this._distanceToLimbInScaledSpaceSquared = n
}, l.prototype.getCameraPosition = function() { return this._cameraPosition };
var u = new i;
l.prototype.isPointVisible = function(e) { var t = this._ellipsoid,
r = t.transformPositionToScaledSpace(e, u); return this.isScaledSpacePointVisible(r) }, l.prototype.isScaledSpacePointVisible = function(e) { var t = this._cameraPositionInScaledSpace,
r = this._distanceToLimbInScaledSpaceSquared,
n = i.subtract(e, t, u),
o = -n.dot(t),
a = o > r && o * o / n.magnitudeSquared() > r; return !a }, l.prototype.computeHorizonCullingPoint = function(e, i, n) { if (!t(e)) throw new r("directionToPoint is required"); if (!t(i)) throw new r("positions is required"); for (var l = this._ellipsoid, u = s(l, e), c = 0, h = 0, d = i.length; d > h; ++h) { var m = i[h],
p = o(l, m, u);
c = Math.max(c, p) } return a(u, c, n) };
var c = new i;
l.prototype.computeHorizonCullingPointFromVertices = function(n, l, u, h, d) { if (!t(n)) throw new r("directionToPoint is required"); if (!t(l)) throw new r("vertices is required"); if (!t(u)) throw new r("stride is required");
h = e(h, i.ZERO); for (var m = this._ellipsoid, p = s(m, n), f = 0, v = 0, y = l.length; y > v; v += u) { c.x = l[v] + h.x, c.y = l[v + 1] + h.y, c.z = l[v + 2] + h.z; var g = o(m, c, p);
f = Math.max(f, g) } return a(p, f, d) };
var h = [];
l.prototype.computeHorizonCullingPointFromExtent = function(e, i, o) { if (!t(e)) throw new r("extent is required."); var a = e.subsample(i, 0, h),
s = n.fromPoints(a); return s.center.magnitude() < .1 * i.getMinimumRadius() ? void 0 : this.computeHorizonCullingPoint(s.center, a, o) };
var d = new i,
m = new i,
p = new i;
return l
}), r("Core/EventHelper", ["./defined", "./DeveloperError"], function(e, t) { "use strict"; var r = function() { this._removalFunctions = [] }; return r.prototype.add = function(r, i, n) { if (!e(r)) throw new t("event is required");
this._removalFunctions.push(r.addEventListener(i, n)) }, r.prototype.removeAll = function() { for (var e = this._removalFunctions, t = 0, r = e.length; r > t; ++t) e[t]();
e.length = 0 }, r }), r("Core/Extent", ["./freezeObject", "./defaultValue", "./defined", "./Ellipsoid", "./Cartographic", "./DeveloperError", "./Math"], function(e, t, r, i, n, o, a) { "use strict"; var s = function(e, r, i, n) { this.west = t(e, 0), this.south = t(r, 0), this.east = t(i, 0), this.north = t(n, 0) };
s.fromDegrees = function(e, i, n, o, l) { return e = a.toRadians(t(e, 0)), i = a.toRadians(t(i, 0)), n = a.toRadians(t(n, 0)), o = a.toRadians(t(o, 0)), r(l) ? (l.west = e, l.south = i, l.east = n, l.north = o, l) : new s(e, i, n, o) }, s.fromCartographicArray = function(e, t) { if (!r(e)) throw new o("cartographics is required."); for (var i = Number.MAX_VALUE, n = -Number.MAX_VALUE, a = Number.MAX_VALUE, l = -Number.MAX_VALUE, u = 0, c = e.length; c > u; u++) { var h = e[u];
i = Math.min(i, h.longitude), n = Math.max(n, h.longitude), a = Math.min(a, h.latitude), l = Math.max(l, h.latitude) } return r(t) ? (t.west = i, t.south = a, t.east = n, t.north = l, t) : new s(i, a, n, l) }, 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, t) { if ("number" != typeof t) throw new o("epsilon is required and must be a number."); return r(e) && Math.abs(this.west - e.west) <= t && Math.abs(this.south - e.south) <= t && Math.abs(this.east - e.east) <= t && Math.abs(this.north - e.north) <= t }, s.prototype.validate = function() { var e = this.north; if ("number" != typeof e) throw new o("north is required to be a number."); if (e < -a.PI_OVER_TWO || e > a.PI_OVER_TWO) throw new o("north must be in the interval [-Pi/2, Pi/2]."); var t = this.south; if ("number" != typeof t) throw new o("south is required to be a number."); if (t < -a.PI_OVER_TWO || t > a.PI_OVER_TWO) throw new o("south must be in the interval [-Pi/2, Pi/2]."); var r = this.west; if ("number" != typeof r) throw new o("west is required to be a number."); if (r < -Math.PI || r > Math.PI) throw new o("west must be in the interval [-Pi, Pi]."); var i = this.east; if ("number" != typeof i) throw new o("east is required to be a number."); if (i < -Math.PI || i > Math.PI) throw new o("east must be in the interval [-Pi, Pi].") }, s.prototype.getSouthwest = function(e) { return r(e) ? (e.longitude = this.west, e.latitude = this.south, e.height = 0, e) : new n(this.west, this.south) }, s.prototype.getNorthwest = function(e) { return r(e) ? (e.longitude = this.west, e.latitude = this.north, e.height = 0, e) : new n(this.west, this.north) }, s.prototype.getNortheast = function(e) { return r(e) ? (e.longitude = this.east, e.latitude = this.north, e.height = 0, e) : new n(this.east, this.north) }, s.prototype.getSoutheast = function(e) { return r(e) ? (e.longitude = this.east, e.latitude = this.south, e.height = 0, e) : new n(this.east, this.south) }, s.prototype.getCenter = function(e) { return r(e) ? (e.longitude = .5 * (this.west + this.east), e.latitude = .5 * (this.south + this.north), e.height = 0, e) : new n(.5 * (this.west + this.east), .5 * (this.south + this.north)) }, s.prototype.intersectWith = function(e, t) { if (!r(e)) throw new o("otherExtent is required."); var i = Math.max(this.west, e.west),
n = Math.max(this.south, e.south),
a = Math.min(this.east, e.east),
l = Math.min(this.north, e.north); return r(t) ? (t.west = i, t.south = n, t.east = a, t.north = l, t) : new s(i, n, a, l) }, s.prototype.contains = function(e) { if (!r(e)) throw new o("cartographic is required."); return e.longitude >= this.west && e.longitude <= this.east && e.latitude >= this.south && e.latitude <= this.north }, s.prototype.isEmpty = function() { return this.west >= this.east || this.south >= this.north }; var l = new n; return s.prototype.subsample = function(e, n, o) { e = t(e, i.WGS84), n = t(n, 0), r(o) || (o = []); var s = 0,
u = this.north,
c = this.south,
h = this.east,
d = this.west,
m = l;
m.height = n, m.longitude = d, m.latitude = u, o[s] = e.cartographicToCartesian(m, o[s]), s++, m.longitude = h, o[s] = e.cartographicToCartesian(m, o[s]), s++, m.latitude = c, o[s] = e.cartographicToCartesian(m, o[s]), s++, m.longitude = d, o[s] = e.cartographicToCartesian(m, o[s]), s++, m.latitude = 0 > u ? u : c > 0 ? c : 0; for (var p = 1; 8 > p; ++p) { var f = -Math.PI + p * a.PI_OVER_TWO;
f > d && h > f && (m.longitude = f, o[s] = e.cartographicToCartesian(m, o[s]), s++) } return 0 === m.latitude && (m.longitude = d, o[s] = e.cartographicToCartesian(m, o[s]), s++, m.longitude = h, o[s] = e.cartographicToCartesian(m, o[s]), s++), o.length = s, o }, s.MAX_VALUE = e(new s(-Math.PI, -a.PI_OVER_TWO, Math.PI, a.PI_OVER_TWO)), s }), r("Core/Matrix2", ["./Cartesian2", "./defaultValue", "./defined", "./DeveloperError", "./freezeObject"], function(e, t, r, i, n) { "use strict"; var o = function(e, r, i, n) { this[0] = t(e, 0), this[1] = t(i, 0), this[2] = t(r, 0), this[3] = t(n, 0) }; return o.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) : new o(e[0], e[2], e[1], e[3]) : void 0 }, o.fromColumnMajorArray = function(e, t) { if (!r(e)) throw new i("values parameter is required"); return o.clone(e, t) }, o.fromRowMajorArray = function(e, t) { if (!r(e)) throw new i("values is required."); return r(t) ? (t[0] = e[0], t[1] = e[2], t[2] = e[1], t[3] = e[3], t) : new o(e[0], e[1], e[2], e[3]) }, o.fromScale = function(e, t) { if (!r(e)) throw new i("scale is required."); return r(t) ? (t[0] = e.x, t[1] = 0, t[2] = 0, t[3] = e.y, t) : new o(e.x, 0, 0, e.y) }, o.fromUniformScale = function(e, t) { if ("number" != typeof e) throw new i("scale is required."); return r(t) ? (t[0] = e, t[1] = 0, t[2] = 0, t[3] = e, t) : new o(e, 0, 0, e) }, o.fromRotation = function(e, t) { if (!r(e)) throw new i("angle is required."); var n = Math.cos(e),
a = Math.sin(e); return r(t) ? (t[0] = n, t[1] = a, t[2] = -a, t[3] = n, t) : new o(n, -a, a, n) }, o.toArray = function(e, t) { if (!r(e)) throw new i("matrix is required"); return r(t) ? (t[0] = e[0], t[1] = e[1], t[2] = e[2], t[3] = e[3], t) : [e[0], e[1], e[2], e[3]] }, o.getElementIndex = function(e, t) { if ("number" != typeof t || 0 > t || t > 1) throw new i("row is required and must be 0 or 1."); if ("number" != typeof e || 0 > e || e > 1) throw new i("column is required and must be 0 or 1."); return 2 * e + t }, o.getColumn = function(t, n, o) { if (!r(t)) throw new i("matrix is required."); if ("number" != typeof n || 0 > n || n > 1) throw new i("index is required and must be 0 or 1."); var a = 2 * n,
s = t[a],
l = t[a + 1]; return r(o) ? (o.x = s, o.y = l, o) : new e(s, l) }, o.setColumn = function(e, t, n, a) { if (!r(e)) throw new i("matrix is required"); if (!r(n)) throw new i("cartesian is required"); if ("number" != typeof t || 0 > t || t > 1) throw new i("index is required and must be 0 or 1.");
a = o.clone(e, a); var s = 2 * t; return a[s] = n.x, a[s + 1] = n.y, a }, o.getRow = function(t, n, o) { if (!r(t)) throw new i("matrix is required."); if ("number" != typeof n || 0 > n || n > 1) throw new i("index is required and must be 0 or 1."); var a = t[n],
s = t[n + 2]; return r(o) ? (o.x = a, o.y = s, o) : new e(a, s) }, o.setRow = function(e, t, n, a) { if (!r(e)) throw new i("matrix is required"); if (!r(n)) throw new i("cartesian is required"); if ("number" != typeof t || 0 > t || t > 1) throw new i("index is required and must be 0 or 1."); return a = o.clone(e, a), a[t] = n.x, a[t + 2] = n.y, a }, o.multiply = function(e, t, n) { if (!r(e)) throw new i("left is required"); if (!r(t)) throw new i("right is required"); var a = e[0] * t[0] + e[2] * t[1],
s = e[0] * t[2] + e[2] * t[3],
l = e[1] * t[0] + e[3] * t[1],
u = e[1] * t[2] + e[3] * t[3]; return r(n) ? (n[0] = a, n[1] = l, n[2] = s, n[3] = u, n) : new o(a, s, l, u) }, o.multiplyByVector = function(t, n, o) { if (!r(t)) throw new i("matrix is required"); if (!r(n)) throw new i("cartesian is required"); var a = t[0] * n.x + t[2] * n.y,
s = t[1] * n.x + t[3] * n.y; return r(o) ? (o.x = a, o.y = s, o) : new e(a, s) }, o.multiplyByScalar = function(e, t, n) { if (!r(e)) throw new i("matrix is required"); if ("number" != typeof t) throw new i("scalar is required and must be a number"); return r(n) ? (n[0] = e[0] * t, n[1] = e[1] * t, n[2] = e[2] * t, n[3] = e[3] * t, n) : new o(e[0] * t, e[2] * t, e[1] * t, e[3] * t) }, o.negate = function(e, t) { if (!r(e)) throw new i("matrix is required"); return r(t) ? (t[0] = -e[0], t[1] = -e[1], t[2] = -e[2], t[3] = -e[3], t) : new o(-e[0], -e[2], -e[1], -e[3]) }, o.transpose = function(e, t) { if (!r(e)) throw new i("matrix is required"); var n = e[0],
a = e[2],
s = e[1],
l = e[3]; return r(t) ? (t[0] = n, t[1] = a, t[2] = s, t[3] = l, t) : new o(n, s, a, l) }, o.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] }, o.equalsEpsilon = function(e, t, n) { if ("number" != typeof n) throw new i("epsilon is required and must be a number"); return e === t || r(e) && r(t) && Math.abs(e[0] - t[0]) <= n && Math.abs(e[1] - t[1]) <= n && Math.abs(e[2] - t[2]) <= n && Math.abs(e[3] - t[3]) <= n }, o.IDENTITY = n(new o(1, 0, 0, 1)), o.COLUMN0ROW0 = 0, o.COLUMN0ROW1 = 1, o.COLUMN1ROW0 = 2, o.COLUMN1ROW1 = 3, o.prototype.clone = function(e) { return o.clone(this, e) }, o.prototype.toArray = function(e) { return o.toArray(this, e) }, o.prototype.getColumn = function(e, t) { return o.getColumn(this, e, t) }, o.prototype.setColumn = function(e, t, r) { return o.setColumn(this, e, t, r) }, o.prototype.getRow = function(e, t) { return o.getRow(this, e, t) }, o.prototype.setRow = function(e, t, r) { return o.setRow(this, e, t, r) }, o.prototype.multiply = function(e, t) { return o.multiply(this, e, t) }, o.prototype.multiplyByVector = function(e, t) { return o.multiplyByVector(this, e, t) }, o.prototype.multiplyByScalar = function(e, t) { return o.multiplyByScalar(this, e, t) }, o.prototype.negate = function(e) { return o.negate(this, e) }, o.prototype.transpose = function(e) { return o.transpose(this, e) }, o.prototype.equals = function(e) { return o.equals(this, e) }, o.prototype.equalsEpsilon = function(e, t) { return o.equalsEpsilon(this, e, t) }, o.prototype.toString = function() { return "(" + this[0] + ", " + this[2] + ")\n" + "(" + this[1] + ", " + this[3] + ")" }, o }), r("Core/ExtentGeometry", ["./defaultValue", "./defined", "./BoundingSphere", "./Cartesian2", "./Cartesian3", "./Cartographic", "./ComponentDatatype", "./IndexDatatype", "./DeveloperError", "./Ellipsoid", "./Extent", "./Geometry", "./GeometryInstance", "./GeometryPipeline", "./GeographicProjection", "./GeometryAttribute", "./GeometryAttributes", "./Math", "./Matrix2", "./Matrix3", "./PrimitiveType", "./Quaternion", "./VertexFormat"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C, x) { "use strict";
function S(e, t) { return e < -y.PI_OVER_TWO || e > y.PI_OVER_TWO ? !1 : t > y.PI || t < -y.PI ? !1 : !0 }
function E(e, r, i, n, o) { var a = e.radiiSquared;
O = z.latitude - e.granYCos * r + i * e.granXSin; var s = et(O),
l = tt(O),
u = a.z * l;
R = z.longitude + r * e.granYSin + i * e.granXCos; var c = s * et(R),
h = s * tt(R),
d = a.x * c,
m = a.y * h,
p = rt(d * c + m * h + u * l),
f = d / p,
v = m / p,
y = u / p;
t(n) && (W.x = f + c * n, W.y = v + h * n, W.z = y + l * n), t(o) && (Y.x = f + c * o, Y.y = v + h * o, Y.z = y + l * o) }
function b(e, t) { var r = new h({ attributes: new v, primitiveType: w.TRIANGLES }); return e.position && (r.attributes.position = new f({ componentDatatype: a.DOUBLE, componentsPerAttribute: 3, values: t.positions })), e.normal && (r.attributes.normal = new f({ componentDatatype: a.FLOAT, componentsPerAttribute: 3, values: t.normals })), e.tangent && (r.attributes.tangent = new f({ componentDatatype: a.FLOAT, componentsPerAttribute: 3, values: t.tangents })), e.binormal && (r.attributes.binormal = new f({ componentDatatype: a.FLOAT, componentsPerAttribute: 3, values: t.binormals })), r }
function T(e, t, r, i, o) { var a = e.length,
s = t.normal ? new Float32Array(a) : void 0,
l = t.tangent ? new Float32Array(a) : void 0,
u = t.binormal ? new Float32Array(a) : void 0,
c = 0,
h = i ? a / 2 : 0;
a = i && o ? a / 2 : a; for (var d = 0; a > d; d += 3) { var m = n.fromArray(e, d, W),
p = c + 1,
f = c + 2;
(t.normal || t.tangent || t.binormal) && (G = r.geodeticSurfaceNormal(m, G), (t.tangent || t.binormal) && (n.cross(n.UNIT_Z, G, H), _.multiplyByVector(k, H, H), n.normalize(H, H), t.binormal && n.cross(G, H, j).normalize(j)), i && (t.normal && (s[c] = G.x, s[p] = G.y, s[f] = G.z), t.tangent && (l[c] = H.x, l[p] = H.y, l[f] = H.z), t.binormal && (u[c] = j.x, u[p] = j.y, u[f] = j.z)), o && (t.normal && (s[c + h] = -G.x, s[p + h] = -G.y, s[f + h] = -G.z), t.tangent && (l[c + h] = -H.x, l[p + h] = -H.y, l[f + h] = -H.z), t.binormal && (u[c + h] = j.x, u[p + h] = j.y, u[f + h] = j.z))), c += 3 } return b(t, { positions: e, normals: s, tangents: l, binormals: u }) }
function A(e, t, r) { for (var i = e.length, o = t.normal ? new Float32Array(i) : void 0, a = t.tangent ? new Float32Array(i) : void 0, s = t.binormal ? new Float32Array(i) : void 0, l = 0, u = !0, c = i / 2, h = 0; c > h; h += 3) { var d = n.fromArray(e, h, W),
m = l + 1,
p = l + 2; if (t.normal || t.tangent || t.binormal) { var f = n.fromArray(e, h + 3, K); if (u) { var v = n.fromArray(e, h + c, J);
f = f.subtract(d, f), v = v.subtract(d, v), G = v.cross(f, G).normalize(G), u = !1 } f.equalsEpsilon(d, y.EPSILON10) && (u = !0), (t.tangent || t.binormal) && (j = r.geodeticSurfaceNormal(d, j), t.tangent && (H = n.cross(j, G, H).normalize(H))), t.normal && (o[l] = G.x, o[m] = G.y, o[p] = G.z, o[l + c] = G.x, o[m + c] = G.y, o[p + c] = G.z), t.tangent && (a[l] = H.x, a[m] = H.y, a[p] = H.z, a[l + c] = H.x, a[m + c] = H.y, a[p + c] = H.z), t.binormal && (s[l] = j.x, s[m] = j.y, s[p] = j.z, s[l + c] = j.x, s[m + c] = j.y, s[p + c] = j.z) } l += 3 } return b(t, { positions: e, normals: o, tangents: a, binormals: s }) }
function M(e, r, i, n, o) { return Q.x = (R - B.west) * n.lonScalar - .5, Q.y = (O - B.south) * n.latScalar - .5, g.multiplyByVector(V, Q, Q), Q.x += .5, Q.y += .5, t(o) && (i[r + o] = Q.x, i[r + 1 + o] = Q.y), i[r++] = Q.x, i[r++] = Q.y, r }
function P(e, t, r) { return e[t + r] = Y.x, e[t++] = W.x, e[t + r] = Y.y, e[t++] = W.y, e[t + r] = Y.z, e[t++] = W.z, e }
function D(e, t) { for (var i = t.ellipsoid, n = t.size, o = t.height, l = t.width, u = t.surfaceHeight, c = 0, h = e.position ? new Float64Array(3 * n) : void 0, d = e.st ? new Float32Array(2 * n) : void 0, m = 0, p = 0; o > p; ++p)
for (var v = 0; l > v; ++v) E(t, p, v, u), h[m++] = W.x, h[m++] = W.y, h[m++] = W.z, e.st && (Q.x = (R - B.west) * t.lonScalar - .5, Q.y = (O - B.south) * t.latScalar - .5, g.multiplyByVector(V, Q, Q), Q.x += .5, Q.y += .5, d[c++] = Q.x, d[c++] = Q.y); for (var y = T(h, e, i, !0, !1), _ = 6 * (l - 1) * (o - 1), w = s.createTypedArray(n, _), C = 0, x = 0, S = 0; o - 1 > S; ++S) { for (var b = 0; l - 1 > b; ++b) { var A = C,
M = A + l,
P = M + 1,
D = A + 1;
w[x++] = A, w[x++] = M, w[x++] = D, w[x++] = D, w[x++] = M, w[x++] = P, ++C }++C } return y.indices = w, e.st && (y.attributes.st = new f({ componentDatatype: a.FLOAT, componentsPerAttribute: 2, values: d })), { boundingSphere: r.fromExtent3D(t.extent, i, u), geometry: y } }
function I(t, i) { var o = i.surfaceHeight,
l = i.extrudedHeight,
u = Math.min(l, o),
c = Math.max(l, o); if (y.equalsEpsilon(u, c, .1)) return D(t, i); var h, p = i.height,
v = i.width,
g = i.size,
_ = i.ellipsoid,
w = e(i.closeTop, !0),
C = e(i.closeBottom, !0),
x = 2 * v + 2 * p - 4,
S = 2 * (x + 4),
b = new Float64Array(3 * S),
I = t.st ? new Float32Array(2 * S) : void 0,
O = 0,
R = 0,
L = 0,
z = 3 * (S / 2); for (h = 0; p > h; h++) E(i, h, O, c, u), b = P(b, R, z), R += 3, t.st && (L = M(t, L, I, i, S)); for (h = p - 1, O = 0; v > O; O++) E(i, h, O, c, u), b = P(b, R, z), R += 3, t.st && (L = M(t, L, I, i, S)); for (O = v - 1, h = p - 1; h >= 0; h--) E(i, h, O, c, u), b = P(b, R, z), R += 3, t.st && (L = M(t, L, I, i, S)); for (h = 0, O = v - 1; O >= 0; O--) E(i, h, O, c, u), b = P(b, R, z), R += 3, t.st && (L = M(t, L, I, i, S)); var N = A(b, t, _);
t.st && (N.attributes.st = new f({ componentDatatype: a.FLOAT, componentsPerAttribute: 2, values: I })); var F, B, V, q, k, U = s.createTypedArray(S, 6 * x),
G = b.length / 6,
H = 0; for (k = 0; G - 1 > k; k++) { F = k, q = F + 1; var j = n.fromArray(b, 3 * F, K),
Q = n.fromArray(b, 3 * q, J);
j.equalsEpsilon(Q, y.EPSILON10) || (B = F + G, V = B + 1, U[H++] = F, U[H++] = B, U[H++] = q, U[H++] = q, U[H++] = B, U[H++] = V) } if (N.indices = U, C || w) { var $, et, tt = 0,
rt = 0;
w && (tt += g, rt += 6 * (v - 1) * (p - 1), $ = c), C && (tt += g, rt += 6 * (v - 1) * (p - 1), et = u); var it = new Float64Array(3 * tt),
nt = t.st ? new Float32Array(2 * tt) : void 0,
ot = s.createTypedArray(tt, rt); for (R = 0, L = 0, z = C && w ? 3 * g : 0, h = 0; p > h; ++h)
for (O = 0; v > O; ++O) E(i, h, O, $, et), C && (it[R + z] = Y.x, it[R + 1 + z] = Y.y, it[R + 2 + z] = Y.z), w && (it[R] = W.x, it[R + 1] = W.y, it[R + 2] = W.z), t.st && (L = M(t, L, nt, i, 2 * g)), R += 3; var at = T(it, t, _, w, C);
t.st && (at.attributes.st = new f({ componentDatatype: a.FLOAT, componentsPerAttribute: 2, values: nt })); var st = 0; for (H = 0, z /= 3, k = 0; p - 1 > k; ++k) { for (var lt = 0; v - 1 > lt; ++lt) F = H, B = F + v, V = B + 1, q = F + 1, C && (ot[st++] = q + z, ot[st++] = B + z, ot[st++] = F + z, ot[st++] = V + z, ot[st++] = B + z, ot[st++] = q + z), w && (ot[st++] = F, ot[st++] = B, ot[st++] = q, ot[st++] = q, ot[st++] = B, ot[st++] = V), ++H;++H } at.indices = ot, N = m.combine([new d({ geometry: at }), new d({ geometry: N })]) } var ut = r.fromExtent3D(i.extent, _, c, Z),
ct = r.fromExtent3D(i.extent, _, u, X),
ht = r.union(ut, ct); return { boundingSphere: ht, geometry: N } } var O, R, L = new n,
z = new o,
N = new o,
F = new n,
B = new c,
V = new g,
q = new g,
k = new _,
U = new p,
W = new n,
G = new n,
H = new n,
j = new n,
Y = new n,
X = new r,
Z = new r,
K = new n,
J = new n,
Q = new i,
$ = new C,
et = Math.cos,
tt = Math.sin,
rt = Math.sqrt,
it = function(r) { r = e(r, e.EMPTY_OBJECT); var i = r.extent,
n = e(r.granularity, y.RADIANS_PER_DEGREE),
o = e(r.ellipsoid, u.WGS84),
a = e(r.height, 0),
s = r.rotation,
c = r.stRotation,
h = e(r.vertexFormat, x.DEFAULT); if (!t(i)) throw new l("extent is required.");
i.validate(), this._extent = i, this._granularity = n, this._ellipsoid = o, this._surfaceHeight = a, this._rotation = s, this._stRotation = c, this._vertexFormat = h, this._extrudedHeight = r.extrudedHeight, this._closeTop = r.closeTop, this._closeBottom = r.closeBottom, this._workerName = "createExtentGeometry" }; return it.createGeometry = function(e) { var r = e._extent,
i = e._granularity,
o = e._ellipsoid,
a = e._surfaceHeight,
s = e._rotation,
u = e._stRotation,
d = e._vertexFormat,
m = e._extrudedHeight,
p = e._closeTop,
f = e._closeBottom,
y = Math.ceil((r.east - r.west) / i) + 1,
w = Math.ceil((r.north - r.south) / i) + 1,
x = (r.east - r.west) / (y - 1),
E = (r.north - r.south) / (w - 1),
b = o.getRadiiSquared();
c.clone(r, B), r.getNorthwest(z), r.getCenter(N); var T = E,
A = x,
M = 0,
P = 0; if (t(s)) { var O = et(s);
T *= O, A *= O; var R = tt(s);
M = E * R, P = x * R, U.project(z, L), U.project(N, F), L.subtract(F, L), g.fromRotation(s, q), q.multiplyByVector(L, L), L.add(F, L), U.unproject(L, z); var W = z.latitude,
G = W + (y - 1) * P,
H = W - T * (w - 1),
j = W - T * (w - 1) + (y - 1) * P,
Y = Math.max(W, G, H, j),
X = Math.min(W, G, H, j),
Z = z.longitude,
J = Z + (y - 1) * A,
Q = Z + (w - 1) * M,
rt = Z + (w - 1) * M + (y - 1) * A,
it = Math.max(Z, J, Q, rt),
nt = Math.min(Z, J, Q, rt); if (!(S(Y, nt) && S(Y, it) && S(X, nt) && S(X, it))) throw new l("Rotated extent is invalid.");
B.north = Y, B.south = X, B.east = it, B.west = nt } var ot = 1 / (B.east - B.west),
at = 1 / (B.north - B.south),
st = y * w; if (t(u)) { g.fromRotation(-u, V); var lt = o.cartographicToCartesian(N, K);
n.normalize(lt, lt), C.fromAxisAngle(lt, -u, $), _.fromQuaternion($, k) } else g.clone(g.IDENTITY, V), _.clone(_.IDENTITY, k); var ut, ct = { granYCos: T, granYSin: M, granXCos: A, granXSin: P, radiiSquared: b, ellipsoid: o, lonScalar: ot, latScalar: at, extent: r, width: y, height: w, surfaceHeight: a, size: st, extrudedHeight: m, closeTop: p, closeBottom: f };
ut = t(m) ? I(d, ct) : D(d, ct); var ht = ut.boundingSphere; return ut = ut.geometry, new h({ attributes: new v(ut.attributes), indices: ut.indices, primitiveType: ut.primitiveType, boundingSphere: ht }) }, it }), r("Core/ExtentOutlineGeometry", ["./defaultValue", "./defined", "./BoundingSphere", "./Cartesian3", "./Cartographic", "./ComponentDatatype", "./IndexDatatype", "./DeveloperError", "./Ellipsoid", "./GeographicProjection", "./Geometry", "./GeometryAttribute", "./GeometryAttributes", "./Math", "./Matrix2", "./PrimitiveType"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f) { "use strict";
function v(e, t) { return e < -m.PI_OVER_TWO || e > m.PI_OVER_TWO ? !1 : t > m.PI || t < -m.PI ? !1 : !0 }
function y(e, r, i, n, o) { var a = e.radiiSquared;
w = S.latitude - e.granYCos * r + i * e.granXSin; var s = O(w),
l = R(w),
u = a.z * l;
C = S.longitude + r * e.granYSin + i * e.granXCos; var c = s * O(C),
h = s * R(C),
d = a.x * c,
m = a.y * h,
p = L(d * c + m * h + u * l),
f = d / p,
v = m / p,
y = u / p;
t(n) && (M.x = f + c * n, M.y = v + h * n, M.z = y + l * n), t(o) && (P.x = f + c * o, P.y = v + h * o, P.z = y + l * o) }
function g(e) { var t, i = e.extent,
n = e.ellipsoid,
o = e.size,
s = e.height,
l = e.width,
u = e.surfaceHeight,
c = new Float64Array(3 * o),
h = 0,
d = 0; for (t = 0; l > t; t++) y(e, d, t, u), c[h++] = M.x, c[h++] = M.y, c[h++] = M.z; for (t = l - 1, d = 1; s > d; d++) y(e, d, t, u), c[h++] = M.x, c[h++] = M.y, c[h++] = M.z; for (d = s - 1, t = l - 2; t >= 0; t--) y(e, d, t, u), c[h++] = M.x, c[h++] = M.y, c[h++] = M.z; for (t = 0, d = s - 2; d > 0; d--) y(e, d, t, u), c[h++] = M.x, c[h++] = M.y, c[h++] = M.z; for (var m = 2 * (c.length / 3), p = a.createTypedArray(c.length / 3, m), f = 0, v = 0; v < c.length / 3 - 1; v++) p[f++] = v, p[f++] = v + 1; return p[f++] = c.length / 3 - 1, p[f++] = 0, { boundingSphere: r.fromExtent3D(i, n, u), positions: c, indices: p } }
function _(e, t) { var i = e.surfaceHeight,
n = Math.min(t, i),
o = Math.max(t, i); if (m.equalsEpsilon(n, o, .1)) return g(e); var s, l = e.extent,
u = e.height,
c = e.width,
h = 3 * e.size,
d = e.ellipsoid,
p = 0,
f = 0,
v = new Float64Array(2 * h); for (s = 0; c > s; s++) y(e, f, s, o, n), v[p + h] = P.x, v[p + h + 1] = P.y, v[p + h + 2] = P.z, v[p++] = M.x, v[p++] = M.y, v[p++] = M.z; for (s = c - 1, f = 1; u > f; f++) y(e, f, s, o, n), v[p + h] = P.x, v[p + h + 1] = P.y, v[p + h + 2] = P.z, v[p++] = M.x, v[p++] = M.y, v[p++] = M.z; for (f = u - 1, s = c - 2; s >= 0; s--) y(e, f, s, o, n), v[p + h] = P.x, v[p + h + 1] = P.y, v[p + h + 2] = P.z, v[p++] = M.x, v[p++] = M.y, v[p++] = M.z; for (s = 0, f = u - 2; f > 0; f--) y(e, f, s, o, n), v[p + h] = P.x, v[p + h + 1] = P.y, v[p + h + 2] = P.z, v[p++] = M.x, v[p++] = M.y, v[p++] = M.z; for (var _ = 2 * (v.length / 3) + 8, w = a.createTypedArray(v.length / 3, _), C = v.length / 6, x = 0, S = 0; C - 1 > S; S++) w[x++] = S, w[x++] = S + 1, w[x++] = S + C, w[x++] = S + C + 1;
w[x++] = C - 1, w[x++] = 0, w[x++] = C + C - 1, w[x++] = C, w[x++] = 0, w[x++] = C, w[x++] = c - 1, w[x++] = C + c - 1, w[x++] = c + u - 2, w[x++] = c + u - 2 + C, w[x++] = 2 * c + u - 3, w[x++] = 2 * c + u - 3 + C; var E = r.fromExtent3D(l, d, o, I),
b = r.fromExtent3D(l, d, n, D),
T = r.union(E, b); return { boundingSphere: T, positions: v, indices: w } } var w, C, x = new i,
S = new n,
E = new n,
b = new i,
T = new p,
A = new u,
M = new i,
P = new i,
D = new r,
I = new r,
O = Math.cos,
R = Math.sin,
L = Math.sqrt,
z = function(r) { r = e(r, e.EMPTY_OBJECT); var i = r.extent,
n = e(r.granularity, m.RADIANS_PER_DEGREE),
o = e(r.ellipsoid, l.WGS84),
a = e(r.height, 0),
u = r.rotation; if (!t(i)) throw new s("extent is required.");
i.validate(), this._extent = i, this._granularity = n, this._ellipsoid = o, this._surfaceHeight = a, this._rotation = u, this._extrudedHeight = r.extrudedHeight, this._workerName = "createExtentOutlineGeometry" }; return z.createGeometry = function(e) { var r = e._extent,
i = e._granularity,
n = e._ellipsoid,
a = e._surfaceHeight,
l = e._rotation,
u = e._extrudedHeight,
m = Math.ceil((r.east - r.west) / i) + 1,
y = Math.ceil((r.north - r.south) / i) + 1,
w = (r.east - r.west) / (m - 1),
C = (r.north - r.south) / (y - 1),
M = n.getRadiiSquared();
r.getNorthwest(S), r.getCenter(E); var P = C,
D = w,
I = 0,
L = 0; if (t(l)) { var z = O(l);
P *= z, D *= z; var N = R(l);
I = C * N, L = w * N, A.project(S, x), A.project(E, b), x.subtract(b, x), p.fromRotation(l, T), T.multiplyByVector(x, x), x.add(b, x), A.unproject(x, S); var F = S.latitude,
B = F + (m - 1) * L,
V = F - P * (y - 1),
q = F - P * (y - 1) + (m - 1) * L,
k = Math.max(F, B, V, q),
U = Math.min(F, B, V, q),
W = S.longitude,
G = W + (m - 1) * D,
H = W + (y - 1) * I,
j = W + (y - 1) * I + (m - 1) * D,
Y = Math.max(W, G, H, j),
X = Math.min(W, G, H, j); if (!(v(k, X) && v(k, Y) && v(U, X) && v(U, Y))) throw new s("Rotated extent is invalid.") } var Z, K = 2 * m + 2 * y - 4,
J = { granYCos: P, granYSin: I, granXCos: D, granXSin: L, radiiSquared: M, ellipsoid: n, extent: r, width: m, height: y, surfaceHeight: a, size: K };
Z = t(u) ? _(J, u) : g(J); var Q = new d({ position: new h({ componentDatatype: o.DOUBLE, componentsPerAttribute: 3, values: Z.positions }) }); return new c({ attributes: Q, indices: Z.indices, primitiveType: f.LINES, boundingSphere: Z.boundingSphere }) }, z }), r("Core/FAR", [], function() { "use strict"; var e = 5906376272e3; return e }), r("Core/HeightmapTessellator", ["./defaultValue", "./defined", "./freezeObject", "./DeveloperError", "./Cartesian3", "./Ellipsoid", "./Math"], function(e, t, r, i, n, o, a) { "use strict"; var s = {}; return s.DEFAULT_STRUCTURE = r({ heightScale: 1, heightOffset: 0, elementsPerHeight: 1, stride: 1, elementMultiplier: 256, isBigEndian: !1 }), s.computeVertices = function(r) { if (!t(r) || !t(r.heightmap)) throw new i("description.heightmap is required."); if (!t(r.width) || !t(r.height)) throw new i("description.width and description.height are required."); if (!t(r.vertices)) throw new i("description.vertices is required."); if (!t(r.nativeExtent)) throw new i("description.nativeExtent is required."); if (!t(r.skirtHeight)) throw new i("description.skirtHeight is required."); var l, u, c, h, d = Math.cos,
m = Math.sin,
p = Math.sqrt,
f = Math.atan,
v = Math.exp,
y = a.PI_OVER_TWO,
g = a.toRadians,
_ = r.vertices,
w = r.heightmap,
C = r.width,
x = r.height,
S = r.skirtHeight,
E = e(r.isGeographic, !0),
b = e(r.ellipsoid, o.WGS84),
T = 1 / b.getMaximumRadius(),
A = r.nativeExtent,
M = r.extent;
t(M) ? (l = M.west, u = M.south, c = M.east, h = M.north) : E ? (l = g(A.west), u = g(A.south), c = g(A.east), h = g(A.north)) : (l = A.west * T, u = y - 2 * f(v(-A.south * T)), c = A.east * T, h = y - 2 * f(v(-A.north * T))); var P = e(r.relativeToCenter, n.ZERO),
D = e(r.structure, s.DEFAULT_STRUCTURE),
I = e(D.heightScale, s.DEFAULT_STRUCTURE.heightScale),
O = e(D.heightOffset, s.DEFAULT_STRUCTURE.heightOffset),
R = e(D.elementsPerHeight, s.DEFAULT_STRUCTURE.elementsPerHeight),
L = e(D.stride, s.DEFAULT_STRUCTURE.stride),
z = e(D.elementMultiplier, s.DEFAULT_STRUCTURE.elementMultiplier),
N = e(D.isBigEndian, s.DEFAULT_STRUCTURE.isBigEndian),
F = (A.east - A.west) / (C - 1),
B = (A.north - A.south) / (x - 1),
V = b.getRadiiSquared(),
q = V.x,
k = V.y,
U = V.z,
W = 0,
G = 65536,
H = -65536,
j = 0,
Y = x,
X = 0,
Z = C;
S > 0 && (--j, ++Y, --X, ++Z); for (var K = j; Y > K; ++K) { var J = K;
0 > J && (J = 0), J >= x && (J = x - 1); var Q = A.north - B * J;
Q = E ? g(Q) : y - 2 * f(v(-Q * T)); for (var $ = d(Q), et = m(Q), tt = U * et, rt = (Q - u) / (h - u), it = X; Z > it; ++it) { var nt = it;
0 > nt && (nt = 0), nt >= C && (nt = C - 1); var ot = A.west + F * nt;
E ? ot = g(ot) : ot *= T; var at, st = J * C * L + nt * L; if (1 === R) at = w[st];
else { at = 0; var lt; if (N)
for (lt = 0; R > lt; ++lt) at = at * z + w[st + lt];
else
for (lt = R - 1; lt >= 0; --lt) at = at * z + w[st + lt] } at = at * I + O, H = Math.max(H, at), G = Math.min(G, at), (it !== nt || K !== J) && (at -= S); var ut = $ * d(ot),
ct = $ * m(ot),
ht = q * ut,
dt = k * ct,
mt = p(ht * ut + dt * ct + tt * et),
pt = 1 / mt,
ft = ht * pt,
vt = dt * pt,
yt = tt * pt;
_[W++] = ft + ut * at - P.x, _[W++] = vt + ct * at - P.y, _[W++] = yt + et * at - P.z, _[W++] = at; var gt = (ot - l) / (c - l);
_[W++] = gt, _[W++] = rt } } return { maximumHeight: H, minimumHeight: G } }, s }), r("Core/HermitePolynomialApproximation", ["./defined", "./Math"], function(e, t) { "use strict";
function r(e, t, i, n, o, a) { var s, l, u, c = 0; if (n > 0) { for (l = 0; o > l; l++) { for (s = !1, u = 0; u < a.length && !s; u++) l === a[u] && (s = !0);
s || (a.push(l), c += r(e, t, i, n - 1, o, a), a.splice(a.length - 1, 1)) } return c } for (c = 1, l = 0; o > l; l++) { for (s = !1, u = 0; u < a.length && !s; u++) l === a[u] && (s = !0);
s || (c *= e - i[t[l]]) } return c } var i = t.factorial,
n = { type: "Hermite" }; return n.getRequiredDataPoints = function(e) { return Math.max(e + 1, 2) }, n.interpolateOrderZero = function(t, n, o, a, s) { e(s) || (s = new Array(a)); var l, u, c, h, d, m, p = n.length,
f = new Array(a); for (l = 0; a > l; l++) { s[l] = 0; var v = new Array(p); for (f[l] = v, u = 0; p > u; u++) v[u] = [] } var y = p,
g = new Array(y); for (l = 0; y > l; l++) g[l] = l; var _ = p - 1; for (h = 0; a > h; h++) { for (u = 0; y > u; u++) m = g[u] * a + h, f[h][0].push(o[m]); for (l = 1; y > l; l++) { var w = !1; for (u = 0; y - l > u; u++) { var C, x = n[g[u]],
S = n[g[u + l]];
0 >= S - x ? (m = g[u] * a + a * l + h, C = o[m], f[h][l].push(C / i(l))) : (C = f[h][l - 1][u + 1] - f[h][l - 1][u], f[h][l].push(C / (S - x))), w = w || 0 !== C } w || (_ = l - 1) } } for (c = 0, d = 0; d >= c; c++)
for (l = c; _ >= l; l++) { var E = r(t, g, n, c, l, []); for (h = 0; a > h; h++) { var b = f[h][l][0];
s[h + c * a] += b * E } }
return s }, n }), r("Core/InterpolationAlgorithm", ["./DeveloperError"], function(e) { "use strict"; var t = {}; return t.type = void 0, t.getRequiredDataPoints = function() { throw new e("This function defines an interface and should not be called directly.") }, t.interpolateOrderZero = function() { throw new e("This function defines an interface and should not be called directly.") }, t }), r("Core/TimeInterval", ["./defined", "./DeveloperError", "./freezeObject", "./JulianDate", "./TimeStandard"], function(e, t, r, i, n) { "use strict"; var o = function(r, n, o, a, s) { if (!e(r)) throw new t("start must be specified."); if (!e(n)) throw new t("stop must be specified.");
e(o) || (o = !0), e(a) || (a = !0); var l = i.compare(n, r);
this.start = r, this.stop = n, this.data = s, this.isStartIncluded = o, this.isStopIncluded = a, this.isEmpty = 0 > l || 0 === l && (!o || !a) }; return o.fromIso8601 = function(e, t, r, n) { var a = e.split("/"),
s = i.fromIso8601(a[0]),
l = i.fromIso8601(a[1]); return new o(s, l, t, r, n) }, o.equals = function(t, r) { return t === r || e(t) && e(r) && (t.isEmpty && r.isEmpty || t.isStartIncluded === r.isStartIncluded && t.isStopIncluded === r.isStopIncluded && t.start.equals(r.start) && t.stop.equals(r.stop)) }, o.equalsEpsilon = function(r, i, n) { if ("number" != typeof n) throw new t("epsilon is required and must be a number."); return r === i || e(r) && e(i) && (r.isEmpty && i.isEmpty || r.isStartIncluded === i.isStartIncluded && r.isStopIncluded === i.isStopIncluded && r.start.equalsEpsilon(i.start, n) && r.stop.equalsEpsilon(i.stop, n)) }, o.prototype.clone = function() { return new o(this.start, this.stop, this.isStartIncluded, this.isStopIncluded, this.data) }, o.EMPTY = r(new o(new i(0, 0, n.TAI), new i(0, 0, n.TAI), !1, !1)), o.prototype.intersect = function(t, r) { if (!e(t)) return o.EMPTY; var i, n, a, s = t.start,
l = t.stop,
u = t.isStartIncluded,
c = t.isStopIncluded,
h = this.start,
d = this.stop,
m = this.isStartIncluded,
p = this.isStopIncluded; return s.greaterThanOrEquals(h) && d.greaterThanOrEquals(s) ? (n = !s.equals(h) && u || m && u, a = p && c, i = e(r) ? r(this.data, t.data) : this.data, d.greaterThanOrEquals(l) ? (a = a || !l.equals(d) && c, new o(s, l, n, a, i)) : (a = a || p, new o(s, d, n, a, i))) : s.lessThanOrEquals(h) && h.lessThanOrEquals(l) ? (n = s.equals(h) === !1 && m || m && u, a = p && c, i = e(r) ? r(this.data, t.data) : this.data, d.greaterThanOrEquals(l) ? (a = a || l.equals(d) === !1 && c, new o(h, l, n, a, i)) : (a = a || p, new o(h, d, n, a, i))) : o.EMPTY }, o.prototype.contains = function(e) { if (this.isEmpty) return !1; var t = i.compare(this.start, e); if (0 === t) return this.isStartIncluded; var r = i.compare(e, this.stop); return 0 === r ? this.isStopIncluded : 0 > t && 0 > r }, o.prototype.equals = function(e) { return o.equals(this, e) }, o.prototype.equalsEpsilon = function(e, t) { return o.equalsEpsilon(this, e, t) }, o }), r("Core/Iso8601", ["./freezeObject", "./JulianDate", "./TimeInterval"], function(e, t, r) { "use strict"; var i = e(t.fromIso8601("0000-01-01T00:00:00Z")),
n = e(t.fromIso8601("9999-12-31T24:00:00Z")),
o = e(new r(i, n, !0, !0)),
a = { MINIMUM_VALUE: i, MAXIMUM_VALUE: n, MAXIMUM_INTERVAL: o }; return a }), r("Core/KeyboardEventModifier", ["./Enumeration"], function(e) { "use strict"; var t = { SHIFT: new e(0, "SHIFT"), CTRL: new e(1, "CTRL"), ALT: new e(2, "ALT") }; return t }), r("Core/LagrangePolynomialApproximation", ["./defined"], function(e) { "use strict"; var t = { type: "Lagrange" }; return t.getRequiredDataPoints = function(e) { return Math.max(e + 1, 2) }, t.interpolateOrderZero = function(t, r, i, n, o) { e(o) || (o = new Array(n)); var a, s, l = r.length; for (a = 0; n > a; a++) o[a] = 0; for (a = 0; l > a; a++) { var u = 1; for (s = 0; l > s; s++)
if (s !== a) { var c = r[a] - r[s];
u *= (t - r[s]) / c }
for (s = 0; n > s; s++) o[s] += u * i[a * n + s] } return o }, t }), r("Core/LinearApproximation", ["./defined", "./DeveloperError"], function(e, t) { "use strict"; var r = { type: "Linear" }; return r.getRequiredDataPoints = function(e) { if (1 !== e) throw new t("Linear interpolation can only generate a first degree polynomial."); return 2 }, r.interpolateOrderZero = function(r, i, n, o, a) { if (2 !== i.length) throw new t("The xTable provided to the linear interpolator must have exactly two elements."); if (0 >= o) throw new t("There must be at least 1 dependent variable for each independent variable.");
e(a) || (a = new Array(o)); var s, l, u, c = i[0],
h = i[1]; if (c === h) throw new t("Divide by zero error: xTable[0] and xTable[1] are equal"); for (s = 0; o > s; s++) l = n[s], u = n[s + o], a[s] = ((u - l) * r + h * l - c * u) / (h - c); return a }, r }), r("Core/NearFarScalar", ["./defaultValue", "./defined", "./DeveloperError"], function(e, t) { "use strict"; var r = function(t, r, i, n) { this.near = e(t, 0), this.nearValue = e(r, 0), this.far = e(i, 1), this.farValue = e(n, 0) }; return r.clone = function(e, i) { return t(e) ? t(i) ? (i.near = e.near, i.nearValue = e.nearValue, i.far = e.far, i.farValue = e.farValue, i) : new r(e.near, e.nearValue, e.far, e.farValue) : void 0 }, r.equals = function(e, r) { return e === r || t(e) && t(r) && e.near === r.near && e.nearValue === r.nearValue && e.far === r.far && e.farValue === r.farValue }, r }), r("Core/Visibility", ["./Enumeration"], function(e) { "use strict"; var t = { NONE: new e(-1, "NONE"), PARTIAL: new e(0, "PARTIAL"), FULL: new e(1, "FULL") }; return t }), r("Core/Occluder", ["./defaultValue", "./defined", "./DeveloperError", "./Math", "./Cartesian3", "./Visibility", "./Ellipsoid", "./BoundingSphere"], function(e, t, r, i, n, o, a, s) {
"use strict";
var l = function(e, t) { if (!e) throw new r("occluderBoundingSphere is required."); if (!t) throw new r("camera position is required.");
this._occluderPosition = e.center.clone(), this._occluderRadius = e.radius, this._horizonDistance = 0, this._horizonPlaneNormal = void 0, this._horizonPlanePosition = void 0, this._cameraPosition = void 0, this.setCameraPosition(t) };
l.prototype.getPosition = function() { return this._occluderPosition }, l.prototype.getRadius = function() {
return this._occluderRadius
}, l.prototype.setCameraPosition = function(e) { e = n.clone(e); var t, r, i, o = this._occluderPosition.subtract(e),
a = o.magnitudeSquared(),
s = this._occluderRadius * this._occluderRadius; if (a > s) { t = Math.sqrt(a - s), a = 1 / Math.sqrt(a), r = o.multiplyByScalar(a); var l = t * t * a;
i = e.add(r.multiplyByScalar(l)) } else t = Number.MAX_VALUE;
this._horizonDistance = t, this._horizonPlaneNormal = r, this._horizonPlanePosition = i, this._cameraPosition = e };
var u = new n;
l.prototype.isPointVisible = function(e) { if (this._horizonDistance !== Number.MAX_VALUE) { var t = n.subtract(e, this._occluderPosition, u),
r = this._occluderRadius; if (r = t.magnitudeSquared() - r * r, r > 0) return r = Math.sqrt(r) + this._horizonDistance, t = n.subtract(e, this._cameraPosition, t), r * r > t.magnitudeSquared() } return !1 }, l.prototype.isBoundingSphereVisible = function(e) { var t = e.center.clone(),
r = e.radius; if (this._horizonDistance !== Number.MAX_VALUE) { var i = n.subtract(t, this._occluderPosition, u),
o = this._occluderRadius - r; if (o = i.magnitudeSquared() - o * o, r < this._occluderRadius) return o > 0 ? (o = Math.sqrt(o) + this._horizonDistance, i = n.subtract(t, this._cameraPosition, i), o * o + r * r > i.magnitudeSquared()) : !1; if (o > 0) { i = t.subtract(this._cameraPosition); var a = i.magnitudeSquared(),
s = this._occluderRadius * this._occluderRadius,
l = r * r; return (this._horizonDistance * this._horizonDistance + s) * l > a * s ? !0 : (o = Math.sqrt(o) + this._horizonDistance, o * o + l > a) } return !0 } return !1 }, l.prototype.getVisibility = function(e) { var t = e.center.clone(),
r = e.radius; if (r > this._occluderRadius) return o.FULL; if (this._horizonDistance !== Number.MAX_VALUE) { var i = t.subtract(this._occluderPosition),
n = this._occluderRadius - r,
a = i.magnitudeSquared(); if (n = a - n * n, n > 0) { n = Math.sqrt(n) + this._horizonDistance, i = t.subtract(this._cameraPosition); var s = i.magnitudeSquared(); return s > n * n + r * r ? o.NONE : (n = this._occluderRadius + r, n = a - n * n, n > 0 ? (n = Math.sqrt(n) + this._horizonDistance, n * n + r * r > s ? o.FULL : o.PARTIAL) : (i = t.subtract(this._horizonPlanePosition), i.dot(this._horizonPlaneNormal) > -r ? o.PARTIAL : o.FULL)) } } return o.NONE }, l.getOccludeePoint = function(e, t, i) { if (!e) throw new r("occluderBoundingSphere is required."); if (!i) throw new r("positions is required."); if (0 === i.length) throw new r("positions must contain at least one element"); var o = n.clone(t),
a = e.center.clone(),
s = e.radius,
u = i.length; if (a.equals(t)) throw new r("occludeePosition must be different than occluderBoundingSphere.center"); var c = o.subtract(a).normalize(),
h = -c.dot(a),
d = l._anyRotationVector(a, c, h),
m = l._horizonToPlaneNormalDotProduct(e, c, h, d, i[0]); if (!m) return void 0; for (var p, f = 1; u > f; ++f) { if (p = l._horizonToPlaneNormalDotProduct(e, c, h, d, i[f]), !p) return void 0;
m > p && (m = p) } if (.0017453283658983088 > m) return void 0; var v = s / m; return a.add(c.multiplyByScalar(v)) };
var c = [];
return l.computeOccludeePointFromExtent = function(i, o) { if (!t(i)) throw new r("extent is required.");
o = e(o, a.WGS84); var u = i.subsample(o, 0, c),
h = s.fromPoints(u),
d = n.ZERO; return d.equals(h.center) ? void 0 : l.getOccludeePoint(new s(d, o.getMinimumRadius()), h.center, u) }, l._anyRotationVector = function(e, t, r) { var i = t.clone().abs(),
o = i.x > i.y ? 0 : 1;
(0 === o && i.z > i.x || 1 === o && i.z > i.y) && (o = 2); var a = new n;
0 === o ? (i.x = e.x, i.y = e.y + 1, i.z = e.z + 1, a = n.UNIT_X) : 1 === o ? (i.x = e.x + 1, i.y = e.y, i.z = e.z + 1, a = n.UNIT_Y) : (i.x = e.x + 1, i.y = e.y + 1, i.z = e.z, a = n.UNIT_Z); var s = (t.dot(i) + r) / -t.dot(a); return i.add(a.multiplyByScalar(s)).subtract(e).normalize() }, l._rotationVector = function(e, t, r, n, o) { var a = n.subtract(e); if (a = a.normalize(), t.dot(a) < .9999999847691291) { var s = t.cross(a),
l = s.magnitude(); if (l > i.EPSILON13) return s.normalize() } return o }, l._horizonToPlaneNormalDotProduct = function(e, t, r, i, o) { var a = n.clone(o),
s = e.center.clone(),
l = e.radius,
u = s.subtract(a),
c = u.magnitudeSquared(),
h = l * l; if (h > c) return !1; var d = c - h,
m = Math.sqrt(d),
p = Math.sqrt(c),
f = 1 / p,
v = m * f,
y = v * m;
u = u.normalize(); var g = a.add(u.multiplyByScalar(y)),
_ = Math.sqrt(d - y * y),
w = this._rotationVector(s, t, r, a, i),
C = new n(w.x * w.x * u.x + (w.x * w.y - w.z) * u.y + (w.x * w.z + w.y) * u.z, (w.x * w.y + w.z) * u.x + w.y * w.y * u.y + (w.y * w.z - w.x) * u.z, (w.x * w.z - w.y) * u.x + (w.y * w.z + w.x) * u.y + w.z * w.z * u.z);
C = C.normalize(); var x = C.multiplyByScalar(_);
w = g.add(x).subtract(s).normalize(); var S = t.dot(w);
w = g.subtract(x).subtract(s).normalize(); var E = t.dot(w); return E > S ? S : E }, l
}), r("Core/OrientationInterpolator", ["./defined", "./DeveloperError"], function(e, t) { "use strict";
function r(e, t) { var r = e._lastTimeIndex || 0; if (t >= e._points[r].time) { if (r + 1 < e._points.length && t < e._points[r + 1].time) return r; if (r + 2 < e._points.length && t < e._points[r + 2].time) return e._lastTimeIndex = r + 1, e._lastTimeIndex } else if (r - 1 >= 0 && t >= e._points[r - 1].time) return e._lastTimeIndex = r - 1, e._lastTimeIndex; for (r = 0; r < e._points.length - 1 && !(t >= e._points[r].time && t < e._points[r + 1].time); ++r); return r === e._points.length - 1 && (r = e._points.length - 2), e._lastTimeIndex = r, e._lastTimeIndex } var i = function(r) { if (!e(r) || !(r instanceof Array) || r.length < 2) throw new t("controlPoints is required. It must be an array with at least a length of 3.");
this._points = r, this._lastTimeIndex = 0 }; return i.prototype.getControlPoints = function() { return this._points }, i.prototype.evaluate = function(i) { if (!e(i)) throw new t("time is required."); if (i < this._points[0].time || i > this._points[this._points.length - 1].time) throw new t("time is out of range."); var n = r(this, i),
o = (i - this._points[n].time) / (this._points[n + 1].time - this._points[n].time); return this._points[n].orientation.slerp(this._points[n + 1].orientation, o) }, i }), r("Core/Packable", ["../Core/DeveloperError"], function(e) { "use strict";
function t() { throw new e("This type should not be instantiated directly.") } var r = { packedLength: void 0, pack: t, unpack: t }; return r }), r("Core/PackableForInterpolation", ["../Core/DeveloperError"], function(e) { "use strict";
function t() { throw new e("This type should not be instantiated directly.") } var r = { packedInterpolationLength: void 0, convertPackedArrayForInterpolation: t, unpackInterpolationResult: t }; return r }), r("Core/PolygonGeometryLibrary", ["./defaultValue", "./defined", "./Cartesian3", "./Ellipsoid"], function(e, t, r, i) { "use strict";
function n(e, t, i, n) { return r.subtract(t, e, a), r.multiplyByScalar(a, i / n, a), r.add(e, a, a), [a.x, a.y, a.z] } var o = {},
a = new r;
o.subdivideLine = function(e, t, i) { var o = r.distance(e, t),
a = r.angleBetween(e, t),
s = a / i,
l = Math.ceil(Math.log(s) / Math.log(2));
1 > l && (l = 0); var u = Math.pow(2, l),
c = o / u,
h = new Array(3 * u),
d = 0;
h[d++] = e.x, h[d++] = e.y, h[d++] = e.z; for (var m = 1; u > m; m++) { var p = n(e, t, m * c, o);
h[d++] = p[0], h[d++] = p[1], h[d++] = p[2] } return h }; var s = new r,
l = new r,
u = new r; return o.scaleToGeodeticHeightExtruded = function(n, o, a, c) { c = e(c, i.WGS84); var h = s,
d = l,
m = u; if (t(n) && t(n.attributes) && t(n.attributes.position))
for (var p = n.attributes.position.values, f = p.length / 2, v = 0; f > v; v += 3) r.fromArray(p, v, m), c.scaleToGeodeticSurface(m, m), c.geodeticSurfaceNormal(m, h), r.multiplyByScalar(h, o, d), r.add(m, d, d), p[v] = d.x, p[v + 1] = d.y, p[v + 2] = d.z, r.multiplyByScalar(h, a, d), r.add(m, d, d), p[v + f] = d.x, p[v + 1 + f] = d.y, p[v + 2 + f] = d.z; return n }, o }), r("Core/pointInsideTriangle", ["./barycentricCoordinates", "./Cartesian3", "./DeveloperError"], function(e, t) { "use strict"; var r = new t,
i = function(t, i, n, o) { return e(t, i, n, o, r), r.x > 0 && r.y > 0 && r.z > 0 }; return i }), r("Core/Queue", [], function() { "use strict"; var e = function() { this._array = [], this._offset = 0, this.length = 0 }; return e.prototype.enqueue = function(e) { this._array.push(e), this.length++ }, e.prototype.dequeue = function() { if (0 === this.length) return void 0; var e = this._array,
t = this._offset,
r = e[t]; return e[t] = void 0, t++, t > 10 && 2 * t > e.length && (this._array = e.slice(t), t = 0), this._offset = t, this.length--, r }, e.prototype.contains = function(e) { return -1 !== this._array.indexOf(e) }, e.prototype.clear = function() { this._array.length = this._offset = this.length = 0 }, e.prototype.sort = function(e) { this._offset > 0 && (this._array = this._array.slice(this._offset), this._offset = 0), this._array.sort(e) }, e }), r("Core/WindingOrder", ["./Enumeration"], function(e) { "use strict"; var t = { CLOCKWISE: new e(2304, "CLOCKWISE"), COUNTER_CLOCKWISE: new e(2305, "COUNTER_CLOCKWISE"), validate: function(e) { return e === t.CLOCKWISE || e === t.COUNTER_CLOCKWISE } }; return t }), r("Core/PolygonPipeline", ["./DeveloperError", "./Math", "./Cartesian2", "./Cartesian3", "./defined", "./Geometry", "./GeometryAttribute", "./Ellipsoid", "./EllipsoidTangentPlane", "./defaultValue", "./pointInsideTriangle", "./ComponentDatatype", "./PrimitiveType", "./Queue", "./WindingOrder"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p) { "use strict";
function f(e, t, r) { var i = t.subtract(e),
n = r.subtract(t); return i.x * n.y - i.y * n.x >= 0 }
function v(e) { for (var t = e[0].x, r = 0, i = 0; i < e.length; i++) e[i].x > t && (t = e[i].x, r = i); return r }
function y(e) { for (var t = e[0][0].x, r = 0, i = 0; i < e.length; i++) { var n = e[i][v(e[i])].x;
n > t && (t = n, r = i) } return r }
function g(e) { for (var t = [], r = 0; r < e.length; r++) { var i = e[(r - 1 + e.length) % e.length],
n = e[r],
o = e[(r + 1) % e.length];
f(i, n, o) || t.push(n) } return t }
function _(e, t) { for (var r = 0; r < e.length; r++)
if (t.equals(e[r])) return r; return -1 }
function w(e, t, n) { n = u(n, []); var o = Number.MAX_VALUE,
a = v(t),
s = new r(t[a].x, e.y);
n.push(a), n.push((a + 1) % t.length); for (var l = t[0].x, c = l, h = 1; h < t.length; ++h) t[h].x < l ? l = t[h].x : t[h].x > c && (c = t[h].x);
c += c - l; var d = new i(c, e.y, 0); for (h = 0; h < t.length; h++) { var m = t[h],
p = t[(h + 1) % t.length]; if ((m.x >= e.x || p.x >= e.x) && (m.y >= e.y && p.y <= e.y || m.y <= e.y && p.y >= e.y)) { var f = (p.y - m.y) * (d.x - e.x) - (p.x - m.x) * (d.y - e.y); if (0 !== f) { f = 1 / f; var y = ((p.x - m.x) * (e.y - m.y) - (p.y - m.y) * (e.x - m.x)) * f,
g = ((d.x - e.x) * (e.y - m.y) - (d.y - e.y) * (e.x - m.x)) * f; if (y >= 0 && 1 >= y && g >= 0 && 1 >= g) { var _ = new r(e.x + y * (d.x - e.x), e.y + y * (d.y - e.y)),
w = _.subtract(e);
f = w.magnitudeSquared(), o > f && (s = _, o = f, n[0] = h, n[1] = (h + 1) % t.length) } } } } return s }
function C(e, t) { var i = y(t),
n = t[i],
o = v(n),
a = n[o],
s = [],
l = w(a, e, s),
u = _(e, l); if (-1 !== u) return u; var h = e[s[0]].subtract(a).magnitudeSquared(),
d = e[s[1]].subtract(a).magnitudeSquared(),
m = d > h ? e[s[0]] : e[s[1]],
p = g(e),
f = p.indexOf(m); - 1 !== f && p.splice(f, 1); for (var C = [], x = 0; x < p.length; x++) { var S = p[x];
c(S, a, l, m) && C.push(S) } var E = Number.MAX_VALUE; if (C.length > 0) { var b = new r(1, 0, 0); for (x = 0; x < C.length; x++) { var T = C[x].subtract(a),
A = b.magnitude() * T.magnitude(); if (0 !== A) { var M = Math.abs(Math.acos(b.dot(T) / A));
E > M && (E = M, m = C[x]) } } } return e.indexOf(m) }
function x(e, t, r) { for (var i = W.computeWindingOrder2D(e), n = 0; n < t.length; n++) { var o = t[n];
o[0].equals(o[o.length - 1]) || o.push(o[0]); var a = W.computeWindingOrder2D(o);
a === i && o.reverse() } var s = l.fromPoints(e, r),
u = s.projectPointsOntoPlane(e),
c = []; for (n = 0; n < t.length; n++) c.push(s.projectPointsOntoPlane(t[n])); var h = C(u, c),
d = y(c),
m = v(c[d]),
p = t[d],
f = []; for (n = 0; n < e.length; n++) f.push(e[n]); var g, _ = []; if (0 !== m)
for (g = 0; g <= p.length; g++) { var w = (g + m) % p.length;
0 !== w && _.push(p[w]) } else
for (g = 0; g < p.length; g++) _.push(p[(g + m) % p.length]); var x = f.lastIndexOf(e[h]);
_.push(e[x]); var S = f.slice(0, x + 1),
E = f.slice(x + 1); return f = S.concat(_, E), t.splice(d, 1), f }
function S(e) { var t = "0." + Math.sin(B).toString().substr(5);
B += .2; var r = Math.floor(t * e); return r === e && r--, r }
function E(e, t, r) { return b(e, t, r) && b(t, e, r) && !L(r[e].position, r[t].position, r) && !r[e].position.equals(r[t].position) }
function b(e, t, r) { M(e, r); var n = r[e],
o = r[t],
a = A(e, r, V),
s = A(e, r, q),
l = r[a].position.subtract(n.position),
u = r[s].position.subtract(n.position),
c = o.position.subtract(n.position); return l = new i(l.x, l.y, 0), u = new i(u.x, u.y, 0), c = new i(c.x, c.y, 0), P(l, c) ? T(l, c) : P(u, c) ? T(u, c) : D(l, u) ? R(l, u, c) ? !0 : !1 : I(l, u) ? O(l, u, c) ? !1 : !0 : void 0 }
function T(e, t) { return t.magnitude() < e.magnitude() }
function A(e, t, r) { var i = e + r; return 0 > i && (i = t.length - 1), i === t.length && (i = 0), M(i, t), i }
function M(t, r) { var n = t - 1,
o = t + 1;
0 > n && (n = r.length - 1), o === r.length && (o = 0); var a = r[n].position.subtract(r[t].position),
s = r[o].position.subtract(r[t].position); if (a = new i(a.x, a.y, 0), s = new i(s.x, s.y, 0), 0 === a.cross(s).z) { var l = new e("Superfluous vertex found."); throw l.vertexIndex = t, l } }
function P(e, t) { return 0 === e.cross(t).z }
function D(e, t) { return e.cross(t).z < 0 }
function I(e, t) { return e.cross(t).z > 0 }
function O(e, t, r) { return e.cross(r).z > 0 && r.cross(t).z > 0 }
function R(e, t, r) { return e.cross(r).z < 0 && r.cross(t).z < 0 }
function L(e, t, i) { for (var n = 0; n < i.length; n++) { var o, a = i[n].position; if (o = n < i.length - 1 ? i[n + 1].position : i[0].position, !(e.equals(a) || t.equals(o) || e.equals(o) || t.equals(a))) { var s = (t.y - e.y) / (t.x - e.x),
l = (o.y - a.y) / (o.x - a.x); if (!(s === l || isNaN(s) && isNaN(l))) { var u;
u = isNaN(s) ? e.x : isNaN(l) ? a.x : (e.y - a.y - s * e.x + l * a.x) / (l - s); var c = s * u + e.y - s * e.x,
h = new r(u, c); if (!(h.equals(e) || h.equals(t) || h.equals(a) || h.equals(o))) { var d = N(u, e.x, t.x) && N(c, e.y, t.y) && N(u, a.x, o.x) && N(c, a.y, o.y); if (d) return !0 } } } } return !1 }
function z(e) { var t = e[0].position,
r = e[1].position,
n = e[2].position,
o = r.subtract(t),
a = n.subtract(t); return o = new i(o.x, o.y, 0), a = new i(a.x, a.y, 0), 0 === o.cross(a).z }
function N(e, t, r) { return (e > t || e > r) && (t > e || r > e) || t === r && t === e }
function F(t) { var r = t.length; if (3 === r) return z(t) ? [] : [t[0].index, t[1].index, t[2].index]; if (t.length < 3) throw new e("Invalid polygon: must have at least three vertices."); for (var i = !1, n = 0; !i;) { var o = 10 * t.length; if (n > o) throw new e("Tried " + o + " times to find a valid cut and couldn't.");
n++; for (var a = S(t.length), s = a + 1; Math.abs(a - s) < 2 || Math.abs(a - s) > t.length - 2;) s = S(t.length); if (a > s) { var l = a;
a = s, s = l } try { if (E(a, s, t)) { var u = t.splice(a, s - a + 1, t[a], t[s]); return F(t).concat(F(u)) } } catch (c) { if (c.hasOwnProperty("vertexIndex")) return t.splice(c.vertexIndex, 1), F(t); throw c } } } var B = 0,
V = -1,
q = 1,
k = new i,
U = new i,
W = { removeDuplicates: function(t) { if (!n(t)) throw new e("positions is required."); var r = t.length; if (3 > r) throw new e("At least three positions are required."); for (var o = [], a = r - 1, s = 0; r > s; a = s++) { var l = t[a],
u = t[s];
i.equals(l, u) || o.push(u) } return o }, computeArea2D: function(t) { if (!n(t)) throw new e("positions is required."); var r = t.length; if (3 > r) throw new e("At least three positions are required."); for (var i = 0, o = r - 1, a = 0; r > a; o = a++) { var s = t[o],
l = t[a];
i += s.x * l.y - l.x * s.y } return .5 * i }, computeWindingOrder2D: function(e) { var t = W.computeArea2D(e); return t >= 0 ? p.COUNTER_CLOCKWISE : p.CLOCKWISE }, triangulate: function(t) { if (!n(t)) throw new e("positions is required."); var r = t.length; if (3 > r) throw new e("At least three positions are required."); for (var i = [], o = 0; r > o; ++o) i[o] = { position: t[o], index: o }; return F(i) }, resetSeed: function(e) { B = u(e, 0) }, computeSubdivision: function(r, s, l) { if (!n(r)) throw new e("positions is required."); if (!n(s)) throw new e("indices is required."); if (s.length < 3) throw new e("At least three indices are required."); if (0 !== s.length % 3) throw new e("The number of indices must be divisable by three."); if (l = u(l, t.RADIANS_PER_DEGREE), 0 >= l) throw new e("granularity must be greater than zero."); for (var c = new m, p = s.length, f = 0; p > f; f += 3) c.enqueue({ i0: s[f], i1: s[f + 1], i2: s[f + 2] }); for (var v, y = r.slice(0), g = [], _ = {}; c.length > 0;) { var w, C, x = c.dequeue(),
S = y[x.i0],
E = y[x.i1],
b = y[x.i2],
T = i.angleBetween(S, E),
A = i.angleBetween(E, b),
M = i.angleBetween(b, S),
P = Math.max(T, Math.max(A, M));
P > l ? T === P ? (w = Math.min(x.i0, x.i1).toString() + " " + Math.max(x.i0, x.i1).toString(), v = _[w], v || (C = i.add(S, E), i.multiplyByScalar(C, .5, C), y.push(C), v = y.length - 1, _[w] = v), c.enqueue({ i0: x.i0, i1: v, i2: x.i2 }), c.enqueue({ i0: v, i1: x.i1, i2: x.i2 })) : A === P ? (w = Math.min(x.i1, x.i2).toString() + " " + Math.max(x.i1, x.i2).toString(), v = _[w], v || (C = i.add(E, b), i.multiplyByScalar(C, .5, C), y.push(C), v = y.length - 1, _[w] = v), c.enqueue({ i0: x.i1, i1: v, i2: x.i0 }), c.enqueue({ i0: v, i1: x.i2, i2: x.i0 })) : M === P && (w = Math.min(x.i2, x.i0).toString() + " " + Math.max(x.i2, x.i0).toString(), v = _[w], v || (C = i.add(b, S), i.multiplyByScalar(C, .5, C), y.push(C), v = y.length - 1, _[w] = v), c.enqueue({ i0: x.i2, i1: v, i2: x.i1 }), c.enqueue({ i0: v, i1: x.i0, i2: x.i1 })) : (g.push(x.i0), g.push(x.i1), g.push(x.i2)) } var D = y.length,
I = new Array(3 * D),
O = 0; for (v = 0; D > v; v++) { var R = y[v];
I[O++] = R.x, I[O++] = R.y, I[O++] = R.z } return new o({ attributes: { position: new a({ componentDatatype: h.DOUBLE, componentsPerAttribute: 3, values: I }) }, indices: g, primitiveType: d.TRIANGLES }) }, scaleToGeodeticHeight: function(e, t, r) { r = u(r, s.WGS84); var o = k,
a = U; if (t = u(t, 0), n(e) && n(e.attributes) && n(e.attributes.position))
for (var l = e.attributes.position.values, c = l.length, h = 0; c > h; h += 3) a = i.fromArray(l, h, a), r.scaleToGeodeticSurface(a, a), r.geodeticSurfaceNormal(a, o), i.multiplyByScalar(o, t, o), i.add(a, o, a), l[h] = a.x, l[h + 1] = a.y, l[h + 2] = a.z; return e }, eliminateHoles: function(t, r, o) { if (!n(t)) throw new e("outerRing is required."); if (0 === t.length) throw new e("outerRing must not be empty."); if (!n(r)) throw new e("innerRings is required.");
o = u(o, s.WGS84); for (var a = [], l = 0; l < r.length; l++) { for (var c = [], h = 0; h < r[l].length; h++) c.push(i.clone(r[l][h]));
a.push(c) } for (var d = t; a.length > 0;) d = x(d, a, o); return d } }; return W }), r("Core/PolygonGeometry", ["./defaultValue", "./BoundingRectangle", "./BoundingSphere", "./Cartesian2", "./Cartesian3", "./ComponentDatatype", "./defined", "./DeveloperError", "./Ellipsoid", "./EllipsoidTangentPlane", "./Geometry", "./GeometryAttribute", "./GeometryAttributes", "./GeometryInstance", "./GeometryPipeline", "./IndexDatatype", "./Math", "./Matrix3", "./PolygonGeometryLibrary", "./PolygonPipeline", "./PrimitiveType", "./Quaternion", "./Queue", "./VertexFormat", "./WindingOrder"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C, x, S, E) { "use strict";
function b(e, t, r, i) { for (var o = C.fromAxisAngle(e._plane.normal, r, O), s = y.fromQuaternion(o, R), l = Number.POSITIVE_INFINITY, u = Number.NEGATIVE_INFINITY, c = Number.POSITIVE_INFINITY, h = Number.NEGATIVE_INFINITY, d = t.length, m = 0; d > m; ++m) { var p = n.clone(t[m], I);
y.multiplyByVector(s, p, p); var f = e.projectPointOntoPlane(p, D);
a(f) && (l = Math.min(l, f.x), u = Math.max(u, f.x), c = Math.min(c, f.y), h = Math.max(h, f.y)) } return i.x = l, i.y = c, i.width = u - l, i.height = h - c, i }
function T(e, t, r) { var i = _.removeDuplicates(t); if (i.length < 3) throw new s("Duplicate positions result in not enough positions to form a polygon."); var n = u.fromPoints(i, e),
o = n.projectPointsOntoPlane(i, L),
a = _.computeWindingOrder2D(o);
a === E.CLOCKWISE && (o.reverse(), i.reverse()); var l = _.triangulate(o); return new m({ geometry: _.computeSubdivision(i, l, r) }) }
function A(e, t, r, a, s, l, c) { if (e.st || e.normal || e.tangent || e.binormal) { var d = _.removeDuplicates(r),
m = u.fromPoints(d, a),
p = b(m, r, s, z),
f = W;
f.x = p.x, f.y = p.y; var g = t.attributes.position.values,
w = g.length,
x = e.st ? new Float32Array(2 * (w / 3)) : void 0,
S = e.normal ? new Float32Array(w) : void 0,
E = e.tangent ? new Float32Array(w) : void 0,
T = e.binormal ? new Float32Array(w) : void 0,
A = 0,
M = 0,
P = F,
D = B,
I = V,
O = !0,
R = C.fromAxisAngle(m._plane.normal, s, j),
L = y.fromQuaternion(R, Y),
q = w / 2,
X = w / 3;
l && (w /= 2); for (var Z = 0; w > Z; Z += 3) { var K = n.fromArray(g, Z, H); if (e.st) { var J = y.multiplyByVector(L, K, N),
Q = m.projectPointOntoPlane(J, G);
i.subtract(Q, f, Q), l && (x[A + X] = Q.x / p.width, x[A + 1 + X] = Q.y / p.height), x[A] = Q.x / p.width, x[A + 1] = Q.y / p.height, A += 2 } if (e.normal || e.tangent || e.binormal) { var $ = M + 1,
et = M + 2; if (c) { if (w > Z + 3) { var tt = n.fromArray(g, Z + 3, k); if (O) { var rt = n.fromArray(g, Z + w, U);
tt.subtract(K, tt), rt.subtract(K, rt), P = n.cross(rt, tt, P).normalize(P), O = !1 } tt.equalsEpsilon(K, v.EPSILON10) && (O = !0) }(e.tangent || e.binormal) && (I = a.geodeticSurfaceNormal(K, I), e.tangent && (D = n.cross(I, P, D).normalize(D))) } else P = a.geodeticSurfaceNormal(K, P), (e.tangent || e.binormal) && (D = n.cross(n.UNIT_Z, P, D), D = y.multiplyByVector(L, D, D).normalize(D), e.binormal && (I = n.cross(P, D, I).normalize(I)));
e.normal && (l && !c ? (S[M + q] = -P.x, S[$ + q] = -P.y, S[et + q] = -P.z) : (S[M + q] = P.x, S[$ + q] = P.y, S[et + q] = P.z), S[M] = P.x, S[$] = P.y, S[et] = P.z), e.tangent && (l && !c ? (E[M + q] = -D.x, E[$ + q] = -D.y, E[et + q] = -D.z) : (E[M + q] = D.x, E[$ + q] = D.y, E[et + q] = D.z), E[M] = D.x, E[$] = D.y, E[et] = D.z), e.binormal && (l && (T[M + q] = I.x, T[$ + q] = I.y, T[et + q] = I.z), T[M] = I.x, T[$] = I.y, T[et] = I.z), M += 3 } } e.st && (t.attributes.st = new h({ componentDatatype: o.FLOAT, componentsPerAttribute: 2, values: x })), e.normal && (t.attributes.normal = new h({ componentDatatype: o.FLOAT, componentsPerAttribute: 3, values: S })), e.tangent && (t.attributes.tangent = new h({ componentDatatype: o.FLOAT, componentsPerAttribute: 3, values: E })), e.binormal && (t.attributes.binormal = new h({ componentDatatype: o.FLOAT, componentsPerAttribute: 3, values: T })) } return t }
function M(e, t) { var r, i, a, s, l, u, m, p, y, _ = [],
C = e.length; for (m = 0; C > m; m++) p = e[m], y = e[(m + 1) % C], r = g.subdivideLine(p, y, t), r.push(y.x, y.y, y.z), _ = _.concat(r);
_ = _.concat(_), C = _.length; var x = f.createTypedArray(C / 3, C - 6 * e.length); for (i = 0, C /= 6, m = 0; C > m; m++) a = m, s = a + 1, p = n.fromArray(_, 3 * a, k), y = n.fromArray(_, 3 * s, U), n.equalsEpsilon(p, y, v.EPSILON6) || (l = a + C, u = l + 1, x[i++] = a, x[i++] = l, x[i++] = s, x[i++] = s, x[i++] = l, x[i++] = u); return new c({ attributes: new d({ position: new h({ componentDatatype: o.DOUBLE, componentsPerAttribute: 3, values: _ }) }), indices: x, primitiveType: w.TRIANGLES }) }
function P(e, t, r, i) { var n = T(e, t, r).geometry,
a = n.attributes.position.values,
s = n.indices,
l = a.concat(a),
u = l.length / 3,
p = f.createTypedArray(u, 2 * s.length);
p.set(s); var v, y = s.length,
g = u / 2; for (v = 0; y > v; v += 3) { var w = p[v] + g,
C = p[v + 1] + g,
x = p[v + 2] + g;
p[v + y] = x, p[v + 1 + y] = C, p[v + 2 + y] = w } var S = new c({ attributes: new d({ position: new h({ componentDatatype: o.DOUBLE, componentsPerAttribute: 3, values: l }) }), indices: p, primitiveType: n.primitiveType }),
b = { topAndBottom: new m({ geometry: S }) };
b.walls = []; var A = i.outerRing,
P = _.computeWindingOrder2D(A);
P === E.CLOCKWISE && (A = A.reverse()); var D = M(A, r);
b.walls.push(new m({ geometry: D })); var I = i.holes; for (v = 0; v < I.length; v++) { var O = I[v];
P = _.computeWindingOrder2D(O), P !== E.CLOCKWISE && (O = O.reverse()), D = M(O, r), b.walls.push(new m({ geometry: D })) } return b } var D = new i,
I = new n,
O = new C,
R = new y,
L = [],
z = new t,
N = new n,
F = new n,
B = new n,
V = new n,
q = new r,
k = new n,
U = new n,
W = new i,
G = new i,
H = new n,
j = new C,
Y = new y,
X = function(t) { t = e(t, e.EMPTY_OBJECT); var r = e(t.vertexFormat, S.DEFAULT),
i = e(t.ellipsoid, l.WGS84),
n = e(t.granularity, v.RADIANS_PER_DEGREE),
o = e(t.stRotation, 0),
u = e(t.height, 0),
c = e(t.extrudedHeight, void 0),
h = a(c) && !v.equalsEpsilon(u, c, v.EPSILON6); if (h) { var d = c;
c = Math.min(d, u), u = Math.max(d, u) } var m = t.polygonHierarchy; if (!a(m)) throw new s("options.polygonHierarchy is required.");
this._vertexFormat = r, this._ellipsoid = i, this._granularity = n, this._stRotation = o, this._height = u, this._extrudedHeight = c, this._extrude = h, this._polygonHierarchy = m, this._workerName = "createPolygonGeometry" }; return X.fromPositions = function(t) { if (t = e(t, e.EMPTY_OBJECT), !a(t.positions)) throw new s("options.positions is required."); var r = { polygonHierarchy: { positions: t.positions }, height: t.height, extrudedHeight: t.extrudedHeight, vertexFormat: t.vertexFormat, stRotation: t.stRotation, ellipsoid: t.ellipsoid, granularity: t.granularity }; return new X(r) }, X.createGeometry = function(e) { var t, i, o, l, u = e._vertexFormat,
h = e._ellipsoid,
d = e._granularity,
m = e._stRotation,
v = e._height,
y = e._extrudedHeight,
w = e._extrude,
C = e._polygonHierarchy,
S = [],
E = new x;
E.enqueue(C), C = []; for (var b; 0 !== E.length;) { var M = E.dequeue(),
D = M.positions; if (D.length < 3) throw new s("At least three positions are required."); var I = M.holes ? M.holes.length : 0; if (0 === I) C.push({ outerRing: D, holes: [] }), S.push(M.positions);
else { var O = []; for (b = 0; I > b; b++) { var R = M.holes[b];
O.push(R.positions); var L = 0;
a(R.holes) && (L = R.holes.length); for (var z = 0; L > z; z++) E.enqueue(R.holes[z]) } C.push({ outerRing: D, holes: O }); var B = _.eliminateHoles(D, O);
S.push(B) } } l = S[0], t = r.fromPoints(l); var V, k = []; if (w) { for (b = 0; b < S.length; b++)
if (V = P(h, S[b], d, C[b]), a(V)) { o = V.topAndBottom, o.geometry = g.scaleToGeodeticHeightExtruded(o.geometry, v, y, h), o.geometry = A(u, o.geometry, l, h, m, !0, !1), k.push(o), i = V.walls; for (var U = 0; U < i.length; U++) { var W = i[U];
W.geometry = g.scaleToGeodeticHeightExtruded(W.geometry, v, y, h), W.geometry = A(u, W.geometry, l, h, m, !0, !0), k.push(W) } } } else
for (b = 0; b < S.length; b++) V = T(h, S[b], d), a(V) && (V.geometry = _.scaleToGeodeticHeight(V.geometry, v, h), V.geometry = A(u, V.geometry, l, h, m, !1, !1), k.push(V));
V = p.combine(k); var G = t.center;
F = h.geodeticSurfaceNormal(G, F), N = n.multiplyByScalar(F, v, N), G = n.add(G, N, G), w && (q = t.clone(q), G = q.center, N = n.multiplyByScalar(F, y, N), G = n.add(h.scaleToGeodeticSurface(G, G), N, G), t = r.union(t, q, t)), V.attributes.position.values = new Float64Array(V.attributes.position.values), V.indices = f.createTypedArray(V.attributes.position.values.length / 3, V.indices); var H = V.attributes; return u.position || delete H.position, new c({ attributes: H, indices: V.indices, primitiveType: V.primitiveType, boundingSphere: t }) }, X }), r("Core/PolygonOutlineGeometry", ["./defaultValue", "./defined", "./BoundingSphere", "./Cartesian3", "./ComponentDatatype", "./DeveloperError", "./Ellipsoid", "./EllipsoidTangentPlane", "./Geometry", "./GeometryAttribute", "./GeometryAttributes", "./GeometryInstance", "./GeometryPipeline", "./IndexDatatype", "./Math", "./PolygonGeometryLibrary", "./PolygonPipeline", "./PrimitiveType", "./Queue", "./WindingOrder"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _) { "use strict";
function w(e, t, r) { var i = v.removeDuplicates(t); if (i.length < 3) throw new o("Duplicate positions result in not enough positions to form a polygon."); var a = s.fromPoints(i, e),
d = a.projectPointsOntoPlane(i, x),
p = v.computeWindingOrder2D(d);
p === _.CLOCKWISE && (d.reverse(), i.reverse()); var g, w = [],
C = i.length; for (g = 0; C - 1 > g; g++) w = w.concat(f.subdivideLine(i[g], i[g + 1], r));
w = w.concat(f.subdivideLine(i[C - 1], i[0], r)), C = w.length / 3; var S = 2 * C,
E = m.createTypedArray(w.length / 3, S),
b = 0; for (g = 0; C - 1 > g; g++) E[b++] = g, E[b++] = g + 1; return E[b++] = C - 1, E[b++] = 0, new h({ geometry: new l({ attributes: new c({ position: new u({ componentDatatype: n.DOUBLE, componentsPerAttribute: 3, values: new Float64Array(w) }) }), indices: E, primitiveType: y.LINES }) }) }
function C(e, t, r) { var i = v.removeDuplicates(t); if (i.length < 3) throw new o("Duplicate positions result in not enough positions to form a polygon."); var a = s.fromPoints(i, e),
d = a.projectPointsOntoPlane(i, x),
p = v.computeWindingOrder2D(d);
p === _.CLOCKWISE && (d.reverse(), i.reverse()); var g, w = [],
C = i.length,
S = new Array(C); for (S[0] = 0, g = 0; C - 1 > g; g++) w = w.concat(f.subdivideLine(i[g], i[g + 1], r)), S[g + 1] = w.length / 3;
w = w.concat(f.subdivideLine(i[C - 1], i[0], r)), C = w.length / 3; var E = 2 * (2 * C + S.length),
b = m.createTypedArray(w.length / 3, E),
T = 0; for (g = 0; C - 1 > g; g++) b[T++] = g, b[T++] = g + 1, b[T++] = g + C, b[T++] = g + 1 + C; for (b[T++] = C - 1, b[T++] = 0, b[T++] = C + C - 1, b[T++] = C, g = 0; g < S.length; g++) { var A = S[g];
b[T++] = A, b[T++] = A + C } return w = w.concat(w), new h({ geometry: new l({ attributes: new c({ position: new u({ componentDatatype: n.DOUBLE, componentsPerAttribute: 3, values: new Float64Array(w) }) }), indices: b, primitiveType: y.LINES }) }) } var x = [],
S = new i,
E = new i,
b = new r,
T = function(r) { r = e(r, e.EMPTY_OBJECT); var i = e(r.ellipsoid, a.WGS84),
n = e(r.granularity, p.RADIANS_PER_DEGREE),
s = e(r.height, 0),
l = e(r.extrudedHeight, void 0),
u = t(l) && !p.equalsEpsilon(s, l, p.EPSILON6); if (u) { var c = l;
l = Math.min(c, s), s = Math.max(c, s) } var h = r.polygonHierarchy; if (!t(h)) throw new o("options.polygonHierarchy is required.");
this._ellipsoid = i, this._granularity = n, this._height = s, this._extrudedHeight = l, this._extrude = u, this._polygonHierarchy = h, this._workerName = "createPolygonOutlineGeometry" }; return T.fromPositions = function(r) { if (r = e(r, e.EMPTY_OBJECT), !t(r.positions)) throw new o("options.positions is required."); var i = { polygonHierarchy: { positions: r.positions }, height: r.height, extrudedHeight: r.extrudedHeight, ellipsoid: r.ellipsoid, granularity: r.granularity }; return new T(i) }, T.createGeometry = function(e) { var n, a, s = e._ellipsoid,
u = e._granularity,
c = e._height,
h = e._extrudedHeight,
m = e._extrude,
p = e._polygonHierarchy,
y = [],
_ = new g;
_.enqueue(p); for (var x; 0 !== _.length;) { var T = _.dequeue(),
A = T.positions; if (A.length < 3) throw new o("At least three positions are required."); var M = T.holes ? T.holes.length : 0; for (x = 0; M > x; x++) { var P = T.holes[x];
y.push(P.positions); var D = 0;
t(P.holes) && (D = P.holes.length); for (var I = 0; D > I; I++) _.enqueue(P.holes[I]) } y.push(A) } a = y[0], n = r.fromPoints(a); var O, R = []; if (m)
for (x = 0; x < y.length; x++) O = C(s, y[x], u), t(O) && (O.geometry = f.scaleToGeodeticHeightExtruded(O.geometry, c, h, s), R.push(O));
else
for (x = 0; x < y.length; x++) O = w(s, y[x], u), t(O) && (O.geometry = v.scaleToGeodeticHeight(O.geometry, c, s), R.push(O));
O = d.combine(R); var L = n.center; return E = s.geodeticSurfaceNormal(L, E), S = i.multiplyByScalar(E, c, S), L = i.add(L, S, L), m && (b = n.clone(b), L = b.center, S = i.multiplyByScalar(E, h, S), L = i.add(L, S, L), n = r.union(n, b, n)), new l({ attributes: O.attributes, indices: O.indices, primitiveType: O.primitiveType, boundingSphere: n }) }, T }), r("Core/ReferenceFrame", ["./Enumeration"], function(e) { "use strict"; var t = { FIXED: new e(0, "FIXED"), INERTIAL: new e(1, "INERTIAL") }; return t }), r("Core/destroyObject", ["./defaultValue", "./DeveloperError"], function(e, t) { "use strict";
function r() { return !0 } var i = function(i, n) {
function o() { throw new t(n) } n = e(n, "This object was destroyed, i.e., destroy() was called."); for (var a in i) "function" == typeof i[a] && (i[a] = o); return i.isDestroyed = r, void 0 }; return i }), r("Core/ScreenSpaceEventType", ["./Enumeration"], function(e) { "use strict"; var t = { LEFT_DOWN: new e(0, "LEFT_DOWN"), LEFT_UP: new e(1, "LEFT_UP"), LEFT_CLICK: new e(2, "LEFT_CLICK"), LEFT_DOUBLE_CLICK: new e(3, "LEFT_DOUBLE_CLICK"), RIGHT_DOWN: new e(5, "RIGHT_DOWN"), RIGHT_UP: new e(6, "RIGHT_UP"), RIGHT_CLICK: new e(7, "RIGHT_CLICK"), RIGHT_DOUBLE_CLICK: new e(8, "RIGHT_DOUBLE_CLICK"), MIDDLE_DOWN: new e(10, "MIDDLE_DOWN"), MIDDLE_UP: new e(11, "MIDDLE_UP"), MIDDLE_CLICK: new e(12, "MIDDLE_CLICK"), MIDDLE_DOUBLE_CLICK: new e(13, "MIDDLE_DOUBLE_CLICK"), MOUSE_MOVE: new e(15, "MOUSE_MOVE"), WHEEL: new e(16, "WHEEL"), PINCH_START: new e(17, "PINCH_START"), PINCH_END: new e(18, "PINCH_END"), PINCH_MOVE: new e(19, "PINCH_MOVE") }; return t }), r("Core/ScreenSpaceEventHandler", ["./DeveloperError", "./defined", "./destroyObject", "./Cartesian2", "./ScreenSpaceEventType", "./KeyboardEventModifier", "./defaultValue"], function(e, t, r, i, n, o, a) {
"use strict";
function s(e, t) { if (e._element === document) return { x: t.clientX, y: t.clientY }; var r = e._element.getBoundingClientRect(); return { x: t.clientX - r.left, y: t.clientY - r.top } }
function l(e) { return e.shiftKey ? o.SHIFT : e.ctrlKey ? o.CTRL : e.altKey ? o.ALT : void 0 }
function u(e, r) { var o = s(e, r); if (e._lastMouseX = o.x, e._lastMouseY = o.y, e._totalPixels = 0, !e._seenAnyTouchEvents) { var a, u = l(r);
0 === r.button ? (e._leftMouseButtonDown = !0, a = e.getInputAction(n.LEFT_DOWN, u)) : 1 === r.button ? (e._middleMouseButtonDown = !0, a = e.getInputAction(n.MIDDLE_DOWN, u)) : 2 === r.button && (e._rightMouseButtonDown = !0, a = e.getInputAction(n.RIGHT_DOWN, u)), t(a) && a({ position: new i(o.x, o.y) }), r.preventDefault() } }
function c(e, r) { var o, a, u = l(r); if (!e._seenAnyTouchEvents) { 0 === r.button ? (e._leftMouseButtonDown = !1, o = e.getInputAction(n.LEFT_UP, u), a = e.getInputAction(n.LEFT_CLICK, u)) : 1 === r.button ? (e._middleMouseButtonDown = !1, o = e.getInputAction(n.MIDDLE_UP, u), a = e.getInputAction(n.MIDDLE_CLICK, u)) : 2 === r.button && (e._rightMouseButtonDown = !1, o = e.getInputAction(n.RIGHT_UP, u), a = e.getInputAction(n.RIGHT_CLICK, u)); var c = s(e, r),
h = e._lastMouseX - c.x,
d = e._lastMouseY - c.y;
e._totalPixels += Math.sqrt(h * h + d * d), t(o) && o({ position: new i(c.x, c.y) }), t(a) && e._totalPixels < e._clickPixelTolerance && a({ position: new i(c.x, c.y) }) } }
function h(e, r) { var o = s(e, r); if (!e._seenAnyTouchEvents) { var a = e._lastMouseX - o.x,
u = e._lastMouseY - o.y;
e._totalPixels += Math.sqrt(a * a + u * u); var c = { startPosition: new i(e._lastMouseX, e._lastMouseY), endPosition: new i(o.x, o.y), motion: new i },
h = l(r),
d = e.getInputAction(n.MOUSE_MOVE, h);
t(d) && d(c), e._lastMouseX = c.endPosition.x, e._lastMouseY = c.endPosition.y, (e._leftMouseButtonDown || e._middleMouseButtonDown || e._rightMouseButtonDown) && r.preventDefault() } }
function d(e, r) { var o, a, u = r.touches.length;
e._seenAnyTouchEvents = !0; var c, h = l(r);
o = s(e, r.touches[0]), 1 === u ? (e._lastMouseX = o.x, e._lastMouseY = o.y, e._totalPixels = 0, e._leftMouseButtonDown = !0, c = e.getInputAction(n.LEFT_DOWN, h), t(c) && c({ position: new i(o.x, o.y) }), r.preventDefault()) : e._leftMouseButtonDown && (e._leftMouseButtonDown = !1, c = e.getInputAction(n.LEFT_UP, h), t(c) && c({ position: new i(o.x, o.y) })), 2 === u ? (e._isPinching = !0, a = s(e, r.touches[1]), e._touchID1 = r.touches[0].identifier, e._touchID2 = r.touches[1].identifier, e._lastMouseX = o.x, e._lastMouseY = o.y, e._lastTouch2X = a.x, e._lastTouch2Y = a.y, c = e.getInputAction(n.PINCH_START, h), t(c) && c({ position1: new i(o.x, o.y), position2: new i(a.x, a.y) })) : e._isPinching && (e._isPinching = !1, c = e.getInputAction(n.PINCH_END, h), t(c) && c()) }
function m(e, r) { var o, a, u = r.touches.length,
c = r.changedTouches.length,
h = l(r); if (e._leftMouseButtonDown && (e._leftMouseButtonDown = !1, o = e.getInputAction(n.LEFT_UP, h), a = e.getInputAction(n.LEFT_CLICK, h), c > 0)) { var m = s(e, r.changedTouches[0]),
p = e._lastMouseX - m.x,
f = e._lastMouseY - m.y;
e._totalPixels += Math.sqrt(p * p + f * f), t(o) && o({ position: new i(m.x, m.y) }), t(a) && e._totalPixels < e._clickPixelTolerance && a({ position: new i(m.x, m.y) }) } e._isPinching && (e._isPinching = !1, o = e.getInputAction(n.PINCH_END, h), o && o()), (1 === u || 2 === u) && d(e, r) }
function p(e, r) {
var o, a, u, c, h = l(r);
if (e._leftMouseButtonDown && 1 === r.touches.length) {
o = s(e, r.touches[0]);
var d = e._lastMouseX - o.x,
m = e._lastMouseY - o.y;
e._totalPixels += Math.sqrt(d * d + m * m), c = { startPosition: new i(e._lastMouseX, e._lastMouseY), endPosition: new i(o.x, o.y), motion: new i }, u = e.getInputAction(n.MOUSE_MOVE, h), t(u) && u(c), e._lastMouseX = c.endPosition.x, e._lastMouseY = c.endPosition.y, (e._leftMouseButtonDown || e._middleMouseButtonDown || e._rightMouseButtonDown) && r.preventDefault()
}
if (e._isPinching && 2 === r.touches.length) { if (r.touches[0].identifier === e._touchID2 ? (o = s(e, r.touches[1]), a = s(e, r.touches[0])) : (o = s(e, r.touches[0]), a = s(e, r.touches[1])), u = e.getInputAction(n.PINCH_MOVE, h), t(u)) { var p = a.x - o.x,
f = a.y - o.y,
v = .25 * Math.sqrt(p * p + f * f),
y = e._lastTouch2X - e._lastMouseX,
g = e._lastTouch2Y - e._lastMouseY,
_ = .25 * Math.sqrt(y * y + g * g),
w = .125 * (a.y + o.y),
C = .125 * (e._lastTouch2Y + e._lastMouseY),
x = Math.atan2(f, p),
S = Math.atan2(g, y);
c = { distance: { startPosition: new i(0, _), endPosition: new i(0, v), motion: new i }, angleAndHeight: { startPosition: new i(S, C), endPosition: new i(x, w), motion: new i } }, u(c) } e._lastMouseX = o.x, e._lastMouseY = o.y, e._lastTouch2X = a.x, e._lastTouch2Y = a.y }
}
function f(e, r) { var i = r.detail ? -120 * r.detail : r.wheelDelta,
o = l(r),
a = n.WHEEL,
s = e.getInputAction(a, o);
t(s) && (r.preventDefault(), s(i)) }
function v(e, r) { var o, a = l(r),
u = s(e, r);
0 === r.button ? o = e.getInputAction(n.LEFT_DOUBLE_CLICK, a) : 1 === r.button ? o = e.getInputAction(n.MIDDLE_DOUBLE_CLICK, a) : 2 === r.button && (o = e.getInputAction(n.RIGHT_DOUBLE_CLICK, a)), t(o) && o({ position: new i(u.x, u.y) }) }
function y(e) { var r = e,
i = !0;
e._callbacks = [], t(e._element.disableRootEvents) && (i = !1), e._callbacks.push({ name: "mousedown", onDoc: !1, action: function(e) { u(r, e) } }), e._callbacks.push({ name: "mouseup", onDoc: i, action: function(e) { c(r, e) } }), e._callbacks.push({ name: "mousemove", onDoc: i, action: function(e) { h(r, e) } }), e._callbacks.push({ name: "dblclick", onDoc: !1, action: function(e) { v(r, e) } }), e._callbacks.push({ name: "touchstart", onDoc: !1, action: function(e) { d(r, e) } }), e._callbacks.push({ name: "touchend", onDoc: i, action: function(e) { m(r, e) } }), e._callbacks.push({ name: "touchmove", onDoc: i, action: function(e) { p(r, e) } }), e._callbacks.push({ name: "mousewheel", onDoc: !1, action: function(e) { f(r, e) } }), e._callbacks.push({ name: "DOMMouseScroll", onDoc: !1, action: function(e) { f(r, e) } }); for (var n = 0; n < e._callbacks.length; n++) { var o = e._callbacks[n];
o.onDoc ? document.addEventListener(o.name, o.action, !1) : e._element.addEventListener(o.name, o.action, !1) } }
var g = function(e) { this._mouseEvents = {}; for (var t in n) n.hasOwnProperty(t) && (this._mouseEvents[t] = void 0);
this._modifiedMouseEvents = {}; for (var r in o)
if (o.hasOwnProperty(r)) { this._modifiedMouseEvents[r] = {}; for (t in n) n.hasOwnProperty(t) && (this._modifiedMouseEvents[r][t] = void 0) }
this._leftMouseButtonDown = !1, this._middleMouseButtonDown = !1, this._rightMouseButtonDown = !1, this._isPinching = !1, this._seenAnyTouchEvents = !1, this._lastMouseX = 0, this._lastMouseY = 0, this._lastTouch2X = 0, this._lastTouch2Y = 0, this._totalPixels = 0, this._touchID1 = 0, this._touchID2 = 0, this._clickPixelTolerance = 5, this._element = a(e, document), y(this) };
return g.prototype.setInputAction = function(r, i, n) { if (!t(r)) throw new e("action is required."); if (!t(i)) throw new e("type is required."); var o;
o = t(n) && t(n.name) ? this._modifiedMouseEvents[n.name] : this._mouseEvents, t(i) && t(i.name) && t(o) && (o[i.name] = r) }, g.prototype.getInputAction = function(r, i) { if (!t(r)) throw new e("type is required."); var n; return n = t(i) && t(i.name) ? this._modifiedMouseEvents[i.name] : this._mouseEvents, t(r) && t(r.name) && t(n) ? n[r.name] : void 0 }, g.prototype.removeInputAction = function(r, i) { if (!t(r)) throw new e("type is required."); var n;
n = t(i) && t(i.name) ? this._modifiedMouseEvents[i.name] : this._mouseEvents, t(r) && t(r.name) && t(n) && t(n[r.name]) && delete n[r.name] }, g.prototype._unregister = function() { for (var e = 0; e < this._callbacks.length; e++) { var t = this._callbacks[e];
t.onDoc ? document.removeEventListener(t.name, t.action, !1) : this._element.removeEventListener(t.name, t.action, !1) } }, g.prototype.isDestroyed = function() { return !1 }, g.prototype.destroy = function() { return this._unregister(), r(this) }, g
}), r("Core/Shapes", ["./defaultValue", "./defined", "./DeveloperError", "./Math", "./Cartesian3", "./Quaternion", "./Matrix3"], function(e, t, r, i, n, o, a) { "use strict";
function s(e, t, r, i, n, s, l, u, c, h, d, m, p, f, v, y, g, _) { for (var w, C, x, S, E, b, T, A, M = 0; _ > M; M++, p += v, ++g) { C = v > 0 ? m[p] + f : f - m[p], S = C + d, E = -Math.cos(S), T = c.multiplyByScalar(E), E = Math.sin(S), A = h.multiplyByScalar(E), T = T.add(A), E = Math.cos(C), E *= E, b = Math.sin(C), b *= b, x = n / Math.sqrt(i * E + r * b), w = x / t, E = Math.sin(w / 2); var P = new o(T.x * E, T.y * E, T.z * E, Math.cos(w / 2)).normalize(),
D = a.fromQuaternion(P),
I = D.multiplyByVector(u),
O = I.normalize();
I = O.multiplyByScalar(l), y[g] = I } } var l = { computeCircleBoundary: function(n, o, a, s) { if (!t(n) || !t(o) || !t(a)) throw new r("ellipsoid, center, and radius are required."); if (0 >= a) throw new r("radius must be greater than zero."); if (s = e(s, i.RADIANS_PER_DEGREE), 0 >= s) throw new r("granularity must be greater than zero."); return this.computeEllipseBoundary(n, o, a, a, 0, s) }, computeEllipseBoundary: function(o, a, l, u, c, h) { if (!(t(o) && t(a) && t(l) && t(u))) throw new r("ellipsoid, center, semiMajorAxis, and semiMinorAxis are required."); if (0 >= l || 0 >= u) throw new r("Semi-major and semi-minor axes must be greater than zero."); if (c = c || 0, h = e(h, i.RADIANS_PER_DEGREE), 0 >= h) throw new r("granularity must be greater than zero."); if (u > l) { var d = l;
l = u, u = d } for (var m = 2.31, p = l * l, f = u * u, v = l * u, y = 1 - f / p, g = Math.sqrt(y), _ = n.clone(a), w = _.magnitude(), C = new n(0, 0, 1), x = 1 / w, S = _.multiplyByScalar(x), E = C.cross(_).normalize(), b = S.cross(E), T = 1 + Math.ceil(i.PI_OVER_TWO / h), A = m / (T - 1), M = [], P = 0, D = 0, I = 0; T > I; I++, D += A, ++P)
if (M[P] = D - g * Math.sin(D), M[P] >= i.PI_OVER_TWO) { M[P] = i.PI_OVER_TWO, T = I + 1; break }
var O = []; return s(o, _.magnitude(), p, f, v, g, w, S, E, b, c, M, 0, 0, 1, O, 0, T - 1), s(o, _.magnitude(), p, f, v, g, w, S, E, b, c, M, T - 1, Math.PI, -1, O, T - 1, T - 1), s(o, _.magnitude(), p, f, v, g, w, S, E, b, c, M, 0, Math.PI, 1, O, 2 * T - 2, T - 1), s(o, _.magnitude(), p, f, v, g, w, S, E, b, c, M, T - 1, i.TWO_PI, -1, O, 3 * T - 3, T), O.push(O[0].clone()), O } }; return l }), r("Core/ShowGeometryInstanceAttribute", ["./defaultValue", "./defined", "./ComponentDatatype", "./DeveloperError"], function(e, t, r, i) { "use strict"; var n = function(t) { t = e(t, !0), this.componentDatatype = r.UNSIGNED_BYTE, this.componentsPerAttribute = 1, this.normalize = !0, this.value = n.toValue(t) }; return n.toValue = function(e) { if (!t(e)) throw new i("show is required."); return new Uint8Array([e]) }, n }), r("Core/Simon1994PlanetaryPositions", ["./Cartesian3", "./defined", "./DeveloperError", "./JulianDate", "./Math", "./Matrix3", "./TimeConstants", "./TimeStandard"], function(e, t, r, i, n, o, a, s) { "use strict";
function l(e) { var t = 6.239996 + .0172019696544 * e; return .001657 * Math.sin(t + .01671 * Math.sin(t)) }
function u(e, t) { t = e.addSeconds(w, t); var r = t.getTotalDays() - C; return t = t.addSeconds(l(r), t) }
function c(i, o, a, s, l, u, c, m) { if (0 > a && (a = -a, l += n.PI), 0 > a || a > n.PI) throw new r("The inclination is out of range. Inclination must be greater than or equal to zero and less than or equal to Pi radians."); var p = i * (1 - o),
v = s - l,
y = l,
g = d(u - s, o),
_ = h(o, 0); if ("Hyperbolic" === _ && Math.abs(n.NegativePiToPi(g)) >= Math.acos(-1 / o)) throw new r("The true anomaly of the hyperbolic orbit lies outside of the bounds of the hyperbola.");
f(v, a, y, P); var w = p * (1 + o),
C = Math.cos(g),
x = Math.sin(g),
S = 1 + o * C; if (S <= n.Epsilon10) throw new r("elements cannot be converted to cartesian"); var E = w / S; return t(m) ? (m.x = E * C, m.y = E * x, m.z = 0) : m = new e(E * C, E * x, 0), P.multiplyByVector(m, m) }
function h(e, t) { if (0 > e) throw new r("eccentricity cannot be negative."); return t >= e ? "Circular" : 1 - t > e ? "Elliptical" : 1 + t >= e ? "Parabolic" : "Hyperbolic" }
function d(e, t) { if (0 > t || t >= 1) throw new r("eccentricity out of range."); var i = m(e, t); return p(i, t) }
function m(e, t) { if (0 > t || t >= 1) throw new r("eccentricity out of range."); var i = Math.floor(e / n.TWO_PI);
e -= i * n.TWO_PI; var o, a = e + t * Math.sin(e) / (1 - Math.sin(e + t) + Math.sin(e)),
s = Number.MAX_VALUE; for (o = 0; D > o && Math.abs(s - a) > I; ++o) { s = a; var l = s - t * Math.sin(s) - e,
u = 1 - t * Math.cos(s);
a = s - l / u } if (o >= D) throw new r("Kepler equation did not converge"); return s = a + i * n.TWO_PI }
function p(e, t) { if (0 > t || t >= 1) throw new r("eccentricity out of range."); var i = Math.floor(e / n.TWO_PI);
e -= i * n.TWO_PI; var o = Math.cos(e) - t,
a = Math.sin(e) * Math.sqrt(1 - t * t),
s = Math.atan2(a, o); return s = n.zeroToTwoPi(s), 0 > e && (s -= n.TWO_PI), s += i * n.TWO_PI }
function f(e, i, a, s) { if (0 > i || i > n.PI) throw new r("inclination out of range"); var l = Math.cos(e),
u = Math.sin(e),
c = Math.cos(i),
h = Math.sin(i),
d = Math.cos(a),
m = Math.sin(a); return t(s) ? (s[0] = d * l - m * u * c, s[1] = m * l + d * u * c, s[2] = u * h, s[3] = -d * u - m * l * c, s[4] = -m * u + d * l * c, s[5] = l * h, s[6] = m * h, s[7] = -d * h, s[8] = c) : s = new o(d * l - m * u * c, -d * u - m * l * c, m * h, m * l + d * u * c, -m * u + d * l * c, -d * h, u * h, l * h, c), s }
function v(e, t) { u(e, Pt); var r = Pt.getJulianDayNumber() - x.getJulianDayNumber() + (Pt.getSecondsOfDay() - x.getSecondsOfDay()) / a.SECONDS_PER_DAY,
i = r / (10 * a.DAYS_PER_JULIAN_CENTURY),
n = .3595362 * i,
o = O + W * Math.cos(z * n) + J * Math.sin(z * n) + G * Math.cos(N * n) + Q * Math.sin(N * n) + H * Math.cos(F * n) + $ * Math.sin(F * n) + j * Math.cos(B * n) + et * Math.sin(B * n) + Y * Math.cos(V * n) + tt * Math.sin(V * n) + X * Math.cos(q * n) + rt * Math.sin(q * n) + Z * Math.cos(k * n) + it * Math.sin(k * n) + K * Math.cos(U * n) + nt * Math.sin(U * n),
s = R + L * i + mt * Math.cos(ot * n) + Ct * Math.sin(ot * n) + pt * Math.cos(at * n) + xt * Math.sin(at * n) + ft * Math.cos(st * n) + St * Math.sin(st * n) + vt * Math.cos(lt * n) + Et * Math.sin(lt * n) + yt * Math.cos(ut * n) + bt * Math.sin(ut * n) + gt * Math.cos(ct * n) + Tt * Math.sin(ct * n) + _t * Math.cos(ht * n) + At * Math.sin(ht * n) + wt * Math.cos(dt * n) + Mt * Math.sin(dt * n),
l = .0167086342 - .0004203654 * i,
h = 102.93734808 * T + 11612.3529 * A * i,
d = 469.97289 * A * i,
m = 174.87317577 * T - 8679.27034 * A * i; return c(o, l, d, h, m, s, E, t) }
function y(e, t) { u(e, Pt); var r = Pt.getJulianDayNumber() - x.getJulianDayNumber() + (Pt.getSecondsOfDay() - x.getSecondsOfDay()) / a.SECONDS_PER_DAY,
i = r / a.DAYS_PER_JULIAN_CENTURY,
n = i * i,
o = n * i,
s = o * i,
l = 383397.7725 + .004 * i,
h = .055545526 - 1.6e-8 * i,
d = 5.15668983 * T,
m = -8e-5 * i + .02966 * n - 42e-6 * o - 1.3e-7 * s,
p = 83.35324312 * T,
f = 14643420.2669 * i - 38.2702 * n - .045047 * o + 21301e-8 * s,
v = 125.04455501 * T,
y = -6967919.3631 * i + 6.3602 * n + .007625 * o - 3586e-8 * s,
g = 218.31664563 * T,
_ = 1732559343.4847 * i - 6.391 * n + .006588 * o - 3169e-8 * s,
w = 297.85019547 * T + A * (1602961601.209 * i - 6.3706 * n + .006593 * o - 3169e-8 * s),
C = 93.27209062 * T + A * (1739527262.8478 * i - 12.7512 * n - .001037 * o + 417e-8 * s),
E = 134.96340251 * T + A * (1717915923.2178 * i + 31.8792 * n + .051635 * o - 2447e-7 * s),
M = 357.52910918 * T + A * (129596581.0481 * i - .5532 * n + 136e-6 * o - 1149e-8 * s),
P = 310.17137918 * T - A * (6967051.436 * i + 6.2068 * n + .007618 * o - 3219e-8 * s),
D = 2 * w,
I = 4 * w,
O = 6 * w,
R = 2 * E,
L = 3 * E,
z = 4 * E,
N = 2 * C;
l += 3400.4 * Math.cos(D) - 635.6 * Math.cos(D - E) - 235.6 * Math.cos(E) + 218.1 * Math.cos(D - M) + 181 * Math.cos(D + E), h += .014216 * Math.cos(D - E) + .008551 * Math.cos(D - R) - .001383 * Math.cos(E) + .001356 * Math.cos(D + E) - .001147 * Math.cos(I - L) - 914e-6 * Math.cos(I - R) + 869e-6 * Math.cos(D - M - E) - 627e-6 * Math.cos(D) - 394e-6 * Math.cos(I - z) + 282e-6 * Math.cos(D - M - R) - 279e-6 * Math.cos(w - E) - 236e-6 * Math.cos(R) + 231e-6 * Math.cos(I) + 229e-6 * Math.cos(O - z) - 201e-6 * Math.cos(R - N), m += 486.26 * Math.cos(D - N) - 40.13 * Math.cos(D) + 37.51 * Math.cos(N) + 25.73 * Math.cos(R - N) + 19.97 * Math.cos(D - M - N), f += -55609 * Math.sin(D - E) - 34711 * Math.sin(D - R) - 9792 * Math.sin(E) + 9385 * Math.sin(I - L) + 7505 * Math.sin(I - R) + 5318 * Math.sin(D + E) + 3484 * Math.sin(I - z) - 3417 * Math.sin(D - M - E) - 2530 * Math.sin(O - z) - 2376 * Math.sin(D) - 2075 * Math.sin(D - L) - 1883 * Math.sin(R) - 1736 * Math.sin(O - 5 * E) + 1626 * Math.sin(M) - 1370 * Math.sin(O - L), y += -5392 * Math.sin(D - N) - 540 * Math.sin(M) - 441 * Math.sin(D) + 423 * Math.sin(N) - 288 * Math.sin(R - N), _ += -3332.9 * Math.sin(D) + 1197.4 * Math.sin(D - E) - 662.5 * Math.sin(M) + 396.3 * Math.sin(E) - 218 * Math.sin(D - M); var F = 2 * P,
B = 3 * P;
m += 46.997 * Math.cos(P) * i - .614 * Math.cos(D - N + P) * i + .614 * Math.cos(D - N - P) * i - .0297 * Math.cos(F) * n - .0335 * Math.cos(P) * n + .0012 * Math.cos(D - N + F) * n - 16e-5 * Math.cos(P) * o + 4e-5 * Math.cos(B) * o + 4e-5 * Math.cos(F) * o; var V = 2.116 * Math.sin(P) * i - .111 * Math.sin(D - N - P) * i - .0015 * Math.sin(P) * n;
f += V, _ += V, y += -520.77 * Math.sin(P) * i + 13.66 * Math.sin(D - N + P) * i + 1.12 * Math.sin(D - P) * i - 1.06 * Math.sin(N - P) * i + .66 * Math.sin(F) * n + .371 * Math.sin(P) * n - .035 * Math.sin(D - N + F) * n - .015 * Math.sin(D - N + P) * n + .0014 * Math.sin(P) * o - .0011 * Math.sin(B) * o - 9e-4 * Math.sin(F) * o, l *= b; var q = d + m * A,
k = p + f * A,
U = g + _ * A,
W = v + y * A; return c(l, h, q, k, W, U, S, t) }
function g(e, t) { var r = y(e); return t = r.multiplyByScalar(It, t) } var _ = {},
w = 32.184,
C = 2451545,
x = i.fromTotalDays(2451545, s.TAI),
S = 398600435e6,
E = 328900.56 * 1.012300034 * S,
b = 1e3,
T = n.RADIANS_PER_DEGREE,
A = n.RADIANS_PER_ARCSECOND,
M = 14959787e4,
P = new o,
D = 50,
I = n.EPSILON8,
O = 1.0000010178 * M,
R = 100.46645683 * T,
L = 1295977422.83429 * A,
z = 16002,
N = 21863,
F = 32004,
B = 10931,
V = 14529,
q = 16368,
k = 15318,
U = 32794,
W = 64e-7 * M,
G = -152 * 1e-7 * M,
H = 62e-7 * M,
j = -8e-7 * M,
Y = 32e-7 * M,
X = -41 * 1e-7 * M,
Z = 19e-7 * M,
K = -11 * 1e-7 * M,
J = -150 * 1e-7 * M,
Q = -46 * 1e-7 * M,
$ = 68 * 1e-7 * M,
et = 54e-7 * M,
tt = 14e-7 * M,
rt = 24e-7 * M,
it = -28 * 1e-7 * M,
nt = 22e-7 * M,
ot = 10,
at = 16002,
st = 21863,
lt = 10931,
ut = 1473,
ct = 32004,
ht = 4387,
dt = 73,
mt = -325 * 1e-7,
pt = -322 * 1e-7,
ft = -79 * 1e-7,
vt = 232 * 1e-7,
yt = -52 * 1e-7,
gt = 97e-7,
_t = 55e-7,
wt = -41 * 1e-7,
Ct = -105 * 1e-7,
xt = -137 * 1e-7,
St = 258e-7,
Et = 35e-7,
bt = -116 * 1e-7,
Tt = -88 * 1e-7,
At = -112 * 1e-7,
Mt = -80 * 1e-7,
Pt = new i,
Dt = .012300034,
It = -1 * (Dt / (Dt + 1)),
Ot = new o(1.0000000000000002, 5.619723173785822e-16, 4.690511510146299e-19, -5.154129427414611e-16, .9174820620691819, -.39777715593191376, -2.23970096136568e-16, .39777715593191376, .9174820620691819),
Rt = new e; return _.ComputeSunPositionInEarthInertialFrame = function(e, r) { return t(e) || (e = new i), Rt = v(e, Rt), r = Rt.negate(r), g(e, Rt), r.subtract(Rt, r), Ot.multiplyByVector(r, r), r }, _.ComputeMoonPositionInEarthInertialFrame = function(e, r) { return t(e) || (e = new i), r = y(e, r), Ot.multiplyByVector(r, r), r }, _ }), r("Core/SimplePolylineGeometry", ["./defined", "./DeveloperError", "./ComponentDatatype", "./IndexDatatype", "./PrimitiveType", "./defaultValue", "./BoundingSphere", "./Geometry", "./GeometryAttribute", "./GeometryAttributes"], function(e, t, r, i, n, o, a, s, l, u) { "use strict"; var c = function(r) { r = o(r, o.EMPTY_OBJECT); var i = r.positions; if (!e(i) || i.length < 2) throw new t("At least two positions are required.");
this._positions = i, this._workerName = "createSimplePolylineGeometry" }; return c.createGeometry = function(e) { var t, o = e._positions,
c = 0,
h = o.length,
d = new Float64Array(3 * h); for (t = 0; h > t; ++t) { var m = o[t];
d[c++] = m.x, d[c++] = m.y, d[c++] = m.z } var p = new u;
p.position = new l({ componentDatatype: r.DOUBLE, componentsPerAttribute: 3, values: d }); var f = 2 * (h - 1),
v = i.createTypedArray(h, f); for (c = 0, t = 0; h - 1 > t; ++t) v[c++] = t, v[c++] = t + 1; return new s({ attributes: p, indices: v, primitiveType: n.LINES, boundingSphere: a.fromPoints(o) }) }, c }), r("Core/SphereGeometry", ["./defaultValue", "./Cartesian3", "./EllipsoidGeometry"], function(e, t, r) { "use strict"; var i = function(i) { var n = e(i.radius, 1),
o = new t(n, n, n),
a = { radii: o, stackPartitions: i.stackPartitions, slicePartitions: i.slicePartitions, vertexFormat: i.vertexFormat };
this._ellipsoidGeometry = new r(a), this._workerName = "createSphereGeometry" }; return i.createGeometry = function(e) { return r.createGeometry(e._ellipsoidGeometry) }, i }), r("Core/SphereOutlineGeometry", ["./defaultValue", "./Cartesian3", "./EllipsoidOutlineGeometry"], function(e, t, r) { "use strict"; var i = function(i) { var n = e(i.radius, 1),
o = new t(n, n, n),
a = { radii: o, stackPartitions: i.stackPartitions, slicePartitions: i.slicePartitions, subdivisions: i.subdivisions };
this._ellipsoidGeometry = new r(a), this._workerName = "createSphereOutlineGeometry" }; return i.createGeometry = function(e) { return r.createGeometry(e._ellipsoidGeometry) }, i }), r("Core/Spherical", ["./DeveloperError", "./defaultValue", "./defined"], function(e, t, r) { "use strict"; var i = function(e, r, i) { this.clock = t(e, 0), this.cone = t(r, 0), this.magnitude = t(i, 1) }; return i.fromCartesian3 = function(t, n) { if (!r(t)) throw new e("cartesian3 is required"); var o = t.x,
a = t.y,
s = t.z,
l = o * o + a * a; return r(n) || (n = new i), n.clock = Math.atan2(a, o), n.cone = Math.atan2(Math.sqrt(l), s), n.magnitude = Math.sqrt(l + s * s), n }, i.clone = function(e, t) { return r(e) ? r(t) ? (t.clock = e.clock, t.cone = e.cone, t.magnitude = e.magnitude, t) : new i(e.clock, e.cone, e.magnitude) : void 0 }, i.normalize = function(t, n) { if (!r(t)) throw new e("spherical is required"); return r(n) ? (n.clock = t.clock, n.cone = t.cone, n.magnitude = 1, n) : new i(t.clock, t.cone, 1) }, i.equals = function(e, t) { return e === t || r(e) && r(t) && e.clock === t.clock && e.cone === t.cone && e.magnitude === t.magnitude }, i.equalsEpsilon = function(e, i, n) { return n = t(n, 0), e === i || r(e) && r(i) && Math.abs(e.clock - i.clock) <= n && Math.abs(e.cone - i.cone) <= n && Math.abs(e.magnitude - i.magnitude) <= n }, i.toString = function(e) { return "(" + e.clock + ", " + e.cone + ", " + e.magnitude + ")" }, i.prototype.clone = function(e) { return i.clone(this, e) }, i.prototype.normalize = function(e) { return i.normalize(this, e) }, i.prototype.equals = function(e) { return i.equals(this, e) }, i.prototype.equalsEpsilon = function(e, t) { return i.equalsEpsilon(this, e, t) }, i.prototype.toString = function() { return i.toString(this) }, i }), r("Core/isCrossOriginUrl", ["./defined"], function(e) { "use strict"; var t, r = function(r) { e(t) || (t = document.createElement("a")), t.href = window.location.href; var i = t.host,
n = t.protocol; return t.href = r, t.href = t.href, n !== t.protocol || i !== t.host }; return r }), r("Core/TaskProcessor", ["require", "./buildModuleUrl", "./defaultValue", "./defined", "./destroyObject", "./isCrossOriginUrl", "../ThirdParty/when", "../ThirdParty/Uri"], function(e, t, r, i, n, o, a, s) { "use strict";
function l(e, t) {--e._activeTasks; var r = t.data,
n = r.id,
o = e._deferreds,
a = o[n];
i(r.error) ? a.reject(r.error) : a.resolve(r.result), delete o[n] }
function u() { if (i(h)) return h; if (h = t("Workers/cesiumWorkerBootstrapper.js"), o(h)) { var e, r = 'importScripts("' + h + '");'; try { e = new Blob([r], { type: "application/javascript" }) } catch (n) { var a = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder,
s = new a;
s.append(r), e = s.getBlob("application/javascript") } var l = window.URL || window.webkitURL;
h = l.createObjectURL(e) } return h }
function c(n) { var o = u(),
a = new Worker(o);
a.postMessage = r(a.webkitPostMessage, a.postMessage); var c = { loaderConfig: {}, workerModule: d._workerModulePrefix + n._workerName }; if (i(e.toUrl)) { var h = new s("..").resolve(new s(t("Workers/cesiumWorkerBootstrapper.js"))).toString();
c.loaderConfig.baseUrl = h } else c.loaderConfig.paths = { Workers: t("Workers") };
a.postMessage(c), a.onmessage = function(e) { l(n, e) }, n._worker = a } var h, d = function(e, t) { this._workerName = e, this._maximumActiveTasks = r(t, 5), this._activeTasks = 0, this._deferreds = {}, this._nextID = 0 }; return d.prototype.scheduleTask = function(e, t) { if (i(this._worker) || c(this), this._activeTasks >= this._maximumActiveTasks) return void 0;++this._activeTasks; var r = this._nextID++,
n = a.defer(); return this._deferreds[r] = n, this._worker.postMessage({ id: r, parameters: e }, t), n.promise }, d.prototype.isDestroyed = function() { return !1 }, d.prototype.destroy = function() { return i(this._worker) && this._worker.terminate(), n(this) }, d._defaultWorkerModulePrefix = "Workers/", d._workerModulePrefix = d._defaultWorkerModulePrefix, d }), r("Core/TimeIntervalCollection", ["./defined", "./DeveloperError", "./binarySearch", "./TimeInterval", "./JulianDate"], function(e, t, r, i, n) { "use strict";
function o(e, t) { return n.compare(e.start, t.start) }
function a(t, r, i, n) { for (var o = 0, a = 0, l = new s, u = t._intervals, c = r._intervals; o < u.length && a < c.length;) { var h = u[o],
d = c[a]; if (h.stop.lessThan(d.start)) ++o;
else if (d.stop.lessThan(h.start)) ++a;
else { if (e(n) || e(i) && i(h, d) || !e(i) && d.data === h.data) { var m = h.intersect(d, n);
m.isEmpty || l.addInterval(m, i) } h.stop.lessThan(d.stop) || h.stop.equals(d.stop) && !h.isStopIncluded && d.isStopIncluded ? ++o : ++a } } return l } var s = function() { this._intervals = [] }; return s.prototype.get = function(e) { if (isNaN(e)) throw new t("index must be a number."); return this._intervals[e] }, s.prototype.getStart = function() { var e = this._intervals; return 0 === e.length ? void 0 : e[0].start }, s.prototype.getStop = function() { var e = this._intervals,
t = e.length; return 0 === t ? void 0 : e[t - 1].stop }, s.prototype.getLength = function() { return this._intervals.length }, s.prototype.clear = function() { this._intervals = [] }, s.prototype.isEmpty = function() { return 0 === this._intervals.length }, s.prototype.findIntervalContainingDate = function(e) { var t = this.indexOf(e); return t >= 0 ? this._intervals[t] : void 0 }, s.prototype.findDataForIntervalContainingDate = function(e) { var t = this.indexOf(e); return t >= 0 ? this._intervals[t].data : void 0 }, s.prototype.contains = function(e) { return this.indexOf(e) >= 0 }, s.prototype.indexOf = function(n) { if (!e(n)) throw new t("date required"); var a = this._intervals,
s = r(a, new i(n, n, !0, !0), o); return s >= 0 ? a[s].isStartIncluded ? s : s > 0 && a[s - 1].stop.equals(n) && a[s - 1].isStopIncluded ? s - 1 : ~s : (s = ~s, s > 0 && s - 1 < a.length && a[s - 1].contains(n) ? s - 1 : ~s) }, s.prototype.findInterval = function(t, r, i, n) { for (var o, a = this._intervals, s = 0, l = a.length; l > s; s++)
if (o = a[s], !(e(t) && !o.start.equals(t) || e(r) && !o.stop.equals(r) || e(i) && o.isStartIncluded !== i || e(n) && o.isStopIncluded !== n)) return a[s]; return void 0 }, s.prototype.addInterval = function(a, s) { if (!e(a)) throw new t("interval is required"); if (!a.isEmpty) { var l, u, c = this._intervals; if (0 === c.length || a.start.greaterThan(c[c.length - 1].stop)) return c.push(a), void 0; for (u = r(c, a, o), 0 > u ? u = ~u : u > 0 && a.isStartIncluded && c[u - 1].isStartIncluded && c[u - 1].start.equals(a.start) ? --u : u < c.length && !a.isStartIncluded && c[u].isStartIncluded && c[u].start.equals(a.start) && ++u, u > 0 && (l = n.compare(c[u - 1].stop, a.start), (l > 0 || 0 === l && (c[u - 1].isStopIncluded || a.isStartIncluded)) && ((e(s) ? s(c[u - 1].data, a.data) : c[u - 1].data === a.data) ? (a = a.stop.greaterThan(c[u - 1].stop) ? new i(c[u - 1].start, a.stop, c[u - 1].isStartIncluded, a.isStopIncluded, a.data) : new i(c[u - 1].start, c[u - 1].stop, c[u - 1].isStartIncluded, c[u - 1].isStopIncluded || a.stop.equals(c[u - 1].stop) && a.isStopIncluded, a.data), c.splice(u - 1, 1), --u) : (l = n.compare(c[u - 1].stop, a.stop), l > 0 || 0 === l && c[u - 1].isStopIncluded && !a.isStopIncluded ? c.splice(u - 1, 1, new i(c[u - 1].start, a.start, c[u - 1].isStartIncluded, !a.isStartIncluded, c[u - 1].data), new i(a.stop, c[u - 1].stop, !a.isStopIncluded, c[u - 1].isStopIncluded, c[u - 1].data)) : c[u - 1] = new i(c[u - 1].start, a.start, c[u - 1].isStartIncluded, !a.isStartIncluded, c[u - 1].data)))); u < c.length && (l = n.compare(a.stop, c[u].start), l > 0 || 0 === l && (a.isStopIncluded || c[u].isStartIncluded));)
if (e(s) ? s(c[u].data, a.data) : c[u].data === a.data) a = new i(a.start, c[u].stop.greaterThan(a.stop) ? c[u].stop : a.stop, a.isStartIncluded, c[u].stop.greaterThan(a.stop) ? c[u].isStopIncluded : a.isStopIncluded, a.data), c.splice(u, 1);
else { if (c[u] = new i(a.stop, c[u].stop, !a.isStopIncluded, c[u].isStopIncluded, c[u].data), !c[u].isEmpty) break;
c.splice(u, 1) }
c.splice(u, 0, a) } }, s.prototype.removeInterval = function(n) { if (!e(n)) throw new t("interval is required"); if (n.isEmpty) return !1; var a = !1,
s = this._intervals,
l = r(s, n, o);
0 > l && (l = ~l); var u = n.start,
c = n.stop,
h = n.isStartIncluded,
d = n.isStopIncluded; if (l > 0) { var m = s[l - 1],
p = m.stop;
(p.greaterThan(u) || p.equals(u) && m.isStopIncluded && h) && (a = !0, (p.greaterThan(c) || m.isStopIncluded && !d && p.equals(c)) && s.splice(l, 0, new i(c, p, !d, m.isStopIncluded, m.data)), s[l - 1] = new i(m.start, u, m.isStartIncluded, !h, m.data)) } var f = s[l]; for (l < s.length && !h && f.isStartIncluded && u.equals(f.start) && (a = !0, s.splice(l, 0, new i(f.start, f.start, !0, !0, f.data)), ++l, f = s[l]); l < s.length && c.greaterThan(f.stop);) a = !0, s.splice(l, 1); return l < s.length && c.equals(f.stop) && (a = !0, !d && f.isStopIncluded ? l + 1 < s.length && s[l + 1].start.equals(c) && f.data === s[l + 1].data ? (s.splice(l, 1), s[l] = f = new i(f.start, f.stop, !0, f.isStopIncluded, f.data)) : s[l] = f = new i(c, c, !0, !0, f.data) : s.splice(l, 1)), l < s.length && (c.greaterThan(f.start) || c.equals(f.start) && d && f.isStartIncluded) && (a = !0, s[l] = new i(c, f.stop, !d, f.isStopIncluded, f.data)), a }, s.prototype.intersect = function(r, i, n) { if (!e(r)) throw new t("timeIntervalCollection is required."); return a(this, r, i, n) }, s.prototype.intersectInterval = function(r, i, n) { if (!e(r)) throw new t("interval is required."); var o = new s; return o.addInterval(r), a(this, o, i, n) }, s }), r("Core/WallGeometryLibrary", ["./defined", "./Cartographic", "./Cartesian3", "./DeveloperError", "./EllipsoidTangentPlane", "./PolygonPipeline", "./PolylinePipeline", "./Math", "./WindingOrder"], function(e, t, r, i, n, o, a, s, l) { "use strict";
function u(e, t, i, n, o) { var a, s = r.angleBetween(e, t),
l = Math.ceil(s / o),
u = new Array(l); if (i === n) { for (a = 0; l > a; a++) u[a] = i; return u } var c = n - i,
h = c / l; for (a = 1; l > a; a++) { var d = i + a * h;
u[a] = d } return u[0] = i, u }
function c(e, t) { return s.equalsEpsilon(e.latitude, t.latitude, s.EPSILON6) && s.equalsEpsilon(e.longitude, t.longitude, s.EPSILON6) }
function h(t, r, i, n) { var o = e(n),
a = e(i),
s = [],
l = [],
u = o ? [] : void 0,
h = r.length; if (2 > h) return r.slice(0); var d = r[0];
s.push(d); var f = t.cartesianToCartographic(d, m);
a && (f.height = i[0]), l.push(f.height), o && u.push(n[0]); for (var v = 1; h > v; ++v) { var y = r[v],
g = t.cartesianToCartographic(y, p);
a && (g.height = i[v]), c(f, g) ? f.height < g.height && (l[v - 1] = g.height) : (s.push(y), l.push(g.height), o && u.push(n[v])), f = g.clone(f) } return { positions: s, topHeights: l, bottomHeights: u } } var d = {},
m = new t,
p = new t; return d.computePositions = function(t, r, s, c, d, m) { var p = h(t, r, s, c); if (r = p.positions, s = p.topHeights, c = p.bottomHeights, r.length < 2) throw new i("unique positions must be greater than or equal to 2"); var f = e(c); if (r.length >= 3) { var v = n.fromPoints(r, t),
y = v.projectPointsOntoPlane(r);
o.computeWindingOrder2D(y) === l.CLOCKWISE && (r.reverse(), s.reverse(), f && c.reverse()) } var g, _ = r.length,
w = [],
C = f ? [] : void 0,
x = []; for (g = 0; _ - 1 > g; g++) { var S = r[g],
E = r[g + 1],
b = s[g],
T = s[g + 1];
w = w.concat(u(S, E, b, T, d)), m && w.push(T), f && (S = r[g], E = r[g + 1], b = c[g], T = c[g + 1], C = C.concat(u(S, E, b, T, d)), m && C.push(T)), m && (x = x.concat(a.scaleToSurface([S, E], d, t))) } m || (x = a.scaleToSurface(r, d, t), w.push(s[_ - 1]), f && C.push(c[_ - 1])); var A = f ? a.scaleToGeodeticHeight(x, C, t) : x.slice(0),
M = a.scaleToGeodeticHeight(x, w, t); return { newWallPositions: x, bottomPositions: A, topPositions: M } }, d }), r("Core/WallGeometry", ["./defaultValue", "./defined", "./BoundingSphere", "./Cartesian3", "./ComponentDatatype", "./IndexDatatype", "./DeveloperError", "./Ellipsoid", "./Geometry", "./GeometryAttribute", "./GeometryAttributes", "./Math", "./PrimitiveType", "./VertexFormat", "./WallGeometryLibrary"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p) { "use strict"; var f = new i,
v = new i,
y = new i,
g = new i,
_ = new i,
w = new i,
C = new i,
x = new i,
S = function(r) { r = e(r, e.EMPTY_OBJECT); var i = r.positions,
n = r.maximumHeights,
o = r.minimumHeights; if (!t(i)) throw new a("positions is required."); if (t(n) && n.length !== i.length) throw new a("positions and maximumHeights must have the same length."); if (t(o) && o.length !== i.length) throw new a("positions and minimumHeights must have the same length."); var l = e(r.vertexFormat, m.DEFAULT),
u = e(r.granularity, h.RADIANS_PER_DEGREE),
c = e(r.ellipsoid, s.WGS84);
this._positions = i, this._minimumHeights = o, this._maximumHeights = n, this._vertexFormat = l, this._granularity = u, this._ellipsoid = c, this._workerName = "createWallGeometry" }; return S.fromConstantHeights = function(r) { r = e(r, e.EMPTY_OBJECT); var i = r.positions; if (!t(i)) throw new a("options.positions is required."); var n, o, s = r.minimumHeight,
l = r.maximumHeight,
u = t(s),
c = t(l); if (u || c) { var h = i.length;
n = u ? new Array(h) : void 0, o = c ? new Array(h) : void 0; for (var d = 0; h > d; ++d) u && (n[d] = s), c && (o[d] = l) } var m = { positions: i, maximumHeights: o, minimumHeights: n, ellipsoid: r.ellipsoid, vertexFormat: r.vertexFormat }; return new S(m) }, S.createGeometry = function(e) { var t = e._positions,
a = e._minimumHeights,
s = e._maximumHeights,
m = e._vertexFormat,
S = e._granularity,
E = e._ellipsoid,
b = p.computePositions(E, t, s, a, S, !0),
T = b.newWallPositions,
A = b.bottomPositions,
M = b.topPositions,
P = T.length,
D = 2 * P,
I = m.position ? new Float64Array(D) : void 0,
O = m.normal ? new Float32Array(D) : void 0,
R = m.tangent ? new Float32Array(D) : void 0,
L = m.binormal ? new Float32Array(D) : void 0,
z = m.st ? new Float32Array(2 * (D / 3)) : void 0,
N = 0,
F = 0,
B = 0,
V = 0,
q = 0,
k = x,
U = C,
W = w,
G = !0;
P /= 3; var H; for (H = 0; P > H; ++H) { var j = 3 * H,
Y = i.fromArray(M, j, f),
X = i.fromArray(A, j, v); if (m.position && (I[N++] = X.x, I[N++] = X.y, I[N++] = X.z, I[N++] = Y.x, I[N++] = Y.y, I[N++] = Y.z), m.normal || m.tangent || m.binormal) { var Z, K, J = i.fromArray(T, j, v); if (P > H + 1 && (Z = i.fromArray(T, j + 3, y), K = i.fromArray(M, j + 3, _)), G) { var Q = K.subtract(Y, g),
$ = J.subtract(Y, f);
k = i.cross($, Q, k).normalize(k), G = !1 } Z.equalsEpsilon(J, h.EPSILON6) ? G = !0 : (m.tangent && (U = Z.subtract(J, U).normalize(U)), m.binormal && (W = i.cross(k, U, W).normalize(W))), m.normal && (O[F++] = k.x, O[F++] = k.y, O[F++] = k.z, O[F++] = k.x, O[F++] = k.y, O[F++] = k.z), m.tangent && (R[V++] = U.x, R[V++] = U.y, R[V++] = U.z, R[V++] = U.x, R[V++] = U.y, R[V++] = U.z), m.binormal && (L[B++] = W.x, L[B++] = W.y, L[B++] = W.z, L[B++] = W.x, L[B++] = W.y, L[B++] = W.z) } if (m.st) { var et = H / (P - 1);
z[q++] = et, z[q++] = 0, z[q++] = et, z[q++] = 1 } } var tt = new c;
m.position && (tt.position = new u({ componentDatatype: n.DOUBLE, componentsPerAttribute: 3, values: I })), m.normal && (tt.normal = new u({ componentDatatype: n.FLOAT, componentsPerAttribute: 3, values: O })), m.tangent && (tt.tangent = new u({ componentDatatype: n.FLOAT, componentsPerAttribute: 3, values: R })), m.binormal && (tt.binormal = new u({ componentDatatype: n.FLOAT, componentsPerAttribute: 3, values: L })), m.st && (tt.st = new u({ componentDatatype: n.FLOAT, componentsPerAttribute: 2, values: z })); var rt = D / 3;
D -= 6; var it = o.createTypedArray(rt, D),
nt = 0; for (H = 0; rt - 2 > H; H += 2) { var ot = H,
at = H + 2,
st = i.fromArray(I, 3 * ot, f),
lt = i.fromArray(I, 3 * at, v); if (!i.equalsEpsilon(st, lt, h.EPSILON6)) { var ut = H + 1,
ct = H + 3;
it[nt++] = ut, it[nt++] = ot, it[nt++] = ct, it[nt++] = ct, it[nt++] = ot, it[nt++] = at } } return new l({ attributes: tt, indices: it, primitiveType: d.TRIANGLES, boundingSphere: new r.fromVertices(I) }) }, S }), r("Core/WallOutlineGeometry", ["./defaultValue", "./defined", "./BoundingSphere", "./Cartesian3", "./Cartographic", "./ComponentDatatype", "./IndexDatatype", "./DeveloperError", "./Ellipsoid", "./Geometry", "./GeometryAttribute", "./GeometryAttributes", "./Math", "./PrimitiveType", "./WallGeometryLibrary"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p) { "use strict"; var f = new i,
v = new i,
y = function(r) { r = e(r, e.EMPTY_OBJECT); var i = r.positions,
n = r.maximumHeights,
o = r.minimumHeights; if (!t(i)) throw new s("positions is required."); if (t(n) && n.length !== i.length) throw new s("positions and maximumHeights must have the same length."); if (t(o) && o.length !== i.length) throw new s("positions and minimumHeights must have the same length."); var a = e(r.granularity, d.RADIANS_PER_DEGREE),
u = e(r.ellipsoid, l.WGS84);
this._positions = i, this._minimumHeights = o, this._maximumHeights = n, this._granularity = a, this._ellipsoid = u, this._workerName = "createWallOutlineGeometry" }; return y.fromConstantHeights = function(r) { r = e(r, e.EMPTY_OBJECT); var i = r.positions; if (!t(i)) throw new s("options.positions is required."); var n, o, a = r.minimumHeight,
l = r.maximumHeight,
u = t(a),
c = t(l); if (u || c) { var h = i.length;
n = u ? new Array(h) : void 0, o = c ? new Array(h) : void 0; for (var d = 0; h > d; ++d) u && (n[d] = a), c && (o[d] = l) } var m = { positions: i, maximumHeights: o, minimumHeights: n, ellipsoid: r.ellipsoid }; return new y(m) }, y.createGeometry = function(e) { var t = e._positions,
n = e._minimumHeights,
s = e._maximumHeights,
l = e._granularity,
y = e._ellipsoid,
g = p.computePositions(y, t, s, n, l, !1),
_ = g.newWallPositions,
w = g.bottomPositions,
C = g.topPositions,
x = _.length,
S = 2 * x,
E = new Float64Array(S),
b = 0;
x /= 3; var T; for (T = 0; x > T; ++T) { var A = 3 * T,
M = i.fromArray(C, A, f),
P = i.fromArray(w, A, v);
E[b++] = P.x, E[b++] = P.y, E[b++] = P.z, E[b++] = M.x, E[b++] = M.y, E[b++] = M.z } var D = new h({ position: new c({ componentDatatype: o.DOUBLE, componentsPerAttribute: 3, values: E }) }),
I = S / 3;
S = 2 * I - 4 + I; var O = a.createTypedArray(I, S),
R = 0; for (T = 0; I - 2 > T; T += 2) { var L = T,
z = T + 2,
N = i.fromArray(E, 3 * L, f),
F = i.fromArray(E, 3 * z, v); if (!i.equalsEpsilon(N, F, d.EPSILON6)) { var B = T + 1,
V = T + 3;
O[R++] = B, O[R++] = L, O[R++] = B, O[R++] = V, O[R++] = L, O[R++] = z } } return O[R++] = I - 2, O[R++] = I - 1, new u({ attributes: D, indices: O, primitiveType: m.LINES, boundingSphere: new r.fromVertices(E) }) }, y }), r("Core/WebMercatorProjection", ["./defaultValue", "./defined", "./Cartesian3", "./Cartographic", "./Math", "./Ellipsoid"], function(e, t, r, i, n, o) { "use strict"; var a = function(t) { this._ellipsoid = e(t, o.WGS84), this._semimajorAxis = this._ellipsoid.getMaximumRadius(), this._oneOverSemimajorAxis = 1 / this._semimajorAxis }; return a.mercatorAngleToGeodeticLatitude = function(e) { return n.PI_OVER_TWO - 2 * Math.atan(Math.exp(-e)) }, a.geodeticLatitudeToMercatorAngle = function(e) { e > a.MaximumLatitude ? e = a.MaximumLatitude : e < -a.MaximumLatitude && (e = -a.MaximumLatitude); var t = Math.sin(e); return .5 * Math.log((1 + t) / (1 - t)) }, a.MaximumLatitude = a.mercatorAngleToGeodeticLatitude(Math.PI), a.prototype.getEllipsoid = function() { return this._ellipsoid }, a.prototype.project = function(e, i) { var n = this._semimajorAxis,
o = e.longitude * n,
s = a.geodeticLatitudeToMercatorAngle(e.latitude) * n,
l = e.height; return t(i) ? (i.x = o, i.y = s, i.z = l, i) : new r(o, s, l) }, a.prototype.unproject = function(e, r) { var n = this._oneOverSemimajorAxis,
o = e.x * n,
s = a.mercatorAngleToGeodeticLatitude(e.y * n),
l = e.z; return t(r) ? (r.longitude = o, r.latitude = s, r.height = l, r) : new i(o, s, l) }, a }), r("Core/cancelAnimationFrame", ["./defined"], function(e) { "use strict"; var t = window.cancelAnimationFrame;! function() { if (!e(t))
for (var r = ["webkit", "moz", "ms", "o"], i = 0, n = r.length; n > i && !e(t);) t = window[r[i] + "CancelAnimationFrame"], e(t) || (t = window[r[i] + "CancelRequestAnimationFrame"]), ++i;
e(t) || (t = clearTimeout) }(); var r = function(e) { t(e) }; return r }), r("Core/combine", ["./DeveloperError", "./defaultValue", "./defined"], function(e, t, r) {
"use strict";
var i = function(e, r, i) { r = t(r, !0), i = t(i, !0); for (var o = {}, a = 0; a < e.length; a++) n(o, e[a], r, i); return o },
n = function(t, i, o, a) {
for (var s in i)
if (i.hasOwnProperty(s))
if (t.hasOwnProperty(s) && r(t[s])) {
if (!a) throw new e("Duplicate member: " + s);
o && "object" == typeof t[s] && "object" == typeof i[s] && n(t[s], i[s], o, a)
} else t[s] = i[s]
};
return i
}), r("Core/createGuid", [], function() { "use strict"; var e = function() { return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function(e) { var t = 0 | 16 * Math.random(),
r = "x" === e ? t : 8 | 3 & t; return r.toString(16) }) }; return e }), r("Core/defineProperties", ["./defined"], function(e) { "use strict"; var t = function() { try { return "x" in Object.defineProperty({}, "x", {}) } catch (e) { return !1 } }(),
r = Object.defineProperties; return t && e(r) || (r = function(e) { return e }), r }), r("Core/getImagePixels", ["./defined"], function(e) { "use strict"; var t = {},
r = function(r, i, n) { e(i) || (i = r.width), e(n) || (n = r.height); var o = t[i];
e(o) || (o = {}, t[i] = o); var a = o[n]; if (!e(a)) { var s = document.createElement("canvas");
s.width = i, s.height = n, a = s.getContext("2d"), a.globalCompositeOperation = "copy", o[n] = a } return a.drawImage(r, 0, 0, i, n), a.getImageData(0, 0, i, n).data }; return r }), r("Core/jsonp", ["./defaultValue", "./defined", "./DeveloperError", "../ThirdParty/when"], function(e, t, r, i) { "use strict";
function n(e, t, r) { e.push(encodeURIComponent(t) + "=" + encodeURIComponent(r)) } var o = function(a, s) { if (!t(a)) throw new r("url is required.");
s = e(s, e.EMPTY_OBJECT); var l, u = i.defer();
do l = "jsonp" + Math.random().toString().substring(2, 8); while (t(window[l]));
window[l] = function(e) { u.resolve(e); try { delete window[l] } catch (t) { window[l] = void 0 } }; var c = e(s.callbackParameterName, "callback"),
h = [];
n(h, c, l); var d = e(s.parameters, e.EMPTY_OBJECT); for (var m in d) d.hasOwnProperty(m) && n(h, m, d[m]);
h.length > 0 && (a += -1 === a.indexOf("?") ? "?" : "&", a += h.join("&")); var p = s.proxy; return t(p) && (a = p.getURL(a)), o.loadAndExecuteScript(a, l, u), u.promise }; return o.loadAndExecuteScript = function(e, t, r) { var i = document.createElement("script");
i.async = !0, i.src = e; var n = document.getElementsByTagName("head")[0];
i.onload = function() { i.onload = void 0, n.removeChild(i) }, i.onerror = function(e) { r.reject(e) }, n.appendChild(i) }, o.defaultLoadAndExecuteScript = o.loadAndExecuteScript, o }), r("Core/loadArrayBuffer", ["./loadWithXhr"], function(e) { "use strict"; var t = function(t, r) { return e(t, "arraybuffer", r) }; return t }), r("Core/loadBlob", ["./loadWithXhr"], function(e) { "use strict"; var t = function(t, r) { return e(t, "blob", r) }; return t }), r("Core/loadImage", ["./defaultValue", "./defined", "./DeveloperError", "./isCrossOriginUrl", "../ThirdParty/when"], function(e, t, r, i, n) { "use strict"; var o = /^data:/,
a = function(s, l) { if (!t(s)) throw new r("url is required."); return l = e(l, !0), n(s, function(e) { var t;
t = o.test(e) || !l ? !1 : i(e); var r = n.defer(); return a.createImage(e, t, r), r.promise }) }; return a.createImage = function(e, t, r) { var i = new Image;
i.onload = function() { r.resolve(i) }, i.onerror = function(e) { r.reject(e) }, t && (i.crossOrigin = ""), i.src = e }, a.defaultCreateImage = a.createImage, a }), r("Core/loadImageViaBlob", ["./loadBlob", "./loadImage"], function(e, t) { "use strict"; var r = /^data:/,
i = function(i) { return r.test(i) ? t(i) : e(i).then(function(e) { var r = window.URL.createObjectURL(e); return t(r, !1).then(function(t) { return t.blob = e, window.URL.revokeObjectURL(r), t }, function(e) { return window.URL.revokeObjectURL(r), e }) }) },
n = function() { try { var e = new XMLHttpRequest; return e.open("GET", "#", !0), e.responseType = "blob", "blob" === e.responseType } catch (t) { return !1 } }(); return n ? i : t }), r("Core/loadXML", ["./defined", "./DeveloperError", "./RequestErrorEvent", "../ThirdParty/when"], function(e, t, r, i) { "use strict"; var n = function(r, o) { if (!e(r)) throw new t("url is required."); return i(r, function(e) { var t = i.defer(); return n.loadXML(e, o, t), t.promise }) }; return n.loadXML = function(t, i, n) { var o = new XMLHttpRequest; if (o.overrideMimeType("text/xml"), o.open("GET", t, !0), e(i))
for (var a in i) i.hasOwnProperty(a) && o.setRequestHeader(a, i[a]);
o.onload = function() { 200 === o.status ? n.resolve(o.responseXML) : n.reject(new r(o.status, o.response)) }, o.onerror = function() { n.reject(new r) }, o.send() }, n.defaultLoadXML = n.loadXML, n }), r("Core/requestAnimationFrame", ["./defined"], function(e) { "use strict"; var t = window.requestAnimationFrame;! function() { if (!e(t))
for (var r = ["webkit", "moz", "ms", "o"], i = 0, n = r.length; n > i && !e(t);) t = window[r[i] + "RequestAnimationFrame"], ++i; if (!e(t)) { var o = 0;
t = function(e) { var t = Date.now(),
r = Math.max(16 - (t - o), 0); return o = t + r, setTimeout(function() { e(o) }, r) } } }(); var r = function(e) { return t(e) }; return r }), r("Core/throttleRequestByServer", ["./defaultValue", "./defined", "../ThirdParty/when"], function(e, t, r) { "use strict";
function i(e) { return t(o) || (o = document.createElement("a")), o.href = e, o.hostname + "%" + o.port }
function n(t, n) { var o = i(t),
l = e(s[o], 0); return l > a ? void 0 : (s[o] = l + 1, r(n(t), function(e) { return s[o]--, e }, function(e) { return s[o]--, r.reject(e) })) } var o, a = 6,
s = {}; return n }), r("Core/wrapFunction", ["./DeveloperError"], function(e) { "use strict"; var t = function(t, r, i) { if ("function" != typeof r) throw new e("oldFunction is required to be a function."); if ("function" != typeof i) throw new e("oldFunction is required to be a function."); return function() { i.apply(t, arguments), r.apply(t, arguments) } }; return t }), r("ThirdParty/measureText", [], function() { var e = function(e, t) { return document.defaultView.getComputedStyle(e, null).getPropertyValue(t) },
t = function(t, r, i, n) { var o = t.measureText(r),
a = e(t.canvas, "font-family"),
s = e(t.canvas, "font-size").replace("px", ""),
l = !/\S/.test(r);
o.fontsize = s; var u = document.createElement("div");
u.style.position = "absolute", u.style.opacity = 0, u.style.font = s + "px " + a, u.innerHTML = r + " " + r, document.body.appendChild(u), o.leading = 1.2 * s; var c = e(u, "height"); if (c = c.replace("px", ""), c >= 2 * s && (o.leading = 0 | c / 2), document.body.removeChild(u), l) o.ascent = 0, o.descent = 0, o.bounds = { minx: 0, maxx: o.width, miny: 0, maxy: 0 }, o.height = 0;
else { var h = document.createElement("canvas"),
d = 100;
h.width = o.width + d, h.height = 3 * s, h.style.opacity = 1, h.style.fontFamily = a, h.style.fontSize = s; var m = h.getContext("2d");
m.font = s + "px " + a; var p = h.width,
f = h.height,
v = f / 2;
m.fillStyle = "white", m.fillRect(-1, -1, p + 2, f + 2), i && (m.strokeStyle = "black", m.lineWidth = t.lineWidth, m.strokeText(r, d / 2, v)), n && (m.fillStyle = "black", m.fillText(r, d / 2, v)); for (var y = m.getImageData(0, 0, p, f).data, g = 0, _ = 4 * p, w = y.length; ++g < w && 255 === y[g];); var C = 0 | g / _; for (g = w - 1; --g > 0 && 255 === y[g];); var x = 0 | g / _; for (g = 0; w > g && 255 === y[g];) g += _, g >= w && (g = g - w + 4); var S = 0 | g % _ / 4,
E = 1; for (g = w - 3; g >= 0 && 255 === y[g];) g -= _, 0 > g && (g = w - 3 - 4 * E++); var b = 0 | g % _ / 4 + 1;
o.ascent = v - C, o.descent = x - v, o.bounds = { minx: S - d / 2, maxx: b - d / 2, miny: 0, maxy: x - C }, o.height = 1 + (x - C) } return o }; return t }), r("Core/writeTextToCanvas", ["./defaultValue", "./defined", "./DeveloperError", "./Color", "../ThirdParty/measureText"], function(e, t, r, i, n) { "use strict"; var o = function(o, a) { if (!t(o)) throw new r("text is required."); if ("" === o) return void 0;
a = e(a, e.EMPTY_OBJECT); var s = e(a.font, "10px sans-serif"),
l = document.createElement("canvas");
l.width = l.height = 1, l.style.font = s; var u = l.getContext("2d");
u.font = s, u.textBaseline = e(a.textBaseline, "bottom"), l.style.visibility = "hidden", document.body.appendChild(l); var c = e(a.stroke, !1),
h = e(a.fill, !0),
d = 2 * e(a.strokeWidth, 1);
u.lineWidth = d; var m = n(u, o, c, h);
l.dimensions = m, document.body.removeChild(l), l.style.visibility = ""; var p = m.height - m.ascent;
l.width = m.width, l.height = m.height; var f = l.height - p; if (u.font = s, c) { var v = e(a.strokeColor, i.BLACK);
u.strokeStyle = v.toCssColorString(), u.lineWidth = d, u.strokeText(o, 0, f) } if (h) { var y = e(a.fillColor, i.WHITE);
u.fillStyle = y.toCssColorString(), u.fillText(o, 0, f) } return l }; return o }), r("DynamicScene/ConstantProperty", ["../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/Enumeration"], function(e, t, r, i) { "use strict";
function n(e, t) { return e.clone(t) }
function o(e) { return e } var a = function(a, s) { if (!t(a)) throw new r("value is required."); if (!("object" != typeof a || Array.isArray(a) || a instanceof i)) { if ("function" != typeof a.clone && "function" != typeof s) throw new r("clone is a required function.");
s = e(s, n) } this._value = a, this._clone = e(s, o) }; return a.prototype.getValue = function(e, t) { return this._clone(this._value, t) }, a }), r("DynamicScene/ColorMaterialProperty", ["../Core/Color", "../Core/defined", "./ConstantProperty"], function(e, t, r) { "use strict"; var i = function() { this.color = new r(e.WHITE) }; return i.prototype.getType = function() { return "Color" }, i.prototype.getValue = function(e, r) { return t(r) || (r = {}), r.color = t(this.color) ? this.color.getValue(e, r.color) : void 0, r }, i }), r("DynamicScene/DynamicObject", ["../Core/createGuid", "../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/JulianDate", "../Core/TimeInterval"], function(e, t, r, i, n, o) { "use strict"; var a = function(t) { this._cachedAvailabilityDate = void 0, this._cachedAvailabilityValue = void 0, r(t) || (t = e()), this.id = t, this.availability = void 0, this.position = void 0, this.orientation = void 0, this.billboard = void 0, this.cone = void 0, this.ellipsoid = void 0, this.ellipse = void 0, this.label = void 0, this.path = void 0, this.point = void 0, this.polygon = void 0, this.polyline = void 0, this.pyramid = void 0, this.vertexPositions = void 0, this.vector = void 0, this.viewFrom = void 0 }; return a.prototype.isAvailable = function(e) { if (!r(e)) throw new i("time is required."); var t = this.availability; if (!r(t)) return !0; if (n.equals(this._cachedAvailabilityDate, e)) return this._cachedAvailabilityValue; var o = t.contains(e); return this._cachedAvailabilityDate = n.clone(e, this._cachedAvailabilityDate), this._cachedAvailabilityValue = o, o }, a.prototype.merge = function(e) { if (!r(e)) throw new i("other is required"); for (var n in e) e.hasOwnProperty(n) && (this[n] = t(this[n], e[n])) }, a.mergeProperties = function(e, i) { e.position = t(e.position, i.position), e.orientation = t(e.orientation, i.orientation), e.vertexPositions = t(e.vertexPositions, i.vertexPositions), e.viewFrom = t(e.viewFrom, i.viewFrom); var n = i.availability;
r(n) && e._setAvailability(n) }, a.undefineProperties = function(e) { e.position = void 0, e.orientation = void 0, e.vertexPositions = void 0, e.viewFrom = void 0, e._setAvailability(void 0) }, a.prototype._setAvailability = function(e) { var t = !o.equals(this.availability, e); return this.availability = e, this._cachedAvailabilityDate = void 0, this._cachedAvailabilityValue = void 0, t }, a }), r("DynamicScene/DynamicBillboard", ["../Core/defaultValue", "../Core/defined"], function(e, t) { "use strict"; var r = function() { this.image = void 0, this.scale = void 0, this.rotation = void 0, this.alignedAxis = void 0, this.horizontalOrigin = void 0, this.verticalOrigin = void 0, this.color = void 0, this.eyeOffset = void 0, this.pixelOffset = void 0, this.show = void 0 }; return r.mergeProperties = function(i, n) { var o = n.billboard; if (t(o)) { var a = i.billboard;
t(a) || (i.billboard = a = new r), a.color = e(a.color, o.color), a.eyeOffset = e(a.eyeOffset, o.eyeOffset), a.horizontalOrigin = e(a.horizontalOrigin, o.horizontalOrigin), a.image = e(a.image, o.image), a.pixelOffset = e(a.pixelOffset, o.pixelOffset), a.scale = e(a.scale, o.scale), a.rotation = e(a.rotation, o.rotation), a.alignedAxis = e(a.alignedAxis, o.alignedAxis), a.show = e(a.show, o.show), a.verticalOrigin = e(a.verticalOrigin, o.verticalOrigin) } }, r.undefineProperties = function(e) { e.billboard = void 0 }, r }), r("DynamicScene/DynamicClock", ["../Core/Iso8601", "../Core/ClockRange", "../Core/ClockStep", "../Core/defined"], function(e, t, r, i) { "use strict"; var n = function() { this.startTime = e.MAXIMUM_INTERVAL.start, this.stopTime = e.MAXIMUM_INTERVAL.stop, this.currentTime = e.MAXIMUM_INTERVAL.start, this.clockRange = t.LOOP_STOP, this.clockStep = r.SYSTEM_CLOCK_MULTIPLIER, this.multiplier = 1 }; return n.prototype.clone = function(e) { return i(e) || (e = new n), e.startTime = this.startTime, e.stopTime = this.stopTime, e.clockRange = this.clockRange, e.clockStep = this.clockStep, e.multiplier = this.multiplier, e.currentTime = this.currentTime, e }, n.mergeProperties = function(e, t) { var r = t.clock; if (i(r)) { var o = e.clock;
i(o) || (o = new n, e.clock = o), o.startTime = r.startTime, o.stopTime = r.stopTime, o.currentTime = r.currentTime, o.clockRange = r.clockRange, o.clockStep = r.clockStep, o.multiplier = r.multiplier } }, n.undefineProperties = function(e) { e.clock = void 0 }, n }), r("DynamicScene/DynamicEllipse", ["../Core/defaultValue", "../Core/defined", "../Core/Cartesian3", "../Core/Ellipsoid", "../Core/Shapes"], function(e, t, r, i, n) { "use strict"; var o = function() { this.semiMajorAxis = void 0, this.semiMinorAxis = void 0, this.bearing = void 0, this._lastPosition = void 0, this._lastSemiMajorAxis = void 0, this._lastSemiMinorAxis = void 0, this._lastBearing = void 0, this._cachedVertexPositions = void 0 }; return o.mergeProperties = function(r, i) { var n = i.ellipse; if (t(n)) { var a = r.ellipse;
t(a) || (r.ellipse = a = new o), a.bearing = e(a.bearing, n.bearing), a.semiMajorAxis = e(a.semiMajorAxis, n.semiMajorAxis), a.semiMinorAxis = e(a.semiMinorAxis, n.semiMinorAxis) } }, o.undefineProperties = function(e) { e.ellipse = void 0 }, o.prototype.getValue = function(e, o) { var a = this.semiMajorAxis,
s = this.semiMinorAxis; if (!t(o) || !t(a) || !t(s)) return void 0; var l = a.getValue(e),
u = s.getValue(e),
c = 0,
h = this.bearing; if (t(h) && (c = h.getValue(e)), !t(l) || !t(u) || 0 === l || 0 === u) return void 0; var d = this._lastPosition,
m = this._lastSemiMajorAxis,
p = this._lastSemiMinorAxis,
f = this._lastBearing; return c === f && m === l && p === u && r.equals(d, o) || (this._cachedVertexPositions = n.computeEllipseBoundary(i.WGS84, o, l, u, c), this._lastPosition = r.clone(o, this._lastPosition), this._lastBearing = c, this._lastSemiMajorAxis = l, this._lastSemiMinorAxis = u), this._cachedVertexPositions }, o }), r("DynamicScene/DynamicEllipsoid", ["../Core/defaultValue", "../Core/defined"], function(e, t) { "use strict"; var r = function() { this.show = void 0, this.radii = void 0, this.material = void 0 }; return r.mergeProperties = function(i, n) { var o = n.ellipsoid; if (t(o)) { var a = i.ellipsoid;
t(a) || (i.ellipsoid = a = new r), a.show = e(a.show, o.show), a.radii = e(a.radii, o.radii), a.material = e(a.material, o.material) } }, r.undefineProperties = function(e) { e.ellipsoid = void 0 }, r }), r("DynamicScene/DynamicCone", ["../Core/defaultValue", "../Core/defined"], function(e, t) { "use strict"; var r = function() { this.minimumClockAngle = void 0, this.maximumClockAngle = void 0, this.innerHalfAngle = void 0, this.outerHalfAngle = void 0, this.capMaterial = void 0, this.innerMaterial = void 0, this.outerMaterial = void 0, this.silhouetteMaterial = void 0, this.intersectionColor = void 0, this.intersectionWidth = void 0, this.showIntersection = void 0, this.radius = void 0, this.show = void 0 }; return r.mergeProperties = function(i, n) { var o = n.cone; if (t(o)) { var a = i.cone;
t(a) || (i.cone = a = new r), a.show = e(a.show, o.show), a.innerHalfAngle = e(a.innerHalfAngle, o.innerHalfAngle), a.outerHalfAngle = e(a.outerHalfAngle, o.outerHalfAngle), a.minimumClockAngle = e(a.minimumClockAngle, o.minimumClockAngle), a.maximumClockAngle = e(a.maximumClockAngle, o.maximumClockAngle), a.radius = e(a.radius, o.radius), a.showIntersection = e(a.showIntersection, o.showIntersection), a.intersectionColor = e(a.intersectionColor, o.intersectionColor), a.intersectionWidth = e(a.intersectionWidth, o.intersectionWidth), a.capMaterial = e(a.capMaterial, o.capMaterial), a.innerMaterial = e(a.innerMaterial, o.innerMaterial), a.outerMaterial = e(a.outerMaterial, o.outerMaterial), a.silhouetteMaterial = e(a.silhouetteMaterial, o.silhouetteMaterial) } }, r.undefineProperties = function(e) { e.cone = void 0 }, r }), r("DynamicScene/DynamicLabel", ["../Core/defaultValue", "../Core/defined"], function(e, t) { "use strict"; var r = function() { this.text = void 0, this.font = void 0, this.style = void 0, this.fillColor = void 0, this.outlineColor = void 0, this.outlineWidth = void 0, this.horizontalOrigin = void 0, this.verticalOrigin = void 0, this.eyeOffset = void 0, this.pixelOffset = void 0, this.scale = void 0, this.show = void 0 }; return r.mergeProperties = function(i, n) { var o = n.label; if (t(o)) { var a = i.label;
t(a) || (i.label = a = new r), a.text = e(a.text, o.text), a.font = e(a.font, o.font), a.show = e(a.show, o.show), a.style = e(a.style, o.style), a.fillColor = e(a.fillColor, o.fillColor), a.outlineColor = e(a.outlineColor, o.outlineColor), a.outlineWidth = e(a.outlineWidth, o.outlineWidth), a.scale = e(a.scale, o.scale), a.horizontalOrigin = e(a.horizontalOrigin, o.horizontalOrigin), a.verticalOrigin = e(a.verticalOrigin, o.verticalOrigin), a.eyeOffset = e(a.eyeOffset, o.eyeOffset), a.pixelOffset = e(a.pixelOffset, o.pixelOffset) } }, r.undefineProperties = function(e) { e.label = void 0 }, r }), r("DynamicScene/DynamicPath", ["../Core/defaultValue", "../Core/defined"], function(e, t) { "use strict"; var r = function() { this.color = void 0, this.outlineColor = void 0, this.outlineWidth = void 0, this.show = void 0, this.width = void 0, this.resolution = void 0, this.leadTime = void 0, this.trailTime = void 0 }; return r.mergeProperties = function(i, n) { var o = n.path; if (t(o)) { var a = i.path;
t(a) || (i.path = a = new r), a.color = e(a.color, o.color), a.width = e(a.width, o.width), a.resolution = e(a.resolution, o.resolution), a.outlineColor = e(a.outlineColor, o.outlineColor), a.outlineWidth = e(a.outlineWidth, o.outlineWidth), a.show = e(a.show, o.show), a.leadTime = e(a.leadTime, o.leadTime), a.trailTime = e(a.trailTime, o.trailTime) } }, r.undefineProperties = function(e) { e.path = void 0 }, r }), r("DynamicScene/DynamicPoint", ["../Core/defined", "../Core/defaultValue"], function(e, t) { "use strict"; var r = function() { this.color = void 0, this.pixelSize = void 0, this.outlineColor = void 0, this.outlineWidth = void 0, this.show = void 0 }; return r.mergeProperties = function(i, n) { var o = n.point; if (e(o)) { var a = i.point;
e(a) || (i.point = a = new r), a.color = t(a.color, o.color), a.pixelSize = t(a.pixelSize, o.pixelSize), a.outlineColor = t(a.outlineColor, o.outlineColor), a.outlineWidth = t(a.outlineWidth, o.outlineWidth), a.show = t(a.show, o.show) } }, r.undefineProperties = function(e) { e.point = void 0 }, r }), r("DynamicScene/DynamicPolygon", ["../Core/defaultValue", "../Core/defined"], function(e, t) { "use strict"; var r = function() { this.show = void 0, this.material = void 0 }; return r.mergeProperties = function(i, n) { var o = n.polygon; if (t(o)) { var a = i.polygon;
t(a) || (i.polygon = a = new r), a.show = e(a.show, o.show), a.material = e(a.material, o.material) } }, r.undefineProperties = function(e) { e.polygon = void 0 }, r }), r("DynamicScene/DynamicPolyline", ["../Core/defaultValue", "../Core/defined"], function(e, t) { "use strict"; var r = function() { this.color = void 0, this.outlineColor = void 0, this.outlineWidth = void 0, this.show = void 0, this.width = void 0 }; return r.mergeProperties = function(i, n) { var o = n.polyline; if (t(o)) { var a = i.polyline;
t(a) || (i.polyline = a = new r), a.color = e(a.color, o.color), a.width = e(a.width, o.width), a.outlineColor = e(a.outlineColor, o.outlineColor), a.outlineWidth = e(a.outlineWidth, o.outlineWidth), a.show = e(a.show, o.show) } }, r.undefineProperties = function(e) { e.polyline = void 0 }, r }), r("DynamicScene/DynamicPyramid", ["../Core/defaultValue", "../Core/defined"], function(e, t) { "use strict"; var r = function() { this.show = void 0, this.directions = void 0, this.radius = void 0, this.showIntersection = void 0, this.intersectionColor = void 0, this.intersectionWidth = void 0, this.material = void 0 }; return r.mergeProperties = function(i, n) { var o = n.pyramid; if (t(o)) { var a = i.pyramid;
t(a) || (i.pyramid = a = new r), a.show = e(a.show, o.show), a.directions = e(a.directions, o.directions), a.radius = e(a.radius, o.radius), a.showIntersection = e(a.showIntersection, o.showIntersection), a.intersectionColor = e(a.intersectionColor, o.intersectionColor), a.intersectionWidth = e(a.intersectionWidth, o.intersectionWidth), a.material = e(a.material, o.material) } }, r.undefineProperties = function(e) { e.pyramid = void 0 }, r }), r("DynamicScene/DynamicVector", ["../Core/defaultValue", "../Core/defined"], function(e, t) { "use strict"; var r = function() { this.color = void 0, this.show = void 0, this.width = void 0, this.direction = void 0, this.length = void 0 }; return r.mergeProperties = function(i, n) { var o = n.vector; if (t(o)) { var a = i.vector;
t(a) || (i.vector = a = new r), a.color = e(a.color, o.color), a.width = e(a.width, o.width), a.direction = e(a.direction, o.direction), a.length = e(a.length, o.length), a.show = e(a.show, o.show) } }, r.undefineProperties = function(e) { e.vector = void 0 }, r }), r("DynamicScene/CompositeDynamicObjectCollection", ["../Core/defaultValue", "../Core/defined", "../Core/Event", "../Core/Iso8601", "../Core/TimeInterval", "../Core/DeveloperError", "./DynamicObject", "./DynamicBillboard", "./DynamicClock", "./DynamicEllipse", "./DynamicEllipsoid", "./DynamicCone", "./DynamicLabel", "./DynamicPath", "./DynamicPoint", "./DynamicPolygon", "./DynamicPolyline", "./DynamicPyramid", "./DynamicVector"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g) { "use strict";
function _(e, t) { var r = e._hash[t]; return r || (r = new a(t), e._hash[t] = r, e._array.push(r)), r }
function w(e) { var t = e._array;
e._hash = {}, e._array = [], t.length > 0 && e.objectsRemoved.raiseEvent(e, t) } var C = function(t, i, n) { this._hash = {}, this._array = [], this._collections = [], this.mergeFunctions = e(i, C.mergers), this.cleanFunctions = e(n, C.cleaners), this.objectPropertiesChanged = new r, this.objectsRemoved = new r, this.setCollections(t) }; return C.mergers = [l.mergeProperties, s.mergeProperties, u.mergeProperties, c.mergeProperties, h.mergeProperties, d.mergeProperties, m.mergeProperties, p.mergeProperties, f.mergeProperties, v.mergeProperties, y.mergeProperties, g.mergeProperties, a.mergeProperties], C.cleaners = [s.undefineProperties, u.undefineProperties, c.undefineProperties, h.undefineProperties, d.undefineProperties, m.undefineProperties, p.undefineProperties, f.undefineProperties, v.undefineProperties, y.undefineProperties, g.undefineProperties, a.undefineProperties, l.undefineProperties], C.prototype.computeAvailability = function() { for (var e = i.MAXIMUM_VALUE, t = i.MINIMUM_VALUE, r = this._collections, o = 0, a = r.length; a > o; ++o) { var s = r[o],
l = s.computeAvailability(),
u = l.start,
c = l.stop;
u.lessThan(e) && !u.equals(i.MINIMUM_VALUE) && (e = l.start), c.greaterThan(t) && !c.equals(i.MAXIMUM_VALUE) && (t = l.stop) } return i.MAXIMUM_VALUE.equals(e) && (e = i.MINIMUM_VALUE), i.MINIMUM_VALUE.equals(t) && (t = i.MAXIMUM_VALUE), new n(e, t, !0, !0) }, C.prototype.getCollections = function() { return this._collections.slice(0) }, C.prototype.setCollections = function(e) { e = t(e) ? e : []; var r = this._collections; if (e !== r) { var i, n; for (n = r.length - 1; n > -1; n--) i = r[n], i.compositeCollection = void 0, i.objectPropertiesChanged.removeEventListener(C.prototype._onObjectPropertiesChanged, this);
r = this._collections = e, w(this); var o = this.mergeFunctions; for (n = r.length - 1; n > -1; n--) { i = r[n], i.compositeCollection = this, i.objectPropertiesChanged.addEventListener(C.prototype._onObjectPropertiesChanged, this); for (var a = i.getObjects(), s = a.length - 1; s > -1; s--)
for (var l = a[s], u = _(this, l.id), c = o.length - 1; c > -1; c--) { var h = o[c];
h(u, l) } } } }, C.prototype.getObject = function(e) { if (!t(e)) throw new o("id is required."); return this._hash[e] }, C.prototype.getObjects = function() { return this._array }, C.prototype.clear = function() { this.setCollections([]) }, C.prototype._onObjectPropertiesChanged = function(e, r) { for (var i, n, o = this.mergeFunctions, a = this.cleanFunctions, s = this._collections, l = [], u = r.length - 1; u > -1; u--) { if (i = r[u], n = this.getObject(i.id), t(n))
for (var c = a.length - 1; c > -1; c--) { var h = a[c];
h(n) } else n = _(this, i.id);
l.push(n); for (var d = s.length - 1; d > -1; d--) { var m = s[d],
p = m.getObject(i.id); if (t(p))
for (var f = o.length - 1; f > -1; f--) { var v = o[f];
v(n, p) } } } l.length > 0 && this.objectPropertiesChanged.raiseEvent(this, l) }, C }), r("DynamicScene/CompositeMaterialProperty", ["../Core/defined", "../Core/defineProperties", "../Core/DeveloperError", "../Core/TimeIntervalCollection"], function(e, t, r, i) { "use strict"; var n = function() { this._intervals = new i }; return t(n.prototype, { intervals: { get: function() { return this._intervals } } }), n.prototype.getType = function(t) { if (!e(t)) throw new r("time is required"); var i = this._intervals.findDataForIntervalContainingDate(t); return e(i) ? i.getType(t) : void 0 }, n.prototype.getValue = function(t, i) { if (!e(t)) throw new r("time is required"); var n = this._intervals.findDataForIntervalContainingDate(t); return e(n) ? n.getValue(t, i) : void 0 }, n }), r("DynamicScene/CompositePositionProperty", ["../Core/defaultValue", "../Core/defined", "../Core/defineProperties", "../Core/DeveloperError", "../Core/TimeIntervalCollection", "../Core/ReferenceFrame"], function(e, t, r, i, n, o) { "use strict"; var a = function(t) { this._intervals = new n, this._referenceFrame = e(t, o.FIXED) }; return r(a.prototype, { intervals: { get: function() { return this._intervals } }, referenceFrame: { get: function() { return this._referenceFrame }, set: function(e) { this._referenceFrame = e } } }), a.prototype.getValue = function(e, t) { return this.getValueInReferenceFrame(e, o.FIXED, t) }, a.prototype.getValueInReferenceFrame = function(e, r, n) { if (!t(e)) throw new i("time is required."); if (!t(r)) throw new i("referenceFrame is required."); var o = this._intervals.findDataForIntervalContainingDate(e); return t(o) ? o.getValueInReferenceFrame(e, r, n) : void 0 }, a }), r("DynamicScene/CompositeProperty", ["../Core/defined", "../Core/defineProperties", "../Core/DeveloperError", "../Core/TimeIntervalCollection"], function(e, t, r, i) { "use strict"; var n = function() { this._intervals = new i }; return t(n.prototype, { intervals: { get: function() { return this._intervals } } }), n.prototype.getValue = function(t, i) { if (!e(t)) throw new r("time is required"); var n = this._intervals.findDataForIntervalContainingDate(t); return e(n) ? n.getValue(t, i) : void 0 }, n }), r("DynamicScene/PositionProperty", ["../Core/Cartesian3", "../Core/defined", "../Core/defineProperties", "../Core/DeveloperError", "../Core/Matrix3", "../Core/ReferenceFrame", "../Core/Transforms"], function(e, t, r, i, n, o, a) { "use strict";
function s() { throw new i("This type should not be instantiated directly.") } var l = s;
r(l.prototype, { referenceFrame: { get: s } }), l.prototype.getValue = s, l.prototype.getValueInReferenceFrame = s; var u = new n; return l.convertToReferenceFrame = function(r, i, n, s, l) { if (n === s) return e.clone(i, l); var c = a.computeIcrfToFixedMatrix(r, u); return t(c) || (c = a.computeTemeToPseudoFixedMatrix(r, u)), n === o.INERTIAL ? c.multiplyByVector(i, l) : n === o.FIXED ? c.transpose(u).multiplyByVector(i, l) : void 0 }, l }), r("DynamicScene/ConstantPositionProperty", ["./ConstantProperty", "./PositionProperty", "../Core/Cartesian3", "../Core/defaultValue", "../Core/defined", "../Core/defineProperties", "../Core/DeveloperError", "../Core/ReferenceFrame"], function(e, t, r, i, n, o, a, s) { "use strict"; var l = function(t, n) { this._property = new e(t, r.clone), this._referenceFrame = i(n, s.FIXED) }; return o(l.prototype, { referenceFrame: { get: function() { return this._referenceFrame } } }), l.prototype.getValue = function(e, t) { return this.getValueInReferenceFrame(e, s.FIXED, t) }, l.prototype.getValueInReferenceFrame = function(e, r, i) { if (!n(e)) throw new a("time is required."); if (!n(r)) throw new a("referenceFrame is required."); var o = this._property.getValue(e, i); return t.convertToReferenceFrame(e, o, this._referenceFrame, r, o) }, l }), r("Scene/HorizontalOrigin", ["../Core/Enumeration"], function(e) { "use strict"; var t = { CENTER: new e(0, "CENTER"), LEFT: new e(1, "LEFT"), RIGHT: new e(-1, "RIGHT") }; return t }), r("Scene/LabelStyle", ["../Core/Enumeration"], function(e) { "use strict"; var t = { FILL: new e(0, "FILL"), OUTLINE: new e(1, "OUTLINE"), FILL_AND_OUTLINE: new e(2, "FILL_AND_OUTLINE") }; return t }), r("Scene/VerticalOrigin", ["../Core/Enumeration"], function(e) { "use strict"; var t = { CENTER: new e(0, "CENTER"), BOTTOM: new e(1, "BOTTOM"), TOP: new e(-1, "TOP") }; return t }), r("DynamicScene/DynamicDirectionsProperty", ["../Core/defined", "../Core/TimeInterval", "../Core/TimeIntervalCollection", "../Core/Cartesian3", "../Core/Spherical", "../Core/Iso8601"], function(e, t, r, i, n, o) { "use strict";
function a(t) { var r, o, a = [],
s = t.unitSpherical; if (e(s)) { for (r = 0, o = s.length; o > r; r += 2) a.push(new n(s[r], s[r + 1]));
this.spherical = a } if (s = t.unitCartesian, e(s)) { for (r = 0, o = s.length; o > r; r += 3) a.push(new i(s[r], s[r + 1], s[r + 2], !0));
this.cartesian = a } }
function s(r, i, n) { var s = i.interval;
s = e(s) ? t.fromIso8601(s) : o.MAXIMUM_INTERVAL.clone(), e(n) && (s = s.intersect(n)); var l = r._propertyIntervals,
u = l.findInterval(s.start, s.stop);
e(u) || (u = s, l.addInterval(u)), u.data = new a(i) } a.prototype.getValue = function() { var t = this.spherical; if (!e(t)) { t = [], this.spherical = t; for (var r = this.cartesian, i = 0, o = r.length; o > i; i++) t.push(n.fromCartesian3(r[i])) } return t }; var l = function() { this._propertyIntervals = new r }; return l.prototype.processCzmlIntervals = function(e, t, r) { if (Array.isArray(e))
for (var i = 0, n = e.length; n > i; i++) s(this, e[i], t, r);
else s(this, e, t, r) }, l.prototype.getValue = function(t) { var r = this._propertyIntervals.findIntervalContainingDate(t); return e(r) ? r.data.getValue() : void 0 }, l }), r("DynamicScene/GridMaterialProperty", ["../Core/Cartesian2", "../Core/Color", "../Core/defined", "./ConstantProperty"], function(e, t, r, i) { "use strict"; var n = function() { this.color = new i(t.WHITE), this.cellAlpha = new i(.1), this.lineCount = new i(new e(8, 8)), this.lineThickness = new i(new e(1, 1)) }; return n.prototype.getType = function() { return "Grid" }, n.prototype.getValue = function(e, t) { return r(t) || (t = {}), t.color = r(this.color) ? this.color.getValue(e, t.color) : void 0, t.cellAlpha = r(this.cellAlpha) ? this.cellAlpha.getValue(e) : void 0, t.lineCount = r(this.lineCount) ? this.lineCount.getValue(e, t.lineCount) : void 0, t.lineThickness = r(this.lineThickness) ? this.lineThickness.getValue(e, t.lineThickness) : void 0, t }, n }), r("DynamicScene/ImageMaterialProperty", ["../Core/Cartesian2", "../Core/defined", "./ConstantProperty"], function(e, t, r) { "use strict"; var i = function() { this.image = void 0, this.repeat = new r(new e(1, 1)) }; return i.prototype.getType = function() { return "Image" }, i.prototype.getValue = function(e, r) { return t(r) || (r = {}), r.image = t(this.image) ? this.image.getValue(e) : void 0, r.repeat = t(this.repeat) ? this.repeat.getValue(e, r.repeat) : void 0, r }, i }), r("DynamicScene/DynamicObjectCollection", ["../Core/defined", "../Core/Event", "../Core/TimeInterval", "../Core/Iso8601", "../Core/DeveloperError", "./DynamicObject"], function(e, t, r, i, n, o) { "use strict"; var a = function() { this._hash = {}, this._array = [], this.compositeCollection = void 0, this.objectPropertiesChanged = new t, this.objectsRemoved = new t }; return a.prototype.computeAvailability = function() { for (var t = i.MAXIMUM_VALUE, n = i.MINIMUM_VALUE, o = this._array, a = 0, s = o.length; s > a; a++) { var l = o[a],
u = l.availability; if (e(u)) { var c = u.start,
h = u.stop;
c.lessThan(t) && !c.equals(i.MINIMUM_VALUE) && (t = l.availability.start), h.greaterThan(n) && !h.equals(i.MAXIMUM_VALUE) && (n = l.availability.stop) } } return i.MAXIMUM_VALUE.equals(t) && (t = i.MINIMUM_VALUE), i.MINIMUM_VALUE.equals(n) && (n = i.MAXIMUM_VALUE), new r(t, n, !0, !0) }, a.prototype.getObject = function(t) { if (!e(t)) throw new n("id is required."); return this._hash[t] }, a.prototype.removeObject = function(t) { if (!e(t)) throw new n("id is required."); var r = this._hash[t],
i = e(r); return i && (this._hash[t] = void 0, this._array.splice(this._array.indexOf(r), 1), this.objectsRemoved.raiseEvent(this, [r])), i }, a.prototype.getObjects = function() { return this._array }, a.prototype.getOrCreateObject = function(t) { if (!e(t)) throw new n("id is required."); var r = this._hash[t]; return r || (r = new o(t), this._hash[t] = r, this._array.push(r)), r }, a.prototype.clear = function() { var e = this._array;
this._hash = {}, this._array = [], e.length > 0 && this.objectsRemoved.raiseEvent(this, e) }, a }), r("DynamicScene/ReferenceProperty", ["../Core/defaultValue", "../Core/defined", "../Core/DeveloperError"], function(e, t, r) { "use strict";
function i(r) { var i = r._targetProperty; if (!t(i)) { var n = e(r._dynamicObjectCollection.compositeCollection, r._dynamicObjectCollection),
o = n.getObject(r._targetObjectId);
t(o) && (i = o[r._targetPropertyName], r._targetProperty = i, r._targetObject = o) } return i } var n = function(e, i, n) { if (!t(e)) throw new r("dynamicObjectCollection is required."); if (!t(i)) throw new r("targetObjectId is required."); if (!t(n)) throw new r("targetPropertyName is required.");
this._targetProperty = void 0, this._dynamicObjectCollection = e, this._targetObjectId = i, this._targetObject = void 0, this._targetPropertyName = n }; return n.fromString = function(e, i) { if (!t(e)) throw new r("dynamicObjectCollection is required."); if (!t(i)) throw new r("referenceString is required."); var o = i.split("."); if (2 !== o.length) throw new r("referenceString must contain a single . delineating the target object ID and property name."); return new n(e, o[0], o[1]) }, n.prototype.getValue = function(e, n) { if (!t(e)) throw new r("time is required."); var o = i(this); return t(o) && this._targetObject.isAvailable(e) ? o.getValue(e, n) : void 0 }, n }), r("DynamicScene/DynamicVertexPositionsProperty", ["../Core/defined", "../Core/TimeInterval", "../Core/TimeIntervalCollection", "../Core/Cartesian3", "../Core/Cartographic", "../Core/Iso8601", "../Core/Ellipsoid", "./ReferenceProperty"], function(e, t, r, i, n, o, a, s) {
"use strict";
function l(t) { var r, o, a, s = []; if (a = t.cartesian, e(a)) { for (r = 0, o = a.length; o > r; r += 3) s.push(new i(a[r], a[r + 1], a[r + 2]));
this.cartesian = s } else if (a = t.cartographicRadians, e(a)) { for (r = 0, o = a.length; o > r; r += 3) s.push(new n(a[r], a[r + 1], a[r + 2]));
this.cartographic = s } else if (a = t.cartographicDegrees, e(a)) { for (r = 0, o = a.length; o > r; r += 3) s.push(n.fromDegrees(a[r], a[r + 1], a[r + 2]));
this.cartographic = s } }
var u = a.WGS84;
l.prototype.getValue = function() {
return e(this.cartesian) || (this.cartesian = u.cartographicArrayToCartesianArray(this.cartographic)), this.cartesian
};
var c = function() { this._propertyIntervals = new r };
return c.prototype.processCzmlIntervals = function(e, t, r) { if (Array.isArray(e))
for (var i = 0, n = e.length; n > i; i++) this._addCzmlInterval(e[i], t, r);
else this._addCzmlInterval(e, t, r) }, c.prototype.getValue = function(t) { var r = this._propertyIntervals.findIntervalContainingDate(t); if (!e(r)) return void 0; var i = r.data; if (Array.isArray(i)) { for (var n = [], o = 0, a = i.length; a > o; o++) { var s = i[o].getValue(t);
e(s) && n.push(s) } return n } return i.getValue() }, c.prototype._addCzmlInterval = function(r, i, n) { var a = r.interval;
a = e(a) ? t.fromIso8601(a) : o.MAXIMUM_INTERVAL.clone(), e(i) && (a = a.intersect(i)); var u = this._propertyIntervals,
c = u.findInterval(a.start, a.stop);
e(c) || (c = a, u.addInterval(c)); var h = r.references; if (e(h)) { for (var d = [], m = 0, p = h.length; p > m; m++) d.push(s.fromString(n, h[m]));
c.data = d } else c.data = new l(r) }, c
}), r("DynamicScene/SampledProperty", ["../Core/binarySearch", "../Core/defaultValue", "../Core/defined", "../Core/defineProperties", "../Core/DeveloperError", "../Core/JulianDate", "../Core/LinearApproximation"], function(e, t, r, i, n, o, a) { "use strict";
function s(e, t, r) { var i, n = e.length,
o = r.length,
a = n + o; if (e.length = a, n !== t) { var s = n - 1; for (i = a - 1; i >= t; i--) e[i] = e[s--] } for (i = 0; o > i; i++) e[t++] = r[i] }
function l(e, t) { return e instanceof o ? e : "string" == typeof e ? o.fromIso8601(e) : t.addSeconds(e) } var u = { packedLength: 1, pack: function(e, r, i) { i = t(i, 0), r[i] = e }, unpack: function(e, r) { return r = t(r, 0), e[r] } },
c = function(t, i, n, a, u) { for (var c, h, d, m, p, f, v, y, g = 0; g < a.length;)
if (v = l(a[g], t), d = e(i, v, o.compare), 0 > d) { for (d = ~d, p = [], m = d * u, f = [], h = void 0, y = i[d]; g < a.length && (v = l(a[g], t), !(r(h) && o.compare(h, v) >= 0 || r(y) && o.compare(v, y) >= 0));) { for (p.push(v), g += 1, c = 0; u > c; c++) f.push(a[g]), g += 1;
h = v } s(n, m, f), s(i, d, p) } else { for (c = 0; u > c; c++) g++, n[d * u + c] = a[g];
g++ } },
h = function(e) { if (!r(e)) throw new n("type is required."); var i = e;
i === Number && (i = u); var o = t(i.packedInterpolationLength, i.packedLength);
this._type = e, this._innerType = i, this._interpolationDegree = 1, this._interpolationAlgorithm = a, this._numberOfPoints = 0, this._times = [], this._values = [], this._xTable = [], this._yTable = [], this._packedInterpolationLength = o, this._updateTableLength = !0, this._interpolationResult = new Array(o) }; return i(h.prototype, { type: { get: function() { return this._type } }, interpolationDegree: { get: function() { return this._interpolationDegree }, set: function(e) { this._interpolationDegree = e, this._updateTableLength = !0 } }, interpolationAlgorithm: { get: function() { return this._interpolationAlgorithm }, set: function(e) { this._interpolationAlgorithm = e, this._updateTableLength = !0 } } }), h.prototype.getValue = function(t, i) { if (!r(t)) throw new n("time is required."); var a = this._innerType,
s = this._times,
l = this._values,
u = e(s, t, o.compare); if (0 > u) { var c = this._xTable,
h = this._yTable,
d = this._interpolationAlgorithm,
m = this._packedInterpolationLength; if (this._updateTableLength) { this._updateTableLength = !1; var p = Math.min(d.getRequiredDataPoints(this._interpolationDegree), s.length);
p !== this._numberOfPoints && (this._numberOfPoints = p, c.length = p, h.length = p * m) } var f = this._numberOfPoints - 1; if (1 > f) return void 0;
u = ~u, u >= s.length && (u = s.length - 1); var v = 0,
y = s.length - 1,
g = y - v + 1; if (f + 1 > g);
else { var _ = u - (0 | f / 2) - 1;
v > _ && (_ = v); var w = _ + f;
w > y && (w = y, _ = w - f, v > _ && (_ = v)), v = _, y = w } for (var C = y - v + 1, x = 0; C > x; ++x) c[x] = s[y].getSecondsDifference(s[v + x]); if (r(a.convertPackedArrayForInterpolation)) a.convertPackedArrayForInterpolation(l, v, y, h);
else
for (var S = 0, E = a.packedLength, b = v * E, T = (y + 1) * E; T > b;) h[S] = l[b], b++, S++; var A = s[y].getSecondsDifference(t),
M = d.interpolateOrderZero(A, c, h, m, this._interpolationResult); return r(a.unpackInterpolationResult) ? a.unpackInterpolationResult(M, l, v, y, i) : a.unpack(M, 0, i) } return a.unpack(this._values, u * a.packedLength, i) }, h.prototype.addSample = function(e, t) { if (!r(e)) throw new n("time is required."); if (!r(t)) throw new n("value is required."); var i = this._innerType,
o = [e];
i.pack(t, o, 1), c(void 0, this._times, this._values, o, i.packedLength), this._updateTableLength = !0 }, h.prototype.addSamples = function(e, t) { if (!r(e)) throw new n("times is required."); if (!r(t)) throw new n("values is required."); if (e.length !== t.length) throw new n("times and values must be the same length."); for (var i = this._innerType, o = e.length, a = [], s = 0; o > s; s++) a.push(e[s]), i.pack(t[s], a, a.length);
c(void 0, this._times, this._values, a, i.packedLength), this._updateTableLength = !0 }, h.prototype.addSamplesPackedArray = function(e, t) { if (!r(e)) throw new n("packedSamples is required.");
c(t, this._times, this._values, e, this._innerType.packedLength), this._updateTableLength = !0 }, h._mergeNewSamples = c, h }), r("DynamicScene/SampledPositionProperty", ["../Core/Cartesian3", "../Core/defaultValue", "../Core/defined", "../Core/defineProperties", "../Core/DeveloperError", "../Core/ReferenceFrame", "./PositionProperty", "./SampledProperty"], function(e, t, r, i, n, o, a, s) { "use strict"; var l = function(r) { this._property = new s(e), this._referenceFrame = t(r, o.FIXED) }; return i(l.prototype, { referenceFrame: { get: function() { return this._referenceFrame } }, interpolationDegree: { get: function() { return this._property.interpolationDegree }, set: function(e) { this._property.interpolationDegree = e } }, interpolationAlgorithm: { get: function() { return this._property.interpolationAlgorithm }, set: function(e) { this._property.interpolationAlgorithm = e } } }), l.prototype.getValue = function(e, t) { return this.getValueInReferenceFrame(e, o.FIXED, t) }, l.prototype.getValueInReferenceFrame = function(e, t, i) { if (!r(e)) throw new n("time is required."); if (!r(t)) throw new n("referenceFrame is required."); return i = this._property.getValue(e, i), r(i) ? a.convertToReferenceFrame(e, i, this._referenceFrame, t, i) : i }, l.prototype.addSample = function(e, t) { this._property.addSample(e, t) }, l.prototype.addSamples = function(e, t) { this._property.addSamples(e, t) }, l.prototype.addSamplesPackedArray = function(e, t) { this._property.addSamplesPackedArray(e, t) }, l }), r("DynamicScene/TimeIntervalCollectionPositionProperty", ["../Core/defaultValue", "../Core/defined", "../Core/defineProperties", "../Core/DeveloperError", "../Core/ReferenceFrame", "../Core/TimeIntervalCollection", "./PositionProperty"], function(e, t, r, i, n, o, a) { "use strict"; var s = function(t) { this._intervals = new o, this._referenceFrame = e(t, n.FIXED) }; return r(s.prototype, { intervals: { get: function() { return this._intervals } }, referenceFrame: { get: function() { return this._referenceFrame } } }), s.prototype.getValue = function(e, t) { return this.getValueInReferenceFrame(e, n.FIXED, t) }, s.prototype.getValueInReferenceFrame = function(e, r, n) { if (!t(e)) throw new i("time is required."); if (!t(r)) throw new i("referenceFrame is required."); var o = this._intervals.findDataForIntervalContainingDate(e); return t(o) ? a.convertToReferenceFrame(e, o, this._referenceFrame, r, n) : void 0 }, s }), r("DynamicScene/TimeIntervalCollectionProperty", ["../Core/defined", "../Core/defineProperties", "../Core/DeveloperError", "../Core/Enumeration", "../Core/TimeIntervalCollection"], function(e, t, r, i, n) { "use strict"; var o = function(e) { this._intervals = new n, this._clone = e }; return t(o.prototype, { intervals: { get: function() { return this._intervals } } }), o.prototype.getValue = function(t, n) { if (!e(t)) throw new r("time is required"); var o = this._intervals.findDataForIntervalContainingDate(t); if (e(o) && "object" == typeof o && !Array.isArray(o) && !(o instanceof i)) { if ("function" == typeof o.clone) return o.clone(n); if (!e(this._clone)) throw new r("This value requires a clone function be specified for the TimeIntervalCollectionProperty constructor."); return this._clone(o, n) } return o }, o }), r("DynamicScene/CzmlDataSource", ["../Core/Cartesian2", "../Core/Cartesian3", "../Core/Cartographic", "../Core/Color", "../Core/ClockRange", "../Core/ClockStep", "../Core/createGuid", "../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/Ellipsoid", "../Core/Event", "../Core/HermitePolynomialApproximation", "../Core/Iso8601", "../Core/JulianDate", "../Core/LagrangePolynomialApproximation", "../Core/LinearApproximation", "../Core/loadJson", "../Core/Math", "../Core/Quaternion", "../Core/ReferenceFrame", "../Core/RuntimeError", "../Core/Spherical", "../Core/TimeInterval", "../Scene/HorizontalOrigin", "../Scene/LabelStyle", "../Scene/VerticalOrigin", "./CompositeMaterialProperty", "./CompositePositionProperty", "./CompositeProperty", "./ConstantPositionProperty", "./ConstantProperty", "./DynamicBillboard", "./DynamicClock", "./ColorMaterialProperty", "./DynamicCone", "./DynamicLabel", "./DynamicDirectionsProperty", "./DynamicEllipse", "./DynamicEllipsoid", "./GridMaterialProperty", "./ImageMaterialProperty", "./DynamicObjectCollection", "./DynamicPath", "./DynamicPoint", "./DynamicPolyline", "./DynamicPolygon", "./DynamicPyramid", "./DynamicVector", "./DynamicVertexPositionsProperty", "./SampledPositionProperty", "./SampledProperty", "./TimeIntervalCollectionPositionProperty", "./TimeIntervalCollectionProperty", "../ThirdParty/Uri", "../ThirdParty/when"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C, x, S, E, b, T, A, M, P, D, I, O, R, L, z, N, F, B, V, q, k, U, W, G, H, j, Y, X, Z, K, J, Q, $, et, tt) { "use strict";
function rt(e) { var t = e.rgbaf; if (l(t)) return t; var r = e.rgba; if (!l(r)) return void 0; if (r.length === i.length) return [i.byteToFloat(r[0]), i.byteToFloat(r[1]), i.byteToFloat(r[2]), i.byteToFloat(r[3])]; var n = r.length;
t = new Array(n); for (var o = 0; n > o; o += 5) t[o] = r[o], t[o + 1] = i.byteToFloat(r[o + 1]), t[o + 2] = i.byteToFloat(r[o + 2]), t[o + 3] = i.byteToFloat(r[o + 3]), t[o + 4] = i.byteToFloat(r[o + 4]); return t }
function it(e, t) { var r = s(e.image, e); if (l(t)) { var i = new et(document.location.href);
t = new et(t), r = new et(r).resolve(t.resolve(i)).toString() } return r }
function nt(e) { if (l(e.cartesian)) return e.cartesian; if (l(e.unitCartesian)) return e.unitCartesian; var r, i, n, o = e.unitSpherical; if (l(o)) { if (i = o.length, 2 === i) Lt.clock = o[0], Lt.cone = o[1], t.fromSpherical(Lt, Rt), n = [Rt.x, Rt.y, Rt.z];
else { var a = 0; for (n = new Array(4 * (i / 3)), r = 0; i > r; r += 4) n[r] = o[a++], Lt.clock = o[a++], Lt.cone = o[a++], t.fromSpherical(Lt, Rt), n[r + 1] = Rt.x, n[r + 2] = Rt.y, n[r + 3] = Rt.z } return n } var s = e.cartographicRadians; if (l(s)) { if (3 === s.length) zt.longitude = s[0], zt.latitude = s[1], zt.height = s[2], c.WGS84.cartographicToCartesian(zt, Rt), n = [Rt.x, Rt.y, Rt.z];
else
for (i = s.length, n = new Array(i), r = 0; i > r; r += 4) zt.longitude = s[r + 1], zt.latitude = s[r + 2], zt.height = s[r + 3], c.WGS84.cartographicToCartesian(zt, Rt), n[r] = s[r], n[r + 1] = Rt.x, n[r + 2] = Rt.y, n[r + 3] = Rt.z; return n } var u = e.cartographicDegrees; if (!l(u)) throw new C(JSON.stringify(e) + " is not a valid CZML interval."); if (3 === u.length) zt.longitude = g.toRadians(u[0]), zt.latitude = g.toRadians(u[1]), zt.height = u[2], c.WGS84.cartographicToCartesian(zt, Rt), n = [Rt.x, Rt.y, Rt.z];
else
for (i = u.length, n = new Array(i), r = 0; i > r; r += 4) zt.longitude = g.toRadians(u[r + 1]), zt.latitude = g.toRadians(u[r + 2]), zt.height = u[r + 3], c.WGS84.cartographicToCartesian(zt, Rt), n[r] = u[r], n[r + 1] = Rt.x, n[r + 2] = Rt.y, n[r + 3] = Rt.z; return n }
function ot(r, n, o) { switch (r) {
case Boolean:
return s(n.boolean, n);
case e:
return n.cartesian2;
case t:
return nt(n);
case i:
return rt(n);
case E:
return E[s(n.horizontalOrigin, n)];
case Image:
return it(n, o);
case b:
return b[s(n.labelStyle, n)];
case Number:
return s(n.number, n);
case String:
return s(n.string, n);
case _:
return n.unitQuaternion;
case T:
return T[s(n.verticalOrigin, n)];
default:
throw new u(r) } }
function at(e, t) { var r = Nt[e.interpolationAlgorithm];
l(r) && (t.interpolationAlgorithm = r), l(e.interpolationDegree) && (t.interpolationDegree = e.interpolationDegree) }
function st(e, t, r, i, n, o) { var a, u = i.interval;
l(u) ? (a = S.fromIso8601(u), l(n) && (a = a.intersect(n))) : l(n) && (a = n); var c = ot(e, i, o),
h = l(a) && !a.equals(m.MAXIMUM_INTERVAL),
d = s(e.packedLength, 1),
f = s(c.length, 1),
v = "string" != typeof c && f > d; if (!v && !h) return t[r] = l(e.unpack) ? new I(e.unpack(c, 0)) : new I(c), !0; var y = !1,
g = t[r]; if (v && !h) return g instanceof J || (g = new J(e), t[r] = g, y = !0), g.addSamplesPackedArray(c, p.fromIso8601(i.epoch)), at(i, g), y; var _; if (!v && h) return a = a.clone(), a.data = l(e.unpack) ? e.unpack(c, 0) : c, l(g) || (g = new $, t[r] = g, y = !0), g instanceof $ ? g.intervals.addInterval(a) : g instanceof P ? (a.data = new I(a.data), g.intervals.addInterval(a)) : (_ = m.MAXIMUM_INTERVAL.clone(), _.data = g, y = !0, g = new P, t[r] = g, g.intervals.addInterval(_), a.data = new I(a.data), g.intervals.addInterval(a)), y;
l(g) || (y = !0, g = new P, t[r] = g), g instanceof P || (_ = m.MAXIMUM_INTERVAL.clone(), _.data = g, y = !0, g = new P, t[r] = g, g.intervals.addInterval(_)); var w = g.intervals; return _ = w.findInterval(a.start, a.stop, a.isStartIncluded, a.isStopIncluded), l(_) && _.data instanceof J || (_ = a.clone(), _.data = new J(e), w.addInterval(_)), _.data.addSamplesPackedArray(c, p.fromIso8601(i.epoch)), at(i, _.data), y }
function lt(e, t, r, i, n, o) { if (!l(i)) return !1; var a = !1; if (Array.isArray(i))
for (var s = 0, u = i.length; u > s; s++) a = st(e, t, r, i[s], n, o) || a;
else a = st(e, t, r, i, n, o) || a; return a }
function ut(e, r, i, n) { var o, a = i.interval;
l(a) ? (o = S.fromIso8601(a), l(n) && (o = o.intersect(n))) : l(n) && (o = n); var u = w[s(i.referenceFrame, "FIXED")],
c = nt(i),
h = l(o) && !o.equals(m.MAXIMUM_INTERVAL),
d = t.packedLength,
f = s(c.length, 1),
v = "string" != typeof c && f > d; if (!v && !h) return e[r] = new D(t.unpack(c), u), !0; var y = !1,
g = e[r]; if (v && !h) return g instanceof J && g.referenceFrame === u || (g = new K(u), e[r] = g, y = !0), g.addSamplesPackedArray(c, p.fromIso8601(i.epoch)), at(i, g), y; var _; if (!v && h) return o = o.clone(), o.data = t.unpack(c), l(g) || (g = new Q(u), e[r] = g, y = !0), g instanceof Q && g.referenceFrame === u ? g.intervals.addInterval(o) : g instanceof M ? (o.data = new D(o.data, u), g.intervals.addInterval(o)) : (_ = m.MAXIMUM_INTERVAL.clone(), _.data = g, y = !0, g = new M(g.referenceFrame), e[r] = g, g.intervals.addInterval(_), o.data = new D(o.data, u), g.intervals.addInterval(o)), y;
l(g) ? g instanceof M || (_ = m.MAXIMUM_INTERVAL.clone(), _.data = g, y = !0, g = new M(g.referenceFrame), e[r] = g, g.intervals.addInterval(_)) : (y = !0, g = new M(u), e[r] = g); var C = g.intervals; return _ = C.findInterval(o.start, o.stop, o.isStartIncluded, o.isStopIncluded), l(_) && _.data instanceof K && _.data.referenceFrame === u || (_ = o.clone(), _.data = new K(u), C.addInterval(_)), _.data.addSamplesPackedArray(c, p.fromIso8601(i.epoch)), at(i, _.data), y }
function ct(e, t, r, i, n) { if (!l(r)) return !1; var o = !1; if (Array.isArray(r))
for (var a = 0, s = r.length; s > a; a++) o = ut(e, t, r[a], i, n) || o;
else o = ut(e, t, r, i, n) || o; return o }
function ht(e, t, r) { return l(t) || l(r) ? (e instanceof Ft || (e = new Ft), lt(Number, e, "_x", t), lt(Number, e, "_y", r), e) : e }
function dt(e, t, r, n, o) { var a, u = r.interval;
l(u) ? (a = S.fromIso8601(u), l(n) && (a = a.intersect(n))) : l(n) && (a = n), a = s(a, m.MAXIMUM_INTERVAL); var c = !1,
h = e[t];
l(h) || (h = new A, e[t] = h, c = !0); var d, p = h.intervals,
f = p.findInterval(a.start, a.stop);
l(f) ? d = f.data : (f = a.clone(), p.addInterval(f)); var v; return l(r.solidColor) ? (d instanceof L || (d = new L), v = r.solidColor, lt(i, d, "color", v.color)) : l(r.grid) ? (d instanceof q || (d = new q), v = r.grid, lt(i, d, "color", v.color, void 0, o), lt(Number, d, "cellAlpha", v.cellAlpha, void 0, o), d.lineThickness = ht(d.lineThickness, v.rowThickness, v.columnThickness), d.lineCount = ht(d.lineCount, v.rowCount, v.columnCount)) : l(r.image) && (d instanceof k || (d = new k), v = r.image, lt(Image, d, "image", v.image, void 0, o), d.repeat = ht(d.repeat, v.horizontalRepeat, v.verticalRepeat)), f.data = d, c }
function mt(e, t, r, i, n) { if (!l(r)) return !1; var o = !1; if (Array.isArray(r))
for (var a = 0, s = r.length; s > a; a++) o = dt(e, t, r[a], i, n) || o;
else o = dt(e, t, r, i, n) || o; return o }
function pt(e, t, r, i) { var n = t.position; return l(n) ? ct(e, "position", n, void 0, i) : !1 }
function ft(e, r, i, n) { var o = r.viewFrom; return l(o) ? lt(t, e, "viewFrom", o, void 0, n) : !1 }
function vt(e, t, r, i) { var n = t.orientation; return l(n) ? lt(_, e, "orientation", n, void 0, i) : !1 }
function yt(e, t, r) { var i = t.vertexPositions; if (!l(i)) return !1; var n = e.vertexPositions,
o = !l(e.vertexPositions); return o && (e.vertexPositions = n = new Z), n.processCzmlIntervals(i, void 0, r), o }
function gt(e, t) { var r = t.availability; if (!l(r)) return !1; var i = !1,
n = S.fromIso8601(r); return l(n) && (i = e._setAvailability(n)), i }
function _t(r, n, o, a) { var s = n.billboard; if (!l(s)) return !1; var u = s.interval;
l(u) && (u = S.fromIso8601(u)); var c = r.billboard,
h = !l(c); return h && (r.billboard = c = new O), h = lt(i, c, "color", s.color, u, a) || h, h = lt(t, c, "eyeOffset", s.eyeOffset, u, a) || h, h = lt(E, c, "horizontalOrigin", s.horizontalOrigin, u, a) || h, h = lt(Image, c, "image", s.image, u, a) || h, h = lt(e, c, "pixelOffset", s.pixelOffset, u, a) || h, h = lt(Number, c, "scale", s.scale, u, a) || h, h = lt(Number, c, "rotation", s.rotation, u, a) || h, h = lt(t, c, "alignedAxis", s.alignedAxis, u, a) || h, h = lt(Boolean, c, "show", s.show, u, a) || h, h = lt(T, c, "verticalOrigin", s.verticalOrigin, u, a) || h }
function wt(e, t) { var r = !1,
i = t.clock; if (l(i) && "document" === e.id) { var a = e.clock; if (l(a) || (a = new R, e.clock = a, r = !0), l(i.interval)) { var s = S.fromIso8601(i.interval);
l(s) && (a.startTime = s.start, a.stopTime = s.stop) } l(i.currentTime) && (a.currentTime = p.fromIso8601(i.currentTime)), l(i.range) && (a.clockRange = n[i.range]), l(i.step) && (a.clockStep = o[i.step]), l(i.multiplier) && (a.multiplier = i.multiplier) } return r }
function Ct(e, t, r, n) { var o = t.cone; if (!l(o)) return !1; var a = o.interval;
l(a) && (a = S.fromIso8601(a)); var s = e.cone,
u = !l(s); return u && (e.cone = s = new z), u = lt(Boolean, s, "show", o.show, a, n) || u, u = lt(Number, s, "radius", o.radius, a, n) || u, u = lt(Boolean, s, "showIntersection", o.showIntersection, a, n) || u, u = lt(i, s, "intersectionColor", o.intersectionColor, a, n) || u, u = lt(Number, s, "intersectionWidth", o.intersectionWidth, a, n) || u, u = lt(Number, s, "innerHalfAngle", o.innerHalfAngle, a, n) || u, u = lt(Number, s, "outerHalfAngle", o.outerHalfAngle, a, n) || u, u = lt(Number, s, "minimumClockAngle", o.minimumClockAngle, a, n) || u, u = lt(Number, s, "maximumClockAngle", o.maximumClockAngle, a, n) || u, u = mt(s, "capMaterial", o.capMaterial, a, n), u = mt(s, "innerMaterial", o.innerMaterial, a, n), u = mt(s, "outerMaterial", o.outerMaterial, a, n), u = mt(s, "silhouetteMaterial", o.silhouetteMaterial, a, n) }
function xt(e, t, r, i) { var n = t.ellipse; if (!l(n)) return !1; var o = n.interval;
l(o) && (o = S.fromIso8601(o)); var a = e.ellipse,
s = !l(a); return s && (e.ellipse = a = new B), s = lt(Number, a, "bearing", n.bearing, o, i) || s, s = lt(Number, a, "semiMajorAxis", n.semiMajorAxis, o, i) || s, s = lt(Number, a, "semiMinorAxis", n.semiMinorAxis, o, i) || s }
function St(e, r, i, n) { var o = r.ellipsoid; if (!l(o)) return !1; var a = o.interval;
l(a) && (a = S.fromIso8601(a)); var s = e.ellipsoid,
u = !l(s); return u && (e.ellipsoid = s = new V), u = lt(Boolean, s, "show", o.show, a, n) || u, u = lt(t, s, "radii", o.radii, a, n) || u, u = mt(s, "material", o.material, a, n) }
function Et(r, n, o, a) { var s = n.label; if (!l(s)) return !1; var u = s.interval;
l(u) && (u = S.fromIso8601(u)); var c = r.label,
h = !l(c); return h && (r.label = c = new N), h = lt(i, c, "fillColor", s.fillColor, u, a) || h, h = lt(i, c, "outlineColor", s.outlineColor, u, a) || h, h = lt(Number, c, "outlineWidth", s.outlineWidth, u, a) || h, h = lt(t, c, "eyeOffset", s.eyeOffset, u, a) || h, h = lt(E, c, "horizontalOrigin", s.horizontalOrigin, u, a) || h, h = lt(String, c, "text", s.text, u, a) || h, h = lt(e, c, "pixelOffset", s.pixelOffset, u, a) || h, h = lt(Number, c, "scale", s.scale, u, a) || h, h = lt(Boolean, c, "show", s.show, u, a) || h, h = lt(T, c, "verticalOrigin", s.verticalOrigin, u, a) || h, h = lt(String, c, "font", s.font, u, a) || h, h = lt(b, c, "style", s.style, u, a) || h }
function bt(e, t, r, n) { var o = t.path; if (!l(o)) return !1; var a = o.interval;
l(a) && (a = S.fromIso8601(a)); var s = e.path,
u = !l(s); return u && (e.path = s = new W), u = lt(i, s, "color", o.color, a, n) || u, u = lt(Number, s, "width", o.width, a, n) || u, u = lt(i, s, "outlineColor", o.outlineColor, a, n) || u, u = lt(Number, s, "outlineWidth", o.outlineWidth, a, n) || u, u = lt(Boolean, s, "show", o.show, a, n) || u, u = lt(Number, s, "resolution", o.resolution, a, n) || u, u = lt(Number, s, "leadTime", o.leadTime, a, n) || u, u = lt(Number, s, "trailTime", o.trailTime, a, n) || u }
function Tt(e, t, r, n) { var o = t.point; if (!l(o)) return !1; var a = o.interval;
l(a) && (a = S.fromIso8601(a)); var s = e.point,
u = !l(s); return u && (e.point = s = new G), u = lt(i, s, "color", o.color, a, n) || u, u = lt(Number, s, "pixelSize", o.pixelSize, a, n) || u, u = lt(i, s, "outlineColor", o.outlineColor, a, n) || u, u = lt(Number, s, "outlineWidth", o.outlineWidth, a, n) || u, u = lt(Boolean, s, "show", o.show, a, n) || u }
function At(e, t, r, i) { var n = t.polygon; if (!l(n)) return !1; var o = n.interval;
l(o) && (o = S.fromIso8601(o)); var a = e.polygon,
s = !l(a); return s && (e.polygon = a = new j), s = lt(Boolean, a, "show", n.show, o, i) || s, s = mt(a, "material", n.material, o, i) }
function Mt(e, t, r, n) { var o = t.polyline; if (!l(o)) return !1; var a = o.interval;
l(a) && (a = S.fromIso8601(a)); var s = e.polyline,
u = !l(s); return u && (e.polyline = s = new H), u = lt(i, s, "color", o.color, a, n) || u, u = lt(Number, s, "width", o.width, a, n) || u, u = lt(i, s, "outlineColor", o.outlineColor, a, n) || u, u = lt(Number, s, "outlineWidth", o.outlineWidth, a, n) || u, u = lt(Boolean, s, "show", o.show, a, n) || u }
function Pt(e, t, r, n) { var o = t.pyramid; if (!l(o)) return !1; var a = o.interval;
l(a) && (a = S.fromIso8601(a)); var s = e.pyramid,
u = !l(s); if (u && (e.pyramid = s = new Y), u = lt(Boolean, s, "show", o.show, a, n) || u, u = lt(Number, s, "radius", o.radius, a, n) || u, u = lt(Boolean, s, "showIntersection", o.showIntersection, a, n) || u, u = lt(i, s, "intersectionColor", o.intersectionColor, a, n) || u, u = lt(Number, s, "intersectionWidth", o.intersectionWidth, a, n) || u, u = mt(s, "material", o.material, a, n), l(o.directions)) { var c = s.directions;
l(c) || (s.directions = c = new F, u = !0), c.processCzmlIntervals(o.directions, a) } return u }
function Dt(e, r, n, o) { var a = r.vector; if (!l(a)) return !1; var s = a.interval;
l(s) && (s = S.fromIso8601(s)); var u = e.vector,
c = !l(u); return c && (e.vector = u = new X), c = lt(i, u, "color", a.color, s, o) || c, c = lt(Boolean, u, "show", a.show, s, o) || c, c = lt(Number, u, "width", a.width, s, o) || c, c = lt(t, u, "direction", a.direction, s, o) || c, c = lt(Number, u, "length", a.length, s, o) || c }
function It(e, t, r, i, n, o) { var s = e.id; if (l(s) || (s = a()), e["delete"] === !0) t.removeObject(s);
else
for (var u = t.getOrCreateObject(s), c = n.length - 1; c > -1; c--) n[c](u, e, t, o) && !l(i[s]) && (i[s] = !0, r.push(u)) }
function Ot(e, t, r) { var i = e._dynamicObjectCollection;
Bt._processCzml(t, i, r); var a, s = i.computeAvailability(),
u = i.getObject("document"); if (l(u) && l(u.clock)) a = new R, a.startTime = u.clock.startTime, a.stopTime = u.clock.stopTime, a.clockRange = u.clock.clockRange, a.clockStep = u.clock.clockStep, a.multiplier = u.clock.multiplier, a.currentTime = u.clock.currentTime;
else if (!s.start.equals(m.MINIMUM_VALUE)) { a = new R, a.startTime = s.start, a.stopTime = s.stop, a.clockRange = n.LOOP_STOP; var c = a.startTime.getSecondsDifference(a.stopTime),
h = Math.round(c / 120);
a.multiplier = h, a.currentTime = a.startTime, a.clockStep = o.SYSTEM_CLOCK_MULTIPLIER } return a } var Rt = new t,
Lt = new x,
zt = new r,
Nt = { HERMITE: d, LAGRANGE: f, LINEAR: v },
Ft = function() { this._x = new I(0), this._y = new I(0) };
Ft.prototype.getValue = function(t, r) { return l(r) || (r = new e), r.x = this._x.getValue(t), r.y = this._y.getValue(t), r }; var Bt = function() { this._changed = new h, this._error = new h, this._clock = void 0, this._dynamicObjectCollection = new U, this._timeVarying = !0 }; return Bt.updaters = [wt, _t, xt, St, Ct, Et, bt, Tt, At, Mt, Pt, Dt, pt, ft, vt, yt, gt], Bt.prototype.getChangedEvent = function() { return this._changed }, Bt.prototype.getErrorEvent = function() { return this._error }, Bt.prototype.getClock = function() { return this._clock }, Bt.prototype.getDynamicObjectCollection = function() { return this._dynamicObjectCollection }, Bt.prototype.getIsTimeVarying = function() { return this._timeVarying }, Bt.prototype.process = function(e, t) { if (!l(e)) throw new u("czml is required.");
this._clock = Ot(this, e, t) }, Bt.prototype.load = function(e, t) { if (!l(e)) throw new u("czml is required.");
this._dynamicObjectCollection.clear(), this._clock = Ot(this, e, t) }, Bt.prototype.processUrl = function(e) { if (!l(e)) throw new u("url is required."); var t = this; return tt(y(e), function(r) { t.process(r, e) }, function(e) { return t._error.raiseEvent(t, e), tt.reject(e) }) }, Bt.prototype.loadUrl = function(e) { if (!l(e)) throw new u("url is required."); var t = this; return tt(y(e), function(r) { t.load(r, e) }, function(e) { return t._error.raiseEvent(t, e), tt.reject(e) }) }, Bt._processCzml = function(e, t, r, i) { var n = [],
o = {}; if (i = l(i) ? i : Bt.updaters, Array.isArray(e))
for (var a = 0, s = e.length; s > a; a++) It(e[a], t, n, o, i, r);
else It(e, t, n, o, i, r); return n.length > 0 && t.objectPropertiesChanged.raiseEvent(t, n), n }, Bt }), r("DynamicScene/DataSource", ["../Core/DeveloperError"], function(e) { "use strict";
function t() { throw new e("This type should not be instantiated directly.") } var r = t; return r.prototype.getChangedEvent = t, r.prototype.getErrorEvent = t, r.prototype.getClock = t, r.prototype.getDynamicObjectCollection = t, r.prototype.getIsTimeVarying = t, r }), r("DynamicScene/DataSourceCollection", ["../Core/DeveloperError", "../Core/defined", "../Core/destroyObject", "../Core/Event"], function(e, t, r, i) { "use strict"; var n = function() { this._dataSources = [], this.dataSourceAdded = new i, this.dataSourceRemoved = new i }; return n.prototype.add = function(r) { if (!t(r)) throw new e("dataSource is required.");
this._dataSources.push(r), this.dataSourceAdded.raiseEvent(this, r) }, n.prototype.remove = function(e, t) { var r = this._dataSources.indexOf(e); return -1 !== r ? (this._dataSources.splice(r, 1), this.dataSourceRemoved.raiseEvent(this, e), "function" == typeof e.destroy && t && e.destroy(), !0) : !1 }, n.prototype.removeAll = function(e) { for (var t = this._dataSources, r = t.length - 1; r >= 0; r--) this.remove(t[r], e) }, n.prototype.contains = function(e) { return -1 !== this.indexOf(e) }, n.prototype.indexOf = function(e) { return this._dataSources.indexOf(e) }, n.prototype.get = function(r) { if (!t(r)) throw new e("index is required."); return this._dataSources[r] }, n.prototype.getLength = function() { return this._dataSources.length }, n.prototype.isDestroyed = function() { return !1 }, n.prototype.destroy = function() { return this.removeAll(!0), r(this) }, n }), r("Renderer/BlendEquation", ["../Core/Enumeration"], function(e) { "use strict"; var t = { ADD: new e(32774, "ADD"), SUBTRACT: new e(32778, "SUBTRACT"), REVERSE_SUBTRACT: new e(32779, "REVERSE_SUBTRACT"), validate: function(e) { return e === t.ADD || e === t.SUBTRACT || e === t.REVERSE_SUBTRACT } }; return t }), r("Renderer/BlendFunction", ["../Core/Enumeration"], function(e) { "use strict"; var t = { ZERO: new e(0, "ZERO"), ONE: new e(1, "ONE"), SOURCE_COLOR: new e(768, "SOURCE_COLOR"), ONE_MINUS_SOURCE_COLOR: new e(769, "ONE_MINUS_SOURCE_COLOR"), DESTINATION_COLOR: new e(774, "DESTINATION_COLOR"), ONE_MINUS_DESTINATION_COLOR: new e(775, "ONE_MINUS_DESTINATION_COLOR"), SOURCE_ALPHA: new e(770, "SOURCE_ALPHA"), ONE_MINUS_SOURCE_ALPHA: new e(771, "ONE_MINUS_SOURCE_ALPHA"), DESTINATION_ALPHA: new e(772, "DESTINATION_ALPHA"), ONE_MINUS_DESTINATION_ALPHA: new e(773, "ONE_MINUS_DESTINATION_ALPHA"), CONSTANT_COLOR: new e(32769, "CONSTANT_COLOR"), ONE_MINUS_CONSTANT_COLOR: new e(32770, "ONE_MINUS_CONSTANT_COLOR"), CONSTANT_ALPHA: new e(32771, "CONSTANT_ALPHA"), ONE_MINUS_CONSTANT_ALPHA: new e(32772, "ONE_MINUS_CONSTANT_ALPHA"), SOURCE_ALPHA_SATURATE: new e(776, "SOURCE_ALPHA_SATURATE"), validate: function(e) { return e === t.ZERO || e === t.ONE || e === t.SOURCE_COLOR || e === t.ONE_MINUS_SOURCE_COLOR || e === t.DESTINATION_COLOR || e === t.ONE_MINUS_DESTINATION_COLOR || e === t.SOURCE_ALPHA || e === t.ONE_MINUS_SOURCE_ALPHA || e === t.DESTINATION_ALPHA || e === t.ONE_MINUS_DESTINATION_ALPHA || e === t.CONSTANT_COLOR || e === t.ONE_MINUS_CONSTANT_COLOR || e === t.CONSTANT_ALPHA || e === t.ONE_MINUS_CONSTANT_ALPHA || e === t.SOURCE_ALPHA_SATURATE } }; return t }), r("Renderer/BlendingState", ["./BlendEquation", "./BlendFunction"], function(e, t) { "use strict"; var r = { DISABLED: { enabled: !1 }, ALPHA_BLEND: { enabled: !0, equationRgb: e.ADD, equationAlpha: e.ADD, functionSourceRgb: t.SOURCE_ALPHA, functionSourceAlpha: t.SOURCE_ALPHA, functionDestinationRgb: t.ONE_MINUS_SOURCE_ALPHA, functionDestinationAlpha: t.ONE_MINUS_SOURCE_ALPHA }, PRE_MULTIPLIED_ALPHA_BLEND: { enabled: !0, equationRgb: e.ADD, equationAlpha: e.ADD, functionSourceRgb: t.ONE, functionSourceAlpha: t.ONE, functionDestinationRgb: t.ONE_MINUS_SOURCE_ALPHA, functionDestinationAlpha: t.ONE_MINUS_SOURCE_ALPHA }, ADDITIVE_BLEND: { enabled: !0, equationRgb: e.ADD, equationAlpha: e.ADD, functionSourceRgb: t.SOURCE_ALPHA, functionSourceAlpha: t.SOURCE_ALPHA, functionDestinationRgb: t.ONE, functionDestinationAlpha: t.ONE } }; return r }), r("Renderer/BufferUsage", ["../Core/Enumeration"], function(e) { "use strict"; var t = { STREAM_DRAW: new e(35040, "STREAM_DRAW"), STATIC_DRAW: new e(35044, "STATIC_DRAW"), DYNAMIC_DRAW: new e(35048, "DYNAMIC_DRAW"), validate: function(e) { return e === t.STREAM_DRAW || e === t.STATIC_DRAW || e === t.DYNAMIC_DRAW } }; return t }), r("Renderer/CommandLists", [], function() { "use strict"; var e = function() { this.colorList = [], this.pickList = [], this.overlayList = [] }; return e.prototype.empty = function() { return 0 === this.colorList.length && 0 === this.pickList.length && 0 === this.overlayList.length }, e.prototype.removeAll = function() { this.colorList.length = 0, this.pickList.length = 0, this.overlayList.length = 0 }, e }), r("Renderer/DrawCommand", [], function() { "use strict"; var e = function() { this.boundingVolume = void 0, this.cull = !0, this.modelMatrix = void 0, this.primitiveType = void 0, this.vertexArray = void 0, this.count = void 0, this.offset = void 0, this.shaderProgram = void 0, this.uniformMap = void 0, this.renderState = void 0, this.framebuffer = void 0, this.executeInClosestFrustum = !1, this.owner = void 0, this.debugShowBoundingVolume = !1, this.debugOverlappingFrustums = 0 }; return e.prototype.execute = function(e, t) { e.draw(this, t) }, e }), r("Renderer/VertexArrayFacade", ["../Core/ComponentDatatype", "../Core/defaultValue", "../Core/defined", "../Core/destroyObject", "../Core/DeveloperError", "../Core/Math", "./BufferUsage"], function(e, t, r, i, n, o, a) {
"use strict";
function s(e, t) { if (t.needsCommit && t.vertexSizeInBytes > 0) { t.needsCommit = !1; var i = t.vertexBuffer,
n = e._size * t.vertexSizeInBytes,
o = r(i); if (!o || i.getSizeInBytes() < n) return o && i.destroy(), t.vertexBuffer = e._context.createVertexBuffer(t.arrayBuffer, t.usage), t.vertexBuffer.setVertexArrayDestroyable(!1), !0;
t.vertexBuffer.copyFromArrayView(t.arrayBuffer) } return !1 }
function l(e, t, r) { if (e.needsCommit && e.vertexSizeInBytes > 0) { var i = e.vertexSizeInBytes * t,
n = e.vertexSizeInBytes * r;
e.vertexBuffer.copyFromArrayView(new Uint8Array(e.arrayBuffer, i, n), i) } }
function u(e) { var t = e.vaByPurpose; if (r(t)) { for (var i in t)
if (t.hasOwnProperty(i))
for (var n = t[i], o = n.length, a = 0; o > a; ++a) n[a].va.destroy();
e.vaByPurpose = void 0 } }
var c = function(e, t, i) {
function o(e, t) { return t.componentDatatype.sizeInBytes - e.componentDatatype.sizeInBytes } if (!e) throw new n("context is required."); if (!t || 0 === t.length) throw new n("At least one attribute is required."); var s = c._verifyAttributes(t);
i = i || 0; for (var l, u, h, d, m = {}, p = [], f = s.length, v = 0; f > v; ++v) { var y = s[v];
y.vertexBuffer ? p.push(y) : (h = y.purpose, l = m[h], r(l) || (l = m[h] = {}), d = y.usage.toString(), u = l[d], r(u) || (u = l[d] = []), u.push(y)) } this._buffersByPurposeAndUsage = {}, this._allBuffers = []; for (h in m)
if (m.hasOwnProperty(h)) { l = m[h]; var g = this._buffersByPurposeAndUsage[h];
r(g) || (g = this._buffersByPurposeAndUsage[h] = {}); for (d in l)
if (l.hasOwnProperty(d)) { u = l[d], u.sort(o); var _, w = c._vertexSizeInBytes(u); switch (d) {
case a.STATIC_DRAW.toString():
_ = a.STATIC_DRAW; break;
case a.STREAM_DRAW.toString():
_ = a.STREAM_DRAW; break;
case a.DYNAMIC_DRAW.toString():
_ = a.DYNAMIC_DRAW } var C = { purpose: h, vertexSizeInBytes: w, vertexBuffer: void 0, usage: _, needsCommit: !1, arrayBuffer: void 0, arrayViews: c._createArrayViews(u, w) };
g[d] = C, this._allBuffers.push(C) } }
this._size = 0, this._precreated = p, this._context = e, this.writers = void 0, this.vaByPurpose = void 0, this.resize(i) };
c._verifyAttributes = function(i) { for (var o = [], s = 0; s < i.length; ++s) { var l = i[s],
u = { index: t(l.index, s), enabled: t(l.enabled, !0), componentsPerAttribute: l.componentsPerAttribute, componentDatatype: l.componentDatatype || e.FLOAT, normalize: l.normalize || !1, purpose: t(l.purpose, "all"), vertexBuffer: l.vertexBuffer, usage: l.usage || a.STATIC_DRAW }; if (o.push(u), 1 !== u.componentsPerAttribute && 2 !== u.componentsPerAttribute && 3 !== u.componentsPerAttribute && 4 !== u.componentsPerAttribute) throw new n("attribute.componentsPerAttribute must be in the range [1, 4]."); var c = u.componentDatatype; if (!e.validate(c)) throw new n("Attribute must have a valid componentDatatype or not specify it."); if (!a.validate(u.usage)) throw new n("Attribute must have a valid usage or not specify it.") } for (var h = new Array(o.length), d = 0; d < o.length; ++d) { var m = o[d],
p = m.index,
f = m.purpose; if ("all" !== f) { var v = h[p]; if (v === !0) throw new n("Index " + p + " is used by more than one attribute."); if (r(v)) { if (v[f]) throw new n("Index " + p + " is used by more than one attribute with the same purpose.") } else v = h[p] = {};
v[f] = !0 } else { if (h[p]) throw new n("Index " + p + " is used by more than one attribute.");
h[p] = !0 } } return o }, c._vertexSizeInBytes = function(e) { for (var t = 0, r = e.length, i = 0; r > i; ++i) { var n = e[i];
t += n.componentsPerAttribute * n.componentDatatype.sizeInBytes } var o = r > 0 ? e[0].componentDatatype.sizeInBytes : 0,
a = o > 0 ? t % o : 0,
s = 0 === a ? 0 : o - a; return t += s }, c._createArrayViews = function(e, t) { for (var r = [], i = 0, n = e.length, o = 0; n > o; ++o) { var a = e[o],
s = a.componentDatatype;
r.push({ index: a.index, enabled: a.enabled, componentsPerAttribute: a.componentsPerAttribute, componentDatatype: s, normalize: a.normalize, offsetInBytes: i, vertexSizeInComponentType: t / s.sizeInBytes, view: void 0 }), i += a.componentsPerAttribute * s.sizeInBytes } return r }, c.prototype.resize = function(e) {
this._size = e;
var t = this._allBuffers;
this.writers = {};
for (var i = 0, n = t.length; n > i; ++i) { var o = t[i];
c._resize(o, this._size); var a = this.writers[o.purpose];
r(a) || (a = this.writers[o.purpose] = []), c._appendWriters(a, o) } u(this)
}, c._resize = function(t, r) { if (t.vertexSizeInBytes > 0) { var i = new ArrayBuffer(r * t.vertexSizeInBytes); if (t.arrayBuffer)
for (var n = new Uint8Array(i), o = new Uint8Array(t.arrayBuffer), a = o.length, s = 0; a > s; ++s) n[s] = o[s]; for (var l = t.arrayViews, u = l.length, c = 0; u > c; ++c) { var h = l[c];
h.view = e.createArrayBufferView(h.componentDatatype, i, h.offsetInBytes) } t.arrayBuffer = i } };
var h = [function(e, t, r) { return function(i, n) { t[i * r] = n, e.needsCommit = !0 } }, function(e, t, r) { return function(i, n, o) { var a = i * r;
t[a] = n, t[a + 1] = o, e.needsCommit = !0 } }, function(e, t, r) { return function(i, n, o, a) { var s = i * r;
t[s] = n, t[s + 1] = o, t[s + 2] = a, e.needsCommit = !0 } }, function(e, t, r) { return function(i, n, o, a, s) { var l = i * r;
t[l] = n, t[l + 1] = o, t[l + 2] = a, t[l + 3] = s, e.needsCommit = !0 } }];
return c._appendWriters = function(e, t) { for (var r = t.arrayViews, i = r.length, n = 0; i > n; ++n) { var o = r[n];
e[o.index] = h[o.componentsPerAttribute - 1](t, o.view, o.vertexSizeInComponentType) } }, c.prototype.commit = function(e) { for (var t, i = !1, n = this._allBuffers, a = 0, l = n.length; l > a; ++a) t = n[a], i = s(this, t) || i; if (i || !r(this.vaByPurpose)) { var h = this._buffersByPurposeAndUsage;
u(this), this.vaByPurpose = {}; for (var d in h)
if (h.hasOwnProperty(d)) { for (var m = h[d], p = [], f = Math.ceil(this._size / o.SIXTY_FOUR_KILOBYTES), v = 0; f > v; ++v) { var y = [],
g = h.all; if (g !== m)
for (var _ in g)
if (g.hasOwnProperty(_)) { var w = g[_];
c._appendAttributes(y, w, v * w.vertexSizeInBytes * o.SIXTY_FOUR_KILOBYTES) }
for (var C in m) m.hasOwnProperty(C) && (t = m[C], c._appendAttributes(y, t, v * t.vertexSizeInBytes * o.SIXTY_FOUR_KILOBYTES));
y = y.concat(this._precreated), p.push({ va: this._context.createVertexArray(y, e), indicesCount: 1.5 * (v !== f - 1 ? o.SIXTY_FOUR_KILOBYTES : this._size % o.SIXTY_FOUR_KILOBYTES) }) } this.vaByPurpose[d] = p } } }, c._appendAttributes = function(e, t, r) { for (var i = t.arrayViews, n = i.length, o = 0; n > o; ++o) { var a = i[o];
e.push({ index: a.index, enabled: a.enabled, componentsPerAttribute: a.componentsPerAttribute, componentDatatype: a.componentDatatype, normalize: a.normalize, vertexBuffer: t.vertexBuffer, offsetInBytes: r + a.offsetInBytes, strideInBytes: t.vertexSizeInBytes }) } }, c.prototype.subCommit = function(e, t) { if (0 > e || e >= this._size) throw new n("offsetInVertices must be greater than or equal to zero and less than the vertex array size."); if (e + t > this._size) throw new n("offsetInVertices + lengthInVertices cannot exceed the vertex array size."); for (var r = this._allBuffers, i = 0, o = r.length; o > i; ++i) l(r[i], e, t) }, c.prototype.endSubCommits = function() { for (var e = this._allBuffers, t = 0, r = e.length; r > t; ++t) e[t].needsCommit = !1 }, c.prototype.isDestroyed = function() { return !1 }, c.prototype.destroy = function() { for (var e = this._allBuffers, t = 0, r = e.length; r > t; ++t) { var n = e[t];
n.vertexBuffer = n.vertexBuffer && n.vertexBuffer.destroy() } return u(this), i(this) }, c
}), r("Renderer/createShaderSource", ["../Core/defaultValue", "../Core/defined", "../Core/DeveloperError"], function(e, t, r) { "use strict";
function i(i) { i = e(i, e.EMPTY_OBJECT); var n = i.defines,
o = i.sources,
a = i.pickColorQualifier; if (t(a) && "uniform" !== a && "varying" !== a) throw new r("options.pickColorQualifier must be 'uniform' or 'varying'."); var s, l, u = ""; if (t(n) && n.length > 0)
for (l = n.length, s = 0; l > s; ++s) 0 !== n[s].length && (u += "#define " + n[s] + "\n"); if (t(o) && o.length > 0)
for (l = o.length, s = 0; l > s; ++s) u += "\n#line 0\n" + o[s]; if (t(a)) { var c = u.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g, "void czm_old_main()"),
h = a + " vec4 czm_pickColor; \n" + "void main() \n" + "{ \n" + " czm_old_main(); \n" + " if (gl_FragColor.a == 0.0) { \n" + " discard; \n" + " } \n" + " gl_FragColor = czm_pickColor; \n" + "}";
u = c + "\n" + h } return u } return i }), r("Scene/SceneMode", ["../Core/Enumeration"], function(e) { "use strict"; var t = { SCENE2D: new e(0, "SCENE2D", { morphTime: 0 }), COLUMBUS_VIEW: new e(1, "COLUMBUS_VIEW", { morphTime: 0 }), SCENE3D: new e(2, "SCENE3D", { morphTime: 1 }), MORPHING: new e(3, "MORPHING") }; return t }), r("Scene/SceneTransforms", ["../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/Cartographic", "../Core/Cartesian2", "../Core/Cartesian3", "../Core/Cartesian4", "../Core/Matrix4", "../Core/BoundingRectangle", "../Core/Math", "./SceneMode"], function(e, t, r, i, n, o, a, s, l, u, c) { "use strict"; var h = {},
d = new o,
m = new a;
h.wgs84ToWindowCoordinates = function(e, i, n) { if (!t(e)) throw new r("scene is required."); if (!t(i)) throw new r("position is required."); if (h.computeActualWgs84Position(e.getFrameState(), i, d), !t(d)) return n = void 0, void 0; var o = e.getUniformState().getViewProjection(); return o.multiplyByPoint(d, m), h.clipToWindowCoordinates(e.getCanvas(), m, n) }; var p = new o,
f = new i;
h.computeActualWgs84Position = function(e, r, i) { var n = e.mode; if (n === c.SCENE3D) return o.clone(r, i); var a = e.scene2D.projection; if (a.getEllipsoid().cartesianToCartographic(r, f), !t(f)) return i = void 0; if (a.project(f, p), n === c.COLUMBUS_VIEW) return o.fromElements(p.z, p.x, p.y, i); if (n === c.SCENE2D) return o.fromElements(0, p.x, p.y, i); var s = e.morphTime; return o.fromElements(u.lerp(p.z, r.x, s), u.lerp(p.x, r.y, s), u.lerp(p.y, r.z, s), i) }; var v = new o,
y = new a,
g = new l,
_ = new s; return h.clipToWindowCoordinates = function(e, t, r) { return v.x = t.x / t.w, v.y = t.y / t.w, v.z = t.z / t.w, g.width = e.clientWidth, g.height = e.clientHeight, s.computeViewportTransformation(g, 0, 1, _), _.multiplyByPoint(v, y), n.fromCartesian4(y, r) }, h }), r("Scene/Billboard", ["../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/Color", "../Core/Cartesian2", "../Core/Cartesian3", "../Core/Cartesian4", "../Core/NearFarScalar", "./HorizontalOrigin", "./VerticalOrigin", "./SceneMode", "./SceneTransforms"], function(e, t, r, i, n, o, a, s, l, u, c, h) { "use strict";
function d(e, r) { var i = e._billboardCollection;
t(i) && (i._updateBillboard(e, r), e._dirty = !0) } var m = {},
p = function(a, s) { if (a = e(a, m), t(a.scaleByDistance) && a.scaleByDistance.far <= a.scaleByDistance.near) throw new r("scaleByDistance.far must be greater than scaleByDistance.near.");
this._show = e(a.show, !0), this._position = o.clone(e(a.position, o.ZERO)), this._actualPosition = this._position.clone(), this._pixelOffset = n.clone(e(a.pixelOffset, n.ZERO)), this._eyeOffset = o.clone(e(a.eyeOffset, o.ZERO)), this._verticalOrigin = e(a.verticalOrigin, u.CENTER), this._horizontalOrigin = e(a.horizontalOrigin, l.CENTER), this._scale = e(a.scale, 1), this._imageIndex = e(a.imageIndex, -1), this._color = i.clone(e(a.color, i.WHITE)), this._rotation = e(a.rotation, 0), this._alignedAxis = o.clone(e(a.alignedAxis, o.ZERO)), this._width = a.width, this._height = a.height, this._scaleByDistance = a.scaleByDistance, this._pickId = void 0, this._pickIdThis = a._pickIdThis, this._billboardCollection = s, this._dirty = !1, this._index = -1 },
f = p.SHOW_INDEX = 0,
v = p.POSITION_INDEX = 1,
y = p.PIXEL_OFFSET_INDEX = 2,
g = p.EYE_OFFSET_INDEX = 3,
_ = p.HORIZONTAL_ORIGIN_INDEX = 4,
w = p.VERTICAL_ORIGIN_INDEX = 5,
C = p.SCALE_INDEX = 6,
x = p.IMAGE_INDEX_INDEX = 7,
S = p.COLOR_INDEX = 8,
E = p.ROTATION_INDEX = 9,
b = p.ALIGNED_AXIS_INDEX = 10,
T = p.SCALE_BY_DISTANCE_INDEX = 11;
p.NUMBER_OF_PROPERTIES = 12, p.prototype.getPickId = function(r) { return t(this._pickId) || (this._pickId = r.createPickId(e(this._pickIdThis, this))), this._pickId }, p.prototype.getShow = function() { return this._show }, p.prototype.setShow = function(e) { if (!t(e)) throw new r("value is required.");
e !== this._show && (this._show = e, d(this, f)) }, p.prototype.getPosition = function() { return this._position }, p.prototype.setPosition = function(e) { if (!t(e)) throw new r("value is required."); var i = this._position;
o.equals(i, e) || (o.clone(e, i), o.clone(e, this._actualPosition), d(this, v)) }, p.prototype._getActualPosition = function() { return this._actualPosition }, p.prototype._setActualPosition = function(e) { o.clone(e, this._actualPosition), d(this, v) }, p.prototype.getPixelOffset = function() { return this._pixelOffset }, p.prototype.setPixelOffset = function(e) { if (!t(e)) throw new r("value is required."); var i = this._pixelOffset;
n.equals(i, e) || (n.clone(e, i), d(this, y)) }, p.prototype.getScaleByDistance = function() { return this._scaleByDistance }, p.prototype.setScaleByDistance = function(e) { if (!s.equals(this._scaleByDistance, e)) { if (e.far <= e.near) throw new r("far distance must be greater than near distance.");
d(this, T), this._scaleByDistance = s.clone(e, this._scaleByDistance) } }, p.prototype.getEyeOffset = function() { return this._eyeOffset }, p.prototype.setEyeOffset = function(e) { if (!t(e)) throw new r("value is required."); var i = this._eyeOffset;
o.equals(i, e) || (o.clone(e, i), d(this, g)) }, p.prototype.getHorizontalOrigin = function() { return this._horizontalOrigin }, p.prototype.setHorizontalOrigin = function(e) { if (!t(e)) throw new r("value is required.");
this._horizontalOrigin !== e && (this._horizontalOrigin = e, d(this, _)) }, p.prototype.getVerticalOrigin = function() { return this._verticalOrigin }, p.prototype.setVerticalOrigin = function(e) { if (!t(e)) throw new r("value is required.");
this._verticalOrigin !== e && (this._verticalOrigin = e, d(this, w)) }, p.prototype.getScale = function() { return this._scale }, p.prototype.setScale = function(e) { if (!t(e)) throw new r("value is required.");
this._scale !== e && (this._scale = e, d(this, C)) }, p.prototype.getImageIndex = function() { return this._imageIndex }, p.prototype.setImageIndex = function(e) { if ("number" != typeof e) throw new r("value is required and must be a number.");
this._imageIndex !== e && (this._imageIndex = e, d(this, x)) }, p.prototype.getColor = function() { return this._color }, p.prototype.setColor = function(e) { if (!t(e)) throw new r("value is required."); var n = this._color;
i.equals(n, e) || (i.clone(e, n), d(this, S)) }, p.prototype.getRotation = function() { return this._rotation }, p.prototype.setRotation = function(e) { if (!t(e)) throw new r("value is required.");
this._rotation !== e && (this._rotation = e, d(this, E)) }, p.prototype.getAlignedAxis = function() { return this._alignedAxis }, p.prototype.setAlignedAxis = function(e) { if (!t(e)) throw new r("value is required."); var i = this._alignedAxis;
o.equals(i, e) || (o.clone(e, i), d(this, b)) }, p.prototype.getWidth = function() { return this._width }, p.prototype.setWidth = function(e) { this._width !== e && (this._width = e, d(this, x)) }, p.prototype.getHeight = function() { return this._height }, p.prototype.setHeight = function(e) { this._height !== e && (this._height = e, d(this, x)) }; var A = new a; return p._computeActualPosition = function(e, t, r) { return t.mode === c.SCENE3D ? e : (r.multiplyByPoint(e, A), h.computeActualWgs84Position(t, A)) }, p._computeScreenSpacePosition = function(e, t, r, i, o, a) { var s = a.camera,
l = s.getViewMatrix(),
u = s.frustum.getProjectionMatrix(),
c = l.multiply(e),
d = c.multiplyByPoint(t),
m = r.multiplyComponents(d.normalize());
d.x += r.x + m.x, d.y += r.y + m.y, d.z += m.z; var p = u.multiplyByVector(d),
f = h.clipToWindowCoordinates(o.getCanvas(), p),
v = o.getUniformState(),
y = i.multiplyByScalar(v.getHighResolutionSnapScale()); return f.x += y.x, f.y += y.y, new n(f.x, f.y) }, p.prototype.computeScreenSpacePosition = function(e, i) { var n = this._billboardCollection; if (!t(n)) throw new r("Billboard must be in a collection. Was it removed?"); if (!t(e)) throw new r("context is required."); if (!t(i)) throw new r("frameState is required."); var o = n.modelMatrix; return p._computeScreenSpacePosition(o, this._actualPosition, this._eyeOffset, this._pixelOffset, e, i) }, p.prototype.equals = function(e) { return this === e || t(e) && this._show === e._show && this._imageIndex === e._imageIndex && this._scale === e._scale && this._verticalOrigin === e._verticalOrigin && this._horizontalOrigin === e._horizontalOrigin && o.equals(this._position, e._position) && i.equals(this._color, e._color) && n.equals(this._pixelOffset, e._pixelOffset) && o.equals(this._eyeOffset, e._eyeOffset) && s.equals(this._scaleByDistance, e._scaleByDistance) }, p.prototype._destroy = function() { this._pickId = this._pickId && this._pickId.destroy(), this._billboardCollection = void 0 }, p }), r("Shaders/BillboardCollectionVS", [], function() { "use strict"; return "attribute vec3 positionHigh;\nattribute vec3 positionLow;\nattribute vec2 direction;\nattribute vec4 textureCoordinatesAndImageSize;\nattribute vec3 originAndShow;\nattribute vec2 pixelOffset;\nattribute vec4 eyeOffsetAndScale;\nattribute vec4 rotationAndAlignedAxis;\nattribute vec4 scaleByDistance;\n#ifdef RENDER_FOR_PICK\nattribute vec4 pickColor;\n#else\nattribute vec4 color;\n#endif\nconst vec2 czm_highResolutionSnapScale = vec2(1.0, 1.0);\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nvoid main()\n{\nvec3 eyeOffset = eyeOffsetAndScale.xyz;\nfloat scale = eyeOffsetAndScale.w;\nvec2 textureCoordinates = textureCoordinatesAndImageSize.xy;\nvec2 imageSize = textureCoordinatesAndImageSize.zw;\nvec2 origin = originAndShow.xy;\nfloat show = originAndShow.z;\nvec4 p = czm_translateRelativeToEye(positionHigh, positionLow);\nvec4 positionEC = czm_modelViewRelativeToEye * p;\npositionEC = czm_eyeOffset(positionEC, eyeOffset);\npositionEC.xyz *= show;\n#ifdef EYE_DISTANCE_SCALING\nfloat lengthSq;\nif (czm_sceneMode == czm_sceneMode2D)\n{\nlengthSq = czm_eyeHeight2D.y;\n}\nelse\n{\nlengthSq = dot(positionEC.xyz, positionEC.xyz);\n}\nfloat scaleAtMin = scaleByDistance.y;\nfloat scaleAtMax = scaleByDistance.w;\nfloat nearDistanceSq = scaleByDistance.x * scaleByDistance.x;\nfloat farDistanceSq = scaleByDistance.z * scaleByDistance.z;\nlengthSq = clamp(lengthSq, nearDistanceSq, farDistanceSq);\nfloat t = (lengthSq - nearDistanceSq) / (farDistanceSq - nearDistanceSq);\nt = pow(t, 0.15);\nscale *= mix(scaleAtMin, scaleAtMax, t);\n#endif\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec2 halfSize = imageSize * scale * czm_highResolutionSnapScale;\nhalfSize *= ((direction * 2.0) - 1.0);\npositionWC.xy += (origin * abs(halfSize));\n#ifdef ROTATION\nfloat rotation = rotationAndAlignedAxis.x;\nvec3 alignedAxis = rotationAndAlignedAxis.yzw;\nif (!all(equal(rotationAndAlignedAxis, vec4(0.0))))\n{\nfloat angle = rotation;\nif (!all(equal(alignedAxis, vec3(0.0))))\n{\nvec3 pos = positionEC.xyz + czm_encodedCameraPositionMCHigh + czm_encodedCameraPositionMCLow;\nvec3 normal = normalize(cross(alignedAxis, pos));\nvec4 tangent = vec4(normalize(cross(pos, normal)), 0.0);\ntangent = czm_modelViewProjection * tangent;\nangle += sign(-tangent.x) * acos(tangent.y / length(tangent.xy));\n}\nfloat cosTheta = cos(angle);\nfloat sinTheta = sin(angle);\nmat2 rotationMatrix = mat2(cosTheta, sinTheta, -sinTheta, cosTheta);\nhalfSize = rotationMatrix * halfSize;\n}\n#endif\npositionWC.xy += halfSize;\npositionWC.xy += (pixelOffset * czm_highResolutionSnapScale);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy, -positionWC.z, 1.0);\nv_textureCoordinates = textureCoordinates;\n#ifdef RENDER_FOR_PICK\nv_pickColor = pickColor;\n#else\nv_color = color;\n#endif\n}\n" }), r("Shaders/BillboardCollectionFS", [], function() { "use strict"; return "uniform sampler2D u_atlas;\nvarying vec2 v_textureCoordinates;\n#ifdef RENDER_FOR_PICK\nvarying vec4 v_pickColor;\n#else\nvarying vec4 v_color;\n#endif\nvoid main()\n{\n#ifdef RENDER_FOR_PICK\nvec4 vertexColor = vec4(1.0, 1.0, 1.0, 1.0);\n#else\nvec4 vertexColor = v_color;\n#endif\nvec4 color = texture2D(u_atlas, v_textureCoordinates) * vertexColor;\nif (color.a == 0.0)\n{\ndiscard;\n}\n#ifdef RENDER_FOR_PICK\ngl_FragColor = v_pickColor;\n#else\ngl_FragColor = color;\n#endif\n}\n" }), r("Scene/BillboardCollection", ["../Core/defined", "../Core/DeveloperError", "../Core/Color", "../Core/defaultValue", "../Core/destroyObject", "../Core/Cartesian2", "../Core/Cartesian3", "../Core/EncodedCartesian3", "../Core/Matrix4", "../Core/ComponentDatatype", "../Core/IndexDatatype", "../Core/PrimitiveType", "../Core/BoundingSphere", "../Renderer/BlendingState", "../Renderer/BufferUsage", "../Renderer/CommandLists", "../Renderer/DrawCommand", "../Renderer/VertexArrayFacade", "../Renderer/createShaderSource", "./SceneMode", "./Billboard", "./HorizontalOrigin", "../Shaders/BillboardCollectionVS", "../Shaders/BillboardCollectionFS"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C, x, S) { "use strict";
function E(e) { if (e._billboardsRemoved) { e._billboardsRemoved = !1; for (var t = [], r = e._billboards, i = r.length, n = 0, o = 0; i > n; ++n) { var a = r[n];
a && (a._index = o++, t.push(a)) } e._billboards = t } }
function b(t) { var r = 16384,
i = t.cache.billboardCollection_directionsVertexBuffer; if (e(i)) return i; for (var n = new Uint8Array(2 * 4 * r), o = 0, a = 0; r > o; ++o) n[a++] = 0, n[a++] = 0, n[a++] = 255, n[a++] = 0, n[a++] = 255, n[a++] = 255, n[a++] = 0, n[a++] = 255; return i = t.createVertexBuffer(n, p.STATIC_DRAW), i.setVertexArrayDestroyable(!1), t.cache.billboardCollection_directionsVertexBuffer = i, i }
function T(t) { var r = 16384,
i = t.cache.billboardCollection_indexBuffer; if (e(i)) return i; for (var n = 6 * r, o = new Uint16Array(n), a = 0, s = 0; n > a; a += 6, s += 4) o[a + 0] = s + 0, o[a + 1] = s + 1, o[a + 2] = s + 2, o[a + 3] = s + 0, o[a + 4] = s + 2, o[a + 5] = s + 3; return i = t.createIndexBuffer(o, p.STATIC_DRAW, c.UNSIGNED_SHORT), i.setVertexArrayDestroyable(!1), t.cache.billboardCollection_indexBuffer = i, i }
function A(e, t, r) { var i = b(e); return new y(e, [{ index: et.positionHigh, componentsPerAttribute: 3, componentDatatype: u.FLOAT, usage: r[U] }, { index: et.positionLow, componentsPerAttribute: 3, componentDatatype: u.FLOAT, usage: r[U] }, { index: et.pixelOffset, componentsPerAttribute: 2, componentDatatype: u.FLOAT, usage: r[W] }, { index: et.eyeOffsetAndScale, componentsPerAttribute: 4, componentDatatype: u.FLOAT, usage: r[Y] }, { index: et.textureCoordinatesAndImageSize, componentsPerAttribute: 4, componentDatatype: u.FLOAT, usage: r[X] }, { index: et.pickColor, componentsPerAttribute: 4, normalize: !0, componentDatatype: u.UNSIGNED_BYTE, usage: p.STATIC_DRAW, purpose: it }, { index: et.color, componentsPerAttribute: 4, normalize: !0, componentDatatype: u.UNSIGNED_BYTE, usage: r[Z], purpose: rt }, { index: et.originAndShow, componentsPerAttribute: 3, componentDatatype: u.BYTE, usage: r[k] }, { index: et.direction, vertexBuffer: i, componentsPerAttribute: 2, normalize: !0, componentDatatype: u.UNSIGNED_BYTE }, { index: et.rotationAndAlignedAxis, componentsPerAttribute: 4, componentDatatype: u.FLOAT, usage: r[K] }, { index: et.scaleByDistance, componentsPerAttribute: 4, componentDatatype: u.FLOAT, usage: r[Q] }], 4 * t) }
function M(e, t, r, i, n) { var o = 4 * n._index,
a = n._getActualPosition();
e._mode === _.SCENE3D && e._baseVolume.expand(a, e._baseVolume), s.fromCartesian(a, at); var l = i[tt],
u = l[et.positionHigh],
c = at.high;
u(o + 0, c.x, c.y, c.z), u(o + 1, c.x, c.y, c.z), u(o + 2, c.x, c.y, c.z), u(o + 3, c.x, c.y, c.z); var h = l[et.positionLow],
d = at.low;
h(o + 0, d.x, d.y, d.z), h(o + 1, d.x, d.y, d.z), h(o + 2, d.x, d.y, d.z), h(o + 3, d.x, d.y, d.z) }
function P(e, t, r, i, n) { var o = 4 * n._index,
a = n.getPixelOffset();
e._maxPixelOffset = Math.max(e._maxPixelOffset, a.x, a.y); var s = i[tt],
l = s[et.pixelOffset];
l(o + 0, a.x, a.y), l(o + 1, a.x, a.y), l(o + 2, a.x, a.y), l(o + 3, a.x, a.y) }
function D(e, t, r, i, n) { var o = 4 * n._index,
a = n.getEyeOffset(),
s = n.getScale();
e._maxEyeOffset = Math.max(e._maxEyeOffset, Math.abs(a.x), Math.abs(a.y), Math.abs(a.z)), e._maxScale = Math.max(e._maxScale, s); var l = i[tt],
u = l[et.eyeOffsetAndScale];
u(o + 0, a.x, a.y, a.z, s), u(o + 1, a.x, a.y, a.z, s), u(o + 2, a.x, a.y, a.z, s), u(o + 3, a.x, a.y, a.z, s) }
function I(e, t, i, n, o) { var a = 4 * o._index,
s = n[it],
l = s[et.pickColor],
u = o.getPickId(t).color,
c = r.floatToByte(u.red),
h = r.floatToByte(u.green),
d = r.floatToByte(u.blue),
m = r.floatToByte(u.alpha);
l(a + 0, c, h, d, m), l(a + 1, c, h, d, m), l(a + 2, c, h, d, m), l(a + 3, c, h, d, m) }
function O(e, t, i, n, o) { var a = 4 * o._index,
s = n[rt],
l = s[et.color],
u = o.getColor(),
c = r.floatToByte(u.red),
h = r.floatToByte(u.green),
d = r.floatToByte(u.blue),
m = r.floatToByte(u.alpha);
l(a + 0, c, h, d, m), l(a + 1, c, h, d, m), l(a + 2, c, h, d, m), l(a + 3, c, h, d, m) }
function R(e, t, r, i, n) { var o = 4 * n._index,
a = n.getHorizontalOrigin().value,
s = n.getVerticalOrigin().value,
l = n.getShow();
0 === n.getColor().alpha && (l = !1), e._allHorizontalCenter = e._allHorizontalCenter && a === C.CENTER.value; var u = i[tt],
c = u[et.originAndShow];
c(o + 0, a, s, l), c(o + 1, a, s, l), c(o + 2, a, s, l), c(o + 3, a, s, l) }
function L(r, n, o, a, s) { var l = 4 * s._index,
u = 0,
c = 0,
h = 0,
d = 0,
m = s.getImageIndex(); if (-1 !== m) { var p = o[m]; if (!e(p)) throw new t("Invalid billboard image index: " + m);
u = p.x, c = p.y, h = p.width, d = p.height } var f = u + h,
v = c + d,
y = r._textureAtlas.getTexture().getDimensions(),
g = .5 * i(s.getWidth(), y.x * h),
_ = .5 * i(s.getHeight(), y.y * d);
r._maxSize = Math.max(r._maxSize, g, _); var w = a[tt],
C = w[et.textureCoordinatesAndImageSize];
C(l + 0, u, c, g, _), C(l + 1, f, c, g, _), C(l + 2, f, v, g, _), C(l + 3, u, v, g, _) }
function z(e, t, r, i, n) { var o = 4 * n._index,
s = n.getRotation(),
l = n.getAlignedAxis();
0 === s && a.equals(l, a.ZERO) || (e._shaderRotation = !0); var u = l.x,
c = l.y,
h = l.z,
d = i[tt],
m = d[et.rotationAndAlignedAxis];
m(o + 0, s, u, c, h), m(o + 1, s, u, c, h), m(o + 2, s, u, c, h), m(o + 3, s, u, c, h) }
function N(t, r, i, n, o) { var a = 4 * o._index,
s = n[tt],
l = s[et.scaleByDistance],
u = 0,
c = 0,
h = 0,
d = 0,
m = o.getScaleByDistance();
e(m) && (u = m.near, c = m.nearValue, h = m.far, d = m.farValue, (1 !== c || 1 !== d) && (t._shaderScaleByDistance = !0)), l(a + 0, u, c, h, d), l(a + 1, u, c, h, d), l(a + 2, u, c, h, d), l(a + 3, u, c, h, d) }
function F(e, t, r, i, n) { M(e, t, r, i, n), P(e, t, r, i, n), D(e, t, r, i, n), I(e, t, r, i, n), O(e, t, r, i, n), R(e, t, r, i, n), L(e, t, r, i, n), z(e, t, r, i, n), N(e, t, r, i, n) }
function B(t, r, i, n, o, a) { var s;
s = n.mode === _.SCENE3D ? t._baseVolume : t._baseVolume2D; for (var l = [], u = 0; i > u; ++u) { var c = r[u],
h = c.getPosition(),
m = w._computeActualPosition(h, n, o);
e(m) && (c._setActualPosition(m), a ? l.push(m) : s.expand(m, s)) } a && d.fromPoints(l, s) }
function V(e, t) { var r = t.mode,
i = t.scene2D.projection,
n = e._billboards,
o = e._billboardsToUpdate,
a = e._modelMatrix;
e._mode !== r || e._projection !== i || r !== _.SCENE3D && !a.equals(e.modelMatrix) ? (e._mode = r, e._projection = i, e.modelMatrix.clone(a), e._createVertexArray = !0, (r === _.SCENE3D || r === _.SCENE2D || r === _.COLUMBUS_VIEW) && B(e, n, n.length, t, a, !0)) : r === _.MORPHING ? B(e, n, n.length, t, a, !0) : (r === _.SCENE2D || r === _.COLUMBUS_VIEW) && B(e, o, e._billboardsToUpdateIndex, t, a, !1) }
function q(e, t, r, i) { var n, o, a, s = r.camera,
l = s.frustum,
u = s.getPositionWC().subtract(i.center, lt),
c = s.getDirectionWC().multiplyByScalar(u.dot(s.getDirectionWC()), ut),
h = Math.max(0, c.magnitude() - i.radius),
d = t.getCanvas();
st.x = d.clientWidth, st.y = d.clientHeight; var m = l.getPixelSize(st, h);
n = Math.max(m.x, m.y), o = 2 * n * e._maxScale * e._maxSize, e._allHorizontalCenter && (o *= .5), a = n * e._maxPixelOffset + e._maxEyeOffset, i.radius += o + a } var k = w.SHOW_INDEX,
U = w.POSITION_INDEX,
W = w.PIXEL_OFFSET_INDEX,
G = w.EYE_OFFSET_INDEX,
H = w.HORIZONTAL_ORIGIN_INDEX,
j = w.VERTICAL_ORIGIN_INDEX,
Y = w.SCALE_INDEX,
X = w.IMAGE_INDEX_INDEX,
Z = w.COLOR_INDEX,
K = w.ROTATION_INDEX,
J = w.ALIGNED_AXIS_INDEX,
Q = w.SCALE_BY_DISTANCE_INDEX,
$ = w.NUMBER_OF_PROPERTIES,
et = { positionHigh: 0, positionLow: 1, pixelOffset: 2, eyeOffsetAndScale: 3, textureCoordinatesAndImageSize: 4, originAndShow: 5, direction: 6, pickColor: 7, color: 7, rotationAndAlignedAxis: 8, scaleByDistance: 9 },
tt = "all",
rt = "color",
it = "pick",
nt = [],
ot = function() { this._textureAtlas = void 0, this._textureAtlasGUID = void 0, this._destroyTextureAtlas = !0, this._sp = void 0, this._rs = void 0, this._vaf = void 0, this._spPick = void 0, this._billboards = [], this._billboardsToUpdate = [], this._billboardsToUpdateIndex = 0, this._billboardsRemoved = !1, this._createVertexArray = !1, this._shaderRotation = !1, this._compiledShaderRotation = !1, this._compiledShaderRotationPick = !1, this._shaderScaleByDistance = !1, this._compiledShaderScaleByDistance = !1, this._compiledShaderScaleByDistancePick = !1, this._propertiesChanged = new Uint32Array($), this._maxSize = 0, this._maxEyeOffset = 0, this._maxScale = 1, this._maxPixelOffset = 0, this._allHorizontalCenter = !0, this._baseVolume = new d, this._baseVolume2D = new d, this._boundingVolume = new d, this._colorCommands = [], this._pickCommands = [], this._commandLists = new f, this.modelMatrix = l.IDENTITY.clone(), this._modelMatrix = l.IDENTITY.clone(), this._mode = _.SCENE3D, this._projection = void 0, this._buffersUsage = [p.STATIC_DRAW, p.STATIC_DRAW, p.STATIC_DRAW, p.STATIC_DRAW, p.STATIC_DRAW, p.STATIC_DRAW, p.STATIC_DRAW, p.STATIC_DRAW, p.STATIC_DRAW, p.STATIC_DRAW, p.STATIC_DRAW, p.STATIC_DRAW]; var e = this;
this._uniforms = { u_atlas: function() { return e._textureAtlas.getTexture() } } };
ot.prototype.add = function(e) { var t = new w(e, this); return t._index = this._billboards.length, this._billboards.push(t), this._createVertexArray = !0, t }, ot.prototype.remove = function(e) { return this.contains(e) ? (this._billboards[e._index] = null, this._billboardsRemoved = !0, this._createVertexArray = !0, e._destroy(), !0) : !1 }, ot.prototype.removeAll = function() { this._destroyBillboards(), this._billboards = [], this._billboardsToUpdate = [], this._billboardsToUpdateIndex = 0, this._billboardsRemoved = !1, this._createVertexArray = !0 }, ot.prototype._updateBillboard = function(e, t) { e._dirty || (this._billboardsToUpdate[this._billboardsToUpdateIndex++] = e), ++this._propertiesChanged[t] }, ot.prototype.contains = function(t) { return e(t) && t._billboardCollection === this }, ot.prototype.get = function(r) { if (!e(r)) throw new t("index is required."); return E(this), this._billboards[r] }, ot.prototype.getLength = function() { return E(this), this._billboards.length }, ot.prototype.getTextureAtlas = function() { return this._textureAtlas }, ot.prototype.setTextureAtlas = function(e) { this._textureAtlas !== e && (this._textureAtlas = this._destroyTextureAtlas && this._textureAtlas && this._textureAtlas.destroy(), this._textureAtlas = e, this._createVertexArray = !0) }, ot.prototype.getDestroyTextureAtlas = function() { return this._destroyTextureAtlas }, ot.prototype.setDestroyTextureAtlas = function(e) { this._destroyTextureAtlas = e }, ot.prototype.computeNewBuffersUsage = function() { for (var e = this._buffersUsage, t = !1, r = this._propertiesChanged, i = 0; $ > i; ++i) { var n = 0 === r[i] ? p.STATIC_DRAW : p.STREAM_DRAW;
t = t || e[i] !== n, e[i] = n } return t }; var at = new s,
st = new o,
lt = new a,
ut = new a; return ot.prototype.update = function(t, r, i) { var n = this._textureAtlas; if (e(n)) { var o = n.getTextureCoordinates(); if (0 !== o.length) { E(this), V(this, r); var a = this._billboards,
s = a.length,
u = this._billboardsToUpdate,
c = this._billboardsToUpdateIndex,
p = this._propertiesChanged,
f = n.getGUID(),
y = this._createVertexArray || this._textureAtlasGUID !== f;
this._textureAtlasGUID = f; var w, C = r.passes,
b = C.pick; if (y || !b && this.computeNewBuffersUsage()) { this._createVertexArray = !1; for (var I = 0; $ > I; ++I) p[I] = 0; if (this._vaf = this._vaf && this._vaf.destroy(), s > 0) { this._vaf = A(t, s, this._buffersUsage), w = this._vaf.writers; for (var B = 0; s > B; ++B) { var tt = this._billboards[B];
tt._dirty = !1, F(this, t, o, w, tt) } this._vaf.commit(T(t)) } this._billboardsToUpdateIndex = 0 } else if (c > 0) { var ot = []; if (p[U] && ot.push(M), p[W] && ot.push(P), (p[G] || p[Y]) && ot.push(D), p[X] && ot.push(L), p[Z] && ot.push(O), (p[H] || p[j] || p[k]) && ot.push(R), (p[K] || p[J]) && ot.push(z), p[Q] && ot.push(N), w = this._vaf.writers, c / s > .1) { for (var at = 0; c > at; ++at) { var st = u[at];
st._dirty = !1; for (var lt = 0; lt < ot.length; ++lt) ot[lt](this, t, o, w, st) } this._vaf.commit(T(t)) } else { for (var ut = 0; c > ut; ++ut) { var ct = u[ut];
ct._dirty = !1; for (var ht = 0; ht < ot.length; ++ht) ot[ht](this, t, o, w, ct);
this._vaf.subCommit(4 * ct._index, 4) } this._vaf.endSubCommits() } this._billboardsToUpdateIndex = 0 } if (c > 1.5 * s && (u.length = s), e(this._vaf) && e(this._vaf.vaByPurpose)) { var dt, mt = l.IDENTITY;
r.mode === _.SCENE3D ? (mt = this.modelMatrix, dt = d.clone(this._baseVolume, this._boundingVolume)) : dt = d.clone(this._baseVolume2D, this._boundingVolume), q(this, t, r, dt); var pt, ft, vt, yt, gt = this._commandLists; if (gt.colorList = nt, gt.pickList = nt, C.color) { var _t = this._colorCommands; for (gt.colorList = _t, e(this._rs) || (this._rs = t.createRenderState({ depthTest: { enabled: !0 }, blending: m.ALPHA_BLEND })), (!e(this._sp) || this._shaderRotation && !this._compiledShaderRotation || this._shaderScaleByDistance && !this._compiledShaderScaleByDistance) && (this._sp = t.getShaderCache().replaceShaderProgram(this._sp, g({ defines: [this._shaderRotation ? "ROTATION" : "", this._shaderScaleByDistance ? "EYE_DISTANCE_SCALING" : ""], sources: [x] }), S, et), this._compiledShaderRotation = this._shaderRotation, this._compiledShaderScaleByDistance = this._shaderScaleByDistance), pt = this._vaf.vaByPurpose[rt], ft = pt.length, _t.length = ft, yt = 0; ft > yt; ++yt) vt = _t[yt], e(vt) || (vt = _t[yt] = new v), vt.boundingVolume = dt, vt.modelMatrix = mt, vt.primitiveType = h.TRIANGLES, vt.count = pt[yt].indicesCount, vt.shaderProgram = this._sp, vt.uniformMap = this._uniforms, vt.vertexArray = pt[yt].va, vt.renderState = this._rs, vt.owner = this } if (b) { var wt = this._pickCommands; for (gt.pickList = wt, (!e(this._spPick) || this._shaderRotation && !this._compiledShaderRotationPick || this._shaderScaleByDistance && !this._compiledShaderScaleByDistancePick) && (this._spPick = t.getShaderCache().replaceShaderProgram(this._spPick, g({ defines: ["RENDER_FOR_PICK", this._shaderRotation ? "ROTATION" : "", this._shaderScaleByDistance ? "EYE_DISTANCE_SCALING" : ""], sources: [x] }), g({ defines: ["RENDER_FOR_PICK"], sources: [S] }), et), this._compiledShaderRotationPick = this._shaderRotation, this._compiledShaderScaleByDistancePick = this._shaderScaleByDistance), pt = this._vaf.vaByPurpose[it], ft = pt.length, wt.length = ft, yt = 0; ft > yt; ++yt) vt = wt[yt], e(vt) || (vt = wt[yt] = new v), vt.boundingVolume = dt, vt.modelMatrix = mt, vt.primitiveType = h.TRIANGLES, vt.count = pt[yt].indicesCount, vt.shaderProgram = this._spPick, vt.uniformMap = this._uniforms, vt.vertexArray = pt[yt].va, vt.renderState = this._rs, vt.owner = this } gt.empty() || i.push(gt) } } } }, ot.prototype.isDestroyed = function() { return !1 }, ot.prototype.destroy = function() { return this._textureAtlas = this._destroyTextureAtlas && this._textureAtlas && this._textureAtlas.destroy(), this._sp = this._sp && this._sp.release(), this._spPick = this._spPick && this._spPick.release(), this._vaf = this._vaf && this._vaf.destroy(), this._destroyBillboards(), n(this) }, ot.prototype._destroyBillboards = function() { for (var e = this._billboards, t = e.length, r = 0; t > r; ++r) e[r] && e[r]._destroy() }, ot }), r("Renderer/TextureAtlasBuilder", ["../Core/Event", "../Core/defined", "../Core/DeveloperError", "../Core/loadImage"], function(e, t, r, i) { "use strict";
function n() { this.imageLoaded = new e, this.index = -1, this.loaded = !1 } var o = function(e) { if (!t(e)) throw new r("textureAtlas is required.");
this.textureAtlas = e, this._idHash = {} }; return o.prototype.addTextureFromUrl = function(e, n) { if (!t(e)) throw new r("url is required."); if (!t(n)) throw new r("textureAvailableCallback is required.");
this.addTextureFromFunction(e, function(e, t) { i(e).then(t) }, n) }, o.prototype.addTextureFromFunction = function(e, i, o) { if (!t(e)) throw new r("id is required."); if (!t(i)) throw new r("getImageCallback is required."); if (!t(o)) throw new r("textureAvailableCallback is required."); var a = this._idHash[e]; if (t(a)) return a.loaded ? o(a.index) : a.imageLoaded.addEventListener(o), void 0;
this._idHash[e] = a = new n, a.imageLoaded.addEventListener(o); var s = this;
i(e, function(t) { if (!s.textureAtlas.isDestroyed()) { var r = a.index = s.textureAtlas.addImage(t);
a.loaded = !0, a.imageLoaded.raiseEvent(r, e), a.imageLoaded = void 0 } }) }, o }), r("DynamicScene/DynamicBillboardVisualizer", ["../Core/DeveloperError", "../Core/defined", "../Core/destroyObject", "../Core/Color", "../Core/Cartesian2", "../Core/Cartesian3", "../Scene/BillboardCollection", "../Scene/HorizontalOrigin", "../Scene/VerticalOrigin", "../Renderer/TextureAtlasBuilder"], function(e, t, r, i, n, o, a, s, l, u) {
"use strict";
function c(e, r, i) { return function(n) { var o = e._billboardVisualizerIndex; if (t(o)) { var a = r.get(o);
a._visualizerUrl === i && (a._visualizerTextureAvailable = !0, a.setImageIndex(n)) } } }
function h(e, r, a) { var u = a.billboard; if (t(u)) { var h = a.position; if (t(h)) { var d = u.image; if (t(d)) { var y, g = u.show,
_ = a._billboardVisualizerIndex,
w = a.isAvailable(r) && (!t(g) || g.getValue(r)); if (!w) return t(_) && (y = e._billboardCollection.get(_), y.setShow(!1), y.setImageIndex(-1), y._visualizerUrl = void 0, y._visualizerTextureAvailable = !1, a._billboardVisualizerIndex = void 0, e._unusedIndexes.push(_)), void 0; if (t(_)) y = e._billboardCollection.get(_);
else { var C = e._unusedIndexes,
x = C.length;
x > 0 ? (_ = C.pop(), y = e._billboardCollection.get(_)) : (_ = e._billboardCollection.getLength(), y = e._billboardCollection.add()), a._billboardVisualizerIndex = _, y.dynamicObject = a, y._visualizerUrl = void 0, y._visualizerTextureAvailable = !1, y.setColor(i.WHITE), y.setEyeOffset(o.ZERO), y.setPixelOffset(n.ZERO), y.setScale(1), y.setHorizontalOrigin(s.CENTER), y.setVerticalOrigin(l.CENTER) } var S = d.getValue(r); if (S !== y._visualizerUrl && (y._visualizerUrl = S, y._visualizerTextureAvailable = !1, e._textureAtlasBuilder.addTextureFromUrl(S, c(a, e._billboardCollection, S))), y.setShow(y._visualizerTextureAvailable), y._visualizerTextureAvailable) { m = h.getValue(r, m), t(m) && y.setPosition(m); var E = u.color; if (t(E) && (p = E.getValue(r, p), t(p) && y.setColor(p)), E = u.eyeOffset, t(E) && (f = E.getValue(r, f), t(f) && y.setEyeOffset(f)), E = u.pixelOffset, t(E) && (v = E.getValue(r, v), t(v) && y.setPixelOffset(v)), E = u.scale, t(E)) { var b = E.getValue(r);
t(b) && y.setScale(b) } if (E = u.rotation, t(E)) { var T = E.getValue(r);
t(T) && y.setRotation(T) } if (E = u.alignedAxis, t(E)) { var A = E.getValue(r);
t(A) && y.setAlignedAxis(A) } if (E = u.horizontalOrigin, t(E)) { var M = E.getValue(r);
t(M) && y.setHorizontalOrigin(M) } if (E = u.verticalOrigin, t(E)) { var P = E.getValue(r);
t(P) && y.setVerticalOrigin(P) } } } } } }
var d = function(r, i) {
if (!t(r)) throw new e("scene is required.");
this._scene = r, this._unusedIndexes = [], this._dynamicObjectCollection = void 0;
var n = this._billboardCollection = new a,
o = this._textureAtlas = r.getContext().createTextureAtlas();
this._textureAtlasBuilder = new u(o), n.setTextureAtlas(o), r.getPrimitives().add(n), this.setDynamicObjectCollection(i)
};
d.prototype.getScene = function() { return this._scene }, d.prototype.getDynamicObjectCollection = function() { return this._dynamicObjectCollection }, d.prototype.setDynamicObjectCollection = function(e) { var r = this._dynamicObjectCollection;
r !== e && (t(r) && (r.objectsRemoved.removeEventListener(d.prototype._onObjectsRemoved, this), this.removeAllPrimitives()), this._dynamicObjectCollection = e, t(e) && e.objectsRemoved.addEventListener(d.prototype._onObjectsRemoved, this)) }, d.prototype.update = function(r) { if (!t(r)) throw new e("time is requied."); if (t(this._dynamicObjectCollection))
for (var i = this._dynamicObjectCollection.getObjects(), n = 0, o = i.length; o > n; n++) h(this, r, i[n]) }, d.prototype.removeAllPrimitives = function() { if (t(this._dynamicObjectCollection)) { this._unusedIndexes = [], this._billboardCollection.removeAll(); for (var e = this._dynamicObjectCollection.getObjects(), r = e.length - 1; r > -1; r--) e[r]._billboardVisualizerIndex = void 0 } }, d.prototype.isDestroyed = function() { return !1 }, d.prototype.destroy = function() { return this.removeAllPrimitives(), this._scene.getPrimitives().remove(this._billboardCollection), r(this) };
var m, p, f, v;
return d.prototype._onObjectsRemoved = function(e, r) { for (var i = this._billboardCollection, n = this._unusedIndexes, o = r.length - 1; o > -1; o--) { var a = r[o],
s = a._billboardVisualizerIndex; if (t(s)) { var l = i.get(s);
l.setShow(!1), l.setImageIndex(-1), l._visualizerUrl = void 0, l._visualizerTextureAvailable = !1, a._billboardVisualizerIndex = void 0, n.push(s) } } }, d
}), r("Renderer/CullFace", ["../Core/Enumeration"], function(e) { "use strict"; var t = { FRONT: new e(1028, "FRONT"), BACK: new e(1029, "BACK"), FRONT_AND_BACK: new e(1032, "FRONT_AND_BACK"), validate: function(e) { return e === t.FRONT || e === t.BACK || e === t.FRONT_AND_BACK } }; return t }), r("Renderer/MipmapHint", ["../Core/Enumeration"], function(e) { "use strict"; var t = { DONT_CARE: new e(4352, "DONT_CARE"), FASTEST: new e(4353, "FASTEST"), NICEST: new e(4354, "NICEST"), validate: function(e) { return e === t.DONT_CARE || e === t.FASTEST || e === t.NICEST } }; return t }), r("Renderer/PixelDatatype", ["../Core/Enumeration"], function(e) { "use strict"; var t = { UNSIGNED_BYTE: new e(5121, "UNSIGNED_BYTE"), UNSIGNED_SHORT: new e(5123, "UNSIGNED_SHORT"), UNSIGNED_INT: new e(5125, "UNSIGNED_INT"), FLOAT: new e(5126, "FLOAT"), UNSIGNED_INT_24_8_WEBGL: new e(34042, "UNSIGNED_INT_24_8_WEBGL"), UNSIGNED_SHORT_4_4_4_4: new e(32819, "UNSIGNED_SHORT_4_4_4_4"), UNSIGNED_SHORT_5_5_5_1: new e(32820, "UNSIGNED_SHORT_5_5_5_1"), UNSIGNED_SHORT_5_6_5: new e(33635, "UNSIGNED_SHORT_5_6_5"), validate: function(e) { return e === t.UNSIGNED_BYTE || e === t.UNSIGNED_SHORT || e === t.UNSIGNED_INT || e === t.FLOAT || e === t.UNSIGNED_INT_24_8_WEBGL || e === t.UNSIGNED_SHORT_4_4_4_4 || e === t.UNSIGNED_SHORT_5_5_5_1 || e === t.UNSIGNED_SHORT_5_6_5 } }; return t }), r("Renderer/PixelFormat", ["../Core/Enumeration"], function(e) { "use strict"; var t = { DEPTH_COMPONENT: new e(6402, "DEPTH_COMPONENT"), DEPTH_STENCIL: new e(34041, "DEPTH_STENCIL"), ALPHA: new e(6406, "ALPHA"), RGB: new e(6407, "RGB"), RGBA: new e(6408, "RGBA"), LUMINANCE: new e(6409, "LUMINANCE"), LUMINANCE_ALPHA: new e(6410, "LUMINANCE_ALPHA"), validate: function(e) { return e === t.DEPTH_COMPONENT || e === t.DEPTH_STENCIL || e === t.ALPHA || e === t.RGB || e === t.RGBA || e === t.LUMINANCE || e === t.LUMINANCE_ALPHA }, isColorFormat: function(e) { return e === t.ALPHA || e === t.RGB || e === t.RGBA || e === t.LUMINANCE || e === t.LUMINANCE_ALPHA }, isDepthFormat: function(e) { return e === t.DEPTH_COMPONENT || e === t.DEPTH_STENCIL } }; return t }), r("Renderer/TextureMagnificationFilter", ["../Core/Enumeration"], function(e) { "use strict"; var t = { NEAREST: new e(9728, "NEAREST"), LINEAR: new e(9729, "LINEAR"), validate: function(e) { return e === t.NEAREST || e === t.LINEAR } }; return t }), r("Renderer/TextureMinificationFilter", ["../Core/Enumeration"], function(e) { "use strict"; var t = { NEAREST: new e(9728, "NEAREST"), LINEAR: new e(9729, "LINEAR"), NEAREST_MIPMAP_NEAREST: new e(9984, "NEAREST_MIPMAP_NEAREST"), LINEAR_MIPMAP_NEAREST: new e(9985, "LINEAR_MIPMAP_NEAREST"), NEAREST_MIPMAP_LINEAR: new e(9986, "NEAREST_MIPMAP_LINEAR"), LINEAR_MIPMAP_LINEAR: new e(9987, "LINEAR_MIPMAP_LINEAR"), validate: function(e) { return e === t.NEAREST || e === t.LINEAR || e === t.NEAREST_MIPMAP_NEAREST || e === t.LINEAR_MIPMAP_NEAREST || e === t.NEAREST_MIPMAP_LINEAR || e === t.LINEAR_MIPMAP_LINEAR } }; return t }), r("Renderer/TextureWrap", ["../Core/Enumeration"], function(e) { "use strict"; var t = { CLAMP: new e(33071, "CLAMP"), REPEAT: new e(10497, "REPEAT"), MIRRORED_REPEAT: new e(33648, "MIRRORED_REPEAT"), validate: function(e) { return e === t.CLAMP || e === t.REPEAT || e === t.MIRRORED_REPEAT } }; return t }), r("Renderer/Texture", ["../Core/Cartesian2", "../Core/defaultValue", "../Core/defined", "../Core/destroyObject", "../Core/DeveloperError", "../Core/Math", "./MipmapHint", "./PixelDatatype", "./PixelFormat", "./TextureMagnificationFilter", "./TextureMinificationFilter", "./TextureWrap"], function(e, t, r, i, n, o, a, s, l, u, c, h) { "use strict"; var d = function(t, r, i, n, o, a, s, l, u, c) { this._gl = t, this._textureFilterAnisotropic = r, this._textureTarget = i, this._texture = n, this._pixelFormat = o, this._pixelDatatype = a, this._width = s, this._height = l, this._dimensions = new e(s, l), this._preMultiplyAlpha = u, this._flipY = c, this._sampler = void 0, this.setSampler() }; return d.prototype.copyFrom = function(e, i, o) { if (!r(e)) throw new n("source is required."); if (l.isDepthFormat(this._pixelFormat)) throw new n("Cannot call copyFrom when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL."); if (i = t(i, 0), o = t(o, 0), 0 > i) throw new n("xOffset must be greater than or equal to zero."); if (0 > o) throw new n("yOffset must be greater than or equal to zero."); var a = e.width,
s = e.height; if (i + a > this._width) throw new n("xOffset + source.width must be less than or equal to getWidth()."); if (o + s > this._height) throw new n("yOffset + source.height must be less than or equal to getHeight()."); var u = this._gl,
c = this._textureTarget;
u.pixelStorei(u.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this._preMultiplyAlpha), u.pixelStorei(u.UNPACK_FLIP_Y_WEBGL, this._flipY), u.activeTexture(u.TEXTURE0), u.bindTexture(c, this._texture), e.arrayBufferView ? u.texSubImage2D(c, 0, i, o, a, s, +this._pixelFormat, +this._pixelDatatype, e.arrayBufferView) : u.texSubImage2D(c, 0, i, o, this._pixelFormat, this._pixelDatatype, e), u.bindTexture(c, null) }, d.prototype.copyFromFramebuffer = function(e, r, i, o, a, u) { if (l.isDepthFormat(this._pixelFormat)) throw new n("Cannot call copyFromFramebuffer when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL."); if (this._pixelDatatype === s.FLOAT) throw new n("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT."); if (e = t(e, 0), r = t(r, 0), i = t(i, 0), o = t(o, 0), a = t(a, this._width), u = t(u, this._height), 0 > e) throw new n("xOffset must be greater than or equal to zero."); if (0 > r) throw new n("yOffset must be greater than or equal to zero."); if (0 > i) throw new n("framebufferXOffset must be greater than or equal to zero."); if (0 > o) throw new n("framebufferYOffset must be greater than or equal to zero."); if (e + a > this._width) throw new n("xOffset + width must be less than or equal to getWidth()."); if (r + u > this._height) throw new n("yOffset + height must be less than or equal to getHeight()."); var c = this._gl,
h = this._textureTarget;
c.activeTexture(c.TEXTURE0), c.bindTexture(h, this._texture), c.copyTexSubImage2D(h, 0, e, r, i, o, a, u), c.bindTexture(h, null) }, d.prototype.generateMipmap = function(e) { if (l.isDepthFormat(this._pixelFormat)) throw new n("Cannot call generateMipmap when the texture pixel format is DEPTH_COMPONENT or DEPTH_STENCIL."); if (this._width > 1 && !o.isPowerOfTwo(this._width)) throw new n("width must be a power of two to call generateMipmap()."); if (this._height > 1 && !o.isPowerOfTwo(this._height)) throw new n("height must be a power of two to call generateMipmap()."); if (e = t(e, a.DONT_CARE), !a.validate(e)) throw new n("hint is invalid."); var r = this._gl,
i = this._textureTarget;
r.hint(r.GENERATE_MIPMAP_HINT, e), r.activeTexture(r.TEXTURE0), r.bindTexture(i, this._texture), r.generateMipmap(i), r.bindTexture(i, null) }, d.prototype.getSampler = function() { return this._sampler }, d.prototype.setSampler = function(e) { if (!r(e)) { var t = c.LINEAR,
i = u.LINEAR;
this._pixelDatatype === s.FLOAT && (t = c.NEAREST, i = u.NEAREST), e = { wrapS: h.CLAMP, wrapT: h.CLAMP, minificationFilter: t, magnificationFilter: i, maximumAnisotropy: 1 } } if (this._pixelDatatype === s.FLOAT) { if (e.minificationFilter !== c.NEAREST && e.minificationFilter !== c.NEAREST_MIPMAP_NEAREST) throw new n("Only NEAREST and NEAREST_MIPMAP_NEAREST minification filters are supported for floating point textures."); if (e.magnificationFilter !== u.NEAREST) throw new n("Only the NEAREST magnification filter is supported for floating point textures.") } var o = this._gl,
a = this._textureTarget;
o.activeTexture(o.TEXTURE0), o.bindTexture(a, this._texture), o.texParameteri(a, o.TEXTURE_MIN_FILTER, e.minificationFilter), o.texParameteri(a, o.TEXTURE_MAG_FILTER, e.magnificationFilter), o.texParameteri(a, o.TEXTURE_WRAP_S, e.wrapS), o.texParameteri(a, o.TEXTURE_WRAP_T, e.wrapT), this._textureFilterAnisotropic && o.texParameteri(a, this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT, e.maximumAnisotropy), o.bindTexture(a, null), this._sampler = { wrapS: e.wrapS, wrapT: e.wrapT, minificationFilter: e.minificationFilter, magnificationFilter: e.magnificationFilter, maximumAnisotropy: e.maximumAnisotropy } }, d.prototype.getPixelFormat = function() { return this._pixelFormat }, d.prototype.getPixelDatatype = function() { return this._pixelDatatype }, d.prototype.getDimensions = function() { return this._dimensions }, d.prototype.getPreMultiplyAlpha = function() { return this._preMultiplyAlpha }, d.prototype.getFlipY = function() { return this._flipY }, d.prototype.getWidth = function() { return this._width }, d.prototype.getHeight = function() { return this._height }, d.prototype._getTexture = function() { return this._texture }, d.prototype._getTarget = function() { return this._textureTarget }, d.prototype.isDestroyed = function() { return !1 }, d.prototype.destroy = function() { return this._gl.deleteTexture(this._texture), i(this) }, d }), r("Renderer/CubeMapFace", ["../Core/defaultValue", "../Core/DeveloperError", "./PixelDatatype"], function(e, t, r) { "use strict"; var i = function(e, t, r, i, n, o, a, s, l) { this._gl = e, this._texture = t, this._textureTarget = r, this._targetFace = i, this._pixelFormat = n, this._pixelDatatype = o, this._size = a, this._preMultiplyAlpha = s, this._flipY = l }; return i.prototype.copyFrom = function(r, i, n) { if (!r) throw new t("source is required.");
i = e(i, 0), n = e(n, 0); var o = r.width,
a = r.height; if (0 > i) throw new t("xOffset must be greater than or equal to zero."); if (0 > n) throw new t("yOffset must be greater than or equal to zero."); if (i + o > this._size) throw new t("xOffset + source.width must be less than or equal to getWidth()."); if (n + a > this._size) throw new t("yOffset + source.height must be less than or equal to getHeight()."); var s = this._gl,
l = this._textureTarget;
s.pixelStorei(s.UNPACK_PREMULTIPLY_ALPHA_WEBGL, this._preMultiplyAlpha), s.pixelStorei(s.UNPACK_FLIP_Y_WEBGL, this._flipY), s.activeTexture(s.TEXTURE0), s.bindTexture(l, this._texture), r.arrayBufferView ? s.texSubImage2D(this._targetFace, 0, i, n, o, a, +this._pixelFormat, +this._pixelDatatype, r.arrayBufferView) : s.texSubImage2D(this._targetFace, 0, i, n, +this._pixelFormat, +this._pixelDatatype, r), s.bindTexture(l, null) }, i.prototype.copyFromFramebuffer = function(i, n, o, a, s, l) { if (i = e(i, 0), n = e(n, 0), o = e(o, 0), a = e(a, 0), s = e(s, this._size), l = e(l, this._size), 0 > i) throw new t("xOffset must be greater than or equal to zero."); if (0 > n) throw new t("yOffset must be greater than or equal to zero."); if (0 > o) throw new t("framebufferXOffset must be greater than or equal to zero."); if (0 > a) throw new t("framebufferYOffset must be greater than or equal to zero."); if (i + s > this._size) throw new t("xOffset + source.width must be less than or equal to getWidth()."); if (n + l > this._size) throw new t("yOffset + source.height must be less than or equal to getHeight()."); if (this._pixelDatatype === r.FLOAT) throw new t("Cannot call copyFromFramebuffer when the texture pixel data type is FLOAT."); var u = this._gl,
c = this._textureTarget;
u.activeTexture(u.TEXTURE0), u.bindTexture(c, this._texture), u.copyTexSubImage2D(this._targetFace, 0, i, n, o, a, s, l), u.bindTexture(c, null) }, i.prototype.getPixelFormat = function() { return this._pixelFormat }, i.prototype.getPixelDatatype = function() { return this._pixelDatatype }, i.prototype._getTexture = function() { return this._texture }, i.prototype._getTarget = function() { return this._targetFace }, i }), r("Renderer/CubeMap", ["../Core/defined", "../Core/DeveloperError", "../Core/destroyObject", "../Core/Math", "./MipmapHint", "./PixelDatatype", "./TextureMagnificationFilter", "./TextureMinificationFilter", "./TextureWrap", "./CubeMapFace"], function(e, t, r, i, n, o, a, s, l, u) { "use strict"; var c = function(e, t, r, i, n, o, a, s, l) { this._gl = e, this._textureFilterAnisotropic = t, this._textureTarget = r, this._texture = i, this._pixelFormat = n, this._pixelDatatype = o, this._size = a, this._preMultiplyAlpha = s, this._flipY = l, this._sampler = void 0, this._positiveX = new u(e, i, r, e.TEXTURE_CUBE_MAP_POSITIVE_X, n, o, a, s, l), this._negativeX = new u(e, i, r, e.TEXTURE_CUBE_MAP_NEGATIVE_X, n, o, a, s, l), this._positiveY = new u(e, i, r, e.TEXTURE_CUBE_MAP_POSITIVE_Y, n, o, a, s, l), this._negativeY = new u(e, i, r, e.TEXTURE_CUBE_MAP_NEGATIVE_Y, n, o, a, s, l), this._positiveZ = new u(e, i, r, e.TEXTURE_CUBE_MAP_POSITIVE_Z, n, o, a, s, l), this._negativeZ = new u(e, i, r, e.TEXTURE_CUBE_MAP_NEGATIVE_Z, n, o, a, s, l), this.setSampler() }; return c.prototype.getPositiveX = function() { return this._positiveX }, c.prototype.getNegativeX = function() { return this._negativeX }, c.prototype.getPositiveY = function() { return this._positiveY }, c.prototype.getNegativeY = function() { return this._negativeY }, c.prototype.getPositiveZ = function() { return this._positiveZ }, c.prototype.getNegativeZ = function() { return this._negativeZ }, c.prototype.generateMipmap = function(e) { if (this._size > 1 && !i.isPowerOfTwo(this._size)) throw new t("width and height must be a power of two to call generateMipmap()."); if (e = e || n.DONT_CARE, !n.validate(e)) throw new t("hint is invalid."); var r = this._gl,
o = this._textureTarget;
r.hint(r.GENERATE_MIPMAP_HINT, e), r.activeTexture(r.TEXTURE0), r.bindTexture(o, this._texture), r.generateMipmap(o), r.bindTexture(o, null) }, c.prototype.setSampler = function(r) { if (!e(r)) { var i = s.LINEAR,
n = a.LINEAR;
this._pixelDatatype === o.FLOAT && (i = s.NEAREST, n = a.NEAREST), r = { wrapS: l.CLAMP, wrapT: l.CLAMP, minificationFilter: i, magnificationFilter: n, maximumAnisotropy: 1 } } if (this._pixelDatatype === o.FLOAT) { if (r.minificationFilter !== s.NEAREST && r.minificationFilter !== s.NEAREST_MIPMAP_NEAREST) throw new t("Only NEAREST and NEAREST_MIPMAP_NEAREST minification filters are supported for floating point textures."); if (r.magnificationFilter !== a.NEAREST) throw new t("Only the NEAREST magnification filter is supported for floating point textures.") } var u = this._gl,
c = this._textureTarget;
u.activeTexture(u.TEXTURE0), u.bindTexture(c, this._texture), u.texParameteri(c, u.TEXTURE_MIN_FILTER, r.minificationFilter), u.texParameteri(c, u.TEXTURE_MAG_FILTER, r.magnificationFilter), u.texParameteri(c, u.TEXTURE_WRAP_S, r.wrapS), u.texParameteri(c, u.TEXTURE_WRAP_T, r.wrapT), this._textureFilterAnisotropic && u.texParameteri(c, this._textureFilterAnisotropic.TEXTURE_MAX_ANISOTROPY_EXT, r.maximumAnisotropy), u.bindTexture(c, null), this._sampler = { wrapS: r.wrapS, wrapT: r.wrapT, minificationFilter: r.minificationFilter, magnificationFilter: r.magnificationFilter, maximumAnisotropy: r.maximumAnisotropy } }, c.prototype.getSampler = function() { return this._sampler }, c.prototype.getPixelFormat = function() { return this._pixelFormat }, c.prototype.getPixelDatatype = function() { return this._pixelDatatype }, c.prototype.getWidth = function() { return this._size }, c.prototype.getHeight = function() { return this._size }, c.prototype.getPreMultiplyAlpha = function() { return this._preMultiplyAlpha }, c.prototype.getFlipY = function() { return this._flipY }, c.prototype._getTexture = function() { return this._texture }, c.prototype._getTarget = function() { return this._textureTarget }, c.prototype.isDestroyed = function() { return !1 }, c.prototype.destroy = function() { return this._gl.deleteTexture(this._texture), this._positiveX = r(this._positiveX), this._negativeX = r(this._negativeX), this._positiveY = r(this._positiveY), this._negativeY = r(this._negativeY), this._positiveZ = r(this._positiveZ), this._negativeZ = r(this._negativeZ), r(this) }, c }), r("Shaders/Materials/AsphaltMaterial", [], function() { "use strict"; return "uniform vec4 asphaltColor;\nuniform float bumpSize;\nuniform float roughness;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 color = asphaltColor;\nvec2 st = materialInput.st;\nvec2 F = czm_cellular(st / bumpSize);\ncolor.rgb -= (F.x / F.y) * 0.1;\nfloat noise = czm_snoise(st / bumpSize);\nnoise = pow(noise, 5.0) * roughness;\ncolor.rgb += noise;\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n" }), r("Shaders/Materials/BlobMaterial", [], function() { "use strict"; return "uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform float frequency;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 F = czm_cellular(materialInput.st * frequency);\nfloat t = 1.0 - F.x * F.x;\nvec4 color = mix(lightColor, darkColor, t);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n" }), r("Shaders/Materials/BrickMaterial", [], function() { "use strict"; return "uniform vec4 brickColor;\nuniform vec4 mortarColor;\nuniform vec2 brickSize;\nuniform vec2 brickPct;\nuniform float brickRoughness;\nuniform float mortarRoughness;\n#define Integral(x, p) ((floor(x) * p) + max(fract(x) - (1.0 - p), 0.0))\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nvec2 position = st / brickSize;\nif(fract(position.y * 0.5) > 0.5) {\nposition.x += 0.5;\n}\nvec2 filterWidth = vec2(0.02);\nvec2 useBrick = (Integral(position + filterWidth, brickPct) -\nIntegral(position, brickPct)) / filterWidth;\nfloat useBrickFinal = useBrick.x * useBrick.y;\nvec4 color = mix(mortarColor, brickColor, useBrickFinal);\nvec2 brickScaled = vec2(st.x / 0.1, st.y / 0.006);\nfloat brickNoise = abs(czm_snoise(brickScaled) * brickRoughness / 5.0);\ncolor.rg += brickNoise * useBrickFinal;\nvec2 mortarScaled = st / 0.005;\nfloat mortarNoise = max(czm_snoise(mortarScaled) * mortarRoughness, 0.0);\ncolor.rgb += mortarNoise * (1.0 - useBrickFinal);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n" }), r("Shaders/Materials/BumpMapMaterial", [], function() { "use strict"; return "uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nvec2 centerPixel = fract(repeat * st);\nfloat centerBump = texture2D(image, centerPixel).channel;\nfloat imageWidth = float(imageDimensions.x);\nvec2 rightPixel = fract(repeat * (st + vec2(1.0 / imageWidth, 0.0)));\nfloat rightBump = texture2D(image, rightPixel).channel;\nfloat imageHeight = float(imageDimensions.y);\nvec2 leftPixel = fract(repeat * (st + vec2(0.0, 1.0 / imageHeight)));\nfloat topBump = texture2D(image, leftPixel).channel;\nvec3 normalTangentSpace = normalize(vec3(centerBump - rightBump, centerBump - topBump, clamp(1.0 - strength, 0.1, 1.0)));\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nmaterial.diffuse = vec3(0.01);\nreturn material;\n}\n" }), r("Shaders/Materials/CementMaterial", [], function() { "use strict"; return "uniform vec4 cementColor;\nuniform float grainScale;\nuniform float roughness;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat noise = czm_snoise(materialInput.st / grainScale);\nnoise = pow(noise, 5.0) * roughness;\nvec4 color = cementColor;\ncolor.rgb += noise;\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n" }), r("Shaders/Materials/CheckerboardMaterial", [], function() { "use strict"; return "uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat b = mod(floor(repeat.s * st.s) + floor(repeat.t * st.t), 2.0);\nfloat scaledWidth = fract(repeat.s * st.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(repeat.t * st.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value = min(scaledWidth, scaledHeight);\nvec4 currentColor = mix(lightColor, darkColor, b);\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, value, 0.03);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n" }), r("Shaders/Materials/DotMaterial", [], function() { "use strict"; return "uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat b = smoothstep(0.3, 0.32, length(fract(repeat * materialInput.st) - 0.5));\nvec4 color = mix(lightColor, darkColor, b);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n" }), r("Shaders/Materials/FacetMaterial", [], function() { "use strict"; return "uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform float frequency;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 F = czm_cellular(materialInput.st * frequency);\nfloat t = 0.1 + (F.y - F.x);\nvec4 color = mix(lightColor, darkColor, t);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n" }), r("Shaders/Materials/FresnelMaterial", [], function() { "use strict"; return "czm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec3 normalWC = normalize(czm_inverseViewRotation * material.normal);\nvec3 positionWC = normalize(czm_inverseViewRotation * materialInput.positionToEyeEC);\nfloat cosAngIncidence = max(dot(normalWC, positionWC), 0.0);\nmaterial.diffuse = mix(reflection.diffuse, refraction.diffuse, cosAngIncidence);\nreturn material;\n}\n" }), r("Shaders/Materials/GrassMaterial", [], function() { "use strict"; return "uniform vec4 grassColor;\nuniform vec4 dirtColor;\nuniform float patchiness;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat noise1 = (czm_snoise(st * patchiness * 1.0)) * 1.0;\nfloat noise2 = (czm_snoise(st * patchiness * 2.0)) * 0.5;\nfloat noise3 = (czm_snoise(st * patchiness * 4.0)) * 0.25;\nfloat noise = sin(noise1 + noise2 + noise3) * 0.1;\nvec4 color = mix(grassColor, dirtColor, noise);\nfloat verticalNoise = czm_snoise(vec2(st.x * 100.0, st.y * 20.0)) * 0.02;\nfloat horizontalNoise = czm_snoise(vec2(st.x * 20.0, st.y * 100.0)) * 0.02;\nfloat stripeNoise = min(verticalNoise, horizontalNoise);\ncolor.rgb += stripeNoise;\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n" }), r("Shaders/Materials/GridMaterial", [], function() { "use strict"; return "#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform vec4 color;\nuniform float cellAlpha;\nuniform vec2 lineCount;\nuniform vec2 lineThickness;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat scaledWidth = fract(lineCount.s * st.s);\nscaledWidth = abs(scaledWidth - floor(scaledWidth + 0.5));\nfloat scaledHeight = fract(lineCount.t * st.t);\nscaledHeight = abs(scaledHeight - floor(scaledHeight + 0.5));\nfloat value;\n#ifdef GL_OES_standard_derivatives\nconst float fuzz = 1.2;\nvec2 thickness = lineThickness - 1.0;\nvec2 dx = abs(dFdx(st));\nvec2 dy = abs(dFdy(st));\nvec2 dF = vec2(max(dx.s, dy.s), max(dx.t, dy.t)) * lineCount;\nvalue = min(\nsmoothstep(dF.s * thickness.s, dF.s * (fuzz + thickness.s), scaledWidth),\nsmoothstep(dF.t * thickness.t, dF.t * (fuzz + thickness.t), scaledHeight));\n#else\nconst float fuzz = 0.05;\nvec2 range = 0.5 - (lineThickness * 0.05);\nvalue = min(\n1.0 - smoothstep(range.s, range.s + fuzz, scaledWidth),\n1.0 - smoothstep(range.t, range.t + fuzz, scaledHeight));\n#endif\nfloat dRim = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\nfloat sRim = smoothstep(0.8, 1.0, dRim);\nvalue *= (1.0 - sRim);\nvec3 halfColor = color.rgb * 0.5;\nmaterial.diffuse = halfColor;\nmaterial.emission = halfColor;\nmaterial.alpha = color.a * (1.0 - ((1.0 - cellAlpha) * value));\nreturn material;\n}\n" }), r("Shaders/Materials/NormalMapMaterial", [], function() { "use strict"; return "uniform sampler2D image;\nuniform float strength;\nuniform vec2 repeat;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec4 textureValue = texture2D(image, fract(repeat * materialInput.st));\nvec3 normalTangentSpace = textureValue.channels;\nnormalTangentSpace.xy = normalTangentSpace.xy * 2.0 - 1.0;\nnormalTangentSpace.z = clamp(1.0 - strength, 0.1, 1.0);\nnormalTangentSpace = normalize(normalTangentSpace);\nvec3 normalEC = materialInput.tangentToEyeMatrix * normalTangentSpace;\nmaterial.normal = normalEC;\nreturn material;\n}\n" }), r("Shaders/Materials/ReflectionMaterial", [], function() { "use strict"; return "uniform samplerCube cubeMap;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec3 normalWC = normalize(czm_inverseViewRotation * material.normal);\nvec3 positionWC = normalize(czm_inverseViewRotation * materialInput.positionToEyeEC);\nvec3 reflectedWC = reflect(positionWC, normalWC);\nmaterial.diffuse = textureCube(cubeMap, reflectedWC).channels;\nreturn material;\n}\n" }), r("Shaders/Materials/RefractionMaterial", [], function() { "use strict"; return "uniform samplerCube cubeMap;\nuniform float indexOfRefractionRatio;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec3 normalWC = normalize(czm_inverseViewRotation * material.normal);\nvec3 positionWC = normalize(czm_inverseViewRotation * materialInput.positionToEyeEC);\nvec3 refractedWC = refract(positionWC, -normalWC, indexOfRefractionRatio);\nmaterial.diffuse = textureCube(cubeMap, refractedWC).channels;\nreturn material;\n}\n" }), r("Shaders/Materials/StripeMaterial", [], function() { "use strict"; return "uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform float offset;\nuniform float repeat;\nuniform bool horizontal;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat coord = mix(materialInput.st.s, materialInput.st.t, float(horizontal));\nfloat value = fract((coord - offset) * (repeat * 0.5));\nfloat dist = min(value, min(abs(value - 0.5), 1.0 - value));\nvec4 currentColor = mix(lightColor, darkColor, step(0.5, value));\nvec4 color = czm_antialias(lightColor, darkColor, currentColor, dist);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n" }), r("Shaders/Materials/TieDyeMaterial", [], function() { "use strict"; return "uniform vec4 lightColor;\nuniform vec4 darkColor;\nuniform float frequency;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec3 scaled = materialInput.str * frequency;\nfloat t = abs(czm_snoise(scaled));\nvec4 color = mix(lightColor, darkColor, t);\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n" }), r("Shaders/Materials/Water", [], function() { "use strict"; return "uniform sampler2D specularMap;\nuniform sampler2D normalMap;\nuniform vec4 baseWaterColor;\nuniform vec4 blendColor;\nuniform float frequency;\nuniform float animationSpeed;\nuniform float amplitude;\nuniform float specularIntensity;\nuniform float fadeFactor;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat time = czm_frameNumber * animationSpeed;\nfloat fade = max(1.0, (length(materialInput.positionToEyeEC) / 10000000000.0) * frequency * fadeFactor);\nfloat specularMapValue = texture2D(specularMap, materialInput.st).r;\nvec4 noise = czm_getWaterNoise(normalMap, materialInput.st * frequency, time, 0.0);\nvec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / amplitude));\nnormalTangentSpace.xy /= fade;\nnormalTangentSpace = mix(vec3(0.0, 0.0, 50.0), normalTangentSpace, specularMapValue);\nnormalTangentSpace = normalize(normalTangentSpace);\nfloat tsPerturbationRatio = clamp(dot(normalTangentSpace, vec3(0.0, 0.0, 1.0)), 0.0, 1.0);\nmaterial.alpha = specularMapValue;\nmaterial.diffuse = mix(blendColor.rgb, baseWaterColor.rgb, specularMapValue);\nmaterial.diffuse += (0.1 * tsPerturbationRatio);\nmaterial.normal = normalize(materialInput.tangentToEyeMatrix * normalTangentSpace);\nmaterial.specular = specularIntensity;\nmaterial.shininess = 10.0;\nreturn material;\n}\n" }), r("Shaders/Materials/WoodMaterial", [], function() { "use strict"; return "uniform vec4 lightWoodColor;\nuniform vec4 darkWoodColor;\nuniform float ringFrequency;\nuniform vec2 noiseScale;\nuniform float grainFrequency;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nvec2 noisevec;\nnoisevec.x = czm_snoise(st * noiseScale.x);\nnoisevec.y = czm_snoise(st * noiseScale.y);\nvec2 location = st + noisevec;\nfloat dist = sqrt(location.x * location.x + location.y * location.y);\ndist *= ringFrequency;\nfloat r = fract(dist + noisevec[0] + noisevec[1]) * 2.0;\nif(r > 1.0)\nr = 2.0 - r;\nvec4 color = mix(lightWoodColor, darkWoodColor, r);\nr = abs(czm_snoise(vec2(st.x * grainFrequency, st.y * grainFrequency * 0.02))) * 0.2;\ncolor.rgb += lightWoodColor.rgb * r;\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n" }), r("Shaders/Materials/RimLightingMaterial", [], function() { "use strict"; return "uniform vec4 color;\nuniform vec4 rimColor;\nuniform float width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat d = 1.0 - dot(materialInput.normalEC, normalize(materialInput.positionToEyeEC));\nfloat s = smoothstep(1.0 - width, 1.0, d);\nmaterial.diffuse = color.rgb;\nmaterial.emission = rimColor.rgb * s;\nmaterial.alpha = mix(color.a, rimColor.a, s);\nreturn material;\n}\n" }), r("Shaders/Materials/ErosionMaterial", [], function() { "use strict"; return "uniform vec4 color;\nuniform float time;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nfloat alpha = 1.0;\nif (time != 1.0)\n{\nfloat t = 0.5 + (0.5 * czm_snoise(materialInput.str / (1.0 / 10.0)));\nif (t > time)\n{\nalpha = 0.0;\n}\n}\nmaterial.diffuse = color.rgb;\nmaterial.alpha = color.a * alpha;\nreturn material;\n}\n" }), r("Shaders/Materials/FadeMaterial", [], function() {
"use strict";
return "uniform vec4 fadeInColor;\nuniform vec4 fadeOutColor;\nuniform float maximumDistance;\nuniform bool repeat;\nuniform vec2 fadeDirection;\nuniform vec2 time;\nfloat getTime(float t, float coord)\n{\nfloat scalar = 1.0 / maximumDistance;\nfloat q = distance(t, coord) * scalar;\nif (repeat)\n{\nfloat r = distance(t, coord + 1.0) * scalar;\nfloat s = distance(t, coord - 1.0) * scalar;\nq = min(min(r, s), q);\n}\nreturn clamp(q, 0.0, 1.0);\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat s = getTime(time.x, st.s) * fadeDirection.s;\nfloat t = getTime(time.y, st.t) * fadeDirection.t;\nfloat u = length(vec2(s, t));\nvec4 color = mix(fadeInColor, fadeOutColor, u);\nmaterial.emission = color.rgb;\nmaterial.alpha = color.a;\nreturn material;\n}\n"
}), r("Shaders/Materials/PolylineArrowMaterial", [], function() { "use strict"; return "#extension GL_OES_standard_derivatives : enable\nuniform vec4 color;\nvarying float v_width;\nfloat getPointOnLine(vec2 p0, vec2 p1, float x)\n{\nfloat slope = (p0.y - p1.y) / (p0.x - p1.x);\nreturn slope * (x - p0.x) + p0.y;\n}\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat base = 1.0 - abs(fwidth(st.s)) * 10.0;\nvec2 center = vec2(1.0, 0.5);\nfloat ptOnUpperLine = getPointOnLine(vec2(base, 1.0), center, st.s);\nfloat ptOnLowerLine = getPointOnLine(vec2(base, 0.0), center, st.s);\nfloat halfWidth = 0.15;\nfloat s = step(0.5 - halfWidth, st.t);\ns *= 1.0 - step(0.5 + halfWidth, st.t);\ns *= 1.0 - step(base, st.s);\nfloat t = step(base, materialInput.st.s);\nt *= 1.0 - step(ptOnUpperLine, st.t);\nt *= step(ptOnLowerLine, st.t);\nfloat dist;\nif (st.s < base)\n{\nfloat d1 = abs(st.t - (0.5 - halfWidth));\nfloat d2 = abs(st.t - (0.5 + halfWidth));\ndist = min(d1, d2);\n}\nelse\n{\nfloat d1 = czm_infinity;\nif (st.t < 0.5 - halfWidth && st.t > 0.5 + halfWidth)\n{\nd1 = abs(st.s - base);\n}\nfloat d2 = abs(st.t - ptOnUpperLine);\nfloat d3 = abs(st.t - ptOnLowerLine);\ndist = min(min(d1, d2), d3);\n}\nvec4 outsideColor = vec4(0.0);\nvec4 currentColor = mix(outsideColor, color, clamp(s + t, 0.0, 1.0));\nvec4 outColor = czm_antialias(outsideColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n" }), r("Shaders/Materials/PolylineGlowMaterial", [], function() { "use strict"; return "uniform vec4 color;\nuniform float glowPower;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat glow = glowPower / abs(st.t - 0.5);\nmaterial.emission = max(vec3(glow - 1.0 + color.rgb), color.rgb);\nmaterial.alpha = clamp(0.0, 1.0, glow) * color.a;\nreturn material;\n}\n" }), r("Shaders/Materials/PolylineOutlineMaterial", [], function() { "use strict"; return "uniform vec4 color;\nuniform vec4 outlineColor;\nuniform float outlineWidth;\nvarying float v_width;\nczm_material czm_getMaterial(czm_materialInput materialInput)\n{\nczm_material material = czm_getDefaultMaterial(materialInput);\nvec2 st = materialInput.st;\nfloat halfInteriorWidth = 0.5 * (v_width - outlineWidth) / v_width;\nfloat b = step(0.5 - halfInteriorWidth, st.t);\nb *= 1.0 - step(0.5 + halfInteriorWidth, st.t);\nfloat d1 = abs(st.t - (0.5 - halfInteriorWidth));\nfloat d2 = abs(st.t - (0.5 + halfInteriorWidth));\nfloat dist = min(d1, d2);\nvec4 currentColor = mix(outlineColor, color, b);\nvec4 outColor = czm_antialias(outlineColor, color, currentColor, dist);\nmaterial.diffuse = outColor.rgb;\nmaterial.alpha = outColor.a;\nreturn material;\n}\n" }), r("Scene/Material", ["../ThirdParty/when", "../Core/loadImage", "../Core/DeveloperError", "../Core/createGuid", "../Core/clone", "../Core/Color", "../Core/combine", "../Core/defaultValue", "../Core/defined", "../Core/destroyObject", "../Core/Cartesian2", "../Core/Matrix2", "../Core/Matrix3", "../Core/Matrix4", "../Renderer/Texture", "../Renderer/CubeMap", "../Shaders/Materials/AsphaltMaterial", "../Shaders/Materials/BlobMaterial", "../Shaders/Materials/BrickMaterial", "../Shaders/Materials/BumpMapMaterial", "../Shaders/Materials/CementMaterial", "../Shaders/Materials/CheckerboardMaterial", "../Shaders/Materials/DotMaterial", "../Shaders/Materials/FacetMaterial", "../Shaders/Materials/FresnelMaterial", "../Shaders/Materials/GrassMaterial", "../Shaders/Materials/GridMaterial", "../Shaders/Materials/NormalMapMaterial", "../Shaders/Materials/ReflectionMaterial", "../Shaders/Materials/RefractionMaterial", "../Shaders/Materials/StripeMaterial", "../Shaders/Materials/TieDyeMaterial", "../Shaders/Materials/Water", "../Shaders/Materials/WoodMaterial", "../Shaders/Materials/RimLightingMaterial", "../Shaders/Materials/ErosionMaterial", "../Shaders/Materials/FadeMaterial", "../Shaders/Materials/PolylineArrowMaterial", "../Shaders/Materials/PolylineGlowMaterial", "../Shaders/Materials/PolylineOutlineMaterial"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C, x, S, E, b, T, A, M, P, D, I, O, R, L, z, N, F, B, V) { "use strict";
function q(e, t) { e = s(e, s.EMPTY_OBJECT), t._context = e.context, t._strict = s(e.strict, !1), t._count = s(e.count, 0), t._template = n(s(e.fabric, s.EMPTY_OBJECT)), t._template.uniforms = n(s(t._template.uniforms, s.EMPTY_OBJECT)), t._template.materials = n(s(t._template.materials, s.EMPTY_OBJECT)), t.type = l(t._template.type) ? t._template.type : i(), t.shaderSource = "", t.materials = {}, t.uniforms = {}, t._uniforms = {}; var r = $._materialCache.getMaterial(t.type); if (l(r)) { var o = n(r, !0);
t._template = a([t._template, o]) } G(t), l(r) || $._materialCache.addMaterial(t.type, t._template), H(t), j(t), K(t) }
function k(e, t, r, i) { if (l(e))
for (var n in e)
if (e.hasOwnProperty(n)) { var o = -1 !== t.indexOf(n);
(i && !o || !i && o) && r(n, t) } }
function U(e, t) { for (var i = "fabric: property name '" + e + "' is not valid. It should be ", n = 0; n < t.length; n++) { var o = "'" + t[n] + "'";
i += n === t.length - 1 ? "or " + o + "." : o + ", " } throw new r(i) }
function W(e) { var t = "fabric: uniforms and materials cannot share the same property '" + e + "'"; throw new r(t) }
function G(e) { var t = e._template,
i = t.uniforms,
n = t.materials,
o = t.components; if (l(o) && l(t.source)) throw new r("fabric: cannot have source and components in the same template.");
k(t, et, U, !0), k(o, tt, U, !0); var a = []; for (var s in n) n.hasOwnProperty(s) && a.push(s);
k(i, a, W, !1) }
function H(e) { var t = e._template.components,
r = e._template.source; if (l(r)) e.shaderSource += r + "\n";
else { if (e.shaderSource += "czm_material czm_getMaterial(czm_materialInput materialInput)\n{\n", e.shaderSource += "czm_material material = czm_getDefaultMaterial(materialInput);\n", l(t))
for (var i in t) t.hasOwnProperty(i) && (e.shaderSource += "material." + i + " = " + t[i] + ";\n");
e.shaderSource += "return material;\n}\n" } }
function j(e) { var t = e._template.uniforms; for (var r in t) t.hasOwnProperty(r) && Y(e, r) }
function Y(e, t) { var i = e._strict,
n = e._template.uniforms,
o = n[t],
a = Z(o); if (!l(a)) throw new r("fabric: uniform '" + t + "' has invalid type."); if ("channels" === a) { if (0 === J(e, t, o, !1) && i) throw new r("strict: shader source does not use channels '" + t + "'.") } else { if (-1 !== a.indexOf("sampler") && !l(e._context)) throw new r("image: context is not defined"); if ("sampler2D" === a) { var s = t + "Dimensions";
Q(e, s) > 0 && (n[s] = { type: "ivec3", x: 1, y: 1 }, Y(e, s)) } var u = "uniform " + a + " " + t + ";\n"; - 1 === e.shaderSource.indexOf(u) && (e.shaderSource = u + e.shaderSource); var c = t + "_" + e._count++; if (1 === J(e, t, c) && i) throw new r("strict: shader source does not use uniform '" + t + "'.");
e.uniforms[t] = o, e._uniforms[c] = X(e, t, a) } }
function X(e, t, i) { return function() { var n = e.uniforms,
o = n[t],
a = Z(o); if ("sampler2D" === i && (a === i || o instanceof p)) { a === i && (o = $._textureCache.registerTexture2DToMaterial(e, t, o)); var s = t + "Dimensions"; if (n.hasOwnProperty(s)) { var u = n[s];
u.x = o._width, u.y = o._height } } else if ("samplerCube" === i && (a === i || o instanceof f)) a === i && (o = $._textureCache.registerCubeMapToMaterial(e, t, o));
else if (-1 !== i.indexOf("mat") && (a === i || o instanceof rt[i])) a === i && (o = rt[i].fromColumnMajorArray(o));
else if (!l(a) || i !== a) throw new r("fabric: uniform '" + t + "' has invalid value."); return n[t] = o, n[t] } }
function Z(e) { var t = e.type; if (!l(t)) { var r = typeof e; if ("number" === r) t = "float";
else if ("boolean" === r) t = "bool";
else if ("string" === r) t = /^([rgba]){1,4}$/i.test(e) ? "channels" : e === $.DefaultCubeMapId ? "samplerCube" : "sampler2D";
else if ("object" === r)
if (Array.isArray(e))(4 === e.length || 9 === e.length || 16 === e.length) && (t = "mat" + Math.sqrt(e.length));
else { var i = 0; for (var n in e) e.hasOwnProperty(n) && (i += 1);
i >= 2 && 4 >= i ? t = "vec" + i : 6 === i && (t = "samplerCube") } } return t }
function K(e) { var t = e._context,
i = e._strict,
n = e._template.materials; for (var o in n)
if (n.hasOwnProperty(o)) { var s = new $({ context: t, strict: i, fabric: n[o], count: e._count });
e._count = s._count, e._uniforms = a([e._uniforms, s._uniforms]), e.materials[o] = s; var l = "czm_getMaterial",
u = l + "_" + e._count++;
J(s, l, u), e.shaderSource = s.shaderSource + e.shaderSource; var c = u + "(materialInput)"; if (0 === J(e, o, c) && i) throw new r("strict: shader source does not use material '" + o + "'.") } }
function J(e, t, r, i) { i = s(i, !0); var n = 0,
o = "a-zA-Z0-9_",
a = "([" + o + "])?",
l = "([" + o + (i ? "." : "") + "])?",
u = new RegExp(l + t + a, "g"); return e.shaderSource = e.shaderSource.replace(u, function(e, t, i) { return t || i ? e : (n += 1, r) }), n }
function Q(e, t, r) { return J(e, t, t, r) } var $ = function(e) { this.type = void 0, this.shaderSource = void 0, this.materials = void 0, this.uniforms = void 0, this._uniforms = void 0, this._context = void 0, this._strict = void 0, this._template = void 0, this._count = void 0, q(e, this), Object.defineProperty(this, "type", { value: this.type, writable: !1 }), l($._uniformList[this.type]) || ($._uniformList[this.type] = Object.keys(this._uniforms)) };
$._uniformList = {}, $.fromType = function(e, t) { if (!l($._materialCache.getMaterial(t))) throw new r("material with type '" + t + "' does not exist."); return new $({ context: e, fabric: { type: t } }) }, $.prototype.isDestroyed = function() { return !1 }, $.prototype.destroy = function() { var e = this.materials,
t = this.uniforms; for (var r in t)
if (t.hasOwnProperty(r)) { var i = t[r];
(i instanceof p || i instanceof f) && $._textureCache.releaseTexture(this, i) }
for (var n in e) e.hasOwnProperty(n) && e[n].destroy(); return u(this) }; var et = ["type", "materials", "uniforms", "components", "source"],
tt = ["diffuse", "specular", "shininess", "normal", "emission", "alpha"],
rt = { mat2: h, mat3: d, mat4: m }; return $._textureCache = { _pathsToMaterials: {}, _pathsToTextures: {}, _updateMaterialsOnLoad: function(e, t) { this._pathsToTextures[t] = e; for (var r = this._pathsToMaterials[t], i = 0; i < r.length; i++) { var n = r[i],
o = n.material,
a = n.property;
this.releaseTexture(o, o.uniforms[a]), o.uniforms[a] = e } }, releaseTexture: function(e, t) { var r = this._pathsToTextures; for (var i in r)
if (r[i] === t)
for (var n = this._pathsToMaterials[i], o = 0; o < n.length; o++)
if (n[o].material === e) { n.splice(o, 1); var a = n.length;
0 === a && (t.destroy(), delete r.path, delete n.path) } }, registerCubeMapToMaterial: function(r, i, n) { var o, a = this; if (n === $.DefaultCubeMapId) o = r._context.getDefaultCubeMap();
else { var u = n.positiveX + n.negativeX + n.positiveY + n.negativeY + n.positiveZ + n.negativeZ; if (this._pathsToMaterials[u] = s(this._pathsToMaterials[u], []), this._pathsToMaterials[u].push({ material: r, property: i }), o = this._pathsToTextures[u], !l(o)) { var c = r.uniforms[i],
h = c instanceof f;
o = h ? c : r._context.getDefaultCubeMap(), 1 === this._pathsToMaterials[u].length && e.all([t(n.positiveX), t(n.negativeX), t(n.positiveY), t(n.negativeY), t(n.positiveZ), t(n.negativeZ)]).then(function(e) { o = r._context.createCubeMap({ source: { positiveX: e[0], negativeX: e[1], positiveY: e[2], negativeY: e[3], positiveZ: e[4], negativeZ: e[5] } }), a._updateMaterialsOnLoad(o, u) }) } } return o }, registerTexture2DToMaterial: function(r, i, n) { var o, a = this; if (n === $.DefaultImageId) o = r._context.getDefaultTexture();
else { var u = n; if (this._pathsToMaterials[u] = s(this._pathsToMaterials[u], []), this._pathsToMaterials[u].push({ material: r, property: i }), o = this._pathsToTextures[u], !l(o)) { var c = r.uniforms[i],
h = c instanceof p;
o = h ? c : r._context.getDefaultTexture(), 1 === this._pathsToMaterials[u].length && e(t(u), function(e) { o = r._context.createTexture2D({ source: e }), a._updateMaterialsOnLoad(o, u) }) } } return o } }, $._materialCache = { _materials: {}, addMaterial: function(e, t) { this._materials[e] = t }, getMaterial: function(e) { return this._materials[e] } }, $.DefaultImageId = "czm_defaultImage", $.DefaultCubeMapId = "czm_defaultCubeMap", $.ColorType = "Color", $._materialCache.addMaterial($.ColorType, { type: $.ColorType, uniforms: { color: new o(1, 0, 0, .5) }, components: { diffuse: "color.rgb", alpha: "color.a" } }), $.ImageType = "Image", $._materialCache.addMaterial($.ImageType, { type: $.ImageType, uniforms: { image: $.DefaultImageId, repeat: new c(1, 1) }, components: { diffuse: "texture2D(image, fract(repeat * materialInput.st)).rgb", alpha: "texture2D(image, fract(repeat * materialInput.st)).a" } }), $.DiffuseMapType = "DiffuseMap", $._materialCache.addMaterial($.DiffuseMapType, { type: $.DiffuseMapType, uniforms: { image: $.DefaultImageId, channels: "rgb", repeat: new c(1, 1) }, components: { diffuse: "texture2D(image, fract(repeat * materialInput.st)).channels" } }), $.AlphaMapType = "AlphaMap", $._materialCache.addMaterial($.AlphaMapType, { type: $.AlphaMapType, uniforms: { image: $.DefaultImageId, channel: "a", repeat: new c(1, 1) }, components: { alpha: "texture2D(image, fract(repeat * materialInput.st)).channel" } }), $.SpecularMapType = "SpecularMap", $._materialCache.addMaterial($.SpecularMapType, { type: $.SpecularMapType, uniforms: { image: $.DefaultImageId, channel: "r", repeat: new c(1, 1) }, components: { specular: "texture2D(image, fract(repeat * materialInput.st)).channel" } }), $.EmissionMapType = "EmissionMap", $._materialCache.addMaterial($.EmissionMapType, { type: $.EmissionMapType, uniforms: { image: $.DefaultImageId, channels: "rgb", repeat: new c(1, 1) }, components: { emission: "texture2D(image, fract(repeat * materialInput.st)).channels" } }), $.BumpMapType = "BumpMap", $._materialCache.addMaterial($.BumpMapType, { type: $.BumpMapType, uniforms: { image: $.DefaultImageId, channel: "r", strength: .8, repeat: new c(1, 1) }, source: _ }), $.NormalMapType = "NormalMap", $._materialCache.addMaterial($.NormalMapType, { type: $.NormalMapType, uniforms: { image: $.DefaultImageId, channels: "rgb", strength: .8, repeat: new c(1, 1) }, source: A }), $.ReflectionType = "Reflection", $._materialCache.addMaterial($.ReflectionType, { type: $.ReflectionType, uniforms: { cubeMap: $.DefaultCubeMapId, channels: "rgb" }, source: M }), $.RefractionType = "Refraction", $._materialCache.addMaterial($.RefractionType, { type: $.RefractionType, uniforms: { cubeMap: $.DefaultCubeMapId, channels: "rgb", indexOfRefractionRatio: .9 }, source: P }), $.FresnelType = "Fresnel", $._materialCache.addMaterial($.FresnelType, { type: $.FresnelType, materials: { reflection: { type: $.ReflectionType }, refraction: { type: $.RefractionType } }, source: E }), $.BrickType = "Brick", $._materialCache.addMaterial($.BrickType, { type: $.BrickType, uniforms: { brickColor: new o(.6, .3, .1, 1), mortarColor: new o(.8, .8, .7, 1), brickSize: new c(.3, .15), brickPct: new c(.9, .85), brickRoughness: .2, mortarRoughness: .1 }, source: g }), $.WoodType = "Wood", $._materialCache.addMaterial($.WoodType, { type: $.WoodType, uniforms: { lightWoodColor: new o(.6, .3, .1, 1), darkWoodColor: new o(.4, .2, .07, 1), ringFrequency: 3, noiseScale: new c(.7, .5), grainFrequency: 27 }, source: R }), $.AsphaltType = "Asphalt", $._materialCache.addMaterial($.AsphaltType, { type: $.AsphaltType, uniforms: { asphaltColor: new o(.15, .15, .15, 1), bumpSize: .02, roughness: .2 }, source: v }), $.CementType = "Cement", $._materialCache.addMaterial($.CementType, { type: $.CementType, uniforms: { cementColor: new o(.95, .95, .85, 1), grainScale: .01, roughness: .3 }, source: w }), $.GrassType = "Grass", $._materialCache.addMaterial($.GrassType, { type: $.GrassType, uniforms: { grassColor: new o(.25, .4, .1, 1), dirtColor: new o(.1, .1, .1, 1), patchiness: 1.5 }, source: b }), $.GridType = "Grid", $._materialCache.addMaterial($.GridType, { type: $.GridType, uniforms: { color: new o(0, 1, 0, 1), cellAlpha: .1, lineCount: new c(8, 8), lineThickness: new c(1, 1) }, source: T }), $.StripeType = "Stripe", $._materialCache.addMaterial($.StripeType, { type: $.StripeType, uniforms: { horizontal: !0, lightColor: new o(1, 1, 1, .5), darkColor: new o(0, 0, 1, .5), offset: 0, repeat: 5 }, source: D }), $.CheckerboardType = "Checkerboard", $._materialCache.addMaterial($.CheckerboardType, { type: $.CheckerboardType, uniforms: { lightColor: new o(1, 1, 1, .5), darkColor: new o(0, 0, 0, .5), repeat: new c(5, 5) }, source: C }), $.DotType = "Dot", $._materialCache.addMaterial($.DotType, { type: $.DotType, uniforms: { lightColor: new o(1, 1, 0, .75), darkColor: new o(0, 1, 1, .75), repeat: new c(5, 5) }, source: x }), $.TyeDyeType = "TieDye", $._materialCache.addMaterial($.TyeDyeType, { type: $.TyeDyeType, uniforms: { lightColor: new o(1, 1, 0, .75), darkColor: new o(1, 0, 0, .75), frequency: 5 }, source: I }), $.FacetType = "Facet", $._materialCache.addMaterial($.FacetType, { type: $.FacetType, uniforms: { lightColor: new o(.25, .25, .25, .75), darkColor: new o(.75, .75, .75, .75), frequency: 10 }, source: S }), $.BlobType = "Blob", $._materialCache.addMaterial($.BlobType, { type: $.BlobType, uniforms: { lightColor: new o(1, 1, 1, .5), darkColor: new o(0, 0, 1, .5), frequency: 10 }, source: y }), $.WaterType = "Water", $._materialCache.addMaterial($.WaterType, { type: $.WaterType, uniforms: { baseWaterColor: { red: .2, green: .3, blue: .6, alpha: 1 }, blendColor: { red: 0, green: 1, blue: .699, alpha: 1 }, specularMap: $.DefaultImageId, normalMap: $.DefaultImageId, frequency: 10, animationSpeed: .01, amplitude: 1, specularIntensity: .5, fadeFactor: 1 }, source: O }), $.RimLightingType = "RimLighting", $._materialCache.addMaterial($.RimLightingType, { type: $.RimLightingType, uniforms: { color: new o(1, 0, 0, .7), rimColor: new o(1, 1, 1, .4), width: .3 }, source: L }), $.ErosionType = "Erosion", $._materialCache.addMaterial($.ErosionType, { type: $.ErosionType, uniforms: { color: new o(1, 0, 0, .5), time: 1 }, source: z }), $.FadeType = "Fade", $._materialCache.addMaterial($.FadeType, { type: $.FadeType, uniforms: { fadeInColor: new o(1, 0, 0, 1), fadeOutColor: new o(0, 0, 0, 0), maximumDistance: .5, repeat: !0, fadeDirection: { x: !0, y: !0 }, time: new c(.5, .5) }, source: N }), $.PolylineArrowType = "PolylineArrow", $._materialCache.addMaterial($.PolylineArrowType, { type: $.PolylineArrowType, uniforms: { color: new o(1, 1, 1, 1) }, source: F }), $.PolylineGlowType = "PolylineGlow", $._materialCache.addMaterial($.PolylineGlowType, { type: $.PolylineGlowType, uniforms: { color: new o(0, .5, 1, 1), glowPower: .1 }, source: B }), $.PolylineOutlineType = "PolylineOutline", $._materialCache.addMaterial($.PolylineOutlineType, { type: $.PolylineOutlineType, uniforms: { color: new o(1, 1, 1, 1), outlineColor: new o(1, 0, 0, 1), outlineWidth: 1 }, source: V }), $ }), r("Shaders/EllipsoidVS", [], function() { "use strict"; return "attribute vec3 position;\nuniform vec3 u_radii;\nvarying vec3 v_positionEC;\nvoid main()\n{\nvec4 p = vec4(u_radii * position, 1.0);\nv_positionEC = (czm_modelView * p).xyz;\ngl_Position = czm_modelViewProjection * p;\ngl_Position.z = clamp(gl_Position.z, gl_DepthRange.near, gl_DepthRange.far);\n}\n" }), r("Shaders/EllipsoidFS", [], function() { "use strict"; return "uniform vec3 u_radii;\nuniform vec3 u_oneOverEllipsoidRadiiSquared;\nvarying vec3 v_positionEC;\nvec4 computeEllipsoidColor(czm_ray ray, float intersection, float side)\n{\nvec3 positionEC = czm_pointAlongRay(ray, intersection);\nvec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;\nvec3 geodeticNormal = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), u_oneOverEllipsoidRadiiSquared));\nvec3 sphericalNormal = normalize(positionMC / u_radii);\nvec3 normalMC = geodeticNormal * side;\nvec3 normalEC = normalize(czm_normal * normalMC);\nvec2 st = czm_ellipsoidWgs84TextureCoordinates(sphericalNormal);\nvec3 positionToEyeEC = -positionEC;\nczm_materialInput materialInput;\nmaterialInput.s = st.s;\nmaterialInput.st = st;\nmaterialInput.str = (positionMC + u_radii) / u_radii;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(positionMC, normalEC);\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\nreturn czm_phong(normalize(positionToEyeEC), material);\n}\nvoid main()\n{\nfloat maxRadius = max(u_radii.x, max(u_radii.y, u_radii.z)) * 1.5;\nvec3 direction = normalize(v_positionEC);\nvec3 ellipsoidCenter = czm_modelView[3].xyz;\nfloat t1 = -1.0;\nfloat t2 = -1.0;\nfloat b = -2.0 * dot(direction, ellipsoidCenter);\nfloat c = dot(ellipsoidCenter, ellipsoidCenter) - maxRadius * maxRadius;\nfloat discriminant = b * b - 4.0 * c;\nif (discriminant >= 0.0) {\nt1 = (-b - sqrt(discriminant)) * 0.5;\nt2 = (-b + sqrt(discriminant)) * 0.5;\n}\nif (t1 < 0.0 && t2 < 0.0) {\ndiscard;\n}\nfloat t = min(t1, t2);\nif (t < 0.0) {\nt = 0.0;\n}\nczm_ellipsoid ellipsoid = czm_ellipsoidNew(ellipsoidCenter, u_radii);\nczm_ray ray = czm_ray(t * direction, direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (czm_isEmpty(intersection))\n{\ndiscard;\n}\nvec4 outsideFaceColor = (intersection.start != 0.0) ? computeEllipsoidColor(ray, intersection.start, 1.0) : vec4(0.0);\nvec4 insideFaceColor = (outsideFaceColor.a < 1.0) ? computeEllipsoidColor(ray, intersection.stop, -1.0) : vec4(0.0);\ngl_FragColor = mix(insideFaceColor, outsideFaceColor, outsideFaceColor.a);\ngl_FragColor.a = 1.0 - (1.0 - insideFaceColor.a) * (1.0 - outsideFaceColor.a);\n}\n" }), r("Scene/EllipsoidPrimitive", ["../Core/BoxGeometry", "../Core/Cartesian3", "../Core/Cartesian4", "../Core/combine", "../Core/defined", "../Core/DeveloperError", "../Core/destroyObject", "../Core/Matrix4", "../Core/BoundingSphere", "../Core/PrimitiveType", "../Renderer/CullFace", "../Renderer/BlendingState", "../Renderer/BufferUsage", "../Renderer/CommandLists", "../Renderer/DrawCommand", "../Renderer/createShaderSource", "./Material", "./SceneMode", "../Shaders/EllipsoidVS", "../Shaders/EllipsoidFS"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _) { "use strict";
function w(r) { var i = r.cache.ellipsoidPrimitive_vertexArray; if (n(i)) return i; var o = e.createGeometry(e.fromDimensions({ dimensions: new t(2, 2, 2) })); return i = r.createVertexArrayFromGeometry({ geometry: o, attributeIndices: C, bufferUsage: d.STATIC_DRAW }), r.cache.ellipsoidPrimitive_vertexArray = i, i } var C = { position: 0 },
x = function() { this.center = t.ZERO.clone(), this.radii = void 0, this._radii = new t, this._oneOverEllipsoidRadiiSquared = new t, this._boundingSphere = new l, this.modelMatrix = s.IDENTITY.clone(), this._computedModelMatrix = s.IDENTITY.clone(), this.show = !0, this.material = v.fromType(void 0, v.ColorType), this._material = void 0, this._sp = void 0, this._rs = void 0, this._va = void 0, this._pickSP = void 0, this._pickId = void 0, this._colorCommand = new p, this._colorCommand.owner = this, this._pickCommand = new p, this._pickCommand.owner = this, this._commandLists = new m; var e = this;
this._uniforms = { u_radii: function() { return e.radii }, u_oneOverEllipsoidRadiiSquared: function() { return e._oneOverEllipsoidRadiiSquared } }, this._pickUniforms = { czm_pickColor: function() { return e._pickId.color } } }; return x.prototype.update = function(e, r, a) { if (this.show && r.mode === y.SCENE3D && n(this.center) && n(this.radii)) { if (!n(this.material)) throw new o("this.material must be defined.");
n(this._rs) || (this._rs = e.createRenderState({ cull: { enabled: !0, face: c.FRONT }, depthTest: { enabled: !0 }, depthMask: !1, blending: h.ALPHA_BLEND })), n(this._va) || (this._va = w(e)); var l = this.radii; if (!t.equals(this._radii, l)) { t.clone(l, this._radii); var d = this._oneOverEllipsoidRadiiSquared;
d.x = 1 / (l.x * l.x), d.y = 1 / (l.y * l.y), d.z = 1 / (l.z * l.z), this._boundingSphere.radius = t.getMaximumComponent(l) } s.multiplyByTranslation(this.modelMatrix, this.center, this._computedModelMatrix); var m = this._commandLists;
m.removeAll(); var p = this._material !== this.material; if (this._material = this.material, r.passes.color) { var v = this._colorCommand; if (p) { var x = f({ sources: [this.material.shaderSource, _] });
this._sp = e.getShaderCache().replaceShaderProgram(this._sp, g, x, C), v.primitiveType = u.TRIANGLES, v.vertexArray = this._va, v.renderState = this._rs, v.shaderProgram = this._sp, v.uniformMap = i([this._uniforms, this.material._uniforms], !1, !1), v.executeInClosestFrustum = !0 } v.boundingVolume = this._boundingSphere, v.modelMatrix = this._computedModelMatrix, m.colorList.push(v) } if (r.passes.pick) { var S = this._pickCommand; if (n(this._pickId) || (this._pickId = e.createPickId(this)), p || !n(this._pickSP)) { var E = f({ sources: [this.material.shaderSource, _], pickColorQualifier: "uniform" });
this._pickSP = e.getShaderCache().replaceShaderProgram(this._pickSP, g, E, C), S.primitiveType = u.TRIANGLES, S.vertexArray = this._va, S.renderState = this._rs, S.shaderProgram = this._pickSP, S.uniformMap = i([this._uniforms, this._pickUniforms, this.material._uniforms], !1, !1), S.executeInClosestFrustum = !0 } S.boundingVolume = this._boundingSphere, S.modelMatrix = this._computedModelMatrix, m.pickList.push(S) } a.push(m) } }, x.prototype.isDestroyed = function() { return !1 }, x.prototype.destroy = function() { return this._sp = this._sp && this._sp.release(), this._pickSP = this._pickSP && this._pickSP.release(), this._pickId = this._pickId && this._pickId.destroy(), a(this) }, x }), r("DynamicScene/MaterialProperty", ["../Core/defined", "../Core/DeveloperError", "../Scene/Material"], function(e, t, r) { "use strict";
function i() { throw new t("This type should not be instantiated directly.") } var n = i; return n.prototype.getType = i, n.prototype.getValue = i, n.getValue = function(t, i, n, o) { if (e(n)) { var a = n.getType(t);
e(o) && o.type === a || (o = r.fromType(i, a)), n.getValue(t, o.uniforms) } return o }, n }), r("DynamicScene/DynamicEllipsoidVisualizer", ["../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/destroyObject", "../Core/Matrix3", "../Core/Matrix4", "../Scene/EllipsoidPrimitive", "../Scene/Material", "./MaterialProperty"], function(e, t, r, i, n, o, a, s, l) { "use strict";
function u(r, i, u) { var h = r._scene.getContext(),
p = u.ellipsoid; if (t(p)) { var f = p.radii; if (t(f)) { var v = u.position; if (t(v)) { var y = u.orientation; if (t(y)) { var g, _ = p.show,
w = u._ellipsoidVisualizerIndex,
C = u.isAvailable(i) && (!t(_) || _.getValue(i)); if (!C) return t(w) && (g = r._ellipsoidCollection[w], g.show = !1, u._ellipsoidVisualizerIndex = void 0, r._unusedIndexes.push(w)), void 0; if (t(w)) g = r._ellipsoidCollection[w];
else { var x = r._unusedIndexes,
S = x.length;
S > 0 ? (w = x.pop(), g = r._ellipsoidCollection[w]) : (w = r._ellipsoidCollection.length, g = new a, r._ellipsoidCollection.push(g), r._primitives.add(g)), u._ellipsoidVisualizerIndex = w, g.dynamicObject = u, g.material = s.fromType(h, s.ColorType) } g.show = !0, g.radii = f.getValue(i, g.radii), d = e(v.getValue(i, d), g._visualizerPosition), m = e(y.getValue(i, m), g._visualizerOrientation), !t(d) || !t(m) || d.equals(g._visualizerPosition) && m.equals(g._visualizerOrientation) || (o.fromRotationTranslation(n.fromQuaternion(m, c), d, g.modelMatrix), g._visualizerPosition = d.clone(g._visualizerPosition), g._visualizerOrientation = m.clone(g._visualizerOrientation)), g.material = l.getValue(i, h, p.material, g.material) } } } } } var c = new n,
h = function(e, i) { if (!t(e)) throw new r("scene is required.");
this._scene = e, this._unusedIndexes = [], this._primitives = e.getPrimitives(), this._ellipsoidCollection = [], this._dynamicObjectCollection = void 0, this.setDynamicObjectCollection(i) };
h.prototype.getScene = function() { return this._scene }, h.prototype.getDynamicObjectCollection = function() { return this._dynamicObjectCollection }, h.prototype.setDynamicObjectCollection = function(e) { var r = this._dynamicObjectCollection;
r !== e && (t(r) && (r.objectsRemoved.removeEventListener(h.prototype._onObjectsRemoved, this), this.removeAllPrimitives()), this._dynamicObjectCollection = e, t(e) && e.objectsRemoved.addEventListener(h.prototype._onObjectsRemoved, this)) }, h.prototype.update = function(e) { if (!t(e)) throw new r("time is requied."); if (t(this._dynamicObjectCollection))
for (var i = this._dynamicObjectCollection.getObjects(), n = 0, o = i.length; o > n; n++) u(this, e, i[n]) }, h.prototype.removeAllPrimitives = function() { var e, r; for (e = 0, r = this._ellipsoidCollection.length; r > e; e++) this._primitives.remove(this._ellipsoidCollection[e]); if (t(this._dynamicObjectCollection)) { var i = this._dynamicObjectCollection.getObjects(); for (e = i.length - 1; e > -1; e--) i[e]._ellipsoidVisualizerIndex = void 0 } this._unusedIndexes = [], this._ellipsoidCollection = [] }, h.prototype.isDestroyed = function() { return !1 }, h.prototype.destroy = function() { return this.removeAllPrimitives(), i(this) }; var d, m; return h.prototype._onObjectsRemoved = function(e, r) { for (var i = this._ellipsoidCollection, n = this._unusedIndexes, o = r.length - 1; o > -1; o--) { var a = r[o],
s = a._ellipsoidVisualizerIndex; if (t(s)) { var l = i[s];
l.show = !1, n.push(s), a._ellipsoidVisualizerIndex = void 0 } } }, h }), r("Shaders/SensorVolume", [], function() { "use strict"; return "uniform vec4 u_intersectionColor;\nuniform float u_intersectionWidth;\nbool inSensorShadow(vec3 coneVertexWC, czm_ellipsoid ellipsoidEC, vec3 pointWC)\n{\nvec3 D = ellipsoidEC.inverseRadii;\nvec3 q = D * coneVertexWC;\nfloat qMagnitudeSquared = dot(q, q);\nfloat test = qMagnitudeSquared - 1.0;\nvec3 temp = D * pointWC - q;\nfloat d = dot(temp, q);\nreturn (d < -test) && (d / length(temp) < -sqrt(test));\n}\nvec4 getIntersectionColor()\n{\nreturn u_intersectionColor;\n}\nfloat getIntersectionWidth()\n{\nreturn u_intersectionWidth;\n}\nvec2 sensor2dTextureCoordinates(float sensorRadius, vec3 pointMC)\n{\nfloat t = pointMC.z / sensorRadius;\nfloat s = 1.0 + (atan(pointMC.y, pointMC.x) / czm_twoPi);\ns = s - floor(s);\nreturn vec2(s, t);\n}\n" }), r("Shaders/CustomSensorVolumeVS", [], function() { "use strict"; return "attribute vec4 position;\nattribute vec3 normal;\nvarying vec3 v_positionWC;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\ngl_Position = czm_modelViewProjection * position;\nv_positionWC = (czm_model * position).xyz;\nv_positionEC = (czm_modelView * position).xyz;\nv_normalEC = czm_normal * normal;\n}\n" }), r("Shaders/CustomSensorVolumeFS", [], function() { "use strict"; return "#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\nuniform bool u_showIntersection;\nuniform bool u_showThroughEllipsoid;\nuniform float u_sensorRadius;\nuniform float u_normalDirection;\nvarying vec3 v_positionWC;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvec4 getColor(float sensorRadius, vec3 pointEC)\n{\nczm_materialInput materialInput;\nvec3 pointMC = (czm_inverseModelView * vec4(pointEC, 1.0)).xyz;\nmaterialInput.st = sensor2dTextureCoordinates(sensorRadius, pointMC);\nmaterialInput.str = pointMC / sensorRadius;\nvec3 positionToEyeEC = -v_positionEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nvec3 normalEC = normalize(v_normalEC);\nmaterialInput.normalEC = u_normalDirection * normalEC;\nczm_material material = czm_getMaterial(materialInput);\nreturn mix(czm_phong(normalize(positionToEyeEC), material), vec4(material.diffuse, material.alpha), 0.4);\n}\nbool isOnBoundary(float value, float epsilon)\n{\nfloat width = getIntersectionWidth();\nfloat tolerance = width * epsilon;\n#ifdef GL_OES_standard_derivatives\nfloat delta = max(abs(dFdx(value)), abs(dFdy(value)));\nfloat pixels = width * delta;\nfloat temp = abs(value);\nreturn temp < tolerance && temp < pixels || (delta < 10.0 * tolerance && temp - delta < tolerance && temp < pixels);\n#else\nreturn abs(value) < tolerance;\n#endif\n}\nvec4 shade(bool isOnBoundary)\n{\nif (u_showIntersection && isOnBoundary)\n{\nreturn getIntersectionColor();\n}\nreturn getColor(u_sensorRadius, v_positionEC);\n}\nfloat ellipsoidSurfaceFunction(czm_ellipsoid ellipsoid, vec3 point)\n{\nvec3 scaled = ellipsoid.inverseRadii * point;\nreturn dot(scaled, scaled) - 1.0;\n}\nvoid main()\n{\nvec3 sensorVertexWC = czm_model[3].xyz;\nvec3 sensorVertexEC = czm_modelView[3].xyz;\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nfloat ellipsoidValue = ellipsoidSurfaceFunction(ellipsoid, v_positionWC);\nif (!u_showThroughEllipsoid)\n{\nif (ellipsoidValue < 0.0)\n{\ndiscard;\n}\nif (inSensorShadow(sensorVertexWC, ellipsoid, v_positionWC))\n{\ndiscard;\n}\n}\nif (distance(v_positionEC, sensorVertexEC) > u_sensorRadius)\n{\ndiscard;\n}\nbool isOnEllipsoid = isOnBoundary(ellipsoidValue, czm_epsilon3);\ngl_FragColor = shade(isOnEllipsoid);\n}\n" }), r("Scene/CustomSensorVolume", ["../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/Color", "../Core/combine", "../Core/destroyObject", "../Core/FAR", "../Core/Cartesian3", "../Core/Matrix4", "../Core/ComponentDatatype", "../Core/PrimitiveType", "../Core/BoundingSphere", "../Renderer/BufferUsage", "../Renderer/BlendingState", "../Renderer/CommandLists", "../Renderer/DrawCommand", "../Renderer/createShaderSource", "../Renderer/CullFace", "./Material", "../Shaders/SensorVolume", "../Shaders/CustomSensorVolumeVS", "../Shaders/CustomSensorVolumeFS", "./SceneMode"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C, x) {
"use strict";
function S(e) { for (var t = e._directions, r = t.length, i = new Float32Array(3 * r), n = isFinite(e.radius) ? e.radius : a, o = [s.ZERO], l = r - 2, u = r - 1, c = 0; r > c; l = u++, u = c++) { var d = s.fromSpherical(t[l]),
m = s.fromSpherical(t[u]),
p = s.fromSpherical(t[c]),
f = Math.max(s.angleBetween(d, m), s.angleBetween(m, p)),
v = n / Math.cos(.5 * f),
y = m.multiplyByScalar(v);
i[3 * u + 0] = y.x, i[3 * u + 1] = y.y, i[3 * u + 2] = y.z, o.push(y) } return h.fromPoints(o, e._frontFaceColorCommand.boundingVolume), i }
function E(e, t) {
for (var r = S(e), i = e._directions.length, n = new Float32Array(18 * i), o = 0, a = i - 1, l = 0; i > l; a = l++) {
var c = new s(r[3 * a + 0], r[3 * a + 1], r[3 * a + 2]),
h = new s(r[3 * l + 0], r[3 * l + 1], r[3 * l + 2]),
d = h.cross(c).normalize();
n[o++] = 0, n[o++] = 0, n[o++] = 0, n[o++] = d.x, n[o++] = d.y, n[o++] = d.z, n[o++] = h.x, n[o++] = h.y, n[o++] = h.z, n[o++] = d.x, n[o++] = d.y, n[o++] = d.z, n[o++] = c.x, n[o++] = c.y, n[o++] = c.z, n[o++] = d.x, n[o++] = d.y, n[o++] = d.z
}
var m = t.createVertexBuffer(new Float32Array(n), e.bufferUsage),
p = 6 * Float32Array.BYTES_PER_ELEMENT,
f = [{ index: b.position, vertexBuffer: m, componentsPerAttribute: 3, componentDatatype: u.FLOAT, offsetInBytes: 0, strideInBytes: p }, { index: b.normal, vertexBuffer: m, componentsPerAttribute: 3, componentDatatype: u.FLOAT, offsetInBytes: 3 * Float32Array.BYTES_PER_ELEMENT, strideInBytes: p }];
return t.createVertexArray(f)
}
var b = { position: 0, normal: 1 },
T = function(r) { r = e(r, e.EMPTY_OBJECT), this._pickId = void 0, this._pickIdThis = e(r._pickIdThis, this), this._frontFaceColorCommand = new f, this._backFaceColorCommand = new f, this._pickCommand = new f, this._commandLists = new p, this._frontFaceColorCommand.primitiveType = c.TRIANGLES, this._frontFaceColorCommand.boundingVolume = new h, this._frontFaceColorCommand.owner = this, this._backFaceColorCommand.primitiveType = this._frontFaceColorCommand.primitiveType, this._backFaceColorCommand.boundingVolume = this._frontFaceColorCommand.boundingVolume, this._backFaceColorCommand.owner = this, this._pickCommand.primitiveType = this._frontFaceColorCommand.primitiveType, this._pickCommand.boundingVolume = this._frontFaceColorCommand.boundingVolume, this._pickCommand.owner = this, this.show = e(r.show, !0), this.showIntersection = e(r.showIntersection, !0), this.showThroughEllipsoid = e(r.showThroughEllipsoid, !1), this._showThroughEllipsoid = this.showThroughEllipsoid, this.modelMatrix = l.clone(e(r.modelMatrix, l.IDENTITY)), this.bufferUsage = e(r.bufferUsage, d.STATIC_DRAW), this._bufferUsage = this.bufferUsage, this.radius = e(r.radius, Number.POSITIVE_INFINITY), this._directions = void 0, this._directionsDirty = !1, this.setDirections(r.directions), this.material = t(r.material) ? r.material : g.fromType(void 0, g.ColorType), this._material = void 0, this.intersectionColor = i.clone(e(r.intersectionColor, i.WHITE)), this.intersectionWidth = e(r.intersectionWidth, 5); var n = this;
this._uniforms = { u_showThroughEllipsoid: function() { return n.showThroughEllipsoid }, u_showIntersection: function() { return n.showIntersection }, u_sensorRadius: function() { return isFinite(n.radius) ? n.radius : a }, u_intersectionColor: function() { return n.intersectionColor }, u_intersectionWidth: function() { return n.intersectionWidth }, u_normalDirection: function() { return 1 } }, this._mode = x.SCENE3D };
return T.prototype.setDirections = function(e) { this._directions = e, this._directionsDirty = !0 }, T.prototype.getDirections = function() { return this._directions }, T.prototype.update = function(e, i, o) { if (this._mode = i.mode, this.show && this._mode === x.SCENE3D) { if (this.radius < 0) throw new r("this.radius must be greater than or equal to zero."); if (!t(this.material)) throw new r("this.material must be defined."); if (this._showThroughEllipsoid !== this.showThroughEllipsoid || !t(this._frontFaceColorCommand.renderState)) { this._showThroughEllipsoid = this.showThroughEllipsoid; var a = e.createRenderState({ depthTest: { enabled: !this.showThroughEllipsoid }, depthMask: !1, blending: m.ALPHA_BLEND, cull: { enabled: !0, face: y.BACK } });
this._frontFaceColorCommand.renderState = a, a = e.createRenderState({ depthTest: { enabled: !this.showThroughEllipsoid }, depthMask: !1, blending: m.ALPHA_BLEND, cull: { enabled: !0, face: y.FRONT } }), this._backFaceColorCommand.renderState = a, a = e.createRenderState({ depthTest: { enabled: !this.showThroughEllipsoid }, depthMask: !1, blending: m.ALPHA_BLEND }), this._pickCommand.renderState = a } if (this._directionsDirty || this._bufferUsage !== this.bufferUsage) { this._directionsDirty = !1, this._bufferUsage = this.bufferUsage, this._va = this._va && this._va.destroy(); var s = this._directions;
s && s.length >= 3 && (this._frontFaceColorCommand.vertexArray = E(this, e), this._backFaceColorCommand.vertexArray = this._frontFaceColorCommand.vertexArray, this._pickCommand.vertexArray = this._frontFaceColorCommand.vertexArray) } if (t(this._frontFaceColorCommand.vertexArray)) { var l = i.passes;
this._commandLists.removeAll(), this._frontFaceColorCommand.modelMatrix = this.modelMatrix, this._backFaceColorCommand.modelMatrix = this._frontFaceColorCommand.modelMatrix, this._pickCommand.modelMatrix = this._frontFaceColorCommand.modelMatrix; var u = this._material !== this.material; if (this._material = this.material, l.color) { var c = this._frontFaceColorCommand,
h = this._backFaceColorCommand; if (u || !t(c.shaderProgram)) { var d = v({ sources: [_, this._material.shaderSource, C] });
c.shaderProgram = e.getShaderCache().replaceShaderProgram(c.shaderProgram, w, d, b), c.uniformMap = n([this._uniforms, this._material._uniforms], !1, !1), h.shaderProgram = c.shaderProgram, h.uniformMap = n([this._uniforms, this._material._uniforms], !1, !1), h.uniformMap.u_normalDirection = function() { return -1 } } this._commandLists.colorList.push(h), this._commandLists.colorList.push(c) } if (l.pick) { var p = this._pickCommand; if (t(this._pickId) || (this._pickId = e.createPickId(this._pickIdThis)), u || !t(p.shaderProgram)) { var f = v({ sources: [_, this._material.shaderSource, C], pickColorQualifier: "uniform" });
p.shaderProgram = e.getShaderCache().replaceShaderProgram(p.shaderProgram, w, f, b); var g = this;
p.uniformMap = n([this._uniforms, this._material._uniforms, { czm_pickColor: function() { return g._pickId.color } }], !1, !1) } this._commandLists.pickList.push(p) } this._commandLists.empty() || o.push(this._commandLists) } } }, T.prototype.isDestroyed = function() { return !1 }, T.prototype.destroy = function() { return this._frontFaceColorCommand.vertexArray = this._frontFaceColorCommand.vertexArray && this._frontFaceColorCommand.vertexArray.destroy(), this._frontFaceColorCommand.shaderProgram = this._frontFaceColorCommand.shaderProgram && this._frontFaceColorCommand.shaderProgram.release(), this._pickCommand.shaderProgram = this._pickCommand.shaderProgram && this._pickCommand.shaderProgram.release(), this._pickId = this._pickId && this._pickId.destroy(), o(this) }, T
}), r("DynamicScene/DynamicConeVisualizerUsingCustomSensor", ["../Core/Cartesian3", "../Core/Color", "../Core/defined", "../Core/destroyObject", "../Core/DeveloperError", "../Core/Quaternion", "../Core/Math", "../Core/Matrix3", "../Core/Matrix4", "../Core/Spherical", "../Scene/CustomSensorVolume", "../Scene/Material", "./MaterialProperty"], function(e, t, r, i, n, o, a, s, l, u, c, h, d) { "use strict";
function m(e, t, i, n) { var o = t[e];
r(o) || (t[e] = o = new u), o.clock = i, o.cone = n, o.magnitude = 1 }
function p(e, t, r, i, n) { var o, s = 0,
l = a.toRadians(2); if (0 === e && t === a.TWO_PI)
for (o = 0; o < a.TWO_PI; o += l) m(s++, n, o, i);
else { for (o = e; t > o; o += l) m(s++, n, o, i); if (m(s++, n, t, i), r) { for (o = t; o > e; o -= l) m(s++, n, o, r);
m(s++, n, e, r) } else m(s++, n, t, 0) } return n.length = s, n }
function f(e, i, n) { var o = e._scene.getContext(),
u = n.cone; if (r(u)) { var m = n.position; if (r(m)) { var f = n.orientation; if (r(f)) { var y, w = u.show,
C = n._coneVisualizerIndex,
x = n.isAvailable(i) && (!r(w) || w.getValue(i)); if (!x) return r(C) && (y = e._coneCollection[C], y.show = !1, n._coneVisualizerIndex = void 0, e._unusedIndexes.push(C)), void 0; if (r(C)) y = e._coneCollection[C];
else { var S = e._unusedIndexes,
E = S.length;
E > 0 ? (C = S.pop(), y = e._coneCollection[C]) : (C = e._coneCollection.length, y = new c, y._directionsScratch = [], e._coneCollection.push(y), e._primitives.add(y)), n._coneVisualizerIndex = C, y.dynamicObject = n, y.material = h.fromType(o, h.ColorType), y.intersectionColor = t.YELLOW.clone(), y.intersectionWidth = 5, y.radius = Number.POSITIVE_INFINITY, y.showIntersection = !0 } y.show = !0; var b, T = u.minimumClockAngle;
r(T) && (b = T.getValue(i)), r(b) || (b = 0); var A;
T = u.maximumClockAngle, r(T) && (A = T.getValue(i)), r(A) || (A = a.TWO_PI); var M;
T = u.innerHalfAngle, r(T) && (M = T.getValue(i)), r(M) || (M = 0); var P; if (T = u.outerHalfAngle, r(T) && (P = T.getValue(i)), r(P) || (P = Math.PI), (b !== y.minimumClockAngle || A !== y.maximumClockAngle || M !== y.innerHalfAngle || P !== y.outerHalfAngle) && (y.setDirections(p(b, A, M, P, y._directionsScratch)), y.innerHalfAngle = M, y.maximumClockAngle = A, y.outerHalfAngle = P, y.minimumClockAngle = b), T = u.radius, r(T)) { var D = T.getValue(i);
r(D) && (y.radius = D) } var I = m.getValue(i, g),
O = f.getValue(i, _); if (!r(I) || !r(O) || I.equals(y._visualizerPosition) && O.equals(y._visualizerOrientation) || (l.fromRotationTranslation(s.fromQuaternion(O, v), I, y.modelMatrix), y._visualizerPosition = I.clone(y._visualizerPosition), y._visualizerOrientation = O.clone(y._visualizerOrientation)), y.material = d.getValue(i, o, u.outerMaterial, y.material), T = u.intersectionColor, r(T) && T.getValue(i, y.intersectionColor), T = u.intersectionWidth, r(T)) { var R = T.getValue(i);
r(R) && (y.intersectionWidth = R) } } } } } var v = new s,
y = function(e, t) { if (!r(e)) throw new n("scene is required.");
this._scene = e, this._unusedIndexes = [], this._primitives = e.getPrimitives(), this._coneCollection = [], this._dynamicObjectCollection = void 0, this.setDynamicObjectCollection(t) };
y.prototype.getScene = function() { return this._scene }, y.prototype.getDynamicObjectCollection = function() { return this._dynamicObjectCollection }, y.prototype.setDynamicObjectCollection = function(e) { var t = this._dynamicObjectCollection;
t !== e && (r(t) && (t.objectsRemoved.removeEventListener(y.prototype._onObjectsRemoved, this), this.removeAllPrimitives()), this._dynamicObjectCollection = e, r(e) && e.objectsRemoved.addEventListener(y.prototype._onObjectsRemoved, this)) }, y.prototype.update = function(e) { if (!r(e)) throw new n("time is requied."); if (r(this._dynamicObjectCollection))
for (var t = this._dynamicObjectCollection.getObjects(), i = 0, o = t.length; o > i; i++) f(this, e, t[i]) }, y.prototype.removeAllPrimitives = function() { var e, t; for (e = 0, t = this._coneCollection.length; t > e; e++) this._primitives.remove(this._coneCollection[e]); if (r(this._dynamicObjectCollection)) { var i = this._dynamicObjectCollection.getObjects(); for (e = i.length - 1; e > -1; e--) i[e]._coneVisualizerIndex = void 0 } this._unusedIndexes = [], this._coneCollection = [] }, y.prototype.isDestroyed = function() { return !1 }, y.prototype.destroy = function() { return this.removeAllPrimitives(), i(this) }; var g = new e,
_ = new o; return y.prototype._onObjectsRemoved = function(e, t) { for (var i = this._coneCollection, n = this._unusedIndexes, o = t.length - 1; o > -1; o--) { var a = t[o],
s = a._coneVisualizerIndex; if (r(s)) { var l = i[s];
l.show = !1, n.push(s), a._coneVisualizerIndex = void 0 } } }, y }), r("Scene/Label", ["../Core/defaultValue", "../Core/DeveloperError", "../Core/Cartesian2", "../Core/Cartesian3", "../Core/Color", "../Core/defined", "./Billboard", "./LabelStyle", "./HorizontalOrigin", "./VerticalOrigin"], function(e, t, r, i, n, o, a, s, l, u) { "use strict";
function c(e) { e._rebindAllGlyphs || e._repositionAllGlyphs || e._labelCollection._labelsToUpdate.push(e), e._rebindAllGlyphs = !0 }
function h(e) { e._rebindAllGlyphs || e._repositionAllGlyphs || e._labelCollection._labelsToUpdate.push(e), e._repositionAllGlyphs = !0 } var d = function(t, o) { t = e(t, e.EMPTY_OBJECT), this._text = e(t.text, ""), this._show = e(t.show, !0), this._font = e(t.font, "30px sans-serif"), this._fillColor = n.clone(e(t.fillColor, n.WHITE)), this._outlineColor = n.clone(e(t.outlineColor, n.BLACK)), this._outlineWidth = e(t.outlineWidth, 1), this._style = e(t.style, s.FILL), this._verticalOrigin = e(t.verticalOrigin, u.BOTTOM), this._horizontalOrigin = e(t.horizontalOrigin, l.LEFT), this._pixelOffset = r.clone(e(t.pixelOffset, r.ZERO)), this._eyeOffset = i.clone(e(t.eyeOffset, i.ZERO)), this._position = i.clone(e(t.position, i.ZERO)), this._scale = e(t.scale, 1), this._labelCollection = o, this._glyphs = [], this._rebindAllGlyphs = !0, this._repositionAllGlyphs = !0 }; return d.prototype.getShow = function() { return this._show }, d.prototype.setShow = function(e) { if (!o(e)) throw new t("value is required."); if (e !== this._show) { this._show = e; for (var r = this._glyphs, i = 0, n = r.length; n > i; i++) { var a = r[i];
o(a.billboard) && a.billboard.setShow(e) } } }, d.prototype.getPosition = function() { return this._position }, d.prototype.setPosition = function(e) { if (!o(e)) throw new t("value is required."); var r = this._position; if (!i.equals(r, e)) { i.clone(e, r); for (var n = this._glyphs, a = 0, s = n.length; s > a; a++) { var l = n[a];
o(l.billboard) && l.billboard.setPosition(e) } } }, d.prototype.getText = function() { return this._text }, d.prototype.setText = function(e) { if (!o(e)) throw new t("value is required.");
e !== this._text && (this._text = e, c(this)) }, d.prototype.getFont = function() { return this._font }, d.prototype.setFont = function(e) { if (!o(e)) throw new t("value is required.");
this._font !== e && (this._font = e, c(this)) }, d.prototype.getFillColor = function() { return this._fillColor }, d.prototype.setFillColor = function(e) { if (!o(e)) throw new t("value is required."); var r = this._fillColor;
n.equals(r, e) || (n.clone(e, r), c(this)) }, d.prototype.getOutlineColor = function() { return this._outlineColor }, d.prototype.setOutlineColor = function(e) { if (!o(e)) throw new t("value is required."); var r = this._outlineColor;
n.equals(r, e) || (n.clone(e, r), c(this)) }, d.prototype.getOutlineWidth = function() { return this._outlineWidth }, d.prototype.setOutlineWidth = function(e) { if (!o(e)) throw new t("value is required.");
this._outlineWidth !== e && (this._outlineWidth = e, c(this)) }, d.prototype.getStyle = function() { return this._style }, d.prototype.setStyle = function(e) { if (!o(e)) throw new t("value is required.");
this._style !== e && (this._style = e, c(this)) }, d.prototype.getPixelOffset = function() { return this._pixelOffset }, d.prototype.setPixelOffset = function(e) { if (!o(e)) throw new t("value is required."); var i = this._pixelOffset;
r.equals(i, e) || (r.clone(e, i), h(this)) }, d.prototype.getEyeOffset = function() { return this._eyeOffset }, d.prototype.setEyeOffset = function(e) { if (!o(e)) throw new t("value is required."); var r = this._eyeOffset; if (!i.equals(r, e)) { i.clone(e, r); for (var n = this._glyphs, a = 0, s = n.length; s > a; a++) { var l = n[a];
o(l.billboard) && l.billboard.setEyeOffset(e) } } }, d.prototype.getHorizontalOrigin = function() { return this._horizontalOrigin }, d.prototype.setHorizontalOrigin = function(e) { if (!o(e)) throw new t("value is required.");
this._horizontalOrigin !== e && (this._horizontalOrigin = e, h(this)) }, d.prototype.getVerticalOrigin = function() { return this._verticalOrigin }, d.prototype.setVerticalOrigin = function(e) { if (!o(e)) throw new t("value is required.");
this._verticalOrigin !== e && (this._verticalOrigin = e, h(this)) }, d.prototype.getScale = function() { return this._scale }, d.prototype.setScale = function(e) { if (!o(e)) throw new t("value is required."); if (this._scale !== e) { this._scale = e; for (var r = this._glyphs, i = 0, n = r.length; n > i; i++) { var a = r[i];
o(a.billboard) && a.billboard.setScale(e) } h(this) } }, d.prototype.computeScreenSpacePosition = function(e, r) { if (!o(e)) throw new t("context is required."); if (!o(r)) throw new t("frameState is required."); var i = this._labelCollection,
n = i.modelMatrix,
s = a._computeActualPosition(this._position, r, n); return a._computeScreenSpacePosition(n, s, this._eyeOffset, this._pixelOffset, e, r) }, d.prototype.equals = function(e) { return this === e || o(e) && this._show === e._show && this._scale === e._scale && this._style === e._style && this._verticalOrigin === e._verticalOrigin && this._horizontalOrigin === e._horizontalOrigin && this._text === e._text && this._font === e._font && i.equals(this._position, e._position) && n.equals(this._fillColor, e._fillColor) && n.equals(this._outlineColor, e._outlineColor) && r.equals(this._pixelOffset, e._pixelOffset) && i.equals(this._eyeOffset, e._eyeOffset) }, d.prototype.isDestroyed = function() { return !1 }, d }), r("Scene/LabelCollection", ["../Core/DeveloperError", "../Core/defined", "../Core/destroyObject", "../Core/Cartesian2", "../Core/Matrix4", "../Core/writeTextToCanvas", "./BillboardCollection", "./Label", "./LabelStyle", "./HorizontalOrigin", "./VerticalOrigin"], function(e, t, r, i, n, o, a, s, l, u, c) { "use strict";
function h() { this.textureInfo = void 0, this.dimensions = void 0, this.billboard = void 0 }
function d(e, t, r) { this.labelCollection = e, this.index = t, this.dimensions = r }
function m(e, t, r, i, n, a, s) { return g.font = t, g.fillColor = r, g.strokeColor = i, g.strokeWidth = n, g.textBaseline = s === c.BOTTOM ? "bottom" : s === c.TOP ? "top" : "middle", g.fill = a === l.FILL || a === l.FILL_AND_OUTLINE, g.stroke = a === l.OUTLINE || a === l.FILL_AND_OUTLINE, o(e, g) }
function p(e, r) { r.textureInfo = void 0, r.dimensions = void 0; var i = r.billboard;
t(i) && (i.setShow(!1), i.setImageIndex(-1), e._spareBillboards.push(i), r.billboard = void 0) }
function f(e, r) { var i, n, o, a = r._text,
s = a.length,
l = r._glyphs,
c = l.length; if (c > s)
for (n = s; c > n; ++n) p(e, l[n]);
l.length = s; var f = e._glyphTextureCache,
v = e._textureAtlas; for (o = 0; s > o; ++o) { var y = a.charAt(o),
g = r._font,
_ = r._fillColor,
w = r._outlineColor,
C = r._outlineWidth,
x = r._style,
S = r._verticalOrigin,
E = JSON.stringify([y, g, _.toRgba(), w.toRgba(), C, +x, +S]),
b = f[E]; if (!t(b)) { var T = m(y, g, _, w, C, x, S),
A = -1;
T.width > 0 && T.height > 0 && (A = v.addImage(T)), b = new d(e, A, T.dimensions), f[E] = b } if (i = l[o], t(i) ? -1 === b.index ? p(e, i) : t(i.textureInfo) && (i.textureInfo = void 0) : (i = new h, l[o] = i), i.textureInfo = b, i.dimensions = b.dimensions, -1 !== b.index) { var M = i.billboard;
t(M) || (i.billboard = M = e._spareBillboards.length > 0 ? e._spareBillboards.pop() : e._billboardCollection.add(), M.setShow(r._show), M.setPosition(r._position), M.setEyeOffset(r._eyeOffset), M.setHorizontalOrigin(u.LEFT), M.setVerticalOrigin(r._verticalOrigin), M.setScale(r._scale), M._pickIdThis = r), i.billboard.setImageIndex(b.index) } } r._repositionAllGlyphs = !0 }
function v(e) { var r, i, n = e._glyphs,
o = 0,
a = 0,
s = 0,
l = n.length; for (s = 0; l > s; ++s) r = n[s], i = r.dimensions, o += i.width, a = Math.max(a, i.height); var h = e._scale,
d = e._horizontalOrigin,
m = 0;
d === u.CENTER ? m -= o / 2 * h : d === u.RIGHT && (m -= o * h); var p = e._pixelOffset;
_.x = p.x + m, _.y = 0; var f = e._verticalOrigin; for (s = 0; l > s; ++s) r = n[s], i = r.dimensions, f === c.BOTTOM || i.height === a ? _.y = p.y - i.descent * h : f === c.TOP ? _.y = p.y - (a - i.height) * h - i.descent * h : f === c.CENTER && (_.y = p.y - (a - i.height) / 2 * h - i.descent * h), t(r.billboard) && r.billboard.setPixelOffset(_), _.x += i.width * h }
function y(e, t) { for (var i = t._glyphs, n = 0, o = i.length; o > n; ++n) p(e, i[n]);
t._labelCollection = void 0, r(t) } var g = {},
_ = new i,
w = function() { this._textureAtlas = void 0, this._billboardCollection = new a, this._billboardCollection.setDestroyTextureAtlas(!1), this._spareBillboards = [], this._glyphTextureCache = {}, this._labels = [], this._labelsToUpdate = [], this._totalGlyphCount = 0, this.modelMatrix = n.IDENTITY.clone() }; return w.prototype.add = function(e) { var t = new s(e, this); return this._labels.push(t), this._labelsToUpdate.push(t), t }, w.prototype.remove = function(e) { if (t(e) && e._labelCollection === this) { var r = this._labels.indexOf(e); if (-1 !== r) return this._labels.splice(r, 1), y(this, e), !0 } return !1 }, w.prototype.removeAll = function() { for (var e = this._labels, t = 0, r = e.length; r > t; ++t) y(this, e[t]);
e.length = 0 }, w.prototype.contains = function(e) { return t(e) && e._labelCollection === this }, w.prototype.get = function(r) { if (!t(r)) throw new e("index is required."); return this._labels[r] }, w.prototype.getLength = function() { return this._labels.length }, w.prototype.update = function(e, r, i) { var n = this._billboardCollection;
n.modelMatrix = this.modelMatrix, t(this._textureAtlas) || (this._textureAtlas = e.createTextureAtlas(), n.setTextureAtlas(this._textureAtlas)); for (var o = this._labelsToUpdate, a = 0, s = o.length; s > a; ++a) { var l = o[a]; if (!l.isDestroyed()) { var u = l._glyphs.length;
l._rebindAllGlyphs && (f(this, l), l._rebindAllGlyphs = !1), l._repositionAllGlyphs && (v(l), l._repositionAllGlyphs = !1); var c = l._glyphs.length - u;
this._totalGlyphCount += c } } o.length = 0, this._billboardCollection.update(e, r, i) }, w.prototype.isDestroyed = function() { return !1 }, w.prototype.destroy = function() { return this.removeAll(), this._billboardCollection = this._billboardCollection.destroy(), this._textureAtlas = this._textureAtlas && this._textureAtlas.destroy(), r(this) }, w }), r("DynamicScene/DynamicLabelVisualizer", ["../Core/DeveloperError", "../Core/defined", "../Core/destroyObject", "../Core/Color", "../Core/Cartesian2", "../Core/Cartesian3", "../Scene/LabelCollection", "../Scene/LabelStyle", "../Scene/HorizontalOrigin", "../Scene/VerticalOrigin"], function(e, t, r, i, n, o, a, s, l, u) { "use strict";
function c(e, r, a) { var c = a.label; if (t(c)) { var h = c.text; if (t(h)) { var y = a.position; if (t(y)) { var g, _ = c.show,
w = a._labelVisualizerIndex,
C = a.isAvailable(r) && (!t(_) || _.getValue(r)); if (!C) return t(w) && (g = e._labelCollection.get(w), g.setShow(!1), e._unusedIndexes.push(w), a._labelVisualizerIndex = void 0), void 0; if (t(w)) g = e._labelCollection.get(w);
else { var x = e._unusedIndexes,
S = x.length;
S > 0 ? (w = x.pop(), g = e._labelCollection.get(w)) : (w = e._labelCollection.getLength(), g = e._labelCollection.add()), a._labelVisualizerIndex = w, g.dynamicObject = a, g.setText(""), g.setScale(1), g.setFont("30px sans-serif"), g.setFillColor(i.WHITE), g.setOutlineColor(i.BLACK), g.setOutlineWidth(1), g.setStyle(s.FILL), g.setPixelOffset(n.ZERO), g.setEyeOffset(o.ZERO), g.setHorizontalOrigin(l.CENTER), g.setVerticalOrigin(u.CENTER) } g.setShow(C); var E = h.getValue(r);
t(E) && g.setText(E), d = y.getValue(r, d), t(d) && g.setPosition(d); var b = c.scale; if (t(b)) { var T = b.getValue(r);
t(T) && g.setScale(T) } if (b = c.font, t(b)) { var A = b.getValue(r);
t(A) && g.setFont(A) } if (b = c.fillColor, t(b) && (m = b.getValue(r, m), t(m) && g.setFillColor(m)), b = c.outlineColor, t(b) && (p = b.getValue(r, p), t(p) && g.setOutlineColor(p)), b = c.outlineWidth, t(b)) { var M = b.getValue(r);
t(M) && g.setOutlineWidth(M) } if (b = c.style, t(b)) { var P = b.getValue(r);
t(P) && g.setStyle(P) } if (b = c.pixelOffset, t(b) && (v = b.getValue(r, v), t(v) && g.setPixelOffset(v)), b = c.eyeOffset, t(b) && (f = b.getValue(r, f), t(f) && g.setEyeOffset(f)), b = c.horizontalOrigin, t(b)) { var D = b.getValue(r);
t(D) && g.setHorizontalOrigin(D) } if (b = c.verticalOrigin, t(b)) { var I = b.getValue(r);
t(I) && g.setVerticalOrigin(I) } } } } } var h = function(r, i) { if (!t(r)) throw new e("scene is required.");
this._scene = r, this._unusedIndexes = [], this._dynamicObjectCollection = void 0; var n = this._labelCollection = new a;
r.getPrimitives().add(n), this.setDynamicObjectCollection(i) };
h.prototype.getScene = function() { return this._scene }, h.prototype.getDynamicObjectCollection = function() { return this._dynamicObjectCollection }, h.prototype.setDynamicObjectCollection = function(e) { var r = this._dynamicObjectCollection;
r !== e && (t(r) && (r.objectsRemoved.removeEventListener(h.prototype._onObjectsRemoved, this), this.removeAllPrimitives()), this._dynamicObjectCollection = e, t(e) && e.objectsRemoved.addEventListener(h.prototype._onObjectsRemoved, this)) }, h.prototype.update = function(r) { if (!t(r)) throw new e("time is requied."); if (t(this._dynamicObjectCollection))
for (var i = this._dynamicObjectCollection.getObjects(), n = 0, o = i.length; o > n; n++) c(this, r, i[n]) }, h.prototype.removeAllPrimitives = function() { if (this._unusedIndexes = [], this._labelCollection.removeAll(), t(this._dynamicObjectCollection))
for (var e = this._dynamicObjectCollection.getObjects(), r = e.length - 1; r > -1; r--) e[r]._labelVisualizerIndex = void 0 }, h.prototype.isDestroyed = function() { return !1 }, h.prototype.destroy = function() { return this.removeAllPrimitives(), this._scene.getPrimitives().remove(this._labelCollection), r(this) }; var d, m, p, f, v; return h.prototype._onObjectsRemoved = function(e, r) { for (var i = this._labelCollection, n = this._unusedIndexes, o = r.length - 1; o > -1; o--) { var a = r[o],
s = a._labelVisualizerIndex; if (t(s)) { var l = i.get(s);
l.setShow(!1), n.push(s), a._labelVisualizerIndex = void 0 } } }, h }), r("Scene/Polyline", ["../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/BoundingSphere", "../Core/Color", "../Core/PolylinePipeline", "../Core/Matrix4", "./Material"], function(e, t, r, i, n, o, a, s) { "use strict";
function l(e, r) {++e._propertiesChanged[r]; var i = e._polylineCollection;
t(i) && (i._updatePolyline(e, r), e._dirty = !0) } var u = {},
c = function(r, l) { r = e(r, u), this._show = e(r.show, !0), this._width = e(r.width, 1), this._material = r.material, t(this._material) || (this._material = s.fromType(void 0, s.ColorType), this._material.uniforms.color = new n(1, 1, 1, 1)); var c = r.positions;
t(c) || (c = []), this._positions = c; var h;
t(this._polylineCollection) && (h = a.clone(this._polylineCollection.modelMatrix)), this._modelMatrix = h, this._segments = o.wrapLongitude(c, h), this._actualLength = void 0, this._propertiesChanged = new Uint32Array(v), this._polylineCollection = l, this._dirty = !1, this._pickId = void 0, this._pickIdThis = r._pickIdThis, this._boundingVolume = i.fromPoints(this._positions), this._boundingVolume2D = new i },
h = c.SHOW_INDEX = 0,
d = c.WIDTH_INDEX = 1,
m = c.POSITION_INDEX = 2,
p = c.MATERIAL_INDEX = 3,
f = c.POSITION_SIZE_INDEX = 4,
v = c.NUMBER_OF_PROPERTIES = 5; return c.prototype.getShow = function() { return this._show }, c.prototype.setShow = function(e) { if (!t(e)) throw new r("value is required.");
e !== this._show && (this._show = e, l(this, h)) }, c.prototype.getPositions = function() { return this._positions }, c.prototype.setPositions = function(e) { if (!t(e)) throw new r("value is required.");
this._positions.length !== e.length && l(this, f), this._positions = e, this._boundingVolume = i.fromPoints(this._positions, this._boundingVolume), l(this, m), this.update() }, c.prototype.update = function() { var e = a.IDENTITY;
t(this._polylineCollection) && (e = this._polylineCollection.modelMatrix); var r = this._segments.positions.length,
i = this._segments.lengths,
n = this._propertiesChanged[m] > 0 || this._propertiesChanged[f] > 0; if ((!e.equals(this._modelMatrix) || n) && (this._segments = o.wrapLongitude(this._positions, e)), this._modelMatrix = e, this._segments.positions.length !== r) l(this, f);
else
for (var s = i.length, u = 0; s > u; ++u)
if (i[u] !== this._segments.lengths[u]) { l(this, f); break } }, c.prototype.getMaterial = function() { return this._material }, c.prototype.setMaterial = function(e) { if (!t(e)) throw new r("material is required.");
this._material = e, l(this, p) }, c.prototype.getWidth = function() { return this._width }, c.prototype.setWidth = function(e) { if (!t(e)) throw new r("value is required."); var i = this._width;
e !== i && (this._width = e, l(this, d)) }, c.prototype.getPickId = function(r) { return t(this._pickId) || (this._pickId = r.createPickId(e(this._pickIdThis, this))), this._pickId }, c.prototype._clean = function() { this._dirty = !1; for (var e = this._propertiesChanged, t = 0; v - 1 > t; ++t) e[t] = 0 }, c.prototype._destroy = function() { this._pickId = this._pickId && this._pickId.destroy(), this._material = this._material && this._material.destroy(), this._polylineCollection = void 0 }, c }), r("Shaders/PolylineVS", [], function() { "use strict"; return "attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 position2DHigh;\nattribute vec3 position2DLow;\nattribute vec3 prevPosition3DHigh;\nattribute vec3 prevPosition3DLow;\nattribute vec3 prevPosition2DHigh;\nattribute vec3 prevPosition2DLow;\nattribute vec3 nextPosition3DHigh;\nattribute vec3 nextPosition3DLow;\nattribute vec3 nextPosition2DHigh;\nattribute vec3 nextPosition2DLow;\nattribute vec4 texCoordExpandWidthAndShow;\nattribute vec4 pickColor;\nvarying vec2 v_textureCoordinates;\nvarying float v_width;\nvarying vec4 czm_pickColor;\nconst vec2 czm_highResolutionSnapScale = vec2(1.0, 1.0);\nvoid clipLineSegmentToNearPlane(\nvec3 p0,\nvec3 p1,\nout vec4 positionWC,\nout bool clipped,\nout bool culledByNearPlane)\n{\nculledByNearPlane = false;\nclipped = false;\nvec3 p1ToP0 = p1 - p0;\nfloat magnitude = length(p1ToP0);\nvec3 direction = normalize(p1ToP0);\nfloat endPoint0Distance = -(czm_currentFrustum.x + p0.z);\nfloat denominator = -direction.z;\nif (endPoint0Distance < 0.0 && abs(denominator) < czm_epsilon7)\n{\nculledByNearPlane = true;\n}\nelse if (endPoint0Distance < 0.0 && abs(denominator) > czm_epsilon7)\n{\nfloat t = (czm_currentFrustum.x + p0.z) / denominator;\nif (t < 0.0 || t > magnitude)\n{\nculledByNearPlane = true;\n}\nelse\n{\np0 = p0 + t * direction;\nclipped = true;\n}\n}\npositionWC = czm_eyeToWindowCoordinates(vec4(p0, 1.0));\n}\nvoid main()\n{\nfloat texCoord = texCoordExpandWidthAndShow.x;\nfloat expandDir = texCoordExpandWidthAndShow.y;\nfloat width = abs(texCoordExpandWidthAndShow.z) + 0.5;\nbool usePrev = texCoordExpandWidthAndShow.z < 0.0;\nfloat show = texCoordExpandWidthAndShow.w;\nvec4 p, prev, next;\nif (czm_morphTime == 1.0)\n{\np = czm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz);\nprev = czm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz);\nnext = czm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz);\n}\nelse if (czm_morphTime == 0.0)\n{\np = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\nprev = czm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy);\nnext = czm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy);\n}\nelse\n{\np = czm_columbusViewMorph(\nczm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\nczm_translateRelativeToEye(position3DHigh.xyz, position3DLow.xyz),\nczm_morphTime);\nprev = czm_columbusViewMorph(\nczm_translateRelativeToEye(prevPosition2DHigh.zxy, prevPosition2DLow.zxy),\nczm_translateRelativeToEye(prevPosition3DHigh.xyz, prevPosition3DLow.xyz),\nczm_morphTime);\nnext = czm_columbusViewMorph(\nczm_translateRelativeToEye(nextPosition2DHigh.zxy, nextPosition2DLow.zxy),\nczm_translateRelativeToEye(nextPosition3DHigh.xyz, nextPosition3DLow.xyz),\nczm_morphTime);\n}\nvec4 endPointWC, p0, p1;\nbool culledByNearPlane, clipped;\nvec4 positionEC = czm_modelViewRelativeToEye * p;\nvec4 prevEC = czm_modelViewRelativeToEye * prev;\nvec4 nextEC = czm_modelViewRelativeToEye * next;\nclipLineSegmentToNearPlane(prevEC.xyz, positionEC.xyz, p0, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(nextEC.xyz, positionEC.xyz, p1, clipped, culledByNearPlane);\nclipLineSegmentToNearPlane(positionEC.xyz, usePrev ? prevEC.xyz : nextEC.xyz, endPointWC, clipped, culledByNearPlane);\nif (culledByNearPlane)\n{\ngl_Position = czm_projection * vec4(0.0, 0.0, 0.0, 1.0);\nreturn;\n}\nvec2 prevWC = normalize(p0.xy - endPointWC.xy);\nvec2 nextWC = normalize(p1.xy - endPointWC.xy);\nfloat expandWidth = width * 0.5;\nvec2 direction;\nif (czm_equalsEpsilon(normalize(prev.xyz - p.xyz), vec3(0.0), czm_epsilon1) || czm_equalsEpsilon(prevWC, -nextWC, czm_epsilon1))\n{\ndirection = vec2(-nextWC.y, nextWC.x);\n}\nelse if (czm_equalsEpsilon(normalize(next.xyz - p.xyz), vec3(0.0), czm_epsilon1) || clipped)\n{\ndirection = vec2(prevWC.y, -prevWC.x);\n}\nelse\n{\nvec2 normal = vec2(-nextWC.y, nextWC.x);\ndirection = normalize((nextWC + prevWC) * 0.5);\nif (dot(direction, normal) < 0.0)\n{\ndirection = -direction;\n}\nfloat sinAngle = abs(direction.x * nextWC.y - direction.y * nextWC.x);\nexpandWidth = clamp(expandWidth / sinAngle, 0.0, width * 2.0);\n}\nvec2 offset = direction * expandDir * expandWidth * czm_highResolutionSnapScale;\nvec4 positionWC = vec4(endPointWC.xy + offset, -endPointWC.z, 1.0);\ngl_Position = czm_viewportOrthographic * positionWC * show;\nv_textureCoordinates = vec2(texCoord, clamp(expandDir, 0.0, 1.0));\nv_width = width;\nczm_pickColor = pickColor;\n}\n" }), r("Shaders/PolylineFS", [], function() { "use strict"; return "varying vec2 v_textureCoordinates;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_textureCoordinates.s;\nmaterialInput.st = v_textureCoordinates;\nmaterialInput.str = vec3(v_textureCoordinates, 0.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n" }), r("Scene/PolylineCollection", ["../Core/defined", "../Core/DeveloperError", "../Core/Color", "../Core/combine", "../Core/destroyObject", "../Core/Cartesian3", "../Core/Cartesian4", "../Core/EncodedCartesian3", "../Core/Matrix4", "../Core/Math", "../Core/ComponentDatatype", "../Core/IndexDatatype", "../Core/PrimitiveType", "../Core/BoundingSphere", "../Core/Intersect", "../Renderer/BlendingState", "../Renderer/BufferUsage", "../Renderer/CommandLists", "../Renderer/DrawCommand", "../Renderer/createShaderSource", "./Material", "./SceneMode", "./Polyline", "../Shaders/PolylineVS", "../Shaders/PolylineFS"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C, x, S, E) {
"use strict";
function b(t, r, i, n, o, a, s) { for (var l = o.length, u = i.length, c = 0, h = !0, p = 0; l > p; ++p)
for (var f = o[p], v = f.buckets, y = v.length, _ = 0; y > _; ++_) { for (var w, x, S, E = v[_], b = E.offset, T = s ? E.bucket.shaderProgram : E.bucket.pickShaderProgram, A = E.bucket.polylines, P = A.length, D = 0, I = 0; P > I; ++I) { var O = A[I],
R = M(O._material);
R !== w && (e(w) && (c >= u ? (S = new g, S.owner = t, i.push(S)) : S = i[c], ++c, S.boundingVolume = m.clone(j, S.boundingVolume), S.modelMatrix = n, S.primitiveType = d.TRIANGLES, S.shaderProgram = T, S.vertexArray = f.va, S.renderState = a, S.uniformMap = x._uniforms, S.count = D, S.offset = b, b += D, D = 0, h = !0), x = O._material, w = R); for (var L = O._locatorBuckets, z = L.length, N = 0; z > N; ++N) { var F = L[N];
F.locator === E && (D += F.count) } var B;
r.mode === C.SCENE3D ? B = O._boundingVolume : r.mode === C.COLUMBUS_VIEW ? B = O._boundingVolume2D : r.mode === C.SCENE2D ? e(O._boundingVolume2D) && (B = m.clone(O._boundingVolume2D, Y), B.center.x = 0) : e(O._boundingVolume) && e(O._boundingVolume2D) && (B = m.union(O._boundingVolume, O._boundingVolume2D, Y)), h ? (h = !1, m.clone(B, j)) : m.union(B, j, j) } e(w) && D > 0 && (c >= u ? (S = new g, S.owner = t, i.push(S)) : S = i[c], ++c, S.boundingVolume = m.clone(j, S.boundingVolume), S.modelMatrix = n, S.primitiveType = d.TRIANGLES, S.shaderProgram = T, S.vertexArray = f.va, S.renderState = a, S.uniformMap = x._uniforms, S.count = D, S.offset = b, h = !0), w = void 0 } i.length = c }
function T(e) {
for (var t = e._buffersUsage, r = !1, i = e._propertiesChanged, n = 0; U - 2 > n; ++n) {
var o = t[n];
i[n] ? o.bufferUsage !== v.STREAM_DRAW ? (r = !0, o.bufferUsage = v.STREAM_DRAW, o.frameCount = 100) : o.frameCount = 100 : o.bufferUsage !== v.STATIC_DRAW && (0 === o.frameCount ? (r = !0, o.bufferUsage = v.STATIC_DRAW) : o.frameCount--)
}
return r
}
function A(t, r) { t._createVertexArray = !1, O(t), R(t), P(t); var i, n, o = [
[]
],
a = o[0],
s = [0],
l = 0,
d = [
[]
],
m = 0,
p = t._polylineBuckets; for (i in p) p.hasOwnProperty(i) && (n = p[i], n.updateShader(r), m += n.lengthOfPositions); if (m > 0) { var f, y = t._mode,
g = new Float32Array(3 * 6 * m),
_ = new Uint8Array(4 * m),
w = new Float32Array(4 * m),
x = 0,
S = 0,
E = 0; for (i in p)
if (p.hasOwnProperty(i)) { n = p[i], n.write(g, _, w, x, S, E, r), y === C.MORPHING && (e(f) || (f = new Float32Array(3 * 6 * m)), n.writeForMorph(f, x)); var b = n.lengthOfPositions;
x += 3 * 6 * b, S += 4 * b, E += 4 * b, l = n.updateIndices(o, s, d, l) }
var T = t._buffersUsage[V].bufferUsage,
A = t._buffersUsage[F].bufferUsage,
M = t._buffersUsage[B].bufferUsage,
D = A === v.STREAM_DRAW || M === v.STREAM_DRAW ? v.STREAM_DRAW : v.STATIC_DRAW;
t._positionBuffer = r.createVertexBuffer(g, T); var I;
e(f) && (I = r.createVertexBuffer(f, T)), t._pickColorBuffer = r.createVertexBuffer(_, v.STATIC_DRAW), t._texCoordExpandWidthAndShowBuffer = r.createVertexBuffer(w, D); for (var L = 4 * Uint8Array.BYTES_PER_ELEMENT, z = 3 * Float32Array.BYTES_PER_ELEMENT, N = 4 * Float32Array.BYTES_PER_ELEMENT, q = 0, k = o.length, U = 0; k > U; ++U)
if (a = o[U], a.length > 0) { var G = new Uint16Array(a),
H = r.createIndexBuffer(G, v.STATIC_DRAW, h.UNSIGNED_SHORT);
q += s[U]; var j, Y, Z, K, J = 6 * (U * z * u.SIXTY_FOUR_KILOBYTES - q * z),
Q = z + J,
$ = z + Q,
et = z + $,
tt = z + et,
rt = z + tt,
it = U * L * u.SIXTY_FOUR_KILOBYTES - q * L,
nt = U * N * u.SIXTY_FOUR_KILOBYTES - q * N,
ot = [{ index: W.position3DHigh, componentsPerAttribute: 3, componentDatatype: c.FLOAT, offsetInBytes: J, strideInBytes: 6 * z }, { index: W.position3DLow, componentsPerAttribute: 3, componentDatatype: c.FLOAT, offsetInBytes: Q, strideInBytes: 6 * z }, { index: W.position2DHigh, componentsPerAttribute: 3, componentDatatype: c.FLOAT, offsetInBytes: J, strideInBytes: 6 * z }, { index: W.position2DLow, componentsPerAttribute: 3, componentDatatype: c.FLOAT, offsetInBytes: Q, strideInBytes: 6 * z }, { index: W.prevPosition3DHigh, componentsPerAttribute: 3, componentDatatype: c.FLOAT, offsetInBytes: $, strideInBytes: 6 * z }, { index: W.prevPosition3DLow, componentsPerAttribute: 3, componentDatatype: c.FLOAT, offsetInBytes: et, strideInBytes: 6 * z }, { index: W.prevPosition2DHigh, componentsPerAttribute: 3, componentDatatype: c.FLOAT, offsetInBytes: $, strideInBytes: 6 * z }, { index: W.prevPosition2DLow, componentsPerAttribute: 3, componentDatatype: c.FLOAT, offsetInBytes: et, strideInBytes: 6 * z }, { index: W.nextPosition3DHigh, componentsPerAttribute: 3, componentDatatype: c.FLOAT, offsetInBytes: tt, strideInBytes: 6 * z }, { index: W.nextPosition3DLow, componentsPerAttribute: 3, componentDatatype: c.FLOAT, offsetInBytes: rt, strideInBytes: 6 * z }, { index: W.nextPosition2DHigh, componentsPerAttribute: 3, componentDatatype: c.FLOAT, offsetInBytes: tt, strideInBytes: 6 * z }, { index: W.nextPosition2DLow, componentsPerAttribute: 3, componentDatatype: c.FLOAT, offsetInBytes: rt, strideInBytes: 6 * z }, { index: W.texCoordExpandWidthAndShow, componentsPerAttribute: 4, componentDatatype: c.FLOAT, vertexBuffer: t._texCoordExpandWidthAndShowBuffer, offsetInBytes: nt }, { index: W.pickColor, componentsPerAttribute: 4, componentDatatype: c.UNSIGNED_BYTE, vertexBuffer: t._pickColorBuffer, offsetInBytes: it, normalize: !0 }];
y === C.SCENE3D ? (j = t._positionBuffer, Y = "vertexBuffer", Z = X, K = "value") : y === C.SCENE2D || y === C.COLUMBUS_VIEW ? (j = X, Y = "value", Z = t._positionBuffer, K = "vertexBuffer") : (j = I, Y = "vertexBuffer", Z = t._positionBuffer, K = "vertexBuffer"), ot[0][Y] = j, ot[1][Y] = j, ot[2][K] = Z, ot[3][K] = Z, ot[4][Y] = j, ot[5][Y] = j, ot[6][K] = Z, ot[7][K] = Z, ot[8][Y] = j, ot[9][Y] = j, ot[10][K] = Z, ot[11][K] = Z; var at = r.createVertexArray(ot, H);
t._vertexArrays.push({ va: at, buckets: d[U] }) } } }
function M(e) { var t = w._uniformList[e.type],
r = t.length;
Z.length = 2 * r; for (var i = 0, n = 0; r > n; ++n) { var o = t[n];
Z[i] = o, Z[i + 1] = e._uniforms[o](), i += 2 } return e.type + ":" + JSON.stringify(Z) }
function P(t) { for (var r = t._mode, i = t._projection, n = t._modelMatrix, o = t._polylineBuckets = {}, a = t._polylines, s = a.length, l = 0; s > l; ++l) { var u = a[l]; if (u.getPositions().length > 1) { u.update(); var c = u.getMaterial(),
h = o[c.type];
e(h) || (h = o[c.type] = new K(c, r, i, n)), h.addPolyline(u) } } }
function D(e, t) { var r = t.mode,
i = t.scene2D.projection;
e._mode === r && e._projection === i && e._modelMatrix.equals(e.modelMatrix) || (e._mode = r, e._projection = i, e._modelMatrix = e.modelMatrix.clone(), e._createVertexArray = !0) }
function I(t) { if (t._polylinesRemoved) { t._polylinesRemoved = !1; for (var r = [], i = t._polylines.length, n = 0, o = 0; i > n; ++n) { var a = t._polylines[n];
e(a) && (a._index = o++, r.push(a)) } t._polylines = r } }
function O(t) { for (var r = t._polylines, i = r.length, n = 0; i > n; ++n)
if (e(r[n])) { var o = r[n]._bucket;
e(o) && (o.shaderProgram = o.shaderProgram && o.shaderProgram.release()) } }
function R(e) { for (var t = e._vertexArrays.length, r = 0; t > r; ++r) e._vertexArrays[r].va.destroy();
e._vertexArrays.length = 0 }
function L(t) { for (var r = t._polylines, i = r.length, n = 0; i > n; ++n) e(r[n]) && r[n]._destroy() }
function z(e, t, r) { this.count = e, this.offset = t, this.bucket = r }
function N(e) { return o.dot(o.UNIT_X, e._boundingVolume.center) < 0 || e._boundingVolume.intersect(a.UNIT_Y) === p.INTERSECTING }
var F = x.SHOW_INDEX,
B = x.WIDTH_INDEX,
V = x.POSITION_INDEX,
q = x.MATERIAL_INDEX,
k = x.POSITION_SIZE_INDEX,
U = x.NUMBER_OF_PROPERTIES,
W = { texCoordExpandWidthAndShow: 0, position3DHigh: 1, position3DLow: 2, position2DHigh: 3, position2DLow: 4, prevPosition3DHigh: 5, prevPosition3DLow: 6, prevPosition2DHigh: 7, prevPosition2DLow: 8, nextPosition3DHigh: 9, nextPosition3DLow: 10, nextPosition2DHigh: 11, nextPosition2DLow: 12, pickColor: 13 },
G = function() { this.modelMatrix = l.IDENTITY.clone(), this._modelMatrix = l.IDENTITY.clone(), this._rs = void 0, this._commandLists = new y, this._colorCommands = [], this._pickCommands = [], this._polylinesUpdated = !1, this._polylinesRemoved = !1, this._createVertexArray = !1, this._propertiesChanged = new Uint32Array(U), this._polylines = [], this._polylineBuckets = {}, this._buffersUsage = [{ bufferUsage: v.STATIC_DRAW, frameCount: 0 }, { bufferUsage: v.STATIC_DRAW, frameCount: 0 }, { bufferUsage: v.STATIC_DRAW, frameCount: 0 }], this._mode = void 0, this._polylinesToUpdate = [], this._vertexArrays = [], this._positionBuffer = void 0, this._pickColorBuffer = void 0, this._texCoordExpandWidthAndShowBuffer = void 0 };
G.prototype.add = function(e) { var t = new x(e, this); return t._index = this._polylines.length, this._polylines.push(t), this._createVertexArray = !0, t }, G.prototype.remove = function(t) { if (this.contains(t)) { if (this._polylines[t._index] = void 0, this._polylinesRemoved = !0, this._createVertexArray = !0, e(t._bucket)) { var r = t._bucket;
r.shaderProgram = r.shaderProgram && r.shaderProgram.release(), r.pickShaderProgram = r.pickShaderProgram && r.pickShaderProgram.release() } return t._destroy(), !0 } return !1 }, G.prototype.removeAll = function() { O(this), L(this), this._polylineBuckets = {}, this._polylinesRemoved = !1, this._polylines.length = 0, this._polylinesToUpdate.length = 0, this._createVertexArray = !0 }, G.prototype.contains = function(t) { return e(t) && t._polylineCollection === this }, G.prototype.get = function(r) { if (!e(r)) throw new t("index is required."); return I(this), this._polylines[r] }, G.prototype.getLength = function() { return I(this), this._polylines.length };
var H = [];
G.prototype.update = function(t, r, i) { if (I(this), 0 !== this._polylines.length) { D(this, r); var n, o = this._propertiesChanged; if (this._createVertexArray || T(this)) A(this, t);
else if (this._polylinesUpdated) { var a = this._polylinesToUpdate; if (this._mode !== C.SCENE3D)
for (var s = a.length, u = 0; s > u; ++u) n = a[u], n.update(); if (o[k] || o[q]) A(this, t);
else
for (var c = a.length, h = this._polylineBuckets, d = 0; c > d; ++d) { n = a[d], o = n._propertiesChanged; var m = n._bucket,
p = 0; for (var v in h)
if (h.hasOwnProperty(v)) { if (h[v] === m) {
(o[V] || o[F] || o[B]) && m.writeUpdate(p, n, this._positionBuffer, this._texCoordExpandWidthAndShowBuffer); break } p += h[v].lengthOfPositions }
n._clean() } a.length = 0, this._polylinesUpdated = !1 } for (var y = 0; U > y; ++y) o[y] = 0; var g = l.IDENTITY;
r.mode === C.SCENE3D && (g = this.modelMatrix); var _ = r.passes,
w = 0 !== r.morphTime,
x = this._commandLists; if (x.colorList = H, x.pickList = H, e(this._rs) && this._rs.depthTest.enabled === w || (this._rs = t.createRenderState({ blending: f.ALPHA_BLEND, depthMask: !w, depthTest: { enabled: w } })), _.color) { var S = this._colorCommands;
x.colorList = S, b(this, r, S, g, this._vertexArrays, this._rs, !0) } if (_.pick) { var E = this._pickCommands;
x.pickList = E, b(this, r, E, g, this._vertexArrays, this._rs, !1) } this._commandLists.empty() || i.push(this._commandLists) } };
var j = new m,
Y = new m;
G.prototype.isDestroyed = function() { return !1 }, G.prototype.destroy = function() { return R(this), O(this), L(this), n(this) };
var X = [0, 0, 0],
Z = [];
G.prototype._updatePolyline = function(e, t) { this._polylinesUpdated = !0, this._polylinesToUpdate.push(e), ++this._propertiesChanged[t] };
var K = function(e, t, r, i) { this.polylines = [], this.lengthOfPositions = 0, this.material = e, this.shaderProgram = void 0, this.pickShaderProgram = void 0, this.mode = t, this.projection = r, this.ellipsoid = r.getEllipsoid(), this.modelMatrix = i };
K.prototype.addPolyline = function(e) { var t = this.polylines;
t.push(e), e._actualLength = this.getPolylinePositionsLength(e), this.lengthOfPositions += e._actualLength, e._bucket = this }, K.prototype.updateShader = function(t) { if (!e(this.shaderProgram)) { var r = _({ sources: [this.material.shaderSource, E] }),
i = _({ sources: [r], pickColorQualifier: "varying" });
this.shaderProgram = t.getShaderCache().getShaderProgram(S, r, W), this.pickShaderProgram = t.getShaderCache().getShaderProgram(S, i, W) } }, K.prototype.getPolylinePositionsLength = function(e) { var t; if (this.mode === C.SCENE3D || !N(e)) return t = e.getPositions().length, 4 * t - 4; var r = 0,
i = e._segments.lengths;
t = i.length; for (var n = 0; t > n; ++n) r += 4 * i[n] - 4; return r };
var J = new o,
Q = new o,
$ = new o,
et = new o;
K.prototype.write = function(e, t, i, n, a, l, u) { for (var c = this.mode, h = this.polylines, d = h.length, m = 0; d > m; ++m)
for (var p, f = h[m], v = f.getWidth(), y = f.getShow() && v > 0, g = this.getSegments(f), _ = g.positions, w = g.lengths, x = _.length, S = f.getPickId(u).color, E = 0, b = 0, T = 0; x > T; ++T) { 0 === T ? (p = et, o.subtract(_[0], _[1], p), o.add(_[0], p, p)) : p = _[T - 1], Q.x = p.x, Q.y = p.y, Q.z = c !== C.SCENE2D ? p.z : 0, p = _[T], J.x = p.x, J.y = p.y, J.z = c !== C.SCENE2D ? p.z : 0, T === x - 1 ? (p = et, o.subtract(_[x - 1], _[x - 2], p), o.add(_[x - 1], p, p)) : p = _[T + 1], $.x = p.x, $.y = p.y, $.z = c !== C.SCENE2D ? p.z : 0; var A = w[E];
T === b + A && (b += A, ++E); for (var M = 0 === T - b, P = T === b + w[E] - 1, D = M ? 2 : 0, I = P ? 2 : 4, O = D; I > O; ++O) { s.writeElements(J, e, n), s.writeElements(Q, e, n + 6), s.writeElements($, e, n + 12), t[a] = r.floatToByte(S.red), t[a + 1] = r.floatToByte(S.green), t[a + 2] = r.floatToByte(S.blue), t[a + 3] = r.floatToByte(S.alpha); var R = 0 > O - 2 ? -1 : 1;
i[l] = T / (x - 1), i[l + 1] = 2 * (O % 2) - 1, i[l + 2] = R * v, i[l + 3] = y, n += 18, a += 4, l += 4 } } };
var tt = new o,
rt = new o,
it = new o,
nt = new o;
K.prototype.writeForMorph = function(e, t) { for (var r = this.modelMatrix, i = this.polylines, n = i.length, a = 0; n > a; ++a)
for (var u = i[a], c = u._segments.positions, h = u._segments.lengths, d = c.length, m = 0, p = 0, f = 0; d > f; ++f) { var v;
0 === f ? (v = nt, o.subtract(c[0], c[1], v), o.add(c[0], v, v)) : v = c[f - 1], v = l.multiplyByPoint(r, v, rt); var y, g = l.multiplyByPoint(r, c[f], tt);
f === d - 1 ? (y = nt, o.subtract(c[d - 1], c[d - 2], y), o.add(c[d - 1], y, y)) : y = c[f + 1], y = l.multiplyByPoint(r, y, it); var _ = h[m];
f === p + _ && (p += _, ++m); for (var w = 0 === f - p, C = f === p + h[m] - 1, x = w ? 2 : 0, S = C ? 2 : 4, E = x; S > E; ++E) s.writeElements(g, e, t), s.writeElements(v, e, t + 6), s.writeElements(y, e, t + 12), t += 18 } };
var ot = new Array(1);
K.prototype.updateIndices = function(e, t, r, i) { var n = r.length - 1,
o = new z(0, i, this);
r[n].push(o); var a = 0,
s = e[e.length - 1],
l = 0;
s.length > 0 && (l = s[s.length - 1] + 1); for (var c = this.polylines, h = c.length, d = 0; h > d; ++d) { var m = c[d];
m._locatorBuckets = []; var p; if (this.mode === C.SCENE3D) { p = ot; var f = m.getPositions().length; if (!(f > 0)) continue;
p[0] = f } else p = m._segments.lengths; var v = p.length; if (v > 0) { for (var y = 0, g = 0; v > g; ++g)
for (var _ = p[g] - 1, w = 0; _ > w; ++w) l + 4 >= u.SIXTY_FOUR_KILOBYTES - 1 && (m._locatorBuckets.push({ locator: o, count: y }), y = 0, t.push(4), s = [], e.push(s), l = 0, o.count = a, a = 0, i = 0, o = new z(0, 0, this), r[++n] = [o]), s.push(l, l + 2, l + 1), s.push(l + 1, l + 2, l + 3), y += 6, a += 6, i += 6, l += 4;
m._locatorBuckets.push({ locator: o, count: y }), l + 4 >= u.SIXTY_FOUR_KILOBYTES - 1 && (t.push(0), s = [], e.push(s), l = 0, o.count = a, i = 0, a = 0, o = new z(0, 0, this), r[++n] = [o]) } m._clean() } return o.count = a, i }, K.prototype.getPolylineStartIndex = function(e) { for (var t = this.polylines, r = 0, i = t.length, n = 0; i > n; ++n) { var o = t[n]; if (o === e) break;
r += o._actualLength } return r };
var at = { positions: void 0, lengths: void 0 },
st = new Array(1);
return K.prototype.getSegments = function(e) { var t = e.getPositions(); if (this.mode === C.SCENE3D) return st[0] = t.length, at.positions = t, at.lengths = st, at;
N(e) && (t = e._segments.positions); for (var r, i, n = this.ellipsoid, a = this.projection, s = [], l = this.modelMatrix, u = t.length, c = 0; u > c; ++c) r = t[c], i = l.multiplyByPoint(r), s.push(a.project(n.cartesianToCartographic(o.fromCartesian4(i)))); if (s.length > 0) { e._boundingVolume2D = m.fromPoints(s, e._boundingVolume2D); var h = e._boundingVolume2D.center;
e._boundingVolume2D.center = new o(h.z, h.x, h.y) } return at.positions = s, at.lengths = e._segments.lengths, at }, K.prototype.writeUpdate = function(e, t, r, i) { var n = this.mode,
a = t._actualLength; if (a) { e += this.getPolylineStartIndex(t); var l, u = new Float32Array(3 * 6 * a),
c = new Float32Array(4 * a),
h = 0,
d = 0,
m = this.getSegments(t),
p = m.positions,
f = m.lengths,
v = 0,
y = 0,
g = t.getWidth(),
_ = t.getShow() && g > 0;
a = p.length; for (var w = 0; a > w; ++w) { 0 === w ? (l = et, o.subtract(p[0], p[1], l), o.add(p[0], l, l)) : l = p[w - 1], Q.x = l.x, Q.y = l.y, Q.z = n !== C.SCENE2D ? l.z : 0, l = p[w], J.x = l.x, J.y = l.y, J.z = n !== C.SCENE2D ? l.z : 0, w === a - 1 ? (l = et, o.subtract(p[a - 1], p[a - 2], l), o.add(p[a - 1], l, l)) : l = p[w + 1], $.x = l.x, $.y = l.y, $.z = n !== C.SCENE2D ? l.z : 0; var x = f[v];
w === y + x && (y += x, ++v); for (var S = 0 === w - y, E = w === y + f[v] - 1, b = S ? 2 : 0, T = E ? 2 : 4, A = b; T > A; ++A) { s.writeElements(J, u, h), s.writeElements(Q, u, h + 6), s.writeElements($, u, h + 12); var M = 0 > A - 2 ? -1 : 1;
c[d] = w / (a - 1), c[d + 1] = 2 * (A % 2) - 1, c[d + 2] = M * g, c[d + 3] = _, h += 18, d += 4 } } r.copyFromArrayView(u, 18 * Float32Array.BYTES_PER_ELEMENT * e), i.copyFromArrayView(c, 4 * Float32Array.BYTES_PER_ELEMENT * e) } }, G
}), r("DynamicScene/DynamicPathVisualizer", ["../Core/defined", "../Core/DeveloperError", "../Core/destroyObject", "../Core/Cartesian3", "../Core/Matrix3", "../Core/Matrix4", "../Core/Color", "../Core/Transforms", "../Core/ReferenceFrame", "./SampledPositionProperty", "./CompositePositionProperty", "./TimeIntervalCollectionPositionProperty", "../Scene/Material", "../Scene/SceneMode", "../Scene/PolylineCollection"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p) { "use strict";
function f(t, r, i, n, o, a, s, l) { var u, c = t._property._times,
h = s;
u = t.getValueInReferenceFrame(r, o, l[h]), e(u) && (l[h++] = u); for (var d, m, p, f = !e(n) || n.lessThanOrEquals(r) || n.greaterThanOrEquals(i), v = 0, y = c.length, g = c[v], _ = i, w = !1; y > v;) { if (!f && g.greaterThanOrEquals(n) && (u = t.getValueInReferenceFrame(n, o, l[h]), e(u) && (l[h++] = u), f = !0), g.greaterThan(r) && g.lessThan(_) && !g.equals(n) && (u = t.getValueInReferenceFrame(g, o, l[h]), e(u) && (l[h++] = u)), y - 1 > v) { if (!w) { var C = c[v + 1],
x = g.getSecondsDifference(C);
w = x > a, w && (d = Math.floor(x / a), m = 0, p = x / Math.max(d, 2), d = Math.max(d - 2, 1)) } if (w && d > m) { g = g.addSeconds(p), m++; continue } } w = !1, v++, g = c[v] } return u = t.getValueInReferenceFrame(i, o, l[h]), e(u) && (l[h++] = u), h }
function v(t, r, i, n, o, a, s, l) { for (var u, c = 0, h = s, d = r, m = !e(n) || n.lessThanOrEquals(r) || n.greaterThanOrEquals(i); d.lessThan(i);) !m && d.greaterThanOrEquals(n) && (m = !0, u = t.getValueInReferenceFrame(n, o, l[h]), e(u) && (l[h] = u, h++)), u = t.getValueInReferenceFrame(d, o, l[h]), e(u) && (l[h] = u, h++), c++, d = r.addSeconds(a * c); return u = t.getValueInReferenceFrame(i, o, l[h]), e(u) && (l[h] = u, h++), h }
function y(t, r, i, n, o, a, s, l) { for (var u = s, c = t.getIntervals(), h = 0; h < c.getLength(); h++) { var d = c.get(0); if (d.start.lessThanOrEquals(i)) { var m = t.getValueInReferenceFrame(i, o, l[u]);
e(m) && (l[u] = m, u++) } } return u }
function g(e, t, r, i, n, o, a, s) { for (var l = a, d = e.getIntervals(), m = 0; m < d.getLength(); m++) { var p = d.get(0); if (p.start.lessThanOrEquals(r)) { var _ = p.data;
l = _ instanceof u ? f(_, p.start, p.stop, i, n, o, l, s) : _ instanceof c ? g(_, p.start, p.stop, i, n, o, l, s) : _ instanceof h ? y(_, p.start, p.stop, i, n, o, l, s) : v(_, p.start, p.stop, i, n, o, l, s) } } return l }
function _(t, r, i, n, o, a, s) { e(s) || (s = []); var l = 0; return l = t instanceof u ? f(t, r, i, n, o, a, 0, s) : t instanceof c ? g(t, r, i, n, o, a, 0, s) : t instanceof h ? g(t, r, i, n, o, a, 0, s) : v(t, r, i, n, o, a, 0, s), s.length = l, s } var w = new n,
C = function(e, t) { this._unusedIndexes = [], this._polylineCollection = new p, this._scene = e, this._referenceFrame = t, e.getPrimitives().add(this._polylineCollection) };
C.prototype.update = function(t) { if (this._referenceFrame === l.INERTIAL) { var r = s.computeIcrfToFixedMatrix(t, w);
e(r) || (r = s.computeTemeToPseudoFixedMatrix(t, w)), o.fromRotationTranslation(r, i.ZERO, this._polylineCollection.modelMatrix) } }, C.prototype.updateObject = function(t, r) { var i = r.path; if (e(i)) { var n = r.position; if (e(n)) { var o, s, l, u, c = i.show,
h = r._pathVisualizerIndex,
m = !e(c) || c.getValue(t); if (m) { s = i.leadTime; var p;
e(s) && (p = s.getValue(t)), s = i.trailTime; var f;
e(s) && (f = s.getValue(t)); var v = r.availability,
y = e(v),
g = e(p),
w = e(f);
m = y || g && w, m && (w && (l = t.addSeconds(-f)), !y || w && !v.start.greaterThan(l) || (l = v.start), g && (u = t.addSeconds(p)), !y || g && !v.stop.lessThan(u) || (u = v.stop), m = l.lessThan(u)) } if (!m) return e(h) && (o = this._polylineCollection.get(h), o.setShow(!1), r._pathVisualizerIndex = void 0, this._unusedIndexes.push(h)), void 0; var C; if (e(h)) o = this._polylineCollection.get(h), C = o.getMaterial().uniforms;
else { var x = this._unusedIndexes,
S = x.length;
S > 0 ? (h = x.pop(), o = this._polylineCollection.get(h)) : (h = this._polylineCollection.getLength(), o = this._polylineCollection.add()), r._pathVisualizerIndex = h, o.dynamicObject = r, o.setWidth(1); var E = o.getMaterial();
e(E) && E.type === d.PolylineOutlineType || (E = d.fromType(this._scene.getContext(), d.PolylineOutlineType), o.setMaterial(E)), C = E.uniforms, a.clone(a.WHITE, C.color), a.clone(a.BLACK, C.outlineColor), C.outlineWidth = 0 } o.setShow(!0); var b = 60; if (s = i.resolution, e(s) && (b = s.getValue(t)), o.setPositions(_(n, l, u, t, this._referenceFrame, b, o.getPositions())), s = i.color, e(s) && (C.color = s.getValue(t, C.color)), s = i.outlineColor, e(s) && (C.outlineColor = s.getValue(t, C.outlineColor)), s = i.outlineWidth, e(s) && (C.outlineWidth = s.getValue(t)), s = i.width, e(s)) { var T = s.getValue(t);
e(T) && o.setWidth(T) } } } }, C.prototype.removeObject = function(t) { var r = t._pathVisualizerIndex; if (e(r)) { var i = this._polylineCollection.get(r);
i.setShow(!1), this._unusedIndexes.push(r), t._pathVisualizerIndex = void 0 } }, C.prototype.destroy = function() { return this._scene.getPrimitives().remove(this._polylineCollection), r(this) }; var x = function(r, i) { if (!e(r)) throw new t("scene is required.");
this._scene = r, this._updaters = {}, this._dynamicObjectCollection = void 0, this.setDynamicObjectCollection(i) }; return x.prototype.getScene = function() { return this._scene }, x.prototype.getDynamicObjectCollection = function() { return this._dynamicObjectCollection }, x.prototype.setDynamicObjectCollection = function(t) { var r = this._dynamicObjectCollection;
r !== t && (e(r) && (r.objectsRemoved.removeEventListener(x.prototype._onObjectsRemoved, this), this.removeAllPrimitives()), this._dynamicObjectCollection = t, e(t) && t.objectsRemoved.addEventListener(x.prototype._onObjectsRemoved, this)) }, x.prototype.update = function(r) { if (!e(r)) throw new t("time is requied."); if (e(this._dynamicObjectCollection)) { var i = this._updaters; for (var n in i) i.hasOwnProperty(n) && i[n].update(r); for (var o = this._dynamicObjectCollection.getObjects(), a = 0, s = o.length; s > a; a++) { var u = o[a]; if (e(u.path)) { var c = u.position; if (e(c)) { var h = u._pathUpdater,
d = l.FIXED;
this._scene.mode === m.SCENE3D && (d = c.referenceFrame); var p = this._updaters[d];
h === p && e(p) ? p.updateObject(r, u) : (e(h) && h.removeObject(u), e(p) || (p = new C(this._scene, d), p.update(r), this._updaters[d] = p), u._pathUpdater = p, e(p) && p.updateObject(r, u)) } } } } }, x.prototype.removeAllPrimitives = function() { var t = this._updaters; for (var r in t) t.hasOwnProperty(r) && t[r].destroy(); if (this._updaters = {}, e(this._dynamicObjectCollection))
for (var i = this._dynamicObjectCollection.getObjects(), n = i.length - 1; n > -1; n--) i[n]._pathUpdater = void 0, i[n]._pathVisualizerIndex = void 0 }, x.prototype.isDestroyed = function() { return !1 }, x.prototype.destroy = function() { return this.removeAllPrimitives(), r(this) }, x.prototype._onObjectsRemoved = function(t, r) { for (var i = r.length - 1; i > -1; i--) { var n = r[i],
o = n._pathUpdater;
e(o) && o.removeObject(n) } }, x }), r("DynamicScene/DynamicPointVisualizer", ["../Core/Color", "../Core/defaultValue", "../Core/defined", "../Core/destroyObject", "../Core/DeveloperError", "../Scene/BillboardCollection", "../Renderer/TextureAtlasBuilder"], function(e, t, r, i, n, o, a) { "use strict";
function s(i, n, o) { var a = o.point; if (r(a)) { var s = o.position; if (r(s)) { var l, d = a.show,
m = o._pointVisualizerIndex,
p = o.isAvailable(n) && (!r(d) || d.getValue(n)); if (!p) return r(m) && (l = i._billboardCollection.get(m), l.setShow(!1), l.setImageIndex(-1), o._pointVisualizerIndex = void 0, i._unusedIndexes.push(m)), void 0; var f = !1; if (r(m)) l = i._billboardCollection.get(m);
else { var v = i._unusedIndexes,
y = v.length;
y > 0 ? (m = v.pop(), l = i._billboardCollection.get(m)) : (m = i._billboardCollection.getLength(), l = i._billboardCollection.add()), o._pointVisualizerIndex = m, l.dynamicObject = o, l._visualizerColor = e.WHITE.clone(l._visualizerColor), l._visualizerOutlineColor = e.BLACK.clone(l._visualizerOutlineColor), l._visualizerOutlineWidth = 0, l._visualizerPixelSize = 1, f = !0 } l.setShow(!0), c = s.getValue(n, c), r(c) && l.setPosition(c); var g = a.color; if (r(g) && (u = g.getValue(n, u), e.equals(l._visualizerColor, u) || (e.clone(u, l._visualizerColor), f = !0)), g = a.outlineColor, r(g) && (h = g.getValue(n, h), e.equals(l._visualizerOutlineColor, h) || (e.clone(h, l._visualizerOutlineColor), f = !0)), g = a.outlineWidth, r(g)) { var _ = g.getValue(n);
l._visualizerOutlineWidth !== _ && (l._visualizerOutlineWidth = _, f = !0) } if (g = a.pixelSize, r(g)) { var w = g.getValue(n);
l._visualizerPixelSize !== w && (l._visualizerPixelSize = w, f = !0) } if (f) { var C = t(l._visualizerColor, e.WHITE).toCssColorString(),
x = t(l._visualizerOutlineColor, e.BLACK).toCssColorString(),
S = t(l._visualizerPixelSize, 3),
E = t(l._visualizerOutlineWidth, 2),
b = JSON.stringify([C, S, x, E]);
i._textureAtlasBuilder.addTextureFromFunction(b, function(e, t) { var r = document.createElement("canvas"),
i = S + 2 * E;
r.height = r.width = i; var n = r.getContext("2d");
n.clearRect(0, 0, i, i), 0 !== E && (n.beginPath(), n.arc(i / 2, i / 2, i / 2, 0, 2 * Math.PI, !0), n.closePath(), n.fillStyle = x, n.fill()), n.beginPath(), n.arc(i / 2, i / 2, S / 2, 0, 2 * Math.PI, !0), n.closePath(), n.fillStyle = C, n.fill(), t(r) }, function(e) { l.setImageIndex(e) }) } } } } var l = function(e, t) { if (!r(e)) throw new n("scene is required.");
this._scene = e, this._unusedIndexes = [], this._dynamicObjectCollection = void 0; var i = this._billboardCollection = new o,
s = this._textureAtlas = e.getContext().createTextureAtlas();
this._textureAtlasBuilder = new a(s), i.setTextureAtlas(s), e.getPrimitives().add(i), this.setDynamicObjectCollection(t) };
l.prototype.getScene = function() { return this._scene }, l.prototype.getDynamicObjectCollection = function() { return this._dynamicObjectCollection }, l.prototype.setDynamicObjectCollection = function(e) { var t = this._dynamicObjectCollection;
t !== e && (r(t) && (t.objectsRemoved.removeEventListener(l.prototype._onObjectsRemoved, this), this.removeAllPrimitives()), this._dynamicObjectCollection = e, r(e) && e.objectsRemoved.addEventListener(l.prototype._onObjectsRemoved, this)) }, l.prototype.update = function(e) { if (!r(e)) throw new n("time is requied."); if (r(this._dynamicObjectCollection))
for (var t = this._dynamicObjectCollection.getObjects(), i = 0, o = t.length; o > i; i++) s(this, e, t[i]) }, l.prototype.removeAllPrimitives = function() { if (this._unusedIndexes = [], this._billboardCollection.removeAll(), r(this._dynamicObjectCollection))
for (var e = this._dynamicObjectCollection.getObjects(), t = e.length - 1; t > -1; t--) e[t]._pointVisualizerIndex = void 0 }, l.prototype.isDestroyed = function() { return !1 }, l.prototype.destroy = function() { return this.removeAllPrimitives(), this._scene.getPrimitives().remove(this._billboardCollection), i(this) }; var u, c, h; return l.prototype._onObjectsRemoved = function(e, t) { for (var i = this._billboardCollection, n = this._unusedIndexes, o = t.length - 1; o > -1; o--) { var a = t[o],
s = a._pointVisualizerIndex; if (r(s)) { var l = i.get(s);
l.setShow(!1), l.setImageIndex(-1), a._pointVisualizerIndex = void 0, n.push(s) } } }, l }), r("Scene/Appearance", ["../Core/defaultValue", "../Core/defined", "../Renderer/BlendingState", "../Renderer/CullFace", "../Renderer/createShaderSource"], function(e, t, r, i, n) { "use strict"; var o = function(t) { t = e(t, e.EMPTY_OBJECT), this.material = t.material, this.vertexShaderSource = t.vertexShaderSource, this.fragmentShaderSource = t.fragmentShaderSource, this.renderState = t.renderState, this.translucent = e(t.translucent, !0), this.closed = e(t.closed, !1) }; return o.prototype.getFragmentShaderSource = function() { return n({ defines: [this.flat ? "FLAT" : "", this.faceForward ? "FACE_FORWARD" : ""], sources: [t(this.material) ? this.material.shaderSource : "", this.fragmentShaderSource] }) }, o.getDefaultRenderState = function(e, t) { var n = { depthTest: { enabled: !0 } }; return e && (n.depthMask = !1, n.blending = r.ALPHA_BLEND), t && (n.cull = { enabled: !0, face: i.BACK }), n }, o }), r("Shaders/Appearances/BasicMaterialAppearanceVS", [], function() { "use strict"; return "attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n" }), r("Shaders/Appearances/BasicMaterialAppearanceFS", [], function() { "use strict"; return "varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC;\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(v_normalEC, vec3(0.0, 0.0, 1.0), -v_normalEC));\n#else\nnormalEC = normalize(v_normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n" }), r("Shaders/Appearances/TexturedMaterialAppearanceVS", [], function() { "use strict"; return "attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec2 st;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n" }), r("Shaders/Appearances/TexturedMaterialAppearanceFS", [], function() { "use strict"; return "varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC;\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(v_normalEC, vec3(0.0, 0.0, 1.0), -v_normalEC));\n#else\nnormalEC = normalize(v_normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n" }), r("Shaders/Appearances/AllMaterialAppearanceVS", [], function() { "use strict"; return "attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec3 tangent;\nattribute vec3 binormal;\nattribute vec2 st;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_binormalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_tangentEC = czm_normal * tangent;\nv_binormalEC = czm_normal * binormal;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n" }), r("Shaders/Appearances/AllMaterialAppearanceFS", [], function() { "use strict"; return "varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec3 v_tangentEC;\nvarying vec3 v_binormalEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nmat3 tangentToEyeMatrix = czm_tangentToEyeSpaceMatrix(v_normalEC, v_tangentEC, v_binormalEC);\nvec3 normalEC;\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(v_normalEC, vec3(0.0, 0.0, 1.0), -v_normalEC));\n#else\nnormalEC = normalize(v_normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = tangentToEyeMatrix;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nmaterialInput.st = v_st;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n" }), r("Scene/MaterialAppearance", ["../Core/defaultValue", "../Core/defined", "../Core/freezeObject", "../Core/VertexFormat", "./Material", "./Appearance", "../Shaders/Appearances/BasicMaterialAppearanceVS", "../Shaders/Appearances/BasicMaterialAppearanceFS", "../Shaders/Appearances/TexturedMaterialAppearanceVS", "../Shaders/Appearances/TexturedMaterialAppearanceFS", "../Shaders/Appearances/AllMaterialAppearanceVS", "../Shaders/Appearances/AllMaterialAppearanceFS"], function(e, t, r, i, n, o, a, s, l, u, c, h) { "use strict"; var d = function(r) { r = e(r, e.EMPTY_OBJECT); var i = e(r.translucent, !0),
a = e(r.closed, !1),
s = e(r.materialSupport, d.MaterialSupport.TEXTURED);
this.material = t(r.material) ? r.material : n.fromType(void 0, n.ColorType), this.vertexShaderSource = e(r.vertexShaderSource, s.vertexShaderSource), this.fragmentShaderSource = e(r.fragmentShaderSource, s.fragmentShaderSource), this.renderState = e(r.renderState, o.getDefaultRenderState(i, a)), this.materialSupport = s, this.vertexFormat = s.vertexFormat, this.flat = e(r.flat, !1), this.faceForward = e(r.faceForward, !1), this.translucent = i, this.closed = a }; return d.prototype.getFragmentShaderSource = o.prototype.getFragmentShaderSource, d.MaterialSupport = { BASIC: r({ vertexFormat: i.POSITION_AND_NORMAL, vertexShaderSource: a, fragmentShaderSource: s }), TEXTURED: r({ vertexFormat: i.POSITION_NORMAL_AND_ST, vertexShaderSource: l, fragmentShaderSource: u }), ALL: r({ vertexFormat: i.ALL, vertexShaderSource: c, fragmentShaderSource: h }) }, d }), r("Shaders/Appearances/EllipsoidSurfaceAppearanceVS", [], function() { "use strict"; return "attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec2 st;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionMC = position3DHigh + position3DLow;\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_st = st;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n" }), r("Shaders/Appearances/EllipsoidSurfaceAppearanceFS", [], function() { "use strict"; return "varying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_st;\nvoid main()\n{\nczm_materialInput materialInput;\nvec3 normalEC = czm_normal3D * czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0));\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(normalEC, vec3(0.0, 0.0, 1.0), -normalEC));\n#else\nnormalEC = normalize(normalEC);\n#endif\nmaterialInput.s = v_st.s;\nmaterialInput.st = v_st;\nmaterialInput.str = vec3(v_st, 0.0);\nmaterialInput.normalEC = normalEC;\nmaterialInput.tangentToEyeMatrix = czm_eastNorthUpToEyeCoordinates(v_positionMC, materialInput.normalEC);\nvec3 positionToEyeEC = -v_positionEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getMaterial(materialInput);\n#ifdef FLAT\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n#else\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n#endif\n}\n" }), r("Scene/EllipsoidSurfaceAppearance", ["../Core/defaultValue", "../Core/defined", "../Core/VertexFormat", "./Material", "./Appearance", "./MaterialAppearance", "../Shaders/Appearances/EllipsoidSurfaceAppearanceVS", "../Shaders/Appearances/EllipsoidSurfaceAppearanceFS"], function(e, t, r, i, n, o, a, s) {
"use strict";
var l = function(r) { r = e(r, e.EMPTY_OBJECT); var o = e(r.translucent, !0),
u = e(r.aboveGround, !1);
this.material = t(r.material) ? r.material : i.fromType(void 0, i.ColorType), this.vertexShaderSource = e(r.vertexShaderSource, a), this.fragmentShaderSource = e(r.fragmentShaderSource, s), this.renderState = e(r.renderState, n.getDefaultRenderState(o, !u)), this.vertexFormat = l.VERTEX_FORMAT, this.flat = e(r.flat, !1), this.faceForward = e(r.faceForward, !1), this.translucent = o, this.closed = !u, this.aboveGround = u };
return l.VERTEX_FORMAT = r.POSITION_AND_ST, l.prototype.getFragmentShaderSource = n.prototype.getFragmentShaderSource, l
}), r("Renderer/VertexLayout", ["../Core/Enumeration"], function(e) { "use strict"; var t = { SEPARATE: new e(0, "SEPARATE"), INTERLEAVED: new e(1, "INTERLEAVED"), validate: function(e) { return e === t.SEPARATE || e === t.INTERLEAVED } }; return t }), r("Scene/PrimitivePipeline", ["../Core/defined", "../Core/defaultValue", "../Core/Color", "../Core/ComponentDatatype", "../Core/DeveloperError", "../Core/FeatureDetection", "../Core/Geometry", "../Core/GeometryAttribute", "../Core/GeometryPipeline", "../Core/Matrix4"], function(e, t, r, i, n, o, a, s, l, u) { "use strict";
function c(e, t, r) { var i, n = !r,
o = e.length; if (!n && o > 1) { var a = e[0].modelMatrix; for (i = 1; o > i; ++i)
if (!u.equals(a, e[i].modelMatrix)) { n = !0; break } } if (n)
for (i = 0; o > i; ++i) l.transformToWorldCoordinates(e[i]);
else u.clone(e[0].modelMatrix, t) }
function h(e, t) { for (var n = e.length, o = 0; n > o; ++o) { var a = e[o],
l = a.geometry,
u = l.attributes,
c = u.position,
h = 4 * (c.values.length / c.componentsPerAttribute);
u.pickColor = new s({ componentDatatype: i.UNSIGNED_BYTE, componentsPerAttribute: 4, normalize: !0, values: new Uint8Array(h) }); for (var d = t[o], m = r.floatToByte(d.red), p = r.floatToByte(d.green), f = r.floatToByte(d.blue), v = r.floatToByte(d.alpha), y = u.pickColor.values, g = 0; h > g; g += 4) y[g] = m, y[g + 1] = p, y[g + 2] = f, y[g + 3] = v } }
function d(t) { var r, i = t.length,
n = [],
o = t[0].attributes; for (r in o)
if (o.hasOwnProperty(r)) { for (var a = o[r], s = !0, l = 1; i > l; ++l) { var u = t[l].attributes[r]; if (!e(u) || a.componentDatatype.value !== u.componentDatatype.value || a.componentsPerAttribute !== u.componentsPerAttribute || a.normalize !== u.normalize) { s = !1; break } } s && n.push(r) }
return n }
function m(e, t) { for (var r = e.length, n = 0; r > n; ++n)
for (var o = e[n], l = o.attributes, u = o.geometry, c = a.computeNumberOfVertices(u), h = t.length, d = 0; h > d; ++d) { for (var m = t[d], p = l[m], f = p.componentDatatype, v = p.value, y = v.length, g = i.createTypedArray(f, c * y), _ = 0; c > _; ++_) g.set(v, _ * y);
u.attributes[m] = new s({ componentDatatype: f, componentsPerAttribute: y, normalize: p.normalize, values: g }) } }
function p(e) { var t, r = e.instances,
i = e.pickIds,
o = e.projection,
a = e.elementIndexUintSupported,
s = e.allow3DOnly,
u = e.vertexCacheOptimize,
p = e.modelMatrix,
f = r.length,
v = r[0].geometry.primitiveType; for (t = 1; f > t; ++t)
if (r[t].geometry.primitiveType.value !== v.value) throw new n("All instance geometries must have the same primitiveType."); if (c(r, p, s), !s)
for (t = 0; f > t; ++t) l.wrapLongitude(r[t].geometry);
h(r, i); var y = d(r); if (m(r, y), u)
for (t = 0; f > t; ++t) l.reorderForPostVertexCache(r[t].geometry), l.reorderForPreVertexCache(r[t].geometry); var g = l.combine(r); return s ? l.encodeAttribute(g, "position", "position3DHigh", "position3DLow") : (l.projectTo2D(g, o), l.encodeAttribute(g, "position3D", "position3DHigh", "position3DLow"), l.encodeAttribute(g, "position2D", "position2DHigh", "position2DLow")), a ? [g] : l.fitToUnsignedShortIndices(g) }
function f(e, t, r) { for (var n = [], o = e.attributes, a = r.length, s = 0; a > s; ++s) { var l = r[s],
u = o[l],
c = u.componentDatatype;
c.value === i.DOUBLE.value && (c = i.FLOAT); var h = i.createTypedArray(c, u.values);
n.push({ index: t[l], componentDatatype: c, componentsPerAttribute: u.componentsPerAttribute, normalize: u.normalize, values: h }), delete o[l] } return n }
function v(r, i, n) { for (var o = [], s = d(r), l = r.length, u = {}, c = {}, h = 0; l > h; ++h)
for (var m = r[h], p = a.computeNumberOfVertices(m.geometry), f = s.length, v = 0; f > v; ++v)
for (var y = s[v], g = n[y], _ = p; _ > 0;) { for (var w, C = t(c[y], 0), x = i[C], S = x.length, E = 0; S > E && (w = x[E], w.index !== g); ++E);
e(o[h]) || (o[h] = {}), e(o[h][y]) || (o[h][y] = { dirty: !1, value: m.attributes[y].value, indices: [] }); var b, T = w.values.length / w.componentsPerAttribute,
A = t(u[y], 0);
T > A + _ ? (b = _, o[h][y].indices.push({ attribute: w, offset: A, count: b }), u[y] = A + _) : (b = T - A, o[h][y].indices.push({ attribute: w, offset: A, count: b }), u[y] = 0, c[y] = C + 1), _ -= b }
return o }
function y(e) { return { type: e.constructor.name, buffer: e.buffer } }
function g(e) { return new w[e.type](e.buffer) } if (!o.supportsTypedArrays()) return {}; var _ = {};
_.combineGeometry = function(e) { for (var t = { instances: e.instances, pickIds: e.pickIds, ellipsoid: e.ellipsoid, projection: e.projection, elementIndexUintSupported: e.elementIndexUintSupported, allow3DOnly: e.allow3DOnly, vertexCacheOptimize: e.vertexCacheOptimize, modelMatrix: u.clone(e.modelMatrix) }, r = p(t), i = l.createAttributeIndices(r[0]), n = t.instances, o = d(n), a = [], s = r.length, c = 0; s > c; ++c) { var h = r[c];
a.push(f(h, i, o)) } var m = v(n, a, i); return { geometries: r, modelMatrix: t.modelMatrix, attributeIndices: i, vaAttributes: a, vaAttributeIndices: m } }; var w = { Int8Array: Int8Array, Uint8Array: Uint8Array, Int16Array: Int16Array, Uint16Array: Uint16Array, Int32Array: Int32Array, Uint32Array: Uint32Array, Float32Array: Float32Array, Float64Array: Float64Array }; return _.transferGeometry = function(t, r) { var i, n = t.attributes; for (var o in n) n.hasOwnProperty(o) && e(n[o]) && e(n[o].values) && (i = n[o].values, r.indexOf(n[o].values.buffer) < 0 && r.push(i.buffer), e(i.type) || (n[o].values = y(i)));
e(t.indices) && (i = t.indices, r.push(i.buffer), e(i.type) || (t.indices = y(t.indices))) }, _.transferGeometries = function(e, t) { for (var r = e.length, i = 0; r > i; ++i) _.transferGeometry(e[i], t) }, _.transferPerInstanceAttributes = function(e, t) { for (var r = e.length, i = 0; r > i; ++i)
for (var n = e[i], o = n.length, a = 0; o > a; ++a) { var s = n[a].values;
t.push(s.buffer), n[a].values = y(s) } }, _.transferInstances = function(e, t) { for (var r = e.length, i = 0; r > i; ++i) { var n = e[i];
_.transferGeometry(n.geometry, t) } }, _.receiveGeometry = function(t) { var r = t.attributes; for (var i in r) r.hasOwnProperty(i) && e(r[i]) && e(r[i].values) && (r[i].values = g(r[i].values));
e(t.indices) && (t.indices = g(t.indices)) }, _.receiveGeometries = function(e) { for (var t = e.length, r = 0; t > r; ++r) _.receiveGeometry(e[r]) }, _.receivePerInstanceAttributes = function(e) { for (var t = e.length, r = 0; t > r; ++r)
for (var i = e[r], n = i.length, o = 0; n > o; ++o) i[o].values = g(i[o].values) }, _.receiveInstances = function(e) { for (var t = e.length, r = 0; t > r; ++r) { var i = e[r];
_.receiveGeometry(i.geometry) } }, _ }), r("Scene/PrimitiveState", ["../Core/Enumeration"], function(e) { "use strict"; var t = { READY: new e(0, "READY"), CREATING: new e(1, "CREATING"), CREATED: new e(2, "CREATED"), COMBINING: new e(3, "COMBINING"), COMBINED: new e(4, "COMBINED"), COMPLETE: new e(5, "COMPLETE"), FAILED: new e(6, "FAILED") }; return t }), r("Scene/Primitive", ["../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/destroyObject", "../Core/Matrix4", "../Core/BoundingSphere", "../Core/Geometry", "../Core/GeometryAttribute", "../Core/GeometryAttributes", "../Core/GeometryInstance", "../Core/GeometryInstanceAttribute", "../Core/ComponentDatatype", "../Core/TaskProcessor", "../Core/GeographicProjection", "../Core/Queue", "../Core/clone", "../Renderer/BufferUsage", "../Renderer/VertexLayout", "../Renderer/CommandLists", "../Renderer/DrawCommand", "../Renderer/createShaderSource", "../Renderer/CullFace", "./PrimitivePipeline", "./PrimitiveState", "./SceneMode", "../ThirdParty/when"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C, x, S, E, b) { "use strict";
function T(e) { return new s({ componentDatatype: e.componentDatatype, componentsPerAttribute: e.componentsPerAttribute, normalize: e.normalize, values: new e.values.constructor(e.values) }) }
function A(e) { var r = e.attributes,
i = new l; for (var n in r) r.hasOwnProperty(n) && t(r[n]) && (i[n] = T(r[n])); var s; if (t(e.indices)) { var u = e.indices;
s = new u.constructor(u) } return new a({ attributes: i, indices: s, primitiveType: e.primitiveType, boundingSphere: o.clone(e.boundingSphere) }) }
function M(e) { return new c({ componentDatatype: e.componentDatatype, componentsPerAttribute: e.componentsPerAttribute, normalize: e.normalize, value: new e.value.constructor(e.value) }) }
function P(e, t) { var r = e.attributes,
i = {}; for (var o in r) r.hasOwnProperty(o) && (i[o] = M(r[o])); return new u({ geometry: t, modelMatrix: n.clone(e.modelMatrix), attributes: i }) }
function D(e, t) { var r;
r = e._allow3DOnly ? "" : "attribute vec3 position2DHigh;\nattribute vec3 position2DLow;\n"; var i = "\nvec4 czm_computePosition()\n{\n"; return i += e._allow3DOnly ? " return czm_translateRelativeToEye(position3DHigh, position3DLow);\n" : " vec4 p;\n if (czm_morphTime == 1.0)\n {\n p = czm_translateRelativeToEye(position3DHigh, position3DLow);\n }\n else if (czm_morphTime == 0.0)\n {\n p = czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy);\n }\n else\n {\n p = czm_columbusViewMorph(\n czm_translateRelativeToEye(position2DHigh.zxy, position2DLow.zxy),\n czm_translateRelativeToEye(position3DHigh, position3DLow),\n czm_morphTime);\n }\n return p;\n", i += "}\n\n", r + t + i }
function I(e) { var t = e.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g, "void czm_old_main()"),
r = "attribute vec4 pickColor; \nvarying vec4 czm_pickColor; \nvoid main() \n{ \n czm_old_main(); \n czm_pickColor = pickColor; \n}"; return t + "\n" + r }
function O(e, r) { if (!t(e._attributeIndices.show)) return r; var i = r.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g, "void czm_non_show_main()"),
n = "attribute float show;\nvoid main() \n{ \n czm_non_show_main(); \n gl_Position *= show; \n}"; return i + "\n" + n }
function R(e, i) { var n = e.getVertexAttributes(); for (var o in n)
if (n.hasOwnProperty(o) && !t(i[o])) throw new r("Appearance/Geometry mismatch. The appearance requires vertex shader attribute input '" + o + "', which was not computed as part of the Geometry. Use the appearance's vertexFormat property when constructing the geometry.") }
function L(e, t) { return function() { return t[e].value } }
function z(e, i, n) { return function(o) { if (!t(o) || !t(o.length) || o.length < 1 || o.length > 4) throw new r("value must be and array with length between 1 and 4."); var a = i[e];
a.value = o, a.dirty || (n.push(a), a.dirty = !0) } } var N = function(t) { t = e(t, e.EMPTY_OBJECT), this.geometryInstances = t.geometryInstances, this.appearance = t.appearance, this._appearance = void 0, this._material = void 0, this.asynchronous = e(t.asynchronous, !0), this.modelMatrix = n.IDENTITY.clone(), this.show = !0, this.state = S.READY, this._createdGeometries = [], this._geometries = [], this._vaAttributes = void 0, this._error = void 0, this._vertexCacheOptimize = e(t.vertexCacheOptimize, !0), this._releaseGeometryInstances = e(t.releaseGeometryInstances, !0), this._allow3DOnly = e(t.allow3DOnly, !1), this._boundingSphere = void 0, this._boundingSphere2D = void 0, this._perInstanceAttributeIndices = void 0, this._instanceIds = [], this._lastPerInstanceAttributeIndex = 0, this._dirtyAttributes = [], this._va = [], this._attributeIndices = void 0, this._primitiveType = void 0, this._frontFaceRS = void 0, this._backFaceRS = void 0, this._sp = void 0, this._pickSP = void 0, this._pickIds = [], this._commandLists = new g },
F = new d("taskDispatcher", Number.POSITIVE_INFINITY); return N.prototype.update = function(r, i, a) { if (this.show && (t(this.geometryInstances) || 0 !== this._va.length) && t(this.appearance) && (i.mode === E.SCENE3D || !this._allow3DOnly) && (i.passes.color || i.passes.pick)) { var s, l, u, c, d, p, g, T, M, L, z, N, B, V, q, k = i.scene2D.projection,
U = this._commandLists.colorList,
W = this._commandLists.pickList,
G = this; if (this.state !== S.COMPLETE && this.state !== S.COMBINED)
if (this.asynchronous) { if (this.state === S.FAILED) throw this._error; if (this.state === S.READY) { z = Array.isArray(this.geometryInstances) ? this.geometryInstances : [this.geometryInstances], p = z.length; var H = []; for (g = 0; p > g; ++g) u = z[g].geometry, this._instanceIds.push(z[g].id), t(u.attributes) && t(u.primitiveType) ? this._createdGeometries.push({ geometry: A(u), index: g }) : H.push(F.scheduleTask({ task: u._workerName, geometry: u, index: g }));
this.state = S.CREATING, b.all(H, function(e) { G._geometries = e, G.state = S.CREATED }, function(e) { G._error = e, G.state = S.FAILED }) } else if (this.state === S.CREATED) { for (z = Array.isArray(this.geometryInstances) ? this.geometryInstances : [this.geometryInstances], N = new Array(z.length), B = this._geometries.concat(this._createdGeometries), p = B.length, g = 0; p > g; ++g) u = B[g], M = u.index, N[M] = P(z[M], u.geometry);
p = N.length; var j = []; for (x.transferInstances(N, j), V = [], g = 0; p > g; ++g) q = r.createPickId(e(z[g].id, this)), this._pickIds.push(q), V.push(q.color);
L = F.scheduleTask({ task: "combineGeometry", instances: N, pickIds: V, ellipsoid: k.getEllipsoid(), isGeographic: k instanceof m, elementIndexUintSupported: r.getElementIndexUint(), allow3DOnly: this._allow3DOnly, vertexCacheOptimize: this._vertexCacheOptimize, modelMatrix: this.modelMatrix }, j), this.state = S.COMBINING, b(L, function(e) { x.receiveGeometries(e.geometries), x.receivePerInstanceAttributes(e.vaAttributes), G._geometries = e.geometries, G._attributeIndices = e.attributeIndices, G._vaAttributes = e.vaAttributes, G._perInstanceAttributeIndices = e.vaAttributeIndices, n.clone(e.modelMatrix, G.modelMatrix), G.state = S.COMBINED }, function(e) { G._error = e, G.state = S.FAILED }) } } else { for (z = Array.isArray(this.geometryInstances) ? this.geometryInstances : [this.geometryInstances], p = z.length, B = this._createdGeometries, g = 0; p > g; ++g) u = z[g].geometry, this._instanceIds.push(z[g].id), t(u.attributes) && t(u.primitiveType) ? B.push({ geometry: A(u), index: g }) : B.push({ geometry: u.constructor.createGeometry(u), index: g }); for (N = new Array(z.length), p = B.length, g = 0; p > g; ++g) u = B[g], M = u.index, N[M] = P(z[M], u.geometry); for (V = [], g = 0; p > g; ++g) q = r.createPickId(e(z[g].id, this)), this._pickIds.push(q), V.push(q.color); var Y = x.combineGeometry({ instances: N, pickIds: V, ellipsoid: k.getEllipsoid(), isGeographic: k, elementIndexUintSupported: r.getElementIndexUint(), allow3DOnly: this._allow3DOnly, vertexCacheOptimize: this._vertexCacheOptimize, modelMatrix: this.modelMatrix });
this._geometries = Y.geometries, this._attributeIndices = Y.attributeIndices, this._vaAttributes = Y.vaAttributes, this._perInstanceAttributeIndices = Y.vaAttributeIndices, n.clone(Y.modelMatrix, this.modelMatrix), this.state = S.COMBINED }
if (this.state === S.COMBINED) { B = this._geometries; var X = this._attributeIndices,
Z = this._vaAttributes;
this._boundingSphere = o.clone(B[0].boundingSphere), !this._allow3DOnly && t(this._boundingSphere) && (this._boundingSphere2D = o.projectTo2D(this._boundingSphere, k)); var K = []; for (p = B.length, g = 0; p > g; ++g) { u = B[g], c = Z[g]; var J = c.length; for (T = 0; J > T; ++T) d = c[T], d.vertexBuffer = r.createVertexBuffer(d.values, v.DYNAMIC_DRAW), delete d.values;
K.push(r.createVertexArrayFromGeometry({ geometry: u, attributeIndices: X, bufferUsage: v.STATIC_DRAW, vertexLayout: y.INTERLEAVED, vertexArrayAttributes: c })) } this._va = K, this._primitiveType = B[0].primitiveType, this._releaseGeometryInstances && (this.geometryInstances = void 0), this._geomtries = void 0, this._createdGeometries = void 0, this.state = S.COMPLETE } if (this.state === S.COMPLETE) { var Q = this.appearance,
$ = Q.material,
et = !1,
tt = !1; if (this._appearance !== Q ? (this._appearance = Q, this._material = $, et = !0, tt = !0) : this._material !== $ && (this._material = $, tt = !0), et)
if (Q.closed && Q.translucent) { var rt = f(Q.renderState, !1);
rt.cull = { enabled: !0, face: C.BACK }, this._frontFaceRS = r.createRenderState(rt), rt.cull.face = C.FRONT, this._backFaceRS = r.createRenderState(rt) } else this._frontFaceRS = r.createRenderState(Q.renderState); if (tt) { var it = r.getShaderCache(),
nt = D(this, Q.vertexShaderSource);
nt = O(this, nt); var ot = Q.getFragmentShaderSource(),
at = w({ sources: [ot], pickColorQualifier: "varying" });
this._sp = it.replaceShaderProgram(this._sp, nt, ot, this._attributeIndices), this._pickSP = it.replaceShaderProgram(this._pickSP, I(nt), at, this._attributeIndices), R(this._sp, this._attributeIndices), R(this._pickSP, this._attributeIndices) } if (et || tt) { var st = t($) ? $._uniforms : void 0;
t(this._backFaceRS) ? (U.length = 2 * this._va.length, W.length = 2 * this._va.length) : (U.length = this._va.length, W.length = this._va.length), p = U.length; var lt = 0; for (g = 0; p > g; ++g) t(this._backFaceRS) && (s = U[g], t(s) || (s = U[g] = new _), s.owner = this, s.primitiveType = this._primitiveType, s.vertexArray = this._va[lt], s.renderState = this._backFaceRS, s.shaderProgram = this._sp, s.uniformMap = st, l = W[g], t(l) || (l = W[g] = new _), l.owner = this, l.primitiveType = this._primitiveType, l.vertexArray = this._va[lt], l.renderState = this._backFaceRS, l.shaderProgram = this._pickSP, l.uniformMap = st, ++g), s = U[g], t(s) || (s = U[g] = new _), s.owner = this, s.primitiveType = this._primitiveType, s.vertexArray = this._va[lt], s.renderState = this._frontFaceRS, s.shaderProgram = this._sp, s.uniformMap = st, l = W[g], t(l) || (l = W[g] = new _), l.owner = this, l.primitiveType = this._primitiveType, l.vertexArray = this._va[lt], l.renderState = this._frontFaceRS, l.shaderProgram = this._pickSP, l.uniformMap = st, ++lt } if (this._dirtyAttributes.length > 0) { for (c = this._dirtyAttributes, p = c.length, g = 0; p > g; ++g) { d = c[g]; var ut = d.value,
ct = d.indices,
ht = ct.length; for (T = 0; ht > T; ++T) { M = ct[T]; for (var dt = M.offset, mt = M.count, pt = M.attribute, ft = pt.componentDatatype, vt = pt.componentsPerAttribute, yt = h.createTypedArray(ft, mt * vt), gt = 0; mt > gt; ++gt) yt.set(ut, gt * vt); var _t = dt * vt * ft.sizeInBytes;
pt.vertexBuffer.copyFromArrayView(yt, _t) } d.dirty = !1 } c.length = 0 } var wt; for (i.mode === E.SCENE3D ? wt = this._boundingSphere : i.mode === E.COLUMBUS_VIEW ? wt = this._boundingSphere2D : i.mode === E.SCENE2D && t(this._boundingSphere2D) ? (wt = o.clone(this._boundingSphere2D), wt.center.x = 0) : t(this._boundingSphere) && t(this._boundingSphere2D) && (wt = o.union(this._boundingSphere, this._boundingSphere2D)), p = U.length, g = 0; p > g; ++g) U[g].modelMatrix = this.modelMatrix, W[g].modelMatrix = this.modelMatrix, U[g].boundingVolume = wt, W[g].boundingVolume = wt;
a.push(this._commandLists) } } }, N.prototype.getGeometryInstanceAttributes = function(e) { if (!t(e)) throw new r("id is required"); if (!t(this._perInstanceAttributeIndices)) throw new r("must call update before calling getGeometryInstanceAttributes"); for (var i = -1, n = this._lastPerInstanceAttributeIndex, o = this._instanceIds, a = o.length, s = 0; a > s; ++s) { var l = (n + s) % a; if (e === o[l]) { i = l; break } } if (-1 === i) return void 0; var u = this._perInstanceAttributeIndices[i],
c = {}; for (var h in u) u.hasOwnProperty(h) && Object.defineProperty(c, h, { get: L(h, u), set: z(h, u, this._dirtyAttributes) }); return this._lastPerInstanceAttributeIndex = i, c }, N.prototype.isDestroyed = function() { return !1 }, N.prototype.destroy = function() { var e, t;
this._sp = this._sp && this._sp.release(), this._pickSP = this._pickSP && this._pickSP.release(); var r = this._va; for (e = r.length, t = 0; e > t; ++t) r[t].destroy();
this._va = void 0; var n = this._pickIds; for (e = n.length, t = 0; e > t; ++t) n[t].destroy(); return this._pickIds = void 0, i(this) }, N }), r("Scene/Polygon", ["../Core/DeveloperError", "../Core/defaultValue", "../Core/defined", "../Core/Color", "../Core/destroyObject", "../Core/Math", "../Core/Ellipsoid", "../Core/GeometryInstance", "../Core/PolygonGeometry", "../Core/PolygonPipeline", "../Core/Queue", "./EllipsoidSurfaceAppearance", "./Primitive", "./Material"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m) { "use strict"; var p = function(e) { e = t(e, t.EMPTY_OBJECT), this.ellipsoid = t(e.ellipsoid, a.WGS84), this._ellipsoid = void 0, this.granularity = t(e.granularity, o.RADIANS_PER_DEGREE), this._granularity = void 0, this.height = t(e.height, 0), this._height = void 0, this.textureRotationAngle = t(e.textureRotationAngle, 0), this._textureRotationAngle = void 0, this.show = t(e.show, !0); var r = m.fromType(void 0, m.ColorType);
r.uniforms.color = new i(1, 1, 0, .5), this.material = t(e.material, r), this.asynchronous = t(e.asynchronous, !0), this._positions = e.positions, this._polygonHierarchy = e.polygonHierarchy, this._createPrimitive = !1, this._primitive = void 0 }; return p.prototype.getPositions = function() { return this._positions }, p.prototype.setPositions = function(t) { if (r(t) && t.length < 3) throw new e("At least three positions are required.");
this._positions = t, this._polygonHierarchy = void 0, this._createPrimitive = !0 }, p.prototype.configureFromPolygonHierarchy = function(e) { this._positions = void 0, this._polygonHierarchy = e, this._createPrimitive = !0 }, p.prototype.update = function(t, i, n) { if (!r(this.ellipsoid)) throw new e("this.ellipsoid must be defined."); if (!r(this.material)) throw new e("this.material must be defined."); if (this.granularity < 0) throw new e("this.granularity and scene2D/scene3D overrides must be greater than zero."); if (this.show && (this._createPrimitive || r(this._primitive))) { if (this._createPrimitive || this._ellipsoid !== this.ellipsoid || this._granularity !== this.granularity || this._height !== this.height || this._textureRotationAngle !== this.textureRotationAngle) { if (this._createPrimitive = !1, this._ellipsoid = this.ellipsoid, this._granularity = this.granularity, this._height = this.height, this._textureRotationAngle = this.textureRotationAngle, this._primitive = this._primitive && this._primitive.destroy(), !r(this._positions) && !r(this._polygonHierarchy)) return; var o;
o = r(this._positions) ? new s({ geometry: l.fromPositions({ positions: this._positions, height: this.height, vertexFormat: h.VERTEX_FORMAT, stRotation: this.textureRotationAngle, ellipsoid: this.ellipsoid, granularity: this.granularity }), id: this }) : new s({ geometry: new l({ polygonHierarchy: this._polygonHierarchy, height: this.height, vertexFormat: h.VERTEX_FORMAT, stRotation: this.textureRotationAngle, ellipsoid: this.ellipsoid, granularity: this.granularity }), id: this }), this._primitive = new d({ geometryInstances: o, appearance: new h({ aboveGround: this.height > 0 }), asynchronous: this.asynchronous }) } this._primitive.appearance.material = this.material, this._primitive.update(t, i, n) } }, p.prototype.isDestroyed = function() { return !1 }, p.prototype.destroy = function() { return this._primitive = this._primitive && this._primitive.destroy(), n(this) }, p }), r("DynamicScene/DynamicPolygonVisualizer", ["../Core/Cartesian3", "../Core/defined", "../Core/DeveloperError", "../Core/destroyObject", "../Scene/Polygon", "../Scene/Material", "./MaterialProperty"], function(e, t, r, i, n, o, a) { "use strict";
function s(e, r, i) { var s = i.polygon; if (t(s)) { var l, c = s.show,
h = i.ellipse,
d = i.position,
m = i.vertexPositions,
p = i._polygonVisualizerIndex,
f = i.isAvailable(r) && (!t(c) || c.getValue(r)),
v = t(m); if (!(f && (v || t(h) && t(d)))) return t(p) && (l = e._polygonCollection[p], l.show = !1, i._polygonVisualizerIndex = void 0, e._unusedIndexes.push(p)), void 0; var y = e._scene.getContext(); if (t(p)) l = e._polygonCollection[p];
else { var g = e._unusedIndexes,
_ = g.length;
_ > 0 ? (p = g.pop(), l = e._polygonCollection[p]) : (p = e._polygonCollection.length, l = new n, e._polygonCollection.push(l), e._primitives.add(l)), i._polygonVisualizerIndex = p, l.dynamicObject = i, l.material = o.fromType(y, o.ColorType) } l.show = !0; var w;
w = v ? m.getValue(r) : h.getValue(r, d.getValue(r, u)), l._visualizerPositions !== w && t(w) && w.length > 3 && (l.setPositions(w), l._visualizerPositions = w), l.material = a.getValue(r, y, s.material, l.material) } } var l = function(e, i) { if (!t(e)) throw new r("scene is required.");
this._scene = e, this._unusedIndexes = [], this._primitives = e.getPrimitives(), this._polygonCollection = [], this._dynamicObjectCollection = void 0, this.setDynamicObjectCollection(i) };
l.prototype.getScene = function() { return this._scene }, l.prototype.getDynamicObjectCollection = function() { return this._dynamicObjectCollection }, l.prototype.setDynamicObjectCollection = function(e) { var r = this._dynamicObjectCollection;
r !== e && (t(r) && (r.objectsRemoved.removeEventListener(l.prototype._onObjectsRemoved, this), this.removeAllPrimitives()), this._dynamicObjectCollection = e, t(e) && e.objectsRemoved.addEventListener(l.prototype._onObjectsRemoved, this)) }, l.prototype.update = function(e) { if (!t(e)) throw new r("time is requied."); if (t(this._dynamicObjectCollection))
for (var i = this._dynamicObjectCollection.getObjects(), n = 0, o = i.length; o > n; n++) s(this, e, i[n]) }, l.prototype.removeAllPrimitives = function() { var e, r; for (e = 0, r = this._polygonCollection.length; r > e; e++) this._primitives.remove(this._polygonCollection[e]); if (t(this._dynamicObjectCollection)) { var i = this._dynamicObjectCollection.getObjects(); for (e = i.length - 1; e > -1; e--) i[e]._polygonVisualizerIndex = void 0 } this._unusedIndexes = [], this._polygonCollection = [] }, l.prototype.isDestroyed = function() { return !1 }, l.prototype.destroy = function() { return this.removeAllPrimitives(), i(this) }; var u = new e; return l.prototype._onObjectsRemoved = function(e, r) { for (var i = this._polygonCollection, n = this._unusedIndexes, o = r.length - 1; o > -1; o--) { var a = r[o],
s = a._polygonVisualizerIndex; if (t(s)) { var l = i[s];
l.show = !1, n.push(s), a._polygonVisualizerIndex = void 0 } } }, l }), r("DynamicScene/DynamicPolylineVisualizer", ["../Core/DeveloperError", "../Core/defined", "../Core/destroyObject", "../Core/Cartesian3", "../Core/Color", "../Scene/Material", "../Scene/PolylineCollection"], function(e, t, r, i, n, o, a) { "use strict";
function s(e, r, i) { var a = i.polyline; if (t(a)) { var s, l = a.show,
c = i.ellipse,
h = i.position,
d = i.vertexPositions,
m = i._polylineVisualizerIndex,
p = i.isAvailable(r) && (!t(l) || l.getValue(r)); if (!(p && (t(d) || t(c) && t(h)))) return t(m) && (s = e._polylineCollection.get(m), s.setShow(!1), i._polylineVisualizerIndex = void 0, e._unusedIndexes.push(m)), void 0; var f; if (t(m)) s = e._polylineCollection.get(m), f = s.getMaterial().uniforms;
else { var v = e._unusedIndexes,
y = v.length;
y > 0 ? (m = v.pop(), s = e._polylineCollection.get(m)) : (m = e._polylineCollection.getLength(), s = e._polylineCollection.add()), i._polylineVisualizerIndex = m, s.dynamicObject = i, s.setWidth(1); var g = s.getMaterial();
t(g) && g.type === o.PolylineOutlineType || (g = o.fromType(e._scene.getContext(), o.PolylineOutlineType), s.setMaterial(g)), f = g.uniforms, n.clone(n.WHITE, f.color), n.clone(n.BLACK, f.outlineColor), f.outlineWidth = 0 } s.setShow(!0); var _;
_ = t(c) ? c.getValue(r, h.getValue(r, u)) : d.getValue(r), t(_) && s._visualizerPositions !== _ && (s.setPositions(_), s._visualizerPositions = _); var w = a.color; if (t(w) && (f.color = w.getValue(r, f.color)), w = a.outlineColor, t(w) && (f.outlineColor = w.getValue(r, f.outlineColor)), w = a.outlineWidth, t(w) && (f.outlineWidth = w.getValue(r)), w = a.width, t(w)) { var C = w.getValue(r);
t(C) && s.setWidth(C) } } } var l = function(r, i) { if (!t(r)) throw new e("scene is required.");
this._scene = r, this._unusedIndexes = [], this._primitives = r.getPrimitives(); var n = this._polylineCollection = new a;
r.getPrimitives().add(n), this._dynamicObjectCollection = void 0, this.setDynamicObjectCollection(i) };
l.prototype.getScene = function() { return this._scene }, l.prototype.getDynamicObjectCollection = function() { return this._dynamicObjectCollection }, l.prototype.setDynamicObjectCollection = function(e) { var r = this._dynamicObjectCollection;
r !== e && (t(r) && (r.objectsRemoved.removeEventListener(l.prototype._onObjectsRemoved, this), this.removeAllPrimitives()), this._dynamicObjectCollection = e, t(e) && e.objectsRemoved.addEventListener(l.prototype._onObjectsRemoved, this)) }, l.prototype.update = function(r) { if (!t(r)) throw new e("time is requied."); if (t(this._dynamicObjectCollection))
for (var i = this._dynamicObjectCollection.getObjects(), n = 0, o = i.length; o > n; n++) s(this, r, i[n]) }, l.prototype.removeAllPrimitives = function() { var e; if (this._polylineCollection.removeAll(), t(this._dynamicObjectCollection)) { var r = this._dynamicObjectCollection.getObjects(); for (e = r.length - 1; e > -1; e--) r[e]._polylineVisualizerIndex = void 0 } this._unusedIndexes = [] }, l.prototype.isDestroyed = function() { return !1 }, l.prototype.destroy = function() { return this.removeAllPrimitives(), this._scene.getPrimitives().remove(this._polylineCollection), r(this) }; var u = new i; return l.prototype._onObjectsRemoved = function(e, r) { for (var i = this._polylineCollection, n = this._unusedIndexes, o = r.length - 1; o > -1; o--) { var a = r[o],
s = a._polylineVisualizerIndex; if (t(s)) { var l = i.get(s);
l.setShow(!1), n.push(s), a._polylineVisualizerIndex = void 0 } } }, l }), r("DynamicScene/DynamicPyramidVisualizer", ["../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/destroyObject", "../Core/Color", "../Core/Matrix3", "../Core/Matrix4", "../Scene/CustomSensorVolume", "../Scene/Material", "./MaterialProperty"], function(e, t, r, i, n, o, a, s, l, u) { "use strict";
function c(r, i, c) { var d = r._scene.getContext(),
f = c.pyramid; if (t(f)) { var v = f.directions; if (t(v)) { var y = c.position; if (t(y)) { var g = c.orientation; if (t(g)) { var _, w = f.show,
C = c._pyramidVisualizerIndex,
x = c.isAvailable(i) && (!t(w) || w.getValue(i)); if (!x) return t(C) && (_ = r._pyramidCollection[C], _.show = !1, c._pyramidVisualizerIndex = void 0, r._unusedIndexes.push(C)), void 0; if (t(C)) _ = r._pyramidCollection[C];
else { var S = r._unusedIndexes,
E = S.length;
E > 0 ? (C = S.pop(), _ = r._pyramidCollection[C]) : (C = r._pyramidCollection.length, _ = new s, r._pyramidCollection.push(_), r._primitives.add(_)), c._pyramidVisualizerIndex = C, _.dynamicObject = c, _.radius = Number.POSITIVE_INFINITY, _.showIntersection = !0, _.intersectionColor = n.YELLOW, _.intersectionWidth = 5, _.material = l.fromType(d, l.ColorType) } _.show = !0; var b = v.getValue(i);
t(b) && _._visualizerDirections !== b && (_.setDirections(b), _._visualizerDirections = b), m = e(y.getValue(i, m), _._visualizerPosition), p = e(g.getValue(i, p), _._visualizerOrientation), !t(m) || !t(p) || m.equals(_._visualizerPosition) && p.equals(_._visualizerOrientation) || (a.fromRotationTranslation(o.fromQuaternion(p, h), m, _.modelMatrix), m.clone(_._visualizerPosition), p.clone(_._visualizerOrientation)), _.material = u.getValue(i, d, f.material, _.material); var T = f.intersectionColor; if (t(T)) { var A = T.getValue(i, A);
t(A) && (_.intersectionColor = A) } if (T = f.intersectionWidth, t(T)) { var M = T.getValue(i, M);
t(M) && (_.intersectionWidth = M) } if (T = f.radius, t(T)) { var P = T.getValue(i, P);
t(P) && (_.radius = P) } } } } } } var h = new o,
d = function(e, i) { if (!t(e)) throw new r("scene is required.");
this._scene = e, this._unusedIndexes = [], this._primitives = e.getPrimitives(), this._pyramidCollection = [], this._dynamicObjectCollection = void 0, this.setDynamicObjectCollection(i) };
d.prototype.getScene = function() { return this._scene }, d.prototype.getDynamicObjectCollection = function() { return this._dynamicObjectCollection }, d.prototype.setDynamicObjectCollection = function(e) { var r = this._dynamicObjectCollection;
r !== e && (t(r) && (r.objectsRemoved.removeEventListener(d.prototype._onObjectsRemoved, this), this.removeAllPrimitives()), this._dynamicObjectCollection = e, t(e) && e.objectsRemoved.addEventListener(d.prototype._onObjectsRemoved, this)) }, d.prototype.update = function(e) { if (!t(e)) throw new r("time is requied."); if (t(this._dynamicObjectCollection))
for (var i = this._dynamicObjectCollection.getObjects(), n = 0, o = i.length; o > n; n++) c(this, e, i[n]) }, d.prototype.removeAllPrimitives = function() { var e, r; for (e = 0, r = this._pyramidCollection.length; r > e; e++) this._primitives.remove(this._pyramidCollection[e]); if (t(this._dynamicObjectCollection)) { var i = this._dynamicObjectCollection.getObjects(); for (e = i.length - 1; e > -1; e--) i[e]._pyramidVisualizerIndex = void 0 } this._unusedIndexes = [], this._pyramidCollection = [] }, d.prototype.isDestroyed = function() { return !1 }, d.prototype.destroy = function() { return this.removeAllPrimitives(), i(this) }; var m, p; return d.prototype._onObjectsRemoved = function(e, r) { for (var i = this._pyramidCollection, n = this._unusedIndexes, o = r.length - 1; o > -1; o--) { var a = r[o],
s = a._pyramidVisualizerIndex; if (t(s)) { var l = i[s];
l.show = !1, n.push(s), a._pyramidVisualizerIndex = void 0 } } }, d }), r("DynamicScene/VisualizerCollection", ["../Core/defaultValue", "../Core/defined", "../Core/destroyObject"], function(e, t, r) { "use strict"; var i = function(e, r) { this._visualizers = t(e) ? e : [], this._dynamicObjectCollection = void 0, this.setDynamicObjectCollection(r) }; return i.prototype.getVisualizers = function() { return this._visualizers.slice(0) }, i.prototype.setVisualizers = function(r, i) { i = e(i, !0); var n, o = this._visualizers; if (i)
for (n = o.length - 1; n > -1; n--) { var a = o[n]; - 1 === r.indexOf(a) && a.destroy() } t(r) || (r = []), this._visualizers = r; var s = this._dynamicObjectCollection; for (n = r.length - 1; n > -1; n--) r[n].setDynamicObjectCollection(s) }, i.prototype.getDynamicObjectCollection = function() { return this._dynamicObjectCollection }, i.prototype.setDynamicObjectCollection = function(e) { var t = this._dynamicObjectCollection; if (t !== e) { this._dynamicObjectCollection = e; for (var r = this._visualizers, i = r.length - 1; i > -1; i--) r[i].setDynamicObjectCollection(e) } }, i.prototype.update = function(e) { for (var t = this._visualizers, r = t.length - 1; r > -1; r--) t[r].update(e) }, i.prototype.removeAllPrimitives = function() { for (var e = this._visualizers, t = e.length - 1; t > -1; t--) e[t].removeAllPrimitives() }, i.prototype.isDestroyed = function() { return !1 }, i.prototype.destroy = function(t) { if (t = e(t, !0), this.removeAllPrimitives(), t)
for (var i = this._visualizers, n = i.length - 1; n > -1; n--) i[n].destroy(); return r(this) }, i }), r("DynamicScene/DataSourceDisplay", ["../Core/defaultValue", "../Core/defined", "../Core/destroyObject", "../Core/DeveloperError", "../Core/EventHelper", "./DynamicBillboardVisualizer", "./DynamicEllipsoidVisualizer", "./DynamicConeVisualizerUsingCustomSensor", "./DynamicLabelVisualizer", "./DynamicPathVisualizer", "./DynamicPointVisualizer", "./DynamicPolygonVisualizer", "./DynamicPolylineVisualizer", "./DynamicPyramidVisualizer", "./VisualizerCollection"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p) {
"use strict";
var f = [o, a, s, l, c, h, d, m, u],
v = function(r, o, a) {
if (!t(r)) throw new i("scene is required.");
if (!t(o)) throw new i("dataSourceCollection is required.");
this._eventHelper = new n, this._eventHelper.add(o.dataSourceAdded, this._onDataSourceAdded, this), this._eventHelper.add(o.dataSourceRemoved, this._onDataSourceRemoved, this), this._dataSourceCollection = o, this._scene = r, this._timeVaryingSources = [], this._staticSourcesToUpdate = [], this._visualizersTypes = e(a, f).slice(0);
for (var s = 0, l = o.getLength(); l > s; s++) this._onDataSourceAdded(o, o.get(s))
};
return v.prototype.getScene = function() { return this._scene }, v.prototype.getVisualizerTypes = function() { return this._visualizersTypes.slice(0) }, v.prototype.getDataSources = function() { return this._dataSourceCollection }, v.prototype.isDestroyed = function() { return !1 }, v.prototype.destroy = function() { this._eventHelper.removeAll(); for (var e = this._dataSourceCollection, t = 0, i = e.getLength(); i > t; ++t) this._onDataSourceRemoved(this._dataSourceCollection, e.get(t)); return r(this) }, v.prototype.update = function(e) { if (!t(e)) throw new i("time is required."); var r, n = this._timeVaryingSources,
o = n.length; for (r = 0; o > r; r++) n[r]._visualizerCollection.update(e); var a = this._staticSourcesToUpdate; if (o = a.length, o > 0) { for (r = 0; o > r; r++) a[r]._visualizerCollection.update(e);
a.length = 0 } }, v.prototype._onDataSourceAdded = function(e, t) { for (var r = this._visualizersTypes, i = r.length, n = new Array(i), o = this._scene, a = 0; i > a; a++) n[a] = new r[a](o); var s = new p(n, t.getDynamicObjectCollection());
t._visualizerCollection = s, t.getChangedEvent().addEventListener(this._onDataSourceChanged, this), this._onDataSourceChanged(t) }, v.prototype._onDataSourceRemoved = function(e, t) { t.getChangedEvent().removeEventListener(this._onDataSourceChanged, this); var r = this._timeVaryingSources.indexOf(t); - 1 !== r && this._timeVaryingSources.splice(r, 1); var i = this._staticSourcesToUpdate.indexOf(t); - 1 !== i && this._staticSourcesToUpdate.splice(i, 1), t._visualizerCollection.destroy(), t._visualizerCollection = void 0 }, v.prototype._onDataSourceChanged = function(e) { var t = this._timeVaryingSources.indexOf(e),
r = this._staticSourcesToUpdate.indexOf(e);
e.getIsTimeVarying() ? (-1 === t && this._timeVaryingSources.push(e), -1 !== r && this._staticSourcesToUpdate.splice(r, 1)) : (-1 === r && this._staticSourcesToUpdate.push(e), -1 !== t && this._timeVaryingSources.splice(r, 1)) }, v
}), r("Scene/CameraColumbusViewMode", ["../Core/Enumeration"], function(e) { "use strict"; var t = { FREE: new e(0, "FREE"), LOCKED: new e(1, "LOCKED") }; return t }), r("DynamicScene/DynamicObjectView", ["../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/Math", "../Core/Cartesian2", "../Core/Cartesian3", "../Core/Cartesian4", "../Core/Cartographic", "../Core/Quaternion", "../Core/Matrix3", "../Core/Matrix4", "../Core/Ellipsoid", "../Core/Transforms", "../Scene/CameraColumbusViewMode", "../Scene/SceneMode"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p) { "use strict";
function f(e, r, i, a, s, l, u, c) { var h, d = e.scene,
m = d.mode !== e._mode;
m ? (e._mode = d.mode, e._screenSpaceCameraController.enableTranslate = !1, h = a.magnitude()) : h = i ? a.magnitude() : r.position.z; var p = s.getValue(l, e._lastCartesian); if (t(p)) { var f = u.cartesianToCartographic(p, e._lastCartographic);
f.height = h, i || m ? (r.controller.setPositionCartographic(f), r.up.z = 0, o.normalize(r.up, r.up), r.right.z = 0, o.normalize(r.right, r.right), n.clone(r.right, e._first2dUp)) : r.position = c.project(f), e._lastDistance = r.frustum.right - r.frustum.left, n.clone(r.right, e._last2dUp) } }
function v(e, r, n, a, s, l, c) { g(e, r, n, a); var m = s.getValue(l, e._lastCartesian); if (t(m)) { var p = !1,
f = l.addSeconds(.01),
v = s.getValue(f, S); if (t(v) && !o.equalsEpsilon(m, v, i.EPSILON6)) { var y, T = d.computeFixedToIcrfMatrix(l, w),
A = d.computeFixedToIcrfMatrix(f, C);!t(T) || t(A) ? (y = d.computeTemeToPseudoFixedMatrix(l, x), T = u.transpose(y, w), A = d.computeTemeToPseudoFixedMatrix(f, C), u.transpose(A, A)) : y = u.transpose(T, x); var M = E;
o.normalize(m, M), o.normalize(v, v), u.multiplyByVector(T, M, M), u.multiplyByVector(A, v, v); var P = o.cross(M, v, b); if (!o.equalsEpsilon(P, o.ZERO, i.EPSILON6)) { var D = o.cross(P, M, S);
u.multiplyByVector(y, D, D), u.multiplyByVector(y, P, P), u.multiplyByVector(y, M, M), o.normalize(D, D), o.normalize(P, P), o.normalize(M, M); var I = _;
I[0] = D.x, I[1] = D.y, I[2] = D.z, I[3] = 0, I[4] = P.x, I[5] = P.y, I[6] = P.z, I[7] = 0, I[8] = M.x, I[9] = M.y, I[10] = M.z, I[11] = 0, I[12] = m.x, I[13] = m.y, I[14] = m.z, I[15] = 0, r.transform = I, p = !0 } } p || (r.transform = d.eastNorthUpToFixedFrame(m, c, _)), e._screenSpaceCameraController.setEllipsoid(h.UNIT_SPHERE); var O = r.position;
o.clone(O, e._lastOffset), e._lastDistance = o.magnitude(O) } }
function y(e, r, i, n, a, s, l, u) { g(e, r, i, n); var c = a.getValue(s, e._lastCartesian); if (t(c)) { var d = l.cartesianToCartographic(c, e._lastCartographic),
p = u.project(d);
T.x = p.z, T.y = p.x, T.z = p.y; var f = r.transform;
f.setColumn(3, T, f); var v = e._screenSpaceCameraController;
v.enableTranslate = !1, v.setEllipsoid(h.UNIT_SPHERE), v.columbusViewMode = m.LOCKED, r.controller.constrainedAxis = o.UNIT_Z; var y = r.position;
o.clone(y, e._lastOffset), e._lastDistance = o.magnitude(y) } }
function g(e, t, r, a) { var s = e.scene; if (t.controller.constrainedAxis = o.UNIT_Z, r) t.controller.lookAt(a, o.ZERO, o.UNIT_Z);
else if (s.mode !== e._mode) { e._mode = s.mode; var c = e._first2dUp,
h = e._last2dUp; if (!n.equals(c, h)) { var d = Math.acos(c.x);
c.y < 0 && (d = i.TWO_PI - d); var m = Math.acos(h.x);
h.y < 0 && (m = i.TWO_PI - m), h.x = 0, h.y = 0, c.x = 0, c.y = 0; var p = d - m,
f = l.fromAxisAngle(o.UNIT_Z, p, A);
u.fromQuaternion(f, M).multiplyByVector(a, a) } a.normalize(a).multiplyByScalar(e._lastDistance, a), t.controller.lookAt(a, o.ZERO, o.UNIT_Z) } } var _ = new c,
w = new u,
C = new u,
x = new u,
S = new o,
E = new o,
b = new o,
T = new a(0, 0, 0, 1),
A = new l,
M = new u,
P = new o(1e4, -1e4, 1e4),
D = new o,
I = function(t, r, i) { this.dynamicObject = t, this.scene = r, this._lastScene = void 0, this.ellipsoid = e(i, h.WGS84), this._lastDynamicObject = void 0, this._mode = void 0, this._lastCartesian = new o, this._lastCartographic = new s, this._lastDistance = void 0, this._lastOffset = new o, this._offsetScratch = new o, this._first2dUp = new n, this._last2dUp = new n }; return I.prototype.update = function(e) { if (!t(e)) throw new r("time is required."); var i = this.scene; if (!t(i)) throw new r("DynamicObjectView.scene is required.");
i !== this._lastScene && (this._lastScene = i, this._screenSpaceCameraController = i.getScreenSpaceCameraController()); var n = this.dynamicObject; if (!t(n)) throw new r("DynamicObjectView.dynamicObject is required."); var a = this.ellipsoid; if (!t(a)) throw new r("DynamicObjectView.ellipsoid is required."); var s = this.dynamicObject.position; if (!t(s)) throw new r("dynamicObject.position is required."); var l = n !== this._lastDynamicObject,
u = this._offsetScratch; if (l) { this._lastDynamicObject = n; var c = this.dynamicObject.viewFrom;
(!t(c) || t(c.getValue(e, u))) && o.clone(P, u); var h = this._first2dUp,
d = this._last2dUp;
h.x = h.y = 0, d.x = d.y = 0, o.clone(u, this._lastOffset), this._lastDistance = u.magnitude(), o.equals(u.normalize(D), o.UNIT_Z) && (u.y -= .01) } else t(this._lastOffset) ? u = this._lastOffset : o.clone(P, u); var m = i.mode;
m === p.SCENE2D ? f(this, i.getCamera(), l, u, s, e, a, i.scene2D.projection) : m === p.SCENE3D ? v(this, i.getCamera(), l, u, s, e, a) : m === p.COLUMBUS_VIEW && y(this, i.getCamera(), l, u, s, e, a, i.scene2D.projection) }, I }), r("DynamicScene/DynamicVectorVisualizer", ["../Core/DeveloperError", "../Core/defined", "../Core/destroyObject", "../Core/Cartesian3", "../Core/Color", "../Scene/Material", "../Scene/PolylineCollection"], function(e, t, r, i, n, o, a) { "use strict";
function s(e, r, a) { var s = a.vector; if (t(s)) { var l, u = s.show,
c = a.position,
h = s.direction,
d = s.length,
m = a._vectorVisualizerIndex,
p = a.isAvailable(r) && (!t(u) || u.getValue(r)); if (!(p && t(h) && t(c) && t(d))) return t(m) && (l = e._polylineCollection.get(m), l.setShow(!1), a._vectorVisualizerIndex = void 0, e._unusedIndexes.push(m)), void 0; var f; if (t(m)) l = e._polylineCollection.get(m), f = l.getMaterial().uniforms;
else { var v = e._unusedIndexes;
v.length > 0 ? (m = v.pop(), l = e._polylineCollection.get(m)) : (m = e._polylineCollection.getLength(), l = e._polylineCollection.add(), l._visualizerPositions = [new i, new i]), a._vectorVisualizerIndex = m, l.dynamicObject = a, l.setWidth(1); var y = l.getMaterial();
t(y) && y.type === o.PolylineArrowType || (y = o.fromType(e._scene.getContext(), o.PolylineArrowType), l.setMaterial(y)), f = y.uniforms, n.clone(n.WHITE, f.color) } l.setShow(!0); var g = l._visualizerPositions,
_ = c.getValue(r, g[0]),
w = h.getValue(r, g[1]),
C = d.getValue(r);
t(_) && t(w) && t(C) && (i.add(_, w.normalize(w).multiplyByScalar(C, w), w), l.setPositions(g)); var x = s.color; if (t(x) && (f.color = x.getValue(r, f.color)), x = s.width, t(x)) { var S = x.getValue(r);
t(S) && l.setWidth(S) } } } var l = function(r, i) { if (!t(r)) throw new e("scene is required.");
this._scene = r, this._unusedIndexes = [], this._primitives = r.getPrimitives(); var n = this._polylineCollection = new a;
r.getPrimitives().add(n), this._dynamicObjectCollection = void 0, this.setDynamicObjectCollection(i) }; return l.prototype.getScene = function() { return this._scene }, l.prototype.getDynamicObjectCollection = function() { return this._dynamicObjectCollection }, l.prototype.setDynamicObjectCollection = function(e) { var r = this._dynamicObjectCollection;
r !== e && (t(r) && (r.objectsRemoved.removeEventListener(l.prototype._onObjectsRemoved, this), this.removeAllPrimitives()), this._dynamicObjectCollection = e, t(e) && e.objectsRemoved.addEventListener(l.prototype._onObjectsRemoved, this)) }, l.prototype.update = function(r) { if (!t(r)) throw new e("time is requied."); if (t(this._dynamicObjectCollection))
for (var i = this._dynamicObjectCollection.getObjects(), n = 0, o = i.length; o > n; n++) s(this, r, i[n]) }, l.prototype.removeAllPrimitives = function() { var e; if (this._polylineCollection.removeAll(), t(this._dynamicObjectCollection)) { var r = this._dynamicObjectCollection.getObjects(); for (e = r.length - 1; e > -1; e--) r[e]._vectorVisualizerIndex = void 0 } this._unusedIndexes = [] }, l.prototype.isDestroyed = function() { return !1 }, l.prototype.destroy = function() { return this.removeAllPrimitives(), this._scene.getPrimitives().remove(this._polylineCollection), r(this) }, l.prototype._onObjectsRemoved = function(e, r) { for (var i = this._polylineCollection, n = this._unusedIndexes, o = r.length - 1; o > -1; o--) { var a = r[o],
s = a._vectorVisualizerIndex; if (t(s)) { var l = i.get(s);
l.setShow(!1), n.push(s), a._vectorVisualizerIndex = void 0 } } }, l }), r("ThirdParty/topojson", [], function() { var e = function() {
function e(e, t) {
function r(t) { var r = e.arcs[t],
i = r[0],
n = [0, 0]; return r.forEach(function(e) { n[0] += e[0], n[1] += e[1] }), [i, n] } var i = {},
n = {},
o = {};
t.forEach(function(e) { var t = r(e);
(i[t[0]] || (i[t[0]] = [])).push(e), (i[t[1]] || (i[t[1]] = [])).push(~e) }), t.forEach(function(e) { var t, i, a = r(e),
s = a[0],
l = a[1]; if (t = o[s])
if (delete o[t.end], t.push(e), t.end = l, i = n[l]) { delete n[i.start]; var u = i === t ? t : t.concat(i);
n[u.start = t.start] = o[u.end = i.end] = u } else if (i = o[l]) { delete n[i.start], delete o[i.end]; var u = t.concat(i.map(function(e) { return ~e }).reverse());
n[u.start = t.start] = o[u.end = i.start] = u } else n[t.start] = o[t.end] = t;
else if (t = n[l])
if (delete n[t.start], t.unshift(e), t.start = s, i = o[s]) { delete o[i.end]; var c = i === t ? t : i.concat(t);
n[c.start = i.start] = o[c.end = t.end] = c } else if (i = n[s]) { delete n[i.start], delete o[i.end]; var c = i.map(function(e) { return ~e }).reverse().concat(t);
n[c.start = i.end] = o[c.end = t.end] = c } else n[t.start] = o[t.end] = t;
else if (t = n[s])
if (delete n[t.start], t.unshift(~e), t.start = l, i = o[l]) { delete o[i.end]; var c = i === t ? t : i.concat(t);
n[c.start = i.start] = o[c.end = t.end] = c } else if (i = n[l]) { delete n[i.start], delete o[i.end]; var c = i.map(function(e) { return ~e }).reverse().concat(t);
n[c.start = i.end] = o[c.end = t.end] = c } else n[t.start] = o[t.end] = t;
else if (t = o[l])
if (delete o[t.end], t.push(~e), t.end = s, i = o[s]) { delete n[i.start]; var u = i === t ? t : t.concat(i);
n[u.start = t.start] = o[u.end = i.end] = u } else if (i = n[s]) { delete n[i.start], delete o[i.end]; var u = t.concat(i.map(function(e) { return ~e }).reverse());
n[u.start = t.start] = o[u.end = i.start] = u } else n[t.start] = o[t.end] = t;
else t = [e], n[t.start = s] = o[t.end = l] = t }); var a = []; for (var s in o) a.push(o[s]); return a }
function t(t, r, i) {
function o(e) { 0 > e && (e = ~e), (h[e] || (h[e] = [])).push(c) }
function a(e) { e.forEach(o) }
function s(e) { e.forEach(a) }
function l(e) { "GeometryCollection" === e.type ? e.geometries.forEach(l) : e.type in d && (c = e, d[e.type](e.arcs)) } var u = []; if (arguments.length > 1) { var c, h = [],
d = { LineString: a, MultiLineString: s, Polygon: s, MultiPolygon: function(e) { e.forEach(s) } };
l(r), h.forEach(arguments.length < 3 ? function(e, t) { u.push(t) } : function(e, t) { i(e[0], e[e.length - 1]) && u.push(t) }) } else
for (var m = 0, p = t.arcs.length; p > m; ++m) u.push(m); return n(t, { type: "MultiLineString", arcs: e(t, u) }) }
function r(e, t) { return "GeometryCollection" === t.type ? { type: "FeatureCollection", features: t.geometries.map(function(t) { return i(e, t) }) } : i(e, t) }
function i(e, t) { var r = { type: "Feature", id: t.id, properties: t.properties || {}, geometry: n(e, t) }; return null == t.id && delete r.id, r }
function n(e, t) {
function r(e, t) { t.length && t.pop(); for (var r, i = p[0 > e ? ~e : e], n = 0, a = i.length, s = 0, l = 0; a > n; ++n) t.push([(s += (r = i[n])[0]) * c + d, (l += r[1]) * h + m]);
0 > e && o(t, a) }
function i(e) { return [e[0] * c + d, e[1] * h + m] }
function n(e) { for (var t = [], i = 0, n = e.length; n > i; ++i) r(e[i], t); return t.length < 2 && t.push(t[0]), t }
function a(e) { for (var t = n(e); t.length < 4;) t.push(t[0]); return t }
function s(e) { return e.map(a) }
function l(e) { var t = e.type; return "GeometryCollection" === t ? { type: t, geometries: e.geometries.map(l) } : t in f ? { type: t, coordinates: f[t](e) } : null } var u = e.transform,
c = u.scale[0],
h = u.scale[1],
d = u.translate[0],
m = u.translate[1],
p = e.arcs,
f = { Point: function(e) { return i(e.coordinates) }, MultiPoint: function(e) { return e.coordinates.map(i) }, LineString: function(e) { return n(e.arcs) }, MultiLineString: function(e) { return e.arcs.map(n) }, Polygon: function(e) { return s(e.arcs) }, MultiPolygon: function(e) { return e.arcs.map(s) } }; return l(t) }
function o(e, t) { for (var r, i = e.length, n = i - t; n < --i;) r = e[n], e[n++] = e[i], e[i] = r }
function a(e, t) { for (var r = 0, i = e.length; i > r;) { var n = r + i >>> 1;
e[n] < t ? r = n + 1 : i = n } return r }
function s(e) {
function t(e, t) { e.forEach(function(e) { 0 > e && (e = ~e); var r = n[e];
r ? r.push(t) : n[e] = [t] }) }
function r(e, r) { e.forEach(function(e) { t(e, r) }) }
function i(e, t) { "GeometryCollection" === e.type ? e.geometries.forEach(function(e) { i(e, t) }) : e.type in s && s[e.type](e.arcs, t) } var n = {},
o = e.map(function() { return [] }),
s = { LineString: t, MultiLineString: r, Polygon: r, MultiPolygon: function(e, t) { e.forEach(function(e) { r(e, t) }) } };
e.forEach(i); for (var l in n)
for (var u = n[l], c = u.length, h = 0; c > h; ++h)
for (var d = h + 1; c > d; ++d) { var m, p = u[h],
f = u[d];
(m = o[p])[l = a(m, f)] !== f && m.splice(l, 0, f), (m = o[f])[l = a(m, p)] !== p && m.splice(l, 0, p) }
return o } return { version: "1.1.4", mesh: t, feature: r, neighbors: s } }(); return e }), r("DynamicScene/GeoJsonDataSource", ["../Core/createGuid", "../Core/Cartographic", "../Core/Color", "../Core/defined", "../Core/DeveloperError", "../Core/RuntimeError", "../Core/Ellipsoid", "../Core/Event", "../Core/loadJson", "./ConstantProperty", "./DynamicObject", "./DynamicPoint", "./DynamicPolyline", "./DynamicPolygon", "./ColorMaterialProperty", "./DynamicObjectCollection", "../ThirdParty/when", "../ThirdParty/topojson"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y) { "use strict";
function g(t, r) { var n = t.id; if (i(n) && "Feature" === t.type) { for (var o = 2, a = n; i(r.getObject(a));) a = n + "_" + o, o++;
n = a } else n = e(); var s = r.getOrCreateObject(n); return s.geoJson = t, s }
function _(e, t) { for (var r = new Array(e.length), i = 0; i < e.length; i++) r[i] = t(e[i]); return r }
function w(e, t, r, n, a) { if (!i(t.geometry)) throw new o("feature.geometry is required."); if (null === t.geometry) g(t, e._dynamicObjectCollection);
else { var s = t.geometry.type,
l = O[s]; if (!i(l)) throw new o("Unknown geometry type: " + s);
l(e, t, t.geometry, n, a) } }
function C(e, t, r, i, n) { for (var o = t.features, a = 0, s = o.length; s > a; a++) w(e, o[a], void 0, i, n) }
function x(e, t, r, n, a) { for (var s = r.geometries, l = 0, u = s.length; u > l; l++) { var c = s[l],
h = c.type,
d = O[h]; if (!i(d)) throw new o("Unknown geometry type: " + h);
d(e, t, c, n, a) } }
function S(e, t, r, i) { var n = g(t, e._dynamicObjectCollection);
n.merge(e.defaultPoint), n.position = new u(i(r.coordinates)) }
function E(e, t, r, i) { for (var n = r.coordinates, o = 0; o < n.length; o++) { var a = g(t, e._dynamicObjectCollection);
a.merge(e.defaultPoint), a.position = new u(i(n[o])) } }
function b(e, t, r, i) { var n = g(t, e._dynamicObjectCollection);
n.merge(e.defaultLine), n.vertexPositions = new u(_(r.coordinates, i)) }
function T(e, t, r, i) { for (var n = r.coordinates, o = 0; o < n.length; o++) { var a = g(t, e._dynamicObjectCollection);
a.merge(e.defaultLine), a.vertexPositions = new u(_(n[o], i)) } }
function A(e, t, r, i) { var n = g(t, e._dynamicObjectCollection);
n.merge(e.defaultPolygon), n.vertexPositions = new u(_(r.coordinates[0], i)) }
function M(e, t, r, i, n) { for (var o in r.objects)
if (r.objects.hasOwnProperty(o)) { var a = y.feature(r, r.objects[o]),
s = I[a.type];
s(e, a, a, i, n) } }
function P(e, t, r, i) { for (var n = r.coordinates, o = 0; o < n.length; o++) { var a = n[o],
s = g(t, e._dynamicObjectCollection);
s.merge(e.defaultPolygon), s.vertexPositions = new u(_(a[0], i)) } }
function D(e) { var r = t.fromDegrees(e[0], e[1], e[2]); return a.WGS84.cartographicToCartesian(r) } var I = { Feature: w, FeatureCollection: C, GeometryCollection: x, LineString: b, MultiLineString: T, MultiPoint: E, MultiPolygon: P, Point: S, Polygon: A, Topology: M },
O = { GeometryCollection: x, LineString: b, MultiLineString: T, MultiPoint: E, MultiPolygon: P, Point: S, Polygon: A, Topology: M },
R = function() { var e = new c("GeoJsonDataSource.defaultPoint"),
t = new h;
t.color = new u(r.YELLOW), t.pixelSize = new u(10), t.outlineColor = new u(r.BLACK), t.outlineWidth = new u(1), e.point = t; var i = new c("GeoJsonDataSource.defaultLine"),
n = new d;
n.color = new u(r.YELLOW), n.width = new u(2), n.outlineColor = new u(r.BLACK), n.outlineWidth = new u(1), i.polyline = n; var o = new c("GeoJsonDataSource.defaultPolygon");
n = new d, n.color = new u(r.YELLOW), n.width = new u(1), n.outlineColor = new u(r.BLACK), n.outlineWidth = new u(0), o.polyline = n; var a = new m;
o.polygon = a; var l = new p;
l.color = new u(new r(1, 1, 0, .1)), a.material = l, this._changed = new s, this._error = new s, this._dynamicObjectCollection = new f, this.defaultPoint = e, this.defaultLine = i, this.defaultPolygon = o }; return R.prototype.getChangedEvent = function() { return this._changed }, R.prototype.getErrorEvent = function() { return this._error }, R.prototype.getClock = function() { return void 0 }, R.prototype.getDynamicObjectCollection = function() { return this._dynamicObjectCollection }, R.prototype.getIsTimeVarying = function() { return !1 }, R.prototype.loadUrl = function(e) { if (!i(e)) throw new n("url is required."); var t = this; return v(l(e), function(r) { return t.load(r, e) }, function(e) { return t._error.raiseEvent(t, e), v.reject(e) }) }, R.prototype.load = function(e, t) { if (!i(e)) throw new n("geoJson is required."); var r = I[e.type]; if (!i(r)) throw new n("Unsupported GeoJSON object type: " + e.type); var a = D,
s = e.crs; if (i(s)) { if (null === s) throw new o("crs is null."); if (!i(s.properties)) throw new o("crs.properties is undefined."); var l = s.properties; if ("name" === s.type) { if (a = R.crsNames[l.name], !i(a)) throw new o("Unknown crs name: " + l.name) } else if ("link" === s.type) { var u = R.crsLinkHrefs[l.href]; if (i(u) || (u = R.crsLinkTypes[l.type]), !i(u)) throw new o("Unable to resolve crs link: " + JSON.stringify(l));
a = u(l) } else { if ("EPSG" !== s.type) throw new o("Unknown crs type: " + s.type); if (a = R.crsNames["EPSG:" + l.code], !i(a)) throw new o("Unknown crs EPSG code: " + l.code) } } this._dynamicObjectCollection.clear(); var c = this; return v(a, function(i) { r(c, e, e, i, t), c._changed.raiseEvent(c) }, function(e) { return c._error.raiseEvent(c, e), v.reject(e) }) }, R.crsNames = { "urn:ogc:def:crs:OGC:1.3:CRS84": D, "EPSG:4326": D }, R.crsLinkHrefs = {}, R.crsLinkTypes = {}, R }), r("DynamicScene/Property", ["../Core/DeveloperError"], function(e) { "use strict";
function t() { throw new e("This type should not be instantiated directly.") } var r = t; return r.prototype.getValue = t, r }), r("Renderer/Buffer", ["../Core/DeveloperError", "../Core/destroyObject"], function(e, t) { "use strict"; var r = function(e, t, r, i, n) { this._gl = e, this._bufferTarget = t, this._sizeInBytes = r, this._usage = i, this._buffer = n, this._vertexArrayDestroyable = !0 }; return r.prototype.copyFromArrayView = function(t, r) { if (!t) throw new e("arrayView is required."); if (r = r || 0, r + t.byteLength > this._sizeInBytes) throw new e("This buffer is not large enough."); var i = this._gl,
n = this._bufferTarget;
i.bindBuffer(n, this._buffer), i.bufferSubData(n, r, t), i.bindBuffer(n, null) }, r.prototype._getBuffer = function() { return this._buffer }, r.prototype.getSizeInBytes = function() { return this._sizeInBytes }, r.prototype.getUsage = function() { return this._usage }, r.prototype.getVertexArrayDestroyable = function() { return this._vertexArrayDestroyable }, r.prototype.setVertexArrayDestroyable = function(e) { this._vertexArrayDestroyable = e }, r.prototype.isDestroyed = function() { return !1 }, r.prototype.destroy = function() { return this._gl.deleteBuffer(this._buffer), t(this) }, r }), r("Renderer/ClearCommand", ["../Core/Color", "../Core/freezeObject"], function(e, t) { "use strict"; var r = function() { this.color = void 0, this.depth = void 0, this.stencil = void 0, this.renderState = void 0, this.framebuffer = void 0, this.owner = void 0 },
i = new r; return i.color = new e(0, 0, 0, 0), i.depth = 1, i.stencil = 0, r.ALL = t(i), r.prototype.execute = function(e, t) { e.clear(this, t) }, r }), r("Renderer/Framebuffer", ["../Core/DeveloperError", "../Core/destroyObject", "./PixelFormat"], function(e, t, r) { "use strict";
function i(e, t, r) { e._bind(); var i = e._gl;
r ? i.framebufferTexture2D(i.FRAMEBUFFER, t, r._getTarget(), r._getTexture(), 0) : i.framebufferTexture2D(i.FRAMEBUFFER, t, i.TEXTURE_2D, null, 0), e._unBind() }
function n(e, t, r) { e._bind(); var i = e._gl;
r ? i.framebufferRenderbuffer(i.FRAMEBUFFER, t, i.RENDERBUFFER, r._getRenderbuffer()) : i.framebufferRenderbuffer(i.FRAMEBUFFER, t, i.RENDERBUFFER, null), e._unBind() }
function o(e, t) { e.destroyAttachments && t && t.destroy && t.destroy() } var a = function(t, r) { if (this._gl = t, this._framebuffer = t.createFramebuffer(), this._colorTexture = void 0, this._colorRenderbuffer = void 0, this._depthTexture = void 0, this._depthRenderbuffer = void 0, this._stencilRenderbuffer = void 0, this._depthStencilTexture = void 0, this._depthStencilRenderbuffer = void 0, this.destroyAttachments = !0, r) { if (r.colorTexture && r.colorRenderbuffer) throw new e("Cannot have both a color texture and color renderbuffer attachment."); if (r.depthTexture && r.depthRenderbuffer) throw new e("Cannot have both a depth texture and depth renderbuffer attachment."); if (r.depthStencilTexture && r.depthStencilRenderbuffer) throw new e("Cannot have both a depth-stencil texture and depth-stencil renderbuffer attachment."); var i = r.depthTexture || r.depthRenderbuffer,
n = r.depthStencilTexture || r.depthStencilRenderbuffer; if (i && n) throw new e("Cannot have both a depth and depth-stencil attachment."); if (r.stencilRenderbuffer && n) throw new e("Cannot have both a stencil and depth-stencil attachment."); if (i && r.stencilRenderbuffer) throw new e("Cannot have both a depth and stencil attachment.");
r.colorTexture && this.setColorTexture(r.colorTexture), r.colorRenderbuffer && this.setColorRenderbuffer(r.colorRenderbuffer), r.depthTexture && this.setDepthTexture(r.depthTexture), r.depthRenderbuffer && this.setDepthRenderbuffer(r.depthRenderbuffer), r.stencilRenderbuffer && this.setStencilRenderbuffer(r.stencilRenderbuffer), r.depthStencilTexture && this.setDepthStencilTexture(r.depthStencilTexture), r.depthStencilRenderbuffer && this.setDepthStencilRenderbuffer(r.depthStencilRenderbuffer) } }; return a.prototype._bind = function() { var e = this._gl;
e.bindFramebuffer(e.FRAMEBUFFER, this._framebuffer) }, a.prototype._unBind = function() { var e = this._gl;
e.bindFramebuffer(e.FRAMEBUFFER, null) }, a.prototype.setColorTexture = function(t) { if (t && !r.isColorFormat(t.getPixelFormat())) throw new e("The color-texture pixel-format must be a color format.");
i(this, this._gl.COLOR_ATTACHMENT0, t), o(this, this._colorTexture), this._colorTexture = t }, a.prototype.getColorTexture = function() { return this._colorTexture }, a.prototype.setColorRenderbuffer = function(e) { n(this, this._gl.COLOR_ATTACHMENT0, e), o(this, this._colorRenderbuffer), this._colorRenderbuffer = e }, a.prototype.getColorRenderbuffer = function() { return this._colorRenderbuffer }, a.prototype.setDepthTexture = function(t) { if (t && t.getPixelFormat() !== r.DEPTH_COMPONENT) throw new e("The depth-texture pixel-format must be DEPTH_COMPONENT.");
i(this, this._gl.DEPTH_ATTACHMENT, t), o(this, this._depthTexture), this._depthTexture = t }, a.prototype.getDepthTexture = function() { return this._depthTexture }, a.prototype.setDepthRenderbuffer = function(e) { n(this, this._gl.DEPTH_ATTACHMENT, e), o(this, this._depthRenderbuffer), this._depthRenderbuffer = e }, a.prototype.getDepthRenderbuffer = function() { return this._depthRenderbuffer }, a.prototype.setStencilRenderbuffer = function(e) { n(this, this._gl.STENCIL_ATTACHMENT, e), o(this, this._stencilRenderbuffer), this._stencilRenderbuffer = e }, a.prototype.getStencilRenderbuffer = function() { return this._stencilRenderbuffer }, a.prototype.setDepthStencilTexture = function(t) { if (t && t.getPixelFormat() !== r.DEPTH_STENCIL) throw new e("The depth-stencil pixel-format must be DEPTH_STENCIL.");
i(this, this._gl.DEPTH_STENCIL_ATTACHMENT, t), o(this, this._depthStencilTexture), this._depthStencilTexture = t }, a.prototype.getDepthStencilTexture = function() { return this._depthStencilTexture }, a.prototype.setDepthStencilRenderbuffer = function(e) { n(this, this._gl.DEPTH_STENCIL_ATTACHMENT, e), o(this, this._depthStencilRenderbuffer), this._depthStencilRenderbuffer = e }, a.prototype.getDepthStencilRenderbuffer = function() { return this._depthStencilRenderbuffer }, a.prototype.hasDepthAttachment = function() { return !!(this.getDepthTexture() || this.getDepthRenderbuffer() || this.getDepthStencilTexture() || this.getDepthStencilRenderbuffer()) }, a.prototype.isDestroyed = function() { return !1 }, a.prototype.destroy = function() { return this.destroyAttachments && (this._colorTexture = this._colorTexture && this._colorTexture.destroy && this._colorTexture.destroy(), this._colorRenderbuffer = this._colorRenderbuffer && this._colorRenderbuffer.destroy(), this._depthTexture = this._depthTexture && this._depthTexture.destroy(), this._depthRenderbuffer = this._depthRenderbuffer && this._depthRenderbuffer.destroy(), this._stencilRenderbuffer = this._stencilRenderbuffer && this._stencilRenderbuffer.destroy(), this._depthStencilTexture = this._depthStencilTexture && this._depthStencilTexture.destroy(), this._depthStencilRenderbuffer = this._depthStencilRenderbuffer && this._depthStencilRenderbuffer.destroy()), this._gl.deleteFramebuffer(this._framebuffer), t(this) }, a }), r("Renderer/PassState", [], function() { "use strict"; var e = function(e) { this.context = e, this.framebuffer = void 0, this.blendingEnabled = void 0, this.scissorTest = void 0 }; return e }), r("Renderer/RenderbufferFormat", ["../Core/Enumeration"], function(e) { "use strict"; var t = { RGBA4: new e(32854, "RGBA4"), RGB5_A1: new e(32855, "RGB5_A1"), RGB565: new e(36194, "RGB565"), DEPTH_COMPONENT16: new e(33189, "DEPTH_COMPONENT16"), STENCIL_INDEX8: new e(36168, "STENCIL_INDEX8"), DEPTH_STENCIL: new e(34041, "DEPTH_STENCIL"), validate: function(e) { return e === t.RGBA4 || e === t.RGB5_A1 || e === t.RGB565 || e === t.DEPTH_COMPONENT16 || e === t.STENCIL_INDEX8 || e === t.DEPTH_STENCIL } }; return t }), r("Renderer/PickFramebuffer", ["../Core/defaultValue", "../Core/defined", "../Core/destroyObject", "../Core/Color", "../Core/BoundingRectangle", "./PassState", "./RenderbufferFormat"], function(e, t, r, i, n, o, a) { "use strict"; var s = function(e) { var t = new o(e);
t.blendingEnabled = !1, t.scissorTest = { enabled: !0, rectangle: new n }, this._context = e, this._fb = void 0, this._passState = t, this._width = 0, this._height = 0 };
s.prototype.begin = function(e) { var r = this._context,
i = r.getCanvas().clientWidth,
o = r.getCanvas().clientHeight; return n.clone(e, this._passState.scissorTest.rectangle), t(this._fb) && this._width === i && this._height === o || (this._width = i, this._height = o, this._fb = this._fb && this._fb.destroy(), this._fb = r.createFramebuffer({ colorTexture: r.createTexture2D({ width: i, height: o }), depthRenderbuffer: r.createRenderbuffer({ format: a.DEPTH_COMPONENT16 }) }), this._passState.framebuffer = this._fb), this._passState }; var l = new i; return s.prototype.end = function(r) { for (var n = e(r.width, 1), o = e(r.height, 1), a = this._context, s = a.readPixels({ x: r.x, y: r.y, width: n, height: o, framebuffer: this._fb }), u = Math.max(n, o), c = u * u, h = Math.floor(.5 * n), d = Math.floor(.5 * o), m = 0, p = 0, f = 0, v = -1, y = 0; c > y; ++y) { if (m >= -h && h >= m && p >= -d && d >= p) { var g = 4 * ((d - p) * n + m + h);
l.red = i.byteToFloat(s[g]), l.green = i.byteToFloat(s[g + 1]), l.blue = i.byteToFloat(s[g + 2]), l.alpha = i.byteToFloat(s[g + 3]); var _ = a.getObjectByPickColor(l); if (t(_)) return _ } if (m === p || 0 > m && -m === p || m > 0 && m === 1 - p) { var w = f;
f = -v, v = w } m += f, p += v } return void 0 }, s.prototype.isDestroyed = function() { return !1 }, s.prototype.destroy = function() { return this._fb = this._fb && this._fb.destroy(), r(this) }, s }), r("Renderer/Renderbuffer", ["../Core/destroyObject"], function(e) { "use strict";
function t(t, r, i, n) { var o = t.createRenderbuffer();
t.bindRenderbuffer(t.RENDERBUFFER, o), t.renderbufferStorage(t.RENDERBUFFER, r, i, n), t.bindRenderbuffer(t.RENDERBUFFER, null), this.getFormat = function() { return r }, this.getWidth = function() { return i }, this.getHeight = function() { return n }, this._getRenderbuffer = function() { return o }, this.isDestroyed = function() { return !1 }, this.destroy = function() { return t.deleteRenderbuffer(o), e(this) } } return t }), r("Renderer/DepthFunction", ["../Core/Enumeration"], function(e) { "use strict"; var t = { NEVER: new e(512, "NEVER"), LESS: new e(513, "LESS"), EQUAL: new e(514, "EQUAL"), LESS_OR_EQUAL: new e(515, "LEQUAL"), GREATER: new e(516, "GREATER"), NOT_EQUAL: new e(517, "NOTEQUAL"), GREATER_OR_EQUAL: new e(518, "GEQUAL"), ALWAYS: new e(519, "ALWAYS"), validate: function(e) { return e === t.NEVER || e === t.LESS || e === t.EQUAL || e === t.LESS_OR_EQUAL || e === t.GREATER || e === t.NOT_EQUAL || e === t.GREATER_OR_EQUAL || e === t.ALWAYS } }; return t }), r("Renderer/StencilFunction", ["../Core/Enumeration"], function(e) { "use strict"; var t = { NEVER: new e(512, "NEVER"), LESS: new e(513, "LESS"), EQUAL: new e(514, "EQUAL"), LESS_OR_EQUAL: new e(515, "LESS_OR_EQUAL"), GREATER: new e(516, "GREATER"), NOT_EQUAL: new e(517, "NOT_EQUAL"), GREATER_OR_EQUAL: new e(518, "GREATER_OR_EQUAL"), ALWAYS: new e(519, "ALWAYS"), validate: function(e) { return e === t.NEVER || e === t.LESS || e === t.EQUAL || e === t.LESS_OR_EQUAL || e === t.GREATER || e === t.NOT_EQUAL || e === t.GREATER_OR_EQUAL || e === t.ALWAYS } }; return t }), r("Renderer/StencilOperation", ["../Core/Enumeration"], function(e) { "use strict"; var t = { ZERO: new e(0, "ZERO"), KEEP: new e(7680, "KEEP"), REPLACE: new e(7681, "REPLACE"), INCREMENT: new e(7682, "INCREMENT"), DECREMENT: new e(7683, "DECREMENT"), INVERT: new e(5386, "INVERT"), INCREMENT_WRAP: new e(34055, "INCREMENT_WRAP"), DECREMENT_WRAP: new e(34056, "DECREMENT_WRAP"), validate: function(e) { return e === t.ZERO || e === t.KEEP || e === t.REPLACE || e === t.INCREMENT || e === t.DECREMENT || e === t.INVERT || e === t.INCREMENT_WRAP || e === t.DECREMENT_WRAP } }; return t }), r("Renderer/RenderState", ["../Core/Color", "../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/BoundingRectangle", "../Core/RuntimeError", "../Core/WindingOrder", "./CullFace", "./DepthFunction", "./BlendEquation", "./BlendFunction", "./StencilFunction", "./StencilOperation"], function(e, t, r, i, n, o, a, s, l, u, c, h, d) {
"use strict";
function m(e, t, r) { r ? e.enable(t) : e.disable(t) }
function p(e, t) { e.frontFace(t.frontFace) }
function f(e, t) { var r = t.cull,
i = r.enabled;
m(e, e.CULL_FACE, i), i && e.cullFace(r.face) }
function v(e, t) { e.lineWidth(t.lineWidth) }
function y(e, t) { var r = t.polygonOffset,
i = r.enabled;
m(e, e.POLYGON_OFFSET_FILL, i), i && e.polygonOffset(r.factor, r.units) }
function g(e, t, i) { var n = t.scissorTest,
o = r(i.scissorTest) ? i.scissorTest.enabled : n.enabled; if (m(e, e.SCISSOR_TEST, o), o) { var a = r(i.scissorTest) ? i.scissorTest.rectangle : n.rectangle;
e.scissor(a.x, a.y, a.width, a.height) } }
function _(e, t) { var r = t.depthRange;
e.depthRange(r.near, r.far) }
function w(e, t) { var r = t.depthTest,
i = r.enabled;
m(e, e.DEPTH_TEST, i), i && e.depthFunc(r.func) }
function C(e, t) { var r = t.colorMask;
e.colorMask(r.red, r.green, r.blue, r.alpha) }
function x(e, t) { e.depthMask(t.depthMask) }
function S(e, t) { e.stencilMask(t.stencilMask) }
function E(e, t, i) { var n = t.blending,
o = r(i.blendingEnabled) ? i.blendingEnabled : n.enabled; if (m(e, e.BLEND, o), o) { var a = n.color,
s = n.equationRgb,
l = n.equationAlpha,
u = n.functionSourceRgb,
c = n.functionDestinationRgb,
h = n.functionSourceAlpha,
d = n.functionDestinationAlpha;
e.blendColor(a.red, a.green, a.blue, a.alpha), e.blendEquationSeparate(s, l), e.blendFuncSeparate(u, c, h, d) } }
function b(e, t) { var r = t.stencilTest,
i = r.enabled; if (m(e, e.STENCIL_TEST, i), i) { var n = r.frontFunction,
o = r.backFunction,
a = r.reference,
s = r.mask;
e.stencilFunc(r.frontFunction, r.reference, r.mask), e.stencilFuncSeparate(e.BACK, o, a, s), e.stencilFuncSeparate(e.FRONT, n, a, s); var l = r.frontOperation,
u = l.fail,
c = l.zFail,
h = l.zPass;
e.stencilOpSeparate(e.FRONT, u, c, h); var d = r.backOperation,
p = d.fail,
f = d.zFail,
v = d.zPass;
e.stencilOpSeparate(e.BACK, p, f, v) } }
function T(e, t) { var r = t.sampleCoverage,
i = r.enabled;
m(e, e.SAMPLE_COVERAGE, i), i && e.sampleCoverage(r.value, r.invert) }
function A(e, t) { m(e, e.DITHER, t.dither) }
function M(e, t, i) { var n = t.viewport; if (!r(n)) { var o = i.context.getCanvas();
n = I, n.width = o.clientWidth, n.height = o.clientHeight } i.context.getUniformState().setViewport(n), e.viewport(n.x, n.y, n.width, n.height) }
function P(e, t) {
var r = [];
return e.frontFace !== t.frontFace && r.push(p), (e.cull.enabled !== t.cull.enabled || e.cull.face !== t.cull.face) && r.push(f), e.lineWidth !== t.lineWidth && r.push(v), (e.polygonOffset.enabled !== t.polygonOffset.enabled || e.polygonOffset.factor !== t.polygonOffset.factor || e.polygonOffset.units !== t.polygonOffset.units) && r.push(y), r.push(g), (e.depthRange.near !== t.depthRange.near || e.depthRange.far !== t.depthRange.far) && r.push(_), (e.depthTest.enabled !== t.depthTest.enabled || e.depthTest.func !== t.depthTest.func) && r.push(w), (e.colorMask.red !== t.colorMask.red || e.colorMask.green !== t.colorMask.green || e.colorMask.blue !== t.colorMask.blue || e.colorMask.alpha !== t.colorMask.alpha) && r.push(C), e.depthMask !== t.depthMask && r.push(x), r.push(E), e.stencilMask !== t.stencilMask && r.push(S), (e.stencilTest.enabled !== t.stencilTest.enabled || e.stencilTest.frontFunction !== t.stencilTest.frontFunction || e.stencilTest.backFunction !== t.stencilTest.backFunction || e.stencilTest.reference !== t.stencilTest.reference || e.stencilTest.mask !== t.stencilTest.mask || e.stencilTest.frontOperation.fail !== t.stencilTest.frontOperation.fail || e.stencilTest.frontOperation.zFail !== t.stencilTest.frontOperation.zFail || e.stencilTest.backOperation.fail !== t.stencilTest.backOperation.fail || e.stencilTest.backOperation.zFail !== t.stencilTest.backOperation.zFail || e.stencilTest.backOperation.zPass !== t.stencilTest.backOperation.zPass) && r.push(b), (e.sampleCoverage.enabled !== t.sampleCoverage.enabled || e.sampleCoverage.value !== t.sampleCoverage.value || e.sampleCoverage.invert !== t.sampleCoverage.invert) && r.push(T), e.dither !== t.dither && r.push(A), r.push(M), r
}
var D = function(m, p) { var f = t(p, {}),
v = t(f.cull, {}),
y = t(f.polygonOffset, {}),
g = t(f.scissorTest, {}),
_ = t(g.rectangle, {}),
w = t(f.depthRange, {}),
C = t(f.depthTest, {}),
x = t(f.colorMask, {}),
S = t(f.blending, {}),
E = t(S.color, {}),
b = t(f.stencilTest, {}),
T = t(b.frontOperation, {}),
A = t(b.backOperation, {}),
M = t(f.sampleCoverage, {}),
P = f.viewport; if (this.frontFace = t(f.frontFace, a.COUNTER_CLOCKWISE), this.cull = { enabled: t(v.enabled, !1), face: t(v.face, s.BACK) }, this.lineWidth = t(f.lineWidth, 1), this.polygonOffset = { enabled: t(y.enabled, !1), factor: t(y.factor, 0), units: t(y.units, 0) }, this.scissorTest = { enabled: t(g.enabled, !1), rectangle: n.clone(_) }, this.depthRange = { near: t(w.near, 0), far: t(w.far, 1) }, this.depthTest = { enabled: t(C.enabled, !1), func: t(C.func, l.LESS) }, this.colorMask = { red: t(x.red, !0), green: t(x.green, !0), blue: t(x.blue, !0), alpha: t(x.alpha, !0) }, this.depthMask = t(f.depthMask, !0), this.stencilMask = t(f.stencilMask, -1), this.blending = { enabled: t(S.enabled, !1), color: new e(t(E.red, 0), t(E.green, 0), t(E.blue, 0), t(E.alpha, 0)), equationRgb: t(S.equationRgb, u.ADD), equationAlpha: t(S.equationAlpha, u.ADD), functionSourceRgb: t(S.functionSourceRgb, c.ONE), functionSourceAlpha: t(S.functionSourceAlpha, c.ONE), functionDestinationRgb: t(S.functionDestinationRgb, c.ZERO), functionDestinationAlpha: t(S.functionDestinationAlpha, c.ZERO) }, this.stencilTest = { enabled: t(b.enabled, !1), frontFunction: t(b.frontFunction, h.ALWAYS), backFunction: t(b.backFunction, h.ALWAYS), reference: t(b.reference, 0), mask: t(b.mask, -1), frontOperation: { fail: t(T.fail, d.KEEP), zFail: t(T.zFail, d.KEEP), zPass: t(T.zPass, d.KEEP) }, backOperation: { fail: t(A.fail, d.KEEP), zFail: t(A.zFail, d.KEEP), zPass: t(A.zPass, d.KEEP) } }, this.sampleCoverage = { enabled: t(M.enabled, !1), value: t(M.value, 1), invert: t(M.invert, !1) }, this.dither = t(f.dither, !0), this.viewport = r(P) ? new n(P.x, P.y, r(P.width) ? P.width : m.getCanvas().clientWidth, r(P.height) ? P.height : m.getCanvas().clientHeight) : void 0, !a.validate(this.frontFace)) throw new i("Invalid renderState.frontFace."); if (!s.validate(this.cull.face)) throw new i("Invalid renderState.cull.face."); if (this.lineWidth < m.getMinimumAliasedLineWidth() || this.lineWidth > m.getMaximumAliasedLineWidth()) throw new o("renderState.lineWidth is out of range. Check getMinimumAliasedLineWidth() and getMaximumAliasedLineWidth()."); if (this.scissorTest.rectangle.width < 0 || this.scissorTest.rectangle.height < 0) throw new i("renderState.scissorTest.rectangle.width and renderState.scissorTest.rectangle.height must be greater than or equal to zero."); if (this.depthRange.near > this.depthRange.far) throw new i("renderState.depthRange.near can not be greater than renderState.depthRange.far."); if (this.depthRange.near < 0) throw new i("renderState.depthRange.near must be greater than or equal to zero."); if (this.depthRange.far > 1) throw new i("renderState.depthRange.far must be less than or equal to one."); if (!l.validate(this.depthTest.func)) throw new i("Invalid renderState.depthTest.func."); if (this.blending.color.red < 0 || this.blending.color.red > 1 || this.blending.color.green < 0 || this.blending.color.green > 1 || this.blending.color.blue < 0 || this.blending.color.blue > 1 || this.blending.color.alpha < 0 || this.blending.color.alpha > 1) throw new i("renderState.blending.color components must be greater than or equal to zero and less than or equal to one."); if (!u.validate(this.blending.equationRgb)) throw new i("Invalid renderState.blending.equationRgb."); if (!u.validate(this.blending.equationAlpha)) throw new i("Invalid renderState.blending.equationAlpha."); if (!c.validate(this.blending.functionSourceRgb)) throw new i("Invalid renderState.blending.functionSourceRgb."); if (!c.validate(this.blending.functionSourceAlpha)) throw new i("Invalid renderState.blending.functionSourceAlpha."); if (!c.validate(this.blending.functionDestinationRgb)) throw new i("Invalid renderState.blending.functionDestinationRgb."); if (!c.validate(this.blending.functionDestinationAlpha)) throw new i("Invalid renderState.blending.functionDestinationAlpha."); if (!h.validate(this.stencilTest.frontFunction)) throw new i("Invalid renderState.stencilTest.frontFunction."); if (!h.validate(this.stencilTest.backFunction)) throw new i("Invalid renderState.stencilTest.backFunction."); if (!d.validate(this.stencilTest.frontOperation.fail)) throw new i("Invalid renderState.stencilTest.frontOperation.fail."); if (!d.validate(this.stencilTest.frontOperation.zFail)) throw new i("Invalid renderState.stencilTest.frontOperation.zFail."); if (!d.validate(this.stencilTest.frontOperation.zPass)) throw new i("Invalid renderState.stencilTest.frontOperation.zPass."); if (!d.validate(this.stencilTest.backOperation.fail)) throw new i("Invalid renderState.stencilTest.backOperation.fail."); if (!d.validate(this.stencilTest.backOperation.zFail)) throw new i("Invalid renderState.stencilTest.backOperation.zFail."); if (!d.validate(this.stencilTest.backOperation.zPass)) throw new i("Invalid renderState.stencilTest.backOperation.zPass."); if (r(this.viewport)) { if (this.viewport.width < 0) throw new i("renderState.viewport.width must be greater than or equal to zero."); if (this.viewport.width > m.getMaximumViewportWidth()) throw new o("renderState.viewport.width must be less than or equal to the maximum viewport width (" + this.getMaximumViewportWidth().toString() + "). Check getMaximumViewportWidth()."); if (this.viewport.height < 0) throw new i("renderState.viewport.height must be greater than or equal to zero."); if (this.viewport.height > m.getMaximumViewportHeight()) throw new o("renderState.viewport.height must be less than or equal to the maximum viewport height (" + this.getMaximumViewportHeight().toString() + "). Check getMaximumViewportHeight().") } this.id = 0, this._applyFunctions = [] },
I = new n;
return D.apply = function(e, t, r) { p(e, t), f(e, t), v(e, t), y(e, t), g(e, t, r), _(e, t), w(e, t), C(e, t), x(e, t), S(e, t), E(e, t, r), b(e, t), T(e, t), A(e, t), M(e, t, r) }, D.partialApply = function(e, t, i, n) { var o = i._applyFunctions[t.id];
r(o) || (o = P(t, i), i._applyFunctions[t.id] = o); for (var a = o.length, s = 0; a > s; ++s) o[s](e, i, n) }, D
}), r("Renderer/ShaderCache", ["../Core/defined", "../Core/destroyObject"], function(e, t) { "use strict"; var r = function(e) { this._context = e, this._shaders = {}, this._shadersToRelease = {} }; return r.prototype.replaceShaderProgram = function(t, r, i, n) { return e(t) && t.release(), this.getShaderProgram(r, i, n) }, r.prototype.getShaderProgram = function(e, t, r) { var i, n = e + t + JSON.stringify(r); if (this._shaders[n]) i = this._shaders[n];
else { var o = this._context.createShaderProgram(e, t, r);
i = { cache: this, shaderProgram: o, keyword: n, count: 0 }, o._cachedShader = i, this._shaders[n] = i } return ++i.count, i.shaderProgram }, r.prototype.destroyReleasedShaderPrograms = function() { var e = this._shadersToRelease; for (var t in e)
if (e.hasOwnProperty(t)) { var r = e[t];
0 === r.count && (delete this._shaders[r.keyword], r.shaderProgram.destroy()) }
this._shadersToRelease = {} }, r.prototype.releaseShaderProgram = function(e) { if (e) { var t = e._cachedShader;
t && 0 === --t.count && (this._shadersToRelease[t.keyword] = t) } return void 0 }, r.prototype.isDestroyed = function() { return !1 }, r.prototype.destroy = function() { var e = this._shaders; for (var r in e) e.hasOwnProperty(r) && e[r].shaderProgram.destroy(); return t(this) }, r }), r("Renderer/UniformDatatype", ["../Core/Enumeration"], function(e) { "use strict"; var t = { FLOAT: new e(5126, "FLOAT", { getGLSL: function() { return "float" } }), FLOAT_VECTOR2: new e(35664, "FLOAT_VECTOR2", { getGLSL: function() { return "vec2" } }), FLOAT_VECTOR3: new e(35665, "FLOAT_VECTOR3", { getGLSL: function() { return "vec3" } }), FLOAT_VECTOR4: new e(35666, "FLOAT_VECTOR4", { getGLSL: function() { return "vec4" } }), INT: new e(5124, "INT", { getGLSL: function() { return "int" } }), INT_VECTOR2: new e(35667, "INT_VECTOR2", { getGLSL: function() { return "ivec2" } }), INT_VECTOR3: new e(35668, "INT_VECTOR3", { getGLSL: function() { return "ivec3" } }), INT_VECTOR4: new e(35669, "INT_VECTOR4", { getGLSL: function() { return "ivec4" } }), BOOL: new e(35670, "BOOL", { getGLSL: function() { return "bool" } }), BOOL_VECTOR2: new e(35671, "BOOL_VECTOR2", { getGLSL: function() { return "bvec2" } }), BOOL_VECTOR3: new e(35672, "BOOL_VECTOR3", { getGLSL: function() { return "bvec3" } }), BOOL_VECTOR4: new e(35673, "BOOL_VECTOR4", { getGLSL: function() { return "bvec4" } }), FLOAT_MATRIX2: new e(35674, "FLOAT_MATRIX2", { getGLSL: function() { return "mat2" } }), FLOAT_MATRIX3: new e(35675, "FLOAT_MATRIX3", { getGLSL: function() { return "mat3" } }), FLOAT_MATRIX4: new e(35676, "FLOAT_MATRIX4", { getGLSL: function() { return "mat4" } }), SAMPLER_2D: new e(35678, "SAMPLER_2D", { getGLSL: function() { return "sampler2D" } }), SAMPLER_CUBE: new e(35680, "SAMPLER_CUBE", { getGLSL: function() { return "samplerCube" } }) }; return t }), r("Shaders/Builtin/Structs", [], function() { "use strict"; return "struct czm_materialInput\n{\nfloat s;\nvec2 st;\nvec3 str;\nvec3 normalEC;\nmat3 tangentToEyeMatrix;\nvec3 positionToEyeEC;\n};\nstruct czm_material\n{\nvec3 diffuse;\nfloat specular;\nfloat shininess;\nvec3 normal;\nvec3 emission;\nfloat alpha;\n};\nstruct czm_ray\n{\nvec3 origin;\nvec3 direction;\n};\nstruct czm_raySegment\n{\nfloat start;\nfloat stop;\n};\nconst czm_raySegment czm_emptyRaySegment = czm_raySegment(-czm_infinity, -czm_infinity);\nconst czm_raySegment czm_fullRaySegment = czm_raySegment(0.0, czm_infinity);\nstruct czm_ellipsoid\n{\nvec3 center;\nvec3 radii;\nvec3 inverseRadii;\nvec3 inverseRadiiSquared;\n};\n" }), r("Shaders/Builtin/Constants", [], function() { "use strict"; return "const float czm_pi = 3.141592653589793;\nconst float czm_oneOverPi = 0.3183098861837907;\nconst float czm_piOverTwo = 1.5707963267948966;\nconst float czm_piOverThree = 1.0471975511965976;\nconst float czm_piOverFour = 0.7853981633974483;\nconst float czm_piOverSix = 0.5235987755982988;\nconst float czm_threePiOver2 = 4.71238898038469;\nconst float czm_twoPi = 6.283185307179586;\nconst float czm_oneOverTwoPi = 0.15915494309189535;\nconst float czm_radiansPerDegree = 0.017453292519943295;\nconst float czm_degreesPerRadian = 57.29577951308232;\nconst float czm_solarRadius = 699500000.0;\nconst float czm_infinity = 5906376272000.0;\nconst float czm_epsilon1 = 0.1;\nconst float czm_epsilon2 = 0.01;\nconst float czm_epsilon3 = 0.001;\nconst float czm_epsilon4 = 0.0001;\nconst float czm_epsilon5 = 0.00001;\nconst float czm_epsilon6 = 0.000001;\nconst float czm_epsilon7 = 0.0000001;\nconst float czm_webMercatorMaxLatitude = 1.4844222297453324;\nconst float czm_sceneMode2D = 0.0;\nconst float czm_sceneModeColumbusView = 1.0;\nconst float czm_sceneMode3D = 2.0;\nconst float czm_sceneModeMorphing = 3.0;\n" }), r("Shaders/Builtin/Functions/RGBToXYZ", [], function() { "use strict"; return "vec3 czm_RGBToXYZ(vec3 rgb)\n{\nconst mat3 RGB2XYZ = mat3(0.4124, 0.2126, 0.0193,\n0.3576, 0.7152, 0.1192,\n0.1805, 0.0722, 0.9505);\nvec3 xyz = RGB2XYZ * rgb;\nvec3 Yxy;\nYxy.r = xyz.g;\nfloat temp = dot(vec3(1.0), xyz);\nYxy.gb = xyz.rg / temp;\nreturn Yxy;\n}\n" }), r("Shaders/Builtin/Functions/XYZToRGB", [], function() { "use strict"; return "vec3 czm_XYZToRGB(vec3 Yxy)\n{\nconst mat3 XYZ2RGB = mat3( 3.2405, -0.9693, 0.0556,\n-1.5371, 1.8760, -0.2040,\n-0.4985, 0.0416, 1.0572);\nvec3 xyz;\nxyz.r = Yxy.r * Yxy.g / Yxy.b;\nxyz.g = Yxy.r;\nxyz.b = Yxy.r * (1.0 - Yxy.g - Yxy.b) / Yxy.b;\nreturn XYZ2RGB * xyz;\n}\n" }), r("Shaders/Builtin/Functions/antialias", [], function() { "use strict"; return "vec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist, float fuzzFactor)\n{\nfloat val1 = clamp(dist / fuzzFactor, 0.0, 1.0);\nfloat val2 = clamp((dist - 0.5) / fuzzFactor, 0.0, 1.0);\nval1 = val1 * (1.0 - val2);\nval1 = val1 * val1 * (3.0 - (2.0 * val1));\nval1 = pow(val1, 0.5);\nvec4 midColor = (color1 + color2) * 0.5;\nreturn mix(midColor, currentColor, val1);\n}\nvec4 czm_antialias(vec4 color1, vec4 color2, vec4 currentColor, float dist)\n{\nreturn czm_antialias(color1, color2, currentColor, dist, 0.1);\n}\n" }), r("Shaders/Builtin/Functions/cellular", [], function() { "use strict"; return "vec3 _czm_permute289(vec3 x)\n{\nreturn mod((34.0 * x + 1.0) * x, 289.0);\n}\nvec2 czm_cellular(vec2 P)\n{\n#define K 0.142857142857\n#define Ko 0.428571428571\n#define jitter 1.0\nvec2 Pi = mod(floor(P), 289.0);\nvec2 Pf = fract(P);\nvec3 oi = vec3(-1.0, 0.0, 1.0);\nvec3 of = vec3(-0.5, 0.5, 1.5);\nvec3 px = _czm_permute289(Pi.x + oi);\nvec3 p = _czm_permute289(px.x + Pi.y + oi);\nvec3 ox = fract(p*K) - Ko;\nvec3 oy = mod(floor(p*K),7.0)*K - Ko;\nvec3 dx = Pf.x + 0.5 + jitter*ox;\nvec3 dy = Pf.y - of + jitter*oy;\nvec3 d1 = dx * dx + dy * dy;\np = _czm_permute289(px.y + Pi.y + oi);\nox = fract(p*K) - Ko;\noy = mod(floor(p*K),7.0)*K - Ko;\ndx = Pf.x - 0.5 + jitter*ox;\ndy = Pf.y - of + jitter*oy;\nvec3 d2 = dx * dx + dy * dy;\np = _czm_permute289(px.z + Pi.y + oi);\nox = fract(p*K) - Ko;\noy = mod(floor(p*K),7.0)*K - Ko;\ndx = Pf.x - 1.5 + jitter*ox;\ndy = Pf.y - of + jitter*oy;\nvec3 d3 = dx * dx + dy * dy;\nvec3 d1a = min(d1, d2);\nd2 = max(d1, d2);\nd2 = min(d2, d3);\nd1 = min(d1a, d2);\nd2 = max(d1a, d2);\nd1.xy = (d1.x < d1.y) ? d1.xy : d1.yx;\nd1.xz = (d1.x < d1.z) ? d1.xz : d1.zx;\nd1.yz = min(d1.yz, d2.yz);\nd1.y = min(d1.y, d1.z);\nd1.y = min(d1.y, d2.x);\nreturn sqrt(d1.xy);\n}\n" }), r("Shaders/Builtin/Functions/columbusViewMorph", [], function() { "use strict"; return "vec4 czm_columbusViewMorph(vec4 position2D, vec4 position3D, float time)\n{\nvec3 p = mix(position2D.xyz, position3D.xyz, time);\nreturn vec4(p, 1.0);\n}\n" }), r("Shaders/Builtin/Functions/computePosition", [], function() { "use strict"; return "vec4 czm_computePosition();\n" }), r("Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates", [], function() { "use strict"; return "mat3 czm_eastNorthUpToEyeCoordinates(vec3 positionMC, vec3 normalEC)\n{\nvec3 tangentMC = normalize(vec3(-positionMC.y, positionMC.x, 0.0));\nvec3 tangentEC = normalize(czm_normal3D * tangentMC);\nvec3 bitangentEC = normalize(cross(normalEC, tangentEC));\nreturn mat3(\ntangentEC.x, tangentEC.y, tangentEC.z,\nbitangentEC.x, bitangentEC.y, bitangentEC.z,\nnormalEC.x, normalEC.y, normalEC.z);\n}\n" }), r("Shaders/Builtin/Functions/ellipsoidContainsPoint", [], function() { "use strict"; return "bool czm_ellipsoidContainsPoint(czm_ellipsoid ellipsoid, vec3 point)\n{\nvec3 scaled = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(point, 1.0)).xyz;\nreturn (dot(scaled, scaled) <= 1.0);\n}\n" }), r("Shaders/Builtin/Functions/ellipsoidNew", [], function() { "use strict"; return "czm_ellipsoid czm_ellipsoidNew(vec3 center, vec3 radii)\n{\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(center, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n" }), r("Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates", [], function() { "use strict"; return "vec2 czm_ellipsoidWgs84TextureCoordinates(vec3 normal)\n{\nreturn vec2(atan(normal.y, normal.x) * czm_oneOverTwoPi + 0.5, asin(normal.z) * czm_oneOverPi + 0.5);\n}\n" }), r("Shaders/Builtin/Functions/equalsEpsilon", [], function() { "use strict"; return "bool czm_equalsEpsilon(vec4 left, vec4 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec4(epsilon)));\n}\nbool czm_equalsEpsilon(vec3 left, vec3 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec3(epsilon)));\n}\nbool czm_equalsEpsilon(vec2 left, vec2 right, float epsilon) {\nreturn all(lessThanEqual(abs(left - right), vec2(epsilon)));\n}\nbool czm_equalsEpsilon(float left, float right, float epsilon) {\nreturn (abs(left - right) <= epsilon);\n}\n" }), r("Shaders/Builtin/Functions/eyeOffset", [], function() { "use strict"; return "vec4 czm_eyeOffset(vec4 positionEC, vec3 eyeOffset)\n{\nvec4 p = positionEC;\nvec4 zEyeOffset = normalize(p) * eyeOffset.z;\np.xy += eyeOffset.xy + zEyeOffset.xy;\np.z += zEyeOffset.z;\nreturn p;\n}\n" }), r("Shaders/Builtin/Functions/eyeToWindowCoordinates", [], function() { "use strict"; return "vec4 czm_eyeToWindowCoordinates(vec4 positionEC)\n{\nvec4 q = czm_projection * positionEC;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n" }), r("Shaders/Builtin/Functions/geodeticSurfaceNormal", [], function() { "use strict"; return "vec3 czm_geodeticSurfaceNormal(vec3 positionOnEllipsoid, vec3 ellipsoidCenter, vec3 oneOverEllipsoidRadiiSquared)\n{\nreturn normalize((positionOnEllipsoid - ellipsoidCenter) * oneOverEllipsoidRadiiSquared);\n}\n" }), r("Shaders/Builtin/Functions/getDefaultMaterial", [], function() { "use strict"; return "czm_material czm_getDefaultMaterial(czm_materialInput materialInput)\n{\nczm_material material;\nmaterial.diffuse = vec3(0.0);\nmaterial.specular = 0.0;\nmaterial.shininess = 1.0;\nmaterial.normal = materialInput.normalEC;\nmaterial.emission = vec3(0.0);\nmaterial.alpha = 1.0;\nreturn material;\n}\n" }), r("Shaders/Builtin/Functions/getWaterNoise", [], function() { "use strict"; return "vec4 czm_getWaterNoise(sampler2D normalMap, vec2 uv, float time, float angleInRadians)\n{\nfloat cosAngle = cos(angleInRadians);\nfloat sinAngle = sin(angleInRadians);\nvec2 s0 = vec2(1.0/17.0, 0.0);\nvec2 s1 = vec2(-1.0/29.0, 0.0);\nvec2 s2 = vec2(1.0/101.0, 1.0/59.0);\nvec2 s3 = vec2(-1.0/109.0, -1.0/57.0);\ns0 = vec2((cosAngle * s0.x) - (sinAngle * s0.y), (sinAngle * s0.x) + (cosAngle * s0.y));\ns1 = vec2((cosAngle * s1.x) - (sinAngle * s1.y), (sinAngle * s1.x) + (cosAngle * s1.y));\ns2 = vec2((cosAngle * s2.x) - (sinAngle * s2.y), (sinAngle * s2.x) + (cosAngle * s2.y));\ns3 = vec2((cosAngle * s3.x) - (sinAngle * s3.y), (sinAngle * s3.x) + (cosAngle * s3.y));\nvec2 uv0 = (uv/103.0) + (time * s0);\nvec2 uv1 = uv/107.0 + (time * s1) + vec2(0.23);\nvec2 uv2 = uv/vec2(897.0, 983.0) + (time * s2) + vec2(0.51);\nvec2 uv3 = uv/vec2(991.0, 877.0) + (time * s3) + vec2(0.71);\nuv0 = fract(uv0);\nuv1 = fract(uv1);\nuv2 = fract(uv2);\nuv3 = fract(uv3);\nvec4 noise = (texture2D(normalMap, uv0)) +\n(texture2D(normalMap, uv1)) +\n(texture2D(normalMap, uv2)) +\n(texture2D(normalMap, uv3));\nreturn ((noise / 4.0) - 0.5) * 2.0;\n}\n" }), r("Shaders/Builtin/Functions/getWgs84EllipsoidEC", [], function() { "use strict"; return "czm_ellipsoid czm_getWgs84EllipsoidEC()\n{\nvec3 radii = vec3(6378137.0, 6378137.0, 6356752.314245);\nvec3 inverseRadii = vec3(1.0 / radii.x, 1.0 / radii.y, 1.0 / radii.z);\nvec3 inverseRadiiSquared = inverseRadii * inverseRadii;\nczm_ellipsoid temp = czm_ellipsoid(czm_view[3].xyz, radii, inverseRadii, inverseRadiiSquared);\nreturn temp;\n}\n" }), r("Shaders/Builtin/Functions/hue", [], function() { "use strict"; return "vec3 czm_hue(vec3 rgb, float adjustment)\n{\nconst mat3 toYIQ = mat3(0.299, 0.587, 0.114,\n0.595716, -0.274453, -0.321263,\n0.211456, -0.522591, 0.311135);\nconst mat3 toRGB = mat3(1.0, 0.9563, 0.6210,\n1.0, -0.2721, -0.6474,\n1.0, -1.107, 1.7046);\nvec3 yiq = toYIQ * rgb;\nfloat hue = atan(yiq.z, yiq.y) + adjustment;\nfloat chroma = sqrt(yiq.z * yiq.z + yiq.y * yiq.y);\nvec3 color = vec3(yiq.x, chroma * cos(hue), chroma * sin(hue));\nreturn toRGB * color;\n}\n" }), r("Shaders/Builtin/Functions/isEmpty", [], function() { "use strict"; return "bool czm_isEmpty(czm_raySegment interval)\n{\nreturn (interval.stop < 0.0);\n}\n" }), r("Shaders/Builtin/Functions/isFull", [], function() { "use strict"; return "bool czm_isFull(czm_raySegment interval)\n{\nreturn (interval.start == 0.0 && interval.stop == czm_infinity);\n}\n" }), r("Shaders/Builtin/Functions/latitudeToWebMercatorFraction", [], function() { "use strict"; return "float czm_latitudeToWebMercatorFraction(float latitude, float southMercatorYLow, float southMercatorYHigh, float oneOverMercatorHeight)\n{\nfloat sinLatitude = sin(latitude);\nfloat mercatorY = 0.5 * log((1.0 + sinLatitude) / (1.0 - sinLatitude));\nfloat t1 = 0.0 - southMercatorYLow;\nfloat e = t1 - 0.0;\nfloat t2 = ((-southMercatorYLow - e) + (0.0 - (t1 - e))) + mercatorY - southMercatorYHigh;\nfloat highDifference = t1 + t2;\nfloat lowDifference = t2 - (highDifference - t1);\nreturn highDifference * oneOverMercatorHeight + lowDifference * oneOverMercatorHeight;\n}\n" }), r("Shaders/Builtin/Functions/luminance", [], function() { "use strict"; return "float czm_luminance(vec3 rgb)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nreturn dot(rgb, W);\n}\n" }), r("Shaders/Builtin/Functions/modelToWindowCoordinates", [], function() { "use strict"; return "vec4 czm_modelToWindowCoordinates(vec4 position)\n{\nvec4 q = czm_modelViewProjection * position;\nq.xyz /= q.w;\nq.xyz = (czm_viewportTransformation * vec4(q.xyz, 1.0)).xyz;\nreturn q;\n}\n" }), r("Shaders/Builtin/Functions/multiplyWithColorBalance", [], function() { "use strict"; return "vec3 czm_multiplyWithColorBalance(vec3 left, vec3 right)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 target = left * right;\nfloat leftLuminance = dot(left, W);\nfloat rightLuminance = dot(right, W);\nfloat targetLuminance = dot(target, W);\nreturn ((leftLuminance + rightLuminance) / (2.0 * targetLuminance)) * target;\n}\n" }), r("Shaders/Builtin/Functions/phong", [], function() { "use strict"; return "float getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n{\nreturn max(dot(lightDirectionEC, normalEC), 0.0);\n}\nfloat getLambertDiffuseOfMaterial(vec3 lightDirectionEC, czm_material material)\n{\nreturn getLambertDiffuse(lightDirectionEC, material.normal);\n}\nfloat getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\nvec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\nfloat specular = max(dot(toReflectedLight, toEyeEC), 0.0);\nreturn pow(specular, shininess);\n}\nfloat getSpecularOfMaterial(vec3 lightDirectionEC, vec3 toEyeEC, czm_material material)\n{\nreturn getSpecular(lightDirectionEC, toEyeEC, material.normal, material.shininess);\n}\nvec4 czm_phong(vec3 toEye, czm_material material)\n{\nfloat diffuse = getLambertDiffuseOfMaterial(vec3(0.0, 0.0, 1.0), material) + getLambertDiffuseOfMaterial(vec3(0.0, 1.0, 0.0), material);\nfloat specular = getSpecularOfMaterial(czm_sunDirectionEC, toEye, material) + getSpecularOfMaterial(czm_moonDirectionEC, toEye, material);\nvec3 ambient = vec3(0.0);\nvec3 color = ambient + material.emission;\ncolor += material.diffuse * diffuse;\ncolor += material.specular * specular;\nreturn vec4(color, material.alpha);\n}\n" }), r("Shaders/Builtin/Functions/pointAlongRay", [], function() { "use strict"; return "vec3 czm_pointAlongRay(czm_ray ray, float time)\n{\nreturn ray.origin + (time * ray.direction);\n}\n" }), r("Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval", [], function() { "use strict"; return "czm_raySegment czm_rayEllipsoidIntersectionInterval(czm_ray ray, czm_ellipsoid ellipsoid)\n{\nvec3 q = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.origin, 1.0)).xyz;\nvec3 w = ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ray.direction, 0.0)).xyz;\nq = q - ellipsoid.inverseRadii * (czm_inverseModelView * vec4(ellipsoid.center, 1.0)).xyz;\nfloat q2 = dot(q, q);\nfloat qw = dot(q, w);\nif (q2 > 1.0)\n{\nif (qw >= 0.0)\n{\nreturn czm_emptyRaySegment;\n}\nelse\n{\nfloat qw2 = qw * qw;\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nif (qw2 < product)\n{\nreturn czm_emptyRaySegment;\n}\nelse if (qw2 > product)\n{\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nfloat root0 = temp / w2;\nfloat root1 = difference / temp;\nif (root0 < root1)\n{\nczm_raySegment i = czm_raySegment(root0, root1);\nreturn i;\n}\nelse\n{\nczm_raySegment i = czm_raySegment(root1, root0);\nreturn i;\n}\n}\nelse\n{\nfloat root = sqrt(difference / w2);\nczm_raySegment i = czm_raySegment(root, root);\nreturn i;\n}\n}\n}\nelse if (q2 < 1.0)\n{\nfloat difference = q2 - 1.0;\nfloat w2 = dot(w, w);\nfloat product = w2 * difference;\nfloat discriminant = qw * qw - product;\nfloat temp = -qw + sqrt(discriminant);\nczm_raySegment i = czm_raySegment(0.0, temp / w2);\nreturn i;\n}\nelse\n{\nif (qw < 0.0)\n{\nfloat w2 = dot(w, w);\nczm_raySegment i = czm_raySegment(0.0, -qw / w2);\nreturn i;\n}\nelse\n{\nreturn czm_emptyRaySegment;\n}\n}\n}\n" }), r("Shaders/Builtin/Functions/saturation", [], function() { "use strict"; return "vec3 czm_saturation(vec3 rgb, float adjustment)\n{\nconst vec3 W = vec3(0.2125, 0.7154, 0.0721);\nvec3 intensity = vec3(dot(rgb, W));\nreturn mix(intensity, rgb, adjustment);\n}\n" }), r("Shaders/Builtin/Functions/snoise", [], function() { "use strict"; return "vec4 _czm_mod289(vec4 x)\n{\nreturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec3 _czm_mod289(vec3 x)\n{\nreturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec2 _czm_mod289(vec2 x)\n{\nreturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nfloat _czm_mod289(float x)\n{\nreturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 _czm_permute(vec4 x)\n{\nreturn _czm_mod289(((x*34.0)+1.0)*x);\n}\nvec3 _czm_permute(vec3 x)\n{\nreturn _czm_mod289(((x*34.0)+1.0)*x);\n}\nfloat _czm_permute(float x)\n{\nreturn _czm_mod289(((x*34.0)+1.0)*x);\n}\nvec4 _czm_taylorInvSqrt(vec4 r)\n{\nreturn 1.79284291400159 - 0.85373472095314 * r;\n}\nfloat _czm_taylorInvSqrt(float r)\n{\nreturn 1.79284291400159 - 0.85373472095314 * r;\n}\nvec4 _czm_grad4(float j, vec4 ip)\n{\nconst vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\nvec4 p,s;\np.xyz = floor( fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\np.w = 1.5 - dot(abs(p.xyz), ones.xyz);\ns = vec4(lessThan(p, vec4(0.0)));\np.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\nreturn p;\n}\nfloat czm_snoise(vec2 v)\n{\nconst vec4 C = vec4(0.211324865405187,\n0.366025403784439,\n-0.577350269189626,\n0.024390243902439);\nvec2 i = floor(v + dot(v, C.yy) );\nvec2 x0 = v - i + dot(i, C.xx);\nvec2 i1;\ni1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\nvec4 x12 = x0.xyxy + C.xxzz;\nx12.xy -= i1;\ni = _czm_mod289(i);\nvec3 p = _czm_permute( _czm_permute( i.y + vec3(0.0, i1.y, 1.0 )) + i.x + vec3(0.0, i1.x, 1.0 ));\nvec3 m = max(0.5 - vec3(dot(x0,x0), dot(x12.xy,x12.xy), dot(x12.zw,x12.zw)), 0.0);\nm = m*m ;\nm = m*m ;\nvec3 x = 2.0 * fract(p * C.www) - 1.0;\nvec3 h = abs(x) - 0.5;\nvec3 ox = floor(x + 0.5);\nvec3 a0 = x - ox;\nm *= 1.79284291400159 - 0.85373472095314 * ( a0*a0 + h*h );\nvec3 g;\ng.x = a0.x * x0.x + h.x * x0.y;\ng.yz = a0.yz * x12.xz + h.yz * x12.yw;\nreturn 130.0 * dot(m, g);\n}\nfloat czm_snoise(vec3 v)\n{\nconst vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\nconst vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\nvec3 i = floor(v + dot(v, C.yyy) );\nvec3 x0 = v - i + dot(i, C.xxx) ;\nvec3 g = step(x0.yzx, x0.xyz);\nvec3 l = 1.0 - g;\nvec3 i1 = min( g.xyz, l.zxy );\nvec3 i2 = max( g.xyz, l.zxy );\nvec3 x1 = x0 - i1 + C.xxx;\nvec3 x2 = x0 - i2 + C.yyy;\nvec3 x3 = x0 - D.yyy;\ni = _czm_mod289(i);\nvec4 p = _czm_permute( _czm_permute( _czm_permute(\ni.z + vec4(0.0, i1.z, i2.z, 1.0 ))\n+ i.y + vec4(0.0, i1.y, i2.y, 1.0 ))\n+ i.x + vec4(0.0, i1.x, i2.x, 1.0 ));\nfloat n_ = 0.142857142857;\nvec3 ns = n_ * D.wyz - D.xzx;\nvec4 j = p - 49.0 * floor(p * ns.z * ns.z);\nvec4 x_ = floor(j * ns.z);\nvec4 y_ = floor(j - 7.0 * x_ );\nvec4 x = x_ *ns.x + ns.yyyy;\nvec4 y = y_ *ns.x + ns.yyyy;\nvec4 h = 1.0 - abs(x) - abs(y);\nvec4 b0 = vec4( x.xy, y.xy );\nvec4 b1 = vec4( x.zw, y.zw );\nvec4 s0 = floor(b0)*2.0 + 1.0;\nvec4 s1 = floor(b1)*2.0 + 1.0;\nvec4 sh = -step(h, vec4(0.0));\nvec4 a0 = b0.xzyw + s0.xzyw*sh.xxyy ;\nvec4 a1 = b1.xzyw + s1.xzyw*sh.zzww ;\nvec3 p0 = vec3(a0.xy,h.x);\nvec3 p1 = vec3(a0.zw,h.y);\nvec3 p2 = vec3(a1.xy,h.z);\nvec3 p3 = vec3(a1.zw,h.w);\nvec4 norm = _czm_taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\np0 *= norm.x;\np1 *= norm.y;\np2 *= norm.z;\np3 *= norm.w;\nvec4 m = max(0.6 - vec4(dot(x0,x0), dot(x1,x1), dot(x2,x2), dot(x3,x3)), 0.0);\nm = m * m;\nreturn 42.0 * dot( m*m, vec4( dot(p0,x0), dot(p1,x1),\ndot(p2,x2), dot(p3,x3) ) );\n}\nfloat czm_snoise(vec4 v)\n{\nconst vec4 C = vec4( 0.138196601125011,\n0.276393202250021,\n0.414589803375032,\n-0.447213595499958);\n#define F4 0.309016994374947451\nvec4 i = floor(v + dot(v, vec4(F4)) );\nvec4 x0 = v - i + dot(i, C.xxxx);\nvec4 i0;\nvec3 isX = step( x0.yzw, x0.xxx );\nvec3 isYZ = step( x0.zww, x0.yyz );\ni0.x = isX.x + isX.y + isX.z;\ni0.yzw = 1.0 - isX;\ni0.y += isYZ.x + isYZ.y;\ni0.zw += 1.0 - isYZ.xy;\ni0.z += isYZ.z;\ni0.w += 1.0 - isYZ.z;\nvec4 i3 = clamp( i0, 0.0, 1.0 );\nvec4 i2 = clamp( i0-1.0, 0.0, 1.0 );\nvec4 i1 = clamp( i0-2.0, 0.0, 1.0 );\nvec4 x1 = x0 - i1 + C.xxxx;\nvec4 x2 = x0 - i2 + C.yyyy;\nvec4 x3 = x0 - i3 + C.zzzz;\nvec4 x4 = x0 + C.wwww;\ni = _czm_mod289(i);\nfloat j0 = _czm_permute( _czm_permute( _czm_permute( _czm_permute(i.w) + i.z) + i.y) + i.x);\nvec4 j1 = _czm_permute( _czm_permute( _czm_permute( _czm_permute (\ni.w + vec4(i1.w, i2.w, i3.w, 1.0 ))\n+ i.z + vec4(i1.z, i2.z, i3.z, 1.0 ))\n+ i.y + vec4(i1.y, i2.y, i3.y, 1.0 ))\n+ i.x + vec4(i1.x, i2.x, i3.x, 1.0 ));\nvec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\nvec4 p0 = _czm_grad4(j0, ip);\nvec4 p1 = _czm_grad4(j1.x, ip);\nvec4 p2 = _czm_grad4(j1.y, ip);\nvec4 p3 = _czm_grad4(j1.z, ip);\nvec4 p4 = _czm_grad4(j1.w, ip);\nvec4 norm = _czm_taylorInvSqrt(vec4(dot(p0,p0), dot(p1,p1), dot(p2, p2), dot(p3,p3)));\np0 *= norm.x;\np1 *= norm.y;\np2 *= norm.z;\np3 *= norm.w;\np4 *= _czm_taylorInvSqrt(dot(p4,p4));\nvec3 m0 = max(0.6 - vec3(dot(x0,x0), dot(x1,x1), dot(x2,x2)), 0.0);\nvec2 m1 = max(0.6 - vec2(dot(x3,x3), dot(x4,x4) ), 0.0);\nm0 = m0 * m0;\nm1 = m1 * m1;\nreturn 49.0 * ( dot(m0*m0, vec3( dot( p0, x0 ), dot( p1, x1 ), dot( p2, x2 )))\n+ dot(m1*m1, vec2( dot( p3, x3 ), dot( p4, x4 ) ) ) ) ;\n}\n" }), r("Shaders/Builtin/Functions/tangentToEyeSpaceMatrix", [], function() { "use strict"; return "mat3 czm_tangentToEyeSpaceMatrix(vec3 normalEC, vec3 tangentEC, vec3 binormalEC)\n{\nvec3 normal = normalize(normalEC);\nvec3 tangent = normalize(tangentEC);\nvec3 binormal = normalize(binormalEC);\nreturn mat3(tangent.x, tangent.y, tangent.z,\nbinormal.x, binormal.y, binormal.z,\nnormal.x, normal.y, normal.z);\n}\n" }), r("Shaders/Builtin/Functions/translateRelativeToEye", [], function() { "use strict"; return "vec4 czm_translateRelativeToEye(vec3 high, vec3 low)\n{\nvec3 highDifference = high - czm_encodedCameraPositionMCHigh;\nvec3 lowDifference = low - czm_encodedCameraPositionMCLow;\nreturn vec4(highDifference + lowDifference, 1.0);\n}\n" }), r("Shaders/Builtin/Functions/transpose", [], function() { "use strict"; return "mat2 czm_transpose(mat2 matrix)\n{\nreturn mat2(\nmatrix[0][0], matrix[1][0],\nmatrix[0][1], matrix[1][1]);\n}\nmat3 czm_transpose(mat3 matrix)\n{\nreturn mat3(\nmatrix[0][0], matrix[1][0], matrix[2][0],\nmatrix[0][1], matrix[1][1], matrix[2][1],\nmatrix[0][2], matrix[1][2], matrix[2][2]);\n}\nmat4 czm_transpose(mat4 matrix)\n{\nreturn mat4(\nmatrix[0][0], matrix[1][0], matrix[2][0], matrix[3][0],\nmatrix[0][1], matrix[1][1], matrix[2][1], matrix[3][1],\nmatrix[0][2], matrix[1][2], matrix[2][2], matrix[3][2],\nmatrix[0][3], matrix[1][3], matrix[2][3], matrix[3][3]);\n}\n" }), r("Shaders/Builtin/Functions/windowToEyeCoordinates", [], function() { "use strict"; return "vec4 czm_windowToEyeCoordinates(vec4 fragmentCoordinate)\n{\nfloat x = 2.0 * (fragmentCoordinate.x - czm_viewport.x) / czm_viewport.z - 1.0;\nfloat y = 2.0 * (fragmentCoordinate.y - czm_viewport.y) / czm_viewport.w - 1.0;\nfloat z = (fragmentCoordinate.z - czm_viewportTransformation[3][2]) / czm_viewportTransformation[2][2];\nvec4 q = vec4(x, y, z, 1.0);\nq /= fragmentCoordinate.w;\nq = czm_inverseProjection * q;\nreturn q;\n}\n" }), r("Renderer/ShaderProgram", ["../Core/defined", "../Core/DeveloperError", "../Core/FeatureDetection", "../Core/RuntimeError", "../Core/destroyObject", "../Core/Matrix2", "../Core/Matrix3", "../Core/Matrix4", "./UniformDatatype", "../Shaders/Builtin/Structs", "../Shaders/Builtin/Constants", "../Shaders/Builtin/Functions/RGBToXYZ", "../Shaders/Builtin/Functions/XYZToRGB", "../Shaders/Builtin/Functions/antialias", "../Shaders/Builtin/Functions/cellular", "../Shaders/Builtin/Functions/columbusViewMorph", "../Shaders/Builtin/Functions/computePosition", "../Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates", "../Shaders/Builtin/Functions/ellipsoidContainsPoint", "../Shaders/Builtin/Functions/ellipsoidNew", "../Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates", "../Shaders/Builtin/Functions/equalsEpsilon", "../Shaders/Builtin/Functions/eyeOffset", "../Shaders/Builtin/Functions/eyeToWindowCoordinates", "../Shaders/Builtin/Functions/geodeticSurfaceNormal", "../Shaders/Builtin/Functions/getDefaultMaterial", "../Shaders/Builtin/Functions/getWaterNoise", "../Shaders/Builtin/Functions/getWgs84EllipsoidEC", "../Shaders/Builtin/Functions/hue", "../Shaders/Builtin/Functions/isEmpty", "../Shaders/Builtin/Functions/isFull", "../Shaders/Builtin/Functions/latitudeToWebMercatorFraction", "../Shaders/Builtin/Functions/luminance", "../Shaders/Builtin/Functions/modelToWindowCoordinates", "../Shaders/Builtin/Functions/multiplyWithColorBalance", "../Shaders/Builtin/Functions/phong", "../Shaders/Builtin/Functions/pointAlongRay", "../Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval", "../Shaders/Builtin/Functions/saturation", "../Shaders/Builtin/Functions/snoise", "../Shaders/Builtin/Functions/tangentToEyeSpaceMatrix", "../Shaders/Builtin/Functions/translateRelativeToEye", "../Shaders/Builtin/Functions/transpose", "../Shaders/Builtin/Functions/windowToEyeCoordinates"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C, x, S, E, b, T, A, M, P, D, I, O, R, L, z, N, F, B, V, q, k, U, W) {
"use strict";
function G(e, t) { switch (t) {
case e.FLOAT:
return function() { return l.FLOAT };
case e.FLOAT_VEC2:
return function() { return l.FLOAT_VECTOR2 };
case e.FLOAT_VEC3:
return function() { return l.FLOAT_VECTOR3 };
case e.FLOAT_VEC4:
return function() { return l.FLOAT_VECTOR4 };
case e.INT:
return function() { return l.INT };
case e.INT_VEC2:
return function() { return l.INT_VECTOR2 };
case e.INT_VEC3:
return function() { return l.INT_VECTOR3 };
case e.INT_VEC4:
return function() { return l.INT_VECTOR4 };
case e.BOOL:
return function() { return l.BOOL };
case e.BOOL_VEC2:
return function() { return l.BOOL_VECTOR2 };
case e.BOOL_VEC3:
return function() { return l.BOOL_VECTOR3 };
case e.BOOL_VEC4:
return function() { return l.BOOL_VECTOR4 };
case e.FLOAT_MAT2:
return function() { return l.FLOAT_MATRIX2 };
case e.FLOAT_MAT3:
return function() { return l.FLOAT_MATRIX3 };
case e.FLOAT_MAT4:
return function() { return l.FLOAT_MATRIX4 };
case e.SAMPLER_2D:
return function() { return l.SAMPLER_2D };
case e.SAMPLER_CUBE:
return function() { return l.SAMPLER_CUBE };
default:
throw new i("Unrecognized uniform type: " + t) } }
function H(e) { var t = e.indexOf("#version"); if (-1 !== t) { var r = e.indexOf("\n", t); if (-1 !== t) { var i = e.substring(t, r + 1),
n = e.substring(0, t) + "//" + e.substring(t); return { version: i, source: n } } } return { version: "", source: e } }
function j(e) { var t = "",
r = st; for (var i in r) r.hasOwnProperty(i) && -1 !== e.indexOf(i) && (t += r[i] + " \n"); return t }
function Y() { return "#ifdef GL_FRAGMENT_PRECISION_HIGH \n precision highp float; \n#else \n precision mediump float; \n#endif \n\n" }
function X(e, t) { var r = e[t],
i = "uniform " + r.getDatatype().getGLSL() + " " + t,
n = r.getSize(); return i += 1 === n ? ";" : "[" + n.toString() + "];" }
function Z(e) { var t = "",
r = it; for (var i in r) r.hasOwnProperty(i) && -1 !== e.indexOf(i) && (t += X(r, i) + " \n"); return t }
function K(t, r, n, o, a) { var s = H(n),
l = H(o),
h = j(s.source) + "\n#line 0\n" + s.source,
d = s.version + c + u + Z(h) + h,
m = j(l.source) + "\n#line 0\n" + l.source,
p = l.version + Y() + c + u + Z(m) + m,
f = t.createShader(t.VERTEX_SHADER);
t.shaderSource(f, d), t.compileShader(f); var v = t.getShaderInfoLog(f); if (r && v && v.length && console.log("[GL] Vertex shader compile log: " + v), !t.getShaderParameter(f, t.COMPILE_STATUS)) throw t.deleteShader(f), console.error("[GL] Vertex shader compile log: " + v), new i("Vertex shader failed to compile. Compile log: " + v); var y = t.createShader(t.FRAGMENT_SHADER);
t.shaderSource(y, p), t.compileShader(y); var g = t.getShaderInfoLog(y); if (r && g && g.length && console.log("[GL] Fragment shader compile log: " + g), !t.getShaderParameter(y, t.COMPILE_STATUS)) throw t.deleteShader(f), t.deleteShader(y), console.error("[GL] Fragment shader compile log: " + g), new i("Fragment shader failed to compile. Compile log: " + g); var _ = t.createProgram(); if (t.attachShader(_, f), t.attachShader(_, y), t.deleteShader(f), t.deleteShader(y), e(a))
for (var w in a) a.hasOwnProperty(w) && t.bindAttribLocation(_, a[w], w);
t.linkProgram(_); var C = t.getProgramInfoLog(_); if (r && C && C.length && console.log("[GL] Shader program link log: " + C), !t.getProgramParameter(_, t.LINK_STATUS)) throw t.deleteProgram(_), console.error("[GL] Shader program link log: " + C), new i("Program failed to link. Link log: " + C); return _ }
function J(e, t, r) { for (var i = {}, n = 0; r > n; ++n) { var o = e.getActiveAttrib(t, n),
a = e.getAttribLocation(t, o.name);
i[o.name] = { name: o.name, type: o.type, index: a } } return i }
function Q(e, t) { for (var r = {}, i = [], n = [], o = e.getProgramParameter(t, e.ACTIVE_UNIFORMS), a = 0; o > a; ++a) { var s = e.getActiveUniform(t, a),
l = "[0]",
u = -1 !== s.name.indexOf(l, s.name.length - l.length) ? s.name.slice(0, s.name.length - 3) : s.name; if (0 !== u.indexOf("gl_"))
if (s.name.indexOf("[") < 0) { var c = e.getUniformLocation(t, u),
h = e.getUniform(t, c),
d = new nt(e, s, u, c, h);
r[u] = d, d._setSampler ? n.push(d) : i.push(d) } else { var m, p, f, v, y = u.indexOf("["); if (y >= 0) { if (m = r[u.slice(0, y)], "undefined" == typeof m) continue;
p = m._getLocations(), p.length <= 1 && (f = m.value, v = e.getUniformLocation(t, u), p.push(v), f.push(e.getUniform(t, v))) } else { p = [], f = []; for (var g = 0; g < s.size; ++g) v = e.getUniformLocation(t, u + "[" + g + "]"), p.push(v), f.push(e.getUniform(t, v));
m = new ot(e, s, u, p, f), r[u] = m, m._setSampler ? n.push(m) : i.push(m) } } } return { allUniforms: r, uniforms: i, samplerUniforms: n } }
function $(e) { var t = [],
r = {}; for (var i in e)
if (e.hasOwnProperty(i)) { var n = it[i];
n ? t.push({ uniform: e[i], automaticUniform: n }) : r[i] = e[i] }
return { automaticUniforms: t, manualUniforms: r } }
var et, tt, rt, it = { czm_viewport: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_VECTOR4 }, getValue: function(e) { var t = e.getViewport(); return { x: t.x, y: t.y, z: t.width, w: t.height } } }, czm_viewportOrthographic: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getViewportOrthographic() } }, czm_viewportTransformation: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getViewportTransformation() } }, czm_model: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getModel() } }, czm_inverseModel: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getInverseModel() } }, czm_view: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getView() } }, czm_view3D: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getView3D() } }, czm_viewRotation: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX3 }, getValue: function(e) { return e.getViewRotation() } }, czm_viewRotation3D: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX3 }, getValue: function(e) { return e.getViewRotation3D() } }, czm_inverseView: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getInverseView() } }, czm_inverseView3D: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getInverseView3D() } }, czm_inverseViewRotation: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX3 }, getValue: function(e) { return e.getInverseViewRotation() } }, czm_inverseViewRotation3D: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX3 }, getValue: function(e) { return e.getInverseViewRotation3D() } }, czm_projection: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getProjection() } }, czm_inverseProjection: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getInverseProjection() } }, czm_infiniteProjection: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getInfiniteProjection() } }, czm_modelView: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getModelView() } }, czm_modelView3D: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getModelView3D() } }, czm_modelViewRelativeToEye: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getModelViewRelativeToEye() } }, czm_inverseModelView: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getInverseModelView() } }, czm_inverseModelView3D: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getInverseModelView3D() } }, czm_viewProjection: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getViewProjection() } }, czm_modelViewProjection: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getModelViewProjection() } }, czm_modelViewProjectionRelativeToEye: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getModelViewProjectionRelativeToEye() } }, czm_modelViewInfiniteProjection: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX4 }, getValue: function(e) { return e.getModelViewInfiniteProjection() } }, czm_normal: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX3 }, getValue: function(e) { return e.getNormal() } }, czm_normal3D: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX3 }, getValue: function(e) { return e.getNormal3D() } }, czm_inverseNormal: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX3 }, getValue: function(e) { return e.getInverseNormal() } }, czm_inverseNormal3D: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX3 }, getValue: function(e) { return e.getInverseNormal3D() } }, czm_entireFrustum: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_VECTOR2 }, getValue: function(e) { return e.getEntireFrustum() } }, czm_eyeHeight2D: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_VECTOR2 }, getValue: function(e) { return e.getEyeHeight2D() } }, czm_currentFrustum: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_VECTOR2 }, getValue: function(e) { return e.getCurrentFrustum() } }, czm_pixelSizeInMeters: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT }, getValue: function(e) { return e.getPixelSize() } }, czm_sunPositionWC: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_VECTOR3 }, getValue: function(e) { return e.getSunPositionWC() } }, czm_sunPositionColumbusView: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_VECTOR3 }, getValue: function(e) { return e.getSunPositionColumbusView() } }, czm_sunDirectionEC: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_VECTOR3 }, getValue: function(e) { return e.getSunDirectionEC() } }, czm_sunDirectionWC: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_VECTOR3 }, getValue: function(e) { return e.getSunDirectionWC() } }, czm_moonDirectionEC: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_VECTOR3 }, getValue: function(e) { return e.getMoonDirectionEC() } }, czm_encodedCameraPositionMCHigh: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_VECTOR3 }, getValue: function(e) { return e.getEncodedCameraPositionMCHigh() } }, czm_encodedCameraPositionMCLow: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_VECTOR3 }, getValue: function(e) { return e.getEncodedCameraPositionMCLow() } }, czm_viewerPositionWC: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_VECTOR3 }, getValue: function(e) { return e.getInverseView().getTranslation() } }, czm_frameNumber: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT }, getValue: function(e) { return e.getFrameState().frameNumber } }, czm_morphTime: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT }, getValue: function(e) { return e.getFrameState().morphTime } }, czm_sceneMode: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT }, getValue: function(e) { return e.getFrameState().mode.value } }, czm_temeToPseudoFixed: { getSize: function() { return 1 }, getDatatype: function() { return l.FLOAT_MATRIX3 }, getValue: function(e) { return e.getTemeToPseudoFixedMatrix() } } };
r.supportsTypedArrays() && (et = new Float32Array(4), tt = new Float32Array(9), rt = new Float32Array(16));
var nt = function(r, n, l, u, c) { this.value = c, this.getName = function() { return l }, this.getDatatype = G(r, n.type), this._getLocation = function() { return u }, this._set = function() { switch (n.type) {
case r.FLOAT:
return function() { r.uniform1f(u, this.value) };
case r.FLOAT_VEC2:
return function() { var e = this.value;
r.uniform2f(u, e.x, e.y) };
case r.FLOAT_VEC3:
return function() { var e = this.value;
r.uniform3f(u, e.x, e.y, e.z) };
case r.FLOAT_VEC4:
return function() { var i = this.value; if (e(i.red)) r.uniform4f(u, i.red, i.green, i.blue, i.alpha);
else { if (!e(i.x)) throw new t('Invalid vec4 value for uniform "' + n.name + '".');
r.uniform4f(u, i.x, i.y, i.z, i.w) } };
case r.SAMPLER_2D:
case r.SAMPLER_CUBE:
return void 0;
case r.INT:
case r.BOOL:
return function() { r.uniform1i(u, this.value) };
case r.INT_VEC2:
case r.BOOL_VEC2:
return function() { var e = this.value;
r.uniform2i(u, e.x, e.y) };
case r.INT_VEC3:
case r.BOOL_VEC3:
return function() { var e = this.value;
r.uniform3i(u, e.x, e.y, e.z) };
case r.INT_VEC4:
case r.BOOL_VEC4:
return function() { var e = this.value;
r.uniform4i(u, e.x, e.y, e.z, e.w) };
case r.FLOAT_MAT2:
return function() { r.uniformMatrix2fv(u, !1, o.toArray(this.value, et)) };
case r.FLOAT_MAT3:
return function() { r.uniformMatrix3fv(u, !1, a.toArray(this.value, tt)) };
case r.FLOAT_MAT4:
return function() { r.uniformMatrix4fv(u, !1, s.toArray(this.value, rt)) };
default:
throw new i("Unrecognized uniform type: " + n.type + ' for uniform "' + n.name + '".') } }(), (n.type === r.SAMPLER_2D || n.type === r.SAMPLER_CUBE) && (this._setSampler = function(e) { return r.activeTexture(r.TEXTURE0 + e), r.bindTexture(this.value._getTarget(), this.value._getTexture()), r.uniform1i(u, e), e + 1 }, this._clearSampler = function(e) { return r.activeTexture(r.TEXTURE0 + e), r.bindTexture(this.value._getTarget(), null), e + 1 }) },
ot = function(r, n, l, u, c) { this.value = c; var h = u;
this.getName = function() { return l }, this.getDatatype = G(r, n.type), this._getLocations = function() { return h }, this._set = function() { switch (n.type) {
case r.FLOAT:
return function() { for (var e = 0; e < h.length; ++e) r.uniform1f(h[e], this.value[e]) };
case r.FLOAT_VEC2:
return function() { for (var e = 0; e < h.length; ++e) { var t = this.value[e];
r.uniform2f(h[e], t.x, t.y) } };
case r.FLOAT_VEC3:
return function() { for (var e = 0; e < h.length; ++e) { var t = this.value[e];
r.uniform3f(h[e], t.x, t.y, t.z) } };
case r.FLOAT_VEC4:
return function() { for (var i = 0; i < h.length; ++i) { var n = this.value[i]; if (e(n.red)) r.uniform4f(h[i], n.red, n.green, n.blue, n.alpha);
else { if (!e(n.x)) throw new t("Invalid vec4 value.");
r.uniform4f(h[i], n.x, n.y, n.z, n.w) } } };
case r.SAMPLER_2D:
case r.SAMPLER_CUBE:
return void 0;
case r.INT:
case r.BOOL:
return function() { for (var e = 0; e < h.length; ++e) r.uniform1i(h[e], this.value[e]) };
case r.INT_VEC2:
case r.BOOL_VEC2:
return function() { for (var e = 0; e < h.length; ++e) { var t = this.value[e];
r.uniform2i(h[e], t.x, t.y) } };
case r.INT_VEC3:
case r.BOOL_VEC3:
return function() { for (var e = 0; e < h.length; ++e) { var t = this.value[e];
r.uniform3i(h[e], t.x, t.y, t.z) } };
case r.INT_VEC4:
case r.BOOL_VEC4:
return function() { for (var e = 0; e < h.length; ++e) { var t = this.value[e];
r.uniform4i(h[e], t.x, t.y, t.z, t.w) } };
case r.FLOAT_MAT2:
return function() { for (var e = 0; e < h.length; ++e) r.uniformMatrix2fv(h[e], !1, o.toArray(this.value[e], et)) };
case r.FLOAT_MAT3:
return function() { for (var e = 0; e < h.length; ++e) r.uniformMatrix3fv(h[e], !1, a.toArray(this.value[e], tt)) };
case r.FLOAT_MAT4:
return function() { for (var e = 0; e < h.length; ++e) r.uniformMatrix4fv(h[e], !1, s.toArray(this.value[e], rt)) };
default:
throw new i("Unrecognized uniform type: " + n.type) } }(), (n.type === r.SAMPLER_2D || n.type === r.SAMPLER_CUBE) && (this._setSampler = function(e) { for (var t = 0; t < h.length; ++t) { var i = this.value[t],
n = e + t;
r.activeTexture(r.TEXTURE0 + n), r.bindTexture(i._getTarget(), i._getTexture()), r.uniform1i(h[t], n) } return e + h.length }, this._clearSampler = function(e) { for (var t = 0; t < h.length; ++t) r.activeTexture(r.TEXTURE0 + e + t), r.bindTexture(this.value[t]._getTarget(), null); return e + h.length }) },
at = function(e, t, r, i, n) { var o = K(e, t, r, i, n),
a = e.getProgramParameter(o, e.ACTIVE_ATTRIBUTES),
s = Q(e, o),
l = $(s.allUniforms);
this._gl = e, this._program = o, this._numberOfVertexAttributes = a, this._vertexAttributes = J(e, o, a), this._allUniforms = s.allUniforms, this._uniforms = s.uniforms, this._samplerUniforms = s.samplerUniforms, this._automaticUniforms = l.automaticUniforms, this._manualUniforms = l.manualUniforms, this.vertexShaderSource = r, this.fragmentShaderSource = i },
st = { czm_RGBToXYZ: h, czm_XYZToRGB: d, czm_antialias: m, czm_cellular: p, czm_columbusViewMorph: f, czm_computePosition: v, czm_eastNorthUpToEyeCoordinates: y, czm_ellipsoidContainsPoint: g, czm_ellipsoidNew: _, czm_ellipsoidWgs84TextureCoordinates: w, czm_equalsEpsilon: C, czm_eyeOffset: x, czm_eyeToWindowCoordinates: S, czm_geodeticSurfaceNormal: E, czm_getDefaultMaterial: b, czm_getWaterNoise: T, czm_getWgs84EllipsoidEC: A, czm_hue: M, czm_isEmpty: P, czm_isFull: D, czm_latitudeToWebMercatorFraction: I, czm_luminance: O, czm_modelToWindowCoordinates: R, czm_multiplyWithColorBalance: L, czm_phong: z, czm_pointAlongRay: N, czm_rayEllipsoidIntersectionInterval: F, czm_saturation: B, czm_snoise: V, czm_tangentToEyeSpaceMatrix: q, czm_translateRelativeToEye: k, czm_transpose: U, czm_windowToEyeCoordinates: W };
return at.prototype.getVertexAttributes = function() { return this._vertexAttributes }, at.prototype.getNumberOfVertexAttributes = function() { return this._numberOfVertexAttributes }, at.prototype.getAllUniforms = function() { return this._allUniforms }, at.prototype.getManualUniforms = function() { return this._manualUniforms }, at.prototype._bind = function() { this._gl.useProgram(this._program) }, at.prototype._unBind = function() { this._gl.useProgram(null); for (var e = this._samplerUniforms, t = 0, r = e.length, i = 0; r > i; ++i) t = e[i]._clearSampler(t) }, at.prototype._setUniforms = function(e, r, i) { var n, o, a = this._uniforms,
s = this._samplerUniforms,
l = this._manualUniforms,
u = this._automaticUniforms; if (e)
for (var c in l) l.hasOwnProperty(c) && (l[c].value = e[c]()); for (n = u.length, o = 0; n > o; ++o) u[o].uniform.value = u[o].automaticUniform.getValue(r); for (n = a.length, o = 0; n > o; ++o) a[o]._set(); var h = 0; for (n = s.length, o = 0; n > o; ++o) h = s[o]._setSampler(h); if (i) { var d = this._gl,
m = this._program; if (d.validateProgram(m), !d.getProgramParameter(m, d.VALIDATE_STATUS)) throw new t("Program validation failed. Link log: " + d.getProgramInfoLog(m)) } }, at.prototype.isDestroyed = function() { return !1 }, at.prototype.destroy = function() { return this._gl.deleteProgram(this._program), n(this) }, at.prototype.release = function() { return this._cachedShader ? this._cachedShader.cache.releaseShaderProgram(this) : this.destroy() }, at
}), r("Renderer/TextureAtlas", ["../Core/BoundingRectangle", "../Core/Cartesian2", "../Core/createGuid", "../Core/defaultValue", "../Core/defined", "../Core/destroyObject", "../Core/DeveloperError", "./PixelFormat"], function(e, t, r, i, n, o, a, s) { "use strict";
function l(e, r, n, o, a) { this.bottomLeft = i(e, t.ZERO), this.topRight = i(r, t.ZERO), this.childNode1 = n, this.childNode2 = o, this.imageIndex = a }
function u(e, r) { var i = e.getNumberOfImages(),
o = 2; if (i > 0) { var a = e._texture.getWidth(),
s = e._texture.getHeight(),
u = o * (a + r.width + e._borderWidthInPixels),
c = o * (s + r.height + e._borderWidthInPixels),
h = a / u,
d = s / c,
m = new l(new t(a + e._borderWidthInPixels, 0), new t(u, s)),
p = new l(new t, new t(u, s), e._root, m),
f = new l(new t(0, s + e._borderWidthInPixels), new t(u, c)),
v = new l(new t, new t(u, c), p, f);
e._root = v; for (var y = 0; y < e._textureCoordinates.length; y++) { var g = e._textureCoordinates[y];
n(g) && (g.x *= h, g.y *= d, g.width *= h, g.height *= d) } var _ = e._context.createTexture2D({ width: u, height: c, pixelFormat: e._pixelFormat }),
w = e._context.createFramebuffer({ colorTexture: e._texture });
w._bind(), _.copyFromFramebuffer(0, 0, 0, 0, a, s), w._unBind(), w.destroy(), e._texture = _ } else { var C = o * (r.width + e._borderWidthInPixels),
x = o * (r.height + e._borderWidthInPixels);
e._texture = e._texture && e._texture.destroy(), e._texture = e._context.createTexture2D({ width: C, height: x, pixelFormat: e._pixelFormat }), e._root = new l(new t, new t(C, x)) } }
function c(e, r, i) { if (!n(r)) return void 0; if (!n(r.childNode1) && !n(r.childNode2)) { if (n(r.imageIndex)) return void 0; var o = r.topRight.x - r.bottomLeft.x,
a = r.topRight.y - r.bottomLeft.y,
s = o - i.width,
u = a - i.height; if (0 > s || 0 > u) return void 0; if (0 === s && 0 === u) return r; if (s > u) { r.childNode1 = new l(new t(r.bottomLeft.x, r.bottomLeft.y), new t(r.bottomLeft.x + i.width, r.topRight.y)); var h = r.bottomLeft.x + i.width + e._borderWidthInPixels;
h < r.topRight.x && (r.childNode2 = new l(new t(h, r.bottomLeft.y), new t(r.topRight.x, r.topRight.y))) } else { r.childNode1 = new l(new t(r.bottomLeft.x, r.bottomLeft.y), new t(r.topRight.x, r.bottomLeft.y + i.height)); var d = r.bottomLeft.y + i.height + e._borderWidthInPixels;
d < r.topRight.y && (r.childNode2 = new l(new t(r.bottomLeft.x, d), new t(r.topRight.x, r.topRight.y))) } return c(e, r.childNode1, i) } return c(e, r.childNode1, i) || c(e, r.childNode2, i) }
function h(t, r, i) { if (!n(r)) throw new a("image is required."); var o = c(t, t._root, r); if (n(o)) { o.imageIndex = i; var s = t._texture.getWidth(),
l = t._texture.getHeight(),
d = o.topRight.x - o.bottomLeft.x,
m = o.topRight.y - o.bottomLeft.y;
t._textureCoordinates[i] = new e(o.bottomLeft.x / s, o.bottomLeft.y / l, d / s, m / l), t._texture.copyFrom(r, o.bottomLeft.x, o.bottomLeft.y) } else u(t, r), h(t, r, i) } var d = new t(16, 16),
m = function(e) { e = i(e, i.EMPTY_OBJECT); var o = e.context; if (!n(o)) throw new a("context is required."); var u = i(e.borderWidthInPixels, 1); if (0 > u) throw new a("borderWidthInPixels must be greater than or equal to zero."); var c = i(e.initialSize, d); if (c.x < 1 || c.y < 1) throw new a("initialSize must be greater than zero.");
this._context = o, this._pixelFormat = i(e.pixelFormat, s.RGBA), this._borderWidthInPixels = u, this._textureCoordinates = [], this._guid = r(), this._texture = this._context.createTexture2D({ width: c.x, height: c.y, pixelFormat: this._pixelFormat }), this._root = new l(new t, new t(c.x, c.y)); var h = e.images;
n(h) && h.length > 0 && this.addImages(h); var m = e.image;
n(m) && this.addImage(m) }; return m.prototype.addImage = function(e) { var t = this.getNumberOfImages(); return h(this, e, t), this._guid = r(), t }, m.prototype.addImages = function(e) { if (!n(e) || e.length < 1) throw new a("images is required and must have length greater than zero."); var t, i = [],
o = e.length,
s = this.getNumberOfImages(); for (t = 0; o > t; ++t) i.push({ image: e[t], index: t + s }); for (i.sort(function(e, t) { return Math.max(t.image.height, t.image.width) - Math.max(e.image.height, e.image.width) }), t = 0; o > t; ++t) { var l = i[t];
h(this, l.image, l.index) } return this._guid = r(), s }, m.prototype.addSubRegions = function(t, i) { for (var n = this.addImage(t), o = this._texture.getWidth(), a = this._texture.getHeight(), s = this.getNumberOfImages(), l = i.length, u = this._textureCoordinates[n], c = 0; l > c; ++c) { var h = i[c];
this._textureCoordinates.push(new e(u.x + h.x / o, u.y + h.y / a, h.width / o, h.height / a)) } return this._guid = r(), s }, m.prototype.getBorderWidthInPixels = function() { return this._borderWidthInPixels }, m.prototype.getTextureCoordinates = function() { return this._textureCoordinates }, m.prototype.getTexture = function() { return this._texture }, m.prototype.getNumberOfImages = function() { return this._textureCoordinates.length }, m.prototype.getGUID = function() { return this._guid }, m.prototype.isDestroyed = function() { return !1 }, m.prototype.destroy = function() { return this._texture = this._texture && this._texture.destroy(), o(this) }, m }), r("Renderer/UniformState", ["../Core/Matrix3", "../Core/Matrix4", "../Core/Cartesian2", "../Core/Cartesian3", "../Core/Cartesian4", "../Core/Cartographic", "../Core/defined", "../Core/Math", "../Core/EncodedCartesian3", "../Core/BoundingRectangle", "../Core/Transforms", "../Core/Simon1994PlanetaryPositions", "../Scene/SceneMode"], function(e, t, r, i, n, o, a, s, l, u, c, h, d) {
"use strict";
function m(e, r) { t.clone(r, e._view), t.getRotation(r, e._viewRotation), e._view3DDirty = !0, e._inverseView3DDirty = !0, e._modelViewDirty = !0, e._modelView3DDirty = !0, e._modelViewRelativeToEyeDirty = !0, e._inverseModelViewDirty = !0, e._inverseModelView3DDirty = !0, e._viewProjectionDirty = !0, e._modelViewProjectionDirty = !0, e._modelViewProjectionRelativeToEyeDirty = !0, e._modelViewInfiniteProjectionDirty = !0, e._normalDirty = !0, e._inverseNormalDirty = !0, e._normal3DDirty = !0, e._inverseNormal3DDirty = !0 }
function p(e, r) { t.clone(r, e._inverseView), t.getRotation(r, e._inverseViewRotation) }
function f(e, r) { t.clone(r, e._projection), e._inverseProjectionDirty = !0, e._viewProjectionDirty = !0, e._modelViewProjectionDirty = !0, e._modelViewProjectionRelativeToEyeDirty = !0 }
function v(e, r) { t.clone(r, e._infiniteProjection), e._modelViewInfiniteProjectionDirty = !0 }
function y(e, t) { i.clone(t.getPositionWC(), e._cameraPosition), i.clone(t.getDirectionWC(), e._cameraDirection), i.clone(t.getRightWC(), e._cameraRight), i.clone(t.getUpWC(), e._cameraUp), e._encodedCameraPositionMCDirty = !0 }
function g(t, r) { a(c.computeIcrfToFixedMatrix(r.time, F)) || (F = c.computeTemeToPseudoFixedMatrix(r.time, F)); var n = h.ComputeSunPositionInEarthInertialFrame(r.time, t._sunPositionWC);
e.multiplyByVector(F, n, n), i.normalize(n, t._sunDirectionWC), n = e.multiplyByVector(t.getViewRotation3D(), n, t._sunDirectionEC), i.normalize(n, n), n = h.ComputeMoonPositionInEarthInertialFrame(r.time, t._moonDirectionEC), e.multiplyByVector(F, n, n), e.multiplyByVector(t.getViewRotation3D(), n, n), i.normalize(n, n); var o = r.scene2D.projection,
s = o.getEllipsoid(),
l = s.cartesianToCartographic(t._sunPositionWC, B);
o.project(l, t._sunPositionColumbusView) }
function _(e) { if (e._viewportDirty) { var r = e._viewport;
t.computeOrthographicOffCenter(r.x, r.x + r.width, r.y, r.y + r.height, 0, 1, e._viewportOrthographicMatrix), t.computeViewportTransformation(r, 0, 1, e._viewportTransformation), e._viewportDirty = !1 } }
function w(e) { e._inverseProjectionDirty && (e._inverseProjectionDirty = !1, t.inverse(e._projection, e._inverseProjection)) }
function C(e) { e._modelViewDirty && (e._modelViewDirty = !1, t.multiply(e._view, e._model, e._modelView)) }
function x(e) { e._modelView3DDirty && (e._modelView3DDirty = !1, t.multiply(e.getView3D(), e._model, e._modelView3D)) }
function S(e) { if (e._modelViewRelativeToEyeDirty) { e._modelViewRelativeToEyeDirty = !1; var t = e.getModelView(),
r = e._modelViewRelativeToEye;
r[0] = t[0], r[1] = t[1], r[2] = t[2], r[3] = t[3], r[4] = t[4], r[5] = t[5], r[6] = t[6], r[7] = t[7], r[8] = t[8], r[9] = t[9], r[10] = t[10], r[11] = t[11], r[12] = 0, r[13] = 0, r[14] = 0, r[15] = t[15] } }
function E(e) { e._inverseModelViewDirty && (e._inverseModelViewDirty = !1, t.inverse(e.getModelView(), e._inverseModelView)) }
function b(e) { e._inverseModelView3DDirty && (e._inverseModelView3DDirty = !1, t.inverse(e.getModelView3D(), e._inverseModelView3D)) }
function T(e) { e._viewProjectionDirty && (e._viewProjectionDirty = !1, t.multiply(e._projection, e._view, e._viewProjection)) }
function A(e) { e._modelViewProjectionDirty && (e._modelViewProjectionDirty = !1, t.multiply(e._projection, e.getModelView(), e._modelViewProjection)) }
function M(e) { e._modelViewProjectionRelativeToEyeDirty && (e._modelViewProjectionRelativeToEyeDirty = !1, t.multiply(e._projection, e.getModelViewRelativeToEye(), e._modelViewProjectionRelativeToEye)) }
function P(e) { e._modelViewInfiniteProjectionDirty && (e._modelViewInfiniteProjectionDirty = !1, t.multiply(e._infiniteProjection, e.getModelView(), e._modelViewInfiniteProjection)) }
function D(e) { e._normalDirty && (e._normalDirty = !1, t.transpose(e.getInverseModelView(), V), t.getRotation(V, e._normal)) }
function I(e) { e._normal3DDirty && (e._normal3DDirty = !1, t.transpose(e.getInverseModelView3D(), V), t.getRotation(V, e._normal3D)) }
function O(e) { e._inverseNormalDirty && (e._inverseNormalDirty = !1, t.getRotation(e.getInverseModelView(), e._inverseNormal)) }
function R(e) { e._inverseNormal3DDirty && (e._inverseNormal3DDirty = !1, t.getRotation(e.getInverseModelView3D(), e._inverseNormal3D)) }
function L(e) { e._encodedCameraPositionMCDirty && (e._encodedCameraPositionMCDirty = !1, e.getInverseModel().multiplyByPoint(e._cameraPosition, q), l.fromCartesian(q, e._encodedCameraPositionMC)) }
function z(e, r, n, o, l, u, h, m) { var p = k;
p.x = e.y, p.y = e.z, p.z = e.x; var f = U;
f.x = n.y, f.y = n.z, f.z = n.x; var v = W;
v.x = o.y, v.y = o.z, v.z = o.x; var y = G;
y.x = r.y, y.y = r.z, y.z = r.x, u === d.SCENE2D && (p.z = .5 * l); var g = h.unproject(p, H);
g.longitude = s.clamp(g.longitude, -Math.PI, Math.PI), g.latitude = s.clamp(g.latitude, -s.PI_OVER_TWO, s.PI_OVER_TWO); var _ = h.getEllipsoid(),
w = _.cartographicToCartesian(g, j),
C = c.eastNorthUpToFixedFrame(w, _, Y); return C.multiplyByVector(f, f), C.multiplyByVector(v, v), C.multiplyByVector(y, y), a(m) || (m = new t), m[0] = f.x, m[1] = v.x, m[2] = -y.x, m[3] = 0, m[4] = f.y, m[5] = v.y, m[6] = -y.y, m[7] = 0, m[8] = f.z, m[9] = v.z, m[10] = -y.z, m[11] = 0, m[12] = -i.dot(f, w), m[13] = -i.dot(v, w), m[14] = i.dot(y, w), m[15] = 1, m }
var N = function() { this._viewport = new u, this._viewportDirty = !1, this._viewportOrthographicMatrix = t.IDENTITY.clone(), this._viewportTransformation = t.IDENTITY.clone(), this._model = t.IDENTITY.clone(), this._view = t.IDENTITY.clone(), this._inverseView = t.IDENTITY.clone(), this._projection = t.IDENTITY.clone(), this._infiniteProjection = t.IDENTITY.clone(), this._entireFrustum = new r, this._currentFrustum = new r, this._pixelSize = 0, this._frameState = void 0, this._temeToPseudoFixed = e.IDENTITY.clone(), this._view3DDirty = !0, this._view3D = new t, this._inverseView3DDirty = !0, this._inverseView3D = new t, this._inverseModelDirty = !0, this._inverseModel = new t, this._viewRotation = new e, this._inverseViewRotation = new e, this._viewRotation3D = new e, this._inverseViewRotation3D = new e, this._inverseProjectionDirty = !0, this._inverseProjection = new t, this._modelViewDirty = !0, this._modelView = new t, this._modelView3DDirty = !0, this._modelView3D = new t, this._modelViewRelativeToEyeDirty = !0, this._modelViewRelativeToEye = new t, this._inverseModelViewDirty = !0, this._inverseModelView = new t, this._inverseModelView3DDirty = !0, this._inverseModelView3D = new t, this._viewProjectionDirty = !0, this._viewProjection = new t, this._modelViewProjectionDirty = !0, this._modelViewProjection = new t, this._modelViewProjectionRelativeToEyeDirty = !0, this._modelViewProjectionRelativeToEye = new t, this._modelViewInfiniteProjectionDirty = !0, this._modelViewInfiniteProjection = new t, this._normalDirty = !0, this._normal = new e, this._normal3DDirty = !0, this._normal3D = new e, this._inverseNormalDirty = !0, this._inverseNormal = new e, this._inverseNormal3DDirty = !0, this._inverseNormal3D = new e, this._encodedCameraPositionMCDirty = !0, this._encodedCameraPositionMC = new l, this._cameraPosition = new i, this._sunPositionWC = new i, this._sunPositionColumbusView = new i, this._sunDirectionWC = new i, this._sunDirectionEC = new i, this._moonDirectionEC = new i, this._mode = void 0, this._mapProjection = void 0, this._cameraDirection = new i, this._cameraRight = new i, this._cameraUp = new i, this._frustum2DWidth = 0, this._eyeHeight2D = new r },
F = new e,
B = new o;
N.prototype.updateFrustum = function(e) { f(this, e.getProjectionMatrix()), a(e.getInfiniteProjectionMatrix) && v(this, e.getInfiniteProjectionMatrix()), this._currentFrustum.x = e.near, this._currentFrustum.y = e.far }, N.prototype.update = function(e) { this._mode = e.mode, this._mapProjection = e.scene2D.projection; var t = e.camera;
m(this, t.getViewMatrix()), p(this, t.getInverseViewMatrix()), y(this, t), e.mode === d.SCENE2D ? (this._frustum2DWidth = t.frustum.right - t.frustum.left, this._eyeHeight2D.x = .5 * this._frustum2DWidth, this._eyeHeight2D.y = this._eyeHeight2D.x * this._eyeHeight2D.x) : (this._frustum2DWidth = 0, this._eyeHeight2D.x = 0, this._eyeHeight2D.y = 0), g(this, e); var r = t.frustum.getPixelSize(e.canvasDimensions);
this._pixelSize = Math.max(r.x, r.y), this._entireFrustum.x = t.frustum.near, this._entireFrustum.y = t.frustum.far, this.updateFrustum(t.frustum), this._frameState = e, this._temeToPseudoFixed = c.computeTemeToPseudoFixedMatrix(e.time) }, N.prototype.setViewport = function(e) { u.equals(e, this._viewport) || (u.clone(e, this._viewport), this._viewportDirty = !0) }, N.prototype.getViewport = function() { return this._viewport }, N.prototype.getViewportOrthographic = function() { return _(this), this._viewportOrthographicMatrix }, N.prototype.getViewportTransformation = function() { return _(this), this._viewportTransformation }, N.prototype.setModel = function(e) { t.clone(e, this._model), this._modelView3DDirty = !0, this._inverseModelView3DDirty = !0, this._inverseModelDirty = !0, this._modelViewDirty = !0, this._modelViewRelativeToEyeDirty = !0, this._inverseModelViewDirty = !0, this._modelViewProjectionDirty = !0, this._modelViewProjectionRelativeToEyeDirty = !0, this._modelViewInfiniteProjectionDirty = !0, this._normalDirty = !0, this._inverseNormalDirty = !0, this._normal3DDirty = !0, this._inverseNormal3DDirty = !0, this._encodedCameraPositionMCDirty = !0 }, N.prototype.getModel = function() { return this._model }, N.prototype.getInverseModel = function() { return this._inverseModelDirty && (this._inverseModelDirty = !1, this._model.inverse(this._inverseModel)), this._inverseModel }, N.prototype.getView = function() { return this._view }, N.prototype.getView3D = function() { return this._view3DDirty && (this._mode === d.SCENE3D ? t.clone(this._view, this._view3D) : z(this._cameraPosition, this._cameraDirection, this._cameraRight, this._cameraUp, this._frustum2DWidth, this._mode, this._mapProjection, this._view3D), t.getRotation(this._view3D, this._viewRotation3D), this._view3DDirty = !1), this._view3D }, N.prototype.getViewRotation = function() { return this._viewRotation }, N.prototype.getViewRotation3D = function() { return this.getView3D(), this._viewRotation3D }, N.prototype.getInverseView = function() { return this._inverseView }, N.prototype.getInverseView3D = function() { return this._inverseView3DDirty && (t.inverseTransformation(this.getView3D(), this._inverseView3D), t.getRotation(this._inverseView3D, this._inverseViewRotation3D), this._inverseView3DDirty = !1), this._inverseView3D }, N.prototype.getInverseViewRotation = function() {
return this._inverseViewRotation
}, N.prototype.getInverseViewRotation3D = function() { return this.getInverseView3D(), this._inverseViewRotation3D }, N.prototype.getProjection = function() { return this._projection }, N.prototype.getInverseProjection = function() { return w(this), this._inverseProjection }, N.prototype.getInfiniteProjection = function() { return this._infiniteProjection }, N.prototype.getModelView = function() { return C(this), this._modelView }, N.prototype.getModelView3D = function() { return x(this), this._modelView3D }, N.prototype.getModelViewRelativeToEye = function() { return S(this), this._modelViewRelativeToEye }, N.prototype.getInverseModelView = function() { return E(this), this._inverseModelView }, N.prototype.getInverseModelView3D = function() { return b(this), this._inverseModelView3D }, N.prototype.getViewProjection = function() { return T(this), this._viewProjection }, N.prototype.getModelViewProjection = function() { return A(this), this._modelViewProjection }, N.prototype.getModelViewProjectionRelativeToEye = function() { return M(this), this._modelViewProjectionRelativeToEye }, N.prototype.getModelViewInfiniteProjection = function() { return P(this), this._modelViewInfiniteProjection };
var V = new t;
N.prototype.getNormal = function() { return D(this), this._normal }, N.prototype.getNormal3D = function() { return I(this), this._normal3D }, N.prototype.getInverseNormal = function() { return O(this), this._inverseNormal }, N.prototype.getInverseNormal3D = function() { return R(this), this._inverseNormal3D }, N.prototype.getEntireFrustum = function() { return this._entireFrustum }, N.prototype.getCurrentFrustum = function() { return this._currentFrustum }, N.prototype.getEyeHeight2D = function() { return this._eyeHeight2D }, N.prototype.getPixelSize = function() { return this._pixelSize }, N.prototype.getSunPositionWC = function() { return this._sunPositionWC }, N.prototype.getSunPositionColumbusView = function() { return this._sunPositionColumbusView }, N.prototype.getSunDirectionWC = function() { return this._sunDirectionWC }, N.prototype.getSunDirectionEC = function() { return this._sunDirectionEC }, N.prototype.getMoonDirectionEC = function() { return this._moonDirectionEC };
var q = new i;
N.prototype.getEncodedCameraPositionMCHigh = function() { return L(this), this._encodedCameraPositionMC.high }, N.prototype.getEncodedCameraPositionMCLow = function() { return L(this), this._encodedCameraPositionMC.low }, N.prototype.getFrameState = function() { return this._frameState }, N.prototype.getTemeToPseudoFixedMatrix = function() { return this._temeToPseudoFixed }, N.prototype.getHighResolutionSnapScale = function() { return 1 };
var k = new i,
U = new n,
W = new n,
G = new n,
H = new o,
j = new i,
Y = new t;
return N
}), r("Renderer/VertexArray", ["../Core/defaultValue", "../Core/defined", "../Core/destroyObject", "../Core/DeveloperError", "../Core/ComponentDatatype"], function(e, t, r, i, n) { "use strict";
function o(t, r, o) { if (!r.vertexBuffer && !r.value) throw new i("attribute must have a vertexBuffer or a value."); if (r.vertexBuffer && r.value) throw new i("attribute cannot have both a vertexBuffer and a value. It must have either a vertexBuffer property defining per-vertex data or a value property defining data for all vertices."); var a = r.value ? r.value.length : r.componentsPerAttribute; if (1 !== a && 2 !== a && 3 !== a && 4 !== a) { if (r.value) throw new i("attribute.value.length must be in the range [1, 4]."); throw new i("attribute.componentsPerAttribute must be in the range [1, 4].") } if (r.componentDatatype) { var s = r.componentDatatype; if (!n.validate(s)) throw new i("attribute must have a valid componentDatatype or not specify it.") } if (r.strideInBytes && r.strideInBytes > 255) throw new i("attribute must have a strideInBytes less than or equal to 255 or not specify it."); var l = { index: e(r.index, o), enabled: e(r.enabled, !0), vertexBuffer: r.vertexBuffer, value: r.value ? r.value.slice(0) : void 0, componentsPerAttribute: a, componentDatatype: r.componentDatatype || n.FLOAT, normalize: r.normalize || !1, offsetInBytes: r.offsetInBytes || 0, strideInBytes: r.strideInBytes || 0 }; if (l.vertexBuffer) l.vertexAttrib = function(e) { e.bindBuffer(e.ARRAY_BUFFER, this.vertexBuffer._getBuffer()), e.vertexAttribPointer(this.index, this.componentsPerAttribute, this.componentDatatype.value, this.normalize, this.strideInBytes, this.offsetInBytes), e.enableVertexAttribArray(this.index) }, l.disableVertexAttribArray = function(e) { e.disableVertexAttribArray(this.index) };
else { switch (l.componentsPerAttribute) {
case 1:
l.vertexAttrib = function(e) { e.vertexAttrib1fv(this.index, this.value) }; break;
case 2:
l.vertexAttrib = function(e) { e.vertexAttrib2fv(this.index, this.value) }; break;
case 3:
l.vertexAttrib = function(e) { e.vertexAttrib3fv(this.index, this.value) }; break;
case 4:
l.vertexAttrib = function(e) { e.vertexAttrib4fv(this.index, this.value) } } l.disableVertexAttribArray = function() {} } t.push(l) }
function a(e, r, i) { for (var n = 0; n < r.length; ++n) { var o = r[n];
o.enabled && o.vertexAttrib(e) } t(i) && e.bindBuffer(e.ELEMENT_ARRAY_BUFFER, i._getBuffer()) } var s = function(e, r, n, s) { var l = []; if (t(n))
for (var u = 0; u < n.length; ++u) o(l, n[u], u); for (var c = {}, h = 0; h < l.length; ++h) { var d = l[h].index; if (c[d]) throw new i("Index " + d + " is used by more than one attribute.");
c[d] = !0 } var m;
null !== r && (m = r.createVertexArrayOES(), r.bindVertexArrayOES(m), a(e, l, s), r.bindVertexArrayOES(null)), this._gl = e, this._vaoExtension = r, this._vao = m, this._attributes = l, this._indexBuffer = s }; return s.prototype.getAttribute = function(e) { if (!t(e)) throw new i("index is required."); return this._attributes[e] }, s.prototype.getNumberOfAttributes = function() { return this._attributes.length }, s.prototype.getIndexBuffer = function() { return this._indexBuffer }, s.prototype._bind = function() { t(this._vao) ? this._vaoExtension.bindVertexArrayOES(this._vao) : a(this._gl, this._attributes, this._indexBuffer) }, s.prototype._unBind = function() { if (t(this._vao)) this._vaoExtension.bindVertexArrayOES(null);
else { for (var e = this._attributes, r = this._gl, i = 0; i < e.length; ++i) { var n = e[i];
n.enabled && n.disableVertexAttribArray(r) } this._indexBuffer && r.bindBuffer(r.ELEMENT_ARRAY_BUFFER, null) } }, s.prototype._getNumberOfVertices = function() { if (this._attributes.length > 0) { var e = this._attributes[0],
t = e.strideInBytes || e.componentsPerAttribute * e.componentDatatype.sizeInBytes; return e.vertexBuffer.getSizeInBytes() / t } return 0 }, s.prototype.isDestroyed = function() { return !1 }, s.prototype.destroy = function() { for (var e = this._attributes, i = 0; i < e.length; ++i) { var n = e[i].vertexBuffer;
n && !n.isDestroyed() && n.getVertexArrayDestroyable() && n.destroy() } var o = this._indexBuffer; return o && !o.isDestroyed() && o.getVertexArrayDestroyable() && o.destroy(), t(this._vao) && this._vaoExtension.deleteVertexArrayOES(this._vao), r(this) }, s }), r("Renderer/Context", ["../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/destroyObject", "../Core/Color", "../Core/ComponentDatatype", "../Core/IndexDatatype", "../Core/RuntimeError", "../Core/PrimitiveType", "../Core/Geometry", "../Core/createGuid", "../Core/Matrix4", "../Core/Math", "./Buffer", "./BufferUsage", "./CubeMap", "./Framebuffer", "./PixelDatatype", "./PixelFormat", "./PickFramebuffer", "./Renderbuffer", "./RenderbufferFormat", "./RenderState", "./ShaderCache", "./ShaderProgram", "./Texture", "./TextureAtlas", "./TextureMagnificationFilter", "./TextureMinificationFilter", "./TextureWrap", "./UniformState", "./VertexArray", "./VertexLayout", "./ClearCommand", "./PassState"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C, x, S, E, b, T, A, M, P, D, I, O, R, L) {
"use strict";
function z(e, t) { var r = "OpenGL Error: "; switch (t) {
case e.INVALID_ENUM:
r += "Invalid enumeration"; break;
case e.INVALID_VALUE:
r += "Invalid value"; break;
case e.INVALID_OPERATION:
r += "Invalid operation"; break;
case e.OUT_OF_MEMORY:
r += "Out of memory"; break;
case e.CONTEXT_LOST_WEBGL:
r += "Context lost"; break;
default:
r += "Unknown" } return r }
function N(e, t, r, i) { for (var n = z(e, i) + ": " + t.name + "(", o = 0; o < r.length; ++o) 0 !== o && (n += ", "), n += r[o]; return n += ");" }
function F(e, t, r) { var i = e.getError(); if (i !== e.NO_ERROR) throw new s(N(e, t, r, i)) }
function B(e, t) {
function r(r) { return function() { var i = r.apply(e, arguments); return t(e, r, arguments), i } } if (!t) return e; var i = {}; for (var n in e) { var o = e[n];
i[n] = "function" == typeof o ? r(o) : o } return i }
function V(e, t, i, n) { var o; if ("number" == typeof i) o = i;
else { if ("object" != typeof i || "number" != typeof i.byteLength) throw new r("typedArrayOrSizeInBytes must be either a typed array or a number.");
o = i.byteLength } if (0 >= o) throw new r("typedArrayOrSizeInBytes must be greater than zero."); if (!p.validate(n)) throw new r("usage is invalid."); var a = e.createBuffer(); return e.bindBuffer(t, a), e.bufferData(t, i, n), e.bindBuffer(t, null), new m(e, t, o, n, a) }
function q(e, t, r) { var i = e._currentRenderState;
i !== t && (e._currentRenderState = t, x.partialApply(e._gl, i, t, r)) }
function k(e) { return e.values.length / e.componentsPerAttribute }
function U(e) { return e.componentDatatype.sizeInBytes * e.componentsPerAttribute }
function W(e) { var r, i, n, a = []; for (i in e) e.hasOwnProperty(i) && t(e[i]) && t(e[i].values) && (a.push(i), e[i].componentDatatype.value === o.DOUBLE.value && (e[i].componentDatatype = o.FLOAT, e[i].values = o.createTypedArray(o.FLOAT, e[i].values))); var l, u = a.length; if (u > 0)
for (l = k(e[a[0]]), r = 1; u > r; ++r) { var c = k(e[a[r]]); if (c !== l) throw new s("Each attribute list must have the same number of vertices. Attribute " + a[r] + " has a different number of vertices " + "(" + c.toString() + ")" + " than attribute " + a[0] + " (" + l.toString() + ").") } a.sort(function(t, r) { return e[r].componentDatatype.sizeInBytes - e[t].componentDatatype.sizeInBytes }); var h = 0,
d = {}; for (r = 0; u > r; ++r) i = a[r], n = e[i], d[i] = h, h += U(n); if (h > 0) { var m = e[a[0]].componentDatatype.sizeInBytes,
p = h % m;
0 !== p && (h += m - p); var f = l * h,
v = new ArrayBuffer(f),
y = {}; for (r = 0; u > r; ++r) { i = a[r]; var g = e[i].componentDatatype.sizeInBytes;
y[i] = { pointer: o.createTypedArray(e[i].componentDatatype, v), index: d[i] / g, strideInComponentType: h / g } } for (r = 0; l > r; ++r)
for (var _ = 0; u > _; ++_) { i = a[_], n = e[i]; for (var w = n.values, C = y[i], x = C.pointer, S = n.componentsPerAttribute, E = 0; S > E; ++E) x[C.index + E] = w[r * S + E];
C.index += C.strideInComponentType }
return { buffer: v, offsetsInBytes: d, vertexSizeInBytes: h } } return void 0 }
function G(e, t, r) { this._pickObjects = e, this.key = t, this.color = r }
var H = function(e, i) { if (!window.WebGLRenderingContext) throw new s("The browser does not support WebGL. Visit http://get.webgl.org."); if (!t(e)) throw new r("canvas is required."); if (this._canvas = e, t(i) || (i = {}), t(i.alpha) || (i.alpha = !1), this._originalGLContext = e.getContext("webgl", i) || e.getContext("experimental-webgl", i), !this._originalGLContext) throw new s("The browser supports WebGL, but initialization failed.");
this._id = c(), this._validateFB = !1, this._validateSP = !1, this._logShaderCompilation = !1, this._throwOnWebGLError = !1, this._shaderCache = new S(this); var o = this._gl = this._originalGLContext;
this._version = o.getParameter(o.VERSION), this._shadingLanguageVersion = o.getParameter(o.SHADING_LANGUAGE_VERSION), this._vendor = o.getParameter(o.VENDOR), this._renderer = o.getParameter(o.RENDERER), this._redBits = o.getParameter(o.RED_BITS), this._greenBits = o.getParameter(o.GREEN_BITS), this._blueBits = o.getParameter(o.BLUE_BITS), this._alphaBits = o.getParameter(o.ALPHA_BITS), this._depthBits = o.getParameter(o.DEPTH_BITS), this._stencilBits = o.getParameter(o.STENCIL_BITS), this._maximumCombinedTextureImageUnits = o.getParameter(o.MAX_COMBINED_TEXTURE_IMAGE_UNITS), this._maximumCubeMapSize = o.getParameter(o.MAX_CUBE_MAP_TEXTURE_SIZE), this._maximumFragmentUniformVectors = o.getParameter(o.MAX_FRAGMENT_UNIFORM_VECTORS), this._maximumTextureImageUnits = o.getParameter(o.MAX_TEXTURE_IMAGE_UNITS), this._maximumRenderbufferSize = o.getParameter(o.MAX_RENDERBUFFER_SIZE), this._maximumTextureSize = o.getParameter(o.MAX_TEXTURE_SIZE), this._maximumVaryingVectors = o.getParameter(o.MAX_VARYING_VECTORS), this._maximumVertexAttributes = o.getParameter(o.MAX_VERTEX_ATTRIBS), this._maximumVertexTextureImageUnits = o.getParameter(o.MAX_VERTEX_TEXTURE_IMAGE_UNITS), this._maximumVertexUniformVectors = o.getParameter(o.MAX_VERTEX_UNIFORM_VECTORS), this._aliasedLineWidthRange = o.getParameter(o.ALIASED_LINE_WIDTH_RANGE), this._aliasedPointSizeRange = o.getParameter(o.ALIASED_POINT_SIZE_RANGE), this._maximumViewportDimensions = o.getParameter(o.MAX_VIEWPORT_DIMS), this._antialias = o.getContextAttributes().antialias, this._standardDerivatives = o.getExtension("OES_standard_derivatives"), this._elementIndexUint = o.getExtension("OES_element_index_uint"), this._depthTexture = o.getExtension("WEBKIT_WEBGL_depth_texture") || o.getExtension("MOZ_WEBGL_depth_texture"), this._textureFloat = o.getExtension("OES_texture_float"); var a = o.getExtension("EXT_texture_filter_anisotropic") || o.getExtension("WEBKIT_EXT_texture_filter_anisotropic") || o.getExtension("MOZ_EXT_texture_filter_anisotropic");
this._textureFilterAnisotropic = a, this._maximumTextureFilterAnisotropy = a ? o.getParameter(a.MAX_TEXTURE_MAX_ANISOTROPY_EXT) : 1, this._vertexArrayObject = o.getExtension("OES_vertex_array_object"); var l = o.getParameter(o.COLOR_CLEAR_VALUE);
this._clearColor = new n(l[0], l[1], l[2], l[3]), this._clearDepth = o.getParameter(o.DEPTH_CLEAR_VALUE), this._clearStencil = o.getParameter(o.STENCIL_CLEAR_VALUE); var u = new D,
h = new L(this),
d = this.createRenderState();
this._defaultPassState = h, this._defaultRenderState = d, this._defaultTexture = void 0, this._defaultCubeMap = void 0, this._us = u, this._currentFramebuffer = void 0, this._currentSp = void 0, this._currentRenderState = d, this._pickObjects = {}, this._nextPickColor = new Uint32Array(1), this.cache = {}, x.apply(o, d, h) };
H.prototype.getId = function() { return this._id }, H.prototype.getCanvas = function() { return this._canvas }, H.prototype.getShaderCache = function() { return this._shaderCache }, H.prototype.getUniformState = function() { return this._us }, H.prototype.getVersion = function() { return this._version }, H.prototype.getShadingLanguageVersion = function() { return this._shadingLanguageVersion }, H.prototype.getVendor = function() { return this._vendor }, H.prototype.getRenderer = function() { return this._renderer }, H.prototype.getRedBits = function() { return this._redBits }, H.prototype.getGreenBits = function() { return this._greenBits }, H.prototype.getBlueBits = function() { return this._blueBits }, H.prototype.getAlphaBits = function() { return this._alphaBits }, H.prototype.getDepthBits = function() { return this._depthBits }, H.prototype.getStencilBits = function() { return this._stencilBits }, H.prototype.getMaximumCombinedTextureImageUnits = function() { return this._maximumCombinedTextureImageUnits }, H.prototype.getMaximumCubeMapSize = function() { return this._maximumCubeMapSize }, H.prototype.getMaximumFragmentUniformVectors = function() { return this._maximumFragmentUniformVectors }, H.prototype.getMaximumTextureImageUnits = function() { return this._maximumTextureImageUnits }, H.prototype.getMaximumRenderbufferSize = function() { return this._maximumRenderbufferSize }, H.prototype.getMaximumTextureSize = function() { return this._maximumTextureSize }, H.prototype.getMaximumVaryingVectors = function() { return this._maximumVaryingVectors }, H.prototype.getMaximumVertexAttributes = function() { return this._maximumVertexAttributes }, H.prototype.getMaximumVertexTextureImageUnits = function() { return this._maximumVertexTextureImageUnits }, H.prototype.getMaximumVertexUniformVectors = function() { return this._maximumVertexUniformVectors }, H.prototype.getMinimumAliasedLineWidth = function() { return this._aliasedLineWidthRange[0] }, H.prototype.getMaximumAliasedLineWidth = function() { return this._aliasedLineWidthRange[1] }, H.prototype.getMinimumAliasedPointSize = function() { return this._aliasedPointSizeRange[0] }, H.prototype.getMaximumAliasedPointSize = function() { return this._aliasedPointSizeRange[1] }, H.prototype.getMaximumViewportWidth = function() { return this._maximumViewportDimensions[0] }, H.prototype.getMaximumViewportHeight = function() { return this._maximumViewportDimensions[1] }, H.prototype.getAntialias = function() { return this._antialias }, H.prototype.getStandardDerivatives = function() { return !!this._standardDerivatives }, H.prototype.getElementIndexUint = function() { return !!this._elementIndexUint }, H.prototype.getDepthTexture = function() { return !!this._depthTexture }, H.prototype.getFloatingPointTexture = function() { return !!this._textureFloat }, H.prototype.getTextureFilterAnisotropic = function() { return !!this._textureFilterAnisotropic }, H.prototype.getMaximumTextureFilterAnisotropy = function() { return this._maximumTextureFilterAnisotropy }, H.prototype.getVertexArrayObject = function() { return !!this._vertexArrayObject }, H.prototype.getValidateFramebuffer = function() { return this._validateFB }, H.prototype.setValidateFramebuffer = function(e) { this._validateFB = e }, H.prototype.getValidateShaderProgram = function() { return this._validateSP }, H.prototype.setValidateShaderProgram = function(e) { this._validateSP = e }, H.prototype.getThrowOnWebGLError = function() { return this._throwOnWebGLError }, H.prototype.setThrowOnWebGLError = function(e) { this._throwOnWebGLError = e, this._gl = B(this._originalGLContext, e ? F : null) }, H.prototype.getLogShaderCompilation = function() { return this._logShaderCompilation }, H.prototype.setLogShaderCompilation = function(e) { this._logShaderCompilation = e }, H.prototype.getDefaultTexture = function() { return void 0 === this._defaultTexture && (this._defaultTexture = this.createTexture2D({ source: { width: 1, height: 1, arrayBufferView: new Uint8Array([255, 255, 255, 255]) } })), this._defaultTexture }, H.prototype.getDefaultCubeMap = function() { if (void 0 === this._defaultCubeMap) { var e = { width: 1, height: 1, arrayBufferView: new Uint8Array([255, 255, 255, 255]) };
this._defaultCubeMap = this.createCubeMap({ source: { positiveX: e, negativeX: e, positiveY: e, negativeY: e, positiveZ: e, negativeZ: e } }) } return this._defaultCubeMap }, H.prototype.createShaderProgram = function(e, t, r) { return new E(this._gl, this._logShaderCompilation, e, t, r) }, H.prototype.createVertexBuffer = function(e, t) { return V(this._gl, this._gl.ARRAY_BUFFER, e, t) }, H.prototype.createIndexBuffer = function(e, t, i) { if (!a.validate(i)) throw new r("Invalid indexDatatype."); if (i.value === a.UNSIGNED_INT.value && !this.getElementIndexUint()) throw new s("IndexDatatype.UNSIGNED_INT requires OES_element_index_uint, which is not supported on this system."); var n = i.sizeInBytes,
o = this._gl,
l = V(o, o.ELEMENT_ARRAY_BUFFER, e, t),
u = l.getSizeInBytes() / n; return l.getIndexDatatype = function() { return i }, l.getBytesPerIndex = function() { return n }, l.getNumberOfIndices = function() { return u }, l }, H.prototype.createVertexArray = function(e, t) { return new I(this._gl, this._vertexArrayObject, e, t) }, H.prototype.createTexture2D = function(i) { if (!i) throw new r("description is required."); var n = i.source,
o = t(n) ? n.width : i.width,
a = t(n) ? n.height : i.height; if (!t(o) || !t(a)) throw new r("description requires a source field to create an initialized texture or width and height fields to create a blank texture."); if (0 >= o) throw new r("Width must be greater than zero."); if (o > this._maximumTextureSize) throw new r("Width must be less than or equal to the maximum texture size (" + this._maximumTextureSize + "). Check getMaximumTextureSize()."); if (0 >= a) throw new r("Height must be greater than zero."); if (a > this._maximumTextureSize) throw new r("Height must be less than or equal to the maximum texture size (" + this._maximumTextureSize + "). Check getMaximumTextureSize()."); var l = e(i.pixelFormat, g.RGBA); if (!g.validate(l)) throw new r("Invalid description.pixelFormat."); var u = e(i.pixelDatatype, y.UNSIGNED_BYTE); if (!y.validate(u)) throw new r("Invalid description.pixelDatatype."); if (u === y.FLOAT && !this.getFloatingPointTexture()) throw new s("When description.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension."); if (l === g.DEPTH_COMPONENT && u !== y.UNSIGNED_SHORT && u !== y.UNSIGNED_INT) throw new r("When description.pixelFormat is DEPTH_COMPONENT, description.pixelDatatype must be UNSIGNED_SHORT or UNSIGNED_INT."); if (l === g.DEPTH_STENCIL && u !== y.UNSIGNED_INT_24_8_WEBGL) throw new r("When description.pixelFormat is DEPTH_STENCIL, description.pixelDatatype must be UNSIGNED_INT_24_8_WEBGL."); if (g.isDepthFormat(l)) { if (n) throw new r("When description.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, source cannot be provided."); if (!this.getDepthTexture()) throw new s("When description.pixelFormat is DEPTH_COMPONENT or DEPTH_STENCIL, this WebGL implementation must support WEBGL_depth_texture. Check getDepthTexture().") } var c = i.preMultiplyAlpha || l === g.RGB || l === g.LUMINANCE,
h = e(i.flipY, !0),
d = this._gl,
m = d.TEXTURE_2D,
p = d.createTexture(); return d.activeTexture(d.TEXTURE0), d.bindTexture(m, p), n ? (d.pixelStorei(d.UNPACK_PREMULTIPLY_ALPHA_WEBGL, c), d.pixelStorei(d.UNPACK_FLIP_Y_WEBGL, h), n.arrayBufferView ? d.texImage2D(m, 0, l, o, a, 0, l, u, n.arrayBufferView) : d.texImage2D(m, 0, l, l, u, n)) : d.texImage2D(m, 0, l, o, a, 0, l, u, null), d.bindTexture(m, null), new b(d, this._textureFilterAnisotropic, m, p, l, u, o, a, c, h) }, H.prototype.createTexture2DFromFramebuffer = function(t, i, n, o, a) { if (t = e(t, g.RGB), i = e(i, 0), n = e(n, 0), o = e(o, this._canvas.clientWidth), a = e(a, this._canvas.clientHeight), !g.validate(t)) throw new r("Invalid pixelFormat."); if (g.isDepthFormat(t)) throw new r("pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL."); if (0 > i) throw new r("framebufferXOffset must be greater than or equal to zero."); if (0 > n) throw new r("framebufferYOffset must be greater than or equal to zero."); if (i + o > this._canvas.clientWidth) throw new r("framebufferXOffset + width must be less than or equal to getCanvas().clientWidth"); if (n + a > this._canvas.clientHeight) throw new r("framebufferYOffset + height must be less than or equal to getCanvas().clientHeight."); var s = this._gl,
l = s.TEXTURE_2D,
u = s.createTexture(); return s.activeTexture(s.TEXTURE0), s.bindTexture(l, u), s.copyTexImage2D(l, 0, t, i, n, o, a, 0), s.bindTexture(l, null), new b(s, this._textureFilterAnisotropic, l, u, t, void 0, o, a) }, H.prototype.createTextureAtlas = function(e) { return e = e || {}, e.context = this, new T(e) }, H.prototype.createCubeMap = function(i) {
function n(e, t) { t.arrayBufferView ? _.texImage2D(e, 0, d, h, h, 0, d, m, t.arrayBufferView) : _.texImage2D(e, 0, d, d, m, t) } if (!i) throw new r("description is required."); var o, a, l = i.source; if (l) { var u = [l.positiveX, l.negativeX, l.positiveY, l.negativeY, l.positiveZ, l.negativeZ]; if (!(u[0] && u[1] && u[2] && u[3] && u[4] && u[5])) throw new r("description.source requires positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ faces.");
o = u[0].width, a = u[0].height; for (var c = 1; 6 > c; ++c)
if (Number(u[c].width) !== o || Number(u[c].height) !== a) throw new r("Each face in description.source must have the same width and height.") } else o = i.width, a = i.height; if (!t(o) || !t(a)) throw new r("description requires a source field to create an initialized cube map or width and height fields to create a blank cube map."); if (o !== a) throw new r("Width must equal height."); var h = o; if (0 >= h) throw new r("Width and height must be greater than zero."); if (h > this._maximumCubeMapSize) throw new r("Width and height must be less than or equal to the maximum cube map size (" + this._maximumCubeMapSize + "). Check getMaximumCubeMapSize()."); var d = e(i.pixelFormat, g.RGBA); if (!g.validate(d)) throw new r("Invalid description.pixelFormat."); if (g.isDepthFormat(d)) throw new r("description.pixelFormat cannot be DEPTH_COMPONENT or DEPTH_STENCIL."); var m = e(i.pixelDatatype, y.UNSIGNED_BYTE); if (!y.validate(m)) throw new r("Invalid description.pixelDatatype."); if (m === y.FLOAT && !this.getFloatingPointTexture()) throw new s("When description.pixelDatatype is FLOAT, this WebGL implementation must support the OES_texture_float extension."); var p = i.preMultiplyAlpha || d === g.RGB || d === g.LUMINANCE,
v = e(i.flipY, !0),
_ = this._gl,
w = _.TEXTURE_CUBE_MAP,
C = _.createTexture(); return _.activeTexture(_.TEXTURE0), _.bindTexture(w, C), l ? (_.pixelStorei(_.UNPACK_PREMULTIPLY_ALPHA_WEBGL, p), _.pixelStorei(_.UNPACK_FLIP_Y_WEBGL, v), n(_.TEXTURE_CUBE_MAP_POSITIVE_X, l.positiveX), n(_.TEXTURE_CUBE_MAP_NEGATIVE_X, l.negativeX), n(_.TEXTURE_CUBE_MAP_POSITIVE_Y, l.positiveY), n(_.TEXTURE_CUBE_MAP_NEGATIVE_Y, l.negativeY), n(_.TEXTURE_CUBE_MAP_POSITIVE_Z, l.positiveZ), n(_.TEXTURE_CUBE_MAP_NEGATIVE_Z, l.negativeZ)) : (_.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_X, 0, d, h, h, 0, d, m, null), _.texImage2D(_.TEXTURE_CUBE_MAP_NEGATIVE_X, 0, d, h, h, 0, d, m, null), _.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_Y, 0, d, h, h, 0, d, m, null), _.texImage2D(_.TEXTURE_CUBE_MAP_NEGATIVE_Y, 0, d, h, h, 0, d, m, null), _.texImage2D(_.TEXTURE_CUBE_MAP_POSITIVE_Z, 0, d, h, h, 0, d, m, null), _.texImage2D(_.TEXTURE_CUBE_MAP_NEGATIVE_Z, 0, d, h, h, 0, d, m, null)), _.bindTexture(w, null), new f(_, this._textureFilterAnisotropic, w, C, d, m, h, p, v) }, H.prototype.createFramebuffer = function(e) { return new v(this._gl, e) }, H.prototype.createRenderbuffer = function(i) { i = e(i, e.EMPTY_OBJECT); var n = e(i.format, C.RGBA4),
o = t(i.width) ? i.width : this._canvas.clientWidth,
a = t(i.height) ? i.height : this._canvas.clientHeight,
s = this._gl; if (!C.validate(n)) throw new r("Invalid format."); if (0 >= o) throw new r("Width must be greater than zero."); if (o > this.getMaximumRenderbufferSize()) throw new r("Width must be less than or equal to the maximum renderbuffer size (" + this.getMaximumRenderbufferSize() + "). Check getMaximumRenderbufferSize()."); if (0 >= a) throw new r("Height must be greater than zero."); if (a > this.getMaximumRenderbufferSize()) throw new r("Height must be less than or equal to the maximum renderbuffer size (" + this.getMaximumRenderbufferSize() + "). Check getMaximumRenderbufferSize()."); return new w(s, n, o, a) };
var j = 0,
Y = {};
H.prototype.createRenderState = function(e) { var r = JSON.stringify(e),
i = Y[r]; if (t(i)) return i; var n = new x(this, e),
o = JSON.stringify(n); return i = Y[o], t(i) || (n.id = j++, i = n, Y[o] = i), Y[r] = i, i }, H.prototype.createSampler = function(e) { var i = { wrapS: e.wrapS || P.CLAMP, wrapT: e.wrapT || P.CLAMP, minificationFilter: e.minificationFilter || M.LINEAR, magnificationFilter: e.magnificationFilter || A.LINEAR, maximumAnisotropy: t(e.maximumAnisotropy) ? e.maximumAnisotropy : 1 }; if (!P.validate(i.wrapS)) throw new r("Invalid sampler.wrapS."); if (!P.validate(i.wrapT)) throw new r("Invalid sampler.wrapT."); if (!M.validate(i.minificationFilter)) throw new r("Invalid sampler.minificationFilter."); if (!A.validate(i.magnificationFilter)) throw new r("Invalid sampler.magnificationFilter."); if (i.maximumAnisotropy < 1) throw new r("sampler.maximumAnisotropy must be greater than or equal to one."); return i }, H.prototype._validateFramebuffer = function() { if (this._validateFB) { var e = this._gl,
t = e.checkFramebufferStatus(e.FRAMEBUFFER); if (t !== e.FRAMEBUFFER_COMPLETE) { var i; switch (t) {
case e.FRAMEBUFFER_INCOMPLETE_ATTACHMENT:
i = "Framebuffer is not complete. Incomplete attachment: at least one attachment point with a renderbuffer or texture attached has its attached object no longer in existence or has an attached image with a width or height of zero, or the color attachment point has a non-color-renderable image attached, or the depth attachment point has a non-depth-renderable image attached, or the stencil attachment point has a non-stencil-renderable image attached. Color-renderable formats include GL_RGBA4, GL_RGB5_A1, and GL_RGB565. GL_DEPTH_COMPONENT16 is the only depth-renderable format. GL_STENCIL_INDEX8 is the only stencil-renderable format."; break;
case e.FRAMEBUFFER_INCOMPLETE_DIMENSIONS:
i = "Framebuffer is not complete. Incomplete dimensions: not all attached images have the same width and height."; break;
case e.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT:
i = "Framebuffer is not complete. Missing attachment: no images are attached to the framebuffer."; break;
case e.FRAMEBUFFER_UNSUPPORTED:
i = "Framebuffer is not complete. Unsupported: the combination of internal formats of the attached images violates an implementation-dependent set of restrictions." } throw new r(i) } } };
var X = new R;
return H.prototype.clear = function(r, i) { r = e(r, X), i = e(i, this._defaultPassState); var o = this._gl,
a = 0,
s = r.color,
l = r.depth,
u = r.stencil;
t(s) && (n.equals(this._clearColor, s) || (n.clone(s, this._clearColor), o.clearColor(s.red, s.green, s.blue, s.alpha)), a |= o.COLOR_BUFFER_BIT), t(l) && (l !== this._clearDepth && (this._clearDepth = l, o.clearDepth(l)), a |= o.DEPTH_BUFFER_BIT), t(u) && (u !== this._clearStencil && (this._clearStencil = u, o.clearStencil(u)), a |= o.STENCIL_BUFFER_BIT); var c = e(r.renderState, this._defaultRenderState);
q(this, c, i); var h = e(r.framebuffer, i.framebuffer);
t(h) && (h._bind(), this._validateFramebuffer(h)), o.clear(a), t(h) && h._unBind() }, H.prototype.draw = function(t, r) { r = e(r, this._defaultPassState), this.beginDraw(t, r), this.continueDraw(t), this.endDraw() }, H.prototype.beginDraw = function(i, n) { if (!t(i)) throw new r("command is required."); if (!t(i.shaderProgram)) throw new r("command.shaderProgram is required."); var o = e(i.framebuffer, n.framebuffer),
a = i.shaderProgram,
s = t(i.renderState) ? i.renderState : this._defaultRenderState; if (t(o) && s.depthTest && s.depthTest.enabled && !o.hasDepthAttachment()) throw new r("The depth test can not be enabled (command.renderState.depthTest.enabled) because the framebuffer (command.framebuffer) does not have a depth or depth-stencil renderbuffer.");
q(this, s, n), t(o) && (o._bind(), this._validateFramebuffer(o)), a._bind(), this._currentFramebuffer = o, this._currentSp = a }, H.prototype.continueDraw = function(i) { var n = this._currentSp; if (!t(n)) throw new r("beginDraw must be called before continueDraw."); if (!t(i)) throw new r("command is required."); var o = i.primitiveType; if (!l.validate(o)) throw new r("command.primitiveType is required and must be valid."); if (!t(i.vertexArray)) throw new r("command.vertexArray is required."); var a = i.vertexArray,
s = a.getIndexBuffer(),
u = i.offset,
c = i.count,
d = t(s); if (d ? (u = (u || 0) * s.getBytesPerIndex(), c = c || s.getNumberOfIndices()) : (u = u || 0, c = c || a._getNumberOfVertices()), 0 > u) throw new r("command.offset must be omitted or greater than or equal to zero.");
c > 0 && (this._us.setModel(e(i.modelMatrix, h.IDENTITY)), n._setUniforms(i.uniformMap, this._us, this._validateSP), a._bind(), d ? this._gl.drawElements(o.value, c, s.getIndexDatatype().value, u) : this._gl.drawArrays(o.value, u, c), a._unBind()) }, H.prototype.endDraw = function() { t(this._currentFramebuffer) && (this._currentFramebuffer._unBind(), this._currentFramebuffer = void 0), this._currentSp._unBind(), this._currentSp = void 0 }, H.prototype.readPixels = function(e) { e = e || {}; var t = Math.max(e.x || 0, 0),
i = Math.max(e.y || 0, 0),
n = e.width || this._canvas.clientWidth,
o = e.height || this._canvas.clientHeight,
a = e.framebuffer || null; if (0 >= n) throw new r("readState.width must be greater than zero."); if (0 >= o) throw new r("readState.height must be greater than zero."); var s = new Uint8Array(4 * n * o);
a && (a._bind(), this._validateFramebuffer(a)); var l = this._gl; return l.readPixels(t, i, n, o, l.RGBA, l.UNSIGNED_BYTE, s), a && a._unBind(), s }, H.prototype.createVertexArrayFromGeometry = function(r) { var i, n, s, l = e(r, e.EMPTY_OBJECT),
c = e(l.geometry, e.EMPTY_OBJECT),
h = e(l.bufferUsage, p.DYNAMIC_DRAW),
m = e(l.attributeIndices, e.EMPTY_OBJECT),
f = t(l.vertexLayout) && l.vertexLayout === O.INTERLEAVED,
v = l.vertexArrayAttributes,
y = t(v) ? v : [],
g = c.attributes; if (f) { var _ = W(g); if (t(_)) { s = this.createVertexBuffer(_.buffer, h); var w = _.offsetsInBytes,
C = _.vertexSizeInBytes; for (i in g) g.hasOwnProperty(i) && t(g[i]) && (n = g[i], t(n.values) ? y.push({ index: m[i], vertexBuffer: s, componentDatatype: n.componentDatatype, componentsPerAttribute: n.componentsPerAttribute, normalize: n.normalize, offsetInBytes: w[i], strideInBytes: C }) : y.push({ index: m[i], value: n.value, componentDatatype: n.componentDatatype, normalize: n.normalize })) } } else
for (i in g)
if (g.hasOwnProperty(i) && t(g[i])) { n = g[i]; var x = n.componentDatatype;
x.value === o.DOUBLE.value && (x = o.FLOAT), s = void 0, t(n.values) && (s = this.createVertexBuffer(o.createTypedArray(x, n.values), h)), y.push({ index: m[i], vertexBuffer: s, value: n.value, componentDatatype: x, componentsPerAttribute: n.componentsPerAttribute, normalize: n.normalize }) } var S, E = c.indices; return t(E) && (S = u.computeNumberOfVertices(c) > d.SIXTY_FOUR_KILOBYTES && this.getElementIndexUint() ? this.createIndexBuffer(new Uint32Array(E), h, a.UNSIGNED_INT) : this.createIndexBuffer(new Uint16Array(E), h, a.UNSIGNED_SHORT)), this.createVertexArray(y, S) }, H.prototype.createPickFramebuffer = function() { return new _(this) }, H.prototype.getObjectByPickColor = function(e) { if (!t(e)) throw new r("pickColor is required."); return this._pickObjects[e.toRgba()] }, G.prototype.destroy = function() { return delete this._pickObjects[this.key], void 0 }, H.prototype.createPickId = function(e) { if (!t(e)) throw new r("object is required.");++this._nextPickColor[0]; var i = this._nextPickColor[0]; if (0 === i) throw new s("Out of unique Pick IDs."); return this._pickObjects[i] = e, new G(this._pickObjects, i, n.fromRgba(i)) }, H.prototype.isDestroyed = function() { return !1 }, H.prototype.destroy = function() {
var e = this.cache;
for (var r in e)
if (e.hasOwnProperty(r)) { var n = e[r];
t(n.destroy) && n.destroy() }
return this._shaderCache = this._shaderCache.destroy(), this._defaultTexture = this._defaultTexture && this._defaultTexture.destroy(), this._defaultCubeMap = this._defaultCubeMap && this._defaultCubeMap.destroy(), i(this)
}, H
}), r("Renderer/loadCubeMap", ["../Core/defined", "../Core/DeveloperError", "../Core/loadImage", "../ThirdParty/when"], function(e, t, r, i) { "use strict"; var n = function(n, o, a) { if (!e(n)) throw new t("context is required."); if (!(e(o) && e(o.positiveX) && e(o.negativeX) && e(o.positiveY) && e(o.negativeY) && e(o.positiveZ) && e(o.negativeZ))) throw new t("urls is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties."); var s = [r(o.positiveX, a), r(o.negativeX, a), r(o.positiveY, a), r(o.negativeY, a), r(o.positiveZ, a), r(o.negativeZ, a)]; return i.all(s, function(e) { return n.createCubeMap({ source: { positiveX: e[0], negativeX: e[1], positiveY: e[2], negativeY: e[3], positiveZ: e[4], negativeZ: e[5] } }) }) }; return n }), r("ThirdParty/Tween", [], function() { var e = e || function() { var e = []; return { REVISION: "7", getAll: function() { return e }, removeAll: function() { e = [] }, add: function(t) { e.push(t) }, remove: function(t) { var r = e.indexOf(t); - 1 !== r && e.splice(r, 1) }, update: function(t) { if (0 === e.length) return !1; var r = 0,
i = e.length; for (t = void 0 !== t ? t : Date.now(); i > r;) e[r].update(t) ? r++ : (e.splice(r, 1), i--); return !0 } } }(); return e.Tween = function(t) { var r = t,
i = {},
n = {},
o = 1e3,
a = 0,
s = null,
l = e.Easing.Linear.None,
u = e.Interpolation.Linear,
c = [],
h = null,
d = !1,
m = null,
p = null;
this.to = function(e, t) { return void 0 !== t && (o = t), n = e, this }, this.start = function(t) { e.add(this), d = !1, s = void 0 !== t ? t : Date.now(), s += a; for (var o in n)
if (null !== r[o]) { if (n[o] instanceof Array) { if (0 === n[o].length) continue;
n[o] = [r[o]].concat(n[o]) } i[o] = r[o] }
return this }, this.stop = function() { return e.remove(this), this }, this.delay = function(e) { return a = e, this }, this.easing = function(e) { return l = e, this }, this.interpolation = function(e) { return u = e, this }, this.chain = function() { return c = arguments, this }, this.onStart = function(e) { return h = e, this }, this.onUpdate = function(e) { return m = e, this }, this.onComplete = function(e) { return p = e, this }, this.update = function(e) { if (s > e) return !0;
d === !1 && (null !== h && h.call(r), d = !0); var t = (e - s) / o;
t = t > 1 ? 1 : t; var a = l(t); for (var f in i) { var v = i[f],
y = n[f];
r[f] = y instanceof Array ? u(y, a) : v + (y - v) * a } if (null !== m && m.call(r, a), 1 == t) { null !== p && p.call(r); for (var g = 0, _ = c.length; _ > g; g++) c[g].start(e); return !1 } return !0 } }, e.Easing = { Linear: { None: function(e) { return e } }, Quadratic: { In: function(e) { return e * e }, Out: function(e) { return e * (2 - e) }, InOut: function(e) { return (e *= 2) < 1 ? .5 * e * e : -.5 * (--e * (e - 2) - 1) } }, Cubic: { In: function(e) { return e * e * e }, Out: function(e) { return --e * e * e + 1 }, InOut: function(e) { return (e *= 2) < 1 ? .5 * e * e * e : .5 * ((e -= 2) * e * e + 2) } }, Quartic: { In: function(e) { return e * e * e * e }, Out: function(e) { return 1 - --e * e * e * e }, InOut: function(e) { return (e *= 2) < 1 ? .5 * e * e * e * e : -.5 * ((e -= 2) * e * e * e - 2) } }, Quintic: { In: function(e) { return e * e * e * e * e }, Out: function(e) { return --e * e * e * e * e + 1 }, InOut: function(e) { return (e *= 2) < 1 ? .5 * e * e * e * e * e : .5 * ((e -= 2) * e * e * e * e + 2) } }, Sinusoidal: { In: function(e) { return 1 - Math.cos(e * Math.PI / 2) }, Out: function(e) { return Math.sin(e * Math.PI / 2) }, InOut: function(e) { return .5 * (1 - Math.cos(Math.PI * e)) } }, Exponential: { In: function(e) { return 0 === e ? 0 : Math.pow(1024, e - 1) }, Out: function(e) { return 1 === e ? 1 : 1 - Math.pow(2, -10 * e) }, InOut: function(e) { return 0 === e ? 0 : 1 === e ? 1 : (e *= 2) < 1 ? .5 * Math.pow(1024, e - 1) : .5 * (-Math.pow(2, -10 * (e - 1)) + 2) } }, Circular: { In: function(e) { return 1 - Math.sqrt(1 - e * e) }, Out: function(e) { return Math.sqrt(1 - --e * e) }, InOut: function(e) { return (e *= 2) < 1 ? -.5 * (Math.sqrt(1 - e * e) - 1) : .5 * (Math.sqrt(1 - (e -= 2) * e) + 1) } }, Elastic: { In: function(e) { var t, r = .1,
i = .4; return 0 === e ? 0 : 1 === e ? 1 : (!r || 1 > r ? (r = 1, t = i / 4) : t = i * Math.asin(1 / r) / (2 * Math.PI), -(r * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - t) * 2 * Math.PI / i))) }, Out: function(e) { var t, r = .1,
i = .4; return 0 === e ? 0 : 1 === e ? 1 : (!r || 1 > r ? (r = 1, t = i / 4) : t = i * Math.asin(1 / r) / (2 * Math.PI), r * Math.pow(2, -10 * e) * Math.sin((e - t) * 2 * Math.PI / i) + 1) }, InOut: function(e) { var t, r = .1,
i = .4; return 0 === e ? 0 : 1 === e ? 1 : (!r || 1 > r ? (r = 1, t = i / 4) : t = i * Math.asin(1 / r) / (2 * Math.PI), (e *= 2) < 1 ? -.5 * r * Math.pow(2, 10 * (e -= 1)) * Math.sin((e - t) * 2 * Math.PI / i) : .5 * r * Math.pow(2, -10 * (e -= 1)) * Math.sin((e - t) * 2 * Math.PI / i) + 1) } }, Back: { In: function(e) { var t = 1.70158; return e * e * ((t + 1) * e - t) }, Out: function(e) { var t = 1.70158; return --e * e * ((t + 1) * e + t) + 1 }, InOut: function(e) { var t = 2.5949095; return (e *= 2) < 1 ? .5 * e * e * ((t + 1) * e - t) : .5 * ((e -= 2) * e * ((t + 1) * e + t) + 2) } }, Bounce: { In: function(t) { return 1 - e.Easing.Bounce.Out(1 - t) }, Out: function(e) { return 1 / 2.75 > e ? 7.5625 * e * e : 2 / 2.75 > e ? 7.5625 * (e -= 1.5 / 2.75) * e + .75 : 2.5 / 2.75 > e ? 7.5625 * (e -= 2.25 / 2.75) * e + .9375 : 7.5625 * (e -= 2.625 / 2.75) * e + .984375 }, InOut: function(t) { return .5 > t ? .5 * e.Easing.Bounce.In(2 * t) : .5 * e.Easing.Bounce.Out(2 * t - 1) + .5 } } }, e.Interpolation = { Linear: function(t, r) { var i = t.length - 1,
n = i * r,
o = Math.floor(n),
a = e.Interpolation.Utils.Linear; return 0 > r ? a(t[0], t[1], n) : r > 1 ? a(t[i], t[i - 1], i - n) : a(t[o], t[o + 1 > i ? i : o + 1], n - o) }, Bezier: function(t, r) { var i, n = 0,
o = t.length - 1,
a = Math.pow,
s = e.Interpolation.Utils.Bernstein; for (i = 0; o >= i; i++) n += a(1 - r, o - i) * a(r, i) * t[i] * s(o, i); return n }, CatmullRom: function(t, r) { var i = t.length - 1,
n = i * r,
o = Math.floor(n),
a = e.Interpolation.Utils.CatmullRom; return t[0] === t[i] ? (0 > r && (o = Math.floor(n = i * (1 + r))), a(t[(o - 1 + i) % i], t[o], t[(o + 1) % i], t[(o + 2) % i], n - o)) : 0 > r ? t[0] - (a(t[0], t[0], t[1], t[1], -n) - t[0]) : r > 1 ? t[i] - (a(t[i], t[i], t[i - 1], t[i - 1], n - i) - t[i]) : a(t[o ? o - 1 : 0], t[o], t[o + 1 > i ? i : o + 1], t[o + 2 > i ? i : o + 2], n - o) }, Utils: { Linear: function(e, t, r) { return (t - e) * r + e }, Bernstein: function(t, r) { var i = e.Interpolation.Utils.Factorial; return i(t) / i(r) / i(t - r) }, Factorial: function() { var e = [1]; return function(t) { var r, i = 1; if (e[t]) return e[t]; for (r = t; r > 1; r--) i *= r; return e[t] = i } }(), CatmullRom: function(e, t, r, i, n) { var o = .5 * (r - e),
a = .5 * (i - t),
s = n * n,
l = n * s; return (2 * t - 2 * r + o + a) * l + (-3 * t + 3 * r - 2 * o - a) * s + o * n + t } } }, e }), r("Scene/AnimationCollection", ["../Core/defined", "../Core/DeveloperError", "../Core/clone", "../ThirdParty/Tween", "../Core/defaultValue"], function(e, t, r, i, n) { "use strict"; var o = function() {}; return o.prototype.add = function(o) { if (o = n(o, n.EMPTY_OBJECT), !e(o.duration)) throw new t("duration is required."); if (o.duration > 0) { var a = n(o.delayDuration, 0),
s = n(o.easingFunction, i.Easing.Linear.None),
l = r(o.startValue),
u = new i.Tween(l); return u.onCancel = o.onCancel, u.to(o.stopValue, o.duration), u.delay(a), u.easing(s), "function" == typeof o.onUpdate && u.onUpdate(function() { o.onUpdate(l) }), u.onComplete(n(o.onComplete, null)), u.start(), { _tween: u } } "function" == typeof o.onComplete && o.onComplete() }, o.prototype.addAlpha = function(r, o, a, s) { if (!e(r)) throw new t("material is required."); var l = []; for (var u in r.uniforms) r.uniforms.hasOwnProperty(u) && e(r.uniforms[u]) && e(r.uniforms[u].alpha) && l.push(u); if (0 === l.length) throw new t("material has no properties with alpha components.");
o = n(o, 0), a = n(a, 1), s = n(s, n.EMPTY_OBJECT); var c = n(s.duration, 3e3),
h = n(s.delayDuration, 0),
d = n(s.easingFunction, i.Easing.Linear.None),
m = { alpha: o },
p = new i.Tween(m); return p.to({ alpha: a }, c), p.delay(h), p.easing(d), p.onUpdate(function() { for (var e = l.length, t = 0; e > t; ++t) r.uniforms[l[t]].alpha = m.alpha }), p.onComplete(n(s.onComplete, null)), p.start(), { _tween: p } }, o.prototype.addProperty = function(r, o, a, s, l) { if (!e(r)) throw new t("object is required."); if (!e(o)) throw new t("property is required."); if (!e(r[o])) throw new t("object must have the specified property.");
l = n(l, n.EMPTY_OBJECT); var u = n(l.duration, 3e3),
c = n(l.delayDuration, 0),
h = n(l.easingFunction, i.Easing.Linear.None),
d = { value: a },
m = new i.Tween(d); return m.to({ value: s }, u), m.delay(c), m.easing(h), m.onUpdate(function() { r[o] = d.value }), m.onComplete(n(l.onComplete, null)), m.start(), { _tween: m } }, o.prototype.addOffsetIncrement = function(r, o) { if (!e(r)) throw new t("material is required."); if (!e(r.uniforms.offset)) throw new t("material must have an offset property.");
o = n(o, n.EMPTY_OBJECT); var a = n(o.duration, 3e3),
s = n(o.delayDuration, 0),
l = n(o.easingFunction, i.Easing.Linear.None),
u = { offset: r.uniforms.offset },
c = new i.Tween(u); return c.to({ offset: r.uniforms.offset + 1 }, a), c.delay(s), c.easing(l), c.onUpdate(function() { r.uniforms.offset = u.offset }), c.onComplete(function() { c.to({ offset: r.uniforms.offset + 1 }, a), c.start() }), c.start(), { _tween: c } }, o.prototype.remove = function(t) { if (e(t)) { var r = i.getAll().length; return i.remove(t._tween), i.getAll().length === r - 1 } return !1 }, o.prototype.removeAll = function() { for (var e = i.getAll(), t = e.length, r = -1; ++r < t;) { var n = e[r]; "function" == typeof n.onCancel && n.onCancel() } i.removeAll() }, o.prototype.contains = function(t) { return e(t) ? -1 !== i.getAll().indexOf(t._tween) : !1 }, o.prototype.update = function() { i.update() }, o }), r("Scene/Credit", ["../Core/defined", "../Core/DeveloperError"], function(e, t) { "use strict"; var r = function(r, i, n) { var o = e(n),
a = e(i),
s = e(r); if (!s && !a && !o) throw new t("text, imageUrl or link is required");
s || a || (r = n), this._text = r, this._imageUrl = i, this._link = n, this._hasLink = o, this._hasImage = a }; return r.prototype.hasImage = function() { return this._hasImage }, r.prototype.hasLink = function() { return this._hasLink }, r.prototype.getText = function() { return this._text }, r.prototype.getImageUrl = function() { return this._imageUrl }, r.prototype.getLink = function() { return this._link }, r.equals = function(t, r) { var i = !e(t),
n = !e(r); return t === r || (i && n || !i && !n) && t._text === r._text && t._imageUrl === r._imageUrl && t._link === r._link }, r.prototype.equals = function(e) { return r.equals(this, e) }, r }), r("Scene/TerrainProvider", ["../Core/defined", "../Core/DeveloperError", "../Core/ComponentDatatype", "../Renderer/BufferUsage", "../Core/IndexDatatype"], function(e, t, r, i, n) { "use strict";
function o(e, t, r, i, n) { return e[t++] = r, e[t++] = i, e[t++] = i, e[t++] = n, e[t++] = n, e[t++] = r, t }
function a(e) { for (var t = e.length, r = new Uint16Array(2 * t), i = 0, n = 0; t > n; n += 3) i = o(r, i, e[n], e[n + 1], e[n + 2]); return r } var s = function() { throw new t("This type should not be instantiated directly.") };
s.attributeIndices = { position3DAndHeight: 0, textureCoordinates: 1 }; var l = []; return s.getRegularGridIndices = function(t, r) { var i = l[t];
e(i) || (l[t] = i = []); var n = i[r]; if (!e(n)) { n = i[r] = new Uint16Array(6 * (t - 1) * (r - 1)); for (var o = 0, a = 0, s = 0; r - 1 > s; ++s) { for (var u = 0; t - 1 > u; ++u) { var c = o,
h = c + t,
d = h + 1,
m = c + 1;
n[a++] = c, n[a++] = h, n[a++] = m, n[a++] = m, n[a++] = h, n[a++] = d, ++o }++o } } return n }, s.createTileEllipsoidGeometryFromBuffers = function(t, o, a, l) { var u = r.FLOAT,
c = o.vertices,
h = t.createVertexBuffer(c, i.STATIC_DRAW),
d = 5 * u.sizeInBytes,
m = 3;
l && (d += u.sizeInBytes, ++m); var p = [{ index: s.attributeIndices.position3DAndHeight, vertexBuffer: h, componentDatatype: u, componentsPerAttribute: m, offsetInBytes: 0, strideInBytes: d }, { index: s.attributeIndices.textureCoordinates, vertexBuffer: h, componentDatatype: u, componentsPerAttribute: 2, offsetInBytes: m * u.sizeInBytes, strideInBytes: d }],
f = o.indices.indexBuffers || {},
v = f[t.getId()]; if (!e(v) || v.isDestroyed()) { var y = o.indices;
v = t.createIndexBuffer(y, i.STATIC_DRAW, n.UNSIGNED_SHORT), v.setVertexArrayDestroyable(!1), v.referenceCount = 1, f[t.getId()] = v, o.indices.indexBuffers = f } else ++v.referenceCount;
a.vertexArray = t.createVertexArray(p, v) }, s.createWireframeVertexArray = function(e, t, r) { var o = a(r.indices),
s = e.createIndexBuffer(o, i.STATIC_DRAW, n.UNSIGNED_SHORT); return e.createVertexArray(t._attributes, s) }, s.heightmapTerrainQuality = .25, s.getEstimatedLevelZeroGeometricErrorForAHeightmap = function(e, t, r) { return 2 * e.getMaximumRadius() * Math.PI * s.heightmapTerrainQuality / (t * r) }, s.prototype.requestTileGeometry = function() { throw new t("This type should not be instantiated directly.") }, s.prototype.getErrorEvent = function() { throw new t("This type should not be instantiated directly.") }, s.prototype.getLevelMaximumGeometricError = function() { throw new t("This type should not be instantiated directly.") }, s.prototype.getCredit = function() { throw new t("This type should not be instantiated directly.") }, s.prototype.getTilingScheme = function() { throw new t("This type should not be instantiated directly.") }, s.prototype.hasWaterMask = function() { throw new t("This type should not be instantiated directly.") }, s.prototype.isReady = function() { throw new t("This type should not be instantiated directly.") }, s }), r("Scene/ImageryState", ["../Core/Enumeration"], function(e) { "use strict"; var t = { UNLOADED: new e(0, "UNLOADED"), TRANSITIONING: new e(1, "TRANSITIONING"), RECEIVED: new e(2, "RECEIVED"), TEXTURE_LOADED: new e(3, "TEXTURE_LOADED"), READY: new e(4, "READY"), FAILED: new e(5, "FAILED"), INVALID: new e(6, "INVALID"), PLACEHOLDER: new e(7, "PLACEHOLDER") }; return t }), r("Scene/TerrainState", ["../Core/Enumeration"], function(e) { "use strict"; var t = { FAILED: new e(0, "FAILED"), UNLOADED: new e(1, "UNLOADED"), RECEIVING: new e(2, "RECEIVING"), RECEIVED: new e(3, "RECEIVED"), TRANSFORMING: new e(4, "TRANSFORMING"), TRANSFORMED: new e(5, "TRANSFORMED"), READY: new e(6, "READY") }; return t }), r("Scene/TileState", ["../Core/Enumeration"], function(e) { "use strict"; var t = { START: new e(0, "START"), LOADING: new e(1, "LOADING"), READY: new e(2, "READY") }; return t }), r("Scene/TileProviderError", ["../Core/defaultValue", "../Core/defined"], function(e, t) { "use strict"; var r = function(t, r, i, n, o, a) { this.provider = t, this.message = r, this.x = i, this.y = n, this.level = o, this.timesRetried = e(a, 0), this.retry = !1 }; return r.handleError = function(e, i, n, o, a, s, l, u) { var c = e; return t(e) ? (c.provider = i, c.message = o, c.x = a, c.y = s, c.level = l, c.retry = !1, ++c.timesRetried) : c = new r(i, o, a, s, l, 0), n.getNumberOfListeners() > 0 ? n.raiseEvent(c) : (console.log('An error occurred in "' + i.constructor.name + '":'), console.log(o)), c.retry && t(u) && u(), c }, r.handleSuccess = function(e) { t(e) && (e.timesRetried = -1) }, r }), r("Scene/TileTerrain", ["../Core/BoundingSphere", "../Core/Cartesian3", "../Core/defined", "../Core/DeveloperError", "./TerrainProvider", "./TerrainState", "./TileProviderError", "../ThirdParty/when"], function(e, t, r, i, n, o, a, s) { "use strict";
function l(e, t, i, n, l) {
function u(t) { e.data = t, e.state = o.RECEIVED }
function c() { e.state = o.FAILED; var r = "Failed to obtain terrain tile X: " + i + " Y: " + n + " Level: " + l + ".";
t._requestError = a.handleError(t._requestError, t, t.getErrorEvent(), r, i, n, l, h) }
function h() { e.data = t.requestTileGeometry(i, n, l), r(e.data) ? (e.state = o.RECEIVING, s(e.data, u, c)) : e.state = o.UNLOADED } h() }
function u(e, t, i, n, a, l) { var u = i.getTilingScheme(),
c = e.data,
h = c.createMesh(u, n, a, l);
r(h) && (e.state = o.TRANSFORMING, s(h, function(t) { e.mesh = t, e.state = o.TRANSFORMED }, function() { e.state = o.FAILED })) }
function c(e, t) { n.createTileEllipsoidGeometryFromBuffers(t, e.mesh, e, !0), e.state = o.READY } var h = function(e) { this.state = o.UNLOADED, this.data = void 0, this.mesh = void 0, this.vertexArray = void 0, this.upsampleDetails = e }; return h.prototype.freeResources = function() { if (this.state = o.UNLOADED, this.data = void 0, this.mesh = void 0, r(this.vertexArray)) { var e = this.vertexArray.getIndexBuffer();
this.vertexArray.destroy(), this.vertexArray = void 0, !e.isDestroyed() && r(e.referenceCount) && (--e.referenceCount, 0 === e.referenceCount && e.destroy()) } }, h.prototype.publishToTile = function(r) { var i = this.mesh;
t.clone(i.center, r.center), r.minimumHeight = i.minimumHeight, r.maximumHeight = i.maximumHeight, e.clone(i.boundingSphere3D, r.boundingSphere3D), t.clone(i.occludeePointInScaledSpace, r.occludeePointInScaledSpace), r.freeVertexArray(), r.vertexArray = this.vertexArray, this.vertexArray = void 0 }, h.prototype.processLoadStateMachine = function(e, t, r, i, n) { this.state === o.UNLOADED && l(this, t, r, i, n), this.state === o.RECEIVED && u(this, e, t, r, i, n), this.state === o.TRANSFORMED && c(this, e, t, r, i, n) }, h.prototype.processUpsampleStateMachine = function(e, t, n, a, l) { if (this.state === o.UNLOADED) { var h = this.upsampleDetails; if (!r(h)) throw new i("TileTerrain cannot upsample unless provided upsampleDetails."); var d = h.data,
m = h.x,
p = h.y,
f = h.level; if (this.data = d.upsample(t.getTilingScheme(), m, p, f, n, a, l), !r(this.data)) return;
this.state = o.RECEIVING; var v = this;
s(this.data, function(e) { v.data = e, v.state = o.RECEIVED }, function() { v.state = o.FAILED }) } this.state === o.RECEIVED && u(this, e, t, n, a, l), this.state === o.TRANSFORMED && c(this, e, t, n, a, l) }, h }), r("Scene/Tile", ["../Core/BoundingSphere", "../Core/Cartesian3", "../Core/Cartesian4", "../Core/defined", "../Core/DeveloperError", "./ImageryState", "./TerrainState", "./TileState", "./TileTerrain", "../Renderer/PixelDatatype", "../Renderer/PixelFormat", "../Renderer/TextureMagnificationFilter", "../Renderer/TextureMinificationFilter", "../Renderer/TextureWrap"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m) { "use strict";
function p(e, r, n) { var o = v(e);
i(o) && (e.upsampledTerrain = new l(o)), _(e) && (e.loadedTerrain = new l); for (var a = 0, s = n.getLength(); s > a; ++a) { var u = n.get(a);
u.show && u._createTileImagerySkeletons(e, r) } var c = e.tilingScheme.getEllipsoid(),
h = e.extent;
c.cartographicToCartesian(h.getSouthwest(), e.southwestCornerCartesian); var d = c.cartographicToCartesian(h.getSoutheast(), b);
c.cartographicToCartesian(h.getNortheast(), e.northeastCornerCartesian); var m = c.cartographicToCartesian(h.getNorthwest(), T);
t.UNIT_Z.cross(e.southwestCornerCartesian.negate(S), S).normalize(e.westNormal), e.northeastCornerCartesian.negate(S).cross(t.UNIT_Z, S).normalize(e.eastNormal), c.geodeticSurfaceNormal(d, S).cross(e.southwestCornerCartesian.subtract(d, E), S).normalize(e.southNormal), c.geodeticSurfaceNormal(m, S).cross(e.northeastCornerCartesian.subtract(m, E), S).normalize(e.northNormal) }
function f(e, t, r) { var n = e.loadedTerrain,
o = e.upsampledTerrain,
s = !1; if (i(n)) { if (n.processLoadStateMachine(t, r, e.x, e.y, e.level), n.state.value >= a.RECEIVED.value) { if (e.terrainData !== n.data) { e.terrainData = n.data; var l = e.terrainData.getWaterMask();
i(l) && (i(e.waterMaskTexture) && (--e.waterMaskTexture.referenceCount, 0 === e.waterMaskTexture.referenceCount && e.waterMaskTexture.destroy()), e.waterMaskTexture = w(t, l), e.waterMaskTranslationAndScale.x = 0, e.waterMaskTranslationAndScale.y = 0, e.waterMaskTranslationAndScale.z = 1, e.waterMaskTranslationAndScale.w = 1), g(e) } s = !0 } n.state === a.READY ? (n.publishToTile(e), e.loadedTerrain = void 0, e.upsampledTerrain = void 0) : n.state === a.FAILED && (e.loadedTerrain = void 0) }!s && i(o) && (o.processUpsampleStateMachine(t, r, e.x, e.y, e.level), o.state.value >= a.RECEIVED.value && e.terrainData !== o.data && (e.terrainData = o.data, r.hasWaterMask() && C(e, t), y(e)), o.state === a.READY ? (o.publishToTile(e), e.upsampledTerrain = void 0) : o.state === a.FAILED && (e.upsampledTerrain = void 0)) }
function v(e) { for (var t = e.parent; i(t) && !i(t.terrainData);) t = t.parent; return i(t) ? { data: t.terrainData, x: t.x, y: t.y, level: t.level } : void 0 }
function y(e) { if (i(e.children))
for (var t = 0; 4 > t; ++t) { var r = e.children[t]; if (r.state !== s.START) { if (i(r.terrainData) && !r.terrainData.wasCreatedByUpsampling()) continue;
i(r.upsampledTerrain) && r.upsampledTerrain.freeResources(), r.upsampledTerrain = new l({ data: e.terrainData, x: e.x, y: e.y, level: e.level }), r.state = s.LOADING } } }
function g(e) { if (i(e.children))
for (var t = 0; 4 > t; ++t) { var r = e.children[t]; if (r.state !== s.START) { if (i(r.terrainData) && !r.terrainData.wasCreatedByUpsampling()) continue;
i(r.upsampledTerrain) && r.upsampledTerrain.freeResources(), r.upsampledTerrain = new l({ data: e.terrainData, x: e.x, y: e.y, level: e.level }), e.terrainData.isChildAvailable(e.x, e.y, r.x, r.y) && (i(r.loadedTerrain) || (r.loadedTerrain = new l)), r.state = s.LOADING } } }
function _(e) { var t = e.parent; return i(t) ? i(t.terrainData) ? t.terrainData.isChildAvailable(t.x, t.y, e.x, e.y) : !1 : !0 }
function w(e, t) { var r, n = e.cache.tile_waterMaskData;
i(n) || (n = e.cache.tile_waterMaskData = { allWaterTexture: void 0, allLandTexture: void 0, sampler: void 0, destroy: function() { i(this.allWaterTexture) && this.allWaterTexture.destroy(), i(this.allLandTexture) && this.allLandTexture.destroy() } }); var o = Math.sqrt(t.length); return 1 !== o || 0 !== t[0] && 255 !== t[0] ? (r = e.createTexture2D({ pixelFormat: c.LUMINANCE, pixelDatatype: u.UNSIGNED_BYTE, source: { width: o, height: o, arrayBufferView: t } }), r.referenceCount = 0, i(n.sampler) || (n.sampler = e.createSampler({ wrapS: m.CLAMP, wrapT: m.CLAMP, minificationFilter: d.LINEAR, magnificationFilter: h.LINEAR })), r.setSampler(n.sampler)) : (i(n.allWaterTexture) || (n.allWaterTexture = e.createTexture2D({ pixelFormat: c.LUMINANCE, pixelDatatype: u.UNSIGNED_BYTE, source: { arrayBufferView: new Uint8Array([255]), width: 1, height: 1 } }), n.allWaterTexture.referenceCount = 1, n.allLandTexture = e.createTexture2D({ pixelFormat: c.LUMINANCE, pixelDatatype: u.UNSIGNED_BYTE, source: { arrayBufferView: new Uint8Array([0]), width: 1, height: 1 } }), n.allLandTexture.referenceCount = 1), r = 0 === t[0] ? n.allLandTexture : n.allWaterTexture), ++r.referenceCount, r }
function C(e) { for (var t = e.parent; i(t) && !i(t.terrainData) || t.terrainData.wasCreatedByUpsampling();) t = t.parent; if (i(t) && i(t.waterMaskTexture)) { e.waterMaskTexture = t.waterMaskTexture, ++e.waterMaskTexture.referenceCount; var r = t.extent,
n = e.extent,
o = n.east - n.west,
a = n.north - n.south,
s = o / (r.east - r.west),
l = a / (r.north - r.south);
e.waterMaskTranslationAndScale.x = s * (n.west - r.west) / o, e.waterMaskTranslationAndScale.y = l * (n.south - r.south) / a, e.waterMaskTranslationAndScale.z = s, e.waterMaskTranslationAndScale.w = l } } var x = function(o) { if (!i(o)) throw new n("description is required."); if (i(o.x) && i(o.y)) { if (o.x < 0 || o.y < 0) throw new n("description.x and description.y must be greater than or equal to zero.") } else if (!i(o.extent)) throw new n("Either description.extent is required or description.x and description.y are required."); if (!i(o.level) || o.zoom < 0) throw new n("description.level is required and must be greater than or equal to zero."); if (!i(o.tilingScheme)) throw new n("description.tilingScheme is required.");
this.tilingScheme = o.tilingScheme, this.x = o.x, this.y = o.y, this.level = o.level, this.parent = o.parent, this.children = void 0, this.extent = this.tilingScheme.tileXYToExtent(this.x, this.y, this.level), this.state = s.START, this.replacementPrevious = void 0, this.replacementNext = void 0, this.imagery = [], this.distance = 0, this.southwestCornerCartesian = new t, this.northeastCornerCartesian = new t, this.westNormal = new t, this.southNormal = new t, this.eastNormal = new t, this.northNormal = new t, this.waterMaskTexture = void 0, this.waterMaskTranslationAndScale = new r(0, 0, 1, 1), this.terrainData = void 0, this.center = new t, this.vertexArray = void 0, this.minimumHeight = 0, this.maximumHeight = 0, this.boundingSphere3D = new e, this.boundingSphere2D = new e, this.occludeePointInScaledSpace = new t, this.isRenderable = !1, this.loadedTerrain = void 0, this.upsampledTerrain = void 0 };
x.prototype.getChildren = function() { if (!i(this.children)) { var e = this.tilingScheme,
t = this.level + 1,
r = 2 * this.x,
n = 2 * this.y;
this.children = [new x({ tilingScheme: e, x: r, y: n, level: t, parent: this }), new x({ tilingScheme: e, x: r + 1, y: n, level: t, parent: this }), new x({ tilingScheme: e, x: r, y: n + 1, level: t, parent: this }), new x({ tilingScheme: e, x: r + 1, y: n + 1, level: t, parent: this })] } return this.children }, x.prototype.freeResources = function() { i(this.waterMaskTexture) && (--this.waterMaskTexture.referenceCount, 0 === this.waterMaskTexture.referenceCount && this.waterMaskTexture.destroy(), this.waterMaskTexture = void 0), this.state = s.START, this.isRenderable = !1, this.terrainData = void 0, i(this.loadedTerrain) && (this.loadedTerrain.freeResources(), this.loadedTerrain = void 0), i(this.upsampledTerrain) && (this.upsampledTerrain.freeResources(), this.upsampledTerrain = void 0); var e, t, r = this.imagery; for (e = 0, t = r.length; t > e; ++e) r[e].freeResources(); if (this.imagery.length = 0, i(this.children)) { for (e = 0, t = this.children.length; t > e; ++e) this.children[e].freeResources();
this.children = void 0 } this.freeVertexArray() }, x.prototype.freeVertexArray = function() { var e;
i(this.vertexArray) && (e = this.vertexArray.getIndexBuffer(), this.vertexArray.destroy(), this.vertexArray = void 0, !e.isDestroyed() && i(e.referenceCount) && (--e.referenceCount, 0 === e.referenceCount && e.destroy())), "undefined" != typeof this.wireframeVertexArray && (e = this.wireframeVertexArray.getIndexBuffer(), this.wireframeVertexArray.destroy(), this.wireframeVertexArray = void 0, e.isDestroyed() || "undefined" == typeof e.referenceCount || (--e.referenceCount, 0 === e.referenceCount && e.destroy())) }, x.prototype.processStateMachine = function(e, t, r) { this.state === s.START && (p(this, t, r), this.state = s.LOADING), this.state === s.LOADING && f(this, e, t); for (var n = i(this.vertexArray), a = !i(this.loadedTerrain) && !i(this.upsampledTerrain), l = this.imagery, u = 0, c = l.length; c > u; ++u) { var h = l[u]; if (i(h.loadingImagery)) { if (h.loadingImagery.state === o.PLACEHOLDER) { var d = h.loadingImagery.imageryLayer; if (d.getImageryProvider().isReady()) { h.freeResources(), l.splice(u, 1), d._createTileImagerySkeletons(this, t, u), --u, c = l.length; continue } } var m = h.processStateMachine(this, e);
a = a && m, n = n && (m || i(h.readyImagery)) } } u === c && (n && (this.isRenderable = !0), a && (this.state = s.READY)) }; var S = new t,
E = new t,
b = new t,
T = new t; return x }), r("Scene/TilingScheme", ["../Core/defined", "../Core/DeveloperError", "./Tile"], function(e, t, r) { "use strict"; var i = function() { throw new t("This type should not be instantiated directly. Instead, use WebMercatorTilingScheme or GeographicTilingScheme.") }; return i.prototype.getEllipsoid = function() { throw new t("This type should not be instantiated directly.") }, i.prototype.getExtent = function() { throw new t("This type should not be instantiated directly.") }, i.prototype.getProjection = function() { throw new t("This type should not be instantiated directly.") }, i.prototype.getNumberOfXTilesAtLevel = function() { throw new t("This type should not be instantiated directly.") }, i.prototype.getNumberOfYTilesAtLevel = function() { throw new t("This type should not be instantiated directly.") }, i.prototype.createLevelZeroTiles = function() { throw new t("This type should not be instantiated directly.") }, i.prototype.extentToNativeExtent = function() { throw new t("This type should not be instantiated directly.") }, i.prototype.tileXYToNativeExtent = function() { throw new t("This type should not be instantiated directly.") }, i.prototype.tileXYToExtent = function() { throw new t("This type should not be instantiated directly.") }, i.prototype.positionToTileXY = function() { throw new t("This type should not be instantiated directly.") }, i.createRectangleOfLevelZeroTiles = function(i, n, o) { if (!e(i)) throw new t("tilingScheme is required."); if (!e(n)) throw new t("numberOfLevelZeroTilesX is required."); if (!e(o)) throw new t("numberOfLevelZeroTilesY is required."); for (var a = new Array(n * o), s = 0, l = 0; o > l; ++l)
for (var u = 0; n > u; ++u) a[s++] = new r({ tilingScheme: i, x: u, y: l, level: 0 }); return a }, i }), r("Scene/GeographicTilingScheme", ["../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/Math", "../Core/Cartesian2", "../Core/Ellipsoid", "../Core/Extent", "../Core/GeographicProjection", "./TilingScheme"], function(e, t, r, i, n, o, a, s, l) { "use strict"; var u = function(t) { t = e(t, {}), this._ellipsoid = e(t.ellipsoid, o.WGS84), this._extent = e(t.extent, a.MAX_VALUE), this._projection = new s(this._ellipsoid), this._numberOfLevelZeroTilesX = e(t.numberOfLevelZeroTilesX, 2), this._numberOfLevelZeroTilesY = e(t.numberOfLevelZeroTilesY, 1) }; return u.prototype.getEllipsoid = function() { return this._ellipsoid }, u.prototype.getExtent = function() { return this._extent }, u.prototype.getProjection = function() { return this._projection }, u.prototype.getNumberOfXTilesAtLevel = function(e) { return this._numberOfLevelZeroTilesX << e }, u.prototype.getNumberOfYTilesAtLevel = function(e) { return this._numberOfLevelZeroTilesY << e }, u.prototype.createLevelZeroTiles = function() { return l.createRectangleOfLevelZeroTiles(this, this._numberOfLevelZeroTilesX, this._numberOfLevelZeroTilesY) }, u.prototype.extentToNativeExtent = function(e, n) { if (!t(e)) throw new r("extent is required."); var o = i.toDegrees(e.west),
s = i.toDegrees(e.south),
l = i.toDegrees(e.east),
u = i.toDegrees(e.north); return t(n) ? (n.west = o, n.south = s, n.east = l, n.north = u, n) : new a(o, s, l, u) }, u.prototype.tileXYToNativeExtent = function(e, t, r, n) { var o = this.tileXYToExtent(e, t, r, n); return o.west = i.toDegrees(o.west), o.south = i.toDegrees(o.south), o.east = i.toDegrees(o.east), o.north = i.toDegrees(o.north), o }, u.prototype.tileXYToExtent = function(e, r, i, n) { var o = this._extent,
s = this.getNumberOfXTilesAtLevel(i),
l = this.getNumberOfYTilesAtLevel(i),
u = (o.east - o.west) / s,
c = e * u + o.west,
h = (e + 1) * u + o.west,
d = (o.north - o.south) / l,
m = o.north - r * d,
p = o.north - (r + 1) * d; return t(n) || (n = new a(c, p, h, m)), n.west = c, n.south = p, n.east = h, n.north = m, n }, u.prototype.positionToTileXY = function(e, r, i) { var o = this._extent; if (e.latitude > o.north || e.latitude < o.south || e.longitude < o.west || e.longitude > o.east) return void 0; var a = this.getNumberOfXTilesAtLevel(r),
s = this.getNumberOfYTilesAtLevel(r),
l = (o.east - o.west) / a,
u = (o.north - o.south) / s,
c = 0 | (e.longitude - o.west) / l;
c >= a && (c = a - 1); var h = 0 | (o.north - e.latitude) / u; return h >= s && (h = s - 1), t(i) ? (i.x = c, i.y = h, i) : new n(c, h) }, u }), r("Scene/TerrainMesh", [], function() { "use strict"; var e = function(e, t, r, i, n, o, a) { this.center = e, this.vertices = t, this.indices = r, this.minimumHeight = i, this.maximumHeight = n, this.boundingSphere3D = o, this.occludeePointInScaledSpace = a }; return e }), r("Scene/HeightmapTerrainData", ["../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/HeightmapTessellator", "../Core/Math", "../Core/TaskProcessor", "./GeographicTilingScheme", "./TerrainMesh", "./TerrainProvider", "../ThirdParty/when"], function(e, t, r, i, n, o, a, s, l, u) {
"use strict";
function c(e, t, r, i, n, o, a) { var s = 1,
l = e._width,
u = e._height,
c = o * (l - 1),
h = c + l - 1,
d = a * (u - 1),
m = d + u - 1,
p = 1 << s;
c /= p, h /= p, d /= p, m /= p; var f = r * (l - 1),
v = i * (u - 1);
c -= f, h -= f, d -= v, m -= v; var g, _, w = 0 | c,
C = 0 | h,
x = 0 | d,
S = 0 | m,
E = C - w + 1,
b = S - x + 1,
T = e._buffer,
A = e._structure,
M = E * b,
P = M * A.stride,
D = new T.constructor(P),
I = 0,
O = A.stride; if (O > 1)
for (_ = x; S >= _; ++_)
for (g = w; C >= g; ++g)
for (var R = (_ * l + g) * O, L = 0; O > L; ++L) D[I++] = T[R + L];
else
for (_ = x; S >= _; ++_)
for (g = w; C >= g; ++g) D[I++] = T[_ * l + g]; return new y({ buffer: D, width: E, height: b, childTileMask: 0, structure: e._structure, createdByUpsampling: !0 }) }
function h(e, t, r, i, o, a, s, l) { var u, c, h, p, f = e._width,
g = e._height,
_ = e._structure,
w = _.stride,
C = e._buffer,
x = new C.constructor(f * g * w),
S = t.tileXYToExtent(r, i, o),
E = t.tileXYToExtent(a, s, l); if (w > 1) { var b = _.elementsPerHeight,
T = _.elementMultiplier,
A = _.isBigEndian,
M = Math.pow(T, b - 1); for (c = 0; g > c; ++c)
for (h = n.lerp(E.north, E.south, c / (g - 1)), u = 0; f > u; ++u) { p = n.lerp(E.west, E.east, u / (f - 1)); var P = m(C, b, T, w, A, S, f, g, p, h);
v(x, b, T, M, w, A, c * f + u, P) } } else
for (c = 0; g > c; ++c)
for (h = n.lerp(E.north, E.south, c / (g - 1)), u = 0; f > u; ++u) p = n.lerp(E.west, E.east, u / (f - 1)), x[c * f + u] = d(C, S, f, g, p, h); return new y({ buffer: x, width: f, height: g, childTileMask: 0, structure: e._structure, createdByUpsampling: !0 }) }
function d(e, t, r, i, n, o) { var a = (n - t.west) * (r - 1) / (t.east - t.west),
s = (o - t.south) * (i - 1) / (t.north - t.south),
l = 0 | a,
u = l + 1;
u >= r && (u = r - 1, l = r - 2); var c = 0 | s,
h = c + 1;
h >= i && (h = i - 1, c = i - 2); var d = a - l,
m = s - c;
c = i - 1 - c, h = i - 1 - h; var f = e[c * r + l],
v = e[c * r + u],
y = e[h * r + l],
g = e[h * r + u]; return p(d, m, f, v, y, g) }
function m(e, t, r, i, n, o, a, s, l, u) { var c = (l - o.west) * (a - 1) / (o.east - o.west),
h = (u - o.south) * (s - 1) / (o.north - o.south),
d = 0 | c,
m = d + 1;
m >= a && (m = a - 1, d = a - 2); var v = 0 | h,
y = v + 1;
y >= s && (y = s - 1, v = s - 2); var g = c - d,
_ = h - v;
v = s - 1 - v, y = s - 1 - y; var w = f(e, t, r, i, n, v * a + d),
C = f(e, t, r, i, n, v * a + m),
x = f(e, t, r, i, n, y * a + d),
S = f(e, t, r, i, n, y * a + m); return p(g, _, w, C, x, S) }
function p(e, t, r, i, n, o) { return e > t ? r + e * (i - r) + t * (o - i) : r + e * (o - n) + t * (n - r) }
function f(e, t, r, i, n, o) { o *= i; var a, s = 0; if (n)
for (a = 0; t > a; ++a) s = s * r + e[o + a];
else
for (a = t - 1; a >= 0; --a) s = s * r + e[o + a]; return s }
function v(e, t, r, i, n, o, a, s) { a *= n; var l; if (o)
for (l = 0; t > l; ++l) e[a + l] = 0 | s / i, s -= e[a + l] * i, i /= r;
else
for (l = t - 1; l >= 0; --l) e[a + l] = 0 | s / i, s -= e[a + l] * i, i /= r }
var y = function(n) { if (!t(n) || !t(n.buffer)) throw new r("description.buffer is required."); if (!t(n.width)) throw new r("description.width is required."); if (!t(n.height)) throw new r("description.height is required.");
this._buffer = n.buffer, this._width = n.width, this._height = n.height, this._childTileMask = e(n.childTileMask, 15); var o = i.DEFAULT_STRUCTURE,
a = n.structure;
t(a) ? a !== o && (a.heightScale = e(a.heightScale, o.heightScale), a.heightOffset = e(a.heightOffset, o.heightOffset), a.elementsPerHeight = e(a.elementsPerHeight, o.elementsPerHeight), a.stride = e(a.stride, o.stride), a.elementMultiplier = e(a.elementMultiplier, o.elementMultiplier), a.isBigEndian = e(a.isBigEndian, o.isBigEndian)) : a = o, this._structure = a, this._createdByUpsampling = e(n.createdByUpsampling, !1), this._waterMask = n.waterMask },
g = new o("createVerticesFromHeightmap");
return y.prototype.createMesh = function(e, i, n, o) { if (!t(e)) throw new r("tilingScheme is required."); if (!t(i)) throw new r("x is required."); if (!t(n)) throw new r("y is required."); if (!t(o)) throw new r("level is required."); var c = e.getEllipsoid(),
h = e.tileXYToNativeExtent(i, n, o),
d = e.tileXYToExtent(i, n, o),
m = c.cartographicToCartesian(d.getCenter()),
p = this._structure,
f = l.getEstimatedLevelZeroGeometricErrorForAHeightmap(c, this._width, e.getNumberOfXTilesAtLevel(0)),
v = f / (1 << o),
y = g.scheduleTask({ heightmap: this._buffer, structure: p, width: this._width, height: this._height, nativeExtent: h, extent: d, relativeToCenter: m, ellipsoid: c, skirtHeight: Math.min(4 * v, 1e3), isGeographic: e instanceof a }); return t(y) ? u(y, function(e) { return new s(m, new Float32Array(e.vertices), l.getRegularGridIndices(e.gridWidth, e.gridHeight), e.minimumHeight, e.maximumHeight, e.boundingSphere3D, e.occludeePointInScaledSpace) }) : void 0 }, y.prototype.interpolateHeight = function(e, t, r) {
var i, n = this._width,
o = this._height,
a = this._structure,
s = a.stride;
if (s > 1) { var l = a.elementsPerHeight,
u = a.elementMultiplier,
c = a.isBigEndian;
i = m(this._buffer, l, u, s, c, e, n, o, t, r) } else i = d(this._buffer, e, n, o, t, r);
return i * a.heightScale + a.heightOffset
}, y.prototype.upsample = function(e, i, n, o, a, s, l) { if (!t(e)) throw new r("tilingScheme is required."); if (!t(i)) throw new r("thisX is required."); if (!t(n)) throw new r("thisY is required."); if (!t(o)) throw new r("thisLevel is required."); if (!t(a)) throw new r("descendantX is required."); if (!t(s)) throw new r("descendantY is required."); if (!t(l)) throw new r("descendantLevel is required."); var u = l - o; if (u > 1) throw new r("Upsampling through more than one level at a time is not currently supported."); var d; return d = 1 === this._width % 2 && 1 === this._height % 2 ? c(this, e, i, n, o, a, s, l) : h(this, e, i, n, o, a, s, l) }, y.prototype.isChildAvailable = function(e, i, n, o) { if (!t(e)) throw new r("thisX is required."); if (!t(i)) throw new r("thisY is required."); if (!t(n)) throw new r("childX is required."); if (!t(o)) throw new r("childY is required."); var a = 2; return n !== 2 * e && ++a, o !== 2 * i && (a -= 2), 0 !== (this._childTileMask & 1 << a) }, y.prototype.getWaterMask = function() { return this._waterMask }, y.prototype.wasCreatedByUpsampling = function() { return this._createdByUpsampling }, y
}), r("Scene/ArcGisImageServerTerrainProvider", ["../Core/defaultValue", "../Core/defined", "../Core/loadImage", "../Core/getImagePixels", "../Core/throttleRequestByServer", "../Core/writeTextToCanvas", "../Core/DeveloperError", "../Core/Math", "../Core/Ellipsoid", "../Core/Event", "./Credit", "./TerrainProvider", "./GeographicTilingScheme", "./HeightmapTerrainData", "../ThirdParty/when"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p) { "use strict"; var f = function(r) { if (!t(r) || !t(r.url)) throw new a("description.url is required.");
this._url = r.url, this._token = r.token, this._tilingScheme = r.tilingScheme, t(this._tilingScheme) || (this._tilingScheme = new d({ ellipsoid: e(r.ellipsoid, l.WGS84) })), this._heightmapWidth = 65, this._levelZeroMaximumGeometricError = h.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.getEllipsoid(), this._heightmapWidth, this._tilingScheme.getNumberOfXTilesAtLevel(0)), this._proxy = r.proxy, this._terrainDataStructure = { heightScale: .001, heightOffset: -1e3, elementsPerHeight: 3, stride: 4, elementMultiplier: 256, isBigEndian: !0 }, this._errorEvent = new u; var i = r.credit; "string" == typeof i && (i = new c(i)), this._credit = i }; return f.prototype.requestTileGeometry = function(e, o, a) { var l = this._tilingScheme.tileXYToExtent(e, o, a),
u = (l.east - l.west) / (this._heightmapWidth - 1),
c = (l.north - l.south) / (this._heightmapWidth - 1);
l.west -= .5 * u, l.east += .5 * u, l.south -= .5 * c, l.north += .5 * c; var h = s.toDegrees(l.west) + "%2C" + s.toDegrees(l.south) + "%2C" + s.toDegrees(l.east) + "%2C" + s.toDegrees(l.north),
d = this._url + "/exportImage?interpolation=RSP_BilinearInterpolation&format=tiff&f=image&size=" + this._heightmapWidth + "%2C" + this._heightmapWidth + "&bboxSR=4326&imageSR=4326&bbox=" + h;
this._token && (d += "&token=" + this._token); var f = this._proxy;
t(f) && (d = f.getURL(d)); var v = n(d, r); if (!t(v)) return void 0; var y = this; return p(v, function(e) { return new m({ buffer: i(e), width: y._heightmapWidth, height: y._heightmapWidth, childTileMask: 15, structure: y._terrainDataStructure }) }) }, f.prototype.getErrorEvent = function() { return this._errorEvent }, f.prototype.getLevelMaximumGeometricError = function(e) { return this._levelZeroMaximumGeometricError / (1 << e) }, f.prototype.getCredit = function() { return this._credit }, f.prototype.getTilingScheme = function() { return this._tilingScheme }, f.prototype.hasWaterMask = function() { return !1 }, f.prototype.isReady = function() { return !0 }, f }), r("Scene/DiscardMissingTileImagePolicy", ["../Core/defaultValue", "../Core/defined", "../Core/loadImageViaBlob", "../Core/getImagePixels", "../Core/DeveloperError", "../ThirdParty/when"], function(e, t, r, i, n, o) { "use strict"; var a = function(a) {
function s(e) { t(e.blob) && (u._missingImageByteLength = e.blob.size); var r = i(e); if (a.disableCheckIfAllPixelsAreTransparent) { for (var n = !0, o = e.width, s = a.pixelsToCheck, l = 0, c = s.length; n && c > l; ++l) { var h = s[l],
d = 4 * h.x + h.y * o,
m = r[d + 3];
m > 0 && (n = !1) } n && (r = void 0) } u._missingImagePixels = r, u._isReady = !0 }
function l() { u._missingImagePixels = void 0, u._isReady = !0 } if (a = e(a, {}), !t(a.missingImageUrl)) throw new n("description.missingImageUrl is required."); if (!t(a.pixelsToCheck)) throw new n("description.pixelsToCheck is required.");
this._pixelsToCheck = a.pixelsToCheck, this._missingImagePixels = void 0, this._missingImageByteLength = void 0, this._isReady = !1; var u = this;
o(r(a.missingImageUrl), s, l) }; return a.prototype.isReady = function() { return this._isReady }, a.prototype.shouldDiscardImage = function(e) { if (!this._isReady) throw new n("shouldDiscardImage must not be called before the discard policy is ready."); var r = this._pixelsToCheck,
o = this._missingImagePixels; if (!t(o)) return !1; if (t(e.blob) && e.blob.size !== this._missingImageByteLength) return !1; for (var a = i(e), s = e.width, l = 0, u = r.length; u > l; ++l)
for (var c = r[l], h = 4 * c.x + c.y * s, d = 0; 4 > d; ++d) { var m = h + d; if (a[m] !== o[m]) return !1 }
return !0 }, a }), r("Scene/ImageryProvider", ["../Core/defined", "../Core/loadImage", "../Core/loadImageViaBlob", "../Core/DeveloperError", "../Core/throttleRequestByServer"], function(e, t, r, i, n) { "use strict"; var o = function() { throw this.defaultAlpha = void 0, this.defaultBrightness = void 0, this.defaultContrast = void 0, this.defaultHue = void 0, this.defaultSaturation = void 0, this.defaultGamma = void 0, new i("This type should not be instantiated directly.") }; return o.prototype.isReady = function() { throw new i("This type should not be instantiated directly.") }, o.prototype.getExtent = function() { throw new i("This type should not be instantiated directly.") }, o.prototype.getTileWidth = function() { throw new i("This type should not be instantiated directly.") }, o.prototype.getTileHeight = function() { throw new i("This type should not be instantiated directly.") }, o.prototype.getMaximumLevel = function() { throw new i("This type should not be instantiated directly.") }, o.prototype.getMinimumLevel = function() { throw new i("This type should not be instantiated directly.") }, o.prototype.getTilingScheme = function() { throw new i("This type should not be instantiated directly.") }, o.prototype.getTileDiscardPolicy = function() { throw new i("This type should not be instantiated directly.") }, o.prototype.getErrorEvent = function() { throw new i("This type should not be instantiated directly.") }, o.prototype.getCredit = function() { throw new i("This type should not be instantiated directly.") }, o.prototype.getProxy = function() { throw new i("This type should not be instantiated directly.") }, o.prototype.requestImage = function() { throw new i("This type should not be instantiated directly.") }, o.loadImage = function(i, o) { return e(i.getTileDiscardPolicy()) ? n(o, r) : n(o, t) }, o }), r("Scene/WebMercatorTilingScheme", ["../Core/defaultValue", "../Core/defined", "../Core/Ellipsoid", "../Core/Extent", "../Core/Cartesian2", "../Core/WebMercatorProjection", "./TilingScheme"], function(e, t, r, i, n, o, a) { "use strict"; var s = function(a) { if (a = e(a, {}), this._ellipsoid = e(a.ellipsoid, r.WGS84), this._numberOfLevelZeroTilesX = e(a.numberOfLevelZeroTilesX, 1), this._numberOfLevelZeroTilesY = e(a.numberOfLevelZeroTilesY, 1), this._projection = new o(this._ellipsoid), t(a.extentSouthwestInMeters) && t(a.extentNortheastInMeters)) this._extentSouthwestInMeters = a.extentSouthwestInMeters, this._extentNortheastInMeters = a.extentNortheastInMeters;
else { var s = this._ellipsoid.getMaximumRadius() * Math.PI;
this._extentSouthwestInMeters = new n(-s, -s), this._extentNortheastInMeters = new n(s, s) } var l = this._projection.unproject(this._extentSouthwestInMeters),
u = this._projection.unproject(this._extentNortheastInMeters);
this._extent = new i(l.longitude, l.latitude, u.longitude, u.latitude) }; return s.prototype.getEllipsoid = function() { return this._ellipsoid }, s.prototype.getExtent = function() { return this._extent }, s.prototype.getProjection = function() { return this._projection }, s.prototype.getNumberOfXTilesAtLevel = function(e) { return this._numberOfLevelZeroTilesX << e }, s.prototype.getNumberOfYTilesAtLevel = function(e) { return this._numberOfLevelZeroTilesY << e }, s.prototype.createLevelZeroTiles = function() { return a.createRectangleOfLevelZeroTiles(this, this._numberOfLevelZeroTilesX, this._numberOfLevelZeroTilesY) }, s.prototype.extentToNativeExtent = function(e, r) { var n = this._projection,
o = n.project(e.getSouthwest()),
a = n.project(e.getNortheast()); return t(r) ? (r.west = o.x, r.south = o.y, r.east = a.x, r.north = a.y, r) : new i(o.x, o.y, a.x, a.y) }, s.prototype.tileXYToNativeExtent = function(e, r, n, o) { var a = this.getNumberOfXTilesAtLevel(n),
s = this.getNumberOfYTilesAtLevel(n),
l = (this._extentNortheastInMeters.x - this._extentSouthwestInMeters.x) / a,
u = this._extentSouthwestInMeters.x + e * l,
c = this._extentSouthwestInMeters.x + (e + 1) * l,
h = (this._extentNortheastInMeters.y - this._extentSouthwestInMeters.y) / s,
d = this._extentNortheastInMeters.y - r * h,
m = this._extentNortheastInMeters.y - (r + 1) * h; return t(o) ? (o.west = u, o.south = m, o.east = c, o.north = d, o) : new i(u, m, c, d) }, s.prototype.tileXYToExtent = function(e, t, r, i) { var o = this.tileXYToNativeExtent(e, t, r, i),
a = this._projection,
s = a.unproject(new n(o.west, o.south)),
l = a.unproject(new n(o.east, o.north)); return o.west = s.longitude, o.south = s.latitude, o.east = l.longitude, o.north = l.latitude, o }, s.prototype.positionToTileXY = function(e, r, i) { var o = this._extent; if (e.latitude > o.north || e.latitude < o.south || e.longitude < o.west || e.longitude > o.east) return void 0; var a = this.getNumberOfXTilesAtLevel(r),
s = this.getNumberOfYTilesAtLevel(r),
l = this._extentNortheastInMeters.x - this._extentSouthwestInMeters.x,
u = l / a,
c = this._extentNortheastInMeters.y - this._extentSouthwestInMeters.y,
h = c / s,
d = this._projection,
m = d.project(e),
p = m.x - this._extentSouthwestInMeters.x,
f = this._extentNortheastInMeters.y - m.y,
v = 0 | p / u;
v >= a && (v = a - 1); var y = 0 | f / h; return y >= s && (y = s - 1), t(i) ? (i.x = v, i.y = y, i) : new n(v, y) }, s }), r("Scene/ArcGisMapServerImageryProvider", ["../Core/defaultValue", "../Core/defined", "../Core/jsonp", "../Core/writeTextToCanvas", "../Core/Cartesian2", "../Core/DeveloperError", "../Core/Event", "./DiscardMissingTileImagePolicy", "./GeographicTilingScheme", "./ImageryProvider", "./TileProviderError", "./WebMercatorTilingScheme", "./Credit", "../ThirdParty/when"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m) { "use strict";
function p(e, r, i, n) { var o; if (e._useTiles) o = e._url + "/tile/" + n + "/" + i + "/" + r;
else { var a = e._tilingScheme.tileXYToNativeExtent(r, i, n),
s = a.west + "%2C" + a.south + "%2C" + a.east + "%2C" + a.north;
o = e._url + "/export?", o += "bbox=" + s, o += "&bboxSR=4326&size=256%2C256&imageSR=4326&format=png&transparent=true&f=image" } var l = e._proxy; return t(l) && (o = l.getURL(o)), o } var f = function(i) {
function u(e) { var r = e.tileInfo; if (g._useTiles && t(r)) { if (g._tileWidth = r.rows, g._tileHeight = r.cols, 102100 === r.spatialReference.wkid) g._tilingScheme = new h;
else { if (4326 !== e.tileInfo.spatialReference.wkid) { var i = "Tile spatial reference WKID " + e.tileInfo.spatialReference.wkid + " is not supported."; return y = c.handleError(y, g, g._errorEvent, i, void 0, void 0, void 0, v), void 0 } g._tilingScheme = new l } g._maximumLevel = e.tileInfo.lods.length - 1, t(g._tileDiscardPolicy) || (g._tileDiscardPolicy = new s({ missingImageUrl: p(g, 0, 0, g._maximumLevel), pixelsToCheck: [new n(0, 0), new n(200, 20), new n(20, 200), new n(80, 110), new n(160, 130)], disableCheckIfAllPixelsAreTransparent: !0 })), g._useTiles = !0 } else g._tileWidth = 256, g._tileHeight = 256, g._tilingScheme = new l, g._useTiles = !1;
t(e.copyrightText) && e.copyrightText.length > 0 && (g._credit = new d(e.copyrightText)), g._ready = !0, c.handleSuccess(y) }
function f() { var e = "An error occurred while accessing " + g._url + ".";
y = c.handleError(y, g, g._errorEvent, e, void 0, void 0, void 0, v) }
function v() { var e = r(g._url, { parameters: { f: "json" }, proxy: g._proxy });
m(e, u, f) } if (i = e(i, {}), !t(i.url)) throw new o("description.url is required.");
this._url = i.url, this._tileDiscardPolicy = i.tileDiscardPolicy, this._proxy = i.proxy, this._tileWidth = void 0, this._tileHeight = void 0, this._maximumLevel = void 0, this._tilingScheme = void 0, this._credit = void 0, this._useTiles = e(i.usePreCachedTilesIfAvailable, !0), this._errorEvent = new a, this._ready = !1; var y, g = this;
v() }; return f.prototype.isUsingPrecachedTiles = function() { return this._useTiles }, f.prototype.getUrl = function() { return this._url }, f.prototype.getProxy = function() { return this._proxy }, f.prototype.getTileWidth = function() { if (!this._ready) throw new o("getTileWidth must not be called before the imagery provider is ready."); return this._tileWidth }, f.prototype.getTileHeight = function() { if (!this._ready) throw new o("getTileHeight must not be called before the imagery provider is ready."); return this._tileHeight }, f.prototype.getMaximumLevel = function() { if (!this._ready) throw new o("getMaximumLevel must not be called before the imagery provider is ready."); return this._maximumLevel }, f.prototype.getMinimumLevel = function() { if (!this._ready) throw new o("getMinimumLevel must not be called before the imagery provider is ready."); return 0 }, f.prototype.getTilingScheme = function() { if (!this._ready) throw new o("getTilingScheme must not be called before the imagery provider is ready."); return this._tilingScheme }, f.prototype.getExtent = function() { if (!this._ready) throw new o("getExtent must not be called before the imagery provider is ready."); return this._tilingScheme.getExtent() }, f.prototype.getTileDiscardPolicy = function() { if (!this._ready) throw new o("getTileDiscardPolicy must not be called before the imagery provider is ready."); return this._tileDiscardPolicy }, f.prototype.getErrorEvent = function() { return this._errorEvent }, f.prototype.isReady = function() { return this._ready }, f.prototype.requestImage = function(e, t, r) { if (!this._ready) throw new o("requestImage must not be called before the imagery provider is ready."); var i = p(this, e, t, r); return u.loadImage(this, i) }, f.prototype.getCredit = function() { return this._credit }, f }), r("Scene/BingMapsStyle", ["../Core/Enumeration"], function(e) { "use strict"; var t = { AERIAL: new e(0, "AERIAL", { imagerySetName: "Aerial" }), AERIAL_WITH_LABELS: new e(1, "AERIAL_WITH_LABELS", { imagerySetName: "AerialWithLabels" }), ROAD: new e(2, "ROAD", { imagerySetName: "Road" }), ORDNANCE_SURVEY: new e(3, "ORDNANCE_SURVEY", { imagerySetName: "OrdnanceSurvey" }), COLLINS_BART: new e(4, "COLLINS_BART", { imagerySetName: "CollinsBart" }) }; return t }), r("Scene/BingMapsImageryProvider", ["../Core/defaultValue", "../Core/defined", "../Core/jsonp", "../Core/Cartesian2", "../Core/DeveloperError", "../Core/Event", "./BingMapsStyle", "./DiscardMissingTileImagePolicy", "./ImageryProvider", "./TileProviderError", "./WebMercatorTilingScheme", "./Credit", "../ThirdParty/when"], function(e, t, r, i, n, o, a, s, l, u, c, h, d) { "use strict";
function m(e, r, i, n) { var o = e._imageUrlTemplate,
a = p.tileXYToQuadKey(r, i, n);
o = o.replace("{quadkey}", a); var s = e._imageUrlSubdomains,
l = (r + i + n) % s.length;
o = o.replace("{subdomain}", s[l]); var u = e._proxy; return t(u) && (o = u.getURL(o)), o } var p = function f(l) {
function p(e) { var r = e.resourceSets[0].resources[0];
w._tileWidth = r.imageWidth, w._tileHeight = r.imageHeight, w._maximumLevel = r.zoomMax - 1, w._imageUrlSubdomains = r.imageUrlSubdomains, w._imageUrlTemplate = r.imageUrl.replace("{culture}", ""), t(w._tileDiscardPolicy) || (w._tileDiscardPolicy = new s({ missingImageUrl: m(w, 0, 0, w._maximumLevel), pixelsToCheck: [new i(0, 0), new i(120, 140), new i(130, 160), new i(200, 50), new i(200, 200)], disableCheckIfAllPixelsAreTransparent: !0 })), w._ready = !0, u.handleSuccess(g) }
function v() { var e = "An error occurred while accessing " + _ + ".";
g = u.handleError(g, w, w._errorEvent, e, void 0, void 0, void 0, y) }
function y() { var e = r(_, { callbackParameterName: "jsonp", proxy: w._proxy });
d(e, p, v) } if (l = e(l, {}), !t(l.url)) throw new n("description.url is required.");
this._url = l.url, this._key = e(l.key, "AkMnCOd4RF1U7D7qgdBz3Fk1aJB3rgCCI_DO841suDGxqOg0SMICTE8Ivy5HhAf5"), this._mapStyle = e(l.mapStyle, a.AERIAL), this._tileDiscardPolicy = l.tileDiscardPolicy, this._proxy = l.proxy, this._credit = new h("Bing Imagery", f._logoData, "http://www.bing.com"), this.defaultGamma = 1, (this._mapStyle === a.AERIAL || this._mapStyle === a.AERIAL_WITH_LABELS) && (this.defaultGamma = 1.3), this._tilingScheme = new c({ numberOfLevelZeroTilesX: 2, numberOfLevelZeroTilesY: 2 }), this._tileWidth = void 0, this._tileHeight = void 0, this._maximumLevel = void 0, this._imageUrlTemplate = void 0, this._imageUrlSubdomains = void 0, this._errorEvent = new o, this._ready = !1; var g, _ = this._url + "/REST/v1/Imagery/Metadata/" + this._mapStyle.imagerySetName + "?key=" + this._key,
w = this;
y() }; return p.prototype.getUrl = function() { return this._url }, p.prototype.getProxy = function() { return this._proxy }, p.prototype.getKey = function() { return this._key }, p.prototype.getMapStyle = function() { return this._mapStyle }, p.prototype.getTileWidth = function() { if (!this._ready) throw new n("getTileWidth must not be called before the imagery provider is ready."); return this._tileWidth }, p.prototype.getTileHeight = function() { if (!this._ready) throw new n("getTileHeight must not be called before the imagery provider is ready."); return this._tileHeight }, p.prototype.getMaximumLevel = function() { if (!this._ready) throw new n("getMaximumLevel must not be called before the imagery provider is ready."); return this._maximumLevel }, p.prototype.getMinimumLevel = function() { if (!this._ready) throw new n("getMinimumLevel must not be called before the imagery provider is ready."); return 0 }, p.prototype.getTilingScheme = function() { if (!this._ready) throw new n("getTilingScheme must not be called before the imagery provider is ready."); return this._tilingScheme }, p.prototype.getExtent = function() { if (!this._ready) throw new n("getExtent must not be called before the imagery provider is ready."); return this._tilingScheme.getExtent() }, p.prototype.getTileDiscardPolicy = function() { if (!this._ready) throw new n("getTileDiscardPolicy must not be called before the imagery provider is ready."); return this._tileDiscardPolicy }, p.prototype.getErrorEvent = function() { return this._errorEvent }, p.prototype.isReady = function() { return this._ready }, p.prototype.requestImage = function(e, t, r) { if (!this._ready) throw new n("requestImage must not be called before the imagery provider is ready."); var i = m(this, e, t, r); return l.loadImage(this, i) }, p.prototype.getCredit = function() { return this._credit }, p._logoData = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADwAAAAWCAYAAACcy/8iAAAABGdBTUEAAK/INwWK6QAAAAlwSFlzAAAOwgAADsIBFShKgAAAABp0RVh0U29mdHdhcmUAUGFpbnQuTkVUIHYzLjUuMTAw9HKhAAAL+UlEQVRYR9WYeVSXZRbHFZB9kX0H2UQBWUQFFJcKl9GOVIBLWDNKc7JSUxwVbFxGBBcUaVGSpCI7ogKOWohWipKC4oqaC4KyCIoCssiOznzuD36NecypM/8095zn/F7e57n3ud/7fO997ksvpLeamppq37591U1NTbXNzc31LCwsdE1MTDQMDQ2ZUlORRb8m6urqKkZGRn0Y2mZmZgaMvujqoaulo6PThyW9e8YfQ8RhAwMDDSsrK4MBAwbYeHh4OLi5udnZ29sb47g282osUzr9iyG6AFOXADk6OloNGjTIZfDgwQMRB1tbW9RNtAGt+izdp8bz5Fnr5RAUQ19fX/VZA0yqHIIqvsk60ekWTU1NVU5F19XV1TY2bk3Y7t2ZK1K/+jrSy8vLldM2RVFHV1dXw9jYWFMGADT09PTUed9HhHfa/fr1M5sW/OKI/RuC4wqSX965bWXIHG9vb1dLS0sjdNXZQw2dPqIrwRU7BEpD5sQObkhQlI79DEjmZC/REx3R1dbW1tDS0tJEV4s5Hd7rKQcM1ZXgc3h61tbWOvxqE3jRVWNObPbqhXIfABtxsh5nz57PevTocVdjY2PD0KFDx6IwEND2DGuebWTwbMUwx4AJTgt9TVxcXJyz4kas79ph3fl4h/mj+lSHW2sXTA5nMztSxZANjdjDFGeIgaXCFs/W8jemTDgJfcBoAUZdgghATd7pYdpI9kKs0LORwbM1e8uvPfadnJ2dOSvX/vjg6ODgYEPwrWGbYvC3OcOQd5rsr0rge8sJq4sz0NC3oODM4X8hjY1Nzb6+vtOdnJyCoOmoYcOGjfLz8xstg+dAHx8fP2jvaWNj44SubOS5dfGoFRUpHsV1X7vXXdzsczQibEwYUXbDSXFqIIwZQhADsaGwhZ2R7BFAnH1wyBkAloA0IoiGADLDtj0+DSJF/GRtj85odEbh02hPT8+gxYuXRKSnZ6zOzNyz6tOtye9GRkaOPnPmzPtnz559X35zc3NnJCYmeuCfHimqTvBVBLAGkTQnSsNOnjx1tBtwY3NwcPD8zz//YvPFi5e+v3PnToFyVFZW5l+9eu27AweyP8WBsYAZjnMjJk4Y++aWtQu2bouL+DIhdkkC9iba2dmNIDgvxcdvjCwoOJ1ZXl6ep7RTVVV16saN4qOHDx9Jff318FCA+3FiAwDugk0vgvPinj17E69du/4De55S6pWVleWfOlWQfeFCYc7du9UlDx8+bHz4sLnxVMGZb8PDw8devnw5/vjx44uqq6v31tfXHzl06NB4Trsvvkg6dQOGchZQwj8/vxtwa2tr+4MHD+o6OzvbeW5B8XZV1Z3rbHxVnltaWpuY67h3v6Z8x460LSNHjgxftGjxUhyo7OjoaL18+adTnED4zFmz5ty8eesK71oY7U1NTfeQ4h47FS0tLY1ip6Gh8f7Ro7np06dPf8PL23vSpsQPl1dU3L7a2dnV0dbW3sraqtu3K69WV98rbmxqqu1CHiM9vrY0Nzc3pKSkrOjfv79vRkbGlJiYmFFFRUWrCwsL56elpQ2Dqfpywr8KWKSr61EXm17bu3d/Skho6BQiHjRkyJCg114LCUtL27mpuLjkgmza2trW9sMPh//5wQd/j6mpqa0RXRhwYd68ectu3Sq9Jn/j8P38kyezoeB7sGKC1IdJkyaFpKZ+FX/lytV8QAuGrry8/O8XLly4jJMsEzwNDQ21Bw8e2hkePuMvUFn0Xl62fEU09gvQ6RTbly79dDEx8aNE/HoFhrjANsljK0DKsIAthoDVIr3UqN6KHFYAJjq/AFxWXlG0YEHkfN6PwYY7BcZJhjwTnMCIiL/OLi6+eUXWcgrtO9J27rp/v0YJuHD//m8y2ts7hCHNe/ft3xEYODIUhwaT0/2x44wdN5wZMXly8J+vF924LHowpy07++C3ytPD5hcEKAQ9P6g+EL1BUHPUjBlvzC0puVkoa+rq6u4uW7Y8CpBDyX0LhgFFUXJWj7W6vNdCrw/FubtKS9Eih80kh58EvGHDpniS/SXmXKGCCcOACOlzFZhSW5xl448//iS+DbSy/tr1ohLw1sozp3bpxIkT38mznO7q2LjlOO1PPbJGv6+YYhjjnCOOBW7btu0jWSty/nyhAogILHgXvSAOxIP19hQdJ/wZTAGciv0sCQx0biLW68hTd+bFTQ2CowZoNYKqxjtVDQ0N5XWnuJakwzKl6fCFUod69vpXWFjYHBRG4qQD14UBTYYWwdHi/sNG336cVMBKpL6+oV7W375dVf0k4Ly8vO/lGcD3YmPXRGFrkIDFjjrbihMaBM4MQD5JSUlrZa0IutceIfK8Oz3jK39//zAJFreBsMyLAI15++3ZkRUVFUWypra2rnz58pURvHcErLbYZigB/geoUgChRgQN4btbRmZmonKzrKzs3QRhItHyxDEbQJoBXobcgR5QfXxW1oF0Uk+xPv9kwWko/UzAa9asW4zTAwmWHlsqHCKI0rQYw5RBycnJcbJWZN/+b7JuV1aWCqspUA+OHcvdN2tWxFvk8ERy+JX18RtiqO7nZF/k8YHsg9vd3d0DCYg1BNTA9i87q6eFQKsCQroT26ioqBlE7gqbPaJy1lGBk4KDXwkjZ/2gjA8U9+b+DZg06eXXtmz5NEHyU2gFUECtTVAWracBr18f/zdOwJUT1mVLBWDAS/cjBcUdSq+WtSLJyZ+lRC9duhJQhdSAlvb29jZoW3Pnzt0S8rWCPRtlTzKp48SJvNwxY8ZIg+NN7MywL+zpztXniIosJDcMyWMPnJtzq7T0nFRBrpJONr6UmZn50a5du9bt2rV7LcUoiaJ0WhyRNVLJY2JW/yM6eukKAN8Xp3sAK3KYSludkJD4PsFy6qGc4gTopgSwAUWlf2pq6kpZK7J1a/Jm2BNMnk5OSfkylvv2m9LSslzu8BOlpaX55eUVl9txTECXlZWXUFgjsT0E/y2kBe2x/1zpLacMaKlmFtDYY8mS6HC6lFSagxIpSkIfACoEjF1cRe3cy2U5OTlfREdHvw0DgqKiot8jj29xt7aeO3f+JHP75fnevfslmzZ9OBOnbGGSFvspAFM7VDkVqaL227dvj2Qpy1takpK2xvBuODXCmzTzpasKkO6K8QJNzISQkNCZOUeP7ZPrUAJEcI+PGz9+AteOHZTW7LH/X0VFVVVVjRPQkTYTmjkEBgb6E70pcXFx75Bjy47k5Oz48ccTGVBueWxsLG3cwmkBAQH+5KBcF84vvPDi0BUrVk5Zs2bNW7NnvzN95syZU6H5W+iHkhae0M4Yh5SUE0rLZ6Um+qZ0SP4bNya8uXbtulmkSxD7+wDYjVrRHxY4MRwYjvgmrerwiRMnRtDc5AlgusKa5ORtUQTH+QkG/SbpTd8un1byHawnwCWvEWcp+Zy8F72tF89u8o45O5wwpZgZMgxwzphKbMmcHb/9+O0HGDtOy5K1hsxrsU5ZQUUUeQwAbQCass6WX5dx48YPj176wdSoqKXTaSYEvAd0dURXPkSc8WsIpz0tPz8/W2jd3NzSmJ6euZo73eX3AhYRZ1Sgm3Ql0nvqsIk+GxqBzZjNeDSRBt+A09GVnKHKy6Xeh7VyzWgzJzq6Mi/FENpqMacu4HrsK6U3e6hILrNWi3UGxMf6k082v07Tc76yquoneub0qVOnSdH0J4hezA+lzoxbtSpmFalSISdMu1kE26YSGPsnUuZ3S28orgIYFa5NVQGkHHKN9bwTwwp69qyXQqTCdSMB+3nIO2qEct3TotDFpnywa+Kzydy5814qKrpxkLohRbPt5s2bF/iI2fjqq6+Gz5+/YC4fG3sePKivliuJktLG3CquJW8YZPpEyvxPonDqGeN58lvWPCkKeuO0HmnjGBoWFpSTcyyltra2hDr2kMuiU+jbXTw7Ovh8raFyn05M/HARYH04fSspgNh5MmX+0CKNiPy7SIMCaERF78fXli83TjgfL+tpPj7j+/br/PyTXx45krOVU42G6n8iOPJNbglYLhnFHfx/AVYpiusR0PLvH32Am0NxR3LWnWbHh+tpCN/Mvjx7U6BcAWoLI6TH1xEqSwqKjW5Tvya9ev0bEj8/qn9c7kYAAAAASUVORK5CYII=", p.tileXYToQuadKey = function(e, t, r) { for (var i = "", n = r; n >= 0; --n) { var o = 1 << n,
a = 0;
0 !== (e & o) && (a |= 1), 0 !== (t & o) && (a |= 2), i += a } return i }, p.quadKeyToTileXY = function(e) { for (var t = 0, r = 0, i = e.length - 1, n = i; n >= 0; --n) { var o = 1 << n,
a = +e[i - n];
0 !== (1 & a) && (t |= o), 0 !== (2 & a) && (r |= o) } return { x: t, y: r, level: i } }, p }), r("Scene/CameraController", ["../Core/defaultValue", "../Core/defined", "../Core/Cartesian2", "../Core/Cartesian3", "../Core/Cartesian4", "../Core/Cartographic", "../Core/DeveloperError", "../Core/Ellipsoid", "../Core/GeographicProjection", "../Core/IntersectionTests", "../Core/Math", "../Core/Matrix3", "../Core/Matrix4", "../Core/Quaternion", "../Core/Ray", "./SceneMode", "../ThirdParty/Tween"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v) {
"use strict";
function y(e, t) { var r = e._maxCoord.x * e.maximumTranslateFactor;
t.x > r && (t.x = r), t.x < -r && (t.x = -r); var i = e._maxCoord.y * e.maximumTranslateFactor;
t.y > i && (t.y = i), t.y < -i && (t.y = -i) }
function g(e, r) { var n, o = e._camera; if (t(r)) { var a = i.clone(o.getPositionWC(), W),
s = i.clone(o.getUpWC(), G),
l = i.clone(o.getRightWC(), H),
u = i.clone(o.getDirectionWC(), j);
n = o.transform, o.transform = r.multiply(n); var c = o.getInverseTransform();
i.clone(d.multiplyByVector(c, a, a), o.position), i.clone(d.multiplyByVector(c, s, s), o.up), i.clone(d.multiplyByVector(c, l, l), o.right), i.clone(d.multiplyByVector(c, u, u), o.direction) } return n }
function _(e, r) { if (t(r)) { var n = e._camera,
o = i.clone(n.getPositionWC(), Y),
a = i.clone(n.getUpWC(), X),
s = i.clone(n.getRightWC(), Z),
l = i.clone(n.getDirectionWC(), K);
n.transform = r, r = n.getInverseTransform(), o = i.clone(d.multiplyByVector(r, o, o), n.position), a = i.clone(d.multiplyByVector(r, a, a), n.up), s = i.clone(d.multiplyByVector(r, s, s), n.right), l = i.clone(d.multiplyByVector(r, l, l), n.direction) } }
function w(e, r, n) { var o = e._camera,
a = g(e, n),
s = o.position,
l = i.normalize(s, $); if (t(e.constrainedAxis)) { var u = l.equalsEpsilon(e.constrainedAxis, c.EPSILON2),
h = l.equalsEpsilon(e.constrainedAxis.negate(), c.EPSILON2); if (u || h)(u && 0 > r || h && r > 0) && e.rotate(o.right, r);
else { var d = i.normalize(e.constrainedAxis, et),
m = l.dot(d),
p = Math.acos(m);
r > 0 && r > p && (r = p), m = l.dot(d.negate()), p = Math.acos(m), 0 > r && -r > p && (r = -p); var f = i.cross(d, l, tt);
e.rotate(f, r) } } else e.rotate(o.right, r);
_(e, a) }
function C(e, r, i) { t(e.constrainedAxis) ? e.rotate(e.constrainedAxis, r, i) : e.rotate(e._camera.up, r, i) }
function x(e, r) { var i = e._camera.frustum; if (!(t(i.left) && t(i.right) && t(i.top) && t(i.bottom))) throw new a("The camera frustum is expected to be orthographic for 2D camera control.");
r = .5 * r; var n = i.right - r,
o = i.left + r,
s = e._maxCoord.x * e.maximumZoomFactor;
n > s && (n = s, o = -s); var l = i.top / i.right;
i.right = n, i.left = o, i.top = i.right * l, i.bottom = -i.top }
function S(e, t) { var r = e._camera;
e.move(r.direction, t) }
function E(e, t) { var n = e._camera,
o = .5 * -t.height,
a = -o,
s = n.frustum; if (a > o) { var l = s.top / s.right;
s.right = a, s.left = o, s.top = s.right * l, s.bottom = -s.top } r.clone(e._projection.project(t), n.position), i.negate(i.UNIT_Z, n.direction), i.clone(i.UNIT_Y, n.up), i.clone(i.UNIT_X, n.right) }
function b(e, t) { var r = e._camera,
n = e._projection;
r.position = n.project(t), i.negate(i.UNIT_Z, r.direction), i.clone(i.UNIT_Y, r.up), i.clone(i.UNIT_X, r.right) }
function T(e, t) { var r = e._camera,
n = e._projection.getEllipsoid();
n.cartographicToCartesian(t, r.position), i.negate(r.position, r.direction), i.normalize(r.direction, r.direction), i.cross(r.direction, i.UNIT_Z, r.right), i.cross(r.right, r.direction, r.up), i.cross(r.direction, r.up, r.right) }
function A(e, t, r, n, o) { var a = e;
o && (a = lt); var s = t.north,
l = t.south,
u = t.east,
h = t.west;
h > u && (u += c.TWO_PI); var d = rt;
d.longitude = u, d.latitude = s; var m = r.cartographicToCartesian(d, it);
d.latitude = l; var p = r.cartographicToCartesian(d, at);
d.longitude = h; var f = r.cartographicToCartesian(d, nt);
d.latitude = s; var v = r.cartographicToCartesian(d, ot),
y = i.subtract(m, f, st);
i.multiplyByScalar(y, .5, y), i.add(f, y, y), i.subtract(v, y, v), i.subtract(p, y, p), i.subtract(m, y, m), i.subtract(f, y, f); var g = r.geodeticSurfaceNormal(y, a.direction);
i.negate(g, g), i.normalize(g, g); var _ = i.cross(g, i.UNIT_Z, a.right);
i.normalize(_, _); var w = i.cross(_, g, a.up),
C = Math.max(Math.abs(w.dot(v)), Math.abs(w.dot(p)), Math.abs(w.dot(m)), Math.abs(w.dot(f))),
x = Math.max(Math.abs(_.dot(v)), Math.abs(_.dot(p)), Math.abs(_.dot(m)), Math.abs(_.dot(f))),
S = Math.tan(.5 * e.frustum.fovy),
E = e.frustum.aspectRatio * S,
b = Math.max(x / E, C / S),
T = y.magnitude() + b; return i.normalize(y, y), i.multiplyByScalar(y, T, n) }
function M(e, r, o, a, s) { var l = r.north,
u = r.south,
c = r.east,
h = r.west,
m = d.clone(e.transform, dt);
m.setColumn(3, n.UNIT_W); var p = e.getInverseTransform(),
f = ut;
f.longitude = c, f.latitude = l; var v = o.project(f),
y = i.clone(v, ct);
d.multiplyByVector(m, y, y), d.multiplyByVector(p, y, y), f.longitude = h, f.latitude = u, v = o.project(f); var g = i.clone(v, ht);
d.multiplyByVector(m, g, g), d.multiplyByVector(p, g, g); var _ = Math.tan(.5 * e.frustum.fovy),
w = e.frustum.aspectRatio * _; if (t(a) || (a = new i), a.x = .5 * (y.x - g.x) + g.x, a.y = .5 * (y.y - g.y) + g.y, a.z = .5 * Math.max((y.x - g.x) / w, (y.y - g.y) / _), !s) { var C = i.clone(i.UNIT_Z, e.direction);
i.negate(C, C), i.clone(i.UNIT_X, e.right), i.clone(i.UNIT_Y, e.up) } return a }
function P(e, r, n, o, a) { var s = r.north,
l = r.south,
u = r.east,
c = r.west,
h = mt;
h.longitude = u, h.latitude = s; var d = n.project(h, pt);
h.longitude = c, h.latitude = l; var m, p, f = n.project(h, ft),
v = .5 * Math.abs(d.x - f.x),
y = .5 * Math.abs(d.y - f.y),
g = e.frustum.right / e.frustum.top,
_ = y * g; if (v > _ ? (m = v, p = m / g) : (p = y, m = _), y = Math.max(2 * m, 2 * p), t(o) || (o = new i), o.x = .5 * (d.x - f.x) + f.x, o.y = .5 * (d.y - f.y) + f.y, a) h = n.unproject(o, h), h.height = y, o = n.project(h, o);
else { var w = e.frustum;
w.right = m, w.left = -m, w.top = p, w.bottom = -p; var C = i.clone(i.UNIT_Z, e.direction);
i.negate(C, C), i.clone(i.UNIT_X, e.right), i.clone(i.UNIT_Y, e.up) } return o }
function D(t, r, i, n) { i = e(i, s.WGS84); var o = t.getPickRay(r, vt),
a = u.rayEllipsoid(o, i); return a ? o.getPoint(a.start, n) : void 0 }
function I(e, t, r, i) { var n = e.getPickRay(t, yt),
o = n.origin;
o.z = 0; var a = r.unproject(o); return a.latitude < -c.PI_OVER_TWO || a.latitude > c.PI_OVER_TWO || a.longitude < -Math.PI || a.longitude > Math.PI ? void 0 : r.getEllipsoid().cartographicToCartesian(a, i) }
function O(e, t, r, n) { var o = e.getPickRay(t, gt),
a = -o.origin.x / o.direction.x;
o.getPoint(a, n); var s = r.unproject(new i(n.y, n.z, 0)); return s.latitude < -c.PI_OVER_TWO || s.latitude > c.PI_OVER_TWO || s.longitude < -Math.PI || s.longitude > Math.PI ? void 0 : r.getEllipsoid().cartographicToCartesian(s, n) }
function R(e, t, r) { var n = e._canvas.clientWidth,
o = e._canvas.clientHeight,
a = Math.tan(.5 * e.frustum.fovy),
s = e.frustum.aspectRatio * a,
l = e.frustum.near,
u = 2 / n * t.x - 1,
c = 2 / o * (o - t.y) - 1,
h = e.getPositionWC();
i.clone(h, r.origin); var d = i.multiplyByScalar(e.getDirectionWC(), l, _t);
i.add(h, d, d); var m = i.multiplyByScalar(e.getRightWC(), u * l * s, wt),
p = i.multiplyByScalar(e.getUpWC(), c * l * a, Ct),
f = i.add(d, m, r.direction); return i.add(f, p, f), i.subtract(f, h, f), i.normalize(f, f), r }
function L(e, t, r) { var n = e._canvas.clientWidth,
o = e._canvas.clientHeight,
a = 2 / n * t.x - 1;
a *= .5 * (e.frustum.right - e.frustum.left); var s = 2 / o * (o - t.y) - 1;
s *= .5 * (e.frustum.top - e.frustum.bottom); var l = r.origin; return i.clone(e.position, l), l.x += a, l.y += s, i.clone(e.getDirectionWC(), r.direction), r }
function z(e, t) { var r = e._camera,
i = r.position,
n = i.x < -e._maxCoord.x || i.x > e._maxCoord.x,
o = i.y < -e._maxCoord.y || i.y > e._maxCoord.y,
a = n || o,
s = r.frustum,
l = s.top,
u = s.bottom,
h = s.right,
d = s.left,
m = e._frustum,
p = h > e._frustum.right; if (a || p) { var f = i.clone();
f.x > e._maxCoord.x ? f.x = e._maxCoord.x : f.x < -e._maxCoord.x && (f.x = -e._maxCoord.x), f.y > e._maxCoord.y ? f.y = e._maxCoord.y : f.y < -e._maxCoord.y && (f.y = -e._maxCoord.y); var y = function(e) { a && (r.position = i.lerp(f, e.time)), p && (r.frustum.top = c.lerp(l, m.top, e.time), r.frustum.bottom = c.lerp(u, m.bottom, e.time), r.frustum.right = c.lerp(h, m.right, e.time), r.frustum.left = c.lerp(d, m.left, e.time)) }; return { easingFunction: v.Easing.Exponential.Out, startValue: { time: 0 }, stopValue: { time: 1 }, duration: t, onUpdate: y } } return void 0 }
function N(e, t, r, o, a, s) { var l = t.clone();
r.y > o ? l.y -= r.y - o : r.y < -o && (l.y += -o - r.y), r.z > a ? l.z -= r.z - a : r.z < -a && (l.z += -a - r.z); var u = e._camera,
c = function(e) { var r = t.lerp(l, e.time),
o = new n(r.x, r.y, r.z, 1);
u.position = i.fromCartesian4(u.getInverseTransform().multiplyByVector(o)) }; return { easingFunction: v.Easing.Exponential.Out, startValue: { time: 0 }, stopValue: { time: 1 }, duration: s, onUpdate: c } }
function F(e, t) { var r = e._camera,
o = r.position,
a = r.direction,
s = i.fromCartesian4(r.getInverseTransform().multiplyByVector(n.UNIT_X)),
l = -s.dot(o) / s.dot(a),
u = o.add(a.multiplyByScalar(l));
u = new n(u.x, u.y, u.z, 1); var c = r.transform.multiplyByVector(u),
h = new n(r.position.x, r.position.y, r.position.z, 1),
d = r.transform.multiplyByVector(h),
m = Math.tan(.5 * e._camera.frustum.fovy),
p = e._camera.frustum.aspectRatio * m,
f = d.subtract(c).magnitude(),
v = p * f,
y = m * f,
g = e._maxCoord.x,
_ = e._maxCoord.y,
w = Math.max(v - g, g),
C = Math.max(y - _, _); if (d.z < -w || d.z > w || d.y < -C || d.y > C) { var x = c.y < -w || c.y > w,
S = c.z < -C || c.z > C; if (x || S) return N(e, i.fromCartesian4(d), i.fromCartesian4(c), w, C, t) } return void 0 }
var B = function(e) { if (!t(e)) throw new a("camera is required.");
this._camera = e, this._mode = f.SCENE3D, this._projection = new l, this.defaultMoveAmount = 1e5, this.defaultLookAmount = Math.PI / 60, this.defaultRotateAmount = Math.PI / 3600, this.defaultZoomAmount = 1e5, this.constrainedAxis = void 0, this.maximumTranslateFactor = 1.5, this.maximumZoomFactor = 2.5, this._maxCoord = new i, this._frustum = void 0 },
V = new o(Math.PI, c.PI_OVER_TWO);
B.prototype.update = function(e, r) { var i = !1;
e !== this._mode && (this._mode = e, i = this._mode === f.SCENE2D); var n = r.projection; if (t(n) && n !== this._projection && (this._projection = n, this._maxCoord = n.project(V, this._maxCoord)), i) { var o = this._frustum = this._camera.frustum.clone(); if (!(t(o.left) && t(o.right) && t(o.top) && t(o.bottom))) throw new a("The camera frustum is expected to be orthographic for 2D camera control."); var s = 2,
l = o.top / o.right;
o.right = this._maxCoord.x * s, o.left = -o.right, o.top = l * o.right, o.bottom = -o.top } };
var q = new i;
B.prototype.move = function(e, r) { if (!t(e)) throw new a("direction is required."); var n = this._camera.position;
i.multiplyByScalar(e, r, q), i.add(n, q, n), this._mode === f.SCENE2D && y(this, n) }, B.prototype.moveForward = function(t) { t = e(t, this.defaultMoveAmount), this.move(this._camera.direction, t) }, B.prototype.moveBackward = function(t) {
t = e(t, this.defaultMoveAmount), this.move(this._camera.direction, -t)
}, B.prototype.moveUp = function(t) { t = e(t, this.defaultMoveAmount), this.move(this._camera.up, t) }, B.prototype.moveDown = function(t) { t = e(t, this.defaultMoveAmount), this.move(this._camera.up, -t) }, B.prototype.moveRight = function(t) { t = e(t, this.defaultMoveAmount), this.move(this._camera.right, t) }, B.prototype.moveLeft = function(t) { t = e(t, this.defaultMoveAmount), this.move(this._camera.right, -t) }, B.prototype.lookLeft = function(t) { t = e(t, this.defaultLookAmount), this.look(this._camera.up, -t) }, B.prototype.lookRight = function(t) { t = e(t, this.defaultLookAmount), this.look(this._camera.up, t) }, B.prototype.lookUp = function(t) { t = e(t, this.defaultLookAmount), this.look(this._camera.right, -t) }, B.prototype.lookDown = function(t) { t = e(t, this.defaultLookAmount), this.look(this._camera.right, t) };
var k = new m,
U = new h;
B.prototype.look = function(r, i) { if (!t(r)) throw new a("axis is required."); var n = e(i, this.defaultLookAmount),
o = h.fromQuaternion(m.fromAxisAngle(r, n, k), U),
s = this._camera.direction,
l = this._camera.up,
u = this._camera.right;
h.multiplyByVector(o, s, s), h.multiplyByVector(o, l, l), h.multiplyByVector(o, u, u) }, B.prototype.twistLeft = function(t) { t = e(t, this.defaultLookAmount), this.look(this._camera.direction, t) }, B.prototype.twistRight = function(t) { t = e(t, this.defaultLookAmount), this.look(this._camera.direction, -t) };
var W = n.UNIT_W.clone(),
G = n.ZERO.clone(),
H = n.ZERO.clone(),
j = n.ZERO.clone(),
Y = n.UNIT_W.clone(),
X = n.ZERO.clone(),
Z = n.ZERO.clone(),
K = n.ZERO.clone(),
J = new m,
Q = new h;
B.prototype.rotate = function(r, n, o) { if (!t(r)) throw new a("axis is required."); var s = this._camera,
l = e(n, this.defaultRotateAmount),
u = h.fromQuaternion(m.fromAxisAngle(r, l, J), Q),
c = g(this, o);
h.multiplyByVector(u, s.position, s.position), h.multiplyByVector(u, s.direction, s.direction), h.multiplyByVector(u, s.up, s.up), i.cross(s.direction, s.up, s.right), i.cross(s.right, s.direction, s.up), _(this, c) }, B.prototype.rotateDown = function(t, r) { t = e(t, this.defaultRotateAmount), w(this, t, r) }, B.prototype.rotateUp = function(t, r) { t = e(t, this.defaultRotateAmount), w(this, -t, r) };
var $ = new i,
et = new i,
tt = new i;
B.prototype.rotateRight = function(t, r) { t = e(t, this.defaultRotateAmount), C(this, -t, r) }, B.prototype.rotateLeft = function(t, r) { t = e(t, this.defaultRotateAmount), C(this, t, r) }, B.prototype.zoomIn = function(t) { t = e(t, this.defaultZoomAmount), this._mode === f.SCENE2D ? x(this, t) : S(this, t) }, B.prototype.zoomOut = function(t) { t = e(t, this.defaultZoomAmount), this._mode === f.SCENE2D ? x(this, -t) : S(this, -t) }, B.prototype.getMagnitude = function() { var e = this._camera; return this._mode === f.SCENE3D ? e.position.magnitude() : this._mode === f.COLUMBUS_VIEW ? Math.abs(e.position.z) : this._mode === f.SCENE2D ? Math.max(e.frustum.right - e.frustum.left, e.frustum.top - e.frustum.bottom) : void 0 }, B.prototype.setPositionCartographic = function(e) { if (!t(e)) throw new a("cartographic is required.");
this._mode === f.SCENE2D ? E(this, e) : this._mode === f.COLUMBUS_VIEW ? b(this, e) : this._mode === f.SCENE3D && T(this, e) }, B.prototype.lookAt = function(e, r, n) { if (!t(e)) throw new a("eye is required"); if (!t(r)) throw new a("target is required"); if (!t(n)) throw new a("up is required"); if (this._mode === f.SCENE2D) throw new a("lookAt is not supported in 2D mode because there is only one direction to look."); if (this._mode === f.MORPHING) throw new a("lookAt is not supported while morphing."); var o = this._camera;
o.position = i.clone(e, o.position), o.direction = i.subtract(r, e, o.direction).normalize(o.direction), o.right = i.cross(o.direction, n, o.right).normalize(o.right), o.up = i.cross(o.right, o.direction, o.up) };
var rt = new o,
it = new i,
nt = new i,
ot = new i,
at = new i,
st = new i,
lt = { direction: new i, right: new i, up: new i },
ut = new o,
ct = n.UNIT_W.clone(),
ht = n.UNIT_W.clone(),
dt = new d,
mt = new o,
pt = new i,
ft = new i;
B.prototype.getExtentCameraCoordinates = function(e, r) { if (!t(e)) throw new a("extent is required"); return this._mode === f.SCENE3D ? A(this._camera, e, this._projection.getEllipsoid(), r, !0) : this._mode === f.COLUMBUS_VIEW ? M(this._camera, e, this._projection, r, !0) : this._mode === f.SCENE2D ? P(this._camera, e, this._projection, r, !0) : void 0 }, B.prototype.viewExtent = function(r, i) { if (!t(r)) throw new a("extent is required.");
i = e(i, s.WGS84), this._mode === f.SCENE3D ? A(this._camera, r, i, this._camera.position) : this._mode === f.COLUMBUS_VIEW ? M(this._camera, r, this._projection, this._camera.position) : this._mode === f.SCENE2D && P(this._camera, r, this._projection, this._camera.position) };
var vt = new p,
yt = new p,
gt = new p;
B.prototype.pickEllipsoid = function(r, n, o) { if (!t(r)) throw new a("windowPosition is required."); return t(o) || (o = new i), n = e(n, s.WGS84), this._mode === f.SCENE3D ? o = D(this, r, n, o) : this._mode === f.SCENE2D ? o = I(this, r, this._projection, o) : this._mode === f.COLUMBUS_VIEW && (o = O(this, r, this._projection, o)), o };
var _t = new i,
wt = new i,
Ct = new i;
return B.prototype.getPickRay = function(e, r) { if (!t(e)) throw new a("windowPosition is required.");
t(r) || (r = new p); var i = this._camera,
n = i.frustum; return t(n.aspectRatio) && t(n.fovy) && t(n.near) ? R(i, e, r) : L(i, e, r) }, B.prototype.createCorrectPositionAnimation = function(e) { if (!t(e)) throw new a("duration is required."); return this._mode === f.SCENE2D ? z(this, e) : this._mode === f.COLUMBUS_VIEW ? F(this, e) : void 0 }, B
}), r("Scene/CullingVolume", ["../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/Intersect"], function(e, t, r, i) { "use strict"; var n = function(t) { this.planes = e(t, []) }; return n.prototype.getVisibility = function(e) { if (!t(e)) throw new r("boundingVolume is required."); for (var n = this.planes, o = !1, a = 0, s = n.length; s > a; ++a) { var l = e.intersect(n[a]); if (l === i.OUTSIDE) return i.OUTSIDE;
l === i.INTERSECTING && (o = !0) } return o ? i.INTERSECTING : i.INSIDE }, n }), r("Scene/PerspectiveOffCenterFrustum", ["../Core/DeveloperError", "../Core/defaultValue", "../Core/defined", "../Core/destroyObject", "../Core/Cartesian2", "../Core/Cartesian3", "../Core/Cartesian4", "../Core/Matrix4", "../Scene/CullingVolume"], function(e, t, r, i, n, o, a, s, l) { "use strict";
function u(t) { if (!(r(t.right) && r(t.left) && r(t.top) && r(t.bottom) && r(t.near) && r(t.far))) throw new e("right, left, top, bottom, near, or far parameters are not set."); var i = t.top,
n = t.bottom,
o = t.right,
a = t.left,
l = t.near,
u = t.far; if (i !== t._top || n !== t._bottom || a !== t._left || o !== t._right || l !== t._near || u !== t._far) { if (t.near <= 0 || t.near > t.far) throw new e("near must be greater than zero and less than far.");
t._left = a, t._right = o, t._top = i, t._bottom = n, t._near = l, t._far = u, t._perspectiveMatrix = s.computePerspectiveOffCenter(a, o, n, i, l, u), t._infinitePerspective = s.computeInfinitePerspectiveOffCenter(a, o, n, i, l) } } var c = function() { this.left = void 0, this._left = void 0, this.right = void 0, this._right = void 0, this.top = void 0, this._top = void 0, this.bottom = void 0, this._bottom = void 0, this.near = 1, this._near = this.near, this.far = 5e8, this._far = this.far, this._cullingVolume = new l, this._perspectiveMatrix = void 0, this._infinitePerspective = void 0 };
c.prototype.getProjectionMatrix = function() { return u(this), this._perspectiveMatrix }, c.prototype.getInfiniteProjectionMatrix = function() { return u(this), this._infinitePerspective }; var h = new o,
d = new o,
m = new o,
p = new o; return c.prototype.computeCullingVolume = function(t, i, n) { if (!r(t)) throw new e("position is required."); if (!r(i)) throw new e("direction is required."); if (!r(n)) throw new e("up is required."); var s = this._cullingVolume.planes,
l = this.top,
u = this.bottom,
c = this.right,
f = this.left,
v = this.near,
y = this.far,
g = o.cross(i, n, h),
_ = d;
o.multiplyByScalar(i, v, _), o.add(t, _, _); var w = m;
o.multiplyByScalar(i, y, w), o.add(t, w, w); var C = p;
o.multiplyByScalar(g, f, C), o.add(_, C, C), o.subtract(C, t, C), o.normalize(C, C), o.cross(C, n, C); var x = s[0]; return r(x) || (x = s[0] = new a), x.x = C.x, x.y = C.y, x.z = C.z, x.w = -o.dot(C, t), o.multiplyByScalar(g, c, C), o.add(_, C, C), o.subtract(C, t, C), o.normalize(C, C), o.cross(n, C, C), x = s[1], r(x) || (x = s[1] = new a), x.x = C.x, x.y = C.y, x.z = C.z, x.w = -o.dot(C, t), o.multiplyByScalar(n, u, C), o.add(_, C, C), o.subtract(C, t, C), o.normalize(C, C), o.cross(g, C, C), x = s[2], r(x) || (x = s[2] = new a), x.x = C.x, x.y = C.y, x.z = C.z, x.w = -o.dot(C, t), o.multiplyByScalar(n, l, C), o.add(_, C, C), o.subtract(C, t, C), o.normalize(C, C), o.cross(C, g, C), x = s[3], r(x) || (x = s[3] = new a), x.x = C.x, x.y = C.y, x.z = C.z, x.w = -o.dot(C, t), x = s[4], r(x) || (x = s[4] = new a), x.x = i.x, x.y = i.y, x.z = i.z, x.w = -o.dot(i, _), o.negate(i, C), x = s[5], r(x) || (x = s[5] = new a), x.x = C.x, x.y = C.y, x.z = C.z, x.w = -o.dot(C, w), this._cullingVolume }, c.prototype.getPixelSize = function(i, o) { if (u(this), !r(i)) throw new e("canvasDimensions is required."); var a = i.x,
s = i.y; if (0 >= a) throw new e("canvasDimensions.x must be greater than zero."); if (0 >= s) throw new e("canvasDimensions.y must be greater than zero.");
o = t(o, this.near); var l = 1 / this.near,
c = this.top * l,
h = 2 * o * c / s;
c = this.right * l; var d = 2 * o * c / a; return new n(d, h) }, c.prototype.clone = function() { var e = new c; return e.right = this.right, e.left = this.left, e.top = this.top, e.bottom = this.bottom, e.near = this.near, e.far = this.far, e }, c.prototype.equals = function(e) { return r(e) && this.right === e.right && this.left === e.left && this.top === e.top && this.bottom === e.bottom && this.near === e.near && this.far === e.far }, c }), r("Scene/PerspectiveFrustum", ["../Core/defined", "../Core/DeveloperError", "../Scene/PerspectiveOffCenterFrustum"], function(e, t, r) { "use strict";
function i(r) { if (!(e(r.fovy) && e(r.aspectRatio) && e(r.near) && e(r.far))) throw new t("fovy, aspectRatio, near, or far parameters are not set."); var i = r._offCenterFrustum; if (r.fovy !== r._fovy || r.aspectRatio !== r._aspectRatio || r.near !== r._near || r.far !== r._far) { if (r.fovy < 0 || r.fovy >= Math.PI) throw new t("fovy must be in the range [0, PI)."); if (r.aspectRatio < 0) throw new t("aspectRatio must be positive."); if (r.near < 0 || r.near > r.far) throw new t("near must be greater than zero and less than far.");
r._fovy = r.fovy, r._aspectRatio = r.aspectRatio, r._near = r.near, r._far = r.far, i.top = r.near * Math.tan(.5 * r.fovy), i.bottom = -i.top, i.right = r.aspectRatio * i.top, i.left = -i.right, i.near = r.near, i.far = r.far } } var n = function() { this._offCenterFrustum = new r, this.fovy = void 0, this._fovy = void 0, this.aspectRatio = void 0, this._aspectRatio = void 0, this.near = 1, this._near = this.near, this.far = 5e8, this._far = this.far }; return n.prototype.getProjectionMatrix = function() { return i(this), this._offCenterFrustum.getProjectionMatrix() }, n.prototype.getInfiniteProjectionMatrix = function() { return i(this), this._offCenterFrustum.getInfiniteProjectionMatrix() }, n.prototype.computeCullingVolume = function(e, t, r) { return i(this), this._offCenterFrustum.computeCullingVolume(e, t, r) }, n.prototype.getPixelSize = function(e, t) { return i(this), this._offCenterFrustum.getPixelSize(e, t) }, n.prototype.clone = function() { var e = new n; return e.fovy = this.fovy, e.aspectRatio = this.aspectRatio, e.near = this.near, e.far = this.far, e._offCenterFrustum = this._offCenterFrustum.clone(), e }, n.prototype.equals = function(t) { return e(t) ? (i(this), i(t), this.fovy === t.fovy && this.aspectRatio === t.aspectRatio && this.near === t.near && this.far === t.far && this._offCenterFrustum.equals(t._offCenterFrustum)) : !1 }, n }), r("Scene/Camera", ["../Core/defined", "../Core/DeveloperError", "../Core/Math", "../Core/Ellipsoid", "../Core/Cartesian3", "../Core/Cartesian4", "../Core/Matrix4", "./CameraController", "./PerspectiveFrustum"], function(e, t, r, i, n, o, a, s, l) { "use strict";
function u(e) { var t = e._right,
r = e._up,
i = e._direction,
n = e._position,
o = new a(t.x, t.y, t.z, -t.dot(n), r.x, r.y, r.z, -r.dot(n), -i.x, -i.y, -i.z, i.dot(n), 0, 0, 0, 1);
e._viewMatrix = o.multiply(e._invTransform), e._invViewMatrix = e._viewMatrix.inverseTransformation() }
function c(e) { var t = e._position,
i = !t.equals(e.position);
i && (t = e._position = e.position.clone()); var a = e._direction,
s = !a.equals(e.direction);
s && (a = e._direction = e.direction.clone()); var l = e._up,
c = !l.equals(e.up);
c && (l = e._up = e.up.clone()); var h = e._right,
d = !h.equals(e.right);
d && (h = e._right = e.right.clone()); var m = e._transform,
p = !m.equals(e.transform); if (p && (m = e._transform = e.transform.clone(), e._invTransform = e._transform.inverseTransformation()), (i || p) && (e._positionWC = n.fromCartesian4(m.multiplyByPoint(t))), s || c || d) { var f = a.dot(l.cross(h)); if (Math.abs(1 - f) > r.EPSILON2) { a = e._direction = a.normalize(), e.direction = a.clone(); var v = 1 / l.magnitudeSquared(),
y = l.dot(a) * v,
g = a.multiplyByScalar(y);
l = e._up = l.subtract(g).normalize(), e.up = l.clone(), h = e._right = a.cross(l), e.right = h.clone() } }(s || p) && (e._directionWC = n.fromCartesian4(m.multiplyByVector(new o(a.x, a.y, a.z, 0)))), (c || p) && (e._upWC = n.fromCartesian4(m.multiplyByVector(new o(l.x, l.y, l.z, 0)))), (d || p) && (e._rightWC = n.fromCartesian4(m.multiplyByVector(new o(h.x, h.y, h.z, 0)))), (i || s || c || d || p) && u(e) } var h = function(o) { if (!e(o)) throw new t("canvas is required.");
this.transform = a.IDENTITY.clone(), this._transform = this.transform.clone(), this._invTransform = a.IDENTITY.clone(); var c = i.WGS84.getMaximumRadius(),
h = new n(0, -2, 1).normalize().multiplyByScalar(2.5 * c);
this.position = h.clone(), this._position = h, this._positionWC = h; var d = n.ZERO.subtract(h).normalize();
this.direction = d.clone(), this._direction = d, this._directionWC = d; var m = d.cross(n.UNIT_Z).normalize(),
p = m.cross(d);
this.up = p.clone(), this._up = p, this._upWC = p, m = d.cross(p), this.right = m.clone(), this._right = m, this._rightWC = m, this.frustum = new l, this.frustum.fovy = r.toRadians(60), this.frustum.aspectRatio = o.clientWidth / o.clientHeight, this.controller = new s(this), this._viewMatrix = void 0, this._invViewMatrix = void 0, u(this), this._canvas = o }; return h.prototype.getInverseTransform = function() { return c(this), this._invTransform }, h.prototype.getViewMatrix = function() { return c(this), this._viewMatrix }, h.prototype.getInverseViewMatrix = function() { return c(this), this._invViewMatrix }, h.prototype.getPositionWC = function() { return c(this), this._positionWC }, h.prototype.getDirectionWC = function() { return c(this), this._directionWC }, h.prototype.getUpWC = function() { return c(this), this._upWC }, h.prototype.getRightWC = function() { return c(this), this._rightWC }, h.prototype.clone = function() { var e = new h(this._canvas); return e.position = this.position.clone(), e.direction = this.direction.clone(), e.up = this.up.clone(), e.right = this.right.clone(), e.transform = this.transform.clone(), e.frustum = this.frustum.clone(), e }, h.prototype.worldToCameraCoordinates = function(r, i) { if (!e(r)) throw new t("cartesian is required."); return a.multiplyByVector(this.getInverseTransform(), r, i) }, h.prototype.cameraToWorldCoordinates = function(r, i) { if (!e(r)) throw new t("cartesian is required."); return a.multiplyByVector(this.transform, r, i) }, h }), r("Scene/CameraEventType", ["../Core/Enumeration"], function(e) { "use strict"; var t = { LEFT_DRAG: new e(0, "LEFT_DRAG"), RIGHT_DRAG: new e(1, "RIGHT_DRAG"), MIDDLE_DRAG: new e(2, "MIDDLE_DRAG"), WHEEL: new e(3, "WHEEL"), PINCH: new e(4, "PINCH") }; return t }), r("Scene/CameraEventAggregator", ["../Core/defined", "../Core/DeveloperError", "../Core/destroyObject", "../Core/Math", "../Core/ScreenSpaceEventHandler", "../Core/ScreenSpaceEventType", "../Core/Cartesian2", "./CameraEventType"], function(e, t, r, i, n, o, a, s) { "use strict"; var l = function(r, l, u) { if (!e(r)) throw new t("description.canvas is required."); if (!e(l)) throw new t("moveType is required.");
this._eventHandler = new n(r), this._update = !0, this._movement = void 0, this._lastMovement = void 0, this._isDown = !1, this._pressTime = void 0, this._releaseTime = void 0; var c = this; if (l === s.PINCH) this._eventHandler.setInputAction(function() { c._isDown = !0, c._pressTime = new Date }, o.PINCH_START, u), this._eventHandler.setInputAction(function() { c._isDown = !1, c._releaseTime = new Date }, o.PINCH_END, u), this._eventHandler.setInputAction(function(e) { if (c._isDown) { c._update ? (c._movement = e, c._update = !1, c._movement.prevAngle = c._movement.angleAndHeight.startPosition.x) : (c._movement.distance.endPosition = e.distance.endPosition.clone(), c._movement.angleAndHeight.endPosition = e.angleAndHeight.endPosition.clone()); for (var t = c._movement.angleAndHeight.endPosition.x, i = c._movement.prevAngle, n = 2 * Math.PI; t >= i + Math.PI;) t -= n; for (; t < i - Math.PI;) t += n;
c._movement.angleAndHeight.endPosition.x = -t * r.clientWidth / 12, c._movement.angleAndHeight.startPosition.x = -i * r.clientWidth / 12 } }, o.PINCH_MOVE, u);
else if (l === s.WHEEL) this._eventHandler.setInputAction(function(e) { var t = 2 * i.toRadians(e);
c._update ? (c._movement = { startPosition: new a, endPosition: new a(0, t), motion: new a }, c._lastMovement = c._movement, c._update = !1) : c._movement.endPosition.y = c._movement.endPosition.y + t, c._pressTime = new Date, c._releaseTime = new Date(c._pressTime.getTime() + 5 * Math.abs(t)) }, o.WHEEL, u);
else { var h, d; if (l === s.LEFT_DRAG) h = o.LEFT_DOWN, d = o.LEFT_UP;
else if (l === s.RIGHT_DRAG) h = o.RIGHT_DOWN, d = o.RIGHT_UP;
else { if (l !== s.MIDDLE_DRAG) throw this._eventHandler = this._eventHandler && this._eventHandler.destroy(), new t("moveType must be of type CameraEventType.");
h = o.MIDDLE_DOWN, d = o.MIDDLE_UP } this._eventHandler.setInputAction(function() { c._lastMovement = null, c._isDown = !0, c._pressTime = new Date }, h, u), this._eventHandler.setInputAction(function() { c._isDown = !1, c._releaseTime = new Date }, d, u), this._eventHandler.setInputAction(function(e) { c._isDown && (c._update ? (c._lastMovement = c._movement, c._movement = e, c._update = !1) : c._movement.endPosition = e.endPosition.clone()) }, o.MOUSE_MOVE, u) } }; return l.prototype.isMoving = function() { return !this._update }, l.prototype.getMovement = function() { var e = this._movement; return this._update = !0, e }, l.prototype.getLastMovement = function() { return this._lastMovement }, l.prototype.isButtonDown = function() { return this._isDown }, l.prototype.getButtonPressTime = function() { return this._pressTime }, l.prototype.getButtonReleaseTime = function() { return this._releaseTime }, l.prototype.isDestroyed = function() { return !1 }, l.prototype.destroy = function() { return this._eventHandler = this._eventHandler && this._eventHandler.destroy(), r(this) }, l }), r("Scene/CameraFlightPath", ["../Core/Cartesian2", "../Core/Cartesian3", "../Core/clone", "../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/HermiteSpline", "../Core/Math", "../Core/Matrix3", "../Core/OrientationInterpolator", "../Core/Quaternion", "../Scene/PerspectiveFrustum", "../Scene/PerspectiveOffCenterFrustum", "../Scene/SceneMode", "../ThirdParty/Tween"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p) { "use strict";
function f(e, t, r) { return e.cross(t, I), I.cross(e, O), D[0] = I.x, D[1] = O.x, D[2] = -e.x, D[3] = I.y, D[4] = O.y, D[5] = -e.y, D[6] = I.z, D[7] = O.z, D[8] = -e.z, c.fromRotationMatrix(D, r) }
function v(e, t, r) { var i, n, o; if (e instanceof h) { var a = Math.tan(.5 * e.fovy); return i = e.near, n = e.near * a, o = e.aspectRatio * n, Math.max(t * i / o, r * i / n) } return e instanceof d ? (i = e.near, n = e.top, o = e.right, Math.max(t * i / o, r * i / n)) : Math.max(t, r) }
function y(e) { if (e.length > 2) return new a(e); var r = e[0],
i = e[1]; return { getControlPoints: function() { return e }, evaluate: function(e, n) { e = s.clamp(e, r.time, i.time); var o = (e - r.time) / (i.time - r.time); return t.lerp(r.point, i.point, o, n) } } }
function g(e, r, i, n, o) { var a, u, h, d = r.getMaximumRadius(),
m = e.frustum,
p = v(m, d, d),
f = i.normalize().dot(n.normalize()); if (i.magnitude() > p) u = d + .6 * (p - d), h = .35;
else { var g = i.subtract(n);
u = g.multiplyByScalar(.5).add(n).magnitude(); var _ = e.up.multiplyByScalar(g.dot(e.up)).magnitude(),
w = e.right.multiplyByScalar(g.dot(e.right)).magnitude();
u += v(m, _, w), h = s.clamp(f + 1, .25, .5) } var C, x, S, E, b = n.normalize().multiplyByScalar(u),
T = i.normalize().multiplyByScalar(u); if (n.magnitude() > p && f > .75) E = i.subtract(n).multiplyByScalar(.5).add(n), a = [{ point: i }, { point: E }, { point: n }];
else if (i.magnitude() > p && f > 0) E = i.subtract(b).multiplyByScalar(.5).add(b), a = [{ point: i }, { point: E }, { point: n }];
else { a = [{ point: i }], x = Math.acos(T.normalize().dot(b.normalize())), C = T.cross(b), C.equalsEpsilon(t.ZERO, s.EPSILON6) && (C = t.UNIT_Z); for (var A = h * x, M = x - A, P = M; P > 0; P -= A) S = l.fromQuaternion(c.fromAxisAngle(C, P)), a.push({ point: S.multiplyByVector(b) });
a.push({ point: n }) } for (var D = o / (a.length - 1), I = 0; I < a.length; ++I) a[I].time = I * D; return y(a) }
function _(e, r, i, o) { r[0].orientation = f(e.direction, e.up); for (var a, s = r.length - 1, l = 1; s > l; ++l) a = r[l], a.point.negate(R).normalize(R), R.cross(t.UNIT_Z, L).normalize(L), L.cross(R, z), a.orientation = f(R, z, N); return a = r[s], n(i) && n(o) ? a.orientation = f(i, o) : (a.point.negate(R).normalize(R), R.cross(t.UNIT_Z, L).normalize(L), L.cross(R, z), a.orientation = f(R, z, N)), new u(r) }
function w(e, t, r, i, n) { var o = e.camera,
a = e.scene2D.projection.getEllipsoid(),
s = g(o, a, o.position, t, r),
u = _(o, s.getControlPoints(), i, n),
c = function(e) { var t = e.time,
r = u.evaluate(t);
l.fromQuaternion(r, P), o.position = s.evaluate(t, o.position), o.right = P.getRow(0, o.right), o.up = P.getRow(1, o.up), o.direction = P.getRow(2, o.direction).negate(o.direction) }; return c }
function C(e, r, i, n, o) { var a, l, u = r.getMaximumRadius(),
c = e.frustum,
h = v(c, Math.PI * u, s.PI_OVER_TWO * u),
d = .5; if (i.z > h) l = .6 * h;
else { var m = i.subtract(n);
l = v(c, Math.abs(m.y), Math.abs(m.x)) } var p = n.clone();
p.z = l; var f = i.clone();
f.z = l; var g; if (n.z > h) g = i.subtract(n).multiplyByScalar(.5).add(n), a = [{ point: i }, { point: g }, { point: n }];
else if (i.z > h) g = i.subtract(p).multiplyByScalar(.5).add(p), a = [{ point: i }, { point: g }, { point: n }];
else { a = [{ point: i }]; var _ = f.subtract(p),
w = _.magnitude();
t.normalize(_, _); for (var C = d * w, x = w - C, S = x; S > 0; S -= C) a.push({ point: _.multiplyByScalar(S).add(p) });
a.push({ point: n }) } for (var E = o / (a.length - 1), b = 0; b < a.length; ++b) a[b].time = b * E; return y(a) }
function x(e, t, r, i) { t[0].orientation = f(e.direction, e.up); for (var o, a = t.length - 1, s = 1; a > s; ++s) o = t[s], o.orientation = q; return o = t[a], o.orientation = n(r) && n(i) ? f(r, i) : q, new u(t) }
function S(e, t, r, i, n) { var o = e.camera,
a = e.scene2D.projection.getEllipsoid(),
s = C(o, a, o.position.clone(), t, r),
u = x(o, s.getControlPoints(), i, n),
c = function(e) { var t = e.time,
r = u.evaluate(t);
l.fromQuaternion(r, P), o.position = s.evaluate(t, o.position), o.right = P.getRow(0, o.right), o.up = P.getRow(1, o.up), o.direction = P.getRow(2, o.direction).negate(o.direction) }; return c }
function E(e, r, i, n, o) { var a = e.camera,
s = e.scene2D.projection.getEllipsoid(),
u = a.position.clone();
u.z = a.frustum.right - a.frustum.left; var c = C(a, s, u, r, i),
h = c.getControlPoints(),
d = x(a, h, t.UNIT_Z.negate(), o),
m = a.position.z,
p = function(e) { var t = e.time,
r = d.evaluate(t);
l.fromQuaternion(r, P), a.position = c.evaluate(t, a.position); var i = a.position.z;
a.position.z = m, a.right = P.getRow(0, a.right), a.up = P.getRow(1, a.up), a.direction = P.getRow(2, a.direction).negate(a.direction); var n = a.frustum,
o = n.top / n.right,
s = .5 * (i - (n.right - n.left));
n.right += s, n.left -= s, n.top = o * n.right, n.bottom = -n.top }; return p }
function b(e) { var t = { enableTranslate: e.enableTranslate, enableZoom: e.enableZoom, enableRotate: e.enableRotate, enableTilt: e.enableTilt, enableLook: e.enableLook }; return e.enableTranslate = !1, e.enableZoom = !1, e.enableRotate = !1, e.enableTilt = !1, e.enableLook = !1, t }
function T(e, t) { e.enableTranslate = t.enableTranslate, e.enableZoom = t.enableZoom, e.enableRotate = t.enableRotate, e.enableTilt = t.enableTilt, e.enableLook = t.enableLook } var A = {},
M = new t,
P = new l,
D = new l,
I = new t,
O = new t,
R = new t,
L = new t,
z = new t,
N = new c,
F = t.UNIT_Z.negate(),
B = F.cross(t.UNIT_Y).normalize(),
V = B.cross(F),
q = f(F, V),
k = new t,
U = new t,
W = new t; return A.createAnimation = function(r, a) { a = i(a, i.EMPTY_OBJECT); var l = a.destination; if (!n(r)) throw new o("scene is required."); if (!n(l)) throw new o("destination is required."); var u = r.getFrameState(); if (u.mode === m.MORPHING) throw new o("frameState.mode cannot be SceneMode.MORPHING"); var c = a.direction,
h = a.up,
d = i(a.duration, 3e3),
f = r.getScreenSpaceCameraController(),
v = b(f),
y = function(e) { var t = function() { "function" == typeof e && e(), T(f, v) }; return t },
g = y(a.onComplete),
_ = y(a.onCancel),
C = u.camera.frustum; if (u.mode === m.SCENE2D) { if (e.equalsEpsilon(u.camera.position, l, s.EPSILON6) && s.equalsEpsilon(Math.max(C.right - C.left, C.top - C.bottom), l.z, s.EPSILON6)) return { duration: 0, onComplete: g, onCancel: _ } } else if (t.equalsEpsilon(l, u.camera.position, s.EPSILON6)) return { duration: 0, onComplete: g, onCancel: _ }; if (0 >= d) { var x = function() { var e = l; if (u.mode === m.SCENE3D ? (n(a.direction) || n(a.up) ? (k = a.direction, U = k.cross(a.up, U).normalize(U)) : (k = e.negate(k).normalize(k), U = k.cross(t.UNIT_Z, U).normalize(U)), W = i(a.up, U.cross(k, W))) : (n(a.direction) || n(a.up) ? (k = a.direction, U = k.cross(a.up, U).normalize(U)) : (k = t.UNIT_Z.negate(k), U = k.cross(t.UNIT_Y, U).normalize(U)), W = i(a.up, U.cross(k, W))), t.clone(e, u.camera.position), t.clone(k, u.camera.direction), t.clone(W, u.camera.up), t.clone(U, u.camera.right), u.mode === m.SCENE2D) { var r = u.camera.position.z,
o = C.top / C.right,
s = .5 * (r - (C.right - C.left));
C.right += s, C.left -= s, C.top = o * C.right, C.bottom = -C.top } "function" == typeof g && g() }; return { duration: 0, onComplete: x, onCancel: _ } } var A; return A = u.mode === m.SCENE3D ? w(u, l, d, c, h) : u.mode === m.SCENE2D ? E(u, l, d, c, h) : S(u, l, d, c, h), { duration: d, easingFunction: p.Easing.Sinusoidal.InOut, startValue: { time: 0 }, stopValue: { time: d }, onUpdate: A, onComplete: g, onCancel: _ } }, A.createAnimationCartographic = function(e, t) { t = i(t, i.EMPTY_OBJECT); var a = t.destination; if (!n(e)) throw new o("scene is required."); if (!n(a)) throw new o("description.destination is required."); var s = e.getFrameState(),
l = s.scene2D.projection; if (s.mode === m.SCENE3D) { var u = l.getEllipsoid();
u.cartographicToCartesian(a, M) } else { if (s.mode !== m.COLUMBUS_VIEW && s.mode !== m.SCENE2D) throw new o("frameState.mode cannot be SceneMode.MORPHING");
l.project(a, M) } var c = r(t); return c.destination = M, this.createAnimation(e, c) }, A.createAnimationExtent = function(e, t) { t = i(t, i.EMPTY_OBJECT); var a = t.destination,
s = e.getFrameState(); if (!n(s)) throw new o("frameState is required."); if (!n(a)) throw new o("description.destination is required."); if (s.mode === m.MORPHING) throw new o("frameState.mode cannot be SceneMode.MORPHING"); var l = r(t),
u = s.camera; return u.controller.getExtentCameraCoordinates(a, M), l.destination = M, this.createAnimation(e, l) }, A }), r("Scene/Imagery", ["../Core/defined", "../Core/destroyObject", "./ImageryState"], function(e, t, r) { "use strict"; var i = function(t, i, n, o, a) { if (this.imageryLayer = t, this.x = i, this.y = n, this.level = o, 0 !== o) { var s = 0 | i / 2,
l = 0 | n / 2,
u = o - 1;
this.parent = t.getImageryFromCache(s, l, u) } if (this.state = r.UNLOADED, this.imageUrl = void 0, this.image = void 0, this.texture = void 0, this.referenceCount = 0, !e(a) && t.getImageryProvider().isReady()) { var c = t.getImageryProvider().getTilingScheme();
a = c.tileXYToExtent(i, n, o) } this.extent = a }; return i.createPlaceholder = function(e) { var t = new i(e, 0, 0, 0); return t.addReference(), t.state = r.PLACEHOLDER, t }, i.prototype.addReference = function() {++this.referenceCount }, i.prototype.releaseReference = function() { return --this.referenceCount, 0 === this.referenceCount ? (this.imageryLayer.removeImageryFromCache(this), e(this.parent) && this.parent.releaseReference(), e(this.image) && e(this.image.destroy) && this.image.destroy(), e(this.texture) && e(this.texture.destroy) && this.texture.destroy(), t(this), 0) : this.referenceCount }, i }), r("Scene/TileImagery", ["../Core/defined", "./ImageryState"], function(e, t) { "use strict"; var r = function(e, t) { this.readyImagery = void 0, this.loadingImagery = e, this.textureCoordinateExtent = t, this.textureTranslationAndScale = void 0 }; return r.prototype.freeResources = function() { e(this.readyImagery) && this.readyImagery.releaseReference(), e(this.loadingImagery) && this.loadingImagery.releaseReference() }, r.prototype.processStateMachine = function(r, i) { var n = this.loadingImagery,
o = n.imageryLayer; if (n.state === t.UNLOADED && (n.state = t.TRANSITIONING, o._requestImagery(n)), n.state === t.RECEIVED && (n.state = t.TRANSITIONING, o._createTexture(i, n)), n.state === t.TEXTURE_LOADED && (n.state = t.TRANSITIONING, o._reprojectTexture(i, n)), n.state === t.READY) return e(this.readyImagery) && this.readyImagery.releaseReference(), this.readyImagery = this.loadingImagery, this.loadingImagery = void 0, this.textureTranslationAndScale = o._calculateTextureTranslationAndScale(r, this), !0; for (var a = n.parent, s = !1; e(a) && a.state !== t.READY;) s = s || a.state !== t.FAILED && a.state !== t.INVALID, a = a.parent; return this.readyImagery !== a && (e(this.readyImagery) && this.readyImagery.releaseReference(), this.readyImagery = a, e(a) && (a.addReference(), this.textureTranslationAndScale = o._calculateTextureTranslationAndScale(r, this))), s || n.state !== t.FAILED && n.state !== t.INVALID ? !1 : !0 }, r }), r("Scene/TexturePool", ["../Core/defined", "../Core/destroyObject", "../Core/DeveloperError", "../Renderer/PixelDatatype", "../Renderer/PixelFormat", "../Renderer/Texture"], function(e, t, r, i, n, o) { "use strict";
function a(t, r, i) { return e(s) || (s = function(e, t, r) { this._texture = e, this._textureTypeKey = t, this._pool = r }, Object.keys(o.prototype).forEach(function(e) { s.prototype[e] = function() { var t = this._texture; return t[e].apply(t, arguments) } }), s.prototype.destroy = function() { var t = this._pool._free[this._textureTypeKey];
e(t) || (t = this._pool._free[this._textureTypeKey] = []), t.length >= 8 ? this._texture.destroy() : t.push(this) }), new s(t, r, i) } var s, l = function() { this._free = {} }; return l.prototype.createTexture2D = function(t, o) { if (!o) throw new r("description is required."); var s = o.source,
l = e(s) ? s.width : o.width,
u = e(s) ? s.height : o.height,
c = +(o.pixelFormat || n.RGBA),
h = +(o.pixelDatatype || i.UNSIGNED_BYTE),
d = +(o.preMultiplyAlpha || c === n.RGB || c === n.LUMINANCE),
m = JSON.stringify([l, u, c, h, d]),
p = this._free[m]; if (e(p) && p.length > 0) { var f = p.pop(); return e(s) && f.copyFrom(s), f } return a(t.createTexture2D(o), m, this) }, l.prototype.isDestroyed = function() { return !1 }, l.prototype.destroy = function() { var e = this._free; return Object.keys(e).forEach(function(t) { e[t].forEach(function(e) { e._texture.destroy() }) }), t(this) }, l }), r("Shaders/ReprojectWebMercatorFS", [], function() { "use strict"; return "uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n" }), r("Shaders/ReprojectWebMercatorVS", [], function() { "use strict"; return "attribute vec4 position;\nuniform vec2 u_textureDimensions;\nuniform float u_northLatitude;\nuniform float u_southLatitude;\nuniform float u_southMercatorYHigh;\nuniform float u_southMercatorYLow;\nuniform float u_oneOverMercatorHeight;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nfloat currentLatitude = mix(u_southLatitude, u_northLatitude, position.y);\nfloat fraction = czm_latitudeToWebMercatorFraction(currentLatitude, u_southMercatorYLow, u_southMercatorYHigh, u_oneOverMercatorHeight);\nv_textureCoordinates = vec2(position.x, fraction);\ngl_Position = czm_viewportOrthographic * (position * vec4(u_textureDimensions, 1.0, 1.0));\n}\n" }), r("Scene/ImageryLayer", ["../Core/defaultValue", "../Core/defined", "../Core/destroyObject", "../Core/BoundingRectangle", "../Core/ComponentDatatype", "../Core/Cartesian2", "../Core/Cartesian4", "../Core/Color", "../Core/Extent", "../Core/FeatureDetection", "../Core/Math", "../Core/PrimitiveType", "../Core/Geometry", "../Core/GeometryAttribute", "../Renderer/BufferUsage", "../Renderer/MipmapHint", "../Renderer/TextureMagnificationFilter", "../Renderer/TextureMinificationFilter", "../Renderer/TextureWrap", "../Renderer/ClearCommand", "./GeographicTilingScheme", "./Imagery", "./TileProviderError", "./ImageryState", "./TileImagery", "./TerrainProvider", "./TexturePool", "../ThirdParty/when", "../Shaders/ReprojectWebMercatorFS", "../Shaders/ReprojectWebMercatorVS"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C, x, S, E, b, T, A, M, P) {
"use strict";
function D(e, t, r) { return JSON.stringify([e, t, r]) }
function I(r, o, a, l) {
var u = o.cache.imageryLayer_reproject;
if (!t(u)) { u = o.cache.imageryLayer_reproject = { framebuffer: void 0, vertexArray: void 0, shaderProgram: void 0, renderState: void 0, sampler: void 0, destroy: function() { t(this.framebuffer) && this.framebuffer.destroy(), t(this.vertexArray) && this.vertexArray.destroy(), t(this.shaderProgram) && this.shaderProgram.release() } }, u.framebuffer = o.createFramebuffer(), u.framebuffer.destroyAttachments = !1; for (var c = new Array(131072), w = 0, C = 0; 256 > C; ++C)
for (var x = C / 255, S = 0; 256 > S; ++S) { var E = S / 255;
c[w++] = E, c[w++] = x }
var T = new d({ attributes: { position: new m({ componentDatatype: n.FLOAT, componentsPerAttribute: 2, values: c }) }, indices: b.getRegularGridIndices(256, 256), primitiveType: h.TRIANGLES }),
A = { position: 0 };
u.vertexArray = o.createVertexArrayFromGeometry({ geometry: T, attributeIndices: A, bufferUsage: p.STATIC_DRAW }), u.shaderProgram = o.getShaderCache().getShaderProgram(P, M, A); var D = o.getMaximumTextureFilterAnisotropy();
u.sampler = o.createSampler({ wrapS: g.CLAMP, wrapT: g.CLAMP, minificationFilter: y.LINEAR, magnificationFilter: v.LINEAR, maximumAnisotropy: Math.min(D, e(r._maximumAnisotropy, D)) }) } a.setSampler(u.sampler);
var I = a.getWidth(),
O = a.getHeight();
L.textureDimensions.x = I, L.textureDimensions.y = O, L.texture = a, L.northLatitude = l.north, L.southLatitude = l.south;
var R = Math.sin(l.south),
N = .5 * Math.log((1 + R) / (1 - R));
z[0] = N, L.southMercatorYHigh = z[0], L.southMercatorYLow = N - z[0], R = Math.sin(l.north);
var F = .5 * Math.log((1 + R) / (1 - R));
L.oneOverMercatorHeight = 1 / (F - N);
var B = r._texturePool.createTexture2D(o, { width: I, height: O, pixelFormat: a.getPixelFormat(), pixelDatatype: a.getPixelDatatype(), preMultiplyAlpha: a.getPreMultiplyAlpha() });
B.generateMipmap(f.NICEST), u.framebuffer.setColorTexture(B);
var V = new _;
return V.color = s.BLACK, V.framebuffer = u.framebuffer, V.execute(o), t(u.renderState) && u.renderState.viewport.width === I && u.renderState.viewport.height === O || (u.renderState = o.createRenderState({ viewport: new i(0, 0, I, O) })), o.draw({ framebuffer: u.framebuffer, shaderProgram: u.shaderProgram, renderState: u.renderState, primitiveType: h.TRIANGLES, vertexArray: u.vertexArray, uniformMap: L }), B
}
function O(e, t, r) { var i = e._imageryProvider,
n = i.getTilingScheme(),
o = n.getEllipsoid(),
a = Math.cos(r),
s = n.getExtent(),
l = o.getMaximumRadius() * (s.east - s.west) * a / (i.getTileWidth() * n.getNumberOfXTilesAtLevel(0)),
u = l / t,
c = Math.log(u) / Math.log(2),
h = Math.round(c); return 0 | h }
var R = function N(t, r) { this._imageryProvider = t, r = e(r, {}), this.alpha = e(r.alpha, e(t.defaultAlpha, 1)), this.brightness = e(r.brightness, e(t.defaultBrightness, N.DEFAULT_BRIGHTNESS)), this.contrast = e(r.contrast, e(t.defaultContrast, N.DEFAULT_CONTRAST)), this.hue = e(r.hue, e(t.defaultHue, N.DEFAULT_HUE)), this.saturation = e(r.saturation, e(t.defaultSaturation, N.DEFAULT_SATURATION)), this.gamma = e(r.gamma, e(t.defaultGamma, N.DEFAULT_GAMMA)), this.show = e(r.show, !0), this._minimumTerrainLevel = r.minimumTerrainLevel, this._maximumTerrainLevel = r.maximumTerrainLevel, this._extent = e(r.extent, l.MAX_VALUE), this._maximumAnisotropy = r.maximumAnisotropy, this._imageryCache = {}, this._texturePool = new T, this._skeletonPlaceholder = new E(C.createPlaceholder(this)), this._show = !1, this._layerIndex = -1, this._isBaseLayer = !1, this._requestImageError = void 0 };
R.DEFAULT_BRIGHTNESS = 1, R.DEFAULT_CONTRAST = 1, R.DEFAULT_HUE = 0, R.DEFAULT_SATURATION = 1, R.DEFAULT_GAMMA = 1, R.prototype.getImageryProvider = function() { return this._imageryProvider }, R.prototype.getExtent = function() { return this._extent }, R.prototype.isBaseLayer = function() { return this._isBaseLayer }, R.prototype.isDestroyed = function() { return !1 }, R.prototype.destroy = function() { return this._texturePool = this._texturePool && this._texturePool.destroy(), r(this) }, R.prototype._createTileImagerySkeletons = function(e, r, i) { if (t(this._minimumTerrainLevel) && e.level < this._minimumTerrainLevel) return !1; if (t(this._maximumTerrainLevel) && e.level > this._maximumTerrainLevel) return !1; var n = this._imageryProvider; if (t(i) || (i = e.imagery.length), !n.isReady()) return this._skeletonPlaceholder.loadingImagery.addReference(), e.imagery.splice(i, 0, this._skeletonPlaceholder), !0; var o = e.extent.intersectWith(n.getExtent()); if (o = o.intersectWith(this._extent), o.east <= o.west || o.north <= o.south) { if (!this.isBaseLayer()) return !1; var s = n.getExtent().intersectWith(this._extent),
l = e.extent;
l.south >= s.north ? o.north = o.south = s.north : l.north <= s.south && (o.north = o.south = s.south), l.west >= s.east ? o.west = o.east = s.east : l.east <= s.west && (o.west = o.east = s.west) } var u = 0;
o.south > 0 ? u = o.south : o.north < 0 && (u = o.north); var c = 1,
h = c * r.getLevelMaximumGeometricError(e.level),
d = O(this, h, u);
d = Math.max(0, d); var m = n.getMaximumLevel(); if (d > m && (d = m), t(n.getMinimumLevel)) { var p = n.getMinimumLevel();
p > d && (d = p) } var f = n.getTilingScheme(),
v = f.positionToTileXY(o.getNorthwest(), d),
y = f.positionToTileXY(o.getSoutheast(), d),
g = (e.extent.north - e.extent.south) / 512,
_ = (e.extent.east - e.extent.west) / 512,
w = f.tileXYToExtent(v.x, v.y, d);
Math.abs(w.south - e.extent.north) < _ && v.y < y.y && ++v.y, Math.abs(w.east - e.extent.west) < g && v.x < y.x && ++v.x; var C = f.tileXYToExtent(y.x, y.y, d);
Math.abs(C.north - e.extent.south) < _ && y.y > v.y && --y.y, Math.abs(C.west - e.extent.east) < g && y.x > v.x && --y.x; var x, S, b = e.extent,
T = f.tileXYToExtent(v.x, v.y, d),
A = 0,
M = 1;!this.isBaseLayer() && Math.abs(T.west - e.extent.west) >= g && (A = Math.min(1, (T.west - b.west) / (b.east - b.west))), !this.isBaseLayer() && Math.abs(T.north - e.extent.north) >= _ && (M = Math.max(0, (T.north - b.south) / (b.north - b.south))); for (var P = M, D = v.x; D <= y.x; D++) { x = A, T = f.tileXYToExtent(D, v.y, d), A = Math.min(1, (T.east - b.west) / (b.east - b.west)), D === y.x && (this.isBaseLayer() || Math.abs(T.east - e.extent.east) < g) && (A = 1), M = P; for (var I = v.y; I <= y.y; I++) { S = M, T = f.tileXYToExtent(D, I, d), M = Math.max(0, (T.south - b.south) / (b.north - b.south)), I === y.y && (this.isBaseLayer() || Math.abs(T.south - e.extent.south) < _) && (M = 0); var R = new a(x, M, A, S),
L = this.getImageryFromCache(D, I, d, T);
e.imagery.splice(i, 0, new E(L, R)), ++i } } return !0 }, R.prototype._calculateTextureTranslationAndScale = function(e, t) { var r = t.readyImagery.extent,
i = e.extent,
n = i.east - i.west,
o = i.north - i.south,
s = n / (r.east - r.west),
l = o / (r.north - r.south); return new a(s * (i.west - r.west) / n, l * (i.south - r.south) / o, s, l) }, R.prototype._requestImagery = function(e) {
function r(r) { return t(r) ? (e.image = r, e.state = S.RECEIVED, x.handleSuccess(a._requestImageError), void 0) : i() }
function i() { e.state = S.FAILED; var t = "Failed to obtain image tile X: " + e.x + " Y: " + e.y + " Level: " + e.level + ".";
a._requestImageError = x.handleError(a._requestImageError, o, o.getErrorEvent(), t, e.x, e.y, e.level, n) }
function n() { e.state = S.TRANSITIONING; var n = o.requestImage(e.x, e.y, e.level); return t(n) ? (A(n, r, i), void 0) : (e.state = S.UNLOADED, void 0) } var o = this._imageryProvider,
a = this;
n() }, R.prototype._createTexture = function(e, r) { var i = this._imageryProvider; if (t(i.getTileDiscardPolicy)) { var n = i.getTileDiscardPolicy(); if (t(n)) { if (!n.isReady()) return r.state = S.RECEIVED, void 0; if (n.shouldDiscardImage(r.image)) return r.state = S.INVALID, void 0 } } var o = this._texturePool.createTexture2D(e, { source: r.image });
r.texture = o, r.image = void 0, r.state = S.TEXTURE_LOADED }, R.prototype._reprojectTexture = function(r, i) { var n = i.texture,
o = i.extent; if (!(this._imageryProvider.getTilingScheme() instanceof w) && (o.east - o.west) / n.getWidth() > 1e-5) { var a = I(this, r, n, i.extent);
n.destroy(), i.texture = n = a } if (c.isPowerOfTwo(n.getWidth()) && c.isPowerOfTwo(n.getHeight())) { var s = r.cache.imageryLayer_mipmapSampler; if (!t(s)) { var l = r.getMaximumTextureFilterAnisotropy();
s = r.cache.imageryLayer_mipmapSampler = r.createSampler({ wrapS: g.CLAMP, wrapT: g.CLAMP, minificationFilter: y.LINEAR_MIPMAP_LINEAR, magnificationFilter: v.LINEAR, maximumAnisotropy: Math.min(l, e(this._maximumAnisotropy, l)) }) } n.generateMipmap(f.NICEST), n.setSampler(s) } else { var u = r.cache.imageryLayer_nonMipmapSampler;
t(u) || (u = r.cache.imageryLayer_nonMipmapSampler = r.createSampler({ wrapS: g.CLAMP, wrapT: g.CLAMP, minificationFilter: y.LINEAR, magnificationFilter: v.LINEAR })), n.setSampler(u) } i.state = S.READY }, R.prototype.getImageryFromCache = function(e, r, i, n) { var o = D(e, r, i),
a = this._imageryCache[o]; return t(a) || (a = new C(this, e, r, i, n), this._imageryCache[o] = a), a.addReference(), a }, R.prototype.removeImageryFromCache = function(e) { var t = D(e.x, e.y, e.level);
delete this._imageryCache[t] };
var L = { u_textureDimensions: function() { return this.textureDimensions }, u_texture: function() { return this.texture }, u_northLatitude: function() { return this.northLatitude }, u_southLatitude: function() { return this.southLatitude }, u_southMercatorYLow: function() { return this.southMercatorYLow }, u_southMercatorYHigh: function() { return this.southMercatorYHigh }, u_oneOverMercatorHeight: function() { return this.oneOverMercatorHeight }, textureDimensions: new o, texture: void 0, northLatitude: 0, southLatitude: 0, southMercatorYHigh: 0, southMercatorYLow: 0, oneOverMercatorHeight: 0 },
z = u.supportsTypedArrays() ? new Float32Array(1) : void 0;
return R
}), r("Scene/TileReplacementQueue", ["../Core/defined", "./ImageryState", "./TerrainState"], function(e, t, r) { "use strict";
function i(e, t) { var r = t.replacementPrevious,
i = t.replacementNext;
t === e._lastBeforeStartOfFrame && (e._lastBeforeStartOfFrame = i), t === e.head ? e.head = i : r.replacementNext = i, t === e.tail ? e.tail = r : i.replacementPrevious = r, t.replacementPrevious = void 0, t.replacementNext = void 0, --e.count } var n = function() { this.head = void 0, this.tail = void 0, this.count = 0, this._lastBeforeStartOfFrame = void 0 }; return n.prototype.markStartOfRenderFrame = function() { this._lastBeforeStartOfFrame = this.head }, n.prototype.trimTiles = function(n) { for (var o = this.tail, a = !0; a && e(this._lastBeforeStartOfFrame) && this.count > n && e(o);) { a = o !== this._lastBeforeStartOfFrame; for (var s = o.replacementPrevious, l = o.loadedTerrain, u = e(l) && (l.state === r.RECEIVING || l.state === r.TRANSFORMING), c = o.upsampledTerrain, h = e(c) && (c.state === r.RECEIVING || c.state === r.TRANSFORMING), d = !u && !h, m = o.imagery, p = 0, f = m.length; d && f > p; ++p) { var v = m[p];
d = !e(v.loadingImagery) || v.loadingImagery.state !== t.TRANSITIONING } d && (o.freeResources(), i(this, o)), o = s } }, n.prototype.markTileRendered = function(t) { var r = this.head; return r === t ? (t === this._lastBeforeStartOfFrame && (this._lastBeforeStartOfFrame = t.replacementNext), void 0) : (++this.count, e(r) ? ((e(t.replacementPrevious) || e(t.replacementNext)) && i(this, t), t.replacementPrevious = void 0, t.replacementNext = r, r.replacementPrevious = t, this.head = t, void 0) : (t.replacementPrevious = void 0, t.replacementNext = void 0, this.head = t, this.tail = t, void 0)) }, n }), r("Scene/CentralBodySurface", ["../Core/defaultValue", "../Core/defined", "../Core/destroyObject", "../Core/BoundingSphere", "../Core/Cartesian2", "../Core/Cartesian3", "../Core/Cartesian4", "../Core/FeatureDetection", "../Core/DeveloperError", "../Core/Ellipsoid", "../Core/EllipsoidalOccluder", "../Core/Intersect", "../Core/Matrix4", "../Core/PrimitiveType", "../Core/Queue", "../Core/WebMercatorProjection", "../Renderer/DrawCommand", "./ImageryLayer", "./ImageryState", "./SceneMode", "./TerrainProvider", "./TileReplacementQueue", "./TileState", "../ThirdParty/when"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C, x, S) { "use strict";
function E(e, r) { var i = e.loadingImagery;
t(i) || (i = e.readyImagery); var n = r.loadingImagery; return t(n) || (n = r.readyImagery), i.imageryLayer._layerIndex - n.imageryLayer._layerIndex }
function b(e) { if (e._imageryLayerCollection._update(), e._layerOrderChanged) { e._layerOrderChanged = !1; for (var r = e._tileReplacementQueue.head; t(r);) r.imagery.sort(E), r = r.replacementNext } }
function T(e, r, i) { var n = e._debug; if (!n.suspendLodUpdate) { var o, a, s = e._tilesToRenderByTextureCount; for (o = 0, a = s.length; a > o; ++o) { var l = s[o];
t(l) && (l.length = 0) } var u = e._tileTraversalQueue; if (u.clear(), n.maxDepth = 0, n.tilesVisited = 0, n.tilesCulled = 0, n.tilesRendered = 0, n.texturesRendered = 0, n.tilesWaitingForChildren = 0, e._tileLoadQueue.length = 0, e._tileReplacementQueue.markStartOfRenderFrame(), !t(e._levelZeroTiles)) { if (!e._terrainProvider.isReady()) return; var c = e._terrainProvider.getTilingScheme();
e._levelZeroTiles = c.createLevelZeroTiles() } var h = i.camera.getPositionWC(),
d = e._terrainProvider.getTilingScheme().getEllipsoid(),
m = d.cartesianToCartographic(h);
e._ellipsoidalOccluder.setCameraPosition(h); var p, f = e._levelZeroTiles; for (o = 0, a = f.length; a > o; ++o) p = f[o], e._tileReplacementQueue.markTileRendered(p), p.state !== x.READY && R(e, p), p.isRenderable && D(e, i, p) ? u.enqueue(p) : (++n.tilesCulled, p.isRenderable || ++n.tilesWaitingForChildren); for (; t(p = u.dequeue());)
if (++n.tilesVisited, e._tileReplacementQueue.markTileRendered(p), p.level > n.maxDepth && (n.maxDepth = p.level), A(e, r, i, h, m, p) < e._maxScreenSpaceError) P(e, p);
else if (O(e, i, p)) { var v = p.children; for (o = 0, a = v.length; a > o; ++o) D(e, i, v[o]) ? u.enqueue(v[o]) : ++n.tilesCulled } else ++n.tilesWaitingForChildren, P(e, p);
n.enableDebugOutput && (n.tilesVisited !== n.lastTilesVisited || n.tilesRendered !== n.lastTilesRendered || n.texturesRendered !== n.lastTexturesRendered || n.tilesCulled !== n.lastTilesCulled || n.maxDepth !== n.lastMaxDepth || n.tilesWaitingForChildren !== n.lastTilesWaitingForChildren) && (console.log("Visited " + n.tilesVisited + ", Rendered: " + n.tilesRendered + ", Textures: " + n.texturesRendered + ", Culled: " + n.tilesCulled + ", Max Depth: " + n.maxDepth + ", Waiting for children: " + n.tilesWaitingForChildren), n.lastTilesVisited = n.tilesVisited, n.lastTilesRendered = n.tilesRendered, n.lastTexturesRendered = n.texturesRendered, n.lastTilesCulled = n.tilesCulled, n.lastMaxDepth = n.maxDepth, n.lastTilesWaitingForChildren = n.tilesWaitingForChildren) } }
function A(e, t, r, i, n, o) { if (r.mode === _.SCENE2D) return M(e, t, r, i, n, o); var a = o.extent,
s = 1; if (r.mode === _.SCENE3D) { var l = 0;
a.south > 0 ? l = a.south : a.north < 0 && (l = a.north), s = Math.cos(l) } var u = s * e._terrainProvider.getLevelMaximumGeometricError(o.level),
c = Math.sqrt(I(r, i, n, o));
o.distance = c; var h = t.getCanvas(),
d = h.clientHeight,
m = r.camera,
p = m.frustum,
f = p.fovy; return u * d / (2 * c * Math.tan(.5 * f)) }
function M(e, t, r, i, n, o) { var a = r.camera,
s = a.frustum,
l = t.getCanvas(),
u = l.clientWidth,
c = l.clientHeight,
h = e._terrainProvider.getLevelMaximumGeometricError(o.level),
d = Math.max(s.top - s.bottom, s.right - s.left) / Math.max(u, c); return h / d }
function P(e, r) { for (var i = 0, n = r.imagery, o = 0, a = n.length; a > o; ++o) { var s = n[o];
t(s.readyImagery) && 0 !== s.readyImagery.imageryLayer.alpha && ++i } var l = e._tilesToRenderByTextureCount[i];
t(l) || (l = [], e._tilesToRenderByTextureCount[i] = l), l.push(r); var u = e._debug;++u.tilesRendered, u.texturesRendered += i }
function D(e, r, n) { var a = r.cullingVolume,
s = n.boundingSphere3D; if (r.mode !== _.SCENE3D && (s = k, i.fromExtentWithHeights2D(n.extent, r.scene2D.projection, n.minimumHeight, n.maximumHeight, s), s.center = new o(s.center.z, s.center.x, s.center.y), r.mode === _.MORPHING && (s = i.union(n.boundingSphere3D, s, s))), a.getVisibility(s) === h.OUTSIDE) return !1; if (r.mode === _.SCENE3D) { var l = n.occludeePointInScaledSpace; return t(l) ? e._ellipsoidalOccluder.isScaledSpacePointVisible(l) : !0 } return !0 }
function I(e, t, r, i) { var n = i.southwestCornerCartesian,
a = i.northeastCornerCartesian,
s = i.westNormal,
l = i.southNormal,
u = i.eastNormal,
c = i.northNormal,
h = i.maximumHeight;
e.mode !== _.SCENE3D && (n = e.scene2D.projection.project(i.extent.getSouthwest(), U), n.z = n.y, n.y = n.x, n.x = 0, a = e.scene2D.projection.project(i.extent.getNortheast(), W), a.z = a.y, a.y = a.x, a.x = 0, s = G, u = o.UNIT_Y, l = H, c = o.UNIT_Z, h = 0); var d, m = t.subtract(n, j),
p = m.dot(s),
f = m.dot(l),
v = t.subtract(a, j),
y = v.dot(u),
g = v.dot(c);
d = e.mode === _.SCENE3D ? r.height : t.x; var w = d - h,
C = 0; return p > 0 ? C += p * p : y > 0 && (C += y * y), f > 0 ? C += f * f : g > 0 && (C += g * g), w > 0 && (C += w * w), C }
function O(e, t, r) { for (var i = !0, n = r.getChildren(), o = 0, a = n.length; a > o; ++o) { var s = n[o];
e._tileReplacementQueue.markTileRendered(s), s.state !== x.READY && R(e, s), s.isRenderable || (i = !1) } return i }
function R(e, t) { e._tileLoadQueue.push(t) }
function L(e, t) { var r = e._tileLoadQueue,
i = e._terrainProvider,
n = e._imageryLayerCollection; if (0 !== r.length) { e._tileReplacementQueue.trimTiles(e._tileCacheSize); for (var o = Date.now(), a = e._loadQueueTimeSlice, s = o + a, l = r.length - 1, u = l; u >= 0; --u) { var c = r[u]; if (e._tileReplacementQueue.markTileRendered(c), c.processStateMachine(t, i, n), Date.now() >= s) break } } }
function z(e, t) { return e.distance - t.distance }
function N() { return { u_center3D: function() { return this.center3D }, u_tileExtent: function() { return this.tileExtent }, u_modifiedModelView: function() { return this.modifiedModelView }, u_dayTextures: function() { return this.dayTextures }, u_dayTextureTranslationAndScale: function() { return this.dayTextureTranslationAndScale }, u_dayTextureTexCoordsExtent: function() { return this.dayTextureTexCoordsExtent }, u_dayTextureAlpha: function() { return this.dayTextureAlpha }, u_dayTextureBrightness: function() { return this.dayTextureBrightness }, u_dayTextureContrast: function() { return this.dayTextureContrast }, u_dayTextureHue: function() { return this.dayTextureHue }, u_dayTextureSaturation: function() { return this.dayTextureSaturation }, u_dayTextureOneOverGamma: function() { return this.dayTextureOneOverGamma }, u_dayIntensity: function() { return this.dayIntensity }, u_southAndNorthLatitude: function() { return this.southAndNorthLatitude }, u_southMercatorYLowAndHighAndOneOverHeight: function() { return this.southMercatorYLowAndHighAndOneOverHeight }, u_waterMask: function() { return this.waterMask }, u_waterMaskTranslationAndScale: function() { return this.waterMaskTranslationAndScale }, center3D: void 0, modifiedModelView: new d, tileExtent: new a, dayTextures: [], dayTextureTranslationAndScale: [], dayTextureTexCoordsExtent: [], dayTextureAlpha: [], dayTextureBrightness: [], dayTextureContrast: [], dayTextureHue: [], dayTextureSaturation: [], dayTextureOneOverGamma: [], dayIntensity: 0, southAndNorthLatitude: new n, southMercatorYLowAndHighAndOneOverHeight: new o, waterMask: void 0, waterMaskTranslationAndScale: new a } }
function F(e, t) { for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r]) }
function B(e, r, n, s, l, u, c, h) { for (var p = n.camera.getViewMatrix(), w = r.getMaximumTextureImageUnits(), C = e._tileCommands, x = e._tileCommandUniformMaps, S = -1, E = e._tilesToRenderByTextureCount, b = 0, T = E.length; T > b; ++b) { var A = E[b]; if (t(A) && 0 !== A.length) { A.sort(z); for (var M = 0, P = A.length; P > M; M++) { var D = A[M],
I = D.center,
O = Z,
R = 0,
L = 0,
B = 0,
q = 0,
k = 0; if (n.mode !== _.SCENE3D) { var U = l.project(D.extent.getSouthwest()),
W = l.project(D.extent.getNortheast()); if (O.x = U.x, O.y = U.y, O.z = W.x, O.w = W.y, n.mode !== _.MORPHING && (I = K, I.x = 0, I.y = .5 * (O.z + O.x), I.z = .5 * (O.w + O.y), O.x -= I.y, O.y -= I.z, O.z -= I.y, O.w -= I.z), l instanceof f) { R = D.extent.south, L = D.extent.north; var G = f.geodeticLatitudeToMercatorAngle(R),
H = f.geodeticLatitudeToMercatorAngle(L);
Y[0] = G, B = Y[0], q = G - Y[0], k = 1 / (H - G) } } var j = J;
j.x = I.x, j.y = I.y, j.z = I.z, j.w = 1, d.multiplyByVector(p, j, j), p.setColumn(3, j, X); var Q = D.imagery,
$ = 0,
et = Q.length;
do { var tt = 0;++S; var rt = C[S];
t(rt) || (rt = new v, rt.owner = D, rt.cull = !1, C[S] = rt, x[S] = N()), rt.owner = D, rt.debugShowBoundingVolume = D === e._debug.boundingSphereTile; var it = x[S];
F(it, u), it.center3D = D.center, a.clone(O, it.tileExtent), it.southAndNorthLatitude.x = R, it.southAndNorthLatitude.y = L, it.southMercatorYLowAndHighAndOneOverHeight.x = q, it.southMercatorYLowAndHighAndOneOverHeight.y = B, it.southMercatorYLowAndHighAndOneOverHeight.z = k, d.clone(X, it.modifiedModelView); for (var nt = !1, ot = !1, at = !1, st = !1, lt = !1, ut = !1; w > tt && et > $;) { var ct = Q[$],
ht = ct.readyImagery; if (++$, t(ht) && ht.state === g.READY && 0 !== ht.imageryLayer.alpha) { var dt = ht.imageryLayer;
t(ct.textureTranslationAndScale) || (ct.textureTranslationAndScale = dt._calculateTextureTranslationAndScale(D, ct)), it.dayTextures[tt] = ht.texture, it.dayTextureTranslationAndScale[tt] = ct.textureTranslationAndScale, it.dayTextureTexCoordsExtent[tt] = ct.textureCoordinateExtent, it.dayTextureAlpha[tt] = "function" == typeof dt.alpha ? dt.alpha(n, dt, ht.x, ht.y, ht.level) : dt.alpha, ut = ut || 1 !== it.dayTextureAlpha[tt], it.dayTextureBrightness[tt] = "function" == typeof dt.brightness ? dt.brightness(n, dt, ht.x, ht.y, ht.level) : dt.brightness, nt = nt || it.dayTextureBrightness[tt] !== y.DEFAULT_BRIGHTNESS, it.dayTextureContrast[tt] = "function" == typeof dt.contrast ? dt.contrast(n, dt, ht.x, ht.y, ht.level) : dt.contrast, ot = ot || it.dayTextureContrast[tt] !== y.DEFAULT_CONTRAST, it.dayTextureHue[tt] = "function" == typeof dt.hue ? dt.hue(n, dt, ht.x, ht.y, ht.level) : dt.hue, at = at || it.dayTextureHue[tt] !== y.DEFAULT_HUE, it.dayTextureSaturation[tt] = "function" == typeof dt.saturation ? dt.saturation(n, dt, ht.x, ht.y, ht.level) : dt.saturation, st = st || it.dayTextureSaturation[tt] !== y.DEFAULT_SATURATION, it.dayTextureOneOverGamma[tt] = "function" == typeof dt.gamma ? 1 / dt.gamma(n, dt, ht.x, ht.y, ht.level) : 1 / dt.gamma, lt = lt || it.dayTextureOneOverGamma[tt] !== 1 / y.DEFAULT_GAMMA, ++tt } } it.dayTextures.length = tt, it.waterMask = D.waterMaskTexture, a.clone(D.waterMaskTranslationAndScale, it.waterMaskTranslationAndScale), c.push(rt), rt.shaderProgram = s.getShaderProgram(r, b, nt, ot, at, st, lt, ut), rt.renderState = h, rt.primitiveType = m.TRIANGLES, rt.vertexArray = D.vertexArray, rt.uniformMap = it, e._debug.wireframe && (V(r, e, D), t(D.wireframeVertexArray) && (rt.vertexArray = D.wireframeVertexArray, rt.primitiveType = m.LINES)); var mt = D.boundingSphere3D;
n.mode !== _.SCENE3D && (mt = i.fromExtentWithHeights2D(D.extent, n.scene2D.projection, D.minimumHeight, D.maximumHeight), mt.center = new o(mt.center.z, mt.center.x, mt.center.y), n.mode === _.MORPHING && (mt = i.union(D.boundingSphere3D, mt, mt))), rt.boundingVolume = mt } while (et > $) } } } C.length = Math.max(0, S + 1) }
function V(e, r, i) { if (!t(i.wireframeVertexArray) && !t(i.meshForWireframePromise) && (i.meshForWireframePromise = i.terrainData.createMesh(r._terrainProvider.getTilingScheme(), i.x, i.y, i.level), t(i.meshForWireframePromise))) { var n = i.vertexArray;
S(i.meshForWireframePromise, function(t) { i.vertexArray === n && (i.wireframeVertexArray = w.createWireframeVertexArray(e, i.vertexArray, t)), i.meshForWireframePromise = void 0 }) } } var q = function(r) { if (!t(r.terrainProvider)) throw new l("description.terrainProvider is required."); if (!t(r.imageryLayerCollection)) throw new l("description.imageryLayerCollection is required.");
this._terrainProvider = r.terrainProvider, this._imageryLayerCollection = r.imageryLayerCollection, this._maxScreenSpaceError = e(r.maxScreenSpaceError, 2), this._imageryLayerCollection.layerAdded.addEventListener(q.prototype._onLayerAdded, this), this._imageryLayerCollection.layerRemoved.addEventListener(q.prototype._onLayerRemoved, this), this._imageryLayerCollection.layerMoved.addEventListener(q.prototype._onLayerMoved, this), this._imageryLayerCollection.layerShownOrHidden.addEventListener(q.prototype._onLayerShownOrHidden, this), this._layerOrderChanged = !1; var i = this._terrainProvider.getTilingScheme();
this._levelZeroTiles = void 0, this._tilesToRenderByTextureCount = [], this._tileCommands = [], this._tileCommandUniformMaps = [], this._tileTraversalQueue = new p, this._tileLoadQueue = [], this._tileReplacementQueue = new C, this._tileCacheSize = 100, this._loadQueueTimeSlice = 5; var n = i.getEllipsoid();
this._ellipsoidalOccluder = new c(n, o.ZERO), this._debug = { enableDebugOutput: !1, wireframe: !1, boundingSphereTile: void 0, maxDepth: 0, tilesVisited: 0, tilesCulled: 0, tilesRendered: 0, texturesRendered: 0, tilesWaitingForChildren: 0, lastMaxDepth: -1, lastTilesVisited: -1, lastTilesCulled: -1, lastTilesRendered: -1, lastTexturesRendered: -1, lastTilesWaitingForChildren: -1, suspendLodUpdate: !1 } };
q.prototype.update = function(e, t, r, i, n, o, a) { b(this), T(this, e, t), L(this, e, t), B(this, e, t, n, a, i, r, o) }, q.prototype.getTerrainProvider = function() { return this._terrainProvider }, q.prototype.setTerrainProvider = function(e) { if (this._terrainProvider !== e) { if (!t(e)) throw new l("terrainProvider is required.");
this._terrainProvider = e; var r = this._tileReplacementQueue;
r.head = void 0, r.tail = void 0, r.count = 0; var i = this._levelZeroTiles; if (t(i))
for (var n = 0; n < i.length; ++n) i[n].freeResources();
this._levelZeroTiles = void 0 } }, q.prototype._onLayerAdded = function(e) { if (t(this._levelZeroTiles) && e.show) { for (var r = this._tileReplacementQueue.head; t(r);) e._createTileImagerySkeletons(r, this._terrainProvider) && (r.state = x.LOADING), r = r.replacementNext;
this._layerOrderChanged = !0 } }, q.prototype._onLayerRemoved = function(e) { if (t(this._levelZeroTiles))
for (var r = this._tileReplacementQueue.head; t(r);) { for (var i = r.imagery, n = -1, o = 0, a = 0, s = i.length; s > a; ++a) { var l = i[a],
u = l.loadingImagery; if (t(u) || (u = l.readyImagery), u.imageryLayer === e) - 1 === n && (n = a), l.freeResources(), ++o;
else if (-1 !== n) break } - 1 !== n && i.splice(n, o), e.isBaseLayer() && (r.isRenderable = !1), r = r.replacementNext } }, q.prototype._onLayerMoved = function() { t(this._levelZeroTiles) && (this._layerOrderChanged = !0) }, q.prototype._onLayerShownOrHidden = function(e, r, i) { t(this._levelZeroTiles) && (i ? this._onLayerAdded(e, r) : this._onLayerRemoved(e, r)) }, q.prototype.isDestroyed = function() { return !1 }, q.prototype.destroy = function() { var e = this._levelZeroTiles; if (t(e))
for (var i = 0; i < e.length; ++i) e[i].freeResources(); return this._imageryLayerCollection.destroy(), r(this) }; var k = new i,
U = new o,
W = new o,
G = o.UNIT_Y.negate(),
H = o.UNIT_Z.negate(),
j = new o;
q.prototype.debugShowBoundingSphereOfTileAt = function(e) { for (var r, i, n = this._tilesToRenderByTextureCount, o = 0; o < n.length && !t(r); ++o) { var a = n[o]; if (t(a))
for (var s = 0; s < a.length; ++s)
if (i = a[s], i.extent.contains(e)) { r = i; break } } t(r) && console.log("x: " + r.x + " y: " + r.y + " level: " + r.level + " radius: " + r.boundingSphere3D.radius + " center magnitude: " + r.boundingSphere3D.center.magnitude()), this._debug.boundingSphereTile = r }, q.prototype.debugToggleLodUpdate = function() { this._debug.suspendLodUpdate = !this._debug.suspendLodUpdate }; var Y = s.supportsTypedArrays() ? new Float32Array(1) : void 0,
X = new d,
Z = new a,
K = new o,
J = new a; return q }), r("Scene/CentralBodySurfaceShaderSet", ["../Core/defined", "../Core/destroyObject", "../Core/defaultValue"], function(e, t) { "use strict";
function r(e) { this.baseVertexShaderString = void 0, this.baseFragmentShaderString = void 0, this._attributeIndices = e, this._shaders = {} }
function i(e, t, r, i, n, o, a) { var s = ""; return s += e, s += t ? "_brightness" : "", s += r ? "_contrast" : "", s += i ? "_hue" : "", s += n ? "_saturation" : "", s += o ? "_gamma" : "", s += a ? "_alpha" : "" } return r.prototype.invalidateShaders = function() { var e = this._shaders; for (var t in e) e.hasOwnProperty(t) && e[t].release();
this._shaders = {} }, r.prototype.getShaderProgram = function(t, r, n, o, a, s, l, u) { var c = i(r, n, o, a, s, l, u),
h = this._shaders[c]; if (!e(h)) { for (var d = this.baseVertexShaderString, m = (n ? "#define APPLY_BRIGHTNESS\n" : "") + (o ? "#define APPLY_CONTRAST\n" : "") + (a ? "#define APPLY_HUE\n" : "") + (s ? "#define APPLY_SATURATION\n" : "") + (l ? "#define APPLY_GAMMA\n" : "") + (u ? "#define APPLY_ALPHA\n" : "") + "#define TEXTURE_UNITS " + r + "\n" + this.baseFragmentShaderString + "\n" + "vec3 computeDayColor(vec3 initialColor, vec2 textureCoordinates)\n" + "{\n" + " vec3 color = initialColor;\n", p = 0; r > p; ++p) m += "color = sampleAndBlend(\n color,\n u_dayTextures[" + p + "],\n" + " textureCoordinates,\n" + " u_dayTextureTexCoordsExtent[" + p + "],\n" + " u_dayTextureTranslationAndScale[" + p + "],\n" + " u_dayTextureAlpha[" + p + "],\n" + " u_dayTextureBrightness[" + p + "],\n" + " u_dayTextureContrast[" + p + "],\n" + " u_dayTextureHue[" + p + "],\n" + " u_dayTextureSaturation[" + p + "],\n" + " u_dayTextureOneOverGamma[" + p + "]);\n";
m += " return color;\n}", h = t.getShaderCache().getShaderProgram(d, m, this._attributeIndices), this._shaders[c] = h } return h }, r.prototype.destroy = function() { return this.invalidateShaders(), t(this) }, r }), r("Scene/CreditDisplay", ["../Core/defaultValue", "../Core/defined", "../Core/destroyObject", "../Core/DeveloperError", "./Credit"], function(e, t, r, i, n) { "use strict";
function o(e, r, i) { if (!t(e.element)) { var n = e.getText(),
o = e.getLink(),
a = document.createElement("span"); if (e.hasLink()) { var s = document.createElement("a");
s.textContent = n, s.href = o, s.target = "_blank", a.appendChild(s) } else a.textContent = n;
a.className = "cesium-credit-text", e.element = a } if (r.hasChildNodes()) { var l = document.createElement("span");
l.textContent = i, l.className = "cesium-credit-delimiter", r.appendChild(l) } r.appendChild(e.element) }
function a(e, r) { if (!t(e.element)) { var i = e.getText(),
n = e.getLink(),
o = document.createElement("span"),
a = document.createElement("img"); if (a.src = e.getImageUrl(), a.style["vertical-align"] = "bottom", t(i) && (a.alt = i, a.title = i), e.hasLink()) { var s = document.createElement("a");
s.appendChild(a), s.href = n, s.target = "_blank", o.appendChild(s) } else o.appendChild(a);
o.className = "cesium-credit-image", e.element = o } r.appendChild(e.element) }
function s(e, t) { for (var r = e.length, i = 0; r > i; i++) { var o = e[i]; if (n.equals(o, t)) return !0 } return !1 }
function l(e) { var r = e.element; if (t(r)) { var i = r.parentNode; if (!e.hasImage()) { var n = r.previousSibling;
null === n && (n = r.nextSibling), null !== n && i.removeChild(n) } i.removeChild(r) } }
function u(e, t) { var r, i, n, a = e._displayedCredits.textCredits; for (r = 0; r < t.length; r++) n = t[r], i = a.indexOf(n), -1 === i ? o(n, e._textContainer, e._delimiter) : a.splice(i, 1); for (r = 0; r < a.length; r++) n = a[r], l(n) }
function c(e, t) { var r, i, n, o = e._displayedCredits.imageCredits; for (r = 0; r < t.length; r++) n = t[r], i = o.indexOf(n), -1 === i ? a(n, e._imageContainer) : o.splice(i, 1); for (r = 0; r < o.length; r++) n = o[r], l(n) } var h = function(r, n) { if (!t(r)) throw new i("credit container is required"); var o = document.createElement("span");
o.className = "cesium-credit-imageContainer"; var a = document.createElement("span");
a.className = "cesium-credit-textContainer", r.appendChild(o), r.appendChild(a), this._delimiter = e(n, " • "), this._container = r, this._textContainer = a, this._imageContainer = o, this._defaultImageCredits = [], this._defaultTextCredits = [], this._displayedCredits = { imageCredits: [], textCredits: [] }, this._currentFrameCredits = { imageCredits: [], textCredits: [] } }; return h.prototype.addCredit = function(e) { if (!t(e)) throw new i("credit must be defined"); if (e.hasImage()) { var r = this._currentFrameCredits.imageCredits;
s(r, e) || s(this._defaultImageCredits, e) || r.push(e) } else { var n = this._currentFrameCredits.textCredits;
s(n, e) || s(this._defaultTextCredits, e) || n.push(e) } }, h.prototype.addDefaultCredit = function(e) { if (!t(e)) throw new i("credit must be defined"); if (e.hasImage()) { var r = this._defaultImageCredits;
s(r, e) || r.push(e) } else { var n = this._defaultTextCredits;
s(n, e) || n.push(e) } }, h.prototype.removeDefaultCredit = function(e) { if (!t(e)) throw new i("credit must be defined"); var r;
e.hasImage() ? (r = this._defaultImageCredits.indexOf(e), -1 !== r && this._defaultImageCredits.splice(r, 1)) : (r = this._defaultTextCredits.indexOf(e), -1 !== r && this._defaultTextCredits.splice(r, 1)) }, h.prototype.beginFrame = function() { this._currentFrameCredits.imageCredits.length = 0, this._currentFrameCredits.textCredits.length = 0 }, h.prototype.endFrame = function() { var e = this._defaultTextCredits.concat(this._currentFrameCredits.textCredits),
t = this._defaultImageCredits.concat(this._currentFrameCredits.imageCredits);
u(this, e), c(this, t), this._displayedCredits.textCredits = e, this._displayedCredits.imageCredits = t }, h.prototype.destroy = function() { return this._container.removeChild(this._textContainer), this._container.removeChild(this._imageContainer), r(this) }, h.prototype.isDestroyed = function() { return !1 }, h }), r("Scene/EllipsoidTerrainProvider", ["../Core/defaultValue", "../Core/defined", "../Core/Ellipsoid", "../Core/Event", "./HeightmapTerrainData", "./TerrainProvider", "./GeographicTilingScheme"], function(e, t, r, i, n, o, a) { "use strict"; var s = function(s) { s = e(s, {}), this._tilingScheme = s.tilingScheme, t(this._tilingScheme) || (this._tilingScheme = new a({ ellipsoid: e(s.ellipsoid, r.WGS84) })), this._levelZeroMaximumGeometricError = o.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.getEllipsoid(), 64, this._tilingScheme.getNumberOfXTilesAtLevel(0)); var l = 16,
u = 16;
this._terrainData = new n({ buffer: new Uint8Array(l * u), width: 16, height: 16 }), this._errorEvent = new i }; return s.prototype.requestTileGeometry = function() { return this._terrainData }, s.prototype.getErrorEvent = function() { return this._errorEvent }, s.prototype.getLevelMaximumGeometricError = function(e) { return this._levelZeroMaximumGeometricError / (1 << e) }, s.prototype.getCredit = function() { return void 0 }, s.prototype.getTilingScheme = function() { return this._tilingScheme }, s.prototype.hasWaterMask = function() { return !1 }, s.prototype.isReady = function() { return !0 }, s }), r("Scene/ImageryLayerCollection", ["../Core/DeveloperError", "../Core/defaultValue", "../Core/defined", "../Core/destroyObject", "../Core/Event", "../Core/Math", "./ImageryLayer"], function(e, t, r, i, n, o, a) { "use strict";
function s(t, i) { if (!r(i)) throw new e("layer is required."); var n = t.indexOf(i); if (-1 === n) throw new e("layer is not in this collection."); return n }
function l(e, t, r) { var i = e._layers; if (t = o.clamp(t, 0, i.length - 1), r = o.clamp(r, 0, i.length - 1), t !== r) { var n = i[t];
i[t] = i[r], i[r] = n, e._update(), e.layerMoved.raiseEvent(n, r, t) } } var u = function() { this._layers = [], this.layerAdded = new n, this.layerRemoved = new n, this.layerMoved = new n, this.layerShownOrHidden = new n }; return u.prototype.add = function(t, i) { if (!r(t)) throw new e("layer is required."); if (r(i)) { if (0 > i) throw new e("index must be greater than or equal to zero."); if (i > this._layers.length) throw new e("index must be less than or equal to the number of layers.");
this._layers.splice(i, 0, t) } else i = this._layers.length, this._layers.push(t);
this._update(), this.layerAdded.raiseEvent(t, i) }, u.prototype.addImageryProvider = function(t, i) { if (!r(t)) throw new e("imageryProvider is required."); var n = new a(t); return this.add(n, i), n }, u.prototype.remove = function(e, r) { r = t(r, !0); var i = this._layers.indexOf(e); return -1 !== i ? (this._layers.splice(i, 1), this._update(), this.layerRemoved.raiseEvent(e, i), r && e.destroy(), !0) : !1 }, u.prototype.removeAll = function(e) { e = t(e, !0); for (var r = this._layers, i = 0, n = r.length; n > i; i++) { var o = r[i];
this.layerRemoved.raiseEvent(o, i), e && o.destroy() } this._layers = [] }, u.prototype.contains = function(e) { return -1 !== this.indexOf(e) }, u.prototype.indexOf = function(e) { return this._layers.indexOf(e) }, u.prototype.get = function(t) { if (!r(t)) throw new e("index is required.", "index"); return this._layers[t] }, u.prototype.getLength = function() { return this._layers.length }, u.prototype.raise = function(e) { var t = s(this._layers, e);
l(this, t, t + 1) }, u.prototype.lower = function(e) { var t = s(this._layers, e);
l(this, t, t - 1) }, u.prototype.raiseToTop = function(e) { var t = s(this._layers, e);
t !== this._layers.length - 1 && (this._layers.splice(t, 1), this._layers.push(e), this._update(), this.layerMoved.raiseEvent(e, this._layers.length - 1, t)) }, u.prototype.lowerToBottom = function(e) { var t = s(this._layers, e);
0 !== t && (this._layers.splice(t, 1), this._layers.splice(0, 0, e), this._update(), this.layerMoved.raiseEvent(e, 0, t)) }, u.prototype.isDestroyed = function() { return !1 }, u.prototype.destroy = function() { return this.removeAll(!0), i(this) }, u.prototype._update = function() { for (var e, t, i = !0, n = this._layers, o = 0, a = n.length; a > o; ++o) t = n[o], t._layerIndex = o, t.show ? (t._isBaseLayer = i, i = !1) : t._isBaseLayer = !1, t.show !== t._show && (r(t._show) && (r(e) || (e = []), e.push(t)), t._show = t.show); if (r(e))
for (o = 0, a = e.length; a > o; ++o) t = e[o], this.layerShownOrHidden.raiseEvent(t, t._layerIndex, t.show) }, u }), r("Shaders/ViewportQuadVS", [], function() {
"use strict";
return "attribute vec4 position;\nattribute vec2 textureCoordinates;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_Position = position;\nv_textureCoordinates = textureCoordinates;\n}\n"
}), r("Shaders/ViewportQuadFS", [], function() { "use strict"; return "varying vec2 v_textureCoordinates;\nvoid main()\n{\nczm_materialInput materialInput;\nmaterialInput.s = v_textureCoordinates.s;\nmaterialInput.st = v_textureCoordinates;\nmaterialInput.str = vec3(v_textureCoordinates, 0.0);\nmaterialInput.normalEC = vec3(0.0, 0.0, -1.0);\nczm_material material = czm_getMaterial(materialInput);\ngl_FragColor = vec4(material.diffuse + material.emission, material.alpha);\n}\n" }), r("Scene/ViewportQuad", ["../Core/Color", "../Core/combine", "../Core/destroyObject", "../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/BoundingRectangle", "../Core/ComponentDatatype", "../Core/PrimitiveType", "../Core/Geometry", "../Core/GeometryAttribute", "./Material", "../Renderer/BufferUsage", "../Renderer/BlendingState", "../Renderer/CommandLists", "../Renderer/DrawCommand", "../Renderer/createShaderSource", "../Shaders/ViewportQuadVS", "../Shaders/ViewportQuadFS"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g) { "use strict";
function _(e) { var t = e.cache.viewportQuad_vertexArray; if (n(t)) return t; var r = new u({ attributes: { position: new c({ componentDatatype: s.FLOAT, componentsPerAttribute: 2, values: [-1, -1, 1, -1, 1, 1, -1, 1] }), textureCoordinates: new c({ componentDatatype: s.FLOAT, componentsPerAttribute: 2, values: [0, 0, 1, 0, 1, 1, 0, 1] }) }, primitiveType: l.TRIANGLES }); return t = e.createVertexArrayFromGeometry({ geometry: r, attributeIndices: C, bufferUsage: d.STATIC_DRAW }), e.cache.viewportQuad_vertexArray = t, t } var w = function(t, r) { this._va = void 0, this._overlayCommand = new f, this._overlayCommand.primitiveType = l.TRIANGLE_FAN, this._overlayCommand.owner = this, this._commandLists = new p, this._commandLists.overlayList.push(this._overlayCommand), this.show = !0, n(t) || (t = new a), this.rectangle = a.clone(t), n(r) || (r = h.fromType(void 0, h.ColorType), r.uniforms.color = new e(1, 1, 1, 1)), this.material = r, this._material = void 0 },
C = { position: 0, textureCoordinates: 1 }; return w.prototype.update = function(e, t, r) { if (this.show) { if (!n(this.material)) throw new o("this.material must be defined."); if (!n(this.rectangle)) throw new o("this.rectangle must be defined.");
n(this._va) || (this._va = _(e), this._overlayCommand.vertexArray = this._va); var i = this._overlayCommand.renderState;
n(i) && a.equals(i.viewport, this.rectangle) || (this._overlayCommand.renderState = e.createRenderState({ blending: m.ALPHA_BLEND, viewport: this.rectangle })); var s = t.passes; if (s.overlay) { if (this._material !== this.material) { this._material = this.material; var l = v({ sources: [this._material.shaderSource, g] });
this._overlayCommand.shaderProgram = e.getShaderCache().replaceShaderProgram(this._overlayCommand.shaderProgram, y, l, C) } this._overlayCommand.uniformMap = this._material._uniforms, r.push(this._commandLists) } } }, w.prototype.isDestroyed = function() { return !1 }, w.prototype.destroy = function() { return this._overlayCommand.shaderProgram = this._overlayCommand.shaderProgram && this._overlayCommand.shaderProgram.release(), r(this) }, w }), r("Shaders/CentralBodyFS", [], function() { "use strict"; return "#if TEXTURE_UNITS > 0\nuniform sampler2D u_dayTextures[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTranslationAndScale[TEXTURE_UNITS];\nuniform float u_dayTextureAlpha[TEXTURE_UNITS];\nuniform float u_dayTextureBrightness[TEXTURE_UNITS];\nuniform float u_dayTextureContrast[TEXTURE_UNITS];\nuniform float u_dayTextureHue[TEXTURE_UNITS];\nuniform float u_dayTextureSaturation[TEXTURE_UNITS];\nuniform float u_dayTextureOneOverGamma[TEXTURE_UNITS];\nuniform vec4 u_dayTextureTexCoordsExtent[TEXTURE_UNITS];\n#endif\n#ifdef SHOW_REFLECTIVE_OCEAN\nuniform sampler2D u_waterMask;\nuniform vec4 u_waterMaskTranslationAndScale;\nuniform float u_zoomedOutOceanSpecularIntensity;\n#endif\n#ifdef SHOW_OCEAN_WAVES\nuniform sampler2D u_oceanNormalMap;\n#endif\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_textureCoordinates;\nfloat getLambertDiffuse(vec3 lightDirectionEC, vec3 normalEC)\n{\nreturn max(dot(lightDirectionEC, normalEC), 0.0);\n}\nfloat getSpecular(vec3 lightDirectionEC, vec3 toEyeEC, vec3 normalEC, float shininess)\n{\nvec3 toReflectedLight = reflect(-lightDirectionEC, normalEC);\nfloat specular = max(dot(toReflectedLight, toEyeEC), 0.0);\nreturn pow(specular, shininess);\n}\nvec3 sampleAndBlend(\nvec3 previousColor,\nsampler2D texture,\nvec2 tileTextureCoordinates,\nvec4 textureCoordinateExtent,\nvec4 textureCoordinateTranslationAndScale,\nfloat textureAlpha,\nfloat textureBrightness,\nfloat textureContrast,\nfloat textureHue,\nfloat textureSaturation,\nfloat textureOneOverGamma)\n{\nvec2 alphaMultiplier = step(textureCoordinateExtent.st, tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nalphaMultiplier = step(vec2(0.0), textureCoordinateExtent.pq - tileTextureCoordinates);\ntextureAlpha = textureAlpha * alphaMultiplier.x * alphaMultiplier.y;\nvec2 translation = textureCoordinateTranslationAndScale.xy;\nvec2 scale = textureCoordinateTranslationAndScale.zw;\nvec2 textureCoordinates = tileTextureCoordinates * scale + translation;\nvec4 sample = texture2D(texture, textureCoordinates);\nvec3 color = sample.rgb;\nfloat alpha = sample.a;\n#ifdef APPLY_BRIGHTNESS\ncolor = mix(vec3(0.0), color, textureBrightness);\n#endif\n#ifdef APPLY_CONTRAST\ncolor = mix(vec3(0.5), color, textureContrast);\n#endif\n#ifdef APPLY_HUE\ncolor = czm_hue(color, textureHue);\n#endif\n#ifdef APPLY_SATURATION\ncolor = czm_saturation(color, textureSaturation);\n#endif\n#ifdef APPLY_GAMMA\ncolor = pow(color, vec3(textureOneOverGamma));\n#endif\nreturn mix(previousColor, color, alpha * textureAlpha);\n}\nvec3 computeDayColor(vec3 initialColor, vec2 textureCoordinates);\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec3 imageryColor, float specularMapValue);\nvoid main()\n{\nvec3 initialColor = vec3(0.0, 0.0, 0.5);\nvec3 startDayColor = computeDayColor(initialColor, clamp(v_textureCoordinates, 0.0, 1.0));\n#ifdef SHOW_TILE_BOUNDARIES\nif (v_textureCoordinates.x < (1.0/256.0) || v_textureCoordinates.x > (255.0/256.0) ||\nv_textureCoordinates.y < (1.0/256.0) || v_textureCoordinates.y > (255.0/256.0))\n{\nstartDayColor = vec3(1.0, 0.0, 0.0);\n}\n#endif\nvec4 color = vec4(startDayColor, 1.0);\n#ifdef SHOW_REFLECTIVE_OCEAN\nvec2 waterMaskTranslation = u_waterMaskTranslationAndScale.xy;\nvec2 waterMaskScale = u_waterMaskTranslationAndScale.zw;\nvec2 waterMaskTextureCoordinates = v_textureCoordinates * waterMaskScale + waterMaskTranslation;\nfloat mask = texture2D(u_waterMask, waterMaskTextureCoordinates).r;\nif (mask > 0.0)\n{\nvec3 normalMC = normalize(czm_geodeticSurfaceNormal(v_positionMC, vec3(0.0), vec3(1.0)));\nvec3 normalEC = normalize(czm_normal3D * normalMC);\nmat3 enuToEye = czm_eastNorthUpToEyeCoordinates(v_positionMC, normalEC);\nvec2 ellipsoidTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC);\nvec2 ellipsoidFlippedTextureCoordinates = czm_ellipsoidWgs84TextureCoordinates(normalMC.zyx);\nvec2 textureCoordinates = mix(ellipsoidTextureCoordinates, ellipsoidFlippedTextureCoordinates, czm_morphTime * smoothstep(0.9, 0.95, normalMC.z));\ncolor = computeWaterColor(v_positionEC, textureCoordinates, enuToEye, startDayColor, mask);\n}\n#endif\ngl_FragColor = color;\n}\n#ifdef SHOW_REFLECTIVE_OCEAN\nfloat waveFade(float edge0, float edge1, float x)\n{\nfloat y = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0);\nreturn pow(1.0 - y, 5.0);\n}\nconst float oceanFrequency = 125000.0;\nconst float oceanAnimationSpeed = 0.006;\nconst float oceanAmplitude = 2.0;\nconst float oceanSpecularIntensity = 0.5;\nvec4 computeWaterColor(vec3 positionEyeCoordinates, vec2 textureCoordinates, mat3 enuToEye, vec3 imageryColor, float specularMapValue)\n{\nfloat time = czm_frameNumber * oceanAnimationSpeed;\nvec3 positionToEyeEC = -positionEyeCoordinates;\nfloat positionToEyeECLength = length(positionToEyeEC);\nvec3 normalizedpositionToEyeEC = normalize(normalize(positionToEyeEC));\nfloat waveIntensity = waveFade(70000.0, 1000000.0, positionToEyeECLength);\n#ifdef SHOW_OCEAN_WAVES\nvec4 noise = czm_getWaterNoise(u_oceanNormalMap, textureCoordinates * oceanFrequency, time, 0.0);\nvec3 normalTangentSpace = noise.xyz * vec3(1.0, 1.0, (1.0 / oceanAmplitude));\nnormalTangentSpace.xy *= waveIntensity;\nnormalTangentSpace = normalize(normalTangentSpace);\n#else\nvec3 normalTangentSpace = vec3(0.0, 0.0, 1.0);\n#endif\nvec3 normalEC = enuToEye * normalTangentSpace;\nconst vec3 waveHighlightColor = vec3(0.3, 0.45, 0.6);\nfloat diffuseIntensity = getLambertDiffuse(czm_sunDirectionEC, normalEC);\nvec3 diffuseHighlight = waveHighlightColor * diffuseIntensity;\n#ifdef SHOW_OCEAN_WAVES\nfloat tsPerturbationRatio = normalTangentSpace.z;\nvec3 nonDiffuseHighlight = mix(waveHighlightColor * 5.0 * (1.0 - tsPerturbationRatio), vec3(0.0), diffuseIntensity);\n#else\nvec3 nonDiffuseHighlight = vec3(0.0);\n#endif\nfloat specularIntensity = getSpecular(czm_sunDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0) + 0.25 * getSpecular(czm_moonDirectionEC, normalizedpositionToEyeEC, normalEC, 10.0);\nfloat surfaceReflectance = mix(0.0, mix(u_zoomedOutOceanSpecularIntensity, oceanSpecularIntensity, waveIntensity), specularMapValue);\nfloat specular = specularIntensity * surfaceReflectance;\nreturn vec4(imageryColor + diffuseHighlight + nonDiffuseHighlight + specular, 1.0);\n}\n#endif\n" }), r("Shaders/CentralBodyFSDepth", [], function() { "use strict"; return "varying vec4 positionEC;\nvoid main()\n{\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nvec3 direction = normalize(positionEC.xyz);\nczm_ray ray = czm_ray(vec3(0.0), direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (!czm_isEmpty(intersection))\n{\ngl_FragColor = vec4(1.0, 1.0, 0.0, 1.0);\n}\nelse\n{\ndiscard;\n}\n}\n" }), r("Shaders/CentralBodyFSPole", [], function() { "use strict"; return "uniform vec3 u_color;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nczm_ellipsoid ellipsoid = czm_getWgs84EllipsoidEC();\nvec3 direction = normalize(czm_windowToEyeCoordinates(gl_FragCoord).xyz);\nczm_ray ray = czm_ray(vec3(0.0), direction);\nczm_raySegment intersection = czm_rayEllipsoidIntersectionInterval(ray, ellipsoid);\nif (!czm_isEmpty(intersection))\n{\nvec3 positionEC = czm_pointAlongRay(ray, intersection.start);\nvec3 positionMC = (czm_inverseModelView * vec4(positionEC, 1.0)).xyz;\nvec3 normalMC = normalize(czm_geodeticSurfaceNormal(positionMC, vec3(0.0), vec3(1.0)));\nvec3 normalEC = normalize(czm_normal * normalMC);\nvec3 startDayColor = u_color;\ngl_FragColor = vec4(startDayColor, 1.0);\n}\nelse\n{\ndiscard;\n}\n}\n" }), r("Shaders/CentralBodyVS", [], function() { "use strict"; return "attribute vec4 position3DAndHeight;\nattribute vec2 textureCoordinates;\nuniform vec3 u_center3D;\nuniform mat4 u_modifiedModelView;\nuniform vec4 u_tileExtent;\nuniform vec2 u_southAndNorthLatitude;\nuniform vec3 u_southMercatorYLowAndHighAndOneOverHeight;\nvarying vec3 v_positionMC;\nvarying vec3 v_positionEC;\nvarying vec2 v_textureCoordinates;\nvec4 getPosition(vec3 position3DWC);\nfloat get2DYPositionFraction();\nvec4 getPosition3DMode(vec3 position3DWC)\n{\nreturn czm_projection * (u_modifiedModelView * vec4(position3DAndHeight.xyz, 1.0));\n}\nfloat get2DMercatorYPositionFraction()\n{\nconst float maxTileWidth = 0.003068;\nfloat positionFraction = textureCoordinates.y;\nfloat southLatitude = u_southAndNorthLatitude.x;\nfloat northLatitude = u_southAndNorthLatitude.y;\nif (northLatitude - southLatitude > maxTileWidth)\n{\nfloat southMercatorYLow = u_southMercatorYLowAndHighAndOneOverHeight.x;\nfloat southMercatorYHigh = u_southMercatorYLowAndHighAndOneOverHeight.y;\nfloat oneOverMercatorHeight = u_southMercatorYLowAndHighAndOneOverHeight.z;\nfloat currentLatitude = mix(southLatitude, northLatitude, textureCoordinates.y);\ncurrentLatitude = clamp(currentLatitude, -czm_webMercatorMaxLatitude, czm_webMercatorMaxLatitude);\npositionFraction = czm_latitudeToWebMercatorFraction(currentLatitude, southMercatorYLow, southMercatorYHigh, oneOverMercatorHeight);\n}\nreturn positionFraction;\n}\nfloat get2DGeographicYPositionFraction()\n{\nreturn textureCoordinates.y;\n}\nvec4 getPositionPlanarEarth(vec3 position3DWC, float height2D)\n{\nfloat yPositionFraction = get2DYPositionFraction();\nvec4 rtcPosition2D = vec4(height2D, mix(u_tileExtent.st, u_tileExtent.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nreturn czm_projection * (u_modifiedModelView * rtcPosition2D);\n}\nvec4 getPosition2DMode(vec3 position3DWC)\n{\nreturn getPositionPlanarEarth(position3DWC, 0.0);\n}\nvec4 getPositionColumbusViewMode(vec3 position3DWC)\n{\nreturn getPositionPlanarEarth(position3DWC, position3DAndHeight.w);\n}\nvec4 getPositionMorphingMode(vec3 position3DWC)\n{\nfloat yPositionFraction = get2DYPositionFraction();\nvec4 position2DWC = vec4(0.0, mix(u_tileExtent.st, u_tileExtent.pq, vec2(textureCoordinates.x, yPositionFraction)), 1.0);\nvec4 morphPosition = czm_columbusViewMorph(position2DWC, vec4(position3DWC, 1.0), czm_morphTime);\nreturn czm_modelViewProjection * morphPosition;\n}\nvoid main()\n{\nvec3 position3DWC = position3DAndHeight.xyz + u_center3D;\ngl_Position = getPosition(position3DWC);\n#ifdef SHOW_REFLECTIVE_OCEAN\nv_positionEC = (czm_modelView3D * vec4(position3DWC, 1.0)).xyz;\nv_positionMC = position3DWC;\n#endif\nv_textureCoordinates = textureCoordinates;\n}\n" }), r("Shaders/CentralBodyVSDepth", [], function() { "use strict"; return "attribute vec4 position;\nvarying vec4 positionEC;\nvoid main()\n{\npositionEC = czm_modelView * position;\ngl_Position = czm_projection * positionEC;\n}\n" }), r("Shaders/CentralBodyVSPole", [], function() { "use strict"; return "attribute vec4 position;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nfloat x = (position.x - czm_viewport.x) / czm_viewport.z;\nfloat y = (position.y - czm_viewport.y) / czm_viewport.w;\nv_textureCoordinates = vec2(x, y);\ngl_Position = czm_viewportOrthographic * position;\n}\n" }), r("Scene/CentralBody", ["../Core/buildModuleUrl", "../Core/combine", "../Core/loadImage", "../Core/defaultValue", "../Core/defined", "../Core/destroyObject", "../Core/BoundingRectangle", "../Core/BoundingSphere", "../Core/Cartesian2", "../Core/Cartesian3", "../Core/Cartographic", "../Core/ComponentDatatype", "../Core/Ellipsoid", "../Core/Extent", "../Core/FeatureDetection", "../Core/GeographicProjection", "../Core/Geometry", "../Core/GeometryAttribute", "../Core/Intersect", "../Core/Math", "../Core/Matrix4", "../Core/Occluder", "../Core/PrimitiveType", "../Core/Transforms", "../Renderer/BufferUsage", "../Renderer/ClearCommand", "../Renderer/CommandLists", "../Renderer/DepthFunction", "../Renderer/DrawCommand", "../Renderer/createShaderSource", "./CentralBodySurface", "./CentralBodySurfaceShaderSet", "./CreditDisplay", "./EllipsoidTerrainProvider", "./ImageryLayerCollection", "./Material", "./SceneMode", "./TerrainProvider", "./ViewportQuad", "../Shaders/CentralBodyFS", "../Shaders/CentralBodyFSDepth", "../Shaders/CentralBodyFSPole", "../Shaders/CentralBodyVS", "../Shaders/CentralBodyVSDepth", "../Shaders/CentralBodyVSPole", "../ThirdParty/when"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C, x, S, E, b, T, A, M, P, D, I, O, R, L, z, N, F, B, V, q, k, U, W, G, H) { "use strict";
function j(e, t) { var r = e._ellipsoid.getRadii(),
i = t.camera.getPositionWC(),
n = e._ellipsoid.getOneOverRadii().multiplyComponents(i),
o = n.magnitude(),
a = n.normalize(),
s = u.UNIT_Z.cross(n).normalize(),
l = a.cross(s).normalize(),
c = Math.sqrt(n.magnitudeSquared() - 1),
h = a.multiplyByScalar(1 / o),
d = c / o,
m = s.multiplyByScalar(d),
p = l.multiplyByScalar(d),
f = r.multiplyComponents(h.add(p).subtract(m)),
v = r.multiplyComponents(h.add(p).add(m)),
y = r.multiplyComponents(h.subtract(p).subtract(m)),
g = r.multiplyComponents(h.subtract(p).add(m)); return J[0] = f.x, J[1] = f.y, J[2] = f.z, J[3] = y.x, J[4] = y.y, J[5] = y.z, J[6] = v.x, J[7] = v.y, J[8] = v.z, J[9] = g.x, J[10] = g.y, J[11] = g.z, J }
function Y(e, t, r, i, n, o) { var s, l = e._ellipsoid.cartographicToCartesian(new c(0, i)),
h = e._ellipsoid.cartographicToCartesian(new c(Math.PI, i)),
d = .5 * l.subtract(h).magnitude(),
m = e._ellipsoid.cartographicToCartesian(new c(0, r)),
p = t.camera.direction;
s = 1 - u.UNIT_Z.negate().dot(p) < _.EPSILON6 ? u.UNIT_X : p.cross(u.UNIT_Z).normalize(); var f = m.add(s.multiplyByScalar(d)),
v = m.add(u.UNIT_Z.cross(s).normalize().multiplyByScalar(d));
S.pointToWindowCoordinates(n, o, m, m), S.pointToWindowCoordinates(n, o, f, f), S.pointToWindowCoordinates(n, o, v, v); var y = Math.floor(Math.max(v.subtract(m).magnitude(), f.subtract(m).magnitude())),
g = y; return new a(Math.floor(m.x) - y, Math.floor(m.y) - g, 2 * y, 2 * g) }
function X(e, r, i) { var o = e._surface._terrainProvider; if (i.mode === N.SCENE3D && o.isReady()) { var a = o.getTilingScheme().getExtent(),
l = r.getUniformState().getViewProjection(),
u = Q;
u.width = r.getCanvas().clientWidth, u.height = r.getCanvas().clientHeight; var c, d, p, f, x, S, b, T = w.computeViewportTransformation(u, 0, 1, $),
A = .05,
M = e._occluder;
a.north < _.PI_OVER_TWO && (c = new m(-Math.PI, a.north, Math.PI, _.PI_OVER_TWO), d = s.fromExtent3D(c, e._ellipsoid), p = i.cullingVolume.getVisibility(d) === g.OUTSIDE, f = C.computeOccludeePointFromExtent(c, e._ellipsoid), x = f && !M.isPointVisible(f, 0) || !M.isBoundingSphereVisible(d), e._drawNorthPole = !p && !x, e._drawNorthPole && (b = Y(e, i, c.north, c.south - A, l, T), et[0] = b.x, et[1] = b.y, et[2] = b.x + b.width, et[3] = b.y, et[4] = b.x + b.width, et[5] = b.y + b.height, et[6] = b.x, et[7] = b.y + b.height, n(e._northPoleCommand.vertexArray) ? e._northPoleCommand.vertexArray.getAttribute(0).vertexBuffer.copyFromArrayView(et) : (e._northPoleCommand.boundingVolume = s.fromExtent3D(c, e._ellipsoid), S = new v({ attributes: { position: new y({ componentDatatype: h.FLOAT, componentsPerAttribute: 2, values: et }) } }), e._northPoleCommand.vertexArray = r.createVertexArrayFromGeometry({ geometry: S, attributeIndices: { position: 0 }, bufferUsage: E.STREAM_DRAW })))), a.south > -_.PI_OVER_TWO && (c = new m(-Math.PI, -_.PI_OVER_TWO, Math.PI, a.south), d = s.fromExtent3D(c, e._ellipsoid), p = i.cullingVolume.getVisibility(d) === g.OUTSIDE, f = C.computeOccludeePointFromExtent(c, e._ellipsoid), x = f && !M.isPointVisible(f) || !M.isBoundingSphereVisible(d), e._drawSouthPole = !p && !x, e._drawSouthPole && (b = Y(e, i, c.south, c.north + A, l, T), et[0] = b.x, et[1] = b.y, et[2] = b.x + b.width, et[3] = b.y, et[4] = b.x + b.width, et[5] = b.y + b.height, et[6] = b.x, et[7] = b.y + b.height, n(e._southPoleCommand.vertexArray) ? e._southPoleCommand.vertexArray.getAttribute(0).vertexBuffer.copyFromArrayView(et) : (e._southPoleCommand.boundingVolume = s.fromExtent3D(c, e._ellipsoid), S = new v({ attributes: { position: new y({ componentDatatype: h.FLOAT, componentsPerAttribute: 2, values: et }) } }), e._southPoleCommand.vertexArray = r.createVertexArrayFromGeometry({ geometry: S, attributeIndices: { position: 0 }, bufferUsage: E.STREAM_DRAW })))); var P = 0,
D = e._imageryLayerCollection.getLength() > 0 ? e._imageryLayerCollection.get(0) : void 0;
n(D) && n(D.getImageryProvider()) && n(D.getImageryProvider().getPoleIntensity) && (P = D.getImageryProvider().getPoleIntensity()); var I = { u_dayIntensity: function() { return P } },
O = e; if (!n(e._northPoleCommand.uniformMap)) { var R = t([I, { u_color: function() { return O.northPoleColor } }], !1, !1);
e._northPoleCommand.uniformMap = t([R, e._drawUniforms], !1, !1) } if (!n(e._southPoleCommand.uniformMap)) { var L = t([I, { u_color: function() { return O.southPoleColor } }], !1, !1);
e._southPoleCommand.uniformMap = t([L, e._drawUniforms], !1, !1) } } }
function Z(e, t) { var r = t.creditDisplay,
i = e._surface._terrainProvider.getCredit();
n(i) && r.addCredit(i); for (var o = e._imageryLayerCollection, a = 0, s = o.getLength(); s > a; ++a) { var l = o.get(a);
l.show && (i = l.getImageryProvider().getCredit(), n(i) && r.addCredit(i)) } } var K = function(t) { t = i(t, d.WGS84); var r = new R({ ellipsoid: t }),
n = new L;
this.terrainProvider = r, this._ellipsoid = t, this._imageryLayerCollection = n, this._surface = new D({ terrainProvider: r, imageryLayerCollection: n }), this._occluder = new C(new s(u.ZERO, t.getMinimumRadius()), u.ZERO), this._surfaceShaderSet = new I(F.attributeIndices), this._rsColor = void 0, this._rsColorWithoutDepthTest = void 0; var o = new b;
o.depth = 1, o.stencil = 0, o.owner = this, this._clearDepthCommand = o, this._depthCommand = new M, this._depthCommand.primitiveType = x.TRIANGLES, this._depthCommand.boundingVolume = new s(u.ZERO, t.getMaximumRadius()), this._depthCommand.owner = this, this._northPoleCommand = new M, this._northPoleCommand.primitiveType = x.TRIANGLE_FAN, this._northPoleCommand.owner = this, this._southPoleCommand = new M, this._southPoleCommand.primitiveType = x.TRIANGLE_FAN, this._southPoleCommand.owner = this, this._drawNorthPole = !1, this._drawSouthPole = !1, this._commandLists = new T, this.northPoleColor = new u(2 / 255, 6 / 255, 18 / 255), this.southPoleColor = new u(1, 1, 1), this.show = !0, this._mode = N.SCENE3D, this._projection = void 0, this.oceanNormalMapUrl = e("Assets/Textures/waterNormalsSmall.jpg"), this.depthTestAgainstTerrain = !1, this.tileCacheSize = 100, this._lastOceanNormalMapUrl = void 0, this._oceanNormalMap = void 0, this._zoomedOutOceanSpecularIntensity = .5, this._showingPrettyOcean = !1, this._hasWaterMask = !1; var a = this;
this._drawUniforms = { u_zoomedOutOceanSpecularIntensity: function() { return a._zoomedOutOceanSpecularIntensity }, u_oceanNormalMap: function() { return a._oceanNormalMap } } };
K.prototype.getEllipsoid = function() { return this._ellipsoid }, K.prototype.getImageryLayers = function() { return this._imageryLayerCollection }; var J = p.supportsTypedArrays() ? new Float32Array(12) : [],
Q = new a,
$ = new w,
et = p.supportsTypedArrays() ? new Float32Array(8) : []; return K.prototype.update = function(e, t, i) { if (this.show) { var o = e.getCanvas().clientWidth,
a = e.getCanvas().clientHeight; if (0 !== o && 0 !== a) { var s = t.mode,
l = t.scene2D.projection,
u = !1;
this._mode === s && n(this._rsColor) || (u = !0, s === N.SCENE3D || s === N.COLUMBUS_VIEW ? (this._rsColor = e.createRenderState({ cull: { enabled: !0 }, depthTest: { enabled: !0 } }), this._rsColorWithoutDepthTest = e.createRenderState({ cull: { enabled: !0 } }), this._depthCommand.renderState = e.createRenderState({ cull: { enabled: !0 }, depthTest: { enabled: !0, func: A.ALWAYS }, colorMask: { red: !1, green: !1, blue: !1, alpha: !1 } })) : (this._rsColor = e.createRenderState({ cull: { enabled: !0 } }), this._rsColorWithoutDepthTest = e.createRenderState({ cull: { enabled: !0 } }), this._depthCommand.renderState = e.createRenderState({ cull: { enabled: !0 } }))), this._northPoleCommand.renderState = this._rsColorWithoutDepthTest, this._southPoleCommand.renderState = this._rsColorWithoutDepthTest; var c = j(this, t); if (this._depthCommand.vertexArray) this._depthCommand.vertexArray.getAttribute(0).vertexBuffer.copyFromArrayView(c);
else { var d = new v({ attributes: { position: new y({ componentDatatype: h.FLOAT, componentsPerAttribute: 3, values: c }) }, indices: [0, 1, 2, 2, 1, 3], primitiveType: x.TRIANGLES });
this._depthCommand.vertexArray = e.createVertexArrayFromGeometry({ geometry: d, attributeIndices: { position: 0 }, bufferUsage: E.DYNAMIC_DRAW }) } var m = e.getShaderCache(); if (n(this._depthCommand.shaderProgram) || (this._depthCommand.shaderProgram = m.getShaderProgram(W, q, { position: 0 })), this._surface._terrainProvider.hasWaterMask() && this.oceanNormalMapUrl !== this._lastOceanNormalMapUrl) { this._lastOceanNormalMapUrl = this.oceanNormalMapUrl; var p = this;
H(r(this.oceanNormalMapUrl), function(t) { p._oceanNormalMap = p._oceanNormalMap && p._oceanNormalMap.destroy(), p._oceanNormalMap = e.createTexture2D({ source: t }) }) } var g = this._projection !== l,
_ = this._surface._terrainProvider.hasWaterMask(),
w = this._hasWaterMask !== _; if (!n(this._surfaceShaderSet) || !n(this._northPoleCommand.shaderProgram) || !n(this._southPoleCommand.shaderProgram) || u || g || w || n(this._oceanNormalMap) !== this._showingPrettyOcean) { var C, S = "vec4 getPosition(vec3 position3DWC) { return getPosition3DMode(position3DWC); }",
b = "vec4 getPosition(vec3 position3DWC) { return getPosition2DMode(position3DWC); }",
T = "vec4 getPosition(vec3 position3DWC) { return getPositionColumbusViewMode(position3DWC); }",
M = "vec4 getPosition(vec3 position3DWC) { return getPositionMorphingMode(position3DWC); }"; switch (s) {
case N.SCENE3D:
C = S; break;
case N.SCENE2D:
C = b; break;
case N.COLUMBUS_VIEW:
C = T; break;
case N.MORPHING:
C = M } var D, I = "float get2DYPositionFraction() { return get2DGeographicYPositionFraction(); }",
O = "float get2DYPositionFraction() { return get2DMercatorYPositionFraction(); }";
D = l instanceof f ? I : O, this._surfaceShaderSet.baseVertexShaderString = P({ defines: [_ ? "SHOW_REFLECTIVE_OCEAN" : ""], sources: [U, C, D] }); var R = _ && n(this._oceanNormalMap);
this._surfaceShaderSet.baseFragmentShaderString = P({ defines: [_ ? "SHOW_REFLECTIVE_OCEAN" : "", R ? "SHOW_OCEAN_WAVES" : ""], sources: [V] }), this._surfaceShaderSet.invalidateShaders(); var L = m.replaceShaderProgram(this._northPoleCommand.shaderProgram, G, k, F.attributeIndices);
this._northPoleCommand.shaderProgram = L, this._southPoleCommand.shaderProgram = L, this._showingPrettyOcean = n(this._oceanNormalMap), this._hasWaterMask = _ } var z = t.camera.getPositionWC();
this._occluder.setCameraPosition(z), X(this, e, t), this._mode = s, this._projection = l; var B = t.passes,
Y = this._commandLists; if (Y.removeAll(), B.color) { var K = Y.colorList;
s === N.SCENE3D && (this._drawNorthPole && K.push(this._northPoleCommand), this._drawSouthPole && K.push(this._southPoleCommand)), this._zoomedOutOceanSpecularIntensity = s === N.SCENE3D ? .5 : 0, this._surface._tileCacheSize = this.tileCacheSize, this._surface.setTerrainProvider(this.terrainProvider), this._surface.update(e, t, K, this._drawUniforms, this._surfaceShaderSet, this._rsColor, this._projection), Z(this, t), (s === N.SCENE3D || s === N.COLUMBUS_VIEW) && (this.depthTestAgainstTerrain || (K.push(this._clearDepthCommand), s === N.SCENE3D && K.push(this._depthCommand))) } B.pick && Y.pickList.push(this._depthCommand), Y.empty() || i.push(Y) } } }, K.prototype.isDestroyed = function() { return !1 }, K.prototype.destroy = function() { return this._northPoleCommand.vertexArray = this._northPoleCommand.vertexArray && this._northPoleCommand.vertexArray.destroy(), this._southPoleCommand.vertexArray = this._southPoleCommand.vertexArray && this._southPoleCommand.vertexArray.destroy(), this._surfaceShaderSet = this._surfaceShaderSet && this._surfaceShaderSet.destroy(), this._northPoleCommand.shaderProgram = this._northPoleCommand.shaderProgram && this._northPoleCommand.shaderProgram.release(), this._southPoleCommand.shaderProgram = this._northPoleCommand.shaderProgram, this._depthCommand.shaderProgram = this._depthCommand.shaderProgram && this._depthCommand.shaderProgram.release(), this._depthCommand.vertexArray = this._depthCommand.vertexArray && this._depthCommand.vertexArray.destroy(), this._surface = this._surface && this._surface.destroy(), this._oceanNormalMap = this._oceanNormalMap && this._oceanNormalMap.destroy(), o(this) }, K }), r("Scene/isatCesiumTerrainProvider", ["../Core/defaultValue", "../Core/defined", "../Core/loadArrayBuffer", "../Core/throttleRequestByServer", "../Core/writeTextToCanvas", "../Core/DeveloperError", "../Core/Event", "./Credit", "./GeographicTilingScheme", "./HeightmapTerrainData", "./TerrainProvider", "../ThirdParty/when"], function(e, t, r, i, n, o, a, s, l, u, c, h) { "use strict"; var d = function(e) { if (!t(e) || !t(e.url)) throw new o("description.url is required.");
this._url = e.url, this._proxy = e.proxy, this._tilingScheme = new l({ numberOfLevelZeroTilesX: 2, numberOfLevelZeroTilesY: 1 }), this._heightmapWidth = 65, this._levelZeroMaximumGeometricError = c.getEstimatedLevelZeroGeometricErrorForAHeightmap(this._tilingScheme.getEllipsoid(), this._heightmapWidth, this._tilingScheme.getNumberOfXTilesAtLevel(0)), this._terrainDataStructure = { heightScale: .2, heightOffset: -1e3, elementsPerHeight: 1, stride: 1, elementMultiplier: 256, isBigEndian: !1 }, this._errorEvent = new a; var r = e.credit; "string" == typeof r && (r = new s(r)), this._credit = r }; return d.prototype.requestTileGeometry = function(n, o, a, s) { var l = this._tilingScheme.getNumberOfYTilesAtLevel(a),
c = this._url + "/" + a + "/" + n + "/" + (l - o - 1) + ".terrain",
d = this._proxy;
t(d) && (c = d.getURL(c)); var m; if (s = e(s, !0)) { if (m = i(c, r), !t(m)) return void 0 } else m = r(c); var p = this; return h(m, function(e) { var t = new Uint16Array(e, 0, p._heightmapWidth * p._heightmapWidth); return new u({ buffer: t, childTileMask: new Uint8Array(e, t.byteLength, 1)[0], waterMask: new Uint8Array(e, t.byteLength + 1, e.byteLength - t.byteLength - 1), width: p._heightmapWidth, height: p._heightmapWidth, structure: p._terrainDataStructure }) }) }, d.prototype.getErrorEvent = function() { return this._errorEvent }, d.prototype.getLevelMaximumGeometricError = function(e) { return this._levelZeroMaximumGeometricError / (1 << e) }, d.prototype.getCredit = function() { return this._credit }, d.prototype.getTilingScheme = function() { return this._tilingScheme }, d.prototype.hasWaterMask = function() { return !0 }, d.prototype.isReady = function() { return !0 }, d }), r("Scene/CompositePrimitive", ["../Core/createGuid", "../Core/defined", "../Core/destroyObject", "../Core/DeveloperError"], function(e, t, r, i) { "use strict";
function n(e, t) { if (!e.contains(t)) throw new i("primitive is not in this composite."); return e._primitives.indexOf(t) } var o = function() { this._centralBody = void 0, this._primitives = [], this._guid = e(), this.destroyPrimitives = !0, this.show = !0 }; return o.prototype.getCentralBody = function() { return this._centralBody }, o.prototype.setCentralBody = function(e) { this._centralBody = this.destroyPrimitives && this._centralBody && this._centralBody.destroy(), this._centralBody = e }, o.prototype.add = function(e) { if (!t(e)) throw new i("primitive is required."); var r = e._external = e._external || {},
n = r._composites = r._composites || {};
n[this._guid] = { composite: this }, this._primitives.push(e) }, o.prototype.remove = function(e) { if (this.contains(e)) { var t = this._primitives.indexOf(e); if (-1 !== t) return this._primitives.splice(t, 1), delete e._external._composites[this._guid], this.destroyPrimitives && e.destroy(), !0 } return !1 }, o.prototype.removeAll = function() { if (this.destroyPrimitives)
for (var e = this._primitives, t = e.length, r = 0; t > r; ++r) e[r].destroy();
this._primitives = [] }, o.prototype.contains = function(e) { return !!(e && e._external && e._external._composites && e._external._composites[this._guid]) }, o.prototype.raise = function(e) { if (t(e)) { var r = n(this, e),
i = this._primitives; if (r !== i.length - 1) { var o = i[r];
i[r] = i[r + 1], i[r + 1] = o } } }, o.prototype.raiseToTop = function(e) { if (t(e)) { var r = n(this, e),
i = this._primitives;
r !== i.length - 1 && (i.splice(r, 1), i.push(e)) } }, o.prototype.lower = function(e) { if (t(e)) { var r = n(this, e),
i = this._primitives; if (0 !== r) { var o = i[r];
i[r] = i[r - 1], i[r - 1] = o } } }, o.prototype.lowerToBottom = function(e) { if (t(e)) { var r = n(this, e),
i = this._primitives;
0 !== r && (i.splice(r, 1), i.unshift(e)) } }, o.prototype.get = function(e) { if (!t(e)) throw new i("index is required."); return this._primitives[e] }, o.prototype.getLength = function() { return this._primitives.length }, o.prototype.update = function(e, t, r) { if (this.show) { this._centralBody && this._centralBody.update(e, t, r); for (var i = this._primitives, n = i.length, o = 0; n > o; ++o) i[o].update(e, t, r) } }, o.prototype.isDestroyed = function() { return !1 }, o.prototype.destroy = function() { return this.removeAll(), this._centralBody = this.destroyPrimitives && this._centralBody && this._centralBody.destroy(), r(this) }, o }), r("Scene/DebugAppearance", ["../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "./Appearance"], function(e, t, r, i) { "use strict"; var n = function(n) { n = e(n, e.EMPTY_OBJECT); var o = n.attributeName; if (!t(o)) throw new r("options.attributeName is required."); var a, s = e(n.glslDatatype, "vec3"),
l = "v_" + o; if ("normal" === o || "binormal" === o | "tangent" === o) a = "vec4 getColor() { return vec4((" + l + " + vec3(1.0)) * 0.5, 1.0); }\n";
else switch ("st" === o && (s = "vec2"), s) {
case "float":
a = "vec4 getColor() { return vec4(vec3(" + l + "), 1.0); }\n"; break;
case "vec2":
a = "vec4 getColor() { return vec4(" + l + ", 0.0, 1.0); }\n"; break;
case "vec3":
a = "vec4 getColor() { return vec4(" + l + ", 1.0); }\n"; break;
case "vec4":
a = "vec4 getColor() { return " + l + "; }\n"; break;
default:
throw new r("options.glslDatatype must be float, vec2, vec3, or vec4.") }
var u = "attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute " + s + " " + o + ";\n" + "varying " + s + " " + l + ";\n" + "void main()\n" + "{\n" + "vec4 p = czm_translateRelativeToEye(position3DHigh, position3DLow);\n" + l + " = " + o + ";\n" + "gl_Position = czm_modelViewProjectionRelativeToEye * p;\n" + "}",
c = "varying " + s + " " + l + ";\n" + a + "\n" + "void main()\n" + "{\n" + "gl_FragColor = getColor();\n" + "}";
this.material = void 0, this.vertexShaderSource = e(n.vertexShaderSource, u), this.fragmentShaderSource = e(n.fragmentShaderSource, c), this.renderState = e(n.renderState, i.getDefaultRenderState(!1, !1)), this.attributeName = o, this.glslDatatype = s, this.translucent = e(n.translucent, !1), this.closed = e(n.closed, !1) }; return n.prototype.getFragmentShaderSource = i.prototype.getFragmentShaderSource, n }), r("Scene/ExtentPrimitive", ["../Core/DeveloperError", "../Core/defaultValue", "../Core/defined", "../Core/Color", "../Core/destroyObject", "../Core/Math", "../Core/Extent", "../Core/Ellipsoid", "../Core/GeometryInstance", "../Core/ExtentGeometry", "./EllipsoidSurfaceAppearance", "./Primitive", "./Material"], function(e, t, r, i, n, o, a, s, l, u, c, h, d) {
"use strict";
var m = function(e) { e = t(e, t.EMPTY_OBJECT), this.ellipsoid = t(e.ellipsoid, s.WGS84), this._ellipsoid = void 0, this.extent = a.clone(e.extent), this._extent = void 0, this.granularity = t(e.granularity, o.RADIANS_PER_DEGREE), this._granularity = void 0, this.height = t(e.height, 0), this._height = void 0, this.rotation = t(e.rotation, 0), this._rotation = void 0, this.textureRotationAngle = t(e.textureRotationAngle, 0), this._textureRotationAngle = void 0, this.show = t(e.show, !0); var r = d.fromType(void 0, d.ColorType);
r.uniforms.color = new i(1, 1, 0, .5), this.material = t(e.material, r), this.asynchronous = t(e.asynchronous, !0), this._primitive = void 0 };
return m.prototype.update = function(t, i, n) { if (!r(this.ellipsoid)) throw new e("this.ellipsoid must be defined."); if (!r(this.material)) throw new e("this.material must be defined."); if (this.granularity < 0) throw new e("this.granularity and scene2D/scene3D overrides must be greater than zero."); if (this.show && r(this.extent)) { if (!a.equals(this._extent, this.extent) || this._ellipsoid !== this.ellipsoid || this._granularity !== this.granularity || this._height !== this.height || this._rotation !== this.rotation || this._textureRotationAngle !== this.textureRotationAngle) { this._extent = a.clone(this.extent, this._extent), this._ellipsoid = this.ellipsoid, this._granularity = this.granularity, this._height = this.height, this._rotation = this.rotation, this._textureRotationAngle = this.textureRotationAngle; var o = new l({ geometry: new u({ extent: this.extent, vertexFormat: c.VERTEX_FORMAT, ellipsoid: this.ellipsoid, granularity: this.granularity, height: this.height, rotation: this.rotation, stRotation: this.textureRotationAngle }), id: this });
r(this._primitive) && this._primitive.destroy(), this._primitive = new h({ geometryInstances: o, appearance: new c({ aboveGround: this.height > 0 }), asynchronous: this.asynchronous }) } this._primitive.appearance.material = this.material, this._primitive.update(t, i, n) } }, m.prototype.isDestroyed = function() { return !1 }, m.prototype.destroy = function() { return this._primitive = this._primitive && this._primitive.destroy(), n(this) }, m
}), r("Scene/FrameState", ["../Core/defined", "../Core/Cartesian2", "./SceneMode"], function(e, t, r) { "use strict"; var i = function(e) { this.mode = r.SCENE3D, this.morphTime = r.SCENE3D.morphTime, this.frameNumber = 0, this.time = void 0, this.scene2D = { projection: void 0 }, this.camera = void 0, this.cullingVolume = void 0, this.occluder = void 0, this.canvasDimensions = new t, this.passes = { color: !1, pick: !1, overlay: !1 }, this.creditDisplay = e }; return i }), r("Scene/FrustumCommands", ["../Core/defaultValue"], function(e) { "use strict"; var t = function(t, r) { this.near = e(t, 0), this.far = e(r, 0), this.commands = [] }; return t }), r("Scene/GridImageryProvider", ["../Core/defaultValue", "../Core/Color", "../Core/Event", "./GeographicTilingScheme"], function(e, t, r, i) { "use strict"; var n = function(n) { n = e(n, {}), this._tilingScheme = e(n.tilingScheme, new i), this._cells = e(n.cells, 8), this._color = e(n.color, new t(1, 1, 1, .4)), this._glowColor = e(n.glowColor, new t(0, 1, 0, .05)), this._glowWidth = e(n.glowWidth, 6), this._backgroundColor = e(n.backgroundColor, new t(0, .5, 0, .2)), this._errorEvent = new r, this._tileWidth = e(n.tileWidth, 256), this._tileHeight = e(n.tileHeight, 256), this._canvasSize = e(n.canvasSize, 256), this._canvas = this._createGridCanvas() }; return n.prototype.getProxy = function() { return void 0 }, n.prototype.getTileWidth = function() { return this._tileWidth }, n.prototype.getTileHeight = function() { return this._tileHeight }, n.prototype.getMaximumLevel = function() { return void 0 }, n.prototype.getMinimumLevel = function() { return void 0 }, n.prototype.getTilingScheme = function() { return this._tilingScheme }, n.prototype.getExtent = function() { return this._tilingScheme.getExtent() }, n.prototype.getTileDiscardPolicy = function() { return void 0 }, n.prototype.getErrorEvent = function() { return this._errorEvent }, n.prototype.isReady = function() { return !0 }, n.prototype._drawGrid = function(e) { for (var t = 0, r = this._canvasSize, i = 0; i <= this._cells; ++i) { var n = i / this._cells,
o = 1 + n * (r - 1);
e.moveTo(o, t), e.lineTo(o, r), e.moveTo(t, o), e.lineTo(r, o) } e.stroke() }, n.prototype._createGridCanvas = function() { var e = document.createElement("canvas");
e.width = this._canvasSize, e.height = this._canvasSize; var t = 0,
r = this._canvasSize,
i = e.getContext("2d"),
n = this._backgroundColor.toCssColorString();
i.fillStyle = n, i.fillRect(t, t, r, r); var o = this._glowColor.toCssColorString();
i.strokeStyle = o, i.lineWidth = this._glowWidth, i.strokeRect(t, t, r, r), this._drawGrid(i), i.lineWidth = .5 * this._glowWidth, i.strokeRect(t, t, r, r), this._drawGrid(i); var a = this._color.toCssColorString(); return i.strokeStyle = a, i.lineWidth = 2, i.strokeRect(t, t, r, r), i.lineWidth = 1, this._drawGrid(i), e }, n.prototype.requestImage = function() { return this._canvas }, n.prototype.getCredit = function() { return void 0 }, n }), r("Scene/NeverTileDiscardPolicy", [], function() { "use strict"; var e = function() {}; return e.prototype.isReady = function() { return !0 }, e.prototype.shouldDiscardImage = function() { return !1 }, e }), r("Scene/OpenStreetMapImageryProvider", ["../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/Event", "../Core/writeTextToCanvas", "./ImageryProvider", "./WebMercatorTilingScheme", "./Credit"], function(e, t, r, i, n, o, a, s) { "use strict";
function l(e, r, i, n) { var o = e._url + n + "/" + r + "/" + i + "." + e._fileExtension,
a = e._proxy; return t(a) && (o = a.getURL(o)), o } var u = /\/$/,
c = new s("MapQuest, Open Street Map and contributors, CC-BY-SA"),
h = function(t) { t = e(t, {}); var r = e(t.url, "http://tile.openstreetmap.org/");
u.test(r) || (r += "/"), this._url = r, this._fileExtension = e(t.fileExtension, "png"), this._proxy = t.proxy, this._tileDiscardPolicy = t.tileDiscardPolicy, this._tilingScheme = new a, this._tileWidth = 256, this._tileHeight = 256, this._maximumLevel = e(t.maximumLevel, 18), this._extent = e(t.extent, this._tilingScheme.getExtent()), this._errorEvent = new i, this._ready = !0; var n = e(t.credit, c); "string" == typeof n && (n = new s(n)), this._credit = n }; return h.prototype.getUrl = function() { return this._url }, h.prototype.getProxy = function() { return this._proxy }, h.prototype.getTileWidth = function() { if (!this._ready) throw new r("getTileWidth must not be called before the imagery provider is ready."); return this._tileWidth }, h.prototype.getTileHeight = function() { if (!this._ready) throw new r("getTileHeight must not be called before the imagery provider is ready."); return this._tileHeight }, h.prototype.getMaximumLevel = function() { if (!this._ready) throw new r("getMaximumLevel must not be called before the imagery provider is ready."); return this._maximumLevel }, h.prototype.getMinimumLevel = function() { if (!this._ready) throw new r("getMinimumLevel must not be called before the imagery provider is ready."); return 0 }, h.prototype.getTilingScheme = function() { if (!this._ready) throw new r("getTilingScheme must not be called before the imagery provider is ready."); return this._tilingScheme }, h.prototype.getExtent = function() { if (!this._ready) throw new r("getExtent must not be called before the imagery provider is ready."); return this._extent }, h.prototype.getTileDiscardPolicy = function() { if (!this._ready) throw new r("getTileDiscardPolicy must not be called before the imagery provider is ready."); return this._tileDiscardPolicy }, h.prototype.getErrorEvent = function() { return this._errorEvent }, h.prototype.isReady = function() { return this._ready }, h.prototype.requestImage = function(e, t, i) { if (!this._ready) throw new r("requestImage must not be called before the imagery provider is ready."); var n = l(this, e, t, i); return o.loadImage(this, n) }, h.prototype.getCredit = function() { return this._credit }, h }), r("Scene/OrthographicFrustum", ["../Core/defined", "../Core/DeveloperError", "../Core/destroyObject", "../Core/Cartesian2", "../Core/Cartesian3", "../Core/Cartesian4", "../Core/Matrix4", "../Scene/CullingVolume"], function(e, t, r, i, n, o, a, s) { "use strict";
function l(r) { if (!(e(r.right) && e(r.left) && e(r.top) && e(r.bottom) && e(r.near) && e(r.far))) throw new t("right, left, top, bottom, near, or far parameters are not set."); if (r.top !== r._top || r.bottom !== r._bottom || r.left !== r._left || r.right !== r._right || r.near !== r._near || r.far !== r._far) { if (r.left > r.right) throw new t("right must be greater than left."); if (r.bottom > r.top) throw new t("top must be greater than bottom."); if (r.near <= 0 || r.near > r.far) throw new t("near must be greater than zero and less than far.");
r._left = r.left, r._right = r.right, r._top = r.top, r._bottom = r.bottom, r._near = r.near, r._far = r.far, r._orthographicMatrix = a.computeOrthographicOffCenter(r.left, r.right, r.bottom, r.top, r.near, r.far) } } var u = function() { this.left = void 0, this._left = void 0, this.right = void 0, this._right = void 0, this.top = void 0, this._top = void 0, this.bottom = void 0, this._bottom = void 0, this.near = 1, this._near = this.near, this.far = 5e8, this._far = this.far, this._cullingVolume = new s, this._orthographicMatrix = void 0 };
u.prototype.getProjectionMatrix = function() { return l(this), this._orthographicMatrix }; var c = new n,
h = new n,
d = new n; return u.prototype.computeCullingVolume = function(r, i, a) { if (!e(r)) throw new t("position is required."); if (!e(i)) throw new t("direction is required."); if (!e(a)) throw new t("up is required."); var s = this._cullingVolume.planes,
l = this.top,
u = this.bottom,
m = this.right,
p = this.left,
f = this.near,
v = this.far,
y = n.cross(i, a, c),
g = h;
n.multiplyByScalar(i, f, g), n.add(r, g, g); var _ = d;
n.multiplyByScalar(y, p, _), n.add(g, _, _); var w = s[0]; return e(w) || (w = s[0] = new o), w.x = y.x, w.y = y.y, w.z = y.z, w.w = -n.dot(y, _), n.multiplyByScalar(y, m, _), n.add(g, _, _), w = s[1], e(w) || (w = s[1] = new o), w.x = -y.x, w.y = -y.y, w.z = -y.z, w.w = -n.dot(y.negate(), _), n.multiplyByScalar(a, u, _), n.add(g, _, _), w = s[2], e(w) || (w = s[2] = new o), w.x = a.x, w.y = a.y, w.z = a.z, w.w = -n.dot(a, _), n.multiplyByScalar(a, l, _), n.add(g, _, _), w = s[3], e(w) || (w = s[3] = new o), w.x = -a.x, w.y = -a.y, w.z = -a.z, w.w = -n.dot(a.negate(), _), w = s[4], e(w) || (w = s[4] = new o), w.x = i.x, w.y = i.y, w.z = i.z, w.w = -n.dot(i, g), n.multiplyByScalar(i, v, _), n.add(r, _, _), w = s[5], e(w) || (w = s[5] = new o), w.x = -i.x, w.y = -i.y, w.z = -i.z, w.w = -n.dot(i.negate(), _), this._cullingVolume }, u.prototype.getPixelSize = function(r) { if (l(this), !e(r)) throw new t("canvasDimensions is required."); var n = r.x,
o = r.y; if (0 >= n) throw new t("canvasDimensions.x must be greater than zero."); if (0 >= o) throw new t("canvasDimensions.y must be greater than zero."); var a = this.right - this.left,
s = this.top - this.bottom,
u = a / n,
c = s / o; return new i(u, c) }, u.prototype.clone = function() { var e = new u; return e.left = this.left, e.right = this.right, e.top = this.top, e.bottom = this.bottom, e.near = this.near, e.far = this.far, e }, u.prototype.equals = function(t) { return e(t) && this.right === t.right && this.left === t.left && this.top === t.top && this.bottom === t.bottom && this.near === t.near && this.far === t.far }, u }), r("Shaders/Appearances/PerInstanceColorAppearanceVS", [], function() { "use strict"; return "attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec3 normal;\nattribute vec4 color;\nvarying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_positionEC = (czm_modelViewRelativeToEye * p).xyz;\nv_normalEC = czm_normal * normal;\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n" }), r("Shaders/Appearances/PerInstanceColorAppearanceFS", [], function() { "use strict"; return "varying vec3 v_positionEC;\nvarying vec3 v_normalEC;\nvarying vec4 v_color;\nvoid main()\n{\nvec3 positionToEyeEC = -v_positionEC;\nvec3 normalEC;\n#ifdef FACE_FORWARD\nnormalEC = normalize(faceforward(v_normalEC, vec3(0.0, 0.0, 1.0), -v_normalEC));\n#else\nnormalEC = normalize(v_normalEC);\n#endif\nczm_materialInput materialInput;\nmaterialInput.normalEC = normalEC;\nmaterialInput.positionToEyeEC = positionToEyeEC;\nczm_material material = czm_getDefaultMaterial(materialInput);\nmaterial.diffuse = v_color.rgb;\nmaterial.alpha = v_color.a;\ngl_FragColor = czm_phong(normalize(positionToEyeEC), material);\n}\n" }), r("Shaders/Appearances/PerInstanceFlatColorAppearanceVS", [], function() { "use strict"; return "attribute vec3 position3DHigh;\nattribute vec3 position3DLow;\nattribute vec4 color;\nvarying vec4 v_color;\nvoid main()\n{\nvec4 p = czm_computePosition();\nv_color = color;\ngl_Position = czm_modelViewProjectionRelativeToEye * p;\n}\n" }), r("Shaders/Appearances/PerInstanceFlatColorAppearanceFS", [], function() { "use strict"; return "varying vec4 v_color;\nvoid main()\n{\ngl_FragColor = v_color;\n}\n" }), r("Scene/PerInstanceColorAppearance", ["../Core/defaultValue", "../Core/VertexFormat", "./Appearance", "../Shaders/Appearances/PerInstanceColorAppearanceVS", "../Shaders/Appearances/PerInstanceColorAppearanceFS", "../Shaders/Appearances/PerInstanceFlatColorAppearanceVS", "../Shaders/Appearances/PerInstanceFlatColorAppearanceFS"], function(e, t, r, i, n, o, a) { "use strict"; var s = function(t) { t = e(t, e.EMPTY_OBJECT); var l = e(t.translucent, !0),
u = e(t.closed, !1),
c = e(t.flat, !1),
h = c ? o : i,
d = c ? a : n,
m = c ? s.FLAT_VERTEX_FORMAT : s.VERTEX_FORMAT;
this.material = void 0, this.vertexShaderSource = e(t.vertexShaderSource, h), this.fragmentShaderSource = e(t.fragmentShaderSource, d), this.renderState = e(t.renderState, r.getDefaultRenderState(l, u)), this.vertexFormat = m, this.flat = c, this.faceForward = e(t.faceForward, !1), this.translucent = l, this.closed = u }; return s.VERTEX_FORMAT = t.POSITION_AND_NORMAL, s.FLAT_VERTEX_FORMAT = t.POSITION_ONLY, s.prototype.getFragmentShaderSource = r.prototype.getFragmentShaderSource, s }), r("Scene/PerformanceDisplay", ["../Core/BoundingRectangle", "../Core/Color", "../Core/defaultValue", "../Core/defined", "../Core/destroyObject", "../Renderer/PixelFormat", "./Material", "./ViewportQuad"], function(e, t, r, i, n, o, a, s) { "use strict"; var l = t.fromCssColorString("#e52"),
u = t.fromCssColorString("#de3"),
c = t.fromCssColorString("rgba(0, 0, 30, 0.9)"),
h = new e(0, 0, 80, 40),
d = function(e) { e = r(e, r.EMPTY_OBJECT), this._fpsColor = r(e.fpsColor, l).toCssColorString(), this._frameTimeColor = r(e.frameTimeColor, u).toCssColorString(), this._backgroundColor = r(e.backgroundColor, c).toCssColorString(), this._font = r(e.font, "bold 10px Helvetica,Arial,sans-serif"), this._rectangle = r(e.rectangle, h), this._canvas = document.createElement("canvas"), this._canvas.width = this._rectangle.width, this._canvas.height = this._rectangle.height, this._canvasContext = this._canvas.getContext("2d"), this._canvasContext.font = this._font, this._canvasContext.lineWidth = 1, this._bufferLength = this._rectangle.width, this._frameTimeSamples = new Array(this._bufferLength), this._fpsSamples = new Array(this._bufferLength); for (var t = 0; t < this._bufferLength; t++) this._frameTimeSamples[t] = this._fpsSamples[t] = 0;
this._frameTimeIndex = 0, this._fpsIndex = 0, this._lastFpsSampleTime = void 0, this._frameCount = 0, this._quad = void 0, this._time = void 0, this._texture = void 0, this._viewportHeight = 0 }; return d.prototype.update = function(e, t, r) { if (!i(this._time)) return this._lastFpsSampleTime = this._time = Date.now(), void 0; var n = this._time,
l = this._time = Date.now(),
u = l - n;
this._frameTimeSamples[this._frameTimeIndex++] = u, this._frameTimeIndex >= this._bufferLength && (this._frameTimeIndex = 0), this._frameCount++; var c = this._fps,
h = l - this._lastFpsSampleTime;
h > 1e3 && (c = this._fps = 0 | 1e3 * this._frameCount / h, this._fpsSamples[this._fpsIndex++] = c, this._fpsIndex >= this._bufferLength && (this._fpsIndex = 0), this._lastFpsSampleTime = l, this._frameCount = 0); var d = this._canvasContext,
m = this._rectangle.width,
p = this._rectangle.height;
d.clearRect(0, 0, m, p), d.fillStyle = this._backgroundColor, d.fillRect(0, 0, m, p), i(c) && (d.fillStyle = this._fpsColor, d.textAlign = "left", d.fillText(c + " FPS", 1, 10)), d.fillStyle = this._frameTimeColor, d.textAlign = "right", d.fillText(u + " MS", m - 1, 10); for (var f = 0; f < this._bufferLength; f++) c = this._fpsSamples[(f + this._fpsIndex) % this._bufferLength], c > 0 && this._drawLine(this._fpsColor, f, c / 100), u = this._frameTimeSamples[(f + this._frameTimeIndex) % this._bufferLength], u > 0 && this._drawLine(this._frameTimeColor, f, u / 200);
i(this._quad) || (this._quad = new s(void 0, a.fromType(e, a.ImageType))), i(this._texture) ? this._texture.copyFrom(this._canvas) : (this._texture = e.createTexture2D({ source: this._canvas, pixelFormat: o.RGBA }), this._quad.material.uniforms.image = this._texture); var v = e.getCanvas().clientHeight; if (v !== this._viewportHeight) { this._viewportHeight = v; var y = this._quad.rectangle;
y.x = this._rectangle.x, y.y = v - p - this._rectangle.y, y.width = m, y.height = p } this._quad.update(e, t, r) }, d.prototype._drawLine = function(e, t, r) { var i = this._canvasContext,
n = this._rectangle.height,
o = n - 10;
t = .5 + t, i.beginPath(), i.strokeStyle = e, i.moveTo(t, n); var a = r * o;
a > o && (a = o); var s = n - a;
i.lineTo(t, s), i.stroke() }, d.prototype.destroy = function() { return this._quad = this._quad.destroy(), n(this) }, d }), r("Scene/RectangularPyramidSensorVolume", ["../Core/clone", "../Core/Color", "../Core/defaultValue", "../Core/defined", "../Core/destroyObject", "../Core/DeveloperError", "../Core/Math", "../Core/Matrix4", "../Renderer/BufferUsage", "./Material", "./CustomSensorVolume"], function(e, t, r, i, n, o, a, s, l, u, c) { "use strict"; var h = function(n) { n = r(n, r.EMPTY_OBJECT), this.show = r(n.show, !0), this.showIntersection = r(n.showIntersection, !0), this.showThroughEllipsoid = r(n.showThroughEllipsoid, !1), this.modelMatrix = s.clone(r(n.modelMatrix, s.IDENTITY)), this.bufferUsage = r(n.bufferUsage, l.STATIC_DRAW), this.radius = r(n.radius, Number.POSITIVE_INFINITY), this.xHalfAngle = r(n.xHalfAngle, a.PI_OVER_TWO), this._xHalfAngle = void 0, this.yHalfAngle = r(n.yHalfAngle, a.PI_OVER_TWO), this._yHalfAngle = void 0, this.material = i(n.material) ? n.material : u.fromType(void 0, u.ColorType), this.intersectionColor = t.clone(r(n.intersectionColor, t.WHITE)), this.intersectionWidth = r(n.intersectionWidth, 5); var o = e(n);
o._pickIdThis = r(n._pickIdThis, this), this._customSensor = new c(o) }; return h.prototype.update = function(e, t, r) { if (this.xHalfAngle > a.PI_OVER_TWO || this.yHalfAngle > a.PI_OVER_TWO) throw new o("this.xHalfAngle and this.yHalfAngle must each be less than or equal to 90 degrees."); var i = this._customSensor; if (i.show = this.show, i.showIntersection = this.showIntersection, i.showThroughEllipsoid = this.showThroughEllipsoid, i.modelMatrix = this.modelMatrix, i.bufferUsage = this.bufferUsage, i.radius = this.radius, i.material = this.material, i.intersectionColor = this.intersectionColor, i.intersectionWidth = this.intersectionWidth, this._xHalfAngle !== this.xHalfAngle || this._yHalfAngle !== this.yHalfAngle) { this._xHalfAngle = this.xHalfAngle, this._yHalfAngle = this.yHalfAngle; var n = Math.tan(Math.min(this.xHalfAngle, a.toRadians(89))),
s = Math.tan(Math.min(this.yHalfAngle, a.toRadians(89))),
l = Math.atan(n / s),
u = Math.atan(Math.sqrt(n * n + s * s));
i.setDirections([{ clock: l, cone: u }, { clock: a.toRadians(180) - l, cone: u }, { clock: a.toRadians(180) + l, cone: u }, { clock: -l, cone: u }]) } i.update(e, t, r) }, h.prototype.isDestroyed = function() { return !1 }, h.prototype.destroy = function() { return this._customSensor = this._customSensor && this._customSensor.destroy(), n(this) }, h }), r("Scene/ScreenSpaceCameraController", ["../Core/defined", "../Core/destroyObject", "../Core/Cartesian2", "../Core/Cartesian3", "../Core/Cartesian4", "../Core/Cartographic", "../Core/DeveloperError", "../Core/Ellipsoid", "../Core/KeyboardEventModifier", "../Core/FAR", "../Core/IntersectionTests", "../Core/Math", "../Core/Matrix4", "../Core/Ray", "../Core/Transforms", "./AnimationCollection", "./CameraEventAggregator", "./CameraEventType", "./CameraColumbusViewMode", "./SceneMode"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _) {
"use strict";
function w(e, t) { if (0 > e) return 0; var r = 25 * (1 - t); return Math.exp(-r * e) }
function C(e) { return e.startPosition.equalsEpsilon(e.endPosition, h.EPSILON14) }
function x(t, i, n, o, a) { var s = t.getButtonPressTime(),
l = t.getButtonReleaseTime(),
u = s && l && (l.getTime() - s.getTime()) / 1e3,
c = new Date,
h = l && (c.getTime() - l.getTime()) / 1e3; if (s && l && k > u) { var d = w(h, i); if (e(o[a])) o[a] = { startPosition: o[a].endPosition.clone(), endPosition: new r(o[a].endPosition.x + o[a].motion.x * d, o[a].endPosition.y + o[a].motion.y * d), motion: new r };
else { var m = t.getLastMovement(); if (!m || C(m)) return; var p = .5 * (m.endPosition.x - m.startPosition.x),
f = .5 * (m.endPosition.y - m.startPosition.y);
o[a] = { startPosition: new r(m.startPosition.x, m.startPosition.y), endPosition: new r(m.startPosition.x + p * d, m.startPosition.y + f * d), motion: new r(p, f) } } if (isNaN(o[a].endPosition.x) || isNaN(o[a].endPosition.y) || C(o[a])) return o[a] = void 0, void 0;
t.isButtonDown() || n(o, o[a]) } else o[a] = void 0 }
function S(t, r, i, n, o) { var a = 1;
e(o) && (a = h.clamp(Math.abs(o), .25, 1)); var s = t.minimumZoomDistance * a,
l = t.maximumZoomDistance,
u = n - s,
c = i * u;
c = h.clamp(c, t._minimumZoomRate, t._maximumZoomRate); var d = r.endPosition.y - r.startPosition.y,
m = d / t._canvas.clientHeight;
m = Math.min(m, t.maximumMovementRatio); var p = c * m;
p > 0 && Math.abs(n - s) < 1 || 0 > p && Math.abs(n - l) < 1 || (s > n - p ? p = n - s - 1 : n - p > l && (p = n - l), t._cameraController.zoomIn(p)) }
function E(e, t) { var r = e._cameraController,
i = r.getPickRay(t.startPosition, U).origin,
n = r.getPickRay(t.endPosition, W).origin;
r.moveRight(i.x - n.x), r.moveUp(i.y - n.y) }
function b(e, t) { S(e, t, e._zoomFactor, e._cameraController.getMagnitude()) }
function T(e, t) { var i = e._canvas.clientWidth,
n = e._canvas.clientHeight,
o = G;
o.x = 2 / i * t.startPosition.x - 1, o.y = 2 / n * (n - t.startPosition.y) - 1, r.normalize(o, o); var a = H;
a.x = 2 / i * t.endPosition.x - 1, a.y = 2 / n * (n - t.endPosition.y) - 1, r.normalize(a, a); var s = Math.acos(o.x);
o.y < 0 && (s = h.TWO_PI - s); var l = Math.acos(a.x);
a.y < 0 && (l = h.TWO_PI - l); var u = l - s;
e._cameraController.twistRight(u) }
function A(e, t) { var r = e._rotateFactor * e._rotateRateRangeAdjustment;
r > e._maximumRotateRate && (r = e._maximumRotateRate), r < e._minimumRotateRate && (r = e._minimumRotateRate); var i = (t.endPosition.x - t.startPosition.x) / e._canvas.clientWidth;
i = Math.min(i, e.maximumMovementRatio); var n = 4 * r * i * Math.PI;
e._cameraController.twistRight(n) }
function M(t) { var r = t._translateHandler,
i = t._zoomHandler,
n = t._zoomWheelHandler,
o = t._pinchHandler,
a = r.isMoving() && r.getMovement(),
s = i.isMoving() && i.getMovement(),
l = n.isMoving() && n.getMovement(),
u = o.isMoving() && o.getMovement(); if ((r.isButtonDown() || i.isButtonDown() || l) && t._animationCollection.removeAll(), t.enableTranslate && (a && E(t, r.getMovement()), !a && t.inertiaTranslate < 1 && x(r, t.inertiaTranslate, E, t, "_lastInertiaTranslateMovement")), t.enableZoom && (s ? b(t, i.getMovement()) : l ? b(t, n.getMovement()) : u && b(t, o.getMovement().distance), !s && t.inertiaZoom < 1 && x(i, t.inertiaZoom, b, t, "_lastInertiaZoomMovement"), !l && t.inertiaZoom < 1 && x(n, t.inertiaZoom, b, t, "_lastInertiaWheelZoomMovement"), !u && t.inertiaZoom < 1 && x(o, t.inertiaZoom, b, t, "_lastInertiaZoomMovement")), t.enableRotate && (t._rotateHandler.isMoving() && T(t, t._rotateHandler.getMovement()), u && A(t, o.getMovement().angleAndHeight)), !(r.isButtonDown() || i.isButtonDown() || t._lastInertiaZoomMovement || t._lastInertiaTranslateMovement || t._animationCollection.contains(t._animation))) { var c = t._cameraController.createCorrectPositionAnimation(t.bounceAnimationTime);
e(c) && (t._animation = t._animationCollection.add(c)) } return t._animationCollection.update(), !0 }
function P(e, t) { var r = e._cameraController,
n = r.getPickRay(t.startPosition, j),
o = r.getPickRay(t.endPosition, Y),
a = i.UNIT_X,
s = n.origin,
l = n.direction,
u = -a.dot(s) / a.dot(l),
c = i.multiplyByScalar(l, u, X);
i.add(s, c, c), s = o.origin, l = o.direction, u = -a.dot(s) / a.dot(l); var d = i.multiplyByScalar(l, u, Z);
i.add(s, d, d); var m = i.subtract(c, d, K),
p = m.x;
m.x = m.y, m.y = m.z, m.z = p; var f = m.magnitude();
f > h.EPSILON6 && (i.normalize(m, m), r.move(m, f)) }
function D(e, t) { var r = J;
r.x = e._canvas.clientWidth / 2, r.y = e._canvas.clientHeight / 2; var n = e._cameraController.getPickRay(r, Q),
o = i.UNIT_X,
a = n.origin,
l = n.direction,
u = -o.dot(a) / o.dot(l),
c = i.multiplyByScalar(l, u, $);
i.add(a, c, c); var h = d.fromTranslation(c, et),
m = e._ellipsoid;
e.setEllipsoid(s.UNIT_SPHERE), L(e, t, h, i.UNIT_Z), e.setEllipsoid(m) }
function I(e, t) { var r = tt;
r.x = e._canvas.clientWidth / 2, r.y = e._canvas.clientHeight / 2; var n = e._cameraController.getPickRay(r, rt),
o = i.UNIT_X,
a = n.origin,
s = n.direction,
l = -o.dot(a) / o.dot(s);
S(e, t, e._zoomFactor, l) }
function O(t) { var r = t._zoomHandler,
i = r.isMoving() && r.getMovement(),
n = t._zoomWheelHandler,
o = n.isMoving() && n.getMovement(),
a = t._pinchHandler,
s = a.isMoving() && a.getMovement(),
l = t._translateHandler,
u = l.isMoving() && l.getMovement(),
c = t._rotateHandler,
h = c.isMoving() && c.getMovement(),
d = t._spinHandler,
m = d.isMoving() && d.getMovement(),
p = t._lookHandler,
f = p.isMoving() && p.getMovement(),
v = c.isButtonDown() || d.isButtonDown() || l.isButtonDown() || r.isButtonDown() || f || o || s; if (t.columbusViewMode === g.LOCKED) t.enableRotate && (m && L(t, d.getMovement()), !v && t.inertiaSpin >= 0 && t.inertiaSpin < 1 && x(d, t.inertiaSpin, L, t, "_lastInertiaSpinMovement")), t.enableZoom && (i ? N(t, r.getMovement()) : o ? N(t, n.getMovement()) : s && N(t, a.getMovement().distance), !v && t.inertiaZoom >= 0 && t.inertiaZoom < 1 && x(r, t.inertiaZoom, N, t, "_lastInertiaZoomMovement"), !v && t.inertiaZoom >= 0 && t.inertiaZoom < 1 && x(n, t.inertiaZoom, N, t, "_lastInertiaWheelZoomMovement"), !v && t.inertiaZoom >= 0 && t.inertiaZoom < 1 && x(a, t.inertiaZoom, N, t, "_lastInertiaZoomMovement"));
else { if (v && t._animationCollection.removeAll(), t.enableTilt && (h && D(t, c.getMovement()), s && D(t, a.getMovement().angleAndHeight), !v && t.inertiaSpin >= 0 && t.inertiaSpin < 1 && x(c, t.inertiaSpin, D, t, "_lastInertiaTiltMovement"), !v && t.inertiaZoom >= 0 && t.inertiaZoom < 1 && x(a, t.inertiaZoom, I, t, "_lastInertiaZoomMovement")), t.enableTranslate && (u && P(t, l.getMovement()), !v && t.inertiaTranslate >= 0 && t.inertiaTranslate < 1 && x(l, t.inertiaTranslate, P, t, "_lastInertiaTranslateMovement")), t.enableZoom && (i ? I(t, r.getMovement()) : o ? I(t, n.getMovement()) : s && I(t, a.getMovement().distance), !v && t.inertiaZoom >= 0 && t.inertiaZoom < 1 && x(r, t.inertiaZoom, I, t, "_lastInertiaZoomMovement"), !v && t.inertiaZoom >= 0 && t.inertiaZoom < 1 && x(n, t.inertiaZoom, I, t, "_lastInertiaWheelZoomMovement"), !v && t.inertiaZoom >= 0 && t.inertiaZoom < 1 && x(a, t.inertiaZoom, I, t, "_lastInertiaZoomMovement")), t.enableLook && f && B(t, p.getMovement()), !(v || t._lastInertiaZoomMovement || t._lastInertiaTranslateMovement || t._animationCollection.contains(t._animation))) { var y = t._cameraController.createCorrectPositionAnimation(t.bounceAnimationTime);
e(y) && (t._animation = t._animationCollection.add(y)) } t._animationCollection.update() } return !0 }
function R(t, r) { e(t._cameraController.pickEllipsoid(r.startPosition, t._ellipsoid, it)) ? z(t, r) : L(t, r) }
function L(t, r, n, o, a) { var s = t._cameraController,
l = s.constrainedAxis;
e(o) && (s.constrainedAxis = o); var u = s._camera.position.magnitude(),
c = t._rotateFactor * (u - t._rotateRateRangeAdjustment);
c > t._maximumRotateRate && (c = t._maximumRotateRate), c < t._minimumRotateRate && (c = t._minimumRotateRate); var m = (r.startPosition.x - r.endPosition.x) / t._canvas.clientWidth,
p = (r.startPosition.y - r.endPosition.y) / t._canvas.clientHeight;
m = Math.min(m, t.maximumMovementRatio), p = Math.min(p, t.maximumMovementRatio); var f = 2 * c * m * Math.PI,
v = c * p * Math.PI; if (e(s.constrainedAxis) && !e(n)) { var y = s._camera,
g = y.position.normalize(),
_ = g.equalsEpsilon(s.constrainedAxis, h.EPSILON2),
w = g.equalsEpsilon(s.constrainedAxis.negate(), h.EPSILON2); if (!_ && !w) { var C;
C = i.dot(y.position, y.direction) + 1 < h.EPSILON4 ? y.up : y.direction; var x;
x = i.equalsEpsilon(s.constrainedAxis, y.position.normalize(), h.EPSILON2) ? y.right : i.cross(s.constrainedAxis, y.position).normalize(); var S = i.dot(y.right, x),
E = h.sign(S) < 0 ? -1 : 1;
S = Math.abs(S); var b = i.dot(C, s.constrainedAxis),
T = i.dot(C, x),
A = b > 0 && T > 0 || 0 > b && 0 > T ? -1 : 1;
b = Math.abs(b); var M = v;
v = E * (v * b - A * f * (1 - S)), f = E * (f * S + A * M * (1 - b)) } } if (s.rotateRight(f, n), s.rotateUp(v, n), e(a)) { var P = i.clone(s._camera.getDirectionWC(), nt),
D = n.inverseTransformation();
d.multiplyByVector(D, P, P); var I = -i.dot(P, o),
O = Math.acos(I);
O > a && (O -= a, s.rotateUp(-O, n)) } s.constrainedAxis = l }
function z(t, r) { var n = t._cameraController,
o = n.pickEllipsoid(r.startPosition, t._ellipsoid, ot),
a = n.pickEllipsoid(r.endPosition, t._ellipsoid, at); if (e(o) && e(a))
if (o = n._camera.worldToCameraCoordinates(o, o), a = n._camera.worldToCameraCoordinates(a, a), e(n.constrainedAxis)) { var s = n.constrainedAxis,
l = i.mostOrthogonalAxis(s, st);
i.cross(l, s, l), i.normalize(l, l); var u = i.cross(s, l, lt),
c = i.magnitude(o),
d = i.dot(s, o),
m = Math.acos(d / c),
p = i.multiplyByScalar(s, d, ut);
i.subtract(o, p, p), i.normalize(p, p); var f = i.magnitude(a),
v = i.dot(s, a),
y = Math.acos(v / f),
g = i.multiplyByScalar(s, v, ct);
i.subtract(a, g, g), i.normalize(g, g); var _ = Math.acos(i.dot(p, l));
i.dot(p, u) < 0 && (_ = h.TWO_PI - _); var w = Math.acos(i.dot(g, l));
i.dot(g, u) < 0 && (w = h.TWO_PI - w); var C, x = _ - w;
C = i.equalsEpsilon(s, n._camera.position, h.EPSILON2) ? n._camera.right : i.cross(s, n._camera.position); var S, E = i.cross(s, C, st),
b = i.dot(E, i.subtract(o, s, lt)),
T = i.dot(E, i.subtract(a, s, lt));
S = b > 0 && T > 0 ? y - m : b > 0 && 0 >= T ? i.dot(n._camera.position, s) > 0 ? -m - y : m + y : m - y, n.rotateRight(x), n.rotateUp(S) } else { i.normalize(o, o), i.normalize(a, a); var A = i.dot(o, a),
M = i.cross(o, a, st); if (1 > A && !M.equalsEpsilon(i.ZERO, h.EPSILON14)) { var P = Math.acos(A);
n.rotate(M, P) } } }
function N(e, t) { var r = e._cameraController._camera,
n = e._ellipsoid,
o = n.cartesianToCartographic(r.position).height,
a = i.normalize(r.position, ht);
S(e, t, e._zoomFactor, o, i.dot(a, r.direction)) }
function F(t, r) { var n = t._cameraController,
o = t._ellipsoid,
a = .25 * t.minimumZoomDistance,
l = o.cartesianToCartographic(t._cameraController._camera.position).height; if (!(l - a - 1 < h.EPSILON3 && r.endPosition.y - r.startPosition.y < 0)) { var u = dt;
u.x = t._canvas.clientWidth / 2, u.y = t._canvas.clientHeight / 2; var d, m = n.getPickRay(u, mt),
f = c.rayEllipsoid(m, o); if (e(f)) d = m.getPoint(f.start, ft);
else { var v = c.grazingAltitudeLocation(m, o); if (!e(v)) return; var y = o.cartesianToCartographic(v, pt);
y.height = 0, d = o.cartographicToCartesian(y, ft) } var g = n._camera;
d = g.worldToCameraCoordinates(d, d); var _ = p.eastNorthUpToFixedFrame(d, o, vt),
w = t._ellipsoid;
t.setEllipsoid(s.UNIT_SPHERE); var C = .25 * a / i.subtract(d, g.position).magnitude();
L(t, r, _, i.UNIT_Z, h.PI_OVER_TWO - C), t.setEllipsoid(w) } }
function B(t, r) { var i = t._cameraController,
n = yt;
n.x = r.startPosition.x, n.y = 0; var o = gt;
o.x = r.endPosition.x, o.y = 0; var a = i.getPickRay(n, _t).direction,
s = i.getPickRay(o, wt).direction,
l = 0,
u = a.dot(s);
1 > u && (l = Math.acos(u)), l = r.startPosition.x > r.endPosition.x ? -l : l; var c = t._horizontalRotationAxis;
e(c) ? i.look(c, l) : i.lookLeft(l), n.x = 0, n.y = r.startPosition.y, o.x = 0, o.y = r.endPosition.y, a = i.getPickRay(n, _t).direction, s = i.getPickRay(o, wt).direction, l = 0, u = a.dot(s), 1 > u && (l = Math.acos(u)), l = r.startPosition.y > r.endPosition.y ? -l : l, i.lookUp(l) }
function V(e) { var t = e._spinHandler,
r = e._zoomHandler,
i = e._zoomWheelHandler,
n = e._pinchHandler,
o = t.isMoving() && t.getMovement(),
a = r.isMoving() && r.getMovement(),
s = i.isMoving() && i.getMovement(),
l = n.isMoving() && n.getMovement(),
u = e._rotateHandler,
c = u.isMoving() && u.getMovement(),
h = e._lookHandler,
d = h.isMoving() && h.getMovement(),
m = t.isButtonDown() || r.isButtonDown() || u.isButtonDown() || d || s || l; return e.enableRotate && (o && R(e, t.getMovement()), !m && e.inertiaSpin >= 0 && e.inertiaSpin < 1 && x(t, e.inertiaSpin, R, e, "_lastInertiaSpinMovement")), e.enableTilt && (c && F(e, u.getMovement()), l && F(e, n.getMovement().angleAndHeight), !m && e.inertiaSpin >= 0 && e.inertiaSpin < 1 && x(u, e.inertiaSpin, F, e, "_lastInertiaTiltMovement"), !m && e.inertiaSpin >= 0 && e.inertiaSpin < 1 && x(n, e.inertiaSpin, F, e, "_lastInertiaTiltMovement")), e.enableZoom && (a ? N(e, r.getMovement()) : s ? N(e, i.getMovement()) : l && N(e, n.getMovement().distance), !m && e.inertiaZoom >= 0 && e.inertiaZoom < 1 && x(r, e.inertiaZoom, N, e, "_lastInertiaZoomMovement"), !m && e.inertiaZoom >= 0 && e.inertiaZoom < 1 && x(i, e.inertiaZoom, N, e, "_lastInertiaWheelZoomMovement"), !m && e.inertiaZoom >= 0 && e.inertiaZoom < 1 && x(n, e.inertiaZoom, N, e, "_lastInertiaZoomMovement")), e.enableLook && d && B(e, h.getMovement()), !0 }
var q = function(t, r) { if (!e(t)) throw new a("canvas is required."); if (!e(r)) throw new a("cameraController is required.");
this.enableTranslate = !0, this.enableZoom = !0, this.enableRotate = !0, this.enableTilt = !0, this.enableLook = !0, this.inertiaSpin = .9, this.inertiaTranslate = .9, this.inertiaZoom = .8, this.maximumMovementRatio = .1, this.columbusViewMode = g.FREE, this.bounceAnimationTime = 3e3, this.minimumZoomDistance = 20, this.maximumZoomDistance = Number.POSITIVE_INFINITY, this._canvas = t, this._cameraController = r, this._ellipsoid = s.WGS84, this._spinHandler = new v(t, y.LEFT_DRAG), this._translateHandler = new v(t, y.LEFT_DRAG), this._lookHandler = new v(t, y.LEFT_DRAG, l.SHIFT), this._rotateHandler = new v(t, y.MIDDLE_DRAG), this._zoomHandler = new v(t, y.RIGHT_DRAG), this._zoomWheelHandler = new v(t, y.WHEEL), this._pinchHandler = new v(t, y.PINCH), this._lastInertiaSpinMovement = void 0, this._lastInertiaZoomMovement = void 0, this._lastInertiaTranslateMovement = void 0, this._lastInertiaWheelZoomMovement = void 0, this._lastInertiaTiltMovement = void 0, this._animationCollection = new f, this._animation = void 0, this._horizontalRotationAxis = void 0; var i = this._ellipsoid.getMaximumRadius();
this._zoomFactor = 5, this._rotateFactor = 1 / i, this._rotateRateRangeAdjustment = i, this._maximumRotateRate = 1.77, this._minimumRotateRate = 2e-4, this._translateFactor = 1, this._minimumZoomRate = 20, this._maximumZoomRate = u };
q.prototype.getEllipsoid = function() { return this._ellipsoid }, q.prototype.setEllipsoid = function(e) {
e = e || s.WGS84;
var t = e.getMaximumRadius();
this._ellipsoid = e, this._rotateFactor = 1 / t, this._rotateRateRangeAdjustment = t
};
var k = .4,
U = new m,
W = new m,
G = new r,
H = new r,
j = new m,
Y = new m,
X = new i,
Z = new i,
K = new i,
J = new r,
Q = new m,
$ = new i,
et = new d,
tt = new r,
rt = new m,
it = new i,
nt = n.ZERO.clone(),
ot = n.UNIT_W.clone(),
at = n.UNIT_W.clone(),
st = new i,
lt = new i,
ut = new i,
ct = new i,
ht = new i,
dt = new r,
mt = new m,
pt = new o,
ft = n.UNIT_W.clone(),
vt = new d,
yt = new r,
gt = new r,
_t = new m,
wt = new m;
return q.prototype.update = function(e) { e === _.SCENE2D ? M(this) : e === _.COLUMBUS_VIEW ? (this._horizontalRotationAxis = i.UNIT_Z, O(this)) : e === _.SCENE3D && (this._horizontalRotationAxis = void 0, V(this)) }, q.prototype.isDestroyed = function() { return !1 }, q.prototype.destroy = function() { return this._spinHandler = this._spinHandler && this._spinHandler.destroy(), this._translateHandler = this._translateHandler && this._translateHandler.destroy(), this._lookHandler = this._lookHandler && this._lookHandler.destroy(), this._rotateHandler = this._rotateHandler && this._rotateHandler.destroy(), this._zoomHandler = this._zoomHandler && this._zoomHandler.destroy(), this._zoomWheelHandler = this._zoomWheelHandler && this._zoomWheelHandler.destroy(), this._pinchHandler = this._pinchHandler && this._pinchHandler.destroy(), t(this) }, q
}), r("Shaders/PostProcessFilters/AdditiveBlend", [], function() { "use strict"; return "uniform sampler2D u_texture0;\nuniform sampler2D u_texture1;\nuniform vec2 u_center;\nuniform float u_radius;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color0 = texture2D(u_texture0, v_textureCoordinates);\nvec4 color1 = texture2D(u_texture1, v_textureCoordinates);\nfloat x = length(gl_FragCoord.xy - u_center) / u_radius;\nfloat t = smoothstep(0.5, 0.8, x);\ngl_FragColor = mix(color0 + color1, color0, t);\n}\n" }), r("Shaders/PostProcessFilters/BrightPass", [], function() { "use strict"; return "uniform sampler2D u_texture;\nuniform float u_avgLuminance;\nuniform float u_threshold;\nuniform float u_offset;\nvarying vec2 v_textureCoordinates;\nfloat key(float avg)\n{\nfloat guess = 1.5 - (1.5 / (avg * 0.1 + 1.0));\nreturn max(0.0, guess) + 0.1;\n}\nvoid main()\n{\nvec4 color = texture2D(u_texture, v_textureCoordinates);\nvec3 xyz = czm_RGBToXYZ(color.rgb);\nfloat luminance = xyz.r;\nfloat scaledLum = key(u_avgLuminance) * luminance / u_avgLuminance;\nfloat brightLum = max(scaledLum - u_threshold, 0.0);\nfloat brightness = brightLum / (u_offset + brightLum);\nxyz.r = brightness;\ngl_FragColor = vec4(czm_XYZToRGB(xyz), 1.0);\n}\n" }), r("Shaders/PostProcessFilters/GaussianBlur1D", [], function() { "use strict"; return "#define SAMPLES 8\nuniform float delta;\nuniform float sigma;\nuniform float direction;\nuniform sampler2D u_texture;\nuniform vec2 u_step;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec2 st = v_textureCoordinates;\nvec2 dir = vec2(1.0 - direction, direction);\nvec3 g;\ng.x = 1.0 / (sqrt(czm_twoPi) * sigma);\ng.y = exp((-0.5 * delta * delta) / (sigma * sigma));\ng.z = g.y * g.y;\nvec4 result = texture2D(u_texture, st) * g.x;\nfor (int i = 1; i < SAMPLES; ++i)\n{\ng.xy *= g.yz;\nvec2 offset = float(i) * dir * u_step;\nresult += texture2D(u_texture, st - offset) * g.x;\nresult += texture2D(u_texture, st + offset) * g.x;\n}\ngl_FragColor = result;\n}\n" }), r("Shaders/PostProcessFilters/PassThrough", [], function() { "use strict"; return "uniform sampler2D u_texture;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\ngl_FragColor = texture2D(u_texture, v_textureCoordinates);\n}\n" }), r("Scene/SunPostProcess", ["../Core/BoundingRectangle", "../Core/Cartesian2", "../Core/Cartesian4", "../Core/Color", "../Core/ComponentDatatype", "../Core/defaultValue", "../Core/defined", "../Core/destroyObject", "../Core/Geometry", "../Core/GeometryAttribute", "../Core/Math", "../Core/Matrix4", "../Core/PrimitiveType", "../Core/Transforms", "../Renderer/BufferUsage", "../Renderer/ClearCommand", "../Renderer/DrawCommand", "../Renderer/PassState", "../Renderer/PixelDatatype", "../Renderer/PixelFormat", "../Renderer/RenderbufferFormat", "../Shaders/PostProcessFilters/AdditiveBlend", "../Shaders/PostProcessFilters/BrightPass", "../Shaders/PostProcessFilters/GaussianBlur1D", "../Shaders/PostProcessFilters/PassThrough", "../Shaders/ViewportQuadVS"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C, x, S, E, b) { "use strict";
function T(e) { var t = e.cache.viewportQuad_vertexArray; if (a(t)) return t; var r = new l({ attributes: { position: new u({ componentDatatype: n.FLOAT, componentsPerAttribute: 2, values: [-1, -1, 1, -1, 1, 1, -1, 1] }), textureCoordinates: new u({ componentDatatype: n.FLOAT, componentsPerAttribute: 2, values: [0, 0, 1, 0, 1, 1, 0, 1] }) }, primitiveType: d.TRIANGLES }); return t = e.createVertexArrayFromGeometry({ geometry: r, attributeIndices: M, bufferUsage: p.STATIC_DRAW }), e.cache.viewportQuad_vertexArray = t, t } var A = function() { this._fbo = void 0, this._downSampleFBO1 = void 0, this._downSampleFBO2 = void 0, this._clearFBO1Command = void 0, this._clearFBO2Command = void 0, this._downSampleCommand = void 0, this._brightPassCommand = void 0, this._blurXCommand = void 0, this._blurYCommand = void 0, this._blendCommand = void 0, this._fullScreenCommand = void 0, this._downSamplePassState = new y, this._downSamplePassState.scissorTest = { enable: !0, rectangle: new e }, this._upSamplePassState = new y, this._upSamplePassState.scissorTest = { enabled: !0, rectangle: new e }, this._uCenter = new t, this._uRadius = void 0 };
A.prototype.clear = function(e, t) { var r = this._clearFBO1Command;
i.clone(o(t, i.BLACK), r.color), r.execute(e), r = this._clearFBO2Command, i.clone(o(t, i.BLACK), r.color), r.execute(e) }, A.prototype.execute = function(e) { this._downSampleCommand.execute(e, this._downSamplePassState), this._brightPassCommand.execute(e, this._downSamplePassState), this._blurXCommand.execute(e, this._downSamplePassState), this._blurYCommand.execute(e, this._downSamplePassState), this._fullScreenCommand.execute(e), this._blendCommand.execute(e, this._upSamplePassState) }; var M = { position: 0, textureCoordinates: 1 },
P = new e,
D = new e,
I = new r,
O = new t,
R = new t,
L = new h; return A.prototype.update = function(e) { var r = e.getCanvas(),
n = r.clientWidth,
o = r.clientHeight,
s = this; if (!a(this._fbo)) { this._fbo = e.createFramebuffer(), this._downSampleFBO1 = e.createFramebuffer(), this._downSampleFBO2 = e.createFramebuffer(), this._clearFBO1Command = new f, this._clearFBO1Command.color = new i, this._clearFBO1Command.framebuffer = this._downSampleFBO1, this._clearFBO2Command = new f, this._clearFBO2Command.color = new i, this._clearFBO2Command.framebuffer = this._downSampleFBO2; var l = d.TRIANGLE_FAN,
u = T(e),
p = this._downSampleCommand = new v;
p.owner = this, p.primitiveType = l, p.vertexArray = u, p.shaderProgram = e.getShaderCache().getShaderProgram(b, E, M), p.uniformMap = {}, p.framebuffer = this._downSampleFBO1; var y = this._brightPassCommand = new v;
y.owner = this, y.primitiveType = l, y.vertexArray = u, y.shaderProgram = e.getShaderCache().getShaderProgram(b, x, M), y.uniformMap = { u_avgLuminance: function() { return .5 }, u_threshold: function() { return .25 }, u_offset: function() { return .1 } }, y.framebuffer = this._downSampleFBO2; var A = 1,
z = 2,
N = this._blurXCommand = new v;
N.owner = this, N.primitiveType = l, N.vertexArray = u, N.shaderProgram = e.getShaderCache().getShaderProgram(b, S, M), N.uniformMap = { delta: function() { return A }, sigma: function() { return z }, direction: function() { return 0 } }, N.framebuffer = this._downSampleFBO1; var F = this._blurYCommand = new v;
F.owner = this, F.primitiveType = l, F.vertexArray = u, F.shaderProgram = e.getShaderCache().getShaderProgram(b, S, M), F.uniformMap = { delta: function() { return A }, sigma: function() { return z }, direction: function() { return 1 } }, F.framebuffer = this._downSampleFBO2; var B = this._blendCommand = new v;
B.owner = this, B.primitiveType = l, B.vertexArray = u, B.shaderProgram = e.getShaderCache().getShaderProgram(b, C, M), B.uniformMap = { u_center: function() { return s._uCenter }, u_radius: function() { return s._uRadius } }; var V = this._fullScreenCommand = new v;
V.owner = this, V.primitiveType = l, V.vertexArray = u, V.shaderProgram = e.getShaderCache().getShaderProgram(b, E, M), V.uniformMap = {} } var q = Math.pow(2, Math.ceil(Math.log(n) / Math.log(2)) - 2),
k = Math.pow(2, Math.ceil(Math.log(o) / Math.log(2)) - 2),
U = Math.max(q, k),
W = P;
W.width = n, W.height = o; var G = D;
G.width = U, G.height = U; var H = this._fbo,
j = H.getColorTexture(); if (!a(j) || j.getWidth() !== n || j.getHeight() !== o) { H.setColorTexture(e.createTexture2D({ width: n, height: o })), e.getDepthTexture() ? H.setDepthTexture(e.createTexture2D({ width: n, height: o, pixelFormat: _.DEPTH_COMPONENT, pixelDatatype: g.UNSIGNED_SHORT })) : H.setDepthRenderbuffer(e.createRenderbuffer({ format: w.DEPTH_COMPONENT16 })), this._downSampleFBO1.setColorTexture(e.createTexture2D({ width: U, height: U })), this._downSampleFBO2.setColorTexture(e.createTexture2D({ width: U, height: U })); var Y = e.createRenderState({ viewport: G }),
X = e.createRenderState();
this._downSampleCommand.uniformMap.u_texture = function() { return H.getColorTexture() }, this._downSampleCommand.renderState = Y, this._brightPassCommand.uniformMap.u_texture = function() { return s._downSampleFBO1.getColorTexture() }, this._brightPassCommand.renderState = Y, this._blurXCommand.uniformMap.u_texture = function() { return s._downSampleFBO2.getColorTexture() }, this._blurXCommand.uniformMap.u_step = function() { return new t(1 / U, 1 / U) }, this._blurXCommand.renderState = Y, this._blurYCommand.uniformMap.u_texture = function() { return s._downSampleFBO1.getColorTexture() }, this._blurYCommand.uniformMap.u_step = function() { return new t(1 / U, 1 / U) }, this._blurYCommand.renderState = Y, this._blendCommand.uniformMap.u_texture0 = function() { return H.getColorTexture() }, this._blendCommand.uniformMap.u_texture1 = function() { return s._downSampleFBO2.getColorTexture() }, this._blendCommand.renderState = X, this._fullScreenCommand.uniformMap.u_texture = function() { return H.getColorTexture() }, this._fullScreenCommand.renderState = X } var Z = e.getUniformState(),
K = Z.getSunPositionWC(),
J = Z.getView(),
Q = Z.getViewProjection(),
$ = Z.getProjection(),
et = h.computeViewportTransformation(W, 0, 1, L),
tt = h.multiplyByPoint(J, K, I),
rt = m.pointToWindowCoordinates(Q, et, K, O);
tt.x += c.SOLAR_RADIUS; var it = m.pointToWindowCoordinates($, et, tt, tt),
nt = 2 * 30 * t.magnitude(t.subtract(it, rt, it)),
ot = R;
ot.x = nt, ot.y = nt; var at = this._upSamplePassState.scissorTest.rectangle; return at.x = Math.max(rt.x - .5 * ot.x, 0), at.y = Math.max(rt.y - .5 * ot.y, 0), at.width = Math.min(ot.x, n), at.height = Math.min(ot.y, o), t.clone(rt, this._uCenter), this._uRadius = .5 * Math.max(ot.x, ot.y), et = h.computeViewportTransformation(G, 0, 1, L), rt = m.pointToWindowCoordinates(Q, et, K, O), ot.x *= q / n, ot.y *= k / o, at = this._downSamplePassState.scissorTest.rectangle, at.x = Math.max(rt.x - .5 * ot.x, 0), at.y = Math.max(rt.y - .5 * ot.y, 0), at.width = Math.min(ot.x, n), at.height = Math.min(ot.y, o), this._downSamplePassState.context = e, this._upSamplePassState.context = e, this._fbo }, A.prototype.isDestroyed = function() { return !1 }, A.prototype.destroy = function() { return this._fbo = this._fbo && this._fbo.destroy(), this._downSampleFBO1 = this._downSampleFBO1 && this._downSampleFBO1.destroy(), this._downSampleFBO2 = this._downSampleFBO2 && this._downSampleFBO2.destroy(), this._downSampleCommand = this._downSampleCommand && this._downSampleCommand.shaderProgram && this._downSampleCommand.shaderProgram.release(), this._brightPassCommand = this._brightPassCommand && this._brightPassCommand.shaderProgram && this._brightPassCommand.shaderProgram.release(), this._blurXCommand = this._blurXCommand && this._blurXCommand.shaderProgram && this._blurXCommand.shaderProgram.release(), this._blurYCommand = this._blurYCommand && this._blurYCommand.shaderProgram && this._blurYCommand.shaderProgram.release(), this._blendCommand = this._blendCommand && this._blendCommand.shaderProgram && this._blendCommand.shaderProgram.release(), this._fullScreenCommand = this._fullScreenCommand && this._fullScreenCommand.shaderProgram && this._fullScreenCommand.shaderProgram.release(), s(this) }, A }), r("Scene/Scene", ["../Core/Math", "../Core/Color", "../Core/defaultValue", "../Core/defined", "../Core/destroyObject", "../Core/GeographicProjection", "../Core/Ellipsoid", "../Core/Occluder", "../Core/BoundingRectangle", "../Core/BoundingSphere", "../Core/Cartesian2", "../Core/Cartesian3", "../Core/Intersect", "../Core/Interval", "../Core/Matrix4", "../Core/JulianDate", "../Core/EllipsoidGeometry", "../Core/GeometryInstance", "../Core/GeometryPipeline", "../Core/ColorGeometryInstanceAttribute", "../Renderer/Context", "../Renderer/ClearCommand", "../Renderer/PassState", "./Camera", "./ScreenSpaceCameraController", "./CompositePrimitive", "./CullingVolume", "./AnimationCollection", "./SceneMode", "./FrameState", "./OrthographicFrustum", "./PerspectiveOffCenterFrustum", "./FrustumCommands", "./Primitive", "./PerInstanceColorAppearance", "./SunPostProcess", "./CreditDisplay"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C, x, S, E, b, T, A, M, P, D, I, O, R, L, z, N) { "use strict";
function F(e) { e.color = !1, e.pick = !1, e.overlay = !1 }
function B(e, t, r) { var n = e._camera,
o = e._frameState;
o.mode = e.mode, o.morphTime = e.morphTime, o.scene2D = e.scene2D, o.frameNumber = t, o.time = r, o.camera = n, o.cullingVolume = n.frustum.computeCullingVolume(n.getPositionWC(), n.getDirectionWC(), n.getUpWC()), o.occluder = void 0, o.canvasDimensions.x = e._canvas.clientWidth, o.canvasDimensions.y = e._canvas.clientHeight; var a = e._primitives.getCentralBody(); if (e.mode === M.SCENE3D && i(a)) { var l = a.getEllipsoid(),
c = new s(new u(h.ZERO, l.getMinimumRadius()), n.getPositionWC());
o.occluder = c } F(o.passes) }
function V(e, t, r, n, o) { o.length = n; for (var a = 0; n > a; ++a) { var s = Math.max(e, Math.pow(r, a) * e),
l = Math.min(t, r * s);
0 !== a && (s *= .99); var u = o[a];
i(u) ? (u.near = s, u.far = l) : u = o[a] = new O(s, l) } }
function q(e, t, r) { e.debugShowFrustums && (t.debugOverlappingFrustums = 0); for (var n = e._frustumCommandsList, o = n.length, a = 0; o > a; ++a) { var s = n[a],
l = s.near,
u = s.far; if (!(r.start > u)) { if (r.stop < l) break; if (s.commands[s.index++] = t, e.debugShowFrustums && (t.debugOverlappingFrustums |= 1 << a), t.executeInClosestFrustum) break } } if (e.debugShowFrustums) { var c = e.debugFrustumStatistics.commandsInFrustums;
c[t.debugOverlappingFrustums] = i(c[t.debugOverlappingFrustums]) ? c[t.debugOverlappingFrustums] + 1 : 1, ++e.debugFrustumStatistics.totalCommands } }
function k(e, t) { var n = e._commandList,
o = e._frameState.cullingVolume,
a = e._camera,
s = a.getDirectionWC(),
l = a.getPositionWC();
e.debugShowFrustums && (e.debugFrustumStatistics = { totalCommands: 0, commandsInFrustums: {} }); for (var u = e._frustumCommandsList, c = u.length, h = 0; c > h; ++h) u[h].index = 0; var m, f = Number.MAX_VALUE,
v = Number.MIN_VALUE,
y = !1;
e._frameState.mode === M.SCENE3D && (m = e._frameState.occluder); for (var g = Q.planes, _ = 0; 5 > _; ++_) g[_] = o.planes[_];
o = Q; for (var w = n.length, x = 0; w > x; ++x)
for (var S = n[x][t], E = S.length, b = 0; E > b; ++b) { var T = S[b],
A = T.boundingVolume; if (i(A)) { var P = r(T.modelMatrix, p.IDENTITY),
D = A.transform(P); if (T.cull && (o.getVisibility(D) === d.OUTSIDE || i(m) && !m.isBoundingSphereVisible(D))) continue;
$ = D.getPlaneDistances(l, s, $), f = Math.min(f, $.start), v = Math.max(v, $.stop) } else $.start = a.frustum.near, $.stop = a.frustum.far, y = !(T instanceof C);
q(e, T, $) } y ? (f = a.frustum.near, v = a.frustum.far) : (f = Math.min(Math.max(f, a.frustum.near), a.frustum.far), v = Math.max(Math.min(v, a.frustum.far), f)); var I = e.farToNearRatio,
O = Math.ceil(Math.log(v / f) / Math.log(I));
f !== Number.MAX_VALUE && (O !== c || 0 !== u.length && (f < u[0].near || v > u[c - 1].far)) && (V(f, v, I, O, u), k(e, t)) }
function U(e) { var t = e.shaderProgram.fragmentShaderSource,
r = t.replace(/void\s+main\s*\(\s*(?:void)?\s*\)/g, "void czm_frustumDebug_main()"),
i = 1 & e.debugOverlappingFrustums ? "1.0" : "0.0",
n = 2 & e.debugOverlappingFrustums ? "1.0" : "0.0",
o = 4 & e.debugOverlappingFrustums ? "1.0" : "0.0",
a = "void main() \n{ \n czm_frustumDebug_main(); \n gl_FragColor.rgb *= vec3(" + i + ", " + n + ", " + o + "); \n" + "}"; return r + "\n" + a }
function W(e, t, r) { if (i(e.shaderProgram)) { var n = e.shaderProgram,
o = {},
a = n.getVertexAttributes(); for (var s in a) a.hasOwnProperty(s) && (o[s] = a[s].index);
e.shaderProgram = t.getShaderCache().getShaderProgram(n.vertexShaderSource, U(e), o), e.execute(t, r), e.shaderProgram.release(), e.shaderProgram = n } }
function G(e, t, n, o) { if ((!i(t.debugCommandFilter) || t.debugCommandFilter(e)) && (t.debugShowFrustums ? W(e, n, o) : e.execute(n, o), e.debugShowBoundingVolume && i(e.boundingVolume))) { if (!i(t._debugSphere)) { var s = v.createGeometry(new v({ ellipsoid: a.UNIT_SPHERE, vertexFormat: L.FLAT_VERTEX_FORMAT }));
t._debugSphere = new R({ geometryInstances: new y({ geometry: g.toWireframe(s), attributes: { color: new _(1, 0, 0, 1) } }), appearance: new L({ flat: !0, translucent: !1 }), asynchronous: !1 }) } var l = p.multiplyByTranslation(r(e.modelMatrix, p.IDENTITY), e.boundingVolume.center);
t._debugSphere.modelMatrix = p.multiplyByUniformScale(p.fromTranslation(h.fromArray(l, 12)), e.boundingVolume.radius); var u = [];
t._debugSphere.update(n, t._frameState, u), u[0].colorList[0].execute(n, o) } }
function H(e, t) { for (var r = t.mode === M.SCENE3D ? t.occluder : void 0, n = t.cullingVolume, o = Q.planes, a = 0; 5 > a; ++a) o[a] = n.planes[a]; return n = Q, i(e) && (!i(e.boundingVolume) || !e.cull || n.getVisibility(e.boundingVolume) !== d.OUTSIDE && (!i(r) || r.isBoundingSphereVisible(e.boundingVolume))) }
function j(e, r, n) { var o = e._frameState,
a = e._camera,
s = a.frustum.clone(),
l = e._context,
u = l.getUniformState(),
c = o.passes.color && i(e.skyBox) ? e.skyBox.update(l, o) : void 0,
h = o.passes.color && i(e.skyAtmosphere) ? e.skyAtmosphere.update(l, o) : void 0,
d = o.passes.color && i(e.sun) ? e.sun.update(l, o) : void 0,
m = H(d, o);
m && (r.framebuffer = e._sunPostProcess.update(l)); var p = e._clearColorCommand;
t.clone(n, p.color), p.execute(l, r), m && e._sunPostProcess.clear(l, e.backgroundColor), s.near = a.frustum.near, s.far = a.frustum.far, u.updateFrustum(s), i(c) && G(c, e, l, r), i(h) && G(h, e, l, r), i(d) && m && (d.execute(l, r), e._sunPostProcess.execute(l), r.framebuffer = void 0); for (var f = e._clearDepthStencilCommand, v = e._frustumCommandsList, y = v.length, g = 0; y > g; ++g) { f.execute(l, r); var _ = y - g - 1,
w = v[_];
s.near = w.near, s.far = w.far, u.updateFrustum(s); for (var C = w.commands, x = w.index, S = 0; x > S; ++S) G(C[S], e, l, r) } }
function Y(e, t) { for (var r = e._context, i = e._commandList, n = i.length, o = 0; n > o; ++o)
for (var a = i[o].overlayList, s = a.length, l = 0; s > l; ++l) a[l].execute(r, t) }
function X(e, t) { var r = e._canvas,
i = e._camera,
n = i.frustum,
o = r.clientWidth,
a = r.clientHeight,
s = 2 / o * t.x - 1;
s *= .5 * (n.right - n.left); var l = 2 / a * (a - t.y) - 1;
l *= .5 * (n.top - n.bottom); var u = i.position;
u = new h(u.z, u.x, u.y), u.y += s, u.z += l; var d = n.getPixelSize(new c(o, a)),
m = et; return m.right = .5 * d.x, m.left = -m.right, m.top = .5 * d.y, m.bottom = -m.top, m.near = n.near, m.far = n.far, m.computeCullingVolume(u, i.getDirectionWC(), i.getUpWC()) }
function Z(e, t, r, i) { var n = e._canvas,
o = e._camera,
a = o.frustum,
s = a.near,
l = n.clientWidth,
u = n.clientHeight,
h = Math.tan(.5 * a.fovy),
d = a.aspectRatio * h,
m = 2 / l * t.x - 1,
p = 2 / u * (u - t.y) - 1,
f = m * s * d,
v = p * s * h,
y = a.getPixelSize(new c(l, u)),
g = .5 * y.x * r,
_ = .5 * y.y * i,
w = tt; return w.top = v + _, w.bottom = v - _, w.right = f + g, w.left = f - g, w.near = s, w.far = a.far, w.computeCullingVolume(o.getPositionWC(), o.getDirectionWC(), o.getUpWC()) }
function K(e, t, r, i) { return e.mode === M.SCENE2D ? X(e, t, r, i) : Z(e, t, r, i) } var J = function(e, r, n) { var s = new w(e, r);
i(n) || (n = document.createElement("div"), n.style.position = "absolute", n.style.bottom = "0", n.style["text-shadow"] = "0px 0px 2px #000000", n.style.color = "#ffffff", n.style["font-size"] = "10pt", n.style["padding-right"] = "5px", e.parentNode.appendChild(n)), this._frameState = new P(new N(n)), this._passState = new x(s), this._canvas = e, this._context = s, this._primitives = new b, this._pickFramebuffer = void 0, this._camera = new S(e), this._screenSpaceCameraController = new E(e, this._camera.controller), this._animations = new A, this._shaderFrameCount = 0, this._sunPostProcess = new z, this._commandList = [], this._frustumCommandsList = [], this._clearColorCommand = new C, this._clearColorCommand.color = new t, this._clearColorCommand.owner = !0; var l = new C;
l.depth = 1, l.stencil = 1, l.owner = this, this._clearDepthStencilCommand = l, this.skyBox = void 0, this.skyAtmosphere = void 0, this.sun = void 0, this.backgroundColor = t.BLACK.clone(), this.mode = M.SCENE3D, this.scene2D = { projection: new o(a.WGS84) }, this.morphTime = 1, this.farToNearRatio = 1e3, this.debugCommandFilter = void 0, this.debugShowFrustums = !1, this.debugFrustumStatistics = void 0, this._debugSphere = void 0; var u = this._camera.frustum.near,
c = this._camera.frustum.far,
h = Math.ceil(Math.log(c / u) / Math.log(this.farToNearRatio));
V(u, c, this.farToNearRatio, h, this._frustumCommandsList), B(this, 0, new f), this.initializeFrame() };
J.prototype.getCanvas = function() { return this._canvas }, J.prototype.getContext = function() { return this._context }, J.prototype.getPrimitives = function() { return this._primitives }, J.prototype.getCamera = function() { return this._camera }, J.prototype.getScreenSpaceCameraController = function() { return this._screenSpaceCameraController }, J.prototype.getUniformState = function() { return this._context.getUniformState() }, J.prototype.getFrameState = function() { return this._frameState }, J.prototype.getAnimations = function() { return this._animations }; var Q = new T,
$ = new m;
J.prototype.initializeFrame = function() { 120 === this._shaderFrameCount++ && (this._shaderFrameCount = 0, this._context.getShaderCache().destroyReleasedShaderPrograms()), this._animations.update(), this._camera.controller.update(this.mode, this.scene2D), this._screenSpaceCameraController.update(this.mode) }, J.prototype.render = function(n) { i(n) || (n = new f); var o = this.getUniformState(),
a = this._frameState,
s = e.incrementWrap(a.frameNumber, 15e6, 1);
B(this, s, n), a.passes.color = !0, a.passes.overlay = !0, a.creditDisplay.beginFrame(), o.update(a); var l = this._context;
this._commandList.length = 0, this._primitives.update(l, a, this._commandList), k(this, "colorList"); var u = this._passState;
j(this, u, r(this.backgroundColor, t.BLACK)), Y(this, u), a.creditDisplay.endFrame() }; var et = new D,
tt = new I,
rt = 3,
it = 3,
nt = new l(0, 0, rt, it),
ot = new t(0, 0, 0, 0); return J.prototype.pick = function(e) { var t = this._context,
r = this._primitives,
n = this._frameState;
i(this._pickFramebuffer) || (this._pickFramebuffer = t.createPickFramebuffer()), B(this, n.frameNumber, n.time), n.cullingVolume = K(this, e, rt, it), n.passes.pick = !0; var o = this._commandList; return o.length = 0, r.update(t, n, o), k(this, "pickList"), nt.x = e.x - .5 * (rt - 1), nt.y = this._canvas.clientHeight - e.y - .5 * (it - 1), j(this, this._pickFramebuffer.begin(nt), ot), this._pickFramebuffer.end(nt) }, J.prototype.isDestroyed = function() { return !1 }, J.prototype.destroy = function() { return this._screenSpaceCameraController = this._screenSpaceCameraController && this._screenSpaceCameraController.destroy(), this._pickFramebuffer = this._pickFramebuffer && this._pickFramebuffer.destroy(), this._primitives = this._primitives && this._primitives.destroy(), this.skyBox = this.skyBox && this.skyBox.destroy(), this.skyAtmosphere = this.skyAtmosphere && this.skyAtmosphere.destroy(), this._debugSphere = this._debugSphere && this._debugSphere.destroy(), this.sun = this.sun && this.sun.destroy(), this._sunPostProcess = this._sunPostProcess && this._sunPostProcess.destroy(), this._context = this._context && this._context.destroy(), this._frameState.creditDisplay.destroy(), n(this) }, J }), r("Scene/SceneTransitioner", ["../Core/defaultValue", "../Core/defined", "../Core/destroyObject", "../Core/DeveloperError", "../Core/Math", "../Core/Event", "../Core/ScreenSpaceEventHandler", "../Core/ScreenSpaceEventType", "../Core/Ellipsoid", "../Core/Cartesian3", "../Core/Cartesian4", "../Core/Cartographic", "../Core/Matrix4", "../ThirdParty/Tween", "./OrthographicFrustum", "./PerspectiveFrustum", "./SceneMode"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v) {
"use strict";
function y(e, t) { var r = new c(e.position.x, e.position.y, e.position.z, 1),
i = new c(e.direction.x, e.direction.y, e.direction.z, 0),
n = new c(e.up.x, e.up.y, e.up.z, 0),
o = t.inverseTransformation().multiply(e.transform);
e.transform = t.clone(), e.position = u.fromCartesian4(o.multiplyByVector(r)), e.direction = u.fromCartesian4(o.multiplyByVector(i)), e.up = u.fromCartesian4(o.multiplyByVector(n)), e.right = e.direction.cross(e.up) }
function g(e, t) { if (e.completeMorphOnUserInput) { e._morphHandler = new a(e._scene.getCanvas()); var r = function() { e._morphCancelled = !0, t(e) };
e._completeMorph = r, e._morphHandler.setInputAction(r, s.LEFT_DOWN), e._morphHandler.setInputAction(r, s.MIDDLE_DOWN), e._morphHandler.setInputAction(r, s.RIGHT_DOWN), e._morphHandler.setInputAction(r, s.WHEEL) } }
function _(e) { for (var t = e._scene.getAnimations(), r = 0; r < e._currentAnimations.length; ++r) t.remove(e._currentAnimations[r]);
e._currentAnimations.length = 0, e._morphHandler = e._morphHandler && e._morphHandler.destroy() }
function w(e, t, r) { var i = e._scene,
n = i.getCamera();
y(n, d.IDENTITY); var o = n.position,
a = n.direction,
s = n.up,
l = e._ellipsoid.getMaximumRadius(),
c = e._ellipsoid.cartographicToCartesian(new h(0, 0, 10));
c = c.normalize().multiplyByScalar(2 * l); var p = u.ZERO.subtract(c).normalize(),
f = p.cross(u.UNIT_Z).normalize(),
v = f.cross(p),
g = function(e) { n.position = x(o, c, e.time), n.direction = x(a, p, e.time), n.up = x(s, v, e.time), n.right = n.direction.cross(n.up) },
_ = i.getAnimations().add({ duration: t, easingFunction: m.Easing.Quartic.Out, startValue: { time: 0 }, stopValue: { time: 1 }, onUpdate: g });
e._currentAnimations.push(_), P(e, i, 0, 1, t, r) }
function C(e, t, r) { t = .5 * t; var i = e._scene.getCamera();
T(e, t, function() { i.frustum = e._cameraCV.frustum.clone(), i.transform = e._cameraCV.transform.clone(), w(e, t, r) }) }
function x(e, t, r) { return e.lerp(t, r) }
function S(e, t, r) { var i = e._scene,
o = i.getCamera(),
a = o.position,
s = o.frustum.fovy,
l = .5 * n.RADIANS_PER_DEGREE,
u = a.magnitude() * Math.tan(.5 * s);
o.frustum.far = u / Math.tan(.5 * l) + 1e7; var c = function(e) { o.frustum.fovy = n.lerp(s, l, e.time); var t = u / Math.tan(.5 * o.frustum.fovy);
o.position = o.position.normalize().multiplyByScalar(t) },
h = i.getAnimations().add({ duration: t, easingFunction: m.Easing.Quartic.Out, startValue: { time: 0 }, stopValue: { time: 1 }, onUpdate: c, onComplete: function() { o.frustum = e._camera2D.frustum.clone(), r(e) } });
e._currentAnimations.push(h) }
function E(e, t, r) { var i = e._scene,
n = i.getCamera(),
o = e._ellipsoid.getMaximumRadius();
y(n, e._cameraCV.transform); var a = n.position.clone(),
s = n.direction.clone(),
l = n.up.clone(),
u = Math.tan(.5 * e._cameraCV.frustum.fovy),
c = e._cameraCV.frustum.aspectRatio * u,
h = o * Math.PI / c,
d = e._camera2D.position.normalize().multiplyByScalar(h),
p = e._camera2D.direction.clone(),
f = e._camera2D.up.clone(),
v = function(e) { n.position = x(a, d, e.time), n.direction = x(s, p, e.time), n.up = x(l, f, e.time), n.right = n.direction.cross(n.up) };
t = .5 * t; var g = i.getAnimations().add({ duration: t, easingFunction: m.Easing.Quartic.Out, startValue: { time: 0 }, stopValue: { time: 1 }, onUpdate: v, onComplete: function() { S(e, t, r) } });
e._currentAnimations.push(g) }
function b(e, t, r) { t = .5 * t; var i = e._ellipsoid.getMaximumRadius(),
n = Math.tan(.5 * e._camera3D.frustum.fovy),
o = e._camera3D.frustum.aspectRatio * n,
a = i * Math.PI / o,
s = {};
s.position = e._camera2D.position.normalize().multiplyByScalar(a), s.direction = e._camera2D.direction.clone(), s.up = e._camera2D.up.clone(); var l = function() { S(e, t, r) };
M(e, t, s, l) }
function T(e, t, r) { var i = e._scene,
o = i.getCamera(),
a = e._ellipsoid.getMaximumRadius(),
s = Math.tan(.5 * e._cameraCV.frustum.fovy),
l = e._cameraCV.frustum.aspectRatio * s,
u = a * Math.PI / l,
c = e._camera2D.position.normalize().multiplyByScalar(u),
h = o.frustum.top,
d = o.frustum.bottom,
p = o.frustum.right,
f = o.frustum.left,
v = e._camera2D.frustum,
y = e._cameraCV.frustum,
g = o.position.clone(),
_ = function(e) { o.position = x(g, c, e.time), o.frustum.top = n.lerp(h, v.top, e.time), o.frustum.bottom = n.lerp(d, v.bottom, e.time), o.frustum.right = n.lerp(p, v.right, e.time), o.frustum.left = n.lerp(f, v.left, e.time) },
w = (p - f) / (2 * a * Math.PI),
C = 1;
w > C && (w = 0); var S = (C - w) * t; if (S < n.EPSILON6) { if (g.equalsEpsilon(c, n.EPSILON6)) return o.position = c, o.frustum = y.clone(), r(e), void 0;
S = t, w = 0, C = 1 } var E = i.getAnimations().add({ easingFunction: m.Easing.Quartic.Out, duration: S, startValue: { time: w }, stopValue: { time: C }, onUpdate: _, onComplete: function() { o.frustum = y.clone(), r(e) } });
e._currentAnimations.push(E) }
function A(e, t, r) { var i = e._scene,
n = i.getCamera();
t = .5 * t; var o = function() { var o = n.position.clone(),
a = n.direction.clone(),
s = n.up.clone(),
l = e._cameraCV.position.clone(),
u = e._cameraCV.direction.clone(),
c = e._cameraCV.up.clone(),
h = function(e) { n.position = x(o, l, e.time), n.direction = x(a, u, e.time), n.up = x(s, c, e.time), n.right = n.direction.cross(n.up) },
d = i.getAnimations().add({ duration: t, easingFunction: m.Easing.Quartic.Out, startValue: { time: 0 }, stopValue: { time: 1 }, onUpdate: h, onComplete: function() { r(e) } });
e._currentAnimations.push(d) };
T(e, t, o) }
function M(e, t, r, i) { var n = e._scene,
o = n.getCamera();
y(o, e._cameraCV.transform); var a = o.position.clone(),
s = o.direction.clone(),
l = o.up.clone(),
u = r.position.clone(),
c = r.direction.clone(),
h = r.up.clone(),
d = function(e) { o.position = x(a, u, e.time), o.direction = x(s, c, e.time), o.up = x(l, h, e.time), o.right = o.direction.cross(o.up) },
p = n.getAnimations().add({ duration: t, easingFunction: m.Easing.Quartic.Out, startValue: { time: 0 }, stopValue: { time: 1 }, onUpdate: d, onComplete: function() { o.position = u, o.direction = c, o.up = h } });
e._currentAnimations.push(p), P(e, n, 1, 0, t, i) }
function P(e, r, i, n, o, a) { var s = { duration: o, easingFunction: m.Easing.Quartic.Out };
t(a) && (s.onComplete = function() { a(e) }); var l = r.getAnimations().addProperty(r, "morphTime", i, n, s);
e._currentAnimations.push(l) }
function D(e) { var t = e._scene,
r = t.getCanvas(),
i = r.clientHeight / r.clientWidth,
n = e._camera2D.frustum;
n.top = n.right * i, n.bottom = -n.top, i = 1 / i, n = e._cameraCV.frustum, n.aspectRatio = i, n = e._camera3D.frustum, n.aspectRatio = i; var o = t.getCamera(); switch (t.mode) {
case v.SCENE3D:
o.frustum = e._camera3D.frustum.clone(); break;
case v.COLUMBUS_VIEW:
o.frustum = e._cameraCV.frustum.clone(); break;
case v.SCENE2D:
o.frustum = e._camera2D.frustum.clone() } }
function I(e) { var r = e._scene;
r.mode = v.SCENE3D, r.morphTime = v.SCENE3D.morphTime, _(e), D(e); var i = r.getCamera();
i.transform = d.IDENTITY.clone(), (e._previousMode !== v.MORPHING || e._morphCancelled) && (e._morphCancelled = !1, i.position = e._camera3D.position.clone(), i.direction = e._camera3D.direction.clone(), i.up = e._camera3D.up.clone()); var n = t(e._completeMorph);
e._completeMorph = void 0, e.onTransitionComplete.raiseEvent(e, e._previousMode, v.SCENE3D, n) }
function O(e) { var r = e._scene;
r.mode = v.SCENE2D, r.morphTime = v.SCENE2D.morphTime, _(e), D(e); var i = r.getCamera();
i.transform = e._camera2D.transform.clone(), i.position = e._camera2D.position.clone(), i.direction = e._camera2D.direction.clone(), i.up = e._camera2D.up.clone(); var n = t(e._completeMorph);
e._completeMorph = void 0, e.onTransitionComplete.raiseEvent(e, e._previousMode, v.SCENE2D, n) }
function R(e) { var r = e._scene;
r.mode = v.COLUMBUS_VIEW, r.morphTime = v.COLUMBUS_VIEW.morphTime, _(e), D(e); var i = r.getCamera();
i.transform = e._cameraCV.transform.clone(), (e._previousModeMode !== v.MORPHING || e._morphCancelled) && (e._morphCancelled = !1, i.position = e._cameraCV.position.clone(), i.direction = e._cameraCV.direction.clone(), i.up = e._cameraCV.up.clone(), i.right = i.direction.cross(i.up)); var n = t(e._completeMorph);
e._completeMorph = void 0, e.onTransitionComplete.raiseEvent(e, e._previousMode, v.COLUMBUS_VIEW, n) }
var L = function(r, a) { if (!t(r)) throw new i("scene is required.");
this.morphDuration = 2e3, this.completeMorphOnUserInput = !0, this.onTransitionStart = new o, this.onTransitionComplete = new o, this._scene = r, this._ellipsoid = e(a, l.WGS84); var s = r.getCanvas(),
c = this._ellipsoid.getMaximumRadius(),
h = new u(0, 0, 2 * c),
m = h.negate().normalize(),
v = u.UNIT_Y,
y = new p;
y.right = c * Math.PI, y.left = -y.right, y.top = y.right * (s.clientHeight / s.clientWidth), y.bottom = -y.top; var g = new d(0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1);
this._camera2D = { position: h, direction: m, up: v, frustum: y, transform: g }, h = new u(0, -1, 1).normalize().multiplyByScalar(5 * c), m = u.ZERO.subtract(h).normalize(); var _ = m.cross(u.UNIT_Z).normalize();
v = _.cross(m), y = new f, y.fovy = n.toRadians(60), y.aspectRatio = s.clientWidth / s.clientHeight, this._cameraCV = { position: h, direction: m, up: v, frustum: y, transform: g }, h = new u(0, -2, 1).normalize().multiplyByScalar(2 * c), m = u.ZERO.subtract(h).normalize(), _ = m.cross(u.UNIT_Z).normalize(), v = _.cross(m), this._camera3D = { position: h, direction: m, up: v, frustum: y }, this._currentAnimations = [], this._morphHandler = void 0, this._morphCancelled = !1, this._completeMorph = void 0 };
return L.prototype.getScene = function() { return this._scene }, L.prototype.getEllipsoid = function() { return this._ellipsoid }, L.prototype.to2D = function() { t(this._completeMorph) && this._completeMorph(), this._previousMode = this._scene.mode, this._previousMode !== v.SCENE2D && (this.onTransitionStart.raiseEvent(this, this._previousMode, v.SCENE2D, !1), O(this)) }, L.prototype.toColumbusView = function() { t(this._completeMorph) && this._completeMorph(); var e = this._scene;
this._previousMode = e.mode, this._previousMode !== v.COLUMBUS_VIEW && (this.onTransitionStart.raiseEvent(this, this._previousMode, v.COLUMBUS_VIEW, !1), R(this)) }, L.prototype.to3D = function() { t(this._completeMorph) && this._completeMorph(); var e = this._scene;
this._previousMode = e.mode, e.mode !== v.SCENE3D && (this.onTransitionStart.raiseEvent(this, this._previousMode, v.SCENE3D, !1), I(this)) }, L.prototype.completeMorph = function() {
if (!t(this._completeMorph)) throw new i("completeMorph can only be called while morphing");
this._completeMorph()
}, L.prototype.morphTo2D = function() { t(this._completeMorph) && this._completeMorph(); var e = this._scene;
this._previousMode = e.mode, this._previousMode !== v.SCENE2D && this._previousMode !== v.MORPHING && (this.onTransitionStart.raiseEvent(this, this._previousMode, v.SCENE2D, !0), D(this), e.mode = v.MORPHING, g(this, O), this._previousMode === v.COLUMBUS_VIEW ? E(this, this.morphDuration, O) : b(this, this.morphDuration, O)) }, L.prototype.morphToColumbusView = function() { t(this._completeMorph) && this._completeMorph(); var e = this._scene;
this._previousMode = e.mode, this._previousMode !== v.COLUMBUS_VIEW && this._previousMode !== v.MORPHING && (this.onTransitionStart.raiseEvent(this, this._previousMode, v.COLUMBUS_VIEW, !0), D(this), e.mode = v.MORPHING, g(this, R), this._previousMode === v.SCENE2D ? A(this, this.morphDuration, R) : M(this, this.morphDuration, this._cameraCV, R)) }, L.prototype.morphTo3D = function() { t(this._completeMorph) && this._completeMorph(); var e = this._scene;
this._previousMode = e.mode, this._previousMode !== v.SCENE3D && this._previousMode !== v.MORPHING && (this.onTransitionStart.raiseEvent(this, this._previousMode, v.SCENE3D, !0), D(this), e.mode = v.MORPHING, g(this, I), this._previousMode === v.SCENE2D ? C(this, this.morphDuration, I) : w(this, this.morphDuration, I)) }, L.prototype.isDestroyed = function() { return !1 }, L.prototype.destroy = function() { return _(this), r(this) }, L
}), r("Scene/SensorVolumeCollection", ["../Core/defined", "../Core/destroyObject", "../Core/DeveloperError", "./CustomSensorVolume", "./RectangularPyramidSensorVolume", "./SceneMode"], function(e, t, r, i, n, o) { "use strict"; var a = function() { this._sensors = [] }; return a.prototype.addRectangularPyramid = function(e) { var t = new n(e); return this._sensors.push(t), t }, a.prototype.addCustom = function(e) { var t = new i(e); return this._sensors.push(t), t }, a.prototype.remove = function(e) { if (e) { var t = this._sensors,
r = t.indexOf(e); if (-1 !== r) return t[r].destroy(), t.splice(r, 1), !0 } return !1 }, a.prototype.removeAll = function() { for (var e = this._sensors, t = e.length, r = 0; t > r; ++r) e[r].destroy();
this._sensors = [] }, a.prototype.contains = function(e) { return e ? -1 !== this._sensors.indexOf(e) : !1 }, a.prototype.get = function(t) { if (!e(t)) throw new r("index is required."); return this._sensors[t] }, a.prototype.getLength = function() { return this._sensors.length }, a.prototype.update = function(e, t, r) { var i = t.mode; if (i === o.SCENE3D)
for (var n = this._sensors, a = n.length, s = 0; a > s; ++s) n[s].update(e, t, r) }, a.prototype.isDestroyed = function() { return !1 }, a.prototype.destroy = function() { return this.removeAll(), t(this) }, a }), r("Scene/SingleTileImageryProvider", ["../Core/defaultValue", "../Core/defined", "../Core/loadImage", "../Core/writeTextToCanvas", "../Core/DeveloperError", "../Core/Event", "../Core/Extent", "./Credit", "./GeographicTilingScheme", "./TileProviderError", "../ThirdParty/when"], function(e, t, r, i, n, o, a, s, l, u, c) { "use strict"; var h = function(i) {
function h(e) { C._image = e, C._tileWidth = e.width, C._tileHeight = e.height, C._ready = !0, u.handleSuccess(C._errorEvent) }
function d() { var e = "Failed to load image " + g + ".";
w = u.handleError(w, C, C._errorEvent, e, 0, 0, 0, m) }
function m() { c(r(g), h, d) } i = e(i, {}); var p = i.url; if (!t(p)) throw new n("url is required.");
this._url = p; var f = i.proxy;
this._proxy = f; var v = e(i.extent, a.MAX_VALUE),
y = new l({ extent: v, numberOfLevelZeroTilesX: 1, numberOfLevelZeroTilesY: 1 });
this._tilingScheme = y, this._image = void 0, this._texture = void 0, this._tileWidth = 0, this._tileHeight = 0, this._errorEvent = new o, this._ready = !1; var g = p;
t(f) && (g = f.getURL(g)); var _ = i.credit; "string" == typeof _ && (_ = new s(_)), this._credit = _; var w, C = this;
m() }; return h.prototype.getUrl = function() { return this._url }, h.prototype.getProxy = function() { return this._proxy }, h.prototype.getTileWidth = function() { if (!this._ready) throw new n("getTileWidth must not be called before the imagery provider is ready."); return this._tileWidth }, h.prototype.getTileHeight = function() { if (!this._ready) throw new n("getTileHeight must not be called before the imagery provider is ready."); return this._tileHeight }, h.prototype.getMaximumLevel = function() { if (!this._ready) throw new n("getMaximumLevel must not be called before the imagery provider is ready."); return 0 }, h.prototype.getMinimumLevel = function() { if (!this._ready) throw new n("getMinimumLevel must not be called before the imagery provider is ready."); return 0 }, h.prototype.getTilingScheme = function() { if (!this._ready) throw new n("getTilingScheme must not be called before the imagery provider is ready."); return this._tilingScheme }, h.prototype.getExtent = function() { return this._tilingScheme.getExtent() }, h.prototype.getTileDiscardPolicy = function() { if (!this._ready) throw new n("getTileDiscardPolicy must not be called before the imagery provider is ready."); return void 0 }, h.prototype.getErrorEvent = function() { return this._errorEvent }, h.prototype.isReady = function() { return this._ready }, h.prototype.requestImage = function() { if (!this._ready) throw new n("requestImage must not be called before the imagery provider is ready."); return this._image }, h.prototype.getCredit = function() { return this._credit }, h }), r("Shaders/SkyAtmosphereVS", [], function() { "use strict"; return "attribute vec4 position;\nuniform float fCameraHeight;\nuniform float fCameraHeight2;\nuniform float fOuterRadius;\nuniform float fOuterRadius2;\nuniform float fInnerRadius;\nuniform float fScale;\nuniform float fScaleDepth;\nuniform float fScaleOverScaleDepth;\nconst float Kr = 0.0025;\nconst float fKr4PI = Kr * 4.0 * czm_pi;\nconst float Km = 0.0015;\nconst float fKm4PI = Km * 4.0 * czm_pi;\nconst float ESun = 15.0;\nconst float fKmESun = Km * ESun;\nconst float fKrESun = Kr * ESun;\nconst vec3 v3InvWavelength = vec3(\n5.60204474633241,\n9.473284437923038,\n19.643802610477206);\nconst float rayleighScaleDepth = 0.25;\nconst int nSamples = 2;\nconst float fSamples = 2.0;\nvarying vec3 v_rayleighColor;\nvarying vec3 v_mieColor;\nvarying vec3 v_toCamera;\nvarying vec3 v_positionEC;\nfloat scale(float fCos)\n{\nfloat x = 1.0 - fCos;\nreturn fScaleDepth * exp(-0.00287 + x*(0.459 + x*(3.83 + x*(-6.80 + x*5.25))));\n}\nvoid main(void)\n{\nvec3 v3Pos = position.xyz;\nvec3 v3Ray = v3Pos - czm_viewerPositionWC;\nfloat fFar = length(v3Ray);\nv3Ray /= fFar;\n#ifdef SKY_FROM_SPACE\nfloat B = 2.0 * dot(czm_viewerPositionWC, v3Ray);\nfloat C = fCameraHeight2 - fOuterRadius2;\nfloat fDet = max(0.0, B*B - 4.0 * C);\nfloat fNear = 0.5 * (-B - sqrt(fDet));\nvec3 v3Start = czm_viewerPositionWC + v3Ray * fNear;\nfFar -= fNear;\nfloat fStartAngle = dot(v3Ray, v3Start) / fOuterRadius;\nfloat fStartDepth = exp(-1.0 / fScaleDepth);\nfloat fStartOffset = fStartDepth*scale(fStartAngle);\n#else\nvec3 v3Start = czm_viewerPositionWC;\nfloat fHeight = length(v3Start);\nfloat fDepth = exp(fScaleOverScaleDepth * (fInnerRadius - fCameraHeight));\nfloat fStartAngle = dot(v3Ray, v3Start) / fHeight;\nfloat fStartOffset = fDepth*scale(fStartAngle);\n#endif\nfloat fSampleLength = fFar / fSamples;\nfloat fScaledLength = fSampleLength * fScale;\nvec3 v3SampleRay = v3Ray * fSampleLength;\nvec3 v3SamplePoint = v3Start + v3SampleRay * 0.5;\nvec3 v3FrontColor = vec3(0.0, 0.0, 0.0);\nfor(int i=0; i this._outerRadius ? this._spSkyFromSpace : this._spSkyFromAtmosphere, a }, f.prototype.isDestroyed = function() { return !1 }, f.prototype.destroy = function() { var e = this._command; return e.vertexArray = e.vertexArray && e.vertexArray.destroy(), this._spSkyFromSpace = this._spSkyFromSpace && this._spSkyFromSpace.release(), this._spSkyFromAtmosphere = this._spSkyFromAtmosphere && this._spSkyFromAtmosphere.release(), i(this) }, f }), r("Shaders/SkyBoxVS", [], function() { "use strict"; return "attribute vec3 position;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 p = czm_viewRotation * (czm_temeToPseudoFixed * (czm_entireFrustum.y * position));\ngl_Position = czm_projection * vec4(p, 1.0);\nv_texCoord = position.xyz;\n}\n" }), r("Shaders/SkyBoxFS", [], function() { "use strict"; return "uniform samplerCube u_cubeMap;\nvarying vec3 v_texCoord;\nvoid main()\n{\nvec3 rgb = textureCube(u_cubeMap, normalize(v_texCoord)).rgb;\ngl_FragColor = vec4(rgb, czm_morphTime);\n}\n" }), r("Scene/SkyBox", ["../Core/BoxGeometry", "../Core/Cartesian3", "../Core/defined", "../Core/destroyObject", "../Core/DeveloperError", "../Core/Matrix4", "../Core/GeometryPipeline", "../Core/VertexFormat", "../Core/PrimitiveType", "../Renderer/loadCubeMap", "../Renderer/BufferUsage", "../Renderer/DrawCommand", "../Renderer/BlendingState", "../Scene/SceneMode", "../Shaders/SkyBoxVS", "../Shaders/SkyBoxFS"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f) { "use strict"; var v = function(e) { if (!(r(e) && r(e.positiveX) && r(e.negativeX) && r(e.positiveY) && r(e.negativeY) && r(e.positiveZ) && r(e.negativeZ))) throw new n("sources is required and must have positiveX, negativeX, positiveY, negativeY, positiveZ, and negativeZ properties."); if (typeof e.positiveX != typeof e.negativeX || typeof e.positiveX != typeof e.positiveY || typeof e.positiveX != typeof e.negativeY || typeof e.positiveX != typeof e.positiveZ || typeof e.positiveX != typeof e.negativeZ) throw new n("sources properties must all be the same type.");
this._command = new h, this._command.owner = this, this._cubeMap = void 0, this._sources = e, this.show = !0 }; return v.prototype.getSources = function() { return this._sources }, v.prototype.update = function(i, n) { if (!this.show) return void 0; if (n.mode !== m.SCENE3D && n.mode !== m.MORPHING) return void 0; if (!n.passes.color) return void 0; var h = this._command; if (!r(h.vertexArray)) { var v = this._sources,
y = this; "string" == typeof v.positiveX ? u(i, this._sources).then(function(e) { y._cubeMap = e }) : this._cubeMap = i.createCubeMap({ source: v }), h.uniformMap = { u_cubeMap: function() { return y._cubeMap } }; var g = e.createGeometry(e.fromDimensions({ dimensions: new t(2, 2, 2), vertexFormat: s.POSITION_ONLY })),
_ = a.createAttributeIndices(g);
h.primitiveType = l.TRIANGLES, h.modelMatrix = o.IDENTITY.clone(), h.vertexArray = i.createVertexArrayFromGeometry({ geometry: g, attributeIndices: _, bufferUsage: c.STATIC_DRAW }), h.shaderProgram = i.getShaderCache().getShaderProgram(p, f, _), h.renderState = i.createRenderState({ blending: d.ALPHA_BLEND }) } return r(this._cubeMap) ? h : void 0 }, v.prototype.isDestroyed = function() { return !1 }, v.prototype.destroy = function() { var e = this._command; return e.vertexArray = e.vertexArray && e.vertexArray.destroy(), e.shaderProgram = e.shaderProgram && e.shaderProgram.release(), this._cubeMap = this._cubeMap && this._cubeMap.destroy(), i(this) }, v }), r("Shaders/SunVS", [], function() { "use strict"; return "attribute vec2 direction;\nvarying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 position;\nif (czm_morphTime == 1.0)\n{\nposition = vec4(czm_sunPositionWC, 1.0);\n}\nelse\n{\nposition = vec4(czm_sunPositionColumbusView.zxy, 1.0);\n}\nvec4 positionEC = czm_view * position;\nvec4 positionWC = czm_eyeToWindowCoordinates(positionEC);\nvec4 limb = czm_eyeToWindowCoordinates(positionEC + vec4(czm_solarRadius, 0.0, 0.0, 0.0));\nvec2 halfSize = vec2(length(limb.xy - positionWC.xy));\nhalfSize *= 30.0;\nhalfSize *= ((direction * 2.0) - 1.0);\ngl_Position = czm_viewportOrthographic * vec4(positionWC.xy + halfSize, -positionWC.z, 1.0);\nv_textureCoordinates = direction;\n}\n" }), r("Shaders/SunFS", [], function() { "use strict"; return "varying vec2 v_textureCoordinates;\nvoid main()\n{\nvec4 color = vec4(1.0, 1.0, 0.0, 1.0);\nfloat b = smoothstep(0.03, 0.3, length(v_textureCoordinates - vec2(0.5)));\ncolor.ba = mix(vec2(1.0), vec2(0.0), b);\ngl_FragColor = color;\n}\n" }), r("Scene/Sun", ["../Core/BoundingSphere", "../Core/Cartesian3", "../Core/ComponentDatatype", "../Core/defined", "../Core/destroyObject", "../Core/Math", "../Core/PrimitiveType", "../Renderer/BlendingState", "../Renderer/BufferUsage", "../Renderer/DrawCommand", "./SceneMode", "../Shaders/SunVS", "../Shaders/SunFS"], function(e, t, r, i, n, o, a, s, l, u, c, h, d) { "use strict"; var m = function() { this._command = new u, this._boundingVolume = new e, this._boundingVolume.radius = 30 * o.SOLAR_RADIUS, this._boundingVolume2D = new e, this._boundingVolume2D.radius = this._boundingVolume.radius, this.show = !0 }; return m.prototype.update = function(n, o) { if (!this.show) return void 0; var u = o.mode; if (u === c.SCENE2D || u === c.MORPHING) return void 0; if (!o.passes.color) return void 0; var m = this._command; if (!i(m.vertexArray)) { var p = { direction: 0 },
f = new Uint8Array(8);
f[0] = 0, f[1] = 0, f[2] = 255, f[3] = 0, f[4] = 255, f[5] = 255, f[6] = 0, f[7] = 255; var v = n.createVertexBuffer(f, l.STATIC_DRAW),
y = [{ index: p.direction, vertexBuffer: v, componentsPerAttribute: 2, normalize: !0, componentDatatype: r.UNSIGNED_BYTE }];
m.vertexArray = n.createVertexArray(y), m.primitiveType = a.TRIANGLE_FAN, m.shaderProgram = n.getShaderCache().getShaderProgram(h, d, p), m.renderState = n.createRenderState({ blending: s.ALPHA_BLEND }), m.boundingVolume = new e } var g = n.getUniformState().getSunPositionWC(),
_ = n.getUniformState().getSunPositionColumbusView(),
w = this._boundingVolume,
C = this._boundingVolume2D; return t.clone(g, w.center), C.center.x = _.z, C.center.y = _.x, C.center.z = _.y, u === c.SCENE3D ? e.clone(w, m.boundingVolume) : u === c.COLUMBUS_VIEW && e.clone(C, m.boundingVolume), m }, m.prototype.isDestroyed = function() { return !1 }, m.prototype.destroy = function() { var e = this._command; return e.vertexArray = e.vertexArray && e.vertexArray.destroy(), e.shaderProgram = e.shaderProgram && e.shaderProgram.release(), n(this) }, m }), r("Scene/TerrainData", ["../Core/DeveloperError"], function(e) { "use strict"; var t = function() { throw new e("This type should not be instantiated directly.") }; return t.prototype.interpolateHeight = function() { throw new e("This type should not be instantiated directly.") }, t.prototype.isChildAvailable = function() { throw new e("This type should not be instantiated directly.") }, t.prototype.getWaterMask = function() { throw new e("This type should not be instantiated directly.") }, t.prototype.createMesh = function() { throw new e("This type should not be instantiated directly.") }, t.prototype.upsample = function() { throw new e("This type should not be instantiated directly.") }, t.prototype.wasCreatedByUpsampling = function() { throw new e("This type should not be instantiated directly.") }, t }), r("Scene/TileCoordinatesImageryProvider", ["../Core/defaultValue", "../Core/Color", "../Core/Event", "./GeographicTilingScheme"], function(e, t, r, i) { "use strict"; var n = function(n) { n = e(n, {}), this._tilingScheme = e(n.tilingScheme, new i), this._color = e(n.color, t.YELLOW), this._errorEvent = new r, this._tileWidth = e(n.tileWidth, 256), this._tileHeight = e(n.tileHeight, 256) }; return n.prototype.getProxy = function() { return void 0 }, n.prototype.getTileWidth = function() { return this._tileWidth }, n.prototype.getTileHeight = function() { return this._tileHeight }, n.prototype.getMaximumLevel = function() { return void 0 }, n.prototype.getMinimumLevel = function() { return void 0 }, n.prototype.getTilingScheme = function() { return this._tilingScheme }, n.prototype.getExtent = function() { return this._tilingScheme.getExtent() }, n.prototype.getTileDiscardPolicy = function() { return void 0 }, n.prototype.getErrorEvent = function() { return this._errorEvent }, n.prototype.isReady = function() { return !0 }, n.prototype.requestImage = function(e, t, r) { var i = document.createElement("canvas");
i.width = 256, i.height = 256; var n = i.getContext("2d"),
o = this._color.toCssColorString();
n.strokeStyle = o, n.lineWidth = 2, n.strokeRect(1, 1, 255, 255); var a = "L" + r + "X" + e + "Y" + t; return n.font = "bold 25px Arial", n.textAlign = "center", n.fillStyle = "black", n.fillText(a, 127, 127), n.fillStyle = o, n.fillText(a, 124, 124), i }, n.prototype.getCredit = function() { return void 0 }, n }), r("Scene/TileDiscardPolicy", ["../Core/DeveloperError"], function(e) { "use strict"; var t = function() { throw new e("This type should not be instantiated directly.") }; return t.prototype.isReady = function() { throw new e("This type should not be instantiated directly.") }, t.prototype.shouldDiscardImage = function() { throw new e("This type should not be instantiated directly.") }, t }), r("Scene/TileMapServiceImageryProvider", ["../Core/defaultValue", "../Core/defined", "../Core/Cartographic", "../Core/DeveloperError", "../Core/Event", "../Core/loadXML", "../Core/writeTextToCanvas", "../Core/Extent", "./Credit", "./ImageryProvider", "./WebMercatorTilingScheme", "./GeographicTilingScheme"], function(e, t, r, i, n, o, a, s, l, u, c, h) { "use strict";
function d(e, r, i, n) { var o = e._tilingScheme.getNumberOfYTilesAtLevel(n),
a = e._url + n + "/" + r + "/" + (o - i - 1) + "." + e._fileExtension,
s = e._proxy; return t(s) && (a = s.getURL(a)), a } var m = /\/$/,
p = function(a) { if (a = e(a, {}), !t(a.url)) throw new i("description.url is required."); var u = a.url;
m.test(u) || (u += "/"), this._url = u, this._ready = !1, this._proxy = a.proxy, this._tileDiscardPolicy = a.tileDiscardPolicy, this._errorEvent = new n; var d = a.credit; "string" == typeof d && (d = new l(d)), this._credit = d; var p = this;
o(u + "tilemapresource.xml").then(function(i) { var n = i.getElementsByTagName("TileFormat")[0];
p._fileExtension = e(a.fileExtension, n.getAttribute("extension")), p._tileWidth = e(a.tileWidth, parseInt(n.getAttribute("width"), 10)), p._tileHeight = e(a.tileHeight, parseInt(n.getAttribute("height"), 10)); var o = i.getElementsByTagName("TileSet"); if (p._minimumLevel = e(a.minimumLevel, parseInt(o[0].getAttribute("order"), 10)), p._maximumLevel = e(a.maximumLevel, parseInt(o[o.length - 1].getAttribute("order"), 10)), p._extent = a.extent, t(p._extent)) p._extent = p._extent.clone();
else { var l = i.getElementsByTagName("BoundingBox")[0],
u = r.fromDegrees(parseFloat(l.getAttribute("miny")), parseFloat(l.getAttribute("minx"))),
d = r.fromDegrees(parseFloat(l.getAttribute("maxy")), parseFloat(l.getAttribute("maxx")));
p._extent = new s(u.longitude, u.latitude, d.longitude, d.latitude) } var m = a.tilingScheme; if (!t(m)) { var f = i.getElementsByTagName("TileSets")[0].getAttribute("profile");
m = "geodetic" === f ? new h : new c } p._extent.west < m.getExtent().west && (p._extent.west = m.getExtent().west), p._extent.east > m.getExtent().east && (p._extent.east = m.getExtent().east), p._extent.south < m.getExtent().south && (p._extent.south = m.getExtent().south), p._extent.north > m.getExtent().north && (p._extent.north = m.getExtent().north); var v = m.positionToTileXY(p._extent.getSouthwest(), p._minimumLevel),
y = m.positionToTileXY(p._extent.getNortheast(), p._minimumLevel),
g = (Math.abs(y.x - v.x) + 1) * (Math.abs(y.y - v.y) + 1);
g > 4 && (p._minimumLevel = 0), p._tilingScheme = m, p._ready = !0 }, function() { p._fileExtension = e(a.fileExtension, "png"), p._tileWidth = e(a.tileWidth, 256), p._tileHeight = e(a.tileHeight, 256), p._minimumLevel = e(a.minimumLevel, 0), p._maximumLevel = e(a.maximumLevel, 18), p._tilingScheme = e(a.tilingScheme, new c), p._extent = e(a.extent, p._tilingScheme.getExtent()), p._ready = !0 }) }; return p.prototype.getUrl = function() { return this._url }, p.prototype.getProxy = function() { return this._proxy }, p.prototype.getTileWidth = function() { if (!this._ready) throw new i("getTileWidth must not be called before the imagery provider is ready."); return this._tileWidth }, p.prototype.getTileHeight = function() { if (!this._ready) throw new i("getTileHeight must not be called before the imagery provider is ready."); return this._tileHeight }, p.prototype.getMinimumLevel = function() { if (!this._ready) throw new i("getMinimumLevel must not be called before the imagery provider is ready."); return this._minimumLevel }, p.prototype.getMaximumLevel = function() { if (!this._ready) throw new i("getMaximumLevel must not be called before the imagery provider is ready."); return this._maximumLevel }, p.prototype.getTilingScheme = function() { if (!this._ready) throw new i("getTilingScheme must not be called before the imagery provider is ready."); return this._tilingScheme }, p.prototype.getExtent = function() { if (!this._ready) throw new i("getExtent must not be called before the imagery provider is ready."); return this._extent }, p.prototype.getTileDiscardPolicy = function() { if (!this._ready) throw new i("getTileDiscardPolicy must not be called before the imagery provider is ready."); return this._tileDiscardPolicy }, p.prototype.getErrorEvent = function() { return this._errorEvent }, p.prototype.isReady = function() { return this._ready }, p.prototype.requestImage = function(e, t, r) { if (!this._ready) throw new i("requestImage must not be called before the imagery provider is ready."); var n = d(this, e, t, r); return u.loadImage(this, n) }, p.prototype.getCredit = function() { return this._credit }, p }), r("Scene/VRTheWorldTerrainProvider", ["../Core/defaultValue", "../Core/defined", "../Core/loadImage", "../Core/loadXML", "../Core/getImagePixels", "../Core/throttleRequestByServer", "../Core/writeTextToCanvas", "../Core/DeveloperError", "../Core/Extent", "../Core/Math", "../Core/Ellipsoid", "../Core/Event", "./Credit", "./TerrainProvider", "./TileProviderError", "./GeographicTilingScheme", "./HeightmapTerrainData", "../ThirdParty/when"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y) { "use strict";
function g(e, t) { this.extent = e, this.maxLevel = t }
function _(e, t, r, i) { for (var n = e._tilingScheme, o = e._extents, a = n.tileXYToExtent(t, r, i), s = 0, l = 0; l < o.length && 15 !== s; ++l) { var u = o[l]; if (!(u.maxLevel <= i)) { var c = u.extent,
h = c.intersectWith(a, x);
h.isEmpty() || (w(n, c, 2 * t, 2 * r, i + 1) && (s |= 4), w(n, c, 2 * t + 1, 2 * r, i + 1) && (s |= 8), w(n, c, 2 * t, 2 * r + 1, i + 1) && (s |= 1), w(n, c, 2 * t + 1, 2 * r + 1, i + 1) && (s |= 2)) } } return s }
function w(e, t, r, i, n) { var o = e.tileXYToExtent(r, i, n); return !o.intersectWith(t, x).isEmpty() } var C = function(r) {
function n(e) { var t = e.getElementsByTagName("SRS")[0].textContent; if ("EPSG:4326" !== t) return o("SRS " + t + " is not supported."), void 0;
w._tilingScheme = new f({ ellipsoid: C }); var r = e.getElementsByTagName("TileFormat")[0];
w._heightmapWidth = parseInt(r.getAttribute("width"), 10), w._heightmapHeight = parseInt(r.getAttribute("height"), 10), w._levelZeroMaximumGeometricError = m.getEstimatedLevelZeroGeometricErrorForAHeightmap(C, Math.min(w._heightmapWidth, w._heightmapHeight), w._tilingScheme.getNumberOfXTilesAtLevel(0)); for (var i = e.getElementsByTagName("DataExtent"), n = 0; n < i.length; ++n) { var a = i[n],
s = u.toRadians(parseFloat(a.getAttribute("minx"))),
c = u.toRadians(parseFloat(a.getAttribute("miny"))),
h = u.toRadians(parseFloat(a.getAttribute("maxx"))),
d = u.toRadians(parseFloat(a.getAttribute("maxy"))),
p = parseInt(a.getAttribute("maxlevel"), 10);
w._extents.push(new g(new l(s, c, h, d), p)) } w._ready = !0 }
function o(t) { var r = e(t, "An error occurred while accessing " + w._url + ".");
_ = p.handleError(_, w, w._errorEvent, r, void 0, void 0, void 0, a) }
function a() { y(i(w._url), n, o) } if (r = e(r, e.EMPTY_OBJECT), !t(r.url)) throw new s("description.url is required.");
this._url = r.url, this._url.length > 0 && "/" !== this._url[this._url.length - 1] && (this._url += "/"), this._errorEvent = new h, this._ready = !1, this._proxy = r.proxy, this._terrainDataStructure = { heightScale: .001, heightOffset: -1e3, elementsPerHeight: 3, stride: 4, elementMultiplier: 256, isBigEndian: !0 }; var v = r.credit; "string" == typeof v && (v = new d(v)), this._credit = v, this._tilingScheme = void 0, this._extents = []; var _, w = this,
C = e(r.ellipsoid, c.WGS84);
a() };
C.prototype.requestTileGeometry = function(i, a, l, u) { if (!this.isReady()) throw new s("requestTileGeometry must not be called before isReady returns true."); var c = this._tilingScheme.getNumberOfYTilesAtLevel(l),
h = this._url + l + "/" + i + "/" + (c - a - 1) + ".tif?cesium=true",
d = this._proxy;
t(d) && (h = d.getURL(h)); var m; if (u = e(u, !0)) { if (m = o(h, r), !t(m)) return void 0 } else m = r(h); var p = this; return y(m, function(e) { return new v({ buffer: n(e), width: p._heightmapWidth, height: p._heightmapHeight, childTileMask: _(p, i, a, l), structure: p._terrainDataStructure }) }) }, C.prototype.getErrorEvent = function() { return this._errorEvent }, C.prototype.getLevelMaximumGeometricError = function(e) { if (!this.isReady()) throw new s("requestTileGeometry must not be called before isReady returns true."); return this._levelZeroMaximumGeometricError / (1 << e) }, C.prototype.getCredit = function() { return this._credit }, C.prototype.getTilingScheme = function() { if (!this.isReady()) throw new s("requestTileGeometry must not be called before isReady returns true."); return this._tilingScheme }, C.prototype.hasWaterMask = function() { return !1 }, C.prototype.isReady = function() { return this._ready }; var x = new l; return C }), r("Scene/WebMapServiceImageryProvider", ["../Core/clone", "../Core/defaultValue", "../Core/defined", "../Core/freezeObject", "../Core/writeTextToCanvas", "../Core/DeveloperError", "../Core/Event", "../Core/Extent", "./Credit", "./ImageryProvider", "./GeographicTilingScheme"], function(e, t, r, i, n, o, a, s, l, u, c) { "use strict";
function h(e, t, i, n) { var o = e._url,
a = o.indexOf("?");
a >= 0 && a < o.length - 1 ? "&" !== o[o.length - 1] && (o += "&") : 0 > a && (o += "?"); var s = e._parameters; for (var l in s) s.hasOwnProperty(l) && (o += l + "=" + s[l] + "&"); if (r(s.layers) || (o += "layers=" + e._layers + "&"), r(s.srs) || (o += "srs=EPSG:4326&"), !r(s.bbox)) { var u = e._tilingScheme.tileXYToNativeExtent(t, i, n),
c = u.west + "," + u.south + "," + u.east + "," + u.north;
o += "bbox=" + c + "&" } r(s.width) || (o += "width=256&"), r(s.height) || (o += "height=256&"); var h = e._proxy; return r(h) && (o = h.getURL(o)), o } var d = function m(i) { if (i = t(i, {}), !r(i.url)) throw new o("description.url is required."); if (!r(i.layers)) throw new o("description.layers is required.");
this._url = i.url, this._tileDiscardPolicy = i.tileDiscardPolicy, this._proxy = i.proxy, this._layers = i.layers; var n = e(m.DefaultParameters); if (r(i.parameters))
for (var u in i.parameters)
if (i.parameters.hasOwnProperty(u)) { var h = u.toLowerCase();
n[h] = i.parameters[u] }
this._parameters = n, this._tileWidth = 256, this._tileHeight = 256, this._maximumLevel = i.maximumLevel; var d = t(i.extent, s.MAX_VALUE);
this._tilingScheme = new c({ extent: d }); var p = i.credit; "string" == typeof p && (p = new l(p)), this._credit = p, this._errorEvent = new a, this._ready = !0 }; return d.prototype.getUrl = function() { return this._url }, d.prototype.getProxy = function() { return this._proxy }, d.prototype.getLayers = function() { return this._layers }, d.prototype.getTileWidth = function() { if (!this._ready) throw new o("getTileWidth must not be called before the imagery provider is ready."); return this._tileWidth }, d.prototype.getTileHeight = function() { if (!this._ready) throw new o("getTileHeight must not be called before the imagery provider is ready."); return this._tileHeight }, d.prototype.getMinimumLevel = function() { if (!this._ready) throw new o("getMinimumLevel must not be called before the imagery provider is ready."); return 0 }, d.prototype.getMaximumLevel = function() { if (!this._ready) throw new o("getMaximumLevel must not be called before the imagery provider is ready."); return this._maximumLevel }, d.prototype.getTilingScheme = function() { if (!this._ready) throw new o("getTilingScheme must not be called before the imagery provider is ready."); return this._tilingScheme }, d.prototype.getExtent = function() { if (!this._ready) throw new o("getExtent must not be called before the imagery provider is ready."); return this._tilingScheme.getExtent() }, d.prototype.getTileDiscardPolicy = function() { if (!this._ready) throw new o("getTileDiscardPolicy must not be called before the imagery provider is ready."); return this._tileDiscardPolicy }, d.prototype.getErrorEvent = function() { return this._errorEvent }, d.prototype.isReady = function() { return this._ready }, d.prototype.requestImage = function(e, t, r) { if (!this._ready) throw new o("requestImage must not be called before the imagery provider is ready."); var i = h(this, e, t, r); return u.loadImage(this, i) }, d.prototype.getCredit = function() { return this._credit }, d.DefaultParameters = i({ service: "WMS", version: "1.1.1", request: "GetMap", styles: "", format: "image/jpeg" }), d }), r("Scene/createTangentSpaceDebugPrimitive", ["../Core/defaultValue", "../Core/defined", "../Core/DeveloperError", "../Core/ColorGeometryInstanceAttribute", "../Core/GeometryInstance", "../Core/GeometryPipeline", "../Core/Matrix4", "./Primitive", "./PerInstanceColorAppearance"], function(e, t, r, i, n, o, a, s, l) { "use strict";
function u(u) { u = e(u, e.EMPTY_OBJECT); var c = [],
h = u.geometry; if (!t(h)) throw new r("options.geometry is required.");
t(h.attributes) && t(h.primitiveType) || (h = h.constructor.createGeometry(h)); var d = h.attributes,
m = a.clone(e(u.modelMatrix, a.IDENTITY)),
p = e(u.length, 1e4); return t(d.normal) && c.push(new n({ geometry: o.createLineSegmentsForVectors(h, "normal", p), attributes: { color: new i(1, 0, 0, 1) }, modelMatrix: m })), t(d.binormal) && c.push(new n({ geometry: o.createLineSegmentsForVectors(h, "binormal", p), attributes: { color: new i(0, 1, 0, 1) }, modelMatrix: m })), t(d.tangent) && c.push(new n({ geometry: o.createLineSegmentsForVectors(h, "tangent", p), attributes: { color: new i(0, 0, 1, 1) }, modelMatrix: m })), c.length > 0 ? new s({ geometryInstances: c, appearance: new l({ flat: !0, translucent: !1 }) }) : void 0 } return u }), r("Scene/sampleTerrain", ["../Core/DeveloperError", "../Core/defined", "../ThirdParty/when"], function(e, t, r) {
"use strict";
function i(e) {
var t = e.positions,
r = e.tilingScheme.tileXYToExtent(e.x, e.y, e.level);
return function(e) { for (var i = 0; i < t.length; ++i) { var n = t[i];
n.height = e.interpolateHeight(r, n.longitude, n.latitude) } }
}
function n(e) { var t = e.positions; return function() { for (var e = 0; e < t.length; ++e) { var r = t[e];
r.height = void 0 } } }
var o = function(o, a, s) { if (!t(o)) throw new e("terrainProvider is required."); if (!t(a)) throw new e("level is required."); if (!t(s)) throw new e("positions is required."); var l, u = o.getTilingScheme(),
c = [],
h = {}; for (l = 0; l < s.length; ++l) { var d = u.positionToTileXY(s[l], a),
m = d.toString(); if (!h.hasOwnProperty(m)) { var p = { x: d.x, y: d.y, level: a, tilingScheme: u, terrainProvider: o, positions: [] };
h[m] = p, c.push(p) } h[m].positions.push(s[l]) } var f = []; for (l = 0; l < c.length; ++l) { var v = c[l],
y = v.terrainProvider.requestTileGeometry(v.x, v.y, v.level, !1),
g = r(y, i(v), n(v));
f.push(g) } return r.all(f, function() { return s }) };
return o
}),
function() {
function e(e) { return function() { return e } }! function(i) {
var n = this || (0, eval)("this"),
o = n.document,
a = n.navigator,
s = n.jQuery,
l = n.JSON;
! function(e) { "function" == typeof t && "object" == typeof exports && "object" == typeof module ? e(module.exports || exports) : "function" == typeof r && r.amd ? r("ThirdParty/knockout-2.3.0", ["exports"], e) : e(n.ko = {}) }(function(t) {
function r(e, t, r, i) { c.d[e] = { init: function(e) { return c.a.f.set(e, p, {}), { controlsDescendantBindings: !0 } }, update: function(e, n, o, a, s) { o = c.a.f.get(e, p), n = c.a.c(n()), a = !r != !n; var l = !o.fb;
(l || t || a !== o.vb) && (l && (o.fb = c.a.Oa(c.e.childNodes(e), !0)), a ? (l || c.e.P(e, c.a.Oa(o.fb)), c.Ja(i ? i(s, n) : s, e)) : c.e.ba(e), o.vb = a) } }, c.g.S[e] = !1, c.e.L[e] = !0 }
function u(e, t, r) { r && t !== c.h.n(e) && c.h.W(e, t), t !== c.h.n(e) && c.q.I(c.a.Ga, null, [e, "change"]) }
var c = "undefined" != typeof t ? t : {};
c.b = function(e, t) { for (var r = e.split("."), i = c, n = 0; n < r.length - 1; n++) i = i[r[n]];
i[r[r.length - 1]] = t }, c.r = function(e, t, r) { e[t] = r }, c.version = "2.3.0", c.b("version", c.version), c.a = function() {
function e(e, t) { for (var r in e) e.hasOwnProperty(r) && t(r, e[r]) }
function t(e, t) { if ("input" !== c.a.u(e) || !e.type || "click" != t.toLowerCase()) return !1; var r = e.type; return "checkbox" == r || "radio" == r } var r = {},
u = {};
r[a && /Firefox\/2/i.test(a.userAgent) ? "KeyboardEvent" : "UIEvents"] = ["keyup", "keydown", "keypress"], r.MouseEvents = "click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "), e(r, function(e, t) { if (t.length)
for (var r = 0, i = t.length; i > r; r++) u[t[r]] = e }); var h = { propertychange: !0 },
d = o && function() { for (var e = 3, t = o.createElement("div"), r = t.getElementsByTagName("i"); t.innerHTML = "", r[0];); return e > 4 ? e : i }(); return { Ta: ["authenticity_token", /^__RequestVerificationToken(_.*)?$/], p: function(e, t) { for (var r = 0, i = e.length; i > r; r++) t(e[r]) }, k: function(e, t) { if ("function" == typeof Array.prototype.indexOf) return Array.prototype.indexOf.call(e, t); for (var r = 0, i = e.length; i > r; r++)
if (e[r] === t) return r; return -1 }, La: function(e, t, r) { for (var i = 0, n = e.length; n > i; i++)
if (t.call(r, e[i])) return e[i]; return null }, ka: function(e, t) { var r = c.a.k(e, t);
r >= 0 && e.splice(r, 1) }, Ma: function(e) { e = e || []; for (var t = [], r = 0, i = e.length; i > r; r++) 0 > c.a.k(t, e[r]) && t.push(e[r]); return t }, Z: function(e, t) { e = e || []; for (var r = [], i = 0, n = e.length; n > i; i++) r.push(t(e[i])); return r }, Y: function(e, t) { e = e || []; for (var r = [], i = 0, n = e.length; n > i; i++) t(e[i]) && r.push(e[i]); return r }, R: function(e, t) { if (t instanceof Array) e.push.apply(e, t);
else
for (var r = 0, i = t.length; i > r; r++) e.push(t[r]); return e }, ja: function(e, t, r) { var i = e.indexOf ? e.indexOf(t) : c.a.k(e, t);
0 > i ? r && e.push(t) : r || e.splice(i, 1) }, extend: function(e, t) { if (t)
for (var r in t) t.hasOwnProperty(r) && (e[r] = t[r]); return e }, w: e, oa: function(e) { for (; e.firstChild;) c.removeNode(e.firstChild) }, Mb: function(e) { e = c.a.N(e); for (var t = o.createElement("div"), r = 0, i = e.length; i > r; r++) t.appendChild(c.H(e[r])); return t }, Oa: function(e, t) { for (var r = 0, i = e.length, n = []; i > r; r++) { var o = e[r].cloneNode(!0);
n.push(t ? c.H(o) : o) } return n }, P: function(e, t) { if (c.a.oa(e), t)
for (var r = 0, i = t.length; i > r; r++) e.appendChild(t[r]) }, eb: function(e, t) { var r = e.nodeType ? [e] : e; if (0 < r.length) { for (var i = r[0], n = i.parentNode, o = 0, a = t.length; a > o; o++) n.insertBefore(t[o], i); for (o = 0, a = r.length; a > o; o++) c.removeNode(r[o]) } }, hb: function(e, t) { 7 > d ? e.setAttribute("selected", t) : e.selected = t }, F: function(e) { return null === e || e === i ? "" : e.trim ? e.trim() : e.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g, "") }, Wb: function(e, t) { for (var r = [], i = (e || "").split(t), n = 0, o = i.length; o > n; n++) { var a = c.a.F(i[n]); "" !== a && r.push(a) } return r }, Tb: function(e, t) { return e = e || "", t.length > e.length ? !1 : e.substring(0, t.length) === t }, yb: function(e, t) { if (t.compareDocumentPosition) return 16 == (16 & t.compareDocumentPosition(e)); for (; null != e;) { if (e == t) return !0;
e = e.parentNode } return !1 }, aa: function(e) { return c.a.yb(e, e.ownerDocument) }, pb: function(e) { return !!c.a.La(e, c.a.aa) }, u: function(e) { return e && e.tagName && e.tagName.toLowerCase() }, o: function(e, r, i) { var n = d && h[r]; if (n || "undefined" == typeof s)
if (n || "function" != typeof e.addEventListener) { if ("undefined" == typeof e.attachEvent) throw Error("Browser doesn't support addEventListener or attachEvent"); var o = function(t) { i.call(e, t) },
a = "on" + r;
e.attachEvent(a, o), c.a.C.ia(e, function() { e.detachEvent(a, o) }) } else e.addEventListener(r, i, !1);
else { if (t(e, r)) { var l = i;
i = function(e, t) { var r = this.checked;
t && (this.checked = !0 !== t.sb), l.call(this, e), this.checked = r } } s(e).bind(r, i) } }, Ga: function(e, r) { if (!e || !e.nodeType) throw Error("element must be a DOM node when calling triggerEvent"); if ("undefined" != typeof s) { var i = [];
t(e, r) && i.push({ sb: e.checked }), s(e).trigger(r, i) } else if ("function" == typeof o.createEvent) { if ("function" != typeof e.dispatchEvent) throw Error("The supplied element doesn't support dispatchEvent");
i = o.createEvent(u[r] || "HTMLEvents"), i.initEvent(r, !0, !0, n, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, e), e.dispatchEvent(i) } else { if ("undefined" == typeof e.fireEvent) throw Error("Browser doesn't support triggering events");
t(e, r) && (e.checked = !0 !== e.checked), e.fireEvent("on" + r) } }, c: function(e) { return c.T(e) ? e() : e }, ya: function(e) { return c.T(e) ? e.t() : e }, ga: function(e, t, r) { if (t) { var i = /\S+/g,
n = e.className.match(i) || [];
c.a.p(t.match(i), function(e) { c.a.ja(n, e, r) }), e.className = n.join(" ") } }, ib: function(e, t) { var r = c.a.c(t);
(null === r || r === i) && (r = ""); var n = c.e.firstChild(e);!n || 3 != n.nodeType || c.e.nextSibling(n) ? c.e.P(e, [o.createTextNode(r)]) : n.data = r, c.a.Bb(e) }, gb: function(e, t) { if (e.name = t, 7 >= d) try { e.mergeAttributes(o.createElement(""), !1) } catch (r) {} }, Bb: function(e) { d >= 9 && (e = 1 == e.nodeType ? e : e.parentNode, e.style && (e.style.zoom = e.style.zoom)) }, zb: function(e) { if (d) { var t = e.style.width;
e.style.width = 0, e.style.width = t } }, Qb: function(e, t) { e = c.a.c(e), t = c.a.c(t); for (var r = [], i = e; t >= i; i++) r.push(i); return r }, N: function(e) { for (var t = [], r = 0, i = e.length; i > r; r++) t.push(e[r]); return t }, Ub: 6 === d, Vb: 7 === d, ca: d, Ua: function(e, t) { for (var r = c.a.N(e.getElementsByTagName("input")).concat(c.a.N(e.getElementsByTagName("textarea"))), i = "string" == typeof t ? function(e) { return e.name === t } : function(e) { return t.test(e.name) }, n = [], o = r.length - 1; o >= 0; o--) i(r[o]) && n.push(r[o]); return n }, Nb: function(e) { return "string" == typeof e && (e = c.a.F(e)) ? l && l.parse ? l.parse(e) : new Function("return " + e)() : null }, Ca: function(e, t, r) { if (!l || !l.stringify) throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js"); return l.stringify(c.a.c(e), t, r) }, Ob: function(t, r, i) { i = i || {}; var n = i.params || {},
a = i.includeFields || this.Ta,
s = t; if ("object" == typeof t && "form" === c.a.u(t))
for (var s = t.action, l = a.length - 1; l >= 0; l--)
for (var u = c.a.Ua(t, a[l]), h = u.length - 1; h >= 0; h--) n[u[h].name] = u[h].value;
r = c.a.c(r); var d = o.createElement("form");
d.style.display = "none", d.action = s, d.method = "post"; for (var m in r) t = o.createElement("input"), t.name = m, t.value = c.a.Ca(c.a.c(r[m])), d.appendChild(t);
e(n, function(e, t) { var r = o.createElement("input");
r.name = e, r.value = t, d.appendChild(r) }), o.body.appendChild(d), i.submitter ? i.submitter(d) : d.submit(), setTimeout(function() { d.parentNode.removeChild(d) }, 0) } } }(), c.b("utils", c.a), c.b("utils.arrayForEach", c.a.p), c.b("utils.arrayFirst", c.a.La), c.b("utils.arrayFilter", c.a.Y), c.b("utils.arrayGetDistinctValues", c.a.Ma), c.b("utils.arrayIndexOf", c.a.k), c.b("utils.arrayMap", c.a.Z), c.b("utils.arrayPushAll", c.a.R), c.b("utils.arrayRemoveItem", c.a.ka), c.b("utils.extend", c.a.extend), c.b("utils.fieldsIncludedWithJsonPost", c.a.Ta), c.b("utils.getFormFields", c.a.Ua), c.b("utils.peekObservable", c.a.ya), c.b("utils.postJson", c.a.Ob), c.b("utils.parseJson", c.a.Nb), c.b("utils.registerEventHandler", c.a.o), c.b("utils.stringifyJson", c.a.Ca), c.b("utils.range", c.a.Qb), c.b("utils.toggleDomNodeCssClass", c.a.ga), c.b("utils.triggerEvent", c.a.Ga), c.b("utils.unwrapObservable", c.a.c), c.b("utils.objectForEach", c.a.w), c.b("utils.addOrRemoveItem", c.a.ja), c.b("unwrap", c.a.c), Function.prototype.bind || (Function.prototype.bind = function(e) { var t = this,
r = Array.prototype.slice.call(arguments); return e = r.shift(),
function() { return t.apply(e, r.concat(Array.prototype.slice.call(arguments))) } }), c.a.f = new function() { var e = 0,
t = "__ko__" + (new Date).getTime(),
r = {}; return { get: function(e, t) { var r = c.a.f.pa(e, !1); return r === i ? i : r[t] }, set: function(e, t, r) {
(r !== i || c.a.f.pa(e, !1) !== i) && (c.a.f.pa(e, !0)[t] = r) }, pa: function(n, o) { var a = n[t]; if (!a || "null" === a || !r[a]) { if (!o) return i;
a = n[t] = "ko" + e++, r[a] = {} } return r[a] }, clear: function(e) { var i = e[t]; return i ? (delete r[i], e[t] = null, !0) : !1 } } }, c.b("utils.domData", c.a.f), c.b("utils.domData.clear", c.a.f.clear), c.a.C = new function() {
function e(e, t) { var n = c.a.f.get(e, r); return n === i && t && (n = [], c.a.f.set(e, r, n)), n }
function t(r) { var i = e(r, !1); if (i)
for (var i = i.slice(0), n = 0; n < i.length; n++) i[n](r); if (c.a.f.clear(r), "function" == typeof s && "function" == typeof s.cleanData && s.cleanData([r]), o[r.nodeType])
for (i = r.firstChild; r = i;) i = r.nextSibling, 8 === r.nodeType && t(r) } var r = "__ko_domNodeDisposal__" + (new Date).getTime(),
n = { 1: !0, 8: !0, 9: !0 },
o = { 1: !0, 9: !0 }; return { ia: function(t, r) { if ("function" != typeof r) throw Error("Callback must be a function");
e(t, !0).push(r) }, cb: function(t, n) { var o = e(t, !1);
o && (c.a.ka(o, n), 0 == o.length && c.a.f.set(t, r, i)) }, H: function(e) { if (n[e.nodeType] && (t(e), o[e.nodeType])) { var r = [];
c.a.R(r, e.getElementsByTagName("*")); for (var i = 0, a = r.length; a > i; i++) t(r[i]) } return e }, removeNode: function(e) { c.H(e), e.parentNode && e.parentNode.removeChild(e) } } }, c.H = c.a.C.H, c.removeNode = c.a.C.removeNode, c.b("cleanNode", c.H), c.b("removeNode", c.removeNode), c.b("utils.domNodeDisposal", c.a.C), c.b("utils.domNodeDisposal.addDisposeCallback", c.a.C.ia), c.b("utils.domNodeDisposal.removeDisposeCallback", c.a.C.cb),
function() { c.a.xa = function(e) { var t; if ("undefined" != typeof s) { if (s.parseHTML) t = s.parseHTML(e) || [];
else if ((t = s.clean([e])) && t[0]) { for (e = t[0]; e.parentNode && 11 !== e.parentNode.nodeType;) e = e.parentNode;
e.parentNode && e.parentNode.removeChild(e) } } else { var r = c.a.F(e).toLowerCase(); for (t = o.createElement("div"), r = r.match(/^<(thead|tbody|tfoot)/) && [1, "
", "
"] || !r.indexOf("
", ""] || (!r.indexOf("
", "
"] || [0, "", ""], e = "ignored
" + r[1] + e + r[2] + "
", "function" == typeof n.innerShiv ? t.appendChild(n.innerShiv(e)) : t.innerHTML = e; r[0]--;) t = t.lastChild;
t = c.a.N(t.lastChild.childNodes) } return t }, c.a.fa = function(e, t) { if (c.a.oa(e), t = c.a.c(t), null !== t && t !== i)
if ("string" != typeof t && (t = t.toString()), "undefined" != typeof s) s(e).html(t);
else
for (var r = c.a.xa(t), n = 0; n < r.length; n++) e.appendChild(r[n]) } }(), c.b("utils.parseHtmlFragment", c.a.xa), c.b("utils.setHtml", c.a.fa), c.s = function() {
function e(t, r) { if (t)
if (8 == t.nodeType) { var i = c.s.$a(t.nodeValue);
null != i && r.push({ xb: t, Kb: i }) } else if (1 == t.nodeType)
for (var i = 0, n = t.childNodes, o = n.length; o > i; i++) e(n[i], r) } var t = {}; return { va: function(e) { if ("function" != typeof e) throw Error("You can only pass a function to ko.memoization.memoize()"); var r = (0 | 4294967296 * (1 + Math.random())).toString(16).substring(1) + (0 | 4294967296 * (1 + Math.random())).toString(16).substring(1); return t[r] = e, "" }, mb: function(e, r) { var n = t[e]; if (n === i) throw Error("Couldn't find any memo with ID " + e + ". Perhaps it's already been unmemoized."); try { return n.apply(null, r || []), !0 } finally { delete t[e] } }, nb: function(t, r) { var i = [];
e(t, i); for (var n = 0, o = i.length; o > n; n++) { var a = i[n].xb,
s = [a];
r && c.a.R(s, r), c.s.mb(i[n].Kb, s), a.nodeValue = "", a.parentNode && a.parentNode.removeChild(a) } }, $a: function(e) { return (e = e.match(/^\[ko_memo\:(.*?)\]$/)) ? e[1] : null } } }(), c.b("memoization", c.s), c.b("memoization.memoize", c.s.va), c.b("memoization.unmemoize", c.s.mb), c.b("memoization.parseMemoText", c.s.$a), c.b("memoization.unmemoizeDomNodeAndDescendants", c.s.nb), c.Sa = { throttle: function(e, t) { e.throttleEvaluation = t; var r = null; return c.j({ read: e, write: function(i) { clearTimeout(r), r = setTimeout(function() { e(i) }, t) } }) }, notify: function(t, r) { return t.equalityComparer = "always" == r ? e(!1) : c.m.fn.equalityComparer, t } }, c.b("extenders", c.Sa), c.kb = function(e, t, r) { this.target = e, this.la = t, this.wb = r, c.r(this, "dispose", this.B) }, c.kb.prototype.B = function() { this.Hb = !0, this.wb() }, c.V = function() { this.G = {}, c.a.extend(this, c.V.fn), c.r(this, "subscribe", this.Da), c.r(this, "extend", this.extend), c.r(this, "getSubscriptionsCount", this.Db) }, c.V.fn = { Da: function(e, t, r) { r = r || "change"; var i = new c.kb(this, t ? e.bind(t) : e, function() { c.a.ka(this.G[r], i) }.bind(this)); return this.G[r] || (this.G[r] = []), this.G[r].push(i), i }, notifySubscribers: function(e, t) { t = t || "change", this.G[t] && c.q.I(function() { c.a.p(this.G[t].slice(0), function(t) { t && !0 !== t.Hb && t.la(e) }) }, this) }, Db: function() { var e = 0; return c.a.w(this.G, function(t, r) { e += r.length }), e }, extend: function(e) { var t = this; return e && c.a.w(e, function(e, r) { var i = c.Sa[e]; "function" == typeof i && (t = i(t, r)) }), t } }, c.Wa = function(e) { return null != e && "function" == typeof e.Da && "function" == typeof e.notifySubscribers }, c.b("subscribable", c.V), c.b("isSubscribable", c.Wa), c.q = function() { var e = []; return { rb: function(t) { e.push({ la: t, Ra: [] }) }, end: function() { e.pop() }, bb: function(t) { if (!c.Wa(t)) throw Error("Only subscribable things can act as dependencies"); if (0 < e.length) { var r = e[e.length - 1];!r || 0 <= c.a.k(r.Ra, t) || (r.Ra.push(t), r.la(t)) } }, I: function(t, r, i) { try { return e.push(null), t.apply(r, i || []) } finally { e.pop() } } } }();
var h = { undefined: !0, "boolean": !0, number: !0, string: !0 };
c.m = function(e) {
function t() { return 0 < arguments.length ? (t.equalityComparer && t.equalityComparer(r, arguments[0]) || (t.K(), r = arguments[0], t.J()), this) : (c.q.bb(t), r) } var r = e; return c.V.call(t), t.t = function() { return r }, t.J = function() { t.notifySubscribers(r) }, t.K = function() { t.notifySubscribers(r, "beforeChange") }, c.a.extend(t, c.m.fn), c.r(t, "peek", t.t), c.r(t, "valueHasMutated", t.J), c.r(t, "valueWillMutate", t.K), t }, c.m.fn = { equalityComparer: function(e, t) { return null === e || typeof e in h ? e === t : !1 } };
var d = c.m.Pb = "__ko_proto__";
c.m.fn[d] = c.m, c.qa = function(e, t) { return null === e || e === i || e[d] === i ? !1 : e[d] === t ? !0 : c.qa(e[d], t) }, c.T = function(e) { return c.qa(e, c.m) }, c.Xa = function(e) { return "function" == typeof e && e[d] === c.m || "function" == typeof e && e[d] === c.j && e.Eb ? !0 : !1 }, c.b("observable", c.m), c.b("isObservable", c.T), c.b("isWriteableObservable", c.Xa), c.U = function(e) { if (e = e || [], "object" != typeof e || !("length" in e)) throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined."); return e = c.m(e), c.a.extend(e, c.U.fn), e }, c.U.fn = { remove: function(e) { for (var t = this.t(), r = [], i = "function" == typeof e ? e : function(t) { return t === e }, n = 0; n < t.length; n++) { var o = t[n];
i(o) && (0 === r.length && this.K(), r.push(o), t.splice(n, 1), n--) } return r.length && this.J(), r }, removeAll: function(e) { if (e === i) { var t = this.t(),
r = t.slice(0); return this.K(), t.splice(0, t.length), this.J(), r } return e ? this.remove(function(t) { return 0 <= c.a.k(e, t) }) : [] }, destroy: function(e) { var t = this.t(),
r = "function" == typeof e ? e : function(t) { return t === e };
this.K(); for (var i = t.length - 1; i >= 0; i--) r(t[i]) && (t[i]._destroy = !0);
this.J() }, destroyAll: function(t) { return t === i ? this.destroy(e(!0)) : t ? this.destroy(function(e) { return 0 <= c.a.k(t, e) }) : [] }, indexOf: function(e) { var t = this(); return c.a.k(t, e) }, replace: function(e, t) { var r = this.indexOf(e);
r >= 0 && (this.K(), this.t()[r] = t, this.J()) } }, c.a.p("pop push reverse shift sort splice unshift".split(" "), function(e) { c.U.fn[e] = function() { var t = this.t(); return this.K(), t = t[e].apply(t, arguments), this.J(), t } }), c.a.p(["slice"], function(e) { c.U.fn[e] = function() { var t = this(); return t[e].apply(t, arguments) } }), c.b("observableArray", c.U), c.j = function(t, r, n) {
function o() { c.a.p(_, function(e) { e.B() }), _ = [] }
function a() { var e = l.throttleEvaluation;
e && e >= 0 ? (clearTimeout(w), w = setTimeout(s, e)) : s() }
function s() { if (!m)
if (d && y()) g();
else { m = !0; try { var e = c.a.Z(_, function(e) { return e.target });
c.q.rb(function(t) { var r;
0 <= (r = c.a.k(e, t)) ? e[r] = i : _.push(t.Da(a)) }); for (var t = p.call(r), n = e.length - 1; n >= 0; n--) e[n] && _.splice(n, 1)[0].B();
d = !0, l.notifySubscribers(h, "beforeChange"), h = t, l.notifySubscribers(h) } finally { c.q.end(), m = !1 } _.length || g() } }
function l() { if (0 < arguments.length) { if ("function" != typeof f) throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters."); return f.apply(r, arguments), this } return d || s(), c.q.bb(l), h }
function u() { return !d || 0 < _.length } var h, d = !1,
m = !1,
p = t; if (p && "object" == typeof p ? (n = p, p = n.read) : (n = n || {}, p || (p = n.read)), "function" != typeof p) throw Error("Pass a function that returns the value of the ko.computed"); var f = n.write,
v = n.disposeWhenNodeIsRemoved || n.$ || null,
y = n.disposeWhen || n.Qa || e(!1),
g = o,
_ = [],
w = null; if (r || (r = n.owner), l.t = function() { return d || s(), h }, l.Cb = function() { return _.length }, l.Eb = "function" == typeof n.write, l.B = function() { g() }, l.ta = u, c.V.call(l), c.a.extend(l, c.j.fn), c.r(l, "peek", l.t), c.r(l, "dispose", l.B), c.r(l, "isActive", l.ta), c.r(l, "getDependenciesCount", l.Cb), !0 !== n.deferEvaluation && s(), v && u()) { g = function() { c.a.C.cb(v, g), o() }, c.a.C.ia(v, g); var C = y,
y = function() { return !c.a.aa(v) || C() } } return l }, c.Gb = function(e) { return c.qa(e, c.j) }, t = c.m.Pb, c.j[t] = c.m, c.j.fn = {}, c.j.fn[t] = c.j, c.b("dependentObservable", c.j), c.b("computed", c.j), c.b("isComputed", c.Gb),
function() {
function e(n, o, a) { if (a = a || new r, n = o(n), "object" != typeof n || null === n || n === i || n instanceof Date || n instanceof String || n instanceof Number || n instanceof Boolean) return n; var s = n instanceof Array ? [] : {}; return a.save(n, s), t(n, function(t) { var r = o(n[t]); switch (typeof r) {
case "boolean":
case "number":
case "string":
case "function":
s[t] = r; break;
case "object":
case "undefined":
var l = a.get(r);
s[t] = l !== i ? l : e(r, o, a) } }), s }
function t(e, t) { if (e instanceof Array) { for (var r = 0; r < e.length; r++) t(r); "function" == typeof e.toJSON && t("toJSON") } else
for (r in e) t(r) }
function r() { this.keys = [], this.Ha = [] } c.lb = function(t) { if (0 == arguments.length) throw Error("When calling ko.toJS, pass the object you want to convert."); return e(t, function(e) { for (var t = 0; c.T(e) && 10 > t; t++) e = e(); return e }) }, c.toJSON = function(e, t, r) { return e = c.lb(e), c.a.Ca(e, t, r) }, r.prototype = { save: function(e, t) { var r = c.a.k(this.keys, e);
r >= 0 ? this.Ha[r] = t : (this.keys.push(e), this.Ha.push(t)) }, get: function(e) { return e = c.a.k(this.keys, e), e >= 0 ? this.Ha[e] : i } } }(), c.b("toJS", c.lb), c.b("toJSON", c.toJSON),
function() { c.h = { n: function(e) { switch (c.a.u(e)) {
case "option":
return !0 === e.__ko__hasDomDataOptionValue__ ? c.a.f.get(e, c.d.options.wa) : 7 >= c.a.ca ? e.getAttributeNode("value") && e.getAttributeNode("value").specified ? e.value : e.text : e.value;
case "select":
return 0 <= e.selectedIndex ? c.h.n(e.options[e.selectedIndex]) : i;
default:
return e.value } }, W: function(e, t) { switch (c.a.u(e)) {
case "option":
switch (typeof t) {
case "string":
c.a.f.set(e, c.d.options.wa, i), "__ko__hasDomDataOptionValue__" in e && delete e.__ko__hasDomDataOptionValue__, e.value = t; break;
default:
c.a.f.set(e, c.d.options.wa, t), e.__ko__hasDomDataOptionValue__ = !0, e.value = "number" == typeof t ? t : "" } break;
case "select":
"" === t && (t = i), (null === t || t === i) && (e.selectedIndex = -1); for (var r = e.options.length - 1; r >= 0; r--)
if (c.h.n(e.options[r]) == t) { e.selectedIndex = r; break }
1 < e.size || -1 !== e.selectedIndex || (e.selectedIndex = 0); break;
default:
(null === t || t === i) && (t = ""), e.value = t } } } }(), c.b("selectExtensions", c.h), c.b("selectExtensions.readValue", c.h.n), c.b("selectExtensions.writeValue", c.h.W), c.g = function() {
function e(e, r) { for (var i = null; e != i;) i = e, e = e.replace(t, function(e, t) { return r[t] }); return e } var t = /\@ko_token_(\d+)\@/g,
r = ["true", "false", "null", "undefined"],
i = /^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i; return { S: [], da: function(t) { var r = c.a.F(t); if (3 > r.length) return []; "{" === r.charAt(0) && (r = r.substring(1, r.length - 1)), t = []; for (var i, n = null, o = 0; o < r.length; o++) { var a = r.charAt(o); if (null === n) switch (a) {
case '"':
case "'":
case "/":
n = o, i = a } else if (a == i && "\\" !== r.charAt(o - 1)) { a = r.substring(n, o + 1), t.push(a); var s = "@ko_token_" + (t.length - 1) + "@",
r = r.substring(0, n) + s + r.substring(o + 1),
o = o - (a.length - s.length),
n = null } } i = n = null; for (var l = 0, u = null, o = 0; o < r.length; o++) { if (a = r.charAt(o), null === n) switch (a) {
case "{":
n = o, u = a, i = "}"; break;
case "(":
n = o, u = a, i = ")"; break;
case "[":
n = o, u = a, i = "]" } a === u ? l++ : a === i && (l--, 0 === l && (a = r.substring(n, o + 1), t.push(a), s = "@ko_token_" + (t.length - 1) + "@", r = r.substring(0, n) + s + r.substring(o + 1), o -= a.length - s.length, n = null)) } for (i = [], r = r.split(","), n = 0, o = r.length; o > n; n++) l = r[n], u = l.indexOf(":"), u > 0 && u < l.length - 1 ? (a = l.substring(u + 1), i.push({ key: e(l.substring(0, u), t), value: e(a, t) })) : i.push({ unknown: e(l, t) }); return i }, ea: function(e) { var t = "string" == typeof e ? c.g.da(e) : e,
n = [];
e = []; for (var o, a = 0; o = t[a]; a++)
if (0 < n.length && n.push(","), o.key) { var s;
e: { s = o.key; var l = c.a.F(s); switch (l.length && l.charAt(0)) {
case "'":
case '"':
break e;
default:
s = "'" + l + "'" } } o = o.value, n.push(s), n.push(":"), n.push(o), o = c.a.F(o), 0 <= c.a.k(r, c.a.F(o).toLowerCase()) ? o = !1 : (l = o.match(i), o = null === l ? !1 : l[1] ? "Object(" + l[1] + ")" + l[2] : o), o && (0 < e.length && e.push(", "), e.push(s + " : function(__ko_value) { " + o + " = __ko_value; }")) } else o.unknown && n.push(o.unknown); return t = n.join(""), 0 < e.length && (t = t + ", '_ko_property_writers' : { " + e.join("") + " } "), t }, Jb: function(e, t) { for (var r = 0; r < e.length; r++)
if (c.a.F(e[r].key) == t) return !0; return !1 }, ha: function(e, t, r, i, n) { e && c.T(e) ? !c.Xa(e) || n && e.t() === i || e(i) : (e = t()._ko_property_writers) && e[r] && e[r](i) } } }(), c.b("expressionRewriting", c.g), c.b("expressionRewriting.bindingRewriteValidators", c.g.S), c.b("expressionRewriting.parseObjectLiteral", c.g.da), c.b("expressionRewriting.preProcessBindings", c.g.ea), c.b("jsonExpressionRewriting", c.g), c.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson", c.g.ea),
function() {
function e(e) { return 8 == e.nodeType && (n ? e.text : e.nodeValue).match(a) }
function t(e) { return 8 == e.nodeType && (n ? e.text : e.nodeValue).match(s) }
function r(r, i) { for (var n = r, o = 1, a = []; n = n.nextSibling;) { if (t(n) && (o--, 0 === o)) return a;
a.push(n), e(n) && o++ } if (!i) throw Error("Cannot find closing comment tag to match: " + r.nodeValue); return null }
function i(e, t) { var i = r(e, t); return i ? 0 < i.length ? i[i.length - 1].nextSibling : e.nextSibling : null } var n = o && "" === o.createComment("test").text,
a = n ? /^\x3c!--\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*--\x3e$/ : /^\s*ko(?:\s+(.+\s*\:[\s\S]*))?\s*$/,
s = n ? /^\x3c!--\s*\/ko\s*--\x3e$/ : /^\s*\/ko\s*$/,
l = { ul: !0, ol: !0 };
c.e = { L: {}, childNodes: function(t) { return e(t) ? r(t) : t.childNodes }, ba: function(t) { if (e(t)) { t = c.e.childNodes(t); for (var r = 0, i = t.length; i > r; r++) c.removeNode(t[r]) } else c.a.oa(t) }, P: function(t, r) { if (e(t)) { c.e.ba(t); for (var i = t.nextSibling, n = 0, o = r.length; o > n; n++) i.parentNode.insertBefore(r[n], i) } else c.a.P(t, r) }, ab: function(t, r) { e(t) ? t.parentNode.insertBefore(r, t.nextSibling) : t.firstChild ? t.insertBefore(r, t.firstChild) : t.appendChild(r) }, Va: function(t, r, i) { i ? e(t) ? t.parentNode.insertBefore(r, i.nextSibling) : i.nextSibling ? t.insertBefore(r, i.nextSibling) : t.appendChild(r) : c.e.ab(t, r) }, firstChild: function(r) { return e(r) ? !r.nextSibling || t(r.nextSibling) ? null : r.nextSibling : r.firstChild }, nextSibling: function(r) { return e(r) && (r = i(r)), r.nextSibling && t(r.nextSibling) ? null : r.nextSibling }, ob: function(t) { return (t = e(t)) ? t[1] : null }, Za: function(r) { if (l[c.a.u(r)]) { var n = r.firstChild; if (n)
do
if (1 === n.nodeType) { var o;
o = n.firstChild; var a = null; if (o)
do
if (a) a.push(o);
else if (e(o)) { var s = i(o, !0);
s ? o = s : a = [o] } else t(o) && (a = [o]); while (o = o.nextSibling); if (o = a)
for (a = n.nextSibling, s = 0; s < o.length; s++) a ? r.insertBefore(o[s], a) : r.appendChild(o[s]) }
while (n = n.nextSibling) } } } }(), c.b("virtualElements", c.e), c.b("virtualElements.allowedBindings", c.e.L), c.b("virtualElements.emptyNode", c.e.ba), c.b("virtualElements.insertAfter", c.e.Va), c.b("virtualElements.prepend", c.e.ab), c.b("virtualElements.setDomNodeChildren", c.e.P),
function() { c.M = function() { this.Na = {} }, c.a.extend(c.M.prototype, { nodeHasBindings: function(e) { switch (e.nodeType) {
case 1:
return null != e.getAttribute("data-bind");
case 8:
return null != c.e.ob(e);
default:
return !1 } }, getBindings: function(e, t) { var r = this.getBindingsString(e, t); return r ? this.parseBindingsString(r, t, e) : null }, getBindingsString: function(e) { switch (e.nodeType) {
case 1:
return e.getAttribute("data-bind");
case 8:
return c.e.ob(e);
default:
return null } }, parseBindingsString: function(e, t, r) { try { var i; if (!(i = this.Na[e])) { var n, o = this.Na,
a = "with($context){with($data||{}){return{" + c.g.ea(e) + "}}}";
n = new Function("$context", "$element", a), i = o[e] = n } return i(t, r) } catch (s) { throw s.message = "Unable to parse bindings.\nBindings value: " + e + "\nMessage: " + s.message, s } } }), c.M.instance = new c.M }(), c.b("bindingProvider", c.M),
function() {
function e(e, r, i) { for (var n = c.e.firstChild(r); r = n;) n = c.e.nextSibling(r), t(e, r, i) }
function t(t, i, n) { var o = !0,
a = 1 === i.nodeType;
a && c.e.Za(i), (a && n || c.M.instance.nodeHasBindings(i)) && (o = r(i, null, t, n).Sb), o && e(t, i, !a) }
function r(e, t, r, n) {
function a(e) { return function() { return l[e] } }
function s() { return l } var l, u, h = 0,
d = c.a.f.get(e, o); if (!t) { if (d) throw Error("You cannot apply bindings multiple times to the same element.");
c.a.f.set(e, o, !0) } return c.j(function() { var o = r && r instanceof c.A ? r : new c.A(c.a.c(r)),
m = o.$data;!d && n && c.jb(e, o), (l = ("function" == typeof t ? t(o, e) : t) || c.M.instance.getBindings(e, o)) && (0 === h && (h = 1, c.a.w(l, function(t) { var r = c.d[t]; if (r && 8 === e.nodeType && !c.e.L[t]) throw Error("The binding '" + t + "' cannot be used with virtual elements"); if (r && "function" == typeof r.init && (r = r.init(e, a(t), s, m, o)) && r.controlsDescendantBindings) { if (u !== i) throw Error("Multiple bindings (" + u + " and " + t + ") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");
u = t } }), h = 2), 2 === h && c.a.w(l, function(t) { var r = c.d[t];
r && "function" == typeof r.update && r.update(e, a(t), s, m, o) })) }, null, { $: e }), { Sb: u === i } } c.d = {}, c.A = function(e, t, r) { t ? (c.a.extend(this, t), this.$parentContext = t, this.$parent = t.$data, this.$parents = (t.$parents || []).slice(0), this.$parents.unshift(this.$parent)) : (this.$parents = [], this.$root = e, this.ko = c), this.$data = e, r && (this[r] = e) }, c.A.prototype.createChildContext = function(e, t) { return new c.A(e, this, t) }, c.A.prototype.extend = function(e) { var t = c.a.extend(new c.A, this); return c.a.extend(t, e) }; var o = "__ko_boundElement";
c.jb = function(e, t) { return 2 != arguments.length ? c.a.f.get(e, "__ko_bindingContext__") : (c.a.f.set(e, "__ko_bindingContext__", t), void 0) }, c.Ka = function(e, t, i) { return 1 === e.nodeType && c.e.Za(e), r(e, t, i, !0) }, c.Ja = function(t, r) { 1 !== r.nodeType && 8 !== r.nodeType || e(t, r, !0) }, c.Ia = function(e, r) { if (r && 1 !== r.nodeType && 8 !== r.nodeType) throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");
r = r || n.document.body, t(e, r, !0) }, c.na = function(e) { switch (e.nodeType) {
case 1:
case 8:
var t = c.jb(e); if (t) return t; if (e.parentNode) return c.na(e.parentNode) } return i }, c.ub = function(e) { return (e = c.na(e)) ? e.$data : i }, c.b("bindingHandlers", c.d), c.b("applyBindings", c.Ia), c.b("applyBindingsToDescendants", c.Ja), c.b("applyBindingsToNode", c.Ka), c.b("contextFor", c.na), c.b("dataFor", c.ub) }();
var m = { "class": "className", "for": "htmlFor" };
c.d.attr = { update: function(e, t) { var r = c.a.c(t()) || {};
c.a.w(r, function(t, r) { r = c.a.c(r); var n = !1 === r || null === r || r === i;
n && e.removeAttribute(t), 8 >= c.a.ca && t in m ? (t = m[t], n ? e.removeAttribute(t) : e[t] = r) : n || e.setAttribute(t, r.toString()), "name" === t && c.a.gb(e, n ? "" : r.toString()) }) } }, c.d.checked = { init: function(t, r, i) { c.a.o(t, "click", function() { var e; if ("checkbox" == t.type) e = t.checked;
else { if ("radio" != t.type || !t.checked) return;
e = t.value } var n = r(),
o = c.a.c(n); "checkbox" == t.type && o instanceof Array ? c.a.ja(n, t.value, t.checked) : c.g.ha(n, i, "checked", e, !0) }), "radio" != t.type || t.name || c.d.uniqueName.init(t, e(!0)) }, update: function(e, t) { var r = c.a.c(t()); "checkbox" == e.type ? e.checked = r instanceof Array ? 0 <= c.a.k(r, e.value) : r : "radio" == e.type && (e.checked = e.value == r) } }, c.d.css = { update: function(e, t) { var r = c.a.c(t()); "object" == typeof r ? c.a.w(r, function(t, r) { r = c.a.c(r), c.a.ga(e, t, r) }) : (r = String(r || ""), c.a.ga(e, e.__ko__cssValue, !1), e.__ko__cssValue = r, c.a.ga(e, r, !0)) } }, c.d.enable = { update: function(e, t) { var r = c.a.c(t());
r && e.disabled ? e.removeAttribute("disabled") : r || e.disabled || (e.disabled = !0) } }, c.d.disable = { update: function(e, t) { c.d.enable.update(e, function() { return !c.a.c(t()) }) } }, c.d.event = { init: function(e, t, r, i) { var n = t() || {};
c.a.w(n, function(n) { "string" == typeof n && c.a.o(e, n, function(e) { var o, a = t()[n]; if (a) { var s = r(); try { var l = c.a.N(arguments);
l.unshift(i), o = a.apply(i, l) } finally {!0 !== o && (e.preventDefault ? e.preventDefault() : e.returnValue = !1) }!1 === s[n + "Bubble"] && (e.cancelBubble = !0, e.stopPropagation && e.stopPropagation()) } }) }) } }, c.d.foreach = { Ya: function(e) { return function() { var t = e(),
r = c.a.ya(t); return r && "number" != typeof r.length ? (c.a.c(t), { foreach: r.data, as: r.as, includeDestroyed: r.includeDestroyed, afterAdd: r.afterAdd, beforeRemove: r.beforeRemove, afterRender: r.afterRender, beforeMove: r.beforeMove, afterMove: r.afterMove, templateEngine: c.D.sa }) : { foreach: t, templateEngine: c.D.sa } } }, init: function(e, t) { return c.d.template.init(e, c.d.foreach.Ya(t)) }, update: function(e, t, r, i, n) { return c.d.template.update(e, c.d.foreach.Ya(t), r, i, n) } }, c.g.S.foreach = !1, c.e.L.foreach = !0, c.d.hasfocus = { init: function(e, t, r) {
function i(i) { e.__ko_hasfocusUpdating = !0; var n = e.ownerDocument; if ("activeElement" in n) { var o; try { o = n.activeElement } catch (a) { o = n.body } i = o === e } n = t(), c.g.ha(n, r, "hasfocus", i, !0), e.__ko_hasfocusLastValue = i, e.__ko_hasfocusUpdating = !1 } var n = i.bind(null, !0),
o = i.bind(null, !1);
c.a.o(e, "focus", n), c.a.o(e, "focusin", n), c.a.o(e, "blur", o), c.a.o(e, "focusout", o) }, update: function(e, t) { var r = !!c.a.c(t());
e.__ko_hasfocusUpdating || e.__ko_hasfocusLastValue === r || (r ? e.focus() : e.blur(), c.q.I(c.a.Ga, null, [e, r ? "focusin" : "focusout"])) } }, c.d.hasFocus = c.d.hasfocus, c.d.html = { init: function() { return { controlsDescendantBindings: !0 } }, update: function(e, t) { c.a.fa(e, t()) } };
var p = "__ko_withIfBindingData";
r("if"), r("ifnot", !1, !0), r("with", !0, !1, function(e, t) { return e.createChildContext(t) }), c.d.options = { init: function(e) { if ("select" !== c.a.u(e)) throw Error("options binding applies only to SELECT elements"); for (; 0 < e.length;) e.remove(0); return { controlsDescendantBindings: !0 } }, update: function(e, t, r) {
function n(e, t, r) { var i = typeof t; return "function" == i ? t(e) : "string" == i ? e[t] : r }
function a(e, t) { if (d) { var r = 0 <= c.a.k(d, c.h.n(t[0]));
c.a.hb(t[0], r) } } var s = 0 == e.length,
l = !s && e.multiple ? e.scrollTop : null;
t = c.a.c(t()); var h, d, m = r(),
p = m.optionsIncludeDestroyed,
f = {}; if (e.multiple ? d = c.a.Z(e.selectedOptions || c.a.Y(e.childNodes, function(e) { return e.tagName && "option" === c.a.u(e) && e.selected }), function(e) { return c.h.n(e) }) : 0 <= e.selectedIndex && (d = [c.h.n(e.options[e.selectedIndex])]), t) { "undefined" == typeof t.length && (t = [t]); var v = c.a.Y(t, function(e) { return p || e === i || null === e || !c.a.c(e._destroy) }); "optionsCaption" in m && (h = c.a.c(m.optionsCaption), null !== h && h !== i && v.unshift(f)) } else t = [];
r = a, m.optionsAfterRender && (r = function(e, t) { a(0, t), c.q.I(m.optionsAfterRender, null, [t[0], e !== f ? e : i]) }), c.a.Aa(e, v, function(e, t, r) { return r.length && (d = r[0].selected && [c.h.n(r[0])]), t = o.createElement("option"), e === f ? (c.a.fa(t, h), c.h.W(t, i)) : (r = n(e, m.optionsValue, e), c.h.W(t, c.a.c(r)), e = n(e, m.optionsText, r), c.a.ib(t, e)), [t] }, null, r), d = null, s && "value" in m && u(e, c.a.ya(m.value), !0), c.a.zb(e), l && 20 < Math.abs(l - e.scrollTop) && (e.scrollTop = l) } }, c.d.options.wa = "__ko.optionValueDomData__", c.d.selectedOptions = {
init: function(e, t, r) { c.a.o(e, "change", function() { var i = t(),
n = [];
c.a.p(e.getElementsByTagName("option"), function(e) { e.selected && n.push(c.h.n(e)) }), c.g.ha(i, r, "selectedOptions", n) }) },
update: function(e, t) {
if ("select" != c.a.u(e)) throw Error("values binding applies only to SELECT elements");
var r = c.a.c(t());
r && "number" == typeof r.length && c.a.p(e.getElementsByTagName("option"), function(e) { var t = 0 <= c.a.k(r, c.h.n(e));
c.a.hb(e, t) })
}
}, c.d.style = { update: function(e, t) { var r = c.a.c(t() || {});
c.a.w(r, function(t, r) { r = c.a.c(r), e.style[t] = r || "" }) } }, c.d.submit = { init: function(e, t, r, i) { if ("function" != typeof t()) throw Error("The value for a submit binding must be a function");
c.a.o(e, "submit", function(r) { var n, o = t(); try { n = o.call(i, e) } finally {!0 !== n && (r.preventDefault ? r.preventDefault() : r.returnValue = !1) } }) } }, c.d.text = { update: function(e, t) { c.a.ib(e, t()) } }, c.e.L.text = !0, c.d.uniqueName = { init: function(e, t) { if (t()) { var r = "ko_unique_" + ++c.d.uniqueName.tb;
c.a.gb(e, r) } } }, c.d.uniqueName.tb = 0, c.d.value = { init: function(e, t, r) {
function i() { a = !1; var i = t(),
n = c.h.n(e);
c.g.ha(i, r, "value", n) } var n = ["change"],
o = r().valueUpdate,
a = !1;
o && ("string" == typeof o && (o = [o]), c.a.R(n, o), n = c.a.Ma(n)), !c.a.ca || "input" != e.tagName.toLowerCase() || "text" != e.type || "off" == e.autocomplete || e.form && "off" == e.form.autocomplete || -1 != c.a.k(n, "propertychange") || (c.a.o(e, "propertychange", function() { a = !0 }), c.a.o(e, "blur", function() { a && i() })), c.a.p(n, function(t) { var r = i;
c.a.Tb(t, "after") && (r = function() { setTimeout(i, 0) }, t = t.substring(5)), c.a.o(e, t, r) }) }, update: function(e, t) { var r = "select" === c.a.u(e),
i = c.a.c(t()),
n = c.h.n(e);
i !== n && (n = function() { c.h.W(e, i) }, n(), r && setTimeout(n, 0)), r && 0 < e.length && u(e, i, !1) } }, c.d.visible = { update: function(e, t) { var r = c.a.c(t()),
i = "none" != e.style.display;
r && !i ? e.style.display = "" : !r && i && (e.style.display = "none") } },
function(e) { c.d[e] = { init: function(t, r, i, n) { return c.d.event.init.call(this, t, function() { var t = {}; return t[e] = r(), t }, i, n) } } }("click"), c.v = function() {}, c.v.prototype.renderTemplateSource = function() { throw Error("Override renderTemplateSource") }, c.v.prototype.createJavaScriptEvaluatorBlock = function() { throw Error("Override createJavaScriptEvaluatorBlock") }, c.v.prototype.makeTemplateSource = function(e, t) { if ("string" == typeof e) { t = t || o; var r = t.getElementById(e); if (!r) throw Error("Cannot find template with ID " + e); return new c.l.i(r) } if (1 == e.nodeType || 8 == e.nodeType) return new c.l.Q(e); throw Error("Unknown template type: " + e) }, c.v.prototype.renderTemplate = function(e, t, r, i) { return e = this.makeTemplateSource(e, i), this.renderTemplateSource(e, t, r) }, c.v.prototype.isTemplateRewritten = function(e, t) { return !1 === this.allowTemplateRewriting ? !0 : this.makeTemplateSource(e, t).data("isRewritten") }, c.v.prototype.rewriteTemplate = function(e, t, r) { e = this.makeTemplateSource(e, r), t = t(e.text()), e.text(t), e.data("isRewritten", !0) }, c.b("templateEngine", c.v), c.Ea = function() {
function e(e, t, r, i) { e = c.g.da(e); for (var n = c.g.S, o = 0; o < e.length; o++) { var a = e[o].key; if (n.hasOwnProperty(a)) { var s = n[a]; if ("function" == typeof s) { if (a = s(e[o].value)) throw Error(a) } else if (!s) throw Error("This template engine does not support the '" + a + "' binding within its templates") } } return r = "ko.__tr_ambtns(function($context,$element){return(function(){return{ " + c.g.ea(e) + " } })()},'" + r.toLowerCase() + "')", i.createJavaScriptEvaluatorBlock(r) + t } var t = /(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,
r = /\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g; return { Ab: function(e, t, r) { t.isTemplateRewritten(e, r) || t.rewriteTemplate(e, function(e) { return c.Ea.Lb(e, t) }, r) }, Lb: function(i, n) { return i.replace(t, function(t, r, i, o, a) { return e(a, r, i, n) }).replace(r, function(t, r) { return e(r, "", "#comment", n) }) }, qb: function(e, t) { return c.s.va(function(r, i) { var n = r.nextSibling;
n && n.nodeName.toLowerCase() === t && c.Ka(n, e, i) }) } } }(), c.b("__tr_ambtns", c.Ea.qb),
function() { c.l = {}, c.l.i = function(e) { this.i = e }, c.l.i.prototype.text = function() { var e = c.a.u(this.i),
e = "script" === e ? "text" : "textarea" === e ? "value" : "innerHTML"; if (0 == arguments.length) return this.i[e]; var t = arguments[0]; "innerHTML" === e ? c.a.fa(this.i, t) : this.i[e] = t }, c.l.i.prototype.data = function(e) { return 1 === arguments.length ? c.a.f.get(this.i, "templateSourceData_" + e) : (c.a.f.set(this.i, "templateSourceData_" + e, arguments[1]), void 0) }, c.l.Q = function(e) { this.i = e }, c.l.Q.prototype = new c.l.i, c.l.Q.prototype.text = function() { if (0 == arguments.length) { var e = c.a.f.get(this.i, "__ko_anon_template__") || {}; return e.Fa === i && e.ma && (e.Fa = e.ma.innerHTML), e.Fa } c.a.f.set(this.i, "__ko_anon_template__", { Fa: arguments[0] }) }, c.l.i.prototype.nodes = function() { return 0 == arguments.length ? (c.a.f.get(this.i, "__ko_anon_template__") || {}).ma : (c.a.f.set(this.i, "__ko_anon_template__", { ma: arguments[0] }), void 0) }, c.b("templateSources", c.l), c.b("templateSources.domElement", c.l.i), c.b("templateSources.anonymousTemplate", c.l.Q) }(),
function() {
function e(e, t, r) { var i; for (t = c.e.nextSibling(t); e && (i = e) !== t;) e = c.e.nextSibling(i), 1 !== i.nodeType && 8 !== i.nodeType || r(i) }
function t(t, r) { if (t.length) { var i = t[0],
n = t[t.length - 1];
e(i, n, function(e) { c.Ia(r, e) }), e(i, n, function(e) { c.s.nb(e, [r]) }) } }
function r(e) { return e.nodeType ? e : 0 < e.length ? e[0] : null }
function n(e, i, n, a, s) { s = s || {}; var l = e && r(e),
l = l && l.ownerDocument,
u = s.templateEngine || o; if (c.Ea.Ab(n, u, l), n = u.renderTemplate(n, a, s, l), "number" != typeof n.length || 0 < n.length && "number" != typeof n[0].nodeType) throw Error("Template engine must return an array of DOM nodes"); switch (l = !1, i) {
case "replaceChildren":
c.e.P(e, n), l = !0; break;
case "replaceNode":
c.a.eb(e, n), l = !0; break;
case "ignoreTargetNode":
break;
default:
throw Error("Unknown renderMode: " + i) } return l && (t(n, a), s.afterRender && c.q.I(s.afterRender, null, [n, a.$data])), n } var o;
c.Ba = function(e) { if (e != i && !(e instanceof c.v)) throw Error("templateEngine must inherit from ko.templateEngine");
o = e }, c.za = function(e, t, a, s, l) { if (a = a || {}, (a.templateEngine || o) == i) throw Error("Set a template engine before calling renderTemplate"); if (l = l || "replaceChildren", s) { var u = r(s); return c.j(function() { var i = t && t instanceof c.A ? t : new c.A(c.a.c(t)),
o = "function" == typeof e ? e(i.$data, i) : e,
i = n(s, l, o, i, a); "replaceNode" == l && (s = i, u = r(s)) }, null, { Qa: function() { return !u || !c.a.aa(u) }, $: u && "replaceNode" == l ? u.parentNode : u }) } return c.s.va(function(r) { c.za(e, t, a, r, "replaceNode") }) }, c.Rb = function(e, r, o, a, s) {
function l(e, r) { t(r, h), o.afterRender && o.afterRender(r, e) }
function u(t, r) { h = s.createChildContext(c.a.c(t), o.as), h.$index = r; var i = "function" == typeof e ? e(t, h) : e; return n(null, "ignoreTargetNode", i, h, o) } var h; return c.j(function() { var e = c.a.c(r) || []; "undefined" == typeof e.length && (e = [e]), e = c.a.Y(e, function(e) { return o.includeDestroyed || e === i || null === e || !c.a.c(e._destroy) }), c.q.I(c.a.Aa, null, [a, e, u, o, l]) }, null, { $: a }) }, c.d.template = { init: function(e, t) { var r = c.a.c(t()); return "string" == typeof r || r.name || 1 != e.nodeType && 8 != e.nodeType || (r = 1 == e.nodeType ? e.childNodes : c.e.childNodes(e), r = c.a.Mb(r), new c.l.Q(e).nodes(r)), { controlsDescendantBindings: !0 } }, update: function(e, t, r, n, o) { t = c.a.c(t()), r = {}, n = !0; var a, s = null; "string" != typeof t && (r = t, t = c.a.c(r.name), "if" in r && (n = c.a.c(r["if"])), n && "ifnot" in r && (n = !c.a.c(r.ifnot)), a = c.a.c(r.data)), "foreach" in r ? s = c.Rb(t || e, n && r.foreach || [], r, e, o) : n ? (o = "data" in r ? o.createChildContext(a, r.as) : o, s = c.za(t || e, o, r, e)) : c.e.ba(e), o = s, (a = c.a.f.get(e, "__ko__templateComputedDomDataKey__")) && "function" == typeof a.B && a.B(), c.a.f.set(e, "__ko__templateComputedDomDataKey__", o && o.ta() ? o : i) } }, c.g.S.template = function(e) { return e = c.g.da(e), 1 == e.length && e[0].unknown || c.g.Jb(e, "name") ? null : "This template engine does not support anonymous templates nested within its templates" }, c.e.L.template = !0 }(), c.b("setTemplateEngine", c.Ba), c.b("renderTemplate", c.za), c.a.Pa = function() {
function e(e, t, r, i, n) { var o, a, s, l, u, c = Math.min,
h = Math.max,
d = [],
m = e.length,
p = t.length,
f = p - m || 1,
v = m + p + 1; for (o = 0; m >= o; o++)
for (l = s, d.push(s = []), u = c(p, o + f), a = h(0, o - 1); u >= a; a++) s[a] = a ? o ? e[o - 1] === t[a - 1] ? l[a - 1] : c(l[a] || v, s[a - 1] || v) + 1 : a + 1 : o + 1; for (c = [], h = [], f = [], o = m, a = p; o || a;) p = d[o][a] - 1, a && p === d[o][a - 1] ? h.push(c[c.length] = { status: r, value: t[--a], index: a }) : o && p === d[o - 1][a] ? f.push(c[c.length] = { status: i, value: e[--o], index: o }) : (c.push({ status: "retained", value: t[--a] }), --o); if (h.length && f.length) { e = 10 * m; var y; for (t = r = 0;
(n || e > t) && (y = h[r]); r++) { for (i = 0; d = f[i]; i++)
if (y.value === d.value) { y.moved = d.index, d.moved = y.index, f.splice(i, 1), t = i = 0; break }
t += i } } return c.reverse() } return function(t, r, i) { return t = t || [], r = r || [], t.length <= r.length ? e(t, r, "added", "deleted", i) : e(r, t, "deleted", "added", i) } }(), c.b("utils.compareArrays", c.a.Pa),
function() {
function e(e) { for (; e.length && !c.a.aa(e[0]);) e.splice(0, 1); if (1 < e.length) { for (var t = e[0], r = e[e.length - 1], i = [t]; t !== r;) { if (t = t.nextSibling, !t) return;
i.push(t) } Array.prototype.splice.apply(e, [0, e.length].concat(i)) } return e }
function t(t, r, n, o, a) { var s = []; return t = c.j(function() { var t = r(n, a, e(s)) || [];
0 < s.length && (c.a.eb(s, t), o && c.q.I(o, null, [n, t, a])), s.splice(0, s.length), c.a.R(s, t) }, null, { $: t, Qa: function() { return !c.a.pb(s) } }), { O: s, j: t.ta() ? t : i } } c.a.Aa = function(r, n, o, a, s) {
function l(t, r) { w = d[r], y !== r && (S[t] = w), w.ra(y++), e(w.O), f.push(w), _.push(w) }
function u(e, t) { if (e)
for (var r = 0, i = t.length; i > r; r++) t[r] && c.a.p(t[r].O, function(i) { e(i, r, t[r].X) }) } n = n || [], a = a || {}; var h = c.a.f.get(r, "setDomNodeChildrenFromArrayMapping_lastMappingResult") === i,
d = c.a.f.get(r, "setDomNodeChildrenFromArrayMapping_lastMappingResult") || [],
m = c.a.Z(d, function(e) { return e.X }),
p = c.a.Pa(m, n, a.dontLimitMoves),
f = [],
v = 0,
y = 0,
g = [],
_ = [];
n = []; for (var w, C, x, S = [], m = [], E = 0; C = p[E]; E++) switch (x = C.moved, C.status) {
case "deleted":
x === i && (w = d[v], w.j && w.j.B(), g.push.apply(g, e(w.O)), a.beforeRemove && (n[E] = w, _.push(w))), v++; break;
case "retained":
l(E, v++); break;
case "added":
x !== i ? l(E, x) : (w = { X: C.value, ra: c.m(y++) }, f.push(w), _.push(w), h || (m[E] = w)) } u(a.beforeMove, S), c.a.p(g, a.beforeRemove ? c.H : c.removeNode); for (var b, E = 0, h = c.e.firstChild(r); w = _[E]; E++) { for (w.O || c.a.extend(w, t(r, o, w.X, s, w.ra)), v = 0; p = w.O[v]; h = p.nextSibling, b = p, v++) p !== h && c.e.Va(r, p, b);!w.Fb && s && (s(w.X, w.O, w.ra), w.Fb = !0) } u(a.beforeRemove, n), u(a.afterMove, S), u(a.afterAdd, m), c.a.f.set(r, "setDomNodeChildrenFromArrayMapping_lastMappingResult", f) } }(), c.b("utils.setDomNodeChildrenFromArrayMapping", c.a.Aa), c.D = function() { this.allowTemplateRewriting = !1 }, c.D.prototype = new c.v, c.D.prototype.renderTemplateSource = function(e) { var t = (9 > c.a.ca ? 0 : e.nodes) ? e.nodes() : null; return t ? c.a.N(t.cloneNode(!0).childNodes) : (e = e.text(), c.a.xa(e)) }, c.D.sa = new c.D, c.Ba(c.D.sa), c.b("nativeTemplateEngine", c.D),
function() { c.ua = function() { var e = this.Ib = function() { if ("undefined" == typeof s || !s.tmpl) return 0; try { if (0 <= s.tmpl.tag.tmpl.open.toString().indexOf("__")) return 2 } catch (e) {} return 1 }();
this.renderTemplateSource = function(t, r, i) { if (i = i || {}, 2 > e) throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later."); var n = t.data("precompiled"); return n || (n = t.text() || "", n = s.template(null, "{{ko_with $item.koBindingContext}}" + n + "{{/ko_with}}"), t.data("precompiled", n)), t = [r.$data], r = s.extend({ koBindingContext: r }, i.templateOptions), r = s.tmpl(n, t, r), r.appendTo(o.createElement("div")), s.fragments = {}, r }, this.createJavaScriptEvaluatorBlock = function(e) { return "{{ko_code ((function() { return " + e + " })()) }}" }, this.addTemplate = function(e, t) { o.write("") }, e > 0 && (s.tmpl.tag.ko_code = { open: "__.push($1 || '');" }, s.tmpl.tag.ko_with = { open: "with($1) {", close: "} " }) }, c.ua.prototype = new c.v; var e = new c.ua;
0 < e.Ib && c.Ba(e), c.b("jqueryTmplTemplateEngine", c.ua) }()
})
}()
}(), r("ThirdParty/weakmap", ["exports"], function(e) { void
function(t, r, i) {
function n(e, t, r) { return "function" == typeof t && (r = t, t = o(r).replace(/_$/, "")), c(e, t, { configurable: !0, writable: !0, value: r }) }
function o(e) { return "function" != typeof e ? "" : "_name" in e ? e._name : "name" in e ? e.name : h.call(e).match(p)[1] }
function a(e, t) { return t._name = e, t } if ("WeakMap" in t) return e.WeakMap = t.WeakMap, void 0; var s = function() { try { return "x" in Object.defineProperty({}, "x", {}) } catch (e) { return !1 } }(),
l = Array.prototype.forEach ? Array.prototype.forEach : function(e, t) { for (var r = 0, i = this.length; i > r; ++r) e.call(t, this[r], r, this) },
u = Object.getOwnPropertyNames,
c = s ? Object.defineProperty : function(e) { return e },
h = Function.prototype.toString,
d = Object.create ? Object.create : function(e) {
function t() {} return t.prototype = e, new t },
m = Object.prototype.hasOwnProperty,
p = /^\n?function\s?(\w*)?_?\(/,
f = function() {
function e() { var e = s(),
i = {};
this.unlock = function(n) { var o = h(n); if (m.call(o, e)) return o[e](i); var a = d(null, t); return c(o, e, { value: new Function("s", "l", r)(i, a) }), a } } var t = { value: { writable: !0, value: i } },
r = "return function(k){if(k===s)return l}",
o = d(null),
s = function() { var e = Math.random().toString(36).slice(2); return e in o ? s() : o[e] = e },
l = s(),
h = function(e) { if (m.call(e, l)) return e[l]; if (!Object.isExtensible(e)) throw new TypeError("Object must be extensible"); var t = d(null); return c(e, l, { value: t }), t }; return n(Object, a("getOwnPropertyNames", function(e) { var t = u(e); return m.call(e, l) && t.splice(t.indexOf(l), 1), t })), n(e.prototype, a("get", function(e) { return this.unlock(e).value })), n(e.prototype, a("set", function(e, t) { this.unlock(e).value = t })), e }(),
v = function(e) {
function s(e) { return this === t || null == this || this === s.prototype ? new s(e) : (v(this, new f), g(this, e), void 0) }
function u(e) { p(e); var t = y(this).get(e); return t === r ? i : t }
function c(e, t) { p(e), y(this).set(e, t === i ? r : t) }
function h(e) { return p(e), y(this).get(e) !== i }
function d(e) { p(e); var t = y(this),
r = t.get(e) !== i; return t.set(e, i), r }
function m() { return y(this), "[object WeakMap]" } var p = function(e) { if (null == e || "object" != typeof e && "function" != typeof e) throw new TypeError("Invalid WeakMap key") },
v = function(t, r) { var i = e.unlock(t); if (i.value) throw new TypeError("Object is already a WeakMap");
i.value = r },
y = function(t) { var r = e.unlock(t).value; if (!r) throw new TypeError("WeakMap is not generic"); return r },
g = function(e, t) { null !== t && "object" == typeof t && "function" == typeof t.forEach && t.forEach(function(r, i) { r instanceof Array && 2 === r.length && c.call(e, t[i][0], t[i][1]) }) };
u._name = "get", c._name = "set", h._name = "has", m._name = "toString"; try { var _ = ("return " + d).replace("e_", "\\u0065"),
w = new Function("unwrap", "validate", _)(y, p) } catch (C) { var w = d } var _ = ("" + Object).split("Object"),
x = a("toString", function() { return _[0] + o(this) + _[1] });
n(x, x); var S = { __proto__: [] } instanceof Array ? function(e) { e.__proto__ = x } : function(e) { n(e, x) }; return S(s), l.call([m, u, c, h, w], function(e) { n(s.prototype, e), S(e) }), s }(new f);
e.WeakMap = v }((0, eval)("this")) }), r("ThirdParty/knockout-es5", ["./weakmap", "exports"], function(e, r) {! function(i, n) { "use strict";
function o(e, t) { if (!e) throw new Error("When calling ko.track, you must pass an object as the first parameter."); var r = this,
i = a(e, !0); return t = t || Object.getOwnPropertyNames(e), t.forEach(function(t) { if (!(t in i)) { var o = e[t],
a = o instanceof Array,
s = r.isObservable(o) ? o : a ? r.observableArray(o) : r.observable(o);
Object.defineProperty(e, t, { configurable: !0, enumerable: !0, get: s, set: r.isWriteableObservable(s) ? s : n }), i[t] = s, a && l(r, s) } }), e }
function a(e, t) { y || (y = _()); var r = y.get(e); return !r && t && (r = {}, y.set(e, r)), r }
function s(e, t, r) { var i = this,
n = { owner: e, deferEvaluation: !0 }; if ("function" == typeof r) n.read = r;
else { if ("value" in r) throw new Error('For ko.defineProperty, you must not specify a "value" for the property. You must provide a "get" function.'); if ("function" != typeof r.get) throw new Error('For ko.defineProperty, the third parameter must be either an evaluator function, or an options object containing a function called "get".');
n.read = r.get, n.write = r.set } return e[t] = i.computed(n), o.call(i, e, [t]), e }
function l(e, t) { var r = null;
e.computed(function() { r && (r.dispose(), r = null); var i = t();
i instanceof Array && (r = u(e, t, i)) }) }
function u(e, t, r) { var i = c(e, r); return i.subscribe(t) }
function c(e, t) { g || (g = _()); var r = g.get(t); if (!r) { r = new e.subscribable, g.set(t, r); var i = {};
h(t, r, i), d(e, t, r, i) } return r }
function h(e, t, r) {
["pop", "push", "reverse", "shift", "sort", "splice", "unshift"].forEach(function(i) { var n = e[i];
e[i] = function() { var e = n.apply(this, arguments); return r.pause !== !0 && t.notifySubscribers(this), e } }) }
function d(e, t, r, i) {
["remove", "removeAll", "destroy", "destroyAll", "replace"].forEach(function(n) { Object.defineProperty(t, n, { enumerable: !1, value: function() { var o;
i.pause = !0; try { o = e.observableArray.fn[n].apply(e.observableArray(t), arguments) } finally { i.pause = !1 } return r.notifySubscribers(t), o } }) }) }
function m(e, t) { if (!e) return null; var r = a(e, !1); return r && r[t] || null }
function p(e, t) { var r = m(e, t);
r && r.valueHasMutated() }
function f(e) { e.track = o, e.getObservable = m, e.valueHasMutated = p, e.defineProperty = s }
function v() { if ("undefined" != typeof module) { var n = t("knockout"),
o = t("weakmap");
f(n), _ = function() { return new o }, module.exports = n } else "ko" in i ? (f(i.ko), _ = function() { return new i.WeakMap }) : "undefined" != typeof e && (_ = function() { return new e.WeakMap }, r.attachToKo = f) } var y, g, _;
v() }(this) }), r("ThirdParty/knockout", ["./knockout-2.3.0", "./knockout-es5"], function(e, t) { "use strict"; return t.attachToKo(e), e }), r("Widgets/getElement", ["../Core/DeveloperError"], function(e) { "use strict"; var t = function(t) { if ("string" == typeof t) { var r = document.getElementById(t); if (null === r) throw new e('Element with id "' + t + '" does not exist in the document.');
t = r } return t }; return t }), r("Widgets/Animation/Animation", ["../../Core/defaultValue", "../../Core/defined", "../../Core/defineProperties", "../../Core/destroyObject", "../../Core/DeveloperError", "../../Core/Color", "../getElement", "../../ThirdParty/knockout"], function(e, t, r, i, n, o, a, s) {
"use strict";
function l(e) { return o.fromCssColorString(window.getComputedStyle(e).getPropertyValue("color")) }
function u(e, t, r, i) { return r.call(i, e[t]), s.getObservable(e, t).subscribe(r, i) }
function c(e) { var t = document.createElementNS(g, e.tagName); for (var r in e)
if (e.hasOwnProperty(r) && "tagName" !== r)
if ("children" === r) { var i, n = e.children.length; for (i = 0; n > i; ++i) t.appendChild(c(e.children[i])) } else 0 === r.indexOf("xlink:") ? t.setAttributeNS(_, r.substring(6), e[r]) : "textContent" === r ? t.textContent = e[r] : t.setAttribute(r, e[r]); return t }
function h(e, t, r) { var i = document.createElementNS(g, "text");
i.setAttribute("x", e), i.setAttribute("y", t), i.setAttribute("class", "cesium-animation-svgText"); var n = document.createElementNS(g, "tspan"); return n.textContent = r, i.appendChild(n), i }
function d(e, t, r) { e.setAttribute("transform", "translate(100,100) rotate(" + r + ")"), t.setAttribute("transform", "rotate(" + r + ")") }
function m(e, t) { var r = t.alpha,
i = 1 - r; return M.red = e.red * i + t.red * r, M.green = e.green * i + t.green * r, M.blue = e.blue * i + t.blue * r, M.toCssColorString() }
function p(e, t, r) { var i = { tagName: "g", "class": "cesium-animation-rectButton", transform: "translate(" + e + "," + t + ")", children: [{ tagName: "rect", "class": "cesium-animation-buttonGlow", width: 32, height: 32, rx: 2, ry: 2 }, { tagName: "rect", "class": "cesium-animation-buttonMain", width: 32, height: 32, rx: 4, ry: 4 }, { tagName: "use", "class": "cesium-animation-buttonPath", "xlink:href": r }, { tagName: "title", textContent: "" }] }; return c(i) }
function f(e, t, r) { var i = { tagName: "g", "class": "cesium-animation-rectButton", transform: "translate(" + e + "," + t + ")", children: [{ tagName: "use", "class": "cesium-animation-buttonGlow", "xlink:href": "#animation_pathWingButton" }, { tagName: "use", "class": "cesium-animation-buttonMain", "xlink:href": "#animation_pathWingButton" }, { tagName: "use", "class": "cesium-animation-buttonPath", "xlink:href": r }, { tagName: "title", textContent: "" }] }; return c(i) }
function v(e, t) { var r = e._viewModel,
i = r.shuttleRingDragging; if (!i || y === e)
if ("mousedown" === t.type || i && "mousemove" === t.type || "touchstart" === t.type && 1 === t.touches.length || i && "touchmove" === t.type && 1 === t.touches.length) { var n, o, a = e._centerX,
s = e._centerY,
l = e._svgNode,
u = l.getBoundingClientRect(); if ("touchstart" === t.type || "touchmove" === t.type ? (n = t.touches[0].clientX, o = t.touches[0].clientY) : (n = t.clientX, o = t.clientY), !i && (n > u.right || n < u.left || o < u.top || o > u.bottom)) return; var c = e._shuttleRingPointer.getBoundingClientRect(),
h = n - a - u.left,
d = o - s - u.top,
m = 180 * Math.atan2(d, h) / Math.PI + 90;
m > 180 && (m -= 360); var p = r.shuttleRingAngle;
i || n < c.right && n > c.left && o > c.top && o < c.bottom ? (y = e, r.shuttleRingDragging = !0, r.shuttleRingAngle = m) : p > m ? r.slower() : m > p && r.faster(), t.preventDefault() } else y = void 0, r.shuttleRingDragging = !1 }
var y, g = "http://www.w3.org/2000/svg",
_ = "http://www.w3.org/1999/xlink",
w = o.fromCssColorString("rgba(247,250,255,0.384)"),
C = o.fromCssColorString("rgba(143,191,255,0.216)"),
x = o.fromCssColorString("rgba(153,197,255,0.098)"),
S = o.fromCssColorString("rgba(255,255,255,0.086)"),
E = o.fromCssColorString("rgba(255,255,255,0.267)"),
b = o.fromCssColorString("rgba(255,255,255,0)"),
T = o.fromCssColorString("rgba(66,67,68,0.3)"),
A = o.fromCssColorString("rgba(0,0,0,0.5)"),
M = new o,
P = function(e, t) { this._viewModel = t, this.svgElement = e, this._enabled = void 0, this._toggled = void 0; var r = this;
this._clickFunction = function() { var e = r._viewModel.command;
e.canExecute && e() }, e.addEventListener("click", this._clickFunction, !0), this._subscriptions = [u(t, "toggled", this.setToggled, this), u(t, "tooltip", this.setTooltip, this), u(t.command, "canExecute", this.setEnabled, this)] };
P.prototype.destroy = function() { this.svgElement.removeEventListener("click", this._clickFunction, !0); for (var e = this._subscriptions, t = 0, r = e.length; r > t; t++) e[t].dispose();
i(this) }, P.prototype.isDestroyed = function() { return !1 }, P.prototype.setEnabled = function(e) { if (this._enabled !== e) { if (this._enabled = e, !e) return this.svgElement.setAttribute("class", "cesium-animation-buttonDisabled"), void 0; if (this._toggled) return this.svgElement.setAttribute("class", "cesium-animation-rectButton cesium-animation-buttonToggled"), void 0;
this.svgElement.setAttribute("class", "cesium-animation-rectButton") } }, P.prototype.setToggled = function(e) { this._toggled !== e && (this._toggled = e, this._enabled && (e ? this.svgElement.setAttribute("class", "cesium-animation-rectButton cesium-animation-buttonToggled") : this.svgElement.setAttribute("class", "cesium-animation-rectButton"))) }, P.prototype.setTooltip = function(e) { this.svgElement.getElementsByTagName("title")[0].textContent = e };
var D = function(e, r) { if (!t(e)) throw new n("container is required."); if (!t(r)) throw new n("viewModel is required.");
e = a(e), this._viewModel = r, this._container = e, this._centerX = 0, this._centerY = 0, this._defsElement = void 0, this._svgNode = void 0, this._topG = void 0, this._lastHeight = void 0, this._lastWidth = void 0; var i = document.createElement("style");
i.textContent = ".cesium-animation-rectButton .cesium-animation-buttonGlow { filter: url(#animation_blurred); }.cesium-animation-rectButton .cesium-animation-buttonMain { fill: url(#animation_buttonNormal); }.cesium-animation-buttonToggled .cesium-animation-buttonMain { fill: url(#animation_buttonToggled); }.cesium-animation-rectButton:hover .cesium-animation-buttonMain { fill: url(#animation_buttonHovered); }.cesium-animation-buttonDisabled .cesium-animation-buttonMain { fill: url(#animation_buttonDisabled); }.cesium-animation-shuttleRingG .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshGradient); }.cesium-animation-shuttleRingG:hover .cesium-animation-shuttleRingSwoosh { fill: url(#animation_shuttleRingSwooshHovered); }.cesium-animation-shuttleRingPointer { fill: url(#animation_shuttleRingPointerGradient); }.cesium-animation-shuttleRingPausePointer { fill: url(#animation_shuttleRingPointerPaused); }.cesium-animation-knobOuter { fill: url(#animation_knobOuter); }.cesium-animation-knobInner { fill: url(#animation_knobInner); }", document.head.insertBefore(i, document.head.childNodes[0]); var o = document.createElement("div");
o.className = "cesium-animation-theme", o.innerHTML = '', this._theme = o, this._themeNormal = o.childNodes[0], this._themeHover = o.childNodes[1], this._themeSelect = o.childNodes[2], this._themeDisabled = o.childNodes[3], this._themeKnob = o.childNodes[4], this._themePointer = o.childNodes[5], this._themeSwoosh = o.childNodes[6], this._themeSwooshHover = o.childNodes[7]; var s = document.createElementNS(g, "svg:svg");
this._svgNode = s, s.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", _); var l = document.createElementNS(g, "g");
this._topG = l, this._realtimeSVG = new P(f(3, 4, "#animation_pathClock"), r.playRealtimeViewModel), this._playReverseSVG = new P(p(44, 99, "#animation_pathPlayReverse"), r.playReverseViewModel), this._playForwardSVG = new P(p(124, 99, "#animation_pathPlay"), r.playForwardViewModel), this._pauseSVG = new P(p(84, 99, "#animation_pathPause"), r.pauseViewModel); var m = document.createElementNS(g, "g");
m.appendChild(this._realtimeSVG.svgElement), m.appendChild(this._playReverseSVG.svgElement), m.appendChild(this._playForwardSVG.svgElement), m.appendChild(this._pauseSVG.svgElement); var y = c({ tagName: "circle", "class": "cesium-animation-shuttleRingBack", cx: 100, cy: 100, r: 99 });
this._shuttleRingBackPanel = y; var w = c({ tagName: "g", "class": "cesium-animation-shuttleRingSwoosh", children: [{ tagName: "use", transform: "translate(100,97) scale(-1,1)", "xlink:href": "#animation_pathSwooshFX" }, { tagName: "use", transform: "translate(100,97)", "xlink:href": "#animation_pathSwooshFX" }, { tagName: "line", x1: 100, y1: 8, x2: 100, y2: 22 }] });
this._shuttleRingSwooshG = w, this._shuttleRingPointer = c({ tagName: "use", "class": "cesium-animation-shuttleRingPointer", "xlink:href": "#animation_pathPointer" }); var C = c({ tagName: "g", transform: "translate(100,100)" });
this._knobOuter = c({ tagName: "circle", "class": "cesium-animation-knobOuter", cx: 0, cy: 0, r: 71 }); var x = 61,
S = c({ tagName: "circle", "class": "cesium-animation-knobInner", cx: 0, cy: 0, r: x });
this._knobDate = h(0, -24, ""), this._knobTime = h(0, -7, ""), this._knobStatus = h(0, -41, ""); var E = c({ tagName: "circle", "class": "cesium-animation-blank", cx: 0, cy: 0, r: x }),
b = document.createElementNS(g, "g");
b.setAttribute("class", "cesium-animation-shuttleRingG"), e.appendChild(o), l.appendChild(b), l.appendChild(C), l.appendChild(m), b.appendChild(y), b.appendChild(w), b.appendChild(this._shuttleRingPointer), C.appendChild(this._knobOuter), C.appendChild(S), C.appendChild(this._knobDate), C.appendChild(this._knobTime), C.appendChild(this._knobStatus), C.appendChild(E), s.appendChild(l), e.appendChild(s); var T = this,
A = function(e) { v(T, e) };
this._mouseCallback = A, y.addEventListener("mousedown", A, !0), y.addEventListener("touchstart", A, !0), w.addEventListener("mousedown", A, !0), w.addEventListener("touchstart", A, !0), document.addEventListener("mousemove", A, !0), document.addEventListener("touchmove", A, !0), document.addEventListener("mouseup", A, !0), document.addEventListener("touchend", A, !0), this._shuttleRingPointer.addEventListener("mousedown", A, !0), this._shuttleRingPointer.addEventListener("touchstart", A, !0), this._knobOuter.addEventListener("mousedown", A, !0), this._knobOuter.addEventListener("touchstart", A, !0); var M, D = this._knobTime.childNodes[0],
I = this._knobDate.childNodes[0],
O = this._knobStatus.childNodes[0];
this._subscriptions = [u(r.pauseViewModel, "toggled", function(e) { M !== e && (M = e, M ? T._shuttleRingPointer.setAttribute("class", "cesium-animation-shuttleRingPausePointer") : T._shuttleRingPointer.setAttribute("class", "cesium-animation-shuttleRingPointer")) }), u(r, "shuttleRingAngle", function(e) { d(T._shuttleRingPointer, T._knobOuter, e) }), u(r, "dateLabel", function(e) { I.textContent !== e && (I.textContent = e) }), u(r, "timeLabel", function(e) { D.textContent !== e && (D.textContent = e) }), u(r, "multiplierLabel", function(e) { O.textContent !== e && (O.textContent = e) })], this.applyThemeChanges(), this.resize() };
return r(D.prototype, { container: { get: function() { return this._container } }, viewModel: { get: function() { return this._viewModel } } }), D.prototype.isDestroyed = function() { return !1 }, D.prototype.destroy = function() { var e = this._mouseCallback;
this._shuttleRingBackPanel.removeEventListener("mousedown", e, !0), this._shuttleRingBackPanel.removeEventListener("touchstart", e, !0), this._shuttleRingSwooshG.removeEventListener("mousedown", e, !0), this._shuttleRingSwooshG.removeEventListener("touchstart", e, !0), document.removeEventListener("mousemove", e, !0), document.removeEventListener("touchmove", e, !0), document.removeEventListener("mouseup", e, !0), document.removeEventListener("touchend", e, !0), this._shuttleRingPointer.removeEventListener("mousedown", e, !0), this._shuttleRingPointer.removeEventListener("touchstart", e, !0), this._knobOuter.removeEventListener("mousedown", e, !0), this._knobOuter.removeEventListener("touchstart", e, !0), this._container.removeChild(this._svgNode), this._container.removeChild(this._theme), this._realtimeSVG.destroy(), this._playReverseSVG.destroy(), this._playForwardSVG.destroy(), this._pauseSVG.destroy(); for (var t = this._subscriptions, r = 0, n = t.length; n > r; r++) t[r].dispose(); return i(this) }, D.prototype.resize = function() { var e = this._container.clientWidth,
t = this._container.clientHeight; if (e !== this._lastWidth || t !== this._lastHeight) { var r = this._svgNode,
i = 200,
n = 132,
o = e,
a = t;
0 === e && 0 === t ? (o = i, a = n) : 0 === e ? (a = t, o = i * (t / n)) : 0 === t && (o = e, a = n * (e / i)); var s = o / i,
l = a / n;
r.style.cssText = "width: " + o + "px; height: " + a + "px; position: absolute; bottom: 0; left: 0;", r.setAttribute("width", o), r.setAttribute("height", a), r.setAttribute("viewBox", "0 0 " + o + " " + a), this._topG.setAttribute("transform", "scale(" + s + "," + l + ")"), this._centerX = Math.max(1, 100 * s), this._centerY = Math.max(1, 100 * l), this._lastHeight = e, this._lastWidth = t } }, D.prototype.applyThemeChanges = function() {
var e = l(this._themeNormal),
r = l(this._themeHover),
i = l(this._themeSelect),
n = l(this._themeDisabled),
o = l(this._themeKnob),
a = l(this._themePointer),
s = l(this._themeSwoosh),
u = l(this._themeSwooshHover),
h = c({ tagName: "defs", children: [{ id: "animation_buttonNormal", tagName: "linearGradient", x1: "50%", y1: "0%", x2: "50%", y2: "100%", children: [{ tagName: "stop", offset: "0%", "stop-color": m(e, w) }, { tagName: "stop", offset: "12%", "stop-color": m(e, C) }, { tagName: "stop", offset: "46%", "stop-color": m(e, x) }, { tagName: "stop", offset: "81%", "stop-color": m(e, S) }] }, { id: "animation_buttonHovered", tagName: "linearGradient", x1: "50%", y1: "0%", x2: "50%", y2: "100%", children: [{ tagName: "stop", offset: "0%", "stop-color": m(r, w) }, { tagName: "stop", offset: "12%", "stop-color": m(r, C) }, { tagName: "stop", offset: "46%", "stop-color": m(r, x) }, { tagName: "stop", offset: "81%", "stop-color": m(r, S) }] }, { id: "animation_buttonToggled", tagName: "linearGradient", x1: "50%", y1: "0%", x2: "50%", y2: "100%", children: [{ tagName: "stop", offset: "0%", "stop-color": m(i, w) }, { tagName: "stop", offset: "12%", "stop-color": m(i, C) }, { tagName: "stop", offset: "46%", "stop-color": m(i, x) }, { tagName: "stop", offset: "81%", "stop-color": m(i, S) }] }, { id: "animation_buttonDisabled", tagName: "linearGradient", x1: "50%", y1: "0%", x2: "50%", y2: "100%", children: [{ tagName: "stop", offset: "0%", "stop-color": m(n, E) }, { tagName: "stop", offset: "75%", "stop-color": m(n, b) }] }, { id: "animation_blurred", tagName: "filter", width: "200%", height: "200%", x: "-50%", y: "-50%", children: [{ tagName: "feGaussianBlur", stdDeviation: 4, "in": "SourceGraphic" }] }, { id: "animation_shuttleRingSwooshGradient", tagName: "linearGradient", x1: "50%", y1: "0%", x2: "50%", y2: "100%", children: [{ tagName: "stop", offset: "0%", "stop-opacity": .2, "stop-color": s.toCssColorString() }, { tagName: "stop", offset: "85%", "stop-opacity": .85, "stop-color": s.toCssColorString() }, { tagName: "stop", offset: "95%", "stop-opacity": .05, "stop-color": s.toCssColorString() }] }, { id: "animation_shuttleRingSwooshHovered", tagName: "linearGradient", x1: "50%", y1: "0%", x2: "50%", y2: "100%", children: [{ tagName: "stop", offset: "0%", "stop-opacity": .2, "stop-color": u.toCssColorString() }, { tagName: "stop", offset: "85%", "stop-opacity": .85, "stop-color": u.toCssColorString() }, { tagName: "stop", offset: "95%", "stop-opacity": .05, "stop-color": u.toCssColorString() }] }, { id: "animation_shuttleRingPointerGradient", tagName: "linearGradient", x1: "0%", y1: "50%", x2: "100%", y2: "50%", children: [{ tagName: "stop", offset: "0%", "stop-color": a.toCssColorString() }, { tagName: "stop", offset: "40%", "stop-color": a.toCssColorString() }, { tagName: "stop", offset: "60%", "stop-color": m(a, A) }, { tagName: "stop", offset: "100%", "stop-color": m(a, A) }] }, { id: "animation_shuttleRingPointerPaused", tagName: "linearGradient", x1: "0%", y1: "50%", x2: "100%", y2: "50%", children: [{ tagName: "stop", offset: "0%", "stop-color": "#CCC" }, { tagName: "stop", offset: "40%", "stop-color": "#CCC" }, { tagName: "stop", offset: "60%", "stop-color": "#555" }, { tagName: "stop", offset: "100%", "stop-color": "#555" }] }, { id: "animation_knobOuter", tagName: "linearGradient", x1: "20%", y1: "0%", x2: "90%", y2: "100%", children: [{ tagName: "stop", offset: "5%", "stop-color": m(o, w) }, { tagName: "stop", offset: "60%", "stop-color": m(o, T) }, { tagName: "stop", offset: "85%", "stop-color": m(o, C) }] }, { id: "animation_knobInner", tagName: "linearGradient", x1: "20%", y1: "0%", x2: "90%", y2: "100%", children: [{ tagName: "stop", offset: "5%", "stop-color": m(o, T) }, { tagName: "stop", offset: "60%", "stop-color": m(o, w) }, { tagName: "stop", offset: "85%", "stop-color": m(o, S) }] }, { id: "animation_pathReset", tagName: "path", transform: "translate(16,16) scale(0.85) translate(-16,-16)", d: "M24.316,5.318,9.833,13.682,9.833,5.5,5.5,5.5,5.5,25.5,9.833,25.5,9.833,17.318,24.316,25.682z" }, { id: "animation_pathPause", tagName: "path", transform: "translate(16,16) scale(0.85) translate(-16,-16)", d: "M13,5.5,7.5,5.5,7.5,25.5,13,25.5zM24.5,5.5,19,5.5,19,25.5,24.5,25.5z" }, { id: "animation_pathPlay", tagName: "path", transform: "translate(16,16) scale(0.85) translate(-16,-16)", d: "M6.684,25.682L24.316,15.5L6.684,5.318V25.682z" }, { id: "animation_pathPlayReverse", tagName: "path", transform: "translate(16,16) scale(-0.85,0.85) translate(-16,-16)", d: "M6.684,25.682L24.316,15.5L6.684,5.318V25.682z" }, { id: "animation_pathLoop", tagName: "path", transform: "translate(16,16) scale(0.85) translate(-16,-16)", d: "M24.249,15.499c-0.009,4.832-3.918,8.741-8.75,8.75c-2.515,0-4.768-1.064-6.365-2.763l2.068-1.442l-7.901-3.703l0.744,8.694l2.193-1.529c2.244,2.594,5.562,4.242,9.26,4.242c6.767,0,12.249-5.482,12.249-12.249H24.249zM15.499,6.75c2.516,0,4.769,1.065,6.367,2.764l-2.068,1.443l7.901,3.701l-0.746-8.693l-2.192,1.529c-2.245-2.594-5.562-4.245-9.262-4.245C8.734,3.25,3.25,8.734,3.249,15.499H6.75C6.758,10.668,10.668,6.758,15.499,6.75z" }, { id: "animation_pathClock", tagName: "path", transform: "translate(16,16) scale(0.85) translate(-16,-15.5)", d: "M15.5,2.374C8.251,2.375,2.376,8.251,2.374,15.5C2.376,22.748,8.251,28.623,15.5,28.627c7.249-0.004,13.124-5.879,13.125-13.127C28.624,8.251,22.749,2.375,15.5,2.374zM15.5,25.623C9.909,25.615,5.385,21.09,5.375,15.5C5.385,9.909,9.909,5.384,15.5,5.374c5.59,0.01,10.115,4.535,10.124,10.125C25.615,21.09,21.091,25.615,15.5,25.623zM8.625,15.5c-0.001-0.552-0.448-0.999-1.001-1c-0.553,0-1,0.448-1,1c0,0.553,0.449,1,1,1C8.176,16.5,8.624,16.053,8.625,15.5zM8.179,18.572c-0.478,0.277-0.642,0.889-0.365,1.367c0.275,0.479,0.889,0.641,1.365,0.365c0.479-0.275,0.643-0.887,0.367-1.367C9.27,18.461,8.658,18.297,8.179,18.572zM9.18,10.696c-0.479-0.276-1.09-0.112-1.366,0.366s-0.111,1.09,0.365,1.366c0.479,0.276,1.09,0.113,1.367-0.366C9.821,11.584,9.657,10.973,9.18,10.696zM22.822,12.428c0.478-0.275,0.643-0.888,0.366-1.366c-0.275-0.478-0.89-0.642-1.366-0.366c-0.479,0.278-0.642,0.89-0.366,1.367C21.732,12.54,22.344,12.705,22.822,12.428zM12.062,21.455c-0.478-0.275-1.089-0.111-1.366,0.367c-0.275,0.479-0.111,1.09,0.366,1.365c0.478,0.277,1.091,0.111,1.365-0.365C12.704,22.344,12.54,21.732,12.062,21.455zM12.062,9.545c0.479-0.276,0.642-0.888,0.366-1.366c-0.276-0.478-0.888-0.642-1.366-0.366s-0.642,0.888-0.366,1.366C10.973,9.658,11.584,9.822,12.062,9.545zM22.823,18.572c-0.48-0.275-1.092-0.111-1.367,0.365c-0.275,0.479-0.112,1.092,0.367,1.367c0.477,0.275,1.089,0.113,1.365-0.365C23.464,19.461,23.3,18.848,22.823,18.572zM19.938,7.813c-0.477-0.276-1.091-0.111-1.365,0.366c-0.275,0.48-0.111,1.091,0.366,1.367s1.089,0.112,1.366-0.366C20.581,8.702,20.418,8.089,19.938,7.813zM23.378,14.5c-0.554,0.002-1.001,0.45-1.001,1c0.001,0.552,0.448,1,1.001,1c0.551,0,1-0.447,1-1C24.378,14.949,23.929,14.5,23.378,14.5zM15.501,6.624c-0.552,0-1,0.448-1,1l-0.466,7.343l-3.004,1.96c-0.478,0.277-0.642,0.889-0.365,1.365c0.275,0.479,0.889,0.643,1.365,0.367l3.305-1.676C15.39,16.99,15.444,17,15.501,17c0.828,0,1.5-0.671,1.5-1.5l-0.5-7.876C16.501,7.072,16.053,6.624,15.501,6.624zM15.501,22.377c-0.552,0-1,0.447-1,1s0.448,1,1,1s1-0.447,1-1S16.053,22.377,15.501,22.377zM18.939,21.455c-0.479,0.277-0.643,0.889-0.366,1.367c0.275,0.477,0.888,0.643,1.366,0.365c0.478-0.275,0.642-0.889,0.366-1.365C20.028,21.344,19.417,21.18,18.939,21.455z" }, { id: "animation_pathWingButton", tagName: "path", d: "m 4.5,0.5 c -2.216,0 -4,1.784 -4,4 l 0,24 c 0,2.216 1.784,4 4,4 l 13.71875,0 C 22.478584,27.272785 27.273681,22.511272 32.5,18.25 l 0,-13.75 c 0,-2.216 -1.784,-4 -4,-4 l -24,0 z" }, { id: "animation_pathPointer", tagName: "path", d: "M-15,-65,-15,-55,15,-55,15,-65,0,-95z" }, { id: "animation_pathSwooshFX", tagName: "path", d: "m 85,0 c 0,16.617 -4.813944,35.356 -13.131081,48.4508 h 6.099803 c 8.317138,-13.0948 13.13322,-28.5955 13.13322,-45.2124 0,-46.94483 -38.402714,-85.00262 -85.7743869,-85.00262 -1.0218522,0 -2.0373001,0.0241 -3.0506131,0.0589 45.958443,1.59437 82.723058,35.77285 82.723058,81.70532 z" }] });
t(this._defsElement) ? this._svgNode.replaceChild(h, this._defsElement) : this._svgNode.appendChild(h), this._defsElement = h
}, D
}), r("Widgets/createCommand", ["../Core/defaultValue", "../Core/defined", "../Core/defineProperties", "../Core/DeveloperError", "../Core/Event", "../ThirdParty/knockout"], function(e, t, r, i, n, o) { "use strict"; var a = function(a, s) {
function l() { if (!l.canExecute) throw new i("Cannot execute command, canExecute is false."); var e, t = { args: arguments, cancel: !1 }; return u.raiseEvent(t), t.cancel || (e = a.apply(null, arguments), c.raiseEvent(e)), e } if (!t(a)) throw new i("func is required.");
s = e(s, !0); var u = new n,
c = new n; return l.canExecute = s, o.track(l, ["canExecute"]), r(l, { beforeExecute: { value: u }, afterExecute: { value: c } }), l }; return a }), r("Widgets/ToggleButtonViewModel", ["../Core/defaultValue", "../Core/defined", "../Core/defineProperties", "../Core/DeveloperError", "../ThirdParty/knockout"], function(e, t, r, i, n) { "use strict"; var o = function(r, o) { if (!t(r)) throw new i("command is required.");
this._command = r, o = e(o, e.EMPTY_OBJECT), this.toggled = e(o.toggled, !1), this.tooltip = e(o.tooltip, ""), n.track(this, ["toggled", "tooltip"]) }; return r(o.prototype, { command: { get: function() { return this._command } } }), o }), r("Widgets/Animation/AnimationViewModel", ["../../Core/binarySearch", "../../Core/ClockStep", "../../Core/ClockRange", "../../Core/defined", "../../Core/defineProperties", "../../Core/DeveloperError", "../createCommand", "../ToggleButtonViewModel", "../../ThirdParty/sprintf", "../../ThirdParty/knockout"], function(e, t, r, i, n, o, a, s, l, u) { "use strict";
function c(e) { e.clockStep === t.SYSTEM_CLOCK && (e.clockStep = t.SYSTEM_CLOCK_MULTIPLIER, e.multiplier = 1) }
function h(e) { c(e), e.shouldAnimate = !0 }
function d(e, t) { return e - t }
function m(t, r) { var i = e(r, t, d); return 0 > i ? ~i : i }
function p(e, t) { if (Math.abs(e) <= y) return e / y; var r, i, n = y,
o = g,
a = 0; return e > 0 ? (r = Math.log(t[t.length - 1]), i = (r - a) / (o - n), Math.exp(a + i * (e - n))) : (r = Math.log(-t[0]), i = (r - a) / (o - n), -Math.exp(a + i * (Math.abs(e) - n))) }
function f(e, r, i) { if (i.clockStep === t.SYSTEM_CLOCK) return y; if (Math.abs(e) <= 1) return e * y; var n, o, a = y,
s = g,
l = 0; return e > 0 ? (n = Math.log(r[r.length - 1]), o = (n - l) / (s - a), (Math.log(e) - l) / o + a) : (n = Math.log(-r[0]), o = (n - l) / (s - a), -((Math.log(Math.abs(e)) - l) / o + a)) } var v = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
y = 15,
g = 105,
_ = function(e) { if (!i(e)) throw new o("clockViewModel is required."); var n = this;
this._clockViewModel = e, this._allShuttleRingTicks = [], this._dateFormatter = _.defaultDateFormatter, this._timeFormatter = _.defaultTimeFormatter, this.shuttleRingDragging = !1, this.snapToTicks = !1, u.track(this, ["_allShuttleRingTicks", "_dateFormatter", "_timeFormatter", "shuttleRingDragging", "snapToTicks"]), this._sortedFilteredPositiveTicks = [], this.setShuttleRingTicks(_.defaultTicks), this.timeLabel = void 0, u.defineProperty(this, "timeLabel", function() { return n._timeFormatter(n._clockViewModel.currentTime, n) }), this.dateLabel = void 0, u.defineProperty(this, "dateLabel", function() { return n._dateFormatter(n._clockViewModel.currentTime, n) }), this.multiplierLabel = void 0, u.defineProperty(this, "multiplierLabel", function() { var e = n._clockViewModel; if (e.clockStep === t.SYSTEM_CLOCK) return "Today"; var r = e.multiplier; return 0 === r % 1 ? r.toFixed(0) + "x" : r.toFixed(3).replace(/0{0,3}$/, "") + "x" }), this.shuttleRingAngle = void 0, u.defineProperty(this, "shuttleRingAngle", { get: function() { return f(e.multiplier, n._allShuttleRingTicks, e) }, set: function(e) { e = Math.max(Math.min(e, g), -g); var r = n._allShuttleRingTicks,
i = n._clockViewModel; if (i.clockStep = t.SYSTEM_CLOCK_MULTIPLIER, Math.abs(e) === g) return i.multiplier = e > 0 ? r[r.length - 1] : r[0], void 0; var o = p(e, r); if (n.snapToTicks) o = r[m(o, r)];
else if (0 !== o) { var a = Math.abs(o); if (a > 100) { var s = a.toFixed(0).length - 2,
l = Math.pow(10, s);
o = 0 | Math.round(o / l) * l } else a > y ? o = Math.round(o) : a > 1 ? o = +o.toFixed(1) : a > 0 && (o = +o.toFixed(2)) } i.multiplier = o } }), this._canAnimate = void 0, u.defineProperty(this, "_canAnimate", function() { var e = n._clockViewModel,
t = e.clockRange; if (n.shuttleRingDragging || t === r.UNBOUNDED) return !0; var i = e.multiplier,
o = e.currentTime,
a = e.startTime,
s = !1; if (t === r.LOOP_STOP) s = o.greaterThan(a) || o.equals(a) && i > 0;
else { var l = e.stopTime;
s = o.greaterThan(a) && o.lessThan(l) || o.equals(a) && i > 0 || o.equals(l) && 0 > i } return s || (e.shouldAnimate = !1), s }), this._isSystemTimeAvailable = void 0, u.defineProperty(this, "_isSystemTimeAvailable", function() { var e = n._clockViewModel,
t = e.clockRange; if (t === r.UNBOUNDED) return !0; var i = e.systemTime; return i.greaterThanOrEquals(e.startTime) && i.lessThanOrEquals(e.stopTime) }), this._isAnimating = void 0, u.defineProperty(this, "_isAnimating", function() { return n._clockViewModel.shouldAnimate && (n._canAnimate || n.shuttleRingDragging) }); var l = a(function() { var e = n._clockViewModel;
e.shouldAnimate ? (c(e), e.shouldAnimate = !1) : n._canAnimate && h(e) });
this._pauseViewModel = new s(l, { toggled: u.computed(function() { return !n._isAnimating }), tooltip: "Pause" }); var d = a(function() { var e = n._clockViewModel;
c(e); var t = e.multiplier;
t > 0 && (e.multiplier = -t), e.shouldAnimate = !0 });
this._playReverseViewModel = new s(d, { toggled: u.computed(function() { return n._isAnimating && e.multiplier < 0 }), tooltip: "Play Reverse" }); var v = a(function() { var e = n._clockViewModel;
c(e); var t = e.multiplier;
0 > t && (e.multiplier = -t), e.shouldAnimate = !0 });
this._playForwardViewModel = new s(v, { toggled: u.computed(function() { return n._isAnimating && e.multiplier > 0 && e.clockStep !== t.SYSTEM_CLOCK }), tooltip: "Play Forward" }); var w = a(function() { var e = n._clockViewModel;
e.clockStep = t.SYSTEM_CLOCK, e.multiplier = 1, e.shouldAnimate = !0 }, u.getObservable(this, "_isSystemTimeAvailable"));
this._playRealtimeViewModel = new s(w, { toggled: u.computed(function() { return e.shouldAnimate && e.clockStep === t.SYSTEM_CLOCK }), tooltip: u.computed(function() { return n._isSystemTimeAvailable ? "Today (real-time)" : "Current time not in range" }) }), this._slower = a(function() { var e = n._clockViewModel;
c(e); var t = n._allShuttleRingTicks,
r = e.multiplier,
i = m(r, t) - 1;
i >= 0 && (e.multiplier = t[i]) }), this._faster = a(function() { var e = n._clockViewModel;
c(e); var t = n._allShuttleRingTicks,
r = e.multiplier,
i = m(r, t) + 1;
i < t.length && (e.multiplier = t[i]) }) }; return _.defaultDateFormatter = function(e) { var t = e.toGregorianDate(); return v[t.month - 1] + " " + t.day + " " + t.year }, _.defaultTicks = [.001, .002, .005, .01, .02, .05, .1, .25, .5, 1, 2, 5, 10, 15, 30, 60, 120, 300, 600, 900, 1800, 3600, 7200, 14400, 21600, 43200, 86400, 172800, 345600, 604800], _.defaultTimeFormatter = function(e, t) { var r = e.toGregorianDate(),
i = Math.round(r.millisecond); return Math.abs(t._clockViewModel.multiplier) < 1 ? l("%02d:%02d:%02d.%03d", r.hour, r.minute, r.second, i) : l("%02d:%02d:%02d UTC", r.hour, r.minute, r.second) }, _.prototype.getShuttleRingTicks = function() { return this._sortedFilteredPositiveTicks.slice(0) }, _.prototype.setShuttleRingTicks = function(e) { if (!i(e)) throw new o("positiveTicks is required."); var t, r, n, a = {},
s = this._sortedFilteredPositiveTicks; for (s.length = 0, t = 0, r = e.length; r > t; ++t) n = e[t], a.hasOwnProperty(n) || (a[n] = !0, s.push(n));
s.sort(d); var l = []; for (r = s.length, t = r - 1; t >= 0; --t) n = s[t], 0 !== n && l.push(-n);
Array.prototype.push.apply(l, s), this._allShuttleRingTicks = l }, n(_.prototype, { slower: { get: function() { return this._slower } }, faster: { get: function() { return this._faster } }, clockViewModel: { get: function() { return this._clockViewModel } }, pauseViewModel: { get: function() { return this._pauseViewModel } }, playReverseViewModel: { get: function() { return this._playReverseViewModel } }, playForwardViewModel: { get: function() { return this._playForwardViewModel } }, playRealtimeViewModel: { get: function() { return this._playRealtimeViewModel } }, dateFormatter: { get: function() { return this._dateFormatter }, set: function(e) { if ("function" != typeof e) throw new o("dateFormatter must be a function");
this._dateFormatter = e } }, timeFormatter: { get: function() { return this._timeFormatter }, set: function(e) { if ("function" != typeof e) throw new o("timeFormatter must be a function");
this._timeFormatter = e } } }), _._maxShuttleRingAngle = g, _._realtimeShuttleRingAngle = y, _ }), r("Widgets/BaseLayerPicker/BaseLayerPickerViewModel", ["../../Core/defined", "../../Core/defineProperties", "../../Core/DeveloperError", "../createCommand", "../../ThirdParty/knockout"], function(e, t, r, i, n) { "use strict"; var o = function(t, o) { if (!e(t)) throw new r("imageryLayers is required"); if (e(o)) { if (!Array.isArray(o)) throw new r("imageryProviderViewModels must be an array") } else o = []; var a = this;
this._imageryLayers = t, this.imageryProviderViewModels = o.slice(0), this.dropDownVisible = !1, n.track(this, ["imageryProviderViewModels", "dropDownVisible"]), this.selectedName = void 0, n.defineProperty(this, "selectedName", function() { var t = a.selectedItem; return e(t) ? t.name : void 0 }), this.selectedIconUrl = void 0, n.defineProperty(this, "selectedIconUrl", function() { var t = a.selectedItem; return e(t) ? t.iconUrl : void 0 }), this.selectedItem = void 0; var s = n.observable();
this._currentProviders = [], n.defineProperty(this, "selectedItem", { get: function() { return s() }, set: function(r) { var i, n = a._currentProviders,
o = n.length; for (i = 0; o > i; i++)
for (var l = t.getLength(), u = 0; l > u; u++) { var c = t.get(u); if (c.getImageryProvider() === n[i]) { t.remove(c); break } }
if (e(r)) { var h = r.creationCommand(); if (Array.isArray(h)) { var d = h.length; for (i = d - 1; i >= 0; i--) t.addImageryProvider(h[i], 0);
a._currentProviders = h.slice(0) } else a._currentProviders = [h], t.addImageryProvider(h, 0);
s(r) } a.dropDownVisible = !1 } }), this._toggleDropDown = i(function() { a.dropDownVisible = !a.dropDownVisible }) }; return t(o.prototype, { toggleDropDown: { get: function() { return this._toggleDropDown } }, imageryLayers: { get: function() { return this._imageryLayers } } }), o }), r("Widgets/BaseLayerPicker/BaseLayerPicker", ["../../Core/defined", "../../Core/defineProperties", "../../Core/destroyObject", "../../Core/DeveloperError", "../getElement", "./BaseLayerPickerViewModel", "../../ThirdParty/knockout"], function(e, t, r, i, n, o, a) { "use strict"; var s = function(t, r, s) { if (!e(t)) throw new i("container is required."); if (!e(r)) throw new i("imageryLayers is required.");
t = n(t); var l = new o(r, s);
this._viewModel = l, this._container = t, this._element = document.createElement("img"); var u = this._element;
u.setAttribute("draggable", "false"), u.className = "cesium-baseLayerPicker-selected", u.setAttribute("data-bind", " attr: {title: selectedName, src: selectedIconUrl}, click: toggleDropDown"), t.appendChild(u); var c = document.createElement("div");
this._choices = c, c.className = "cesium-baseLayerPicker-dropDown", c.setAttribute("data-bind", ' css: { "cesium-baseLayerPicker-visible" : dropDownVisible, "cesium-baseLayerPicker-hidden" : !dropDownVisible }, foreach: imageryProviderViewModels'), t.appendChild(c); var h = document.createElement("div");
h.className = "cesium-baseLayerPicker-item", h.setAttribute("data-bind", ' css: {"cesium-baseLayerPicker-selectedItem" : $data === $parent.selectedItem}, attr: {title: tooltip}, visible: creationCommand.canExecute, click: function($data) { $parent.selectedItem = $data }'), c.appendChild(h); var d = document.createElement("img");
d.className = "cesium-baseLayerPicker-itemIcon", d.setAttribute("data-bind", "attr: { src: iconUrl }"), d.setAttribute("draggable", "false"), h.appendChild(d); var m = document.createElement("div");
m.className = "cesium-baseLayerPicker-itemLabel", m.setAttribute("data-bind", "text: name"), h.appendChild(m), a.applyBindings(l, t), this._closeDropDown = function(e) { t.contains(e.target) || (l.dropDownVisible = !1) }, document.addEventListener("mousedown", this._closeDropDown, !0), document.addEventListener("touchstart", this._closeDropDown, !0) }; return t(s.prototype, { container: { get: function() { return this._container } }, viewModel: { get: function() { return this._viewModel } } }), s.prototype.isDestroyed = function() { return !1 }, s.prototype.destroy = function() { document.removeEventListener("mousedown", this._closeDropDown, !0), document.removeEventListener("touchstart", this._closeDropDown, !0); var e = this._container; return a.cleanNode(e), e.removeChild(this._element), e.removeChild(this._choices), r(this) }, s }), r("Widgets/BaseLayerPicker/ImageryProviderViewModel", ["../../Core/defineProperties", "../../Core/defined", "../../Core/DeveloperError", "../createCommand", "../../ThirdParty/knockout"], function(e, t, r, i, n) { "use strict"; var o = function(e) { if (!t(e.name)) throw new r("description.name is required."); if (!t(e.tooltip)) throw new r("description.tooltip is required."); if (!t(e.iconUrl)) throw new r("description.iconUrl is required."); if ("function" != typeof e.creationFunction) throw new r("description.creationFunction is required."); var o = e.creationFunction;
t(o.canExecute) || (o = i(o)), this._creationCommand = o, this.name = e.name, this.tooltip = e.tooltip, this.iconUrl = e.iconUrl, n.track(this, ["name", "tooltip", "iconUrl"]) }; return e(o.prototype, { creationCommand: { get: function() { return this._creationCommand } } }), o }), r("Widgets/BaseLayerPicker/createDefaultBaseLayers", ["require", "../BaseLayerPicker/ImageryProviderViewModel", "../../Core/buildModuleUrl", "../../Core/FeatureDetection", "../../Core/DefaultProxy", "../../Scene/BingMapsImageryProvider", "../../Scene/BingMapsStyle", "../../Scene/ArcGisMapServerImageryProvider", "../../Scene/OpenStreetMapImageryProvider", "../../Scene/TileMapServiceImageryProvider"], function(e, t, r, i, n, o, a, s, l, u) { "use strict";
function c() { var e = new n("http://cesium.agi.com/proxy/"),
c = i.supportsCrossOriginImagery() ? void 0 : e,
h = []; return h.push(new t({ name: "Bing Maps Aerial", iconUrl: r("Widgets/Images/ImageryProviders/bingAerial.png"), tooltip: "Bing Maps aerial imagery \nhttp://www.bing.com/maps", creationFunction: function() { return new o({ url: "http://dev.virtualearth.net", mapStyle: a.AERIAL, proxy: c }) } })), h.push(new t({ name: "Bing Maps Aerial with Labels", iconUrl: r("Widgets/Images/ImageryProviders/bingAerialLabels.png"), tooltip: "Bing Maps aerial imagery with label overlays \nhttp://www.bing.com/maps", creationFunction: function() { return new o({ url: "http://dev.virtualearth.net", mapStyle: a.AERIAL_WITH_LABELS, proxy: c }) } })), h.push(new t({ name: "Bing Maps Roads", iconUrl: r("Widgets/Images/ImageryProviders/bingRoads.png"), tooltip: "Bing Maps standard road maps\nhttp://www.bing.com/maps", creationFunction: function() { return new o({ url: "http://dev.virtualearth.net", mapStyle: a.ROAD, proxy: c }) } })), h.push(new t({ name: "ESRI World Imagery", iconUrl: r("Widgets/Images/ImageryProviders/esriWorldImagery.png"), tooltip: "World Imagery provides one meter or better satellite and aerial imagery in many parts of the world and lower resolution satellite imagery worldwide. The map includes NASA Blue Marble: Next Generation 500m resolution imagery at small scales (above 1:1,000,000), i-cubed 15m eSAT imagery at medium-to-large scales (down to 1:70,000) for the world, and USGS 15m Landsat imagery for Antarctica. The map features 0.3m resolution imagery in the continental United States and 0.6m resolution imagery in parts of Western Europe from DigitalGlobe. In other parts of the world, 1 meter resolution imagery is available from GeoEye IKONOS, i-cubed Nationwide Prime, Getmapping, AeroGRID, IGN Spain, and IGP Portugal. Additionally, imagery at different resolutions has been contributed by the GIS User Community.\nhttp://www.esri.com", creationFunction: function() { return new s({ url: "http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer", proxy: e }) } })), h.push(new t({ name: "ESRI World Street Map", iconUrl: r("Widgets/Images/ImageryProviders/esriWorldStreetMap.png"), tooltip: "This worldwide street map presents highway-level data for the world. Street-level data includes the United States; much of Canada; Japan; most countries in Europe; Australia and New Zealand; India; parts of South America including Argentina, Brazil, Chile, Colombia, and Venezuela; Ghana; and parts of southern Africa including Botswana, Lesotho, Namibia, South Africa, and Swaziland.\nhttp://www.esri.com", creationFunction: function() { return new s({ url: "http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer", proxy: e }) } })), h.push(new t({ name: "ESRI National Geographic", iconUrl: r("Widgets/Images/ImageryProviders/esriNationalGeographic.png"), tooltip: "This web map contains the National Geographic World Map service. This map service is designed to be used as a general reference map for informational and educational purposes as well as a basemap by GIS professionals and other users for creating web maps and web mapping applications.\nhttp://www.esri.com", creationFunction: function() { return new s({ url: "http://services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer/", proxy: e }) } })), h.push(new t({ name: "OpenÂStreetÂMap", iconUrl: r("Widgets/Images/ImageryProviders/openStreetMap.png"), tooltip: "OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org", creationFunction: function() { return new l({ url: "http://tile.openstreetmap.org/", proxy: c }) } })), h.push(new t({ name: "Stamen Watercolor", iconUrl: r("Widgets/Images/ImageryProviders/stamenWatercolor.png"), tooltip: "Reminiscent of hand drawn maps, Stamen watercolor maps apply raster effect area washes and organic edges over a paper texture to add warm pop to any map.\nhttp://maps.stamen.com", creationFunction: function() { return new l({ url: "http://tile.stamen.com/watercolor/", credit: "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.", proxy: c }) } })), h.push(new t({ name: "Stamen Toner", iconUrl: r("Widgets/Images/ImageryProviders/stamenToner.png"), tooltip: "A high contrast black and white map.\nhttp://maps.stamen.com", creationFunction: function() { return new l({ url: "http://tile.stamen.com/toner/", credit: "Map tiles by Stamen Design, under CC BY 3.0. Data by OpenStreetMap, under CC BY SA.", proxy: c }) } })), h.push(new t({ name: "MapQuest OpenÂStreetÂMap", iconUrl: r("Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png"), tooltip: "OpenStreetMap (OSM) is a collaborative project to create a free editable map of the world.\nhttp://www.openstreetmap.org", creationFunction: function() { return new l({ url: "http://otile1.mqcdn.com/tiles/1.0.0/osm/", proxy: c }) } })), h.push(new t({ name: "The Black Marble", iconUrl: r("Widgets/Images/ImageryProviders/blackMarble.png"), tooltip: "The lights of cities and villages trace the outlines of civilization in this global view of the Earth at night as seen by NASA/NOAA's Suomi NPP satellite.", creationFunction: function() { return new u({ url: "http://cesium.agi.com/blackmarble", maximumLevel: 8, credit: "Black Marble imagery courtesy NASA Earth Observatory", proxy: c }) } })), h.push(new t({ name: "Natural Earth II", iconUrl: r("Widgets/Images/ImageryProviders/naturalEarthII.png"), tooltip: "Natural Earth II, darkened for contrast.\nhttp://www.naturalearthdata.com/", creationFunction: function() { return new u({ url: r("Assets/Textures/NaturalEarthII") }) } })), h } return c }), r("Widgets/isatCesiumWidget/isatCesiumWidget", ["../../Core/buildModuleUrl", "../../Core/Cartesian2", "../../Core/Cartesian3", "../../Core/Clock", "../../Core/DefaultProxy", "../../Core/defaultValue", "../../Core/defined", "../../Core/defineProperties", "../../Core/destroyObject", "../../Core/DeveloperError", "../../Core/Ellipsoid", "../../Core/Event", "../../Core/FeatureDetection", "../../Core/requestAnimationFrame", "../../Core/ScreenSpaceEventHandler", "../../Scene/BingMapsImageryProvider", "../../Scene/CentralBody", "../../Scene/Credit", "../../Scene/Scene", "../../Scene/SceneMode", "../../Scene/SceneTransitioner", "../../Scene/SkyAtmosphere", "../../Scene/SkyBox", "../../Scene/Sun", "../getElement"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C, x, S, E) { "use strict";
function b(t) { return e("Assets/Textures/SkyBox/tycho2t3_80_" + t + ".jpg") }
function T(e) {
function t() { if (!e.isDestroyed()) try { e._useDefaultRenderLoop ? (e.resize(), e.render(), m(t)) : e._renderLoopRunning = !1 } catch (r) { e._useDefaultRenderLoop = !1, e._renderLoopRunning = !1, e._onRenderLoopError.raiseEvent(e, r), e._showRenderLoopErrors && (e.showErrorPanel("An error occurred while rendering. Rendering has stopped.", r), console.error(r)) } } e._renderLoopRunning = !0, m(t) } var A = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAHYAAAAaCAYAAABikagwAAAAAXNSR0IArs4c6QAAAAlwSFlzAAAN1wAADdcBQiibeAAAAAd0SU1FB9wGGRQyF371QVsAABOHSURBVGje7Vp5cFTHmf91v2Nm3owGnYMuEEJCOBiEjDlsDMYQjGMOOwmXcWxiLywpJ9iuTXZd612corJssFOxi8LerXizxEGUvWsivNxxHHCQ8WYBYSFzmUMCCXQjaUajOd/V+4f6Kc14kI/KZv/xq+p6M/PmO15/9/c1wa0vwpcMQAHgBuAFoPG7mz8jAGwASQBxADFhJQGYACwAjK+vrr/AJQ8jVMqfuwH4AGQByAaQnTNqXGHWqHGFbq8/g1BJsgw9GQ12Bds/qWsxEvEeAEEAfQDCAKKCgPGVcP//BOsIVQHgAZAJIACgsHTqvDvK7150T2bR2DFaZm6W4slwUypR20yaiUg4OtDbcaP36rlPPt6/7f2B3q5mAB0AeriAE18J9y93kVu4X4W73BwAhQBK5v/gZ98ZVXXvDG92IJMx569MQDEoK0tPmOHu1s4L7799sH7vtvcAXAPQCaCfu2qLu+7h+Eh3sS8Bcyt48iVgPos2+4J7jS+BIx2etDBSynfH/Xq46y0CUL70n3/zXMmUuXepWoZHFCQhFIQARCBFJYV6/Nn+QHnVBH9Ovq/51JFWADpfJhcqEzyDcx9ukTTr/xr2VnDpng0nuHR0h1u3wvWF6EspgBIAFYAfQAGAsuU/rfm7kePvvJ0QiTj6QSgBISS9ujEGSikkxaXklIwfK8uK2Xru2HVurWKspZyezGmmWwp/LqVsupPQub4grPQ5YIejKQvPJAGflLLJSBGmxPEqKXhU4XdJEBq7BR5Z+L+DKx3MTTHWEaybx9WCud/btCJQMeX2Qevk+NPoks0YPArF/RUj0NyXxOmO2CAy1a1OmL9yUVfTmatXTx52EildYFQVNlgRmBR1xQJgCBbPBAVUhcw8lTObLz0FVk4RIEmJJyJNZzFBiCTFBRL+f50rriFUATRFiZSU/XYEAw6X5LlIUghZqXvl5p8pfycRZsgjymlKGw1Adm7JbRUVs785nwGghP5pp9mfFMOxWstmuC3gwdcrRqA/buJUWwyKRMAYgydrZNZt9337623njn+ixyN9nAmdM5nBvYOPfxc3mnEmTQ4T5VZv8hfz8aUKnocJd5tvVhxAhOMADzNefleFjRUFa/D/xzi8LQhIEpTG4VXnNBzlZYISufk7juCfqaAoLkHYcZ6HBAEM8O+ObJz3HcFDpJfDJwWYfiHMMTklviocKHv6I3+zRFLdKhEEatmALBFIBIibNhQ6KFyJEjT2JHDoUj/a+nVIVIBhBGOnzptWXzhmTFfT2TZBOH4AgSeeeGJqRUVFqdfr9btcLnVQXwapmqZpJZPJRCgUCh47duzie++9dwWAXl5enrlp06bF0WhUM01TYYwRrmg2vzNKqS3Lsunz+Yy6urpTP//5z09blkVLSkryVq9ePT03NzegqqqbUnqTGyOEMNM0k319fX2///3vz9bW1l4DYD700EPFy5Ytm65pmvbBBx9c2rp166Wnnnqq7MEHH5zAGIu8/vrr+w8ePPgJVwrRO2gAcg8cOLA2mUx62tvbB9avX39s+fLlo++///5JXNiwbXugpqam9tChQ2cEj6NzuQwlsi+//PKSzMzMQtu2qcfjMZqbm09v2LDht4J3sQEQOU2Jo8mKKzt7VEU5lSgFBi3PZkBZrgv3lGbCo1Jc7I7iSGN40JcQgoGkhXdO94ESQJEoGI+1k/M9mDKqQHEv++akl186e45rNAAE3njjjccWLFhwfyAQyJEkiabGbcc7JJNJva2trX3Lli3vvPbaa+eKi4uLV6xY8d10cf5TcZ8x5OXl5b366qs9lFLtrbfeWldVVXW7pmkuxhjS0SSEIJlMGitXrrz2/PPPv1lTU3NtypQp0x955JG/kmVZdrlcR7du3WrOnTt33pIlS+YDwNGjR68ePHiwjVtukm+wI9ichQsXPgUAHR0d3evXr78xc+bMu9asWbOQUjpENz8/v/jQoUP/IiiH40UzAeQvW7Zs1rp16/7a5/NpDr/19fWlGzZsOM4tNsphkc5iPaXTvl6uuDUvY4MZLwNQ4Ffw+LR8+KQQTCuJSQUFcMsEe88FoSkSKCFwyWSISQbg9pEefHdGAJHIdUydVjFecL3K448/Pm3hwoUPBAKBHFGIlmU5pRCRpMGEze12q2PHjh2zatWqeTt37gwODAxkOQIJhUJ6Y2Njn6IojFJqE0KYsGyPx0POnTvXnUgkfGvXrr1j5syZU7iFsKampv5YLBZ34GzbJgAwatSo7MzMTE95eXnZT37yk0dramr+PRQKZSQSCdPn88nBYNADID8UCmkAYBiGGQ6Hna6cksbdZliWZUuSRKPRKAAUBINBfywWM30+n+yEtenTp9+5YsWKGTt37oxwz+a44RwARc8+++xSr9eriQrY398v8311CUncTTHN0Q7Vl1OQJymq4iBwyxQPT8qDVwri1d1/i8ttp/AP39mOBeMn41pQx9mOGFSZ3qT52ZqMR6aMRGvXKfzbgX9Ea3PnSLEdOWXKlK/5/X4/AFy8ePHG6tWr90QikS5VVaOEEIsxRhljngcffLBi8+bNjxBCUFJSMrKkpMRvGIbboXP27Nn+2bNn/3cgEIgSQmKEEAOARQixKKVxRVEioVAoYtu2dMcdd4x24Hbv3t3+ox/96ONoNBqklMa4ppNkMinNnz8///nnn6/y+Xw0mUxaANy6rrsdl28YhguAX9d1F98jwn9TUjJkJ5N1DWV0ti0ByDAMw+PsbzQatX0+Hy0oKMhcvnz5nP3791+IxWJRIUaPfO655+ZVVlaOA4BoNGprmkZ5uJJThZouKyYAqOrWVEKoE7cwszQDlQUK3jr8S5y++iEIIXh55/fwylOH8e3KHHSEdfQnLFBuRbJEsLQyF27Sh3eO/iuudV+EaSuqkJF6MjMzs9xutwIAv/rVr06eOHHiEwCtPBHQOaPaxYsXLxcXF8cKCwtzOzo6+ltbW4OFhYU+h2nDMAgAqbu7W8xkLSEBcsos1bbtocZIIBBQs7Ky5Pb2dkvXdV1wfaipqemsqak5yF1bFABljNEU4Sj87nia1LKHCJWGLLh6AkDhiksAoLq6um/VqlWZWVlZ8gMPPHDHwoULK2tqasJcYJ7y8vKyb33rW/f4/X43YwybNm26vnnz5pIUb0tvVe44maSVjEfizDJtmwFlOS4srczGiQvv4ncnd4ASAkIo+mN92LLrB/j7Vb/GQxOz8Z/1PTDsQXc6p3QEqopU7Dr6S5y8fAiKpCKhs6SQSUqyLKsO4d7e3j4AvbxD1csFQQF4EolEaP369TVCFjuiqKiogG8w5s6dm8sY++ZwcfbZZ5/dvHXr1isnT55scVz+rFmz8urr6xc4Ls22bZZIJExd181oNGr09PREDx06dPmFF144Ho/HTVGIjiE4guECoyl1LYTPcppGEAghDAAikUjixRdfbHnppZfKfD6fa82aNfMOHz7cHgwGbwBwr1ix4u677rqrgsfU4I4dO66lCPZTXSkqpOaMa60e7mjuosw0RmYoWHf3SLT3NOKt91+CbsZBeOlDCcX5luP4rw9fw4wSH+4p9cMlU3xtpAfLJmej/vIR7PnjLyDRwXeKhoxubokWAOYkDXxTLE5brB11oTZMCrWoNQgymJwZhsHC4bAZjUaNaDRqxGIx3VnxeDzJky8TQGLHjh3n9u3bd6ytrS3U2dkZ6e3tjfX398cHBgYS8XjcIIQQr9frKioq8ldWVhb88Ic/vHfbtm3zAXhs25aHUx7uEt1COeXEXM3JfAWLvWnSxRhLbNu2rampqSlMCME3vvGNyXPmzKkCUFZeXn776tWr72WMwbZtvPDCCx+5XK6wo6BcOdhwQ4Chuu/KR39onDGS9T80u9ivkgiqD/0UbT2NcKvelMaEhXfrqlGaPwEPT5qH0lwvqopcaOtpxPb3/gmGmYBEFRBC0HUlfp67tQQALxMKYsaYU+tlcSadNN8NIOO+++4bnZ2d7Q+Hw+zIkSNJxtiQ9TQ1NUW3bNnSmJWVlZBlWaeUWs5SVTUxYsSIRF1dXScAwzTN2MMPP7w3Pz//ZFVVVUFubq7L6/VKmqZRl8ulKIriVlVVmz59ev6cOXMCLpeLLliwYDyAOpGm08SglA659mQy6eHTrwiPtRYXbi6vP2/yjI61AoDL5Ur09vZ2bt++/ezGjRvvppSSjRs3Lti9e/fvnnzyyfHjx48fyRjDwYMHL9TW1jYWFhZ6xfIs3UhUTlPQRwGE9Gv/c/ba9YGi2rPv0FONf/iUUB3Lj8SDqD60GYtmdGBcYSVOnL+K39b9Gp19zVDkwZzBSpLY9Qv9Z3lKHgOgmaYZd9zg1KlTS994441L3G3lcD6oo/1btmxZFwgEctrb27vWrFlzwLIs2cmKW1pa4q+//vp1AbchdIKiPGZHAJDFixcHpk+ffnsoFNLefvvt3ra2Nl0YSDhdt4zy8vLwsWPHsl0ul6ooigSACuEZXKBJwzAMxhhUVZW8Xm8uH5hQ3mCwOf95VVVVYx03yQVhUEpNQbBxADfefPPN6NKlS8dUVlYWVlZW5r344osz1q1bV8IYQzAYjFVXV5+IxWIdkiTlpfDCUgcC6Sw2CqBvw4ZN+7/9d+Wzo1avT5HU9N1tMpj4dfU14z/efxletx9xPYpIPAhVccO2bVBKcf189I/h3mSLkBi5b9y40RWLxZJer9f12GOPTa6oqMjq6enpJYQYlFLGyx21tLQ0MGnSpDGEECQSCZMQIjuNCF6aqI8++mheVlZWJrdYkzcoLEVREj6fL1FfX39x165dzfPnzy/7/ve/v1LXdWvlypVde/bsuRKLxQyn1LEsS2aMeebNm1fs8/lkxhgsy7IAJBRF0Yc2TZZ1AANNTU0djoJt2rRpzqxZs/K6urq6JUnSCSHMMAxZ07SsxYsXV1JKCWMMAwMDMQBhVVWTjtU6gr1y5Yq1d+/ej8aNG5eraZr6zDPPjPV4PBJjDLW1ted27dr1MYCYqqpDcpMkyRIaEyydxToxNgagr7e3t+XEe0rNxPkjnvhTznNr4Sb0KBL6YO9BovJQnRXptTqaPgr9wTLsDgAhTkOurq4+unz58vs1TRvl9/vVuXPnljHGxgqxw2GcEjLYJLlw4cKV06dPd06bNo04+MePH+/ftm3bNNG1iW5KVVVl//79ew4cONC8d+/ey88884ysKIp85513jpo8eXJh2pHX4EUIITh58uRFAN1utzvHcb0ejycGoKuurk5vbW29u7i4ODB69OisJ5988i4xxDhsKIoiEUJgmqZ94MCBOgBdmqaVODxrmhbhiaP+4x//+N2lS5dOmjBhwhiPxyMBQFdXV191dfX7tm23AdBdLtdQzFYUxWmb3iRcmqbh7vQfOz9+v/PdjvP6kcHuE288MJZWuM4Smw1mgkQvHw/v6Wga+BjADY53AEDfmTNnLq9du/Znp06datB13RA3ROwGmaZphcPhgX379v326aefftO27Tafz9fJGGOmadqMMSbLMpEkiaZbjDFommYQQsK1tbWNr7zyymvhcLifEIJbwRBCmGVZ1vHjxz9atGjRLwA0Z2dndzpdHb/fHwTQcuLEiYann3761fPnz3+i67pBCCGUUkoIofwjpZQS27ZZd3f3ja1bt1Zv3LhxL4CrmZmZPYQQkxCCjIyMEIB2AG0Amrdv3/6beDweNwzD1nXdPHXq1Indu3cf48+7MjIyupw98ng8EW4wCWH4kHbQLgsnJ4oAlN332Ji1hbeps6lEaLohQLrhQCJi9zcei77TcLh9H4CrALp4rLN5LBvBE4scAP6JEyfmBQIBL6VUopSCMcYGBgYSly5dCvX19YW5QkQAmD6fz3PvvfeWxmIxr2EYHqFXPBRrKKWWJEmG1+uNtbW1dTU0NNzgz7wA/OXl5bkFBQV+XsYQwVpZMpk0jh8/3snpRQCYo0aN8k6YMCHX5XLRa9euBRsaGnr4Jnp458c7ceLEbK/X6xL5MQzDbGhoCNq2HeO4YgBYWVmZv6KiIkdVVbS0tHQ3NDR0CsORrDlz5oyllHoYY3p9ff31cDjczeGhaVrGkiVLSg3DkLu7u/s+/PDDFn4UKeJYLhnmAJvGs9QCAKOnLMhfNHqSNl/LlHOpTORbWa4et2ORXqv1wgf9NVfO9B7nTYcuPvlICq02t9CJ8ggjOJomodOF0ZQtHNvxCC08pBnbmcIhO53jdA7mpXaKUkOSWGoxYaaKlIa7IozT0uET+XDGehDGhhBGb6bTmBHezeb8OyNPCPQk/ptzeHConCSfcZDNI1hWQXaBVl5254hZmSPVce4MKUdxEQ+VJMnUbcNIWJFoyOzoa02eOX2k+yg/79TFNWkgZchOUobe4vA63WzUEmpYsa+dCoM0Izgz5aQkTUOPpGvUpKFJBaUR8Q03cLdT8NkppyEgPGOCYcnCiNASsn2SwrstDA2Gxnbkc5xSdHGrcmaBWYoqZ+YUe4pcXuqXJCobupWIhaze3vZohzAfdOaKN2mSwPxwR0ZSZ6uptZoIN9yxFCYIiqV5v3THStgwNNPhvtXxFgzDP9K8q52Cj6ZRNnaLffoUDfI5zhVLgrvxCN0Ux5URYXYYF84Wf2qqf4uDV591ZuiLHir7c8F+mZOU5M+Iazg8n3mYjnxORkV3I6dxg6KrMQW3Yaexlq+uv8D1v2IL+t4z3B/NAAAAAElFTkSuQmCC",
M = function(e, t) { if (!a(e)) throw new u("container is required.");
e = E(e), t = o(t, {}); var s = document.createElement("div");
s.className = "cesium-widget", e.appendChild(s), this._element = s; try { var l = document.createElement("canvas");
l.oncontextmenu = function() { return !1 }, l.onselectstart = function() { return !1 }, s.appendChild(l); var m = document.createElement("div");
m.className = "cesium-widget-credits", s.appendChild(m); var T = new g(l, t.contextOptions, m);
T.getCamera().controller.constrainedAxis = r.UNIT_Z; var M = c.WGS84,
P = T.getFrameState().creditDisplay,
D = new y("isatCesium", A, "http://cesium.agi.com/");
P.addDefaultCredit(D); var I = new v(M);
T.getPrimitives().setCentralBody(I), T.skyBox = new x({ positiveX: b("px"), negativeX: b("mx"), positiveY: b("py"), negativeY: b("my"), positiveZ: b("pz"), negativeZ: b("mz") }), T.skyAtmosphere = new C(M), T.sun = new S; var O = t.imageryProvider;
a(O) || (O = new f({ url: "http://dev.virtualearth.net", proxy: d.supportsCrossOriginImagery() ? void 0 : new n("http://cesium.agi.com/proxy/") })), O !== !1 && I.getImageryLayers().addImageryProvider(O), a(t.terrainProvider) && (I.terrainProvider = t.terrainProvider), this._container = e, this._canvas = l, this._canvasWidth = l.width, this._canvasHeight = l.height, this._scene = T, this._centralBody = I, this._clock = o(t.clock, new i), this._transitioner = new w(T, M), this._screenSpaceEventHandler = new p(l), this._useDefaultRenderLoop = void 0, this._renderLoopRunning = !1, this._creditContainer = m, this._canRender = !1, this._showRenderLoopErrors = o(t.showRenderLoopErrors, !0), this._onRenderLoopError = new h, t.sceneMode && (t.sceneMode === _.SCENE2D && this._transitioner.to2D(), t.sceneMode === _.COLUMBUS_VIEW && this._transitioner.toColumbusView()), this.useDefaultRenderLoop = o(t.useDefaultRenderLoop, !0) } catch (R) { var L = "Error constructing isatCesiumWidget. Check if WebGL is enabled."; throw this.showErrorPanel(L, R), R } }; return s(M.prototype, { container: { get: function() { return this._container } }, sceneTransitioner: { get: function() { return this._transitioner } }, canvas: { get: function() { return this._canvas } }, creditContainer: { get: function() { return this._creditContainer } }, scene: { get: function() { return this._scene } }, centralBody: { get: function() { return this._centralBody } }, clock: { get: function() { return this._clock } }, screenSpaceEventHandler: { get: function() { return this._screenSpaceEventHandler } }, onRenderLoopError: { get: function() { return this._onRenderLoopError } }, useDefaultRenderLoop: { get: function() { return this._useDefaultRenderLoop }, set: function(e) { this._useDefaultRenderLoop !== e && (this._useDefaultRenderLoop = e, e && !this._renderLoopRunning && T(this)) } } }), M.prototype.showErrorPanel = function(e, t) { var r = this._element,
i = document.createElement("div");
i.className = "cesium-widget-errorPanel"; var n = document.createElement("div");
n.className = "cesium-widget-errorPanel-content", i.appendChild(n); var o = document.createElement("div"); if (o.className = "cesium-widget-errorPanel-header", o.textContent = e, n.appendChild(o), a(t)) { var s = document.createElement("div");
s.className = "cesium-widget-errorPanel-message", s.textContent = t, n.appendChild(s) } var l = document.createElement("div");
l.className = "cesium-widget-errorPanel-buttonPanel", n.appendChild(l); var u = document.createElement("span");
u.className = "cesium-widget-button", u.textContent = "OK", u.tabIndex = 100, u.onclick = function() { r.removeChild(i) }, l.appendChild(u), r.appendChild(i) }, M.prototype.isDestroyed = function() { return !1 }, M.prototype.destroy = function() { this._container.removeChild(this._element), l(this) }, M.prototype.resize = function() { var e = this._canvas,
t = e.clientWidth,
r = e.clientHeight; if (this._canvasWidth !== t || this._canvasHeight !== r) { e.width = this._canvasWidth = t, e.height = this._canvasHeight = r; var i = 0 !== t && 0 !== r; if (this._canRender = i, i) { var n = this._scene.getCamera().frustum;
a(n.aspectRatio) ? n.aspectRatio = t / r : (n.top = n.right * (r / t), n.bottom = -n.top) } } }, M.prototype.render = function() { this._scene.initializeFrame(); var e = this._clock.tick();
this._canRender && this._scene.render(e) }, M }), r("Widgets/ClockViewModel", ["../Core/Clock", "../Core/defaultValue", "../Core/defineProperties", "../Core/destroyObject", "../Core/EventHelper", "../Core/JulianDate", "../ThirdParty/knockout"], function(e, t, r, i, n, o, a) {
"use strict";
var s = function(r) {
r = t(r, new e), this._clock = r, this._eventHelper = new n, this._eventHelper.add(r.onTick, this.synchronize, this);
var i = a.observable(r.startTime);
i.equalityComparer = o.equals, this.systemTime = a.observable(new o), this.systemTime.equalityComparer = o.equals, a.track(this, ["systemTime"]), this.startTime = void 0, a.defineProperty(this, "startTime", { get: i, set: function(e) { i(e), r.startTime = e } });
var s = a.observable(r.stopTime);
s.equalityComparer = o.equals, this.stopTime = void 0, a.defineProperty(this, "stopTime", { get: s, set: function(e) { r.stopTime = e, s(e) } });
var l = a.observable(r.currentTime);
l.equalityComparer = o.equals, this.currentTime = void 0, a.defineProperty(this, "currentTime", { get: l, set: function(e) { r.currentTime = e, l(e) } });
var u = a.observable(r.multiplier);
this.multiplier = void 0, a.defineProperty(this, "multiplier", { get: u, set: function(e) { r.multiplier = e, u(e) } });
var c = a.observable(r.clockStep);
c.equalityComparer = function(e, t) { return e === t }, this.clockStep = void 0, a.defineProperty(this, "clockStep", { get: c, set: function(e) { c(e), r.clockStep = e } });
var h = a.observable(r.clockRange);
h.equalityComparer = function(e, t) { return e === t }, this.clockRange = void 0, a.defineProperty(this, "clockRange", { get: h, set: function(e) { h(e), r.clockRange = e } });
var d = a.observable(r.shouldAnimate);
this.shouldAnimate = void 0, a.defineProperty(this, "shouldAnimate", {
get: d,
set: function(e) {
d(e), r.shouldAnimate = e
}
})
};
return r(s.prototype, { clock: { get: function() { return this._clock } } }), s.prototype.synchronize = function() { var e = this._clock,
t = e.startTime,
r = e.stopTime,
i = e.currentTime,
n = e.multiplier,
a = e.clockStep,
s = e.clockRange,
l = e.shouldAnimate;
this.systemTime = new o, this.startTime = t, this.stopTime = r, this.currentTime = i, this.multiplier = n, this.clockStep = a, this.clockRange = s, this.shouldAnimate = l }, s.prototype.isDestroyed = function() { return !1 }, s.prototype.destroy = function() { this._eventHelper.removeAll(), i(this) }, s
}), r("Widgets/Command", ["../Core/DeveloperError"], function(e) { "use strict"; var t = function() { throw this.canExecute = void 0, this.beforeExecute = void 0, this.afterExecute = void 0, new e("This type should not be instantiated directly.") }; return t }), r("Widgets/FullscreenButton/FullscreenButtonViewModel", ["../../Core/defaultValue", "../../Core/defineProperties", "../../Core/destroyObject", "../../Core/DeveloperError", "../../Core/Fullscreen", "../createCommand", "../../ThirdParty/knockout"], function(e, t, r, i, n, o, a) { "use strict"; var s = function(t) { var r = this,
i = a.observable(n.isFullscreen()),
s = a.observable(n.isFullscreenEnabled());
this.isFullscreen = void 0, a.defineProperty(this, "isFullscreen", { get: function() { return i() } }), this.isFullscreenEnabled = void 0, a.defineProperty(this, "isFullscreenEnabled", { get: function() { return s() }, set: function(e) { s(e && n.isFullscreenEnabled()) } }), this.tooltip = void 0, a.defineProperty(this, "tooltip", function() { return this.isFullscreenEnabled ? i() ? "Exit full screen" : "Full screen" : "Full screen unavailable" }), this._command = o(function() { n.isFullscreen() ? n.exitFullscreen() : n.requestFullscreen(r._fullscreenElement) }, a.getObservable(this, "isFullscreenEnabled")), this._fullscreenElement = e(t, document.body), this._callback = function() { i(n.isFullscreen()) }, document.addEventListener(n.getFullscreenChangeEventName(), this._callback) }; return t(s.prototype, { fullscreenElement: { get: function() { return this._fullscreenElement }, set: function(e) { if (!(e instanceof Element)) throw new i("value must be a valid Element.");
this._fullscreenElement = e } }, command: { get: function() { return this._command } } }), s.prototype.isDestroyed = function() { return !1 }, s.prototype.destroy = function() { document.removeEventListener(n.getFullscreenChangeEventName(), this._callback), r(this) }, s }), r("Widgets/FullscreenButton/FullscreenButton", ["../../Core/defined", "../../Core/defineProperties", "../../Core/DeveloperError", "../../Core/destroyObject", "../getElement", "./FullscreenButtonViewModel", "../../ThirdParty/knockout"], function(e, t, r, i, n, o, a) { "use strict"; var s = function(t, i) { if (!e(t)) throw new r("container is required.");
t = n(t), this._container = t, this._viewModel = new o(i), this._element = document.createElement("button"), this._element.type = "button", this._element.className = "cesium-fullscreenButton", this._element.setAttribute("data-bind", 'attr: { title: tooltip },css: { "cesium-fullscreenButton-exit": isFullscreen },click: command,enable: isFullscreenEnabled'), t.appendChild(this._element), a.applyBindings(this._viewModel, this._element) }; return t(s.prototype, { container: { get: function() { return this._container } }, viewModel: { get: function() { return this._viewModel } } }), s.prototype.isDestroyed = function() { return !1 }, s.prototype.destroy = function() { var e = this._container; return a.cleanNode(e), this._viewModel.destroy(), e.removeChild(this._element), i(this) }, s }), r("Widgets/HomeButton/HomeButtonViewModel", ["../../Core/Cartesian3", "../../Core/defaultValue", "../../Core/defined", "../../Core/defineProperties", "../../Core/DeveloperError", "../../Core/Ellipsoid", "../../Core/Extent", "../../Core/Math", "../../Core/Matrix4", "../../Scene/Camera", "../../Scene/CameraColumbusViewMode", "../../Scene/CameraFlightPath", "../../Scene/PerspectiveFrustum", "../../Scene/SceneMode", "../createCommand", "../../ThirdParty/knockout"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f) { "use strict";
function v(t, i, n, o) { var s = t.mode,
d = t.getCamera();
d.controller.constrainedAxis = e.UNIT_Z; var p = t.getScreenSpaceCameraController();
p.setEllipsoid(i), p.columbusViewMode = c.FREE; var f = t.getCanvas();
r(n) && s === m.MORPHING && n.completeMorph(); var v, y; if (s === m.SCENE2D) d.transform = new l(0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1), y = { destination: a.MAX_VALUE, duration: o }, v = h.createAnimationExtent(t, y), t.getAnimations().add(v);
else if (s === m.SCENE3D) { e.add(d.position, l.getTranslation(d.transform), d.position); var g = l.getRotation(d.transform);
g.multiplyByVector(d.direction, d.direction), g.multiplyByVector(d.up, d.up), g.multiplyByVector(d.right, d.right), d.transform = l.IDENTITY.clone(); var _ = new u(f);
y = { destination: _.position, duration: o, up: _.up, direction: _.direction }, v = h.createAnimation(t, y), t.getAnimations().add(v) } else if (s === m.COLUMBUS_VIEW) { d.transform = new l(0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1); var w = i.getMaximumRadius(),
C = new e(0, -1, 1).normalize().multiplyByScalar(5 * w),
x = e.ZERO.subtract(C).normalize(),
S = x.cross(e.UNIT_Z),
E = S.cross(x);
y = { destination: C, duration: o, up: E, direction: x }, v = h.createAnimation(t, y), t.getAnimations().add(v) } } var y = function(e, i, a, s) { if (!r(e)) throw new n("scene is required.");
a = t(a, o.WGS84), s = t(s, 1500), this._scene = e, this._ellipsoid = a, this._transitioner = i, this._flightDuration = s; var l = this;
this._command = p(function() { v(l._scene, l._ellipsoid, l._transitioner, l._flightDuration) }), this.tooltip = "View Home", f.track(this, ["tooltip"]) }; return i(y.prototype, { sceneTransitioner: { get: function() { return this._transitioner } }, scene: { get: function() { return this._scene } }, ellipsoid: { get: function() { return this._ellipsoid } }, command: { get: function() { return this._command } }, flightDuration: { get: function() { return this._flightDuration }, set: function(e) { if (0 > e) throw new n("value must be positive.");
this._flightDuration = e } } }), y }), r("Widgets/HomeButton/HomeButton", ["../../Core/defined", "../../Core/defineProperties", "../../Core/destroyObject", "../../Core/DeveloperError", "../getElement", "./HomeButtonViewModel", "../../ThirdParty/knockout"], function(e, t, r, i, n, o, a) { "use strict"; var s = function(t, r, s, l, u) { if (!e(t)) throw new i("container is required.");
t = n(t), this._container = t, this._viewModel = new o(r, s, l, u), this._element = document.createElement("span"), this._element.className = "cesium-homeButton", this._element.setAttribute("data-bind", "attr: { title: tooltip }, click: command"), t.appendChild(this._element), a.applyBindings(this._viewModel, this._element) }; return t(s.prototype, { container: { get: function() { return this._container } }, viewModel: { get: function() { return this._viewModel } } }), s.prototype.isDestroyed = function() { return !1 }, s.prototype.destroy = function() { var e = this._container; return a.cleanNode(e), e.removeChild(this._element), r(this) }, s }), r("Widgets/Observable", ["../Core/DeveloperError"], function(e) { "use strict"; var t = function() { throw new e("This type should not be instantiated directly.") }; return t }), r("Widgets/SceneModePicker/SceneModePickerViewModel", ["../../Core/defineProperties", "../../Core/defined", "../../Core/destroyObject", "../../Core/DeveloperError", "../../Core/EventHelper", "../../Scene/SceneMode", "../createCommand", "../../ThirdParty/knockout"], function(e, t, r, i, n, o, a, s) { "use strict"; var l = function(e) { if (!t(e)) throw new i("transitioner is required.");
this._transitioner = e; var r = this,
l = function(e, t, i) { r.sceneMode = i, r.dropDownVisible = !1 };
this._eventHelper = new n, this._eventHelper.add(e.onTransitionStart, l), this.sceneMode = e.getScene().mode, this.dropDownVisible = !1, this.tooltip2D = "2D", this.tooltip3D = "3D", this.tooltipColumbusView = "Columbus View", s.track(this, ["sceneMode", "dropDownVisible", "tooltip2D", "tooltip3D", "tooltipColumbusView"]), this.selectedTooltip = void 0, s.defineProperty(this, "selectedTooltip", function() { var e = r.sceneMode; return e === o.SCENE2D ? r.tooltip2D : e === o.SCENE3D ? r.tooltip3D : r.tooltipColumbusView }), this._toggleDropDown = a(function() { r.dropDownVisible = !r.dropDownVisible }), this._morphTo2D = a(function() { e.morphTo2D() }), this._morphTo3D = a(function() { e.morphTo3D() }), this._morphToColumbusView = a(function() { e.morphToColumbusView() }), this._sceneMode = o }; return e(l.prototype, { sceneTransitioner: { get: function() { return this._transitioner } }, toggleDropDown: { get: function() { return this._toggleDropDown } }, morphTo2D: { get: function() { return this._morphTo2D } }, morphTo3D: { get: function() { return this._morphTo3D } }, morphToColumbusView: { get: function() { return this._morphToColumbusView } } }), l.prototype.isDestroyed = function() { return !1 }, l.prototype.destroy = function() { this._eventHelper.removeAll(), r(this) }, l }), r("Widgets/SceneModePicker/SceneModePicker", ["../../Core/defineProperties", "../../Core/defined", "../../Core/destroyObject", "../../Core/DeveloperError", "../getElement", "./SceneModePickerViewModel", "../../ThirdParty/knockout"], function(e, t, r, i, n, o, a) { "use strict"; var s = function(e, r) { if (!t(e)) throw new i("container is required."); if (!t(r)) throw new i("transitioner is required.");
e = n(e); var s = new o(r);
this._viewModel = s, this._container = e, this._element = document.createElement("span"); var l = this._element;
l.className = "cesium-sceneModePicker-button", l.setAttribute("data-bind", ' css: { "cesium-sceneModePicker-button2D": sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-button3D": sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-buttonColumbusView": sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-selected": dropDownVisible}, attr: { title: selectedTooltip }, click: toggleDropDown'), e.appendChild(l); var u = document.createElement("span");
u.className = "cesium-sceneModePicker-button cesium-sceneModePicker-button3D", u.setAttribute("data-bind", ' css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE3D)) || (!dropDownVisible && (sceneMode === _sceneMode.SCENE3D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE3D, "cesium-sceneModePicker-hidden" : !dropDownVisible}, attr: { title: tooltip3D }, click: morphTo3D'), e.appendChild(u), this._node3D = u; var c = document.createElement("span");
c.className = "cesium-sceneModePicker-button cesium-sceneModePicker-button2D", c.setAttribute("data-bind", ' css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.SCENE2D)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.SCENE2D, "cesium-sceneModePicker-hidden" : !dropDownVisible}, attr: { title: tooltip2D }, click: morphTo2D'), e.appendChild(c), this._node2D = c; var h = document.createElement("span");
h.className = "cesium-sceneModePicker-button cesium-sceneModePicker-buttonColumbusView", h.setAttribute("data-bind", ' css: { "cesium-sceneModePicker-visible" : (dropDownVisible && (sceneMode !== _sceneMode.COLUMBUS_VIEW)) || (!dropDownVisible && (sceneMode === _sceneMode.COLUMBUS_VIEW)), "cesium-sceneModePicker-none" : sceneMode === _sceneMode.COLUMBUS_VIEW, "cesium-sceneModePicker-hidden" : !dropDownVisible}, attr: { title: tooltipColumbusView }, click: morphToColumbusView'), e.appendChild(h), this._nodeColumbus = h, a.applyBindings(s, e), this._closeDropDown = function(t) { e.contains(t.target) || (s.dropDownVisible = !1) }, document.addEventListener("mousedown", this._closeDropDown, !0), document.addEventListener("touchstart", this._closeDropDown, !0) }; return e(s.prototype, { container: { get: function() { return this._container } }, viewModel: { get: function() { return this._viewModel } } }), s.prototype.isDestroyed = function() { return !1 }, s.prototype.destroy = function() { this._viewModel.destroy(), document.removeEventListener("mousedown", this._closeDropDown, !0), document.removeEventListener("touchstart", this._closeDropDown, !0); var e = this._container; return a.cleanNode(e), e.removeChild(this._element), e.removeChild(this._node3D), e.removeChild(this._node2D), e.removeChild(this._nodeColumbus), r(this) }, s }), r("Widgets/Timeline/TimelineTrack", ["../../Core/Color", "../../Core/defined"], function(e, t) { "use strict";
function r(t, r, i, n) { this.interval = t, this.height = r, this.color = i || new e(.5, .5, .5, 1), this.backgroundColor = n || new e(0, 0, 0, 0) } return r.prototype.render = function(e, r) { var i = this.interval.start,
n = this.interval.stop,
o = r.startJulian,
a = r.startJulian.addSeconds(r.duration); if (i.lessThan(o) && n.greaterThan(a)) e.fillStyle = this.color.toCssColorString(), e.fillRect(0, r.y, r.timeBarWidth, this.height);
else if (i.lessThanOrEquals(a) && n.greaterThanOrEquals(o)) { var s, l, u; for (s = 0; s < r.timeBarWidth; ++s) { var c = r.startJulian.addSeconds(s / r.timeBarWidth * r.duration);!t(l) && c.greaterThanOrEquals(i) ? l = s : !t(u) && c.greaterThanOrEquals(n) && (u = s) } e.fillStyle = this.backgroundColor.toCssColorString(), e.fillRect(0, r.y, r.timeBarWidth, this.height), t(l) && (t(u) || (u = r.timeBarWidth), e.fillStyle = this.color.toCssColorString(), e.fillRect(l, r.y, Math.max(u - l, 1), this.height)) } }, r }), r("Widgets/Timeline/TimelineHighlightRange", [], function() { "use strict";
function e(e, t) { this._color = e, this._height = t } return e.prototype.getHeight = function() { return this._height }, e.prototype.getStartTime = function() { return this._start }, e.prototype.getStopTime = function() { return this._stop }, e.prototype.setRange = function(e, t) { this._start = e, this._stop = t }, e.prototype.render = function(e) { var t = ""; if (this._start && this._stop && this._color) { var r = e.epochJulian.getSecondsDifference(this._start),
i = Math.round(e.timeBarWidth * e.getAlpha(r)),
n = e.epochJulian.getSecondsDifference(this._stop),
o = Math.round(e.timeBarWidth * e.getAlpha(n)) - i;
0 > i && (o += i, i = 0), i + o > e.timeBarWidth && (o = e.timeBarWidth - i), o > 0 && (t = '') } return e.y += this._height, t }, e }), r("Widgets/Timeline/Timeline", ["../../Core/DeveloperError", "../../Core/ClockRange", "../../Core/defined", "../../Core/destroyObject", "../../Core/JulianDate", "../getElement", "./TimelineTrack", "./TimelineHighlightRange"], function(e, t, r, i, n, o, a, s) { "use strict";
function l(t, i) { if (!r(t)) throw new e("container is required."); if (!r(i)) throw new e("clock is required.");
t = o(t), this.container = t; var n = document.createElement("div");
n.className = "cesium-timeline-main", t.appendChild(n), this._topDiv = n, this._endJulian = void 0, this._epochJulian = void 0, this._lastXPos = void 0, this._scrubElement = void 0, this._startJulian = void 0, this._timeBarSecondsSpan = void 0, this._clock = i, this._scrubJulian = i.currentTime, this._mainTicSpan = -1, this._mouseMode = g.none, this._touchMode = _.none, this._touchState = { centerX: 0, spanX: 0 }, this._mouseX = 0, this._timelineDrag = 0, this._timelineDragLocation = void 0, this._lastHeight = void 0, this._lastWidth = void 0, this._topDiv.innerHTML = '', this._timeBarEle = this._topDiv.childNodes[0], this._trackContainer = this._topDiv.childNodes[1], this._trackListEle = this._topDiv.childNodes[1].childNodes[0], this._needleEle = this._topDiv.childNodes[2], this._rulerEle = this._topDiv.childNodes[3], this._context = this._trackListEle.getContext("2d"), this._trackList = [], this._highlightRanges = [], this.zoomTo(i.startTime, i.stopTime), this._onMouseDown = c(this), this._onMouseUp = h(this), this._onMouseMove = d(this), this._onMouseWheel = m(this), this._onTouchStart = p(this), this._onTouchMove = v(this), this._onTouchEnd = f(this); var a = this._timeBarEle;
document.addEventListener("mouseup", this._onMouseUp, !1), document.addEventListener("mousemove", this._onMouseMove, !1), a.addEventListener("mousedown", this._onMouseDown, !1), a.addEventListener("DOMMouseScroll", this._onMouseWheel, !1), a.addEventListener("mousewheel", this._onMouseWheel, !1), a.addEventListener("touchstart", this._onTouchStart, !1), a.addEventListener("touchmove", this._onTouchMove, !1), a.addEventListener("touchend", this._onTouchEnd, !1), this._topDiv.oncontextmenu = function() { return !1 }, i.onTick.addEventListener(this.updateFromClock, this), this.updateFromClock() }
function u(e) { return 10 > e ? "0" + e.toString() : e.toString() }
function c(e) { return function(t) { e._mouseMode !== g.touchOnly && (0 === t.button ? (e._mouseMode = g.scrub, e._scrubElement && (e._scrubElement.style.backgroundPosition = "-16px 0"), e._onMouseMove(t)) : (e._mouseX = t.clientX, e._mouseMode = 2 === t.button ? g.zoom : g.slide)), t.preventDefault() } }
function h(e) { return function() { e._mouseMode = g.none, e._scrubElement && (e._scrubElement.style.backgroundPosition = "0px 0px"), e._timelineDrag = 0, e._timelineDragLocation = void 0 } }
function d(e) { return function(t) { var r; if (e._mouseMode === g.scrub) { t.preventDefault(); var i = t.clientX - e._topDiv.getBoundingClientRect().left;
0 > i ? (e._timelineDragLocation = 0, e._timelineDrag = -.01 * e._timeBarSecondsSpan) : i > e._topDiv.clientWidth ? (e._timelineDragLocation = e._topDiv.clientWidth, e._timelineDrag = .01 * e._timeBarSecondsSpan) : (e._timelineDragLocation = void 0, e._setTimeBarTime(i, i * e._timeBarSecondsSpan / e._topDiv.clientWidth)) } else if (e._mouseMode === g.slide) { if (r = e._mouseX - t.clientX, e._mouseX = t.clientX, 0 !== r) { var n = r * e._timeBarSecondsSpan / e._topDiv.clientWidth;
e.zoomTo(e._startJulian.addSeconds(n), e._endJulian.addSeconds(n)) } } else e._mouseMode === g.zoom && (r = e._mouseX - t.clientX, e._mouseX = t.clientX, 0 !== r && e.zoomFrom(Math.pow(1.01, r))) } }
function m(e) { return function(t) { var r = t.wheelDeltaY || t.wheelDelta || -t.detail;
y = Math.max(Math.min(Math.abs(r), y), 1), r /= y, e.zoomFrom(Math.pow(1.05, -r)) } }
function p(e) { return function(t) { var r, i, n = t.touches.length,
o = e._topDiv.getBoundingClientRect().left;
t.preventDefault(), e._mouseMode = g.touchOnly, 1 === n ? (r = e._startJulian.getSecondsDifference(e._scrubJulian), i = Math.round(r * e._topDiv.clientWidth / e._timeBarSecondsSpan + o), Math.abs(t.touches[0].clientX - i) < 50 ? (e._touchMode = _.scrub, e._scrubElement && (e._scrubElement.style.backgroundPosition = 1 === n ? "-16px 0" : "0 0")) : (e._touchMode = _.singleTap, e._touchState.centerX = t.touches[0].clientX - o)) : 2 === n ? (e._touchMode = _.slideZoom, e._touchState.centerX = .5 * (t.touches[0].clientX + t.touches[1].clientX) - o, e._touchState.spanX = Math.abs(t.touches[0].clientX - t.touches[1].clientX)) : e._touchMode = _.ignore } }
function f(e) { return function(t) { var r = t.touches.length,
i = e._topDiv.getBoundingClientRect().left;
e._touchMode === _.singleTap ? (e._touchMode = _.scrub, e._handleTouchMove(t)) : e._touchMode === _.scrub && e._handleTouchMove(t), e._mouseMode = g.touchOnly, 1 !== r ? e._touchMode = r > 0 ? _.ignore : _.none : e._touchMode === _.slideZoom && (e._touchState.centerX = t.touches[0].clientX - i), e._scrubElement && (e._scrubElement.style.backgroundPosition = "0 0") } }
function v(e) { return function(t) { var i, n, o, a, s, l, u = 1,
c = e._topDiv.getBoundingClientRect().left;
e._touchMode === _.singleTap && (e._touchMode = _.slideZoom), e._mouseMode = g.touchOnly, e._touchMode === _.scrub ? (t.preventDefault(), 1 === t.changedTouches.length && (n = t.changedTouches[0].clientX - c, n >= 0 && n <= e._topDiv.clientWidth && e._setTimeBarTime(n, n * e._timeBarSecondsSpan / e._topDiv.clientWidth))) : e._touchMode === _.slideZoom && (o = t.touches.length, 2 === o ? (a = .5 * (t.touches[0].clientX + t.touches[1].clientX) - c, s = Math.abs(t.touches[0].clientX - t.touches[1].clientX)) : 1 === o && (a = t.touches[0].clientX - c, s = 0), r(a) && (s > 0 && e._touchState.spanX > 0 ? (u = e._touchState.spanX / s, l = e._startJulian.addSeconds((e._touchState.centerX * e._timeBarSecondsSpan - a * e._timeBarSecondsSpan * u) / e._topDiv.clientWidth)) : (i = e._touchState.centerX - a, l = e._startJulian.addSeconds(i * e._timeBarSecondsSpan / e._topDiv.clientWidth)), e.zoomTo(l, l.addSeconds(e._timeBarSecondsSpan * u)), e._touchState.centerX = a, e._touchState.spanX = s)) } } var y = 1e12,
g = { none: 0, scrub: 1, slide: 2, zoom: 3, touchOnly: 4 },
_ = { none: 0, scrub: 1, slideZoom: 2, singleTap: 3, ignore: 4 },
w = [.001, .002, .005, .01, .02, .05, .1, .25, .5, 1, 2, 5, 10, 15, 30, 60, 120, 300, 600, 900, 1800, 3600, 7200, 14400, 21600, 43200, 86400, 172800, 345600, 604800, 1296e3, 2592e3, 5184e3, 7776e3, 15552e3, 31536e3, 63072e3, 126144e3, 15768e4, 31536e4, 63072e4, 126144e4, 15768e5, 31536e5, 63072e5, 126144e5, 15768e6, 31536e6],
C = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]; return l.prototype.addEventListener = function(e, t, r) { this._topDiv.addEventListener(e, t, r) }, l.prototype.removeEventListener = function(e, t, r) { this._topDiv.removeEventListener(e, t, r) }, l.prototype.isDestroyed = function() { return !1 }, l.prototype.destroy = function() { this._clock.onTick.removeEventListener(this.updateFromClock, this), document.removeEventListener("mouseup", this._onMouseUp, !1), document.removeEventListener("mousemove", this._onMouseMove, !1); var e = this._timeBarEle;
e.removeEventListener("mousedown", this._onMouseDown, !1), e.removeEventListener("DOMMouseScroll", this._onMouseWheel, !1), e.removeEventListener("mousewheel", this._onMouseWheel, !1), e.removeEventListener("touchstart", this._onTouchStart, !1), e.removeEventListener("touchmove", this._onTouchMove, !1), e.removeEventListener("touchend", this._onTouchEnd, !1), this.container.removeChild(this._topDiv), i(this) }, l.prototype.addHighlightRange = function(e, t) { var r = new s(e, t); return this._highlightRanges.push(r), this.resize(), r }, l.prototype.addTrack = function(e, t, r, i) { var n = new a(e, t, r, i); return this._trackList.push(n), this.resize(), n }, l.prototype.zoomTo = function(r, i) { if (this._timeBarSecondsSpan = r.getSecondsDifference(i), this._timeBarSecondsSpan <= 0) throw new e("Start time must come before end time."); if (this._startJulian = r, this._endJulian = i, this._clock && this._clock.clockRange !== t.UNBOUNDED) { var n = this._clock.startTime,
o = this._clock.stopTime,
a = n.getSecondsDifference(o),
s = this._startJulian.getSecondsDifference(n),
l = this._endJulian.getSecondsDifference(o);
this._timeBarSecondsSpan >= a ? (this._timeBarSecondsSpan = a, this._startJulian = this._clock.startTime, this._endJulian = this._clock.stopTime) : s > 0 ? (this._endJulian = this._endJulian.addSeconds(s), this._startJulian = n, this._timeBarSecondsSpan = this._startJulian.getSecondsDifference(this._endJulian)) : 0 > l && (this._startJulian = this._startJulian.addSeconds(l), this._endJulian = o, this._timeBarSecondsSpan = this._startJulian.getSecondsDifference(this._endJulian)) } this._makeTics(); var u = document.createEvent("Event");
u.initEvent("setzoom", !0, !0), u.startJulian = this._startJulian, u.endJulian = this._endJulian, u.epochJulian = this._epochJulian, u.totalSpan = this._timeBarSecondsSpan, u.mainTicSpan = this._mainTicSpan, this._topDiv.dispatchEvent(u) }, l.prototype.zoomFrom = function(e) { var t = this._startJulian.getSecondsDifference(this._scrubJulian);
e > 1 || 0 > t || t > this._timeBarSecondsSpan ? t = .5 * this._timeBarSecondsSpan : t += t - .5 * this._timeBarSecondsSpan; var r = this._timeBarSecondsSpan - t;
this.zoomTo(this._startJulian.addSeconds(t - t * e), this._endJulian.addSeconds(r * e - r)) }, l.prototype.makeLabel = function(e) { var t = e.toGregorianDate(),
r = t.millisecond,
i = " UTC"; if (r > 0 && this._timeBarSecondsSpan < 3600) { for (i = Math.floor(r).toString(); i.length < 3;) i = "0" + i;
i = "." + i } return C[t.month - 1] + " " + t.day + " " + t.year + " " + u(t.hour) + ":" + u(t.minute) + ":" + u(t.second) + i }, l.prototype.smallestTicInPixels = 7, l.prototype._makeTics = function() {
function e(e) { return Math.floor(x / e) * e }
function t(e, t) { return Math.ceil(e / t + .5) * t }
function r(e) { return (e - x) / v }
function i(e, t) { return e - t * Math.round(e / t) } var o, a = this._timeBarEle,
s = this._startJulian.getSecondsDifference(this._scrubJulian),
l = Math.round(s * this._topDiv.clientWidth / this._timeBarSecondsSpan),
u = l - 8,
c = this;
this._needleEle.style.left = l.toString() + "px"; var h = '',
d = .01,
m = 31536e6,
p = 1e-10,
f = 0,
v = this._timeBarSecondsSpan;
d > v ? (v = d, this._timeBarSecondsSpan = d, this._endJulian = this._startJulian.addSeconds(d)) : v > m && (v = m, this._timeBarSecondsSpan = m, this._endJulian = this._startJulian.addSeconds(m)); var y = this._timeBarEle.clientWidth;
10 > y && (y = 10); var g, _ = this._startJulian,
C = Math.min(1e-5 * (v / y), .4);
g = v > 31536e4 ? n.fromIso8601(_.toDate().toISOString().substring(0, 2) + "00-01-01T00:00:00Z") : v > 31536e3 ? n.fromIso8601(_.toDate().toISOString().substring(0, 3) + "0-01-01T00:00:00Z") : v > 86400 ? n.fromIso8601(_.toDate().toISOString().substring(0, 4) + "-01-01T00:00:00Z") : n.fromIso8601(_.toDate().toISOString().substring(0, 10) + "T00:00:00Z"); var x = g.addSeconds(C).getSecondsDifference(this._startJulian),
S = x + v;
this._epochJulian = g, this._rulerEle.innerHTML = this.makeLabel(this._endJulian.addSeconds(-d)); var E = this._rulerEle.offsetWidth + 20,
b = f;
f -= p; var T = { y: 0, startTime: x, startJulian: _, epochJulian: g, duration: v, timeBarWidth: y, getAlpha: r };
this._highlightRanges.forEach(function(e) { h += e.render(T) }); var A = 0,
M = 0,
P = 0,
D = E / y;
D > 1 && (D = 1), D *= this._timeBarSecondsSpan; var I, O = -1,
R = -1,
L = w.length; for (I = 0; L > I; ++I) { var z = w[I]; if (++O, A = z, z > D && z > f) break;
0 > R && y * (z / this._timeBarSecondsSpan) >= this.smallestTicInPixels && (R = O) } if (O > 0) { for (; O > 0;)
if (--O, Math.abs(i(A, w[O])) < 1e-5) { w[O] >= f && (M = w[O]); break }
if (R >= 0)
for (; O > R;) { if (Math.abs(i(M, w[R])) < 1e-5 && w[R] >= f) { P = w[R]; break }++R } } f = b, f > p && 1e-5 > P && Math.abs(f - A) > p && (P = f, A + p >= f && (M = 0)); var N, F = -999999; if (y * (P / this._timeBarSecondsSpan) >= 3)
for (o = e(P); S >= o; o = t(o, P)) h += ''; if (y * (M / this._timeBarSecondsSpan) >= 3)
for (o = e(M); S >= o; o = t(o, M)) h += ''; if (y * (A / this._timeBarSecondsSpan) >= 2) { this._mainTicSpan = A, S += A, o = e(A); for (var B = g.getTaiMinusUtc(); S >= o;) { var V = _.addSeconds(o - x); if (A > 2.1) { var q = V.getTaiMinusUtc();
Math.abs(q - B) > .1 && (o += q - B, V = _.addSeconds(o - x)) } var k = Math.round(y * r(o)),
U = this.makeLabel(V);
this._rulerEle.innerHTML = U, N = this._rulerEle.offsetWidth; var W = k - (N / 2 - 1);
W > F ? (F = W + N + 5, h += '' + '' + U + "") : h += '', o = t(o, A) } } else this._mainTicSpan = -1;
a.innerHTML = h, this._scrubElement = a.childNodes[0], T.y = 0, this._trackList.forEach(function(e) { e.render(c._context, T), T.y += e.height }) }, l.prototype.updateFromClock = function() { this._scrubJulian = this._clock.currentTime; var e = this._scrubElement; if (r(this._scrubElement)) { var t = this._startJulian.getSecondsDifference(this._scrubJulian),
i = Math.round(t * this._topDiv.clientWidth / this._timeBarSecondsSpan);
this._lastXPos !== i && (this._lastXPos = i, e.style.left = i - 8 + "px", this._needleEle.style.left = i + "px") } r(this._timelineDragLocation) && (this._setTimeBarTime(this._timelineDragLocation, this._timelineDragLocation * this._timeBarSecondsSpan / this._topDiv.clientWidth), this.zoomTo(this._startJulian.addSeconds(this._timelineDrag), this._endJulian.addSeconds(this._timelineDrag))) }, l.prototype._setTimeBarTime = function(e, t) { if (e = Math.round(e), this._scrubJulian = this._startJulian.addSeconds(t), this._scrubElement) { var r = e - 8;
this._scrubElement.style.left = r.toString() + "px", this._needleEle.style.left = e.toString() + "px" } var i = document.createEvent("Event");
i.initEvent("settime", !0, !0), i.clientX = e, i.timeSeconds = t, i.timeJulian = this._scrubJulian, i.clock = this._clock, this._topDiv.dispatchEvent(i) }, l.prototype.resize = function() { var e = this.container.clientWidth,
t = this.container.clientHeight; if (e !== this._lastWidth || t !== this._lastHeight) { this._trackContainer.style.height = t + "px"; var r = 1;
this._trackList.forEach(function(e) { r += e.height }), this._trackListEle.style.height = r.toString() + "px", this._trackListEle.width = this._trackListEle.clientWidth, this._trackListEle.height = r, this._makeTics(), this._lastWidth = e, this._lastHeight = t } }, l }), r("Widgets/Viewer/Viewer", ["../../Core/Cartesian2", "../../Core/defaultValue", "../../Core/defined", "../../Core/DeveloperError", "../../Core/defineProperties", "../../Core/destroyObject", "../../Core/Event", "../../Core/EventHelper", "../../Core/requestAnimationFrame", "../../Core/ScreenSpaceEventType", "../../DynamicScene/DataSourceCollection", "../../DynamicScene/DataSourceDisplay", "../Animation/Animation", "../Animation/AnimationViewModel", "../BaseLayerPicker/BaseLayerPicker", "../BaseLayerPicker/createDefaultBaseLayers", "../isatCesiumWidget/isatCesiumWidget", "../ClockViewModel", "../FullscreenButton/FullscreenButton", "../getElement", "../HomeButton/HomeButton", "../SceneModePicker/SceneModePicker", "../Timeline/Timeline", "../../ThirdParty/knockout"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C, x, S) {
"use strict";
function E(e) { var t = e.clock;
t.currentTime = e.timeJulian, t.shouldAnimate = !1 }
function b(e) {
function t() { if (!e.isDestroyed()) try { e._useDefaultRenderLoop ? (e.resize(), e.render(), l(t)) : e._renderLoopRunning = !1 } catch (r) { e._useDefaultRenderLoop = !1, e._renderLoopRunning = !1, e._onRenderLoopError.raiseEvent(e, r), e._showRenderLoopErrors && (e.cesiumWidget.showErrorPanel("An error occurred while rendering. Rendering has stopped.", r), console.error(r)) } } e._renderLoopRunning = !0, l(t) }
var T = function(e, n) {
function o(e) { P.update(e.currentTime) }
function l(e, t) { if (1 === e.getLength()) { var i = t.getClock();
r(i) && (i.clone(D), r(W) && (W.updateFromClock(), W.zoomTo(i.startTime, i.stopTime))) } }
if (!r(e)) throw new i("container is required.");
e = _(e), n = t(n, t.EMPTY_OBJECT);
var u = !r(n.baseLayerPicker) || n.baseLayerPicker !== !1;
if (u && r(n.imageryProvider)) throw new i("options.imageryProvider is not available when using the BaseLayerPicker widget. Either specify options.selectedImageryProviderViewModel instead or set options.baseLayerPicker to false.");
if (!u && r(n.selectedImageryProviderViewModel)) throw new i("options.selectedImageryProviderViewModel is not available when not using the BaseLayerPicker widget. Either specify options.imageryProvider instead or set options.baseLayerPicker to true.");
var b = document.createElement("div");
b.className = "cesium-viewer", e.appendChild(b);
var T = document.createElement("div");
T.className = "cesium-viewer-cesiumWidgetContainer", b.appendChild(T);
var A = new v(T, { terrainProvider: n.terrainProvider, imageryProvider: u ? !1 : n.imageryProvider, sceneMode: n.sceneMode, contextOptions: n.contextOptions, useDefaultRenderLoop: !1 }),
M = new c,
P = new h(A.scene, M),
D = A.clock,
I = new y(D),
O = document.createElement("div");
O.className = "cesium-viewer-toolbar", b.appendChild(O);
var R;
if (!r(n.homeButton) || n.homeButton !== !1) { var L = document.createElement("div");
L.className = "cesium-viewer-homeButtonContainer", O.appendChild(L), R = new w(L, A.scene, A.sceneTransitioner, A.centralBody.getEllipsoid()) }
var z;
if (!r(n.sceneModePicker) || n.sceneModePicker !== !1) { var N = document.createElement("div");
N.className = "cesium-viewer-sceneModePickerContainer", O.appendChild(N), z = new C(N, A.sceneTransitioner) }
var F;
if (u) { var B = document.createElement("div");
B.className = "cesium-viewer-baseLayerPickerContainer", O.appendChild(B); var V = t(n.imageryProviderViewModels, f());
F = new p(B, A.centralBody.getImageryLayers(), V), F.viewModel.selectedItem = t(n.selectedImageryProviderViewModel, V[0]); var q = B.getElementsByClassName("cesium-baseLayerPicker-dropDown");
this._baseLayerPickerDropDown = q[0] }
var k;
if (!r(n.animation) || n.animation !== !1) { var U = document.createElement("div");
U.className = "cesium-viewer-animationContainer", b.appendChild(U), k = new d(U, new m(I)) }
var W;
if (!r(n.timeline) || n.timeline !== !1) { var G = document.createElement("div");
G.className = "cesium-viewer-timelineContainer", b.appendChild(G), W = new x(G, D), W.addEventListener("settime", E, !1), W.zoomTo(D.startTime, D.stopTime) }
var H;
if (r(n.fullscreenButton) && n.fullscreenButton === !1) r(W) && (W.container.style.right = 0);
else { var j = document.createElement("div");
j.className = "cesium-viewer-fullscreenContainer", b.appendChild(j), H = new g(j, t(n.fullscreenElement, e)); var Y = function(e) { j.style.display = e ? "block" : "none", r(W) && (W.container.style.right = j.clientWidth + "px", W.resize()) };
this._fullscreenSubscription = S.getObservable(H.viewModel, "isFullscreenEnabled").subscribe(Y), Y(H.viewModel.isFullscreenEnabled) }
var X = new s;
X.add(D.onTick, o), X.add(M.dataSourceAdded, l), this._container = e, this._element = b, this._cesiumWidget = A, this._dataSourceCollection = M, this._dataSourceDisplay = P, this._clockViewModel = I, this._toolbar = O, this._homeButton = R, this._sceneModePicker = z, this._baseLayerPicker = F, this._animation = k, this._timeline = W, this._fullscreenButton = H, this._eventHelper = X, this._lastWidth = 0, this._lastHeight = 0, this._useDefaultRenderLoop = void 0, this._renderLoopRunning = !1, this._showRenderLoopErrors = t(n.showRenderLoopErrors, !0), this._onRenderLoopError = new a, this.useDefaultRenderLoop = t(n.useDefaultRenderLoop, !0)
};
return n(T.prototype, { container: { get: function() { return this._container } }, cesiumWidget: { get: function() { return this._cesiumWidget } }, homeButton: { get: function() { return this._homeButton } }, sceneModePicker: { get: function() { return this._sceneModePicker } }, baseLayerPicker: { get: function() { return this._baseLayerPicker } }, animation: { get: function() { return this._animation } }, timeline: { get: function() { return this._timeline } }, fullscreenButton: { get: function() { return this._fullscreenButton } }, dataSourceDisplay: { get: function() { return this._dataSourceDisplay } }, dataSources: { get: function() { return this._dataSourceCollection } }, canvas: { get: function() { return this._cesiumWidget.canvas } }, cesiumLogo: { get: function() { return this._cesiumWidget.cesiumLogo } }, scene: { get: function() { return this._cesiumWidget.scene } }, centralBody: { get: function() { return this._cesiumWidget.centralBody } }, clock: { get: function() { return this._cesiumWidget.clock } }, sceneTransitioner: { get: function() { return this._cesiumWidget.sceneTransitioner } }, screenSpaceEventHandler: { get: function() { return this._cesiumWidget.screenSpaceEventHandler } }, onRenderLoopError: { get: function() { return this._onRenderLoopError } }, useDefaultRenderLoop: { get: function() { return this._useDefaultRenderLoop }, set: function(e) { this._useDefaultRenderLoop !== e && (this._useDefaultRenderLoop = e, e && !this._renderLoopRunning && b(this)) } } }), T.prototype.extend = function(e, t) { if (!r(e)) throw new i("mixin is required.");
e(this, t) }, T.prototype.resize = function() { var e = this._cesiumWidget;
e.resize(); var t = this._container,
i = t.clientWidth,
n = t.clientHeight; if (i !== this._lastWidth || n !== this._lastHeight) { var o = this._baseLayerPickerDropDown; if (r(o)) { var a = n - 125;
o.style.maxHeight = a + "px" } var s, l = r(this._timeline),
u = r(this._animation),
c = !u,
h = 0; if (u) { var d = this._lastWidth;
s = this._animation.container, i > 900 ? 900 >= d && (h = 169, s.style.width = "169px", s.style.height = "112px", c = !0, this._animation.resize()) : i >= 600 ? (600 > d || d > 900) && (h = 136, s.style.width = "136px", s.style.height = "90px", c = !0, this._animation.resize()) : (d > 600 || 0 === d) && (h = 106, s.style.width = "106px", s.style.height = "70px", c = !0, this._animation.resize()) } if (c) { var m = 0,
p = h + 5; if (l && (m = this._timeline.container.clientHeight + 3, this._timeline.container.style.left = h + "px"), l || u) { var f = e.creditContainer;
f.style.bottom = m + "px", f.style.left = p + "px" } } l && this._timeline.resize(), this._lastWidth = i, this._lastHeight = n } }, T.prototype.render = function() { this._cesiumWidget.render() }, T.prototype.isDestroyed = function() { return !1 }, T.prototype.destroy = function() { return this._container.removeChild(this._element), this._element.removeChild(this._toolbar), this._eventHelper.removeAll(), r(this._homeButton) && (this._homeButton = this._homeButton.destroy()), r(this._sceneModePicker) && (this._sceneModePicker = this._sceneModePicker.destroy()), r(this._baseLayerPicker) && (this._baseLayerPicker = this._baseLayerPicker.destroy()), r(this._animation) && (this._element.removeChild(this._animation.container), this._animation = this._animation.destroy()), r(this._timeline) && (this._timeline.removeEventListener("settime", E, !1), this._element.removeChild(this._timeline.container), this._timeline = this._timeline.destroy()), r(this._fullscreenButton) && (this._fullscreenSubscription.dispose(), this._element.removeChild(this._fullscreenButton.container), this._fullscreenButton = this._fullscreenButton.destroy()), this._clockViewModel = this._clockViewModel.destroy(), this._dataSourceDisplay = this._dataSourceDisplay.destroy(), this._cesiumWidget = this._cesiumWidget.destroy(), this._dataSourceCollection = this._dataSourceCollection.destroy(), o(this) }, T
}), r("Widgets/Viewer/viewerDragDropMixin", ["../../Core/defaultValue", "../../Core/defined", "../../Core/DeveloperError", "../../Core/defineProperties", "../../Core/Event", "../../Core/wrapFunction", "../../DynamicScene/CzmlDataSource", "../../DynamicScene/GeoJsonDataSource", "../../ThirdParty/when", "../getElement"], function(e, t, r, i, n, o, a, s, l, u) { "use strict";
function c(e) { e.stopPropagation(), e.preventDefault() }
function h(e, r) { var i = e;
t(i) && (i.removeEventListener("drop", r, !1), i.removeEventListener("dragenter", c, !1), i.removeEventListener("dragover", c, !1), i.removeEventListener("dragexit", c, !1)) }
function d(e, t) { e.addEventListener("drop", t, !1), e.addEventListener("dragenter", c, !1), e.addEventListener("dragover", c, !1), e.addEventListener("dragexit", c, !1) }
function m(e, t) { var r = e.length,
i = t.length; return r > i && -1 !== e.indexOf(t, r - i) }
function p(e, t) { var r, i = t.toUpperCase(); if (m(i, ".CZML")) r = a;
else { if (!(m(i, ".GEOJSON") || m(i, ".JSON") || m(i, ".TOPOJSON"))) return e.onDropError.raiseEvent(e, t, "Unrecognized file extension: " + t), void 0;
r = s } return function(i) { var n = new r; try { l(n.load(JSON.parse(i.target.result), t), function() { e.dataSources.add(n) }, function(r) { e.onDropError.raiseEvent(e, t, r) }) } catch (o) { e.onDropError.raiseEvent(e, t, o) } } }
function f(e, t) { return function(r) { e.onDropError.raiseEvent(e, t, r.target.error) } } var v = function(a, s) {
function l(e) { c(e), y && a.dataSources.removeAll(); for (var t = e.dataTransfer.files, r = t.length, i = 0; r > i; i++) { var n = t[i],
o = new FileReader;
o.onload = p(a, n.name), o.onerror = f(a, n.name), o.readAsText(n) } } if (!t(a)) throw new r("viewer is required."); if (a.hasOwnProperty("dropTarget")) throw new r("dropTarget is already defined by another mixin."); if (a.hasOwnProperty("dropEnabled")) throw new r("dropEnabled is already defined by another mixin."); if (a.hasOwnProperty("onDropError")) throw new r("onDropError is already defined by another mixin."); if (a.hasOwnProperty("clearOnDrop")) throw new r("clearOnDrop is already defined by another mixin.");
s = e(s, e.EMPTY_OBJECT); var m = !0,
v = new n,
y = e(s.clearOnDrop, !0),
g = e(s.dropTarget, a.container);
g = u(g), i(a, { dropTarget: { get: function() { return g }, set: function(e) { if (!t(e)) throw new r("value is required.");
h(g, l), g = e, d(g, l) } }, dropEnabled: { get: function() { return m }, set: function(e) { e !== m && (e ? d(g, l) : h(g, l), m = e) } }, onDropError: { get: function() { return v } }, clearOnDrop: { get: function() { return y }, set: function(e) { y = e } } }), d(g, l), a.destroy = o(a, a.destroy, function() { a.dropEnabled = !1 }), a._handleDrop = l }; return v }), r("Widgets/Viewer/viewerDynamicObjectMixin", ["../../Core/defaultValue", "../../Core/defined", "../../Core/DeveloperError", "../../Core/defineProperties", "../../Core/EventHelper", "../../Core/ScreenSpaceEventType", "../../Core/wrapFunction", "../../Scene/SceneMode", "../../DynamicScene/DynamicObjectView"], function(e, t, r, i, n, o, a, s, l) { "use strict"; var u = function(e) {
function u(e) { t(m) && m.update(e.currentTime) }
function c(r) { var i = e.scene.pick(r.position);
t(i) && t(i.dynamicObject) && t(i.dynamicObject.position) && (e.trackedObject = i.dynamicObject) }
function h() { e.trackedObject = void 0 } if (!t(e)) throw new r("viewer is required."); if (e.hasOwnProperty("trackedObject")) throw new r("trackedObject is already defined by another mixin."); var d, m, p = new n;
p.add(e.clock.onTick, u), t(e.homeButton) && p.add(e.homeButton.viewModel.command.beforeExecute, h), e.screenSpaceEventHandler.setInputAction(c, o.LEFT_CLICK), i(e, { trackedObject: { get: function() { return d }, set: function(r) { d !== r && (d = r, m = t(r) ? new l(r, e.scene, e.centralBody.getEllipsoid()) : void 0); var i = e.scene.getFrameState().mode;
(i === s.COLUMBUS_VIEW || i === s.SCENE2D) && (e.scene.getScreenSpaceCameraController().enableTranslate = !t(r)), (i === s.COLUMBUS_VIEW || i === s.SCENE3D) && (e.scene.getScreenSpaceCameraController().enableTilt = !t(r)) } } }), e.destroy = a(e, e.destroy, function() { p.removeAll(), e.screenSpaceEventHandler.removeInputAction(o.LEFT_CLICK) }) }; return u }), r("Widgets/checkForChromeFrame", ["../Core/FeatureDetection", "./getElement", "../ThirdParty/when"], function(e, t, r) { "use strict";
function i(e) { e = t(e); var r = document.createElement("div");
r.className = "cesium-widget-chromeFrameOverlay"; var i = document.createElement("div");
r.appendChild(i), i.innerHTML = 'isatCesium requires WebGL, an open standard for displaying 3D content in a web browser. To enable WebGL in Internet Explorer, we recommend installing Google Chrome Frame, a free, unobtrusive plug-in offered by Google. To learn more about WebGL, visit http://www.khronos.org/webgl/.
Would you like to install Chrome Frame now?
'; var n = document.createElement("p");
i.appendChild(n); var o = document.createElement("a");
o.href = "#", o.innerHTML = "Yes, install Google Chrome Frame", o.onclick = function() { window.CFInstall.check({ mode: "overlay", destination: document.URL }), e.removeChild(r) }, n.appendChild(o), n = document.createElement("p"), i.appendChild(n); var a = document.createElement("a");
a.href = "#", a.innerHTML = "No, not at this time", a.onclick = function() { e.removeChild(r) }, n.appendChild(a), e.appendChild(r) } var n = function(t) { var n = r.defer(); if (e.isInternetExplorer()) { var o = document.createElement("script");
o.type = "text/javascript", o.src = "//ajax.googleapis.com/ajax/libs/chrome-frame/1/CFInstall.min.js"; var a = document.getElementsByTagName("head")[0];
a.appendChild(o); var s = setInterval(function() { if (window.CFInstall) { clearInterval(s); var e = !1;
window.CFInstall.check({ mode: "overlay", preventPrompt: !0, onmissing: function() { e = !0 } }), e && i(t), n.resolve(e) } }, 50) } else n.resolve(!1); return n.promise }; return n }), r("isatCesium", ["./Core/AxisAlignedBoundingBox", "./Core/BoundingRectangle", "./Core/BoundingSphere", "./Core/BoxGeometry", "./Core/BoxOutlineGeometry", "./Core/Cartesian2", "./Core/Cartesian3", "./Core/Cartesian4", "./Core/Cartographic", "./Core/CatmullRomSpline", "./Core/CircleGeometry", "./Core/CircleOutlineGeometry", "./Core/Clock", "./Core/ClockRange", "./Core/ClockStep", "./Core/Color", "./Core/ColorGeometryInstanceAttribute", "./Core/ComponentDatatype", "./Core/CornerType", "./Core/CorridorGeometry", "./Core/CubicRealPolynomial", "./Core/CylinderGeometry", "./Core/CylinderGeometryLibrary", "./Core/CylinderOutlineGeometry", "./Core/DefaultProxy", "./Core/DeveloperError", "./Core/EarthOrientationParameters", "./Core/EarthOrientationParametersSample", "./Core/EllipseGeometry", "./Core/EllipseGeometryLibrary", "./Core/EllipseOutlineGeometry", "./Core/Ellipsoid", "./Core/EllipsoidGeodesic", "./Core/EllipsoidGeometry", "./Core/EllipsoidOutlineGeometry", "./Core/EllipsoidTangentPlane", "./Core/EllipsoidalOccluder", "./Core/EncodedCartesian3", "./Core/Enumeration", "./Core/Event", "./Core/EventHelper", "./Core/Extent", "./Core/ExtentGeometry", "./Core/ExtentOutlineGeometry", "./Core/FAR", "./Core/FeatureDetection", "./Core/Fullscreen", "./Core/GeographicProjection", "./Core/Geometry", "./Core/GeometryAttribute", "./Core/GeometryAttributes", "./Core/GeometryInstance", "./Core/GeometryInstanceAttribute", "./Core/GeometryPipeline", "./Core/HeightmapTessellator", "./Core/HermitePolynomialApproximation", "./Core/HermiteSpline", "./Core/Iau2006XysData", "./Core/Iau2006XysSample", "./Core/IndexDatatype", "./Core/InterpolationAlgorithm", "./Core/Intersect", "./Core/IntersectionTests", "./Core/Interval", "./Core/Iso8601", "./Core/JulianDate", "./Core/KeyboardEventModifier", "./Core/LagrangePolynomialApproximation", "./Core/LeapSecond", "./Core/LinearApproximation", "./Core/Math", "./Core/Matrix2", "./Core/Matrix3", "./Core/Matrix4", "./Core/NearFarScalar", "./Core/Occluder", "./Core/OrientationInterpolator", "./Core/Packable", "./Core/PackableForInterpolation", "./Core/Plane", "./Core/PolygonGeometry", "./Core/PolygonGeometryLibrary", "./Core/PolygonOutlineGeometry", "./Core/PolygonPipeline", "./Core/PolylinePipeline", "./Core/PrimitiveType", "./Core/QuadraticRealPolynomial", "./Core/QuarticRealPolynomial", "./Core/Quaternion", "./Core/Queue", "./Core/Ray", "./Core/ReferenceFrame", "./Core/RequestErrorEvent", "./Core/RuntimeError", "./Core/ScreenSpaceEventHandler", "./Core/ScreenSpaceEventType", "./Core/Shapes", "./Core/ShowGeometryInstanceAttribute", "./Core/Simon1994PlanetaryPositions", "./Core/SimplePolylineGeometry", "./Core/SphereGeometry", "./Core/SphereOutlineGeometry", "./Core/Spherical", "./Core/TaskProcessor", "./Core/TimeConstants", "./Core/TimeInterval", "./Core/TimeIntervalCollection", "./Core/TimeStandard", "./Core/Tipsify", "./Core/Transforms", "./Core/TridiagonalSystemSolver", "./Core/VertexFormat", "./Core/Visibility", "./Core/WallGeometry", "./Core/WallGeometryLibrary", "./Core/WallOutlineGeometry", "./Core/WebMercatorProjection", "./Core/WindingOrder", "./Core/barycentricCoordinates", "./Core/binarySearch", "./Core/buildModuleUrl", "./Core/cancelAnimationFrame", "./Core/clone", "./Core/combine", "./Core/createGuid", "./Core/defaultValue", "./Core/defineProperties", "./Core/defined", "./Core/destroyObject", "./Core/freezeObject", "./Core/getImagePixels", "./Core/isCrossOriginUrl", "./Core/isLeapYear", "./Core/jsonp", "./Core/loadArrayBuffer", "./Core/loadBlob", "./Core/loadImage", "./Core/loadImageViaBlob", "./Core/loadJson", "./Core/loadText", "./Core/loadWithXhr", "./Core/loadXML", "./Core/pointInsideTriangle", "./Core/requestAnimationFrame", "./Core/throttleRequestByServer", "./Core/wrapFunction", "./Core/writeTextToCanvas", "./DynamicScene/ColorMaterialProperty", "./DynamicScene/CompositeDynamicObjectCollection", "./DynamicScene/CompositeMaterialProperty", "./DynamicScene/CompositePositionProperty", "./DynamicScene/CompositeProperty", "./DynamicScene/ConstantPositionProperty", "./DynamicScene/ConstantProperty", "./DynamicScene/CzmlDataSource", "./DynamicScene/DataSource", "./DynamicScene/DataSourceCollection", "./DynamicScene/DataSourceDisplay", "./DynamicScene/DynamicBillboard", "./DynamicScene/DynamicBillboardVisualizer", "./DynamicScene/DynamicClock", "./DynamicScene/DynamicCone", "./DynamicScene/DynamicConeVisualizerUsingCustomSensor", "./DynamicScene/DynamicDirectionsProperty", "./DynamicScene/DynamicEllipse", "./DynamicScene/DynamicEllipsoid", "./DynamicScene/DynamicEllipsoidVisualizer", "./DynamicScene/DynamicLabel", "./DynamicScene/DynamicLabelVisualizer", "./DynamicScene/DynamicObject", "./DynamicScene/DynamicObjectCollection", "./DynamicScene/DynamicObjectView", "./DynamicScene/DynamicPath", "./DynamicScene/DynamicPathVisualizer", "./DynamicScene/DynamicPoint", "./DynamicScene/DynamicPointVisualizer", "./DynamicScene/DynamicPolygon", "./DynamicScene/DynamicPolygonVisualizer", "./DynamicScene/DynamicPolyline", "./DynamicScene/DynamicPolylineVisualizer", "./DynamicScene/DynamicPyramid", "./DynamicScene/DynamicPyramidVisualizer", "./DynamicScene/DynamicVector", "./DynamicScene/DynamicVectorVisualizer", "./DynamicScene/DynamicVertexPositionsProperty", "./DynamicScene/GeoJsonDataSource", "./DynamicScene/GridMaterialProperty", "./DynamicScene/ImageMaterialProperty", "./DynamicScene/MaterialProperty", "./DynamicScene/PositionProperty", "./DynamicScene/Property", "./DynamicScene/ReferenceProperty", "./DynamicScene/SampledPositionProperty", "./DynamicScene/SampledProperty", "./DynamicScene/TimeIntervalCollectionPositionProperty", "./DynamicScene/TimeIntervalCollectionProperty", "./DynamicScene/VisualizerCollection", "./Renderer/BlendEquation", "./Renderer/BlendFunction", "./Renderer/BlendingState", "./Renderer/Buffer", "./Renderer/BufferUsage", "./Renderer/ClearCommand", "./Renderer/CommandLists", "./Renderer/Context", "./Renderer/CubeMap", "./Renderer/CubeMapFace", "./Renderer/CullFace", "./Renderer/DepthFunction", "./Renderer/DrawCommand", "./Renderer/Framebuffer", "./Renderer/MipmapHint", "./Renderer/PassState", "./Renderer/PickFramebuffer", "./Renderer/PixelDatatype", "./Renderer/PixelFormat", "./Renderer/RenderState", "./Renderer/Renderbuffer", "./Renderer/RenderbufferFormat", "./Renderer/ShaderCache", "./Renderer/ShaderProgram", "./Renderer/StencilFunction", "./Renderer/StencilOperation", "./Renderer/Texture", "./Renderer/TextureAtlas", "./Renderer/TextureAtlasBuilder", "./Renderer/TextureMagnificationFilter", "./Renderer/TextureMinificationFilter", "./Renderer/TextureWrap", "./Renderer/UniformDatatype", "./Renderer/UniformState", "./Renderer/VertexArray", "./Renderer/VertexArrayFacade", "./Renderer/VertexLayout", "./Renderer/createShaderSource", "./Renderer/loadCubeMap", "./Scene/AnimationCollection", "./Scene/Appearance", "./Scene/ArcGisImageServerTerrainProvider", "./Scene/ArcGisMapServerImageryProvider", "./Scene/Billboard", "./Scene/BillboardCollection", "./Scene/BingMapsImageryProvider", "./Scene/BingMapsStyle", "./Scene/Camera", "./Scene/CameraColumbusViewMode", "./Scene/CameraController", "./Scene/CameraEventAggregator", "./Scene/CameraEventType", "./Scene/CameraFlightPath", "./Scene/CentralBody", "./Scene/CentralBodySurface", "./Scene/CentralBodySurfaceShaderSet", "./Scene/isatCesiumTerrainProvider", "./Scene/CompositePrimitive", "./Scene/Credit", "./Scene/CreditDisplay", "./Scene/CullingVolume", "./Scene/CustomSensorVolume", "./Scene/DebugAppearance", "./Scene/DiscardMissingTileImagePolicy", "./Scene/EllipsoidPrimitive", "./Scene/EllipsoidSurfaceAppearance", "./Scene/EllipsoidTerrainProvider", "./Scene/ExtentPrimitive", "./Scene/FrameState", "./Scene/FrustumCommands", "./Scene/GeographicTilingScheme", "./Scene/GridImageryProvider", "./Scene/HeightmapTerrainData", "./Scene/HorizontalOrigin", "./Scene/Imagery", "./Scene/ImageryLayer", "./Scene/ImageryLayerCollection", "./Scene/ImageryProvider", "./Scene/ImageryState", "./Scene/Label", "./Scene/LabelCollection", "./Scene/LabelStyle", "./Scene/Material", "./Scene/MaterialAppearance", "./Scene/NeverTileDiscardPolicy", "./Scene/OpenStreetMapImageryProvider", "./Scene/OrthographicFrustum", "./Scene/PerInstanceColorAppearance", "./Scene/PerformanceDisplay", "./Scene/PerspectiveFrustum", "./Scene/PerspectiveOffCenterFrustum", "./Scene/Polygon", "./Scene/Polyline", "./Scene/PolylineCollection", "./Scene/Primitive", "./Scene/PrimitivePipeline", "./Scene/PrimitiveState", "./Scene/RectangularPyramidSensorVolume", "./Scene/Scene", "./Scene/SceneMode", "./Scene/SceneTransforms", "./Scene/SceneTransitioner", "./Scene/ScreenSpaceCameraController", "./Scene/SensorVolumeCollection", "./Scene/SingleTileImageryProvider", "./Scene/SkyAtmosphere", "./Scene/SkyBox", "./Scene/Sun", "./Scene/SunPostProcess", "./Scene/TerrainData", "./Scene/TerrainMesh", "./Scene/TerrainProvider", "./Scene/TerrainState", "./Scene/TexturePool", "./Scene/Tile", "./Scene/TileCoordinatesImageryProvider", "./Scene/TileDiscardPolicy", "./Scene/TileImagery", "./Scene/TileMapServiceImageryProvider", "./Scene/TileProviderError", "./Scene/TileReplacementQueue", "./Scene/TileState", "./Scene/TileTerrain", "./Scene/TilingScheme", "./Scene/VRTheWorldTerrainProvider", "./Scene/VerticalOrigin", "./Scene/ViewportQuad", "./Scene/WebMapServiceImageryProvider", "./Scene/WebMercatorTilingScheme", "./Scene/createTangentSpaceDebugPrimitive", "./Scene/sampleTerrain", "./Shaders/Appearances/AllMaterialAppearanceFS", "./Shaders/Appearances/AllMaterialAppearanceVS", "./Shaders/Appearances/BasicMaterialAppearanceFS", "./Shaders/Appearances/BasicMaterialAppearanceVS", "./Shaders/Appearances/EllipsoidSurfaceAppearanceFS", "./Shaders/Appearances/EllipsoidSurfaceAppearanceVS", "./Shaders/Appearances/PerInstanceColorAppearanceFS", "./Shaders/Appearances/PerInstanceColorAppearanceVS", "./Shaders/Appearances/PerInstanceFlatColorAppearanceFS", "./Shaders/Appearances/PerInstanceFlatColorAppearanceVS", "./Shaders/Appearances/TexturedMaterialAppearanceFS", "./Shaders/Appearances/TexturedMaterialAppearanceVS", "./Shaders/BillboardCollectionFS", "./Shaders/BillboardCollectionVS", "./Shaders/Builtin/Constants", "./Shaders/Builtin/Functions/RGBToXYZ", "./Shaders/Builtin/Functions/XYZToRGB", "./Shaders/Builtin/Functions/antialias", "./Shaders/Builtin/Functions/cellular", "./Shaders/Builtin/Functions/columbusViewMorph", "./Shaders/Builtin/Functions/computePosition", "./Shaders/Builtin/Functions/eastNorthUpToEyeCoordinates", "./Shaders/Builtin/Functions/ellipsoidContainsPoint", "./Shaders/Builtin/Functions/ellipsoidNew", "./Shaders/Builtin/Functions/ellipsoidWgs84TextureCoordinates", "./Shaders/Builtin/Functions/equalsEpsilon", "./Shaders/Builtin/Functions/eyeOffset", "./Shaders/Builtin/Functions/eyeToWindowCoordinates", "./Shaders/Builtin/Functions/geodeticSurfaceNormal", "./Shaders/Builtin/Functions/getDefaultMaterial", "./Shaders/Builtin/Functions/getWaterNoise", "./Shaders/Builtin/Functions/getWgs84EllipsoidEC", "./Shaders/Builtin/Functions/hue", "./Shaders/Builtin/Functions/isEmpty", "./Shaders/Builtin/Functions/isFull", "./Shaders/Builtin/Functions/latitudeToWebMercatorFraction", "./Shaders/Builtin/Functions/luminance", "./Shaders/Builtin/Functions/modelToWindowCoordinates", "./Shaders/Builtin/Functions/multiplyWithColorBalance", "./Shaders/Builtin/Functions/phong", "./Shaders/Builtin/Functions/pointAlongRay", "./Shaders/Builtin/Functions/rayEllipsoidIntersectionInterval", "./Shaders/Builtin/Functions/saturation", "./Shaders/Builtin/Functions/snoise", "./Shaders/Builtin/Functions/tangentToEyeSpaceMatrix", "./Shaders/Builtin/Functions/translateRelativeToEye", "./Shaders/Builtin/Functions/transpose", "./Shaders/Builtin/Functions/windowToEyeCoordinates", "./Shaders/Builtin/Structs", "./Shaders/CentralBodyFS", "./Shaders/CentralBodyFSDepth", "./Shaders/CentralBodyFSPole", "./Shaders/CentralBodyVS", "./Shaders/CentralBodyVSDepth", "./Shaders/CentralBodyVSPole", "./Shaders/CustomSensorVolumeFS", "./Shaders/CustomSensorVolumeVS", "./Shaders/EllipsoidFS", "./Shaders/EllipsoidVS", "./Shaders/Materials/AsphaltMaterial", "./Shaders/Materials/BlobMaterial", "./Shaders/Materials/BrickMaterial", "./Shaders/Materials/BumpMapMaterial", "./Shaders/Materials/CementMaterial", "./Shaders/Materials/CheckerboardMaterial", "./Shaders/Materials/DotMaterial", "./Shaders/Materials/ErosionMaterial", "./Shaders/Materials/FacetMaterial", "./Shaders/Materials/FadeMaterial", "./Shaders/Materials/FresnelMaterial", "./Shaders/Materials/GrassMaterial", "./Shaders/Materials/GridMaterial", "./Shaders/Materials/NormalMapMaterial", "./Shaders/Materials/PolylineArrowMaterial", "./Shaders/Materials/PolylineGlowMaterial", "./Shaders/Materials/PolylineOutlineMaterial", "./Shaders/Materials/ReflectionMaterial", "./Shaders/Materials/RefractionMaterial", "./Shaders/Materials/RimLightingMaterial", "./Shaders/Materials/StripeMaterial", "./Shaders/Materials/TieDyeMaterial", "./Shaders/Materials/Water", "./Shaders/Materials/WoodMaterial", "./Shaders/PolylineFS", "./Shaders/PolylineVS", "./Shaders/PostProcessFilters/AdditiveBlend", "./Shaders/PostProcessFilters/BrightPass", "./Shaders/PostProcessFilters/GaussianBlur1D", "./Shaders/PostProcessFilters/PassThrough", "./Shaders/ReprojectWebMercatorFS", "./Shaders/ReprojectWebMercatorVS", "./Shaders/SensorVolume", "./Shaders/SkyAtmosphereFS", "./Shaders/SkyAtmosphereVS", "./Shaders/SkyBoxFS", "./Shaders/SkyBoxVS", "./Shaders/SunFS", "./Shaders/SunVS", "./Shaders/ViewportQuadFS", "./Shaders/ViewportQuadVS", "./ThirdParty/Tween", "./ThirdParty/Uri", "./ThirdParty/knockout-2.3.0", "./ThirdParty/knockout-es5", "./ThirdParty/knockout", "./ThirdParty/measureText", "./ThirdParty/mersenne-twister", "./ThirdParty/sprintf", "./ThirdParty/topojson", "./ThirdParty/weakmap", "./ThirdParty/when", "./Widgets/Animation/Animation", "./Widgets/Animation/AnimationViewModel", "./Widgets/BaseLayerPicker/BaseLayerPicker", "./Widgets/BaseLayerPicker/BaseLayerPickerViewModel", "./Widgets/BaseLayerPicker/ImageryProviderViewModel", "./Widgets/BaseLayerPicker/createDefaultBaseLayers", "./Widgets/isatCesiumWidget/isatCesiumWidget", "./Widgets/ClockViewModel", "./Widgets/Command", "./Widgets/FullscreenButton/FullscreenButton", "./Widgets/FullscreenButton/FullscreenButtonViewModel", "./Widgets/HomeButton/HomeButton", "./Widgets/HomeButton/HomeButtonViewModel", "./Widgets/Observable", "./Widgets/SceneModePicker/SceneModePicker", "./Widgets/SceneModePicker/SceneModePickerViewModel", "./Widgets/Timeline/Timeline", "./Widgets/Timeline/TimelineHighlightRange", "./Widgets/Timeline/TimelineTrack", "./Widgets/ToggleButtonViewModel", "./Widgets/Viewer/Viewer", "./Widgets/Viewer/viewerDragDropMixin", "./Widgets/Viewer/viewerDynamicObjectMixin", "./Widgets/checkForChromeFrame", "./Widgets/createCommand", "./Widgets/getElement"], function(e, t, r, i, n, o, a, s, l, u, c, h, d, m, p, f, v, y, g, _, w, C, x, S, E, b, T, A, M, P, D, I, O, R, L, z, N, F, B, V, q, k, U, W, G, H, j, Y, X, Z, K, J, Q, $, et, tt, rt, it, nt, ot, at, st, lt, ut, ct, ht, dt, mt, pt, ft, vt, yt, gt, _t, wt, Ct, xt, St, Et, bt, Tt, At, Mt, Pt, Dt, It, Ot, Rt, Lt, zt, Nt, Ft, Bt, Vt, qt, kt, Ut, Wt, Gt, Ht, jt, Yt, Xt, Zt, Kt, Jt, Qt, $t, er, tr, rr, ir, nr, or, ar, sr, lr, ur, cr, hr, dr, mr, pr, fr, vr, yr, gr, _r, wr, Cr, xr, Sr, Er, br, Tr, Ar, Mr, Pr, Dr, Ir, Or, Rr, Lr, zr, Nr, Fr, Br, Vr, qr, kr, Ur, Wr, Gr, Hr, jr, Yr, Xr, Zr, Kr, Jr, Qr, $r, ei, ti, ri, ii, ni, oi, ai, si, li, ui, ci, hi, di, mi, pi, fi, vi, yi, gi, _i, wi, Ci, xi, Si, Ei, bi, Ti, Ai, Mi, Pi, Di, Ii, Oi, Ri, Li, zi, Ni, Fi, Bi, Vi, qi, ki, Ui, Wi, Gi, Hi, ji, Yi, Xi, Zi, Ki, Ji, Qi, $i, en, tn, rn, nn, on, an, sn, ln, un, cn, hn, dn, mn, pn, fn, vn, yn, gn, _n, wn, Cn, xn, Sn, En, bn, Tn, An, Mn, Pn, Dn, In, On, Rn, Ln, zn, Nn, Fn, Bn, Vn, qn, kn, Un, Wn, Gn, Hn, jn, Yn, Xn, Zn, Kn, Jn, Qn, $n, eo, to, ro, io, no, oo, ao, so, lo, uo, co, ho, mo, po, fo, vo, yo, go, _o, wo, Co, xo, So, Eo, bo, To, Ao, Mo, Po, Do, Io, Oo, Ro, Lo, zo, No, Fo, Bo, Vo, qo, ko, Uo, Wo, Go, Ho, jo, Yo, Xo, Zo, Ko, Jo, Qo, $o, ea, ta, ra, ia, na, oa, aa, sa, la, ua, ca, ha, da, ma, pa, fa, va, ya, ga, _a, wa, Ca, xa, Sa, Ea, ba, Ta, Aa, Ma, Pa, Da, Ia, Oa, Ra, La, za, Na, Fa, Ba, Va, qa, ka, Ua, Wa, Ga, Ha, ja, Ya, Xa, Za, Ka, Ja, Qa, $a, es, ts, rs, is, ns, os, as, ss, ls, us, cs, hs, ds, ms, ps, fs, vs, ys, gs, _s, ws, Cs, xs, Ss, Es, bs, Ts, As, Ms, Ps, Ds, Is, Os, Rs, Ls, zs, Ns, Fs, Bs, Vs, qs, ks, Us, Ws, Gs, Hs, js, Ys, Xs, Zs, Ks, Js, Qs, $s, el, tl, rl, il, nl, ol, al, sl, ll, ul, cl, hl, dl, ml, pl, fl, vl, yl, gl, _l, wl, Cl, xl, Sl, El, bl, Tl, Al, Ml, Pl, Dl, Il, Ol, Rl, Ll) {
"use strict";
var zl = { _shaders: {} };
return zl.AxisAlignedBoundingBox = e, zl.BoundingRectangle = t, zl.BoundingSphere = r, zl.BoxGeometry = i, zl.BoxOutlineGeometry = n, zl.Cartesian2 = o, zl.Cartesian3 = a, zl.Cartesian4 = s, zl.Cartographic = l, zl.CatmullRomSpline = u, zl.CircleGeometry = c, zl.CircleOutlineGeometry = h, zl.Clock = d, zl.ClockRange = m, zl.ClockStep = p, zl.Color = f, zl.ColorGeometryInstanceAttribute = v, zl.ComponentDatatype = y, zl.CornerType = g, zl.CorridorGeometry = _, zl.CubicRealPolynomial = w, zl.CylinderGeometry = C, zl.CylinderGeometryLibrary = x, zl.CylinderOutlineGeometry = S, zl.DefaultProxy = E, zl.DeveloperError = b, zl.EarthOrientationParameters = T, zl.EarthOrientationParametersSample = A, zl.EllipseGeometry = M, zl.EllipseGeometryLibrary = P, zl.EllipseOutlineGeometry = D, zl.Ellipsoid = I, zl.EllipsoidGeodesic = O, zl.EllipsoidGeometry = R, zl.EllipsoidOutlineGeometry = L, zl.EllipsoidTangentPlane = z, zl.EllipsoidalOccluder = N, zl.EncodedCartesian3 = F, zl.Enumeration = B, zl.Event = V, zl.EventHelper = q, zl.Extent = k, zl.ExtentGeometry = U, zl.ExtentOutlineGeometry = W, zl.FAR = G, zl.FeatureDetection = H, zl.Fullscreen = j, zl.GeographicProjection = Y, zl.Geometry = X, zl.GeometryAttribute = Z, zl.GeometryAttributes = K, zl.GeometryInstance = J, zl.GeometryInstanceAttribute = Q, zl.GeometryPipeline = $, zl.HeightmapTessellator = et, zl.HermitePolynomialApproximation = tt, zl.HermiteSpline = rt, zl.Iau2006XysData = it, zl.Iau2006XysSample = nt, zl.IndexDatatype = ot, zl.InterpolationAlgorithm = at, zl.Intersect = st, zl.IntersectionTests = lt, zl.Interval = ut, zl.Iso8601 = ct, zl.JulianDate = ht, zl.KeyboardEventModifier = dt, zl.LagrangePolynomialApproximation = mt, zl.LeapSecond = pt, zl.LinearApproximation = ft, zl.Math = vt, zl.Matrix2 = yt, zl.Matrix3 = gt, zl.Matrix4 = _t, zl.NearFarScalar = wt, zl.Occluder = Ct, zl.OrientationInterpolator = xt, zl.Packable = St, zl.PackableForInterpolation = Et, zl.Plane = bt, zl.PolygonGeometry = Tt, zl.PolygonGeometryLibrary = At, zl.PolygonOutlineGeometry = Mt, zl.PolygonPipeline = Pt, zl.PolylinePipeline = Dt, zl.PrimitiveType = It, zl.QuadraticRealPolynomial = Ot, zl.QuarticRealPolynomial = Rt, zl.Quaternion = Lt, zl.Queue = zt, zl.Ray = Nt, zl.ReferenceFrame = Ft, zl.RequestErrorEvent = Bt, zl.RuntimeError = Vt, zl.ScreenSpaceEventHandler = qt, zl.ScreenSpaceEventType = kt, zl.Shapes = Ut, zl.ShowGeometryInstanceAttribute = Wt, zl.Simon1994PlanetaryPositions = Gt, zl.SimplePolylineGeometry = Ht, zl.SphereGeometry = jt, zl.SphereOutlineGeometry = Yt, zl.Spherical = Xt, zl.TaskProcessor = Zt, zl.TimeConstants = Kt, zl.TimeInterval = Jt, zl.TimeIntervalCollection = Qt, zl.TimeStandard = $t, zl.Tipsify = er, zl.Transforms = tr, zl.TridiagonalSystemSolver = rr, zl.VertexFormat = ir, zl.Visibility = nr, zl.WallGeometry = or, zl.WallGeometryLibrary = ar, zl.WallOutlineGeometry = sr, zl.WebMercatorProjection = lr, zl.WindingOrder = ur, zl.barycentricCoordinates = cr, zl.binarySearch = hr, zl.buildModuleUrl = dr, zl.cancelAnimationFrame = mr, zl.clone = pr, zl.combine = fr, zl.createGuid = vr, zl.defaultValue = yr, zl.defineProperties = gr, zl.defined = _r, zl.destroyObject = wr, zl.freezeObject = Cr, zl.getImagePixels = xr, zl.isCrossOriginUrl = Sr, zl.isLeapYear = Er, zl.jsonp = br, zl.loadArrayBuffer = Tr, zl.loadBlob = Ar, zl.loadImage = Mr, zl.loadImageViaBlob = Pr, zl.loadJson = Dr, zl.loadText = Ir, zl.loadWithXhr = Or, zl.loadXML = Rr, zl.pointInsideTriangle = Lr, zl.requestAnimationFrame = zr, zl.throttleRequestByServer = Nr, zl.wrapFunction = Fr, zl.writeTextToCanvas = Br, zl.ColorMaterialProperty = Vr, zl.CompositeDynamicObjectCollection = qr, zl.CompositeMaterialProperty = kr, zl.CompositePositionProperty = Ur, zl.CompositeProperty = Wr, zl.ConstantPositionProperty = Gr, zl.ConstantProperty = Hr, zl.CzmlDataSource = jr, zl.DataSource = Yr, zl.DataSourceCollection = Xr, zl.DataSourceDisplay = Zr, zl.DynamicBillboard = Kr, zl.DynamicBillboardVisualizer = Jr, zl.DynamicClock = Qr, zl.DynamicCone = $r, zl.DynamicConeVisualizerUsingCustomSensor = ei, zl.DynamicDirectionsProperty = ti, zl.DynamicEllipse = ri, zl.DynamicEllipsoid = ii, zl.DynamicEllipsoidVisualizer = ni, zl.DynamicLabel = oi, zl.DynamicLabelVisualizer = ai, zl.DynamicObject = si, zl.DynamicObjectCollection = li, zl.DynamicObjectView = ui, zl.DynamicPath = ci, zl.DynamicPathVisualizer = hi, zl.DynamicPoint = di, zl.DynamicPointVisualizer = mi, zl.DynamicPolygon = pi, zl.DynamicPolygonVisualizer = fi, zl.DynamicPolyline = vi, zl.DynamicPolylineVisualizer = yi, zl.DynamicPyramid = gi, zl.DynamicPyramidVisualizer = _i, zl.DynamicVector = wi, zl.DynamicVectorVisualizer = Ci, zl.DynamicVertexPositionsProperty = xi, zl.GeoJsonDataSource = Si, zl.GridMaterialProperty = Ei, zl.ImageMaterialProperty = bi, zl.MaterialProperty = Ti, zl.PositionProperty = Ai, zl.Property = Mi, zl.ReferenceProperty = Pi, zl.SampledPositionProperty = Di, zl.SampledProperty = Ii, zl.TimeIntervalCollectionPositionProperty = Oi, zl.TimeIntervalCollectionProperty = Ri, zl.VisualizerCollection = Li, zl.BlendEquation = zi, zl.BlendFunction = Ni, zl.BlendingState = Fi, zl.Buffer = Bi, zl.BufferUsage = Vi, zl.ClearCommand = qi, zl.CommandLists = ki, zl.Context = Ui, zl.CubeMap = Wi, zl.CubeMapFace = Gi, zl.CullFace = Hi, zl.DepthFunction = ji, zl.DrawCommand = Yi, zl.Framebuffer = Xi, zl.MipmapHint = Zi, zl.PassState = Ki, zl.PickFramebuffer = Ji, zl.PixelDatatype = Qi, zl.PixelFormat = $i, zl.RenderState = en, zl.Renderbuffer = tn, zl.RenderbufferFormat = rn, zl.ShaderCache = nn, zl.ShaderProgram = on, zl.StencilFunction = an, zl.StencilOperation = sn, zl.Texture = ln, zl.TextureAtlas = un, zl.TextureAtlasBuilder = cn, zl.TextureMagnificationFilter = hn, zl.TextureMinificationFilter = dn, zl.TextureWrap = mn, zl.UniformDatatype = pn, zl.UniformState = fn, zl.VertexArray = vn, zl.VertexArrayFacade = yn, zl.VertexLayout = gn, zl.createShaderSource = _n, zl.loadCubeMap = wn, zl.AnimationCollection = Cn, zl.Appearance = xn, zl.ArcGisImageServerTerrainProvider = Sn, zl.ArcGisMapServerImageryProvider = En, zl.Billboard = bn, zl.BillboardCollection = Tn, zl.BingMapsImageryProvider = An, zl.BingMapsStyle = Mn, zl.Camera = Pn, zl.CameraColumbusViewMode = Dn, zl.CameraController = In, zl.CameraEventAggregator = On, zl.CameraEventType = Rn, zl.CameraFlightPath = Ln, zl.CentralBody = zn, zl.CentralBodySurface = Nn, zl.CentralBodySurfaceShaderSet = Fn, zl.isatCesiumTerrainProvider = Bn, zl.CompositePrimitive = Vn, zl.Credit = qn, zl.CreditDisplay = kn, zl.CullingVolume = Un, zl.CustomSensorVolume = Wn, zl.DebugAppearance = Gn, zl.DiscardMissingTileImagePolicy = Hn, zl.EllipsoidPrimitive = jn, zl.EllipsoidSurfaceAppearance = Yn, zl.EllipsoidTerrainProvider = Xn, zl.ExtentPrimitive = Zn, zl.FrameState = Kn, zl.FrustumCommands = Jn, zl.GeographicTilingScheme = Qn, zl.GridImageryProvider = $n, zl.HeightmapTerrainData = eo, zl.HorizontalOrigin = to, zl.Imagery = ro, zl.ImageryLayer = io, zl.ImageryLayerCollection = no, zl.ImageryProvider = oo, zl.ImageryState = ao, zl.Label = so, zl.LabelCollection = lo, zl.LabelStyle = uo, zl.Material = co, zl.MaterialAppearance = ho, zl.NeverTileDiscardPolicy = mo, zl.OpenStreetMapImageryProvider = po, zl.OrthographicFrustum = fo, zl.PerInstanceColorAppearance = vo, zl.PerformanceDisplay = yo, zl.PerspectiveFrustum = go, zl.PerspectiveOffCenterFrustum = _o, zl.Polygon = wo, zl.Polyline = Co, zl.PolylineCollection = xo, zl.Primitive = So, zl.PrimitivePipeline = Eo, zl.PrimitiveState = bo, zl.RectangularPyramidSensorVolume = To, zl.Scene = Ao, zl.SceneMode = Mo, zl.SceneTransforms = Po, zl.SceneTransitioner = Do, zl.ScreenSpaceCameraController = Io, zl.SensorVolumeCollection = Oo, zl.SingleTileImageryProvider = Ro, zl.SkyAtmosphere = Lo, zl.SkyBox = zo, zl.Sun = No, zl.SunPostProcess = Fo, zl.TerrainData = Bo, zl.TerrainMesh = Vo, zl.TerrainProvider = qo, zl.TerrainState = ko, zl.TexturePool = Uo, zl.Tile = Wo, zl.TileCoordinatesImageryProvider = Go, zl.TileDiscardPolicy = Ho, zl.TileImagery = jo, zl.TileMapServiceImageryProvider = Yo, zl.TileProviderError = Xo, zl.TileReplacementQueue = Zo, zl.TileState = Ko, zl.TileTerrain = Jo, zl.TilingScheme = Qo, zl.VRTheWorldTerrainProvider = $o, zl.VerticalOrigin = ea, zl.ViewportQuad = ta, zl.WebMapServiceImageryProvider = ra, zl.WebMercatorTilingScheme = ia, zl.createTangentSpaceDebugPrimitive = na, zl.sampleTerrain = oa, zl._shaders.AllMaterialAppearanceFS = aa, zl._shaders.AllMaterialAppearanceVS = sa, zl._shaders.BasicMaterialAppearanceFS = la, zl._shaders.BasicMaterialAppearanceVS = ua, zl._shaders.EllipsoidSurfaceAppearanceFS = ca, zl._shaders.EllipsoidSurfaceAppearanceVS = ha, zl._shaders.PerInstanceColorAppearanceFS = da, zl._shaders.PerInstanceColorAppearanceVS = ma, zl._shaders.PerInstanceFlatColorAppearanceFS = pa, zl._shaders.PerInstanceFlatColorAppearanceVS = fa, zl._shaders.TexturedMaterialAppearanceFS = va, zl._shaders.TexturedMaterialAppearanceVS = ya, zl._shaders.BillboardCollectionFS = ga, zl._shaders.BillboardCollectionVS = _a, zl._shaders.Constants = wa, zl._shaders.RGBToXYZ = Ca, zl._shaders.XYZToRGB = xa, zl._shaders.antialias = Sa, zl._shaders.cellular = Ea, zl._shaders.columbusViewMorph = ba, zl._shaders.computePosition = Ta, zl._shaders.eastNorthUpToEyeCoordinates = Aa, zl._shaders.ellipsoidContainsPoint = Ma, zl._shaders.ellipsoidNew = Pa, zl._shaders.ellipsoidWgs84TextureCoordinates = Da, zl._shaders.equalsEpsilon = Ia, zl._shaders.eyeOffset = Oa, zl._shaders.eyeToWindowCoordinates = Ra, zl._shaders.geodeticSurfaceNormal = La, zl._shaders.getDefaultMaterial = za, zl._shaders.getWaterNoise = Na, zl._shaders.getWgs84EllipsoidEC = Fa, zl._shaders.hue = Ba, zl._shaders.isEmpty = Va, zl._shaders.isFull = qa, zl._shaders.latitudeToWebMercatorFraction = ka, zl._shaders.luminance = Ua, zl._shaders.modelToWindowCoordinates = Wa, zl._shaders.multiplyWithColorBalance = Ga, zl._shaders.phong = Ha, zl._shaders.pointAlongRay = ja, zl._shaders.rayEllipsoidIntersectionInterval = Ya, zl._shaders.saturation = Xa, zl._shaders.snoise = Za, zl._shaders.tangentToEyeSpaceMatrix = Ka, zl._shaders.translateRelativeToEye = Ja, zl._shaders.transpose = Qa, zl._shaders.windowToEyeCoordinates = $a, zl._shaders.Structs = es, zl._shaders.CentralBodyFS = ts, zl._shaders.CentralBodyFSDepth = rs, zl._shaders.CentralBodyFSPole = is, zl._shaders.CentralBodyVS = ns, zl._shaders.CentralBodyVSDepth = os, zl._shaders.CentralBodyVSPole = as, zl._shaders.CustomSensorVolumeFS = ss, zl._shaders.CustomSensorVolumeVS = ls, zl._shaders.EllipsoidFS = us, zl._shaders.EllipsoidVS = cs, zl._shaders.AsphaltMaterial = hs, zl._shaders.BlobMaterial = ds, zl._shaders.BrickMaterial = ms, zl._shaders.BumpMapMaterial = ps, zl._shaders.CementMaterial = fs, zl._shaders.CheckerboardMaterial = vs, zl._shaders.DotMaterial = ys, zl._shaders.ErosionMaterial = gs, zl._shaders.FacetMaterial = _s, zl._shaders.FadeMaterial = ws, zl._shaders.FresnelMaterial = Cs, zl._shaders.GrassMaterial = xs, zl._shaders.GridMaterial = Ss, zl._shaders.NormalMapMaterial = Es, zl._shaders.PolylineArrowMaterial = bs, zl._shaders.PolylineGlowMaterial = Ts, zl._shaders.PolylineOutlineMaterial = As, zl._shaders.ReflectionMaterial = Ms, zl._shaders.RefractionMaterial = Ps, zl._shaders.RimLightingMaterial = Ds, zl._shaders.StripeMaterial = Is, zl._shaders.TieDyeMaterial = Os, zl._shaders.Water = Rs, zl._shaders.WoodMaterial = Ls, zl._shaders.PolylineFS = zs, zl._shaders.PolylineVS = Ns, zl._shaders.AdditiveBlend = Fs, zl._shaders.BrightPass = Bs, zl._shaders.GaussianBlur1D = Vs, zl._shaders.PassThrough = qs, zl._shaders.ReprojectWebMercatorFS = ks, zl._shaders.ReprojectWebMercatorVS = Us, zl._shaders.SensorVolume = Ws, zl._shaders.SkyAtmosphereFS = Gs, zl._shaders.SkyAtmosphereVS = Hs, zl._shaders.SkyBoxFS = js, zl._shaders.SkyBoxVS = Ys, zl._shaders.SunFS = Xs, zl._shaders.SunVS = Zs, zl._shaders.ViewportQuadFS = Ks, zl._shaders.ViewportQuadVS = Js, zl.Tween = Qs, zl.Uri = $s, zl.knockout_2_3_0 = el, zl.knockout_es5 = tl, zl.knockout = rl, zl.measureText = il, zl.mersenne_twister = nl, zl.sprintf = ol, zl.topojson = al, zl.weakmap = sl, zl.when = ll, zl.Animation = ul, zl.AnimationViewModel = cl, zl.BaseLayerPicker = hl, zl.BaseLayerPickerViewModel = dl, zl.ImageryProviderViewModel = ml, zl.createDefaultBaseLayers = pl, zl.isatCesiumWidget = fl, zl.ClockViewModel = vl, zl.Command = yl, zl.FullscreenButton = gl, zl.FullscreenButtonViewModel = _l, zl.HomeButton = wl, zl.HomeButtonViewModel = Cl, zl.Observable = xl, zl.SceneModePicker = Sl, zl.SceneModePickerViewModel = El, zl.Timeline = bl, zl.TimelineHighlightRange = Tl, zl.TimelineTrack = Al, zl.ToggleButtonViewModel = Ml, zl.Viewer = Pl, zl.viewerDragDropMixin = Dl, zl.viewerDynamicObjectMixin = Il, zl.checkForChromeFrame = Ol, zl.createCommand = Rl, zl.getElement = Ll, zl
}), t(["isatCesium"], function(e) { "use strict"; var t = "undefined" != typeof window ? window : "undefined" != typeof self ? self : {};
t.isatCesium = e }, void 0, !0)
}();
function angl(vec1, vec2) {
'use strict';
var SMALL = 0.00000001,
UNDEFINED = 999999.1,
magv1 = mag(vec1),
magv2 = mag(vec2),
temp,
theta;
if (magv1 * magv2 > SMALL * SMALL) {
temp = dot(vec1, vec2) / (magv1 * magv2);
if (Math.abs(temp) > 1.0) {
temp = sign(temp) * 1.0;
}
theta = Math.acos(temp);
}
else {
theta = UNDEFINED;
}
return theta;
}
// compat.js
if (typeof(String.prototype.trim) === 'undefined') {
String.prototype.trim = function () {
'use strict';
return this.replace(/^\s+|\s+$/g, '');
};
}
if (typeof(String.prototype.ltrim) === 'undefined') {
String.prototype.ltrim = function () {
'use strict';
return this.replace(/^\s+/, '');
};
}
if (typeof(String.prototype.rtrim) === 'undefined') {
String.prototype.rtrim = function () {
'use strict';
return this.replace(/\s+$/, '');
};
}
// MATLAB fake compatibility output functions
// These rather assume the output elements are
// so the \n gives linebreaks (adding would make double breaks)
// TODO: if the element doesn't exist, add it to the DOM.
function writeId(id, str) { // TODO: need varargs and sprintf() here
'use strict';
// TODO: isnt' there an append() method?
document.getElementById(id).innerHTML += str + ' \n';
}
function debug(str) {
'use strict';
document.getElementById('debug').innerHTML += str + '\n';
}
function outfile(str) {
'use strict';
// I'm using sprintf() so don't want "\n" from writeId()'s
document.getElementById('outfile').innerHTML += str;
}
function fprintf1(str) {
'use strict';
// I'm using sprintf() so don't want "\n" from writeId()'s
document.getElementById('fprintf1').innerHTML += str;
}
// constastro.js
// ----------------------- physical constants ----------------
// WGS-84/EGM-96 constants used here
var re = 6378.137, // km
flat = 1.0 / 298.257223563,
omegaearth = 7.292115e-11, // rad/s
mu = 398600.4418, // km3/s2
mum = 3.986004418e14, // m3/s2
// derived constants from the base values
eccearth = Math.sqrt(2.0 * flat - flat * flat),
eccearthsqrd = eccearth * eccearth,
renm = re / nm2m,
reft = re * 1000.0 / ft2m,
tusec = Math.sqrt(Math.pow(re, 3) / mu),
tumin = tusec / 60.0,
tuday = tusec / 86400.0,
omegaearthradptu = omegaearth * tusec,
omegaearthradpmin = omegaearth * 60.0,
velkmps = Math.sqrt(mu / re),
velftps = velkmps * 1000.0 / ft2m,
velradpmin = velkmps * 60.0 / re,
//for afspc
//velkmps1 = velradpmin*6378.135/60.0 7.90537051051763
//mu1 = velkmps*velkmps*6378.135 3.986003602567418e+005
degpsec = (180.0 / Math.PI) / tusec,
radpday = 2.0 * Math.PI * 1.002737909350795,
speedoflight = 2.99792458e8, // m/s
au = 149597870.0, // km
earth2moon = 384400.0, // km
moonradius = 1738.0, // km
sunradius = 696000.0, // km
masssun = 1.9891e30,
massearth = 5.9742e24,
massmoon = 7.3483e22;
// constmath.js
var small = 0.00000001,
infinite = 999999.9,
UNDEFINED = 999999.1, // lowercase is JavaScript reserved word
// ------------------------- mathematical --------------------
rad = 180.0 / Math.PI,
twopi = 2.0 * Math.PI,
halfpi = Math.PI * 0.5,
// ------------------------- conversions ---------------------
ft2m = 0.3048,
mile2m = 1609.344,
nm2m = 1852,
mile2ft = 5280,
mileph2kmph = 0.44704,
nmph2kmph = 0.5144444;
// days2mdh.js
var i, lmonth = [], dayofyr, i, inttemp, mon, day, temp, hr, minute, sec, julianday;
function days2mdh(year, days) {
'use strict';
// --------------- set up array of days in month --------------
// This is crazy, why not just:
// lmonth = [undefined, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
for (i = 1; i <= 12; i += 1) {
lmonth[i] = 31;
if (i === 2) {
lmonth[i] = 28;
}
if (i === 4 || i === 6 || i === 9 || i === 11) {
lmonth[i] = 30;
}
}
dayofyr = Math.floor(days);
// ----------------- find month and day of month ---------------
if ((year - 1900) % 4 === 0) {
lmonth[2] = 29;
}
i = 1;
inttemp = 0;
while ((dayofyr > inttemp + lmonth[i]) && (i < 12)) {
inttemp = inttemp + lmonth[i];
i += 1;
}
mon = i;
day = dayofyr - inttemp;
// ----------------- find hours minutes and seconds ------------
// MATLAB's fix() rounds toward zero which behaves differently for
// negative numbers than JavaScript's Math.floor() which rounds down.
// But it should be fine here, for positve numbers.
temp = (days - dayofyr) * 24.0;
hr = Math.floor(temp);
temp = (temp - hr) * 60.0;
minute = Math.floor(temp);
sec = (temp - minute) * 60.0;
julianday = jday(year, mon, day, hr, minute, sec);
return [mon, day, hr, minute, sec];
}
// dpper.js
function dpper(e3, ee2, peo, pgho, pho, pinco, plo, se2,
se3, sgh2, sgh3, sgh4, sh2, sh3, si2, si3,
sl2, sl3, sl4, t, xgh2, xgh3, xgh4, xh2,
xh3, xi2, xi3, xl2, xl3, xl4, zmol,
zmos, inclo, init, ep, inclp, nodep, argpp, mp) {
'use strict';
if (typeof(opsmode) === 'undefined') {
throw new Error('Global opsmode is undefined, must be "a" or "i"');
}
if ((opsmode !== 'a') && (opsmode !== 'i')) {
throw new Error('Global must be "a" or "i" but opsmode=' + opsmode);
}
var twopi = 2.0 * Math.PI,
// /* ---------------------- constants ----------------------------- */
zns = 1.19459e-5,
zes = 0.01675,
znl = 1.5835218e-4,
zel = 0.05490,
zm = zmos + zns * t,
zf, sinzf, f2, f3, ses, sis, sls, sghs, shs,
sel, sil, sll, sghl, shll, pe, pinc, pl, pgh, ph,
sinip, cosip,
sinop, cosop, alfdp, betdb, dalf, dbet, betdp, xls, dls, xnoh;
// /* --------------- calculate time varying periodics ----------- */
// // be sure that the initial call has time set to zero
if (init === 'y') {
zm = zmos;
}
zf = zm + 2.0 * zes * Math.sin(zm);
sinzf = Math.sin(zf);
f2 = 0.5 * sinzf * sinzf - 0.25;
f3 = -0.5 * sinzf * Math.cos(zf);
ses = se2 * f2 + se3 * f3;
sis = si2 * f2 + si3 * f3;
sls = sl2 * f2 + sl3 * f3 + sl4 * sinzf;
sghs = sgh2 * f2 + sgh3 * f3 + sgh4 * sinzf;
shs = sh2 * f2 + sh3 * f3;
zm = zmol + znl * t;
if (init === 'y') {
zm = zmol;
}
zf = zm + 2.0 * zel * Math.sin(zm);
sinzf = Math.sin(zf);
f2 = 0.5 * sinzf * sinzf - 0.25;
f3 = -0.5 * sinzf * Math.cos(zf);
sel = ee2 * f2 + e3 * f3;
sil = xi2 * f2 + xi3 * f3;
sll = xl2 * f2 + xl3 * f3 + xl4 * sinzf;
sghl = xgh2 * f2 + xgh3 * f3 + xgh4 * sinzf;
shll = xh2 * f2 + xh3 * f3;
pe = ses + sel;
pinc = sis + sil;
pl = sls + sll;
pgh = sghs + sghl;
ph = shs + shll;
if (init === 'n') {
// 0.2 rad = 11.45916 deg
pe = pe - peo;
pinc = pinc - pinco;
pl = pl - plo;
pgh = pgh - pgho;
ph = ph - pho;
inclp = inclp + pinc;
ep = ep + pe;
sinip = Math.sin(inclp);
cosip = Math.cos(inclp);
// /* ----------------- apply periodics directly ------------ */
// sgp4fix for lyddane choice
// strn3 used original inclination - this is technically feasible
// gsfc used perturbed inclination - also technically feasible
// probably best to readjust the 0.2 limit value and limit discontinuity
// use next line for original strn3 approach and original inclination
// if (inclo >= 0.2)
// use next line for gsfc version and perturbed inclination
if (inclp >= 0.2) {
ph = ph / sinip;
pgh = pgh - cosip * ph;
argpp = argpp + pgh;
nodep = nodep + ph;
mp = mp + pl;
}
else {
// /* ---- apply periodics with lyddane modification ---- */
sinop = Math.sin(nodep);
cosop = Math.cos(nodep);
alfdp = sinip * sinop;
betdp = sinip * cosop;
dalf = ph * cosop + pinc * cosip * sinop;
dbet = -ph * sinop + pinc * cosip * cosop;
alfdp = alfdp + dalf;
betdp = betdp + dbet;
nodep = nodep % twopi;
// sgp4fix for afspc written intrinsic functions
// nodep used without a trigonometric function ahead
if ((nodep < 0.0) && (opsmode === 'a')) {
nodep = nodep + twopi;
}
xls = mp + argpp + cosip * nodep;
dls = pl + pgh - pinc * nodep * sinip;
xls = xls + dls;
xnoh = nodep;
nodep = Math.atan2(alfdp, betdp);
// sgp4fix for afspc written intrinsic functions
// nodep used without a trigonometric function ahead
if ((nodep < 0.0) && (opsmode === 'a')) {
nodep = nodep + twopi;
}
if (Math.abs(xnoh - nodep) > Math.PI) {
if (nodep < xnoh) {
nodep = nodep + twopi;
}
else {
nodep = nodep - twopi;
}
}
mp = mp + pl;
argpp = xls - mp - cosip * nodep;
}
} // if init == 'n'
return [ ep, inclp, nodep, argpp, mp];
}
// dscom.js
function dscom(epoch, ep, argpp, tc, inclp, nodep, np) {
'use strict';
// /* -------------------------- constants ------------------------- */
var zes = 0.01675,
zel = 0.05490,
c1ss = 2.9864797e-6,
c1l = 4.7968065e-7,
zsinis = 0.39785416,
zcosis = 0.91744867,
zcosgs = 0.1945905,
zsings = -0.98088458,
twopi = 2.0 * Math.PI,
// /* --------------------- local variables ------------------------ */
nm = np,
em = ep,
snodm = Math.sin(nodep),
cnodm = Math.cos(nodep),
sinomm = Math.sin(argpp),
cosomm = Math.cos(argpp),
sinim = Math.sin(inclp),
cosim = Math.cos(inclp),
emsq = em * em,
betasq = 1.0 - emsq,
rtemsq = Math.sqrt(betasq),
// /* ----------------- initialize lunar solar terms --------------- */
peo = 0.0,
pinco = 0.0,
plo = 0.0,
pgho = 0.0,
pho = 0.0,
day = epoch + 18261.5 + tc / 1440.0,
xnodce = (4.5236020 - 9.2422029e-4 * day) % twopi,
stem = Math.sin(xnodce),
ctem = Math.cos(xnodce),
zcosil = 0.91375164 - 0.03568096 * ctem,
zsinil = Math.sqrt(1.0 - zcosil * zcosil),
zsinhl = 0.089683511 * stem / zsinil,
zcoshl = Math.sqrt(1.0 - zsinhl * zsinhl),
gam = 5.8351514 + 0.0019443680 * day,
zx = 0.39785416 * stem / zsinil,
zy = zcoshl * ctem + 0.91744867 * zsinhl * stem,
//
zcosgl, zsingl, zcosg, zsing, zcosi, zsini, zcosh, zsinh,
cc, xnoi,
lsflg,
a1, a3, a7, a8, a9, a10, a2, a4, a5, a6,
x1, x2, x3, x4, x5, x6, x7, x8,
z31, z32, z33, z1, z2, z3, z11, z12, z13, z21, z22, z23,
s3, s2, s4, s1, s5, s6, s7,
ss1, ss2, ss3, ss4, ss5, ss6, ss7,
sz1, sz2, sz3, sz11, sz12, sz13, sz21, sz22, sz23, sz31, sz32, sz33,
zmol, zmos,
se2, se3, si2, si3, sl2, sl3, sl4, sgh2, sgh3, sgh4, sh2, sh3,
ee2, e3, xi2, xi3, xl2, xl3, xl4, xgh2, xgh3, xgh4, xh2, xh3;
zx = Math.atan2(zx, zy);
zx = gam + zx - xnodce;
zcosgl = Math.cos(zx);
zsingl = Math.sin(zx);
// /* ------------------------- do solar terms --------------------- */
zcosg = zcosgs;
zsing = zsings;
zcosi = zcosis;
zsini = zsinis;
zcosh = cnodm;
zsinh = snodm;
cc = c1ss;
xnoi = 1.0 / nm;
for (lsflg = 1; lsflg <= 2; lsflg += 1) { // =1:2
a1 = zcosg * zcosh + zsing * zcosi * zsinh;
a3 = -zsing * zcosh + zcosg * zcosi * zsinh;
a7 = -zcosg * zsinh + zsing * zcosi * zcosh;
a8 = zsing * zsini;
a9 = zsing * zsinh + zcosg * zcosi * zcosh;
a10 = zcosg * zsini;
a2 = cosim * a7 + sinim * a8;
a4 = cosim * a9 + sinim * a10;
a5 = -sinim * a7 + cosim * a8;
a6 = -sinim * a9 + cosim * a10;
x1 = a1 * cosomm + a2 * sinomm;
x2 = a3 * cosomm + a4 * sinomm;
x3 = -a1 * sinomm + a2 * cosomm;
x4 = -a3 * sinomm + a4 * cosomm;
x5 = a5 * sinomm;
x6 = a6 * sinomm;
x7 = a5 * cosomm;
x8 = a6 * cosomm;
z31 = 12.0 * x1 * x1 - 3.0 * x3 * x3;
z32 = 24.0 * x1 * x2 - 6.0 * x3 * x4;
z33 = 12.0 * x2 * x2 - 3.0 * x4 * x4;
z1 = 3.0 * (a1 * a1 + a2 * a2) + z31 * emsq;
z2 = 6.0 * (a1 * a3 + a2 * a4) + z32 * emsq;
z3 = 3.0 * (a3 * a3 + a4 * a4) + z33 * emsq;
z11 = -6.0 * a1 * a5 + emsq * (-24.0 * x1 * x7 - 6.0 * x3 * x5);
z12 = -6.0 * (a1 * a6 + a3 * a5) + emsq * (-24.0 * (x2 * x7 + x1 * x8) - 6.0 * (x3 * x6 + x4 * x5));
z13 = -6.0 * a3 * a6 + emsq * (-24.0 * x2 * x8 - 6.0 * x4 * x6);
z21 = 6.0 * a2 * a5 + emsq * (24.0 * x1 * x5 - 6.0 * x3 * x7);
z22 = 6.0 * (a4 * a5 + a2 * a6) + emsq * (24.0 * (x2 * x5 + x1 * x6) - 6.0 * (x4 * x7 + x3 * x8));
z23 = 6.0 * a4 * a6 + emsq * (24.0 * x2 * x6 - 6.0 * x4 * x8);
z1 = z1 + z1 + betasq * z31;
z2 = z2 + z2 + betasq * z32;
z3 = z3 + z3 + betasq * z33;
s3 = cc * xnoi;
s2 = -0.5 * s3 / rtemsq;
s4 = s3 * rtemsq;
s1 = -15.0 * em * s4;
s5 = x1 * x3 + x2 * x4;
s6 = x2 * x3 + x1 * x4;
s7 = x2 * x4 - x1 * x3;
// /* ----------------------- do lunar terms ------------------- */
if (lsflg === 1) {
ss1 = s1;
ss2 = s2;
ss3 = s3;
ss4 = s4;
ss5 = s5;
ss6 = s6;
ss7 = s7;
sz1 = z1;
sz2 = z2;
sz3 = z3;
sz11 = z11;
sz12 = z12;
sz13 = z13;
sz21 = z21;
sz22 = z22;
sz23 = z23;
sz31 = z31;
sz32 = z32;
sz33 = z33;
zcosg = zcosgl;
zsing = zsingl;
zcosi = zcosil;
zsini = zsinil;
zcosh = zcoshl * cnodm + zsinhl * snodm;
zsinh = snodm * zcoshl - cnodm * zsinhl;
cc = c1l;
}
}
zmol = (4.7199672 + 0.22997150 * day - gam) % twopi;
zmos = (6.2565837 + 0.017201977 * day) % twopi;
// /* ------------------------ do solar terms ---------------------- */
se2 = 2.0 * ss1 * ss6;
se3 = 2.0 * ss1 * ss7;
si2 = 2.0 * ss2 * sz12;
si3 = 2.0 * ss2 * (sz13 - sz11);
sl2 = -2.0 * ss3 * sz2;
sl3 = -2.0 * ss3 * (sz3 - sz1);
sl4 = -2.0 * ss3 * (-21.0 - 9.0 * emsq) * zes;
sgh2 = 2.0 * ss4 * sz32;
sgh3 = 2.0 * ss4 * (sz33 - sz31);
sgh4 = -18.0 * ss4 * zes;
sh2 = -2.0 * ss2 * sz22;
sh3 = -2.0 * ss2 * (sz23 - sz21);
// /* ------------------------ do lunar terms ---------------------- */
ee2 = 2.0 * s1 * s6;
e3 = 2.0 * s1 * s7;
xi2 = 2.0 * s2 * z12;
xi3 = 2.0 * s2 * (z13 - z11);
xl2 = -2.0 * s3 * z2;
xl3 = -2.0 * s3 * (z3 - z1);
xl4 = -2.0 * s3 * (-21.0 - 9.0 * emsq) * zel;
xgh2 = 2.0 * s4 * z32;
xgh3 = 2.0 * s4 * (z33 - z31);
xgh4 = -18.0 * s4 * zel;
xh2 = -2.0 * s2 * z22;
xh3 = -2.0 * s2 * (z23 - z21);
return [sinim, cosim, sinomm, cosomm, snodm, cnodm, day, e3, ee2, em, emsq, gam,
peo, pgho, pho, pinco, plo, rtemsq, se2, se3, sgh2, sgh3, sgh4, sh2, sh3, si2,
si3, sl2, sl3, sl4, s1, s2, s3, s4, s5, s6, s7, ss1, ss2, ss3, ss4, ss5, ss6, ss7,
sz1, sz2, sz3, sz11, sz12, sz13, sz21, sz22, sz23, sz31, sz32, sz33, xgh2, xgh3,
xgh4, xh2, xh3, xi2, xi3, xl2, xl3, xl4, nm, z1, z2, z3, z11, z12, z13, z21, z22,
z23, z31, z32, z33, zmol, zmos];
}
// dsinit.js
function dsinit(
cosim, emsq, argpo, s1, s2, s3, s4,
s5, sinim, ss1, ss2, ss3, ss4, ss5,
sz1, sz3, sz11, sz13, sz21, sz23, sz31,
sz33, t, tc, gsto, mo, mdot, no,
nodeo, nodedot, xpidot, z1, z3, z11,
z13, z21, z23, z31, z33, em, argpm,
inclm, mm, nm, nodem, ecco, eccsq) {
'use strict';
// /* --------------------- local variables ------------------------ */
var twopi = 2.0 * Math.PI,
aonv = 0.0,
q22 = 1.7891679e-6,
q31 = 2.1460748e-6,
q33 = 2.2123015e-7,
root22 = 1.7891679e-6,
root44 = 7.3636953e-9,
root54 = 2.1765803e-9,
rptim = 4.37526908801129966e-3,
root32 = 3.7393792e-7,
root52 = 1.1428639e-7,
x2o3 = 2.0 / 3.0,
znl = 1.5835218e-4,
zns = 1.19459e-5,
// sgp4fix identify constants and allow alternate values
irez = 0,
// TODO: FIGURE OUT HOW TO GET GLOBALS
//global tumin mu radiusearthkm xke j2 j3 j4 j3oj2
//tumin, mu, radiusearthkm, xke, j2, j3, j4, j3oj2,
// /* -------------------- deep space initialization ------------ */
d2201 = 0,
d2211 = 0,
d3210 = 0,
d3222 = 0,
d4410 = 0,
d4422 = 0,
d5220 = 0,
d5232 = 0,
d5421 = 0,
d5433 = 0,
del1 = 0,
del2 = 0,
del3 = 0,
atime = 0,
xfact = 0,
xlamo = 0,
xli = 0,
xni = 0,
// variable defined later
ses, sis, sls, sghs, shs, sgs, sghl,
dedt, didt, dmdt, sdhl, shll, domdt, dnodt, dndt, theta,
cosisq, emo, emsqo, eoc,
g201, g211, g310, g322, g410, g422, g520, g533, g521, g532,
sini2, f220, f221, f321, f322, f441, f442, f522, f523, f542, f543,
xno2, ainv2, temp1, temp,
g200, g300, f311, f330;
if ((nm < 0.0052359877) && (nm > 0.0034906585)) {
irez = 1;
}
if ((nm >= 8.26e-3) && (nm <= 9.24e-3) && (em >= 0.5)) {
irez = 2;
}
// /* ------------------------ do solar terms ------------------- */
ses = ss1 * zns * ss5;
sis = ss2 * zns * (sz11 + sz13);
sls = -zns * ss3 * (sz1 + sz3 - 14.0 - 6.0 * emsq);
sghs = ss4 * zns * (sz31 + sz33 - 6.0);
shs = -zns * ss2 * (sz21 + sz23);
// // sgp4fix for 180 deg incl
if ((inclm < 5.2359877e-2) || (inclm > Math.PI - 5.2359877e-2)) {
shs = 0.0;
}
if (sinim !== 0.0) { // WARN unreliable floating point comparison
shs = shs / sinim;
}
sgs = sghs - cosim * shs;
// /* ------------------------- do lunar terms ------------------ */
dedt = ses + s1 * znl * s5;
didt = sis + s2 * znl * (z11 + z13);
dmdt = sls - znl * s3 * (z1 + z3 - 14.0 - 6.0 * emsq);
sghl = s4 * znl * (z31 + z33 - 6.0);
shll = -znl * s2 * (z21 + z23);
// // sgp4fix for 180 deg incl
if ((inclm < 5.2359877e-2) || (inclm > Math.PI - 5.2359877e-2)) {
shll = 0.0;
}
domdt = sgs + sghl;
dnodt = shs;
if (sinim !== 0.0) { // WARN unrealiable
domdt = domdt - cosim / sinim * shll;
dnodt = dnodt + shll / sinim;
}
// /* ----------- calculate deep space resonance effects -------- */
dndt = 0.0;
theta = (gsto + tc * rptim) % twopi;
em = em + dedt * t;
inclm = inclm + didt * t;
argpm = argpm + domdt * t;
nodem = nodem + dnodt * t;
mm = mm + dmdt * t;
// // sgp4fix for negative inclinations
// // the following if statement should be commented out
// //if (inclm < 0.0)
// // {
// // inclm = -inclm;
// // argpm = argpm - pi;
// // nodem = nodem + pi;
// // }
// /* - update resonances : numerical (euler-maclaurin) integration - */
// /* ------------------------- epoch restart ---------------------- */
// // sgp4fix for propagator problems
// // the following integration works for negative time steps and periods
// // the specific changes are unknown because the original code was so convoluted
// /* -------------- initialize the resonance terms ------------- */
if (irez !== 0) {
aonv = Math.pow(nm / xke, x2o3); // TODO GLOBAL xke
// /* ---------- geopotential resonance for 12 hour orbits ------ */
if (irez === 2) {
cosisq = cosim * cosim;
emo = em;
em = ecco;
emsqo = emsq;
emsq = eccsq;
eoc = em * emsq;
g201 = -0.306 - (em - 0.64) * 0.440;
if (em <= 0.65) {
g211 = 3.616 - 13.2470 * em + 16.2900 * emsq;
g310 = -19.302 + 117.3900 * em - 228.4190 * emsq + 156.5910 * eoc;
g322 = -18.9068 + 109.7927 * em - 214.6334 * emsq + 146.5816 * eoc;
g410 = -41.122 + 242.6940 * em - 471.0940 * emsq + 313.9530 * eoc;
g422 = -146.407 + 841.8800 * em - 1629.014 * emsq + 1083.4350 * eoc;
g520 = -532.114 + 3017.977 * em - 5740.032 * emsq + 3708.2760 * eoc;
}
else {
g211 = -72.099 + 331.819 * em - 508.738 * emsq + 266.724 * eoc;
g310 = -346.844 + 1582.851 * em - 2415.925 * emsq + 1246.113 * eoc;
g322 = -342.585 + 1554.908 * em - 2366.899 * emsq + 1215.972 * eoc;
g410 = -1052.797 + 4758.686 * em - 7193.992 * emsq + 3651.957 * eoc;
g422 = -3581.690 + 16178.110 * em - 24462.770 * emsq + 12422.520 * eoc;
if (em > 0.715) {
g520 = -5149.66 + 29936.92 * em - 54087.36 * emsq + 31324.56 * eoc;
}
else {
g520 = 1464.74 - 4664.75 * em + 3763.64 * emsq;
}
}
if (em < 0.7) {
g533 = -919.22770 + 4988.6100 * em - 9064.7700 * emsq + 5542.21 * eoc;
g521 = -822.71072 + 4568.6173 * em - 8491.4146 * emsq + 5337.524 * eoc;
g532 = -853.66600 + 4690.2500 * em - 8624.7700 * emsq + 5341.4 * eoc;
}
else {
g533 = -37995.780 + 161616.52 * em - 229838.20 * emsq + 109377.94 * eoc;
g521 = -51752.104 + 218913.95 * em - 309468.16 * emsq + 146349.42 * eoc;
g532 = -40023.880 + 170470.89 * em - 242699.48 * emsq + 115605.82 * eoc;
}
////
sini2 = sinim * sinim;
f220 = 0.75 * (1.0 + 2.0 * cosim + cosisq);
f221 = 1.5 * sini2;
f321 = 1.875 * sinim * (1.0 - 2.0 * cosim - 3.0 * cosisq);
f322 = -1.875 * sinim * (1.0 + 2.0 * cosim - 3.0 * cosisq);
f441 = 35.0 * sini2 * f220;
f442 = 39.3750 * sini2 * sini2;
f522 = 9.84375 * sinim * (sini2 * (1.0 - 2.0 * cosim - 5.0 * cosisq) +
0.33333333 * (-2.0 + 4.0 * cosim + 6.0 * cosisq));
f523 = sinim * (4.92187512 * sini2 * (-2.0 - 4.0 * cosim +
10.0 * cosisq) + 6.56250012 * (1.0 + 2.0 * cosim - 3.0 * cosisq));
f542 = 29.53125 * sinim * (2.0 - 8.0 * cosim + cosisq *
(-12.0 + 8.0 * cosim + 10.0 * cosisq));
f543 = 29.53125 * sinim * (-2.0 - 8.0 * cosim + cosisq *
(12.0 + 8.0 * cosim - 10.0 * cosisq));
xno2 = nm * nm;
ainv2 = aonv * aonv;
temp1 = 3.0 * xno2 * ainv2;
temp = temp1 * root22;
d2201 = temp * f220 * g201;
d2211 = temp * f221 * g211;
temp1 = temp1 * aonv;
temp = temp1 * root32;
d3210 = temp * f321 * g310;
d3222 = temp * f322 * g322;
temp1 = temp1 * aonv;
temp = 2.0 * temp1 * root44;
d4410 = temp * f441 * g410;
d4422 = temp * f442 * g422;
temp1 = temp1 * aonv;
temp = temp1 * root52;
d5220 = temp * f522 * g520;
d5232 = temp * f523 * g532;
temp = 2.0 * temp1 * root54;
d5421 = temp * f542 * g521;
d5433 = temp * f543 * g533;
xlamo = (mo + nodeo + nodeo - theta - theta) % twopi;
xfact = mdot + dmdt + 2.0 * (nodedot + dnodt - rptim) - no;
em = emo;
emsq = emsqo;
}
// /* ---------------- synchronous resonance terms -------------- */
if (irez === 1) {
g200 = 1.0 + emsq * (-2.5 + 0.8125 * emsq);
g310 = 1.0 + 2.0 * emsq;
g300 = 1.0 + emsq * (-6.0 + 6.60937 * emsq);
f220 = 0.75 * (1.0 + cosim) * (1.0 + cosim);
f311 = 0.9375 * sinim * sinim * (1.0 + 3.0 * cosim) - 0.75 * (1.0 + cosim);
f330 = 1.0 + cosim;
f330 = 1.875 * f330 * f330 * f330;
del1 = 3.0 * nm * nm * aonv * aonv;
del2 = 2.0 * del1 * f220 * g200 * q22;
del3 = 3.0 * del1 * f330 * g300 * q33 * aonv;
del1 = del1 * f311 * g310 * q31 * aonv;
xlamo = (mo + nodeo + argpo - theta) % twopi;
xfact = mdot + xpidot - rptim + dmdt + domdt + dnodt - no;
}
// /* ------------ for sgp4, initialize the integrator ---------- */
xli = xlamo;
xni = no;
atime = 0.0;
nm = no + dndt;
}
return [em, argpm, inclm, mm, nm, nodem, irez,
atime, d2201, d2211, d3210, d3222, d4410, d4422,
d5220, d5232, d5421, d5433, dedt, didt, dmdt,
dndt, dnodt, domdt, del1, del2, del3, xfact,
xlamo, xli, xni];
}
// dspace.js
function dspace(d2201, d2211, d3210, d3222, d4410, d4422, d5220,
d5232, d5421, d5433, dedt, del1, del2, del3,
didt, dmdt, dnodt, domdt, irez, argpo, argpdot,
t, tc, gsto, xfact, xlamo, no, atime,
em, argpm, inclm, xli, mm, xni, nodem,
nm) {
'use strict';
var twopi = 2.0 * Math.PI,
fasx2 = 0.13130908,
fasx4 = 2.8843198,
fasx6 = 0.37448087,
g22 = 5.7686396,
g32 = 0.95240898,
g44 = 1.8014998,
g52 = 1.0508330,
g54 = 4.4108898,
rptim = 4.37526908801129966e-3,
stepp = 720.0,
stepn = -720.0,
step2 = 259200.0,
// /* ----------- calculate deep space resonance effects ----------- */
dndt = 0.0,
theta = (gsto + tc * rptim) % twopi,
// defined elsewhere
ft,
delt,
iretn, iret,
xndt, xldot, xnddt,
xomi, x2omi, x2li,
xl;
em = em + dedt * t;
inclm = inclm + didt * t;
argpm = argpm + domdt * t;
nodem = nodem + dnodt * t;
mm = mm + dmdt * t;
// // sgp4fix for negative inclinations
// // the following if statement should be commented out
// // if (inclm < 0.0)
// // {
// // inclm = -inclm;
// // argpm = argpm - pi;
// // nodem = nodem + pi;
// // }
// /* - update resonances : numerical (euler-maclaurin) integration - */
// /* ------------------------- epoch restart ---------------------- */
// // sgp4fix for propagator problems
// // the following integration works for negative time steps and periods
// // the specific changes are unknown because the original code was so convoluted
// // sgp4fix take out atime = 0.0 and fix for faster operation
ft = 0.0;
if (irez !== 0) {
// sgp4fix streamline check
if ((atime === 0.0) || (t * atime <= 0.0) || (Math.abs(t) < Math.abs(atime))) {
atime = 0.0;
xni = no;
xli = xlamo;
}
// sgp4fix move check outside loop
if (t >= 0.0) {
delt = stepp;
}
else {
delt = stepn;
}
iretn = 381; //// added for do loop
iret = 0; //// added for loop
while (iretn === 381) {
// /* ------------------- dot terms calculated ------------- */
// /* ----------- near - synchronous resonance terms ------- */
if (irez !== 2) {
xndt = del1 * Math.sin(xli - fasx2) + del2 * Math.sin(2.0 * (xli - fasx4)) +
del3 * Math.sin(3.0 * (xli - fasx6));
xldot = xni + xfact;
xnddt = del1 * Math.cos(xli - fasx2) +
2.0 * del2 * Math.cos(2.0 * (xli - fasx4)) +
3.0 * del3 * Math.cos(3.0 * (xli - fasx6));
xnddt = xnddt * xldot;
}
else {
// /* --------- near - half-day resonance terms -------- */
xomi = argpo + argpdot * atime;
x2omi = xomi + xomi;
x2li = xli + xli;
xndt =
d2201 * Math.sin(x2omi + xli - g22) + d2211 * Math.sin(xli - g22) +
d3210 * Math.sin(xomi + xli - g32) + d3222 * Math.sin(-xomi + xli - g32) +
d4410 * Math.sin(x2omi + x2li - g44) + d4422 * Math.sin(x2li - g44) +
d5220 * Math.sin(xomi + xli - g52) + d5232 * Math.sin(-xomi + xli - g52) +
d5421 * Math.sin(xomi + x2li - g54) + d5433 * Math.sin(-xomi + x2li - g54);
xldot = xni + xfact;
xnddt =
d2201 * Math.cos(x2omi + xli - g22) + d2211 * Math.cos(xli - g22) +
d3210 * Math.cos(xomi + xli - g32) + d3222 * Math.cos(-xomi + xli - g32) +
d5220 * Math.cos(xomi + xli - g52) + d5232 * Math.cos(-xomi + xli - g52) +
2.0 * (d4410 * Math.cos(x2omi + x2li - g44) +
d4422 * Math.cos(x2li - g44) + d5421 * Math.cos(xomi + x2li - g54) +
d5433 * Math.cos(-xomi + x2li - g54));
xnddt = xnddt * xldot;
}
// /* ----------------------- integrator ------------------- */
// sgp4fix move end checks to end of routine
if (Math.abs(t - atime) >= stepp) {
iret = 0;
iretn = 381;
}
else {
ft = t - atime;
iretn = 0;
}
if (iretn === 381) {
xli = xli + xldot * delt + xndt * step2;
xni = xni + xndt * delt + xnddt * step2;
atime = atime + delt;
}
} // while iretn = 381
nm = xni + xndt * ft + xnddt * ft * ft * 0.5;
xl = xli + xldot * ft + xndt * ft * ft * 0.5;
if (irez !== 1) {
mm = xl - 2.0 * nodem + 2.0 * theta;
dndt = nm - no;
}
else {
mm = xl - nodem - argpm + theta;
dndt = nm - no;
}
nm = no + dndt;
}
return [atime, em, argpm, inclm, xli, mm, xni, nodem, dndt, nm];
}
// getgravc.js
function getgravc(whichconst) {
'use strict';
var mu, radiusearthkm, xke, tumin, j2, j3, j4, j3oj2;
switch (whichconst) {
case 721:
// -- wgs-72 low precision str#3 constants --
mu = 398600.79964; // in km3 / s2
radiusearthkm = 6378.135; // km
xke = 0.0743669161;
tumin = 1.0 / xke;
j2 = 0.001082616;
j3 = -0.00000253881;
j4 = -0.00000165597;
j3oj2 = j3 / j2;
break;
case 72:
// ------------ wgs-72 constants ------------
mu = 398600.8; // in km3 / s2
radiusearthkm = 6378.135; // km
xke = 60.0 / Math.sqrt(radiusearthkm * radiusearthkm * radiusearthkm / mu);
tumin = 1.0 / xke;
j2 = 0.001082616;
j3 = -0.00000253881;
j4 = -0.00000165597;
j3oj2 = j3 / j2;
break;
case 84:
// ------------ wgs-84 constants ------------
mu = 398600.5; // in km3 / s2
radiusearthkm = 6378.137; // km
xke = 60.0 / Math.sqrt(radiusearthkm * radiusearthkm * radiusearthkm / mu);
tumin = 1.0 / xke;
j2 = 0.00108262998905;
j3 = -0.00000253215306;
j4 = -0.00000161098761;
j3oj2 = j3 / j2;
break;
default:
alert('getgravc: unknown gravity option: ' + whichconst);
throw new Error('getgravc: unknown gravity option: ' + whichconst);
}
return [tumin, mu, radiusearthkm, xke, j2, j3, j4, j3oj2];
}
// gstime.js
function gstime(jdut1) {
'use strict';
var twopi = 2.0 * Math.PI,
deg2rad = Math.PI / 180.0,
tut1, temp;
// ------------------------ implementation ------------------
tut1 = (jdut1 - 2451545.0) / 36525.0;
temp = -6.2e-6 * tut1 * tut1 * tut1 + 0.093104 * tut1 * tut1 +
(876600.0 * 3600.0 + 8640184.812866) * tut1 + 67310.54841;
// 360/86400 = 1/240, to deg, to rad
temp = (temp * deg2rad / 240.0) % twopi;
// ------------------------ check quadrants --------------------
if (temp < 0.0) {
temp = temp + twopi;
}
return temp;
}
// initl.js
function initl(ecco, epoch, inclo, no, satn) {
'use strict';
// /* -------------------- wgs-72 earth constants ----------------- */
// sgp4fix identify constants and allow alternate values
// MATLAB:
//global tumin mu radiusearthkm xke j2 j3 j4 j3oj2
// not used: tumin, mu, radiusearth, j3, j4, j3oj2
//global opsmode
if (typeof opsmode === 'undefined') {
throw new Error('opsmode undefined');
}
if (typeof xke === 'undefined') {
throw new Error('xke undefined');
}
if (typeof j2 === 'undefined') {
throw new Error('j2 undefined');
}
var x2o3 = 2.0 / 3.0,
// /* ------------- calculate auxillary epoch quantities ---------- */
eccsq = ecco * ecco,
omeosq = 1.0 - eccsq,
rteosq = Math.sqrt(omeosq),
cosio = Math.cos(inclo),
cosio2 = cosio * cosio,
// /* ------------------ un-kozai the mean motion ----------------- */
ak = Math.pow(xke / no, x2o3),
d1 = 0.75 * j2 * (3.0 * cosio2 - 1.0) / (rteosq * omeosq),
del = d1 / (ak * ak),
adel = ak * (1.0 - del * del - del *
(1.0 / 3.0 + 134.0 * del * del / 81.0)),
// defined elsewhere
ao, sinio, po, con42, con41, ainv, einv, posq, rp, method,
gsto, ts70, ids70, tfrac, c1, thgr70, fk5r, twopi, c1p2p;
del = d1 / (adel * adel);
no = no / (1.0 + del);
ao = Math.pow(xke / no, x2o3);
sinio = Math.sin(inclo);
po = ao * omeosq;
con42 = 1.0 - 5.0 * cosio2;
con41 = -con42 - cosio2 - cosio2;
ainv = 1.0 / ao;
einv = 1.0 / ecco;
posq = po * po;
rp = ao * (1.0 - ecco);
method = 'n';
// sgp4fix modern approach to finding sidereal time
if (opsmode !== 'a') {
gsto = gstime(epoch + 2433281.5); // EXTERNAL gstime()
}
else {
// sgp4fix use old way of finding gst
// count integer number of days from 0 jan 1970
ts70 = epoch - 7305.0;
ids70 = Math.floor(ts70 + 1.0e-8);
tfrac = ts70 - ids70;
// find greenwich location at epoch
c1 = 1.72027916940703639e-2;
thgr70 = 1.7321343856509374;
fk5r = 5.07551419432269442e-15;
twopi = 6.283185307179586;
c1p2p = c1 + twopi;
gsto = (thgr70 + c1 * ids70 + c1p2p * tfrac + ts70 * ts70 * fk5r) % twopi;
}
if (gsto < 0.0) {
gsto = gsto + twopi;
}
return [ainv, ao, con41, con42, cosio, cosio2, einv,
eccsq, method, omeosq, posq, rp, rteosq, sinio,
gsto, no];
}
// invjday.js
function invjday(jd) {
'use strict';
// ----------------- find year and days of the year ---------------
var temp = jd - 2415019.5,
tu = temp / 365.25,
year = 1900 + Math.floor(tu),
leapyrs = Math.floor((year - 1901) * 0.25),
// days = temp - ((year-1900)*365.0 + leapyrs ) + 0.00000000001; // nudge by 8.64x10-7 sec to get even outputs
days = temp - ((year - 1900) * 365.0 + leapyrs),
mon, day, hr, min, sec,
rets;
// ------------ check for case of beginning of a year -------------
if (days < 1.0) {
year = year - 1;
leapyrs = Math.floor((year - 1901) * 0.25);
days = temp - ((year - 1900) * 365.0 + leapyrs);
}
// ------------------- find remaining data -----------------------
rets = days2mdh(year, days);
mon = rets.shift();
day = rets.shift();
hr = rets.shift();
min = rets.shift();
sec = rets.shift();
// sec= sec - 0.00000086400;
return [year, mon, day, hr, min, sec];
}
// jday.js
function jday(yr, mon, day, hr, min, sec) {
'use strict';
return 367.0 * yr -
Math.floor((7 * (yr + Math.floor((mon + 9) / 12.0))) * 0.25) +
Math.floor(275 * mon / 9.0) +
day + 1721013.5 +
((sec / 60.0 + min) / 60.0 + hr) / 24.0;
// - 0.5 * sign(100.0 * yr + mon - 190002.5) + 0.5;
}
// mag.js
function mag(vec) {
'use strict';
var temp = vec[0] * vec[0] + vec[1] * vec[1] + vec[2] * vec[2],
mymag = 0.0;
if (Math.abs(temp) >= 1.0e-16) {
mymag = Math.sqrt(temp);
}
return mymag;
}
// math_utils.js
function sign(val) {
'use strict';
if (val < 0) {
return -1;
}
if (val > 0) {
return 1;
}
return 0;
}
function cross(v1, v2) {
'use strict';
// Return 3d cross product vector from two 3d vectors.
// http://knol.google.com/k/dot-product-cross-product-in-3d
// http://rosettacode.org/wiki/Vector_products
// Our vectors are represented as lists, for historical compatibility.
var x1 = v1[0],
y1 = v1[1],
z1 = v1[2],
x2 = v2[0],
y2 = v2[1],
z2 = v2[2];
return [y1 * z2 - y2 * z1, z1 * x2 - z2 * x1, x1 * y2 - x2 * y1];
}
function dot(a, b) {
'use strict';
// Return a scalar dot product of two multidimensional vectors.
// http://c2.com/cgi/wiki?DotProductInManyProgrammingLanguages
var n = 0,
lim = Math.min(a.length, b.length),
i;
for (i = 0; i < lim; i += 1) {
n += a[i] * b[i];
}
return n;
}
// newtonu.js
function sinh(val) {
'use strict';
return (Math.pow(Math.E, val) - Math.pow(Math.E, -val)) / 2;
}
function asinh(val) {
'use strict';
return Math.log(val + Math.sqrt(val * val + 1));
}
function newtonnu(ecc, nu) {
'use strict';
var e0 = 999999.9,
m = 999999.9,
small = 0.00000001,
sine, cose;
// --------------------------- circular ------------------------
if (Math.abs(ecc) < small) {
m = nu;
e0 = nu;
}
else {
// ---------------------- elliptical -----------------------
if (ecc < 1.0 - small) {
sine = (Math.sqrt(1.0 - ecc * ecc) * Math.sin(nu)) / (1.0 + ecc * Math.cos(nu));
cose = (ecc + Math.cos(nu)) / (1.0 + ecc * Math.cos(nu));
e0 = Math.atan2(sine, cose);
m = e0 - ecc * Math.sin(e0);
}
else {
// -------------------- hyperbolic --------------------
if (ecc > 1.0 + small) {
if ((ecc > 1.0) &&
(Math.abs(nu) + 0.00001 < Math.PI - Math.acos(1.0 / ecc))) {
sine = (Math.sqrt(ecc * ecc - 1.0) * Math.sin(nu)) / (1.0 + ecc * Math.cos(nu));
e0 = asinh(sine);
m = ecc * sinh(e0) - e0;
}
else {
// ----------------- parabolic ---------------------
if (Math.abs(nu) < 168.0 * Math.PI / 180.0) {
e0 = Math.tan(nu * 0.5);
m = e0 + (e0 * e0 * e0) / 3.0;
}
}
}
}
}
if (ecc < 1.0) {
m = m % (2.0 * Math.PI);
if (m < 0.0) {
m = m + 2.0 * Math.PI;
}
e0 = e0 % (2.0 * Math.PI);
}
return [e0, m];
}
// rv2coe.js
function rv2coe(r, v, mu) {
'use strict';
// ------------------------- implementation -----------------
var magr, magv,
// ------------------ find h n and e vectors ----------------
hbar, // hbar is a vector
magh,
nbar = [],
magn, c1, rdotv,
ebar = [],
i, ecc, sme, a, p, hk, incl,
typeorbit,
temp, omega, argp,
nu, arglat, m, lonper,
truelon, em;
magr = mag(r);
magv = mag(v);
// ------------------ find h n and e vectors ----------------
hbar = cross(r, v); // hbar is a vector
magh = mag(hbar);
if (magh > small) {
nbar[0] = - hbar[1];
nbar[1] = hbar[0];
nbar[2] = 0.0;
magn = mag(nbar);
c1 = magv * magv - mu / magr;
rdotv = dot(r, v);
for (i in [0, 1, 2]) {
ebar[i] = (c1 * r[i] - rdotv * v[i]) / mu;
}
ecc = mag(ebar);
// ------------ find a e and semi-latus rectum ----------
sme = (magv * magv * 0.5) - (mu / magr);
if (Math.abs(sme) > small) {
a = -mu / (2.0 * sme);
}
else {
a = infinite;
}
p = magh * magh / mu;
// ----------------- find inclination -------------------
hk = hbar[2] / magh;
incl = Math.acos(hk);
// -------- determine type of orbit for later use --------
// ------ elliptical, parabolic, hyperbolic inclined -------
typeorbit = 'ei';
if (ecc < small) {
alert('ecc small) {
temp = nbar[0] / magn;
if (Math.abs(temp) > 1.0) {
temp = sign(temp);
}
omega = Math.acos(temp);
if (nbar[1] < 0.0) {
omega = twopi - omega;
}
}
else {
alert('omega=UNDEFINED');
omega = UNDEFINED;
}
// ---------------- find argument of perigee ---------------
if (typeorbit === 'ei') {
argp = angl(nbar, ebar);
if (ebar[2] < 0.0) {
argp = twopi - argp;
}
}
else {
alert('argp=UNDEFINED');
argp = UNDEFINED;
}
// ------------ find true anomaly at epoch -------------
if (typeorbit[0] === 'e') {
nu = angl(ebar, r);
if (rdotv < 0.0) {
nu = twopi - nu;
}
}
else {
alert('nu=UNDEFINED');
nu = UNDEFINED;
}
// ---- find argument of latitude - circular inclined -----
if (typeorbit === 'ci') {
arglat = angl(nbar, r);
if (r[2] < 0.0) {
arglat = twopi - arglat;
}
m = arglat;
}
else {
//alert("arglat=UNDEFINED");
arglat = UNDEFINED;
}
// -- find longitude of perigee - elliptical equatorial ----
if ((ecc > small) && (typeorbit === 'ee')) {
temp = ebar[0] / ecc;
if (Math.abs(temp) > 1.0) {
temp = sign(temp);
}
lonper = Math.acos(temp);
if (ebar[1] < 0.0) {
lonper = twopi - lonper;
}
if (incl > halfpi) {
lonper = twopi - lonper;
}
}
else {
//alert("lonper=UNDEFINED");
lonper = UNDEFINED;
}
// -------- find true longitude - circular equatorial ------
if ((magr > small) && (typeorbit === 'ce')) {
temp = r[0] / magr;
if (Math.abs(temp) > 1.0) {
temp = sign(temp);
}
truelon = Math.acos(temp);
if (r[1] < 0.0) {
truelon = twopi - truelon;
}
if (incl > halfpi) {
truelon = twopi - truelon;
}
m = truelon;
}
else {
//alert("truelon=UNDEFINED");
truelon = UNDEFINED;
}
// ------------ find mean anomaly for all orbits -----------
if (typeorbit[0] === 'e') {
//[e, m] = newtonnu(ecc,nu ); // e is undefined, but unused
em = newtonnu(ecc, nu);
m = em[1];
}
}
else { // magh <= small
p = UNDEFINED;
a = UNDEFINED;
ecc = UNDEFINED;
incl = UNDEFINED;
omega = UNDEFINED;
argp = UNDEFINED;
nu = UNDEFINED;
m = UNDEFINED;
arglat = UNDEFINED;
truelon = UNDEFINED;
lonper = UNDEFINED;
}
return [p, a, ecc, incl, omega, argp, nu, m, arglat, truelon, lonper];
}
// sgp4.js
function sgp4(satrec, tsince) {
'use strict';
// /* ------------------ set mathematical constants --------------- */
var twopi = 2.0 * Math.PI,
x2o3 = 2.0 / 3.0,
// sgp4fix divisor for divide by zero check on inclination
// the old check used 1.0 + Math.cos(pi-1.0e-9), but then compared it to
// 1.5 e-12, so the threshold was changed to 1.5e-12 for consistancy
temp4 = 1.5e-12,
// sgp4fix identify constants and allow alternate values
// TODO: global tumin mu radiusearthkm xke j2 j3 j4 j3oj2
rets, tumin, mu, radiusearthkm, xke, j2, j3, j4, j3oj2,
vkmpersec,
xmdf, argpdf, nodedf, argpm, mm, t2, nodem, tempa, tempe, templ,
delomg, delm, temp, t3, t4, temp3,
nm, em, inclm, tc, dndt, am,
xm, emsq, sl,
xlm, sinim, cosim, ep, xincp, argpp, nodep, mp, sinip, cosip,
axnl, aynl, xl, u, eo1, tem5, ktr, sineo1, coseo1,
ecose, esine, el2, pl,
r = [],
v = [],
rl, rdotl, rvdotl, betal, sinu, cosu, su, sin2u, cos2u, temp1, temp2,
cosisq, mrt, xnode, xinc, mvt, rvdot,
sinsu, cossu, snod, cnod, sini, cosi, xmx, xmy, ux, uy, uz, vx, vy, vz;
// TODO: how do we get `whichconst` from the caller? or (shudder) globals?
rets = getgravc(72); // TODO: sucks to have to call this all the time
tumin = rets.shift();
mu = rets.shift();
radiusearthkm = rets.shift();
xke = rets.shift();
j2 = rets.shift();
j3 = rets.shift();
j4 = rets.shift();
j3oj2 = rets.shift();
vkmpersec = radiusearthkm * xke / 60.0;
// /* --------------------- clear sgp4 error flag ----------------- */
//satrec.t = tsince/1440;
satrec.t = tsince;
satrec.error = 0;
// /* ------- update for secular gravity and atmospheric drag ----- */
xmdf = satrec.mo + satrec.mdot * satrec.t;
argpdf = satrec.argpo + satrec.argpdot * satrec.t;
nodedf = satrec.nodeo + satrec.nodedot * satrec.t;
argpm = argpdf;
mm = xmdf;
t2 = satrec.t * satrec.t;
nodem = nodedf + satrec.nodecf * t2;
tempa = 1.0 - satrec.cc1 * satrec.t;
tempe = satrec.bstar * satrec.cc4 * satrec.t;
templ = satrec.t2cof * t2;
if (satrec.isimp !== 1) {
delomg = satrec.omgcof * satrec.t;
delm = satrec.xmcof *
(Math.pow(1.0 + satrec.eta * Math.cos(xmdf), 3) -
satrec.delmo);
temp = delomg + delm;
mm = xmdf + temp;
argpm = argpdf - temp;
t3 = t2 * satrec.t;
t4 = t3 * satrec.t;
tempa = tempa - satrec.d2 * t2 - satrec.d3 * t3 - satrec.d4 * t4;
tempe = tempe + satrec.bstar * satrec.cc5 * (Math.sin(mm) - satrec.sinmao);
templ = templ + satrec.t3cof * t3 + t4 * (satrec.t4cof +
satrec.t * satrec.t5cof);
}
nm = satrec.no;
em = satrec.ecco;
inclm = satrec.inclo;
if (satrec.method === 'd') {
tc = satrec.t;
rets = dspace(satrec.d2201, satrec.d2211, satrec.d3210,
satrec.d3222, satrec.d4410, satrec.d4422,
satrec.d5220, satrec.d5232, satrec.d5421,
satrec.d5433, satrec.dedt, satrec.del1,
satrec.del2, satrec.del3, satrec.didt,
satrec.dmdt, satrec.dnodt, satrec.domdt,
satrec.irez, satrec.argpo, satrec.argpdot, satrec.t,
tc, satrec.gsto, satrec.xfact, satrec.xlamo, satrec.no,
satrec.atime, em, argpm, inclm, satrec.xli, mm,
satrec.xni, nodem, nm);
satrec.atime = rets.shift();
em = rets.shift();
argpm = rets.shift();
inclm = rets.shift();
satrec.xli = rets.shift();
mm = rets.shift();
satrec.xni = rets.shift();
nodem = rets.shift();
dndt = rets.shift();
nm = rets.shift();
} // if method = d
if (nm <= 0.0) {
// fprintf(1,'# error nm //f\n', nm);
satrec.error = 2;
}
am = Math.pow(xke / nm, x2o3) * tempa * tempa;
nm = xke / Math.pow(am, 1.5);
em = em - tempe;
// fix tolerance for error recognition
if ((em >= 1.0) || (em < -0.001) || (am < 0.95)) {
//fprintf(1,'# error em //f\n', em);
satrec.error = 1;
}
// sgp4fix change test condition for eccentricity
if (em < 1.0e-6) {
em = 1.0e-6;
}
mm = mm + satrec.no * templ;
xlm = mm + argpm + nodem;
emsq = em * em;
temp = 1.0 - emsq;
nodem = nodem % twopi;
argpm = argpm % twopi;
xlm = xlm % twopi;
mm = (xlm - argpm - nodem) % twopi;
// /* ----------------- compute extra mean quantities ------------- */
sinim = Math.sin(inclm);
cosim = Math.cos(inclm);
// /* -------------------- add lunar-solar periodics -------------- */
ep = em;
xincp = inclm;
argpp = argpm;
nodep = nodem;
mp = mm;
sinip = sinim;
cosip = cosim;
if (satrec.method === 'd') {
rets = dpper(satrec.e3, satrec.ee2, satrec.peo,
satrec.pgho, satrec.pho, satrec.pinco,
satrec.plo, satrec.se2, satrec.se3,
satrec.sgh2, satrec.sgh3, satrec.sgh4,
satrec.sh2, satrec.sh3, satrec.si2,
satrec.si3, satrec.sl2, satrec.sl3,
satrec.sl4, satrec.t, satrec.xgh2,
satrec.xgh3, satrec.xgh4, satrec.xh2,
satrec.xh3, satrec.xi2, satrec.xi3,
satrec.xl2, satrec.xl3, satrec.xl4,
satrec.zmol, satrec.zmos, satrec.inclo,
satrec.init, ep, xincp, nodep, argpp, mp);
ep = rets.shift();
xincp = rets.shift();
nodep = rets.shift();
argpp = rets.shift();
mp = rets.shift();
if (xincp < 0.0) {
xincp = -xincp;
nodep = nodep + Math.PI;
argpp = argpp - Math.PI;
}
if ((ep < 0.0) || (ep > 1.0)) {
//fprintf(1,'# error ep //f\n', ep);
satrec.error = 3;
}
} // if method = d
// /* -------------------- long period periodics ------------------ */
if (satrec.method === 'd') {
sinip = Math.sin(xincp);
cosip = Math.cos(xincp);
satrec.aycof = -0.5 * j3oj2 * sinip;
// sgp4fix for divide by zero with xinco = 180 deg
if (Math.abs(cosip + 1.0) > 1.5e-12) {
satrec.xlcof = -0.25 * j3oj2 * sinip * (3.0 + 5.0 * cosip) / (1.0 + cosip);
}
else {
satrec.xlcof = -0.25 * j3oj2 * sinip * (3.0 + 5.0 * cosip) / temp4;
}
}
axnl = ep * Math.cos(argpp);
temp = 1.0 / (am * (1.0 - ep * ep));
aynl = ep * Math.sin(argpp) + temp * satrec.aycof;
xl = mp + argpp + nodep + temp * satrec.xlcof * axnl;
// /* --------------------- solve kepler's equation --------------- */
u = (xl - nodep) % twopi;
eo1 = u;
tem5 = 9999.9;
ktr = 1;
// sgp4fix for kepler iteration
// the following iteration needs better limits on corrections
while ((Math.abs(tem5) >= 1.0e-12) && (ktr <= 10)) {
sineo1 = Math.sin(eo1);
coseo1 = Math.cos(eo1);
tem5 = 1.0 - coseo1 * axnl - sineo1 * aynl;
tem5 = (u - aynl * coseo1 + axnl * sineo1 - eo1) / tem5;
if (Math.abs(tem5) >= 0.95) {
if (tem5 > 0.0) {
tem5 = 0.95;
}
else {
tem5 = -0.95;
}
}
eo1 = eo1 + tem5;
ktr = ktr + 1;
}
// /* ------------- short period preliminary quantities ----------- */
ecose = axnl * coseo1 + aynl * sineo1;
esine = axnl * sineo1 - aynl * coseo1;
el2 = axnl * axnl + aynl * aynl;
pl = am * (1.0 - el2);
if (pl < 0.0) {
//fprintf(1,'# error pl //f\n', pl);
satrec.error = 4;
// WTF is this in MATLAB? ';' makes it columnar array
// r = [0;0;0];
// v = [0;0;0];
r = [0, 0, 0];
v = [0, 0, 0];
}
else {
rl = am * (1.0 - ecose);
rdotl = Math.sqrt(am) * esine / rl;
rvdotl = Math.sqrt(pl) / rl;
betal = Math.sqrt(1.0 - el2);
temp = esine / (1.0 + betal);
sinu = am / rl * (sineo1 - aynl - axnl * temp);
cosu = am / rl * (coseo1 - axnl + aynl * temp);
su = Math.atan2(sinu, cosu);
sin2u = (cosu + cosu) * sinu;
cos2u = 1.0 - 2.0 * sinu * sinu;
temp = 1.0 / pl;
temp1 = 0.5 * j2 * temp;
temp2 = temp1 * temp;
// /* -------------- update for short period periodics ------------ */
if (satrec.method === 'd') {
cosisq = cosip * cosip;
satrec.con41 = 3.0 * cosisq - 1.0;
satrec.x1mth2 = 1.0 - cosisq;
satrec.x7thm1 = 7.0 * cosisq - 1.0;
}
mrt = rl * (1.0 - 1.5 * temp2 * betal * satrec.con41) +
0.5 * temp1 * satrec.x1mth2 * cos2u;
su = su - 0.25 * temp2 * satrec.x7thm1 * sin2u;
xnode = nodep + 1.5 * temp2 * cosip * sin2u;
xinc = xincp + 1.5 * temp2 * cosip * sinip * cos2u;
mvt = rdotl - nm * temp1 * satrec.x1mth2 * sin2u / xke;
rvdot = rvdotl + nm * temp1 * (satrec.x1mth2 * cos2u +
1.5 * satrec.con41) / xke;
// /* --------------------- orientation vectors ------------------- */
sinsu = Math.sin(su);
cossu = Math.cos(su);
snod = Math.sin(xnode);
cnod = Math.cos(xnode);
sini = Math.sin(xinc);
cosi = Math.cos(xinc);
xmx = -snod * cosi;
xmy = cnod * cosi;
ux = xmx * sinsu + cnod * cossu;
uy = xmy * sinsu + snod * cossu;
uz = sini * sinsu;
vx = xmx * cossu - cnod * sinsu;
vy = xmy * cossu - snod * sinsu;
vz = sini * cossu;
// /* --------- position and velocity (in km and km/sec) ---------- */
r[0] = (mrt * ux) * radiusearthkm;
r[1] = (mrt * uy) * radiusearthkm;
r[2] = (mrt * uz) * radiusearthkm;
v[0] = (mvt * ux + rvdot * vx) * vkmpersec;
v[1] = (mvt * uy + rvdot * vy) * vkmpersec;
v[2] = (mvt * uz + rvdot * vz) * vkmpersec;
}// if pl > 0
// sgp4fix for decaying satellites
if (mrt < 1.0) {
// printf("# decay condition //11.6f \n",mrt);
satrec.error = 6;
}
return [satrec, r, v];
}
// sgp4init.js
function sgp4init(whichconst, satrec, xbstar, xecco, epoch,
xargpo, xinclo, xmo, xno, xnodeo) {
'use strict';
var gravc, tumin, mu, radiusearthkm, xke, j2, j3, j4, j3oj2,
ss, qzms2t, x2o3, temp4, foo,
ainv, ao, con42, cosio, cosio2, einv, eccsq, omeosq, posq, rp, rteosq, sinio,
sfour, qzms24, perige, pinvsq, tsi, etasq, eeta, psisq, coef, coef1, cc2, cc3,
cosio4, temp1, temp2, temp3, xhdot1, xpidot,
tc, inclm,
dscomvars, sinim, cosim, sinomm, cosomm, snodm, cnodm, day, em, emsq, gam, rtemsq,
s1, s2, s3, s4, s5, s6, s7, ss1, ss2, ss3, ss4, ss5, ss6, ss7,
sz1, sz2, sz3, sz11, sz12, sz13, sz21, sz22, sz23, sz31, sz32, sz33,
nm, z1, z2, z3, z11, z12, z13, z21, z22, z23, z31, z32, z33,
rets,
argpm, nodem, mm,
dndt,
cc1sq, temp,
r, v;
// /* ------------------------ initialization --------------------- */
// /* ----------- set all near earth variables to zero ------------ */
satrec.isimp = 0;
satrec.method = 'n';
satrec.aycof = 0.0;
satrec.con41 = 0.0;
satrec.cc1 = 0.0;
satrec.cc4 = 0.0;
satrec.cc5 = 0.0;
satrec.d2 = 0.0;
satrec.d3 = 0.0;
satrec.d4 = 0.0;
satrec.delmo = 0.0;
satrec.eta = 0.0;
satrec.argpdot = 0.0;
satrec.omgcof = 0.0;
satrec.sinmao = 0.0;
satrec.t = 0.0;
satrec.t2cof = 0.0;
satrec.t3cof = 0.0;
satrec.t4cof = 0.0;
satrec.t5cof = 0.0;
satrec.x1mth2 = 0.0;
satrec.x7thm1 = 0.0;
satrec.mdot = 0.0;
satrec.nodedot = 0.0;
satrec.xlcof = 0.0;
satrec.xmcof = 0.0;
satrec.nodecf = 0.0;
// /* ----------- set all deep space variables to zero ------------ */
satrec.irez = 0;
satrec.d2201 = 0.0;
satrec.d2211 = 0.0;
satrec.d3210 = 0.0;
satrec.d3222 = 0.0;
satrec.d4410 = 0.0;
satrec.d4422 = 0.0;
satrec.d5220 = 0.0;
satrec.d5232 = 0.0;
satrec.d5421 = 0.0;
satrec.d5433 = 0.0;
satrec.dedt = 0.0;
satrec.del1 = 0.0;
satrec.del2 = 0.0;
satrec.del3 = 0.0;
satrec.didt = 0.0;
satrec.dmdt = 0.0;
satrec.dnodt = 0.0;
satrec.domdt = 0.0;
satrec.e3 = 0.0;
satrec.ee2 = 0.0;
satrec.peo = 0.0;
satrec.pgho = 0.0;
satrec.pho = 0.0;
satrec.pinco = 0.0;
satrec.plo = 0.0;
satrec.se2 = 0.0;
satrec.se3 = 0.0;
satrec.sgh2 = 0.0;
satrec.sgh3 = 0.0;
satrec.sgh4 = 0.0;
satrec.sh2 = 0.0;
satrec.sh3 = 0.0;
satrec.si2 = 0.0;
satrec.si3 = 0.0;
satrec.sl2 = 0.0;
satrec.sl3 = 0.0;
satrec.sl4 = 0.0;
satrec.gsto = 0.0;
satrec.xfact = 0.0;
satrec.xgh2 = 0.0;
satrec.xgh3 = 0.0;
satrec.xgh4 = 0.0;
satrec.xh2 = 0.0;
satrec.xh3 = 0.0;
satrec.xi2 = 0.0;
satrec.xi3 = 0.0;
satrec.xl2 = 0.0;
satrec.xl3 = 0.0;
satrec.xl4 = 0.0;
satrec.xlamo = 0.0;
satrec.zmol = 0.0;
satrec.zmos = 0.0;
satrec.atime = 0.0;
satrec.xli = 0.0;
satrec.xni = 0.0;
// sgp4fix - note the following variables are also passed directly via satrec.
// it is possible to streamline the sgp4init call by deleting the "x"
// variables, but the user would need to set the satrec.* values first. we
// include the additional assignment in case twoline2rv is not used.
satrec.bstar = xbstar;
satrec.ecco = xecco;
satrec.argpo = xargpo;
satrec.inclo = xinclo;
satrec.mo = xmo;
satrec.no = xno;
satrec.nodeo = xnodeo;
// /* -------------------- wgs-72 earth constants ----------------- */
// // sgp4fix identify constants and allow alternate values
// [tumin, mu, radiusearthkm, xke, j2, j3, j4, j3oj2] = getgravc( whichconst );
rets = getgravc(whichconst);
tumin = rets.shift();
mu = rets.shift();
radiusearthkm = rets.shift();
xke = rets.shift();
j2 = rets.shift();
j3 = rets.shift();
j4 = rets.shift();
j3oj2 = rets.shift();
ss = 78.0 / radiusearthkm + 1.0;
qzms2t = Math.pow((120.0 - 78.0) / radiusearthkm, 4);
x2o3 = 2.0 / 3.0;
// sgp4fix divisor for divide by zero check on inclination
// the old check used 1.0 + cos(pi-1.0e-9), but then compared it to
// 1.5 e-12, so the threshold was changed to 1.5e-12 for consistancy
temp4 = 1.5e-12;
satrec.init = 'y';
satrec.t = 0.0;
// [ainv, ao, satrec.con41, con42, cosio, cosio2, einv, eccsq,
// satrec.method, omeosq, posq, rp, rteosq, sinio,
// satrec.gsto, satrec.no]
rets = initl(satrec.ecco, epoch, satrec.inclo, satrec.no, satrec.satnum);
ainv = rets.shift();
ao = rets.shift();
satrec.con41 = rets.shift();
con42 = rets.shift();
cosio = rets.shift();
cosio2 = rets.shift();
einv = rets.shift();
eccsq = rets.shift();
satrec.method = rets.shift();
omeosq = rets.shift();
posq = rets.shift();
rp = rets.shift();
rteosq = rets.shift();
sinio = rets.shift();
satrec.gsto = rets.shift();
satrec.no = rets.shift();
satrec.error = 0;
if (rp < 1.0) {
// printf("# *** satn//d epoch elts sub-orbital ***\n" = rets[]; satn);
satrec.error = 5;
}
if ((omeosq >= 0.0) || (satrec.no >= 0.0)) {
satrec.isimp = 0;
if (rp < (220.0 / radiusearthkm + 1.0)) {
satrec.isimp = 1;
}
sfour = ss;
qzms24 = qzms2t;
perige = (rp - 1.0) * radiusearthkm;
// /* - for perigees below 156 km, s and qoms2t are altered - */
if (perige < 156.0) {
sfour = perige - 78.0;
if (perige < 98.0) {
sfour = 20.0;
}
qzms24 = Math.pow((120.0 - sfour) / radiusearthkm, 4.0);
sfour = sfour / radiusearthkm + 1.0;
}
pinvsq = 1.0 / posq;
tsi = 1.0 / (ao - sfour);
satrec.eta = ao * satrec.ecco * tsi;
etasq = satrec.eta * satrec.eta;
eeta = satrec.ecco * satrec.eta;
psisq = Math.abs(1.0 - etasq);
coef = qzms24 * Math.pow(tsi, 4.0);
coef1 = coef / Math.pow(psisq, 3.5);
cc2 = coef1 * satrec.no * (ao * (1.0 + 1.5 * etasq + eeta *
(4.0 + etasq)) + 0.375 * j2 * tsi / psisq * satrec.con41 *
(8.0 + 3.0 * etasq * (8.0 + etasq)));
satrec.cc1 = satrec.bstar * cc2;
cc3 = 0.0;
if (satrec.ecco > 1.0e-4) {
cc3 = -2.0 * coef * tsi * j3oj2 * satrec.no * sinio / satrec.ecco;
}
satrec.x1mth2 = 1.0 - cosio2;
satrec.cc4 = 2.0 * satrec.no * coef1 * ao * omeosq *
(satrec.eta * (2.0 + 0.5 * etasq) + satrec.ecco *
(0.5 + 2.0 * etasq) - j2 * tsi / (ao * psisq) *
(-3.0 * satrec.con41 * (1.0 - 2.0 * eeta + etasq *
(1.5 - 0.5 * eeta)) + 0.75 * satrec.x1mth2 *
(2.0 * etasq - eeta * (1.0 + etasq)) * Math.cos(2.0 * satrec.argpo)));
satrec.cc5 = 2.0 * coef1 * ao * omeosq * (1.0 + 2.75 *
(etasq + eeta) + eeta * etasq);
cosio4 = cosio2 * cosio2;
temp1 = 1.5 * j2 * pinvsq * satrec.no;
temp2 = 0.5 * temp1 * j2 * pinvsq;
temp3 = -0.46875 * j4 * pinvsq * pinvsq * satrec.no;
satrec.mdot = satrec.no + 0.5 * temp1 * rteosq * satrec.con41 +
0.0625 * temp2 * rteosq * (13.0 - 78.0 * cosio2 + 137.0 * cosio4);
satrec.argpdot = -0.5 * temp1 * con42 + 0.0625 * temp2 *
(7.0 - 114.0 * cosio2 + 395.0 * cosio4) +
temp3 * (3.0 - 36.0 * cosio2 + 49.0 * cosio4);
xhdot1 = -temp1 * cosio;
satrec.nodedot = xhdot1 + (0.5 * temp2 * (4.0 - 19.0 * cosio2) +
2.0 * temp3 * (3.0 - 7.0 * cosio2)) * cosio;
xpidot = satrec.argpdot + satrec.nodedot;
satrec.omgcof = satrec.bstar * cc3 * Math.cos(satrec.argpo);
satrec.xmcof = 0.0;
if (satrec.ecco > 1.0e-4) {
satrec.xmcof = -x2o3 * coef * satrec.bstar / eeta;
}
satrec.nodecf = 3.5 * omeosq * xhdot1 * satrec.cc1;
satrec.t2cof = 1.5 * satrec.cc1;
// sgp4fix for divide by zero with xinco = 180 deg
if (Math.abs(cosio + 1.0) > 1.5e-12) {
satrec.xlcof = -0.25 * j3oj2 * sinio *
(3.0 + 5.0 * cosio) / (1.0 + cosio);
}
else {
satrec.xlcof = -0.25 * j3oj2 * sinio *
(3.0 + 5.0 * cosio) / temp4;
}
satrec.aycof = -0.5 * j3oj2 * sinio;
satrec.delmo = Math.pow(1.0 + satrec.eta * Math.cos(satrec.mo), 3);
satrec.sinmao = Math.sin(satrec.mo);
satrec.x7thm1 = 7.0 * cosio2 - 1.0;
// /* --------------- deep space initialization ------------- */
if ((2 * Math.PI / satrec.no) >= 225.0) {
satrec.method = 'd';
satrec.isimp = 1;
tc = 0.0;
inclm = satrec.inclo;
// [sinim,cosim,sinomm,cosomm,snodm,cnodm,day,satrec.e3,satrec.ee2,
// em,emsq,gam,satrec.peo,satrec.pgho,satrec.pho,satrec.pinco,
// satrec.plo,rtemsq,satrec.se2,satrec.se3,satrec.sgh2,
// satrec.sgh3,satrec.sgh4,satrec.sh2,satrec.sh3,satrec.si2,
// satrec.si3,satrec.sl2,satrec.sl3,satrec.sl4,s1,s2,s3,s4,s5,
// s6,s7,ss1,ss2,ss3,ss4,ss5,ss6,ss7,sz1,sz2,sz3,sz11,sz12,
// sz13,sz21,sz22,sz23,sz31,sz32,sz33,satrec.xgh2,satrec.xgh3,
// satrec.xgh4,satrec.xh2,satrec.xh3,satrec.xi2,satrec.xi3,
// satrec.xl2,satrec.xl3,satrec.xl4,nm,z1,z2,z3,z11,z12,z13,
// z21,z22,z23,z31,z32,z33,satrec.zmol,satrec.zmos] =
rets = dscom(epoch, satrec.ecco, satrec.argpo, tc, satrec.inclo,
satrec.nodeo, satrec.no);
sinim = rets.shift();
cosim = rets.shift();
sinomm = rets.shift();
cosomm = rets.shift();
snodm = rets.shift();
cnodm = rets.shift();
day = rets.shift();
satrec.e3 = rets.shift();
satrec.ee2 = rets.shift();
em = rets.shift();
emsq = rets.shift();
gam = rets.shift();
satrec.peo = rets.shift();
satrec.pgho = rets.shift();
satrec.pho = rets.shift();
satrec.pinco = rets.shift();
satrec.plo = rets.shift();
rtemsq = rets.shift();
satrec.se2 = rets.shift();
satrec.se3 = rets.shift();
satrec.sgh2 = rets.shift();
satrec.sgh3 = rets.shift();
satrec.sgh4 = rets.shift();
satrec.sh2 = rets.shift();
satrec.sh3 = rets.shift();
satrec.si2 = rets.shift();
satrec.si3 = rets.shift();
satrec.sl2 = rets.shift();
satrec.sl3 = rets.shift();
satrec.sl4 = rets.shift();
s1 = rets.shift();
s2 = rets.shift();
s3 = rets.shift();
s4 = rets.shift();
s5 = rets.shift();
s6 = rets.shift();
s7 = rets.shift();
ss1 = rets.shift();
ss2 = rets.shift();
ss3 = rets.shift();
ss4 = rets.shift();
ss5 = rets.shift();
ss6 = rets.shift();
ss7 = rets.shift();
sz1 = rets.shift();
sz2 = rets.shift();
sz3 = rets.shift();
sz11 = rets.shift();
sz12 = rets.shift();
sz13 = rets.shift();
sz21 = rets.shift();
sz22 = rets.shift();
sz23 = rets.shift();
sz31 = rets.shift();
sz32 = rets.shift();
sz33 = rets.shift();
satrec.xgh2 = rets.shift();
satrec.xgh3 = rets.shift();
satrec.xgh4 = rets.shift();
satrec.xh2 = rets.shift();
satrec.xh3 = rets.shift();
satrec.xi2 = rets.shift();
satrec.xi3 = rets.shift();
satrec.xl2 = rets.shift();
satrec.xl3 = rets.shift();
satrec.xl4 = rets.shift();
nm = rets.shift();
z1 = rets.shift();
z2 = rets.shift();
z3 = rets.shift();
z11 = rets.shift();
z12 = rets.shift();
z13 = rets.shift();
z21 = rets.shift();
z22 = rets.shift();
z23 = rets.shift();
z31 = rets.shift();
z32 = rets.shift();
z33 = rets.shift();
satrec.zmol = rets.shift();
satrec.zmos = rets.shift();
//[satrec.ecco,satrec.inclo,satrec.nodeo,satrec.argpo,satrec.mo]
rets = dpper(satrec.e3, satrec.ee2, satrec.peo, satrec.pgho,
satrec.pho, satrec.pinco, satrec.plo, satrec.se2, satrec.se3,
satrec.sgh2, satrec.sgh3, satrec.sgh4, satrec.sh2, satrec.sh3,
satrec.si2, satrec.si3, satrec.sl2, satrec.sl3, satrec.sl4,
satrec.t, satrec.xgh2, satrec.xgh3, satrec.xgh4, satrec.xh2,
satrec.xh3, satrec.xi2, satrec.xi3, satrec.xl2, satrec.xl3,
satrec.xl4, satrec.zmol, satrec.zmos, inclm, satrec.init,
satrec.ecco, satrec.inclo, satrec.nodeo, satrec.argpo, satrec.mo);
satrec.ecco = rets.shift();
satrec.inclo = rets.shift();
satrec.nodeo = rets.shift();
satrec.argpo = rets.shift();
satrec.mo = rets.shift();
argpm = 0.0;
nodem = 0.0;
mm = 0.0;
// [em,argpm,inclm,mm,nm,nodem,satrec.irez,satrec.atime,
// satrec.d2201,satrec.d2211,satrec.d3210,satrec.d3222,
// satrec.d4410,satrec.d4422,satrec.d5220,satrec.d5232,
// satrec.d5421,satrec.d5433,satrec.dedt,satrec.didt,
// satrec.dmdt,dndt,satrec.dnodt,satrec.domdt,satrec.del1,
// satrec.del2,satrec.del3,
// //ses,sghl,sghs,sgs,shl,shs,sis,sls,theta,
// satrec.xfact,satrec.xlamo,satrec.xli,satrec.xni]
rets = dsinit(cosim, emsq, satrec.argpo, s1, s2, s3, s4, s5, sinim, ss1, ss2, ss3,
ss4, ss5, sz1, sz3, sz11, sz13, sz21, sz23, sz31, sz33, satrec.t, tc,
satrec.gsto, satrec.mo, satrec.mdot, satrec.no, satrec.nodeo,
satrec.nodedot, xpidot, z1, z3, z11, z13, z21, z23, z31, z33, em,
argpm, inclm, mm, nm, nodem, satrec.ecco, eccsq);
em = rets.shift();
argpm = rets.shift();
inclm = rets.shift();
mm = rets.shift();
nm = rets.shift();
nodem = rets.shift();
satrec.irez = rets.shift();
satrec.atime = rets.shift();
satrec.d2201 = rets.shift();
satrec.d2211 = rets.shift();
satrec.d3210 = rets.shift();
satrec.d3222 = rets.shift();
satrec.d4410 = rets.shift();
satrec.d4422 = rets.shift();
satrec.d5220 = rets.shift();
satrec.d5232 = rets.shift();
satrec.d5421 = rets.shift();
satrec.d5433 = rets.shift();
satrec.dedt = rets.shift();
satrec.didt = rets.shift();
satrec.dmdt = rets.shift();
dndt = rets.shift();
satrec.dnodt = rets.shift();
satrec.domdt = rets.shift();
satrec.del1 = rets.shift();
satrec.del2 = rets.shift();
satrec.del3 = rets.shift();
//ses,sghl,sghs,sgs,shl,shs,sis,sls,theta,
satrec.xfact = rets.shift();
satrec.xlamo = rets.shift();
satrec.xli = rets.shift();
satrec.xni = rets.shift();
}
// /* ----------- set variables if not deep space ----------- */
if (satrec.isimp !== 1) {
cc1sq = satrec.cc1 * satrec.cc1;
satrec.d2 = 4.0 * ao * tsi * cc1sq;
temp = satrec.d2 * tsi * satrec.cc1 / 3.0;
satrec.d3 = (17.0 * ao + sfour) * temp;
satrec.d4 = 0.5 * temp * ao * tsi *
(221.0 * ao + 31.0 * sfour) * satrec.cc1;
satrec.t3cof = satrec.d2 + 2.0 * cc1sq;
satrec.t4cof = 0.25 * (3.0 * satrec.d3 + satrec.cc1 *
(12.0 * satrec.d2 + 10.0 * cc1sq));
satrec.t5cof = 0.2 * (3.0 * satrec.d4 +
12.0 * satrec.cc1 * satrec.d3 +
6.0 * satrec.d2 * satrec.d2 +
15.0 * cc1sq * (2.0 * satrec.d2 + cc1sq));
}
} // if omeosq = 0
// /* finally propogate to zero epoch to initialise all others. */
if (satrec.error === 0) {
rets = sgp4(satrec, 0.0);
satrec = rets.shift();
r = rets.shift();
v = rets.shift();
}
satrec.init = 'n';
return satrec; // MATLAB returns an unnecessary list "[satrec]", don't do it here
}
// sprintf.js
/**
sprintf() for JavaScript 0.7-beta1
http://www.diveintojavascript.com/projects/javascript-sprintf
Copyright (c) Alexandru Marasteanu
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* 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.
* Neither the name of sprintf() for JavaScript nor the
names of its contributors may 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 Alexandru Marasteanu 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.
Changelog:
2010.09.06 - 0.7-beta1
- features: vsprintf, support for named placeholders
- enhancements: format cache, reduced global namespace pollution
2010.05.22 - 0.6:
- reverted to 0.4 and fixed the bug regarding the sign of the number 0
Note:
Thanks to Raphael Pigulla (http://www.n3rd.org/)
who warned me about a bug in 0.5, I discovered that the last update was
a regress. I appologize for that.
2010.05.09 - 0.5:
- bug fix: 0 is now preceeded with a + sign
- bug fix: the sign was not at the right position on padded results (Kamal Abdali)
- switched from GPL to BSD license
2007.10.21 - 0.4:
- unit test and patch (David Baird)
2007.09.17 - 0.3:
- bug fix: no longer throws exception on empty paramenters (Hans Pufal)
2007.09.11 - 0.2:
- feature: added argument swapping
2007.04.03 - 0.1:
- initial release
**/
var sprintf = (function () {
'use strict';
function getType(variable) {
return Object.prototype.toString.call(variable).slice(8, -1).toLowerCase();
}
function strRepeat(input, multiplier) {
for (var output = []; multiplier > 0; output[--multiplier] = input) {/* do nothing */}
return output.join('');
}
var strFormat = function () {
if (!strFormat.cache.hasOwnProperty(arguments[0])) {
strFormat.cache[arguments[0]] = strFormat.parse(arguments[0]);
}
return strFormat.format.call(null, strFormat.cache[arguments[0]], arguments);
};
strFormat.format = function (parseTree, argv) {
var cursor = 1, treeLength = parseTree.length,
nodeType = '',
arg,
output = [],
i,
k,
match,
pad,
padCharacter,
padLength;
for (i = 0; i < treeLength; i++) {
nodeType = getType(parseTree[i]);
if (nodeType === 'string') {
output.push(parseTree[i]);
}
else if (nodeType === 'array') {
match = parseTree[i]; // convenience purposes only
if (match[2]) { // keyword argument
arg = argv[cursor];
for (k = 0; k < match[2].length; k++) {
if (!arg.hasOwnProperty(match[2][k])) {
throw (sprintf('[sprintf] property "%s" does not exist', match[2][k]));
}
arg = arg[match[2][k]];
}
}
else if (match[1]) { // positional argument (explicit)
arg = argv[match[1]];
}
else { // positional argument (implicit)
arg = argv[cursor++];
}
if (/[^s]/.test(match[8]) && (getType(arg) !== 'number')) {
throw (sprintf('[sprintf] expecting number but found %s', getType(arg)));
}
switch (match[8]) {
case 'b':
arg = arg.toString(2);
break;
case 'c':
arg = String.fromCharCode(arg);
break;
case 'd':
arg = parseInt(arg, 10);
break;
case 'e':
arg = match[7] ? arg.toExponential(match[7]) : arg.toExponential();
break;
case 'f':
arg = match[7] ? parseFloat(arg).toFixed(match[7]) : parseFloat(arg);
break;
case 'o':
arg = arg.toString(8);
break;
case 's':
arg = ((arg = String(arg)) && match[7] ? arg.substring(0, match[7]) : arg);
break;
case 'u':
arg = Math.abs(arg);
break;
case 'x':
arg = arg.toString(16);
break;
case 'X':
arg = arg.toString(16).toUpperCase();
break;
}
arg = (/[def]/.test(match[8]) && match[3] && arg >= 0 ? '+' + arg : arg);
padCharacter = match[4] ? match[4] === '0' ? '0' : match[4].charAt(1) : ' ';
padLength = match[6] - String(arg).length;
pad = match[6] ? strRepeat(padCharacter, padLength) : '';
output.push(match[5] ? arg + pad : pad + arg);
}
}
return output.join('');
};
strFormat.cache = {};
strFormat.parse = function (fmt) {
var _fmt = fmt, match = [], parseTree = [], argNames = 0;
while (_fmt) {
if ((match = /^[^\x25]+/.exec(_fmt)) !== null) {
parseTree.push(match[0]);
}
else if ((match = /^\x25{2}/.exec(_fmt)) !== null) {
parseTree.push('%');
}
else if ((match = /^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(_fmt)) !== null) {
if (match[2]) {
argNames |= 1;
var fieldList = [], replacementField = match[2], fieldMatch = [];
if ((fieldMatch = /^([a-z_][a-z_\d]*)/i.exec(replacementField)) !== null) {
fieldList.push(fieldMatch[1]);
while ((replacementField = replacementField.substring(fieldMatch[0].length)) !== '') {
if ((fieldMatch = /^\.([a-z_][a-z_\d]*)/i.exec(replacementField)) !== null) {
fieldList.push(fieldMatch[1]);
}
else if ((fieldMatch = /^\[(\d+)\]/.exec(replacementField)) !== null) {
fieldList.push(fieldMatch[1]);
}
else {
throw ('[sprintf] huh?');
}
}
}
else {
throw ('[sprintf] huh?');
}
match[2] = fieldList;
}
else {
argNames |= 2;
}
if (argNames === 3) {
throw ('[sprintf] mixing positional and named placeholders is not (yet) supported');
}
parseTree.push(match);
}
else {
throw ('[sprintf] huh?');
}
_fmt = _fmt.substring(match[0].length);
}
return parseTree;
};
return strFormat;
})();
var vsprintf = function (fmt, argv) {
'use strict';
argv.unshift(fmt);
return sprintf.apply(null, argv);
};
// testmat.js
function handleFileSelect(evt) {
'use strict';
var files = evt.target.files, // FileList object
i, reader;
for (var i = 0, f; f = files[i]; i++) {
var reader = new FileReader();
// Closure to capture the file info
reader.onload = (function (theFile) { // theFile is unused(?)
return function (e) {
document.getElementById('tle-lines').value = e.target.result;
};
})(f);
reader.readAsText(f); // Read in the file as text
} // for file...
} // function
function getTLELines(htmlId) {
'use strict';
// use like: for (var i = 0; i < lines.length; i++) { alert(lines[i]); }
var
lines,
TLELines = document.getElementById(htmlId).textContent;
if (document.all) { // IE
return TLELines.split('\r\n');
}
else { //Mozilla
return TLELines.split('\n');
}
}
// We should probably take some input and return output
// so that the QUnit test runner can validate results.
function testmat() {
'use strict';
var USE_GLOBAL_opsmode = 'NO opsmode', // from verify procedure: improved mode
typerun = 'NO typerun', // from verify procedure: verify
typeinput = 'NO typeinput', // only if typerun is NOT 'm'
whichconst = 'NO whichconst', // from verify procedure: ???
infilename = 'OMFG WE DON\'T HAVE AN infilename',
rets, tumin, mu, radiusearthkm, xke, j2, j3, j4, j3oj2,
rad = 180.0 / Math.PI,
infile,
idebug = true, // enable debug output
longstr1, longstr2, fgets, // TODO matlab TLE file reader
catno,
satrec, startmfe, stopmfe, deltamin,
ro, vo,
tsince,
jd, year, mon, day, hr, minute, sec,
p, a, ecc, incl, node, argp, nu, m, arglat, truelon, lonper,
i,
TLELines,
startTime, satTime, totalTime;
TLELines = getTLELines('tle-lines');
// add operation smode for afspc (a) or improved (i)
opsmode = input('opsmode'); //'input opsmode afspc a, improved i ', 's');
//typerun = 'c' compare 1 year of full satcat data
//typerun = 'v' verification run, requires modified elm file with
//typerun = 'm' maunual operation- either mfe, epoch, or dayof yr
// start stop and delta times
typerun = input('typerun'); //'input type of run c, v, m: ', 's');
if (typerun === 'm') {
typeinput = input('typeinput'); //'input mfe, epoch (YMDHMS), or dayofyr approach, m,e,d: ', 's');
}
else {
typeinput = 'e';
}
whichconst = parseInt(input('whichconst'), 10); //'input constants 721, 72, 84 ');
//alert("testmat.js opsmode=" + opsmode + " typerun=" + typerun + " typeinput=" + typeinput + " whichconst=" + whichconst + "infile=" + infile);
// CSHENTON: I don't see how this function can operate without
// instantiating from getgravc(whichconst) we need mu and others below
rets = getgravc(whichconst);
tumin = rets.shift();
mu = rets.shift();
radiusearthkm = rets.shift();
xke = rets.shift();
j2 = rets.shift();
j3 = rets.shift();
j4 = rets.shift();
j3oj2 = rets.shift();
// ---------------- setup files for operation ------------------
// input 2-line element set file
// infilename = input('input elset filename: ', 's');
// infile = fopen(infilename, 'r');
// if (infile === -1) {
// fprintf(1, 'Failed to open file: //s\n', infilename);
// return;
// }
// if (typerun === 'c') {
// outfile = fopen('tmatall.out', 'wt');
// }
// else {
// if (typerun === 'v') {
// outfile = fopen('tmatver.out', 'wt');
// }
// else {
// outfile = fopen('tmat.out', 'wt');
// }
// }
// TLE file format repeats 3-line sets like:
//# # TEME example
//1 00005U 58002B 00179.78495062 .00000023 00000-0 28098-4 0 4753
//2 00005 34.2682 348.7242 1859667 331.7664 19.3264 10.82419157413667 0.00 4320.0 360.00
// ----------------- test simple propagation -------------------
startTime = new Date(); // overall run time
for (i = 0; i < TLELines.length; i += 1) {
satTime = new Date(); // time for each satelite (depends of course on period requested)
TLELines[i] = TLELines[i].trim();
if (TLELines[i] === '' || TLELines[i][0] === '#') {
continue;
}
else { // DANGER doesn't tolerate comments between TLE line 1 and 2
longstr1 = TLELines[i];
i += 1;
longstr2 = TLELines[i];
i += 1; // BUG I think this should not be here
}
// convert the char string to sgp4 elements
// includes initialization of sgp4
//[satrec, startmfe, stopmfe, deltamin] = twoline2rv(whichconst,
// longstr1, longstr2, typerun, typeinput);
rets = twoline2rv(whichconst, longstr1, longstr2, typerun, typeinput);
satrec = rets.shift();
startmfe = rets.shift();
stopmfe = rets.shift();
deltamin = rets.shift();
outfile(sprintf('\n %d xx\n', satrec.satnum));
fprintf1(sprintf(' %d\n', satrec.satnum));
// call the propagator to get the initial state vector value
//[satrec, ro ,vo] = sgp4 (satrec, 0.0);
rets = sgp4(satrec, 0.0);
satrec = rets.shift();
ro = rets.shift();
vo = rets.shift();
outfile(sprintf(' %16.8f %16.8f %16.8f %16.8f %12.9f %12.9f %12.9f\n',
satrec.t, ro[0], ro[1], ro[2], vo[0], vo[1], vo[2])); // MIG offsets shifted
// Why don't we print ymdhms or a,ecc,*rad as we do during the time intervals below?
//fprintf1(' %16.8f %16.8f %16.8f %16.8f %12.9f %12.9f %12.9f\n',...
// satrec.t,ro(1),ro(2),ro(3),vo(1),vo(2),vo(3));
tsince = startmfe;
// check so the first value isn't written twice
if (Math.abs(tsince) > 1.0e-8) {
tsince = tsince - deltamin;
}
// loop to perform the propagation
while ((tsince < stopmfe) && (satrec.error === 0)) {
tsince = tsince + deltamin;
if (tsince > stopmfe) {
tsince = stopmfe;
}
//[satrec, ro, vo] = sgp4(satrec, tsince);
rets = sgp4(satrec, tsince);
satrec = rets.shift();
ro = rets.shift();
vo = rets.shift();
if (satrec.error > 0) {
fprintf1(sprintf('# *** error: tsince=%f *** code=%d (satnum=%d)\n',
tsince, satrec.error, satrec.satnum));
}
if (satrec.error === 0) {
if ((typerun !== 'v') && (typerun !== 'c')) {
jd = satrec.jdsatepoch + tsince / 1440; // 24 hours/day * 60 minutes/hour = 1440 minutes/day
//[year,mon,day,hr,minute,sec] = invjday(jd);
rets = invjday(jd);
year = rets.shift();
mon = rets.shift();
day = rets.shift();
hr = rets.shift();
minute = rets.shift();
sec = rets.shift();
outfile(sprintf(' %16.8f %16.8f %16.8f %16.8f %12.9f %12.9f %12.9f %5i%3i%3i %2i:%2i:%9.6f %16.8f%16.8f%16.8%12.9f%12.9f%12.9f\n',
tsince, ro[0], ro[1], ro[2], vo[0], vo[1], vo[2],
year, mon, day, hr, minute, sec));
}
else {
outfile(sprintf(' %16.8f %16.8f %16.8f %16.8f %12.9f %12.9f %12.9f',
tsince, ro[0], ro[1], ro[2], vo[0], vo[1], vo[2]));
// fprintf1(' %16.8f %16.8f %16.8f %16.8f %12.9f %12.9f %12.9f',
// tsince, ro[0], ro[1], ro[2], vo[0], vo[1], vo[2]);
//[p,a,ecc,incl,node,argp,nu,m,arglat,truelon,lonper ] = rv2coe(ro, vo, mu);
rets = rv2coe(ro, vo, mu);
p = rets.shift();
a = rets.shift();
ecc = rets.shift();
incl = rets.shift();
node = rets.shift();
argp = rets.shift();
nu = rets.shift();
m = rets.shift();
arglat = rets.shift();
truelon = rets.shift();
lonper = rets.shift();
outfile(sprintf(' %14.6f %8.6f %10.5f %10.5f %10.5f %10.5f %10.5f\n',
a, ecc, incl * rad, node * rad, argp * rad, nu * rad, m * rad));
}
} // if satrec.error == 0
} // while propagating the orbit
debug('satnum=' + satrec.satnum +
' time=' + (new Date() - satTime) + 'ms' +
' ellapsed time=' + (new Date() - startTime) + 'ms');
} // if not eof
// window.onload = testmat();
// TODO: return results of test?
}
// twoline2rv.js
var xke, j2; // HACK: GLOBALS to pass to initl()
function twoline2rv(whichconst, longstr1, longstr2, typerun, typeinput) {
'use strict';
var rets = getgravc(whichconst),
tumin = rets.shift(),
mu = rets.shift(),
radiusearthkm = rets.shift(),
LOCAL_xke = rets.shift(),
LOCAL_j2 = rets.shift(),
j3 = rets.shift(),
j4 = rets.shift(),
j3oj2 = rets.shift(),
deg2rad = Math.PI / 180.0, // 0.01745329251994330 [deg/rad]
xpdotp = 1440.0 / (2.0 * Math.PI), // 229.1831180523293 [rev/day]/[rad/min]
satrec = {},
revnum = 0,
elnum = 0,
year = 0,
j,
carnumb, classification, intldesg, nexp, ibexp, numb,
cardnumb, startmfe, stopmfe, deltamin,
mon, day, hr, minute, sec,
startyear, startmon, startday, starthr, startmin, startsec, jdstart,
stopyear, stopmon, stopday, stophr, stopmin, stopsec, jdstop,
startdayofyr, stopdayofyr,
sgp4epoch;
// Set globals to pass to initl() [vomit]
xke = LOCAL_xke;
j2 = LOCAL_j2;
// global tumin radiusearthkm xke j2 j3 j4 j3oj2
// Get these via getgravc() OR from caller's globals.
// [tumin, mu, radiusearthkm, xke, j2, j3, j4, j3oj2] = getgravc(whichconst);
if (typeof tumin === 'undefined') {
throw new Error('Global "tumin" is undefined');
}
if (typeof radiusearthkm === 'undefined') {
throw new Error('Global "radiusearthkm" is undefined');
}
if (typeof xke === 'undefined') {
throw new Error('Global "xke" is undefined');
}
if (typeof j2 === 'undefined') {
throw new Error('Global "j2" is undefined');
}
if (typeof j3 === 'undefined') {
throw new Error('Global "j3" is undefined');
}
if (typeof j4 === 'undefined') {
throw new Error('Global "j4" is undefined');
}
if (typeof j3oj2 === 'undefined') {
throw new Error('Global "j3oj2" is undefined');
}
satrec.error = 0;
// JavaScript's strings are immutable strings, so convert to
// mutable array, munge, then convert back to strings.
longstr1 = longstr1.split('');
longstr2 = longstr2.split('');
// set the implied decimal points since doing a formated read
// fixes for bad input data values (missing, ...)
for (j = 10; j <= 15; j += 1) { //"8002B " -> "8002B_"
if (longstr1[j] === ' ') {
longstr1[j] = '_';
}
}
if (longstr1[44] !== ' ') {
longstr1[43] = longstr1[44];
}
longstr1[44] = '.';
if (longstr1[7] === ' ') {
longstr1[7] = 'U';
}
if (longstr1[9] === ' ') {
longstr1[9] = '.';
}
for (j = 45; j <= 49; j += 1) {
if (longstr1[j] === ' ') {
longstr1[j] = '0';
}
}
if (longstr1[51] === ' ') {
longstr1[51] = '0';
}
if (longstr1[53] !== ' ') {
longstr1[52] = longstr1[53];
}
longstr1[53] = '.';
if (longstr1[62] === ' ') {
longstr1[62] = '0';
}
if ((longstr1.length < 68) || (longstr1[67] === ' ')) {
longstr1[67] = '0';
}
longstr2[25] = '.';
for (j = 26; j <= 32; j += 1) {
if (longstr2[j] === ' ') {
longstr2[j] = '0';
}
}
longstr1 = longstr1.join('');
longstr2 = longstr2.join('');
//00000000001111111111222222222233333333334444444444555555555566666666667777777777888888888899999999990000000000
//01234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
//1 00005U 58002B 00179.78495062 .00000023 00000-0 28098-4 0 4753
//2 00005 34.2682 348.7242 1859667 331.7664 19.3264 10.82419157413667 0.00 4320.0 360.00
// parse first line
carnumb = parseFloat(longstr1[0]); // caution: 'cardnum' in second line
satrec.satnum = parseFloat(longstr1.slice(2, 7));
classification = longstr1[7]; // "U"
intldesg = longstr1.slice(9, 17);
satrec.epochyr = parseFloat(longstr1.slice(18, 20)); // ??
satrec.epochdays = parseFloat(longstr1.slice(20, 32));
satrec.ndot = parseFloat(longstr1.slice(33, 43));
satrec.nddot = parseFloat(longstr1.slice(43, 50));
nexp = parseFloat(longstr1.slice(50, 52));
satrec.bstar = parseFloat(longstr1.slice(52, 59));
ibexp = parseFloat(longstr1.slice(59, 61));
numb = parseFloat(longstr1.slice(62, 63));
elnum = parseFloat(longstr1.slice(64, 68));
// parse second line
if (typerun === 'v') {
cardnumb = parseFloat(longstr2.slice(0, 1));
satrec.satnum = parseFloat(longstr2.slice(2, 7));
satrec.inclo = parseFloat(longstr2.slice(7, 16));
satrec.nodeo = parseFloat(longstr2.slice(16, 25));
satrec.ecco = parseFloat(longstr2.slice(25, 33));
satrec.argpo = parseFloat(longstr2.slice(33, 42));
satrec.mo = parseFloat(longstr2.slice(42, 51));
satrec.no = parseFloat(longstr2.slice(51, 63));
revnum = parseFloat(longstr2.slice(63, 68));
startmfe = parseFloat(longstr2.slice(69, 81)); // only for 'v'
stopmfe = parseFloat(longstr2.slice(82, 96)); // only for 'v'
deltamin = parseFloat(longstr2.slice(96, 105)); // only for 'v'
} else {
cardnumb = parseFloat(longstr2.slice(0, 1));
satrec.satnum = parseFloat(longstr2.slice(2, 7));
satrec.inclo = parseFloat(longstr2.slice(7, 16));
satrec.nodeo = parseFloat(longstr2.slice(16, 25));
satrec.ecco = parseFloat(longstr2.slice(25, 33));
satrec.argpo = parseFloat(longstr2.slice(33, 42));
satrec.mo = parseFloat(longstr2.slice(42, 51));
satrec.no = parseFloat(longstr2.slice(51, 63));
revnum = parseFloat(longstr2.slice(63, 68));
}
// ---- find no, ndot, nddot ----
satrec.no = satrec.no / xpdotp; ////* rad/min
satrec.nddot = satrec.nddot * Math.pow(10.0, nexp);
satrec.bstar = satrec.bstar * Math.pow(10.0, ibexp);
// ---- convert to sgp4 units ----
satrec.a = Math.pow(satrec.no * tumin, -2 / 3); // [er]
satrec.ndot = satrec.ndot / (xpdotp * 1440.0); // [rad/min^2]
satrec.nddot = satrec.nddot / (xpdotp * 1440.0 * 1440); // [rad/min^3]
// ---- find standard orbital elements ----
satrec.inclo = satrec.inclo * deg2rad;
satrec.nodeo = satrec.nodeo * deg2rad;
satrec.argpo = satrec.argpo * deg2rad;
satrec.mo = satrec.mo * deg2rad;
satrec.alta = satrec.a * (1.0 + satrec.ecco) - 1.0;
satrec.altp = satrec.a * (1.0 - satrec.ecco) - 1.0;
// ----------------------------------------------------------------
// find sgp4epoch time of element set
// remember that sgp4 uses units of days from 0 jan 1950 (sgp4epoch)
// and minutes from the epoch (time)
// --------------------------------------------------------------
// ------------- temp fix for years from 1957-2056 ----------------
// ------ correct fix will occur when year is 4-digit in 2le ------
if (satrec.epochyr < 57) {
year = satrec.epochyr + 2000;
} else {
year = satrec.epochyr + 1900;
}
//[mon,day,hr,minute,sec] = days2mdh(year, satrec.epochdays);
rets = days2mdh(year, satrec.epochdays);
mon = rets.shift();
day = rets.shift();
hr = rets.shift();
minute = rets.shift();
sec = rets.shift();
satrec.jdsatepoch = jday(year, mon, day, hr, minute, sec);
// input start stop times manually
if ((typerun !== 'v') && (typerun !== 'c')) {
// ------------- enter start/stop ymd hms values --------------------
if (typeinput === 'e') {
startyear = input('input start year');
startmon = input('input start mon');
startday = input('input start day');
starthr = input('input start hr');
startmin = input('input start min');
startsec = input('input start sec');
jdstart = jday(startyear, startmon, startday, starthr, startmin, startsec);
stopyear = input('input stop year');
stopmon = input('input stop mon');
stopday = input('input stop day');
stophr = input('input stop hr');
stopmin = input('input stop min');
stopsec = input('input stop sec');
jdstop = jday(stopyear, stopmon, stopday, stophr, stopmin, stopsec);
startmfe = (jdstart - satrec.jdsatepoch) * 1440.0;
stopmfe = (jdstop - satrec.jdsatepoch) * 1440.0;
deltamin = input('input time step in minutes ');
}
// -------- enter start/stop year and days of year values -----------
if (typeinput === 'd') {
startyear = input('input start year');
startdayofyr = input('input start dayofyr');
stopyear = input('input stop year');
stopdayofyr = input('input stop dayofyr');
//[mon, day, hr, minute, sec] = days2mdh ( startyear, startdayofyr);
rets = days2mdh(startyear, startdayofyr);
mon = rets.shift();
day = rets.shift();
hr = rets.shift();
minute = rets.shift();
sec = rets.shift();
jdstart = jday(startyear, mon, day, hr, minute, sec);
//[mon, day, hr, minute, sec] = days2mdh ( stopyear, stopdayofyr);
rets = days2mdh(stopyear, stopdayofyr);
mon = rets.shift();
day = rets.shift();
hr = rets.shift();
minute = rets.shift();
sec = rets.shift();
jdstop = jday(stopyear, mon, day, hr, minute, sec);
startmfe = (jdstart - satrec.jdsatepoch) * 1440.0;
stopmfe = (jdstop - satrec.jdsatepoch) * 1440.0;
deltamin = input('input time step in minutes ');
}
// ------------------ enter start/stop mfe values -------------------
if (typeinput === 'm') {
startmfe = input('input start mfe: ');
stopmfe = input('input stop mfe: ');
deltamin = input('input time step in minutes: ');
}
if (typeinput === 'n') { // HACK: 'now', from cesiumtry
var now = new Date();
jdstart = jday(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDay(),
now.getUTCHours(), now.getUTCMinutes(), now.getUTCSeconds());
jdstop = jday(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDay(),
now.getUTCHours(), now.getUTCMinutes(), (now.getUTCSeconds() + 1) % 60); // more than jdstart
startmfe = (jdstart - satrec.jdsatepoch) * 1440.0;
stopmfe = (jdstop - satrec.jdsatepoch) * 1440.0;
deltamin = 60; // minutes, we shouldn't need this
// Why is startmfe negative??
// satrec.jdsatepoch=2456195.79713419
// jdstart =2456156.1898611113
// Perhaps based on typerun==c use delta of ... 1?
startmfe = 0.0;
stopmfe = 1.0;
}
}
// // perform complete catalog evaluation
if (typerun === 'c') {
startmfe = -1440.0;
stopmfe = 1440.0;
deltamin = 20.0;
}
// ------------- initialize the orbit at sgp4epoch --------------
sgp4epoch = satrec.jdsatepoch - 2433281.5; // days since 0 Jan 1950
satrec = sgp4init(whichconst, satrec, satrec.bstar, satrec.ecco, sgp4epoch,
satrec.argpo, satrec.inclo, satrec.mo, satrec.no, satrec.nodeo);
return [satrec, startmfe, stopmfe, deltamin];
}
// tle.js
// Get, parse, and return TLE structures
var tle = {
// I need to get a grip on proper OO patterns :-(
content : null,
lines : null,
tles : null,
readFile : function (fileName) {
// https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest
var request = new XMLHttpRequest();
var ASYNC = false; // TODO do async callback properly
request.open('GET', fileName, ASYNC);
request.send(); // blocks until returned due to ASYNC=false
if (request.status !== 200) {
return null; // TODO throw an error
}
this.content = request.responseText;
return this.content;
},
readFileLines : function (fileName) {
this.readFile(fileName);
this.lines = this.content.split('\n');
return this.lines;
},
parseFile : function (fileName) {
// Read file: if line starts with '1' or '2' assume TLE line 1, 2, otherwise store as comment/name
var lines = this.readFileLines(fileName);
var line;
var tle = [];
var tles = [];
for (linenum = 0; linenum < lines.length; linenum++) {
if (lines[linenum].substring(0, 2) === '1 ') {
tle[1] = lines[linenum];
}
else if (lines[linenum].substring(0, 2) === '2 ') {
tle[2] = lines[linenum];
tles.push(tle);
tle = [];
}
else {
tle[0] = lines[linenum]; // TODO: trim whitespace
}
}
this.tles = tles;
return tles;
}
};