@openmockup-studio/player 0.0.0-stage → 0.2.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.
@@ -0,0 +1,3227 @@
1
+ import { t as e } from "./rolldown-runtime-CGnMp29N.js";
2
+ import { A as t, C as n, D as r, H as i, L as a, U as o, X as s, Y as c, c as l, f as u, k as d, l as f, m as p, n as m, p as h, s as g, v as _, x as v } from "./three-o_76Nw0r.js";
3
+ // ../devices/src/primitives/dispose.ts
4
+ function y(e) {
5
+ e.traverse((e) => {
6
+ if (!(e instanceof r)) return;
7
+ e.geometry.dispose();
8
+ let t = Array.isArray(e.material) ? e.material : [e.material];
9
+ for (let e of t) e.dispose();
10
+ });
11
+ }
12
+ // ../devices/src/primitives/logo.ts
13
+ var b = "M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701", x = null;
14
+ function S() {
15
+ if (!x) {
16
+ let e = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="${b}"/></svg>`, { paths: t } = new m().parse(e);
17
+ x = t.flatMap((e) => m.createShapes(e));
18
+ }
19
+ return x;
20
+ }
21
+ function C(e) {
22
+ let t = new o(S(), 12);
23
+ t.computeBoundingBox();
24
+ let n = t.boundingBox;
25
+ if (!n) return t;
26
+ let r = new s();
27
+ n.getSize(r);
28
+ let i = new s();
29
+ n.getCenter(i);
30
+ let a = e / r.y;
31
+ return t.translate(-i.x, -i.y, 0), t.scale(a, -a, 1), t.computeVertexNormals(), t;
32
+ }
33
+ // ../core/src/fit.ts
34
+ function w(e, t, n = "cover", r = [.5, .5]) {
35
+ if (n === "stretch") return {
36
+ repeat: [1, 1],
37
+ offset: [0, 0]
38
+ };
39
+ let i = e > t;
40
+ if (n === "cover" ? i : !i) {
41
+ let n = t / e;
42
+ return {
43
+ repeat: [n, 1],
44
+ offset: [(1 - n) * r[0], 0]
45
+ };
46
+ }
47
+ let a = e / t;
48
+ return {
49
+ repeat: [1, a],
50
+ offset: [0, (1 - a) * r[1]]
51
+ };
52
+ }
53
+ function ee(e) {
54
+ if (!e) return [.5, .5];
55
+ let t = (e) => Number.isFinite(e) ? Math.min(1, Math.max(0, e)) : .5;
56
+ return [t(e[0]), t(e[1])];
57
+ }
58
+ // ../core/src/ids.ts
59
+ function te(e = "") {
60
+ let t = typeof crypto < "u" && "randomUUID" in crypto ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2, 10)}`;
61
+ return e ? `${e}_${t.slice(0, 8)}` : t;
62
+ }
63
+ // ../core/src/easing.ts
64
+ var ne = 1.70158, re = 2.70158, ie = {
65
+ linear: (e) => e,
66
+ easeInQuad: (e) => e * e,
67
+ easeOutQuad: (e) => 1 - (1 - e) * (1 - e),
68
+ easeInOutQuad: (e) => e < .5 ? 2 * e * e : 1 - (-2 * e + 2) ** 2 / 2,
69
+ easeInOutCubic: (e) => e < .5 ? 4 * e * e * e : 1 - (-2 * e + 2) ** 3 / 2,
70
+ easeOutExpo: (e) => e >= 1 ? 1 : 1 - 2 ** (-10 * e),
71
+ easeOutBack: (e) => 1 + re * (e - 1) ** 3 + ne * (e - 1) ** 2,
72
+ easeInOutSine: (e) => -(Math.cos(Math.PI * e) - 1) / 2
73
+ };
74
+ Object.keys(ie);
75
+ var ae = 11, T = 1 / 10, oe = (e, t) => 1 - 3 * t + 3 * e, se = (e, t) => 3 * t - 6 * e, ce = (e) => 3 * e, le = (e, t, n) => ((oe(t, n) * e + se(t, n)) * e + ce(t)) * e, ue = (e, t, n) => 3 * oe(t, n) * e * e + 2 * se(t, n) * e + ce(t);
76
+ function de(e, t, n, r) {
77
+ if (e === t && n === r) return ie.linear;
78
+ let i = new Float64Array(ae);
79
+ for (let t = 0; t < ae; t++) i[t] = le(t * T, e, n);
80
+ let a = (t) => {
81
+ let r = 0, a = 1;
82
+ for (; a < 10 && (i[a] ?? 1) <= t; a++) r += T;
83
+ a--;
84
+ let o = i[a] ?? 0, s = i[a + 1] ?? 1, c = (t - o) / (s - o || 1), l = r + c * T, u = ue(l, e, n);
85
+ if (u >= .001) {
86
+ for (let r = 0; r < 4; r++) {
87
+ let r = ue(l, e, n);
88
+ if (r === 0) return l;
89
+ l -= (le(l, e, n) - t) / r;
90
+ }
91
+ return l;
92
+ }
93
+ if (u === 0) return l;
94
+ let d = r, f = r + T;
95
+ for (let r = 0; r < 10; r++) {
96
+ l = d + (f - d) / 2;
97
+ let r = le(l, e, n) - t;
98
+ if (Math.abs(r) < 1e-7) break;
99
+ r > 0 ? f = l : d = l;
100
+ }
101
+ return l;
102
+ };
103
+ return (e) => e <= 0 ? 0 : e >= 1 ? 1 : le(a(e), t, r);
104
+ }
105
+ var fe = /* @__PURE__ */ new Map();
106
+ function pe(e) {
107
+ if (typeof e == "string") return ie[e] ?? ie.linear;
108
+ let t = e.bezier.join(","), n = fe.get(t);
109
+ return n || (n = de(...e.bezier), fe.set(t, n)), n;
110
+ }
111
+ // ../core/src/timeline.ts
112
+ function me(e) {
113
+ return {
114
+ duration: e.duration,
115
+ fps: e.fps,
116
+ tracks: e.tracks.filter((e) => e.keys.length > 0).map(he)
117
+ };
118
+ }
119
+ function he(e) {
120
+ let t = [...e.keys].sort((e, t) => e.t - t.t);
121
+ return {
122
+ target: e.target,
123
+ type: e.type,
124
+ times: Float64Array.from(t, (e) => e.t),
125
+ values: t.map((e) => e.value),
126
+ easings: t.map((e) => pe(e.easing)),
127
+ holds: t.map((e) => e.interpolation === "hold")
128
+ };
129
+ }
130
+ function ge(e, t) {
131
+ let n = 0, r = e.length - 1;
132
+ if (t < (e[0] ?? 0)) return -1;
133
+ for (; n < r;) {
134
+ let i = n + r + 1 >> 1;
135
+ (e[i] ?? Infinity) <= t ? n = i : r = i - 1;
136
+ }
137
+ return n;
138
+ }
139
+ function _e(e, t) {
140
+ let { times: n, values: r } = e, i = n.length - 1, a = ge(n, t);
141
+ if (a < 0) return r[0];
142
+ if (a >= i) return r[i];
143
+ let o = r[a];
144
+ if (e.holds[a]) return o;
145
+ let s = r[a + 1], c = n[a] ?? 0, l = (n[a + 1] ?? c) - c;
146
+ return ye(o, s, l > 0 ? (e.easings[a] ?? ((e) => e))((t - c) / l) : 1, e.type);
147
+ }
148
+ function ve(e, t) {
149
+ let n = /* @__PURE__ */ new Map();
150
+ for (let r of e.tracks) n.set(r.target, { value: _e(r, t) });
151
+ return n;
152
+ }
153
+ function ye(e, t, n, r) {
154
+ return r === "number" && typeof e == "number" && typeof t == "number" ? e + (t - e) * n : r === "vec3" && Array.isArray(e) && Array.isArray(t) ? be(e, t, n) : r === "color" && typeof e == "string" && typeof t == "string" ? xe(e, t, n) : n < 1 ? e : t;
155
+ }
156
+ function be(e, t, n) {
157
+ return [
158
+ e[0] + (t[0] - e[0]) * n,
159
+ e[1] + (t[1] - e[1]) * n,
160
+ e[2] + (t[2] - e[2]) * n
161
+ ];
162
+ }
163
+ function xe(e, t, n) {
164
+ let r = Se(e), i = Se(t);
165
+ if (!r || !i) return n < 1 ? e : t;
166
+ let a = (e) => Math.round((r[e] ?? 0) + ((i[e] ?? 0) - (r[e] ?? 0)) * n);
167
+ return `#${[
168
+ a(0),
169
+ a(1),
170
+ a(2)
171
+ ].map((e) => e.toString(16).padStart(2, "0")).join("")}`;
172
+ }
173
+ function Se(e) {
174
+ let t = /^#?([0-9a-f]{6})$/i.exec(e.trim());
175
+ if (!t || !t[1]) return null;
176
+ let n = parseInt(t[1], 16);
177
+ return [
178
+ n >> 16 & 255,
179
+ n >> 8 & 255,
180
+ n & 255
181
+ ];
182
+ }
183
+ // ../core/src/state.ts
184
+ var E = (e) => [
185
+ e[0],
186
+ e[1],
187
+ e[2]
188
+ ];
189
+ function Ce(e, t) {
190
+ let { scene: n } = e, r = {};
191
+ for (let e of n.devices) r[e.id] = {
192
+ position: E(e.transform.position),
193
+ rotation: E(e.transform.rotation),
194
+ scale: e.transform.scale,
195
+ params: { ...e.params },
196
+ screenFinish: e.screenFinish,
197
+ glare: e.glare,
198
+ visible: !0
199
+ };
200
+ let i = {};
201
+ for (let e of n.screens) {
202
+ let n = e.video, r = 0;
203
+ if (n) {
204
+ r = Math.max(0, (t - n.start) * n.playbackRate);
205
+ let i = e.media && "duration" in e.media ? e.media.duration : void 0;
206
+ n.loop && i && i > 0 && (r %= i);
207
+ }
208
+ i[e.id] = {
209
+ mediaTime: r,
210
+ opacity: 1
211
+ };
212
+ }
213
+ return {
214
+ time: t,
215
+ camera: {
216
+ position: E(n.camera.position),
217
+ target: E(n.camera.target),
218
+ fov: n.camera.fov,
219
+ roll: n.camera.roll,
220
+ lens: { ...n.camera.lens }
221
+ },
222
+ devices: r,
223
+ screens: i,
224
+ environment: {
225
+ preset: n.environment.preset,
226
+ intensity: n.environment.intensity,
227
+ rotation: n.environment.rotation,
228
+ glow: n.environment.glow
229
+ },
230
+ backdrop: { ...n.backdrop },
231
+ floor: {
232
+ y: n.floor.mode === "fixed" ? n.floor.y ?? 0 : null,
233
+ shadow: n.floor.shadow
234
+ },
235
+ set: { ...n.set }
236
+ };
237
+ }
238
+ function we(e, t) {
239
+ for (let [n, r] of t) {
240
+ let t = n.split("."), [i] = t;
241
+ if (i === "camera") D(e.camera, t.slice(1), r.value, r.add);
242
+ else if (i === "environment") D(e.environment, t.slice(1), r.value, r.add);
243
+ else if (i === "backdrop") D(e.backdrop, t.slice(1), r.value, r.add);
244
+ else if (i === "set") D(e.set, t.slice(1), r.value, r.add);
245
+ else if (i === "devices" || i === "screens") {
246
+ let n = t[1], a = i === "devices" ? e.devices : e.screens, o = n ? a[n] : void 0;
247
+ o && D(o, t.slice(2), r.value, r.add);
248
+ }
249
+ }
250
+ return e;
251
+ }
252
+ function D(e, t, n, r) {
253
+ let i = e;
254
+ for (let e = 0; e < t.length - 1; e++) {
255
+ let n = t[e];
256
+ if (!n) return;
257
+ let r = i[n];
258
+ typeof r == "object" && r || (r = {}, i[n] = r), i = r;
259
+ }
260
+ let a = t[t.length - 1];
261
+ if (!a) return;
262
+ let o = i[a];
263
+ r ? typeof o == "number" && typeof n == "number" ? i[a] = o + n : Array.isArray(o) && Array.isArray(n) && (i[a] = o.map((e, t) => typeof e == "number" ? e + (n[t] ?? 0) : e)) : i[a] = Array.isArray(n) ? [...n] : n;
264
+ }
265
+ function Te(e, t, n = [], r = me(e.timeline)) {
266
+ let i = Ce(e, t);
267
+ we(i, ve(r, t));
268
+ for (let e of n) we(i, e);
269
+ return i;
270
+ }
271
+ // ../core/src/idle.ts
272
+ function Ee(e, t, n) {
273
+ let r = /* @__PURE__ */ new Map();
274
+ if (t <= 0) return r;
275
+ let i = Math.sin(e * .9) * .3 * t, a = Math.sin(e * .6) * 1.7 * t, o = Math.sin(e * .45 + 1) * 2.9 * t;
276
+ for (let e of n) r.set(`devices.${e}.position`, {
277
+ value: [
278
+ 0,
279
+ i,
280
+ 0
281
+ ],
282
+ add: !0
283
+ }), r.set(`devices.${e}.rotation`, {
284
+ value: [
285
+ a,
286
+ o,
287
+ 0
288
+ ],
289
+ add: !0
290
+ });
291
+ return r;
292
+ }
293
+ // ../core/src/presets.ts
294
+ var De = /^devices\.\$(\d+)\./;
295
+ function Oe(e, t, n) {
296
+ let r = new Set(n), i = e.timeline.tracks.filter((e) => {
297
+ let t = e.target.split(".")[1];
298
+ return !(e.target.startsWith("devices.") && t && r.has(t)) && !e.target.startsWith("camera.");
299
+ }), a = [];
300
+ for (let e of t.timeline.tracks) {
301
+ let t = De.exec(e.target), r = e.target;
302
+ if (t && t[1] !== void 0) {
303
+ let i = n[Number(t[1])];
304
+ if (!i) continue;
305
+ r = e.target.replace(De, `devices.${i}.`);
306
+ }
307
+ a.push({
308
+ ...e,
309
+ id: te("trk"),
310
+ target: r,
311
+ keys: e.keys.map((e) => ({ ...e }))
312
+ });
313
+ }
314
+ return {
315
+ ...e,
316
+ scene: {
317
+ ...e.scene,
318
+ camera: t.camera ? {
319
+ ...e.scene.camera,
320
+ ...t.camera
321
+ } : e.scene.camera
322
+ },
323
+ timeline: {
324
+ ...e.timeline,
325
+ duration: t.timeline.duration,
326
+ tracks: [...i, ...a]
327
+ },
328
+ interaction: t.interaction ? {
329
+ ...e.interaction,
330
+ ...t.interaction
331
+ } : e.interaction
332
+ };
333
+ }
334
+ // ../../node_modules/.pnpm/valibot@1.5.0_typescript@5.9.3/node_modules/valibot/dist/index.mjs
335
+ var ke = {
336
+ lang: void 0,
337
+ message: void 0,
338
+ abortEarly: void 0,
339
+ abortPipeEarly: void 0
340
+ };
341
+ /* @__NO_SIDE_EFFECTS__ */
342
+ function Ae(e) {
343
+ return e ? {
344
+ lang: e?.lang ?? void 0,
345
+ message: e?.message,
346
+ abortEarly: e?.abortEarly ?? void 0,
347
+ abortPipeEarly: e?.abortPipeEarly ?? void 0
348
+ } : ke;
349
+ }
350
+ /* @__NO_SIDE_EFFECTS__ */
351
+ function O(e) {
352
+ let t = typeof e;
353
+ return t === "string" ? `"${e}"` : t === "number" || t === "bigint" || t === "boolean" ? `${e}` : t === "object" || t === "function" ? (e && Object.getPrototypeOf(e)?.constructor?.name) ?? "null" : t;
354
+ }
355
+ function k(e, t, n, r, i) {
356
+ let a = i && "input" in i ? i.input : n.value, o = i?.expected ?? e.expects ?? null, s = i?.received ?? /* @__PURE__ */ O(a), c = {
357
+ kind: e.kind,
358
+ type: e.type,
359
+ input: a,
360
+ expected: o,
361
+ received: s,
362
+ message: `Invalid ${t}: ${o ? `Expected ${o} but r` : "R"}eceived ${s}`,
363
+ requirement: e.requirement,
364
+ path: i?.path,
365
+ issues: i?.issues,
366
+ lang: r.lang,
367
+ abortEarly: r.abortEarly,
368
+ abortPipeEarly: r.abortPipeEarly
369
+ }, l = e.kind === "schema", u = i?.message ?? e.message ?? (e.reference, c.lang, void 0) ?? (l ? (c.lang, void 0) : null) ?? r.message ?? (c.lang, void 0);
370
+ u !== void 0 && (c.message = typeof u == "function" ? u(c) : u), l && (n.typed = !1), n.issues ? n.issues.push(c) : n.issues = [c];
371
+ }
372
+ /* @__NO_SIDE_EFFECTS__ */
373
+ function je(e, t) {
374
+ return e === t || Number.isNaN(e) && Number.isNaN(t);
375
+ }
376
+ /* @__NO_SIDE_EFFECTS__ */
377
+ function Me(e, t) {
378
+ return Object.prototype.hasOwnProperty.call(e, t) && t !== "__proto__" && t !== "prototype" && t !== "constructor";
379
+ }
380
+ /* @__NO_SIDE_EFFECTS__ */
381
+ function Ne(e, t) {
382
+ let n = [...new Set(e)];
383
+ return n.length > 1 ? `(${n.join(` ${t} `)})` : n[0] ?? "never";
384
+ }
385
+ function A(e) {
386
+ return e["~standard"] = {
387
+ version: 1,
388
+ vendor: "valibot",
389
+ validate: (t) => e["~run"]({ value: t }, /* @__PURE__ */ Ae())
390
+ }, e;
391
+ }
392
+ var Pe = class extends Error {
393
+ constructor(e) {
394
+ super(e[0].message), this.name = "ValiError", this.issues = e;
395
+ }
396
+ };
397
+ /* @__NO_SIDE_EFFECTS__ */
398
+ function Fe(e, t) {
399
+ return {
400
+ kind: "validation",
401
+ type: "max_value",
402
+ reference: Fe,
403
+ async: !1,
404
+ expects: `<=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ O(e)}`,
405
+ requirement: e,
406
+ message: t,
407
+ "~run"(e, t) {
408
+ return e.typed && !(e.value <= this.requirement) && k(this, "value", e, t, { received: e.value instanceof Date ? e.value.toJSON() : /* @__PURE__ */ O(e.value) }), e;
409
+ }
410
+ };
411
+ }
412
+ /* @__NO_SIDE_EFFECTS__ */
413
+ function Ie(e, t) {
414
+ return {
415
+ kind: "validation",
416
+ type: "min_value",
417
+ reference: Ie,
418
+ async: !1,
419
+ expects: `>=${e instanceof Date ? e.toJSON() : /* @__PURE__ */ O(e)}`,
420
+ requirement: e,
421
+ message: t,
422
+ "~run"(e, t) {
423
+ return e.typed && !(e.value >= this.requirement) && k(this, "value", e, t, { received: e.value instanceof Date ? e.value.toJSON() : /* @__PURE__ */ O(e.value) }), e;
424
+ }
425
+ };
426
+ }
427
+ var Le = { abortEarly: !0 };
428
+ /* @__NO_SIDE_EFFECTS__ */
429
+ function Re(e, t, n) {
430
+ return typeof e.fallback == "function" ? e.fallback(t, n) : e.fallback;
431
+ }
432
+ /* @__NO_SIDE_EFFECTS__ */
433
+ function ze(e, t, n) {
434
+ return typeof e.default == "function" ? e.default(t, n) : e.default;
435
+ }
436
+ /* @__NO_SIDE_EFFECTS__ */
437
+ function j(e, t) {
438
+ return A({
439
+ kind: "schema",
440
+ type: "array",
441
+ reference: j,
442
+ expects: "Array",
443
+ async: !1,
444
+ item: e,
445
+ message: t,
446
+ "~run"(e, t) {
447
+ let n = e.value;
448
+ if (Array.isArray(n)) {
449
+ e.typed = !0, e.value = [];
450
+ for (let r = 0; r < n.length; r++) {
451
+ let i = n[r], a = this.item["~run"]({ value: i }, t);
452
+ if (a.issues) {
453
+ let o = {
454
+ type: "array",
455
+ origin: "value",
456
+ input: n,
457
+ key: r,
458
+ value: i
459
+ };
460
+ for (let t of a.issues) t.path ? t.path.unshift(o) : t.path = [o], e.issues?.push(t);
461
+ if (e.issues ||= a.issues, t.abortEarly) {
462
+ e.typed = !1;
463
+ break;
464
+ }
465
+ }
466
+ a.typed || (e.typed = !1), e.value.push(a.value);
467
+ }
468
+ } else k(this, "type", e, t);
469
+ return e;
470
+ }
471
+ });
472
+ }
473
+ /* @__NO_SIDE_EFFECTS__ */
474
+ function M(e) {
475
+ return A({
476
+ kind: "schema",
477
+ type: "boolean",
478
+ reference: M,
479
+ expects: "boolean",
480
+ async: !1,
481
+ message: e,
482
+ "~run"(e, t) {
483
+ return typeof e.value == "boolean" ? e.typed = !0 : k(this, "type", e, t), e;
484
+ }
485
+ });
486
+ }
487
+ /* @__NO_SIDE_EFFECTS__ */
488
+ function N(e, t) {
489
+ return A({
490
+ kind: "schema",
491
+ type: "literal",
492
+ reference: N,
493
+ expects: /* @__PURE__ */ O(e),
494
+ async: !1,
495
+ literal: e,
496
+ message: t,
497
+ "~run"(e, t) {
498
+ return /* @__PURE__ */ je(e.value, this.literal) ? e.typed = !0 : k(this, "type", e, t), e;
499
+ }
500
+ });
501
+ }
502
+ /* @__NO_SIDE_EFFECTS__ */
503
+ function P(e, t) {
504
+ return A({
505
+ kind: "schema",
506
+ type: "loose_object",
507
+ reference: P,
508
+ expects: "Object",
509
+ async: !1,
510
+ entries: e,
511
+ message: t,
512
+ "~run"(e, t) {
513
+ let n = e.value;
514
+ if (n && typeof n == "object") {
515
+ e.typed = !0, e.value = {};
516
+ for (let r in this.entries) {
517
+ let i = this.entries[r];
518
+ if (r in n || (i.type === "exact_optional" || i.type === "optional" || i.type === "nullish") && i.default !== void 0) {
519
+ let a = r in n ? n[r] : /* @__PURE__ */ ze(i), o = i["~run"]({ value: a }, t);
520
+ if (o.issues) {
521
+ let i = {
522
+ type: "object",
523
+ origin: "value",
524
+ input: n,
525
+ key: r,
526
+ value: a
527
+ };
528
+ for (let t of o.issues) t.path ? t.path.unshift(i) : t.path = [i], e.issues?.push(t);
529
+ if (e.issues ||= o.issues, t.abortEarly) {
530
+ e.typed = !1;
531
+ break;
532
+ }
533
+ }
534
+ o.typed || (e.typed = !1), e.value[r] = o.value;
535
+ } else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */ Re(i);
536
+ else if (i.type !== "exact_optional" && i.type !== "optional" && i.type !== "nullish" && (k(this, "key", e, t, {
537
+ input: void 0,
538
+ expected: `"${r}"`,
539
+ path: [{
540
+ type: "object",
541
+ origin: "key",
542
+ input: n,
543
+ key: r,
544
+ value: n[r]
545
+ }]
546
+ }), t.abortEarly)) break;
547
+ }
548
+ if (!e.issues || !t.abortEarly) for (let t in n) /* @__PURE__ */ Me(n, t) && !Object.prototype.hasOwnProperty.call(this.entries, t) && (e.value[t] = n[t]);
549
+ } else k(this, "type", e, t);
550
+ return e;
551
+ }
552
+ });
553
+ }
554
+ /* @__NO_SIDE_EFFECTS__ */
555
+ function Be(e, t) {
556
+ return A({
557
+ kind: "schema",
558
+ type: "nullable",
559
+ reference: Be,
560
+ expects: `(${e.expects} | null)`,
561
+ async: !1,
562
+ wrapped: e,
563
+ default: t,
564
+ "~run"(e, t) {
565
+ return e.value === null && (this.default !== void 0 && (e.value = /* @__PURE__ */ ze(this, e, t)), e.value === null) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
566
+ }
567
+ });
568
+ }
569
+ /* @__NO_SIDE_EFFECTS__ */
570
+ function F(e) {
571
+ return A({
572
+ kind: "schema",
573
+ type: "number",
574
+ reference: F,
575
+ expects: "number",
576
+ async: !1,
577
+ message: e,
578
+ "~run"(e, t) {
579
+ return typeof e.value == "number" && !isNaN(e.value) ? e.typed = !0 : k(this, "type", e, t), e;
580
+ }
581
+ });
582
+ }
583
+ /* @__NO_SIDE_EFFECTS__ */
584
+ function I(e, t) {
585
+ return A({
586
+ kind: "schema",
587
+ type: "object",
588
+ reference: I,
589
+ expects: "Object",
590
+ async: !1,
591
+ entries: e,
592
+ message: t,
593
+ "~run"(e, t) {
594
+ let n = e.value;
595
+ if (n && typeof n == "object") {
596
+ e.typed = !0, e.value = {};
597
+ for (let r in this.entries) {
598
+ let i = this.entries[r];
599
+ if (r in n || (i.type === "exact_optional" || i.type === "optional" || i.type === "nullish") && i.default !== void 0) {
600
+ let a = r in n ? n[r] : /* @__PURE__ */ ze(i), o = i["~run"]({ value: a }, t);
601
+ if (o.issues) {
602
+ let i = {
603
+ type: "object",
604
+ origin: "value",
605
+ input: n,
606
+ key: r,
607
+ value: a
608
+ };
609
+ for (let t of o.issues) t.path ? t.path.unshift(i) : t.path = [i], e.issues?.push(t);
610
+ if (e.issues ||= o.issues, t.abortEarly) {
611
+ e.typed = !1;
612
+ break;
613
+ }
614
+ }
615
+ o.typed || (e.typed = !1), e.value[r] = o.value;
616
+ } else if (i.fallback !== void 0) e.value[r] = /* @__PURE__ */ Re(i);
617
+ else if (i.type !== "exact_optional" && i.type !== "optional" && i.type !== "nullish" && (k(this, "key", e, t, {
618
+ input: void 0,
619
+ expected: `"${r}"`,
620
+ path: [{
621
+ type: "object",
622
+ origin: "key",
623
+ input: n,
624
+ key: r,
625
+ value: n[r]
626
+ }]
627
+ }), t.abortEarly)) break;
628
+ }
629
+ } else k(this, "type", e, t);
630
+ return e;
631
+ }
632
+ });
633
+ }
634
+ /* @__NO_SIDE_EFFECTS__ */
635
+ function L(e, t) {
636
+ return A({
637
+ kind: "schema",
638
+ type: "optional",
639
+ reference: L,
640
+ expects: `(${e.expects} | undefined)`,
641
+ async: !1,
642
+ wrapped: e,
643
+ default: t,
644
+ "~run"(e, t) {
645
+ return e.value === void 0 && (this.default !== void 0 && (e.value = /* @__PURE__ */ ze(this, e, t)), e.value === void 0) ? (e.typed = !0, e) : this.wrapped["~run"](e, t);
646
+ }
647
+ });
648
+ }
649
+ /* @__NO_SIDE_EFFECTS__ */
650
+ function R(e, t) {
651
+ return A({
652
+ kind: "schema",
653
+ type: "picklist",
654
+ reference: R,
655
+ expects: /* @__PURE__ */ Ne(e.map(O), "|"),
656
+ async: !1,
657
+ options: e,
658
+ message: t,
659
+ "~run"(e, t) {
660
+ return this.options.includes(e.value) ? e.typed = !0 : k(this, "type", e, t), e;
661
+ }
662
+ });
663
+ }
664
+ /* @__NO_SIDE_EFFECTS__ */
665
+ function Ve(e, t, n) {
666
+ return A({
667
+ kind: "schema",
668
+ type: "record",
669
+ reference: Ve,
670
+ expects: "Object",
671
+ async: !1,
672
+ key: e,
673
+ value: t,
674
+ message: n,
675
+ "~run"(e, t) {
676
+ let n = e.value;
677
+ if (n && typeof n == "object") {
678
+ e.typed = !0, e.value = {};
679
+ for (let r in n) if (/* @__PURE__ */ Me(n, r)) {
680
+ let i = n[r], a = this.key["~run"]({ value: r }, t);
681
+ if (a.issues) {
682
+ let o = {
683
+ type: "object",
684
+ origin: "key",
685
+ input: n,
686
+ key: r,
687
+ value: i
688
+ };
689
+ for (let t of a.issues) t.path = [o], e.issues?.push(t);
690
+ if (e.issues ||= a.issues, t.abortEarly) {
691
+ e.typed = !1;
692
+ break;
693
+ }
694
+ }
695
+ let o = this.value["~run"]({ value: i }, t);
696
+ if (o.issues) {
697
+ let a = {
698
+ type: "object",
699
+ origin: "value",
700
+ input: n,
701
+ key: r,
702
+ value: i
703
+ };
704
+ for (let t of o.issues) t.path ? t.path.unshift(a) : t.path = [a], e.issues?.push(t);
705
+ if (e.issues ||= o.issues, t.abortEarly) {
706
+ e.typed = !1;
707
+ break;
708
+ }
709
+ }
710
+ a.typed && o.typed || (e.typed = !1), a.typed && (e.value[a.value] = o.value);
711
+ }
712
+ } else k(this, "type", e, t);
713
+ return e;
714
+ }
715
+ });
716
+ }
717
+ /* @__NO_SIDE_EFFECTS__ */
718
+ function z(e) {
719
+ return A({
720
+ kind: "schema",
721
+ type: "string",
722
+ reference: z,
723
+ expects: "string",
724
+ async: !1,
725
+ message: e,
726
+ "~run"(e, t) {
727
+ return typeof e.value == "string" ? e.typed = !0 : k(this, "type", e, t), e;
728
+ }
729
+ });
730
+ }
731
+ /* @__NO_SIDE_EFFECTS__ */
732
+ function B(e, t) {
733
+ return A({
734
+ kind: "schema",
735
+ type: "tuple",
736
+ reference: B,
737
+ expects: "Array",
738
+ async: !1,
739
+ items: e,
740
+ message: t,
741
+ "~run"(e, t) {
742
+ let n = e.value;
743
+ if (Array.isArray(n)) {
744
+ e.typed = !0, e.value = [];
745
+ for (let r = 0; r < this.items.length; r++) {
746
+ let i = n[r], a = this.items[r]["~run"]({ value: i }, t);
747
+ if (a.issues) {
748
+ let o = {
749
+ type: "array",
750
+ origin: "value",
751
+ input: n,
752
+ key: r,
753
+ value: i
754
+ };
755
+ for (let t of a.issues) t.path ? t.path.unshift(o) : t.path = [o], e.issues?.push(t);
756
+ if (e.issues ||= a.issues, t.abortEarly) {
757
+ e.typed = !1;
758
+ break;
759
+ }
760
+ }
761
+ a.typed || (e.typed = !1), e.value.push(a.value);
762
+ }
763
+ } else k(this, "type", e, t);
764
+ return e;
765
+ }
766
+ });
767
+ }
768
+ /* @__NO_SIDE_EFFECTS__ */
769
+ function He(e) {
770
+ let t;
771
+ if (e) for (let n of e) if (t) for (let e of n.issues) t.push(e);
772
+ else t = n.issues;
773
+ return t;
774
+ }
775
+ /* @__NO_SIDE_EFFECTS__ */
776
+ function Ue(e, t) {
777
+ return A({
778
+ kind: "schema",
779
+ type: "union",
780
+ reference: Ue,
781
+ expects: /* @__PURE__ */ Ne(e.map((e) => e.expects), "|"),
782
+ async: !1,
783
+ options: e,
784
+ message: t,
785
+ "~run"(e, t) {
786
+ let n, r, i;
787
+ for (let a of this.options) {
788
+ let o = a["~run"]({ value: e.value }, t);
789
+ if (o.typed) {
790
+ if (o.issues) r ? r.push(o) : r = [o];
791
+ else {
792
+ n = o;
793
+ break;
794
+ }
795
+ } else i ? i.push(o) : i = [o];
796
+ }
797
+ if (n) return n;
798
+ if (r) {
799
+ if (r.length === 1) return r[0];
800
+ k(this, "type", e, t, { issues: /* @__PURE__ */ He(r) }), e.typed = !0;
801
+ } else if (i?.length === 1) return i[0];
802
+ else k(this, "type", e, t, { issues: /* @__PURE__ */ He(i) });
803
+ return e;
804
+ }
805
+ });
806
+ }
807
+ /* @__NO_SIDE_EFFECTS__ */
808
+ function We() {
809
+ return A({
810
+ kind: "schema",
811
+ type: "unknown",
812
+ reference: We,
813
+ expects: "unknown",
814
+ async: !1,
815
+ "~run"(e) {
816
+ return e.typed = !0, e;
817
+ }
818
+ });
819
+ }
820
+ /* @__NO_SIDE_EFFECTS__ */
821
+ function Ge(e, t, n) {
822
+ return A({
823
+ kind: "schema",
824
+ type: "variant",
825
+ reference: Ge,
826
+ expects: "Object",
827
+ async: !1,
828
+ key: e,
829
+ options: t,
830
+ message: n,
831
+ "~run"(e, t) {
832
+ let n = e.value;
833
+ if (n && typeof n == "object") {
834
+ let r, i = 0, a = this.key, o = [], s = (e, c) => {
835
+ for (let l of e.options) {
836
+ if (l.type === "variant") s(l, new Set(c).add(l.key));
837
+ else {
838
+ let e = !0, s = 0;
839
+ for (let t of c) {
840
+ let r = l.entries[t];
841
+ if (t in n ? r["~run"]({
842
+ typed: !1,
843
+ value: n[t]
844
+ }, Le).issues : r.type !== "exact_optional" && r.type !== "optional" && r.type !== "nullish") {
845
+ e = !1, a !== t && (i < s || i === s && t in n && !(a in n)) && (i = s, a = t, o = []), a === t && o.push(l.entries[t].expects);
846
+ break;
847
+ }
848
+ s++;
849
+ }
850
+ if (e) {
851
+ let e = l["~run"]({ value: n }, t);
852
+ (!r || !r.typed && e.typed) && (r = e);
853
+ }
854
+ }
855
+ if (r && !r.issues) break;
856
+ }
857
+ };
858
+ if (s(this, /* @__PURE__ */ new Set([this.key])), r) return r;
859
+ k(this, "type", e, t, {
860
+ input: n[a],
861
+ expected: /* @__PURE__ */ Ne(o, "|"),
862
+ path: [{
863
+ type: "object",
864
+ origin: "value",
865
+ input: n,
866
+ key: a,
867
+ value: n[a]
868
+ }]
869
+ });
870
+ } else k(this, "type", e, t);
871
+ return e;
872
+ }
873
+ });
874
+ }
875
+ function V(e, t, n) {
876
+ let r = e["~run"]({ value: t }, /* @__PURE__ */ Ae(n));
877
+ if (r.issues) throw new Pe(r.issues);
878
+ return r.value;
879
+ }
880
+ /* @__NO_SIDE_EFFECTS__ */
881
+ function Ke(...e) {
882
+ return A({
883
+ ...e[0],
884
+ pipe: e,
885
+ "~run"(t, n) {
886
+ for (let r of e) if (r.kind !== "metadata") {
887
+ if (t.issues && (r.kind === "schema" || r.kind === "transformation")) {
888
+ t.typed = !1;
889
+ break;
890
+ }
891
+ t.issues && (n.abortEarly || n.abortPipeEarly) || (t = r["~run"](t, n));
892
+ }
893
+ return t;
894
+ }
895
+ });
896
+ }
897
+ // ../core/src/schema.ts
898
+ var qe = /* @__PURE__ */ B([/* @__PURE__ */ F(), /* @__PURE__ */ F()]), H = /* @__PURE__ */ B([
899
+ /* @__PURE__ */ F(),
900
+ /* @__PURE__ */ F(),
901
+ /* @__PURE__ */ F()
902
+ ]), Je = /* @__PURE__ */ Ke(/* @__PURE__ */ F(), /* @__PURE__ */ Ie(0), /* @__PURE__ */ Fe(1)), Ye = /* @__PURE__ */ I({
903
+ label: /* @__PURE__ */ z(),
904
+ frame: /* @__PURE__ */ z(),
905
+ back: /* @__PURE__ */ z(),
906
+ frameRoughness: Je,
907
+ backMaterial: /* @__PURE__ */ L(/* @__PURE__ */ R([
908
+ "glass",
909
+ "metal",
910
+ "ceramic"
911
+ ])),
912
+ accent: /* @__PURE__ */ L(/* @__PURE__ */ z())
913
+ }), Xe = /* @__PURE__ */ Ge("source", [
914
+ /* @__PURE__ */ I({
915
+ kind: /* @__PURE__ */ R(["image", "video"]),
916
+ source: /* @__PURE__ */ N("idb"),
917
+ id: /* @__PURE__ */ z(),
918
+ hash: /* @__PURE__ */ z(),
919
+ mime: /* @__PURE__ */ z(),
920
+ width: /* @__PURE__ */ F(),
921
+ height: /* @__PURE__ */ F(),
922
+ duration: /* @__PURE__ */ L(/* @__PURE__ */ F())
923
+ }),
924
+ /* @__PURE__ */ I({
925
+ kind: /* @__PURE__ */ R(["image", "video"]),
926
+ source: /* @__PURE__ */ N("url"),
927
+ url: /* @__PURE__ */ z(),
928
+ width: /* @__PURE__ */ L(/* @__PURE__ */ F()),
929
+ height: /* @__PURE__ */ L(/* @__PURE__ */ F()),
930
+ duration: /* @__PURE__ */ L(/* @__PURE__ */ F())
931
+ }),
932
+ /* @__PURE__ */ I({
933
+ kind: /* @__PURE__ */ N("image"),
934
+ source: /* @__PURE__ */ N("data"),
935
+ dataUrl: /* @__PURE__ */ z(),
936
+ width: /* @__PURE__ */ F(),
937
+ height: /* @__PURE__ */ F()
938
+ })
939
+ ]), Ze = /* @__PURE__ */ P({
940
+ id: /* @__PURE__ */ z(),
941
+ type: /* @__PURE__ */ R([
942
+ "phone",
943
+ "tablet",
944
+ "laptop",
945
+ "monitor",
946
+ "watch"
947
+ ]),
948
+ spec: /* @__PURE__ */ z(),
949
+ finish: /* @__PURE__ */ Ue([/* @__PURE__ */ z(), Ye]),
950
+ params: /* @__PURE__ */ L(/* @__PURE__ */ Ve(/* @__PURE__ */ z(), /* @__PURE__ */ F()), () => ({})),
951
+ transform: /* @__PURE__ */ L(/* @__PURE__ */ I({
952
+ position: /* @__PURE__ */ L(H, () => [
953
+ 0,
954
+ 0,
955
+ 0
956
+ ]),
957
+ rotation: /* @__PURE__ */ L(H, () => [
958
+ 0,
959
+ 0,
960
+ 0
961
+ ]),
962
+ scale: /* @__PURE__ */ L(/* @__PURE__ */ F(), 1)
963
+ }), () => ({
964
+ position: [
965
+ 0,
966
+ 0,
967
+ 0
968
+ ],
969
+ rotation: [
970
+ 0,
971
+ 0,
972
+ 0
973
+ ],
974
+ scale: 1
975
+ })),
976
+ screenFinish: /* @__PURE__ */ L(/* @__PURE__ */ R([
977
+ "clean",
978
+ "glossy",
979
+ "matte"
980
+ ]), "matte"),
981
+ glare: /* @__PURE__ */ L(Je, 1),
982
+ screens: /* @__PURE__ */ L(/* @__PURE__ */ j(/* @__PURE__ */ z()), () => [])
983
+ }), Qe = /* @__PURE__ */ P({
984
+ id: /* @__PURE__ */ z(),
985
+ media: /* @__PURE__ */ L(/* @__PURE__ */ Be(Xe), null),
986
+ fit: /* @__PURE__ */ L(/* @__PURE__ */ R([
987
+ "cover",
988
+ "contain",
989
+ "stretch"
990
+ ]), "cover"),
991
+ offset: /* @__PURE__ */ L(qe),
992
+ video: /* @__PURE__ */ L(/* @__PURE__ */ I({
993
+ start: /* @__PURE__ */ L(/* @__PURE__ */ F(), 0),
994
+ loop: /* @__PURE__ */ L(/* @__PURE__ */ M(), !0),
995
+ muted: /* @__PURE__ */ L(/* @__PURE__ */ N(!0), !0),
996
+ playbackRate: /* @__PURE__ */ L(/* @__PURE__ */ F(), 1)
997
+ })),
998
+ poster: /* @__PURE__ */ L(/* @__PURE__ */ z())
999
+ }), $e = /* @__PURE__ */ I({
1000
+ fisheye: /* @__PURE__ */ L(/* @__PURE__ */ F(), 0),
1001
+ chromatic: /* @__PURE__ */ L(/* @__PURE__ */ F(), 0),
1002
+ vignette: /* @__PURE__ */ L(/* @__PURE__ */ F(), 0),
1003
+ bloom: /* @__PURE__ */ L(/* @__PURE__ */ F(), 0),
1004
+ grain: /* @__PURE__ */ L(/* @__PURE__ */ F(), 0),
1005
+ blur: /* @__PURE__ */ L(/* @__PURE__ */ F(), 0),
1006
+ focus: /* @__PURE__ */ L(/* @__PURE__ */ F(), 0),
1007
+ fade: /* @__PURE__ */ L(/* @__PURE__ */ F(), 0)
1008
+ }), et = /* @__PURE__ */ P({
1009
+ position: /* @__PURE__ */ L(H, () => [
1010
+ 0,
1011
+ 1.5,
1012
+ 48
1013
+ ]),
1014
+ target: /* @__PURE__ */ L(H, () => [
1015
+ 0,
1016
+ 0,
1017
+ 0
1018
+ ]),
1019
+ fov: /* @__PURE__ */ L(/* @__PURE__ */ F(), 28),
1020
+ roll: /* @__PURE__ */ L(/* @__PURE__ */ F(), 0),
1021
+ lens: /* @__PURE__ */ L($e, () => V($e, {}))
1022
+ }), tt = /* @__PURE__ */ P({
1023
+ preset: /* @__PURE__ */ L(/* @__PURE__ */ R([
1024
+ "studio",
1025
+ "soft",
1026
+ "contrast",
1027
+ "night"
1028
+ ]), "studio"),
1029
+ intensity: /* @__PURE__ */ L(/* @__PURE__ */ F(), 1),
1030
+ rotation: /* @__PURE__ */ L(/* @__PURE__ */ F(), 0),
1031
+ glow: /* @__PURE__ */ L(/* @__PURE__ */ F(), 0)
1032
+ }), nt = /* @__PURE__ */ P({
1033
+ kind: /* @__PURE__ */ L(/* @__PURE__ */ R([
1034
+ "none",
1035
+ "crevice",
1036
+ "block"
1037
+ ]), "none"),
1038
+ seed: /* @__PURE__ */ L(/* @__PURE__ */ F(), 1),
1039
+ color: /* @__PURE__ */ L(/* @__PURE__ */ z(), "#3a3b40")
1040
+ }), rt = /* @__PURE__ */ P({
1041
+ kind: /* @__PURE__ */ L(/* @__PURE__ */ R([
1042
+ "transparent",
1043
+ "solid",
1044
+ "gradient",
1045
+ "image"
1046
+ ]), "gradient"),
1047
+ color: /* @__PURE__ */ L(/* @__PURE__ */ z()),
1048
+ inner: /* @__PURE__ */ L(/* @__PURE__ */ z()),
1049
+ outer: /* @__PURE__ */ L(/* @__PURE__ */ z()),
1050
+ angle: /* @__PURE__ */ L(/* @__PURE__ */ F()),
1051
+ image: /* @__PURE__ */ L(Xe),
1052
+ tone: /* @__PURE__ */ L(/* @__PURE__ */ R(["light", "dark"]), "light")
1053
+ }), it = /* @__PURE__ */ P({
1054
+ mode: /* @__PURE__ */ L(/* @__PURE__ */ R(["auto", "fixed"]), "auto"),
1055
+ y: /* @__PURE__ */ L(/* @__PURE__ */ F()),
1056
+ shadow: /* @__PURE__ */ L(Je, .22)
1057
+ }), at = /* @__PURE__ */ P({
1058
+ duration: /* @__PURE__ */ L(/* @__PURE__ */ Ke(/* @__PURE__ */ F(), /* @__PURE__ */ Ie(.1)), 4),
1059
+ fps: /* @__PURE__ */ L(/* @__PURE__ */ F(), 30),
1060
+ tracks: /* @__PURE__ */ L(/* @__PURE__ */ j(/* @__PURE__ */ P({
1061
+ id: /* @__PURE__ */ z(),
1062
+ target: /* @__PURE__ */ z(),
1063
+ type: /* @__PURE__ */ R([
1064
+ "number",
1065
+ "vec3",
1066
+ "color"
1067
+ ]),
1068
+ keys: /* @__PURE__ */ L(/* @__PURE__ */ j(/* @__PURE__ */ I({
1069
+ id: /* @__PURE__ */ L(/* @__PURE__ */ z()),
1070
+ t: /* @__PURE__ */ F(),
1071
+ value: /* @__PURE__ */ Ue([
1072
+ /* @__PURE__ */ F(),
1073
+ H,
1074
+ /* @__PURE__ */ z()
1075
+ ]),
1076
+ easing: /* @__PURE__ */ L(/* @__PURE__ */ Ue([/* @__PURE__ */ R([
1077
+ "linear",
1078
+ "easeInQuad",
1079
+ "easeOutQuad",
1080
+ "easeInOutQuad",
1081
+ "easeInOutCubic",
1082
+ "easeOutExpo",
1083
+ "easeOutBack",
1084
+ "easeInOutSine"
1085
+ ]), /* @__PURE__ */ I({ bezier: /* @__PURE__ */ B([
1086
+ /* @__PURE__ */ F(),
1087
+ /* @__PURE__ */ F(),
1088
+ /* @__PURE__ */ F(),
1089
+ /* @__PURE__ */ F()
1090
+ ]) })]), "easeInOutCubic"),
1091
+ interpolation: /* @__PURE__ */ L(/* @__PURE__ */ R(["smooth", "hold"]))
1092
+ })), () => [])
1093
+ })), () => []),
1094
+ markers: /* @__PURE__ */ L(/* @__PURE__ */ j(/* @__PURE__ */ I({
1095
+ t: /* @__PURE__ */ F(),
1096
+ label: /* @__PURE__ */ z()
1097
+ })))
1098
+ }), ot = /* @__PURE__ */ P({
1099
+ trigger: /* @__PURE__ */ L(/* @__PURE__ */ R([
1100
+ "none",
1101
+ "load",
1102
+ "click",
1103
+ "hover",
1104
+ "scroll",
1105
+ "in-view",
1106
+ "cursor-move"
1107
+ ]), "load"),
1108
+ loop: /* @__PURE__ */ L(/* @__PURE__ */ R([
1109
+ "none",
1110
+ "loop",
1111
+ "pingpong"
1112
+ ]), "loop"),
1113
+ delay: /* @__PURE__ */ L(/* @__PURE__ */ F(), 0),
1114
+ speed: /* @__PURE__ */ L(/* @__PURE__ */ F(), 1),
1115
+ scroll: /* @__PURE__ */ L(/* @__PURE__ */ I({
1116
+ start: /* @__PURE__ */ L(/* @__PURE__ */ R(["enter", "top"]), "enter"),
1117
+ end: /* @__PURE__ */ L(/* @__PURE__ */ R(["leave", "bottom"]), "leave"),
1118
+ smoothing: /* @__PURE__ */ L(/* @__PURE__ */ F(), 6)
1119
+ })),
1120
+ hover: /* @__PURE__ */ L(/* @__PURE__ */ I({ reverseOnLeave: /* @__PURE__ */ L(/* @__PURE__ */ M(), !0) })),
1121
+ cursor: /* @__PURE__ */ L(/* @__PURE__ */ I({
1122
+ mode: /* @__PURE__ */ L(/* @__PURE__ */ R(["device", "camera"]), "device"),
1123
+ follow: /* @__PURE__ */ L(/* @__PURE__ */ F(), 0),
1124
+ zoom: /* @__PURE__ */ L(/* @__PURE__ */ F(), 0),
1125
+ dolly: /* @__PURE__ */ L(/* @__PURE__ */ F(), 0),
1126
+ shake: /* @__PURE__ */ L(/* @__PURE__ */ F(), 0),
1127
+ smoothing: /* @__PURE__ */ L(/* @__PURE__ */ F(), 5)
1128
+ }), () => ({
1129
+ mode: "device",
1130
+ follow: 0,
1131
+ zoom: 0,
1132
+ dolly: 0,
1133
+ shake: 0,
1134
+ smoothing: 5
1135
+ })),
1136
+ idle: /* @__PURE__ */ L(/* @__PURE__ */ I({ float: /* @__PURE__ */ L(/* @__PURE__ */ F(), 1) }), () => ({ float: 1 }))
1137
+ }), st = /* @__PURE__ */ P({
1138
+ width: /* @__PURE__ */ L(/* @__PURE__ */ F(), 1920),
1139
+ height: /* @__PURE__ */ L(/* @__PURE__ */ F(), 1080),
1140
+ fps: /* @__PURE__ */ L(/* @__PURE__ */ R([
1141
+ 24,
1142
+ 30,
1143
+ 60
1144
+ ]), 30),
1145
+ range: /* @__PURE__ */ L(/* @__PURE__ */ B([/* @__PURE__ */ F(), /* @__PURE__ */ F()]), () => [0, 4]),
1146
+ format: /* @__PURE__ */ L(/* @__PURE__ */ R([
1147
+ "png",
1148
+ "mp4",
1149
+ "webm",
1150
+ "webm-alpha",
1151
+ "png-sequence"
1152
+ ]), "mp4"),
1153
+ codec: /* @__PURE__ */ L(/* @__PURE__ */ R([
1154
+ "auto",
1155
+ "avc",
1156
+ "hevc",
1157
+ "vp9",
1158
+ "av1"
1159
+ ]), "auto"),
1160
+ quality: /* @__PURE__ */ L(/* @__PURE__ */ R([
1161
+ "draft",
1162
+ "standard",
1163
+ "high"
1164
+ ]), "standard"),
1165
+ transparent: /* @__PURE__ */ L(/* @__PURE__ */ M(), !1),
1166
+ includeIdleMotion: /* @__PURE__ */ L(/* @__PURE__ */ M(), !0)
1167
+ }), ct = /* @__PURE__ */ P({
1168
+ devices: /* @__PURE__ */ L(/* @__PURE__ */ j(Ze), () => []),
1169
+ screens: /* @__PURE__ */ L(/* @__PURE__ */ j(Qe), () => []),
1170
+ camera: /* @__PURE__ */ L(et, () => V(et, {})),
1171
+ environment: /* @__PURE__ */ L(tt, () => V(tt, {})),
1172
+ backdrop: /* @__PURE__ */ L(rt, () => V(rt, {})),
1173
+ floor: /* @__PURE__ */ L(it, () => V(it, {})),
1174
+ set: /* @__PURE__ */ L(nt, () => V(nt, {}))
1175
+ }), lt = /* @__PURE__ */ P({
1176
+ schemaVersion: /* @__PURE__ */ L(/* @__PURE__ */ N(1), 1),
1177
+ id: /* @__PURE__ */ L(/* @__PURE__ */ z(), () => te()),
1178
+ name: /* @__PURE__ */ L(/* @__PURE__ */ z(), "Untitled"),
1179
+ createdAt: /* @__PURE__ */ L(/* @__PURE__ */ z(), () => (/* @__PURE__ */ new Date()).toISOString()),
1180
+ updatedAt: /* @__PURE__ */ L(/* @__PURE__ */ z(), () => (/* @__PURE__ */ new Date()).toISOString()),
1181
+ scene: /* @__PURE__ */ L(ct, () => V(ct, {})),
1182
+ timeline: /* @__PURE__ */ L(at, () => V(at, {})),
1183
+ interaction: /* @__PURE__ */ L(ot, () => V(ot, {})),
1184
+ export: /* @__PURE__ */ L(st, () => V(st, {})),
1185
+ meta: /* @__PURE__ */ L(/* @__PURE__ */ Ve(/* @__PURE__ */ z(), /* @__PURE__ */ We()))
1186
+ });
1187
+ function ut(e) {
1188
+ return V(lt, e);
1189
+ }
1190
+ // ../core/src/project.ts
1191
+ var dt = {
1192
+ screenFinish: "glossy",
1193
+ glare: .5
1194
+ }, ft = [
1195
+ 3.4,
1196
+ -24.1,
1197
+ 2.3
1198
+ ];
1199
+ function pt({ name: e = "Untitled", device: t } = {}) {
1200
+ let n = [], r = [];
1201
+ if (t) {
1202
+ let e = te("scr");
1203
+ r.push({ id: e }), n.push({
1204
+ id: te("dev"),
1205
+ type: t.type,
1206
+ spec: t.spec,
1207
+ finish: t.finish,
1208
+ transform: {
1209
+ position: [
1210
+ 0,
1211
+ 0,
1212
+ 0
1213
+ ],
1214
+ rotation: [...ft],
1215
+ scale: 1
1216
+ },
1217
+ ...dt,
1218
+ screens: [e]
1219
+ });
1220
+ }
1221
+ return ut({
1222
+ name: e,
1223
+ scene: {
1224
+ devices: n,
1225
+ screens: r
1226
+ }
1227
+ });
1228
+ }
1229
+ // ../core/src/presets-bundled.ts
1230
+ var U = (e, t, n = "easeInOutCubic") => ({
1231
+ t: e,
1232
+ value: t,
1233
+ easing: n
1234
+ }), W = { bezier: [
1235
+ .4,
1236
+ 0,
1237
+ .2,
1238
+ 1
1239
+ ] }, mt = [
1240
+ {
1241
+ id: "preset.turn",
1242
+ name: "Turn",
1243
+ tags: [
1244
+ "phone",
1245
+ "tablet",
1246
+ "watch"
1247
+ ],
1248
+ duration: 4,
1249
+ rotation: [
1250
+ U(0, [
1251
+ 3.4,
1252
+ -24.1,
1253
+ 2.3
1254
+ ]),
1255
+ U(2, [
1256
+ -8,
1257
+ 28,
1258
+ -4
1259
+ ]),
1260
+ U(4, [
1261
+ 3.4,
1262
+ -24.1,
1263
+ 2.3
1264
+ ], "linear")
1265
+ ]
1266
+ },
1267
+ {
1268
+ id: "preset.push-in",
1269
+ name: "Camera push-in",
1270
+ tags: [
1271
+ "phone",
1272
+ "tablet",
1273
+ "watch",
1274
+ "laptop",
1275
+ "monitor"
1276
+ ],
1277
+ duration: 4,
1278
+ fov: [
1279
+ U(0, 28, W),
1280
+ U(2.4, 20, W),
1281
+ U(4, 28, "linear")
1282
+ ]
1283
+ },
1284
+ {
1285
+ id: "preset.rise",
1286
+ name: "Rise",
1287
+ tags: [
1288
+ "phone",
1289
+ "tablet",
1290
+ "watch"
1291
+ ],
1292
+ duration: 3,
1293
+ position: [
1294
+ U(0, [
1295
+ 0,
1296
+ -6,
1297
+ 0
1298
+ ], "easeOutExpo"),
1299
+ U(1.4, [
1300
+ 0,
1301
+ 0,
1302
+ 0
1303
+ ], W),
1304
+ U(3, [
1305
+ 0,
1306
+ 0,
1307
+ 0
1308
+ ], "linear")
1309
+ ],
1310
+ rotation: [
1311
+ U(0, [
1312
+ -30,
1313
+ -40,
1314
+ 0
1315
+ ], "easeOutExpo"),
1316
+ U(1.4, ft, W),
1317
+ U(3, ft, "linear")
1318
+ ]
1319
+ },
1320
+ {
1321
+ id: "preset.flip",
1322
+ name: "Spin",
1323
+ tags: [
1324
+ "phone",
1325
+ "tablet",
1326
+ "watch"
1327
+ ],
1328
+ duration: 4,
1329
+ rotation: [
1330
+ U(0, [
1331
+ 0,
1332
+ -20,
1333
+ 0
1334
+ ]),
1335
+ U(2, [
1336
+ 0,
1337
+ 160,
1338
+ 0
1339
+ ]),
1340
+ U(4, [
1341
+ 0,
1342
+ 340,
1343
+ 0
1344
+ ], "linear")
1345
+ ]
1346
+ },
1347
+ {
1348
+ id: "preset.sway",
1349
+ name: "Sway",
1350
+ tags: [
1351
+ "phone",
1352
+ "tablet",
1353
+ "watch"
1354
+ ],
1355
+ duration: 5,
1356
+ rotation: [
1357
+ U(0, [
1358
+ 2,
1359
+ -18,
1360
+ 1
1361
+ ], "easeInOutSine"),
1362
+ U(2.5, [
1363
+ -2,
1364
+ 18,
1365
+ -1
1366
+ ], "easeInOutSine"),
1367
+ U(5, [
1368
+ 2,
1369
+ -18,
1370
+ 1
1371
+ ], "linear")
1372
+ ],
1373
+ position: [
1374
+ U(0, [
1375
+ -.6,
1376
+ 0,
1377
+ 0
1378
+ ], "easeInOutSine"),
1379
+ U(2.5, [
1380
+ .6,
1381
+ 0,
1382
+ 0
1383
+ ], "easeInOutSine"),
1384
+ U(5, [
1385
+ -.6,
1386
+ 0,
1387
+ 0
1388
+ ], "linear")
1389
+ ]
1390
+ },
1391
+ {
1392
+ id: "preset.zoom-out",
1393
+ name: "Reveal",
1394
+ tags: [
1395
+ "phone",
1396
+ "tablet",
1397
+ "watch",
1398
+ "laptop",
1399
+ "monitor"
1400
+ ],
1401
+ duration: 3,
1402
+ scale: [
1403
+ U(0, 1.35, "easeOutExpo"),
1404
+ U(1.6, 1, W),
1405
+ U(3, 1, "linear")
1406
+ ],
1407
+ fov: [
1408
+ U(0, 22, "easeOutExpo"),
1409
+ U(1.6, 28, W),
1410
+ U(3, 28, "linear")
1411
+ ]
1412
+ },
1413
+ {
1414
+ id: "preset.lid-open",
1415
+ name: "Lid opens",
1416
+ tags: ["laptop"],
1417
+ duration: 3.5,
1418
+ position: [U(0, [
1419
+ 0,
1420
+ 0,
1421
+ 0
1422
+ ])]
1423
+ },
1424
+ {
1425
+ id: "preset.orbit",
1426
+ name: "Swing",
1427
+ tags: ["laptop", "monitor"],
1428
+ duration: 5,
1429
+ rotation: [
1430
+ U(0, [
1431
+ 0,
1432
+ -28,
1433
+ 0
1434
+ ], "easeInOutSine"),
1435
+ U(2.5, [
1436
+ 0,
1437
+ 28,
1438
+ 0
1439
+ ], "easeInOutSine"),
1440
+ U(5, [
1441
+ 0,
1442
+ -28,
1443
+ 0
1444
+ ], "linear")
1445
+ ]
1446
+ }
1447
+ ];
1448
+ function ht(e) {
1449
+ let t = [];
1450
+ return e.rotation && t.push({
1451
+ id: `${e.id}.rotation`,
1452
+ target: "devices.$0.rotation",
1453
+ type: "vec3",
1454
+ keys: e.rotation
1455
+ }), e.position && t.push({
1456
+ id: `${e.id}.position`,
1457
+ target: "devices.$0.position",
1458
+ type: "vec3",
1459
+ keys: e.position
1460
+ }), e.scale && t.push({
1461
+ id: `${e.id}.scale`,
1462
+ target: "devices.$0.scale",
1463
+ type: "number",
1464
+ keys: e.scale
1465
+ }), e.fov && t.push({
1466
+ id: `${e.id}.fov`,
1467
+ target: "camera.fov",
1468
+ type: "number",
1469
+ keys: e.fov
1470
+ }), e.id === "preset.lid-open" && t.push({
1471
+ id: `${e.id}.lid`,
1472
+ target: "devices.$0.params.lidAngle",
1473
+ type: "number",
1474
+ keys: [
1475
+ U(0, 2, "easeInOutCubic"),
1476
+ U(2.2, 110, W),
1477
+ U(3.5, 110, "linear")
1478
+ ]
1479
+ }), {
1480
+ id: e.id,
1481
+ name: e.name,
1482
+ tags: e.tags,
1483
+ slots: 1,
1484
+ timeline: {
1485
+ duration: e.duration,
1486
+ fps: 30,
1487
+ tracks: t
1488
+ }
1489
+ };
1490
+ }
1491
+ var gt = mt.map(ht), _t = {
1492
+ x: 0,
1493
+ y: 0,
1494
+ speed: 0
1495
+ };
1496
+ function G(e, t) {
1497
+ return Math.sin(e * 13.1 + t) * .5 + Math.sin(e * 7.3 + t * 1.7) * .3 + Math.sin(e * 23.7 + t * .4) * .2;
1498
+ }
1499
+ function vt(e, t, n, r, i) {
1500
+ let a = /* @__PURE__ */ new Map(), { follow: o, zoom: s, dolly: c, shake: l, mode: u } = t;
1501
+ if (o <= 0 && s <= 0 && c <= 0 && l <= 0) return a;
1502
+ let d = St(K(i.target, i.position)), f = St(Ct(d, [
1503
+ 0,
1504
+ 1,
1505
+ 0
1506
+ ])), p = Ct(f, d), m = [
1507
+ 0,
1508
+ 0,
1509
+ 0
1510
+ ], h = 0;
1511
+ if (o > 0) {
1512
+ if (u === "device") for (let t of r) a.set(`devices.${t}.rotation`, {
1513
+ value: [
1514
+ -e.y * o * 10,
1515
+ e.x * o * 16,
1516
+ 0
1517
+ ],
1518
+ add: !0
1519
+ });
1520
+ else {
1521
+ let t = xt(K(i.target, i.position)) * .12 * o;
1522
+ wt(m, q(f, e.x * t)), wt(m, q(p, e.y * t * .6));
1523
+ }
1524
+ }
1525
+ if (s > 0) {
1526
+ let t = 1 - Math.min(1, Math.hypot(e.x, e.y));
1527
+ h -= s * 10 * t;
1528
+ }
1529
+ if (c > 0) {
1530
+ let t = xt(K(i.target, i.position));
1531
+ wt(m, q(d, e.y * c * t * .15));
1532
+ }
1533
+ if (l > 0) {
1534
+ let t = l * Math.min(1, e.speed);
1535
+ for (let e of r) {
1536
+ let r = a.get(`devices.${e}.rotation`)?.value, i = [
1537
+ G(n, 1) * 2 * t,
1538
+ G(n, 2) * 2 * t,
1539
+ G(n, 3) * 1 * t
1540
+ ];
1541
+ a.set(`devices.${e}.rotation`, {
1542
+ value: r ? bt(r, i) : i,
1543
+ add: !0
1544
+ });
1545
+ }
1546
+ wt(m, [
1547
+ G(n, 4) * .2 * t,
1548
+ G(n, 5) * .2 * t,
1549
+ 0
1550
+ ]);
1551
+ }
1552
+ return (m[0] || m[1] || m[2]) && a.set("camera.position", {
1553
+ value: m,
1554
+ add: !0
1555
+ }), h && a.set("camera.fov", {
1556
+ value: h,
1557
+ add: !0
1558
+ }), a;
1559
+ }
1560
+ function yt(e, t) {
1561
+ let n = /* @__PURE__ */ new Map();
1562
+ if (!e) return n;
1563
+ let r = K(t.target, t.position);
1564
+ return n.set("camera.position", {
1565
+ value: q(r, 1 - 2 ** (-e / 100)),
1566
+ add: !0
1567
+ }), n;
1568
+ }
1569
+ var K = (e, t) => [
1570
+ e[0] - t[0],
1571
+ e[1] - t[1],
1572
+ e[2] - t[2]
1573
+ ], bt = (e, t) => [
1574
+ e[0] + t[0],
1575
+ e[1] + t[1],
1576
+ e[2] + t[2]
1577
+ ], q = (e, t) => [
1578
+ e[0] * t,
1579
+ e[1] * t,
1580
+ e[2] * t
1581
+ ], xt = (e) => Math.hypot(e[0], e[1], e[2]), St = (e) => {
1582
+ let t = xt(e) || 1;
1583
+ return [
1584
+ e[0] / t,
1585
+ e[1] / t,
1586
+ e[2] / t
1587
+ ];
1588
+ }, Ct = (e, t) => [
1589
+ e[1] * t[2] - e[2] * t[1],
1590
+ e[2] * t[0] - e[0] * t[2],
1591
+ e[0] * t[1] - e[1] * t[0]
1592
+ ];
1593
+ function wt(e, t) {
1594
+ e[0] += t[0], e[1] += t[1], e[2] += t[2];
1595
+ }
1596
+ function Tt(e, t, n, r) {
1597
+ let i = 1 - Math.exp(-n * r);
1598
+ return {
1599
+ x: e.x + (t.x - e.x) * i,
1600
+ y: e.y + (t.y - e.y) * i,
1601
+ speed: e.speed + (t.speed - e.speed) * Math.min(1, i * 2)
1602
+ };
1603
+ }
1604
+ // ../core/src/templates.ts
1605
+ var J = (e, t, n = "easeInOutCubic") => ({
1606
+ t: e,
1607
+ value: t,
1608
+ easing: n
1609
+ }), Et = { bezier: [
1610
+ .45,
1611
+ 0,
1612
+ .85,
1613
+ .6
1614
+ ] }, Y = { bezier: [
1615
+ .15,
1616
+ .4,
1617
+ .3,
1618
+ 1
1619
+ ] }, X = { bezier: [
1620
+ .4,
1621
+ 0,
1622
+ .2,
1623
+ 1
1624
+ ] }, Dt = {
1625
+ duration: 10,
1626
+ tracks: [
1627
+ {
1628
+ id: "crevice.camera.position",
1629
+ target: "camera.position",
1630
+ type: "vec3",
1631
+ keys: [
1632
+ J(0, [
1633
+ -26,
1634
+ 8,
1635
+ 74
1636
+ ], X),
1637
+ J(1.6, [
1638
+ 1,
1639
+ 1.5,
1640
+ 46
1641
+ ], Et),
1642
+ J(2.5, [
1643
+ 5.5,
1644
+ -4.5,
1645
+ 21
1646
+ ], Y),
1647
+ J(5.4, [
1648
+ 3,
1649
+ -2.5,
1650
+ 18.5
1651
+ ], X),
1652
+ J(6.5, [
1653
+ -4.5,
1654
+ 3.5,
1655
+ 24
1656
+ ], "linear"),
1657
+ J(8.3, [
1658
+ -4.5,
1659
+ -3.5,
1660
+ 24
1661
+ ], X),
1662
+ J(9.5, [
1663
+ 0,
1664
+ .5,
1665
+ 46
1666
+ ], "linear"),
1667
+ J(10, [
1668
+ 0,
1669
+ .5,
1670
+ 47
1671
+ ], "linear")
1672
+ ]
1673
+ },
1674
+ {
1675
+ id: "crevice.camera.target",
1676
+ target: "camera.target",
1677
+ type: "vec3",
1678
+ keys: [
1679
+ J(0, [
1680
+ 0,
1681
+ 1.5,
1682
+ 0
1683
+ ], X),
1684
+ J(1.6, [
1685
+ 0,
1686
+ 1,
1687
+ 0
1688
+ ], Et),
1689
+ J(2.5, [
1690
+ 0,
1691
+ 5,
1692
+ 0
1693
+ ], Y),
1694
+ J(5.4, [
1695
+ 0,
1696
+ 4.5,
1697
+ 0
1698
+ ], X),
1699
+ J(6.5, [
1700
+ 0,
1701
+ 2.5,
1702
+ 0
1703
+ ], "linear"),
1704
+ J(8.3, [
1705
+ 0,
1706
+ -3.5,
1707
+ 0
1708
+ ], X),
1709
+ J(9.5, [
1710
+ 0,
1711
+ .5,
1712
+ 0
1713
+ ], "linear"),
1714
+ J(10, [
1715
+ 0,
1716
+ .5,
1717
+ 0
1718
+ ], "linear")
1719
+ ]
1720
+ },
1721
+ {
1722
+ id: "crevice.camera.fov",
1723
+ target: "camera.fov",
1724
+ type: "number",
1725
+ keys: [
1726
+ J(0, 26, X),
1727
+ J(1.6, 28, Et),
1728
+ J(2.5, 36, Y),
1729
+ J(5.4, 35, X),
1730
+ J(6.5, 32, "linear"),
1731
+ J(8.3, 32, X),
1732
+ J(9.5, 28, "linear"),
1733
+ J(10, 28, "linear")
1734
+ ]
1735
+ },
1736
+ {
1737
+ id: "crevice.camera.roll",
1738
+ target: "camera.roll",
1739
+ type: "number",
1740
+ keys: [
1741
+ J(0, 3, X),
1742
+ J(1.6, 0, Et),
1743
+ J(2.5, -7, Y),
1744
+ J(5.4, -5, X),
1745
+ J(6.5, 2, "linear"),
1746
+ J(8.3, 2, X),
1747
+ J(9.5, 0, "linear"),
1748
+ J(10, 0, "linear")
1749
+ ]
1750
+ },
1751
+ {
1752
+ id: "crevice.camera.fade",
1753
+ target: "camera.lens.fade",
1754
+ type: "number",
1755
+ keys: [
1756
+ J(0, 1, "easeOutQuad"),
1757
+ J(.8, 0, "linear"),
1758
+ J(9.6, 0, "easeInQuad"),
1759
+ J(10, 1, "linear")
1760
+ ]
1761
+ }
1762
+ ]
1763
+ }, Ot = { bezier: [
1764
+ .3,
1765
+ 0,
1766
+ .12,
1767
+ 1
1768
+ ] }, kt = {
1769
+ duration: 6,
1770
+ tracks: [
1771
+ {
1772
+ id: "block.camera.position",
1773
+ target: "camera.position",
1774
+ type: "vec3",
1775
+ keys: [
1776
+ J(0, [
1777
+ -11,
1778
+ -.6,
1779
+ 30
1780
+ ], Ot),
1781
+ J(3.2, [
1782
+ -31,
1783
+ -7.3,
1784
+ 62
1785
+ ], "easeInOutSine"),
1786
+ J(6, [
1787
+ -30,
1788
+ -7,
1789
+ 60
1790
+ ], "linear")
1791
+ ]
1792
+ },
1793
+ {
1794
+ id: "block.camera.target",
1795
+ target: "camera.target",
1796
+ type: "vec3",
1797
+ keys: [
1798
+ J(0, [
1799
+ 3,
1800
+ .8,
1801
+ 4
1802
+ ], Ot),
1803
+ J(3.2, [
1804
+ 3,
1805
+ 7.8,
1806
+ 2
1807
+ ], "easeInOutSine"),
1808
+ J(6, [
1809
+ 3,
1810
+ 8,
1811
+ 2
1812
+ ], "linear")
1813
+ ]
1814
+ },
1815
+ {
1816
+ id: "block.lid",
1817
+ target: "devices.$0.params.lidAngle",
1818
+ type: "number",
1819
+ keys: [
1820
+ J(0, 2, "linear"),
1821
+ J(.35, 2, X),
1822
+ J(2.7, 100, "linear"),
1823
+ J(6, 100, "linear")
1824
+ ]
1825
+ }
1826
+ ]
1827
+ }, At = {
1828
+ duration: 7,
1829
+ tracks: [
1830
+ {
1831
+ id: "push.camera.position",
1832
+ target: "camera.position",
1833
+ type: "vec3",
1834
+ keys: [
1835
+ J(0, [
1836
+ -4,
1837
+ 2,
1838
+ 41
1839
+ ], "linear"),
1840
+ J(.4, [
1841
+ -4,
1842
+ 2,
1843
+ 41
1844
+ ], X),
1845
+ J(2.8, [
1846
+ 9.4,
1847
+ -9.6,
1848
+ 13.3
1849
+ ], Y),
1850
+ J(6.4, [
1851
+ 8.8,
1852
+ -9.8,
1853
+ 12.4
1854
+ ], "linear"),
1855
+ J(7, [
1856
+ 8.8,
1857
+ -9.8,
1858
+ 12.4
1859
+ ], "linear")
1860
+ ]
1861
+ },
1862
+ {
1863
+ id: "push.camera.target",
1864
+ target: "camera.target",
1865
+ type: "vec3",
1866
+ keys: [
1867
+ J(0, [
1868
+ 0,
1869
+ 0,
1870
+ 0
1871
+ ], "linear"),
1872
+ J(.4, [
1873
+ 0,
1874
+ 0,
1875
+ 0
1876
+ ], X),
1877
+ J(2.8, [
1878
+ 0,
1879
+ -3,
1880
+ 0
1881
+ ], Y),
1882
+ J(6.4, [
1883
+ 0,
1884
+ -3.4,
1885
+ 0
1886
+ ], "linear"),
1887
+ J(7, [
1888
+ 0,
1889
+ -3.4,
1890
+ 0
1891
+ ], "linear")
1892
+ ]
1893
+ },
1894
+ {
1895
+ id: "push.camera.fov",
1896
+ target: "camera.fov",
1897
+ type: "number",
1898
+ keys: [
1899
+ J(0, 28, "linear"),
1900
+ J(.4, 28, X),
1901
+ J(2.8, 34, Y),
1902
+ J(7, 34, "linear")
1903
+ ]
1904
+ },
1905
+ {
1906
+ id: "push.camera.roll",
1907
+ target: "camera.roll",
1908
+ type: "number",
1909
+ keys: [
1910
+ J(0, 0, "linear"),
1911
+ J(.4, 0, X),
1912
+ J(2.8, -9, Y),
1913
+ J(6.4, -10, "linear"),
1914
+ J(7, -10, "linear")
1915
+ ]
1916
+ },
1917
+ {
1918
+ id: "push.camera.fade",
1919
+ target: "camera.lens.fade",
1920
+ type: "number",
1921
+ keys: [
1922
+ J(0, 0, "linear"),
1923
+ J(6.4, 0, "easeInQuad"),
1924
+ J(6.95, 1, "linear"),
1925
+ J(7, 1, "linear")
1926
+ ]
1927
+ }
1928
+ ]
1929
+ }, jt = {
1930
+ duration: 10,
1931
+ tracks: [
1932
+ {
1933
+ id: "sweep.camera.position",
1934
+ target: "camera.position",
1935
+ type: "vec3",
1936
+ keys: [
1937
+ J(0, [
1938
+ 4.5,
1939
+ .5,
1940
+ 11
1941
+ ], "linear"),
1942
+ J(.6, [
1943
+ 4.5,
1944
+ .5,
1945
+ 11
1946
+ ], X),
1947
+ J(4, [
1948
+ 3,
1949
+ 1.5,
1950
+ 10.5
1951
+ ], X),
1952
+ J(5.4, [
1953
+ -1.5,
1954
+ -7.5,
1955
+ 12.5
1956
+ ], Y),
1957
+ J(7.4, [
1958
+ -2,
1959
+ -8,
1960
+ 12
1961
+ ], "linear"),
1962
+ J(10, [
1963
+ -2,
1964
+ -8,
1965
+ 12
1966
+ ], "linear")
1967
+ ]
1968
+ },
1969
+ {
1970
+ id: "sweep.camera.target",
1971
+ target: "camera.target",
1972
+ type: "vec3",
1973
+ keys: [
1974
+ J(0, [
1975
+ 0,
1976
+ 5.2,
1977
+ 0
1978
+ ], "linear"),
1979
+ J(.6, [
1980
+ 0,
1981
+ 5.2,
1982
+ 0
1983
+ ], X),
1984
+ J(4, [
1985
+ .3,
1986
+ 4.6,
1987
+ 0
1988
+ ], X),
1989
+ J(5.4, [
1990
+ 0,
1991
+ -3.8,
1992
+ 0
1993
+ ], Y),
1994
+ J(7.4, [
1995
+ 0,
1996
+ -4.2,
1997
+ 0
1998
+ ], "linear"),
1999
+ J(10, [
2000
+ 0,
2001
+ -4.2,
2002
+ 0
2003
+ ], "linear")
2004
+ ]
2005
+ },
2006
+ {
2007
+ id: "sweep.camera.fov",
2008
+ target: "camera.fov",
2009
+ type: "number",
2010
+ keys: [J(0, 36, "linear"), J(10, 36, "linear")]
2011
+ },
2012
+ {
2013
+ id: "sweep.camera.roll",
2014
+ target: "camera.roll",
2015
+ type: "number",
2016
+ keys: [
2017
+ J(0, 14, "linear"),
2018
+ J(.6, 14, X),
2019
+ J(4, 10, X),
2020
+ J(5.4, -6, Y),
2021
+ J(7.4, -8, "linear"),
2022
+ J(10, -8, "linear")
2023
+ ]
2024
+ },
2025
+ {
2026
+ id: "sweep.camera.fade",
2027
+ target: "camera.lens.fade",
2028
+ type: "number",
2029
+ keys: [
2030
+ J(0, 1, "easeOutQuad"),
2031
+ J(.9, 0, "linear"),
2032
+ J(7.4, 0, "easeInQuad"),
2033
+ J(8.2, 1, "linear"),
2034
+ J(10, 1, "linear")
2035
+ ]
2036
+ }
2037
+ ]
2038
+ }, Mt = {
2039
+ "16:9": [1920, 1080],
2040
+ "9:16": [1080, 1920],
2041
+ "1:1": [1080, 1080],
2042
+ "4:3": [1440, 1080]
2043
+ }, Nt = [
2044
+ {
2045
+ id: "tpl.iphone-crevice",
2046
+ name: "Stone crevice",
2047
+ description: "An iPhone wedged between dark rocks, lit by its own screen. Push-in, close pass, pull back.",
2048
+ device: {
2049
+ type: "phone",
2050
+ spec: "phone.iphone-18-pro",
2051
+ finish: "black"
2052
+ },
2053
+ backdrop: {
2054
+ kind: "solid",
2055
+ color: "#030304",
2056
+ tone: "dark"
2057
+ },
2058
+ shadow: 0,
2059
+ aspect: "16:9",
2060
+ rotation: [
2061
+ 0,
2062
+ -6,
2063
+ 0
2064
+ ],
2065
+ float: 0,
2066
+ cursor: {
2067
+ mode: "camera",
2068
+ follow: .25
2069
+ },
2070
+ environment: {
2071
+ preset: "night",
2072
+ intensity: 1,
2073
+ glow: 1.6
2074
+ },
2075
+ lens: {
2076
+ vignette: .45,
2077
+ bloom: .3,
2078
+ grain: .2,
2079
+ blur: .08
2080
+ },
2081
+ set: {
2082
+ kind: "crevice",
2083
+ seed: 3,
2084
+ color: "#3d3d40"
2085
+ },
2086
+ timeline: Dt
2087
+ },
2088
+ {
2089
+ id: "tpl.iphone-push",
2090
+ name: "Grey push-in",
2091
+ description: "An iPhone standing on grey. The camera swings round and closes in on the lower screen, then fades through black.",
2092
+ device: {
2093
+ type: "phone",
2094
+ spec: "phone.iphone-18-pro",
2095
+ finish: "black"
2096
+ },
2097
+ backdrop: {
2098
+ kind: "solid",
2099
+ color: "#cccccc",
2100
+ tone: "light"
2101
+ },
2102
+ shadow: 0,
2103
+ aspect: "4:3",
2104
+ rotation: [
2105
+ 0,
2106
+ 0,
2107
+ 0
2108
+ ],
2109
+ float: 0,
2110
+ cursor: {
2111
+ mode: "camera",
2112
+ follow: .25
2113
+ },
2114
+ environment: {
2115
+ preset: "studio",
2116
+ intensity: 1
2117
+ },
2118
+ timeline: At
2119
+ },
2120
+ {
2121
+ id: "tpl.iphone-night-sweep",
2122
+ name: "Night sweep",
2123
+ description: "An iPhone in the dark, lit along its rim. The camera rises out of black, sweeps down the screen and fades away.",
2124
+ device: {
2125
+ type: "phone",
2126
+ spec: "phone.iphone-18-pro",
2127
+ finish: "black"
2128
+ },
2129
+ backdrop: {
2130
+ kind: "solid",
2131
+ color: "#000000",
2132
+ tone: "dark"
2133
+ },
2134
+ shadow: 0,
2135
+ aspect: "4:3",
2136
+ rotation: [
2137
+ 0,
2138
+ 0,
2139
+ 0
2140
+ ],
2141
+ float: 0,
2142
+ cursor: {
2143
+ mode: "camera",
2144
+ follow: .25
2145
+ },
2146
+ environment: {
2147
+ preset: "night",
2148
+ intensity: 1,
2149
+ glow: 1.2
2150
+ },
2151
+ lens: {
2152
+ vignette: .3,
2153
+ grain: .1
2154
+ },
2155
+ timeline: jt
2156
+ },
2157
+ {
2158
+ id: "tpl.iphone-turn",
2159
+ name: "iPhone turn",
2160
+ description: "A slow turn with a camera push-in. The classic hero shot.",
2161
+ device: {
2162
+ type: "phone",
2163
+ spec: "phone.iphone-18-pro",
2164
+ finish: "black"
2165
+ },
2166
+ preset: "preset.turn",
2167
+ backdrop: {
2168
+ kind: "gradient",
2169
+ inner: "#f6f6f4",
2170
+ outer: "#d5d5d1",
2171
+ tone: "light"
2172
+ },
2173
+ aspect: "16:9",
2174
+ cursor: { follow: .6 }
2175
+ },
2176
+ {
2177
+ id: "tpl.iphone-reel",
2178
+ name: "iPhone reel",
2179
+ description: "Vertical, dark, rises into frame. Made for Reels and Shorts.",
2180
+ device: {
2181
+ type: "phone",
2182
+ spec: "phone.iphone-18-pro-max",
2183
+ finish: "burgundy"
2184
+ },
2185
+ preset: "preset.rise",
2186
+ backdrop: {
2187
+ kind: "gradient",
2188
+ inner: "#2c2f39",
2189
+ outer: "#0b0c10",
2190
+ tone: "dark"
2191
+ },
2192
+ shadow: .5,
2193
+ aspect: "9:16",
2194
+ camera: {
2195
+ position: [
2196
+ 0,
2197
+ 1.5,
2198
+ 62
2199
+ ],
2200
+ fov: 26
2201
+ }
2202
+ },
2203
+ {
2204
+ id: "tpl.ipad-sway",
2205
+ name: "iPad sway",
2206
+ description: "A gentle sway on a warm backdrop for app showcases.",
2207
+ device: {
2208
+ type: "tablet",
2209
+ spec: "tablet.ipad-pro-13",
2210
+ finish: "silver"
2211
+ },
2212
+ preset: "preset.sway",
2213
+ backdrop: {
2214
+ kind: "gradient",
2215
+ inner: "#fbf0e6",
2216
+ outer: "#dfc2a8",
2217
+ tone: "light"
2218
+ },
2219
+ aspect: "16:9",
2220
+ camera: {
2221
+ position: [
2222
+ 0,
2223
+ 2,
2224
+ 78
2225
+ ],
2226
+ fov: 28
2227
+ }
2228
+ },
2229
+ {
2230
+ id: "tpl.macbook-block",
2231
+ name: "Concrete block",
2232
+ description: "A MacBook on the corner of a concrete block. The lid opens as the camera cranes down, then holds.",
2233
+ device: {
2234
+ type: "laptop",
2235
+ spec: "laptop.macbook-pro-14",
2236
+ finish: "space-black"
2237
+ },
2238
+ backdrop: {
2239
+ kind: "solid",
2240
+ color: "#d1d1d1",
2241
+ tone: "light"
2242
+ },
2243
+ shadow: 0,
2244
+ aspect: "4:3",
2245
+ camera: {
2246
+ position: [
2247
+ -30,
2248
+ -7,
2249
+ 60
2250
+ ],
2251
+ target: [
2252
+ 3,
2253
+ 8,
2254
+ 2
2255
+ ],
2256
+ fov: 30
2257
+ },
2258
+ cursor: {
2259
+ mode: "camera",
2260
+ follow: .2
2261
+ },
2262
+ environment: {
2263
+ preset: "studio",
2264
+ intensity: 1
2265
+ },
2266
+ lens: { grain: .08 },
2267
+ set: {
2268
+ kind: "block",
2269
+ seed: 1,
2270
+ color: "#8a8a88"
2271
+ },
2272
+ timeline: kt
2273
+ },
2274
+ {
2275
+ id: "tpl.macbook-open",
2276
+ name: "MacBook lid opens",
2277
+ description: "The lid lifts to reveal your site. Ends on a resting shot.",
2278
+ device: {
2279
+ type: "laptop",
2280
+ spec: "laptop.macbook-pro-14",
2281
+ finish: "space-black"
2282
+ },
2283
+ preset: "preset.lid-open",
2284
+ backdrop: {
2285
+ kind: "gradient",
2286
+ inner: "#e4ecf3",
2287
+ outer: "#b7c6d6",
2288
+ tone: "light"
2289
+ },
2290
+ aspect: "16:9",
2291
+ camera: {
2292
+ position: [
2293
+ 0,
2294
+ 14,
2295
+ 70
2296
+ ],
2297
+ target: [
2298
+ 0,
2299
+ 9,
2300
+ 0
2301
+ ],
2302
+ fov: 30
2303
+ },
2304
+ rotation: [
2305
+ 0,
2306
+ -14,
2307
+ 0
2308
+ ],
2309
+ cursor: {
2310
+ follow: .3,
2311
+ mode: "camera"
2312
+ }
2313
+ },
2314
+ {
2315
+ id: "tpl.macbook-orbit",
2316
+ name: "MacBook orbit",
2317
+ description: "A slow orbit around an open laptop on a dark set.",
2318
+ device: {
2319
+ type: "laptop",
2320
+ spec: "laptop.macbook-pro-16",
2321
+ finish: "silver"
2322
+ },
2323
+ preset: "preset.orbit",
2324
+ backdrop: {
2325
+ kind: "solid",
2326
+ color: "#101114",
2327
+ tone: "dark"
2328
+ },
2329
+ shadow: .55,
2330
+ aspect: "16:9",
2331
+ camera: {
2332
+ position: [
2333
+ 0,
2334
+ 16,
2335
+ 82
2336
+ ],
2337
+ target: [
2338
+ 0,
2339
+ 10,
2340
+ 0
2341
+ ],
2342
+ fov: 30
2343
+ }
2344
+ },
2345
+ {
2346
+ id: "tpl.studio-display",
2347
+ name: "Studio Display push-in",
2348
+ description: "Desktop software on a 27-inch display, slow push-in.",
2349
+ device: {
2350
+ type: "monitor",
2351
+ spec: "monitor.studio-display",
2352
+ finish: "silver"
2353
+ },
2354
+ preset: "preset.push-in",
2355
+ backdrop: {
2356
+ kind: "gradient",
2357
+ inner: "#f6f6f4",
2358
+ outer: "#d5d5d1",
2359
+ tone: "light"
2360
+ },
2361
+ aspect: "16:9",
2362
+ camera: {
2363
+ position: [
2364
+ 0,
2365
+ 32,
2366
+ 150
2367
+ ],
2368
+ target: [
2369
+ 0,
2370
+ 29,
2371
+ 0
2372
+ ],
2373
+ fov: 28
2374
+ }
2375
+ },
2376
+ {
2377
+ id: "tpl.watch-square",
2378
+ name: "Watch square",
2379
+ description: "Square crop of a floating Apple Watch, turning. For feeds.",
2380
+ device: {
2381
+ type: "watch",
2382
+ spec: "watch.series-12-46",
2383
+ finish: "jet-black"
2384
+ },
2385
+ preset: "preset.turn",
2386
+ backdrop: {
2387
+ kind: "gradient",
2388
+ inner: "#e4ecf3",
2389
+ outer: "#b7c6d6",
2390
+ tone: "light"
2391
+ },
2392
+ aspect: "1:1",
2393
+ camera: {
2394
+ position: [
2395
+ 0,
2396
+ .5,
2397
+ 16
2398
+ ],
2399
+ fov: 26
2400
+ }
2401
+ },
2402
+ {
2403
+ id: "tpl.ultra-reveal",
2404
+ name: "Ultra reveal",
2405
+ description: "Apple Watch Ultra scales down into frame on a dark set.",
2406
+ device: {
2407
+ type: "watch",
2408
+ spec: "watch.ultra-4",
2409
+ finish: "natural-titanium"
2410
+ },
2411
+ preset: "preset.zoom-out",
2412
+ backdrop: {
2413
+ kind: "gradient",
2414
+ inner: "#2c2f39",
2415
+ outer: "#0b0c10",
2416
+ tone: "dark"
2417
+ },
2418
+ shadow: .5,
2419
+ aspect: "9:16",
2420
+ camera: {
2421
+ position: [
2422
+ 0,
2423
+ .5,
2424
+ 18
2425
+ ],
2426
+ fov: 26
2427
+ }
2428
+ }
2429
+ ];
2430
+ function Pt(e) {
2431
+ let t = pt({
2432
+ name: e.name,
2433
+ device: e.device
2434
+ }), n = t.scene.devices[0];
2435
+ n && (e.device.type === "laptop" || e.device.type === "monitor" ? (n.transform.rotation = e.rotation ?? [
2436
+ 0,
2437
+ 0,
2438
+ 0
2439
+ ], t.interaction.idle.float = 0) : e.rotation && (n.transform.rotation = e.rotation)), t.scene.backdrop = { ...e.backdrop }, e.shadow !== void 0 && (t.scene.floor.shadow = e.shadow), e.camera && (t.scene.camera = {
2440
+ ...t.scene.camera,
2441
+ ...e.camera
2442
+ });
2443
+ let [r, i] = Mt[e.aspect];
2444
+ t.export.width = r, t.export.height = i, e.environment && (t.scene.environment = {
2445
+ ...t.scene.environment,
2446
+ ...e.environment
2447
+ }), e.lens && (t.scene.camera.lens = {
2448
+ ...t.scene.camera.lens,
2449
+ ...e.lens
2450
+ }), e.set && (t.scene.set = { ...e.set }), e.float !== void 0 && (t.interaction.idle.float = e.float), e.timeline && n && (t.timeline = {
2451
+ ...t.timeline,
2452
+ duration: e.timeline.duration,
2453
+ tracks: e.timeline.tracks.map((e) => ({
2454
+ ...e,
2455
+ target: e.target.replace("$0", n.id),
2456
+ keys: e.keys.map((e) => ({ ...e }))
2457
+ }))
2458
+ }), e.cursor && (t.interaction.cursor = {
2459
+ ...t.interaction.cursor,
2460
+ ...e.cursor
2461
+ }), e.trigger && (t.interaction.trigger = e.trigger);
2462
+ let a = e.preset ? gt.find((t) => t.id === e.preset) : void 0;
2463
+ if (a && n) {
2464
+ let e = t.scene.camera;
2465
+ t = Oe(t, a, [n.id]), t.scene.camera = {
2466
+ ...e,
2467
+ lens: e.lens
2468
+ };
2469
+ }
2470
+ return t.export.range = [0, t.timeline.duration], {
2471
+ id: e.id,
2472
+ name: e.name,
2473
+ description: e.description,
2474
+ tags: [e.device.type],
2475
+ aspect: e.aspect,
2476
+ doc: t
2477
+ };
2478
+ }
2479
+ Nt.map(Pt);
2480
+ // ../core/src/migrations.ts
2481
+ var Ft = {}, It = class extends Error {
2482
+ found;
2483
+ constructor(e) {
2484
+ super(`Project schema version ${e} is newer than this build supports (1). Update the app.`), this.found = e, this.name = "UnsupportedSchemaError";
2485
+ }
2486
+ };
2487
+ function Lt(e) {
2488
+ if (typeof e != "object" || !e) throw TypeError("Project must be an object");
2489
+ let t = { ...e }, n = typeof t.schemaVersion == "number" ? t.schemaVersion : 1;
2490
+ if (n > 1) throw new It(n);
2491
+ for (; n < 1;) {
2492
+ let e = Ft[n];
2493
+ if (!e) throw Error(`No migration from schema version ${n}`);
2494
+ t = e(t), n++, t.schemaVersion = n;
2495
+ }
2496
+ return ut(t);
2497
+ }
2498
+ // ../devices/src/primitives/noise.ts
2499
+ var Rt = {
2500
+ noise: {
2501
+ min: 0,
2502
+ max: 1,
2503
+ default: .3,
2504
+ unit: "",
2505
+ label: "Surface noise"
2506
+ },
2507
+ noiseScale: {
2508
+ min: .1,
2509
+ max: 5,
2510
+ default: .4,
2511
+ unit: "mm",
2512
+ label: "Noise size"
2513
+ }
2514
+ };
2515
+ function zt() {
2516
+ return {
2517
+ amount: { value: Rt.noise.default },
2518
+ grain: { value: Rt.noiseScale.default / 10 }
2519
+ };
2520
+ }
2521
+ var Bt = "\nvarying vec3 vSurfaceNoisePos;\nvarying vec3 vSurfaceNoiseX;\nvarying vec3 vSurfaceNoiseY;\nvarying vec3 vSurfaceNoiseZ;\n", Vt = "\nvSurfaceNoisePos = position;\nvSurfaceNoiseX = normalMatrix[0];\nvSurfaceNoiseY = normalMatrix[1];\nvSurfaceNoiseZ = normalMatrix[2];\n", Ht = "\nuniform float uSurfaceNoiseAmount;\nuniform float uSurfaceNoiseGrain;\nvarying vec3 vSurfaceNoisePos;\nvarying vec3 vSurfaceNoiseX;\nvarying vec3 vSurfaceNoiseY;\nvarying vec3 vSurfaceNoiseZ;\n\nfloat surfaceNoiseHash( vec3 p ) {\n p = fract( p * 0.3183099 + 0.1 );\n p *= 17.0;\n return fract( p.x * p.y * p.z * ( p.x + p.y + p.z ) );\n}\n\n// Value noise with its analytic gradient (Inigo Quilez): x = value 0..1, yzw = d/dp.\nvec4 surfaceNoiseD( vec3 x ) {\n vec3 i = floor( x );\n vec3 w = fract( x );\n vec3 u = w * w * w * ( w * ( w * 6.0 - 15.0 ) + 10.0 );\n vec3 du = 30.0 * w * w * ( w * ( w - 2.0 ) + 1.0 );\n float a = surfaceNoiseHash( i );\n float b = surfaceNoiseHash( i + vec3( 1.0, 0.0, 0.0 ) );\n float c = surfaceNoiseHash( i + vec3( 0.0, 1.0, 0.0 ) );\n float d = surfaceNoiseHash( i + vec3( 1.0, 1.0, 0.0 ) );\n float e = surfaceNoiseHash( i + vec3( 0.0, 0.0, 1.0 ) );\n float f = surfaceNoiseHash( i + vec3( 1.0, 0.0, 1.0 ) );\n float g = surfaceNoiseHash( i + vec3( 0.0, 1.0, 1.0 ) );\n float h = surfaceNoiseHash( i + vec3( 1.0, 1.0, 1.0 ) );\n float k1 = b - a;\n float k2 = c - a;\n float k3 = e - a;\n float k4 = a - b - c + d;\n float k5 = a - c - e + g;\n float k6 = a - b - e + f;\n float k7 = - a + b + c - d + e - f - g + h;\n return vec4(\n a + k1 * u.x + k2 * u.y + k3 * u.z + k4 * u.x * u.y + k5 * u.y * u.z + k6 * u.z * u.x + k7 * u.x * u.y * u.z,\n du * vec3(\n k1 + k4 * u.y + k6 * u.z + k7 * u.y * u.z,\n k2 + k5 * u.z + k4 * u.x + k7 * u.z * u.x,\n k3 + k6 * u.x + k5 * u.y + k7 * u.x * u.y\n )\n );\n}\n", Ut = "\n#include <roughnessmap_fragment>\nfloat surfaceNoiseFootprint = length( fwidth( vSurfaceNoisePos ) ) / max( uSurfaceNoiseGrain, 1e-4 );\nfloat surfaceNoiseFade1 = 1.0 - smoothstep( 0.6, 1.6, surfaceNoiseFootprint );\nfloat surfaceNoiseFade2 = 1.0 - smoothstep( 0.6, 1.6, surfaceNoiseFootprint * 2.13 );\n// Each octave samples a rotated lattice so the cells don't line up with the device's\n// flat faces; gradients come back through the transposed rotation.\nmat3 surfaceNoiseR = mat3( 0.00, 0.80, 0.60, -0.80, 0.36, -0.48, -0.60, -0.48, 0.64 );\nvec3 surfaceNoiseP = surfaceNoiseR * vSurfaceNoisePos / max( uSurfaceNoiseGrain, 1e-4 );\nvec4 surfaceNoise1 = surfaceNoiseD( surfaceNoiseP );\nvec4 surfaceNoise2 = surfaceNoiseD( surfaceNoiseR * surfaceNoiseP * 2.13 + 17.0 );\nfloat surfaceNoiseValue = ( surfaceNoise1.x - 0.5 ) * surfaceNoiseFade1 + ( surfaceNoise2.x - 0.5 ) * 0.5 * surfaceNoiseFade2;\n// Slope per unit amount, in object space (gradients are per cell; cells are one grain).\nmat3 surfaceNoiseRt = transpose( surfaceNoiseR );\nvec3 surfaceNoiseGrad = surfaceNoiseRt * ( surfaceNoise1.yzw * surfaceNoiseFade1 + surfaceNoiseRt * surfaceNoise2.yzw * 2.13 * 0.5 * surfaceNoiseFade2 ) * 0.11;\nroughnessFactor = clamp(\n roughnessFactor + uSurfaceNoiseAmount * ( 0.12 * surfaceNoiseValue + 0.05 * ( 1.0 - surfaceNoiseFade1 ) ),\n 0.03,\n 1.0\n);\n", Wt = "\n#include <normal_fragment_maps>\n{\n vec3 g = mat3( vSurfaceNoiseX, vSurfaceNoiseY, vSurfaceNoiseZ ) * surfaceNoiseGrad * uSurfaceNoiseAmount;\n normal = normalize( normal - ( g - dot( g, normal ) * normal ) );\n}\n";
2522
+ function Gt(e, t) {
2523
+ e.userData.surfaceNoise = t, e.onBeforeCompile = (e) => {
2524
+ e.uniforms.uSurfaceNoiseAmount = t.amount, e.uniforms.uSurfaceNoiseGrain = t.grain, e.vertexShader = e.vertexShader.replace("#include <common>", `#include <common>\n${Bt}`).replace("#include <begin_vertex>", `#include <begin_vertex>\n${Vt}`), e.fragmentShader = e.fragmentShader.replace("#include <common>", `#include <common>\n${Ht}`).replace("#include <roughnessmap_fragment>", Ut).replace("#include <normal_fragment_maps>", Wt);
2525
+ }, e.customProgramCacheKey = () => "surface-noise";
2526
+ }
2527
+ function Kt(e) {
2528
+ let t = /* @__PURE__ */ new Set();
2529
+ e.group.traverse((e) => {
2530
+ let n = e.material;
2531
+ for (let e of Array.isArray(n) ? n : n ? [n] : []) {
2532
+ let n = e.userData.surfaceNoise;
2533
+ n && t.add(n);
2534
+ }
2535
+ });
2536
+ let n = e.setParam;
2537
+ return {
2538
+ ...e,
2539
+ params: {
2540
+ ...e.params,
2541
+ ...Rt
2542
+ },
2543
+ setParam(e, r) {
2544
+ if (e === "noise") for (let e of t) e.amount.value = r;
2545
+ else if (e === "noiseScale") for (let e of t) e.grain.value = r / 10;
2546
+ else n(e, r);
2547
+ }
2548
+ };
2549
+ }
2550
+ // ../devices/src/primitives/materials.ts
2551
+ function qt(e) {
2552
+ let n = {
2553
+ frame: new d({
2554
+ metalness: 1,
2555
+ anisotropy: .4
2556
+ }),
2557
+ back: new d({
2558
+ roughness: .45,
2559
+ clearcoat: .8,
2560
+ clearcoatRoughness: .28
2561
+ }),
2562
+ island: new d({
2563
+ metalness: 1,
2564
+ roughness: .3
2565
+ }),
2566
+ glass: new d({
2567
+ color: 131587,
2568
+ roughness: .6,
2569
+ specularIntensity: 0,
2570
+ clearcoat: 1,
2571
+ clearcoatRoughness: .02
2572
+ }),
2573
+ display: new d({
2574
+ color: 0,
2575
+ emissive: 16777215,
2576
+ roughness: 1,
2577
+ specularIntensity: 0,
2578
+ clearcoat: 1,
2579
+ clearcoatRoughness: .02,
2580
+ toneMapped: !1
2581
+ }),
2582
+ bezel: new t({
2583
+ color: 328966,
2584
+ roughness: .55
2585
+ }),
2586
+ dark: new t({
2587
+ color: 1710620,
2588
+ roughness: .65
2589
+ }),
2590
+ lens: new d({
2591
+ color: 329224,
2592
+ roughness: .08,
2593
+ clearcoat: 1,
2594
+ clearcoatRoughness: .02,
2595
+ iridescence: 1,
2596
+ iridescenceIOR: 1.8,
2597
+ iridescenceThicknessRange: [220, 480]
2598
+ }),
2599
+ lensRing: new d({
2600
+ metalness: 1,
2601
+ roughness: .12
2602
+ }),
2603
+ pupil: new d({
2604
+ color: 0,
2605
+ roughness: .3,
2606
+ clearcoat: 1,
2607
+ clearcoatRoughness: .05
2608
+ }),
2609
+ flash: new d({
2610
+ color: 15261640,
2611
+ roughness: .45,
2612
+ clearcoat: 1,
2613
+ clearcoatRoughness: .1
2614
+ }),
2615
+ logo: new d({
2616
+ metalness: 1,
2617
+ roughness: .08,
2618
+ side: 2
2619
+ }),
2620
+ accent: new d({
2621
+ color: 16738816,
2622
+ roughness: .5
2623
+ }),
2624
+ band: new d({
2625
+ color: 1776413,
2626
+ roughness: .75,
2627
+ sheen: .4,
2628
+ sheenRoughness: .8
2629
+ })
2630
+ }, r = zt();
2631
+ for (let e of [
2632
+ n.frame,
2633
+ n.back,
2634
+ n.island
2635
+ ]) Gt(e, r);
2636
+ return Jt(n, e), n;
2637
+ }
2638
+ function Jt(e, t) {
2639
+ switch (e.frame.color.set(t.frame), e.frame.roughness = t.frameRoughness, e.lensRing.color.set(t.frame).lerp(new p(16777215), .35), e.island.color.set(t.frame), e.back.color.set(t.back), t.backMaterial ?? "glass") {
2640
+ case "metal":
2641
+ e.back.metalness = 1, e.back.roughness = t.frameRoughness + .05, e.back.clearcoat = 0;
2642
+ break;
2643
+ case "ceramic":
2644
+ e.back.metalness = 0, e.back.roughness = .2, e.back.clearcoat = 1, e.back.clearcoatRoughness = .05;
2645
+ break;
2646
+ default: e.back.metalness = 0, e.back.roughness = .45, e.back.clearcoat = .8, e.back.clearcoatRoughness = .28;
2647
+ }
2648
+ e.logo.color.set(t.frame).lerp(new p(16777215), .25), t.accent && e.accent.color.set(t.accent);
2649
+ }
2650
+ function Yt(e, t, n) {
2651
+ return {
2652
+ mesh: e,
2653
+ aspect: t,
2654
+ setTexture(e, r, i = "cover", a) {
2655
+ if (e) {
2656
+ let { repeat: n, offset: o } = w(r, t, i, a);
2657
+ e.wrapS = e.wrapT = h, e.repeat.set(n[0], n[1]), e.offset.set(o[0], o[1]);
2658
+ }
2659
+ n.display.emissiveMap = e, n.display.needsUpdate = !0;
2660
+ },
2661
+ setGlare(e, t = "matte") {
2662
+ let r = n.display;
2663
+ t === "glossy" ? (r.clearcoat = 0, r.roughness = .04, r.specularIntensity = e, r.ior = 1.2) : (r.clearcoat = t === "matte" ? e : 0, r.roughness = 1, r.specularIntensity = 0, r.ior = 1.5), n.glass.clearcoat = .25 + (t === "clean" ? 0 : e * .75);
2664
+ }
2665
+ };
2666
+ }
2667
+ // ../devices/src/primitives/squircle.ts
2668
+ function Xt(e, t, n, r = 2, a = 32) {
2669
+ return new i(Zt(e, t, n, r, a));
2670
+ }
2671
+ function Zt(e, t, n, r = 2, i = 32) {
2672
+ let a = Math.min(n, e / 2, t / 2), o = -e / 2 + a, s = e / 2 - a, l = -t / 2 + a, u = t / 2 - a, d = [
2673
+ [
2674
+ s,
2675
+ l,
2676
+ -Math.PI / 2
2677
+ ],
2678
+ [
2679
+ s,
2680
+ u,
2681
+ 0
2682
+ ],
2683
+ [
2684
+ o,
2685
+ u,
2686
+ Math.PI / 2
2687
+ ],
2688
+ [
2689
+ o,
2690
+ l,
2691
+ Math.PI
2692
+ ]
2693
+ ], f = [];
2694
+ for (let [e, t, n] of d) for (let o = 0; o <= i; o++) {
2695
+ let s = n + o / i * (Math.PI / 2), l = Math.cos(s), u = Math.sin(s), d = new c(e + a * Math.sign(l) * Math.abs(l) ** (2 / r), t + a * Math.sign(u) * Math.abs(u) ** (2 / r)), p = f[f.length - 1];
2696
+ (!p || p.distanceToSquared(d) > 1e-12) && f.push(d);
2697
+ }
2698
+ let p = f[0], m = f[f.length - 1];
2699
+ return p && m && p !== m && p.distanceToSquared(m) < 1e-12 && f.pop(), f;
2700
+ }
2701
+ // ../devices/src/primitives/shapes.ts
2702
+ var Qt = {
2703
+ low: {
2704
+ corner: 12,
2705
+ bevel: 4,
2706
+ round: 24
2707
+ },
2708
+ high: {
2709
+ corner: 32,
2710
+ bevel: 10,
2711
+ round: 64
2712
+ }
2713
+ }, Z = .002;
2714
+ function $t({ width: e, height: t, depth: n, radius: r, exponent: i = 2, edge: a, quality: o }) {
2715
+ let s = Math.min(a, n / 2 - 1e-4), c = new _(Xt(e - 2 * s, t - 2 * s, Math.max(r - s, .001), i, o.corner), {
2716
+ depth: n - 2 * s,
2717
+ bevelEnabled: !0,
2718
+ bevelThickness: s,
2719
+ bevelSize: s,
2720
+ bevelSegments: o.bevel
2721
+ });
2722
+ return c.translate(0, 0, -(n - 2 * s) / 2), c;
2723
+ }
2724
+ function Q(e, t, n, r, i) {
2725
+ return new o(Xt(e, t, n, r, i.corner));
2726
+ }
2727
+ function $(e, t, n, i = {}) {
2728
+ let a = new r(t, n);
2729
+ return a.castShadow = !0, a.position.set(i.x ?? 0, i.y ?? 0, i.z ?? 0), a.rotation.set(i.rx ?? 0, i.ry ?? 0, i.rz ?? 0), e.add(a), a;
2730
+ }
2731
+ function en(e, t, n, r, i) {
2732
+ let a = r === "x" ? e : t, o = r === "x" ? t : e, s = Math.min(t, n) * .3, c = new _(Xt(a - 2 * s, o - 2 * s, Math.min(a, o) / 2 - s, 2, Math.max(6, i.corner / 2)), {
2733
+ depth: n - 2 * s,
2734
+ bevelEnabled: !0,
2735
+ bevelThickness: s,
2736
+ bevelSize: s,
2737
+ bevelSegments: 4
2738
+ });
2739
+ return c.translate(0, 0, -(n - 2 * s) / 2), c;
2740
+ }
2741
+ // ../devices/src/primitives/sweep.ts
2742
+ function tn({ width: e, height: t, radius: n, exponent: r, segments: i, profile: a }) {
2743
+ let o = Zt(e, t, n, r, i), u = o.length, d = o.map((e, t) => {
2744
+ let n = o[(t - 1 + u) % u], r = o[(t + 1) % u];
2745
+ return new c(r.y - n.y, -(r.x - n.x)).normalize();
2746
+ }), p = u + 1, m = a.length, h = new Float32Array(p * m * 3), g = new Float32Array(p * m * 2), _ = [0];
2747
+ for (let e = 1; e < p; e++) _.push(_[e - 1] + o[e % u].distanceTo(o[(e - 1) % u]));
2748
+ let v = [0];
2749
+ for (let e = 1; e < m; e++) {
2750
+ let [t, n] = a[e - 1], [r, i] = a[e];
2751
+ v.push(v[e - 1] + Math.hypot(r - t, i - n));
2752
+ }
2753
+ for (let e = 0; e < m; e++) {
2754
+ let [t, n] = a[e];
2755
+ for (let r = 0; r < p; r++) {
2756
+ let i = o[r % u], a = d[r % u], s = e * p + r;
2757
+ h[s * 3] = i.x - a.x * t, h[s * 3 + 1] = i.y - a.y * t, h[s * 3 + 2] = n, g[s * 2] = _[r], g[s * 2 + 1] = v[e];
2758
+ }
2759
+ }
2760
+ let y = [];
2761
+ for (let e = 0; e < m - 1; e++) for (let t = 0; t < p - 1; t++) {
2762
+ let n = e * p + t, r = n + 1, i = n + p, a = i + 1;
2763
+ y.push(n, i, r, r, i, a);
2764
+ }
2765
+ let b = new f();
2766
+ b.setAttribute("position", new l(h, 3)), b.setAttribute("uv", new l(g, 2)), b.setIndex(y), b.computeVertexNormals();
2767
+ let x = b.attributes.normal, S = new s();
2768
+ for (let e = 0; e < m; e++) {
2769
+ let t = e * p, n = t + p - 1;
2770
+ S.set(x.getX(t) + x.getX(n), x.getY(t) + x.getY(n), x.getZ(t) + x.getZ(n)).normalize(), x.setXYZ(t, S.x, S.y, S.z), x.setXYZ(n, S.x, S.y, S.z);
2771
+ }
2772
+ return b;
2773
+ }
2774
+ function nn(e, t, n = 8) {
2775
+ let r = [];
2776
+ for (let i = 0; i <= n; i++) {
2777
+ let a = i / n * (Math.PI / 2);
2778
+ r.push([e - e * Math.sin(a), t - e + e * Math.cos(a)]);
2779
+ }
2780
+ return r;
2781
+ }
2782
+ // ../devices/src/primitives/uv.ts
2783
+ function rn(e) {
2784
+ e.computeBoundingBox();
2785
+ let t = e.boundingBox, n = e.attributes.position, r = e.attributes.uv;
2786
+ if (!t || !n || !r) return e;
2787
+ for (let e = 0; e < n.count; e++) r.setXY(e, (n.getX(e) - t.min.x) / (t.max.x - t.min.x), (n.getY(e) - t.min.y) / (t.max.y - t.min.y));
2788
+ return r.needsUpdate = !0, e;
2789
+ }
2790
+ // ../devices/src/phone/build.ts
2791
+ var an = new p(16777215);
2792
+ function on() {
2793
+ return {
2794
+ logo: new d({
2795
+ roughness: .35,
2796
+ specularIntensity: .4,
2797
+ clearcoat: .3,
2798
+ clearcoatRoughness: .15,
2799
+ side: 2
2800
+ }),
2801
+ seam: new t({ roughness: .9 }),
2802
+ cover: new d({
2803
+ color: 0,
2804
+ roughness: .02,
2805
+ ior: 1.77,
2806
+ specularIntensity: .45,
2807
+ iridescence: 1,
2808
+ iridescenceIOR: 1.38,
2809
+ iridescenceThicknessRange: [95, 130],
2810
+ transparent: !0,
2811
+ blending: 2,
2812
+ depthWrite: !1
2813
+ }),
2814
+ well: new d({
2815
+ color: 131587,
2816
+ roughness: .55,
2817
+ specularIntensity: .4
2818
+ }),
2819
+ control: new d({
2820
+ color: 921104,
2821
+ roughness: .1,
2822
+ clearcoat: 1,
2823
+ clearcoatRoughness: .03
2824
+ })
2825
+ };
2826
+ }
2827
+ function sn(e, t, n) {
2828
+ Jt(e, n), e.frame.anisotropy = 0, e.lensRing.color.set(n.frame).lerp(an, .06), e.lensRing.roughness = .24, e.back.roughness = .55, e.back.specularIntensity = .6, e.back.clearcoat = .2, e.back.clearcoatRoughness = .4, t.logo.color.set(n.back).multiplyScalar(.78), t.seam.color.set(n.back).multiplyScalar(.3);
2829
+ }
2830
+ function cn(e, t, n = "high") {
2831
+ let r = Qt[n], { width: i, height: a, depth: o, rimInset: s, bezel: c } = e, { radius: l, exponent: u } = e.corner, d = qt(t), f = on();
2832
+ sn(d, f, t);
2833
+ let p = new v();
2834
+ $(p, tn({
2835
+ width: i,
2836
+ height: a,
2837
+ radius: l,
2838
+ exponent: u,
2839
+ segments: r.corner,
2840
+ profile: e.edgeProfile
2841
+ }), d.frame);
2842
+ for (let t of e.buttons) un(e, t, d, f, p, r);
2843
+ let m = new v();
2844
+ m.position.z = o / 2, p.add(m), $(m, $t({
2845
+ width: i - 2 * s,
2846
+ height: a - 2 * s,
2847
+ radius: l - s,
2848
+ exponent: u,
2849
+ depth: .05,
2850
+ edge: .022,
2851
+ quality: r
2852
+ }), d.glass, { z: -.05 / 2 });
2853
+ let h = i - 2 * c, _ = a - 2 * c, b = $(m, rn(Q(h, _, l - c, u, r)), d.display, { z: Z * 2 });
2854
+ $(m, Q(e.island.width, e.island.height, e.island.height / 2, 2, r), d.bezel, {
2855
+ y: _ / 2 - e.island.fromTop - e.island.height / 2,
2856
+ z: Z * 3
2857
+ });
2858
+ let [x, S] = e.edgeProfile[e.edgeProfile.length - 1], C = new v();
2859
+ C.position.z = S, C.rotation.y = Math.PI, p.add(C), $(C, Q(i - 2 * x, a - 2 * x, l - x, u, r), d.frame), dn(e, d, f, C, r), fn(e, d, f, C, r);
2860
+ let w = Yt(b, h / _, d);
2861
+ return {
2862
+ group: p,
2863
+ screens: [w],
2864
+ bounds: new g().setFromObject(p),
2865
+ params: {},
2866
+ restsOnFloor: !1,
2867
+ setParam() {},
2868
+ setFinish: (e) => sn(d, f, e),
2869
+ setGlare: (e, t) => w.setGlare(e, t),
2870
+ dispose: () => {
2871
+ y(p);
2872
+ for (let e of Object.values(f)) e.dispose();
2873
+ }
2874
+ };
2875
+ }
2876
+ function ln(e, t, n) {
2877
+ return {
2878
+ x: -e.width / 2 + t,
2879
+ y: e.height / 2 - n
2880
+ };
2881
+ }
2882
+ function un(e, t, n, r, i, a) {
2883
+ let o = e.height / 2 - t.fromTop, s = e.width / 2 * t.side;
2884
+ if (t.kind === "camera") {
2885
+ $(i, en(t.length, .304, .03, "y", a), n.lensRing, {
2886
+ x: s - t.side * .012,
2887
+ y: o,
2888
+ ry: Math.PI / 2
2889
+ }), $(i, en(t.length - .046, .259, .03, "y", a), r.control, {
2890
+ x: s - t.side * .006,
2891
+ y: o,
2892
+ ry: Math.PI / 2
2893
+ });
2894
+ return;
2895
+ }
2896
+ let c = .146;
2897
+ $(i, en(t.length, .267, c, "y", a), n.frame, {
2898
+ x: s + t.side * (.046 - c / 2),
2899
+ y: o,
2900
+ ry: Math.PI / 2
2901
+ });
2902
+ }
2903
+ function dn(e, t, n, r, i) {
2904
+ let { fromTop: a, margin: o, radius: s } = e.backPanel, c = e.width - 2 * o, l = e.height - a - o, u = e.height / 2 - a - l / 2, d = .012;
2905
+ $(r, Q(c + 2 * d, l + 2 * d, s + d, e.corner.exponent, i), n.seam, {
2906
+ y: u,
2907
+ z: Z
2908
+ }), $(r, Q(c, l, s, e.corner.exponent, i), t.back, {
2909
+ y: u,
2910
+ z: Z * 2
2911
+ }), e.branding !== !1 && $(r, C(e.logo.height), n.logo, {
2912
+ y: e.height / 2 - e.logo.fromTop,
2913
+ z: Z * 3
2914
+ });
2915
+ }
2916
+ function fn(e, t, n, r, i) {
2917
+ let { height: o, margin: s, raise: c, radius: l, lip: d } = e.plateau, f = e.width - 2 * s, p = e.height / 2 - s - o / 2, m = e.corner.exponent, h = [...nn(d, c, i.bevel), [0, -.02]];
2918
+ $(r, tn({
2919
+ width: f,
2920
+ height: o,
2921
+ radius: l,
2922
+ exponent: m,
2923
+ segments: i.corner,
2924
+ profile: h
2925
+ }), t.frame, { y: p }), $(r, Q(f - 2 * d, o - 2 * d, l - d, m, i), t.frame, {
2926
+ y: p,
2927
+ z: c
2928
+ });
2929
+ let g = pn(e.lens.radius, i.round);
2930
+ for (let [i, a] of e.lens.centres) {
2931
+ let o = ln(e, i, a), s = new v();
2932
+ s.position.set(o.x, o.y, c), s.rotation.x = Math.PI / 2, r.add(s), $(s, g.housing, t.lensRing), $(s, g.well, n.well), $(s, g.element, t.lens), $(s, g.cover, n.cover).renderOrder = 1;
2933
+ }
2934
+ let _ = ln(e, e.flash.x, e.flash.y);
2935
+ $(r, new a(e.flash.radius * .86, e.flash.radius, i.round), t.lensRing, {
2936
+ ..._,
2937
+ z: c + Z
2938
+ }), $(r, new u(e.flash.radius * .86, i.round), t.flash, {
2939
+ ..._,
2940
+ z: c + Z
2941
+ });
2942
+ let y = ln(e, e.lidar.x, e.lidar.y);
2943
+ $(r, new u(e.lidar.radius, i.round), t.pupil, {
2944
+ ...y,
2945
+ z: c + Z
2946
+ });
2947
+ let b = ln(e, e.mic.x, e.mic.y);
2948
+ $(r, new u(e.mic.radius, 16), t.bezel, {
2949
+ ...b,
2950
+ z: c + Z
2951
+ });
2952
+ }
2953
+ function pn(e, t) {
2954
+ let r = e / .833, i = (e) => new n(e.map(([e, t]) => new c(e * r, t * r)), t);
2955
+ return {
2956
+ housing: i([
2957
+ [.833, -.02],
2958
+ [.833, .137],
2959
+ [.83, .152],
2960
+ [.822, .165],
2961
+ [.81, .176],
2962
+ [.795, .185],
2963
+ [.775, .189],
2964
+ [.75, .19],
2965
+ [.711, .19],
2966
+ [.711, .03],
2967
+ [.67, .03]
2968
+ ]),
2969
+ well: i([
2970
+ [.712, .035],
2971
+ [.646, .035],
2972
+ [.646, .183],
2973
+ [.482, .183],
2974
+ [.47, .17],
2975
+ [.42, .11],
2976
+ [.325, .105],
2977
+ [.3, .075],
2978
+ [.275, .056],
2979
+ [.256, -.035]
2980
+ ]),
2981
+ element: i([
2982
+ [.256, -.035],
2983
+ [.24, -.02],
2984
+ [.2, .01],
2985
+ [.15, .035],
2986
+ [.1, .05],
2987
+ [.05, .058],
2988
+ [0, .06]
2989
+ ]),
2990
+ cover: i([
2991
+ [.711, .056],
2992
+ [.717, .2],
2993
+ [.712, .205],
2994
+ [.705, .209],
2995
+ [.69, .212],
2996
+ [0, .212]
2997
+ ])
2998
+ };
2999
+ }
3000
+ // ../devices/src/phone/finishes.ts
3001
+ var mn = {
3002
+ black: {
3003
+ label: "Black",
3004
+ frame: "#2e2f33",
3005
+ back: "#1b1c20",
3006
+ frameRoughness: .4,
3007
+ backMaterial: "glass"
3008
+ },
3009
+ silver: {
3010
+ label: "Silver",
3011
+ frame: "#cfd0d2",
3012
+ back: "#d2d2d0",
3013
+ frameRoughness: .42,
3014
+ backMaterial: "glass"
3015
+ },
3016
+ glacier: {
3017
+ label: "Glacier",
3018
+ frame: "#bccddb",
3019
+ back: "#ccdae6",
3020
+ frameRoughness: .42,
3021
+ backMaterial: "glass"
3022
+ },
3023
+ burgundy: {
3024
+ label: "Burgundy",
3025
+ frame: "#553a3e",
3026
+ back: "#3d2226",
3027
+ frameRoughness: .38,
3028
+ backMaterial: "glass"
3029
+ }
3030
+ }, hn = {
3031
+ depth: .875,
3032
+ corner: {
3033
+ radius: 1.4,
3034
+ exponent: 2.2
3035
+ },
3036
+ edgeProfile: [
3037
+ [1.22, 4.7],
3038
+ [1.16, 4.81],
3039
+ [.92, 4.78],
3040
+ [.77, 4.69],
3041
+ [.56, 4.47],
3042
+ [.38, 4.21],
3043
+ [.25, 3.92],
3044
+ [.16, 3.62],
3045
+ [.1, 3.28],
3046
+ [.05, 2.9],
3047
+ [.02, 2.3],
3048
+ [0, 1.6],
3049
+ [0, -.4],
3050
+ [.01, -1],
3051
+ [.03, -1.36],
3052
+ [.05, -1.6],
3053
+ [.07, -1.75],
3054
+ [.1, -1.97],
3055
+ [.17, -2.33],
3056
+ [.27, -2.63],
3057
+ [.41, -2.91],
3058
+ [.59, -3.16],
3059
+ [.82, -3.37],
3060
+ [1.09, -3.53],
3061
+ [1.36, -3.64],
3062
+ [1.72, -3.73],
3063
+ [2.22, -3.8],
3064
+ [2.86, -3.83]
3065
+ ].map(([e, t]) => [e / 10, t / 10 - .0555]),
3066
+ rimInset: .12,
3067
+ bezel: .256,
3068
+ island: {
3069
+ width: 1.575,
3070
+ height: .607,
3071
+ fromTop: .232
3072
+ },
3073
+ plateau: {
3074
+ height: 4.012,
3075
+ margin: .387,
3076
+ raise: .279,
3077
+ radius: 1.11,
3078
+ lip: .11
3079
+ },
3080
+ lens: {
3081
+ radius: .833,
3082
+ centres: [
3083
+ [1.442, 1.437],
3084
+ [1.442, 3.361],
3085
+ [3.262, 2.399]
3086
+ ]
3087
+ },
3088
+ finishes: [
3089
+ "black",
3090
+ "silver",
3091
+ "glacier",
3092
+ "burgundy"
3093
+ ]
3094
+ };
3095
+ function gn(e) {
3096
+ return {
3097
+ flash: {
3098
+ radius: .3365,
3099
+ x: e - 1.388,
3100
+ y: 1.382
3101
+ },
3102
+ lidar: {
3103
+ radius: .336,
3104
+ x: e - 1.388,
3105
+ y: 3.416
3106
+ },
3107
+ mic: {
3108
+ radius: .038,
3109
+ x: e - 1.695,
3110
+ y: 3.07
3111
+ }
3112
+ };
3113
+ }
3114
+ var _n = {
3115
+ ...hn,
3116
+ id: "phone.iphone-18-pro-max",
3117
+ label: "iPhone 18 Pro Max",
3118
+ width: 7.8,
3119
+ height: 16.34,
3120
+ display: {
3121
+ px: [1320, 2868],
3122
+ ppi: 460
3123
+ },
3124
+ ...gn(7.8),
3125
+ backPanel: {
3126
+ fromTop: 4.878,
3127
+ margin: .381,
3128
+ radius: 1.035
3129
+ },
3130
+ buttons: [
3131
+ {
3132
+ side: -1,
3133
+ fromTop: 3.429,
3134
+ length: .692,
3135
+ kind: "action"
3136
+ },
3137
+ {
3138
+ side: -1,
3139
+ fromTop: 4.844,
3140
+ length: 1.122,
3141
+ kind: "volume"
3142
+ },
3143
+ {
3144
+ side: -1,
3145
+ fromTop: 6.264,
3146
+ length: 1.122,
3147
+ kind: "volume"
3148
+ },
3149
+ {
3150
+ side: 1,
3151
+ fromTop: 5.554,
3152
+ length: 1.772,
3153
+ kind: "side"
3154
+ },
3155
+ {
3156
+ side: 1,
3157
+ fromTop: 11.184,
3158
+ length: 1.712,
3159
+ kind: "camera"
3160
+ }
3161
+ ],
3162
+ logo: {
3163
+ height: 2.004,
3164
+ fromTop: 9.753
3165
+ }
3166
+ }, vn = {
3167
+ ...hn,
3168
+ id: "phone.iphone-18-pro",
3169
+ label: "iPhone 18 Pro",
3170
+ width: 7.19,
3171
+ height: 15,
3172
+ display: {
3173
+ px: [1206, 2622],
3174
+ ppi: 460
3175
+ },
3176
+ ...gn(7.19),
3177
+ backPanel: {
3178
+ fromTop: 4.878,
3179
+ margin: .381,
3180
+ radius: 1.035
3181
+ },
3182
+ buttons: [
3183
+ {
3184
+ side: -1,
3185
+ fromTop: 3.429,
3186
+ length: .692,
3187
+ kind: "action"
3188
+ },
3189
+ {
3190
+ side: -1,
3191
+ fromTop: 4.844,
3192
+ length: 1.122,
3193
+ kind: "volume"
3194
+ },
3195
+ {
3196
+ side: -1,
3197
+ fromTop: 6.264,
3198
+ length: 1.122,
3199
+ kind: "volume"
3200
+ },
3201
+ {
3202
+ side: 1,
3203
+ fromTop: 5.554,
3204
+ length: 1.772,
3205
+ kind: "side"
3206
+ },
3207
+ {
3208
+ side: 1,
3209
+ fromTop: 10.264,
3210
+ length: 1.712,
3211
+ kind: "camera"
3212
+ }
3213
+ ],
3214
+ logo: {
3215
+ height: 2.004,
3216
+ fromTop: 9.079
3217
+ }
3218
+ }, yn = {
3219
+ [vn.id]: vn,
3220
+ [_n.id]: _n
3221
+ }, bn = /* @__PURE__ */ e({ phone: () => xn }), xn = {
3222
+ type: "phone",
3223
+ specs: yn,
3224
+ finishes: mn,
3225
+ build: cn
3226
+ };
3227
+ export { me as C, y as D, C as E, Te as S, ee as T, _t as _, Qt as a, Tt as b, en as c, Xt as d, Jt as f, Lt as g, Kt as h, Z as i, $t as l, Yt as m, rn as n, $ as o, qt as p, tn as r, Q as s, bn as t, Zt as u, yt as v, w, Ee as x, vt as y };