@realsee/five 6.6.4 → 6.7.0-alpha.0

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.
Files changed (54) hide show
  1. package/docs/classes/five.Fetcher.html +2 -2
  2. package/docs/classes/five.Five.html +57 -57
  3. package/docs/classes/five.Work.html +16 -16
  4. package/docs/classes/five.WorkResolvedObserver.html +16 -16
  5. package/docs/classes/sticker.Sticker.html +2 -2
  6. package/docs/functions/five.loadAt3d.html +1 -1
  7. package/docs/functions/five.loadDome.html +1 -1
  8. package/docs/functions/five.loadFbx.html +1 -1
  9. package/docs/functions/five.loadPbm.html +1 -1
  10. package/docs/functions/five.parseWork.html +1 -1
  11. package/docs/interfaces/five.LooseWorkWithExtrinsics.html +5 -5
  12. package/docs/interfaces/five.TileHeader.html +2 -2
  13. package/docs/interfaces/five.TilesetHeader.html +4 -4
  14. package/docs/interfaces/five.TrajectoryHeader.html +2 -2
  15. package/docs/interfaces/five.WorkCubeImage.html +2 -2
  16. package/docs/interfaces/five.WorkImage.html +3 -3
  17. package/docs/interfaces/five.WorkInitial.html +8 -8
  18. package/docs/interfaces/five.WorkModel.html +6 -6
  19. package/docs/interfaces/five.WorkModelLayer.html +2 -2
  20. package/docs/interfaces/five.WorkObserver.html +18 -18
  21. package/docs/interfaces/five.WorkTile.html +4 -4
  22. package/docs/interfaces/five.WorkVideo.html +4 -4
  23. package/docs/types/five.ParseOptions.html +6 -6
  24. package/docs/types/five.PostProcessingType.html +1 -1
  25. package/five/index.js +20 -20
  26. package/five/index.mjs +525 -649
  27. package/gltf-loader/index.js +2 -2
  28. package/gltf-loader/index.mjs +145 -145
  29. package/line/index.js +2 -2
  30. package/line/index.mjs +9 -9
  31. package/package.json +1 -1
  32. package/plugins/index.js +1 -1
  33. package/plugins/index.mjs +1 -1
  34. package/react/index.js +1 -1
  35. package/react/index.mjs +1 -1
  36. package/shader-lib/index.js +1 -1
  37. package/shader-lib/index.mjs +1 -1
  38. package/sticker/index.js +2 -2
  39. package/sticker/index.mjs +6 -6
  40. package/umd/five-gltf-loader.js +2 -2
  41. package/umd/five-line.js +2 -2
  42. package/umd/five-plugins.js +1 -1
  43. package/umd/five-react.js +1 -1
  44. package/umd/five-shader-lib.js +1 -1
  45. package/umd/five-sticker.js +2 -2
  46. package/umd/five-vfx.js +1 -1
  47. package/umd/five-vue.js +1 -1
  48. package/umd/five.js +20 -20
  49. package/vfx/index.js +1 -1
  50. package/vfx/index.mjs +1 -1
  51. package/vue/index.js +1 -1
  52. package/vue/index.mjs +1 -1
  53. package/work-downloader/index.js +1 -1
  54. package/work-downloader/index.mjs +1 -1
package/five/index.mjs CHANGED
@@ -2,7 +2,7 @@
2
2
  * @license
3
3
  * @realsee/five
4
4
  * Generated: 9/25/2025
5
- * Version: 6.6.4
5
+ * Version: 6.7.0-alpha.0
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -759,8 +759,8 @@ CryptoJS.lib.Cipher || (function(n) {
759
759
  },
760
760
  _doCryptBlock: function(w, C, I, H, M, B, L, O) {
761
761
  for (var F = this._nRounds, Q = w[C] ^ I[0], V = w[C + 1] ^ I[1], J = w[C + 2] ^ I[2], j = w[C + 3] ^ I[3], N = 4, D = 1; D < F; D++)
762
- var U = H[Q >>> 24] ^ M[V >>> 16 & 255] ^ B[J >>> 8 & 255] ^ L[j & 255] ^ I[N++], z = H[V >>> 24] ^ M[J >>> 16 & 255] ^ B[j >>> 8 & 255] ^ L[Q & 255] ^ I[N++], G = H[J >>> 24] ^ M[j >>> 16 & 255] ^ B[Q >>> 8 & 255] ^ L[V & 255] ^ I[N++], j = H[j >>> 24] ^ M[Q >>> 16 & 255] ^ B[V >>> 8 & 255] ^ L[J & 255] ^ I[N++], Q = U, V = z, J = G;
763
- U = (O[Q >>> 24] << 24 | O[V >>> 16 & 255] << 16 | O[J >>> 8 & 255] << 8 | O[j & 255]) ^ I[N++], z = (O[V >>> 24] << 24 | O[J >>> 16 & 255] << 16 | O[j >>> 8 & 255] << 8 | O[Q & 255]) ^ I[N++], G = (O[J >>> 24] << 24 | O[j >>> 16 & 255] << 16 | O[Q >>> 8 & 255] << 8 | O[V & 255]) ^ I[N++], j = (O[j >>> 24] << 24 | O[Q >>> 16 & 255] << 16 | O[V >>> 8 & 255] << 8 | O[J & 255]) ^ I[N++], w[C] = U, w[C + 1] = z, w[C + 2] = G, w[C + 3] = j;
762
+ var U = H[Q >>> 24] ^ M[V >>> 16 & 255] ^ B[J >>> 8 & 255] ^ L[j & 255] ^ I[N++], z = H[V >>> 24] ^ M[J >>> 16 & 255] ^ B[j >>> 8 & 255] ^ L[Q & 255] ^ I[N++], K = H[J >>> 24] ^ M[j >>> 16 & 255] ^ B[Q >>> 8 & 255] ^ L[V & 255] ^ I[N++], j = H[j >>> 24] ^ M[Q >>> 16 & 255] ^ B[V >>> 8 & 255] ^ L[J & 255] ^ I[N++], Q = U, V = z, J = K;
763
+ U = (O[Q >>> 24] << 24 | O[V >>> 16 & 255] << 16 | O[J >>> 8 & 255] << 8 | O[j & 255]) ^ I[N++], z = (O[V >>> 24] << 24 | O[J >>> 16 & 255] << 16 | O[j >>> 8 & 255] << 8 | O[Q & 255]) ^ I[N++], K = (O[J >>> 24] << 24 | O[j >>> 16 & 255] << 16 | O[Q >>> 8 & 255] << 8 | O[V & 255]) ^ I[N++], j = (O[j >>> 24] << 24 | O[Q >>> 16 & 255] << 16 | O[V >>> 8 & 255] << 8 | O[J & 255]) ^ I[N++], w[C] = U, w[C + 1] = z, w[C + 2] = K, w[C + 3] = j;
764
764
  },
765
765
  keySize: 8
766
766
  });
