@realsee/five 6.7.0-alpha.4 → 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.
- package/five/index.js +4 -4
- package/five/index.mjs +4 -4
- package/gltf-loader/index.js +3 -3
- package/gltf-loader/index.mjs +3 -3
- package/line/index.js +3 -3
- package/line/index.mjs +3 -3
- package/package.json +1 -1
- package/plugins/index.js +2 -2
- package/plugins/index.mjs +2 -2
- package/react/index.js +2 -2
- package/react/index.mjs +2 -2
- package/shader-lib/index.js +2 -2
- package/shader-lib/index.mjs +2 -2
- package/sticker/index.js +3 -3
- package/sticker/index.mjs +3 -3
- package/umd/five-gltf-loader.js +3 -3
- package/umd/five-line.js +3 -3
- package/umd/five-plugins.js +2 -2
- package/umd/five-react.js +2 -2
- package/umd/five-shader-lib.js +2 -2
- package/umd/five-sticker.js +3 -3
- package/umd/five-vfx.js +2 -2
- package/umd/five-vue.js +2 -2
- package/umd/five.js +4 -4
- package/vfx/index.js +2 -2
- package/vfx/index.mjs +2 -2
- package/vue/index.js +2 -2
- package/vue/index.mjs +2 -2
- package/work-downloader/index.js +3 -3
- package/work-downloader/index.mjs +306 -256
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
3
|
* @realsee/five
|
|
4
|
-
* Generated: 2025/10/
|
|
5
|
-
* Version: 6.7.0-alpha.
|
|
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
|
|
256
|
-
import { writeFile as
|
|
257
|
-
import { dirname as
|
|
258
|
-
import { Readable as
|
|
259
|
-
import
|
|
260
|
-
function
|
|
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
|
|
263
|
-
|
|
262
|
+
return t instanceof e ? t : new e(function(u) {
|
|
263
|
+
u(t);
|
|
264
264
|
});
|
|
265
265
|
}
|
|
266
|
-
return new (
|
|
267
|
-
function
|
|
266
|
+
return new (e || (e = Promise))(function(t, u) {
|
|
267
|
+
function o(c) {
|
|
268
268
|
try {
|
|
269
269
|
s(a.next(c));
|
|
270
|
-
} catch (
|
|
271
|
-
|
|
270
|
+
} catch (f) {
|
|
271
|
+
u(f);
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
-
function
|
|
274
|
+
function l(c) {
|
|
275
275
|
try {
|
|
276
276
|
s(a.throw(c));
|
|
277
|
-
} catch (
|
|
278
|
-
|
|
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(
|
|
282
|
+
c.done ? t(c.value) : i(c.value).then(o, l);
|
|
283
283
|
}
|
|
284
|
-
s((a = a.apply(n,
|
|
284
|
+
s((a = a.apply(n, r || [])).next());
|
|
285
285
|
});
|
|
286
286
|
}
|
|
287
|
-
function
|
|
288
|
-
var
|
|
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,
|
|
292
|
-
return
|
|
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
|
-
}),
|
|
295
|
-
function
|
|
294
|
+
}), u;
|
|
295
|
+
function o(s) {
|
|
296
296
|
return function(c) {
|
|
297
|
-
return
|
|
297
|
+
return l([s, c]);
|
|
298
298
|
};
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function l(s) {
|
|
301
301
|
if (a) throw new TypeError("Generator is already executing.");
|
|
302
|
-
for (;
|
|
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
|
|
310
|
+
return e.label++, { value: s[1], done: !1 };
|
|
311
311
|
case 5:
|
|
312
|
-
|
|
312
|
+
e.label++, i = s[1], s = [0];
|
|
313
313
|
continue;
|
|
314
314
|
case 7:
|
|
315
|
-
s =
|
|
315
|
+
s = e.ops.pop(), e.trys.pop();
|
|
316
316
|
continue;
|
|
317
317
|
default:
|
|
318
|
-
if (t =
|
|
319
|
-
|
|
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
|
-
|
|
323
|
+
e.label = s[1];
|
|
324
324
|
break;
|
|
325
325
|
}
|
|
326
|
-
if (s[0] === 6 &&
|
|
327
|
-
|
|
326
|
+
if (s[0] === 6 && e.label < t[1]) {
|
|
327
|
+
e.label = t[1], t = s;
|
|
328
328
|
break;
|
|
329
329
|
}
|
|
330
|
-
if (t &&
|
|
331
|
-
|
|
330
|
+
if (t && e.label < t[2]) {
|
|
331
|
+
e.label = t[2], e.ops.push(s);
|
|
332
332
|
break;
|
|
333
333
|
}
|
|
334
|
-
t[2] &&
|
|
334
|
+
t[2] && e.ops.pop(), e.trys.pop();
|
|
335
335
|
continue;
|
|
336
336
|
}
|
|
337
|
-
s =
|
|
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
|
|
348
|
-
if (
|
|
349
|
-
return n.slice(
|
|
350
|
-
throw new Error("".concat(n, " is not starting with ").concat(
|
|
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
|
|
353
|
-
for (var n = [],
|
|
354
|
-
n[
|
|
355
|
-
var
|
|
356
|
-
n = n.map(function(
|
|
357
|
-
return (
|
|
358
|
-
}).filter(function(
|
|
359
|
-
return
|
|
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,
|
|
363
|
-
i || (
|
|
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
|
|
365
|
+
return e.join("/");
|
|
366
366
|
}
|
|
367
|
-
var
|
|
368
|
-
function
|
|
369
|
-
return
|
|
370
|
-
var a, i, t,
|
|
371
|
-
return
|
|
372
|
-
switch (
|
|
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
|
|
374
|
+
return C(r) ? [2, r] : [4, e(n)];
|
|
375
375
|
case 1:
|
|
376
|
-
return a =
|
|
376
|
+
return a = o.sent(), a.ok && a.body ? [4, H(x(r), { recursive: !0 })] : [3, 6];
|
|
377
377
|
case 2:
|
|
378
|
-
return
|
|
379
|
-
var c =
|
|
380
|
-
c.pipe(
|
|
381
|
-
return
|
|
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 =
|
|
387
|
+
return t = o.sent(), [4, q(r, Buffer.from(t))];
|
|
388
388
|
case 5:
|
|
389
|
-
return
|
|
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
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
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 && (
|
|
406
|
-
return
|
|
407
|
-
})
|
|
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
|
|
414
|
-
var
|
|
415
|
-
if (n.content && (n.content.uri ?
|
|
416
|
-
for (var
|
|
417
|
-
var i = a[
|
|
418
|
-
t.length > 0 &&
|
|
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
|
|
434
|
+
return r;
|
|
421
435
|
}
|
|
422
|
-
function
|
|
423
|
-
return
|
|
436
|
+
function ie(n, r, e) {
|
|
437
|
+
return U(this, void 0, void 0, function() {
|
|
424
438
|
var a, i, t;
|
|
425
|
-
return
|
|
426
|
-
switch (
|
|
439
|
+
return L(this, function(u) {
|
|
440
|
+
switch (u.label) {
|
|
427
441
|
case 0:
|
|
428
|
-
return a = new URL(n,
|
|
429
|
-
return "download: ".concat(a, " -> ").concat(
|
|
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
|
|
446
|
+
return u.sent(), /\.json$/.test(n) ? [4, V(a, e)] : [3, 3];
|
|
433
447
|
case 2:
|
|
434
|
-
|
|
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
|
|
445
|
-
return
|
|
446
|
-
var
|
|
447
|
-
return
|
|
448
|
-
switch (
|
|
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
|
|
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
|
|
468
|
+
return g.sent(), u = (t = JSON).parse, [4, Z(e, "utf8")];
|
|
455
469
|
case 2:
|
|
456
|
-
return i =
|
|
457
|
-
return "download: ".concat(
|
|
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
|
-
|
|
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
|
|
465
|
-
return
|
|
466
|
-
switch (
|
|
478
|
+
var F, P, R;
|
|
479
|
+
return L(this, function(j) {
|
|
480
|
+
switch (j.label) {
|
|
467
481
|
case 0:
|
|
468
|
-
return
|
|
469
|
-
return "download: ".concat(
|
|
470
|
-
},
|
|
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
|
|
486
|
+
return j.sent(), [
|
|
473
487
|
2
|
|
474
488
|
/*return*/
|
|
475
489
|
];
|
|
476
490
|
}
|
|
477
491
|
});
|
|
478
|
-
},
|
|
492
|
+
}, f = 0, m = i.asset.trajectories.list, g.label = 5;
|
|
479
493
|
case 5:
|
|
480
|
-
return
|
|
494
|
+
return f < m.length ? (v = m[f], [5, c(v)]) : [3, 8];
|
|
481
495
|
case 6:
|
|
482
|
-
|
|
496
|
+
g.sent(), g.label = 7;
|
|
483
497
|
case 7:
|
|
484
|
-
return
|
|
498
|
+
return f++, [3, 5];
|
|
485
499
|
case 8:
|
|
486
|
-
|
|
500
|
+
p = Q(i.root), b = 6, w = 0, g.label = 9;
|
|
487
501
|
case 9:
|
|
488
|
-
if (!(
|
|
489
|
-
for (
|
|
490
|
-
|
|
491
|
-
return [4, Promise.all(
|
|
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
|
-
|
|
507
|
+
g.sent(), g.label = 11;
|
|
494
508
|
case 11:
|
|
495
|
-
return
|
|
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
|
|
506
|
-
return
|
|
507
|
-
var
|
|
508
|
-
return
|
|
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
|
|
512
|
-
return "download: ".concat(t, " -> ").concat(
|
|
513
|
-
},
|
|
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(
|
|
517
|
-
var
|
|
518
|
-
return
|
|
519
|
-
switch (
|
|
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
|
|
522
|
-
return "download: ".concat(
|
|
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 (
|
|
526
|
-
for (
|
|
527
|
-
G =
|
|
528
|
-
format:
|
|
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:
|
|
531
|
-
}),
|
|
532
|
-
return "imageProcessing: ".concat(
|
|
533
|
-
},
|
|
534
|
-
return [4, Promise.all(
|
|
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
|
|
550
|
+
return W.sent(), [
|
|
537
551
|
2
|
|
538
552
|
/*return*/
|
|
539
553
|
];
|
|
540
554
|
}
|
|
541
555
|
});
|
|
542
|
-
}, c = 0,
|
|
556
|
+
}, c = 0, f = a, h.label = 2;
|
|
543
557
|
case 2:
|
|
544
|
-
return c <
|
|
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
|
-
|
|
565
|
+
v = 0, p = i, h.label = 6;
|
|
552
566
|
case 6:
|
|
553
|
-
return
|
|
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
|
|
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
|
|
568
|
-
return
|
|
569
|
-
var a, i, t,
|
|
570
|
-
return
|
|
571
|
-
switch (
|
|
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 =
|
|
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 (
|
|
578
|
-
for (
|
|
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,
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
],
|
|
587
|
-
format:
|
|
588
|
-
size:
|
|
589
|
-
cut:
|
|
590
|
-
toFilename:
|
|
591
|
-
}),
|
|
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
|
-
},
|
|
594
|
-
format:
|
|
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:
|
|
597
|
-
toFilename:
|
|
598
|
-
}),
|
|
610
|
+
cut: v,
|
|
611
|
+
toFilename: e.imageProcessingFilename
|
|
612
|
+
}), e.log(function(h) {
|
|
599
613
|
return "imageProcessing: ".concat(a, " -> ").concat(h);
|
|
600
|
-
},
|
|
601
|
-
return [4, Promise.all(
|
|
614
|
+
}, w), o.push(w));
|
|
615
|
+
return [4, Promise.all(o)];
|
|
602
616
|
case 2:
|
|
603
|
-
return
|
|
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
|
|
612
|
-
return
|
|
613
|
-
return
|
|
614
|
-
switch (
|
|
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
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
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
|
|
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
|
|
634
|
-
return
|
|
635
|
-
var
|
|
636
|
-
return
|
|
637
|
-
switch (
|
|
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
|
|
640
|
-
return "download: ".concat(n, " -> ").concat(
|
|
641
|
-
},
|
|
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
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
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
|
|
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
|
|
663
|
-
return
|
|
664
|
-
var
|
|
665
|
-
return
|
|
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
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
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(),
|
|
678
|
-
return
|
|
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
|
|
692
|
-
return
|
|
693
|
-
var
|
|
694
|
-
return
|
|
695
|
-
switch (
|
|
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
|
-
|
|
747
|
+
e = n.observers, a = 0, i = e, o.label = 1;
|
|
698
748
|
case 1:
|
|
699
|
-
return a < i.length ? (t = i[a],
|
|
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
|
-
|
|
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
|
|
714
|
-
if (
|
|
715
|
-
var
|
|
716
|
-
|
|
717
|
-
var t = Date.now() -
|
|
718
|
-
console.log(
|
|
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
|
|
727
|
-
return
|
|
728
|
-
var a, i, t,
|
|
729
|
-
return
|
|
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 =
|
|
733
|
-
i =
|
|
782
|
+
if (a = r.baseURL, i = "", e.distPath)
|
|
783
|
+
i = A(process.cwd(), e.distPath);
|
|
734
784
|
else
|
|
735
|
-
for (i =
|
|
736
|
-
/.-(\d+)$/.test(i) ? i = i.replace(/.-(\d+)$/, function(
|
|
737
|
-
return "-" + (Number(
|
|
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 =
|
|
792
|
+
fetch: (s = e.fetch) !== null && s !== void 0 ? s : fetch,
|
|
743
793
|
imageOptions: {
|
|
744
|
-
size: (
|
|
745
|
-
format: (
|
|
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: (
|
|
749
|
-
format: (
|
|
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:
|
|
801
|
+
log: e.log ? le : (function() {
|
|
752
802
|
return Promise.resolve();
|
|
753
803
|
}),
|
|
754
|
-
imageProcessingFilename:
|
|
755
|
-
}, t.log(JSON.stringify(t, null, " ")), [4,
|
|
804
|
+
imageProcessingFilename: e.imageProcessingFilename
|
|
805
|
+
}, t.log(JSON.stringify(t, null, " ")), [4, H(i, { recursive: !0 })];
|
|
756
806
|
case 1:
|
|
757
|
-
return h.sent(),
|
|
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,
|
|
809
|
+
return h.sent(), [4, ce(r, t)];
|
|
760
810
|
case 3:
|
|
761
|
-
return h.sent(), [4,
|
|
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
|
-
|
|
822
|
+
ve as download
|
|
773
823
|
};
|