xgis-label3d 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/worker-labelpoint-DTlZA9yt.js +1620 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1 -0
- package/dist/layer/LabelGeojsonLayer.d.ts +35 -0
- package/dist/layer/LabelLayer.d.ts +19 -0
- package/dist/layer/LabelLayerManager.d.ts +14 -0
- package/dist/layer/LabelMassiveLayer.d.ts +66 -0
- package/dist/layer/VtAnnoStyle.d.ts +173 -0
- package/dist/layer/index.d.ts +5 -0
- package/dist/workers/index.d.ts +2 -0
- package/dist/workers/worker-labelpoint.d.ts +92 -0
- package/package.json +45 -0
|
@@ -0,0 +1,1620 @@
|
|
|
1
|
+
var e = Object.create, t = Object.defineProperty, r = Object.getOwnPropertyDescriptor, n = Object.getOwnPropertyNames, o = Object.getPrototypeOf, i = Object.prototype.hasOwnProperty;
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright 2019 Google LLC
|
|
5
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
6
|
+
*/ const s = Symbol("Comlink.proxy"), a = Symbol("Comlink.endpoint"), l = Symbol("Comlink.releaseProxy"), f = Symbol("Comlink.finalizer"), c = Symbol("Comlink.thrown"), u = (e) => "object" == typeof e && null !== e || "function" == typeof e, h = new Map([["proxy", {
|
|
7
|
+
canHandle: (e) => u(e) && e[s],
|
|
8
|
+
serialize(e) {
|
|
9
|
+
const { port1: t, port2: r } = new MessageChannel();
|
|
10
|
+
return m(e, t), [r, [r]];
|
|
11
|
+
},
|
|
12
|
+
deserialize: (e) => (e.start(), function(e) {
|
|
13
|
+
const t = /* @__PURE__ */ new Map();
|
|
14
|
+
return e.addEventListener("message", function(e) {
|
|
15
|
+
const { data: r } = e;
|
|
16
|
+
if (!r || !r.id) return;
|
|
17
|
+
const n = t.get(r.id);
|
|
18
|
+
if (n) try {
|
|
19
|
+
n(r);
|
|
20
|
+
} finally {
|
|
21
|
+
t.delete(r.id);
|
|
22
|
+
}
|
|
23
|
+
}), O(e, t, [], void 0);
|
|
24
|
+
}(e))
|
|
25
|
+
}], ["throw", {
|
|
26
|
+
canHandle: (e) => u(e) && c in e,
|
|
27
|
+
serialize({ value: e }) {
|
|
28
|
+
let t;
|
|
29
|
+
return t = e instanceof Error ? {
|
|
30
|
+
isError: !0,
|
|
31
|
+
value: {
|
|
32
|
+
message: e.message,
|
|
33
|
+
name: e.name,
|
|
34
|
+
stack: e.stack
|
|
35
|
+
}
|
|
36
|
+
} : {
|
|
37
|
+
isError: !1,
|
|
38
|
+
value: e
|
|
39
|
+
}, [t, []];
|
|
40
|
+
},
|
|
41
|
+
deserialize(e) {
|
|
42
|
+
if (e.isError) throw Object.assign(new Error(e.value.message), e.value);
|
|
43
|
+
throw e.value;
|
|
44
|
+
}
|
|
45
|
+
}]]);
|
|
46
|
+
function m(e, t = globalThis, r = ["*"]) {
|
|
47
|
+
t.addEventListener("message", function n(o) {
|
|
48
|
+
if (!o || !o.data) return;
|
|
49
|
+
if (!function(e, t) {
|
|
50
|
+
for (const r of e) {
|
|
51
|
+
if (t === r || "*" === r) return !0;
|
|
52
|
+
if (r instanceof RegExp && r.test(t)) return !0;
|
|
53
|
+
}
|
|
54
|
+
return !1;
|
|
55
|
+
}(r, o.origin)) return void console.warn(`Invalid origin '${o.origin}' for comlink proxy`);
|
|
56
|
+
const { id: i, type: a, path: l } = Object.assign({ path: [] }, o.data), u = (o.data.argumentList || []).map(S);
|
|
57
|
+
let h;
|
|
58
|
+
try {
|
|
59
|
+
const t = l.slice(0, -1).reduce((e, t) => e[t], e), r = l.reduce((e, t) => e[t], e);
|
|
60
|
+
switch (a) {
|
|
61
|
+
case "GET":
|
|
62
|
+
h = r;
|
|
63
|
+
break;
|
|
64
|
+
case "SET":
|
|
65
|
+
t[l.slice(-1)[0]] = S(o.data.value), h = !0;
|
|
66
|
+
break;
|
|
67
|
+
case "APPLY":
|
|
68
|
+
h = r.apply(t, u);
|
|
69
|
+
break;
|
|
70
|
+
case "CONSTRUCT":
|
|
71
|
+
h = function(e) {
|
|
72
|
+
return Object.assign(e, { [s]: !0 });
|
|
73
|
+
}(new r(...u));
|
|
74
|
+
break;
|
|
75
|
+
case "ENDPOINT":
|
|
76
|
+
{
|
|
77
|
+
const { port1: t, port2: r } = new MessageChannel();
|
|
78
|
+
m(e, r), h = function(e, t) {
|
|
79
|
+
return E.set(e, t), e;
|
|
80
|
+
}(t, [t]);
|
|
81
|
+
}
|
|
82
|
+
break;
|
|
83
|
+
case "RELEASE":
|
|
84
|
+
h = void 0;
|
|
85
|
+
break;
|
|
86
|
+
default: return;
|
|
87
|
+
}
|
|
88
|
+
} catch (e) {
|
|
89
|
+
h = {
|
|
90
|
+
value: e,
|
|
91
|
+
[c]: 0
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
Promise.resolve(h).catch((e) => ({
|
|
95
|
+
value: e,
|
|
96
|
+
[c]: 0
|
|
97
|
+
})).then((r) => {
|
|
98
|
+
const [o, s] = A(r);
|
|
99
|
+
t.postMessage(Object.assign(Object.assign({}, o), { id: i }), s), "RELEASE" === a && (t.removeEventListener("message", n), p(t), f in e && "function" == typeof e[f] && e[f]());
|
|
100
|
+
}).catch((e) => {
|
|
101
|
+
const [r, n] = A({
|
|
102
|
+
value: /* @__PURE__ */ new TypeError("Unserializable return value"),
|
|
103
|
+
[c]: 0
|
|
104
|
+
});
|
|
105
|
+
t.postMessage(Object.assign(Object.assign({}, r), { id: i }), n);
|
|
106
|
+
});
|
|
107
|
+
}), t.start && t.start();
|
|
108
|
+
}
|
|
109
|
+
function p(e) {
|
|
110
|
+
(function(e) {
|
|
111
|
+
return "MessagePort" === e.constructor.name;
|
|
112
|
+
})(e) && e.close();
|
|
113
|
+
}
|
|
114
|
+
function d(e) {
|
|
115
|
+
if (e) throw new Error("Proxy has been released and is not useable");
|
|
116
|
+
}
|
|
117
|
+
function g(e) {
|
|
118
|
+
return w(e, /* @__PURE__ */ new Map(), { type: "RELEASE" }).then(() => {
|
|
119
|
+
p(e);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
const b = /* @__PURE__ */ new WeakMap(), y = "FinalizationRegistry" in globalThis && new FinalizationRegistry((e) => {
|
|
123
|
+
const t = (b.get(e) || 0) - 1;
|
|
124
|
+
b.set(e, t), 0 === t && g(e);
|
|
125
|
+
});
|
|
126
|
+
function O(e, t, r = [], n = function() {}) {
|
|
127
|
+
let o = !1;
|
|
128
|
+
const i = new Proxy(n, {
|
|
129
|
+
get(n, s) {
|
|
130
|
+
if (d(o), s === l) return () => {
|
|
131
|
+
(function(e) {
|
|
132
|
+
y && y.unregister(e);
|
|
133
|
+
})(i), g(e), t.clear(), o = !0;
|
|
134
|
+
};
|
|
135
|
+
if ("then" === s) {
|
|
136
|
+
if (0 === r.length) return { then: () => i };
|
|
137
|
+
const n = w(e, t, {
|
|
138
|
+
type: "GET",
|
|
139
|
+
path: r.map((e) => e.toString())
|
|
140
|
+
}).then(S);
|
|
141
|
+
return n.then.bind(n);
|
|
142
|
+
}
|
|
143
|
+
return O(e, t, [...r, s]);
|
|
144
|
+
},
|
|
145
|
+
set(n, i, s) {
|
|
146
|
+
d(o);
|
|
147
|
+
const [a, l] = A(s);
|
|
148
|
+
return w(e, t, {
|
|
149
|
+
type: "SET",
|
|
150
|
+
path: [...r, i].map((e) => e.toString()),
|
|
151
|
+
value: a
|
|
152
|
+
}, l).then(S);
|
|
153
|
+
},
|
|
154
|
+
apply(n, i, s) {
|
|
155
|
+
d(o);
|
|
156
|
+
const l = r[r.length - 1];
|
|
157
|
+
if (l === a) return w(e, t, { type: "ENDPOINT" }).then(S);
|
|
158
|
+
if ("bind" === l) return O(e, t, r.slice(0, -1));
|
|
159
|
+
const [f, c] = C(s);
|
|
160
|
+
return w(e, t, {
|
|
161
|
+
type: "APPLY",
|
|
162
|
+
path: r.map((e) => e.toString()),
|
|
163
|
+
argumentList: f
|
|
164
|
+
}, c).then(S);
|
|
165
|
+
},
|
|
166
|
+
construct(n, i) {
|
|
167
|
+
d(o);
|
|
168
|
+
const [s, a] = C(i);
|
|
169
|
+
return w(e, t, {
|
|
170
|
+
type: "CONSTRUCT",
|
|
171
|
+
path: r.map((e) => e.toString()),
|
|
172
|
+
argumentList: s
|
|
173
|
+
}, a).then(S);
|
|
174
|
+
}
|
|
175
|
+
});
|
|
176
|
+
return function(e, t) {
|
|
177
|
+
const r = (b.get(t) || 0) + 1;
|
|
178
|
+
b.set(t, r), y && y.register(e, t, e);
|
|
179
|
+
}(i, e), i;
|
|
180
|
+
}
|
|
181
|
+
function C(e) {
|
|
182
|
+
const t = e.map(A);
|
|
183
|
+
return [t.map((e) => e[0]), (r = t.map((e) => e[1]), Array.prototype.concat.apply([], r))];
|
|
184
|
+
var r;
|
|
185
|
+
}
|
|
186
|
+
const E = /* @__PURE__ */ new WeakMap();
|
|
187
|
+
function A(e) {
|
|
188
|
+
for (const [t, r] of h) if (r.canHandle(e)) {
|
|
189
|
+
const [n, o] = r.serialize(e);
|
|
190
|
+
return [{
|
|
191
|
+
type: "HANDLER",
|
|
192
|
+
name: t,
|
|
193
|
+
value: n
|
|
194
|
+
}, o];
|
|
195
|
+
}
|
|
196
|
+
return [{
|
|
197
|
+
type: "RAW",
|
|
198
|
+
value: e
|
|
199
|
+
}, E.get(e) || []];
|
|
200
|
+
}
|
|
201
|
+
function S(e) {
|
|
202
|
+
switch (e.type) {
|
|
203
|
+
case "HANDLER": return h.get(e.name).deserialize(e.value);
|
|
204
|
+
case "RAW": return e.value;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
function w(e, t, r, n) {
|
|
208
|
+
return new Promise((o) => {
|
|
209
|
+
const i = new Array(4).fill(0).map(() => Math.floor(Math.random() * Number.MAX_SAFE_INTEGER).toString(16)).join("-");
|
|
210
|
+
t.set(i, o), e.start && e.start(), e.postMessage(Object.assign({ id: i }, r), n);
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
function j(e) {
|
|
214
|
+
return null != e;
|
|
215
|
+
}
|
|
216
|
+
function F(e) {
|
|
217
|
+
let t;
|
|
218
|
+
this.name = "DeveloperError", this.message = e;
|
|
219
|
+
try {
|
|
220
|
+
throw new Error();
|
|
221
|
+
} catch (e) {
|
|
222
|
+
t = e.stack;
|
|
223
|
+
}
|
|
224
|
+
this.stack = t;
|
|
225
|
+
}
|
|
226
|
+
j(Object.create) && (F.prototype = Object.create(Error.prototype), F.prototype.constructor = F), F.prototype.toString = function() {
|
|
227
|
+
let e = `${this.name}: ${this.message}`;
|
|
228
|
+
return j(this.stack) && (e += `\n${this.stack.toString()}`), e;
|
|
229
|
+
}, F.throwInstantiationError = function() {
|
|
230
|
+
throw new F("This function defines an interface and should not be called directly.");
|
|
231
|
+
};
|
|
232
|
+
const z = {};
|
|
233
|
+
function x(e, t, r) {
|
|
234
|
+
return `Expected ${r} to be typeof ${t}, actual typeof was ${e}`;
|
|
235
|
+
}
|
|
236
|
+
z.typeOf = {}, z.defined = function(e, t) {
|
|
237
|
+
if (!j(t)) throw new F(function(e) {
|
|
238
|
+
return `${e} is required, actual value was undefined`;
|
|
239
|
+
}(e));
|
|
240
|
+
}, z.typeOf.func = function(e, t) {
|
|
241
|
+
if ("function" != typeof t) throw new F(x(typeof t, "function", e));
|
|
242
|
+
}, z.typeOf.string = function(e, t) {
|
|
243
|
+
if ("string" != typeof t) throw new F(x(typeof t, "string", e));
|
|
244
|
+
}, z.typeOf.number = function(e, t) {
|
|
245
|
+
if ("number" != typeof t) throw new F(x(typeof t, "number", e));
|
|
246
|
+
}, z.typeOf.number.lessThan = function(e, t, r) {
|
|
247
|
+
if (z.typeOf.number(e, t), t >= r) throw new F(`Expected ${e} to be less than ${r}, actual value was ${t}`);
|
|
248
|
+
}, z.typeOf.number.lessThanOrEquals = function(e, t, r) {
|
|
249
|
+
if (z.typeOf.number(e, t), t > r) throw new F(`Expected ${e} to be less than or equal to ${r}, actual value was ${t}`);
|
|
250
|
+
}, z.typeOf.number.greaterThan = function(e, t, r) {
|
|
251
|
+
if (z.typeOf.number(e, t), t <= r) throw new F(`Expected ${e} to be greater than ${r}, actual value was ${t}`);
|
|
252
|
+
}, z.typeOf.number.greaterThanOrEquals = function(e, t, r) {
|
|
253
|
+
if (z.typeOf.number(e, t), t < r) throw new F(`Expected ${e} to be greater than or equal to ${r}, actual value was ${t}`);
|
|
254
|
+
}, z.typeOf.object = function(e, t) {
|
|
255
|
+
if ("object" != typeof t) throw new F(x(typeof t, "object", e));
|
|
256
|
+
}, z.typeOf.bool = function(e, t) {
|
|
257
|
+
if ("boolean" != typeof t) throw new F(x(typeof t, "boolean", e));
|
|
258
|
+
}, z.typeOf.bigint = function(e, t) {
|
|
259
|
+
if ("bigint" != typeof t) throw new F(x(typeof t, "bigint", e));
|
|
260
|
+
}, z.typeOf.number.equals = function(e, t, r, n) {
|
|
261
|
+
if (z.typeOf.number(e, r), z.typeOf.number(t, n), r !== n) throw new F(`${e} must be equal to ${t}, the actual values are ${r} and ${n}`);
|
|
262
|
+
};
|
|
263
|
+
var R = ((s, a, l) => (l = null != s ? e(o(s)) : {}, ((e, o, s, a) => {
|
|
264
|
+
if (o && "object" == typeof o || "function" == typeof o) for (var l, f = n(o), c = 0, u = f.length; c < u; c++) l = f[c], i.call(e, l) || void 0 === l || t(e, l, {
|
|
265
|
+
get: ((e) => o[e]).bind(null, l),
|
|
266
|
+
enumerable: !(a = r(o, l)) || a.enumerable
|
|
267
|
+
});
|
|
268
|
+
return e;
|
|
269
|
+
})(!a && s && s.__esModule ? l : t(l, "default", {
|
|
270
|
+
value: s,
|
|
271
|
+
enumerable: !0
|
|
272
|
+
}), s)))(((e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports))((e, t) => {
|
|
273
|
+
var r = function(e) {
|
|
274
|
+
null == e && (e = (/* @__PURE__ */ 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, e.constructor == Array ? this.init_by_array(e, e.length) : this.init_seed(e);
|
|
275
|
+
};
|
|
276
|
+
r.prototype.init_seed = function(e) {
|
|
277
|
+
for (this.mt[0] = e >>> 0, this.mti = 1; this.mti < this.N; this.mti++) 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;
|
|
278
|
+
}, r.prototype.init_by_array = function(e, t) {
|
|
279
|
+
var r, n, o;
|
|
280
|
+
for (this.init_seed(19650218), r = 1, n = 0, o = this.N > t ? this.N : t; o; o--) {
|
|
281
|
+
var i = this.mt[r - 1] ^ this.mt[r - 1] >>> 30;
|
|
282
|
+
this.mt[r] = (this.mt[r] ^ (1664525 * ((4294901760 & i) >>> 16) << 16) + 1664525 * (65535 & i)) + e[n] + n, this.mt[r] >>>= 0, n++, ++r >= this.N && (this.mt[0] = this.mt[this.N - 1], r = 1), n >= t && (n = 0);
|
|
283
|
+
}
|
|
284
|
+
for (o = this.N - 1; o; o--) i = this.mt[r - 1] ^ this.mt[r - 1] >>> 30, this.mt[r] = (this.mt[r] ^ (1566083941 * ((4294901760 & i) >>> 16) << 16) + 1566083941 * (65535 & i)) - r, this.mt[r] >>>= 0, ++r >= this.N && (this.mt[0] = this.mt[this.N - 1], r = 1);
|
|
285
|
+
this.mt[0] = 2147483648;
|
|
286
|
+
}, r.prototype.random_int = function() {
|
|
287
|
+
var e, t = new Array(0, this.MATRIX_A);
|
|
288
|
+
if (this.mti >= this.N) {
|
|
289
|
+
var r;
|
|
290
|
+
for (this.mti == this.N + 1 && this.init_seed(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];
|
|
291
|
+
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];
|
|
292
|
+
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;
|
|
293
|
+
}
|
|
294
|
+
return e = this.mt[this.mti++], e ^= e >>> 11, e ^= e << 7 & 2636928640, e ^= e << 15 & 4022730752, (e ^= e >>> 18) >>> 0;
|
|
295
|
+
}, r.prototype.random_int31 = function() {
|
|
296
|
+
return this.random_int() >>> 1;
|
|
297
|
+
}, r.prototype.random_incl = function() {
|
|
298
|
+
return this.random_int() * (1 / 4294967295);
|
|
299
|
+
}, r.prototype.random = function() {
|
|
300
|
+
return this.random_int() * (1 / 4294967296);
|
|
301
|
+
}, r.prototype.random_excl = function() {
|
|
302
|
+
return (this.random_int() + .5) * (1 / 4294967296);
|
|
303
|
+
}, r.prototype.random_long = function() {
|
|
304
|
+
return (67108864 * (this.random_int() >>> 5) + (this.random_int() >>> 6)) * (1 / 9007199254740992);
|
|
305
|
+
}, t.exports = r;
|
|
306
|
+
})(), 1);
|
|
307
|
+
const I = {
|
|
308
|
+
EPSILON1: .1,
|
|
309
|
+
EPSILON2: .01,
|
|
310
|
+
EPSILON3: .001,
|
|
311
|
+
EPSILON4: 1e-4,
|
|
312
|
+
EPSILON5: 1e-5,
|
|
313
|
+
EPSILON6: 1e-6,
|
|
314
|
+
EPSILON7: 1e-7,
|
|
315
|
+
EPSILON8: 1e-8,
|
|
316
|
+
EPSILON9: 1e-9,
|
|
317
|
+
EPSILON10: 1e-10,
|
|
318
|
+
EPSILON11: 1e-11,
|
|
319
|
+
EPSILON12: 1e-12,
|
|
320
|
+
EPSILON13: 1e-13,
|
|
321
|
+
EPSILON14: 1e-14,
|
|
322
|
+
EPSILON15: 1e-15,
|
|
323
|
+
EPSILON16: 1e-16,
|
|
324
|
+
EPSILON17: 1e-17,
|
|
325
|
+
EPSILON18: 1e-18,
|
|
326
|
+
EPSILON19: 1e-19,
|
|
327
|
+
EPSILON20: 1e-20,
|
|
328
|
+
EPSILON21: 1e-21,
|
|
329
|
+
GRAVITATIONALPARAMETER: 3986004418e5,
|
|
330
|
+
SOLAR_RADIUS: 6955e5,
|
|
331
|
+
LUNAR_RADIUS: 1737400,
|
|
332
|
+
SIXTY_FOUR_KILOBYTES: 65536,
|
|
333
|
+
FOUR_GIGABYTES: 4294967296
|
|
334
|
+
};
|
|
335
|
+
I.sign = Math.sign ?? function(e) {
|
|
336
|
+
return 0 === (e = +e) || e != e ? e : e > 0 ? 1 : -1;
|
|
337
|
+
}, I.signNotZero = function(e) {
|
|
338
|
+
return e < 0 ? -1 : 1;
|
|
339
|
+
}, I.toSNorm = function(e, t) {
|
|
340
|
+
return t = t ?? 255, Math.round((.5 * I.clamp(e, -1, 1) + .5) * t);
|
|
341
|
+
}, I.fromSNorm = function(e, t) {
|
|
342
|
+
return t = t ?? 255, I.clamp(e, 0, t) / t * 2 - 1;
|
|
343
|
+
}, I.normalize = function(e, t, r) {
|
|
344
|
+
return 0 === (r = Math.max(r - t, 0)) ? 0 : I.clamp((e - t) / r, 0, 1);
|
|
345
|
+
}, I.sinh = Math.sinh ?? function(e) {
|
|
346
|
+
return (Math.exp(e) - Math.exp(-e)) / 2;
|
|
347
|
+
}, I.cosh = Math.cosh ?? function(e) {
|
|
348
|
+
return (Math.exp(e) + Math.exp(-e)) / 2;
|
|
349
|
+
}, I.lerp = function(e, t, r) {
|
|
350
|
+
return (1 - r) * e + r * t;
|
|
351
|
+
}, I.PI = Math.PI, I.ONE_OVER_PI = 1 / Math.PI, I.PI_OVER_TWO = Math.PI / 2, I.PI_OVER_THREE = Math.PI / 3, I.PI_OVER_FOUR = Math.PI / 4, I.PI_OVER_SIX = Math.PI / 6, I.THREE_PI_OVER_TWO = 3 * Math.PI / 2, I.TWO_PI = 2 * Math.PI, I.ONE_OVER_TWO_PI = 1 / (2 * Math.PI), I.RADIANS_PER_DEGREE = Math.PI / 180, I.DEGREES_PER_RADIAN = 180 / Math.PI, I.RADIANS_PER_ARCSECOND = I.RADIANS_PER_DEGREE / 3600, I.toRadians = function(e) {
|
|
352
|
+
if (!j(e)) throw new F("degrees is required.");
|
|
353
|
+
return e * I.RADIANS_PER_DEGREE;
|
|
354
|
+
}, I.toDegrees = function(e) {
|
|
355
|
+
if (!j(e)) throw new F("radians is required.");
|
|
356
|
+
return e * I.DEGREES_PER_RADIAN;
|
|
357
|
+
}, I.convertLongitudeRange = function(e) {
|
|
358
|
+
if (!j(e)) throw new F("angle is required.");
|
|
359
|
+
const t = I.TWO_PI, r = e - Math.floor(e / t) * t;
|
|
360
|
+
return r < -Math.PI ? r + t : r >= Math.PI ? r - t : r;
|
|
361
|
+
}, I.clampToLatitudeRange = function(e) {
|
|
362
|
+
if (!j(e)) throw new F("angle is required.");
|
|
363
|
+
return I.clamp(e, -1 * I.PI_OVER_TWO, I.PI_OVER_TWO);
|
|
364
|
+
}, I.negativePiToPi = function(e) {
|
|
365
|
+
if (!j(e)) throw new F("angle is required.");
|
|
366
|
+
return e >= -I.PI && e <= I.PI ? e : I.zeroToTwoPi(e + I.PI) - I.PI;
|
|
367
|
+
}, I.zeroToTwoPi = function(e) {
|
|
368
|
+
if (!j(e)) throw new F("angle is required.");
|
|
369
|
+
if (e >= 0 && e <= I.TWO_PI) return e;
|
|
370
|
+
const t = I.mod(e, I.TWO_PI);
|
|
371
|
+
return Math.abs(t) < I.EPSILON14 && Math.abs(e) > I.EPSILON14 ? I.TWO_PI : t;
|
|
372
|
+
}, I.mod = function(e, t) {
|
|
373
|
+
if (!j(e)) throw new F("m is required.");
|
|
374
|
+
if (!j(t)) throw new F("n is required.");
|
|
375
|
+
if (0 === t) throw new F("divisor cannot be 0.");
|
|
376
|
+
return I.sign(e) === I.sign(t) && Math.abs(e) < Math.abs(t) ? e : (e % t + t) % t;
|
|
377
|
+
}, I.equalsEpsilon = function(e, t, r, n) {
|
|
378
|
+
if (!j(e)) throw new F("left is required.");
|
|
379
|
+
if (!j(t)) throw new F("right is required.");
|
|
380
|
+
r = r ?? 0, n = n ?? r;
|
|
381
|
+
const o = Math.abs(e - t);
|
|
382
|
+
return o <= n || o <= r * Math.max(Math.abs(e), Math.abs(t));
|
|
383
|
+
}, I.lessThan = function(e, t, r) {
|
|
384
|
+
if (!j(e)) throw new F("first is required.");
|
|
385
|
+
if (!j(t)) throw new F("second is required.");
|
|
386
|
+
if (!j(r)) throw new F("absoluteEpsilon is required.");
|
|
387
|
+
return e - t < -r;
|
|
388
|
+
}, I.lessThanOrEquals = function(e, t, r) {
|
|
389
|
+
if (!j(e)) throw new F("first is required.");
|
|
390
|
+
if (!j(t)) throw new F("second is required.");
|
|
391
|
+
if (!j(r)) throw new F("absoluteEpsilon is required.");
|
|
392
|
+
return e - t < r;
|
|
393
|
+
}, I.greaterThan = function(e, t, r) {
|
|
394
|
+
if (!j(e)) throw new F("first is required.");
|
|
395
|
+
if (!j(t)) throw new F("second is required.");
|
|
396
|
+
if (!j(r)) throw new F("absoluteEpsilon is required.");
|
|
397
|
+
return e - t > r;
|
|
398
|
+
}, I.greaterThanOrEquals = function(e, t, r) {
|
|
399
|
+
if (!j(e)) throw new F("first is required.");
|
|
400
|
+
if (!j(t)) throw new F("second is required.");
|
|
401
|
+
if (!j(r)) throw new F("absoluteEpsilon is required.");
|
|
402
|
+
return e - t > -r;
|
|
403
|
+
};
|
|
404
|
+
const L = [1];
|
|
405
|
+
I.factorial = function(e) {
|
|
406
|
+
if ("number" != typeof e || e < 0) throw new F("A number greater than or equal to 0 is required.");
|
|
407
|
+
const t = L.length;
|
|
408
|
+
if (e >= t) {
|
|
409
|
+
let r = L[t - 1];
|
|
410
|
+
for (let n = t; n <= e; n++) {
|
|
411
|
+
const e = r * n;
|
|
412
|
+
L.push(e), r = e;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
return L[e];
|
|
416
|
+
}, I.incrementWrap = function(e, t, r) {
|
|
417
|
+
if (r = r ?? 0, !j(e)) throw new F("n is required.");
|
|
418
|
+
if (t <= r) throw new F("maximumValue must be greater than minimumValue.");
|
|
419
|
+
return ++e > t && (e = r), e;
|
|
420
|
+
}, I.isPowerOfTwo = function(e) {
|
|
421
|
+
if ("number" != typeof e || e < 0 || e > 4294967295) throw new F("A number between 0 and (2^32)-1 is required.");
|
|
422
|
+
return 0 !== e && !(e & e - 1);
|
|
423
|
+
}, I.nextPowerOfTwo = function(e) {
|
|
424
|
+
if ("number" != typeof e || e < 0 || e > 2147483648) throw new F("A number between 0 and 2^31 is required.");
|
|
425
|
+
return --e, e |= e >> 1, e |= e >> 2, e |= e >> 4, e |= e >> 8, e |= e >> 16, ++e;
|
|
426
|
+
}, I.previousPowerOfTwo = function(e) {
|
|
427
|
+
if ("number" != typeof e || e < 0 || e > 4294967295) throw new F("A number between 0 and (2^32)-1 is required.");
|
|
428
|
+
return e |= e >> 1, e |= e >> 2, e |= e >> 4, e |= e >> 8, e |= e >> 16, ((e |= e >> 32) >>> 0) - (e >>> 1);
|
|
429
|
+
}, I.clamp = function(e, t, r) {
|
|
430
|
+
return z.typeOf.number("value", e), z.typeOf.number("min", t), z.typeOf.number("max", r), e < t ? t : e > r ? r : e;
|
|
431
|
+
};
|
|
432
|
+
let T = new R.default();
|
|
433
|
+
I.setRandomNumberSeed = function(e) {
|
|
434
|
+
if (!j(e)) throw new F("seed is required.");
|
|
435
|
+
T = new R.default(e);
|
|
436
|
+
}, I.nextRandomNumber = function() {
|
|
437
|
+
return T.random();
|
|
438
|
+
}, I.randomBetween = function(e, t) {
|
|
439
|
+
return I.nextRandomNumber() * (t - e) + e;
|
|
440
|
+
}, I.acosClamped = function(e) {
|
|
441
|
+
if (!j(e)) throw new F("value is required.");
|
|
442
|
+
return Math.acos(I.clamp(e, -1, 1));
|
|
443
|
+
}, I.asinClamped = function(e) {
|
|
444
|
+
if (!j(e)) throw new F("value is required.");
|
|
445
|
+
return Math.asin(I.clamp(e, -1, 1));
|
|
446
|
+
}, I.chordLength = function(e, t) {
|
|
447
|
+
if (!j(e)) throw new F("angle is required.");
|
|
448
|
+
if (!j(t)) throw new F("radius is required.");
|
|
449
|
+
return 2 * t * Math.sin(.5 * e);
|
|
450
|
+
}, I.logBase = function(e, t) {
|
|
451
|
+
if (!j(e)) throw new F("number is required.");
|
|
452
|
+
if (!j(t)) throw new F("base is required.");
|
|
453
|
+
return Math.log(e) / Math.log(t);
|
|
454
|
+
}, I.cbrt = Math.cbrt ?? function(e) {
|
|
455
|
+
const t = Math.pow(Math.abs(e), 1 / 3);
|
|
456
|
+
return e < 0 ? -t : t;
|
|
457
|
+
}, I.log2 = Math.log2 ?? function(e) {
|
|
458
|
+
return Math.log(e) * Math.LOG2E;
|
|
459
|
+
}, I.fog = function(e, t) {
|
|
460
|
+
const r = e * t;
|
|
461
|
+
return 1 - Math.exp(-r * r);
|
|
462
|
+
}, I.fastApproximateAtan = function(e) {
|
|
463
|
+
return z.typeOf.number("x", e), e * (-.1784 * Math.abs(e) - .0663 * e * e + 1.0301);
|
|
464
|
+
}, I.fastApproximateAtan2 = function(e, t) {
|
|
465
|
+
let r;
|
|
466
|
+
z.typeOf.number("x", e), z.typeOf.number("y", t);
|
|
467
|
+
let n = Math.abs(e);
|
|
468
|
+
r = Math.abs(t);
|
|
469
|
+
const o = Math.max(n, r);
|
|
470
|
+
r = Math.min(n, r);
|
|
471
|
+
const i = r / o;
|
|
472
|
+
if (isNaN(i)) throw new F("either x or y must be nonzero");
|
|
473
|
+
return n = I.fastApproximateAtan(i), n = Math.abs(t) > Math.abs(e) ? I.PI_OVER_TWO - n : n, n = e < 0 ? I.PI - n : n, n = t < 0 ? -n : n, n;
|
|
474
|
+
};
|
|
475
|
+
var N = class e {
|
|
476
|
+
constructor(e, t, r) {
|
|
477
|
+
this.x = e ?? 0, this.y = t ?? 0, this.z = r ?? 0;
|
|
478
|
+
}
|
|
479
|
+
static fromSpherical(t, r) {
|
|
480
|
+
z.typeOf.object("spherical", t), j(r) || (r = new e());
|
|
481
|
+
const n = t.clock, o = t.cone, i = t.magnitude ?? 1, s = i * Math.sin(o);
|
|
482
|
+
return r.x = s * Math.cos(n), r.y = s * Math.sin(n), r.z = i * Math.cos(o), r;
|
|
483
|
+
}
|
|
484
|
+
static fromElements(t, r, n, o) {
|
|
485
|
+
return j(o) ? (o.x = t, o.y = r, o.z = n, o) : new e(t, r, n);
|
|
486
|
+
}
|
|
487
|
+
static clone(t, r) {
|
|
488
|
+
if (j(t)) return j(r) ? (r.x = t.x, r.y = t.y, r.z = t.z, r) : new e(t.x, t.y, t.z);
|
|
489
|
+
}
|
|
490
|
+
static pack(e, t, r) {
|
|
491
|
+
return z.typeOf.object("value", e), z.defined("array", t), r = r ?? 0, t[r++] = e.x, t[r++] = e.y, t[r] = e.z, t;
|
|
492
|
+
}
|
|
493
|
+
static unpack(t, r, n) {
|
|
494
|
+
return z.defined("array", t), r = r ?? 0, j(n) || (n = new e()), n.x = t[r++], n.y = t[r++], n.z = t[r], n;
|
|
495
|
+
}
|
|
496
|
+
static packArray(t, r) {
|
|
497
|
+
z.defined("array", t);
|
|
498
|
+
const n = t.length, o = 3 * n;
|
|
499
|
+
if (j(r)) {
|
|
500
|
+
if (!Array.isArray(r) && r.length !== o) throw new F("If result is a typed array, it must have exactly array.length * 3 elements");
|
|
501
|
+
r.length !== o && (r.length = o);
|
|
502
|
+
} else r = new Array(o);
|
|
503
|
+
for (let i = 0; i < n; ++i) e.pack(t[i], r, 3 * i);
|
|
504
|
+
return r;
|
|
505
|
+
}
|
|
506
|
+
static unpackArray(t, r) {
|
|
507
|
+
if (z.defined("array", t), z.typeOf.number.greaterThanOrEquals("array.length", t.length, 3), t.length % 3 != 0) throw new F("array length must be a multiple of 3.");
|
|
508
|
+
const n = t.length;
|
|
509
|
+
j(r) ? r.length = n / 3 : r = new Array(n / 3);
|
|
510
|
+
for (let o = 0; o < n; o += 3) {
|
|
511
|
+
const n = o / 3;
|
|
512
|
+
r[n] = e.unpack(t, o, r[n]);
|
|
513
|
+
}
|
|
514
|
+
return r;
|
|
515
|
+
}
|
|
516
|
+
static maximumComponent(e) {
|
|
517
|
+
return z.typeOf.object("cartesian", e), Math.max(e.x, e.y, e.z);
|
|
518
|
+
}
|
|
519
|
+
static minimumComponent(e) {
|
|
520
|
+
return z.typeOf.object("cartesian", e), Math.min(e.x, e.y, e.z);
|
|
521
|
+
}
|
|
522
|
+
static minimumByComponent(e, t, r) {
|
|
523
|
+
return z.typeOf.object("first", e), z.typeOf.object("second", t), z.typeOf.object("result", r), r.x = Math.min(e.x, t.x), r.y = Math.min(e.y, t.y), r.z = Math.min(e.z, t.z), r;
|
|
524
|
+
}
|
|
525
|
+
static maximumByComponent(e, t, r) {
|
|
526
|
+
return z.typeOf.object("first", e), z.typeOf.object("second", t), z.typeOf.object("result", r), r.x = Math.max(e.x, t.x), r.y = Math.max(e.y, t.y), r.z = Math.max(e.z, t.z), r;
|
|
527
|
+
}
|
|
528
|
+
static clamp(e, t, r, n) {
|
|
529
|
+
z.typeOf.object("value", e), z.typeOf.object("min", t), z.typeOf.object("max", r), z.typeOf.object("result", n);
|
|
530
|
+
const o = I.clamp(e.x, t.x, r.x), i = I.clamp(e.y, t.y, r.y), s = I.clamp(e.z, t.z, r.z);
|
|
531
|
+
return n.x = o, n.y = i, n.z = s, n;
|
|
532
|
+
}
|
|
533
|
+
static magnitudeSquared(e) {
|
|
534
|
+
return z.typeOf.object("cartesian", e), e.x * e.x + e.y * e.y + e.z * e.z;
|
|
535
|
+
}
|
|
536
|
+
static magnitude(t) {
|
|
537
|
+
return Math.sqrt(e.magnitudeSquared(t));
|
|
538
|
+
}
|
|
539
|
+
static distance(t, r) {
|
|
540
|
+
return z.typeOf.object("left", t), z.typeOf.object("right", r), e.subtract(t, r, D), e.magnitude(D);
|
|
541
|
+
}
|
|
542
|
+
static distanceSquared(t, r) {
|
|
543
|
+
return z.typeOf.object("left", t), z.typeOf.object("right", r), e.subtract(t, r, D), e.magnitudeSquared(D);
|
|
544
|
+
}
|
|
545
|
+
static normalize(t, r) {
|
|
546
|
+
z.typeOf.object("cartesian", t), z.typeOf.object("result", r);
|
|
547
|
+
const n = e.magnitude(t);
|
|
548
|
+
if (r.x = t.x / n, r.y = t.y / n, r.z = t.z / n, isNaN(r.x) || isNaN(r.y) || isNaN(r.z)) throw new F("normalized result is not a number");
|
|
549
|
+
return r;
|
|
550
|
+
}
|
|
551
|
+
static dot(e, t) {
|
|
552
|
+
return z.typeOf.object("left", e), z.typeOf.object("right", t), e.x * t.x + e.y * t.y + e.z * t.z;
|
|
553
|
+
}
|
|
554
|
+
static multiplyComponents(e, t, r) {
|
|
555
|
+
return z.typeOf.object("left", e), z.typeOf.object("right", t), z.typeOf.object("result", r), r.x = e.x * t.x, r.y = e.y * t.y, r.z = e.z * t.z, r;
|
|
556
|
+
}
|
|
557
|
+
static divideComponents(e, t, r) {
|
|
558
|
+
return z.typeOf.object("left", e), z.typeOf.object("right", t), z.typeOf.object("result", r), r.x = e.x / t.x, r.y = e.y / t.y, r.z = e.z / t.z, r;
|
|
559
|
+
}
|
|
560
|
+
static add(e, t, r) {
|
|
561
|
+
return z.typeOf.object("left", e), z.typeOf.object("right", t), z.typeOf.object("result", r), r.x = e.x + t.x, r.y = e.y + t.y, r.z = e.z + t.z, r;
|
|
562
|
+
}
|
|
563
|
+
static subtract(e, t, r) {
|
|
564
|
+
return z.typeOf.object("left", e), z.typeOf.object("right", t), z.typeOf.object("result", r), r.x = e.x - t.x, r.y = e.y - t.y, r.z = e.z - t.z, r;
|
|
565
|
+
}
|
|
566
|
+
static multiplyByScalar(e, t, r) {
|
|
567
|
+
return z.typeOf.object("cartesian", e), z.typeOf.number("scalar", t), z.typeOf.object("result", r), r.x = e.x * t, r.y = e.y * t, r.z = e.z * t, r;
|
|
568
|
+
}
|
|
569
|
+
static divideByScalar(e, t, r) {
|
|
570
|
+
return z.typeOf.object("cartesian", e), z.typeOf.number("scalar", t), z.typeOf.object("result", r), r.x = e.x / t, r.y = e.y / t, r.z = e.z / t, r;
|
|
571
|
+
}
|
|
572
|
+
static negate(e, t) {
|
|
573
|
+
return z.typeOf.object("cartesian", e), z.typeOf.object("result", t), t.x = -e.x, t.y = -e.y, t.z = -e.z, t;
|
|
574
|
+
}
|
|
575
|
+
static abs(e, t) {
|
|
576
|
+
return z.typeOf.object("cartesian", e), z.typeOf.object("result", t), t.x = Math.abs(e.x), t.y = Math.abs(e.y), t.z = Math.abs(e.z), t;
|
|
577
|
+
}
|
|
578
|
+
static lerp(t, r, n, o) {
|
|
579
|
+
return z.typeOf.object("start", t), z.typeOf.object("end", r), z.typeOf.number("t", n), z.typeOf.object("result", o), e.multiplyByScalar(r, n, M), o = e.multiplyByScalar(t, 1 - n, o), e.add(M, o, o);
|
|
580
|
+
}
|
|
581
|
+
static angleBetween(t, r) {
|
|
582
|
+
z.typeOf.object("left", t), z.typeOf.object("right", r), e.normalize(t, P), e.normalize(r, B);
|
|
583
|
+
const n = e.dot(P, B), o = e.magnitude(e.cross(P, B, P));
|
|
584
|
+
return Math.atan2(o, n);
|
|
585
|
+
}
|
|
586
|
+
static mostOrthogonalAxis(t, r) {
|
|
587
|
+
z.typeOf.object("cartesian", t), z.typeOf.object("result", r);
|
|
588
|
+
const n = e.normalize(t, _);
|
|
589
|
+
return e.abs(n, n), n.x <= n.y ? n.x <= n.z ? e.clone(e.UNIT_X, r) : e.clone(e.UNIT_Z, r) : n.y <= n.z ? e.clone(e.UNIT_Y, r) : e.clone(e.UNIT_Z, r);
|
|
590
|
+
}
|
|
591
|
+
static projectVector(t, r, n) {
|
|
592
|
+
z.defined("a", t), z.defined("b", r), z.defined("result", n);
|
|
593
|
+
const o = e.dot(t, r) / e.dot(r, r);
|
|
594
|
+
return e.multiplyByScalar(r, o, n);
|
|
595
|
+
}
|
|
596
|
+
static equals(e, t) {
|
|
597
|
+
return e === t || j(e) && j(t) && e.x === t.x && e.y === t.y && e.z === t.z;
|
|
598
|
+
}
|
|
599
|
+
static equalsArray(e, t, r) {
|
|
600
|
+
return e.x === t[r] && e.y === t[r + 1] && e.z === t[r + 2];
|
|
601
|
+
}
|
|
602
|
+
static equalsEpsilon(e, t, r, n) {
|
|
603
|
+
return e === t || j(e) && j(t) && I.equalsEpsilon(e.x, t.x, r, n) && I.equalsEpsilon(e.y, t.y, r, n) && I.equalsEpsilon(e.z, t.z, r, n);
|
|
604
|
+
}
|
|
605
|
+
static cross(e, t, r) {
|
|
606
|
+
z.typeOf.object("left", e), z.typeOf.object("right", t), z.typeOf.object("result", r);
|
|
607
|
+
const n = e.x, o = e.y, i = e.z, s = t.x, a = t.y, l = t.z, f = o * l - i * a, c = i * s - n * l, u = n * a - o * s;
|
|
608
|
+
return r.x = f, r.y = c, r.z = u, r;
|
|
609
|
+
}
|
|
610
|
+
static midpoint(e, t, r) {
|
|
611
|
+
return z.typeOf.object("left", e), z.typeOf.object("right", t), z.typeOf.object("result", r), r.x = .5 * (e.x + t.x), r.y = .5 * (e.y + t.y), r.z = .5 * (e.z + t.z), r;
|
|
612
|
+
}
|
|
613
|
+
static fromDegrees(t, r, n, o, i) {
|
|
614
|
+
return z.typeOf.number("longitude", t), z.typeOf.number("latitude", r), t = I.toRadians(t), r = I.toRadians(r), e.fromRadians(t, r, n, o, i);
|
|
615
|
+
}
|
|
616
|
+
static fromRadians(t, r, n, o, i) {
|
|
617
|
+
z.typeOf.number("longitude", t), z.typeOf.number("latitude", r), n = n ?? 0;
|
|
618
|
+
const s = j(o) ? o.radiiSquared : e._ellipsoidRadiiSquared, a = Math.cos(r);
|
|
619
|
+
v.x = a * Math.cos(t), v.y = a * Math.sin(t), v.z = Math.sin(r), v = e.normalize(v, v), e.multiplyComponents(s, v, U);
|
|
620
|
+
const l = Math.sqrt(e.dot(v, U));
|
|
621
|
+
return U = e.divideByScalar(U, l, U), v = e.multiplyByScalar(v, n, v), j(i) || (i = new e()), e.add(U, v, i);
|
|
622
|
+
}
|
|
623
|
+
static fromDegreesArray(t, r, n) {
|
|
624
|
+
if (z.defined("coordinates", t), t.length < 2 || t.length % 2 != 0) throw new F("the number of coordinates must be a multiple of 2 and at least 2");
|
|
625
|
+
const o = t.length;
|
|
626
|
+
j(n) ? n.length = o / 2 : n = new Array(o / 2);
|
|
627
|
+
for (let i = 0; i < o; i += 2) {
|
|
628
|
+
const o = t[i], s = t[i + 1], a = i / 2;
|
|
629
|
+
n[a] = e.fromDegrees(o, s, 0, r, n[a]);
|
|
630
|
+
}
|
|
631
|
+
return n;
|
|
632
|
+
}
|
|
633
|
+
static fromRadiansArray(t, r, n) {
|
|
634
|
+
if (z.defined("coordinates", t), t.length < 2 || t.length % 2 != 0) throw new F("the number of coordinates must be a multiple of 2 and at least 2");
|
|
635
|
+
const o = t.length;
|
|
636
|
+
j(n) ? n.length = o / 2 : n = new Array(o / 2);
|
|
637
|
+
for (let i = 0; i < o; i += 2) {
|
|
638
|
+
const o = t[i], s = t[i + 1], a = i / 2;
|
|
639
|
+
n[a] = e.fromRadians(o, s, 0, r, n[a]);
|
|
640
|
+
}
|
|
641
|
+
return n;
|
|
642
|
+
}
|
|
643
|
+
static fromDegreesArrayHeights(t, r, n) {
|
|
644
|
+
if (z.defined("coordinates", t), t.length < 3 || t.length % 3 != 0) throw new F("the number of coordinates must be a multiple of 3 and at least 3");
|
|
645
|
+
const o = t.length;
|
|
646
|
+
j(n) ? n.length = o / 3 : n = new Array(o / 3);
|
|
647
|
+
for (let i = 0; i < o; i += 3) {
|
|
648
|
+
const o = t[i], s = t[i + 1], a = t[i + 2], l = i / 3;
|
|
649
|
+
n[l] = e.fromDegrees(o, s, a, r, n[l]);
|
|
650
|
+
}
|
|
651
|
+
return n;
|
|
652
|
+
}
|
|
653
|
+
static fromRadiansArrayHeights(t, r, n) {
|
|
654
|
+
if (z.defined("coordinates", t), t.length < 3 || t.length % 3 != 0) throw new F("the number of coordinates must be a multiple of 3 and at least 3");
|
|
655
|
+
const o = t.length;
|
|
656
|
+
j(n) ? n.length = o / 3 : n = new Array(o / 3);
|
|
657
|
+
for (let i = 0; i < o; i += 3) {
|
|
658
|
+
const o = t[i], s = t[i + 1], a = t[i + 2], l = i / 3;
|
|
659
|
+
n[l] = e.fromRadians(o, s, a, r, n[l]);
|
|
660
|
+
}
|
|
661
|
+
return n;
|
|
662
|
+
}
|
|
663
|
+
clone(t) {
|
|
664
|
+
return e.clone(this, t);
|
|
665
|
+
}
|
|
666
|
+
equals(t) {
|
|
667
|
+
return e.equals(this, t);
|
|
668
|
+
}
|
|
669
|
+
equalsEpsilon(t, r, n) {
|
|
670
|
+
return e.equalsEpsilon(this, t, r, n);
|
|
671
|
+
}
|
|
672
|
+
toString() {
|
|
673
|
+
return `(${this.x}, ${this.y}, ${this.z})`;
|
|
674
|
+
}
|
|
675
|
+
};
|
|
676
|
+
N.fromCartesian4 = N.clone, N.packedLength = 3, N.fromArray = N.unpack;
|
|
677
|
+
const D = new N(), M = new N(), P = new N(), B = new N(), _ = new N();
|
|
678
|
+
let v = new N(), U = new N();
|
|
679
|
+
N._ellipsoidRadiiSquared = new N(40680631590769, 40680631590769, 40408299984661.445), N.ZERO = Object.freeze(new N(0, 0, 0)), N.ONE = Object.freeze(new N(1, 1, 1)), N.UNIT_X = Object.freeze(new N(1, 0, 0)), N.UNIT_Y = Object.freeze(new N(0, 1, 0)), N.UNIT_Z = Object.freeze(new N(0, 0, 1));
|
|
680
|
+
const q = {};
|
|
681
|
+
let G;
|
|
682
|
+
q.EMPTY_OBJECT = Object.freeze({}), q.EMPTY_ARRAY = Object.freeze([]);
|
|
683
|
+
const k = {
|
|
684
|
+
requestFullscreen: void 0,
|
|
685
|
+
exitFullscreen: void 0,
|
|
686
|
+
fullscreenEnabled: void 0,
|
|
687
|
+
fullscreenElement: void 0,
|
|
688
|
+
fullscreenchange: void 0,
|
|
689
|
+
fullscreenerror: void 0
|
|
690
|
+
}, W = {};
|
|
691
|
+
let $, H, Y, V, K, Z, Q, X, J, ee, te, re, ne, oe, ie, se;
|
|
692
|
+
function ae(e) {
|
|
693
|
+
const t = e.split(".");
|
|
694
|
+
for (let r = 0, n = t.length; r < n; ++r) t[r] = parseInt(t[r], 10);
|
|
695
|
+
return t;
|
|
696
|
+
}
|
|
697
|
+
function le() {
|
|
698
|
+
if (!j(H) && (H = !1, !ue())) {
|
|
699
|
+
const e = / Chrome\/([\.0-9]+)/.exec($.userAgent);
|
|
700
|
+
null !== e && (H = !0, Y = ae(e[1]));
|
|
701
|
+
}
|
|
702
|
+
return H;
|
|
703
|
+
}
|
|
704
|
+
function fe() {
|
|
705
|
+
if (!j(V) && (V = !1, !le() && !ue() && / Safari\/[\.0-9]+/.test($.userAgent))) {
|
|
706
|
+
const e = / Version\/([\.0-9]+)/.exec($.userAgent);
|
|
707
|
+
null !== e && (V = !0, K = ae(e[1]));
|
|
708
|
+
}
|
|
709
|
+
return V;
|
|
710
|
+
}
|
|
711
|
+
function ce() {
|
|
712
|
+
if (!j(Z)) {
|
|
713
|
+
Z = !1;
|
|
714
|
+
const e = / AppleWebKit\/([\.0-9]+)(\+?)/.exec($.userAgent);
|
|
715
|
+
null !== e && (Z = !0, Q = ae(e[1]), Q.isNightly = !!e[2]);
|
|
716
|
+
}
|
|
717
|
+
return Z;
|
|
718
|
+
}
|
|
719
|
+
function ue() {
|
|
720
|
+
if (!j(X)) {
|
|
721
|
+
X = !1;
|
|
722
|
+
const e = / Edg\/([\.0-9]+)/.exec($.userAgent);
|
|
723
|
+
null !== e && (X = !0, J = ae(e[1]));
|
|
724
|
+
}
|
|
725
|
+
return X;
|
|
726
|
+
}
|
|
727
|
+
function he() {
|
|
728
|
+
if (!j(ee)) {
|
|
729
|
+
ee = !1;
|
|
730
|
+
const e = /Firefox\/([\.0-9]+)/.exec($.userAgent);
|
|
731
|
+
null !== e && (ee = !0, te = ae(e[1]));
|
|
732
|
+
}
|
|
733
|
+
return ee;
|
|
734
|
+
}
|
|
735
|
+
function me() {
|
|
736
|
+
if (!j(se)) {
|
|
737
|
+
const e = document.createElement("canvas");
|
|
738
|
+
e.setAttribute("style", "image-rendering: -moz-crisp-edges;image-rendering: pixelated;");
|
|
739
|
+
const t = e.style.imageRendering;
|
|
740
|
+
se = j(t) && "" !== t, se && (ie = t);
|
|
741
|
+
}
|
|
742
|
+
return se;
|
|
743
|
+
}
|
|
744
|
+
function pe() {
|
|
745
|
+
if (!pe.initialized) throw new F("You must call FeatureDetection.supportsWebP.initialize and wait for the promise to resolve before calling FeatureDetection.supportsWebP");
|
|
746
|
+
return pe._result;
|
|
747
|
+
}
|
|
748
|
+
Object.defineProperties(W, {
|
|
749
|
+
element: { get: function() {
|
|
750
|
+
if (W.supportsFullscreen()) return document[k.fullscreenElement];
|
|
751
|
+
} },
|
|
752
|
+
changeEventName: { get: function() {
|
|
753
|
+
if (W.supportsFullscreen()) return k.fullscreenchange;
|
|
754
|
+
} },
|
|
755
|
+
errorEventName: { get: function() {
|
|
756
|
+
if (W.supportsFullscreen()) return k.fullscreenerror;
|
|
757
|
+
} },
|
|
758
|
+
enabled: { get: function() {
|
|
759
|
+
if (W.supportsFullscreen()) return document[k.fullscreenEnabled];
|
|
760
|
+
} },
|
|
761
|
+
fullscreen: { get: function() {
|
|
762
|
+
if (W.supportsFullscreen()) return null !== W.element;
|
|
763
|
+
} }
|
|
764
|
+
}), W.supportsFullscreen = function() {
|
|
765
|
+
if (j(G)) return G;
|
|
766
|
+
G = !1;
|
|
767
|
+
const e = document.body;
|
|
768
|
+
if ("function" == typeof e.requestFullscreen) return k.requestFullscreen = "requestFullscreen", k.exitFullscreen = "exitFullscreen", k.fullscreenEnabled = "fullscreenEnabled", k.fullscreenElement = "fullscreenElement", k.fullscreenchange = "fullscreenchange", k.fullscreenerror = "fullscreenerror", G = !0, G;
|
|
769
|
+
const t = [
|
|
770
|
+
"webkit",
|
|
771
|
+
"moz",
|
|
772
|
+
"o",
|
|
773
|
+
"ms",
|
|
774
|
+
"khtml"
|
|
775
|
+
];
|
|
776
|
+
let r;
|
|
777
|
+
for (let n = 0, o = t.length; n < o; ++n) {
|
|
778
|
+
const o = t[n];
|
|
779
|
+
r = `${o}RequestFullscreen`, "function" == typeof e[r] ? (k.requestFullscreen = r, G = !0) : (r = `${o}RequestFullScreen`, "function" == typeof e[r] && (k.requestFullscreen = r, G = !0)), r = `${o}ExitFullscreen`, "function" == typeof document[r] ? k.exitFullscreen = r : (r = `${o}CancelFullScreen`, "function" == typeof document[r] && (k.exitFullscreen = r)), r = `${o}FullscreenEnabled`, void 0 !== document[r] ? k.fullscreenEnabled = r : (r = `${o}FullScreenEnabled`, void 0 !== document[r] && (k.fullscreenEnabled = r)), r = `${o}FullscreenElement`, void 0 !== document[r] ? k.fullscreenElement = r : (r = `${o}FullScreenElement`, void 0 !== document[r] && (k.fullscreenElement = r)), r = `${o}fullscreenchange`, void 0 !== document[`on${r}`] && ("ms" === o && (r = "MSFullscreenChange"), k.fullscreenchange = r), r = `${o}fullscreenerror`, void 0 !== document[`on${r}`] && ("ms" === o && (r = "MSFullscreenError"), k.fullscreenerror = r);
|
|
780
|
+
}
|
|
781
|
+
return G;
|
|
782
|
+
}, W.requestFullscreen = function(e, t) {
|
|
783
|
+
W.supportsFullscreen() && e[k.requestFullscreen]({ vrDisplay: t });
|
|
784
|
+
}, W.exitFullscreen = function() {
|
|
785
|
+
W.supportsFullscreen() && document[k.exitFullscreen]();
|
|
786
|
+
}, W._names = k, $ = "undefined" != typeof navigator ? navigator : {}, pe._promise = void 0, pe._result = void 0, pe.initialize = function() {
|
|
787
|
+
return j(pe._promise) || (pe._promise = new Promise((e) => {
|
|
788
|
+
const t = new Image();
|
|
789
|
+
t.onload = function() {
|
|
790
|
+
pe._result = t.width > 0 && t.height > 0, e(pe._result);
|
|
791
|
+
}, t.onerror = function() {
|
|
792
|
+
pe._result = !1, e(pe._result);
|
|
793
|
+
}, t.src = "data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA";
|
|
794
|
+
})), pe._promise;
|
|
795
|
+
}, Object.defineProperties(pe, { initialized: { get: function() {
|
|
796
|
+
return j(pe._result);
|
|
797
|
+
} } });
|
|
798
|
+
const de = [];
|
|
799
|
+
"undefined" != typeof ArrayBuffer && (de.push(Int8Array, Uint8Array, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array), "undefined" != typeof Uint8ClampedArray && de.push(Uint8ClampedArray), "undefined" != typeof Uint8ClampedArray && de.push(Uint8ClampedArray), "undefined" != typeof BigInt64Array && de.push(BigInt64Array), "undefined" != typeof BigUint64Array && de.push(BigUint64Array));
|
|
800
|
+
const ge = {
|
|
801
|
+
isChrome: le,
|
|
802
|
+
chromeVersion: function() {
|
|
803
|
+
return le() && Y;
|
|
804
|
+
},
|
|
805
|
+
isSafari: fe,
|
|
806
|
+
safariVersion: function() {
|
|
807
|
+
return fe() && K;
|
|
808
|
+
},
|
|
809
|
+
isWebkit: ce,
|
|
810
|
+
webkitVersion: function() {
|
|
811
|
+
return ce() && Q;
|
|
812
|
+
},
|
|
813
|
+
isEdge: ue,
|
|
814
|
+
edgeVersion: function() {
|
|
815
|
+
return ue() && J;
|
|
816
|
+
},
|
|
817
|
+
isFirefox: he,
|
|
818
|
+
firefoxVersion: function() {
|
|
819
|
+
return he() && te;
|
|
820
|
+
},
|
|
821
|
+
isWindows: function() {
|
|
822
|
+
return j(re) || (re = /Windows/i.test($.appVersion)), re;
|
|
823
|
+
},
|
|
824
|
+
isIPadOrIOS: function() {
|
|
825
|
+
return j(ne) || (ne = "iPhone" === navigator.platform || "iPod" === navigator.platform || "iPad" === navigator.platform), ne;
|
|
826
|
+
},
|
|
827
|
+
hardwareConcurrency: $.hardwareConcurrency ?? 3,
|
|
828
|
+
supportsPointerEvents: function() {
|
|
829
|
+
return j(oe) || (oe = !he() && "undefined" != typeof PointerEvent && (!j($.pointerEnabled) || $.pointerEnabled)), oe;
|
|
830
|
+
},
|
|
831
|
+
supportsImageRenderingPixelated: me,
|
|
832
|
+
supportsWebP: pe,
|
|
833
|
+
imageRenderingValue: function() {
|
|
834
|
+
return me() ? ie : void 0;
|
|
835
|
+
},
|
|
836
|
+
typedArrayTypes: de
|
|
837
|
+
};
|
|
838
|
+
function be(e, t, r) {
|
|
839
|
+
return r < 0 && (r += 1), r > 1 && (r -= 1), 6 * r < 1 ? e + 6 * (t - e) * r : 2 * r < 1 ? t : 3 * r < 2 ? e + (t - e) * (2 / 3 - r) * 6 : e;
|
|
840
|
+
}
|
|
841
|
+
ge.supportsBasis = function(e) {
|
|
842
|
+
return ge.supportsWebAssembly() && e.context.supportsBasis;
|
|
843
|
+
}, ge.supportsFullscreen = function() {
|
|
844
|
+
return W.supportsFullscreen();
|
|
845
|
+
}, ge.supportsTypedArrays = function() {
|
|
846
|
+
return "undefined" != typeof ArrayBuffer;
|
|
847
|
+
}, ge.supportsBigInt64Array = function() {
|
|
848
|
+
return "undefined" != typeof BigInt64Array;
|
|
849
|
+
}, ge.supportsBigUint64Array = function() {
|
|
850
|
+
return "undefined" != typeof BigUint64Array;
|
|
851
|
+
}, ge.supportsBigInt = function() {
|
|
852
|
+
return "undefined" != typeof BigInt;
|
|
853
|
+
}, ge.supportsWebWorkers = function() {
|
|
854
|
+
return "undefined" != typeof Worker;
|
|
855
|
+
}, ge.supportsWebAssembly = function() {
|
|
856
|
+
return "undefined" != typeof WebAssembly;
|
|
857
|
+
}, ge.supportsWebgl2 = function(e) {
|
|
858
|
+
return z.defined("scene", e), e.context.webgl2;
|
|
859
|
+
}, ge.supportsEsmWebWorkers = function() {
|
|
860
|
+
return !he() || parseInt(te) >= 114;
|
|
861
|
+
};
|
|
862
|
+
var ye = class e {
|
|
863
|
+
constructor(e, t, r, n) {
|
|
864
|
+
this.red = e ?? 1, this.green = t ?? 1, this.blue = r ?? 1, this.alpha = n ?? 1;
|
|
865
|
+
}
|
|
866
|
+
static fromCartesian4(t, r) {
|
|
867
|
+
return z.typeOf.object("cartesian", t), j(r) ? (r.red = t.x, r.green = t.y, r.blue = t.z, r.alpha = t.w, r) : new e(t.x, t.y, t.z, t.w);
|
|
868
|
+
}
|
|
869
|
+
static fromBytes(t, r, n, o, i) {
|
|
870
|
+
return t = e.byteToFloat(t ?? 255), r = e.byteToFloat(r ?? 255), n = e.byteToFloat(n ?? 255), o = e.byteToFloat(o ?? 255), j(i) ? (i.red = t, i.green = r, i.blue = n, i.alpha = o, i) : new e(t, r, n, o);
|
|
871
|
+
}
|
|
872
|
+
static fromAlpha(t, r, n) {
|
|
873
|
+
return z.typeOf.object("color", t), z.typeOf.number("alpha", r), j(n) ? (n.red = t.red, n.green = t.green, n.blue = t.blue, n.alpha = r, n) : new e(t.red, t.green, t.blue, r);
|
|
874
|
+
}
|
|
875
|
+
static fromRgba(t, r) {
|
|
876
|
+
return Ce[0] = t, e.fromBytes(Ee[0], Ee[1], Ee[2], Ee[3], r);
|
|
877
|
+
}
|
|
878
|
+
static fromHsl(t, r, n, o, i) {
|
|
879
|
+
t = (t ?? 0) % 1, o = o ?? 1;
|
|
880
|
+
let s = n = n ?? 0, a = n, l = n;
|
|
881
|
+
if (0 !== (r = r ?? 0)) {
|
|
882
|
+
let e;
|
|
883
|
+
e = n < .5 ? n * (1 + r) : n + r - n * r;
|
|
884
|
+
const o = 2 * n - e;
|
|
885
|
+
s = be(o, e, t + 1 / 3), a = be(o, e, t), l = be(o, e, t - 1 / 3);
|
|
886
|
+
}
|
|
887
|
+
return j(i) ? (i.red = s, i.green = a, i.blue = l, i.alpha = o, i) : new e(s, a, l, o);
|
|
888
|
+
}
|
|
889
|
+
static fromRandom(t, r) {
|
|
890
|
+
let n = (t = t ?? q.EMPTY_OBJECT).red;
|
|
891
|
+
if (!j(n)) {
|
|
892
|
+
const e = t.minimumRed ?? 0, r = t.maximumRed ?? 1;
|
|
893
|
+
z.typeOf.number.lessThanOrEquals("minimumRed", e, r), n = e + I.nextRandomNumber() * (r - e);
|
|
894
|
+
}
|
|
895
|
+
let o = t.green;
|
|
896
|
+
if (!j(o)) {
|
|
897
|
+
const e = t.minimumGreen ?? 0, r = t.maximumGreen ?? 1;
|
|
898
|
+
z.typeOf.number.lessThanOrEquals("minimumGreen", e, r), o = e + I.nextRandomNumber() * (r - e);
|
|
899
|
+
}
|
|
900
|
+
let i = t.blue;
|
|
901
|
+
if (!j(i)) {
|
|
902
|
+
const e = t.minimumBlue ?? 0, r = t.maximumBlue ?? 1;
|
|
903
|
+
z.typeOf.number.lessThanOrEquals("minimumBlue", e, r), i = e + I.nextRandomNumber() * (r - e);
|
|
904
|
+
}
|
|
905
|
+
let s = t.alpha;
|
|
906
|
+
if (!j(s)) {
|
|
907
|
+
const e = t.minimumAlpha ?? 0, r = t.maximumAlpha ?? 1;
|
|
908
|
+
z.typeOf.number.lessThanOrEquals("minimumAlpha", e, r), s = e + I.nextRandomNumber() * (r - e);
|
|
909
|
+
}
|
|
910
|
+
return j(r) ? (r.red = n, r.green = o, r.blue = i, r.alpha = s, r) : new e(n, o, i, s);
|
|
911
|
+
}
|
|
912
|
+
static fromCssColorString(t, r) {
|
|
913
|
+
z.typeOf.string("color", t), j(r) || (r = new e()), t = t.trim();
|
|
914
|
+
const n = e[t.toUpperCase()];
|
|
915
|
+
if (j(n)) return e.clone(n, r), r;
|
|
916
|
+
let o = Ae.exec(t);
|
|
917
|
+
return null !== o ? (r.red = parseInt(o[1], 16) / 15, r.green = parseInt(o[2], 16) / 15, r.blue = parseInt(o[3], 16) / 15, r.alpha = parseInt(o[4] ?? "f", 16) / 15, r) : (o = Se.exec(t), null !== o ? (r.red = parseInt(o[1], 16) / 255, r.green = parseInt(o[2], 16) / 255, r.blue = parseInt(o[3], 16) / 255, r.alpha = parseInt(o[4] ?? "ff", 16) / 255, r) : (o = we.exec(t), null !== o ? (r.red = parseFloat(o[1]) / ("%" === o[1].substr(-1) ? 100 : 255), r.green = parseFloat(o[2]) / ("%" === o[2].substr(-1) ? 100 : 255), r.blue = parseFloat(o[3]) / ("%" === o[3].substr(-1) ? 100 : 255), r.alpha = parseFloat(o[4] ?? "1.0"), r) : (o = je.exec(t), null !== o ? e.fromHsl(parseFloat(o[1]) / 360, parseFloat(o[2]) / 100, parseFloat(o[3]) / 100, parseFloat(o[4] ?? "1.0"), r) : r = void 0)));
|
|
918
|
+
}
|
|
919
|
+
static pack(e, t, r) {
|
|
920
|
+
return z.typeOf.object("value", e), z.defined("array", t), r = r ?? 0, t[r++] = e.red, t[r++] = e.green, t[r++] = e.blue, t[r] = e.alpha, t;
|
|
921
|
+
}
|
|
922
|
+
static unpack(t, r, n) {
|
|
923
|
+
return z.defined("array", t), r = r ?? 0, j(n) || (n = new e()), n.red = t[r++], n.green = t[r++], n.blue = t[r++], n.alpha = t[r], n;
|
|
924
|
+
}
|
|
925
|
+
static byteToFloat(e) {
|
|
926
|
+
return e / 255;
|
|
927
|
+
}
|
|
928
|
+
static floatToByte(e) {
|
|
929
|
+
return 1 === e ? 255 : 256 * e | 0;
|
|
930
|
+
}
|
|
931
|
+
static clone(t, r) {
|
|
932
|
+
if (j(t)) return j(r) ? (r.red = t.red, r.green = t.green, r.blue = t.blue, r.alpha = t.alpha, r) : new e(t.red, t.green, t.blue, t.alpha);
|
|
933
|
+
}
|
|
934
|
+
static equals(e, t) {
|
|
935
|
+
return e === t || j(e) && j(t) && e.red === t.red && e.green === t.green && e.blue === t.blue && e.alpha === t.alpha;
|
|
936
|
+
}
|
|
937
|
+
static equalsArray(e, t, r) {
|
|
938
|
+
return e.red === t[r] && e.green === t[r + 1] && e.blue === t[r + 2] && e.alpha === t[r + 3];
|
|
939
|
+
}
|
|
940
|
+
clone(t) {
|
|
941
|
+
return e.clone(this, t);
|
|
942
|
+
}
|
|
943
|
+
equals(t) {
|
|
944
|
+
return e.equals(this, t);
|
|
945
|
+
}
|
|
946
|
+
equalsEpsilon(e, t) {
|
|
947
|
+
return this === e || j(e) && Math.abs(this.red - e.red) <= t && Math.abs(this.green - e.green) <= t && Math.abs(this.blue - e.blue) <= t && Math.abs(this.alpha - e.alpha) <= t;
|
|
948
|
+
}
|
|
949
|
+
toString() {
|
|
950
|
+
return `(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`;
|
|
951
|
+
}
|
|
952
|
+
toCssColorString() {
|
|
953
|
+
const t = e.floatToByte(this.red), r = e.floatToByte(this.green), n = e.floatToByte(this.blue);
|
|
954
|
+
return 1 === this.alpha ? `rgb(${t},${r},${n})` : `rgba(${t},${r},${n},${this.alpha})`;
|
|
955
|
+
}
|
|
956
|
+
toCssHexString() {
|
|
957
|
+
let t = e.floatToByte(this.red).toString(16);
|
|
958
|
+
t.length < 2 && (t = `0${t}`);
|
|
959
|
+
let r = e.floatToByte(this.green).toString(16);
|
|
960
|
+
r.length < 2 && (r = `0${r}`);
|
|
961
|
+
let n = e.floatToByte(this.blue).toString(16);
|
|
962
|
+
if (n.length < 2 && (n = `0${n}`), this.alpha < 1) {
|
|
963
|
+
let o = e.floatToByte(this.alpha).toString(16);
|
|
964
|
+
return o.length < 2 && (o = `0${o}`), `#${t}${r}${n}${o}`;
|
|
965
|
+
}
|
|
966
|
+
return `#${t}${r}${n}`;
|
|
967
|
+
}
|
|
968
|
+
toBytes(t) {
|
|
969
|
+
const r = e.floatToByte(this.red), n = e.floatToByte(this.green), o = e.floatToByte(this.blue), i = e.floatToByte(this.alpha);
|
|
970
|
+
return j(t) ? (t[0] = r, t[1] = n, t[2] = o, t[3] = i, t) : [
|
|
971
|
+
r,
|
|
972
|
+
n,
|
|
973
|
+
o,
|
|
974
|
+
i
|
|
975
|
+
];
|
|
976
|
+
}
|
|
977
|
+
static bytesToRgba(e, t, r, n) {
|
|
978
|
+
return Ee[0] = e, Ee[1] = t, Ee[2] = r, Ee[3] = n, Ce[0];
|
|
979
|
+
}
|
|
980
|
+
toRgba() {
|
|
981
|
+
return e.bytesToRgba(e.floatToByte(this.red), e.floatToByte(this.green), e.floatToByte(this.blue), e.floatToByte(this.alpha));
|
|
982
|
+
}
|
|
983
|
+
brighten(e, t) {
|
|
984
|
+
return z.typeOf.number("magnitude", e), z.typeOf.number.greaterThanOrEquals("magnitude", e, 0), z.typeOf.object("result", t), e = 1 - e, t.red = 1 - (1 - this.red) * e, t.green = 1 - (1 - this.green) * e, t.blue = 1 - (1 - this.blue) * e, t.alpha = this.alpha, t;
|
|
985
|
+
}
|
|
986
|
+
darken(e, t) {
|
|
987
|
+
return z.typeOf.number("magnitude", e), z.typeOf.number.greaterThanOrEquals("magnitude", e, 0), z.typeOf.object("result", t), e = 1 - e, t.red = this.red * e, t.green = this.green * e, t.blue = this.blue * e, t.alpha = this.alpha, t;
|
|
988
|
+
}
|
|
989
|
+
withAlpha(t, r) {
|
|
990
|
+
return e.fromAlpha(this, t, r);
|
|
991
|
+
}
|
|
992
|
+
static add(e, t, r) {
|
|
993
|
+
return z.typeOf.object("left", e), z.typeOf.object("right", t), z.typeOf.object("result", r), r.red = e.red + t.red, r.green = e.green + t.green, r.blue = e.blue + t.blue, r.alpha = e.alpha + t.alpha, r;
|
|
994
|
+
}
|
|
995
|
+
static subtract(e, t, r) {
|
|
996
|
+
return z.typeOf.object("left", e), z.typeOf.object("right", t), z.typeOf.object("result", r), r.red = e.red - t.red, r.green = e.green - t.green, r.blue = e.blue - t.blue, r.alpha = e.alpha - t.alpha, r;
|
|
997
|
+
}
|
|
998
|
+
static multiply(e, t, r) {
|
|
999
|
+
return z.typeOf.object("left", e), z.typeOf.object("right", t), z.typeOf.object("result", r), r.red = e.red * t.red, r.green = e.green * t.green, r.blue = e.blue * t.blue, r.alpha = e.alpha * t.alpha, r;
|
|
1000
|
+
}
|
|
1001
|
+
static divide(e, t, r) {
|
|
1002
|
+
return z.typeOf.object("left", e), z.typeOf.object("right", t), z.typeOf.object("result", r), r.red = e.red / t.red, r.green = e.green / t.green, r.blue = e.blue / t.blue, r.alpha = e.alpha / t.alpha, r;
|
|
1003
|
+
}
|
|
1004
|
+
static mod(e, t, r) {
|
|
1005
|
+
return z.typeOf.object("left", e), z.typeOf.object("right", t), z.typeOf.object("result", r), r.red = e.red % t.red, r.green = e.green % t.green, r.blue = e.blue % t.blue, r.alpha = e.alpha % t.alpha, r;
|
|
1006
|
+
}
|
|
1007
|
+
static lerp(e, t, r, n) {
|
|
1008
|
+
return z.typeOf.object("start", e), z.typeOf.object("end", t), z.typeOf.number("t", r), z.typeOf.object("result", n), n.red = I.lerp(e.red, t.red, r), n.green = I.lerp(e.green, t.green, r), n.blue = I.lerp(e.blue, t.blue, r), n.alpha = I.lerp(e.alpha, t.alpha, r), n;
|
|
1009
|
+
}
|
|
1010
|
+
static multiplyByScalar(e, t, r) {
|
|
1011
|
+
return z.typeOf.object("color", e), z.typeOf.number("scalar", t), z.typeOf.object("result", r), r.red = e.red * t, r.green = e.green * t, r.blue = e.blue * t, r.alpha = e.alpha * t, r;
|
|
1012
|
+
}
|
|
1013
|
+
static divideByScalar(e, t, r) {
|
|
1014
|
+
return z.typeOf.object("color", e), z.typeOf.number("scalar", t), z.typeOf.object("result", r), r.red = e.red / t, r.green = e.green / t, r.blue = e.blue / t, r.alpha = e.alpha / t, r;
|
|
1015
|
+
}
|
|
1016
|
+
};
|
|
1017
|
+
let Oe, Ce, Ee;
|
|
1018
|
+
ge.supportsTypedArrays() && (Oe = /* @__PURE__ */ new ArrayBuffer(4), Ce = new Uint32Array(Oe), Ee = new Uint8Array(Oe));
|
|
1019
|
+
const Ae = /^#([0-9a-f])([0-9a-f])([0-9a-f])([0-9a-f])?$/i, Se = /^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})?$/i, we = /^rgba?\s*\(\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)\s*[,\s]+\s*([0-9.]+%?)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i, je = /^hsla?\s*\(\s*([0-9.]+)\s*[,\s]+\s*([0-9.]+%)\s*[,\s]+\s*([0-9.]+%)(?:\s*[,\s/]+\s*([0-9.]+))?\s*\)$/i;
|
|
1020
|
+
ye.packedLength = 4, ye.ALICEBLUE = Object.freeze(ye.fromCssColorString("#F0F8FF")), ye.ANTIQUEWHITE = Object.freeze(ye.fromCssColorString("#FAEBD7")), ye.AQUA = Object.freeze(ye.fromCssColorString("#00FFFF")), ye.AQUAMARINE = Object.freeze(ye.fromCssColorString("#7FFFD4")), ye.AZURE = Object.freeze(ye.fromCssColorString("#F0FFFF")), ye.BEIGE = Object.freeze(ye.fromCssColorString("#F5F5DC")), ye.BISQUE = Object.freeze(ye.fromCssColorString("#FFE4C4")), ye.BLACK = Object.freeze(ye.fromCssColorString("#000000")), ye.BLANCHEDALMOND = Object.freeze(ye.fromCssColorString("#FFEBCD")), ye.BLUE = Object.freeze(ye.fromCssColorString("#0000FF")), ye.BLUEVIOLET = Object.freeze(ye.fromCssColorString("#8A2BE2")), ye.BROWN = Object.freeze(ye.fromCssColorString("#A52A2A")), ye.BURLYWOOD = Object.freeze(ye.fromCssColorString("#DEB887")), ye.CADETBLUE = Object.freeze(ye.fromCssColorString("#5F9EA0")), ye.CHARTREUSE = Object.freeze(ye.fromCssColorString("#7FFF00")), ye.CHOCOLATE = Object.freeze(ye.fromCssColorString("#D2691E")), ye.CORAL = Object.freeze(ye.fromCssColorString("#FF7F50")), ye.CORNFLOWERBLUE = Object.freeze(ye.fromCssColorString("#6495ED")), ye.CORNSILK = Object.freeze(ye.fromCssColorString("#FFF8DC")), ye.CRIMSON = Object.freeze(ye.fromCssColorString("#DC143C")), ye.CYAN = Object.freeze(ye.fromCssColorString("#00FFFF")), ye.DARKBLUE = Object.freeze(ye.fromCssColorString("#00008B")), ye.DARKCYAN = Object.freeze(ye.fromCssColorString("#008B8B")), ye.DARKGOLDENROD = Object.freeze(ye.fromCssColorString("#B8860B")), ye.DARKGRAY = Object.freeze(ye.fromCssColorString("#A9A9A9")), ye.DARKGREEN = Object.freeze(ye.fromCssColorString("#006400")), ye.DARKGREY = ye.DARKGRAY, ye.DARKKHAKI = Object.freeze(ye.fromCssColorString("#BDB76B")), ye.DARKMAGENTA = Object.freeze(ye.fromCssColorString("#8B008B")), ye.DARKOLIVEGREEN = Object.freeze(ye.fromCssColorString("#556B2F")), ye.DARKORANGE = Object.freeze(ye.fromCssColorString("#FF8C00")), ye.DARKORCHID = Object.freeze(ye.fromCssColorString("#9932CC")), ye.DARKRED = Object.freeze(ye.fromCssColorString("#8B0000")), ye.DARKSALMON = Object.freeze(ye.fromCssColorString("#E9967A")), ye.DARKSEAGREEN = Object.freeze(ye.fromCssColorString("#8FBC8F")), ye.DARKSLATEBLUE = Object.freeze(ye.fromCssColorString("#483D8B")), ye.DARKSLATEGRAY = Object.freeze(ye.fromCssColorString("#2F4F4F")), ye.DARKSLATEGREY = ye.DARKSLATEGRAY, ye.DARKTURQUOISE = Object.freeze(ye.fromCssColorString("#00CED1")), ye.DARKVIOLET = Object.freeze(ye.fromCssColorString("#9400D3")), ye.DEEPPINK = Object.freeze(ye.fromCssColorString("#FF1493")), ye.DEEPSKYBLUE = Object.freeze(ye.fromCssColorString("#00BFFF")), ye.DIMGRAY = Object.freeze(ye.fromCssColorString("#696969")), ye.DIMGREY = ye.DIMGRAY, ye.DODGERBLUE = Object.freeze(ye.fromCssColorString("#1E90FF")), ye.FIREBRICK = Object.freeze(ye.fromCssColorString("#B22222")), ye.FLORALWHITE = Object.freeze(ye.fromCssColorString("#FFFAF0")), ye.FORESTGREEN = Object.freeze(ye.fromCssColorString("#228B22")), ye.FUCHSIA = Object.freeze(ye.fromCssColorString("#FF00FF")), ye.GAINSBORO = Object.freeze(ye.fromCssColorString("#DCDCDC")), ye.GHOSTWHITE = Object.freeze(ye.fromCssColorString("#F8F8FF")), ye.GOLD = Object.freeze(ye.fromCssColorString("#FFD700")), ye.GOLDENROD = Object.freeze(ye.fromCssColorString("#DAA520")), ye.GRAY = Object.freeze(ye.fromCssColorString("#808080")), ye.GREEN = Object.freeze(ye.fromCssColorString("#008000")), ye.GREENYELLOW = Object.freeze(ye.fromCssColorString("#ADFF2F")), ye.GREY = ye.GRAY, ye.HONEYDEW = Object.freeze(ye.fromCssColorString("#F0FFF0")), ye.HOTPINK = Object.freeze(ye.fromCssColorString("#FF69B4")), ye.INDIANRED = Object.freeze(ye.fromCssColorString("#CD5C5C")), ye.INDIGO = Object.freeze(ye.fromCssColorString("#4B0082")), ye.IVORY = Object.freeze(ye.fromCssColorString("#FFFFF0")), ye.KHAKI = Object.freeze(ye.fromCssColorString("#F0E68C")), ye.LAVENDER = Object.freeze(ye.fromCssColorString("#E6E6FA")), ye.LAVENDAR_BLUSH = Object.freeze(ye.fromCssColorString("#FFF0F5")), ye.LAWNGREEN = Object.freeze(ye.fromCssColorString("#7CFC00")), ye.LEMONCHIFFON = Object.freeze(ye.fromCssColorString("#FFFACD")), ye.LIGHTBLUE = Object.freeze(ye.fromCssColorString("#ADD8E6")), ye.LIGHTCORAL = Object.freeze(ye.fromCssColorString("#F08080")), ye.LIGHTCYAN = Object.freeze(ye.fromCssColorString("#E0FFFF")), ye.LIGHTGOLDENRODYELLOW = Object.freeze(ye.fromCssColorString("#FAFAD2")), ye.LIGHTGRAY = Object.freeze(ye.fromCssColorString("#D3D3D3")), ye.LIGHTGREEN = Object.freeze(ye.fromCssColorString("#90EE90")), ye.LIGHTGREY = ye.LIGHTGRAY, ye.LIGHTPINK = Object.freeze(ye.fromCssColorString("#FFB6C1")), ye.LIGHTSEAGREEN = Object.freeze(ye.fromCssColorString("#20B2AA")), ye.LIGHTSKYBLUE = Object.freeze(ye.fromCssColorString("#87CEFA")), ye.LIGHTSLATEGRAY = Object.freeze(ye.fromCssColorString("#778899")), ye.LIGHTSLATEGREY = ye.LIGHTSLATEGRAY, ye.LIGHTSTEELBLUE = Object.freeze(ye.fromCssColorString("#B0C4DE")), ye.LIGHTYELLOW = Object.freeze(ye.fromCssColorString("#FFFFE0")), ye.LIME = Object.freeze(ye.fromCssColorString("#00FF00")), ye.LIMEGREEN = Object.freeze(ye.fromCssColorString("#32CD32")), ye.LINEN = Object.freeze(ye.fromCssColorString("#FAF0E6")), ye.MAGENTA = Object.freeze(ye.fromCssColorString("#FF00FF")), ye.MAROON = Object.freeze(ye.fromCssColorString("#800000")), ye.MEDIUMAQUAMARINE = Object.freeze(ye.fromCssColorString("#66CDAA")), ye.MEDIUMBLUE = Object.freeze(ye.fromCssColorString("#0000CD")), ye.MEDIUMORCHID = Object.freeze(ye.fromCssColorString("#BA55D3")), ye.MEDIUMPURPLE = Object.freeze(ye.fromCssColorString("#9370DB")), ye.MEDIUMSEAGREEN = Object.freeze(ye.fromCssColorString("#3CB371")), ye.MEDIUMSLATEBLUE = Object.freeze(ye.fromCssColorString("#7B68EE")), ye.MEDIUMSPRINGGREEN = Object.freeze(ye.fromCssColorString("#00FA9A")), ye.MEDIUMTURQUOISE = Object.freeze(ye.fromCssColorString("#48D1CC")), ye.MEDIUMVIOLETRED = Object.freeze(ye.fromCssColorString("#C71585")), ye.MIDNIGHTBLUE = Object.freeze(ye.fromCssColorString("#191970")), ye.MINTCREAM = Object.freeze(ye.fromCssColorString("#F5FFFA")), ye.MISTYROSE = Object.freeze(ye.fromCssColorString("#FFE4E1")), ye.MOCCASIN = Object.freeze(ye.fromCssColorString("#FFE4B5")), ye.NAVAJOWHITE = Object.freeze(ye.fromCssColorString("#FFDEAD")), ye.NAVY = Object.freeze(ye.fromCssColorString("#000080")), ye.OLDLACE = Object.freeze(ye.fromCssColorString("#FDF5E6")), ye.OLIVE = Object.freeze(ye.fromCssColorString("#808000")), ye.OLIVEDRAB = Object.freeze(ye.fromCssColorString("#6B8E23")), ye.ORANGE = Object.freeze(ye.fromCssColorString("#FFA500")), ye.ORANGERED = Object.freeze(ye.fromCssColorString("#FF4500")), ye.ORCHID = Object.freeze(ye.fromCssColorString("#DA70D6")), ye.PALEGOLDENROD = Object.freeze(ye.fromCssColorString("#EEE8AA")), ye.PALEGREEN = Object.freeze(ye.fromCssColorString("#98FB98")), ye.PALETURQUOISE = Object.freeze(ye.fromCssColorString("#AFEEEE")), ye.PALEVIOLETRED = Object.freeze(ye.fromCssColorString("#DB7093")), ye.PAPAYAWHIP = Object.freeze(ye.fromCssColorString("#FFEFD5")), ye.PEACHPUFF = Object.freeze(ye.fromCssColorString("#FFDAB9")), ye.PERU = Object.freeze(ye.fromCssColorString("#CD853F")), ye.PINK = Object.freeze(ye.fromCssColorString("#FFC0CB")), ye.PLUM = Object.freeze(ye.fromCssColorString("#DDA0DD")), ye.POWDERBLUE = Object.freeze(ye.fromCssColorString("#B0E0E6")), ye.PURPLE = Object.freeze(ye.fromCssColorString("#800080")), ye.RED = Object.freeze(ye.fromCssColorString("#FF0000")), ye.ROSYBROWN = Object.freeze(ye.fromCssColorString("#BC8F8F")), ye.ROYALBLUE = Object.freeze(ye.fromCssColorString("#4169E1")), ye.SADDLEBROWN = Object.freeze(ye.fromCssColorString("#8B4513")), ye.SALMON = Object.freeze(ye.fromCssColorString("#FA8072")), ye.SANDYBROWN = Object.freeze(ye.fromCssColorString("#F4A460")), ye.SEAGREEN = Object.freeze(ye.fromCssColorString("#2E8B57")), ye.SEASHELL = Object.freeze(ye.fromCssColorString("#FFF5EE")), ye.SIENNA = Object.freeze(ye.fromCssColorString("#A0522D")), ye.SILVER = Object.freeze(ye.fromCssColorString("#C0C0C0")), ye.SKYBLUE = Object.freeze(ye.fromCssColorString("#87CEEB")), ye.SLATEBLUE = Object.freeze(ye.fromCssColorString("#6A5ACD")), ye.SLATEGRAY = Object.freeze(ye.fromCssColorString("#708090")), ye.SLATEGREY = ye.SLATEGRAY, ye.SNOW = Object.freeze(ye.fromCssColorString("#FFFAFA")), ye.SPRINGGREEN = Object.freeze(ye.fromCssColorString("#00FF7F")), ye.STEELBLUE = Object.freeze(ye.fromCssColorString("#4682B4")), ye.TAN = Object.freeze(ye.fromCssColorString("#D2B48C")), ye.TEAL = Object.freeze(ye.fromCssColorString("#008080")), ye.THISTLE = Object.freeze(ye.fromCssColorString("#D8BFD8")), ye.TOMATO = Object.freeze(ye.fromCssColorString("#FF6347")), ye.TURQUOISE = Object.freeze(ye.fromCssColorString("#40E0D0")), ye.VIOLET = Object.freeze(ye.fromCssColorString("#EE82EE")), ye.WHEAT = Object.freeze(ye.fromCssColorString("#F5DEB3")), ye.WHITE = Object.freeze(ye.fromCssColorString("#FFFFFF")), ye.WHITESMOKE = Object.freeze(ye.fromCssColorString("#F5F5F5")), ye.YELLOW = Object.freeze(ye.fromCssColorString("#FFFF00")), ye.YELLOWGREEN = Object.freeze(ye.fromCssColorString("#9ACD32")), ye.TRANSPARENT = Object.freeze(new ye(0, 0, 0, 0));
|
|
1021
|
+
var Fe = class e {
|
|
1022
|
+
constructor(e, t) {
|
|
1023
|
+
this.x = e ?? 0, this.y = t ?? 0;
|
|
1024
|
+
}
|
|
1025
|
+
static fromElements(t, r, n) {
|
|
1026
|
+
return j(n) ? (n.x = t, n.y = r, n) : new e(t, r);
|
|
1027
|
+
}
|
|
1028
|
+
static clone(t, r) {
|
|
1029
|
+
if (j(t)) return j(r) ? (r.x = t.x, r.y = t.y, r) : new e(t.x, t.y);
|
|
1030
|
+
}
|
|
1031
|
+
static pack(e, t, r) {
|
|
1032
|
+
return z.typeOf.object("value", e), z.defined("array", t), r = r ?? 0, t[r++] = e.x, t[r] = e.y, t;
|
|
1033
|
+
}
|
|
1034
|
+
static unpack(t, r, n) {
|
|
1035
|
+
return z.defined("array", t), r = r ?? 0, j(n) || (n = new e()), n.x = t[r++], n.y = t[r], n;
|
|
1036
|
+
}
|
|
1037
|
+
static packArray(t, r) {
|
|
1038
|
+
z.defined("array", t);
|
|
1039
|
+
const n = t.length, o = 2 * n;
|
|
1040
|
+
if (j(r)) {
|
|
1041
|
+
if (!Array.isArray(r) && r.length !== o) throw new F("If result is a typed array, it must have exactly array.length * 2 elements");
|
|
1042
|
+
r.length !== o && (r.length = o);
|
|
1043
|
+
} else r = new Array(o);
|
|
1044
|
+
for (let i = 0; i < n; ++i) e.pack(t[i], r, 2 * i);
|
|
1045
|
+
return r;
|
|
1046
|
+
}
|
|
1047
|
+
static unpackArray(t, r) {
|
|
1048
|
+
if (z.defined("array", t), z.typeOf.number.greaterThanOrEquals("array.length", t.length, 2), t.length % 2 != 0) throw new F("array length must be a multiple of 2.");
|
|
1049
|
+
const n = t.length;
|
|
1050
|
+
j(r) ? r.length = n / 2 : r = new Array(n / 2);
|
|
1051
|
+
for (let o = 0; o < n; o += 2) {
|
|
1052
|
+
const n = o / 2;
|
|
1053
|
+
r[n] = e.unpack(t, o, r[n]);
|
|
1054
|
+
}
|
|
1055
|
+
return r;
|
|
1056
|
+
}
|
|
1057
|
+
static maximumComponent(e) {
|
|
1058
|
+
return z.typeOf.object("cartesian", e), Math.max(e.x, e.y);
|
|
1059
|
+
}
|
|
1060
|
+
static minimumComponent(e) {
|
|
1061
|
+
return z.typeOf.object("cartesian", e), Math.min(e.x, e.y);
|
|
1062
|
+
}
|
|
1063
|
+
static minimumByComponent(e, t, r) {
|
|
1064
|
+
return z.typeOf.object("first", e), z.typeOf.object("second", t), z.typeOf.object("result", r), r.x = Math.min(e.x, t.x), r.y = Math.min(e.y, t.y), r;
|
|
1065
|
+
}
|
|
1066
|
+
static maximumByComponent(e, t, r) {
|
|
1067
|
+
return z.typeOf.object("first", e), z.typeOf.object("second", t), z.typeOf.object("result", r), r.x = Math.max(e.x, t.x), r.y = Math.max(e.y, t.y), r;
|
|
1068
|
+
}
|
|
1069
|
+
static clamp(e, t, r, n) {
|
|
1070
|
+
z.typeOf.object("value", e), z.typeOf.object("min", t), z.typeOf.object("max", r), z.typeOf.object("result", n);
|
|
1071
|
+
const o = I.clamp(e.x, t.x, r.x), i = I.clamp(e.y, t.y, r.y);
|
|
1072
|
+
return n.x = o, n.y = i, n;
|
|
1073
|
+
}
|
|
1074
|
+
static magnitudeSquared(e) {
|
|
1075
|
+
return z.typeOf.object("cartesian", e), e.x * e.x + e.y * e.y;
|
|
1076
|
+
}
|
|
1077
|
+
static magnitude(t) {
|
|
1078
|
+
return Math.sqrt(e.magnitudeSquared(t));
|
|
1079
|
+
}
|
|
1080
|
+
static distance(t, r) {
|
|
1081
|
+
return z.typeOf.object("left", t), z.typeOf.object("right", r), e.subtract(t, r, ze), e.magnitude(ze);
|
|
1082
|
+
}
|
|
1083
|
+
static distanceSquared(t, r) {
|
|
1084
|
+
return z.typeOf.object("left", t), z.typeOf.object("right", r), e.subtract(t, r, ze), e.magnitudeSquared(ze);
|
|
1085
|
+
}
|
|
1086
|
+
static normalize(t, r) {
|
|
1087
|
+
z.typeOf.object("cartesian", t), z.typeOf.object("result", r);
|
|
1088
|
+
const n = e.magnitude(t);
|
|
1089
|
+
if (r.x = t.x / n, r.y = t.y / n, isNaN(r.x) || isNaN(r.y)) throw new F("normalized result is not a number");
|
|
1090
|
+
return r;
|
|
1091
|
+
}
|
|
1092
|
+
static dot(e, t) {
|
|
1093
|
+
return z.typeOf.object("left", e), z.typeOf.object("right", t), e.x * t.x + e.y * t.y;
|
|
1094
|
+
}
|
|
1095
|
+
static cross(e, t) {
|
|
1096
|
+
return z.typeOf.object("left", e), z.typeOf.object("right", t), e.x * t.y - e.y * t.x;
|
|
1097
|
+
}
|
|
1098
|
+
static multiplyComponents(e, t, r) {
|
|
1099
|
+
return z.typeOf.object("left", e), z.typeOf.object("right", t), z.typeOf.object("result", r), r.x = e.x * t.x, r.y = e.y * t.y, r;
|
|
1100
|
+
}
|
|
1101
|
+
static divideComponents(e, t, r) {
|
|
1102
|
+
return z.typeOf.object("left", e), z.typeOf.object("right", t), z.typeOf.object("result", r), r.x = e.x / t.x, r.y = e.y / t.y, r;
|
|
1103
|
+
}
|
|
1104
|
+
static add(e, t, r) {
|
|
1105
|
+
return z.typeOf.object("left", e), z.typeOf.object("right", t), z.typeOf.object("result", r), r.x = e.x + t.x, r.y = e.y + t.y, r;
|
|
1106
|
+
}
|
|
1107
|
+
static subtract(e, t, r) {
|
|
1108
|
+
return z.typeOf.object("left", e), z.typeOf.object("right", t), z.typeOf.object("result", r), r.x = e.x - t.x, r.y = e.y - t.y, r;
|
|
1109
|
+
}
|
|
1110
|
+
static multiplyByScalar(e, t, r) {
|
|
1111
|
+
return z.typeOf.object("cartesian", e), z.typeOf.number("scalar", t), z.typeOf.object("result", r), r.x = e.x * t, r.y = e.y * t, r;
|
|
1112
|
+
}
|
|
1113
|
+
static divideByScalar(e, t, r) {
|
|
1114
|
+
return z.typeOf.object("cartesian", e), z.typeOf.number("scalar", t), z.typeOf.object("result", r), r.x = e.x / t, r.y = e.y / t, r;
|
|
1115
|
+
}
|
|
1116
|
+
static negate(e, t) {
|
|
1117
|
+
return z.typeOf.object("cartesian", e), z.typeOf.object("result", t), t.x = -e.x, t.y = -e.y, t;
|
|
1118
|
+
}
|
|
1119
|
+
static abs(e, t) {
|
|
1120
|
+
return z.typeOf.object("cartesian", e), z.typeOf.object("result", t), t.x = Math.abs(e.x), t.y = Math.abs(e.y), t;
|
|
1121
|
+
}
|
|
1122
|
+
static lerp(t, r, n, o) {
|
|
1123
|
+
return z.typeOf.object("start", t), z.typeOf.object("end", r), z.typeOf.number("t", n), z.typeOf.object("result", o), e.multiplyByScalar(r, n, xe), o = e.multiplyByScalar(t, 1 - n, o), e.add(xe, o, o);
|
|
1124
|
+
}
|
|
1125
|
+
static angleBetween(t, r) {
|
|
1126
|
+
return z.typeOf.object("left", t), z.typeOf.object("right", r), e.normalize(t, Re), e.normalize(r, Ie), I.acosClamped(e.dot(Re, Ie));
|
|
1127
|
+
}
|
|
1128
|
+
static mostOrthogonalAxis(t, r) {
|
|
1129
|
+
z.typeOf.object("cartesian", t), z.typeOf.object("result", r);
|
|
1130
|
+
const n = e.normalize(t, Le);
|
|
1131
|
+
return e.abs(n, n), n.x <= n.y ? e.clone(e.UNIT_X, r) : e.clone(e.UNIT_Y, r);
|
|
1132
|
+
}
|
|
1133
|
+
static equals(e, t) {
|
|
1134
|
+
return e === t || j(e) && j(t) && e.x === t.x && e.y === t.y;
|
|
1135
|
+
}
|
|
1136
|
+
static equalsArray(e, t, r) {
|
|
1137
|
+
return e.x === t[r] && e.y === t[r + 1];
|
|
1138
|
+
}
|
|
1139
|
+
static equalsEpsilon(e, t, r, n) {
|
|
1140
|
+
return e === t || j(e) && j(t) && I.equalsEpsilon(e.x, t.x, r, n) && I.equalsEpsilon(e.y, t.y, r, n);
|
|
1141
|
+
}
|
|
1142
|
+
clone(t) {
|
|
1143
|
+
return e.clone(this, t);
|
|
1144
|
+
}
|
|
1145
|
+
equals(t) {
|
|
1146
|
+
return e.equals(this, t);
|
|
1147
|
+
}
|
|
1148
|
+
equalsEpsilon(t, r, n) {
|
|
1149
|
+
return e.equalsEpsilon(this, t, r, n);
|
|
1150
|
+
}
|
|
1151
|
+
toString() {
|
|
1152
|
+
return `(${this.x}, ${this.y})`;
|
|
1153
|
+
}
|
|
1154
|
+
};
|
|
1155
|
+
Fe.fromCartesian3 = Fe.clone, Fe.fromCartesian4 = Fe.clone, Fe.packedLength = 2, Fe.fromArray = Fe.unpack;
|
|
1156
|
+
const ze = new Fe(), xe = new Fe(), Re = new Fe(), Ie = new Fe(), Le = new Fe();
|
|
1157
|
+
function Te(e, t) {
|
|
1158
|
+
e = e ?? 0, this._near = e, t = t ?? Number.MAX_VALUE, this._far = t;
|
|
1159
|
+
}
|
|
1160
|
+
Fe.ZERO = Object.freeze(new Fe(0, 0)), Fe.ONE = Object.freeze(new Fe(1, 1)), Fe.UNIT_X = Object.freeze(new Fe(1, 0)), Fe.UNIT_Y = Object.freeze(new Fe(0, 1)), Object.defineProperties(Te.prototype, {
|
|
1161
|
+
near: {
|
|
1162
|
+
get: function() {
|
|
1163
|
+
return this._near;
|
|
1164
|
+
},
|
|
1165
|
+
set: function(e) {
|
|
1166
|
+
this._near = e;
|
|
1167
|
+
}
|
|
1168
|
+
},
|
|
1169
|
+
far: {
|
|
1170
|
+
get: function() {
|
|
1171
|
+
return this._far;
|
|
1172
|
+
},
|
|
1173
|
+
set: function(e) {
|
|
1174
|
+
this._far = e;
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
}), Te.packedLength = 2, Te.pack = function(e, t, r) {
|
|
1178
|
+
if (!j(e)) throw new F("value is required");
|
|
1179
|
+
if (!j(t)) throw new F("array is required");
|
|
1180
|
+
return r = r ?? 0, t[r++] = e.near, t[r] = e.far, t;
|
|
1181
|
+
}, Te.unpack = function(e, t, r) {
|
|
1182
|
+
if (!j(e)) throw new F("array is required");
|
|
1183
|
+
return t = t ?? 0, j(r) || (r = new Te()), r.near = e[t++], r.far = e[t], r;
|
|
1184
|
+
}, Te.equals = function(e, t) {
|
|
1185
|
+
return e === t || j(e) && j(t) && e.near === t.near && e.far === t.far;
|
|
1186
|
+
}, Te.clone = function(e, t) {
|
|
1187
|
+
if (j(e)) return j(t) || (t = new Te()), t.near = e.near, t.far = e.far, t;
|
|
1188
|
+
}, Te.prototype.clone = function(e) {
|
|
1189
|
+
return Te.clone(this, e);
|
|
1190
|
+
}, Te.prototype.equals = function(e) {
|
|
1191
|
+
return Te.equals(this, e);
|
|
1192
|
+
};
|
|
1193
|
+
const Ne = {
|
|
1194
|
+
NONE: 0,
|
|
1195
|
+
CLAMP_TO_GROUND: 1,
|
|
1196
|
+
RELATIVE_TO_GROUND: 2,
|
|
1197
|
+
CLAMP_TO_TERRAIN: 3,
|
|
1198
|
+
RELATIVE_TO_TERRAIN: 4,
|
|
1199
|
+
CLAMP_TO_3D_TILE: 5,
|
|
1200
|
+
RELATIVE_TO_3D_TILE: 6
|
|
1201
|
+
};
|
|
1202
|
+
Object.freeze(Ne);
|
|
1203
|
+
const De = {
|
|
1204
|
+
CENTER: 0,
|
|
1205
|
+
LEFT: 1,
|
|
1206
|
+
RIGHT: -1
|
|
1207
|
+
};
|
|
1208
|
+
Object.freeze(De);
|
|
1209
|
+
const Me = {
|
|
1210
|
+
CENTER: 0,
|
|
1211
|
+
BOTTOM: 1,
|
|
1212
|
+
BASELINE: 2,
|
|
1213
|
+
TOP: -1
|
|
1214
|
+
};
|
|
1215
|
+
Object.freeze(Me);
|
|
1216
|
+
const Pe = {
|
|
1217
|
+
FILL: 0,
|
|
1218
|
+
OUTLINE: 1,
|
|
1219
|
+
FILL_AND_OUTLINE: 2
|
|
1220
|
+
};
|
|
1221
|
+
Object.freeze(Pe);
|
|
1222
|
+
const Be = [
|
|
1223
|
+
Int8Array,
|
|
1224
|
+
Uint8Array,
|
|
1225
|
+
Uint8ClampedArray,
|
|
1226
|
+
Int16Array,
|
|
1227
|
+
Uint16Array,
|
|
1228
|
+
Int32Array,
|
|
1229
|
+
Uint32Array,
|
|
1230
|
+
Float32Array,
|
|
1231
|
+
Float64Array
|
|
1232
|
+
];
|
|
1233
|
+
var _e = class e {
|
|
1234
|
+
static from(t) {
|
|
1235
|
+
if (!(t instanceof ArrayBuffer)) throw new Error("Data must be an instance of ArrayBuffer.");
|
|
1236
|
+
const [r, n] = new Uint8Array(t, 0, 2);
|
|
1237
|
+
if (219 !== r) throw new Error("Data does not appear to be in a KDBush format.");
|
|
1238
|
+
const o = n >> 4;
|
|
1239
|
+
if (1 !== o) throw new Error(`Got v${o} data when expected v1.`);
|
|
1240
|
+
const i = Be[15 & n];
|
|
1241
|
+
if (!i) throw new Error("Unrecognized array type.");
|
|
1242
|
+
const [s] = new Uint16Array(t, 2, 1), [a] = new Uint32Array(t, 4, 1);
|
|
1243
|
+
return new e(a, s, i, t);
|
|
1244
|
+
}
|
|
1245
|
+
constructor(e, t = 64, r = Float64Array, n) {
|
|
1246
|
+
if (isNaN(e) || e < 0) throw new Error(`Unpexpected numItems value: ${e}.`);
|
|
1247
|
+
this.numItems = +e, this.nodeSize = Math.min(Math.max(+t, 2), 65535), this.ArrayType = r, this.IndexArrayType = e < 65536 ? Uint16Array : Uint32Array;
|
|
1248
|
+
const o = Be.indexOf(this.ArrayType), i = 2 * e * this.ArrayType.BYTES_PER_ELEMENT, s = e * this.IndexArrayType.BYTES_PER_ELEMENT, a = (8 - s % 8) % 8;
|
|
1249
|
+
if (o < 0) throw new Error(`Unexpected typed array class: ${r}.`);
|
|
1250
|
+
n && n instanceof ArrayBuffer ? (this.data = n, this.ids = new this.IndexArrayType(this.data, 8, e), this.coords = new this.ArrayType(this.data, 8 + s + a, 2 * e), this._pos = 2 * e, this._finished = !0) : (this.data = new ArrayBuffer(8 + i + s + a), this.ids = new this.IndexArrayType(this.data, 8, e), this.coords = new this.ArrayType(this.data, 8 + s + a, 2 * e), this._pos = 0, this._finished = !1, new Uint8Array(this.data, 0, 2).set([219, 16 + o]), new Uint16Array(this.data, 2, 1)[0] = t, new Uint32Array(this.data, 4, 1)[0] = e);
|
|
1251
|
+
}
|
|
1252
|
+
add(e, t) {
|
|
1253
|
+
const r = this._pos >> 1;
|
|
1254
|
+
return this.ids[r] = r, this.coords[this._pos++] = e, this.coords[this._pos++] = t, r;
|
|
1255
|
+
}
|
|
1256
|
+
finish() {
|
|
1257
|
+
const e = this._pos >> 1;
|
|
1258
|
+
if (e !== this.numItems) throw new Error(`Added ${e} items when expected ${this.numItems}.`);
|
|
1259
|
+
return ve(this.ids, this.coords, this.nodeSize, 0, this.numItems - 1, 0), this._finished = !0, this;
|
|
1260
|
+
}
|
|
1261
|
+
range(e, t, r, n) {
|
|
1262
|
+
if (!this._finished) throw new Error("Data not yet indexed - call index.finish().");
|
|
1263
|
+
const { ids: o, coords: i, nodeSize: s } = this, a = [
|
|
1264
|
+
0,
|
|
1265
|
+
o.length - 1,
|
|
1266
|
+
0
|
|
1267
|
+
], l = [];
|
|
1268
|
+
for (; a.length;) {
|
|
1269
|
+
const f = a.pop() || 0, c = a.pop() || 0, u = a.pop() || 0;
|
|
1270
|
+
if (c - u <= s) {
|
|
1271
|
+
for (let s = u; s <= c; s++) {
|
|
1272
|
+
const a = i[2 * s], f = i[2 * s + 1];
|
|
1273
|
+
a >= e && a <= r && f >= t && f <= n && l.push(o[s]);
|
|
1274
|
+
}
|
|
1275
|
+
continue;
|
|
1276
|
+
}
|
|
1277
|
+
const h = u + c >> 1, m = i[2 * h], p = i[2 * h + 1];
|
|
1278
|
+
m >= e && m <= r && p >= t && p <= n && l.push(o[h]), (0 === f ? e <= m : t <= p) && (a.push(u), a.push(h - 1), a.push(1 - f)), (0 === f ? r >= m : n >= p) && (a.push(h + 1), a.push(c), a.push(1 - f));
|
|
1279
|
+
}
|
|
1280
|
+
return l;
|
|
1281
|
+
}
|
|
1282
|
+
within(e, t, r) {
|
|
1283
|
+
if (!this._finished) throw new Error("Data not yet indexed - call index.finish().");
|
|
1284
|
+
const { ids: n, coords: o, nodeSize: i } = this, s = [
|
|
1285
|
+
0,
|
|
1286
|
+
n.length - 1,
|
|
1287
|
+
0
|
|
1288
|
+
], a = [], l = r * r;
|
|
1289
|
+
for (; s.length;) {
|
|
1290
|
+
const f = s.pop() || 0, c = s.pop() || 0, u = s.pop() || 0;
|
|
1291
|
+
if (c - u <= i) {
|
|
1292
|
+
for (let r = u; r <= c; r++) ke(o[2 * r], o[2 * r + 1], e, t) <= l && a.push(n[r]);
|
|
1293
|
+
continue;
|
|
1294
|
+
}
|
|
1295
|
+
const h = u + c >> 1, m = o[2 * h], p = o[2 * h + 1];
|
|
1296
|
+
ke(m, p, e, t) <= l && a.push(n[h]), (0 === f ? e - r <= m : t - r <= p) && (s.push(u), s.push(h - 1), s.push(1 - f)), (0 === f ? e + r >= m : t + r >= p) && (s.push(h + 1), s.push(c), s.push(1 - f));
|
|
1297
|
+
}
|
|
1298
|
+
return a;
|
|
1299
|
+
}
|
|
1300
|
+
};
|
|
1301
|
+
function ve(e, t, r, n, o, i) {
|
|
1302
|
+
if (o - n <= r) return;
|
|
1303
|
+
const s = n + o >> 1;
|
|
1304
|
+
Ue(e, t, s, n, o, i), ve(e, t, r, n, s - 1, 1 - i), ve(e, t, r, s + 1, o, 1 - i);
|
|
1305
|
+
}
|
|
1306
|
+
function Ue(e, t, r, n, o, i) {
|
|
1307
|
+
for (; o > n;) {
|
|
1308
|
+
if (o - n > 600) {
|
|
1309
|
+
const s = o - n + 1, a = r - n + 1, l = Math.log(s), f = .5 * Math.exp(2 * l / 3), c = .5 * Math.sqrt(l * f * (s - f) / s) * (a - s / 2 < 0 ? -1 : 1);
|
|
1310
|
+
Ue(e, t, r, Math.max(n, Math.floor(r - a * f / s + c)), Math.min(o, Math.floor(r + (s - a) * f / s + c)), i);
|
|
1311
|
+
}
|
|
1312
|
+
const s = t[2 * r + i];
|
|
1313
|
+
let a = n, l = o;
|
|
1314
|
+
for (qe(e, t, n, r), t[2 * o + i] > s && qe(e, t, n, o); a < l;) {
|
|
1315
|
+
for (qe(e, t, a, l), a++, l--; t[2 * a + i] < s;) a++;
|
|
1316
|
+
for (; t[2 * l + i] > s;) l--;
|
|
1317
|
+
}
|
|
1318
|
+
t[2 * n + i] === s ? qe(e, t, n, l) : (l++, qe(e, t, l, o)), l <= r && (n = l + 1), r <= l && (o = l - 1);
|
|
1319
|
+
}
|
|
1320
|
+
}
|
|
1321
|
+
function qe(e, t, r, n) {
|
|
1322
|
+
Ge(e, r, n), Ge(t, 2 * r, 2 * n), Ge(t, 2 * r + 1, 2 * n + 1);
|
|
1323
|
+
}
|
|
1324
|
+
function Ge(e, t, r) {
|
|
1325
|
+
const n = e[t];
|
|
1326
|
+
e[t] = e[r], e[r] = n;
|
|
1327
|
+
}
|
|
1328
|
+
function ke(e, t, r, n) {
|
|
1329
|
+
const o = e - r, i = t - n;
|
|
1330
|
+
return o * o + i * i;
|
|
1331
|
+
}
|
|
1332
|
+
function We(e, t) {
|
|
1333
|
+
return toString.call(e) === `[object ${t}]`;
|
|
1334
|
+
}
|
|
1335
|
+
function $e(e) {
|
|
1336
|
+
return We(e, "String");
|
|
1337
|
+
}
|
|
1338
|
+
function He(e) {
|
|
1339
|
+
return We(e, "Number");
|
|
1340
|
+
}
|
|
1341
|
+
function Ye(e) {
|
|
1342
|
+
return void 0 !== e;
|
|
1343
|
+
}
|
|
1344
|
+
function Ve(e = {}, t = {}) {
|
|
1345
|
+
let r;
|
|
1346
|
+
for (r in t) e[r] = t[r];
|
|
1347
|
+
return e;
|
|
1348
|
+
}
|
|
1349
|
+
var Ke = class e {
|
|
1350
|
+
show = !0;
|
|
1351
|
+
minLevel;
|
|
1352
|
+
maxLevel;
|
|
1353
|
+
weight;
|
|
1354
|
+
scale = 1;
|
|
1355
|
+
offset;
|
|
1356
|
+
fontColor = "#000";
|
|
1357
|
+
fontFamily = "宋体";
|
|
1358
|
+
fontSize = 10;
|
|
1359
|
+
backgroundColor;
|
|
1360
|
+
backgroundPadding;
|
|
1361
|
+
outlineColor;
|
|
1362
|
+
outlineAlpha;
|
|
1363
|
+
outlineWidth;
|
|
1364
|
+
imgUrl;
|
|
1365
|
+
imgWidth;
|
|
1366
|
+
imgHeight;
|
|
1367
|
+
labelField = "name";
|
|
1368
|
+
filterField;
|
|
1369
|
+
includeValue;
|
|
1370
|
+
excludeValue;
|
|
1371
|
+
near;
|
|
1372
|
+
far;
|
|
1373
|
+
children;
|
|
1374
|
+
get font() {
|
|
1375
|
+
return this.fontSize + "px " + this.fontFamily;
|
|
1376
|
+
}
|
|
1377
|
+
constructor(e) {
|
|
1378
|
+
e && this.copyFrom(e);
|
|
1379
|
+
}
|
|
1380
|
+
static fromOption(e) {
|
|
1381
|
+
const t = {};
|
|
1382
|
+
if (He(e.scale) && (t.scale = e.scale), He(e.minLevel) && (t.minLevel = e.minLevel), He(e.maxLevel) && (t.maxLevel = e.maxLevel), He(e.near) && (t.near = e.near), He(e.far) && (t.far = e.far), Ye(e.fontSize) || $e(e.fontFamily)) {
|
|
1383
|
+
const r = e.fontSize ?? 10, n = e.fontFamily ?? "宋体";
|
|
1384
|
+
t.font = r + "px " + n;
|
|
1385
|
+
}
|
|
1386
|
+
return e.fontColor && (t.fillColor = ye.fromCssColorString(e.fontColor)), $e(e.backgroundColor) && (t.showBackground = !0, t.backgroundColor = ye.fromCssColorString(e.backgroundColor), t.backgroundPadding = new Fe(e.backgroundPadding, e.backgroundPadding)), e.outlineColor && (t.style = Pe.FILL_AND_OUTLINE, t.outlineColor = ye.fromCssColorString(e.outlineColor).withAlpha(e.outlineAlpha ?? 1), t.outlineWidth = e.outlineWidth ?? 2), e.imgUrl ? (t.image = e.imgUrl, t.width = e.imgWidth, t.height = e.imgHeight, t.pixelOffset = new Fe(0, He(e.offset) ? e.offset : 0)) : "" === e.imgUrl && (t.image = void 0), t;
|
|
1387
|
+
}
|
|
1388
|
+
static fromDefaultOption(e) {
|
|
1389
|
+
const t = {
|
|
1390
|
+
show: !0,
|
|
1391
|
+
style: Pe.FILL,
|
|
1392
|
+
pixelOffset: Fe.ZERO,
|
|
1393
|
+
eyeOffset: N.ZERO,
|
|
1394
|
+
horizontalOrigin: De.CENTER,
|
|
1395
|
+
verticalOrigin: Me.CENTER,
|
|
1396
|
+
heightReference: Ne.CLAMP_TO_GROUND,
|
|
1397
|
+
distanceDisplayCondition: new Te(0, 2e7),
|
|
1398
|
+
disableDepthTestDistance: 1e8
|
|
1399
|
+
};
|
|
1400
|
+
if (He(e.scale) && (t.scale = e.scale), He(e.minLevel) && (t.minLevel = e.minLevel), He(e.maxLevel) && (t.maxLevel = e.maxLevel), Ye(e.fontSize) || $e(e.fontFamily)) {
|
|
1401
|
+
const r = e.fontSize ?? 10, n = e.fontFamily ?? "宋体";
|
|
1402
|
+
t.font = r + "px " + n;
|
|
1403
|
+
}
|
|
1404
|
+
return e.fontColor && (t.fillColor = ye.fromCssColorString(e.fontColor)), $e(e.backgroundColor) && (t.showBackground = !0, t.backgroundColor = ye.fromCssColorString(e.backgroundColor), t.backgroundPadding = new Fe(e.backgroundPadding, e.backgroundPadding)), e.outlineColor && (t.style = Pe.FILL_AND_OUTLINE, t.outlineColor = ye.fromCssColorString(e.outlineColor).withAlpha(e.outlineAlpha ?? 1), t.outlineWidth = e.outlineWidth ?? 2), e.imgUrl ? (t.image = e.imgUrl, t.width = e.imgWidth, t.height = e.imgHeight, t.pixelOffset = new Fe(0, He(e.offset) ? e.offset : 0)) : "" === e.imgUrl && (t.image = void 0), t;
|
|
1405
|
+
}
|
|
1406
|
+
clone() {
|
|
1407
|
+
const t = new e();
|
|
1408
|
+
return t.show = this.show, t.minLevel = this.minLevel, t.maxLevel = this.maxLevel, t.near = this.near, t.far = this.far, t.weight = this.weight, t.offset = this.offset, this.fontColor && (t.fontColor = this.fontColor), this.fontSize && (t.fontSize = this.fontSize), this.fontFamily && (t.fontFamily = this.fontFamily), t.backgroundColor = this.backgroundColor, t.backgroundPadding = this.backgroundPadding, t.outlineColor = this.outlineColor, t.outlineAlpha = this.outlineAlpha, t.outlineWidth = this.outlineWidth, t.imgUrl = this.imgUrl, t.imgWidth = this.imgWidth, t.imgHeight = this.imgHeight, t.labelField = this.labelField, t.filterField = this.filterField, t.includeValue = this.includeValue, t.excludeValue = this.excludeValue, t.children = this.children ? [...this.children] : void 0, t;
|
|
1409
|
+
}
|
|
1410
|
+
copyFrom(e) {
|
|
1411
|
+
this.show = e.show, this.minLevel = e.minLevel, this.maxLevel = e.maxLevel, this.near = e.near, this.far = e.far, this.weight = e.weight, this.offset = e.offset, e.fontColor && (this.fontColor = e.fontColor), e.fontSize && (this.fontSize = e.fontSize), e.fontFamily && (this.fontFamily = e.fontFamily), this.backgroundColor = e.backgroundColor, this.backgroundPadding = e.backgroundPadding, this.outlineColor = e.outlineColor, this.outlineAlpha = e.outlineAlpha, this.outlineWidth = e.outlineWidth, this.imgUrl = e.imgUrl, this.imgWidth = e.imgWidth, this.imgHeight = e.imgHeight, e.labelField && (this.labelField = e.labelField), this.filterField = e.filterField, this.includeValue = e.includeValue, this.excludeValue = e.excludeValue, this.children = e.children ? [...e.children] : void 0;
|
|
1412
|
+
}
|
|
1413
|
+
getLabelOption() {
|
|
1414
|
+
const e = {
|
|
1415
|
+
show: !0,
|
|
1416
|
+
font: this.font,
|
|
1417
|
+
fillColor: ye.fromCssColorString(this.fontColor),
|
|
1418
|
+
style: Pe.FILL,
|
|
1419
|
+
scale: this.scale,
|
|
1420
|
+
pixelOffset: Fe.ZERO,
|
|
1421
|
+
eyeOffset: N.ZERO,
|
|
1422
|
+
horizontalOrigin: De.CENTER,
|
|
1423
|
+
verticalOrigin: Me.CENTER,
|
|
1424
|
+
heightReference: Ne.CLAMP_TO_GROUND,
|
|
1425
|
+
distanceDisplayCondition: new Te(0, 2e7),
|
|
1426
|
+
disableDepthTestDistance: 1e8
|
|
1427
|
+
};
|
|
1428
|
+
He(this.weight) && (e.eyeOffset = new N(0, 0, -100 * this.weight)), this.backgroundColor && (e.showBackground = !0, e.backgroundColor = ye.fromCssColorString(this.backgroundColor), e.backgroundPadding = new Fe(this.backgroundPadding ?? 7, this.backgroundPadding ?? 5)), this.outlineColor && (e.style = Pe.FILL_AND_OUTLINE, e.outlineColor = ye.fromCssColorString(this.outlineColor).withAlpha(this.outlineAlpha ?? 1), e.outlineWidth = this.outlineWidth ?? 2);
|
|
1429
|
+
let t = 0;
|
|
1430
|
+
return He(this.offset) && (t = this.offset, e.pixelOffset = new Fe(0, t)), this.imgUrl && (e.image = this.imgUrl, e.width = this.imgWidth, e.height = this.imgHeight), e;
|
|
1431
|
+
}
|
|
1432
|
+
getBillboardOption() {
|
|
1433
|
+
return this.imgUrl ? {
|
|
1434
|
+
image: this.imgUrl,
|
|
1435
|
+
width: this.imgWidth,
|
|
1436
|
+
height: this.imgHeight
|
|
1437
|
+
} : {};
|
|
1438
|
+
}
|
|
1439
|
+
}, Ze = ((e, r) => {
|
|
1440
|
+
let n = {};
|
|
1441
|
+
for (var o in e) t(n, o, {
|
|
1442
|
+
get: e[o],
|
|
1443
|
+
enumerable: !0
|
|
1444
|
+
});
|
|
1445
|
+
return r || t(n, Symbol.toStringTag, { value: "Module" }), n;
|
|
1446
|
+
})({
|
|
1447
|
+
cancelPromise: () => tt,
|
|
1448
|
+
checkRectangleNoIntersect: () => at,
|
|
1449
|
+
clear: () => ct,
|
|
1450
|
+
deleteLabelRectangle: () => lt,
|
|
1451
|
+
filterByBounds: () => rt,
|
|
1452
|
+
getFilterPointsList: () => nt,
|
|
1453
|
+
getLabelEntities: () => ot,
|
|
1454
|
+
getLabelPointList: () => st,
|
|
1455
|
+
isOverlapping: () => ft,
|
|
1456
|
+
isPointOnFrontOfGlobe: () => it,
|
|
1457
|
+
loadLabelPoints: () => et
|
|
1458
|
+
});
|
|
1459
|
+
let Qe = /* @__PURE__ */ new Map(), Xe = /* @__PURE__ */ new Map();
|
|
1460
|
+
function Je(e, t) {
|
|
1461
|
+
if (t && t.length > 0) {
|
|
1462
|
+
let r, n;
|
|
1463
|
+
const o = t.length;
|
|
1464
|
+
for (let i = 0; i < o; i++) {
|
|
1465
|
+
const o = t[i];
|
|
1466
|
+
if (o && o.includeValue === e) {
|
|
1467
|
+
n = o.fontSize, r = r ? Ve(r, Ke.fromOption(o)) : Ke.fromOption(o);
|
|
1468
|
+
break;
|
|
1469
|
+
}
|
|
1470
|
+
}
|
|
1471
|
+
return {
|
|
1472
|
+
childOptions: r,
|
|
1473
|
+
childFontSize: n
|
|
1474
|
+
};
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
async function et(e, t, r) {
|
|
1478
|
+
if (!e || Qe.has(e)) return;
|
|
1479
|
+
let n = await (await fetch(t)).json();
|
|
1480
|
+
if (!n) return;
|
|
1481
|
+
const o = n.features;
|
|
1482
|
+
let i = r.minLevel ?? 1, s = r.maxLevel ?? 18;
|
|
1483
|
+
const a = r.labelField, l = r.filterField ?? a, f = function(e) {
|
|
1484
|
+
const t = Ke.fromDefaultOption(e);
|
|
1485
|
+
let r;
|
|
1486
|
+
return $e(e.excludeValue) && (r = e.excludeValue.split(",")), {
|
|
1487
|
+
baseLabelOptions: t,
|
|
1488
|
+
exclude: r
|
|
1489
|
+
};
|
|
1490
|
+
}(r), c = f.exclude, u = 1.2 * (r.fontSize ?? 12), h = r.children;
|
|
1491
|
+
if (o) {
|
|
1492
|
+
const t = o.length, r = new _e(t), m = new Array();
|
|
1493
|
+
for (let e = 0; e < t; e++) {
|
|
1494
|
+
const t = o[e], n = t.properties;
|
|
1495
|
+
if (n) {
|
|
1496
|
+
const o = n[a], f = n[l], p = n.minl, d = n.maxl, g = t.geometry.coordinates;
|
|
1497
|
+
let b, y = u;
|
|
1498
|
+
if (c && c.indexOf(f) >= 0) {
|
|
1499
|
+
const e = Je(o, h);
|
|
1500
|
+
e && (e.childFontSize && (y = 1.2 * e.childFontSize), e.childOptions && (b = e.childOptions));
|
|
1501
|
+
}
|
|
1502
|
+
const O = {
|
|
1503
|
+
id: e,
|
|
1504
|
+
name: o,
|
|
1505
|
+
minZoom: p,
|
|
1506
|
+
maxZoom: d,
|
|
1507
|
+
position: N.fromDegrees(g[0], g[1]),
|
|
1508
|
+
textWidth: y * o.length,
|
|
1509
|
+
textHeight: y,
|
|
1510
|
+
childOptions: b
|
|
1511
|
+
};
|
|
1512
|
+
r.add(g[0], g[1]), m.push(O), He(p) && p < i && (i = p), He(d) && d > s && (s = d);
|
|
1513
|
+
}
|
|
1514
|
+
}
|
|
1515
|
+
return r.finish(), Qe.set(e, {
|
|
1516
|
+
indexKDB: r,
|
|
1517
|
+
ptList: m,
|
|
1518
|
+
baseLabelOptions: f.baseLabelOptions,
|
|
1519
|
+
exclude: f.exclude,
|
|
1520
|
+
idRectMap: /* @__PURE__ */ new Map()
|
|
1521
|
+
}), o.length = 0, n = void 0, {
|
|
1522
|
+
min: i,
|
|
1523
|
+
max: s
|
|
1524
|
+
};
|
|
1525
|
+
}
|
|
1526
|
+
}
|
|
1527
|
+
function tt(e) {
|
|
1528
|
+
Xe.set(e, !0);
|
|
1529
|
+
}
|
|
1530
|
+
function rt(e, t, r) {
|
|
1531
|
+
if (!t || !Qe.has(e)) return;
|
|
1532
|
+
const n = Qe.get(e);
|
|
1533
|
+
if (!n) return;
|
|
1534
|
+
Xe.set(e, !1);
|
|
1535
|
+
const o = I.toDegrees(t.west), i = I.toDegrees(t.east), s = I.toDegrees(t.north), a = I.toDegrees(t.south), l = n.indexKDB.range(o, a, i, s);
|
|
1536
|
+
if (Xe.get(e)) throw l.length = 0, /* @__PURE__ */ new Error("0");
|
|
1537
|
+
if (null != r) {
|
|
1538
|
+
const t = l.length, o = [];
|
|
1539
|
+
for (let i = 0; i < t; i++) {
|
|
1540
|
+
if (Xe.get(e)) throw o.length = 0, l.length = 0, /* @__PURE__ */ new Error("0");
|
|
1541
|
+
const t = l[i], s = n.ptList[t];
|
|
1542
|
+
null != s.minZoom && s.maxZoom ? r >= s.minZoom && r <= s.maxZoom && o.push(t) : o.push(t);
|
|
1543
|
+
}
|
|
1544
|
+
return l.length = 0, o;
|
|
1545
|
+
}
|
|
1546
|
+
return l;
|
|
1547
|
+
}
|
|
1548
|
+
function nt(e, t) {
|
|
1549
|
+
if (!Qe.has(e)) return;
|
|
1550
|
+
const r = Qe.get(e);
|
|
1551
|
+
if (!r) return;
|
|
1552
|
+
const n = [], o = t.length;
|
|
1553
|
+
for (let i = 0; i < o; i++) {
|
|
1554
|
+
const e = t[i], o = r.ptList[e];
|
|
1555
|
+
n.push(o);
|
|
1556
|
+
}
|
|
1557
|
+
return n;
|
|
1558
|
+
}
|
|
1559
|
+
function ot(e, t) {
|
|
1560
|
+
if (!Qe.has(e)) return;
|
|
1561
|
+
const r = Qe.get(e);
|
|
1562
|
+
if (!r) return;
|
|
1563
|
+
const n = r.baseLabelOptions, o = [], i = t.length;
|
|
1564
|
+
for (let s = 0; s < i; s++) {
|
|
1565
|
+
const e = t[s], i = r.ptList[e];
|
|
1566
|
+
let a = n;
|
|
1567
|
+
i.childOptions && (a = Ve({ ...n }, i.childOptions));
|
|
1568
|
+
const l = i.position, f = {
|
|
1569
|
+
labelOption: void 0,
|
|
1570
|
+
billboardOption: void 0
|
|
1571
|
+
};
|
|
1572
|
+
a.image && (f.billboardOption = {
|
|
1573
|
+
id: e,
|
|
1574
|
+
show: !0,
|
|
1575
|
+
position: l,
|
|
1576
|
+
disableDepthTestDistance: Number.POSITIVE_INFINITY,
|
|
1577
|
+
image: a.image,
|
|
1578
|
+
width: a.width,
|
|
1579
|
+
height: a.height
|
|
1580
|
+
}, delete a.image, delete a.width, delete a.height), f.labelOption = {
|
|
1581
|
+
position: l,
|
|
1582
|
+
text: i.name,
|
|
1583
|
+
id: e,
|
|
1584
|
+
...a
|
|
1585
|
+
}, o.push(f);
|
|
1586
|
+
}
|
|
1587
|
+
return o;
|
|
1588
|
+
}
|
|
1589
|
+
function it(e, t) {
|
|
1590
|
+
return !(N.distance(e, t) > 6371e3);
|
|
1591
|
+
}
|
|
1592
|
+
function st(e, t) {
|
|
1593
|
+
if (!Qe.has(e)) return;
|
|
1594
|
+
const r = Qe.get(e);
|
|
1595
|
+
return r ? t.map((e) => r.ptList[e]) : void 0;
|
|
1596
|
+
}
|
|
1597
|
+
function at(e, t, r) {
|
|
1598
|
+
const n = Qe.get(e);
|
|
1599
|
+
if (!n) return !1;
|
|
1600
|
+
const o = n.idRectMap;
|
|
1601
|
+
let i = !1;
|
|
1602
|
+
for (let [s, a] of o) if (a && (i = ft(a, t), i)) break;
|
|
1603
|
+
return i || o.set(r, t), i;
|
|
1604
|
+
}
|
|
1605
|
+
function lt(e, t) {
|
|
1606
|
+
const r = Qe.get(e);
|
|
1607
|
+
if (!r) return !1;
|
|
1608
|
+
const n = r.idRectMap;
|
|
1609
|
+
return !!n && n.delete(t);
|
|
1610
|
+
}
|
|
1611
|
+
function ft(e, t) {
|
|
1612
|
+
return !(e.x > t.x + t.width || t.x > e.x + e.width || e.y > t.y + t.height || t.y > e.y + e.height);
|
|
1613
|
+
}
|
|
1614
|
+
function ct(e) {
|
|
1615
|
+
if (Qe.has(e)) {
|
|
1616
|
+
const t = Qe.get(e);
|
|
1617
|
+
t && (t.ptList.length = 0, t.indexKDB.data = null, t.idRectMap.clear(), t.baseLabelOptions = void 0, Qe.delete(e));
|
|
1618
|
+
}
|
|
1619
|
+
}
|
|
1620
|
+
m(Ze);
|