@@ -3191,8 +3191,8 @@ function X509(n) {
3191
3191
  var z = JSON.stringify(U.array).replace(/[\[\]\{\}\"]/g, "");
3192
3192
  return z;
3193
3193
  }, E = function(U) {
3194
- for (var z = "", G = U.array, j = 0; j < G.length; j++) {
3195
- var Q = G[j];
3194
+ for (var z = "", K = U.array, j = 0; j < K.length; j++) {
3195
+ var Q = K[j];
3196
3196
  if (z += " policy oid: " + Q.policyoid + `
3197
3197
  `, Q.array !== void 0)
3198
3198
  for (var V = 0; V < Q.array.length; V++) {
@@ -3203,8 +3203,8 @@ function X509(n) {
3203
3203
  }
3204
3204
  return z;
3205
3205
  }, b = function(U) {
3206
- for (var z = "", G = U.array, j = 0; j < G.length; j++) {
3207
- var Q = G[j];
3206
+ for (var z = "", K = U.array, j = 0; j < K.length; j++) {
3207
+ var Q = K[j];
3208
3208
  try {
3209
3209
  Q.dpname.full[0].uri !== void 0 && (z += " " + Q.dpname.full[0].uri + `
3210
3210
  `);
@@ -3218,8 +3218,8 @@ function X509(n) {
3218
3218
  }
3219
3219
  return z;
3220
3220
  }, T = function(U) {
3221
- for (var z = "", G = U.array, j = 0; j < G.length; j++) {
3222
- var Q = G[j];
3221
+ for (var z = "", K = U.array, j = 0; j < K.length; j++) {
3222
+ var Q = K[j];
3223
3223
  Q.caissuer !== void 0 && (z += " caissuer: " + Q.caissuer + `
3224
3224
  `), Q.ocsp !== void 0 && (z += " ocsp: " + Q.ocsp + `
3225
3225
  `);
@@ -3951,8 +3951,8 @@ var PBMCustomShader = (
3951
3951
  `));
3952
3952
  var U = String(r.clippers.length);
3953
3953
  v.vertexShader = v.vertexShader.replace(/NUM_CLIPPERS/g, U), v.fragmentShader = v.fragmentShader.replace(/NUM_CLIPPERS/g, U);
3954
- for (var z = 0, G = B; z < G.length; z++) {
3955
- var j = G[z];
3954
+ for (var z = 0, K = B; z < K.length; z++) {
3955
+ var j = K[z];
3956
3956
  j.onBeforeCompile && j.onBeforeCompile(v, E);
3957
3957
  }
3958
3958
  };
@@ -5207,8 +5207,8 @@ function ajax(n, t, e, r, o) {
5207
5207
  }
5208
5208
  var O = C.split(","), F = (O[0].match(/:(.*?);/) || [])[1], N = O[1];
5209
5209
  if (t.responseType === "arraybuffer" || t.responseType === "blob") {
5210
- for (var D = atob(O[1]), U = D.length, z = new Uint8Array(U), G = 0; G < U; G++)
5211
- z[G] = D.charCodeAt(G);
5210
+ for (var D = atob(O[1]), U = D.length, z = new Uint8Array(U), K = 0; K < U; K++)
5211
+ z[K] = D.charCodeAt(K);
5212
5212
  t.responseType === "arraybuffer" ? N = z.buffer : N = new Blob([z], { type: F });
5213
5213
  }
5214
5214
  var j = {}, Q = {
@@ -5271,29 +5271,31 @@ function preload(n, t) {
5271
5271
  return (s = t.networkSubscribe) === null || s === void 0 || s.emit("network", n, "Link", "forbidden", u.message), Promise.reject(u);
5272
5272
  }).then(function(o) {
5273
5273
  return o in preloadCache ? preloadCache[o] : preloadCache[o] = new Promise(function(s, u) {
5274
- var l = document.head || document.getElementsByTagName("head")[0], c = document.createElement("link"), f = !1, d = null;
5275
- c.onload = function(h) {
5274
+ var l = document.createElement("link"), c = !1, f = null;
5275
+ l.onload = function(h) {
5276
5276
  var p;
5277
- if (d !== null && (clearTimeout(d), d = null), f !== !0) {
5278
- f = !0, s(), c.onerror = noop, c.onload = noop;
5277
+ if (f !== null && (clearTimeout(f), f = null), c !== !0) {
5278
+ c = !0, s();
5279
5279
  var m = now(), A = m - e, g = {}, y = { origin: r, source: o, requestTime: e, responseTime: m, costs: A, headers: g };
5280
5280
  (p = t.networkSubscribe) === null || p === void 0 || p.emit("network", o, "Link", "preload", JSON.stringify(y));
5281
5281
  }
5282
- }, c.onerror = function(h) {
5282
+ }, l.onerror = function(h) {
5283
5283
  var p;
5284
- if (d !== null && (clearTimeout(d), d = null), f !== !0) {
5285
- f = !0, delete preloadCache[o], l && c.parentNode === l && l.removeChild(c);
5284
+ if (f !== null && (clearTimeout(f), f = null), c !== !0) {
5285
+ c = !0;
5286
5286
  var m = new NetworkResponseError(o, "Link", 0);
5287
- u(m), c.onerror = noop, c.onload = noop, (p = t.networkSubscribe) === null || p === void 0 || p.emit("network", o, "Link", "error", m.message);
5287
+ u(m), (p = t.networkSubscribe) === null || p === void 0 || p.emit("network", o, "Link", "error", m.message);
5288
5288
  }
5289
- }, typeof t.timeout == "number" && (d = window.setTimeout(function() {
5289
+ }, typeof t.timeout == "number" && (f = window.setTimeout(function() {
5290
5290
  var h;
5291
- if (d = null, f !== !0) {
5292
- f = !0, s(), c.onerror = noop, c.onload = noop;
5291
+ if (f = null, c !== !0) {
5292
+ c = !0, s();
5293
5293
  var p = now(), m = p - e, A = {}, g = { origin: r, source: o, requestTime: e, responseTime: p, costs: m, headers: A };
5294
5294
  (h = t.networkSubscribe) === null || h === void 0 || h.emit("network", o, "Link", "timeout", JSON.stringify(g));
5295
5295
  }
5296
- }, t.timeout)), c.rel = c.relList && c.relList.supports("prefetch") ? "prefetch" : "preload", c.as = "fetch", c.crossOrigin = "", c.fetchPriority = "high", c.href = o, l && l.appendChild(c);
5296
+ }, t.timeout)), l.rel = l.relList && l.relList.supports("prefetch") ? "prefetch" : "preload", l.as = "fetch", l.crossOrigin = "", l.fetchPriority = "high", l.href = o;
5297
+ var d = document.head || document.getElementsByTagName("head")[0];
5298
+ d && d.appendChild(l);
5297
5299
  });
5298
5300
  });
5299
5301
  }
@@ -5427,6 +5429,17 @@ function omitUndefinedFields(n) {
5427
5429
  }
5428
5430
  return t;
5429
5431
  }
5432
+ var hrefAElement = typeof document != "undefined" ? document.createElement("a") : { href: "" };
5433
+ function isAbsoluteURL(n) {
5434
+ return n.indexOf("/") === 0 || /^[0-9a-z]+\:/i.test(n);
5435
+ }
5436
+ function getFullURL(n) {
5437
+ if (typeof URL != "undefined")
5438
+ return new URL(n, location.href).href;
5439
+ hrefAElement.href = n;
5440
+ var t = hrefAElement.href;
5441
+ return hrefAElement.href = "", t;
5442
+ }
5430
5443
  function pathJoin() {
5431
5444
  for (var n = [], t = 0; t < arguments.length; t++)
5432
5445
  n[t] = arguments[t];
@@ -5442,8 +5455,31 @@ function pathJoin() {
5442
5455
  }
5443
5456
  return e.join("/");
5444
5457
  }
5445
- function isAbsoluteURL(n) {
5446
- return n.indexOf("/") === 0 || /^[0-9a-z]+\:/i.test(n);
5458
+ function appendSearch(n, t) {
5459
+ if (t === void 0 && (t = ""), (t[0] === "?" || t[0] === "&") && (t = t.slice(1)), !t)
5460
+ return n;
5461
+ var e = n.indexOf("#"), r = "";
5462
+ return e >= 0 && (r = n.slice(e), n = n.slice(0, e)), (n[n.length - 1] === "?" || n[n.length - 1] === "&") && (n = n.slice(0, -1)), n.indexOf("?") >= 0 ? "".concat(n, "&").concat(t).concat(r) : "".concat(n, "?").concat(t).concat(r);
5463
+ }
5464
+ function normalizeURL(n) {
5465
+ var t, e = /^(http\:|https\:|file\:)?\/\/[^/]/.exec(n);
5466
+ if (!e)
5467
+ return n;
5468
+ var r = e[1] || "", o = n.slice(r.length + 2), s = o.indexOf("#");
5469
+ s >= 0 && (n.slice(s), o = n.slice(0, s));
5470
+ var u = o.indexOf("?");
5471
+ u >= 0 && (n.slice(u), o = n.slice(0, u));
5472
+ for (var l = o.split("/"), c = l.shift(), f = (t = l.pop()) !== null && t !== void 0 ? t : "", d = [], h = 0, p = l; h < p.length; h++) {
5473
+ var m = p[h];
5474
+ if (!(m === "" || m === ".")) {
5475
+ if (m === "..") {
5476
+ d.pop();
5477
+ continue;
5478
+ }
5479
+ d.push(m);
5480
+ }
5481
+ }
5482
+ return r + "//" + c + "/" + d.join("/") + "/" + f;
5447
5483
  }
5448
5484
  var webp = "data:image/webp;base64,UklGRiQAAABXRUJQVlA4IBgAAAAwAQCdASoCAAIAAUAmJaQAA3AA/vz0AAA=", avif = "data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAAGhbWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAsaWxvYwAAAABEAAACAAEAAAABAAAB3gAAABkAAgAAAAEAAAHJAAAAFQAAAEJpaW5mAAAAAAACAAAAGmluZmUCAAAAAAEAAGF2MDFDb2xvcgAAAAAaaW5mZQIAAAAAAgAAYXYwMUFscGhhAAAAABppcmVmAAAAAAAAAA5hdXhsAAIAAQABAAAA12lwcnAAAACxaXBjbwAAABRpc3BlAAAAAAAAAAIAAAACAAAAEHBpeGkAAAAAAwgICAAAAAxhdjFDgQAMAAAAABNjb2xybmNseAACAAIAAoAAAAAUaXNwZQAAAAAAAAACAAAAAgAAAA5waXhpAAAAAAEIAAAADGF2MUOBABwAAAAAOGF1eEMAAAAAdXJuOm1wZWc6bXBlZ0I6Y2ljcDpzeXN0ZW1zOmF1eGlsaWFyeTphbHBoYQAAAAAeaXBtYQAAAAAAAAACAAEEAQKDBAACBAUGhwgAAAA2bWRhdBIACgQYADLVMgsWQBhhIAQqrNj/+BIACgUYADLEoDIOFkADDDDCQAACDaqCCb4=", heif = "data:image/heif;base64,AAAAGGZ0eXBoZWljAAAAAG1pZjFoZWljAAABL21ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAHBpY3QAAAAAAAAAAAAAAAAAAAAADnBpdG0AAAAAAAEAAAAjaWluZgAAAAAAAQAAABVpbmZlAgAAAAABAABodmMxAAAAAK9pcHJwAAAAkmlwY28AAAB2aHZjQwEBYAAAAAAAAAAAAADwAPz9+PgAACcDoAABAB5AAQwG//8BYAAAAwAAAwAAAwAAAwAAAwAAreTLgSChAAEAI0IBBwFgAAADAAADAAADAAADAAADAAChInJJlreTLySZNdggogABAAdEAcA98DMkAAAAFGlzcGUAAAAAAAAAAgAAAAIAAAAVaXBtYQAAAAAAAAABAAECgQIAAAAiaWxvYwAAAABEQAABAAEAAAAAAU8AAQAAAAAAAAAOAAAAFm1kYXQAAAAKJgGvLvkQwuWM4A==";
5449
5485
  function checkImage(n) {
@@ -6075,38 +6111,7 @@ var FACE_ORDER$2 = ["right", "left", "up", "down", "front", "back"], TextureLoad
6075
6111
  });
6076
6112
  }, n;
6077
6113
  })()
6078
- ), dequeuing = !1, queue = [];
6079
- function dequeue(n) {
6080
- if (n === void 0 && (n = !1), !(!n && dequeuing)) {
6081
- dequeuing = !0;
6082
- var t = queue.shift();
6083
- if (t) {
6084
- try {
6085
- t();
6086
- } catch (e) {
6087
- }
6088
- AnimationFrameLoop.shared.add(function() {
6089
- return dequeue(!0);
6090
- }, !0, 2, -100);
6091
- } else
6092
- dequeuing = !1;
6093
- }
6094
- }
6095
- function delay$1(n) {
6096
- return new Promise(function(t, e) {
6097
- var r = function() {
6098
- try {
6099
- t(n());
6100
- } catch (o) {
6101
- e(o);
6102
- }
6103
- };
6104
- queue.push(r), AnimationFrameLoop.shared.add(function() {
6105
- return dequeue();
6106
- }, !0, 2, -100);
6107
- });
6108
- }
6109
- var commonjsGlobal = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {}, indexMinimal = {}, minimal$1 = {}, aspromise, hasRequiredAspromise;
6114
+ ), commonjsGlobal = typeof globalThis != "undefined" ? globalThis : typeof window != "undefined" ? window : typeof global != "undefined" ? global : typeof self != "undefined" ? self : {}, indexMinimal = {}, minimal$1 = {}, aspromise, hasRequiredAspromise;
6110
6115
  function requireAspromise() {
6111
6116
  if (hasRequiredAspromise) return aspromise;
6112
6117
  hasRequiredAspromise = 1, aspromise = n;
@@ -7374,14 +7379,11 @@ function loadPbm(n, t) {
7374
7379
  responseType: "arraybuffer"
7375
7380
  });
7376
7381
  }).then(function(b) {
7377
- return E.byteLength = b.body.byteLength, delay$1(function() {
7378
- var T = new Uint8Array(b.body);
7379
- return Model$2.decode(T);
7380
- });
7382
+ E.byteLength = b.body.byteLength;
7383
+ var T = new Uint8Array(b.body);
7384
+ return Model$2.decode(T);
7381
7385
  }).then(function(b) {
7382
- return delay$1(function() {
7383
- return parse$4(b, f, h, p, m, A, d);
7384
- });
7386
+ return parse$4(b, f, h, p, m, A, d);
7385
7387
  }).then(function(b) {
7386
7388
  A.clear();
7387
7389
  var T = new THREE.Group();
@@ -7452,9 +7454,9 @@ function parsePBMModel(n) {
7452
7454
  S += h.faces.indices.length;
7453
7455
  }
7454
7456
  for (var w = new Float32Array(S * 3), C = new Float32Array(S * 2), I = new Float32Array(S * 3), H = c ? new Float32Array(S) : void 0, M = [], B = [1 / 0, 1 / 0, 1 / 0, -1 / 0, -1 / 0, -1 / 0], L = 0, O = 0; O < T.length; O++) {
7455
- for (var F = [1 / 0, 1 / 0, 1 / 0, -1 / 0, -1 / 0, -1 / 0], h = T[O], N = h.vertices.xyz, D = h.vertices.uvs, U = h.faces.indices, z = h.faces.normals, G = h.vertices.marks, j = U.length, R = 0; R < j; R++) {
7457
+ for (var F = [1 / 0, 1 / 0, 1 / 0, -1 / 0, -1 / 0, -1 / 0], h = T[O], N = h.vertices.xyz, D = h.vertices.uvs, U = h.faces.indices, z = h.faces.normals, K = h.vertices.marks, j = U.length, R = 0; R < j; R++) {
7456
7458
  var Q = U[R], V = w[L * 3 + R * 3] = N[Q * 3], J = w[L * 3 + R * 3 + 1] = N[Q * 3 + 1], W = w[L * 3 + R * 3 + 2] = N[Q * 3 + 2];
7457
- H && (H[L + R] = G[Q]), C[L * 2 + R * 2] = D[Q * 2], C[L * 2 + R * 2 + 1] = D[Q * 2 + 1];
7459
+ H && (H[L + R] = K[Q]), C[L * 2 + R * 2] = D[Q * 2], C[L * 2 + R * 2 + 1] = D[Q * 2 + 1];
7458
7460
  var X = Math.floor(R / 3) * 3;
7459
7461
  I[L * 3 + R * 3] = z[X], I[L * 3 + R * 3 + 1] = z[X + 1], I[L * 3 + R * 3 + 2] = z[X + 2], V < F[0] && (F[0] = V), J < F[1] && (F[1] = J), W < F[2] && (F[2] = W), V > F[3] && (F[3] = V), J > F[4] && (F[4] = J), W > F[5] && (F[5] = W);
7460
7462
  }
@@ -7485,10 +7487,10 @@ function parsePBMModel(n) {
7485
7487
  var h = T[R];
7486
7488
  Y += h.vertices.xyz.length / 3, S += h.faces.indices.length;
7487
7489
  }
7488
- for (var w = new Float32Array(Y * 3), C = new Float32Array(Y * 2), I = void 0, K = new Float32Array(Y), ee = new Uint32Array(S), H = c ? new Float32Array(S) : void 0, M = [], B = [1 / 0, 1 / 0, 1 / 0, -1 / 0, -1 / 0, -1 / 0], te = 0, L = 0, O = 0; O < T.length; O++) {
7489
- for (var F = [1 / 0, 1 / 0, 1 / 0, -1 / 0, -1 / 0, -1 / 0], h = T[O], N = h.vertices.xyz, re = h.vertices.marks, D = h.vertices.uvs, U = h.faces.indices, ie = N.length / 3, j = U.length, R = 0; R < ie; R++) {
7490
+ for (var w = new Float32Array(Y * 3), C = new Float32Array(Y * 2), I = void 0, G = new Float32Array(Y), ee = new Uint32Array(S), H = c ? new Float32Array(S) : void 0, M = [], B = [1 / 0, 1 / 0, 1 / 0, -1 / 0, -1 / 0, -1 / 0], te = 0, L = 0, O = 0; O < T.length; O++) {
7491
+ for (var F = [1 / 0, 1 / 0, 1 / 0, -1 / 0, -1 / 0, -1 / 0], h = T[O], N = h.vertices.xyz, ne = h.vertices.marks, D = h.vertices.uvs, U = h.faces.indices, ie = N.length / 3, j = U.length, R = 0; R < ie; R++) {
7490
7492
  var V = w[L * 3 + R * 3] = N[R * 3], J = w[L * 3 + R * 3 + 1] = N[R * 3 + 1], W = w[L * 3 + R * 3 + 2] = N[R * 3 + 2];
7491
- H && (H[L + R] = re[R]), C[L * 2 + R * 2] = D[R * 2], C[L * 2 + R * 2 + 1] = D[R * 2 + 1], K[L + R] = b, V < F[0] && (F[0] = V), J < F[1] && (F[1] = J), W < F[2] && (F[2] = W), V > F[3] && (F[3] = V), J > F[4] && (F[4] = J), W > F[5] && (F[5] = W);
7493
+ H && (H[L + R] = ne[R]), C[L * 2 + R * 2] = D[R * 2], C[L * 2 + R * 2 + 1] = D[R * 2 + 1], G[L + R] = b, V < F[0] && (F[0] = V), J < F[1] && (F[1] = J), W < F[2] && (F[2] = W), V > F[3] && (F[3] = V), J > F[4] && (F[4] = J), W > F[5] && (F[5] = W);
7492
7494
  }
7493
7495
  F[0] < B[0] && (B[0] = F[0]), F[1] < B[1] && (B[1] = F[1]), F[2] < B[2] && (B[2] = F[2]), F[3] > B[3] && (B[3] = F[3]), F[4] > B[4] && (B[4] = F[4]), F[5] > B[5] && (B[5] = F[5]);
7494
7496
  for (var R = 0; R < j; R++)
@@ -7552,8 +7554,8 @@ function parse$4(n, t, e, r, o, s, u) {
7552
7554
  var F = U[D], z = void 0;
7553
7555
  if (F.texture) {
7554
7556
  if (z = F.texture, r.length > 0 && r.indexOf(F.texture) === -1) {
7555
- for (var G = 0, j = r; G < j.length; G++) {
7556
- var Q = j[G], V = isAbsoluteURL(Q) ? Q : pathJoin(e, Q), J = V.slice(F.texture.length * -1) === F.texture;
7557
+ for (var K = 0, j = r; K < j.length; K++) {
7558
+ var Q = j[K], V = isAbsoluteURL(Q) ? Q : pathJoin(e, Q), J = V.slice(F.texture.length * -1) === F.texture;
7557
7559
  if (J) {
7558
7560
  z = Q;
7559
7561
  break;
@@ -7570,27 +7572,27 @@ function parse$4(n, t, e, r, o, s, u) {
7570
7572
  X.name = "model_floor_" + C, X.userData.createAt = v, X.userData.description = E, X.matrix.compose(X.position, X.quaternion, X.scale), X.matrixAutoUpdate = !1, X.frustumCulled = !1, c = v, f = E, d.push(X);
7571
7573
  }
7572
7574
  o = autoRestImageOptionsByTextureLength(o, m);
7573
- for (var Z = [], Y = function(re) {
7575
+ for (var Z = [], Y = function(ne) {
7574
7576
  var ie = void 0;
7575
- s && (ie = s.get(re)), ie || (ie = loadTexture$1(re, e, o, u), s && s.set(re, ie)), Z.push(ie.then(function(ce) {
7576
- for (var ae = 0, de = h[re]; ae < de.length; ae++) {
7577
+ s && (ie = s.get(ne)), ie || (ie = loadTexture$1(ne, e, o, u), s && s.set(ne, ie)), Z.push(ie.then(function(ce) {
7578
+ for (var ae = 0, de = h[ne]; ae < de.length; ae++) {
7577
7579
  var ge = de[ae];
7578
7580
  ge.map && (p.delete(ge.map), ge.map.dispose()), ge.map = ce, p.add(ce);
7579
7581
  }
7580
7582
  return ce;
7581
7583
  }).catch(function() {
7582
- for (var ce = 0, ae = h[re]; ce < ae.length; ce++) {
7584
+ for (var ce = 0, ae = h[ne]; ce < ae.length; ce++) {
7583
7585
  var de = ae[ce];
7584
7586
  de.map && (p.delete(de.map), de.map.dispose()), de.map = null, de.color = new THREE.Color(16777215);
7585
7587
  }
7586
7588
  return null;
7587
7589
  }));
7588
- }, K = 0, ee = Object.keys(h); K < ee.length; K++) {
7589
- var te = ee[K];
7590
+ }, G = 0, ee = Object.keys(h); G < ee.length; G++) {
7591
+ var te = ee[G];
7590
7592
  Y(te);
7591
7593
  }
7592
- return Promise.all(Z).then(function(re) {
7593
- var ie = re.filter(function(ce) {
7594
+ return Promise.all(Z).then(function(ne) {
7595
+ var ie = ne.filter(function(ce) {
7594
7596
  return ce instanceof THREE.Texture;
7595
7597
  });
7596
7598
  return {
@@ -7972,21 +7974,17 @@ function loadAt3d(n, t) {
7972
7974
  }).then(function(b) {
7973
7975
  return lzma(b.body);
7974
7976
  }).then(function(b) {
7975
- return delay$1(function() {
7976
- for (var T, S = {
7977
- chunks: [],
7978
- createAt: void 0,
7979
- description: void 0
7980
- }, R = 0, w = b; R < w.length; R++) {
7981
- var C = w[R], I = Model$2.decode(C);
7982
- I.chunks.length && ((T = S.chunks).push.apply(T, I.chunks), S.createAt = I.createAt, S.description = I.description);
7983
- }
7984
- return S;
7985
- });
7977
+ for (var T, S = {
7978
+ chunks: [],
7979
+ createAt: void 0,
7980
+ description: void 0
7981
+ }, R = 0, w = b; R < w.length; R++) {
7982
+ var C = w[R], I = Model$2.decode(C);
7983
+ I.chunks.length && ((T = S.chunks).push.apply(T, I.chunks), S.createAt = I.createAt, S.description = I.description);
7984
+ }
7985
+ return S;
7986
7986
  }).then(function(b) {
7987
- return delay$1(function() {
7988
- return parse$4(b, f, h, p, m, A, d);
7989
- });
7987
+ return parse$4(b, f, h, p, m, A, d);
7990
7988
  }).then(function(b) {
7991
7989
  A.clear();
7992
7990
  var T = new THREE.Group();
@@ -8581,8 +8579,8 @@ function parse$3(n, t, e, r, o) {
8581
8579
  objects: s,
8582
8580
  textures: Array.from(g),
8583
8581
  dispose: function() {
8584
- l.forEach(function(G) {
8585
- G.dispose();
8582
+ l.forEach(function(K) {
8583
+ K.dispose();
8586
8584
  }), l.clear();
8587
8585
  }
8588
8586
  };
@@ -8866,12 +8864,6 @@ function values(n) {
8866
8864
  t.push(n[e]);
8867
8865
  return t;
8868
8866
  }
8869
- function appendSearch(n, t) {
8870
- if (t === void 0 && (t = ""), (t[0] === "?" || t[0] === "&") && (t = t.slice(1)), !t)
8871
- return n;
8872
- var e = n.indexOf("#"), r = "";
8873
- return e >= 0 && (r = n.slice(e), n = n.slice(0, e)), (n[n.length - 1] === "?" || n[n.length - 1] === "&") && (n = n.slice(0, -1)), n.indexOf("?") >= 0 ? "".concat(n, "&").concat(t).concat(r) : "".concat(n, "?").concat(t).concat(r);
8874
- }
8875
8867
  function composeDsiposeSet(n) {
8876
8868
  var t = Array.from(n);
8877
8869
  return function() {
@@ -8995,10 +8987,10 @@ var Parser = (
8995
8987
  Promise.all(A)
8996
8988
  ]).then(function(w) {
8997
8989
  for (var C = w[0], I = w[1], H = w[2], M = w[3], B = w[4], L = [], O = function(U, z) {
8998
- var G = C[U], j = I[U], Q = H[U], V = M[U], J = B[U];
8999
- if (G === void 0)
8990
+ var K = C[U], j = I[U], Q = H[U], V = M[U], J = B[U];
8991
+ if (K === void 0)
9000
8992
  return "continue";
9001
- G.updateMatrix(), G.matrixAutoUpdate = !0;
8993
+ K.updateMatrix(), K.matrixAutoUpdate = !0;
9002
8994
  var W = void 0;
9003
8995
  switch (PATH_PROPERTIES[J.path]) {
9004
8996
  case PATH_PROPERTIES.weights:
@@ -9013,18 +9005,18 @@ var Parser = (
9013
9005
  W = THREE.VectorKeyframeTrack;
9014
9006
  break;
9015
9007
  }
9016
- var X = G.name ? G.name : G.uuid, Z = V.interpolation !== void 0 ? INTERPOLATION[V.interpolation] : THREE.InterpolateLinear, Y = [];
9017
- PATH_PROPERTIES[J.path] === PATH_PROPERTIES.weights ? G.traverse(function(ae) {
9008
+ var X = K.name ? K.name : K.uuid, Z = V.interpolation !== void 0 ? INTERPOLATION[V.interpolation] : THREE.InterpolateLinear, Y = [];
9009
+ PATH_PROPERTIES[J.path] === PATH_PROPERTIES.weights ? K.traverse(function(ae) {
9018
9010
  ae.morphTargetInfluences && Y.push(ae.name ? ae.name : ae.uuid);
9019
9011
  }) : Y.push(X);
9020
- var K = Q.array;
9012
+ var G = Q.array;
9021
9013
  if (Q.normalized) {
9022
- for (var ee = getNormalizedComponentScale(K.constructor), te = new Float32Array(K.length), re = 0, ie = K.length; re < ie; re++)
9023
- te[re] = K[re] * ee;
9024
- K = te;
9014
+ for (var ee = getNormalizedComponentScale(G.constructor), te = new Float32Array(G.length), ne = 0, ie = G.length; ne < ie; ne++)
9015
+ te[ne] = G[ne] * ee;
9016
+ G = te;
9025
9017
  }
9026
- for (var re = 0, ie = Y.length; re < ie; re++) {
9027
- var ce = new W(Y[re] + "." + PATH_PROPERTIES[J.path], j.array, K, Z);
9018
+ for (var ne = 0, ie = Y.length; ne < ie; ne++) {
9019
+ var ce = new W(Y[ne] + "." + PATH_PROPERTIES[J.path], j.array, G, Z);
9028
9020
  L.push(ce);
9029
9021
  }
9030
9022
  }, F = 0, N = C.length; F < N; F++)
@@ -11658,9 +11650,9 @@ var flrm = /* @__PURE__ */ hMap(flt, 9, 1), fdrm = /* @__PURE__ */ hMap(fdt, 5,
11658
11650
  var u = !e, l = u || t.i != 2, c = t.i;
11659
11651
  u && (e = new u8(o * 3));
11660
11652
  var f = function(te) {
11661
- var re = e.length;
11662
- if (te > re) {
11663
- var ie = new u8(Math.max(re * 2, te));
11653
+ var ne = e.length;
11654
+ if (te > ne) {
11655
+ var ie = new u8(Math.max(ne * 2, te));
11664
11656
  ie.set(e), e = ie;
11665
11657
  }
11666
11658
  }, d = t.f || 0, h = t.p || 0, p = t.b || 0, m = t.l, A = t.d, g = t.m, y = t.n, v = o * 8;
@@ -11708,8 +11700,8 @@ var flrm = /* @__PURE__ */ hMap(flt, 9, 1), fdrm = /* @__PURE__ */ hMap(fdt, 5,
11708
11700
  }
11709
11701
  }
11710
11702
  l && f(p + 131072);
11711
- for (var G = (1 << g) - 1, j = (1 << y) - 1, Q = h; ; Q = h) {
11712
- var N = m[bits16(n, h) & G], V = N >> 4;
11703
+ for (var K = (1 << g) - 1, j = (1 << y) - 1, Q = h; ; Q = h) {
11704
+ var N = m[bits16(n, h) & K], V = N >> 4;
11713
11705
  if (h += N & 15, h > v) {
11714
11706
  c && err(0);
11715
11707
  break;
@@ -11739,9 +11731,9 @@ var flrm = /* @__PURE__ */ hMap(flt, 9, 1), fdrm = /* @__PURE__ */ hMap(fdt, 5,
11739
11731
  l && f(p + 131072);
11740
11732
  var Y = p + J;
11741
11733
  if (p < z) {
11742
- var K = s - z, ee = Math.min(z, Y);
11743
- for (K + p < 0 && err(3); p < ee; ++p)
11744
- e[p] = r[K + p];
11734
+ var G = s - z, ee = Math.min(z, Y);
11735
+ for (G + p < 0 && err(3); p < ee; ++p)
11736
+ e[p] = r[G + p];
11745
11737
  }
11746
11738
  for (; p < Y; ++p)
11747
11739
  e[p] = e[p - z];
@@ -13439,15 +13431,15 @@ function loadX3p(n, t) {
13439
13431
  });
13440
13432
  }
13441
13433
  function parse$1(n, t) {
13442
- for (var e, r, o, s, u, l, c, f, d, h, p, m, A, g, y, v, E, b, T, S, R, w, C, I, H, M, B, L, O, F, N, D, U, z, G, j, Q, V, J, W, X, Z, Y, K, ee, te, re, ie, ce, ae, de, ge, ye, xe, le = unzipSync(n), he = "", ne = null, se = 0, pe = Object.keys(le); se < pe.length; se++) {
13434
+ for (var e, r, o, s, u, l, c, f, d, h, p, m, A, g, y, v, E, b, T, S, R, w, C, I, H, M, B, L, O, F, N, D, U, z, K, j, Q, V, J, W, X, Z, Y, G, ee, te, ne, ie, ce, ae, de, ge, ye, xe, le = unzipSync(n), he = "", re = null, se = 0, pe = Object.keys(le); se < pe.length; se++) {
13443
13435
  var me = pe[se];
13444
- /(^|\/)main\.xml$/i.test(me) && (ne = le[me], he = me.slice(0, me.lastIndexOf("/") + 1));
13436
+ /(^|\/)main\.xml$/i.test(me) && (re = le[me], he = me.slice(0, me.lastIndexOf("/") + 1));
13445
13437
  }
13446
- if (!ne)
13438
+ if (!re)
13447
13439
  throw new Error("X3p: main.xml not found.");
13448
13440
  if (typeof DOMParser == "undefined")
13449
13441
  throw new Error("X3p: DOMParser not found.");
13450
- var Ne = (e = t.color) !== null && e !== void 0 ? e : new THREE.Color(10066329), qe = new DOMParser(), Ye = decodeText(ne), Ve = qe.parseFromString(Ye, "text/xml"), ve = Ve.querySelector("Record1 Axes"), Ke = {
13442
+ var Ne = (e = t.color) !== null && e !== void 0 ? e : new THREE.Color(10066329), qe = new DOMParser(), Ye = decodeText(re), Ve = qe.parseFromString(Ye, "text/xml"), ve = Ve.querySelector("Record1 Axes"), Ke = {
13451
13443
  x: {
13452
13444
  type: (s = (o = (r = ve == null ? void 0 : ve.querySelector("CX AxisType")) === null || r === void 0 ? void 0 : r.textContent) === null || o === void 0 ? void 0 : o.toUpperCase()) !== null && s !== void 0 ? s : "I",
13453
13445
  dataType: (c = (l = (u = ve == null ? void 0 : ve.querySelector("CX DataType")) === null || u === void 0 ? void 0 : u.textContent) === null || l === void 0 ? void 0 : l.toUpperCase()) !== null && c !== void 0 ? c : "D",
@@ -13467,7 +13459,7 @@ function parse$1(n, t) {
13467
13459
  offset: Number((N = (F = ve == null ? void 0 : ve.querySelector("CZ Offset")) === null || F === void 0 ? void 0 : F.textContent) !== null && N !== void 0 ? N : "0")
13468
13460
  }
13469
13461
  }, Te = null, Le = Ve.querySelector("Record1 Axes Rotation");
13470
- Le && (Te = new THREE.Matrix3(), Te.set(Number((U = (D = Le.querySelector("r11")) === null || D === void 0 ? void 0 : D.textContent) !== null && U !== void 0 ? U : 0), Number((G = (z = Le.querySelector("r12")) === null || z === void 0 ? void 0 : z.textContent) !== null && G !== void 0 ? G : 0), Number((Q = (j = Le.querySelector("r13")) === null || j === void 0 ? void 0 : j.textContent) !== null && Q !== void 0 ? Q : 0), Number((J = (V = Le.querySelector("r21")) === null || V === void 0 ? void 0 : V.textContent) !== null && J !== void 0 ? J : 0), Number((X = (W = Le.querySelector("r22")) === null || W === void 0 ? void 0 : W.textContent) !== null && X !== void 0 ? X : 0), Number((Y = (Z = Le.querySelector("r23")) === null || Z === void 0 ? void 0 : Z.textContent) !== null && Y !== void 0 ? Y : 0), Number((ee = (K = Le.querySelector("r31")) === null || K === void 0 ? void 0 : K.textContent) !== null && ee !== void 0 ? ee : 0), Number((re = (te = Le.querySelector("r32")) === null || te === void 0 ? void 0 : te.textContent) !== null && re !== void 0 ? re : 0), Number((ce = (ie = Le.querySelector("r33")) === null || ie === void 0 ? void 0 : ie.textContent) !== null && ce !== void 0 ? ce : 0)));
13462
+ Le && (Te = new THREE.Matrix3(), Te.set(Number((U = (D = Le.querySelector("r11")) === null || D === void 0 ? void 0 : D.textContent) !== null && U !== void 0 ? U : 0), Number((K = (z = Le.querySelector("r12")) === null || z === void 0 ? void 0 : z.textContent) !== null && K !== void 0 ? K : 0), Number((Q = (j = Le.querySelector("r13")) === null || j === void 0 ? void 0 : j.textContent) !== null && Q !== void 0 ? Q : 0), Number((J = (V = Le.querySelector("r21")) === null || V === void 0 ? void 0 : V.textContent) !== null && J !== void 0 ? J : 0), Number((X = (W = Le.querySelector("r22")) === null || W === void 0 ? void 0 : W.textContent) !== null && X !== void 0 ? X : 0), Number((Y = (Z = Le.querySelector("r23")) === null || Z === void 0 ? void 0 : Z.textContent) !== null && Y !== void 0 ? Y : 0), Number((ee = (G = Le.querySelector("r31")) === null || G === void 0 ? void 0 : G.textContent) !== null && ee !== void 0 ? ee : 0), Number((ne = (te = Le.querySelector("r32")) === null || te === void 0 ? void 0 : te.textContent) !== null && ne !== void 0 ? ne : 0), Number((ce = (ie = Le.querySelector("r33")) === null || ie === void 0 ? void 0 : ie.textContent) !== null && ce !== void 0 ? ce : 0)));
13471
13463
  var Ie = (ae = Ve.querySelector("Record3 DataLink PointDataLink")) === null || ae === void 0 ? void 0 : ae.textContent;
13472
13464
  if (typeof Ie != "string")
13473
13465
  throw new Error("X3p: PointDataLink not found.");
@@ -14103,8 +14095,8 @@ var BVHVector3 = (
14103
14095
  function F(N) {
14104
14096
  var D = N.startIndex, U = N.endIndex, z = N.extents;
14105
14097
  B[0] = z[3] - z[0], B[1] = z[4] - z[1], B[2] = z[5] - z[2], L.sort(O);
14106
- for (var G = 0; G < 3; G++) {
14107
- for (var j = L[G], Q = z[j] + z[j + 3], V = D, J = U - 1, W = -1, X = void 0; V <= J; )
14098
+ for (var K = 0; K < 3; K++) {
14099
+ for (var j = L[K], Q = z[j] + z[j + 3], V = D, J = U - 1, W = -1, X = void 0; V <= J; )
14108
14100
  W === -1 ? (X = u[V], l[X * 6 + j] + l[X * 6 + j + 3] < Q ? V++ : W = X) : (X = u[J], l[X * 6 + j] + l[X * 6 + j + 3] >= Q || (u[V] = X, u[J] = W, W = -1, V++), J--);
14109
14101
  if (V > D && V < U) {
14110
14102
  var Z = new BVHNode(++d, calcExtents(u, l, D, V, EPSILON$1), D, V, N.deepth + 1);
@@ -14147,19 +14139,19 @@ var BVHVector3 = (
14147
14139
  this.getPositionByIndex(O, F);
14148
14140
  var N = F.x, D = F.y, U = F.z, z = new BVHVector3(0, 0, 0);
14149
14141
  this.getPositionByIndex(O + 1, z);
14150
- var G = z.x, j = z.y, Q = z.z, V = new BVHVector3(0, 0, 0);
14142
+ var K = z.x, j = z.y, Q = z.z, V = new BVHVector3(0, 0, 0);
14151
14143
  this.getPositionByIndex(O + 2, V);
14152
- var J = V.x, W = V.y, X = V.z, Z = G - N, Y = j - D, K = Q - U, ee = J - N, te = W - D, re = X - U, ie = Y * re - K * te, ce = K * ee - Z * re, ae = Z * te - Y * ee, de = w * ie + C * ce + I * ae, ge = void 0;
14144
+ var J = V.x, W = V.y, X = V.z, Z = K - N, Y = j - D, G = Q - U, ee = J - N, te = W - D, ne = X - U, ie = Y * ne - G * te, ce = G * ee - Z * ne, ae = Z * te - Y * ee, de = w * ie + C * ce + I * ae, ge = void 0;
14153
14145
  if (de > 0)
14154
14146
  ge = 1;
14155
14147
  else if (de < 0)
14156
14148
  ge = -1, de = -de;
14157
14149
  else
14158
14150
  continue;
14159
- var ye = T - N, xe = S - D, le = R - U, he = ge * (w * (xe * re - le * te) + C * (le * ee - ye * re) + I * (ye * te - xe * ee));
14151
+ var ye = T - N, xe = S - D, le = R - U, he = ge * (w * (xe * ne - le * te) + C * (le * ee - ye * ne) + I * (ye * te - xe * ee));
14160
14152
  if (!(he < 0)) {
14161
- var ne = ge * (w * (Y * le - K * xe) + C * (K * ye - Z * le) + I * (Z * xe - Y * ye));
14162
- if (!(ne < 0) && !(he + ne > de)) {
14153
+ var re = ge * (w * (Y * le - G * xe) + C * (G * ye - Z * le) + I * (Z * xe - Y * ye));
14154
+ if (!(re < 0) && !(he + re > de)) {
14163
14155
  var se = -ge * (ye * ie + xe * ce + le * ae);
14164
14156
  if (!(se < 0)) {
14165
14157
  var pe = se / de, me = new BVHVector3(T + w * pe, S + C * pe, R + I * pe), Ne = new BVHIntersect(F, z, V, L, me);
@@ -14225,8 +14217,8 @@ var EPSILON = 1e-6, ORDER_AXISES = ["x", "y", "z"], scratchVector3$8 = new BVHVe
14225
14217
  function I(H) {
14226
14218
  var M = H.startIndex, B = H.endIndex, L = H.extents;
14227
14219
  R[0] = L[3] - L[0], R[1] = L[4] - L[1], R[2] = L[5] - L[2];
14228
- for (var O = w.sort(C)[0], F = ORDER_AXISES[O], N = (L[O] + L[O + 3]) / 2, D = M, U = B - 1, z = -1, G; D <= U; )
14229
- z === -1 ? (G = l[D], s(G, scratchVector3$8), scratchVector3$8[F] < N ? D++ : z = G) : (G = l[U], s(G, scratchVector3$8), scratchVector3$8[F] >= N || (l[D] = G, l[U] = z, z = -1, D++), U--);
14220
+ for (var O = w.sort(C)[0], F = ORDER_AXISES[O], N = (L[O] + L[O + 3]) / 2, D = M, U = B - 1, z = -1, K; D <= U; )
14221
+ z === -1 ? (K = l[D], s(K, scratchVector3$8), scratchVector3$8[F] < N ? D++ : z = K) : (K = l[U], s(K, scratchVector3$8), scratchVector3$8[F] >= N || (l[D] = K, l[U] = z, z = -1, D++), U--);
14230
14222
  if (D > M) {
14231
14223
  var j = L.slice();
14232
14224
  j[O + 3] = N + EPSILON;
@@ -14256,7 +14248,7 @@ var EPSILON = 1e-6, ORDER_AXISES = ["x", "y", "z"], scratchVector3$8 = new BVHVe
14256
14248
  this.getPositionByIndex(C, I);
14257
14249
  var H = I.x, M = I.y, B = I.z, L = e.x, O = e.y, F = e.z, N = r.x, D = r.y, U = r.z, z = N * (H - L) + D * (M - O) + U * (B - F);
14258
14250
  if (z > 0 ? (L += N * z, O += D * z, F += U * z) : z < 0 && (z = 0), N = H - L, D = M - O, U = B - F, N * N + D * D + U * U <= m) {
14259
- var G = new BVHVector3(L, O, F), j = new BVHIntersect(I, I, I, C, G);
14251
+ var K = new BVHVector3(L, O, F), j = new BVHIntersect(I, I, I, C, K);
14260
14252
  (!u || u(j)) && (s ? z < E && (E = z, l.length > 0 && (l.length = 0), l.push(j)) : l.push(j));
14261
14253
  }
14262
14254
  }
@@ -15215,26 +15207,6 @@ var TileRequestScheduler = (
15215
15207
  }, n;
15216
15208
  })()
15217
15209
  );
15218
- function normalizeURL(n) {
15219
- var t, e = /^(http\:|https\:|file\:)?\/\/[^/]/.exec(n);
15220
- if (!e)
15221
- return n;
15222
- var r = e[1] || "", o = n.slice(r.length + 2), s = o.indexOf("#");
15223
- s >= 0 && (n.slice(s), o = n.slice(0, s));
15224
- var u = o.indexOf("?");
15225
- u >= 0 && (n.slice(u), o = n.slice(0, u));
15226
- for (var l = o.split("/"), c = l.shift(), f = (t = l.pop()) !== null && t !== void 0 ? t : "", d = [], h = 0, p = l; h < p.length; h++) {
15227
- var m = p[h];
15228
- if (!(m === "" || m === ".")) {
15229
- if (m === "..") {
15230
- d.pop();
15231
- continue;
15232
- }
15233
- d.push(m);
15234
- }
15235
- }
15236
- return r + "//" + c + "/" + d.join("/") + "/" + f;
15237
- }
15238
15210
  function normalizeTileHeader(n, t) {
15239
15211
  var e;
15240
15212
  if (n.content) {
@@ -16431,16 +16403,16 @@ var Tile3D = (
16431
16403
  maxScreenSpaceError: g.maxScreenSpaceError,
16432
16404
  memoryAdjustedOverflow: g.memoryAdjustedOverflow,
16433
16405
  memoryAdjustedScreenSpaceError: g.memoryAdjustedScreenSpaceError
16434
- }, R = g.cacheCameras.map(function(ne) {
16435
- return ne.updateProjectionMatrix(), __assign(__assign({}, S), { camera: {
16406
+ }, R = g.cacheCameras.map(function(re) {
16407
+ return re.updateProjectionMatrix(), __assign(__assign({}, S), { camera: {
16436
16408
  type: r.type,
16437
- position: new THREE.Vector3().copy(ne.position),
16438
- direction: ne.getWorldDirection(new THREE.Vector3()),
16439
- up: new THREE.Vector3().copy(ne.up),
16440
- projectionMatrix: ne.projectionMatrix.clone(),
16441
- visible: ne.visible,
16409
+ position: new THREE.Vector3().copy(re.position),
16410
+ direction: re.getWorldDirection(new THREE.Vector3()),
16411
+ up: new THREE.Vector3().copy(re.up),
16412
+ projectionMatrix: re.projectionMatrix.clone(),
16413
+ visible: re.visible,
16442
16414
  refine: !0
16443
- }, cullingVolume: new CullingVolume().setFromCamera(ne) });
16415
+ }, cullingVolume: new CullingVolume().setFromCamera(re) });
16444
16416
  });
16445
16417
  this.updateWorldMatrix(!0, !1), this.tileset.transform.equals(this.matrixWorld) || (this.tileset.transform.copy(this.matrixWorld), A = !0);
16446
16418
  var w = !this.autoRefine;
@@ -16453,9 +16425,9 @@ var Tile3D = (
16453
16425
  g.pano1 && H.setFromMatrixPosition(g.pano1.matrix), I.distanceTo(H) < 10 && (w = !0);
16454
16426
  }
16455
16427
  }
16456
- if (w || this.tileset.update(S, R), this.refined = !0, this.refineProgress[0] = 0, this.refineProgress[1] = 0, this.tileset.needsRefinedTiles.forEach(function(ne) {
16457
- if (c.refineProgress[1]++, ne.content) {
16458
- var se = ne.content.loadState;
16428
+ if (w || this.tileset.update(S, R), this.refined = !0, this.refineProgress[0] = 0, this.refineProgress[1] = 0, this.tileset.needsRefinedTiles.forEach(function(re) {
16429
+ if (c.refineProgress[1]++, re.content) {
16430
+ var se = re.content.loadState;
16459
16431
  if (se === "UNLOADED" || se === "LOADING") {
16460
16432
  c.refined = !1;
16461
16433
  return;
@@ -16465,22 +16437,22 @@ var Tile3D = (
16465
16437
  }), this.loaded === !1 && this.autoRefine) {
16466
16438
  this.loaded = !0;
16467
16439
  var M = !1;
16468
- this.tileset.needsRefinedTiles.forEach(function(ne) {
16469
- if (c.loaded !== !1 && ne.content) {
16470
- if (ne.state.visible && (M = !0), S.skipLevelOfDetail) {
16471
- if (ne.state.finalResolution) {
16472
- var se = ne.state.ancestorWithContentAvailable, pe = se && se.content ? se.content : ne.content, me = pe.loadState;
16440
+ this.tileset.needsRefinedTiles.forEach(function(re) {
16441
+ if (c.loaded !== !1 && re.content) {
16442
+ if (re.state.visible && (M = !0), S.skipLevelOfDetail) {
16443
+ if (re.state.finalResolution) {
16444
+ var se = re.state.ancestorWithContentAvailable, pe = se && se.content ? se.content : re.content, me = pe.loadState;
16473
16445
  (me === "UNLOADED" || me === "LOADING") && (c.loaded = !1);
16474
16446
  }
16475
- } else if (ne.state.visible && ne.levelOfContent <= 0) {
16476
- var me = ne.content.loadState;
16447
+ } else if (re.state.visible && re.levelOfContent <= 0) {
16448
+ var me = re.content.loadState;
16477
16449
  (me === "UNLOADED" || me === "LOADING") && (c.loaded = !1);
16478
16450
  }
16479
16451
  }
16480
16452
  }), M && this.tileset.selectedTiles.length === 0 && this.tileset.frameNumber < 500 && (this.loaded = !1), this.loaded === !0 && (this.refined = !1, this.refineProgress[1]++);
16481
16453
  }
16482
- this.renderObjects.length = 0, this.backfaceObjects.length = 0, this.tileObjects.length = 0, this.remove.apply(this, this.children), S.skipLevelOfDetail || this.tileset.selectedTiles.sort(function(ne, se) {
16483
- return ne.floor !== se.floor ? ne.floor - se.floor : ne.levelOfContent !== se.levelOfContent ? se.levelOfContent - ne.levelOfContent : ne.state.distanceToCamera !== se.state.distanceToCamera ? ne.state.distanceToCamera - se.state.distanceToCamera : ne.state.centerZDepth - se.state.centerZDepth;
16454
+ this.renderObjects.length = 0, this.backfaceObjects.length = 0, this.tileObjects.length = 0, this.remove.apply(this, this.children), S.skipLevelOfDetail || this.tileset.selectedTiles.sort(function(re, se) {
16455
+ return re.floor !== se.floor ? re.floor - se.floor : re.levelOfContent !== se.levelOfContent ? se.levelOfContent - re.levelOfContent : re.state.distanceToCamera !== se.state.distanceToCamera ? re.state.distanceToCamera - se.state.distanceToCamera : re.state.centerZDepth - se.state.centerZDepth;
16484
16456
  });
16485
16457
  for (var B = [], L = 0, O = this.tileset.selectedTiles; L < O.length; L++) {
16486
16458
  var F = O[L], N = (d = (f = F.content) === null || f === void 0 ? void 0 : f.data) === null || d === void 0 ? void 0 : d.object;
@@ -16491,13 +16463,13 @@ var Tile3D = (
16491
16463
  var U = cloneSkipBackfaceObject(N);
16492
16464
  U.name = "skipBackface:" + N.name, this.backfaceObjects.push(U);
16493
16465
  }
16494
- for (var z = F.state.selectionDepth, G = STENCIL_CONSTANT.TILE_MASK | z << STENCIL_CONSTANT.SKIP_LOD_BIT_SHIFT, j = THREE.GreaterEqualStencilFunc, Q = STENCIL_CONSTANT.SKIP_LOD_MASK, V = THREE.ReplaceStencilOp, J = STENCIL_CONSTANT.TILE_MASK | STENCIL_CONSTANT.SKIP_LOD_MASK, W = 0, X = N.materials; W < X.length; W++) {
16466
+ for (var z = F.state.selectionDepth, K = STENCIL_CONSTANT.TILE_MASK | z << STENCIL_CONSTANT.SKIP_LOD_BIT_SHIFT, j = THREE.GreaterEqualStencilFunc, Q = STENCIL_CONSTANT.SKIP_LOD_MASK, V = THREE.ReplaceStencilOp, J = STENCIL_CONSTANT.TILE_MASK | STENCIL_CONSTANT.SKIP_LOD_MASK, W = 0, X = N.materials; W < X.length; W++) {
16495
16467
  var Z = X[W];
16496
- Z.stencilWrite = !0, Z.stencilRef = G, Z.stencilFunc = j, Z.stencilFuncMask = Q, Z.stencilZPass = V, Z.stencilWriteMask = J;
16468
+ Z.stencilWrite = !0, Z.stencilRef = K, Z.stencilFunc = j, Z.stencilFuncMask = Q, Z.stencilZPass = V, Z.stencilWriteMask = J;
16497
16469
  }
16498
16470
  } else
16499
- for (var Y = 0, K = N.materials; Y < K.length; Y++) {
16500
- var Z = K[Y];
16471
+ for (var Y = 0, G = N.materials; Y < G.length; Y++) {
16472
+ var Z = G[Y];
16501
16473
  Z.stencilWrite = !1, Z.stencilRef = STENCIL_CONSTANT.TILE_MASK, Z.stencilFunc = THREE.AlwaysStencilFunc, Z.stencilFuncMask = STENCIL_CONSTANT.TILE_MASK, Z.stencilZPass = THREE.ReplaceStencilOp, Z.stencilWriteMask = STENCIL_CONSTANT.TILE_MASK;
16502
16474
  }
16503
16475
  this.tileObjects.push(N);
@@ -16505,8 +16477,8 @@ var Tile3D = (
16505
16477
  }
16506
16478
  var ee = B.toString();
16507
16479
  tileVersionMap.get(this) !== ee && (tileVersionMap.set(this, ee), A = !0), S.skipLevelOfDetail && this.backfaceObjects.length && (u = this.renderObjects).push.apply(u, this.backfaceObjects), this.tileObjects.length && (l = this.renderObjects).push.apply(l, this.tileObjects), S.skipLevelOfDetail && this.renderObjects.push(this.clearStencilObject);
16508
- for (var te = [], re = 0, ie = this.tileset.selectedTrajectories; re < ie.length; re++) {
16509
- var ce = ie[re], ae = (h = ce.content.data) === null || h === void 0 ? void 0 : h.object;
16480
+ for (var te = [], ne = 0, ie = this.tileset.selectedTrajectories; ne < ie.length; ne++) {
16481
+ var ce = ie[ne], ae = (h = ce.content.data) === null || h === void 0 ? void 0 : h.object;
16510
16482
  if (ae) {
16511
16483
  var D = ae.update(e, r, o, this, ce, g);
16512
16484
  te.push(ce.id), D && (A = !0), this.renderObjects.push(ae);
@@ -16514,8 +16486,8 @@ var Tile3D = (
16514
16486
  }
16515
16487
  var de = te.toString();
16516
16488
  trajectoryVersionMap.get(this) !== de && (trajectoryVersionMap.set(this, de), A = !0);
16517
- for (var ge = Math.min(0, ((m = (p = this.parent) === null || p === void 0 ? void 0 : p.children) !== null && m !== void 0 ? m : []).indexOf(this)), ye = ge * 1e4, xe = function(ne) {
16518
- var se = le.renderObjects[ne], pe = ne + ye;
16489
+ for (var ge = Math.min(0, ((m = (p = this.parent) === null || p === void 0 ? void 0 : p.children) !== null && m !== void 0 ? m : []).indexOf(this)), ye = ge * 1e4, xe = function(re) {
16490
+ var se = le.renderObjects[re], pe = re + ye;
16519
16491
  se.traverse(function(me) {
16520
16492
  (me instanceof THREE.Mesh || me instanceof THREE.Line || me instanceof THREE.Points) && (me.renderOrder = pe);
16521
16493
  }), le.add(se);
@@ -16964,191 +16936,169 @@ function loadViewLayers(n, t) {
16964
16936
  });
16965
16937
  });
16966
16938
  }
16967
- var BufferGeometryUtils = {
16968
- computeTangents: function(n) {
16969
- var t = n.index, e = n.attributes;
16970
- if (t === null || e.position === void 0 || e.normal === void 0 || e.uv === void 0) {
16971
- console.warn("THREE.BufferGeometry: Missing required attributes (index, position, normal or uv) in BufferGeometry.computeTangents()");
16972
- return;
16973
- }
16974
- var r = t.array, o = e.position.array, s = e.normal.array, u = e.uv.array, l = o.length / 3;
16975
- e.tangent === void 0 && n.setAttribute("tangent", new THREE.BufferAttribute(new Float32Array(4 * l), 4));
16976
- for (var c = e.tangent.array, f = [], d = [], h = 0; h < l; h++)
16977
- f[h] = new THREE.Vector3(), d[h] = new THREE.Vector3();
16978
- var p = new THREE.Vector3(), m = new THREE.Vector3(), A = new THREE.Vector3(), g = new THREE.Vector2(), y = new THREE.Vector2(), v = new THREE.Vector2(), E = new THREE.Vector3(), b = new THREE.Vector3();
16979
- function T(G, j, Q) {
16980
- p.fromArray(o, G * 3), m.fromArray(o, j * 3), A.fromArray(o, Q * 3), g.fromArray(u, G * 2), y.fromArray(u, j * 2), v.fromArray(u, Q * 2);
16981
- var V = m.x - p.x, J = A.x - p.x, W = m.y - p.y, X = A.y - p.y, Z = m.z - p.z, Y = A.z - p.z, K = y.x - g.x, ee = v.x - g.x, te = y.y - g.y, re = v.y - g.y, ie = 1 / (K * re - ee * te);
16982
- E.set((re * V - te * J) * ie, (re * W - te * X) * ie, (re * Z - te * Y) * ie), b.set((K * J - ee * V) * ie, (K * X - ee * W) * ie, (K * Y - ee * Z) * ie), f[G].add(E), f[j].add(E), f[Q].add(E), d[G].add(b), d[j].add(b), d[Q].add(b);
16983
- }
16984
- var S = n.groups;
16985
- S.length === 0 && (S = [{
16986
- start: 0,
16987
- count: r.length
16988
- }]);
16989
- for (var h = 0, R = S.length; h < R; ++h)
16990
- for (var w = S[h], C = w.start, I = w.count, H = C, M = C + I; H < M; H += 3)
16991
- T(r[H + 0], r[H + 1], r[H + 2]);
16992
- var B = new THREE.Vector3(), L = new THREE.Vector3(), O = new THREE.Vector3(), F = new THREE.Vector3(), N, D, U;
16993
- function z(G) {
16994
- O.fromArray(s, G * 3), F.copy(O), D = f[G], B.copy(D), B.sub(O.multiplyScalar(O.dot(D))).normalize(), L.crossVectors(F, D), U = L.dot(d[G]), N = U < 0 ? -1 : 1, c[G * 4] = B.x, c[G * 4 + 1] = B.y, c[G * 4 + 2] = B.z, c[G * 4 + 3] = N;
16995
- }
16996
- for (var h = 0, R = S.length; h < R; ++h)
16997
- for (var w = S[h], C = w.start, I = w.count, H = C, M = C + I; H < M; H += 3)
16998
- z(r[H + 0]), z(r[H + 1]), z(r[H + 2]);
16999
- },
17000
- /**
17001
- * @param {Array<THREE.BufferGeometry>} geometries
17002
- * @param {Boolean} useGroups
17003
- * @return {THREE.BufferGeometry}
17004
- */
17005
- mergeBufferGeometries: function(n, t) {
17006
- for (var e = n[0].index !== null, r = new Set(Object.keys(n[0].attributes)), o = new Set(Object.keys(n[0].morphAttributes)), s = {}, u = {}, l = new THREE.BufferGeometry(), c = 0, f = 0; f < n.length; ++f) {
17007
- var d = n[f];
17008
- if (e !== (d.index !== null))
16939
+ function createSimpleBoxBufferGeometry(n, t, e) {
16940
+ n === void 0 && (n = 1), t === void 0 && (t = 1), e === void 0 && (e = 1);
16941
+ var r = n / 2, o = t / 2, s = e / 2, u = new Float32Array([
16942
+ -r,
16943
+ +o,
16944
+ +s,
16945
+ +r,
16946
+ +o,
16947
+ +s,
16948
+ +r,
16949
+ +o,
16950
+ -s,
16951
+ -r,
16952
+ +o,
16953
+ -s,
16954
+ -r,
16955
+ -o,
16956
+ +s,
16957
+ +r,
16958
+ -o,
16959
+ +s,
16960
+ +r,
16961
+ -o,
16962
+ -s,
16963
+ -r,
16964
+ -o,
16965
+ -s
16966
+ ]), l = new Uint32Array([
16967
+ 0,
16968
+ 4,
16969
+ 1,
16970
+ 1,
16971
+ 4,
16972
+ 5,
16973
+ 1,
16974
+ 5,
16975
+ 2,
16976
+ 2,
16977
+ 5,
16978
+ 6,
16979
+ 2,
16980
+ 6,
16981
+ 3,
16982
+ 3,
16983
+ 6,
16984
+ 7,
16985
+ 3,
16986
+ 7,
16987
+ 0,
16988
+ 0,
16989
+ 7,
16990
+ 4,
16991
+ 3,
16992
+ 0,
16993
+ 2,
16994
+ 2,
16995
+ 0,
16996
+ 1,
16997
+ 4,
16998
+ 7,
16999
+ 5,
17000
+ 5,
17001
+ 7,
17002
+ 6
17003
+ ]), c = new THREE.BufferGeometry();
17004
+ return c.setAttribute("position", new THREE.BufferAttribute(u, 3)), c.setIndex(new THREE.BufferAttribute(l, 1)), c.addGroup(0, c.index.count, 0), c.computeBoundingBox(), c.computeBoundingSphere(), c;
17005
+ }
17006
+ function mergeBufferGeometries(n, t) {
17007
+ for (var e = n[0].index !== null, r = new Set(Object.keys(n[0].attributes)), o = new Set(Object.keys(n[0].morphAttributes)), s = {}, u = {}, l = new THREE.BufferGeometry(), c = 0; c < n.length; ++c) {
17008
+ var f = n[c];
17009
+ if (e !== (f.index !== null))
17010
+ return null;
17011
+ for (var d in f.attributes) {
17012
+ if (!r.has(d))
17009
17013
  return null;
17010
- for (var h in d.attributes) {
17011
- if (!r.has(h))
17012
- return null;
17013
- s[h] === void 0 && (s[h] = []), s[h].push(d.attributes[h]);
17014
- }
17015
- for (var h in d.morphAttributes) {
17016
- if (!o.has(h))
17017
- return null;
17018
- u[h] === void 0 && (u[h] = []), u[h].push(d.morphAttributes[h]);
17019
- }
17020
- if (l.userData.mergedUserData = l.userData.mergedUserData || [], l.userData.mergedUserData.push(d.userData), t) {
17021
- var p;
17022
- if (e)
17023
- p = d.index.count;
17024
- else if (d.attributes.position !== void 0)
17025
- p = d.attributes.position.count;
17026
- else
17027
- return null;
17028
- l.addGroup(c, p, f), c += p;
17029
- }
17030
- }
17031
- if (e) {
17032
- for (var m = 0, A = [], f = 0; f < n.length; ++f) {
17033
- for (var g = n[f].index, y = 0; y < g.count; ++y)
17034
- A.push(g.getX(y) + m);
17035
- m += n[f].attributes.position.count;
17036
- }
17037
- l.setIndex(A);
17014
+ s[d] === void 0 && (s[d] = []), s[d].push(f.attributes[d]);
17038
17015
  }
17039
- for (var h in s) {
17040
- var v = this.mergeBufferAttributes(s[h]);
17041
- if (!v)
17016
+ for (var d in f.morphAttributes) {
17017
+ if (!o.has(d))
17042
17018
  return null;
17043
- l.setAttribute(h, v);
17019
+ u[d] === void 0 && (u[d] = []), u[d].push(f.morphAttributes[d]);
17044
17020
  }
17045
- for (var h in u) {
17046
- var E = u[h][0].length;
17047
- if (E === 0)
17048
- break;
17049
- l.morphAttributes = l.morphAttributes || {}, l.morphAttributes[h] = [];
17050
- for (var f = 0; f < E; ++f) {
17051
- for (var b = [], y = 0; y < u[h].length; ++y)
17052
- b.push(u[h][y][f]);
17053
- var T = this.mergeBufferAttributes(b);
17054
- if (!T)
17055
- return null;
17056
- l.morphAttributes[h].push(T);
17057
- }
17021
+ l.userData.mergedUserData = l.userData.mergedUserData || [], l.userData.mergedUserData.push(f.userData);
17022
+ }
17023
+ if (e) {
17024
+ for (var h = 0, p = [], c = 0; c < n.length; ++c) {
17025
+ for (var m = n[c].index, A = 0; A < m.count; ++A)
17026
+ p.push(m.getX(A) + h);
17027
+ h += n[c].attributes.position.count;
17058
17028
  }
17059
- return l;
17060
- },
17061
- /**
17062
- * @param {Array<THREE.BufferAttribute>} attributes
17063
- * @return {THREE.BufferAttribute}
17064
- */
17065
- mergeBufferAttributes: function(n) {
17066
- for (var t, e, r, o = 0, s = 0; s < n.length; ++s) {
17067
- var u = n[s];
17068
- if (u.isInterleavedBufferAttribute || (t === void 0 && (t = u.array.constructor), t !== u.array.constructor) || (e === void 0 && (e = u.itemSize), e !== u.itemSize) || (r === void 0 && (r = u.normalized), r !== u.normalized))
17029
+ l.setIndex(p);
17030
+ }
17031
+ for (var d in s) {
17032
+ var g = mergeBufferAttributes(s[d]);
17033
+ if (!g)
17034
+ return null;
17035
+ l.setAttribute(d, g);
17036
+ }
17037
+ for (var d in u) {
17038
+ var y = u[d][0].length;
17039
+ if (y === 0)
17040
+ break;
17041
+ l.morphAttributes = l.morphAttributes || {}, l.morphAttributes[d] = [];
17042
+ for (var c = 0; c < y; ++c) {
17043
+ for (var v = [], A = 0; A < u[d].length; ++A)
17044
+ v.push(u[d][A][c]);
17045
+ var E = mergeBufferAttributes(v);
17046
+ if (!E)
17069
17047
  return null;
17070
- o += u.array.length;
17071
- }
17072
- for (var l = new t(o), c = 0, s = 0; s < n.length; ++s)
17073
- l.set(n[s].array, c), c += n[s].array.length;
17074
- return new THREE.BufferAttribute(l, e, r);
17075
- },
17076
- /**
17077
- * @param {Array<THREE.BufferAttribute>} attributes
17078
- * @return {Array<THREE.InterleavedBufferAttribute>}
17079
- */
17080
- interleaveAttributes: function(n) {
17081
- for (var t, e = 0, r = 0, o = 0, s = n.length; o < s; ++o) {
17082
- var u = n[o];
17083
- if (t === void 0 && (t = u.array.constructor), t !== u.array.constructor)
17084
- return console.warn("AttributeBuffers of different types cannot be interleaved"), null;
17085
- e += u.array.length, r += u.itemSize;
17086
- }
17087
- for (var l = new THREE.InterleavedBuffer(new t(e), r), c = 0, f = [], d = ["getX", "getY", "getZ", "getW"], h = ["setX", "setY", "setZ", "setW"], p = 0, s = n.length; p < s; p++) {
17088
- var u = n[p], m = u.itemSize, A = u.count, g = new THREE.InterleavedBufferAttribute(l, m, c, u.normalized);
17089
- f.push(g), c += m;
17090
- for (var y = 0; y < A; y++)
17091
- for (var v = 0; v < m; v++)
17092
- g[h[v]](y, u[d[v]](y));
17093
- }
17094
- return f;
17095
- },
17096
- /**
17097
- * @param {THREE.BufferGeometry} geometry
17098
- * @return {number}
17099
- */
17100
- estimateBytesUsed: function(n) {
17101
- var t = 0;
17102
- for (var e in n.attributes) {
17103
- var r = n.getAttribute(e);
17104
- t += r.count * r.itemSize * r.array.BYTES_PER_ELEMENT;
17105
- }
17106
- var o = n.getIndex();
17107
- return t += o ? o.count * o.itemSize * o.array.BYTES_PER_ELEMENT : 0, t;
17108
- },
17109
- /**
17110
- * @param {THREE.BufferGeometry} geometry
17111
- * @param {number} tolerance
17112
- * @return {THREE.BufferGeometry>}
17113
- */
17114
- mergeVertices: function(n, t) {
17115
- t === void 0 && (t = 1e-4), t = Math.max(t, Number.EPSILON);
17116
- for (var e = {}, r = n.getIndex(), o = n.getAttribute("position"), s = r ? r.count : o.count, u = 0, l = Object.keys(n.attributes), c = {}, f = {}, d = [], h = ["getX", "getY", "getZ", "getW"], p = 0, m = l.length; p < m; p++) {
17117
- var A = l[p];
17118
- c[A] = [];
17119
- var g = n.morphAttributes[A];
17120
- g && (f[A] = new Array(g.length).fill().map(function() {
17121
- return [];
17122
- }));
17123
- }
17124
- for (var y = Math.log10(1 / t), v = Math.pow(10, y), p = 0; p < s; p++) {
17125
- for (var E = r ? r.getX(p) : p, b = "", T = 0, m = l.length; T < m; T++)
17126
- for (var A = l[T], S = n.getAttribute(A), R = S.itemSize, w = 0; w < R; w++)
17127
- b += "".concat(~~(S[h[w]](E) * v), ",");
17128
- if (b in e)
17129
- d.push(e[b]);
17130
- else {
17131
- for (var T = 0, m = l.length; T < m; T++)
17132
- for (var A = l[T], S = n.getAttribute(A), g = n.morphAttributes[A], R = S.itemSize, C = c[A], I = f[A], w = 0; w < R; w++) {
17133
- var H = h[w];
17134
- if (C.push(S[H](E)), g)
17135
- for (var M = 0, B = g.length; M < B; M++)
17136
- I[M].push(g[M][H](E));
17137
- }
17138
- e[b] = u, d.push(u), u++;
17139
- }
17048
+ l.morphAttributes[d].push(E);
17140
17049
  }
17141
- for (var L = n.clone(), p = 0, m = l.length; p < m; p++) {
17142
- var A = l[p], O = n.getAttribute(A), F = new O.array.constructor(c[A]), S = new THREE.BufferAttribute(F, O.itemSize, O.normalized);
17143
- if (L.setAttribute(A, S), A in f)
17144
- for (var T = 0; T < f[A].length; T++) {
17145
- var N = n.morphAttributes[A][T], F = new N.array.constructor(f[A][T]), D = new THREE.BufferAttribute(F, N.itemSize, N.normalized);
17146
- L.morphAttributes[A][T] = D;
17050
+ }
17051
+ return l;
17052
+ }
17053
+ function mergeBufferAttributes(n) {
17054
+ for (var t, e, r, o = 0, s = 0; s < n.length; ++s) {
17055
+ var u = n[s];
17056
+ if (u.isInterleavedBufferAttribute || (t === void 0 && (t = u.array.constructor), t !== u.array.constructor) || (e === void 0 && (e = u.itemSize), e !== u.itemSize) || (r === void 0 && (r = u.normalized), r !== u.normalized))
17057
+ return null;
17058
+ o += u.array.length;
17059
+ }
17060
+ for (var l = new t(o), c = 0, s = 0; s < n.length; ++s)
17061
+ l.set(n[s].array, c), c += n[s].array.length;
17062
+ return new THREE.BufferAttribute(l, e, r);
17063
+ }
17064
+ function mergeVertices(n, t) {
17065
+ t === void 0 && (t = 1e-4), t = Math.max(t, Number.EPSILON);
17066
+ for (var e = {}, r = n.getIndex(), o = n.getAttribute("position"), s = r ? r.count : o.count, u = 0, l = Object.keys(n.attributes), c = {}, f = {}, d = [], h = ["getX", "getY", "getZ", "getW"], p = 0, m = l.length; p < m; p++) {
17067
+ var A = l[p];
17068
+ c[A] = [];
17069
+ var g = n.morphAttributes[A];
17070
+ g && (f[A] = new Array(g.length).fill().map(function() {
17071
+ return [];
17072
+ }));
17073
+ }
17074
+ for (var y = Math.log10(1 / t), v = Math.pow(10, y), p = 0; p < s; p++) {
17075
+ for (var E = r ? r.getX(p) : p, b = "", T = 0, m = l.length; T < m; T++)
17076
+ for (var A = l[T], S = n.getAttribute(A), R = S.itemSize, w = 0; w < R; w++)
17077
+ b += "".concat(~~(S[h[w]](E) * v), ",");
17078
+ if (b in e)
17079
+ d.push(e[b]);
17080
+ else {
17081
+ for (var T = 0, m = l.length; T < m; T++)
17082
+ for (var A = l[T], S = n.getAttribute(A), g = n.morphAttributes[A], R = S.itemSize, C = c[A], I = f[A], w = 0; w < R; w++) {
17083
+ var H = h[w];
17084
+ if (C.push(S[H](E)), g)
17085
+ for (var M = 0, B = g.length; M < B; M++)
17086
+ I[M].push(g[M][H](E));
17147
17087
  }
17088
+ e[b] = u, d.push(u), u++;
17148
17089
  }
17149
- return L.setIndex(d), L;
17150
17090
  }
17151
- }, scratchSphere$1 = new THREE.Sphere(), scratchMatrix4$1 = new THREE.Matrix4(), scratchMatrix4Inverse = new THREE.Matrix4();
17091
+ for (var L = n.clone(), p = 0, m = l.length; p < m; p++) {
17092
+ var A = l[p], O = n.getAttribute(A), F = new O.array.constructor(c[A]), S = new THREE.BufferAttribute(F, O.itemSize, O.normalized);
17093
+ if (L.setAttribute(A, S), A in f)
17094
+ for (var T = 0; T < f[A].length; T++) {
17095
+ var N = n.morphAttributes[A][T], F = new N.array.constructor(f[A][T]), D = new THREE.BufferAttribute(F, N.itemSize, N.normalized);
17096
+ L.morphAttributes[A][T] = D;
17097
+ }
17098
+ }
17099
+ return L.setIndex(d), L;
17100
+ }
17101
+ var scratchSphere$1 = new THREE.Sphere(), scratchMatrix4$1 = new THREE.Matrix4(), scratchMatrix4Inverse = new THREE.Matrix4();
17152
17102
  function getEdgesBySphere(n, t, e) {
17153
17103
  e === void 0 && (e = 30 / 180 * Math.PI);
17154
17104
  for (var r = Math.cos(e), o = [], s = 0, u = n.children; s < u.length; s++) {
@@ -17163,12 +17113,12 @@ function getEdgesBySphere(n, t, e) {
17163
17113
  if (Q) {
17164
17114
  scratchMatrix4$1.copy(j.matrixWorld), scratchMatrix4Inverse.getInverse(scratchMatrix4$1), scratchSphere$1.copy(t).applyMatrix4(scratchMatrix4Inverse);
17165
17115
  var V = Q.trianglesInSphere(scratchSphere$1.center, scratchSphere$1.radius), J = new THREE.BufferGeometry();
17166
- J.setAttribute("position", new THREE.BufferAttribute(V, 3)), J.applyMatrix4(j.matrixWorld), J = BufferGeometryUtils.mergeVertices(J, 0.01), m.push(J);
17116
+ J.setAttribute("position", new THREE.BufferAttribute(V, 3)), J.applyMatrix4(j.matrixWorld), J = mergeVertices(J, 0.01), m.push(J);
17167
17117
  }
17168
17118
  }
17169
17119
  }), m.length === 0)
17170
17120
  return;
17171
- for (var A = ["a", "b", "c"], g = BufferGeometryUtils.mergeBufferGeometries(m, !1), y = g.getAttribute("position").array, v = ((h = g.getIndex()) === null || h === void 0 ? void 0 : h.array) || [], E = [], b = [], T = 0, S = y.length; T < S; T += 3) {
17121
+ for (var A = ["a", "b", "c"], g = mergeBufferGeometries(m), y = g.getAttribute("position").array, v = ((h = g.getIndex()) === null || h === void 0 ? void 0 : h.array) || [], E = [], b = [], T = 0, S = y.length; T < S; T += 3) {
17172
17122
  var R = new THREE.Vector3(y[T], y[T + 1], y[T + 2]);
17173
17123
  E.push(R);
17174
17124
  }
@@ -17184,8 +17134,8 @@ function getEdgesBySphere(n, t, e) {
17184
17134
  for (var D in M) {
17185
17135
  var U = M[D];
17186
17136
  if (U.face2 === void 0 || b[U.face1].normal.dot(b[U.face2].normal) <= r) {
17187
- var z = E[U.index1], G = E[U.index2];
17188
- o.push(new THREE.Line3(z, G));
17137
+ var z = E[U.index1], K = E[U.index2];
17138
+ o.push(new THREE.Line3(z, K));
17189
17139
  }
17190
17140
  }
17191
17141
  E.length = 0, b.length = 0;
@@ -17992,8 +17942,8 @@ function parse(n, t) {
17992
17942
  var V, J, W, X = [];
17993
17943
  if (Array.isArray(H.model.layers))
17994
17944
  for (var Z = 0, Y = H.model.layers; Z < Y.length; Z++) {
17995
- var K = Y[Z];
17996
- if (K && K.tileset_url) {
17945
+ var G = Y[Z];
17946
+ if (G && G.tileset_url) {
17997
17947
  var ee = {};
17998
17948
  defineProperty(ee, "work", {
17999
17949
  enumerable: !1,
@@ -18004,28 +17954,28 @@ function parse(n, t) {
18004
17954
  enumerable: !0,
18005
17955
  configurable: !1,
18006
17956
  writable: !1,
18007
- value: (V = K.name) !== null && V !== void 0 ? V : ""
17957
+ value: (V = G.name) !== null && V !== void 0 ? V : ""
18008
17958
  }), defineProperty(ee, "type", {
18009
17959
  enumerable: !0,
18010
17960
  configurable: !1,
18011
17961
  writable: !1,
18012
- value: (J = K.type) !== null && J !== void 0 ? J : "mesh"
17962
+ value: (J = G.type) !== null && J !== void 0 ? J : "mesh"
18013
17963
  }), defineProperty(ee, "upAxis", {
18014
17964
  enumerable: !0,
18015
17965
  configurable: !1,
18016
17966
  writable: !1,
18017
- value: (W = K.up_axis) !== null && W !== void 0 ? W : "Z"
17967
+ value: (W = G.up_axis) !== null && W !== void 0 ? W : "Z"
18018
17968
  }), defineProperty(ee, "tileset", {
18019
17969
  enumerable: !0,
18020
17970
  configurable: !1,
18021
17971
  writable: !1,
18022
- value: relativeURL(K.tileset_url, t.baseURL)
17972
+ value: relativeURL(G.tileset_url, t.baseURL)
18023
17973
  }), X.push(ee);
18024
17974
  }
18025
17975
  }
18026
17976
  if (typeof H.model.tiles == "object") {
18027
- var K = H.model.tiles;
18028
- if (K && K.tileset_url) {
17977
+ var G = H.model.tiles;
17978
+ if (G && G.tileset_url) {
18029
17979
  var ee = {};
18030
17980
  defineProperty(ee, "work", {
18031
17981
  enumerable: !1,
@@ -18051,7 +18001,7 @@ function parse(n, t) {
18051
18001
  enumerable: !0,
18052
18002
  configurable: !1,
18053
18003
  writable: !1,
18054
- value: relativeURL(K.tileset_url, t.baseURL)
18004
+ value: relativeURL(G.tileset_url, t.baseURL)
18055
18005
  }), X.push(ee);
18056
18006
  }
18057
18007
  }
@@ -18142,26 +18092,26 @@ function parse(n, t) {
18142
18092
  configurable: !1,
18143
18093
  writable: !1,
18144
18094
  value: (function() {
18145
- var Z, Y, K = ((Y = (Z = J.accessible_nodes) !== null && Z !== void 0 ? Z : J.accessibleNodes) !== null && Y !== void 0 ? Y : []).filter(function(te) {
18095
+ var Z, Y, G = ((Y = (Z = J.accessible_nodes) !== null && Z !== void 0 ? Z : J.accessibleNodes) !== null && Y !== void 0 ? Y : []).filter(function(te) {
18146
18096
  return te < N;
18147
18097
  });
18148
- if (K.length === 0)
18098
+ if (G.length === 0)
18149
18099
  for (var ee = 0; ee < N; ee++)
18150
- ee !== V && K.push(ee);
18151
- return Object.freeze(K);
18100
+ ee !== V && G.push(ee);
18101
+ return Object.freeze(G);
18152
18102
  })()
18153
18103
  }), defineProperty(X, "visibleNodes", {
18154
18104
  enumerable: !0,
18155
18105
  configurable: !1,
18156
18106
  writable: !1,
18157
18107
  value: (function() {
18158
- var Z, Y, K = ((Y = (Z = J.visible_nodes) !== null && Z !== void 0 ? Z : J.visibleNodes) !== null && Y !== void 0 ? Y : []).filter(function(te) {
18108
+ var Z, Y, G = ((Y = (Z = J.visible_nodes) !== null && Z !== void 0 ? Z : J.visibleNodes) !== null && Y !== void 0 ? Y : []).filter(function(te) {
18159
18109
  return te < N;
18160
18110
  });
18161
- if (K.length === 0)
18111
+ if (G.length === 0)
18162
18112
  for (var ee = 0; ee < N; ee++)
18163
- ee !== V && K.push(ee);
18164
- return Object.freeze(K);
18113
+ ee !== V && G.push(ee);
18114
+ return Object.freeze(G);
18165
18115
  })()
18166
18116
  }), defineProperty(X, "images", {
18167
18117
  enumerable: !0,
@@ -18175,8 +18125,8 @@ function parse(n, t) {
18175
18125
  writable: !1,
18176
18126
  value: t
18177
18127
  });
18178
- for (var Y = 0, K = FACE_ORDER$1; Y < K.length; Y++) {
18179
- var ee = K[Y];
18128
+ for (var Y = 0, G = FACE_ORDER$1; Y < G.length; Y++) {
18129
+ var ee = G[Y];
18180
18130
  defineProperty(Z, ee, {
18181
18131
  enumerable: !0,
18182
18132
  configurable: !1,
@@ -18192,20 +18142,20 @@ function parse(n, t) {
18192
18142
  var te = getImageSizeFromURL(Z[FACE_ORDER$1[0]]);
18193
18143
  if (te) {
18194
18144
  if (W.size_list) {
18195
- var re = W.size_list.slice().sort(function(ye, xe) {
18145
+ var ne = W.size_list.slice().sort(function(ye, xe) {
18196
18146
  return ye - xe;
18197
18147
  });
18198
- return Object.freeze(re);
18148
+ return Object.freeze(ne);
18199
18149
  } else if (W.tiles) {
18200
- for (var re = [
18150
+ for (var ne = [
18201
18151
  te
18202
18152
  ], ie = W.tiles.slice().sort(function(xe, le) {
18203
18153
  return xe - le;
18204
18154
  }), ce = 0, ae = ie; ce < ae.length; ce++) {
18205
18155
  var de = ae[ce], ge = 512 * Math.pow(2, de);
18206
- ge > te && re.push(ge);
18156
+ ge > te && ne.push(ge);
18207
18157
  }
18208
- return Object.freeze(re);
18158
+ return Object.freeze(ne);
18209
18159
  }
18210
18160
  }
18211
18161
  return Object.freeze([]);
@@ -18217,15 +18167,15 @@ function parse(n, t) {
18217
18167
  value: (function() {
18218
18168
  var te = getImageSizeFromURL(Z.front);
18219
18169
  if (te) {
18220
- var re = Z.sizeList.slice();
18221
- if (re[0]) {
18222
- var ie = getTileLevel(re[0]);
18170
+ var ne = Z.sizeList.slice();
18171
+ if (ne[0]) {
18172
+ var ie = getTileLevel(ne[0]);
18223
18173
  if (ie)
18224
18174
  for (var ce = ie - 1; ce >= 0; ce--)
18225
- re.unshift(512 * Math.pow(2, ce));
18175
+ ne.unshift(512 * Math.pow(2, ce));
18226
18176
  }
18227
- if (!(re.length <= 0)) {
18228
- for (var ae = [], de = 0, ge = re; de < ge.length; de++) {
18177
+ if (!(ne.length <= 0)) {
18178
+ for (var ae = [], de = 0, ge = ne; de < ge.length; de++) {
18229
18179
  var ye = ge[de], xe = getTileLevel(ye);
18230
18180
  if (typeof xe == "number") {
18231
18181
  var le = {};
@@ -18251,8 +18201,8 @@ function parse(n, t) {
18251
18201
  writable: !1,
18252
18202
  value: 1
18253
18203
  });
18254
- for (var he = 0, ne = FACE_ORDER$1; he < ne.length; he++) {
18255
- var se = ne[he];
18204
+ for (var he = 0, re = FACE_ORDER$1; he < re.length; he++) {
18205
+ var se = re[he];
18256
18206
  defineProperty(le, se, {
18257
18207
  enumerable: !0,
18258
18208
  configurable: !1,
@@ -18336,11 +18286,11 @@ function parse(n, t) {
18336
18286
  value: t
18337
18287
  }), H.initial) {
18338
18288
  if (t.observers.length > 0) {
18339
- var G = void 0;
18340
- isNumber(H.initial.panoIndex) ? G = H.initial.panoIndex : isNumber(H.initial.pano_index) ? G = H.initial.pano_index : isNumber(H.initial.pano) && (G = H.initial.pano), typeof G == "number" && (G = clamp$1(G, 0, t.observers.length - 1), defineProperty(z, "panoIndex", {
18289
+ var K = void 0;
18290
+ isNumber(H.initial.panoIndex) ? K = H.initial.panoIndex : isNumber(H.initial.pano_index) ? K = H.initial.pano_index : isNumber(H.initial.pano) && (K = H.initial.pano), typeof K == "number" && (K = clamp$1(K, 0, t.observers.length - 1), defineProperty(z, "panoIndex", {
18341
18291
  enumerable: !0,
18342
18292
  writable: !0,
18343
- value: G
18293
+ value: K
18344
18294
  }));
18345
18295
  }
18346
18296
  if (H.initial.mode === "Panorama" && t.observers.length === 0 || H.initial.mode === "Floorplan" || H.initial.mode === "Topview" || H.initial.mode === "Model" || H.initial.mode === "Mapview" ? defineProperty(z, "mode", {
@@ -18711,7 +18661,7 @@ function parsePano(n, t) {
18711
18661
  })()
18712
18662
  }), t;
18713
18663
  }
18714
- var workVerifySet = /* @__PURE__ */ new WeakSet(), hrefAElement = typeof document != "undefined" ? document.createElement("a") : { href: "" }, Work = (
18664
+ var workVerifySet = /* @__PURE__ */ new WeakSet(), Work = (
18715
18665
  /** @class */
18716
18666
  (function() {
18717
18667
  function n(t, e) {
@@ -18754,7 +18704,7 @@ Error work input:
18754
18704
  }
18755
18705
  t = pathJoin(this.baseURL, t);
18756
18706
  }
18757
- return hrefAElement.href = t, t = hrefAElement.href, t;
18707
+ return t = getFullURL(t), t;
18758
18708
  }, n.prototype.verifyURL = function(t) {
18759
18709
  return typeof verifyURL(this.getURL(t), this.allowHosts) == "string";
18760
18710
  }, n.prototype.toJSON = function() {
@@ -19835,74 +19785,7 @@ function isSimilarVector3(n, t) {
19835
19785
  function notSimilarVector3(n, t) {
19836
19786
  return !isSimilarVector3(n, t);
19837
19787
  }
19838
- function createBoxGeometry(n, t, e) {
19839
- n === void 0 && (n = 1), t === void 0 && (t = 1), e === void 0 && (e = 1);
19840
- var r = n / 2, o = t / 2, s = e / 2, u = new Float32Array([
19841
- -r,
19842
- +o,
19843
- +s,
19844
- +r,
19845
- +o,
19846
- +s,
19847
- +r,
19848
- +o,
19849
- -s,
19850
- -r,
19851
- +o,
19852
- -s,
19853
- -r,
19854
- -o,
19855
- +s,
19856
- +r,
19857
- -o,
19858
- +s,
19859
- +r,
19860
- -o,
19861
- -s,
19862
- -r,
19863
- -o,
19864
- -s
19865
- ]), l = new Uint32Array([
19866
- 0,
19867
- 4,
19868
- 1,
19869
- 1,
19870
- 4,
19871
- 5,
19872
- 1,
19873
- 5,
19874
- 2,
19875
- 2,
19876
- 5,
19877
- 6,
19878
- 2,
19879
- 6,
19880
- 3,
19881
- 3,
19882
- 6,
19883
- 7,
19884
- 3,
19885
- 7,
19886
- 0,
19887
- 0,
19888
- 7,
19889
- 4,
19890
- 3,
19891
- 0,
19892
- 2,
19893
- 2,
19894
- 0,
19895
- 1,
19896
- 4,
19897
- 7,
19898
- 5,
19899
- 5,
19900
- 7,
19901
- 6
19902
- ]), c = new THREE.BufferGeometry();
19903
- return c.setAttribute("position", new THREE.BufferAttribute(u, 3)), c.setIndex(new THREE.BufferAttribute(l, 1)), c.addGroup(0, c.index.count, 0), c.computeBoundingBox(), c.computeBoundingSphere(), c;
19904
- }
19905
- var scratchGeometry = createBoxGeometry(1, 1, 1);
19788
+ var scratchGeometry = createSimpleBoxBufferGeometry(1, 1, 1);
19906
19789
  scratchGeometry.applyMatrix4(new THREE.Matrix4().makeScale(-1, 1, 1));
19907
19790
  var versionMap = /* @__PURE__ */ new WeakMap(), cameraBoxSize = new THREE.Vector3(1, 1, 1), scratchBoundingBox = new THREE.Box3(), scratchBoundingBoxSize = new THREE.Vector3(), scratchCameraBox = new THREE.Box3(), scratchPosition = new THREE.Vector3(), scratchScale = new THREE.Vector3(), BoundingMesh$1 = (
19908
19791
  /** @class */
@@ -19935,16 +19818,7 @@ var versionMap = /* @__PURE__ */ new WeakMap(), cameraBoxSize = new THREE.Vector
19935
19818
  }
19936
19819
  }, t;
19937
19820
  })(PBMMesh)
19938
- );
19939
- function cameraWorldToLocal(n, t) {
19940
- var e = new THREE.Vector3(0, 0, -1);
19941
- e.applyQuaternion(n.quaternion);
19942
- var r = t.quaternion.clone().inverse();
19943
- e.applyQuaternion(r);
19944
- var o = Math.atan2(e.x, -e.z), s = -Math.asin(e.y);
19945
- return { theta: o, phi: s, lookAtVector: e };
19946
- }
19947
- var PI = Math.PI, TAU = PI * 2;
19821
+ ), PI = Math.PI, TAU = PI * 2;
19948
19822
  function stepNumber(n, t, e) {
19949
19823
  if (n === t)
19950
19824
  return t;
@@ -20198,7 +20072,7 @@ var Hammer = (function(n, t, e, r) {
20198
20072
  var _ = P.ownerDocument || P;
20199
20073
  return _.defaultView || _.parentWindow || n;
20200
20074
  }
20201
- var D = /mobile|tablet|ip(ad|hone|od)|android/i, U = "ontouchstart" in n, z = L(n, "PointerEvent") !== r, G = U && D.test(navigator.userAgent), j = "touch", Q = "pen", V = "mouse", J = "kinect", W = 25, X = 1, Z = 2, Y = 4, K = 8, ee = 1, te = 2, re = 4, ie = 8, ce = 16, ae = te | re, de = ie | ce, ge = ae | de, ye = ["x", "y"], xe = ["clientX", "clientY"];
20075
+ var D = /mobile|tablet|ip(ad|hone|od)|android/i, U = "ontouchstart" in n, z = L(n, "PointerEvent") !== r, K = U && D.test(navigator.userAgent), j = "touch", Q = "pen", V = "mouse", J = "kinect", W = 25, X = 1, Z = 2, Y = 4, G = 8, ee = 1, te = 2, ne = 4, ie = 8, ce = 16, ae = te | ne, de = ie | ce, ge = ae | de, ye = ["x", "y"], xe = ["clientX", "clientY"];
20202
20076
  function le(P, _) {
20203
20077
  var k = this;
20204
20078
  this.manager = P, this.callback = _, this.element = P.element, this.target = P.options.inputTarget, this.domHandler = function(q) {
@@ -20227,10 +20101,10 @@ var Hammer = (function(n, t, e, r) {
20227
20101
  };
20228
20102
  function he(P) {
20229
20103
  var _, k = P.options.inputClass;
20230
- return k ? _ = k : z ? _ = Be : G ? _ = Ue : U ? _ = ht : _ = ke, new _(P, ne);
20104
+ return k ? _ = k : z ? _ = Be : K ? _ = Ue : U ? _ = ht : _ = ke, new _(P, re);
20231
20105
  }
20232
- function ne(P, _, k) {
20233
- var q = k.pointers.length, $ = k.changedPointers.length, oe = _ & X && q - $ === 0, be = _ & (Y | K) && q - $ === 0;
20106
+ function re(P, _, k) {
20107
+ var q = k.pointers.length, $ = k.changedPointers.length, oe = _ & X && q - $ === 0, be = _ & (Y | G) && q - $ === 0;
20234
20108
  k.isFirst = !!oe, k.isFinal = !!be, oe && (P.session = {}), k.eventType = _, se(P, k), P.emit("hammer.input", k), P.recognize(k), P.session.prevInput = k;
20235
20109
  }
20236
20110
  function se(P, _) {
@@ -20255,7 +20129,7 @@ var Hammer = (function(n, t, e, r) {
20255
20129
  }
20256
20130
  function me(P, _) {
20257
20131
  var k = P.lastInterval || _, q = _.timeStamp - k.timeStamp, $, oe, be, De;
20258
- if (_.eventType != K && (q > W || k.velocity === r)) {
20132
+ if (_.eventType != G && (q > W || k.velocity === r)) {
20259
20133
  var Xe = _.deltaX - k.deltaX, Fe = _.deltaY - k.deltaY, lt = Ye(q, Xe, Fe);
20260
20134
  oe = lt.x, be = lt.y, $ = c(lt.x) > c(lt.y) ? lt.x : lt.y, De = Ve(Xe, Fe), P.lastInterval = _;
20261
20135
  } else
@@ -20297,7 +20171,7 @@ var Hammer = (function(n, t, e, r) {
20297
20171
  };
20298
20172
  }
20299
20173
  function Ve(P, _) {
20300
- return P === _ ? ee : c(P) >= c(_) ? P < 0 ? te : re : _ < 0 ? ie : ce;
20174
+ return P === _ ? ee : c(P) >= c(_) ? P < 0 ? te : ne : _ < 0 ? ie : ce;
20301
20175
  }
20302
20176
  function ve(P, _, k) {
20303
20177
  k || (k = ye);
@@ -20342,8 +20216,8 @@ var Hammer = (function(n, t, e, r) {
20342
20216
  pointerdown: X,
20343
20217
  pointermove: Z,
20344
20218
  pointerup: Y,
20345
- pointercancel: K,
20346
- pointerout: K
20219
+ pointercancel: G,
20220
+ pointerout: G
20347
20221
  }, _e = {
20348
20222
  2: j,
20349
20223
  3: Q,
@@ -20362,7 +20236,7 @@ var Hammer = (function(n, t, e, r) {
20362
20236
  */
20363
20237
  handler: function(_) {
20364
20238
  var k = this.store, q = !1, $ = !1, oe = _.type.toLowerCase().replace("ms", ""), be = Pe[oe], De = _e[_.pointerType] || _.pointerType, Xe = De == j, Fe = H(k, _.pointerId, "pointerId");
20365
- be & X && (_.button === 0 || _.button === 2 || Xe) ? Fe < 0 && (k.push(_), Fe = k.length - 1) : be & (Y | K) ? q = !0 : !Xe && _.buttons === 0 && (q = !0, $ = !0, be = Pe.pointerup), !(Fe < 0) && ($ || (k[Fe] = _), this.callback(this.manager, be, {
20239
+ be & X && (_.button === 0 || _.button === 2 || Xe) ? Fe < 0 && (k.push(_), Fe = k.length - 1) : be & (Y | G) ? q = !0 : !Xe && _.buttons === 0 && (q = !0, $ = !0, be = Pe.pointerup), !(Fe < 0) && ($ || (k[Fe] = _), this.callback(this.manager, be, {
20366
20240
  pointers: k,
20367
20241
  changedPointers: [_],
20368
20242
  pointerType: De,
@@ -20374,7 +20248,7 @@ var Hammer = (function(n, t, e, r) {
20374
20248
  touchstart: X,
20375
20249
  touchmove: Z,
20376
20250
  touchend: Y,
20377
- touchcancel: K
20251
+ touchcancel: G
20378
20252
  }, Qe = "touchstart", We = "touchstart touchmove touchend touchcancel";
20379
20253
  function gt() {
20380
20254
  this.evTarget = Qe, this.evWin = We, this.started = !1, le.apply(this, arguments);
@@ -20384,7 +20258,7 @@ var Hammer = (function(n, t, e, r) {
20384
20258
  var k = je[_.type];
20385
20259
  if (k === X && (this.started = !0), !!this.started) {
20386
20260
  var q = Je.call(this, _, k);
20387
- k & (Y | K) && q[0].length - q[1].length === 0 && (this.started = !1), this.callback(this.manager, k, {
20261
+ k & (Y | G) && q[0].length - q[1].length === 0 && (this.started = !1), this.callback(this.manager, k, {
20388
20262
  pointers: q[0],
20389
20263
  changedPointers: q[1],
20390
20264
  pointerType: j,
@@ -20395,13 +20269,13 @@ var Hammer = (function(n, t, e, r) {
20395
20269
  });
20396
20270
  function Je(P, _) {
20397
20271
  var k = M(P.touches), q = M(P.changedTouches);
20398
- return _ & (Y | K) && (k = B(k.concat(q), "identifier")), [k, q];
20272
+ return _ & (Y | G) && (k = B(k.concat(q), "identifier")), [k, q];
20399
20273
  }
20400
20274
  var At = {
20401
20275
  touchstart: X,
20402
20276
  touchmove: Z,
20403
20277
  touchend: Y,
20404
- touchcancel: K
20278
+ touchcancel: G
20405
20279
  }, we = "touchstart touchmove touchend touchcancel";
20406
20280
  function Ue() {
20407
20281
  this.evTarget = we, this.targetIds = {}, le.apply(this, arguments);
@@ -20428,7 +20302,7 @@ var Hammer = (function(n, t, e, r) {
20428
20302
  for ($ = 0; $ < oe.length; )
20429
20303
  q[oe[$].identifier] = !0, $++;
20430
20304
  for ($ = 0; $ < be.length; )
20431
- q[be[$].identifier] && De.push(be[$]), _ & (Y | K) && delete q[be[$].identifier], $++;
20305
+ q[be[$].identifier] && De.push(be[$]), _ & (Y | G) && delete q[be[$].identifier], $++;
20432
20306
  if (De.length)
20433
20307
  return [
20434
20308
  // merge targetTouches with changedTargetTouches so it contains ALL touches, including 'end' and 'cancel'
@@ -20467,7 +20341,7 @@ var Hammer = (function(n, t, e, r) {
20467
20341
  }
20468
20342
  });
20469
20343
  function pt(P, _) {
20470
- P & X ? (this.primaryTouch = _.changedPointers[0].identifier, ze.call(this, _)) : P & (Y | K) && ze.call(this, _);
20344
+ P & X ? (this.primaryTouch = _.changedPointers[0].identifier, ze.call(this, _)) : P & (Y | G) && ze.call(this, _);
20471
20345
  }
20472
20346
  function ze(P) {
20473
20347
  var _ = P.changedPointers[0];
@@ -20709,7 +20583,7 @@ var Hammer = (function(n, t, e, r) {
20709
20583
  return P & St ? "cancel" : P & xt ? "end" : P & Pt ? "move" : P & at ? "start" : "";
20710
20584
  }
20711
20585
  function Lt(P) {
20712
- return P == ce ? "down" : P == ie ? "up" : P == te ? "left" : P == re ? "right" : "";
20586
+ return P == ce ? "down" : P == ie ? "up" : P == te ? "left" : P == ne ? "right" : "";
20713
20587
  }
20714
20588
  function _t(P, _) {
20715
20589
  var k = _.manager;
@@ -20748,7 +20622,7 @@ var Hammer = (function(n, t, e, r) {
20748
20622
  */
20749
20623
  process: function(P) {
20750
20624
  var _ = this.state, k = P.eventType, q = _ & (at | Pt), $ = this.attrTest(P);
20751
- return q && (k & K || !$) ? _ | St : q || $ ? k & Y ? _ | xt : _ & at ? _ | Pt : at : Ge;
20625
+ return q && (k & G || !$) ? _ | St : q || $ ? k & Y ? _ | xt : _ & at ? _ | Pt : at : Ge;
20752
20626
  }
20753
20627
  });
20754
20628
  function Rt() {
@@ -20771,7 +20645,7 @@ var Hammer = (function(n, t, e, r) {
20771
20645
  },
20772
20646
  directionTest: function(P) {
20773
20647
  var _ = this.options, k = !0, q = P.distance, $ = P.direction, oe = P.deltaX, be = P.deltaY;
20774
- return $ & _.direction || (_.direction & ae ? ($ = oe === 0 ? ee : oe < 0 ? te : re, k = oe != this.pX, q = Math.abs(P.deltaX)) : ($ = be === 0 ? ee : be < 0 ? ie : ce, k = be != this.pY, q = Math.abs(P.deltaY))), P.direction = $, k && q > _.threshold && $ & _.direction;
20648
+ return $ & _.direction || (_.direction & ae ? ($ = oe === 0 ? ee : oe < 0 ? te : ne, k = oe != this.pX, q = Math.abs(P.deltaX)) : ($ = be === 0 ? ee : be < 0 ? ie : ce, k = be != this.pY, q = Math.abs(P.deltaY))), P.direction = $, k && q > _.threshold && $ & _.direction;
20775
20649
  },
20776
20650
  attrTest: function(P) {
20777
20651
  return ot.prototype.attrTest.call(this, P) && (this.state & at || !(this.state & at) && this.directionTest(P));
@@ -20830,7 +20704,7 @@ var Hammer = (function(n, t, e, r) {
20830
20704
  },
20831
20705
  process: function(P) {
20832
20706
  var _ = this.options, k = P.pointers.length === _.pointers, q = P.distance < _.threshold, $ = P.deltaTime > _.time;
20833
- if (this._input = P, !q || !k || P.eventType & (Y | K) && !$)
20707
+ if (this._input = P, !q || !k || P.eventType & (Y | G) && !$)
20834
20708
  this.reset();
20835
20709
  else if (P.eventType & X)
20836
20710
  this.reset(), this._timer = d(function() {
@@ -21197,7 +21071,7 @@ var Hammer = (function(n, t, e, r) {
21197
21071
  INPUT_START: X,
21198
21072
  INPUT_MOVE: Z,
21199
21073
  INPUT_END: Y,
21200
- INPUT_CANCEL: K,
21074
+ INPUT_CANCEL: G,
21201
21075
  STATE_POSSIBLE: It,
21202
21076
  STATE_BEGAN: at,
21203
21077
  STATE_CHANGED: Pt,
@@ -21207,7 +21081,7 @@ var Hammer = (function(n, t, e, r) {
21207
21081
  STATE_FAILED: Ge,
21208
21082
  DIRECTION_NONE: ee,
21209
21083
  DIRECTION_LEFT: te,
21210
- DIRECTION_RIGHT: re,
21084
+ DIRECTION_RIGHT: ne,
21211
21085
  DIRECTION_UP: ie,
21212
21086
  DIRECTION_DOWN: ce,
21213
21087
  DIRECTION_HORIZONTAL: ae,
@@ -21239,12 +21113,7 @@ var Hammer = (function(n, t, e, r) {
21239
21113
  bindFn: E,
21240
21114
  prefixed: L
21241
21115
  }), Re;
21242
- })(typeof window != "undefined" ? window : {}, typeof document != "undefined" ? document : {});
21243
- function calculateThreeMouse(n, t, e) {
21244
- var r = t.getBoundingClientRect(), o = r.top, s = r.left, u = r.width, l = r.height;
21245
- return e && (s = s + u * e.left, o = o + l * (1 - e.bottom - e.height), u = u * e.width, l = l * e.height), new THREE.Vector2((n.x - s) / u * 2 - 1, -(n.y - o) / l * 2 + 1);
21246
- }
21247
- var BaseController = (
21116
+ })(typeof window != "undefined" ? window : {}, typeof document != "undefined" ? document : {}), BaseController = (
21248
21117
  /** @class */
21249
21118
  (function(n) {
21250
21119
  __extends(t, n);
@@ -21390,13 +21259,14 @@ var BaseController = (
21390
21259
  }, t.prototype.onMouseMove = function(e) {
21391
21260
  this.stopMomentumMovement(), this.emit("gesture.mousemove", e);
21392
21261
  }, t.prototype.relativeClientPosition = function(e) {
21393
- return calculateThreeMouse(e, this.element, this.viewport);
21262
+ var r = this.element.getBoundingClientRect(), o = r.top, s = r.left, u = r.width, l = r.height;
21263
+ return s = s + u * this.viewport.left, o = o + l * (1 - this.viewport.bottom - this.viewport.height), u = u * this.viewport.width, l = l * this.viewport.height, new THREE.Vector2((e.x - s) / u * 2 - 1, -(e.y - o) / l * 2 + 1);
21394
21264
  }, t.prototype.createRaycasterFromCamera = function(e, r) {
21395
21265
  var o = new THREE.Raycaster();
21396
21266
  return o.params.Points = { threshold: 0.1 }, o.firstHitOnly = !0, o.near = r.near, o.far = r.far, o.setFromCamera(e, this.camera), o;
21397
21267
  }, t.prototype.bindEvents = function(e) {
21398
21268
  var r = this, o = function(M) {
21399
- var B = calculateThreeMouse(M, r.element, r.viewport);
21269
+ var B = r.relativeClientPosition(M);
21400
21270
  return !(Math.abs(B.x) > 1 || Math.abs(B.y) > 1);
21401
21271
  }, s = new Hammer.Manager(e), u = function(M) {
21402
21272
  var B = M.session;
@@ -21615,7 +21485,7 @@ var BaseController = (
21615
21485
  var N = (Math.abs(M.deltaY) > Math.abs(M.deltaX) ? M.deltaY : M.deltaX) / -60, D = r.mouseWheelState !== void 0, U = {
21616
21486
  x: M.clientX,
21617
21487
  y: M.clientY
21618
- }, z = r.relativeClientPosition(U), G = r.createRaycasterFromCamera(z, r.camera), j = __assign(__assign({}, U), { coords: z, raycaster: G, buttons: M.buttons, delta: N }), F = createEvent("gesture.mousewheel", {
21488
+ }, z = r.relativeClientPosition(U), K = r.createRaycasterFromCamera(z, r.camera), j = __assign(__assign({}, U), { coords: z, raycaster: K, buttons: M.buttons, delta: N }), F = createEvent("gesture.mousewheel", {
21619
21489
  target: M.target,
21620
21490
  pointerType: "mouse",
21621
21491
  srcEvent: M,
@@ -22823,7 +22693,7 @@ void main() {
22823
22693
  this.disposed = !0, this.material.map && this.material.map.dispose(), this.material.dispose();
22824
22694
  }, t;
22825
22695
  })(THREE.Mesh)
22826
- ), boundingGeometry = createBoxGeometry(20, 20, 20);
22696
+ ), boundingGeometry = createSimpleBoxBufferGeometry(20, 20, 20);
22827
22697
  boundingGeometry.applyMatrix4(new THREE.Matrix4().makeScale(-1, 1, 1));
22828
22698
  var BOUNDING_MATERIAL_VERTEX_SHADER = `
22829
22699
  varying vec4 vFinalPosition;
@@ -22928,49 +22798,49 @@ void main() {
22928
22798
  var S = scratchCameraProjectMatrix.copy(f);
22929
22799
  S.elements[0] *= p, S.elements[5] *= p, this.camera.projectionMatrix.equals(S) || (this.camera.projectionMatrix.copy(S), this.camera.projectionMatrixInverse.getInverse(this.camera.projectionMatrix), r = !0), scratchSceneQuaternionInverse.copy(this.scene.quaternion).inverse(), scratchSceneMatrixInverse.makeRotationFromQuaternion(scratchSceneQuaternionInverse), scratchFrustumMatrix.copy(this.camera.matrix), scratchFrustumMatrix.setPosition(0, 0, 0), scratchFrustumMatrix.premultiply(scratchSceneMatrixInverse), scratchFrustumMatrixInverse.getInverse(scratchFrustumMatrix), scratchFrustumProjectMatrix.multiplyMatrices(this.camera.projectionMatrix, scratchFrustumMatrixInverse), this.frustum.setFromProjectionMatrix(scratchFrustumProjectMatrix);
22930
22800
  var R = this.frustum.planes[5].normal, w = [];
22931
- A >= m && traverseTileCubeNode(this.tileTree, function(K) {
22932
- if (!(K.level < m)) {
22933
- if (K.level > A || !e.frustum.intersectsBox(K.box))
22801
+ A >= m && traverseTileCubeNode(this.tileTree, function(G) {
22802
+ if (!(G.level < m)) {
22803
+ if (G.level > A || !e.frustum.intersectsBox(G.box))
22934
22804
  return !1;
22935
- w.push(K);
22805
+ w.push(G);
22936
22806
  }
22937
22807
  });
22938
22808
  var C = /* @__PURE__ */ new WeakMap();
22939
- w.sort(function(K, ee) {
22940
- if (K.level !== ee.level)
22941
- return K.level - ee.level;
22942
- var te = C.get(K);
22943
- te === void 0 && (te = K.box.getCenter(scratchSortVector3).angleTo(R), C.set(K, te));
22944
- var re = C.get(ee);
22945
- return re === void 0 && (re = ee.box.getCenter(scratchSortVector3).angleTo(R), C.set(ee, re)), te - re;
22809
+ w.sort(function(G, ee) {
22810
+ if (G.level !== ee.level)
22811
+ return G.level - ee.level;
22812
+ var te = C.get(G);
22813
+ te === void 0 && (te = G.box.getCenter(scratchSortVector3).angleTo(R), C.set(G, te));
22814
+ var ne = C.get(ee);
22815
+ return ne === void 0 && (ne = ee.box.getCenter(scratchSortVector3).angleTo(R), C.set(ee, ne)), te - ne;
22946
22816
  });
22947
22817
  var I = /* @__PURE__ */ new WeakSet(), H = this.observer.images.tiles;
22948
22818
  if (H)
22949
- for (var M = function(K) {
22950
- var ee = H.find(function(ne) {
22951
- return ne.level === K.level;
22819
+ for (var M = function(G) {
22820
+ var ee = H.find(function(re) {
22821
+ return re.level === G.level;
22952
22822
  });
22953
22823
  if (!ee)
22954
22824
  return "continue";
22955
- I.add(K);
22956
- var te = B.tileMeshes.get(K);
22825
+ I.add(G);
22826
+ var te = B.tileMeshes.get(G);
22957
22827
  if (te) {
22958
22828
  te.appearDuration = B.appearDuration;
22959
- var re = te.updateTime(o);
22960
- return re && (r = !0), "continue";
22829
+ var ne = te.updateTime(o);
22830
+ return ne && (r = !0), "continue";
22961
22831
  }
22962
22832
  if (B.pedding >= B.maxRequest)
22963
22833
  return "continue";
22964
- var ie = Math.pow(2, K.level) * K.position.y, ce = Math.pow(2, K.level) * K.position.x, ae = panoStringify({
22834
+ var ie = Math.pow(2, G.level) * G.position.y, ce = Math.pow(2, G.level) * G.position.x, ae = panoStringify({
22965
22835
  panoIndex: B.observer.panoIndex,
22966
22836
  workCode: B.observer.work.workCode
22967
- }), de = "".concat(ae, ".").concat(K.face, ".").concat(K.level, ".").concat(ie, ".").concat(ce), ge = ee.work.getURL(ee[K.face]), ye = ee.size, xe = B.imageOptions.transform, le = __assign(__assign({}, pick(B.imageOptions, ["format", "sharpen", "forceUseExifOrientation", "mappings"])), { key: "pano_tile.".concat(de), size: ee.scale >= 1 ? void 0 : ye * K.size * ee.scale, cut: K.size === 1 ? void 0 : [
22968
- ye * K.position.x,
22969
- ye * K.position.y,
22970
- ye * K.size,
22971
- ye * K.size
22837
+ }), de = "".concat(ae, ".").concat(G.face, ".").concat(G.level, ".").concat(ie, ".").concat(ce), ge = ee.work.getURL(ee[G.face]), ye = ee.size, xe = B.imageOptions.transform, le = __assign(__assign({}, pick(B.imageOptions, ["format", "sharpen", "forceUseExifOrientation", "mappings"])), { key: "pano_tile.".concat(de), size: ee.scale >= 1 ? void 0 : ye * G.size * ee.scale, cut: G.size === 1 ? void 0 : [
22838
+ ye * G.position.x,
22839
+ ye * G.position.y,
22840
+ ye * G.size,
22841
+ ye * G.size
22972
22842
  ] });
22973
- K.level === 1 && ee.scale >= 0.5 && (le.format === "jpg" || /\.jpg$/.test(ge)) && (le.size = void 0, le.quality || (le.quality = 70)), K.size === 1 && console.warn("tile: ".concat(le.key, " should not appear.")), B.pedding++;
22843
+ G.level === 1 && ee.scale >= 0.5 && (le.format === "jpg" || /\.jpg$/.test(ge)) && (le.size = void 0, le.quality || (le.quality = 70)), G.size === 1 && console.warn("tile: ".concat(le.key, " should not appear.")), B.pedding++;
22974
22844
  var he = B.textureLoader.loadTexture(ge, {
22975
22845
  imageURL: {
22976
22846
  transform: xe,
@@ -22980,30 +22850,30 @@ void main() {
22980
22850
  magFilter: THREE.LinearFilter,
22981
22851
  generateMipmaps: !1,
22982
22852
  fetcher: getFetcher(B.observer.work)
22983
- }).then(function(ne) {
22984
- return ne.body;
22853
+ }).then(function(re) {
22854
+ return re.body;
22985
22855
  });
22986
- he.then(function(ne) {
22987
- return initTexture(ne, l);
22988
- }).then(function(ne) {
22989
- return e.pedding--, ne;
22990
- }, function(ne) {
22991
- return e.pedding--, Promise.reject(ne);
22992
- }), te = new TileMesh(K, he), te.name = "tiling:tile-".concat(de), te.visible = !1, te.appearDuration = B.appearDuration, B.tileMeshes.set(K, te), B.scene.add(te), te.updateTime(o), r = !0;
22856
+ he.then(function(re) {
22857
+ return initTexture(re, l);
22858
+ }).then(function(re) {
22859
+ return e.pedding--, re;
22860
+ }, function(re) {
22861
+ return e.pedding--, Promise.reject(re);
22862
+ }), te = new TileMesh(G, he), te.name = "tiling:tile-".concat(de), te.visible = !1, te.appearDuration = B.appearDuration, B.tileMeshes.set(G, te), B.scene.add(te), te.updateTime(o), r = !0;
22993
22863
  }, B = this, L = 0, O = w; L < O.length; L++) {
22994
22864
  var F = O[L];
22995
22865
  M(F);
22996
22866
  }
22997
22867
  var N = [], D = [];
22998
- this.tileMeshes.forEach(function(K, ee) {
22999
- I.has(ee) ? N.push(K) : D.push(K);
22868
+ this.tileMeshes.forEach(function(G, ee) {
22869
+ I.has(ee) ? N.push(G) : D.push(G);
23000
22870
  var te = ee.level >= m && ee.level <= A;
23001
- K.visible !== te && (K.visible = te, r = !0);
22871
+ G.visible !== te && (G.visible = te, r = !0);
23002
22872
  });
23003
- for (var U = D.sort(function(K, ee) {
23004
- return ee.activeTime - K.activeTime;
23005
- }).slice(Math.max(0, this.maxCacheTile - N.length)), z = 0, G = U; z < G.length; z++) {
23006
- var j = G[z];
22873
+ for (var U = D.sort(function(G, ee) {
22874
+ return ee.activeTime - G.activeTime;
22875
+ }).slice(Math.max(0, this.maxCacheTile - N.length)), z = 0, K = U; z < K.length; z++) {
22876
+ var j = K[z];
23007
22877
  this.tileMeshes.delete(j.node), this.scene.remove(j), j.dispose(), r = !0;
23008
22878
  }
23009
22879
  if (r) {
@@ -23015,7 +22885,7 @@ void main() {
23015
22885
  return this.forceRenderWhenNextUpdate = !1, r;
23016
22886
  }, n;
23017
22887
  })()
23018
- ), ROTATE_Y_PI_MATRIX = new THREE.Matrix4().makeRotationAxis(new THREE.Vector3(0, 1, 0), Math.PI), sharedGeometry$1 = createBoxGeometry(2, 2, 2);
22888
+ ), ROTATE_Y_PI_MATRIX = new THREE.Matrix4().makeRotationAxis(new THREE.Vector3(0, 1, 0), Math.PI), sharedGeometry$1 = createSimpleBoxBufferGeometry(2, 2, 2);
23019
22889
  sharedGeometry$1.applyMatrix4(new THREE.Matrix4().makeScale(-1, 1, 1));
23020
22890
  var PANO_VIDEO_MATERIAL_VERTEX_SHADER = `
23021
22891
 
@@ -23317,8 +23187,8 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
23317
23187
  var N = F[O], D = N.key, U = N.progress;
23318
23188
  D !== void 0 && (B.push(D), U > this.locationMotion.progress && L.push(D));
23319
23189
  }
23320
- for (var z = 0, G = Object.keys(this.panoResources); z < G.length; z++) {
23321
- var j = G[z];
23190
+ for (var z = 0, K = Object.keys(this.panoResources); z < K.length; z++) {
23191
+ var j = K[z];
23322
23192
  if (!(L.indexOf(j) >= 0)) {
23323
23193
  var Q = this.panoResources[j];
23324
23194
  if (Q.panoPicture) {
@@ -23345,34 +23215,34 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
23345
23215
  isEmptyObject(h) === !1 && this.modelScene.parameter.set(h), isEmptyObject(p) === !1 && this.setCamera(p);
23346
23216
  var W = this.works.getObserver(this.currentPano), X = this.locationMotion.ended ? this.getForwardObserverOrNot(this.camera) : null, Z = this.works.getObserver(E.panoId), Y = this.works.getObserver(b.panoId);
23347
23217
  if (this.adjustPanoCircleMeshPositionBasedOnModel && this.helper.visible && W) {
23348
- for (var K = [], ee = W.work.observers, te = 0, re = W.accessibleNodes; te < re.length; te++) {
23349
- var ie = re[te], M = ee[ie];
23350
- M && K.push(M);
23218
+ for (var G = [], ee = W.work.observers, te = 0, ne = W.accessibleNodes; te < ne.length; te++) {
23219
+ var ie = ne[te], M = ee[ie];
23220
+ M && G.push(M);
23351
23221
  }
23352
23222
  var ce = /* @__PURE__ */ new Map();
23353
- if (K.sort(function(ue, Ae) {
23223
+ if (G.sort(function(ue, Ae) {
23354
23224
  var Me = ce.get(ue);
23355
23225
  typeof Me == "undefined" && (Me = ue.standingPosition.distanceTo(W.standingPosition), ce.set(ue, Me));
23356
23226
  var He = ce.get(ue);
23357
23227
  return typeof He == "undefined" && (He = Ae.standingPosition.distanceTo(W.standingPosition), ce.set(Ae, He)), Me - He;
23358
- }), K.length) {
23359
- this.accessibleObserverFloorCheckCount = this.accessibleObserverFloorCheckCount % K.length;
23360
- var ae = K[this.accessibleObserverFloorCheckCount], de = this.modelScene.models.find(function(ue) {
23228
+ }), G.length) {
23229
+ this.accessibleObserverFloorCheckCount = this.accessibleObserverFloorCheckCount % G.length;
23230
+ var ae = G[this.accessibleObserverFloorCheckCount], de = this.modelScene.models.find(function(ue) {
23361
23231
  return ue.work === (ae == null ? void 0 : ae.work);
23362
23232
  });
23363
23233
  if (ae && de && de.visible) {
23364
23234
  var ge = 0.3, ye = 0.05, xe = 5e-3, le = ae.standingPosition.clone().applyMatrix4(ae.work.transform), he = panoStringify({
23365
23235
  panoIndex: ae.panoIndex,
23366
23236
  workCode: ae.work.workCode
23367
- }), ne = adjustPanoCircleMeshVectors.map(function(ue) {
23237
+ }), re = adjustPanoCircleMeshVectors.map(function(ue) {
23368
23238
  scratchRaycaster$1.ray.origin.copy(le), scratchRaycaster$1.ray.origin.add(scratchVector3$3.copy(ue).setY(ge)), scratchRaycaster$1.ray.direction.set(0, -1, 0), scratchRaycaster$1.firstHitOnly = !0, scratchRaycaster$1.floorIndex = -1;
23369
23239
  var Ae = de.intersectRaycaster(scratchRaycaster$1)[0];
23370
23240
  return Ae && Ae.distance - xe <= ge ? new THREE.Vector3().copy(le).setY(Ae.point.y + xe) : le;
23371
23241
  });
23372
- ne.sort(function(ue, Ae) {
23242
+ re.sort(function(ue, Ae) {
23373
23243
  return Ae.y - ue.y;
23374
23244
  });
23375
- var se = ne[Math.floor(ne.length / 2)], pe = ne.filter(function(ue) {
23245
+ var se = re[Math.floor(re.length / 2)], pe = re.filter(function(ue) {
23376
23246
  return ue.distanceTo(se) <= ye;
23377
23247
  })[0];
23378
23248
  if (pe) {
@@ -23772,7 +23642,7 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
23772
23642
  var U = this.locationMotionKeyframesLength(this.locationMotion.keyframes), z = this.locationMotionKeyframesLength(S);
23773
23643
  U === 0 || U === 0 ? R = 0 : R = this.locationMotion.getProgressVelocity(v) * U / z;
23774
23644
  }
23775
- var G = r.effect === "instant" ? 0 : this.calculateMovingDuration(o.duration, r.effect === "fly" ? T : 0), j = {
23645
+ var K = r.effect === "instant" ? 0 : this.calculateMovingDuration(o.duration, r.effect === "fly" ? T : 0), j = {
23776
23646
  longitude: o.longitude,
23777
23647
  latitude: o.latitude,
23778
23648
  fov: o.fov
@@ -23785,7 +23655,7 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
23785
23655
  userAction: this.userAction,
23786
23656
  error: null
23787
23657
  })), o.moveStartCallback && o.moveStartCallback(Q), this.videoTexture && this.videoTexture.image instanceof HTMLVideoElement && this.videoTexture.image.getAttribute("src") && (this.videoTexture.image.pause(), this.videoTexture.image.removeAttribute("uuid"), this.videoTexture.image.removeAttribute("src"), this.videoTexture.image.oncanplay = noop, this.videoTexture.needsUpdate = !0), this.panoVideo.setMaterial(null), r.effect === "fly")
23788
- this.cameraMotion.set(j, G).catch(noop);
23658
+ this.cameraMotion.set(j, K).catch(noop);
23789
23659
  else {
23790
23660
  var J = coordinatesToVector({
23791
23661
  longitude: this.cameraMotion.value.longitude,
@@ -23797,13 +23667,13 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
23797
23667
  X.lookAt(J);
23798
23668
  var Z = new THREE.Matrix4().makeRotationFromQuaternion(X.quaternion);
23799
23669
  X.lookAt(W);
23800
- var Y = new THREE.Matrix4().makeRotationFromQuaternion(X.quaternion), K = new THREE.Matrix4().getInverse(Z).premultiply(Y), ee = this.cameraMotion.value.fov, te = (p = j.fov) !== null && p !== void 0 ? p : this.cameraMotion.value.fov, re = 1;
23801
- r.effect === "zoomin" ? re = 1.5 : r.effect === "zoomout" && (re = 0.4);
23802
- for (var ie = clamp$1(te * re, 1, 170), ce = 0; ce < S.length - 1; ce++) {
23670
+ var Y = new THREE.Matrix4().makeRotationFromQuaternion(X.quaternion), G = new THREE.Matrix4().getInverse(Z).premultiply(Y), ee = this.cameraMotion.value.fov, te = (p = j.fov) !== null && p !== void 0 ? p : this.cameraMotion.value.fov, ne = 1;
23671
+ r.effect === "zoomin" ? ne = 1.5 : r.effect === "zoomout" && (ne = 0.4);
23672
+ for (var ie = clamp$1(te * ne, 1, 170), ce = 0; ce < S.length - 1; ce++) {
23803
23673
  var ae = S[ce].key;
23804
23674
  if (ae) {
23805
23675
  var de = this.panoResources[ae];
23806
- de && (de.fixCameraTransform.copy(K), de.panoPicture && (de.panoPicture.zoom = Math.tan(ie / 2 / 180 * Math.PI) / Math.tan(ee / 2 / 180 * Math.PI)));
23676
+ de && (de.fixCameraTransform.copy(G), de.panoPicture && (de.panoPicture.zoom = Math.tan(ie / 2 / 180 * Math.PI) / Math.tan(ee / 2 / 180 * Math.PI)));
23807
23677
  }
23808
23678
  }
23809
23679
  this.cameraMotion.setKeyframes([
@@ -23831,9 +23701,9 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
23831
23701
  fov: te
23832
23702
  }
23833
23703
  }
23834
- ], G).catch(noop);
23704
+ ], K).catch(noop);
23835
23705
  }
23836
- var ge = this.locationMotion.setKeyframes(S, G, R);
23706
+ var ge = this.locationMotion.setKeyframes(S, K, R);
23837
23707
  ge.then(
23838
23708
  // resolve
23839
23709
  // 动画结束
@@ -23851,21 +23721,21 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
23851
23721
  userAction: s.userAction,
23852
23722
  error: null
23853
23723
  })), o.moveEndCallback && o.moveEndCallback(he);
23854
- var ne = s.works.getObserver(e);
23855
- if (ne && ne.video && s.videoTexture && s.videoTexture.image instanceof HTMLVideoElement) {
23724
+ var re = s.works.getObserver(e);
23725
+ if (re && re.video && s.videoTexture && s.videoTexture.image instanceof HTMLVideoElement) {
23856
23726
  var se = {
23857
23727
  map: s.videoTexture,
23858
- size: ne.video.size.clone(),
23859
- matrix: ne.video.matrix.clone(),
23860
- panoMatrix: ne.matrix.clone().premultiply(ne.work.transform),
23728
+ size: re.video.size.clone(),
23729
+ matrix: re.video.matrix.clone(),
23730
+ panoMatrix: re.matrix.clone().premultiply(re.work.transform),
23861
23731
  alpha: 1
23862
23732
  }, pe = createUuid(), me = s.videoTexture.image;
23863
23733
  me.setAttribute("uuid", pe), me.oncanplay = noop, me.ontimeupdate = noop, canplayVideo().then(function(qe) {
23864
- qe && ne.video && me.getAttribute("uuid") === pe && (me.oncanplay = function() {
23734
+ qe && re.video && me.getAttribute("uuid") === pe && (me.oncanplay = function() {
23865
23735
  me.oncanplay = noop, me.play();
23866
23736
  }, me.ontimeupdate = function() {
23867
23737
  me.currentTime > 0.5 && (me.ontimeupdate = noop, s.panoVideo.setMaterial(se));
23868
- }, me.src = ne.video.source);
23738
+ }, me.src = re.video.source);
23869
23739
  }).catch((function() {
23870
23740
  me.removeAttribute("uuid");
23871
23741
  }));
@@ -23988,11 +23858,11 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
23988
23858
  var D = e.state.fov, U = clamp$1(typeof this.minLatitude == "function" ? this.minLatitude(D) : this.minLatitude, -Math.PI / 2, Math.PI / 2), z = clamp$1(typeof this.maxLatitude == "function" ? this.maxLatitude(D) : this.maxLatitude, -Math.PI / 2, Math.PI / 2);
23989
23859
  b.latitude = clamp$1(0, U, z);
23990
23860
  }
23991
- var G = __assign({}, e.state);
23992
- if (G.workCode = l.work.workCode, G.panoIndex = l.panoIndex, b.longitude !== void 0 && (G.longitude = b.longitude), b.latitude !== void 0 && (G.latitude = b.latitude), b.fov !== void 0 && (G.fov = b.fov), G.distance = 0, G.offset = l.position.clone(), e.state = G, this.emit("gesture.tap", e), !e.defaultPrevented) {
23861
+ var K = __assign({}, e.state);
23862
+ if (K.workCode = l.work.workCode, K.panoIndex = l.panoIndex, b.longitude !== void 0 && (K.longitude = b.longitude), b.latitude !== void 0 && (K.latitude = b.latitude), b.fov !== void 0 && (K.fov = b.fov), K.distance = 0, K.offset = l.position.clone(), e.state = K, this.emit("gesture.tap", e), !e.defaultPrevented) {
23993
23863
  if (this.emit("pano.select", createEvent("pano.select", {
23994
23864
  prevPano: this.currentPano,
23995
- state: G,
23865
+ state: K,
23996
23866
  userAction: e.userAction,
23997
23867
  options: b,
23998
23868
  progress: 0,
@@ -24008,7 +23878,7 @@ var scratchRaycaster$1 = new THREE.Raycaster(), scratchVector3$3 = new THREE.Vec
24008
23878
  userAction: e.userAction,
24009
23879
  prevPano: this.currentPano,
24010
23880
  progress: 0,
24011
- state: G,
23881
+ state: K,
24012
23882
  options: b,
24013
23883
  error: null
24014
23884
  }));
@@ -24931,8 +24801,8 @@ void main() {
24931
24801
  B.copy(L), R = !0;
24932
24802
  }
24933
24803
  p.distance = this.locationMotion.value.distance, p.offset = new THREE.Vector3(B.x + (L.x - B.x) * O, B.y + (L.y - B.y) * O, B.z + (L.z - B.z) * O);
24934
- for (var D = [], U = [], z = 0, G = this.locationMotion.keyframes; z < G.length; z++) {
24935
- var j = G[z], Q = j.key, V = j.progress;
24804
+ for (var D = [], U = [], z = 0, K = this.locationMotion.keyframes; z < K.length; z++) {
24805
+ var j = K[z], Q = j.key, V = j.progress;
24936
24806
  Q !== void 0 && (D.push(Q), V > this.locationMotion.progress && U.push(Q));
24937
24807
  }
24938
24808
  for (var J = 0, W = Object.keys(this.panoResources); J < W.length; J++) {
@@ -24960,12 +24830,12 @@ void main() {
24960
24830
  }));
24961
24831
  }
24962
24832
  isEmptyObject(h) === !1 && this.modelScene.parameter.set(h), p.offset && this.camera.position.copy(p.offset);
24963
- var K = this.camera.pose.longitude, ee = this.camera.pose.latitude;
24964
- this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()), this.camera.computePose(), (K !== this.camera.pose.longitude || ee !== this.camera.pose.latitude) && (this.cameraMotion.set(pick(this.camera.pose, ["longitude", "latitude"]), 0).catch(noop), this.emit("camera.update", createEvent("camera.update", {
24833
+ var G = this.camera.pose.longitude, ee = this.camera.pose.latitude;
24834
+ this.camera.quaternion.fromArray(this.cardboard.sensor.getOrientation()), this.camera.computePose(), (G !== this.camera.pose.longitude || ee !== this.camera.pose.latitude) && (this.cameraMotion.set(pick(this.camera.pose, ["longitude", "latitude"]), 0).catch(noop), this.emit("camera.update", createEvent("camera.update", {
24965
24835
  userAction: !0,
24966
24836
  state: __assign(__assign(__assign({}, this.currentPano), { mode: this.mode }), clonePose(this.camera.pose))
24967
24837
  }))), this.works.getObserver(this.currentPano);
24968
- var te = this.works.getObserver(E.panoId), re = this.works.getObserver(b.panoId), ie = /* @__PURE__ */ new Map();
24838
+ var te = this.works.getObserver(E.panoId), ne = this.works.getObserver(b.panoId), ie = /* @__PURE__ */ new Map();
24969
24839
  if (te)
24970
24840
  for (var ce = 0, ae = te.accessibleNodes; ce < ae.length; ce++) {
24971
24841
  var de = ae[ce], N = te.work.observers[de];
@@ -24977,9 +24847,9 @@ void main() {
24977
24847
  ie.set(ge, N);
24978
24848
  }
24979
24849
  }
24980
- if (re)
24981
- for (var ye = 0, xe = re.accessibleNodes; ye < xe.length; ye++) {
24982
- var de = xe[ye], N = re.work.observers[de];
24850
+ if (ne)
24851
+ for (var ye = 0, xe = ne.accessibleNodes; ye < xe.length; ye++) {
24852
+ var de = xe[ye], N = ne.work.observers[de];
24983
24853
  if (N) {
24984
24854
  var ge = panoStringify({
24985
24855
  panoIndex: N.panoIndex,
@@ -25013,7 +24883,7 @@ void main() {
25013
24883
  });
25014
24884
  }
25015
24885
  {
25016
- var O = (l = this.modelScene.parameter.progress) !== null && l !== void 0 ? l : 1, he = Math.round(O), ne = this.modelScene.parameter.pano0, se = this.modelScene.parameter.pano1, pe = he === 0 ? ne : se, N = void 0;
24886
+ var O = (l = this.modelScene.parameter.progress) !== null && l !== void 0 ? l : 1, he = Math.round(O), re = this.modelScene.parameter.pano0, se = this.modelScene.parameter.pano1, pe = he === 0 ? re : se, N = void 0;
25017
24887
  if (pe && (N = this.works.getObserver(pe.panoId), N || (N = this.panoPictureObserverMap.get(pe))), this.tiling.appearDuration = this.tileAppearDuration, this.tiling.maxRequest = O < 0.6 ? 0 : this.tileMaxRequest, this.tiling.imageOptions = this.imageOptions, !N || !pe || this.tileLevelForFov === !1 || this.camera.perspToOrtho.x > 0) {
25018
24888
  this.tiling.setObserver(null);
25019
24889
  var me = {
@@ -25050,16 +24920,16 @@ void main() {
25050
24920
  matrixInverse: this.tiling.camera.matrixWorldInverse,
25051
24921
  projectionMatrix: this.tiling.camera.projectionMatrix,
25052
24922
  pano: he,
25053
- opacity: (ne == null ? void 0 : ne.panoId) === (se == null ? void 0 : se.panoId) ? 1 : easeInQuart(Math.abs(((c = this.modelScene.parameter.progress) !== null && c !== void 0 ? c : 0) - 0.5) * 2)
24923
+ opacity: (re == null ? void 0 : re.panoId) === (se == null ? void 0 : se.panoId) ? 1 : easeInQuart(Math.abs(((c = this.modelScene.parameter.progress) !== null && c !== void 0 ? c : 0) - 0.5) * 2)
25054
24924
  }, Le = this.modelScene.parameter.refinedScreen;
25055
24925
  (Ke || Te.pano !== (Le == null ? void 0 : Le.pano) || Te.opacity !== (Le == null ? void 0 : Le.opacity)) && this.modelScene.parameter.set("refinedScreen", Te);
25056
24926
  }
25057
24927
  }
25058
24928
  this.panoVideo.object.position.copy(this.camera.position), this.panoVideo.updateTime(e);
25059
24929
  {
25060
- var Ie = b.effect, $e = this.modelScene.parameter, ne = $e.pano0, se = $e.pano1;
25061
- if (ne && se && ne !== se && Ie === "fly" && this.flyEffectUseDepthBuffer) {
25062
- if (((f = this.modelScene.parameter.pano0Depth) === null || f === void 0 ? void 0 : f.panoId) !== ne.panoId || ((d = this.modelScene.parameter.pano1Depth) === null || d === void 0 ? void 0 : d.panoId) !== se.panoId) {
24930
+ var Ie = b.effect, $e = this.modelScene.parameter, re = $e.pano0, se = $e.pano1;
24931
+ if (re && se && re !== se && Ie === "fly" && this.flyEffectUseDepthBuffer) {
24932
+ if (((f = this.modelScene.parameter.pano0Depth) === null || f === void 0 ? void 0 : f.panoId) !== re.panoId || ((d = this.modelScene.parameter.pano1Depth) === null || d === void 0 ? void 0 : d.panoId) !== se.panoId) {
25063
24933
  var tt = 500, ke = 512;
25064
24934
  this.pano0DepthCubeRenderTarget ? this.pano0DepthCubeRenderTarget.width !== ke && this.pano0DepthCubeRenderTarget.setSize(ke, ke) : this.pano0DepthCubeRenderTarget = new THREE.WebGLCubeRenderTarget(ke, {
25065
24935
  minFilter: THREE.NearestFilter,
@@ -25071,11 +24941,11 @@ void main() {
25071
24941
  generateMipmaps: !1
25072
24942
  });
25073
24943
  var Pe = new THREE.CubeCamera(this.camera.near, this.camera.far, this.pano0DepthCubeRenderTarget);
25074
- Pe.matrix.copy(ne.matrix), Pe.matrixWorld.copy(Pe.matrix), Pe.matrixAutoUpdate = !1, renderDepthCube(this.renderer, this.modelScene, Pe, tt);
24944
+ Pe.matrix.copy(re.matrix), Pe.matrixWorld.copy(Pe.matrix), Pe.matrixAutoUpdate = !1, renderDepthCube(this.renderer, this.modelScene, Pe, tt);
25075
24945
  var _e = new THREE.CubeCamera(this.camera.near, this.camera.far, this.pano1DepthCubeRenderTarget);
25076
24946
  _e.matrix.copy(se.matrix), _e.matrixWorld.copy(_e.matrix), _e.matrixAutoUpdate = !1, renderDepthCube(this.renderer, this.modelScene, _e, tt), this.modelScene.parameter.set({
25077
24947
  pano0Depth: {
25078
- panoId: ne.panoId,
24948
+ panoId: re.panoId,
25079
24949
  map: this.pano0DepthCubeRenderTarget.texture,
25080
24950
  mapSize: this.pano0DepthCubeRenderTarget.width,
25081
24951
  maxDepth: tt
@@ -25388,10 +25258,10 @@ void main() {
25388
25258
  } : {
25389
25259
  workCode: "",
25390
25260
  panoIndex: 0
25391
- }, z = __assign(__assign({}, U), { mode: this.mode, longitude: (u = H.longitude) !== null && u !== void 0 ? u : this.camera.pose.longitude, latitude: (l = H.latitude) !== null && l !== void 0 ? l : this.camera.pose.latitude, fov: (c = H.fov) !== null && c !== void 0 ? c : this.camera.pose.fov, offset: e.clone(), distance: 0 }), G = this.currentPano;
25261
+ }, z = __assign(__assign({}, U), { mode: this.mode, longitude: (u = H.longitude) !== null && u !== void 0 ? u : this.camera.pose.longitude, latitude: (l = H.latitude) !== null && l !== void 0 ? l : this.camera.pose.latitude, fov: (c = H.fov) !== null && c !== void 0 ? c : this.camera.pose.fov, offset: e.clone(), distance: 0 }), K = this.currentPano;
25392
25262
  this.emit("pano.moveTo", createEvent("pano.moveTo", {
25393
25263
  options: r,
25394
- prevPano: G,
25264
+ prevPano: K,
25395
25265
  progress: 0,
25396
25266
  state: z,
25397
25267
  userAction: this.userAction,
@@ -25407,7 +25277,7 @@ void main() {
25407
25277
  var J = __assign(__assign(__assign({}, U), { mode: s.mode }), clonePose(s.camera.pose));
25408
25278
  s.emit("pano.arrived", createEvent("pano.arrived", {
25409
25279
  options: r,
25410
- prevPano: G,
25280
+ prevPano: K,
25411
25281
  progress: 0,
25412
25282
  state: J,
25413
25283
  userAction: s.userAction,
@@ -25419,7 +25289,7 @@ void main() {
25419
25289
  function() {
25420
25290
  r.moveCancelCallback && r.moveCancelCallback(), s.emit("pano.cancel", createEvent("pano.cancel", {
25421
25291
  options: r,
25422
- prevPano: G,
25292
+ prevPano: K,
25423
25293
  progress: 0,
25424
25294
  state: z,
25425
25295
  userAction: s.userAction,
@@ -25831,10 +25701,10 @@ void main() {
25831
25701
  longitude: C.longitude,
25832
25702
  latitude: C.latitude
25833
25703
  }, 0).catch(noop), e.isFinal) {
25834
- var G = e.velocityX, j = e.velocityY;
25704
+ var K = e.velocityX, j = e.velocityY;
25835
25705
  this.inMomentumMovement = {
25836
25706
  uuid: createUuid()
25837
- }, this.requestMomentumMovement(e, !0, __assign(__assign({}, this.coordinatesForOffset({ x: G, y: j })), { x: 0, y: 0, z: 0 }), 0);
25707
+ }, this.requestMomentumMovement(e, !0, __assign(__assign({}, this.coordinatesForOffset({ x: K, y: j })), { x: 0, y: 0, z: 0 }), 0);
25838
25708
  }
25839
25709
  }
25840
25710
  }
@@ -26683,7 +26553,7 @@ var circleImageURL = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYA
26683
26553
  }
26684
26554
  return Object.defineProperty(t, "version", {
26685
26555
  get: function() {
26686
- return "6.6.4";
26556
+ return "6.7.0-alpha.0";
26687
26557
  },
26688
26558
  enumerable: !1,
26689
26559
  configurable: !0
@@ -27316,11 +27186,11 @@ var CONTROLLER_EVNET_DELTA_TIME = 300, scratchRaycaster = new THREE.Raycaster(),
27316
27186
  var D = this.locationMotionKeyframesLength(this.locationMotion.keyframes), U = this.locationMotionKeyframesLength(T);
27317
27187
  S = this.locationMotion.getProgressVelocity(y) * D / U;
27318
27188
  }
27319
- var z = r.effect === "instant" ? 0 : this.calculateMovingDuration(o.duration, r.effect === "fly" ? b : 0), G = {
27189
+ var z = r.effect === "instant" ? 0 : this.calculateMovingDuration(o.duration, r.effect === "fly" ? b : 0), K = {
27320
27190
  longitude: o.longitude,
27321
27191
  latitude: o.latitude,
27322
27192
  fov: o.fov
27323
- }, j = __assign(__assign({}, e), { mode: this.mode, longitude: (u = G.longitude) !== null && u !== void 0 ? u : this.camera.pose.longitude, latitude: (l = G.latitude) !== null && l !== void 0 ? l : this.camera.pose.latitude, fov: (c = G.fov) !== null && c !== void 0 ? c : this.camera.pose.fov, offset: r.position.clone(), distance: 0 }), Q = this.currentPano;
27193
+ }, j = __assign(__assign({}, e), { mode: this.mode, longitude: (u = K.longitude) !== null && u !== void 0 ? u : this.camera.pose.longitude, latitude: (l = K.latitude) !== null && l !== void 0 ? l : this.camera.pose.latitude, fov: (c = K.fov) !== null && c !== void 0 ? c : this.camera.pose.fov, offset: r.position.clone(), distance: 0 }), Q = this.currentPano;
27324
27194
  if (this.emit("pano.moveTo", createEvent("pano.moveTo", {
27325
27195
  options: o,
27326
27196
  prevPano: Q,
@@ -27329,25 +27199,25 @@ var CONTROLLER_EVNET_DELTA_TIME = 300, scratchRaycaster = new THREE.Raycaster(),
27329
27199
  userAction: this.userAction,
27330
27200
  error: null
27331
27201
  })), o.moveStartCallback && o.moveStartCallback(j), this.videoTexture && this.videoTexture.image instanceof HTMLVideoElement && this.videoTexture.image.getAttribute("src") && (this.videoTexture.image.pause(), this.videoTexture.image.removeAttribute("uuid"), this.videoTexture.image.removeAttribute("src"), this.videoTexture.image.oncanplay = noop, this.videoTexture.needsUpdate = !0), this.panoVideo.setMaterial(null), r.effect === "fly")
27332
- this.cameraMotion.set(G, z).catch(noop);
27202
+ this.cameraMotion.set(K, z).catch(noop);
27333
27203
  else {
27334
27204
  var V = coordinatesToVector({
27335
27205
  longitude: this.cameraMotion.value.longitude,
27336
27206
  latitude: this.cameraMotion.value.latitude
27337
27207
  }), J = coordinatesToVector({
27338
- longitude: (f = G.longitude) !== null && f !== void 0 ? f : this.cameraMotion.value.longitude,
27339
- latitude: (d = G.latitude) !== null && d !== void 0 ? d : this.cameraMotion.value.latitude
27208
+ longitude: (f = K.longitude) !== null && f !== void 0 ? f : this.cameraMotion.value.longitude,
27209
+ latitude: (d = K.latitude) !== null && d !== void 0 ? d : this.cameraMotion.value.latitude
27340
27210
  }), W = new THREE.Object3D();
27341
27211
  W.lookAt(V);
27342
27212
  var X = new THREE.Matrix4().makeRotationFromQuaternion(W.quaternion);
27343
27213
  W.lookAt(J);
27344
- var Z = new THREE.Matrix4().makeRotationFromQuaternion(W.quaternion), Y = new THREE.Matrix4().getInverse(X).premultiply(Z), K = this.cameraMotion.value.fov, ee = (h = G.fov) !== null && h !== void 0 ? h : this.cameraMotion.value.fov, te = 1;
27214
+ var Z = new THREE.Matrix4().makeRotationFromQuaternion(W.quaternion), Y = new THREE.Matrix4().getInverse(X).premultiply(Z), G = this.cameraMotion.value.fov, ee = (h = K.fov) !== null && h !== void 0 ? h : this.cameraMotion.value.fov, te = 1;
27345
27215
  r.effect === "zoomin" ? te = 1.5 : r.effect === "zoomout" && (te = 0.4);
27346
- for (var re = ee * te, ie = 0; ie < T.length - 1; ie++) {
27216
+ for (var ne = ee * te, ie = 0; ie < T.length - 1; ie++) {
27347
27217
  var ce = T[ie].key;
27348
27218
  if (ce) {
27349
27219
  var ae = this.panoResources[ce];
27350
- ae && (ae.fixCameraTransform.copy(Y), ae.leftPanoPicture && (ae.leftPanoPicture.zoom = Math.tan(re / 2 / 180 * Math.PI) / Math.tan(K / 2 / 180 * Math.PI)));
27220
+ ae && (ae.fixCameraTransform.copy(Y), ae.leftPanoPicture && (ae.leftPanoPicture.zoom = Math.tan(ne / 2 / 180 * Math.PI) / Math.tan(G / 2 / 180 * Math.PI)));
27351
27221
  }
27352
27222
  }
27353
27223
  this.cameraMotion.setKeyframes([
@@ -27362,16 +27232,16 @@ var CONTROLLER_EVNET_DELTA_TIME = 300, scratchRaycaster = new THREE.Raycaster(),
27362
27232
  {
27363
27233
  progress: 0,
27364
27234
  value: {
27365
- longitude: (p = G.longitude) !== null && p !== void 0 ? p : this.cameraMotion.value.longitude,
27366
- latitude: (m = G.latitude) !== null && m !== void 0 ? m : this.cameraMotion.value.latitude,
27367
- fov: re
27235
+ longitude: (p = K.longitude) !== null && p !== void 0 ? p : this.cameraMotion.value.longitude,
27236
+ latitude: (m = K.latitude) !== null && m !== void 0 ? m : this.cameraMotion.value.latitude,
27237
+ fov: ne
27368
27238
  }
27369
27239
  },
27370
27240
  {
27371
27241
  progress: 1,
27372
27242
  value: {
27373
- longitude: (A = G.longitude) !== null && A !== void 0 ? A : this.cameraMotion.value.longitude,
27374
- latitude: (g = G.latitude) !== null && g !== void 0 ? g : this.cameraMotion.value.latitude,
27243
+ longitude: (A = K.longitude) !== null && A !== void 0 ? A : this.cameraMotion.value.longitude,
27244
+ latitude: (g = K.latitude) !== null && g !== void 0 ? g : this.cameraMotion.value.latitude,
27375
27245
  fov: ee
27376
27246
  }
27377
27247
  }
@@ -27397,7 +27267,7 @@ var CONTROLLER_EVNET_DELTA_TIME = 300, scratchRaycaster = new THREE.Raycaster(),
27397
27267
  })), o.moveEndCallback && o.moveEndCallback(le);
27398
27268
  var he = s.works.getObserver(s.currentPano);
27399
27269
  if (he && he.video && s.videoTexture && s.videoTexture.image instanceof HTMLVideoElement) {
27400
- var ne = {
27270
+ var re = {
27401
27271
  map: s.videoTexture,
27402
27272
  size: he.video.size.clone(),
27403
27273
  matrix: he.video.matrix.clone(),
@@ -27408,7 +27278,7 @@ var CONTROLLER_EVNET_DELTA_TIME = 300, scratchRaycaster = new THREE.Raycaster(),
27408
27278
  me && he.video && pe.getAttribute("uuid") === se && (pe.oncanplay = function() {
27409
27279
  pe.oncanplay = noop, pe.play();
27410
27280
  }, pe.ontimeupdate = function() {
27411
- pe.currentTime > 0.5 && (pe.ontimeupdate = noop, s.panoVideo.setMaterial(ne));
27281
+ pe.currentTime > 0.5 && (pe.ontimeupdate = noop, s.panoVideo.setMaterial(re));
27412
27282
  }, pe.src = he.video.source);
27413
27283
  }).catch((function() {
27414
27284
  pe.removeAttribute("uuid");
@@ -27539,20 +27409,20 @@ var CONTROLLER_EVNET_DELTA_TIME = 300, scratchRaycaster = new THREE.Raycaster(),
27539
27409
  O.copy(F), M = !0;
27540
27410
  }
27541
27411
  v.distance = this.locationMotion.value.distance, v.offset = new THREE.Vector3(O.x + (F.x - O.x) * N, O.y + (F.y - O.y) * N, O.z + (F.z - O.z) * N);
27542
- for (var z = [], G = [], j = 0, Q = this.locationMotion.keyframes; j < Q.length; j++) {
27412
+ for (var z = [], K = [], j = 0, Q = this.locationMotion.keyframes; j < Q.length; j++) {
27543
27413
  var V = Q[j], J = V.key, W = V.progress;
27544
- J !== void 0 && (z.push(J), W > this.locationMotion.progress && G.push(J));
27414
+ J !== void 0 && (z.push(J), W > this.locationMotion.progress && K.push(J));
27545
27415
  }
27546
27416
  for (var X = 0, Z = Object.keys(this.panoResources); X < Z.length; X++) {
27547
27417
  var Y = Z[X];
27548
- if (!(G.indexOf(Y) >= 0)) {
27549
- var K = this.panoResources[Y];
27550
- if (K.leftPanoPicture) {
27551
- var ee = K.leftPanoPicture.map;
27418
+ if (!(K.indexOf(Y) >= 0)) {
27419
+ var G = this.panoResources[Y];
27420
+ if (G.leftPanoPicture) {
27421
+ var ee = G.leftPanoPicture.map;
27552
27422
  if (ee) {
27553
27423
  if (ee === ((s = y.pano0) === null || s === void 0 ? void 0 : s.map) || ee === ((u = y.pano1) === null || u === void 0 ? void 0 : u.map))
27554
27424
  continue;
27555
- ee.dispose(), K.leftPanoPicture = null;
27425
+ ee.dispose(), G.leftPanoPicture = null;
27556
27426
  }
27557
27427
  }
27558
27428
  z.indexOf(Y) >= 0 || delete this.panoResources[Y];
@@ -27569,13 +27439,13 @@ var CONTROLLER_EVNET_DELTA_TIME = 300, scratchRaycaster = new THREE.Raycaster(),
27569
27439
  }));
27570
27440
  }
27571
27441
  this.camera.setFromPose(v), this.xrManager.cameraVR.projectionMatrix.copy(this.camera.projectionMatrix), this.xrManager.cameraVR.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse), this.xrManager.cameraVR.matrix.copy(this.camera.matrix), this.xrManager.cameraVR.position.copy(this.camera.position), this.xrManager.cameraVR.quaternion.copy(this.camera.quaternion), this.xrManager.cameraVR.scale.copy(this.camera.scale), this.xrManager.cameraVR.matrixAutoUpdate = !1, this.xrManager.cameraVR.matrixWorld.copy(this.camera.matrixWorld);
27572
- var re = A, ie = re[1], ce = new THREE.Vector3(0, 0, 0), ae = new THREE.Vector2().copy(this.camera.resolution);
27442
+ var ne = A, ie = ne[1], ce = new THREE.Vector3(0, 0, 0), ae = new THREE.Vector2().copy(this.camera.resolution);
27573
27443
  if (ie && this.xrManager.session && this.xrManager.referenceSpace && this.xrManager.session.renderState.baseLayer) {
27574
27444
  var de = this.xrManager.cameraVR, ge = this.xrManager.referenceSpace, ye = this.xrManager.session.renderState.baseLayer, xe = ie.getViewerPose(ge), le = (l = xe == null ? void 0 : xe.views) !== null && l !== void 0 ? l : [];
27575
27445
  this.renderer.setFramebuffer(ye.framebuffer);
27576
27446
  for (var he = 0; he < le.length; he++) {
27577
- var ne = le[he], se = de.cameras[he], pe = ye.getViewport(ne);
27578
- pe && (se.projectionMatrix.fromArray(ne.projectionMatrix), se.projectionMatrixInverse.getInverse(se.projectionMatrix), se.matrix.fromArray(ne.transform.matrix), se.matrix.setPosition(this.camera.position), se.matrix.decompose(se.position, se.quaternion, se.scale), se.matrixWorld.copy(se.matrix), se.matrixWorldInverse.getInverse(se.matrixWorld), se.matrixAutoUpdate = !1, ce.copy(se.position), se.viewport.set(pe.x, pe.y, pe.width, pe.height), ae.set(pe.width, pe.height));
27447
+ var re = le[he], se = de.cameras[he], pe = ye.getViewport(re);
27448
+ pe && (se.projectionMatrix.fromArray(re.projectionMatrix), se.projectionMatrixInverse.getInverse(se.projectionMatrix), se.matrix.fromArray(re.transform.matrix), se.matrix.setPosition(this.camera.position), se.matrix.decompose(se.position, se.quaternion, se.scale), se.matrixWorld.copy(se.matrix), se.matrixWorldInverse.getInverse(se.matrixWorld), se.matrixAutoUpdate = !1, ce.copy(se.position), se.viewport.set(pe.x, pe.y, pe.width, pe.height), ae.set(pe.width, pe.height));
27579
27449
  }
27580
27450
  if (this.xrManager.setProjectionFromUnion(this.xrManager.cameraVR, this.xrManager.cameraL, this.xrManager.cameraR), this.camera.quaternion.copy(this.xrManager.cameraVR.quaternion), this.camera.scale.copy(this.xrManager.cameraVR.scale), this.camera.matrix.compose(this.camera.position, this.camera.quaternion, this.camera.scale), this.camera.computePose((c = v.distance) !== null && c !== void 0 ? c : this.camera.pose.distance), this.xrManager.session && this.xrManager.session.inputSources) {
27581
27451
  for (var he = 0; he < this.xrManager.session.inputSources.length; he++)
@@ -29054,7 +28924,7 @@ void main() {
29054
28924
  }
29055
28925
  return Object.defineProperty(t, "version", {
29056
28926
  get: function() {
29057
- return "6.6.4";
28927
+ return "6.7.0-alpha.0";
29058
28928
  },
29059
28929
  enumerable: !1,
29060
28930
  configurable: !0
@@ -29284,15 +29154,15 @@ void main() {
29284
29154
  else
29285
29155
  e instanceof Work ? E.push(e) : E.push(parseWork(e));
29286
29156
  for (var R = createWorks(E), w = function(Y) {
29287
- var K = C, ee = new Fetcher({
29157
+ var G = C, ee = new Fetcher({
29288
29158
  get networkSubscribe() {
29289
- return K.networkSubscribe;
29159
+ return G.networkSubscribe;
29290
29160
  },
29291
29161
  requestProxy: function(te) {
29292
- return Promise.resolve(te).then(function(re) {
29293
- return K.requestProxy(re);
29294
- }).then(function(re) {
29295
- var ie = verifyURL(re, Y.allowHosts);
29162
+ return Promise.resolve(te).then(function(ne) {
29163
+ return G.requestProxy(ne);
29164
+ }).then(function(ne) {
29165
+ var ie = verifyURL(ne, Y.allowHosts);
29296
29166
  if (ie instanceof Error)
29297
29167
  throw ie;
29298
29168
  return ie;
@@ -29358,8 +29228,8 @@ void main() {
29358
29228
  offset: r.offset
29359
29229
  };
29360
29230
  }
29361
- var U = __assign(__assign(__assign({}, O), { mode: F }), N), z = this.getCurrentState(), G = (A = v.duration) !== null && A !== void 0 ? A : this.modeChangeDuration;
29362
- (F === "Floorplan" || F === "Topview" || F === "Mapview") && this.currentMode === F && (G = 0);
29231
+ var U = __assign(__assign(__assign({}, O), { mode: F }), N), z = this.getCurrentState(), K = (A = v.duration) !== null && A !== void 0 ? A : this.modeChangeDuration;
29232
+ (F === "Floorplan" || F === "Topview" || F === "Mapview") && this.currentMode === F && (K = 0);
29363
29233
  var j = "fly";
29364
29234
  (F === "Panorama" || F === "VRPanorama" || F === "XRPanorama") && this.currentMode === F && (j = (g = v.effect) !== null && g !== void 0 ? g : "fade"), this.emit("works.request", createEvent("works.request", {
29365
29235
  input: e,
@@ -29372,12 +29242,12 @@ void main() {
29372
29242
  var Y = __assign(__assign({ initial: {
29373
29243
  state: U,
29374
29244
  currentState: z,
29375
- duration: G,
29245
+ duration: K,
29376
29246
  effect: j,
29377
29247
  userAction: s
29378
- } }, u.commonParams()), u.controllerInits[F]), K = Controllers[F].initAnimationEndState(Y);
29248
+ } }, u.commonParams()), u.controllerInits[F]), G = Controllers[F].initAnimationEndState(Y);
29379
29249
  if (u.controller && u.currentMode === F)
29380
- u.controller.updateWork(R, K, { effect: j, duration: G }, s) === !1 && (u.controller.destroy(), u.controller = u.applyController(F, Y));
29250
+ u.controller.updateWork(R, G, { effect: j, duration: K }, s) === !1 && (u.controller.destroy(), u.controller = u.applyController(F, Y));
29381
29251
  else {
29382
29252
  var ee = u.currentMode;
29383
29253
  if (u.controller)
@@ -29390,14 +29260,14 @@ void main() {
29390
29260
  }));
29391
29261
  }
29392
29262
  u.controller = u.applyController(F, Y);
29393
- var re = createEvent("mode.change", {
29263
+ var ne = createEvent("mode.change", {
29394
29264
  prevMode: ee,
29395
29265
  mode: F,
29396
- state: K,
29266
+ state: G,
29397
29267
  userAction: s
29398
29268
  });
29399
29269
  try {
29400
- u.emit("mode.change", re);
29270
+ u.emit("mode.change", ne);
29401
29271
  } catch (ie) {
29402
29272
  console.error(ie);
29403
29273
  }
@@ -29427,8 +29297,8 @@ void main() {
29427
29297
  userAction: s
29428
29298
  })), X = !0, u.modelScene.autoRefine = !0), W.off("pano.arrived", Z), W.off("pano.cancel", Z);
29429
29299
  }, J = this.loadModels(R, v);
29430
- V = Promise.all(J.map(function(K) {
29431
- return K.initReady;
29300
+ V = Promise.all(J.map(function(G) {
29301
+ return G.initReady;
29432
29302
  })).then(noop), W.once("pano.arrived", Z), W.once("pano.cancel", Z), setTimeout(Z, ((y = v.duration) !== null && y !== void 0 ? y : this.modeChangeDuration) + 1e3);
29433
29303
  }
29434
29304
  return this.emit("works.load", createEvent("works.load", {
@@ -29679,7 +29549,7 @@ void main() {
29679
29549
  var f = panoStringify({
29680
29550
  panoIndex: s.panoIndex,
29681
29551
  workCode: s.work.workCode
29682
- }), d = __assign({ key: "pano.".concat(f, ".").concat(c) }, pick(o.imageOptions, ["size", "format", "quality", "forceUseExifOrientation", "mappings"])), h = s.work.getURL(s.images[c]), p = o.imageOptions.transform ? o.imageOptions.transform(h, d) : imageURL(h, d);
29552
+ }), d = __assign({ key: "pano.".concat(f, ".").concat(c) }, pick(o.imageOptions, ["size", "format", "quality", "forceUseExifOrientation", "mappings"])), h = s.images[c], p = o.imageOptions.transform ? o.imageOptions.transform(h, d) : imageURL(h, d);
29683
29553
  return getFetcher(s.work).preload(p);
29684
29554
  })).then(function() {
29685
29555
  var c = now() - l;
@@ -30062,7 +29932,13 @@ void main() {
30062
29932
  var e = this.works.getObserver(this.pano);
30063
29933
  if (e) {
30064
29934
  var r = new THREE.Object3D();
30065
- return r.matrix.copy(e.matrix).premultiply(e.work.transform), r.matrix.decompose(r.position, r.quaternion, r.scale), r.matrixAutoUpdate = !1, cameraWorldToLocal(this.camera, r);
29935
+ r.matrix.copy(e.matrix).premultiply(e.work.transform), r.matrix.decompose(r.position, r.quaternion, r.scale), r.matrixAutoUpdate = !1;
29936
+ var o = new THREE.Vector3(0, 0, -1);
29937
+ o.applyQuaternion(this.camera.quaternion);
29938
+ var s = r.quaternion.clone().inverse();
29939
+ o.applyQuaternion(s);
29940
+ var u = Math.atan2(o.x, -o.z), l = -Math.asin(o.y);
29941
+ return { theta: u, phi: l, lookAtVector: o };
30066
29942
  }
30067
29943
  }
30068
29944
  return null;