@realsee/five 6.7.0-alpha.3 → 6.7.0-alpha.5

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.
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * @license
3
3
  * @realsee/five
4
- * Generated: 9/26/2025
5
- * Version: 6.7.0-alpha.3
4
+ * Generated: 2025/10/15
5
+ * Version: 6.7.0-alpha.5
6
6
  * Terms:
7
7
  * Realsee SDK License Agreement
8
8
  * Update: July 28, 2021
@@ -252,54 +252,54 @@
252
252
  * No amendment to or modification of this Agreement will be binding unless in
253
253
  * writing and signed by Realsee. You and Realsee hereto confirm that this
254
254
  * Agreement and all related documents shall be drafted in English.
255
- */import { createWriteStream as Q, existsSync as M } from "node:fs";
256
- import { writeFile as X, mkdir as q, readFile as V } from "node:fs/promises";
257
- import { dirname as Y, extname as Z, join as F, resolve as W } from "node:path";
258
- import { Readable as x } from "node:stream";
259
- import ee from "sharp";
260
- function k(n, e, r, a) {
255
+ */import { createWriteStream as Y, existsSync as C } from "node:fs";
256
+ import { writeFile as q, mkdir as H, readFile as Z } from "node:fs/promises";
257
+ import { dirname as x, extname as K, join as _, resolve as A } from "node:path";
258
+ import { Readable as ee } from "node:stream";
259
+ import re from "sharp";
260
+ function U(n, r, e, a) {
261
261
  function i(t) {
262
- return t instanceof r ? t : new r(function(o) {
263
- o(t);
262
+ return t instanceof e ? t : new e(function(u) {
263
+ u(t);
264
264
  });
265
265
  }
266
- return new (r || (r = Promise))(function(t, o) {
267
- function u(c) {
266
+ return new (e || (e = Promise))(function(t, u) {
267
+ function o(c) {
268
268
  try {
269
269
  s(a.next(c));
270
- } catch (l) {
271
- o(l);
270
+ } catch (f) {
271
+ u(f);
272
272
  }
273
273
  }
274
- function f(c) {
274
+ function l(c) {
275
275
  try {
276
276
  s(a.throw(c));
277
- } catch (l) {
278
- o(l);
277
+ } catch (f) {
278
+ u(f);
279
279
  }
280
280
  }
281
281
  function s(c) {
282
- c.done ? t(c.value) : i(c.value).then(u, f);
282
+ c.done ? t(c.value) : i(c.value).then(o, l);
283
283
  }
284
- s((a = a.apply(n, e || [])).next());
284
+ s((a = a.apply(n, r || [])).next());
285
285
  });
286
286
  }
287
- function y(n, e) {
288
- var r = { label: 0, sent: function() {
287
+ function L(n, r) {
288
+ var e = { label: 0, sent: function() {
289
289
  if (t[0] & 1) throw t[1];
290
290
  return t[1];
291
- }, trys: [], ops: [] }, a, i, t, o = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
292
- return o.next = u(0), o.throw = u(1), o.return = u(2), typeof Symbol == "function" && (o[Symbol.iterator] = function() {
291
+ }, trys: [], ops: [] }, a, i, t, u = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
292
+ return u.next = o(0), u.throw = o(1), u.return = o(2), typeof Symbol == "function" && (u[Symbol.iterator] = function() {
293
293
  return this;
294
- }), o;
295
- function u(s) {
294
+ }), u;
295
+ function o(s) {
296
296
  return function(c) {
297
- return f([s, c]);
297
+ return l([s, c]);
298
298
  };
299
299
  }
300
- function f(s) {
300
+ function l(s) {
301
301
  if (a) throw new TypeError("Generator is already executing.");
302
- for (; o && (o = 0, s[0] && (r = 0)), r; ) try {
302
+ for (; u && (u = 0, s[0] && (e = 0)), e; ) try {
303
303
  if (a = 1, i && (t = s[0] & 2 ? i.return : s[0] ? i.throw || ((t = i.return) && t.call(i), 0) : i.next) && !(t = t.call(i, s[1])).done) return t;
304
304
  switch (i = 0, t && (s = [s[0] & 2, t.value]), s[0]) {
305
305
  case 0:
@@ -307,34 +307,34 @@ function y(n, e) {
307
307
  t = s;
308
308
  break;
309
309
  case 4:
310
- return r.label++, { value: s[1], done: !1 };
310
+ return e.label++, { value: s[1], done: !1 };
311
311
  case 5:
312
- r.label++, i = s[1], s = [0];
312
+ e.label++, i = s[1], s = [0];
313
313
  continue;
314
314
  case 7:
315
- s = r.ops.pop(), r.trys.pop();
315
+ s = e.ops.pop(), e.trys.pop();
316
316
  continue;
317
317
  default:
318
- if (t = r.trys, !(t = t.length > 0 && t[t.length - 1]) && (s[0] === 6 || s[0] === 2)) {
319
- r = 0;
318
+ if (t = e.trys, !(t = t.length > 0 && t[t.length - 1]) && (s[0] === 6 || s[0] === 2)) {
319
+ e = 0;
320
320
  continue;
321
321
  }
322
322
  if (s[0] === 3 && (!t || s[1] > t[0] && s[1] < t[3])) {
323
- r.label = s[1];
323
+ e.label = s[1];
324
324
  break;
325
325
  }
326
- if (s[0] === 6 && r.label < t[1]) {
327
- r.label = t[1], t = s;
326
+ if (s[0] === 6 && e.label < t[1]) {
327
+ e.label = t[1], t = s;
328
328
  break;
329
329
  }
330
- if (t && r.label < t[2]) {
331
- r.label = t[2], r.ops.push(s);
330
+ if (t && e.label < t[2]) {
331
+ e.label = t[2], e.ops.push(s);
332
332
  break;
333
333
  }
334
- t[2] && r.ops.pop(), r.trys.pop();
334
+ t[2] && e.ops.pop(), e.trys.pop();
335
335
  continue;
336
336
  }
337
- s = e.call(n, r);
337
+ s = r.call(n, e);
338
338
  } catch (c) {
339
339
  s = [6, c], i = 0;
340
340
  } finally {
@@ -344,94 +344,108 @@ function y(n, e) {
344
344
  return { value: s[0] ? s[1] : void 0, done: !0 };
345
345
  }
346
346
  }
347
- function U(n, e) {
348
- if (e && e[e.length - 1] !== "/" && (e += "/"), n.length > e.length && n.startsWith(e))
349
- return n.slice(e.length);
350
- throw new Error("".concat(n, " is not starting with ").concat(e));
347
+ function S(n, r) {
348
+ if (r && r[r.length - 1] !== "/" && (r += "/"), n.length > r.length && n.startsWith(r))
349
+ return n.slice(r.length);
350
+ throw new Error("".concat(n, " is not starting with ").concat(r));
351
351
  }
352
- function re() {
353
- for (var n = [], e = 0; e < arguments.length; e++)
354
- n[e] = arguments[e];
355
- var r = [];
356
- n = n.map(function(u) {
357
- return (u != null ? u : "").trim();
358
- }).filter(function(u) {
359
- return u.length > 0 && !/^\/+$/.test(u);
352
+ function ne() {
353
+ for (var n = [], r = 0; r < arguments.length; r++)
354
+ n[r] = arguments[r];
355
+ var e = [];
356
+ n = n.map(function(o) {
357
+ return (o != null ? o : "").trim();
358
+ }).filter(function(o) {
359
+ return o.length > 0 && !/^\/+$/.test(o);
360
360
  });
361
361
  for (var a = 0; a < n.length; a++) {
362
- var i = a === 0, t = a === n.length - 1, o = n[a];
363
- i || (o = o.replace(/^\.\//, "").replace(/^\/+/, "")), t || (o = o.replace(/\/+$/, "")), r.push(o);
362
+ var i = a === 0, t = a === n.length - 1, u = n[a];
363
+ i || (u = u.replace(/^\.\//, "").replace(/^\/+/, "")), t || (u = u.replace(/\/+$/, "")), e.push(u);
364
364
  }
365
- return r.join("/");
365
+ return e.join("/");
366
366
  }
367
- var ne = 1024 * 1024 * 5;
368
- function O(n, e, r) {
369
- return k(this, void 0, void 0, function() {
370
- var a, i, t, o;
371
- return y(this, function(u) {
372
- switch (u.label) {
367
+ var te = 1024 * 1024 * 5;
368
+ function E(n, r, e) {
369
+ return U(this, void 0, void 0, function() {
370
+ var a, i, t, u;
371
+ return L(this, function(o) {
372
+ switch (o.label) {
373
373
  case 0:
374
- return M(e) ? [2, e] : [4, r(n)];
374
+ return C(r) ? [2, r] : [4, e(n)];
375
375
  case 1:
376
- return a = u.sent(), a.ok && a.body ? [4, q(Y(e), { recursive: !0 })] : [3, 6];
376
+ return a = o.sent(), a.ok && a.body ? [4, H(x(r), { recursive: !0 })] : [3, 6];
377
377
  case 2:
378
- return u.sent(), i = Number((o = a.headers.get("content-length")) !== null && o !== void 0 ? o : "Infinity"), i > ne ? [2, new Promise(function(f, s) {
379
- var c = x.fromWeb(a.body), l = Q(e);
380
- c.pipe(l), c.on("error", s), l.on("finish", function() {
381
- return f(e);
378
+ return o.sent(), i = Number((u = a.headers.get("content-length")) !== null && u !== void 0 ? u : "Infinity"), i > te ? [2, new Promise(function(l, s) {
379
+ var c = ee.fromWeb(a.body), f = Y(r);
380
+ c.pipe(f), c.on("error", s), f.on("finish", function() {
381
+ return l(r);
382
382
  });
383
383
  })] : [3, 3];
384
384
  case 3:
385
385
  return [4, a.arrayBuffer()];
386
386
  case 4:
387
- return t = u.sent(), [4, X(e, Buffer.from(t))];
387
+ return t = o.sent(), [4, q(r, Buffer.from(t))];
388
388
  case 5:
389
- return u.sent(), [2, e];
389
+ return o.sent(), [2, r];
390
390
  case 6:
391
391
  throw new Error("url: ".concat(n, "(").concat(a.statusText, ")"));
392
392
  }
393
393
  });
394
394
  });
395
395
  }
396
- function I(n, e) {
397
- return k(this, void 0, void 0, function() {
398
- var r, a, i, t, o, u, f, s, c, l;
399
- return y(this, function(g) {
400
- return r = Z(n).slice(1) || "jpg", a = e.cut, i = e.size, t = e.format, o = t === void 0 ? r : t, u = ee(n), a && (u = u.extract({
396
+ var ae = ["jpg", "png"];
397
+ function X(n, r) {
398
+ var e = K(n).slice(1) || "jpg", a = r.cut, i = r.size, t = r.format, u = t === void 0 ? e : t, o = "";
399
+ if (r.toFilename)
400
+ o = r.toFilename(n, { cut: r.cut, size: r.size, format: r.format });
401
+ else {
402
+ var l = "", s = "", c = u;
403
+ a && (l = a.join("x")), i && (s = "".concat(i, "x")), c === e && !s && !l && (c = ""), o = [n, l, s, c].filter(function(f) {
404
+ return f.length > 0;
405
+ }).join(".");
406
+ }
407
+ return o;
408
+ }
409
+ function B(n, r) {
410
+ return U(this, void 0, void 0, function() {
411
+ var e, a, i, t, u, o, l, s, c;
412
+ return L(this, function(f) {
413
+ return e = K(n).slice(1) || "jpg", a = r.cut, i = r.size, t = r.format, u = t === void 0 ? e : t, o = n, (a || i) && u !== e && ae.includes(u) && (l = X(n, {
414
+ format: u,
415
+ toFilename: r.toFilename
416
+ }), l !== o && C(l) && (o = l)), s = re(o), a && (s = s.extract({
401
417
  left: a[0],
402
418
  top: a[1],
403
419
  width: a[2],
404
420
  height: a[3]
405
- })), i && (u = u.resize(i)), o && (u = u.toFormat(o)), f = "", e.toFilename ? f = e.toFilename(n, { cut: e.cut, size: e.size, format: e.format }) : (s = "", c = "", l = o, a && (s = a.join("x")), i && (c = "".concat(i, "x")), l === r && !c && !s && (l = ""), f = [n, s, c, l].filter(function(d) {
406
- return d.length > 0;
407
- }).join(".")), f !== n && !M(f) ? [2, u.toFile(f).then(function() {
408
- return f;
409
- })] : [2, f];
421
+ })), i && (s = s.resize(i)), u && (s = s.toFormat(u)), c = X(n, r), c !== n && !C(c) ? [2, s.toFile(c).then(function() {
422
+ return c;
423
+ })] : [2, c];
410
424
  });
411
425
  });
412
426
  }
413
- function H(n) {
414
- var e = [];
415
- if (n.content && (n.content.uri ? e.push(n.content.uri) : n.content.url && e.push(n.content.url)), n.children)
416
- for (var r = 0, a = n.children; r < a.length; r++) {
417
- var i = a[r], t = H(i);
418
- t.length > 0 && e.push.apply(e, t);
427
+ function Q(n) {
428
+ var r = [];
429
+ if (n.content && (n.content.uri ? r.push(n.content.uri) : n.content.url && r.push(n.content.url)), n.children)
430
+ for (var e = 0, a = n.children; e < a.length; e++) {
431
+ var i = a[e], t = Q(i);
432
+ t.length > 0 && r.push.apply(r, t);
419
433
  }
420
- return e;
434
+ return r;
421
435
  }
422
- function te(n, e, r) {
423
- return k(this, void 0, void 0, function() {
436
+ function ie(n, r, e) {
437
+ return U(this, void 0, void 0, function() {
424
438
  var a, i, t;
425
- return y(this, function(o) {
426
- switch (o.label) {
439
+ return L(this, function(u) {
440
+ switch (u.label) {
427
441
  case 0:
428
- return a = new URL(n, e).href, i = F(r.distPath, U(a, r.baseURL)), t = O(a, i, r.fetch), r.log(function(u) {
429
- return "download: ".concat(a, " -> ").concat(u);
442
+ return a = new URL(n, r).href, i = _(e.distPath, S(a, e.baseURL)), t = E(a, i, e.fetch), e.log(function(o) {
443
+ return "download: ".concat(a, " -> ").concat(o);
430
444
  }, t), [4, t];
431
445
  case 1:
432
- return o.sent(), /\.json$/.test(n) ? [4, K(a, r)] : [3, 3];
446
+ return u.sent(), /\.json$/.test(n) ? [4, V(a, e)] : [3, 3];
433
447
  case 2:
434
- o.sent(), o.label = 3;
448
+ u.sent(), u.label = 3;
435
449
  case 3:
436
450
  return [
437
451
  2
@@ -441,58 +455,58 @@ function te(n, e, r) {
441
455
  });
442
456
  });
443
457
  }
444
- function K(n, e) {
445
- return k(this, void 0, void 0, function() {
446
- var r, a, i, t, o, u, f, s, c, l, g, d, v, m, p, w, h, L, P;
447
- return y(this, function(b) {
448
- switch (b.label) {
458
+ function V(n, r) {
459
+ return U(this, void 0, void 0, function() {
460
+ var e, a, i, t, u, o, l, s, c, f, m, v, p, b, w, d, h, y, k;
461
+ return L(this, function(g) {
462
+ switch (g.label) {
449
463
  case 0:
450
- return r = F(e.distPath, U(n, e.baseURL)), a = O(n, r, e.fetch), e.log(function(z) {
464
+ return e = _(r.distPath, S(n, r.baseURL)), a = E(n, e, r.fetch), r.log(function(z) {
451
465
  return "download: ".concat(n, " -> ").concat(z);
452
466
  }, a), [4, a];
453
467
  case 1:
454
- return b.sent(), o = (t = JSON).parse, [4, V(r, "utf8")];
468
+ return g.sent(), u = (t = JSON).parse, [4, Z(e, "utf8")];
455
469
  case 2:
456
- return i = o.apply(t, [b.sent()]), i.asset.overview ? (u = new URL(i.asset.overview.imageFile, n).href, f = F(e.distPath, U(u, e.baseURL)), s = O(u, f, e.fetch), e.log(function(z) {
457
- return "download: ".concat(u, " -> ").concat(z);
470
+ return i = u.apply(t, [g.sent()]), i.asset.overview ? (o = new URL(i.asset.overview.imageFile, n).href, l = _(r.distPath, S(o, r.baseURL)), s = E(o, l, r.fetch), r.log(function(z) {
471
+ return "download: ".concat(o, " -> ").concat(z);
458
472
  }, s), [4, s]) : [3, 4];
459
473
  case 3:
460
- b.sent(), b.label = 4;
474
+ g.sent(), g.label = 4;
461
475
  case 4:
462
476
  if (!i.asset.trajectories) return [3, 8];
463
477
  c = function(z) {
464
- var R, j, S;
465
- return y(this, function(_) {
466
- switch (_.label) {
478
+ var F, P, R;
479
+ return L(this, function(j) {
480
+ switch (j.label) {
467
481
  case 0:
468
- return R = new URL(z.file, n).href, j = F(e.distPath, U(R, e.baseURL)), S = O(R, j, e.fetch), e.log(function($) {
469
- return "download: ".concat(R, " -> ").concat($);
470
- }, S), [4, S];
482
+ return F = new URL(z.file, n).href, P = _(r.distPath, S(F, r.baseURL)), R = E(F, P, r.fetch), r.log(function(O) {
483
+ return "download: ".concat(F, " -> ").concat(O);
484
+ }, R), [4, R];
471
485
  case 1:
472
- return _.sent(), [
486
+ return j.sent(), [
473
487
  2
474
488
  /*return*/
475
489
  ];
476
490
  }
477
491
  });
478
- }, l = 0, g = i.asset.trajectories.list, b.label = 5;
492
+ }, f = 0, m = i.asset.trajectories.list, g.label = 5;
479
493
  case 5:
480
- return l < g.length ? (d = g[l], [5, c(d)]) : [3, 8];
494
+ return f < m.length ? (v = m[f], [5, c(v)]) : [3, 8];
481
495
  case 6:
482
- b.sent(), b.label = 7;
496
+ g.sent(), g.label = 7;
483
497
  case 7:
484
- return l++, [3, 5];
498
+ return f++, [3, 5];
485
499
  case 8:
486
- v = H(i.root), m = 6, p = 0, b.label = 9;
500
+ p = Q(i.root), b = 6, w = 0, g.label = 9;
487
501
  case 9:
488
- if (!(p < v.length)) return [3, 12];
489
- for (w = [], h = 0; h < m; h++)
490
- L = v[p + h], L && (P = te(L, n, e), w.push(P));
491
- return [4, Promise.all(w)];
502
+ if (!(w < p.length)) return [3, 12];
503
+ for (d = [], h = 0; h < b; h++)
504
+ y = p[w + h], y && (k = ie(y, n, r), d.push(k));
505
+ return [4, Promise.all(d)];
492
506
  case 10:
493
- b.sent(), b.label = 11;
507
+ g.sent(), g.label = 11;
494
508
  case 11:
495
- return p += m, [3, 9];
509
+ return w += b, [3, 9];
496
510
  case 12:
497
511
  return [
498
512
  2
@@ -502,59 +516,59 @@ function K(n, e) {
502
516
  });
503
517
  });
504
518
  }
505
- function ae(n, e) {
506
- return k(this, void 0, void 0, function() {
507
- var r, a, i, t, o, w, u, f, s, c, l, g, d, v, m, p, w;
508
- return y(this, function(h) {
519
+ function se(n, r) {
520
+ return U(this, void 0, void 0, function() {
521
+ var e, a, i, t, u, d, o, l, s, c, f, m, v, p, b, w, d;
522
+ return L(this, function(h) {
509
523
  switch (h.label) {
510
524
  case 0:
511
- return e.log("process model"), n.model ? (r = n.model, a = r.textures, i = r.layers, t = r.file, o = r.textureBase, t ? (e.log("process model file"), w = n.getURL(t), u = F(e.distPath, U(w, e.baseURL)), f = O(w, u, e.fetch), e.log(function(L) {
512
- return "download: ".concat(t, " -> ").concat(L);
513
- }, f), [4, f]) : [3, 5]) : [3, 9];
525
+ return r.log("process model"), n.model ? (e = n.model, a = e.textures, i = e.layers, t = e.file, u = e.textureBase, t ? (r.log("process model file"), d = n.getURL(t), o = _(r.distPath, S(d, r.baseURL)), l = E(d, o, r.fetch), r.log(function(y) {
526
+ return "download: ".concat(t, " -> ").concat(y);
527
+ }, l), [4, l]) : [3, 5]) : [3, 9];
514
528
  case 1:
515
529
  if (h.sent(), !a) return [3, 5];
516
- s = function(L) {
517
- var P, b, z, R, j, S, _, $, A, N, B, G, C;
518
- return y(this, function(J) {
519
- switch (J.label) {
530
+ s = function(y) {
531
+ var k, g, z, F, P, R, j, O, T, $, J, G, D;
532
+ return L(this, function(W) {
533
+ switch (W.label) {
520
534
  case 0:
521
- return P = re(n.getURL(o != null ? o : ""), L), b = F(e.distPath, U(P, e.baseURL)), z = O(P, b, e.fetch), e.log(function(D) {
522
- return "download: ".concat(P, " -> ").concat(D);
535
+ return k = ne(n.getURL(u != null ? u : ""), y), g = _(r.distPath, S(k, r.baseURL)), z = E(k, g, r.fetch), r.log(function(M) {
536
+ return "download: ".concat(k, " -> ").concat(M);
523
537
  }, z), [4, z];
524
538
  case 1:
525
- for (J.sent(), R = e.imageOptions.format, R.length === 0 && R.push(void 0), j = e.imageOptions.size, j.length === 0 && j.push(void 0), S = [], _ = 0, $ = R; _ < $.length; _++)
526
- for (A = $[_], N = 0, B = j; N < B.length; N++)
527
- G = B[N], C = I(b, {
528
- format: A,
539
+ for (W.sent(), F = r.imageOptions.format, F.length === 0 && F.push(void 0), P = r.imageOptions.size, P.length === 0 && P.push(void 0), R = [], j = 0, O = F; j < O.length; j++)
540
+ for (T = O[j], $ = 0, J = P; $ < J.length; $++)
541
+ G = J[$], D = B(g, {
542
+ format: T,
529
543
  size: G,
530
- toFilename: e.imageProcessingFilename
531
- }), e.log(function(D) {
532
- return "imageProcessing: ".concat(b, " -> ").concat(D);
533
- }, C), S.push(C);
534
- return [4, Promise.all(S)];
544
+ toFilename: r.imageProcessingFilename
545
+ }), r.log(function(M) {
546
+ return "imageProcessing: ".concat(g, " -> ").concat(M);
547
+ }, D), R.push(D);
548
+ return [4, Promise.all(R)];
535
549
  case 2:
536
- return J.sent(), [
550
+ return W.sent(), [
537
551
  2
538
552
  /*return*/
539
553
  ];
540
554
  }
541
555
  });
542
- }, c = 0, l = a, h.label = 2;
556
+ }, c = 0, f = a, h.label = 2;
543
557
  case 2:
544
- return c < l.length ? (g = l[c], [5, s(g)]) : [3, 5];
558
+ return c < f.length ? (m = f[c], [5, s(m)]) : [3, 5];
545
559
  case 3:
546
560
  h.sent(), h.label = 4;
547
561
  case 4:
548
562
  return c++, [3, 2];
549
563
  case 5:
550
564
  if (!i) return [3, 9];
551
- d = 0, v = i, h.label = 6;
565
+ v = 0, p = i, h.label = 6;
552
566
  case 6:
553
- return d < v.length ? (m = v[d], p = m.tileset, e.log("process model layer"), w = n.getURL(p), [4, K(w, e)]) : [3, 9];
567
+ return v < p.length ? (b = p[v], w = b.tileset, r.log("process model layer"), d = n.getURL(w), [4, V(d, r)]) : [3, 9];
554
568
  case 7:
555
569
  h.sent(), h.label = 8;
556
570
  case 8:
557
- return d++, [3, 6];
571
+ return v++, [3, 6];
558
572
  case 9:
559
573
  return [
560
574
  2
@@ -564,43 +578,43 @@ function ae(n, e) {
564
578
  });
565
579
  });
566
580
  }
567
- function E(n, e, r) {
568
- return k(this, void 0, void 0, function() {
569
- var a, i, t, o, u, f, s, c, l, g, d, v, m, p;
570
- return y(this, function(w) {
571
- switch (w.label) {
581
+ function N(n, r, e) {
582
+ return U(this, void 0, void 0, function() {
583
+ var a, i, t, u, o, l, s, c, f, m, v, p, b, w;
584
+ return L(this, function(d) {
585
+ switch (d.label) {
572
586
  case 0:
573
- return a = F(r.distPath, U(n, r.baseURL)), i = O(n, a, r.fetch), r.log(function(h) {
587
+ return a = _(e.distPath, S(n, e.baseURL)), i = E(n, a, e.fetch), e.log(function(h) {
574
588
  return "download: ".concat(n, " -> ").concat(h);
575
589
  }, i), [4, i];
576
590
  case 1:
577
- if (w.sent(), t = Math.pow(2, e.level), o = r.imageOptions.format, o.length === 0 && o.push(void 0), u = [], t > 1)
578
- for (f = 0; f < t; f++)
591
+ if (d.sent(), t = Math.pow(2, r.level), u = e.imageOptions.format, u.length === 0 && u.push(void 0), o = [], t > 1)
592
+ for (l = 0; l < t; l++)
579
593
  for (s = 0; s < t; s++)
580
- for (c = 0, l = o; c < l.length; c++)
581
- g = l[c], d = [
582
- e.size / t * s,
583
- e.size / t * f,
584
- e.size / t,
585
- e.size / t
586
- ], v = e.scale >= 1 ? void 0 : e.scale * e.size / t, m = I(a, {
587
- format: g,
588
- size: v,
589
- cut: d,
590
- toFilename: r.imageProcessingFilename
591
- }), r.log(function(h) {
594
+ for (c = 0, f = u; c < f.length; c++)
595
+ m = f[c], v = [
596
+ r.size / t * s,
597
+ r.size / t * l,
598
+ r.size / t,
599
+ r.size / t
600
+ ], p = r.scale >= 1 ? void 0 : r.scale * r.size / t, b = B(a, {
601
+ format: m,
602
+ size: p,
603
+ cut: v,
604
+ toFilename: e.imageProcessingFilename
605
+ }), e.log(function(h) {
592
606
  return "imageProcessing: ".concat(a, " -> ").concat(h);
593
- }, m), u.push(m), e.level === 1 && e.scale >= 0.5 && (g === "jpg" || /\.jpg$/.test(a)) && (p = I(a, {
594
- format: g,
607
+ }, b), o.push(b), r.level === 1 && r.scale >= 0.5 && (m === "jpg" || /\.jpg$/.test(a)) && (w = B(a, {
608
+ format: m,
595
609
  size: void 0,
596
- cut: d,
597
- toFilename: r.imageProcessingFilename
598
- }), r.log(function(h) {
610
+ cut: v,
611
+ toFilename: e.imageProcessingFilename
612
+ }), e.log(function(h) {
599
613
  return "imageProcessing: ".concat(a, " -> ").concat(h);
600
- }, p), u.push(p));
601
- return [4, Promise.all(u)];
614
+ }, w), o.push(w));
615
+ return [4, Promise.all(o)];
602
616
  case 2:
603
- return w.sent(), [
617
+ return d.sent(), [
604
618
  2
605
619
  /*return*/
606
620
  ];
@@ -608,21 +622,21 @@ function E(n, e, r) {
608
622
  });
609
623
  });
610
624
  }
611
- function ie(n, e) {
612
- return k(this, void 0, void 0, function() {
613
- return y(this, function(r) {
614
- switch (r.label) {
625
+ function ue(n, r) {
626
+ return U(this, void 0, void 0, function() {
627
+ return L(this, function(e) {
628
+ switch (e.label) {
615
629
  case 0:
616
630
  return [4, Promise.all([
617
- E(n.work.getURL(n.front), n, e),
618
- E(n.work.getURL(n.back), n, e),
619
- E(n.work.getURL(n.left), n, e),
620
- E(n.work.getURL(n.right), n, e),
621
- E(n.work.getURL(n.up), n, e),
622
- E(n.work.getURL(n.down), n, e)
631
+ N(n.work.getURL(n.front), n, r),
632
+ N(n.work.getURL(n.back), n, r),
633
+ N(n.work.getURL(n.left), n, r),
634
+ N(n.work.getURL(n.right), n, r),
635
+ N(n.work.getURL(n.up), n, r),
636
+ N(n.work.getURL(n.down), n, r)
623
637
  ])];
624
638
  case 1:
625
- return r.sent(), [
639
+ return e.sent(), [
626
640
  2
627
641
  /*return*/
628
642
  ];
@@ -630,28 +644,64 @@ function ie(n, e) {
630
644
  });
631
645
  });
632
646
  }
633
- function T(n, e) {
634
- return k(this, void 0, void 0, function() {
635
- var r, a, i, t, o, u, f, s, c, l, g, d;
636
- return y(this, function(v) {
637
- switch (v.label) {
647
+ function I(n, r, e) {
648
+ return U(this, void 0, void 0, function() {
649
+ var a, i, t, u, o, l, s, c, f, m, v, p, b, w, d, h;
650
+ return L(this, function(y) {
651
+ switch (y.label) {
638
652
  case 0:
639
- return r = F(e.distPath, U(n, e.baseURL)), a = O(n, r, e.fetch), e.log(function(m) {
640
- return "download: ".concat(n, " -> ").concat(m);
641
- }, a), [4, a];
653
+ return a = _(e.distPath, S(n, e.baseURL)), i = E(n, a, e.fetch), e.log(function(k) {
654
+ return "download: ".concat(n, " -> ").concat(k);
655
+ }, i), [4, i];
642
656
  case 1:
643
- for (v.sent(), i = e.imageOptions.format, i.length === 0 && i.push(void 0), t = e.imageOptions.size, t.length === 0 && t.push(void 0), o = [], u = 0, f = i; u < f.length; u++)
644
- for (s = f[u], c = 0, l = t; c < l.length; c++)
645
- g = l[c], d = I(r, {
646
- format: s,
647
- size: g,
648
- toFilename: e.imageProcessingFilename
649
- }), e.log(function(m) {
650
- return "imageProcessing: ".concat(r, " -> ").concat(m);
651
- }, d), o.push(d);
652
- return [4, Promise.all(o)];
657
+ y.sent(), t = e.imageOptions.format, t.length === 0 && t.push(void 0), u = e.imageOptions.size, u.length === 0 && u.push(void 0), o = function(k) {
658
+ var g, z, F, P, R, j, O;
659
+ return L(this, function(T) {
660
+ switch (T.label) {
661
+ case 0:
662
+ return g = n.replace(/cube\_\d+/, "cube_".concat(k)), z = _(e.distPath, S(g, e.baseURL)), F = E(g, z, e.fetch), e.log(function($) {
663
+ return "download ".concat(g, " -> ").concat(z);
664
+ }, F), [4, F];
665
+ case 1:
666
+ T.sent(), P = 0, R = t, T.label = 2;
667
+ case 2:
668
+ return P < R.length ? (j = R[P], O = B(z, {
669
+ format: j,
670
+ toFilename: e.imageProcessingFilename
671
+ }), e.log(function($) {
672
+ return "imageProcessing: ".concat(z, " -> ").concat($);
673
+ }, O), [4, O]) : [3, 5];
674
+ case 3:
675
+ T.sent(), T.label = 4;
676
+ case 4:
677
+ return P++, [3, 2];
678
+ case 5:
679
+ return [
680
+ 2
681
+ /*return*/
682
+ ];
683
+ }
684
+ });
685
+ }, l = 0, s = r, y.label = 2;
653
686
  case 2:
654
- return v.sent(), [
687
+ return l < s.length ? (c = s[l], [5, o(c)]) : [3, 5];
688
+ case 3:
689
+ y.sent(), y.label = 4;
690
+ case 4:
691
+ return l++, [3, 2];
692
+ case 5:
693
+ for (f = [], m = 0, v = t; m < v.length; m++)
694
+ for (p = v[m], b = 0, w = u; b < w.length; b++)
695
+ d = w[b], h = B(a, {
696
+ format: p,
697
+ size: d,
698
+ toFilename: e.imageProcessingFilename
699
+ }), e.log(function(k) {
700
+ return "imageProcessing: ".concat(a, " -> ").concat(k);
701
+ }, h), f.push(h);
702
+ return [4, Promise.all(f)];
703
+ case 6:
704
+ return y.sent(), [
655
705
  2
656
706
  /*return*/
657
707
  ];
@@ -659,23 +709,23 @@ function T(n, e) {
659
709
  });
660
710
  });
661
711
  }
662
- function se(n, e) {
663
- return k(this, void 0, void 0, function() {
664
- var r;
665
- return y(this, function(a) {
712
+ function oe(n, r) {
713
+ return U(this, void 0, void 0, function() {
714
+ var e;
715
+ return L(this, function(a) {
666
716
  switch (a.label) {
667
717
  case 0:
668
- return r = n.images, [4, Promise.all([
669
- T(r.work.getURL(r.front), e),
670
- T(r.work.getURL(r.back), e),
671
- T(r.work.getURL(r.left), e),
672
- T(r.work.getURL(r.right), e),
673
- T(r.work.getURL(r.up), e),
674
- T(r.work.getURL(r.down), e)
718
+ return e = n.images, [4, Promise.all([
719
+ I(e.work.getURL(e.front), e.sizeList, r),
720
+ I(e.work.getURL(e.back), e.sizeList, r),
721
+ I(e.work.getURL(e.left), e.sizeList, r),
722
+ I(e.work.getURL(e.right), e.sizeList, r),
723
+ I(e.work.getURL(e.up), e.sizeList, r),
724
+ I(e.work.getURL(e.down), e.sizeList, r)
675
725
  ])];
676
726
  case 1:
677
- return a.sent(), r.tiles ? [4, Promise.all(r.tiles.map(function(i) {
678
- return ie(i, e);
727
+ return a.sent(), e.tiles ? [4, Promise.all(e.tiles.map(function(i) {
728
+ return ue(i, r);
679
729
  }))] : [3, 3];
680
730
  case 2:
681
731
  a.sent(), a.label = 3;
@@ -688,17 +738,17 @@ function se(n, e) {
688
738
  });
689
739
  });
690
740
  }
691
- function oe(n, e) {
692
- return k(this, void 0, void 0, function() {
693
- var r, a, i, t, o;
694
- return y(this, function(u) {
695
- switch (u.label) {
741
+ function ce(n, r) {
742
+ return U(this, void 0, void 0, function() {
743
+ var e, a, i, t, u;
744
+ return L(this, function(o) {
745
+ switch (o.label) {
696
746
  case 0:
697
- r = n.observers, a = 0, i = r, u.label = 1;
747
+ e = n.observers, a = 0, i = e, o.label = 1;
698
748
  case 1:
699
- return a < i.length ? (t = i[a], o = se(t, e), e.log("process observer #".concat(t.index, " derived: ").concat(t.derivedIdStr), o), [4, o]) : [3, 4];
749
+ return a < i.length ? (t = i[a], u = oe(t, r), r.log("process observer #".concat(t.index, " derived: ").concat(t.derivedIdStr), u), [4, u]) : [3, 4];
700
750
  case 2:
701
- u.sent(), u.label = 3;
751
+ o.sent(), o.label = 3;
702
752
  case 3:
703
753
  return a++, [3, 1];
704
754
  case 4:
@@ -710,12 +760,12 @@ function oe(n, e) {
710
760
  });
711
761
  });
712
762
  }
713
- function ue(n, e) {
714
- if (e) {
715
- var r = Date.now();
716
- e.then(function(i) {
717
- var t = Date.now() - r, o = typeof n == "function" ? n(i) : n;
718
- console.log(o + "(".concat(t, "ms)"));
763
+ function le(n, r) {
764
+ if (r) {
765
+ var e = Date.now();
766
+ r.then(function(i) {
767
+ var t = Date.now() - e, u = typeof n == "function" ? n(i) : n;
768
+ console.log(u + "(".concat(t, "ms)"));
719
769
  }).catch(function() {
720
770
  });
721
771
  } else {
@@ -723,42 +773,42 @@ function ue(n, e) {
723
773
  console.log(a);
724
774
  }
725
775
  }
726
- function ge(n) {
727
- return k(this, arguments, void 0, function(e, r) {
728
- var a, i, t, o, u, f, s, c, l, g, d, v, m, p, w;
729
- return r === void 0 && (r = {}), y(this, function(h) {
776
+ function ve(n) {
777
+ return U(this, arguments, void 0, function(r, e) {
778
+ var a, i, t, u, o, l, s, c, f, m, v, p, b, w, d;
779
+ return e === void 0 && (e = {}), L(this, function(h) {
730
780
  switch (h.label) {
731
781
  case 0:
732
- if (a = e.baseURL, i = "", r.distPath)
733
- i = W(process.cwd(), r.distPath);
782
+ if (a = r.baseURL, i = "", e.distPath)
783
+ i = A(process.cwd(), e.distPath);
734
784
  else
735
- for (i = W(process.cwd(), (f = e.workCode) !== null && f !== void 0 ? f : "work-".concat(Date.now())); M(i); )
736
- /.-(\d+)$/.test(i) ? i = i.replace(/.-(\d+)$/, function(L, P) {
737
- return "-" + (Number(P) + 1);
785
+ for (i = A(process.cwd(), (l = r.workCode) !== null && l !== void 0 ? l : "work-".concat(Date.now())); C(i); )
786
+ /.-(\d+)$/.test(i) ? i = i.replace(/.-(\d+)$/, function(y, k) {
787
+ return "-" + (Number(k) + 1);
738
788
  }) : i = i + "-1";
739
789
  return t = {
740
790
  baseURL: a,
741
791
  distPath: i,
742
- fetch: (s = r.fetch) !== null && s !== void 0 ? s : fetch,
792
+ fetch: (s = e.fetch) !== null && s !== void 0 ? s : fetch,
743
793
  imageOptions: {
744
- size: (l = (c = r.imageOptions) === null || c === void 0 ? void 0 : c.size) !== null && l !== void 0 ? l : [],
745
- format: (d = (g = r.imageOptions) === null || g === void 0 ? void 0 : g.format) !== null && d !== void 0 ? d : []
794
+ size: (f = (c = e.imageOptions) === null || c === void 0 ? void 0 : c.size) !== null && f !== void 0 ? f : [],
795
+ format: (v = (m = e.imageOptions) === null || m === void 0 ? void 0 : m.format) !== null && v !== void 0 ? v : []
746
796
  },
747
797
  textureOptions: {
748
- size: (m = (v = r.textureOptions) === null || v === void 0 ? void 0 : v.size) !== null && m !== void 0 ? m : [],
749
- format: (w = (p = r.textureOptions) === null || p === void 0 ? void 0 : p.format) !== null && w !== void 0 ? w : []
798
+ size: (b = (p = e.textureOptions) === null || p === void 0 ? void 0 : p.size) !== null && b !== void 0 ? b : [],
799
+ format: (d = (w = e.textureOptions) === null || w === void 0 ? void 0 : w.format) !== null && d !== void 0 ? d : []
750
800
  },
751
- log: r.log ? ue : (function() {
801
+ log: e.log ? le : (function() {
752
802
  return Promise.resolve();
753
803
  }),
754
- imageProcessingFilename: r.imageProcessingFilename
755
- }, t.log(JSON.stringify(t, null, " ")), [4, q(i, { recursive: !0 })];
804
+ imageProcessingFilename: e.imageProcessingFilename
805
+ }, t.log(JSON.stringify(t, null, " ")), [4, H(i, { recursive: !0 })];
756
806
  case 1:
757
- return h.sent(), o = "work.json", u = W(i, o), [4, X(u, JSON.stringify(e.toJSON(), null, " "))];
807
+ return h.sent(), u = "work.json", o = A(i, u), [4, q(o, JSON.stringify(r.toJSON(), null, " "))];
758
808
  case 2:
759
- return h.sent(), [4, oe(e, t)];
809
+ return h.sent(), [4, ce(r, t)];
760
810
  case 3:
761
- return h.sent(), [4, ae(e, t)];
811
+ return h.sent(), [4, se(r, t)];
762
812
  case 4:
763
813
  return h.sent(), [
764
814
  2
@@ -769,5 +819,5 @@ function ge(n) {
769
819
  });
770
820
  }
771
821
  export {
772
- ge as download
822
+ ve as download
773
823
  };