@virtualdisplay.io/client 4.0.0-alpha.24 → 4.0.0-alpha.26
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/CHANGELOG.md +23 -0
- package/README.md +50 -16
- package/dist/index.d.ts +172 -13
- package/dist/virtualdisplay.client.cjs.js +119 -26
- package/dist/virtualdisplay.client.es.js +1573 -1194
- package/dist/virtualdisplay.client.umd.js +127 -34
- package/package.json +1 -1
|
@@ -14,72 +14,82 @@ const c = {
|
|
|
14
14
|
FOCUS: "focus",
|
|
15
15
|
PRICING: "pricing",
|
|
16
16
|
QR_SHOWN: "qr_shown",
|
|
17
|
-
SYNC: "sync"
|
|
18
|
-
|
|
17
|
+
SYNC: "sync",
|
|
18
|
+
SELECTABLE: "selectable",
|
|
19
|
+
APP_RESOLVED: "app_resolved"
|
|
20
|
+
}, ee = {
|
|
19
21
|
FOCUS: "focus",
|
|
20
22
|
UNFOCUS: "unfocus"
|
|
21
|
-
},
|
|
23
|
+
}, Ie = {
|
|
22
24
|
FOCUSED: "focused"
|
|
23
|
-
},
|
|
25
|
+
}, Le = {
|
|
24
26
|
/** Behaves exactly like an unpriced combination: no price, no button. */
|
|
25
27
|
HIDDEN: "hidden"
|
|
26
|
-
},
|
|
27
|
-
function
|
|
28
|
+
}, Oe = new Set(Object.values(c));
|
|
29
|
+
function Ne(n) {
|
|
28
30
|
if (typeof n != "object" || n === null)
|
|
29
31
|
return !1;
|
|
30
|
-
const
|
|
31
|
-
return typeof
|
|
32
|
+
const e = n;
|
|
33
|
+
return typeof e.target == "string" ? !1 : typeof e.type == "string" && Oe.has(e.type);
|
|
32
34
|
}
|
|
33
|
-
function
|
|
34
|
-
const
|
|
35
|
-
return
|
|
35
|
+
function Me(n) {
|
|
36
|
+
const e = S(n);
|
|
37
|
+
return e !== null && e.type === c.HANDSHAKE;
|
|
36
38
|
}
|
|
37
|
-
function
|
|
38
|
-
const
|
|
39
|
-
return
|
|
39
|
+
function ze(n) {
|
|
40
|
+
const e = S(n);
|
|
41
|
+
return e !== null && e.type === c.SESSION && typeof e.sessionId == "string";
|
|
42
|
+
}
|
|
43
|
+
function Pe(n) {
|
|
44
|
+
const e = S(n);
|
|
45
|
+
return e !== null && e.type === c.APP_RESOLVED && typeof e.appType == "string" && e.appType !== "" && typeof e.name == "string";
|
|
46
|
+
}
|
|
47
|
+
function Fe(n) {
|
|
48
|
+
const e = S(n);
|
|
49
|
+
return e !== null && e.type === c.MUTATION && Array.isArray(e.results);
|
|
40
50
|
}
|
|
41
|
-
function
|
|
42
|
-
const
|
|
43
|
-
return
|
|
51
|
+
function $e(n) {
|
|
52
|
+
const e = S(n);
|
|
53
|
+
return e !== null && e.type === c.SNAPSHOT && ("data" in e || "error" in e);
|
|
44
54
|
}
|
|
45
|
-
function
|
|
46
|
-
const
|
|
47
|
-
return
|
|
55
|
+
function De(n) {
|
|
56
|
+
const e = S(n);
|
|
57
|
+
return e !== null && e.type === c.CAMERA && Array.isArray(e.transforms);
|
|
48
58
|
}
|
|
49
|
-
function
|
|
50
|
-
const
|
|
51
|
-
return
|
|
59
|
+
function Ue(n) {
|
|
60
|
+
const e = S(n);
|
|
61
|
+
return e !== null && e.type === c.MAPPING && Array.isArray(e.attributes);
|
|
52
62
|
}
|
|
53
|
-
function
|
|
54
|
-
const
|
|
55
|
-
return
|
|
63
|
+
function Be(n) {
|
|
64
|
+
const e = S(n);
|
|
65
|
+
return e !== null && e.type === c.LOADING_INDICATOR && typeof e.progress == "number";
|
|
56
66
|
}
|
|
57
|
-
function
|
|
58
|
-
const
|
|
59
|
-
return
|
|
67
|
+
function Ve(n) {
|
|
68
|
+
const e = S(n);
|
|
69
|
+
return e !== null && e.type === c.SYNC && typeof e.connected == "boolean";
|
|
60
70
|
}
|
|
61
|
-
function
|
|
62
|
-
const
|
|
63
|
-
return
|
|
71
|
+
function je(n) {
|
|
72
|
+
const e = S(n);
|
|
73
|
+
return e !== null && e.type === c.SELECTABLE && Array.isArray(e.attributes);
|
|
64
74
|
}
|
|
65
|
-
function
|
|
66
|
-
const
|
|
67
|
-
return
|
|
75
|
+
function He(n) {
|
|
76
|
+
const e = S(n);
|
|
77
|
+
return e !== null && e.type === c.CONFIG && typeof e.viewerSettings == "object";
|
|
68
78
|
}
|
|
69
|
-
function
|
|
70
|
-
const
|
|
71
|
-
return
|
|
79
|
+
function qe(n) {
|
|
80
|
+
const e = S(n);
|
|
81
|
+
return e !== null && e.type === c.FOCUS && typeof e.state == "string";
|
|
72
82
|
}
|
|
73
|
-
function
|
|
74
|
-
const
|
|
75
|
-
return
|
|
83
|
+
function Ge(n) {
|
|
84
|
+
const e = S(n);
|
|
85
|
+
return e !== null && e.type === c.PRICING && typeof e.pricing == "object" && e.pricing !== null;
|
|
76
86
|
}
|
|
77
87
|
function S(n) {
|
|
78
88
|
return typeof n != "object" || n === null ? null : n;
|
|
79
89
|
}
|
|
80
|
-
class
|
|
81
|
-
constructor(
|
|
82
|
-
this.processor =
|
|
90
|
+
class te {
|
|
91
|
+
constructor(e) {
|
|
92
|
+
this.processor = e;
|
|
83
93
|
}
|
|
84
94
|
processor;
|
|
85
95
|
pending = [];
|
|
@@ -87,12 +97,12 @@ class et {
|
|
|
87
97
|
/**
|
|
88
98
|
* Add a message — processed immediately if ready, queued otherwise
|
|
89
99
|
*/
|
|
90
|
-
enqueue(
|
|
100
|
+
enqueue(e) {
|
|
91
101
|
if (this.isReady) {
|
|
92
|
-
this.processor(
|
|
102
|
+
this.processor(e);
|
|
93
103
|
return;
|
|
94
104
|
}
|
|
95
|
-
this.pending.push(
|
|
105
|
+
this.pending.push(e);
|
|
96
106
|
}
|
|
97
107
|
/**
|
|
98
108
|
* Mark as ready and flush all pending messages
|
|
@@ -100,10 +110,10 @@ class et {
|
|
|
100
110
|
markReady() {
|
|
101
111
|
if (this.isReady || (this.isReady = !0, this.pending.length === 0))
|
|
102
112
|
return;
|
|
103
|
-
const
|
|
113
|
+
const e = [...this.pending];
|
|
104
114
|
this.pending.length = 0;
|
|
105
|
-
for (const
|
|
106
|
-
this.processor(
|
|
115
|
+
for (const t of e)
|
|
116
|
+
this.processor(t);
|
|
107
117
|
}
|
|
108
118
|
get ready() {
|
|
109
119
|
return this.isReady;
|
|
@@ -114,8 +124,8 @@ class et {
|
|
|
114
124
|
/**
|
|
115
125
|
* Check if a message of a specific type is pending
|
|
116
126
|
*/
|
|
117
|
-
hasPending(
|
|
118
|
-
return this.pending.some((
|
|
127
|
+
hasPending(e) {
|
|
128
|
+
return this.pending.some((t) => t.type === e);
|
|
119
129
|
}
|
|
120
130
|
/**
|
|
121
131
|
* Clear all pending messages
|
|
@@ -124,9 +134,9 @@ class et {
|
|
|
124
134
|
this.pending.length = 0;
|
|
125
135
|
}
|
|
126
136
|
}
|
|
127
|
-
class
|
|
128
|
-
constructor(
|
|
129
|
-
this.getTarget =
|
|
137
|
+
class Ze {
|
|
138
|
+
constructor(e, t) {
|
|
139
|
+
this.getTarget = e, this.sourceId = `vd-${Math.random().toString(36).slice(2, 8)}`, this.targetOrigin = "*", this.isValid = t?.isValid ?? Ne, this.publisher = new te((i) => this.post(i)), this.consumer = new te((i) => this.routeToHandler(i)), t?.bufferIncoming !== !0 && this.consumer.markReady();
|
|
130
140
|
}
|
|
131
141
|
getTarget;
|
|
132
142
|
handlers = /* @__PURE__ */ new Map();
|
|
@@ -139,22 +149,22 @@ class jt {
|
|
|
139
149
|
/**
|
|
140
150
|
* Register a handler for a specific message type
|
|
141
151
|
*/
|
|
142
|
-
on(
|
|
143
|
-
this.handlers.set(
|
|
152
|
+
on(e, t) {
|
|
153
|
+
this.handlers.set(e, t);
|
|
144
154
|
}
|
|
145
155
|
/**
|
|
146
156
|
* Update the target origin for outgoing postMessage calls.
|
|
147
157
|
* Use when the target origin is discovered at runtime (e.g. from the first incoming message).
|
|
148
158
|
*/
|
|
149
|
-
setTargetOrigin(
|
|
150
|
-
this.targetOrigin =
|
|
159
|
+
setTargetOrigin(e) {
|
|
160
|
+
this.targetOrigin = e;
|
|
151
161
|
}
|
|
152
162
|
/**
|
|
153
163
|
* Send a message to the target window
|
|
154
164
|
* Queued until markReady() is called
|
|
155
165
|
*/
|
|
156
|
-
send(
|
|
157
|
-
this.publisher.enqueue(
|
|
166
|
+
send(e) {
|
|
167
|
+
this.publisher.enqueue(e);
|
|
158
168
|
}
|
|
159
169
|
/**
|
|
160
170
|
* Feed a message through the same routing path as one that just arrived via
|
|
@@ -165,8 +175,8 @@ class jt {
|
|
|
165
175
|
* viewer engine's SSE-sourced live sync channel, ar-session-handoff) and
|
|
166
176
|
* needs them to land exactly where a postMessage would.
|
|
167
177
|
*/
|
|
168
|
-
receive(
|
|
169
|
-
this.isValid(
|
|
178
|
+
receive(e) {
|
|
179
|
+
this.isValid(e) && this.consumer.enqueue(e);
|
|
170
180
|
}
|
|
171
181
|
/**
|
|
172
182
|
* Enable sending and flush queued outgoing messages
|
|
@@ -184,22 +194,22 @@ class jt {
|
|
|
184
194
|
/**
|
|
185
195
|
* Check if an incoming message of a specific type is pending in the consumer buffer
|
|
186
196
|
*/
|
|
187
|
-
consumerHasPending(
|
|
188
|
-
return this.consumer.hasPending(
|
|
197
|
+
consumerHasPending(e) {
|
|
198
|
+
return this.consumer.hasPending(e);
|
|
189
199
|
}
|
|
190
200
|
/**
|
|
191
201
|
* Start listening for incoming messages
|
|
192
202
|
*/
|
|
193
203
|
start() {
|
|
194
|
-
this.listener === null && (this.listener = (
|
|
195
|
-
const { data:
|
|
196
|
-
if (!this.isValid(
|
|
204
|
+
this.listener === null && (this.listener = (e) => {
|
|
205
|
+
const { data: t } = e;
|
|
206
|
+
if (!this.isValid(t) || t._source === this.sourceId)
|
|
197
207
|
return;
|
|
198
208
|
const i = this.getTarget();
|
|
199
|
-
if (i !== null &&
|
|
209
|
+
if (i !== null && e.source !== null && e.source !== i)
|
|
200
210
|
return;
|
|
201
|
-
const
|
|
202
|
-
this.consumer.enqueue(
|
|
211
|
+
const s = t;
|
|
212
|
+
this.consumer.enqueue(s);
|
|
203
213
|
}, window.addEventListener("message", this.listener));
|
|
204
214
|
}
|
|
205
215
|
/**
|
|
@@ -220,36 +230,36 @@ class jt {
|
|
|
220
230
|
get pendingCount() {
|
|
221
231
|
return this.publisher.pendingCount;
|
|
222
232
|
}
|
|
223
|
-
post(
|
|
224
|
-
const
|
|
225
|
-
|
|
233
|
+
post(e) {
|
|
234
|
+
const t = this.getTarget();
|
|
235
|
+
t !== null && t.postMessage({ ...e, _source: this.sourceId }, this.targetOrigin);
|
|
226
236
|
}
|
|
227
|
-
routeToHandler(
|
|
228
|
-
const
|
|
229
|
-
if (
|
|
237
|
+
routeToHandler(e) {
|
|
238
|
+
const t = this.handlers.get(e.type);
|
|
239
|
+
if (t === void 0)
|
|
230
240
|
return;
|
|
231
|
-
const i = e
|
|
232
|
-
i instanceof Promise && i.catch((
|
|
233
|
-
const
|
|
234
|
-
console.error(`Virtualdisplay: error handling ${
|
|
241
|
+
const i = t(e);
|
|
242
|
+
i instanceof Promise && i.catch((s) => {
|
|
243
|
+
const o = s instanceof Error ? s.message : String(s);
|
|
244
|
+
console.error(`Virtualdisplay: error handling ${e.type}: ${o}`);
|
|
235
245
|
});
|
|
236
246
|
}
|
|
237
247
|
}
|
|
238
|
-
class
|
|
239
|
-
constructor(
|
|
240
|
-
this.send =
|
|
248
|
+
class We {
|
|
249
|
+
constructor(e) {
|
|
250
|
+
this.send = e;
|
|
241
251
|
}
|
|
242
252
|
send;
|
|
243
|
-
setEnabled(
|
|
253
|
+
setEnabled(e) {
|
|
244
254
|
this.send({
|
|
245
255
|
type: c.ANNOTATION_TOGGLE,
|
|
246
|
-
enabled:
|
|
256
|
+
enabled: e
|
|
247
257
|
});
|
|
248
258
|
}
|
|
249
259
|
}
|
|
250
|
-
class
|
|
251
|
-
constructor(
|
|
252
|
-
this.value =
|
|
260
|
+
class Ye {
|
|
261
|
+
constructor(e, t) {
|
|
262
|
+
this.value = e, this.attribute = t;
|
|
253
263
|
}
|
|
254
264
|
value;
|
|
255
265
|
attribute;
|
|
@@ -257,8 +267,8 @@ class qt {
|
|
|
257
267
|
get isSelected() {
|
|
258
268
|
return this.isSelectedValue;
|
|
259
269
|
}
|
|
260
|
-
setSelected(
|
|
261
|
-
this.isSelectedValue =
|
|
270
|
+
setSelected(e) {
|
|
271
|
+
this.isSelectedValue = e;
|
|
262
272
|
}
|
|
263
273
|
}
|
|
264
274
|
const A = {
|
|
@@ -269,286 +279,286 @@ const A = {
|
|
|
269
279
|
INVALID_PARAMETER: "INVALID_PARAMETER",
|
|
270
280
|
SNAPSHOT_FAILED: "SNAPSHOT_FAILED"
|
|
271
281
|
};
|
|
272
|
-
class
|
|
282
|
+
class g extends Error {
|
|
273
283
|
code;
|
|
274
|
-
constructor(
|
|
275
|
-
super(
|
|
284
|
+
constructor(e, t) {
|
|
285
|
+
super(e), this.name = "VirtualdisplayError", this.code = t;
|
|
276
286
|
}
|
|
277
|
-
static valueNotFound(
|
|
278
|
-
return new
|
|
279
|
-
`Value "${
|
|
287
|
+
static valueNotFound(e, t) {
|
|
288
|
+
return new g(
|
|
289
|
+
`Value "${t}" not found for attribute "${e}"`,
|
|
280
290
|
A.VALUE_NOT_FOUND
|
|
281
291
|
);
|
|
282
292
|
}
|
|
283
|
-
static parentNotFound(
|
|
284
|
-
return new
|
|
285
|
-
`Parent element not found: ${
|
|
293
|
+
static parentNotFound(e) {
|
|
294
|
+
return new g(
|
|
295
|
+
`Parent element not found: ${e}`,
|
|
286
296
|
A.PARENT_NOT_FOUND
|
|
287
297
|
);
|
|
288
298
|
}
|
|
289
|
-
static invalidParameter(
|
|
290
|
-
return new
|
|
299
|
+
static invalidParameter(e) {
|
|
300
|
+
return new g(e, A.INVALID_PARAMETER);
|
|
291
301
|
}
|
|
292
302
|
}
|
|
293
|
-
class
|
|
303
|
+
class Qe {
|
|
294
304
|
name;
|
|
295
305
|
defaultValue;
|
|
296
306
|
values;
|
|
297
307
|
onSelect;
|
|
298
308
|
onChangeCallback;
|
|
299
|
-
constructor(
|
|
300
|
-
this.name =
|
|
309
|
+
constructor(e) {
|
|
310
|
+
this.name = e.name, this.defaultValue = e.defaultValue, this.onSelect = e.onSelect, this.values = this.createValues(e.values);
|
|
301
311
|
}
|
|
302
312
|
/**
|
|
303
313
|
* Select a value for this attribute
|
|
304
314
|
* @throws {VirtualdisplayError} When value not found
|
|
305
315
|
*/
|
|
306
|
-
select(
|
|
307
|
-
if (!this.values.has(
|
|
308
|
-
throw
|
|
309
|
-
this.onSelect(this.name,
|
|
316
|
+
select(e) {
|
|
317
|
+
if (!this.values.has(e))
|
|
318
|
+
throw g.valueNotFound(this.name, e);
|
|
319
|
+
this.onSelect(this.name, e);
|
|
310
320
|
}
|
|
311
321
|
getValues() {
|
|
312
322
|
return Array.from(this.values.values());
|
|
313
323
|
}
|
|
314
|
-
getValue(
|
|
315
|
-
return this.values.get(
|
|
324
|
+
getValue(e) {
|
|
325
|
+
return this.values.get(e);
|
|
316
326
|
}
|
|
317
327
|
/** The currently selected value, or undefined before any selection lands. */
|
|
318
328
|
get selected() {
|
|
319
|
-
for (const
|
|
320
|
-
if (
|
|
321
|
-
return
|
|
329
|
+
for (const e of this.values.values())
|
|
330
|
+
if (e.isSelected)
|
|
331
|
+
return e.value;
|
|
322
332
|
}
|
|
323
333
|
/**
|
|
324
334
|
* Register callback that fires when selection changes
|
|
325
335
|
* Receives the newly selected AttributeValue
|
|
326
336
|
*/
|
|
327
|
-
onChange(
|
|
328
|
-
this.onChangeCallback =
|
|
337
|
+
onChange(e) {
|
|
338
|
+
this.onChangeCallback = e;
|
|
329
339
|
}
|
|
330
340
|
/**
|
|
331
341
|
* Update selection state from server mutation result
|
|
332
342
|
* Direct value comparison - no source/target translation
|
|
333
343
|
*/
|
|
334
|
-
handleResult(
|
|
335
|
-
let
|
|
344
|
+
handleResult(e) {
|
|
345
|
+
let t;
|
|
336
346
|
for (const i of this.values.values()) {
|
|
337
|
-
const
|
|
338
|
-
i.setSelected(
|
|
347
|
+
const s = i.value === e;
|
|
348
|
+
i.setSelected(s), s && (t = i);
|
|
339
349
|
}
|
|
340
|
-
|
|
350
|
+
t !== void 0 && this.onChangeCallback !== void 0 && this.onChangeCallback(t);
|
|
341
351
|
}
|
|
342
|
-
createValues(
|
|
343
|
-
const
|
|
344
|
-
for (const i of
|
|
345
|
-
const
|
|
346
|
-
i === this.defaultValue &&
|
|
352
|
+
createValues(e) {
|
|
353
|
+
const t = /* @__PURE__ */ new Map();
|
|
354
|
+
for (const i of e) {
|
|
355
|
+
const s = new Ye(i, this.name);
|
|
356
|
+
i === this.defaultValue && s.setSelected(!0), t.set(i, s);
|
|
347
357
|
}
|
|
348
|
-
return
|
|
358
|
+
return t;
|
|
349
359
|
}
|
|
350
360
|
}
|
|
351
|
-
class
|
|
361
|
+
class Ke {
|
|
352
362
|
attributes = /* @__PURE__ */ new Map();
|
|
353
|
-
constructor(
|
|
354
|
-
for (const
|
|
355
|
-
const
|
|
356
|
-
this.attributes.set(
|
|
363
|
+
constructor(e, t, i) {
|
|
364
|
+
for (const s of e) {
|
|
365
|
+
const o = this.buildOptions(s, t);
|
|
366
|
+
this.attributes.set(s.name, new Qe(o));
|
|
357
367
|
}
|
|
358
368
|
this.onMutationFailed = i;
|
|
359
369
|
}
|
|
360
370
|
onMutationFailed;
|
|
361
|
-
get(
|
|
362
|
-
return this.attributes.get(
|
|
371
|
+
get(e) {
|
|
372
|
+
return this.attributes.get(e);
|
|
363
373
|
}
|
|
364
374
|
/** The current selection as attribute name→value pairs, skipping unset attributes. */
|
|
365
375
|
getSelection() {
|
|
366
|
-
const
|
|
367
|
-
for (const [
|
|
368
|
-
const
|
|
369
|
-
|
|
376
|
+
const e = {};
|
|
377
|
+
for (const [t, i] of this.attributes) {
|
|
378
|
+
const s = i.selected;
|
|
379
|
+
s !== void 0 && (e[t] = s);
|
|
370
380
|
}
|
|
371
|
-
return
|
|
381
|
+
return e;
|
|
372
382
|
}
|
|
373
|
-
handleResults(
|
|
374
|
-
for (const
|
|
375
|
-
if (!
|
|
376
|
-
this.onMutationFailed?.(
|
|
383
|
+
handleResults(e) {
|
|
384
|
+
for (const t of e) {
|
|
385
|
+
if (!t.success) {
|
|
386
|
+
this.onMutationFailed?.(t.name, t.value);
|
|
377
387
|
continue;
|
|
378
388
|
}
|
|
379
|
-
this.get(
|
|
389
|
+
this.get(t.name)?.handleResult(t.value);
|
|
380
390
|
}
|
|
381
391
|
}
|
|
382
|
-
buildOptions(
|
|
392
|
+
buildOptions(e, t) {
|
|
383
393
|
const i = {
|
|
384
|
-
name:
|
|
385
|
-
values:
|
|
386
|
-
onSelect: (
|
|
387
|
-
|
|
394
|
+
name: e.name,
|
|
395
|
+
values: e.values,
|
|
396
|
+
onSelect: (s, o) => {
|
|
397
|
+
t([{ name: s, value: o }], !1);
|
|
388
398
|
}
|
|
389
399
|
};
|
|
390
|
-
return
|
|
400
|
+
return e.defaultValue !== void 0 ? { ...i, defaultValue: e.defaultValue } : i;
|
|
391
401
|
}
|
|
392
402
|
}
|
|
393
|
-
const
|
|
394
|
-
function
|
|
395
|
-
const
|
|
396
|
-
return `${
|
|
403
|
+
const N = 4096, F = 16384, Xe = [1024, 256, 64], Je = 20, W = ["timestamp", "level", "msg", "service", "trace_id", "span_id"];
|
|
404
|
+
function et(n) {
|
|
405
|
+
const e = new Date(n.timestamp).toLocaleTimeString("en-GB", { hour12: !1 }), t = n.level.toUpperCase().padEnd(5), i = n.trace_id?.slice(0, 8) ?? "--------", s = n.msg, o = Object.entries(n).filter(([r]) => !W.includes(r)).map(([r, a]) => `${r}=${L(a, N).line}`).join(" ");
|
|
406
|
+
return `${e} ${t} [${i}] ${s}${o ? " " + o : ""}`;
|
|
397
407
|
}
|
|
398
|
-
function
|
|
399
|
-
for (const
|
|
400
|
-
const { line:
|
|
408
|
+
function tt(n) {
|
|
409
|
+
for (const s of [N, ...Xe]) {
|
|
410
|
+
const { line: o, truncated: r } = L(n, s);
|
|
401
411
|
if (!r) {
|
|
402
|
-
if (
|
|
403
|
-
return
|
|
412
|
+
if (o.length <= F)
|
|
413
|
+
return o;
|
|
404
414
|
continue;
|
|
405
415
|
}
|
|
406
|
-
const { line: a } =
|
|
416
|
+
const { line: a } = L({ ...n, log_truncated: !0 }, s);
|
|
407
417
|
if (a.length <= F)
|
|
408
418
|
return a;
|
|
409
419
|
}
|
|
410
|
-
const
|
|
411
|
-
return i.line.length <= F ? i.line :
|
|
420
|
+
const e = Object.keys(n).filter((s) => !W.includes(s)), t = { ...it(n, W), log_truncated: !0, log_dropped_count: e.length }, i = L({ ...t, log_dropped_attrs: e.slice(0, Je) }, N);
|
|
421
|
+
return i.line.length <= F ? i.line : L(t, N).line;
|
|
412
422
|
}
|
|
413
|
-
function
|
|
414
|
-
const
|
|
423
|
+
function L(n, e) {
|
|
424
|
+
const t = [];
|
|
415
425
|
let i = !1;
|
|
416
426
|
return { line: JSON.stringify(n, function(r, a) {
|
|
417
427
|
if (typeof a == "string")
|
|
418
|
-
return a.length >
|
|
428
|
+
return a.length > e && (i = !0), nt(a, e);
|
|
419
429
|
if (typeof a == "bigint")
|
|
420
430
|
return a.toString();
|
|
421
431
|
if (typeof a != "object" || a === null)
|
|
422
432
|
return a;
|
|
423
|
-
for (;
|
|
424
|
-
|
|
425
|
-
return
|
|
433
|
+
for (; t.length > 0 && t.at(-1) !== this; )
|
|
434
|
+
t.pop();
|
|
435
|
+
return t.includes(a) ? "[Circular]" : (t.push(a), a);
|
|
426
436
|
}), truncated: i };
|
|
427
437
|
}
|
|
428
|
-
function
|
|
429
|
-
return n.length <=
|
|
438
|
+
function nt(n, e) {
|
|
439
|
+
return n.length <= e ? n : `${n.slice(0, e)}...[truncated ${n.length - e} chars]`;
|
|
430
440
|
}
|
|
431
|
-
function
|
|
432
|
-
const
|
|
433
|
-
for (const i of
|
|
434
|
-
n[i] !== void 0 && (
|
|
435
|
-
return
|
|
441
|
+
function it(n, e) {
|
|
442
|
+
const t = {};
|
|
443
|
+
for (const i of e)
|
|
444
|
+
n[i] !== void 0 && (t[i] = n[i]);
|
|
445
|
+
return t;
|
|
436
446
|
}
|
|
437
|
-
function
|
|
438
|
-
const
|
|
439
|
-
n.level === "error" ? console.error(
|
|
447
|
+
function st(n, e) {
|
|
448
|
+
const t = e ? et(n) : tt(n);
|
|
449
|
+
n.level === "error" ? console.error(t) : n.level === "warn" ? console.warn(t) : console.log(t);
|
|
440
450
|
}
|
|
441
|
-
function
|
|
442
|
-
const
|
|
451
|
+
function pe(n, e = 0) {
|
|
452
|
+
const t = {
|
|
443
453
|
name: n.name,
|
|
444
454
|
message: n.message
|
|
445
455
|
};
|
|
446
|
-
n.stack !== void 0 && (
|
|
456
|
+
n.stack !== void 0 && (t.stack = n.stack);
|
|
447
457
|
for (const i of Object.getOwnPropertyNames(n)) {
|
|
448
458
|
if (i === "name" || i === "message" || i === "stack" || i === "cause")
|
|
449
459
|
continue;
|
|
450
|
-
const
|
|
451
|
-
|
|
460
|
+
const s = n[i];
|
|
461
|
+
s !== void 0 && (t[i] = s);
|
|
452
462
|
}
|
|
453
|
-
return n.cause !== void 0 && n.cause !== null && (
|
|
463
|
+
return n.cause !== void 0 && n.cause !== null && (t.cause = n.cause instanceof Error && e < 5 ? pe(n.cause, e + 1) : String(n.cause)), t;
|
|
454
464
|
}
|
|
455
|
-
function
|
|
456
|
-
const
|
|
457
|
-
for (const [
|
|
458
|
-
t
|
|
459
|
-
return
|
|
465
|
+
function ot(n) {
|
|
466
|
+
const e = {};
|
|
467
|
+
for (const [t, i] of Object.entries(n))
|
|
468
|
+
e[t] = i instanceof Error ? pe(i) : i;
|
|
469
|
+
return e;
|
|
460
470
|
}
|
|
461
|
-
function
|
|
471
|
+
function rt() {
|
|
462
472
|
return /* @__PURE__ */ new Date();
|
|
463
473
|
}
|
|
464
|
-
function
|
|
474
|
+
function at(n) {
|
|
465
475
|
return n.toISOString();
|
|
466
476
|
}
|
|
467
|
-
function
|
|
477
|
+
function fe() {
|
|
468
478
|
return typeof navigator > "u" ? "" : navigator.userAgent;
|
|
469
479
|
}
|
|
470
|
-
function
|
|
480
|
+
function lt() {
|
|
471
481
|
return typeof navigator > "u" ? !1 : navigator.platform === "MacIntel" && navigator.maxTouchPoints > 1;
|
|
472
482
|
}
|
|
473
|
-
function
|
|
474
|
-
return /iPhone|iPad|iPod/i.test(
|
|
483
|
+
function ct() {
|
|
484
|
+
return /iPhone|iPad|iPod/i.test(fe()) || lt();
|
|
475
485
|
}
|
|
476
|
-
function
|
|
477
|
-
return /Android/i.test(
|
|
486
|
+
function dt() {
|
|
487
|
+
return /Android/i.test(fe());
|
|
478
488
|
}
|
|
479
|
-
function
|
|
480
|
-
return
|
|
489
|
+
function ut() {
|
|
490
|
+
return ct() || dt();
|
|
481
491
|
}
|
|
482
|
-
class
|
|
483
|
-
constructor(
|
|
484
|
-
this.config =
|
|
492
|
+
class ht {
|
|
493
|
+
constructor(e) {
|
|
494
|
+
this.config = e;
|
|
485
495
|
}
|
|
486
496
|
config;
|
|
487
497
|
/**
|
|
488
498
|
* Log at specified level with optional attributes.
|
|
489
499
|
*/
|
|
490
|
-
log(
|
|
491
|
-
const
|
|
492
|
-
timestamp:
|
|
493
|
-
level:
|
|
494
|
-
msg:
|
|
500
|
+
log(e, t, i = {}) {
|
|
501
|
+
const s = this.config.traceProvider?.() ?? {}, o = {
|
|
502
|
+
timestamp: at(rt()),
|
|
503
|
+
level: e,
|
|
504
|
+
msg: t,
|
|
495
505
|
service: this.config.service,
|
|
496
|
-
...
|
|
497
|
-
...
|
|
506
|
+
...s,
|
|
507
|
+
...ot(i)
|
|
498
508
|
};
|
|
499
|
-
|
|
509
|
+
st(o, this.config.isDev);
|
|
500
510
|
}
|
|
501
511
|
/**
|
|
502
512
|
* Log at DEBUG level (development only).
|
|
503
513
|
*/
|
|
504
|
-
debug(
|
|
505
|
-
this.config.isDev && this.log("debug",
|
|
514
|
+
debug(e, t) {
|
|
515
|
+
this.config.isDev && this.log("debug", e, t);
|
|
506
516
|
}
|
|
507
517
|
/**
|
|
508
518
|
* Log at INFO level.
|
|
509
519
|
*/
|
|
510
|
-
info(
|
|
511
|
-
this.log("info",
|
|
520
|
+
info(e, t) {
|
|
521
|
+
this.log("info", e, t);
|
|
512
522
|
}
|
|
513
523
|
/**
|
|
514
524
|
* Log at WARN level.
|
|
515
525
|
*/
|
|
516
|
-
warn(
|
|
517
|
-
this.log("warn",
|
|
526
|
+
warn(e, t) {
|
|
527
|
+
this.log("warn", e, t);
|
|
518
528
|
}
|
|
519
529
|
/**
|
|
520
530
|
* Log at ERROR level.
|
|
521
531
|
*/
|
|
522
|
-
error(
|
|
523
|
-
this.log("error",
|
|
532
|
+
error(e, t) {
|
|
533
|
+
this.log("error", e, t);
|
|
524
534
|
}
|
|
525
535
|
}
|
|
526
|
-
function
|
|
527
|
-
const
|
|
528
|
-
return new
|
|
536
|
+
function ge(n, e) {
|
|
537
|
+
const t = e?.isDev !== void 0 ? e.isDev : typeof process < "u" ? process.env.NODE_ENV !== "production" : !0;
|
|
538
|
+
return new ht({ service: n, isDev: t, traceProvider: e?.traceProvider });
|
|
529
539
|
}
|
|
530
|
-
function
|
|
540
|
+
function O(n) {
|
|
531
541
|
if (n !== void 0)
|
|
532
542
|
return typeof n == "object" && n !== null && !Array.isArray(n) && !(n instanceof Error) ? n : n instanceof Error ? { error: n.message } : { value: n };
|
|
533
543
|
}
|
|
534
|
-
function
|
|
544
|
+
function be(n) {
|
|
535
545
|
return {
|
|
536
|
-
debug: (
|
|
537
|
-
info: (
|
|
538
|
-
warn: (
|
|
539
|
-
error: (
|
|
546
|
+
debug: (e, t) => n.debug(e, O(t)),
|
|
547
|
+
info: (e, t) => n.info(e, O(t)),
|
|
548
|
+
warn: (e, t) => n.warn(e, O(t)),
|
|
549
|
+
error: (e, t) => n.error(e, O(t))
|
|
540
550
|
};
|
|
541
551
|
}
|
|
542
|
-
let
|
|
543
|
-
function
|
|
544
|
-
|
|
552
|
+
let ve = !1, C = be(ge("client", { isDev: !1 }));
|
|
553
|
+
function mt() {
|
|
554
|
+
ve = !0, C = be(ge("client", { isDev: !0 }));
|
|
545
555
|
}
|
|
546
|
-
function
|
|
547
|
-
return
|
|
556
|
+
function vs() {
|
|
557
|
+
return ve;
|
|
548
558
|
}
|
|
549
|
-
class
|
|
550
|
-
constructor(
|
|
551
|
-
this.send =
|
|
559
|
+
class pt {
|
|
560
|
+
constructor(e, t) {
|
|
561
|
+
this.send = e, this.onMutationFailed = t;
|
|
552
562
|
}
|
|
553
563
|
send;
|
|
554
564
|
onMutationFailed;
|
|
@@ -557,50 +567,61 @@ class de {
|
|
|
557
567
|
/**
|
|
558
568
|
* Handle incoming MAPPING message from server
|
|
559
569
|
*/
|
|
560
|
-
handleMappingReceived(
|
|
561
|
-
|
|
562
|
-
attributeCount:
|
|
563
|
-
}), this.registry = new
|
|
564
|
-
|
|
565
|
-
(
|
|
570
|
+
handleMappingReceived(e) {
|
|
571
|
+
C.debug("Initializing from server mapping", {
|
|
572
|
+
attributeCount: e.attributes.length
|
|
573
|
+
}), this.registry = new Ke(
|
|
574
|
+
e.attributes,
|
|
575
|
+
(t, i) => this.sendMutation(t, i),
|
|
566
576
|
this.onMutationFailed
|
|
567
577
|
), this.replayPendingCallbacks();
|
|
568
578
|
}
|
|
569
|
-
handleMutationResult(
|
|
570
|
-
this.registry?.handleResults(
|
|
579
|
+
handleMutationResult(e) {
|
|
580
|
+
this.registry?.handleResults(e.results);
|
|
571
581
|
}
|
|
572
582
|
/**
|
|
573
583
|
* Select a value for an attribute - sends mutation to server.
|
|
574
584
|
* Can be called before the mapping arrives — the mutation is sent immediately
|
|
575
585
|
* and the messenger's publisher queue holds it until the iframe is ready.
|
|
576
586
|
*/
|
|
577
|
-
select(
|
|
578
|
-
this.sendMutation([{ name:
|
|
587
|
+
select(e, t) {
|
|
588
|
+
this.sendMutation([{ name: e, value: t }], !1);
|
|
579
589
|
}
|
|
580
|
-
|
|
581
|
-
|
|
590
|
+
/**
|
|
591
|
+
* A drag's intermediate step (parametric dimensions): the viewer applies it
|
|
592
|
+
* so the model follows the hand, but it is never recorded as a choice; the
|
|
593
|
+
* settling `select()` is the one tracked value. Used by the measurement
|
|
594
|
+
* slider per step crossed. Deliberately not delegated on the public client:
|
|
595
|
+
* `select()` staying the whole choice API is the spec's own evidence the
|
|
596
|
+
* shape is right, and no integrator has asked for live-follow yet.
|
|
597
|
+
*/
|
|
598
|
+
selectTransient(e, t) {
|
|
599
|
+
this.sendMutation([{ name: e, value: t }], !1, !0);
|
|
582
600
|
}
|
|
583
|
-
|
|
584
|
-
return this.registry?.get(
|
|
601
|
+
getValues(e) {
|
|
602
|
+
return this.registry?.get(e)?.getValues() ?? [];
|
|
603
|
+
}
|
|
604
|
+
getValue(e, t) {
|
|
605
|
+
return this.registry?.get(e)?.getValue(t);
|
|
585
606
|
}
|
|
586
607
|
/**
|
|
587
608
|
* Register onChange callback for an attribute.
|
|
588
609
|
* Buffers the callback if the mapping hasn't arrived yet.
|
|
589
610
|
*/
|
|
590
|
-
onChange(
|
|
611
|
+
onChange(e, t) {
|
|
591
612
|
if (this.registry === void 0) {
|
|
592
|
-
this.pendingCallbacks.push({ name:
|
|
613
|
+
this.pendingCallbacks.push({ name: e, callback: t });
|
|
593
614
|
return;
|
|
594
615
|
}
|
|
595
|
-
const i = this.registry.get(
|
|
616
|
+
const i = this.registry.get(e);
|
|
596
617
|
if (i === void 0) {
|
|
597
|
-
|
|
618
|
+
C.warn(`onChange: attribute "${e}" not found — callback will not fire`);
|
|
598
619
|
return;
|
|
599
620
|
}
|
|
600
|
-
i.onChange(
|
|
621
|
+
i.onChange(t);
|
|
601
622
|
}
|
|
602
|
-
getAttribute(
|
|
603
|
-
return this.registry?.get(
|
|
623
|
+
getAttribute(e) {
|
|
624
|
+
return this.registry?.get(e);
|
|
604
625
|
}
|
|
605
626
|
/** The current selection as attribute name→value pairs, empty before the mapping arrives. */
|
|
606
627
|
getSelection() {
|
|
@@ -609,25 +630,46 @@ class de {
|
|
|
609
630
|
get hasMapping() {
|
|
610
631
|
return this.registry !== void 0;
|
|
611
632
|
}
|
|
612
|
-
sendMutation(t,
|
|
613
|
-
const
|
|
633
|
+
sendMutation(e, t, i = !1) {
|
|
634
|
+
const s = {
|
|
614
635
|
type: c.MUTATION,
|
|
615
|
-
mutations:
|
|
616
|
-
isInitial:
|
|
636
|
+
mutations: e,
|
|
637
|
+
isInitial: t,
|
|
638
|
+
...i && { transient: !0 }
|
|
617
639
|
};
|
|
618
|
-
this.send(
|
|
640
|
+
this.send(s);
|
|
619
641
|
}
|
|
620
642
|
replayPendingCallbacks() {
|
|
621
|
-
for (const { name:
|
|
622
|
-
const i = this.registry?.get(
|
|
623
|
-
i === void 0 &&
|
|
643
|
+
for (const { name: e, callback: t } of this.pendingCallbacks) {
|
|
644
|
+
const i = this.registry?.get(e);
|
|
645
|
+
i === void 0 && C.warn(`onChange: attribute "${e}" not found — buffered callback will not fire`), i?.onChange(t);
|
|
624
646
|
}
|
|
625
647
|
this.pendingCallbacks.length = 0;
|
|
626
648
|
}
|
|
627
649
|
}
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
650
|
+
class ft {
|
|
651
|
+
snapshot;
|
|
652
|
+
callbacks = [];
|
|
653
|
+
handleSnapshot(e) {
|
|
654
|
+
this.snapshot = e.attributes;
|
|
655
|
+
for (const t of this.callbacks)
|
|
656
|
+
t(e.attributes);
|
|
657
|
+
}
|
|
658
|
+
onChange(e) {
|
|
659
|
+
this.callbacks.push(e), this.snapshot !== void 0 && e(this.snapshot);
|
|
660
|
+
}
|
|
661
|
+
/** The selectable values for one attribute, or null when unrestricted. */
|
|
662
|
+
selectableFor(e) {
|
|
663
|
+
return this.snapshot?.find((i) => i.name === e)?.selectable ?? null;
|
|
664
|
+
}
|
|
665
|
+
/** The latest snapshot; empty before the viewer has reported anything. */
|
|
666
|
+
get current() {
|
|
667
|
+
return this.snapshot ?? [];
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
let gt = class {
|
|
671
|
+
constructor(e) {
|
|
672
|
+
this.send = e;
|
|
631
673
|
}
|
|
632
674
|
send;
|
|
633
675
|
commands = [];
|
|
@@ -636,24 +678,24 @@ let ue = class {
|
|
|
636
678
|
* @param degrees - Absolute rotation in degrees (0 = front view)
|
|
637
679
|
* @throws VirtualdisplayError if value is not a finite number
|
|
638
680
|
*/
|
|
639
|
-
rotate(
|
|
640
|
-
return this.validateFiniteNumber(
|
|
681
|
+
rotate(e) {
|
|
682
|
+
return this.validateFiniteNumber(e, "rotate"), this.commands.push({ action: "rotate", value: e }), this;
|
|
641
683
|
}
|
|
642
684
|
/**
|
|
643
685
|
* Tilt camera vertically
|
|
644
686
|
* @param degrees - Absolute tilt in degrees (0 = top view, 90 = horizontal)
|
|
645
687
|
* @throws VirtualdisplayError if value is not a finite number
|
|
646
688
|
*/
|
|
647
|
-
tilt(
|
|
648
|
-
return this.validateFiniteNumber(
|
|
689
|
+
tilt(e) {
|
|
690
|
+
return this.validateFiniteNumber(e, "tilt"), this.commands.push({ action: "tilt", value: e }), this;
|
|
649
691
|
}
|
|
650
692
|
/**
|
|
651
693
|
* Zoom camera
|
|
652
694
|
* @param percentage - Zoom percentage (100 = normal, >100 = zoom in, <100 = zoom out)
|
|
653
695
|
* @throws VirtualdisplayError if value is not a finite number
|
|
654
696
|
*/
|
|
655
|
-
zoom(
|
|
656
|
-
return this.validateFiniteNumber(
|
|
697
|
+
zoom(e) {
|
|
698
|
+
return this.validateFiniteNumber(e, "zoom"), this.commands.push({ action: "zoom", value: e }), this;
|
|
657
699
|
}
|
|
658
700
|
/**
|
|
659
701
|
* Execute accumulated camera commands
|
|
@@ -661,19 +703,19 @@ let ue = class {
|
|
|
661
703
|
*/
|
|
662
704
|
set() {
|
|
663
705
|
if (this.commands.length === 0)
|
|
664
|
-
throw
|
|
706
|
+
throw g.invalidParameter(
|
|
665
707
|
"No camera commands to execute. Call rotate(), tilt(), or zoom() before set()."
|
|
666
708
|
);
|
|
667
|
-
const
|
|
709
|
+
const e = {
|
|
668
710
|
type: c.CAMERA,
|
|
669
711
|
commands: this.commands
|
|
670
712
|
};
|
|
671
|
-
this.send(
|
|
713
|
+
this.send(e), this.commands = [];
|
|
672
714
|
}
|
|
673
|
-
validateFiniteNumber(
|
|
674
|
-
if (!Number.isFinite(
|
|
675
|
-
throw
|
|
676
|
-
`${
|
|
715
|
+
validateFiniteNumber(e, t) {
|
|
716
|
+
if (!Number.isFinite(e))
|
|
717
|
+
throw g.invalidParameter(
|
|
718
|
+
`${t}() requires a finite number, got ${String(e)}`
|
|
677
719
|
);
|
|
678
720
|
}
|
|
679
721
|
/**
|
|
@@ -681,14 +723,14 @@ let ue = class {
|
|
|
681
723
|
* This is not chainable and executes immediately
|
|
682
724
|
*/
|
|
683
725
|
reset() {
|
|
684
|
-
const
|
|
726
|
+
const e = {
|
|
685
727
|
type: c.CAMERA,
|
|
686
728
|
commands: [{ action: "reset" }]
|
|
687
729
|
};
|
|
688
|
-
this.send(
|
|
730
|
+
this.send(e);
|
|
689
731
|
}
|
|
690
732
|
};
|
|
691
|
-
class
|
|
733
|
+
class bt {
|
|
692
734
|
state;
|
|
693
735
|
limitsState;
|
|
694
736
|
changeCallbacks = [];
|
|
@@ -722,8 +764,8 @@ class he {
|
|
|
722
764
|
* Also fires when limits are applied via applyLimits() so components
|
|
723
765
|
* can re-evaluate disabled states without a separate callback.
|
|
724
766
|
*/
|
|
725
|
-
onChange(
|
|
726
|
-
this.changeCallbacks.push(
|
|
767
|
+
onChange(e) {
|
|
768
|
+
this.changeCallbacks.push(e);
|
|
727
769
|
}
|
|
728
770
|
/**
|
|
729
771
|
* Current camera movement limits (set from CONFIG message).
|
|
@@ -736,62 +778,62 @@ class he {
|
|
|
736
778
|
* Apply camera limits received from the server CONFIG message.
|
|
737
779
|
* Fires onChange callbacks so button disabled states update immediately.
|
|
738
780
|
*/
|
|
739
|
-
applyLimits(
|
|
740
|
-
this.limitsState =
|
|
741
|
-
const
|
|
781
|
+
applyLimits(e) {
|
|
782
|
+
this.limitsState = e;
|
|
783
|
+
const t = { rotation: this.rotation, tilt: this.tilt, zoom: this.zoom };
|
|
742
784
|
for (const i of this.changeCallbacks)
|
|
743
|
-
i(
|
|
785
|
+
i(t);
|
|
744
786
|
}
|
|
745
787
|
/**
|
|
746
788
|
* Handle incoming camera position message from server
|
|
747
789
|
*/
|
|
748
|
-
handlePositionUpdate(
|
|
749
|
-
this.update(
|
|
790
|
+
handlePositionUpdate(e) {
|
|
791
|
+
this.update(e.transforms);
|
|
750
792
|
}
|
|
751
793
|
/**
|
|
752
794
|
* Update camera position from server transforms
|
|
753
795
|
*/
|
|
754
|
-
update(
|
|
755
|
-
let
|
|
756
|
-
for (const i of
|
|
796
|
+
update(e) {
|
|
797
|
+
let t = !1;
|
|
798
|
+
for (const i of e)
|
|
757
799
|
switch (i.type) {
|
|
758
800
|
case "rotation":
|
|
759
|
-
this.state.rotation = i.value,
|
|
801
|
+
this.state.rotation = i.value, t = !0;
|
|
760
802
|
break;
|
|
761
803
|
case "tilt":
|
|
762
|
-
this.state.tilt = i.value,
|
|
804
|
+
this.state.tilt = i.value, t = !0;
|
|
763
805
|
break;
|
|
764
806
|
case "zoom":
|
|
765
|
-
this.state.zoom = i.value,
|
|
807
|
+
this.state.zoom = i.value, t = !0;
|
|
766
808
|
break;
|
|
767
809
|
}
|
|
768
|
-
if (
|
|
810
|
+
if (t) {
|
|
769
811
|
const i = {
|
|
770
812
|
rotation: this.rotation,
|
|
771
813
|
tilt: this.tilt,
|
|
772
814
|
zoom: this.zoom
|
|
773
815
|
};
|
|
774
|
-
for (const
|
|
775
|
-
|
|
816
|
+
for (const s of this.changeCallbacks)
|
|
817
|
+
s(i);
|
|
776
818
|
}
|
|
777
819
|
}
|
|
778
820
|
}
|
|
779
|
-
function
|
|
780
|
-
const
|
|
781
|
-
if (
|
|
821
|
+
function vt(n, e) {
|
|
822
|
+
const t = n.filter((o) => yt(o, e));
|
|
823
|
+
if (t.length === 0)
|
|
782
824
|
return;
|
|
783
|
-
const i = Math.max(...
|
|
784
|
-
return
|
|
825
|
+
const i = Math.max(...t.map(ne)), s = t.filter((o) => ne(o) === i);
|
|
826
|
+
return s.length === 1 ? s[0] : void 0;
|
|
785
827
|
}
|
|
786
|
-
function
|
|
787
|
-
return Object.entries(n.attributes).every(([
|
|
828
|
+
function yt(n, e) {
|
|
829
|
+
return Object.entries(n.attributes).every(([t, i]) => e[t] === i);
|
|
788
830
|
}
|
|
789
|
-
function
|
|
831
|
+
function ne(n) {
|
|
790
832
|
return Object.keys(n.attributes).length;
|
|
791
833
|
}
|
|
792
|
-
class
|
|
793
|
-
constructor(
|
|
794
|
-
this.dispatchChange =
|
|
834
|
+
class St {
|
|
835
|
+
constructor(e, t) {
|
|
836
|
+
this.dispatchChange = e, this.dispatchSubmit = t;
|
|
795
837
|
}
|
|
796
838
|
dispatchChange;
|
|
797
839
|
dispatchSubmit;
|
|
@@ -816,9 +858,9 @@ class fe {
|
|
|
816
858
|
* it says, so the CTA does not render.
|
|
817
859
|
*/
|
|
818
860
|
get buttonLabel() {
|
|
819
|
-
const
|
|
820
|
-
if (
|
|
821
|
-
return
|
|
861
|
+
const e = this.pricing?.buttonLabel;
|
|
862
|
+
if (e != null && e !== "")
|
|
863
|
+
return e;
|
|
822
864
|
if (this.submitDefaultLabel !== void 0 && this.submitDefaultLabel !== "")
|
|
823
865
|
return this.submitDefaultLabel;
|
|
824
866
|
}
|
|
@@ -843,16 +885,16 @@ class fe {
|
|
|
843
885
|
* Subscribe to configuration changes. Fires after every selection change with
|
|
844
886
|
* the resolved configuration, including undefined when nothing matches.
|
|
845
887
|
*/
|
|
846
|
-
onChange(
|
|
847
|
-
this.changeCallbacks.push(
|
|
888
|
+
onChange(e) {
|
|
889
|
+
this.changeCallbacks.push(e);
|
|
848
890
|
}
|
|
849
891
|
/**
|
|
850
892
|
* Register the submit handler the CTA hands the configuration to. Registering
|
|
851
893
|
* one is what switches the button on (capability driven). `defaultLabel` fills
|
|
852
894
|
* in when the customer authored no button label.
|
|
853
895
|
*/
|
|
854
|
-
onSubmit(
|
|
855
|
-
this.submitCallback =
|
|
896
|
+
onSubmit(e, t) {
|
|
897
|
+
this.submitCallback = e, this.submitDefaultLabel = t?.defaultLabel, this.notifyRender();
|
|
856
898
|
}
|
|
857
899
|
/**
|
|
858
900
|
* Subscribe the built-in UI to re-render the price + CTA. Fires on every
|
|
@@ -860,10 +902,10 @@ class fe {
|
|
|
860
902
|
* on without a configuration change). Separate from `onChange`, which stays the
|
|
861
903
|
* host-facing, mutation-driven contract. Returns a disposer.
|
|
862
904
|
*/
|
|
863
|
-
onRender(
|
|
864
|
-
return this.renderCallbacks.push(
|
|
865
|
-
const
|
|
866
|
-
|
|
905
|
+
onRender(e) {
|
|
906
|
+
return this.renderCallbacks.push(e), () => {
|
|
907
|
+
const t = this.renderCallbacks.indexOf(e);
|
|
908
|
+
t !== -1 && this.renderCallbacks.splice(t, 1);
|
|
867
909
|
};
|
|
868
910
|
}
|
|
869
911
|
/**
|
|
@@ -875,44 +917,44 @@ class fe {
|
|
|
875
917
|
async submit() {
|
|
876
918
|
if (!this.submittable)
|
|
877
919
|
return;
|
|
878
|
-
const
|
|
879
|
-
this.dispatchSubmit(
|
|
920
|
+
const e = this.resolved !== void 0 ? { attributes: this.resolved.attributes, reference: this.resolved.reference } : { attributes: { ...this.selection }, reference: "" };
|
|
921
|
+
this.dispatchSubmit(e), await this.submitCallback?.(e);
|
|
880
922
|
}
|
|
881
923
|
/** Called by the client when a PRICING message arrives from the viewer. */
|
|
882
|
-
handlePricingReceived(
|
|
883
|
-
this.pricing =
|
|
924
|
+
handlePricingReceived(e) {
|
|
925
|
+
this.pricing = e, this.recompute();
|
|
884
926
|
}
|
|
885
927
|
/** Called by the client after every mutation result, with the full selection. */
|
|
886
|
-
handleSelectionChanged(
|
|
887
|
-
this.selection =
|
|
928
|
+
handleSelectionChanged(e) {
|
|
929
|
+
this.selection = e, this.recompute();
|
|
888
930
|
}
|
|
889
931
|
recompute() {
|
|
890
932
|
this.resolved = this.resolve();
|
|
891
|
-
for (const
|
|
892
|
-
|
|
933
|
+
for (const e of this.changeCallbacks)
|
|
934
|
+
e(this.resolved);
|
|
893
935
|
this.dispatchChange(this.resolved), this.notifyRender();
|
|
894
936
|
}
|
|
895
937
|
notifyRender() {
|
|
896
|
-
for (const
|
|
897
|
-
|
|
938
|
+
for (const e of this.renderCallbacks)
|
|
939
|
+
e();
|
|
898
940
|
}
|
|
899
941
|
resolve() {
|
|
900
942
|
if (this.pricing === void 0)
|
|
901
943
|
return;
|
|
902
|
-
const
|
|
903
|
-
if (!(
|
|
944
|
+
const e = vt(this.pricing.rules, this.selection);
|
|
945
|
+
if (!(e === void 0 || e.availability === Le.HIDDEN))
|
|
904
946
|
return {
|
|
905
947
|
attributes: { ...this.selection },
|
|
906
|
-
reference:
|
|
907
|
-
price:
|
|
948
|
+
reference: e.reference,
|
|
949
|
+
price: e.priceCents,
|
|
908
950
|
currency: this.pricing.currency,
|
|
909
|
-
availability:
|
|
951
|
+
availability: e.availability
|
|
910
952
|
};
|
|
911
953
|
}
|
|
912
954
|
}
|
|
913
|
-
class
|
|
914
|
-
constructor(
|
|
915
|
-
this.send =
|
|
955
|
+
class wt {
|
|
956
|
+
constructor(e, t) {
|
|
957
|
+
this.send = e, this.dispatch = t;
|
|
916
958
|
}
|
|
917
959
|
send;
|
|
918
960
|
dispatch;
|
|
@@ -927,36 +969,36 @@ class ge {
|
|
|
927
969
|
* Focus a component by name. Sends a focus message to the viewer.
|
|
928
970
|
* @throws VirtualdisplayError if component is not a non-empty string
|
|
929
971
|
*/
|
|
930
|
-
set(
|
|
931
|
-
if (typeof
|
|
932
|
-
throw
|
|
933
|
-
`set() requires a non-empty component name, got ${String(
|
|
972
|
+
set(e) {
|
|
973
|
+
if (typeof e != "string" || e.length === 0)
|
|
974
|
+
throw g.invalidParameter(
|
|
975
|
+
`set() requires a non-empty component name, got ${String(e)}`
|
|
934
976
|
);
|
|
935
|
-
this.send({ type: c.FOCUS, action:
|
|
977
|
+
this.send({ type: c.FOCUS, action: ee.FOCUS, component: e });
|
|
936
978
|
}
|
|
937
979
|
/** Return to the overview — unfocus the current component. */
|
|
938
980
|
clear() {
|
|
939
|
-
this.send({ type: c.FOCUS, action:
|
|
981
|
+
this.send({ type: c.FOCUS, action: ee.UNFOCUS });
|
|
940
982
|
}
|
|
941
983
|
/**
|
|
942
984
|
* Subscribe to focus changes. The callback fires with the focus state when a
|
|
943
985
|
* component is focused, and with null when returning to overview.
|
|
944
986
|
*/
|
|
945
|
-
onChange(
|
|
946
|
-
this.changeCallbacks.push(
|
|
987
|
+
onChange(e) {
|
|
988
|
+
this.changeCallbacks.push(e);
|
|
947
989
|
}
|
|
948
990
|
/** Called by the client when a FocusStateMessage is received from the viewer. */
|
|
949
|
-
handleStateReceived(
|
|
950
|
-
|
|
951
|
-
const
|
|
991
|
+
handleStateReceived(e) {
|
|
992
|
+
e.state === Ie.FOCUSED && e.component !== void 0 ? (this.focused = e.component, this.attributes = e.attributes ?? []) : (this.focused = null, this.attributes = []);
|
|
993
|
+
const t = this.focused !== null ? { component: this.focused, attributes: this.attributes } : null;
|
|
952
994
|
for (const i of this.changeCallbacks)
|
|
953
|
-
i(
|
|
954
|
-
this.dispatch(
|
|
995
|
+
i(t);
|
|
996
|
+
this.dispatch(t);
|
|
955
997
|
}
|
|
956
998
|
}
|
|
957
|
-
class
|
|
958
|
-
constructor(
|
|
959
|
-
this.filename =
|
|
999
|
+
class Ct {
|
|
1000
|
+
constructor(e) {
|
|
1001
|
+
this.filename = e;
|
|
960
1002
|
}
|
|
961
1003
|
filename;
|
|
962
1004
|
developedCallbacks = /* @__PURE__ */ new Set();
|
|
@@ -971,8 +1013,8 @@ class be {
|
|
|
971
1013
|
* @param callback Function to call with photo data
|
|
972
1014
|
* @returns This Photo instance for chaining
|
|
973
1015
|
*/
|
|
974
|
-
onDeveloped(
|
|
975
|
-
return this.developed && this.photoData !== null ? (
|
|
1016
|
+
onDeveloped(e) {
|
|
1017
|
+
return this.developed && this.photoData !== null ? (e(this.photoData), this) : (this.developedCallbacks.add(e), this);
|
|
976
1018
|
}
|
|
977
1019
|
/**
|
|
978
1020
|
* Register a callback for when the photo capture fails
|
|
@@ -980,8 +1022,8 @@ class be {
|
|
|
980
1022
|
* @param callback Function to call with error
|
|
981
1023
|
* @returns This Photo instance for chaining
|
|
982
1024
|
*/
|
|
983
|
-
onError(
|
|
984
|
-
return this.errorCallbacks.add(
|
|
1025
|
+
onError(e) {
|
|
1026
|
+
return this.errorCallbacks.add(e), this;
|
|
985
1027
|
}
|
|
986
1028
|
/**
|
|
987
1029
|
* Get the filename for this photo
|
|
@@ -993,24 +1035,24 @@ class be {
|
|
|
993
1035
|
* Mark the photo as developed and notify all callbacks
|
|
994
1036
|
* This method is called by Snapshot when the photo data arrives from the server
|
|
995
1037
|
*/
|
|
996
|
-
develop(
|
|
997
|
-
this.developed || this.failed || (this.photoData =
|
|
998
|
-
|
|
1038
|
+
develop(e) {
|
|
1039
|
+
this.developed || this.failed || (this.photoData = e, this.developed = !0, this.developedCallbacks.forEach((t) => {
|
|
1040
|
+
t(this.photoData);
|
|
999
1041
|
}), this.developedCallbacks.clear(), this.errorCallbacks.clear());
|
|
1000
1042
|
}
|
|
1001
1043
|
/**
|
|
1002
1044
|
* Mark the photo as failed and notify error callbacks
|
|
1003
1045
|
*/
|
|
1004
|
-
fail(
|
|
1005
|
-
this.developed || this.failed || (this.failed = !0, this.errorCallbacks.forEach((
|
|
1006
|
-
e
|
|
1046
|
+
fail(e) {
|
|
1047
|
+
this.developed || this.failed || (this.failed = !0, this.errorCallbacks.forEach((t) => {
|
|
1048
|
+
t(e);
|
|
1007
1049
|
}), this.developedCallbacks.clear(), this.errorCallbacks.clear());
|
|
1008
1050
|
}
|
|
1009
1051
|
}
|
|
1010
|
-
const
|
|
1011
|
-
class
|
|
1012
|
-
constructor(
|
|
1013
|
-
this.send =
|
|
1052
|
+
const ie = 3e4;
|
|
1053
|
+
class _t {
|
|
1054
|
+
constructor(e) {
|
|
1055
|
+
this.send = e;
|
|
1014
1056
|
}
|
|
1015
1057
|
send;
|
|
1016
1058
|
validExtensions = [".png"];
|
|
@@ -1022,39 +1064,39 @@ class ve {
|
|
|
1022
1064
|
* @returns Photo object for registering callbacks
|
|
1023
1065
|
* @throws VirtualdisplayError if filename is invalid
|
|
1024
1066
|
*/
|
|
1025
|
-
take(
|
|
1026
|
-
this.validateFilename(
|
|
1027
|
-
const
|
|
1028
|
-
this.pendingPhotos.delete(
|
|
1029
|
-
`Snapshot timed out: the viewer did not respond within ${
|
|
1067
|
+
take(e) {
|
|
1068
|
+
this.validateFilename(e), C.debug("Taking snapshot", { filename: e });
|
|
1069
|
+
const t = new Ct(e), i = setTimeout(() => {
|
|
1070
|
+
this.pendingPhotos.delete(e), C.warn("Snapshot timed out", { filename: e }), t.fail(new g(
|
|
1071
|
+
`Snapshot timed out: the viewer did not respond within ${ie}ms`,
|
|
1030
1072
|
A.SNAPSHOT_FAILED
|
|
1031
1073
|
));
|
|
1032
|
-
},
|
|
1033
|
-
return this.pendingPhotos.set(
|
|
1074
|
+
}, ie);
|
|
1075
|
+
return this.pendingPhotos.set(e, { photo: t, timeout: i }), this.send({
|
|
1034
1076
|
type: c.SNAPSHOT,
|
|
1035
|
-
filename:
|
|
1036
|
-
}),
|
|
1077
|
+
filename: e
|
|
1078
|
+
}), t;
|
|
1037
1079
|
}
|
|
1038
1080
|
/**
|
|
1039
1081
|
* Handle incoming snapshot result from server
|
|
1040
1082
|
* Matches the message to a pending photo by filename, then develops or fails it
|
|
1041
1083
|
*/
|
|
1042
|
-
handleSnapshotResult(
|
|
1043
|
-
const
|
|
1044
|
-
if (
|
|
1045
|
-
|
|
1046
|
-
filename:
|
|
1084
|
+
handleSnapshotResult(e) {
|
|
1085
|
+
const t = this.pendingPhotos.get(e.filename);
|
|
1086
|
+
if (t === void 0) {
|
|
1087
|
+
C.warn("No pending photo found for filename", {
|
|
1088
|
+
filename: e.filename,
|
|
1047
1089
|
pendingFilenames: Array.from(this.pendingPhotos.keys())
|
|
1048
1090
|
});
|
|
1049
1091
|
return;
|
|
1050
1092
|
}
|
|
1051
|
-
clearTimeout(
|
|
1052
|
-
const { photo: i } =
|
|
1053
|
-
if (
|
|
1054
|
-
i.fail(new
|
|
1093
|
+
clearTimeout(t.timeout), this.pendingPhotos.delete(e.filename);
|
|
1094
|
+
const { photo: i } = t;
|
|
1095
|
+
if (e.error !== void 0) {
|
|
1096
|
+
i.fail(new g(e.error, A.SNAPSHOT_FAILED));
|
|
1055
1097
|
return;
|
|
1056
1098
|
}
|
|
1057
|
-
|
|
1099
|
+
e.data !== void 0 && i.develop({ filename: e.filename, data: e.data });
|
|
1058
1100
|
}
|
|
1059
1101
|
/**
|
|
1060
1102
|
* Fail any pending photos and forget them. Called from client destroy
|
|
@@ -1064,688 +1106,688 @@ class ve {
|
|
|
1064
1106
|
clear() {
|
|
1065
1107
|
if (this.pendingPhotos.size === 0)
|
|
1066
1108
|
return;
|
|
1067
|
-
const
|
|
1109
|
+
const e = new g(
|
|
1068
1110
|
"Client destroyed before snapshot completed",
|
|
1069
1111
|
A.SNAPSHOT_FAILED
|
|
1070
1112
|
);
|
|
1071
|
-
for (const { photo:
|
|
1072
|
-
clearTimeout(i),
|
|
1113
|
+
for (const { photo: t, timeout: i } of this.pendingPhotos.values())
|
|
1114
|
+
clearTimeout(i), t.fail(e);
|
|
1073
1115
|
this.pendingPhotos.clear();
|
|
1074
1116
|
}
|
|
1075
1117
|
/**
|
|
1076
1118
|
* Validate filename has a valid image extension
|
|
1077
1119
|
*/
|
|
1078
|
-
validateFilename(
|
|
1079
|
-
if (
|
|
1080
|
-
throw new
|
|
1120
|
+
validateFilename(e) {
|
|
1121
|
+
if (e === "" || typeof e != "string")
|
|
1122
|
+
throw new g(
|
|
1081
1123
|
"Filename must be a non-empty string",
|
|
1082
1124
|
A.INVALID_PARAMETER
|
|
1083
1125
|
);
|
|
1084
1126
|
if (!this.validExtensions.some(
|
|
1085
|
-
(i) =>
|
|
1127
|
+
(i) => e.toLowerCase().endsWith(i)
|
|
1086
1128
|
))
|
|
1087
|
-
throw new
|
|
1088
|
-
`Invalid filename: "${
|
|
1129
|
+
throw new g(
|
|
1130
|
+
`Invalid filename: "${e}". Filename must end with one of: ${this.validExtensions.join(", ")}`,
|
|
1089
1131
|
A.INVALID_PARAMETER
|
|
1090
1132
|
);
|
|
1091
|
-
if (
|
|
1092
|
-
throw new
|
|
1133
|
+
if (e.includes("..") || e.includes("/") || e.includes("\\"))
|
|
1134
|
+
throw new g(
|
|
1093
1135
|
'Filename cannot contain path separators or ".."',
|
|
1094
1136
|
A.INVALID_PARAMETER
|
|
1095
1137
|
);
|
|
1096
1138
|
}
|
|
1097
1139
|
}
|
|
1098
|
-
class
|
|
1140
|
+
class kt {
|
|
1099
1141
|
container = null;
|
|
1100
|
-
attach(
|
|
1101
|
-
this.container =
|
|
1142
|
+
attach(e) {
|
|
1143
|
+
this.container = e;
|
|
1102
1144
|
}
|
|
1103
|
-
dispatch(
|
|
1104
|
-
const
|
|
1105
|
-
return this.container?.dispatchEvent(
|
|
1145
|
+
dispatch(e, t, i = !1) {
|
|
1146
|
+
const s = new CustomEvent(e, { detail: t, cancelable: i });
|
|
1147
|
+
return this.container?.dispatchEvent(s), s;
|
|
1106
1148
|
}
|
|
1107
|
-
on(
|
|
1108
|
-
const i = (
|
|
1109
|
-
const
|
|
1110
|
-
|
|
1149
|
+
on(e, t) {
|
|
1150
|
+
const i = (s) => {
|
|
1151
|
+
const o = s, r = { ...o.detail, preventDefault: () => {
|
|
1152
|
+
o.preventDefault();
|
|
1111
1153
|
} };
|
|
1112
|
-
|
|
1154
|
+
t(r);
|
|
1113
1155
|
};
|
|
1114
|
-
return this.container?.addEventListener(
|
|
1115
|
-
this.container?.removeEventListener(
|
|
1156
|
+
return this.container?.addEventListener(e, i), () => {
|
|
1157
|
+
this.container?.removeEventListener(e, i);
|
|
1116
1158
|
};
|
|
1117
1159
|
}
|
|
1118
1160
|
}
|
|
1119
|
-
const
|
|
1161
|
+
const At = {}, Et = "en", ye = (
|
|
1120
1162
|
/** @type {const} */
|
|
1121
1163
|
["en", "nl", "de"]
|
|
1122
1164
|
), K = [
|
|
1123
1165
|
"baseLocale"
|
|
1124
|
-
],
|
|
1166
|
+
], se = [], Y = typeof window > "u";
|
|
1125
1167
|
globalThis.__paraglide = /** @type {any} */
|
|
1126
1168
|
globalThis.__paraglide ?? {};
|
|
1127
1169
|
globalThis.__paraglide.ssr = /** @type {any} */
|
|
1128
1170
|
globalThis.__paraglide.ssr ?? {};
|
|
1129
|
-
let
|
|
1171
|
+
let oe = !1, m = () => {
|
|
1130
1172
|
let n = K;
|
|
1131
|
-
!
|
|
1132
|
-
const
|
|
1133
|
-
if (
|
|
1134
|
-
return
|
|
1173
|
+
!Y && typeof window < "u" && window.location?.href && (n = we(window.location.href));
|
|
1174
|
+
const e = xt(n);
|
|
1175
|
+
if (e)
|
|
1176
|
+
return oe || (oe = !0, Se(e, { reload: !1 })), e;
|
|
1135
1177
|
throw new Error("No locale found. Read the docs https://paraglidejs.com/errors#no-locale-found");
|
|
1136
1178
|
};
|
|
1137
|
-
function
|
|
1138
|
-
let
|
|
1179
|
+
function xt(n, e) {
|
|
1180
|
+
let t;
|
|
1139
1181
|
for (const i of n) {
|
|
1140
1182
|
if (i === "baseLocale")
|
|
1141
|
-
|
|
1142
|
-
else if (
|
|
1143
|
-
const
|
|
1144
|
-
if (
|
|
1145
|
-
const r =
|
|
1183
|
+
t = Et;
|
|
1184
|
+
else if (Ce(i) && M.has(i)) {
|
|
1185
|
+
const o = M.get(i);
|
|
1186
|
+
if (o) {
|
|
1187
|
+
const r = o.getLocale();
|
|
1146
1188
|
if (r instanceof Promise)
|
|
1147
1189
|
continue;
|
|
1148
1190
|
if (r !== void 0)
|
|
1149
|
-
return
|
|
1191
|
+
return It(r);
|
|
1150
1192
|
}
|
|
1151
1193
|
}
|
|
1152
|
-
const
|
|
1153
|
-
if (
|
|
1154
|
-
return
|
|
1194
|
+
const s = X(t);
|
|
1195
|
+
if (s)
|
|
1196
|
+
return s;
|
|
1155
1197
|
}
|
|
1156
1198
|
}
|
|
1157
|
-
const
|
|
1199
|
+
const Tt = (n) => {
|
|
1158
1200
|
window.location.reload();
|
|
1159
1201
|
};
|
|
1160
|
-
let
|
|
1161
|
-
const
|
|
1202
|
+
let Se = (n, e) => {
|
|
1203
|
+
const t = {
|
|
1162
1204
|
reload: !0,
|
|
1163
|
-
...
|
|
1205
|
+
...e
|
|
1164
1206
|
};
|
|
1165
1207
|
let i;
|
|
1166
1208
|
try {
|
|
1167
|
-
i =
|
|
1209
|
+
i = m();
|
|
1168
1210
|
} catch {
|
|
1169
1211
|
}
|
|
1170
|
-
const
|
|
1171
|
-
let
|
|
1172
|
-
!
|
|
1173
|
-
for (const a of
|
|
1174
|
-
if (a !== "baseLocale" &&
|
|
1175
|
-
const
|
|
1176
|
-
if (
|
|
1177
|
-
let
|
|
1178
|
-
|
|
1212
|
+
const s = [];
|
|
1213
|
+
let o = K;
|
|
1214
|
+
!Y && typeof window < "u" && window.location?.href && (o = we(window.location.href));
|
|
1215
|
+
for (const a of o)
|
|
1216
|
+
if (a !== "baseLocale" && Ce(a) && M.has(a)) {
|
|
1217
|
+
const d = M.get(a);
|
|
1218
|
+
if (d) {
|
|
1219
|
+
let u = d.setLocale(n);
|
|
1220
|
+
u instanceof Promise && (u = u.catch((f) => {
|
|
1179
1221
|
throw new Error(`Custom strategy "${a}" setLocale failed.`, {
|
|
1180
|
-
cause:
|
|
1222
|
+
cause: f
|
|
1181
1223
|
});
|
|
1182
|
-
}),
|
|
1224
|
+
}), s.push(u));
|
|
1183
1225
|
}
|
|
1184
1226
|
}
|
|
1185
1227
|
const r = () => {
|
|
1186
|
-
!
|
|
1228
|
+
!Y && t.reload && window.location && n !== i && Tt();
|
|
1187
1229
|
};
|
|
1188
|
-
if (
|
|
1189
|
-
return Promise.all(
|
|
1230
|
+
if (s.length)
|
|
1231
|
+
return Promise.all(s).then(() => {
|
|
1190
1232
|
r();
|
|
1191
1233
|
});
|
|
1192
1234
|
r();
|
|
1193
|
-
},
|
|
1235
|
+
}, Rt = () => typeof window < "u" ? window.location.origin : "http://fallback.com";
|
|
1194
1236
|
function X(n) {
|
|
1195
1237
|
if (typeof n != "string")
|
|
1196
1238
|
return;
|
|
1197
|
-
const
|
|
1198
|
-
for (const
|
|
1199
|
-
if (
|
|
1200
|
-
return
|
|
1239
|
+
const e = n.toLowerCase();
|
|
1240
|
+
for (const t of ye)
|
|
1241
|
+
if (t.toLowerCase() === e)
|
|
1242
|
+
return t;
|
|
1201
1243
|
}
|
|
1202
|
-
function
|
|
1203
|
-
const
|
|
1204
|
-
if (
|
|
1205
|
-
return
|
|
1206
|
-
throw new Error(`Invalid locale: ${n}. Expected one of: ${
|
|
1244
|
+
function It(n) {
|
|
1245
|
+
const e = X(n);
|
|
1246
|
+
if (e)
|
|
1247
|
+
return e;
|
|
1248
|
+
throw new Error(`Invalid locale: ${n}. Expected one of: ${ye.join(", ")}`);
|
|
1207
1249
|
}
|
|
1208
|
-
function
|
|
1209
|
-
return
|
|
1250
|
+
function Lt(n) {
|
|
1251
|
+
return Ot(n);
|
|
1210
1252
|
}
|
|
1211
|
-
function
|
|
1212
|
-
const
|
|
1213
|
-
return
|
|
1253
|
+
function Ot(n) {
|
|
1254
|
+
const e = typeof n == "string" ? new URL(n, Rt()) : new URL(n), t = e.pathname.split("/").filter(Boolean);
|
|
1255
|
+
return t.length > 0 && X(t[0]) && (e.pathname = "/" + t.slice(1).join("/")), e;
|
|
1214
1256
|
}
|
|
1215
|
-
let
|
|
1216
|
-
function
|
|
1217
|
-
if (
|
|
1257
|
+
let re, ae;
|
|
1258
|
+
function Nt(n) {
|
|
1259
|
+
if (se.length === 0)
|
|
1218
1260
|
return;
|
|
1219
|
-
const
|
|
1220
|
-
if (
|
|
1221
|
-
return
|
|
1222
|
-
const
|
|
1223
|
-
let
|
|
1224
|
-
for (const r of
|
|
1225
|
-
for (const a of
|
|
1226
|
-
if (new
|
|
1227
|
-
|
|
1261
|
+
const e = typeof n == "string" ? n : n.href;
|
|
1262
|
+
if (re === e)
|
|
1263
|
+
return ae;
|
|
1264
|
+
const t = new URL(e, "http://example.com"), i = Lt(t), s = i.href === t.href ? [t] : [t, i];
|
|
1265
|
+
let o;
|
|
1266
|
+
for (const r of s) {
|
|
1267
|
+
for (const a of se)
|
|
1268
|
+
if (new At(a.match, r.href).exec(r.href)) {
|
|
1269
|
+
o = a;
|
|
1228
1270
|
break;
|
|
1229
1271
|
}
|
|
1230
|
-
if (
|
|
1272
|
+
if (o)
|
|
1231
1273
|
break;
|
|
1232
1274
|
}
|
|
1233
|
-
return
|
|
1275
|
+
return re = e, ae = o, o;
|
|
1234
1276
|
}
|
|
1235
|
-
function
|
|
1236
|
-
const
|
|
1237
|
-
return
|
|
1277
|
+
function we(n) {
|
|
1278
|
+
const e = Nt(n);
|
|
1279
|
+
return e && e.exclude !== !0 && Array.isArray(e.strategy) ? e.strategy : K;
|
|
1238
1280
|
}
|
|
1239
1281
|
const M = /* @__PURE__ */ new Map();
|
|
1240
|
-
function
|
|
1282
|
+
function Ce(n) {
|
|
1241
1283
|
return typeof n == "string" && /^custom-[A-Za-z0-9_-]+$/.test(n);
|
|
1242
1284
|
}
|
|
1243
|
-
const
|
|
1285
|
+
const Mt = (
|
|
1244
1286
|
/** @type {(inputs: Controls_Ar_Buttonlabel1Inputs) => LocalizedString} */
|
|
1245
1287
|
() => (
|
|
1246
1288
|
/** @type {LocalizedString} */
|
|
1247
1289
|
"Activate AR"
|
|
1248
1290
|
)
|
|
1249
|
-
),
|
|
1291
|
+
), zt = (
|
|
1250
1292
|
/** @type {(inputs: Controls_Ar_Buttonlabel1Inputs) => LocalizedString} */
|
|
1251
1293
|
() => (
|
|
1252
1294
|
/** @type {LocalizedString} */
|
|
1253
1295
|
"AR activeren"
|
|
1254
1296
|
)
|
|
1255
|
-
),
|
|
1297
|
+
), Pt = (
|
|
1256
1298
|
/** @type {(inputs: Controls_Ar_Buttonlabel1Inputs) => LocalizedString} */
|
|
1257
1299
|
() => (
|
|
1258
1300
|
/** @type {LocalizedString} */
|
|
1259
1301
|
"AR aktivieren"
|
|
1260
1302
|
)
|
|
1261
|
-
),
|
|
1303
|
+
), Ft = (
|
|
1262
1304
|
/** @type {((inputs?: Controls_Ar_Buttonlabel1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Ar_Buttonlabel1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1263
|
-
((n = {},
|
|
1264
|
-
const
|
|
1265
|
-
return
|
|
1305
|
+
((n = {}, e = {}) => {
|
|
1306
|
+
const t = e.locale ?? m();
|
|
1307
|
+
return t === "nl" ? zt() : t === "de" ? Pt() : Mt();
|
|
1266
1308
|
})
|
|
1267
|
-
),
|
|
1309
|
+
), $t = (
|
|
1268
1310
|
/** @type {(inputs: Controls_Qr_Modaltitle1Inputs) => LocalizedString} */
|
|
1269
1311
|
() => (
|
|
1270
1312
|
/** @type {LocalizedString} */
|
|
1271
1313
|
"Scan to view in AR"
|
|
1272
1314
|
)
|
|
1273
|
-
),
|
|
1315
|
+
), Dt = (
|
|
1274
1316
|
/** @type {(inputs: Controls_Qr_Modaltitle1Inputs) => LocalizedString} */
|
|
1275
1317
|
() => (
|
|
1276
1318
|
/** @type {LocalizedString} */
|
|
1277
1319
|
"Scan om in AR te bekijken"
|
|
1278
1320
|
)
|
|
1279
|
-
),
|
|
1321
|
+
), Ut = (
|
|
1280
1322
|
/** @type {(inputs: Controls_Qr_Modaltitle1Inputs) => LocalizedString} */
|
|
1281
1323
|
() => (
|
|
1282
1324
|
/** @type {LocalizedString} */
|
|
1283
1325
|
"Scannen für AR-Ansicht"
|
|
1284
1326
|
)
|
|
1285
|
-
),
|
|
1327
|
+
), Bt = (
|
|
1286
1328
|
/** @type {((inputs?: Controls_Qr_Modaltitle1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Qr_Modaltitle1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1287
|
-
((n = {},
|
|
1288
|
-
const
|
|
1289
|
-
return
|
|
1329
|
+
((n = {}, e = {}) => {
|
|
1330
|
+
const t = e.locale ?? m();
|
|
1331
|
+
return t === "nl" ? Dt() : t === "de" ? Ut() : $t();
|
|
1290
1332
|
})
|
|
1291
|
-
),
|
|
1333
|
+
), Vt = (
|
|
1292
1334
|
/** @type {(inputs: Controls_Qr_Modaldescription1Inputs) => LocalizedString} */
|
|
1293
1335
|
() => (
|
|
1294
1336
|
/** @type {LocalizedString} */
|
|
1295
1337
|
"Use your smartphone camera to scan this QR code"
|
|
1296
1338
|
)
|
|
1297
|
-
),
|
|
1339
|
+
), jt = (
|
|
1298
1340
|
/** @type {(inputs: Controls_Qr_Modaldescription1Inputs) => LocalizedString} */
|
|
1299
1341
|
() => (
|
|
1300
1342
|
/** @type {LocalizedString} */
|
|
1301
1343
|
"Gebruik de camera van je smartphone om deze QR-code te scannen"
|
|
1302
1344
|
)
|
|
1303
|
-
),
|
|
1345
|
+
), Ht = (
|
|
1304
1346
|
/** @type {(inputs: Controls_Qr_Modaldescription1Inputs) => LocalizedString} */
|
|
1305
1347
|
() => (
|
|
1306
1348
|
/** @type {LocalizedString} */
|
|
1307
1349
|
"Verwende die Kamera deines Smartphones, um diesen QR-Code zu scannen"
|
|
1308
1350
|
)
|
|
1309
|
-
),
|
|
1351
|
+
), qt = (
|
|
1310
1352
|
/** @type {((inputs?: Controls_Qr_Modaldescription1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Qr_Modaldescription1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1311
|
-
((n = {},
|
|
1312
|
-
const
|
|
1313
|
-
return
|
|
1353
|
+
((n = {}, e = {}) => {
|
|
1354
|
+
const t = e.locale ?? m();
|
|
1355
|
+
return t === "nl" ? jt() : t === "de" ? Ht() : Vt();
|
|
1314
1356
|
})
|
|
1315
|
-
),
|
|
1357
|
+
), Gt = (
|
|
1316
1358
|
/** @type {(inputs: Controls_Qr_Modalinstructions1Inputs) => LocalizedString} */
|
|
1317
1359
|
() => (
|
|
1318
1360
|
/** @type {LocalizedString} */
|
|
1319
1361
|
"Your phone will open the 3D model in AR mode."
|
|
1320
1362
|
)
|
|
1321
|
-
),
|
|
1363
|
+
), Zt = (
|
|
1322
1364
|
/** @type {(inputs: Controls_Qr_Modalinstructions1Inputs) => LocalizedString} */
|
|
1323
1365
|
() => (
|
|
1324
1366
|
/** @type {LocalizedString} */
|
|
1325
1367
|
"Je telefoon opent het 3D-model in AR-modus."
|
|
1326
1368
|
)
|
|
1327
|
-
),
|
|
1369
|
+
), Wt = (
|
|
1328
1370
|
/** @type {(inputs: Controls_Qr_Modalinstructions1Inputs) => LocalizedString} */
|
|
1329
1371
|
() => (
|
|
1330
1372
|
/** @type {LocalizedString} */
|
|
1331
1373
|
"Dein Telefon öffnet das 3D-Modell im AR-Modus."
|
|
1332
1374
|
)
|
|
1333
|
-
),
|
|
1375
|
+
), Yt = (
|
|
1334
1376
|
/** @type {((inputs?: Controls_Qr_Modalinstructions1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Qr_Modalinstructions1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1335
|
-
((n = {},
|
|
1336
|
-
const
|
|
1337
|
-
return
|
|
1377
|
+
((n = {}, e = {}) => {
|
|
1378
|
+
const t = e.locale ?? m();
|
|
1379
|
+
return t === "nl" ? Zt() : t === "de" ? Wt() : Gt();
|
|
1338
1380
|
})
|
|
1339
|
-
),
|
|
1381
|
+
), Qt = (
|
|
1340
1382
|
/** @type {(inputs: Controls_Qr_Closebutton1Inputs) => LocalizedString} */
|
|
1341
1383
|
() => (
|
|
1342
1384
|
/** @type {LocalizedString} */
|
|
1343
1385
|
"Close"
|
|
1344
1386
|
)
|
|
1345
|
-
),
|
|
1387
|
+
), Kt = (
|
|
1346
1388
|
/** @type {(inputs: Controls_Qr_Closebutton1Inputs) => LocalizedString} */
|
|
1347
1389
|
() => (
|
|
1348
1390
|
/** @type {LocalizedString} */
|
|
1349
1391
|
"Sluiten"
|
|
1350
1392
|
)
|
|
1351
|
-
),
|
|
1393
|
+
), Xt = (
|
|
1352
1394
|
/** @type {(inputs: Controls_Qr_Closebutton1Inputs) => LocalizedString} */
|
|
1353
1395
|
() => (
|
|
1354
1396
|
/** @type {LocalizedString} */
|
|
1355
1397
|
"Schließen"
|
|
1356
1398
|
)
|
|
1357
|
-
),
|
|
1399
|
+
), Jt = (
|
|
1358
1400
|
/** @type {((inputs?: Controls_Qr_Closebutton1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Qr_Closebutton1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1359
|
-
((n = {},
|
|
1360
|
-
const
|
|
1361
|
-
return
|
|
1401
|
+
((n = {}, e = {}) => {
|
|
1402
|
+
const t = e.locale ?? m();
|
|
1403
|
+
return t === "nl" ? Kt() : t === "de" ? Xt() : Qt();
|
|
1362
1404
|
})
|
|
1363
|
-
),
|
|
1405
|
+
), en = (
|
|
1364
1406
|
/** @type {(inputs: Controls_Fullscreen_Buttonlabel1Inputs) => LocalizedString} */
|
|
1365
1407
|
() => (
|
|
1366
1408
|
/** @type {LocalizedString} */
|
|
1367
1409
|
"Fullscreen"
|
|
1368
1410
|
)
|
|
1369
|
-
),
|
|
1411
|
+
), tn = (
|
|
1370
1412
|
/** @type {(inputs: Controls_Fullscreen_Buttonlabel1Inputs) => LocalizedString} */
|
|
1371
1413
|
() => (
|
|
1372
1414
|
/** @type {LocalizedString} */
|
|
1373
1415
|
"Volledig scherm"
|
|
1374
1416
|
)
|
|
1375
|
-
),
|
|
1417
|
+
), nn = (
|
|
1376
1418
|
/** @type {(inputs: Controls_Fullscreen_Buttonlabel1Inputs) => LocalizedString} */
|
|
1377
1419
|
() => (
|
|
1378
1420
|
/** @type {LocalizedString} */
|
|
1379
1421
|
"Vollbild"
|
|
1380
1422
|
)
|
|
1381
|
-
),
|
|
1423
|
+
), sn = (
|
|
1382
1424
|
/** @type {((inputs?: Controls_Fullscreen_Buttonlabel1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Fullscreen_Buttonlabel1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1383
|
-
((n = {},
|
|
1384
|
-
const
|
|
1385
|
-
return
|
|
1425
|
+
((n = {}, e = {}) => {
|
|
1426
|
+
const t = e.locale ?? m();
|
|
1427
|
+
return t === "nl" ? tn() : t === "de" ? nn() : en();
|
|
1386
1428
|
})
|
|
1387
|
-
),
|
|
1429
|
+
), on = (
|
|
1388
1430
|
/** @type {(inputs: Loading_Downloadingshort1Inputs) => LocalizedString} */
|
|
1389
1431
|
() => (
|
|
1390
1432
|
/** @type {LocalizedString} */
|
|
1391
1433
|
"Downloading"
|
|
1392
1434
|
)
|
|
1393
|
-
),
|
|
1435
|
+
), rn = (
|
|
1394
1436
|
/** @type {(inputs: Loading_Downloadingshort1Inputs) => LocalizedString} */
|
|
1395
1437
|
() => (
|
|
1396
1438
|
/** @type {LocalizedString} */
|
|
1397
1439
|
"Downloaden"
|
|
1398
1440
|
)
|
|
1399
|
-
),
|
|
1441
|
+
), an = (
|
|
1400
1442
|
/** @type {(inputs: Loading_Downloadingshort1Inputs) => LocalizedString} */
|
|
1401
1443
|
() => (
|
|
1402
1444
|
/** @type {LocalizedString} */
|
|
1403
1445
|
"Herunterladen"
|
|
1404
1446
|
)
|
|
1405
|
-
),
|
|
1447
|
+
), _e = (
|
|
1406
1448
|
/** @type {((inputs?: Loading_Downloadingshort1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Loading_Downloadingshort1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1407
|
-
((n = {},
|
|
1408
|
-
const
|
|
1409
|
-
return
|
|
1449
|
+
((n = {}, e = {}) => {
|
|
1450
|
+
const t = e.locale ?? m();
|
|
1451
|
+
return t === "nl" ? rn() : t === "de" ? an() : on();
|
|
1410
1452
|
})
|
|
1411
|
-
),
|
|
1453
|
+
), ln = (
|
|
1412
1454
|
/** @type {(inputs: Loading_RenderingInputs) => LocalizedString} */
|
|
1413
1455
|
() => (
|
|
1414
1456
|
/** @type {LocalizedString} */
|
|
1415
1457
|
"Rendering"
|
|
1416
1458
|
)
|
|
1417
|
-
),
|
|
1459
|
+
), cn = (
|
|
1418
1460
|
/** @type {(inputs: Loading_RenderingInputs) => LocalizedString} */
|
|
1419
1461
|
() => (
|
|
1420
1462
|
/** @type {LocalizedString} */
|
|
1421
1463
|
"Renderen"
|
|
1422
1464
|
)
|
|
1423
|
-
),
|
|
1465
|
+
), dn = (
|
|
1424
1466
|
/** @type {(inputs: Loading_RenderingInputs) => LocalizedString} */
|
|
1425
1467
|
() => (
|
|
1426
1468
|
/** @type {LocalizedString} */
|
|
1427
1469
|
"Rendern"
|
|
1428
1470
|
)
|
|
1429
|
-
),
|
|
1471
|
+
), un = (
|
|
1430
1472
|
/** @type {((inputs?: Loading_RenderingInputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Loading_RenderingInputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1431
|
-
((n = {},
|
|
1432
|
-
const
|
|
1433
|
-
return
|
|
1473
|
+
((n = {}, e = {}) => {
|
|
1474
|
+
const t = e.locale ?? m();
|
|
1475
|
+
return t === "nl" ? cn() : t === "de" ? dn() : ln();
|
|
1434
1476
|
})
|
|
1435
|
-
),
|
|
1477
|
+
), hn = (
|
|
1436
1478
|
/** @type {(inputs: Controls_Screenshot_Buttonlabel1Inputs) => LocalizedString} */
|
|
1437
1479
|
() => (
|
|
1438
1480
|
/** @type {LocalizedString} */
|
|
1439
1481
|
"Screenshot"
|
|
1440
1482
|
)
|
|
1441
|
-
),
|
|
1483
|
+
), mn = (
|
|
1442
1484
|
/** @type {(inputs: Controls_Screenshot_Buttonlabel1Inputs) => LocalizedString} */
|
|
1443
1485
|
() => (
|
|
1444
1486
|
/** @type {LocalizedString} */
|
|
1445
1487
|
"Screenshot"
|
|
1446
1488
|
)
|
|
1447
|
-
),
|
|
1489
|
+
), pn = (
|
|
1448
1490
|
/** @type {(inputs: Controls_Screenshot_Buttonlabel1Inputs) => LocalizedString} */
|
|
1449
1491
|
() => (
|
|
1450
1492
|
/** @type {LocalizedString} */
|
|
1451
1493
|
"Screenshot"
|
|
1452
1494
|
)
|
|
1453
|
-
),
|
|
1495
|
+
), fn = (
|
|
1454
1496
|
/** @type {((inputs?: Controls_Screenshot_Buttonlabel1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Screenshot_Buttonlabel1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1455
|
-
((n = {},
|
|
1456
|
-
const
|
|
1457
|
-
return
|
|
1497
|
+
((n = {}, e = {}) => {
|
|
1498
|
+
const t = e.locale ?? m();
|
|
1499
|
+
return t === "nl" ? mn() : t === "de" ? pn() : hn();
|
|
1458
1500
|
})
|
|
1459
|
-
),
|
|
1501
|
+
), gn = (
|
|
1460
1502
|
/** @type {(inputs: Controls_Configurator_OpenInputs) => LocalizedString} */
|
|
1461
1503
|
() => (
|
|
1462
1504
|
/** @type {LocalizedString} */
|
|
1463
1505
|
"Configure"
|
|
1464
1506
|
)
|
|
1465
|
-
),
|
|
1507
|
+
), bn = (
|
|
1466
1508
|
/** @type {(inputs: Controls_Configurator_OpenInputs) => LocalizedString} */
|
|
1467
1509
|
() => (
|
|
1468
1510
|
/** @type {LocalizedString} */
|
|
1469
1511
|
"Configureren"
|
|
1470
1512
|
)
|
|
1471
|
-
),
|
|
1513
|
+
), vn = (
|
|
1472
1514
|
/** @type {(inputs: Controls_Configurator_OpenInputs) => LocalizedString} */
|
|
1473
1515
|
() => (
|
|
1474
1516
|
/** @type {LocalizedString} */
|
|
1475
1517
|
"Konfigurieren"
|
|
1476
1518
|
)
|
|
1477
|
-
),
|
|
1519
|
+
), yn = (
|
|
1478
1520
|
/** @type {((inputs?: Controls_Configurator_OpenInputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Configurator_OpenInputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1479
|
-
((n = {},
|
|
1480
|
-
const
|
|
1481
|
-
return
|
|
1521
|
+
((n = {}, e = {}) => {
|
|
1522
|
+
const t = e.locale ?? m();
|
|
1523
|
+
return t === "nl" ? bn() : t === "de" ? vn() : gn();
|
|
1482
1524
|
})
|
|
1483
|
-
),
|
|
1525
|
+
), Sn = (
|
|
1484
1526
|
/** @type {(inputs: Controls_Configurator_CloseInputs) => LocalizedString} */
|
|
1485
1527
|
() => (
|
|
1486
1528
|
/** @type {LocalizedString} */
|
|
1487
1529
|
"Close"
|
|
1488
1530
|
)
|
|
1489
|
-
),
|
|
1531
|
+
), wn = (
|
|
1490
1532
|
/** @type {(inputs: Controls_Configurator_CloseInputs) => LocalizedString} */
|
|
1491
1533
|
() => (
|
|
1492
1534
|
/** @type {LocalizedString} */
|
|
1493
1535
|
"Sluiten"
|
|
1494
1536
|
)
|
|
1495
|
-
),
|
|
1537
|
+
), Cn = (
|
|
1496
1538
|
/** @type {(inputs: Controls_Configurator_CloseInputs) => LocalizedString} */
|
|
1497
1539
|
() => (
|
|
1498
1540
|
/** @type {LocalizedString} */
|
|
1499
1541
|
"Schließen"
|
|
1500
1542
|
)
|
|
1501
|
-
),
|
|
1543
|
+
), _n = (
|
|
1502
1544
|
/** @type {((inputs?: Controls_Configurator_CloseInputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Configurator_CloseInputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1503
|
-
((n = {},
|
|
1504
|
-
const
|
|
1505
|
-
return
|
|
1545
|
+
((n = {}, e = {}) => {
|
|
1546
|
+
const t = e.locale ?? m();
|
|
1547
|
+
return t === "nl" ? wn() : t === "de" ? Cn() : Sn();
|
|
1506
1548
|
})
|
|
1507
|
-
),
|
|
1549
|
+
), kn = (
|
|
1508
1550
|
/** @type {(inputs: Controls_Camera_ResetInputs) => LocalizedString} */
|
|
1509
1551
|
() => (
|
|
1510
1552
|
/** @type {LocalizedString} */
|
|
1511
1553
|
"Reset camera"
|
|
1512
1554
|
)
|
|
1513
|
-
),
|
|
1555
|
+
), An = (
|
|
1514
1556
|
/** @type {(inputs: Controls_Camera_ResetInputs) => LocalizedString} */
|
|
1515
1557
|
() => (
|
|
1516
1558
|
/** @type {LocalizedString} */
|
|
1517
1559
|
"Camera resetten"
|
|
1518
1560
|
)
|
|
1519
|
-
),
|
|
1561
|
+
), En = (
|
|
1520
1562
|
/** @type {(inputs: Controls_Camera_ResetInputs) => LocalizedString} */
|
|
1521
1563
|
() => (
|
|
1522
1564
|
/** @type {LocalizedString} */
|
|
1523
1565
|
"Kamera zurücksetzen"
|
|
1524
1566
|
)
|
|
1525
|
-
),
|
|
1567
|
+
), xn = (
|
|
1526
1568
|
/** @type {((inputs?: Controls_Camera_ResetInputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Camera_ResetInputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1527
|
-
((n = {},
|
|
1528
|
-
const
|
|
1529
|
-
return
|
|
1569
|
+
((n = {}, e = {}) => {
|
|
1570
|
+
const t = e.locale ?? m();
|
|
1571
|
+
return t === "nl" ? An() : t === "de" ? En() : kn();
|
|
1530
1572
|
})
|
|
1531
|
-
),
|
|
1573
|
+
), Tn = (
|
|
1532
1574
|
/** @type {(inputs: Controls_Camera_Zoomin1Inputs) => LocalizedString} */
|
|
1533
1575
|
() => (
|
|
1534
1576
|
/** @type {LocalizedString} */
|
|
1535
1577
|
"Zoom in"
|
|
1536
1578
|
)
|
|
1537
|
-
),
|
|
1579
|
+
), Rn = (
|
|
1538
1580
|
/** @type {(inputs: Controls_Camera_Zoomin1Inputs) => LocalizedString} */
|
|
1539
1581
|
() => (
|
|
1540
1582
|
/** @type {LocalizedString} */
|
|
1541
1583
|
"Inzoomen"
|
|
1542
1584
|
)
|
|
1543
|
-
),
|
|
1585
|
+
), In = (
|
|
1544
1586
|
/** @type {(inputs: Controls_Camera_Zoomin1Inputs) => LocalizedString} */
|
|
1545
1587
|
() => (
|
|
1546
1588
|
/** @type {LocalizedString} */
|
|
1547
1589
|
"Hineinzoomen"
|
|
1548
1590
|
)
|
|
1549
|
-
),
|
|
1591
|
+
), Ln = (
|
|
1550
1592
|
/** @type {((inputs?: Controls_Camera_Zoomin1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Camera_Zoomin1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1551
|
-
((n = {},
|
|
1552
|
-
const
|
|
1553
|
-
return
|
|
1593
|
+
((n = {}, e = {}) => {
|
|
1594
|
+
const t = e.locale ?? m();
|
|
1595
|
+
return t === "nl" ? Rn() : t === "de" ? In() : Tn();
|
|
1554
1596
|
})
|
|
1555
|
-
),
|
|
1597
|
+
), On = (
|
|
1556
1598
|
/** @type {(inputs: Controls_Camera_Zoomout1Inputs) => LocalizedString} */
|
|
1557
1599
|
() => (
|
|
1558
1600
|
/** @type {LocalizedString} */
|
|
1559
1601
|
"Zoom out"
|
|
1560
1602
|
)
|
|
1561
|
-
),
|
|
1603
|
+
), Nn = (
|
|
1562
1604
|
/** @type {(inputs: Controls_Camera_Zoomout1Inputs) => LocalizedString} */
|
|
1563
1605
|
() => (
|
|
1564
1606
|
/** @type {LocalizedString} */
|
|
1565
1607
|
"Uitzoomen"
|
|
1566
1608
|
)
|
|
1567
|
-
),
|
|
1609
|
+
), Mn = (
|
|
1568
1610
|
/** @type {(inputs: Controls_Camera_Zoomout1Inputs) => LocalizedString} */
|
|
1569
1611
|
() => (
|
|
1570
1612
|
/** @type {LocalizedString} */
|
|
1571
1613
|
"Herauszoomen"
|
|
1572
1614
|
)
|
|
1573
|
-
),
|
|
1615
|
+
), zn = (
|
|
1574
1616
|
/** @type {((inputs?: Controls_Camera_Zoomout1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Camera_Zoomout1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1575
|
-
((n = {},
|
|
1576
|
-
const
|
|
1577
|
-
return
|
|
1617
|
+
((n = {}, e = {}) => {
|
|
1618
|
+
const t = e.locale ?? m();
|
|
1619
|
+
return t === "nl" ? Nn() : t === "de" ? Mn() : On();
|
|
1578
1620
|
})
|
|
1579
|
-
),
|
|
1621
|
+
), Pn = (
|
|
1580
1622
|
/** @type {(inputs: Controls_Camera_Rotateleft1Inputs) => LocalizedString} */
|
|
1581
1623
|
() => (
|
|
1582
1624
|
/** @type {LocalizedString} */
|
|
1583
1625
|
"Rotate left"
|
|
1584
1626
|
)
|
|
1585
|
-
),
|
|
1627
|
+
), Fn = (
|
|
1586
1628
|
/** @type {(inputs: Controls_Camera_Rotateleft1Inputs) => LocalizedString} */
|
|
1587
1629
|
() => (
|
|
1588
1630
|
/** @type {LocalizedString} */
|
|
1589
1631
|
"Naar links draaien"
|
|
1590
1632
|
)
|
|
1591
|
-
),
|
|
1633
|
+
), $n = (
|
|
1592
1634
|
/** @type {(inputs: Controls_Camera_Rotateleft1Inputs) => LocalizedString} */
|
|
1593
1635
|
() => (
|
|
1594
1636
|
/** @type {LocalizedString} */
|
|
1595
1637
|
"Nach links drehen"
|
|
1596
1638
|
)
|
|
1597
|
-
),
|
|
1639
|
+
), Dn = (
|
|
1598
1640
|
/** @type {((inputs?: Controls_Camera_Rotateleft1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Camera_Rotateleft1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1599
|
-
((n = {},
|
|
1600
|
-
const
|
|
1601
|
-
return
|
|
1641
|
+
((n = {}, e = {}) => {
|
|
1642
|
+
const t = e.locale ?? m();
|
|
1643
|
+
return t === "nl" ? Fn() : t === "de" ? $n() : Pn();
|
|
1602
1644
|
})
|
|
1603
|
-
),
|
|
1645
|
+
), Un = (
|
|
1604
1646
|
/** @type {(inputs: Controls_Camera_Rotateright1Inputs) => LocalizedString} */
|
|
1605
1647
|
() => (
|
|
1606
1648
|
/** @type {LocalizedString} */
|
|
1607
1649
|
"Rotate right"
|
|
1608
1650
|
)
|
|
1609
|
-
),
|
|
1651
|
+
), Bn = (
|
|
1610
1652
|
/** @type {(inputs: Controls_Camera_Rotateright1Inputs) => LocalizedString} */
|
|
1611
1653
|
() => (
|
|
1612
1654
|
/** @type {LocalizedString} */
|
|
1613
1655
|
"Naar rechts draaien"
|
|
1614
1656
|
)
|
|
1615
|
-
),
|
|
1657
|
+
), Vn = (
|
|
1616
1658
|
/** @type {(inputs: Controls_Camera_Rotateright1Inputs) => LocalizedString} */
|
|
1617
1659
|
() => (
|
|
1618
1660
|
/** @type {LocalizedString} */
|
|
1619
1661
|
"Nach rechts drehen"
|
|
1620
1662
|
)
|
|
1621
|
-
),
|
|
1663
|
+
), jn = (
|
|
1622
1664
|
/** @type {((inputs?: Controls_Camera_Rotateright1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Camera_Rotateright1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1623
|
-
((n = {},
|
|
1624
|
-
const
|
|
1625
|
-
return
|
|
1665
|
+
((n = {}, e = {}) => {
|
|
1666
|
+
const t = e.locale ?? m();
|
|
1667
|
+
return t === "nl" ? Bn() : t === "de" ? Vn() : Un();
|
|
1626
1668
|
})
|
|
1627
|
-
),
|
|
1669
|
+
), Hn = (
|
|
1628
1670
|
/** @type {(inputs: Controls_Camera_Tiltup1Inputs) => LocalizedString} */
|
|
1629
1671
|
() => (
|
|
1630
1672
|
/** @type {LocalizedString} */
|
|
1631
1673
|
"Tilt up"
|
|
1632
1674
|
)
|
|
1633
|
-
),
|
|
1675
|
+
), qn = (
|
|
1634
1676
|
/** @type {(inputs: Controls_Camera_Tiltup1Inputs) => LocalizedString} */
|
|
1635
1677
|
() => (
|
|
1636
1678
|
/** @type {LocalizedString} */
|
|
1637
1679
|
"Omhoog kantelen"
|
|
1638
1680
|
)
|
|
1639
|
-
),
|
|
1681
|
+
), Gn = (
|
|
1640
1682
|
/** @type {(inputs: Controls_Camera_Tiltup1Inputs) => LocalizedString} */
|
|
1641
1683
|
() => (
|
|
1642
1684
|
/** @type {LocalizedString} */
|
|
1643
1685
|
"Nach oben kippen"
|
|
1644
1686
|
)
|
|
1645
|
-
),
|
|
1687
|
+
), Zn = (
|
|
1646
1688
|
/** @type {((inputs?: Controls_Camera_Tiltup1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Camera_Tiltup1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1647
|
-
((n = {},
|
|
1648
|
-
const
|
|
1649
|
-
return
|
|
1689
|
+
((n = {}, e = {}) => {
|
|
1690
|
+
const t = e.locale ?? m();
|
|
1691
|
+
return t === "nl" ? qn() : t === "de" ? Gn() : Hn();
|
|
1650
1692
|
})
|
|
1651
|
-
),
|
|
1693
|
+
), Wn = (
|
|
1652
1694
|
/** @type {(inputs: Controls_Camera_Tiltdown1Inputs) => LocalizedString} */
|
|
1653
1695
|
() => (
|
|
1654
1696
|
/** @type {LocalizedString} */
|
|
1655
1697
|
"Tilt down"
|
|
1656
1698
|
)
|
|
1657
|
-
),
|
|
1699
|
+
), Yn = (
|
|
1658
1700
|
/** @type {(inputs: Controls_Camera_Tiltdown1Inputs) => LocalizedString} */
|
|
1659
1701
|
() => (
|
|
1660
1702
|
/** @type {LocalizedString} */
|
|
1661
1703
|
"Omlaag kantelen"
|
|
1662
1704
|
)
|
|
1663
|
-
),
|
|
1705
|
+
), Qn = (
|
|
1664
1706
|
/** @type {(inputs: Controls_Camera_Tiltdown1Inputs) => LocalizedString} */
|
|
1665
1707
|
() => (
|
|
1666
1708
|
/** @type {LocalizedString} */
|
|
1667
1709
|
"Nach unten kippen"
|
|
1668
1710
|
)
|
|
1669
|
-
),
|
|
1711
|
+
), Kn = (
|
|
1670
1712
|
/** @type {((inputs?: Controls_Camera_Tiltdown1Inputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Controls_Camera_Tiltdown1Inputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1671
|
-
((n = {},
|
|
1672
|
-
const
|
|
1673
|
-
return
|
|
1713
|
+
((n = {}, e = {}) => {
|
|
1714
|
+
const t = e.locale ?? m();
|
|
1715
|
+
return t === "nl" ? Yn() : t === "de" ? Qn() : Wn();
|
|
1674
1716
|
})
|
|
1675
|
-
),
|
|
1717
|
+
), Xn = (
|
|
1676
1718
|
/** @type {(inputs: Commerce_Submit_BusyInputs) => LocalizedString} */
|
|
1677
1719
|
() => (
|
|
1678
1720
|
/** @type {LocalizedString} */
|
|
1679
1721
|
"Working…"
|
|
1680
1722
|
)
|
|
1681
|
-
),
|
|
1723
|
+
), Jn = (
|
|
1682
1724
|
/** @type {(inputs: Commerce_Submit_BusyInputs) => LocalizedString} */
|
|
1683
1725
|
() => (
|
|
1684
1726
|
/** @type {LocalizedString} */
|
|
1685
1727
|
"Bezig…"
|
|
1686
1728
|
)
|
|
1687
|
-
),
|
|
1729
|
+
), ei = (
|
|
1688
1730
|
/** @type {(inputs: Commerce_Submit_BusyInputs) => LocalizedString} */
|
|
1689
1731
|
() => (
|
|
1690
1732
|
/** @type {LocalizedString} */
|
|
1691
1733
|
"Läuft…"
|
|
1692
1734
|
)
|
|
1693
|
-
),
|
|
1735
|
+
), ti = (
|
|
1694
1736
|
/** @type {((inputs?: Commerce_Submit_BusyInputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Commerce_Submit_BusyInputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1695
|
-
((n = {},
|
|
1696
|
-
const
|
|
1697
|
-
return
|
|
1737
|
+
((n = {}, e = {}) => {
|
|
1738
|
+
const t = e.locale ?? m();
|
|
1739
|
+
return t === "nl" ? Jn() : t === "de" ? ei() : Xn();
|
|
1698
1740
|
})
|
|
1699
|
-
),
|
|
1741
|
+
), ni = (
|
|
1700
1742
|
/** @type {(inputs: Commerce_Submit_SuccessInputs) => LocalizedString} */
|
|
1701
1743
|
() => (
|
|
1702
1744
|
/** @type {LocalizedString} */
|
|
1703
1745
|
"Done"
|
|
1704
1746
|
)
|
|
1705
|
-
),
|
|
1747
|
+
), ii = (
|
|
1706
1748
|
/** @type {(inputs: Commerce_Submit_SuccessInputs) => LocalizedString} */
|
|
1707
1749
|
() => (
|
|
1708
1750
|
/** @type {LocalizedString} */
|
|
1709
1751
|
"Gelukt"
|
|
1710
1752
|
)
|
|
1711
|
-
),
|
|
1753
|
+
), si = (
|
|
1712
1754
|
/** @type {(inputs: Commerce_Submit_SuccessInputs) => LocalizedString} */
|
|
1713
1755
|
() => (
|
|
1714
1756
|
/** @type {LocalizedString} */
|
|
1715
1757
|
"Fertig"
|
|
1716
1758
|
)
|
|
1717
|
-
),
|
|
1759
|
+
), oi = (
|
|
1718
1760
|
/** @type {((inputs?: Commerce_Submit_SuccessInputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Commerce_Submit_SuccessInputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1719
|
-
((n = {},
|
|
1720
|
-
const
|
|
1721
|
-
return
|
|
1761
|
+
((n = {}, e = {}) => {
|
|
1762
|
+
const t = e.locale ?? m();
|
|
1763
|
+
return t === "nl" ? ii() : t === "de" ? si() : ni();
|
|
1722
1764
|
})
|
|
1723
|
-
),
|
|
1765
|
+
), ri = (
|
|
1724
1766
|
/** @type {(inputs: Commerce_Submit_FailedInputs) => LocalizedString} */
|
|
1725
1767
|
() => (
|
|
1726
1768
|
/** @type {LocalizedString} */
|
|
1727
1769
|
"Failed"
|
|
1728
1770
|
)
|
|
1729
|
-
),
|
|
1771
|
+
), ai = (
|
|
1730
1772
|
/** @type {(inputs: Commerce_Submit_FailedInputs) => LocalizedString} */
|
|
1731
1773
|
() => (
|
|
1732
1774
|
/** @type {LocalizedString} */
|
|
1733
1775
|
"Mislukt"
|
|
1734
1776
|
)
|
|
1735
|
-
),
|
|
1777
|
+
), li = (
|
|
1736
1778
|
/** @type {(inputs: Commerce_Submit_FailedInputs) => LocalizedString} */
|
|
1737
1779
|
() => (
|
|
1738
1780
|
/** @type {LocalizedString} */
|
|
1739
1781
|
"Fehlgeschlagen"
|
|
1740
1782
|
)
|
|
1741
|
-
),
|
|
1783
|
+
), ci = (
|
|
1742
1784
|
/** @type {((inputs?: Commerce_Submit_FailedInputs, options?: { locale?: "en" | "nl" | "de" }) => LocalizedString) & import('../runtime.js').MessageMetadata<Commerce_Submit_FailedInputs, { locale?: "en" | "nl" | "de" }, {}>} */
|
|
1743
|
-
((n = {},
|
|
1744
|
-
const
|
|
1745
|
-
return
|
|
1785
|
+
((n = {}, e = {}) => {
|
|
1786
|
+
const t = e.locale ?? m();
|
|
1787
|
+
return t === "nl" ? ai() : t === "de" ? li() : ri();
|
|
1746
1788
|
})
|
|
1747
1789
|
);
|
|
1748
|
-
const
|
|
1790
|
+
const di = {
|
|
1749
1791
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1750
1792
|
width: 24,
|
|
1751
1793
|
height: 24,
|
|
@@ -1756,22 +1798,22 @@ const si = {
|
|
|
1756
1798
|
"stroke-linecap": "round",
|
|
1757
1799
|
"stroke-linejoin": "round"
|
|
1758
1800
|
};
|
|
1759
|
-
const
|
|
1801
|
+
const ke = ([n, e, t]) => {
|
|
1760
1802
|
const i = document.createElementNS("http://www.w3.org/2000/svg", n);
|
|
1761
|
-
return Object.keys(
|
|
1762
|
-
i.setAttribute(
|
|
1763
|
-
}),
|
|
1764
|
-
const
|
|
1765
|
-
i.appendChild(
|
|
1803
|
+
return Object.keys(e).forEach((s) => {
|
|
1804
|
+
i.setAttribute(s, String(e[s]));
|
|
1805
|
+
}), t?.length && t.forEach((s) => {
|
|
1806
|
+
const o = ke(s);
|
|
1807
|
+
i.appendChild(o);
|
|
1766
1808
|
}), i;
|
|
1767
|
-
},
|
|
1809
|
+
}, Ae = (n, e = {}) => {
|
|
1768
1810
|
const i = {
|
|
1769
|
-
...
|
|
1770
|
-
...
|
|
1811
|
+
...di,
|
|
1812
|
+
...e
|
|
1771
1813
|
};
|
|
1772
|
-
return
|
|
1814
|
+
return ke(["svg", i, n]);
|
|
1773
1815
|
};
|
|
1774
|
-
const
|
|
1816
|
+
const ui = [
|
|
1775
1817
|
[
|
|
1776
1818
|
"path",
|
|
1777
1819
|
{
|
|
@@ -1781,7 +1823,7 @@ const ri = [
|
|
|
1781
1823
|
["path", { d: "m3.3 7 8.7 5 8.7-5" }],
|
|
1782
1824
|
["path", { d: "M12 22V12" }]
|
|
1783
1825
|
];
|
|
1784
|
-
const
|
|
1826
|
+
const hi = [
|
|
1785
1827
|
[
|
|
1786
1828
|
"path",
|
|
1787
1829
|
{
|
|
@@ -1790,27 +1832,27 @@ const ai = [
|
|
|
1790
1832
|
],
|
|
1791
1833
|
["circle", { cx: "12", cy: "13", r: "3" }]
|
|
1792
1834
|
];
|
|
1793
|
-
const
|
|
1794
|
-
const
|
|
1795
|
-
const
|
|
1796
|
-
const
|
|
1797
|
-
const
|
|
1835
|
+
const Ee = [["path", { d: "m6 9 6 6 6-6" }]];
|
|
1836
|
+
const mi = [["path", { d: "m15 18-6-6 6-6" }]];
|
|
1837
|
+
const pi = [["path", { d: "m9 18 6-6-6-6" }]];
|
|
1838
|
+
const fi = [["path", { d: "m18 15-6-6-6 6" }]];
|
|
1839
|
+
const gi = [
|
|
1798
1840
|
["path", { d: "M15 3h6v6" }],
|
|
1799
1841
|
["path", { d: "m21 3-7 7" }],
|
|
1800
1842
|
["path", { d: "m3 21 7-7" }],
|
|
1801
1843
|
["path", { d: "M9 21H3v-6" }]
|
|
1802
1844
|
];
|
|
1803
|
-
const
|
|
1845
|
+
const bi = [
|
|
1804
1846
|
["path", { d: "m14 10 7-7" }],
|
|
1805
1847
|
["path", { d: "M20 10h-6V4" }],
|
|
1806
1848
|
["path", { d: "m3 21 7-7" }],
|
|
1807
1849
|
["path", { d: "M4 14h6v6" }]
|
|
1808
1850
|
];
|
|
1809
|
-
const
|
|
1851
|
+
const vi = [
|
|
1810
1852
|
["path", { d: "M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8" }],
|
|
1811
1853
|
["path", { d: "M3 3v5h5" }]
|
|
1812
1854
|
];
|
|
1813
|
-
const
|
|
1855
|
+
const yi = [
|
|
1814
1856
|
["path", { d: "M10 5H3" }],
|
|
1815
1857
|
["path", { d: "M12 19H3" }],
|
|
1816
1858
|
["path", { d: "M14 3v4" }],
|
|
@@ -1821,50 +1863,50 @@ const pi = [
|
|
|
1821
1863
|
["path", { d: "M8 10v4" }],
|
|
1822
1864
|
["path", { d: "M8 12H3" }]
|
|
1823
1865
|
];
|
|
1824
|
-
const
|
|
1866
|
+
const Si = [
|
|
1825
1867
|
["path", { d: "M18 6 6 18" }],
|
|
1826
1868
|
["path", { d: "m6 6 12 12" }]
|
|
1827
1869
|
];
|
|
1828
|
-
const
|
|
1870
|
+
const wi = [
|
|
1829
1871
|
["circle", { cx: "11", cy: "11", r: "8" }],
|
|
1830
1872
|
["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65" }],
|
|
1873
|
+
["line", { x1: "11", x2: "11", y1: "8", y2: "14" }],
|
|
1831
1874
|
["line", { x1: "8", x2: "14", y1: "11", y2: "11" }]
|
|
1832
1875
|
];
|
|
1833
|
-
const
|
|
1876
|
+
const Ci = [
|
|
1834
1877
|
["circle", { cx: "11", cy: "11", r: "8" }],
|
|
1835
1878
|
["line", { x1: "21", x2: "16.65", y1: "21", y2: "16.65" }],
|
|
1836
|
-
["line", { x1: "11", x2: "11", y1: "8", y2: "14" }],
|
|
1837
1879
|
["line", { x1: "8", x2: "14", y1: "11", y2: "11" }]
|
|
1838
1880
|
];
|
|
1839
|
-
function y(n, { size:
|
|
1840
|
-
return
|
|
1841
|
-
}
|
|
1842
|
-
const
|
|
1843
|
-
ar: (n) => y(
|
|
1844
|
-
fullscreen: (n) => y(
|
|
1845
|
-
exitFullscreen: (n) => y(
|
|
1846
|
-
screenshot: (n) => y(
|
|
1847
|
-
tiltUp: (n) => y(
|
|
1848
|
-
tiltDown: (n) => y(
|
|
1849
|
-
rotateLeft: (n) => y(
|
|
1850
|
-
rotateRight: (n) => y(
|
|
1851
|
-
zoomIn: (n) => y(
|
|
1852
|
-
zoomOut: (n) => y(
|
|
1853
|
-
reset: (n) => y(
|
|
1854
|
-
configurator: (n) => y(
|
|
1855
|
-
close: (n) => y(
|
|
1881
|
+
function y(n, { size: e = 20, strokeWidth: t = 1.75 } = {}) {
|
|
1882
|
+
return Ae(n, { width: e, height: e, "stroke-width": t });
|
|
1883
|
+
}
|
|
1884
|
+
const b = {
|
|
1885
|
+
ar: (n) => y(ui, n),
|
|
1886
|
+
fullscreen: (n) => y(gi, n),
|
|
1887
|
+
exitFullscreen: (n) => y(bi, n),
|
|
1888
|
+
screenshot: (n) => y(hi, n),
|
|
1889
|
+
tiltUp: (n) => y(fi, n),
|
|
1890
|
+
tiltDown: (n) => y(Ee, n),
|
|
1891
|
+
rotateLeft: (n) => y(mi, n),
|
|
1892
|
+
rotateRight: (n) => y(pi, n),
|
|
1893
|
+
zoomIn: (n) => y(wi, n),
|
|
1894
|
+
zoomOut: (n) => y(Ci, n),
|
|
1895
|
+
reset: (n) => y(vi, n),
|
|
1896
|
+
configurator: (n) => y(yi, n),
|
|
1897
|
+
close: (n) => y(Si, n)
|
|
1856
1898
|
};
|
|
1857
|
-
class
|
|
1899
|
+
class v {
|
|
1858
1900
|
element;
|
|
1859
|
-
constructor({ variant:
|
|
1860
|
-
this.element = document.createElement("button"), this.element.className = `ui-btn ui-btn--${
|
|
1901
|
+
constructor({ variant: e = "default", size: t = "default", label: i, icon: s, onClick: o, disabled: r = !1 } = {}) {
|
|
1902
|
+
this.element = document.createElement("button"), this.element.className = `ui-btn ui-btn--${e} ui-btn--size-${t}`, i !== void 0 && (this.element.setAttribute("aria-label", i), this.element.title = i), s !== void 0 ? this.element.appendChild(s) : i !== void 0 && (this.element.textContent = i), o && this.element.addEventListener("click", o), this.element.disabled = r;
|
|
1861
1903
|
}
|
|
1862
|
-
setIcon(
|
|
1863
|
-
const
|
|
1864
|
-
|
|
1904
|
+
setIcon(e) {
|
|
1905
|
+
const t = this.element.querySelector("svg");
|
|
1906
|
+
t !== null ? t.replaceWith(e) : this.element.appendChild(e);
|
|
1865
1907
|
}
|
|
1866
1908
|
}
|
|
1867
|
-
const
|
|
1909
|
+
const p = {
|
|
1868
1910
|
semantic: {
|
|
1869
1911
|
// eslint-disable-next-line vd-custom/enforce-error-codes -- This is a hex color, not an error code
|
|
1870
1912
|
error: "#dc2626"
|
|
@@ -1898,11 +1940,11 @@ const m = {
|
|
|
1898
1940
|
// 32px
|
|
1899
1941
|
9: "2.25rem"
|
|
1900
1942
|
};
|
|
1901
|
-
class
|
|
1943
|
+
class _i {
|
|
1902
1944
|
element;
|
|
1903
1945
|
constructor() {
|
|
1904
1946
|
this.element = document.createElement("div"), Object.assign(this.element.style, {
|
|
1905
|
-
background:
|
|
1947
|
+
background: p.white,
|
|
1906
1948
|
borderRadius: l[3],
|
|
1907
1949
|
padding: l[6],
|
|
1908
1950
|
boxShadow: `0 ${l[2]} ${l[8]} oklch(0% 0 0 / 20%)`,
|
|
@@ -1911,25 +1953,25 @@ class vi {
|
|
|
1911
1953
|
});
|
|
1912
1954
|
}
|
|
1913
1955
|
}
|
|
1914
|
-
class
|
|
1915
|
-
constructor(
|
|
1916
|
-
this.options =
|
|
1956
|
+
class ki {
|
|
1957
|
+
constructor(e = {}) {
|
|
1958
|
+
this.options = e, this.card = new _i(), this.backdrop = this.createBackdrop(), this.backdrop.appendChild(this.card.element);
|
|
1917
1959
|
}
|
|
1918
1960
|
options;
|
|
1919
1961
|
card;
|
|
1920
1962
|
backdrop;
|
|
1921
1963
|
keyHandler = null;
|
|
1922
1964
|
open() {
|
|
1923
|
-
document.body.appendChild(this.backdrop), this.keyHandler = (
|
|
1924
|
-
|
|
1965
|
+
document.body.appendChild(this.backdrop), this.keyHandler = (e) => {
|
|
1966
|
+
e.key === "Escape" && this.close();
|
|
1925
1967
|
}, document.addEventListener("keydown", this.keyHandler);
|
|
1926
1968
|
}
|
|
1927
1969
|
close() {
|
|
1928
1970
|
this.backdrop.remove(), this.keyHandler !== null && (document.removeEventListener("keydown", this.keyHandler), this.keyHandler = null), this.options.onClose?.();
|
|
1929
1971
|
}
|
|
1930
1972
|
createBackdrop() {
|
|
1931
|
-
const
|
|
1932
|
-
return Object.assign(
|
|
1973
|
+
const e = document.createElement("div");
|
|
1974
|
+
return Object.assign(e.style, {
|
|
1933
1975
|
position: "fixed",
|
|
1934
1976
|
inset: l[0],
|
|
1935
1977
|
background: "oklch(0% 0 0 / 50%)",
|
|
@@ -1937,57 +1979,138 @@ class yi {
|
|
|
1937
1979
|
display: "flex",
|
|
1938
1980
|
alignItems: "center",
|
|
1939
1981
|
justifyContent: "center"
|
|
1940
|
-
}),
|
|
1941
|
-
|
|
1942
|
-
}),
|
|
1982
|
+
}), e.addEventListener("click", (t) => {
|
|
1983
|
+
t.target === e && this.close();
|
|
1984
|
+
}), e;
|
|
1943
1985
|
}
|
|
1944
1986
|
}
|
|
1945
|
-
class
|
|
1987
|
+
class Ai {
|
|
1946
1988
|
element;
|
|
1947
1989
|
selectCallback = null;
|
|
1948
|
-
constructor(
|
|
1990
|
+
constructor(e, t, i) {
|
|
1949
1991
|
this.element = document.createElement("div"), this.element.className = "ui-toggle-group";
|
|
1950
|
-
for (let
|
|
1951
|
-
const
|
|
1952
|
-
r.className = "ui-toggle-group-item", r.dataset.value =
|
|
1953
|
-
this.selectCallback?.(
|
|
1992
|
+
for (let s = 0; s < e.length; s++) {
|
|
1993
|
+
const o = e[s], r = document.createElement("button");
|
|
1994
|
+
r.className = "ui-toggle-group-item", r.dataset.value = o, r.textContent = i?.[s] ?? o, r.dataset.state = o === t ? "on" : "off", r.setAttribute("aria-pressed", o === t ? "true" : "false"), r.addEventListener("click", () => {
|
|
1995
|
+
this.selectCallback?.(o);
|
|
1954
1996
|
}), this.element.appendChild(r);
|
|
1955
1997
|
}
|
|
1956
1998
|
}
|
|
1957
|
-
setSelected(
|
|
1958
|
-
for (const
|
|
1959
|
-
const i =
|
|
1960
|
-
|
|
1999
|
+
setSelected(e) {
|
|
2000
|
+
for (const t of this.element.querySelectorAll(".ui-toggle-group-item")) {
|
|
2001
|
+
const i = t.dataset.value === e;
|
|
2002
|
+
t.dataset.state = i ? "on" : "off", t.setAttribute("aria-pressed", i ? "true" : "false");
|
|
1961
2003
|
}
|
|
1962
2004
|
}
|
|
1963
|
-
onSelect(
|
|
1964
|
-
this.selectCallback =
|
|
2005
|
+
onSelect(e) {
|
|
2006
|
+
this.selectCallback = e;
|
|
2007
|
+
}
|
|
2008
|
+
/**
|
|
2009
|
+
* Enable only the given values; null lifts every restriction. A disabled
|
|
2010
|
+
* value stays visible (the buyer sees the option exists) but cannot be
|
|
2011
|
+
* picked: the selectable snapshot's "not in the list = grey".
|
|
2012
|
+
*/
|
|
2013
|
+
setEnabled(e) {
|
|
2014
|
+
for (const t of this.element.querySelectorAll(".ui-toggle-group-item")) {
|
|
2015
|
+
const i = e === null || e.includes(t.dataset.value ?? "");
|
|
2016
|
+
t.disabled = !i, t.setAttribute("aria-disabled", i ? "false" : "true");
|
|
2017
|
+
}
|
|
1965
2018
|
}
|
|
1966
2019
|
}
|
|
1967
|
-
class
|
|
2020
|
+
class Ei {
|
|
1968
2021
|
element;
|
|
1969
2022
|
select;
|
|
1970
|
-
constructor(
|
|
1971
|
-
this.select = document.createElement("select"), this.select.className = "ui-native-select", this.select.dataset.name =
|
|
2023
|
+
constructor(e, t, i, s, o) {
|
|
2024
|
+
this.select = document.createElement("select"), this.select.className = "ui-native-select", this.select.dataset.name = e, this.select.setAttribute("aria-label", i);
|
|
1972
2025
|
const r = document.createElement("option");
|
|
1973
2026
|
r.value = "", r.disabled = !0, r.textContent = i, this.select.appendChild(r);
|
|
1974
2027
|
let a = !1;
|
|
1975
|
-
for (let
|
|
1976
|
-
const
|
|
1977
|
-
|
|
2028
|
+
for (let u = 0; u < t.length; u++) {
|
|
2029
|
+
const f = t[u], h = document.createElement("option");
|
|
2030
|
+
h.value = f, h.textContent = o?.[u] ?? f, f === s && (h.selected = !0, a = !0), this.select.appendChild(h);
|
|
1978
2031
|
}
|
|
1979
2032
|
a || (r.selected = !0);
|
|
1980
|
-
const
|
|
1981
|
-
|
|
2033
|
+
const d = Ae(Ee, { width: 16, height: 16, "stroke-width": 2 });
|
|
2034
|
+
d.classList.add("ui-native-select-icon"), this.element = document.createElement("div"), this.element.className = "ui-native-select-wrap", this.element.appendChild(this.select), this.element.appendChild(d);
|
|
1982
2035
|
}
|
|
1983
|
-
setSelected(
|
|
1984
|
-
this.select.value =
|
|
2036
|
+
setSelected(e) {
|
|
2037
|
+
this.select.value = e;
|
|
1985
2038
|
}
|
|
1986
|
-
onSelect(
|
|
2039
|
+
onSelect(e) {
|
|
1987
2040
|
this.select.addEventListener("change", () => {
|
|
1988
|
-
|
|
2041
|
+
e(this.select.value);
|
|
2042
|
+
});
|
|
2043
|
+
}
|
|
2044
|
+
/** Enable only the given values; null lifts every restriction (see ToggleGroup.setEnabled). */
|
|
2045
|
+
setEnabled(e) {
|
|
2046
|
+
for (const t of this.select.options)
|
|
2047
|
+
t.value !== "" && (t.disabled = e !== null && !e.includes(t.value));
|
|
2048
|
+
}
|
|
2049
|
+
}
|
|
2050
|
+
class xi {
|
|
2051
|
+
element;
|
|
2052
|
+
input;
|
|
2053
|
+
valueText;
|
|
2054
|
+
values;
|
|
2055
|
+
options;
|
|
2056
|
+
selectCallback = null;
|
|
2057
|
+
settleCallback = null;
|
|
2058
|
+
constructor(e, t) {
|
|
2059
|
+
if (e.length === 0)
|
|
2060
|
+
throw new Error("Virtualdisplay: Slider needs at least one value");
|
|
2061
|
+
this.values = e, this.options = t, this.input = document.createElement("input"), this.input.type = "range", this.input.className = "ui-slider-input", this.input.min = "0", this.input.max = String(e.length - 1), this.input.step = "1", this.input.setAttribute("aria-label", t.label), this.valueText = document.createElement("span"), this.valueText.className = "ui-slider-value", this.valueText.setAttribute("aria-hidden", "true");
|
|
2062
|
+
const i = document.createElement("div");
|
|
2063
|
+
i.className = "ui-slider-track", i.appendChild(this.input), i.appendChild(this.buildEnds()), this.element = document.createElement("div"), this.element.className = "ui-slider", this.element.appendChild(i), this.element.appendChild(this.valueText);
|
|
2064
|
+
const s = t.initialSelected === void 0 ? 0 : e.indexOf(t.initialSelected);
|
|
2065
|
+
this.applyIndex(s === -1 ? 0 : s), this.listen();
|
|
2066
|
+
}
|
|
2067
|
+
setSelected(e) {
|
|
2068
|
+
const t = this.values.indexOf(e);
|
|
2069
|
+
t !== -1 && this.applyIndex(t);
|
|
2070
|
+
}
|
|
2071
|
+
/** Fires on every step a drag or keypress crosses, with the value it lands on. */
|
|
2072
|
+
onSelect(e) {
|
|
2073
|
+
this.selectCallback = e;
|
|
2074
|
+
}
|
|
2075
|
+
/** Fires once per interaction, when the value commits (drag released, key released). */
|
|
2076
|
+
onSettle(e) {
|
|
2077
|
+
this.settleCallback = e;
|
|
2078
|
+
}
|
|
2079
|
+
listen() {
|
|
2080
|
+
this.input.addEventListener("input", () => {
|
|
2081
|
+
const e = this.values[this.currentIndex];
|
|
2082
|
+
e !== void 0 && (this.applyIndex(this.currentIndex), this.selectCallback?.(e));
|
|
2083
|
+
}), this.input.addEventListener("change", () => {
|
|
2084
|
+
const e = this.values[this.currentIndex];
|
|
2085
|
+
e !== void 0 && this.settleCallback?.(e);
|
|
1989
2086
|
});
|
|
1990
2087
|
}
|
|
2088
|
+
get currentIndex() {
|
|
2089
|
+
return Number(this.input.value);
|
|
2090
|
+
}
|
|
2091
|
+
applyIndex(e) {
|
|
2092
|
+
this.input.value = String(e);
|
|
2093
|
+
const t = this.displayAt(e);
|
|
2094
|
+
this.valueText.textContent = t, this.input.setAttribute("aria-valuetext", t);
|
|
2095
|
+
const i = this.values.length === 1 ? 100 : e / (this.values.length - 1) * 100;
|
|
2096
|
+
this.element.style.setProperty("--ui-slider-pct", `${i}%`);
|
|
2097
|
+
}
|
|
2098
|
+
buildEnds() {
|
|
2099
|
+
const e = document.createElement("div");
|
|
2100
|
+
e.className = "ui-slider-ends", e.setAttribute("aria-hidden", "true");
|
|
2101
|
+
for (const t of [0, this.values.length - 1]) {
|
|
2102
|
+
const i = document.createElement("span");
|
|
2103
|
+
i.textContent = this.labelAt(t), e.appendChild(i);
|
|
2104
|
+
}
|
|
2105
|
+
return e;
|
|
2106
|
+
}
|
|
2107
|
+
labelAt(e) {
|
|
2108
|
+
return this.options.labels?.[e] ?? this.values[e] ?? "";
|
|
2109
|
+
}
|
|
2110
|
+
displayAt(e) {
|
|
2111
|
+
const t = this.labelAt(e);
|
|
2112
|
+
return this.options.unit === void 0 ? t : `${t} ${this.options.unit}`;
|
|
2113
|
+
}
|
|
1991
2114
|
}
|
|
1992
2115
|
const w = {
|
|
1993
2116
|
fontFamily: {
|
|
@@ -2006,7 +2129,7 @@ const w = {
|
|
|
2006
2129
|
medium: "500",
|
|
2007
2130
|
semibold: "600"
|
|
2008
2131
|
}
|
|
2009
|
-
}, x = w.fontFamily.sans.join(", "),
|
|
2132
|
+
}, x = w.fontFamily.sans.join(", "), Ti = `
|
|
2010
2133
|
--primary: oklch(5% 0 0);
|
|
2011
2134
|
--primary-foreground: oklch(100% 0 0);
|
|
2012
2135
|
--secondary: oklch(92% 0 0);
|
|
@@ -2019,8 +2142,8 @@ const w = {
|
|
|
2019
2142
|
--accent: oklch(92% 0 0);
|
|
2020
2143
|
--accent-foreground: oklch(5% 0 0);
|
|
2021
2144
|
--muted-foreground: oklch(44% 0 0);
|
|
2022
|
-
`,
|
|
2023
|
-
:root { ${
|
|
2145
|
+
`, Ri = `
|
|
2146
|
+
:root { ${Ti} }
|
|
2024
2147
|
|
|
2025
2148
|
/* ── Button ──────────────────────────────────────────────── */
|
|
2026
2149
|
.ui-btn {
|
|
@@ -2096,6 +2219,8 @@ const w = {
|
|
|
2096
2219
|
box-shadow: 0 1px 2px oklch(5% 0 0 / 8%);
|
|
2097
2220
|
}
|
|
2098
2221
|
.ui-toggle-group-item:hover { background: var(--accent); border-color: oklch(85% 0 0); }
|
|
2222
|
+
.ui-toggle-group-item:disabled { opacity: 0.4; cursor: not-allowed; }
|
|
2223
|
+
.ui-toggle-group-item:disabled:hover { background: var(--background); border-color: var(--border); }
|
|
2099
2224
|
.ui-toggle-group-item:active { transform: scale(0.98); }
|
|
2100
2225
|
.ui-toggle-group-item:focus-visible {
|
|
2101
2226
|
outline: none;
|
|
@@ -2149,6 +2274,97 @@ const w = {
|
|
|
2149
2274
|
pointer-events: none;
|
|
2150
2275
|
}
|
|
2151
2276
|
|
|
2277
|
+
/* ── Slider ──────────────────────────────────────────────── */
|
|
2278
|
+
.ui-slider {
|
|
2279
|
+
display: flex;
|
|
2280
|
+
align-items: center;
|
|
2281
|
+
gap: 0.75rem;
|
|
2282
|
+
inline-size: 100%;
|
|
2283
|
+
}
|
|
2284
|
+
|
|
2285
|
+
.ui-slider-track {
|
|
2286
|
+
flex: 1;
|
|
2287
|
+
min-inline-size: 0;
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
/* Tabular figures keep the readout and layout steady mid-drag. */
|
|
2291
|
+
.ui-slider-value {
|
|
2292
|
+
font-family: ${x};
|
|
2293
|
+
font-size: 0.875rem;
|
|
2294
|
+
font-weight: 600;
|
|
2295
|
+
color: var(--foreground);
|
|
2296
|
+
font-variant-numeric: tabular-nums;
|
|
2297
|
+
white-space: nowrap;
|
|
2298
|
+
}
|
|
2299
|
+
|
|
2300
|
+
.ui-slider-ends {
|
|
2301
|
+
display: flex;
|
|
2302
|
+
justify-content: space-between;
|
|
2303
|
+
font-family: ${x};
|
|
2304
|
+
font-size: 0.75rem;
|
|
2305
|
+
color: var(--muted-foreground);
|
|
2306
|
+
font-variant-numeric: tabular-nums;
|
|
2307
|
+
}
|
|
2308
|
+
|
|
2309
|
+
/* 2.75rem tall: the whole input is the touch target (44px). */
|
|
2310
|
+
.ui-slider-input {
|
|
2311
|
+
appearance: none;
|
|
2312
|
+
display: block;
|
|
2313
|
+
inline-size: 100%;
|
|
2314
|
+
block-size: 2.75rem;
|
|
2315
|
+
margin: 0;
|
|
2316
|
+
padding: 0;
|
|
2317
|
+
background: transparent;
|
|
2318
|
+
cursor: pointer;
|
|
2319
|
+
}
|
|
2320
|
+
.ui-slider-input:focus-visible { outline: none; }
|
|
2321
|
+
|
|
2322
|
+
/* --ui-slider-pct is set by the component; it fills the track up to the thumb. */
|
|
2323
|
+
.ui-slider-input::-webkit-slider-runnable-track {
|
|
2324
|
+
block-size: 0.375rem;
|
|
2325
|
+
border-radius: 9999px;
|
|
2326
|
+
background: linear-gradient(to right, var(--primary) var(--ui-slider-pct, 0%), var(--secondary) var(--ui-slider-pct, 0%));
|
|
2327
|
+
}
|
|
2328
|
+
.ui-slider-input::-webkit-slider-thumb {
|
|
2329
|
+
appearance: none;
|
|
2330
|
+
inline-size: 1.25rem;
|
|
2331
|
+
block-size: 1.25rem;
|
|
2332
|
+
margin-block-start: -0.4375rem; /* centre the 1.25rem thumb on the 0.375rem track */
|
|
2333
|
+
border-radius: 50%;
|
|
2334
|
+
border: 2px solid var(--primary);
|
|
2335
|
+
background: var(--background);
|
|
2336
|
+
box-shadow: 0 1px 3px oklch(5% 0 0 / 20%);
|
|
2337
|
+
transition: box-shadow 200ms, border-color 200ms;
|
|
2338
|
+
}
|
|
2339
|
+
.ui-slider-input:focus-visible::-webkit-slider-thumb {
|
|
2340
|
+
border-color: var(--ring);
|
|
2341
|
+
box-shadow: 0 0 0 3px oklch(5% 0 0 / 12%);
|
|
2342
|
+
}
|
|
2343
|
+
|
|
2344
|
+
.ui-slider-input::-moz-range-track {
|
|
2345
|
+
block-size: 0.375rem;
|
|
2346
|
+
border-radius: 9999px;
|
|
2347
|
+
background: var(--secondary);
|
|
2348
|
+
}
|
|
2349
|
+
.ui-slider-input::-moz-range-progress {
|
|
2350
|
+
block-size: 0.375rem;
|
|
2351
|
+
border-radius: 9999px;
|
|
2352
|
+
background: var(--primary);
|
|
2353
|
+
}
|
|
2354
|
+
.ui-slider-input::-moz-range-thumb {
|
|
2355
|
+
inline-size: 1.25rem;
|
|
2356
|
+
block-size: 1.25rem;
|
|
2357
|
+
border-radius: 50%;
|
|
2358
|
+
border: 2px solid var(--primary);
|
|
2359
|
+
background: var(--background);
|
|
2360
|
+
box-shadow: 0 1px 3px oklch(5% 0 0 / 20%);
|
|
2361
|
+
transition: box-shadow 200ms, border-color 200ms;
|
|
2362
|
+
}
|
|
2363
|
+
.ui-slider-input:focus-visible::-moz-range-thumb {
|
|
2364
|
+
border-color: var(--ring);
|
|
2365
|
+
box-shadow: 0 0 0 3px oklch(5% 0 0 / 12%);
|
|
2366
|
+
}
|
|
2367
|
+
|
|
2152
2368
|
/* ── Annotation layer ───────────────────────────────────── */
|
|
2153
2369
|
.vd-annotations-layer {
|
|
2154
2370
|
position: absolute;
|
|
@@ -2297,114 +2513,114 @@ const w = {
|
|
|
2297
2513
|
50% { opacity: 0.55; }
|
|
2298
2514
|
}
|
|
2299
2515
|
`;
|
|
2300
|
-
let
|
|
2301
|
-
function
|
|
2302
|
-
if (
|
|
2516
|
+
let le = !1;
|
|
2517
|
+
function xe() {
|
|
2518
|
+
if (le || typeof document > "u")
|
|
2303
2519
|
return;
|
|
2304
|
-
|
|
2520
|
+
le = !0;
|
|
2305
2521
|
const n = document.createElement("style");
|
|
2306
|
-
n.id = "vd-ui-vanilla", n.textContent =
|
|
2522
|
+
n.id = "vd-ui-vanilla", n.textContent = Ri, document.head.appendChild(n);
|
|
2307
2523
|
}
|
|
2308
|
-
const
|
|
2309
|
-
class
|
|
2524
|
+
const Ii = w.fontFamily.sans.join(", ");
|
|
2525
|
+
class Li {
|
|
2310
2526
|
qrLib = null;
|
|
2311
2527
|
dialog = null;
|
|
2312
2528
|
qrSlot = null;
|
|
2313
2529
|
/** Open the modal immediately, with a loading placeholder in the QR slot. */
|
|
2314
2530
|
show() {
|
|
2315
|
-
this.hide(),
|
|
2531
|
+
this.hide(), xe(), this.dialog = new ki({ onClose: () => {
|
|
2316
2532
|
this.dialog = null, this.qrSlot = null;
|
|
2317
2533
|
} }), Object.assign(this.dialog.card.element.style, {
|
|
2318
2534
|
display: "flex",
|
|
2319
2535
|
flexDirection: "column",
|
|
2320
2536
|
alignItems: "center",
|
|
2321
2537
|
gap: l[3],
|
|
2322
|
-
fontFamily:
|
|
2323
|
-
}), this.dialog.card.element.appendChild(this.createText(
|
|
2538
|
+
fontFamily: Ii
|
|
2539
|
+
}), this.dialog.card.element.appendChild(this.createText(Bt(), {
|
|
2324
2540
|
fontSize: w.fontSize.base,
|
|
2325
2541
|
fontWeight: w.fontWeight.semibold,
|
|
2326
|
-
color:
|
|
2327
|
-
})), this.dialog.card.element.appendChild(this.createText(
|
|
2542
|
+
color: p.neutral[900]
|
|
2543
|
+
})), this.dialog.card.element.appendChild(this.createText(qt(), {
|
|
2328
2544
|
fontSize: w.fontSize.sm,
|
|
2329
|
-
color:
|
|
2330
|
-
})), this.qrSlot = this.createQrSlot(), this.dialog.card.element.appendChild(this.qrSlot), this.dialog.card.element.appendChild(this.createText(
|
|
2545
|
+
color: p.neutral[600]
|
|
2546
|
+
})), this.qrSlot = this.createQrSlot(), this.dialog.card.element.appendChild(this.qrSlot), this.dialog.card.element.appendChild(this.createText(Yt(), {
|
|
2331
2547
|
fontSize: w.fontSize.xs,
|
|
2332
|
-
color:
|
|
2548
|
+
color: p.neutral[500]
|
|
2333
2549
|
}));
|
|
2334
|
-
const
|
|
2550
|
+
const e = new v({
|
|
2335
2551
|
variant: "outline",
|
|
2336
|
-
label:
|
|
2552
|
+
label: Jt(),
|
|
2337
2553
|
onClick: () => {
|
|
2338
2554
|
this.hide();
|
|
2339
2555
|
}
|
|
2340
2556
|
});
|
|
2341
|
-
this.dialog.card.element.appendChild(
|
|
2557
|
+
this.dialog.card.element.appendChild(e.element), this.dialog.open();
|
|
2342
2558
|
}
|
|
2343
2559
|
/**
|
|
2344
2560
|
* Render the QR for `url` into the open modal's slot, replacing the loading
|
|
2345
2561
|
* placeholder. Resolves `true` once the QR is actually on screen; `false`
|
|
2346
2562
|
* when the modal was closed before it could render (nothing reopens).
|
|
2347
2563
|
*/
|
|
2348
|
-
async update(
|
|
2564
|
+
async update(e) {
|
|
2349
2565
|
this.qrLib ??= await import("./browser-ey6Iih3j.js").then((i) => i.b);
|
|
2350
|
-
const
|
|
2566
|
+
const t = await this.qrLib.toDataURL(e, {
|
|
2351
2567
|
width: 256,
|
|
2352
2568
|
margin: 4,
|
|
2353
2569
|
errorCorrectionLevel: "M",
|
|
2354
|
-
color: { dark:
|
|
2570
|
+
color: { dark: p.black, light: p.white }
|
|
2355
2571
|
});
|
|
2356
|
-
return this.qrSlot === null ? !1 : (this.qrSlot.classList.remove("ui-qr-slot--loading"), this.qrSlot.replaceChildren(this.createQrImage(
|
|
2572
|
+
return this.qrSlot === null ? !1 : (this.qrSlot.classList.remove("ui-qr-slot--loading"), this.qrSlot.replaceChildren(this.createQrImage(t)), !0);
|
|
2357
2573
|
}
|
|
2358
2574
|
hide() {
|
|
2359
2575
|
this.dialog?.close(), this.dialog = null, this.qrSlot = null;
|
|
2360
2576
|
}
|
|
2361
|
-
createText(
|
|
2577
|
+
createText(e, t) {
|
|
2362
2578
|
const i = document.createElement("p");
|
|
2363
|
-
return i.textContent =
|
|
2579
|
+
return i.textContent = e, Object.assign(i.style, { margin: "0", textAlign: "center", ...t }), i;
|
|
2364
2580
|
}
|
|
2365
2581
|
createQrSlot() {
|
|
2366
|
-
const
|
|
2367
|
-
return
|
|
2582
|
+
const e = document.createElement("div");
|
|
2583
|
+
return e.className = "ui-qr-slot ui-qr-slot--loading", e;
|
|
2368
2584
|
}
|
|
2369
|
-
createQrImage(
|
|
2370
|
-
const
|
|
2371
|
-
return
|
|
2585
|
+
createQrImage(e) {
|
|
2586
|
+
const t = document.createElement("img");
|
|
2587
|
+
return t.src = e, t.alt = "QR code", t;
|
|
2372
2588
|
}
|
|
2373
2589
|
}
|
|
2374
|
-
function
|
|
2375
|
-
const
|
|
2376
|
-
return
|
|
2590
|
+
function ce(n) {
|
|
2591
|
+
const e = Math.max(0, Math.min(1, n));
|
|
2592
|
+
return e * e * (3 - 2 * e);
|
|
2377
2593
|
}
|
|
2378
|
-
function
|
|
2379
|
-
const [r, a,
|
|
2380
|
-
return [i +
|
|
2594
|
+
function Oi(n, e, t, i, s, o) {
|
|
2595
|
+
const [r, a, d] = n, u = Math.cos(e), f = Math.sin(e), h = u * r + f * d, E = -f * r + u * d, k = Math.cos(t), _ = Math.sin(t), I = k * a - _ * E, P = _ * a + k * E, J = 0.55;
|
|
2596
|
+
return [i + h * o * J, s - I * o * J, P];
|
|
2381
2597
|
}
|
|
2382
|
-
function
|
|
2383
|
-
n.beginPath(), n.moveTo(
|
|
2598
|
+
function Ni(n, e, t) {
|
|
2599
|
+
n.beginPath(), n.moveTo(e[0], e[1]), n.lineTo(t[0], t[1]), n.strokeStyle = "#000", n.lineWidth = 2, n.stroke();
|
|
2384
2600
|
}
|
|
2385
|
-
function
|
|
2386
|
-
const
|
|
2387
|
-
|
|
2388
|
-
|
|
2389
|
-
|
|
2601
|
+
function Mi(n, e, t, i, s) {
|
|
2602
|
+
const o = e(t), r = e(i), a = [
|
|
2603
|
+
o[0] + (r[0] - o[0]) * s,
|
|
2604
|
+
o[1] + (r[1] - o[1]) * s,
|
|
2605
|
+
o[2]
|
|
2390
2606
|
];
|
|
2391
|
-
|
|
2607
|
+
Ni(n, o, a);
|
|
2392
2608
|
}
|
|
2393
|
-
const $ = [-1, -1, 1], D = [1, -1, 1],
|
|
2609
|
+
const $ = [-1, -1, 1], D = [1, -1, 1], U = [1, -1, -1], B = [-1, -1, -1], V = [-1, 1, 1], j = [1, 1, 1], H = [1, 1, -1], q = [-1, 1, -1], de = [
|
|
2394
2610
|
[$, D],
|
|
2395
|
-
[D,
|
|
2396
|
-
[
|
|
2397
|
-
[
|
|
2611
|
+
[D, U],
|
|
2612
|
+
[U, B],
|
|
2613
|
+
[B, $],
|
|
2398
2614
|
[$, V],
|
|
2399
2615
|
[D, j],
|
|
2400
|
-
[
|
|
2401
|
-
[
|
|
2616
|
+
[U, H],
|
|
2617
|
+
[B, q],
|
|
2402
2618
|
[V, j],
|
|
2403
2619
|
[j, H],
|
|
2404
2620
|
[H, q],
|
|
2405
2621
|
[q, V]
|
|
2406
|
-
],
|
|
2407
|
-
function
|
|
2622
|
+
], zi = 400, ue = '-apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif';
|
|
2623
|
+
function Pi() {
|
|
2408
2624
|
const n = document.createElement("div");
|
|
2409
2625
|
Object.assign(n.style, {
|
|
2410
2626
|
position: "absolute",
|
|
@@ -2418,15 +2634,15 @@ function Ii() {
|
|
|
2418
2634
|
opacity: "0",
|
|
2419
2635
|
transition: "opacity 0.3s ease-in-out"
|
|
2420
2636
|
});
|
|
2421
|
-
const
|
|
2422
|
-
Object.assign(
|
|
2637
|
+
const e = document.createElement("canvas");
|
|
2638
|
+
Object.assign(e.style, {
|
|
2423
2639
|
width: "100%",
|
|
2424
2640
|
height: "100%",
|
|
2425
2641
|
position: "absolute",
|
|
2426
2642
|
inset: "0"
|
|
2427
2643
|
});
|
|
2428
|
-
const
|
|
2429
|
-
Object.assign(
|
|
2644
|
+
const t = document.createElement("div");
|
|
2645
|
+
Object.assign(t.style, {
|
|
2430
2646
|
position: "absolute",
|
|
2431
2647
|
top: "56%",
|
|
2432
2648
|
left: "0",
|
|
@@ -2440,16 +2656,16 @@ function Ii() {
|
|
|
2440
2656
|
fontWeight: "400",
|
|
2441
2657
|
color: "#000",
|
|
2442
2658
|
fontVariantNumeric: "tabular-nums",
|
|
2443
|
-
fontFamily:
|
|
2659
|
+
fontFamily: ue
|
|
2444
2660
|
});
|
|
2445
|
-
const
|
|
2446
|
-
return Object.assign(
|
|
2661
|
+
const s = document.createElement("span");
|
|
2662
|
+
return Object.assign(s.style, {
|
|
2447
2663
|
fontSize: "13px",
|
|
2448
2664
|
color: "#000",
|
|
2449
|
-
fontFamily:
|
|
2450
|
-
}),
|
|
2665
|
+
fontFamily: ue
|
|
2666
|
+
}), s.textContent = _e(), t.appendChild(i), t.appendChild(s), n.appendChild(e), n.appendChild(t), { overlay: n, canvas: e, pctEl: i, phaseEl: s };
|
|
2451
2667
|
}
|
|
2452
|
-
class
|
|
2668
|
+
class Fi {
|
|
2453
2669
|
overlay;
|
|
2454
2670
|
canvas;
|
|
2455
2671
|
ctx;
|
|
@@ -2460,34 +2676,34 @@ class Oi {
|
|
|
2460
2676
|
startTime;
|
|
2461
2677
|
hidden = !1;
|
|
2462
2678
|
visible = !1;
|
|
2463
|
-
constructor(
|
|
2679
|
+
constructor(e, t = {}) {
|
|
2464
2680
|
this.startTime = performance.now();
|
|
2465
|
-
const i =
|
|
2466
|
-
this.overlay = i.overlay, this.canvas = i.canvas, this.pctEl = i.pctEl, this.phaseEl = i.phaseEl,
|
|
2467
|
-
const
|
|
2681
|
+
const i = Pi();
|
|
2682
|
+
this.overlay = i.overlay, this.canvas = i.canvas, this.pctEl = i.pctEl, this.phaseEl = i.phaseEl, e.appendChild(this.overlay), this.ctx = this.canvas.getContext("2d"), this.ctx !== null && (this.sizeCanvas(), this.tick());
|
|
2683
|
+
const s = t.showDelay ?? zi;
|
|
2468
2684
|
this.showTimerId = setTimeout(() => {
|
|
2469
2685
|
this.reveal();
|
|
2470
|
-
},
|
|
2686
|
+
}, s);
|
|
2471
2687
|
}
|
|
2472
2688
|
get loadingTexts() {
|
|
2473
2689
|
return {
|
|
2474
|
-
downloading:
|
|
2475
|
-
rendering:
|
|
2690
|
+
downloading: _e(),
|
|
2691
|
+
rendering: un()
|
|
2476
2692
|
};
|
|
2477
2693
|
}
|
|
2478
|
-
updateProgress(
|
|
2479
|
-
this.hidden || (this.pctEl.textContent = `${Math.round(
|
|
2694
|
+
updateProgress(e, t) {
|
|
2695
|
+
this.hidden || (this.pctEl.textContent = `${Math.round(e)}%`, this.phaseEl.textContent = t !== "" ? ` · ${t}` : "");
|
|
2480
2696
|
}
|
|
2481
2697
|
/**
|
|
2482
2698
|
* Show an error state — stops animation and displays the error message.
|
|
2483
2699
|
* The overlay stays visible so the user knows something went wrong.
|
|
2484
2700
|
*/
|
|
2485
|
-
showError(
|
|
2701
|
+
showError(e) {
|
|
2486
2702
|
if (this.hidden = !1, this.animationId !== null && (cancelAnimationFrame(this.animationId), this.animationId = null), this.ctx !== null) {
|
|
2487
|
-
const
|
|
2488
|
-
this.ctx.fillStyle = "#fff", this.ctx.fillRect(0, 0, i *
|
|
2703
|
+
const t = Math.min(devicePixelRatio, 2), i = this.canvas.width / t, s = this.canvas.height / t;
|
|
2704
|
+
this.ctx.fillStyle = "#fff", this.ctx.fillRect(0, 0, i * t, s * t);
|
|
2489
2705
|
}
|
|
2490
|
-
this.pctEl.textContent = "", this.phaseEl.textContent =
|
|
2706
|
+
this.pctEl.textContent = "", this.phaseEl.textContent = e, this.phaseEl.style.color = "#b91c1c", this.reveal();
|
|
2491
2707
|
}
|
|
2492
2708
|
hide() {
|
|
2493
2709
|
if (!this.hidden) {
|
|
@@ -2514,8 +2730,8 @@ class Oi {
|
|
|
2514
2730
|
sizeCanvas() {
|
|
2515
2731
|
if (this.ctx === null)
|
|
2516
2732
|
return;
|
|
2517
|
-
const
|
|
2518
|
-
this.canvas.width =
|
|
2733
|
+
const e = Math.min(devicePixelRatio, 2), t = this.overlay.clientWidth || 440, i = this.overlay.clientHeight || 360;
|
|
2734
|
+
this.canvas.width = t * e, this.canvas.height = i * e, this.ctx.scale(e, e), this.ctx.lineCap = "round", this.ctx.lineJoin = "round";
|
|
2519
2735
|
}
|
|
2520
2736
|
tick = () => {
|
|
2521
2737
|
this.hidden || (this.drawFrame(), this.animationId = requestAnimationFrame(this.tick));
|
|
@@ -2523,24 +2739,24 @@ class Oi {
|
|
|
2523
2739
|
drawFrame() {
|
|
2524
2740
|
if (this.ctx === null)
|
|
2525
2741
|
return;
|
|
2526
|
-
const
|
|
2527
|
-
this.ctx.fillStyle = "#fff", this.ctx.fillRect(0, 0,
|
|
2528
|
-
const
|
|
2742
|
+
const e = this.canvas.width / Math.min(devicePixelRatio, 2), t = this.canvas.height / Math.min(devicePixelRatio, 2), i = (performance.now() - this.startTime) / 1e3;
|
|
2743
|
+
this.ctx.fillStyle = "#fff", this.ctx.fillRect(0, 0, e, t);
|
|
2744
|
+
const s = e / 2, o = t * 0.44, r = Math.min(e, t) * 0.08, a = 0.785, d = 0.615, u = (_) => Oi(_, a, d, s, o, r), f = 6, h = i % f / f, E = de.length;
|
|
2529
2745
|
let k;
|
|
2530
|
-
|
|
2531
|
-
for (let
|
|
2532
|
-
const
|
|
2533
|
-
if (
|
|
2746
|
+
h < 0.35 ? k = ce(h / 0.35) * E : h < 0.55 ? k = E : h < 0.9 ? k = (1 - ce((h - 0.55) / 0.35)) * E : k = 0, this.ctx.shadowBlur = 5, this.ctx.shadowColor = "rgba(30,30,30,0.08)";
|
|
2747
|
+
for (let _ = 0; _ < E && !(_ >= k); _++) {
|
|
2748
|
+
const I = de[_];
|
|
2749
|
+
if (I === void 0)
|
|
2534
2750
|
continue;
|
|
2535
|
-
const P = Math.min(1, k -
|
|
2536
|
-
|
|
2751
|
+
const P = Math.min(1, k - _);
|
|
2752
|
+
Mi(this.ctx, u, I[0], I[1], P);
|
|
2537
2753
|
}
|
|
2538
2754
|
this.ctx.shadowBlur = 0;
|
|
2539
2755
|
}
|
|
2540
2756
|
}
|
|
2541
|
-
class
|
|
2542
|
-
constructor(
|
|
2543
|
-
this.options =
|
|
2757
|
+
class $i {
|
|
2758
|
+
constructor(e) {
|
|
2759
|
+
this.options = e, this.element = document.createElement("div"), Object.assign(this.element.style, { display: "flex", gap: "0.375rem" }), this.onFullscreenChange = () => {
|
|
2544
2760
|
this.setFullscreenIcon(document.fullscreenElement !== null);
|
|
2545
2761
|
}, document.addEventListener("fullscreenchange", this.onFullscreenChange);
|
|
2546
2762
|
}
|
|
@@ -2549,30 +2765,30 @@ class Ni {
|
|
|
2549
2765
|
arBtn = null;
|
|
2550
2766
|
fullscreenBtn = null;
|
|
2551
2767
|
onFullscreenChange;
|
|
2552
|
-
setFullscreenIcon(
|
|
2553
|
-
this.fullscreenBtn !== null && this.fullscreenBtn.setIcon(
|
|
2768
|
+
setFullscreenIcon(e) {
|
|
2769
|
+
this.fullscreenBtn !== null && this.fullscreenBtn.setIcon(e ? b.exitFullscreen() : b.fullscreen());
|
|
2554
2770
|
}
|
|
2555
|
-
syncButton(
|
|
2556
|
-
if (
|
|
2557
|
-
const
|
|
2558
|
-
return this.element.appendChild(
|
|
2771
|
+
syncButton(e, t, i) {
|
|
2772
|
+
if (t && e === null) {
|
|
2773
|
+
const s = i();
|
|
2774
|
+
return this.element.appendChild(s.element), s;
|
|
2559
2775
|
}
|
|
2560
|
-
return !
|
|
2776
|
+
return !t && e !== null ? (e.element.remove(), null) : e;
|
|
2561
2777
|
}
|
|
2562
|
-
applySettings(
|
|
2563
|
-
this.arBtn = this.syncButton(this.arBtn,
|
|
2778
|
+
applySettings(e) {
|
|
2779
|
+
this.arBtn = this.syncButton(this.arBtn, e.ar !== !1 && this.options.onAr !== void 0, () => new v({
|
|
2564
2780
|
variant: "outline",
|
|
2565
2781
|
size: "icon",
|
|
2566
|
-
label:
|
|
2567
|
-
icon:
|
|
2782
|
+
label: Ft(),
|
|
2783
|
+
icon: b.ar(),
|
|
2568
2784
|
onClick: () => {
|
|
2569
2785
|
this.options.onAr?.();
|
|
2570
2786
|
}
|
|
2571
|
-
})), this.fullscreenBtn = this.syncButton(this.fullscreenBtn,
|
|
2787
|
+
})), this.fullscreenBtn = this.syncButton(this.fullscreenBtn, e.fullscreen !== !1 && this.options.onFullscreen !== void 0, () => new v({
|
|
2572
2788
|
variant: "outline",
|
|
2573
2789
|
size: "icon",
|
|
2574
|
-
label:
|
|
2575
|
-
icon:
|
|
2790
|
+
label: sn(),
|
|
2791
|
+
icon: b.fullscreen(),
|
|
2576
2792
|
onClick: () => {
|
|
2577
2793
|
this.options.onFullscreen?.();
|
|
2578
2794
|
}
|
|
@@ -2582,81 +2798,81 @@ class Ni {
|
|
|
2582
2798
|
document.removeEventListener("fullscreenchange", this.onFullscreenChange);
|
|
2583
2799
|
}
|
|
2584
2800
|
}
|
|
2585
|
-
const
|
|
2801
|
+
const R = 0.5;
|
|
2586
2802
|
class z {
|
|
2587
2803
|
element;
|
|
2588
|
-
constructor(
|
|
2804
|
+
constructor(e, t) {
|
|
2589
2805
|
this.element = Object.assign(document.createElement("div"), { className: "vd-camera-controls" });
|
|
2590
2806
|
const i = {
|
|
2591
|
-
targetRotation:
|
|
2592
|
-
targetTilt:
|
|
2593
|
-
targetZoom:
|
|
2807
|
+
targetRotation: t.rotation,
|
|
2808
|
+
targetTilt: t.tilt,
|
|
2809
|
+
targetZoom: t.zoom,
|
|
2594
2810
|
thetaOffset: 0
|
|
2595
|
-
},
|
|
2596
|
-
|
|
2597
|
-
i.targetRotation =
|
|
2598
|
-
}), this.element.appendChild(z.buildZoom(
|
|
2811
|
+
}, s = Di(e, t, i);
|
|
2812
|
+
t.onChange((o) => {
|
|
2813
|
+
i.targetRotation = o.rotation - i.thetaOffset, i.targetTilt = o.tilt, i.targetZoom = o.zoom, Ui(s, t, o);
|
|
2814
|
+
}), this.element.appendChild(z.buildZoom(s.zoomOut, s.zoomIn)), this.element.appendChild(z.buildDpad(s.tiltUp, s.rotateLeft, s.reset, s.rotateRight, s.tiltDown));
|
|
2599
2815
|
}
|
|
2600
|
-
static buildZoom(
|
|
2816
|
+
static buildZoom(e, t) {
|
|
2601
2817
|
const i = document.createElement("div");
|
|
2602
|
-
return i.className = "vd-zoom", i.appendChild(
|
|
2818
|
+
return i.className = "vd-zoom", i.appendChild(e.element), i.appendChild(t.element), i;
|
|
2603
2819
|
}
|
|
2604
|
-
static buildDpad(
|
|
2820
|
+
static buildDpad(e, t, i, s, o) {
|
|
2605
2821
|
const r = document.createElement("div");
|
|
2606
2822
|
r.className = "vd-dpad";
|
|
2607
|
-
for (const [a,
|
|
2608
|
-
[
|
|
2609
|
-
[
|
|
2823
|
+
for (const [a, d] of [
|
|
2824
|
+
[e, "up"],
|
|
2825
|
+
[t, "left"],
|
|
2610
2826
|
[i, "center"],
|
|
2611
|
-
[
|
|
2612
|
-
[
|
|
2827
|
+
[s, "right"],
|
|
2828
|
+
[o, "down"]
|
|
2613
2829
|
])
|
|
2614
|
-
a.element.classList.add(`vd-dpad-${
|
|
2830
|
+
a.element.classList.add(`vd-dpad-${d}`), r.appendChild(a.element);
|
|
2615
2831
|
return r;
|
|
2616
2832
|
}
|
|
2617
2833
|
}
|
|
2618
|
-
function
|
|
2619
|
-
const i = (r) => Math.max(
|
|
2620
|
-
const a =
|
|
2621
|
-
return a !== void 0 ||
|
|
2622
|
-
},
|
|
2623
|
-
const a =
|
|
2624
|
-
if (a !== void 0 ||
|
|
2625
|
-
|
|
2834
|
+
function Di(n, e, t) {
|
|
2835
|
+
const i = (r) => Math.max(e.limits?.minZoom ?? 1, Math.min(e.limits?.maxZoom ?? 1 / 0, r)), s = (r) => {
|
|
2836
|
+
const a = e.limits?.minRotate, d = e.limits?.maxRotate;
|
|
2837
|
+
return a !== void 0 || d !== void 0 ? Math.max(a ?? -1 / 0, Math.min(d ?? 1 / 0, r)) : r;
|
|
2838
|
+
}, o = (r) => {
|
|
2839
|
+
const a = e.limits?.minTilt, d = e.limits?.maxTilt;
|
|
2840
|
+
if (a !== void 0 || d !== void 0) {
|
|
2841
|
+
t.targetTilt = Math.max(a ?? 0, Math.min(d ?? 180, t.targetTilt + r)), n.tilt(t.targetTilt).set();
|
|
2626
2842
|
return;
|
|
2627
2843
|
}
|
|
2628
|
-
const
|
|
2629
|
-
|
|
2844
|
+
const u = t.targetTilt + r;
|
|
2845
|
+
u > 180 || u < 0 ? (t.targetTilt = u > 180 ? 360 - u : -u, t.thetaOffset = (t.thetaOffset + 180) % 360, n.tilt(t.targetTilt).rotate(t.targetRotation + t.thetaOffset).set()) : (t.targetTilt = u, n.tilt(t.targetTilt).set());
|
|
2630
2846
|
};
|
|
2631
2847
|
return {
|
|
2632
|
-
zoomOut: new
|
|
2633
|
-
|
|
2848
|
+
zoomOut: new v({ variant: "outline", size: "icon", label: zn(), icon: b.zoomOut(), onClick: () => {
|
|
2849
|
+
t.targetZoom = i(t.targetZoom - 10), n.zoom(t.targetZoom).set();
|
|
2634
2850
|
} }),
|
|
2635
|
-
zoomIn: new
|
|
2636
|
-
|
|
2851
|
+
zoomIn: new v({ variant: "outline", size: "icon", label: Ln(), icon: b.zoomIn(), onClick: () => {
|
|
2852
|
+
t.targetZoom = i(t.targetZoom + 10), n.zoom(t.targetZoom).set();
|
|
2637
2853
|
} }),
|
|
2638
|
-
tiltUp: new
|
|
2639
|
-
|
|
2854
|
+
tiltUp: new v({ variant: "outline", size: "icon", label: Zn(), icon: b.tiltUp(), onClick: () => {
|
|
2855
|
+
o(-15);
|
|
2640
2856
|
} }),
|
|
2641
|
-
rotateLeft: new
|
|
2642
|
-
|
|
2857
|
+
rotateLeft: new v({ variant: "outline", size: "icon", label: Dn(), icon: b.rotateLeft(), onClick: () => {
|
|
2858
|
+
t.targetRotation = s(t.targetRotation - 15), n.rotate(t.targetRotation + t.thetaOffset).set();
|
|
2643
2859
|
} }),
|
|
2644
|
-
reset: new
|
|
2645
|
-
|
|
2860
|
+
reset: new v({ variant: "outline", size: "icon", label: xn(), icon: b.reset(), onClick: () => {
|
|
2861
|
+
t.thetaOffset = 0, n.reset();
|
|
2646
2862
|
} }),
|
|
2647
|
-
rotateRight: new
|
|
2648
|
-
|
|
2863
|
+
rotateRight: new v({ variant: "outline", size: "icon", label: jn(), icon: b.rotateRight(), onClick: () => {
|
|
2864
|
+
t.targetRotation = s(t.targetRotation + 15), n.rotate(t.targetRotation + t.thetaOffset).set();
|
|
2649
2865
|
} }),
|
|
2650
|
-
tiltDown: new
|
|
2651
|
-
|
|
2866
|
+
tiltDown: new v({ variant: "outline", size: "icon", label: Kn(), icon: b.tiltDown(), onClick: () => {
|
|
2867
|
+
o(15);
|
|
2652
2868
|
} })
|
|
2653
2869
|
};
|
|
2654
2870
|
}
|
|
2655
|
-
function
|
|
2656
|
-
const i =
|
|
2657
|
-
i !== void 0 && (n.zoomOut.element.disabled = i.minZoom !== void 0 &&
|
|
2871
|
+
function Ui(n, e, t) {
|
|
2872
|
+
const i = e.limits;
|
|
2873
|
+
i !== void 0 && (n.zoomOut.element.disabled = i.minZoom !== void 0 && t.zoom <= i.minZoom + R, n.zoomIn.element.disabled = i.maxZoom !== void 0 && t.zoom >= i.maxZoom - R, n.tiltUp.element.disabled = i.minTilt !== void 0 && t.tilt <= i.minTilt + R, n.tiltDown.element.disabled = i.maxTilt !== void 0 && t.tilt >= i.maxTilt - R, n.rotateLeft.element.disabled = i.minRotate !== void 0 && t.rotation <= i.minRotate + R, n.rotateRight.element.disabled = i.maxRotate !== void 0 && t.rotation >= i.maxRotate - R);
|
|
2658
2874
|
}
|
|
2659
|
-
const
|
|
2875
|
+
const T = {
|
|
2660
2876
|
/** Attribute selection requested (cancelable). `detail`: `{ attribute, value }`. */
|
|
2661
2877
|
SELECT: "ui:select",
|
|
2662
2878
|
/** Attribute selection applied. `detail`: `{ attribute, value }`. */
|
|
@@ -2667,30 +2883,97 @@ const O = {
|
|
|
2667
2883
|
CONFIGURATION_CHANGE: "vd:configuration-change",
|
|
2668
2884
|
/** Configuration submitted (bubbles). `detail`: the resolved configuration handed to the host. */
|
|
2669
2885
|
CONFIGURATION_SUBMIT: "vd:configuration-submit"
|
|
2670
|
-
},
|
|
2671
|
-
|
|
2672
|
-
|
|
2673
|
-
|
|
2674
|
-
|
|
2675
|
-
}
|
|
2676
|
-
function
|
|
2677
|
-
const
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
2691
|
-
|
|
2886
|
+
}, Te = {
|
|
2887
|
+
mm: 1,
|
|
2888
|
+
cm: 10,
|
|
2889
|
+
m: 1e3,
|
|
2890
|
+
in: 25.4
|
|
2891
|
+
}, he = 3;
|
|
2892
|
+
function Bi(n) {
|
|
2893
|
+
const e = n.stepMm / Te[n.displayUnit];
|
|
2894
|
+
for (let t = 0; t <= he; t++) {
|
|
2895
|
+
const i = e * 10 ** t;
|
|
2896
|
+
if (Math.abs(i - Math.round(i)) < 1e-9)
|
|
2897
|
+
return t;
|
|
2898
|
+
}
|
|
2899
|
+
return he;
|
|
2900
|
+
}
|
|
2901
|
+
function Vi(n, e, t) {
|
|
2902
|
+
const i = Bi(e), s = n / Te[e.displayUnit];
|
|
2903
|
+
return new Intl.NumberFormat(t, {
|
|
2904
|
+
minimumFractionDigits: i,
|
|
2905
|
+
maximumFractionDigits: i
|
|
2906
|
+
}).format(s);
|
|
2907
|
+
}
|
|
2908
|
+
function ji(n, e, t, i, s, o, r) {
|
|
2909
|
+
const a = m(), d = n.values.map((h) => Vi(Number(h), e, a)), u = n.values.find((h) => t.getValue(n.name, h)?.isSelected === !0) ?? n.defaultValue, f = new xi(n.values, {
|
|
2910
|
+
label: n.name,
|
|
2911
|
+
labels: d,
|
|
2912
|
+
unit: e.displayUnit,
|
|
2913
|
+
...u !== void 0 && { initialSelected: u }
|
|
2914
|
+
});
|
|
2915
|
+
return f.onSelect((h) => {
|
|
2916
|
+
s(n.name, h);
|
|
2917
|
+
}), f.onSettle((h) => {
|
|
2918
|
+
i.dispatch(T.SELECT, { attribute: n.name, value: h }, !0).defaultPrevented || o(n.name, h);
|
|
2919
|
+
}), r(n.name, (h) => {
|
|
2920
|
+
f.setSelected(h.value), i.dispatch(T.SELECTED, { attribute: n.name, value: h.value });
|
|
2921
|
+
}), {
|
|
2922
|
+
element: f.element,
|
|
2923
|
+
// No per-notch grey-out on the slider in v1: a range control cannot
|
|
2924
|
+
// honestly disable one notch. The exclusion still works, the way it
|
|
2925
|
+
// always does, on the other side: the viewer's selectable snapshot greys
|
|
2926
|
+
// the leg that cannot do this size. A slider-side treatment is a later
|
|
2927
|
+
// refinement, noted in task 040.
|
|
2928
|
+
setSelectable: () => {
|
|
2929
|
+
}
|
|
2930
|
+
};
|
|
2931
|
+
}
|
|
2932
|
+
const Hi = 5;
|
|
2933
|
+
let qi = 0;
|
|
2934
|
+
function Q(n) {
|
|
2935
|
+
const e = n.replace(/([A-Z])/g, " $1").trim();
|
|
2936
|
+
return e.charAt(0).toUpperCase() + e.slice(1).toLowerCase();
|
|
2937
|
+
}
|
|
2938
|
+
function Gi(n, e, t, i, s, o) {
|
|
2939
|
+
const r = document.createElement("div");
|
|
2940
|
+
r.className = "vd-attribute", r.dataset.name = n.name;
|
|
2941
|
+
const a = document.createElement("span");
|
|
2942
|
+
a.className = "vd-attribute-label", a.textContent = Q(n.name), a.id = `vd-attribute-label-${qi++}`, r.appendChild(a), r.setAttribute("role", "group"), r.setAttribute("aria-labelledby", a.id);
|
|
2943
|
+
const d = (f) => {
|
|
2944
|
+
r.style.display = f ? "none" : "";
|
|
2945
|
+
}, u = n.dimension !== void 0 ? ji(
|
|
2946
|
+
n,
|
|
2947
|
+
n.dimension,
|
|
2948
|
+
e,
|
|
2949
|
+
t,
|
|
2950
|
+
s,
|
|
2951
|
+
i,
|
|
2952
|
+
o
|
|
2953
|
+
) : Zi(n, e, t, i, o);
|
|
2954
|
+
return r.appendChild(u.element), { element: r, setSelectable: u.setSelectable, setHidden: d };
|
|
2955
|
+
}
|
|
2956
|
+
function Zi(n, e, t, i, s) {
|
|
2957
|
+
const o = n.values.find(
|
|
2958
|
+
(d) => e.getValue(n.name, d)?.isSelected === !0
|
|
2959
|
+
), r = n.values.map(Q), a = n.values.length <= Hi ? new Ai(n.values, o, r) : new Ei(n.name, n.values, Q(n.name), o, r);
|
|
2960
|
+
return a.onSelect((d) => {
|
|
2961
|
+
t.dispatch(T.SELECT, { attribute: n.name, value: d }, !0).defaultPrevented || i(n.name, d);
|
|
2962
|
+
}), s(n.name, (d) => {
|
|
2963
|
+
a.setSelected(d.value), t.dispatch(T.SELECTED, { attribute: n.name, value: d.value });
|
|
2964
|
+
}), {
|
|
2965
|
+
element: a.element,
|
|
2966
|
+
setSelectable: (d) => {
|
|
2967
|
+
a.setEnabled(d);
|
|
2968
|
+
}
|
|
2969
|
+
};
|
|
2970
|
+
}
|
|
2971
|
+
const Wi = 80, Yi = 2500;
|
|
2972
|
+
class Qi {
|
|
2973
|
+
constructor(e, t = Yi) {
|
|
2974
|
+
this.configuration = e, this.resetMs = t, this.element = document.createElement("div"), this.element.className = "vd-commerce vd-hidden";
|
|
2692
2975
|
const i = document.createElement("div");
|
|
2693
|
-
i.className = "vd-commerce-price", this.priceEl = document.createElement("span"), this.priceEl.className = "vd-price", this.vatEl = document.createElement("span"), this.vatEl.className = "vd-vat", i.append(this.priceEl, this.vatEl), this.button = new
|
|
2976
|
+
i.className = "vd-commerce-price", this.priceEl = document.createElement("span"), this.priceEl.className = "vd-price", this.vatEl = document.createElement("span"), this.vatEl.className = "vd-vat", i.append(this.priceEl, this.vatEl), this.button = new v({ variant: "default", onClick: () => {
|
|
2694
2977
|
this.handleSubmit();
|
|
2695
2978
|
} }), this.button.element.classList.add("vd-cta", "vd-hidden"), this.element.append(i, this.button.element), this.unsubscribe = this.configuration.onRender(() => {
|
|
2696
2979
|
this.update();
|
|
@@ -2708,30 +2991,30 @@ class Bi {
|
|
|
2708
2991
|
/** Re-render from the facade. Called on every resolve and on submit-handler registration. */
|
|
2709
2992
|
update() {
|
|
2710
2993
|
this.renderPrice(this.configuration.current), this.renderButton();
|
|
2711
|
-
const
|
|
2712
|
-
this.element.classList.toggle("vd-hidden", !
|
|
2994
|
+
const e = this.configuration.current !== void 0 || this.configuration.submitEnabled;
|
|
2995
|
+
this.element.classList.toggle("vd-hidden", !e);
|
|
2713
2996
|
}
|
|
2714
2997
|
destroy() {
|
|
2715
2998
|
this.unsubscribe(), this.resetTimer !== void 0 && clearTimeout(this.resetTimer), this.element.remove();
|
|
2716
2999
|
}
|
|
2717
|
-
renderPrice(
|
|
2718
|
-
if (
|
|
3000
|
+
renderPrice(e) {
|
|
3001
|
+
if (e === void 0) {
|
|
2719
3002
|
this.priceEl.textContent = "", this.vatEl.textContent = "";
|
|
2720
3003
|
return;
|
|
2721
3004
|
}
|
|
2722
|
-
this.priceEl.textContent =
|
|
3005
|
+
this.priceEl.textContent = Ki(e.price, e.currency), this.vatEl.textContent = me(this.configuration.vatDisplay);
|
|
2723
3006
|
}
|
|
2724
3007
|
renderButton() {
|
|
2725
|
-
const
|
|
2726
|
-
this.button.element.classList.toggle("vd-hidden", !
|
|
3008
|
+
const e = this.configuration.submitEnabled;
|
|
3009
|
+
this.button.element.classList.toggle("vd-hidden", !e), e && this.state === "idle" && this.setButtonText(me(this.configuration.buttonLabel));
|
|
2727
3010
|
}
|
|
2728
3011
|
async handleSubmit() {
|
|
2729
3012
|
if (this.state !== "busy") {
|
|
2730
|
-
this.setState("busy",
|
|
3013
|
+
this.setState("busy", ti());
|
|
2731
3014
|
try {
|
|
2732
|
-
await this.configuration.submit(), this.setState("success",
|
|
3015
|
+
await this.configuration.submit(), this.setState("success", oi());
|
|
2733
3016
|
} catch {
|
|
2734
|
-
this.setState("failed",
|
|
3017
|
+
this.setState("failed", ci());
|
|
2735
3018
|
}
|
|
2736
3019
|
this.scheduleReset();
|
|
2737
3020
|
}
|
|
@@ -2741,43 +3024,43 @@ class Bi {
|
|
|
2741
3024
|
this.state = "idle", this.update();
|
|
2742
3025
|
}, this.resetMs);
|
|
2743
3026
|
}
|
|
2744
|
-
setState(
|
|
2745
|
-
this.state =
|
|
3027
|
+
setState(e, t) {
|
|
3028
|
+
this.state = e, this.element.dataset.submit = e, this.button.element.disabled = e === "busy", this.setButtonText(t);
|
|
2746
3029
|
}
|
|
2747
|
-
setButtonText(
|
|
2748
|
-
this.button.element.textContent =
|
|
3030
|
+
setButtonText(e) {
|
|
3031
|
+
this.button.element.textContent = e, this.button.element.setAttribute("aria-label", e);
|
|
2749
3032
|
}
|
|
2750
3033
|
}
|
|
2751
|
-
function
|
|
2752
|
-
return (n ?? "").slice(0,
|
|
3034
|
+
function me(n) {
|
|
3035
|
+
return (n ?? "").slice(0, Wi);
|
|
2753
3036
|
}
|
|
2754
|
-
function
|
|
3037
|
+
function Ki(n, e) {
|
|
2755
3038
|
try {
|
|
2756
|
-
const
|
|
2757
|
-
return
|
|
3039
|
+
const t = new Intl.NumberFormat(m(), { style: "currency", currency: e }), i = t.resolvedOptions().maximumFractionDigits ?? 2;
|
|
3040
|
+
return t.format(n / 10 ** i);
|
|
2758
3041
|
} catch {
|
|
2759
|
-
return `${
|
|
3042
|
+
return `${e} ${(n / 100).toFixed(2)}`;
|
|
2760
3043
|
}
|
|
2761
3044
|
}
|
|
2762
|
-
class
|
|
3045
|
+
class Re {
|
|
2763
3046
|
slot = null;
|
|
2764
3047
|
panel = null;
|
|
2765
|
-
attach(
|
|
2766
|
-
this.panel =
|
|
3048
|
+
attach(e, t) {
|
|
3049
|
+
this.panel = t, t.style.display = "none", this.slot = document.createElement("div"), this.slot.className = "vd-slot-bottom-left", this.slot.appendChild(t), e.appendChild(this.slot);
|
|
2767
3050
|
}
|
|
2768
|
-
setVisible(
|
|
2769
|
-
this.panel !== null && (this.panel.style.display =
|
|
3051
|
+
setVisible(e) {
|
|
3052
|
+
this.panel !== null && (this.panel.style.display = e ? "flex" : "none");
|
|
2770
3053
|
}
|
|
2771
3054
|
destroy() {
|
|
2772
3055
|
this.slot?.remove(), this.slot = null, this.panel = null;
|
|
2773
3056
|
}
|
|
2774
3057
|
}
|
|
2775
|
-
const
|
|
2776
|
-
class
|
|
3058
|
+
const Xi = 572;
|
|
3059
|
+
class Ji {
|
|
2777
3060
|
/** @param actionBarSlot The shared corner slot the AR/fullscreen buttons live in — the
|
|
2778
3061
|
* "open configurator" toggle joins them there instead of floating as its own overlay. */
|
|
2779
|
-
constructor(
|
|
2780
|
-
this.actionBarSlot =
|
|
3062
|
+
constructor(e) {
|
|
3063
|
+
this.actionBarSlot = e;
|
|
2781
3064
|
}
|
|
2782
3065
|
actionBarSlot;
|
|
2783
3066
|
element = null;
|
|
@@ -2789,71 +3072,71 @@ class ji {
|
|
|
2789
3072
|
collapsible = !1;
|
|
2790
3073
|
expanded = !0;
|
|
2791
3074
|
visible = !1;
|
|
2792
|
-
attach(
|
|
2793
|
-
this.container =
|
|
3075
|
+
attach(e, t) {
|
|
3076
|
+
this.container = e, t.classList.add("vd-attributes-sidebar"), this.closeButton = new v({
|
|
2794
3077
|
variant: "ghost",
|
|
2795
3078
|
size: "icon-sm",
|
|
2796
|
-
label:
|
|
2797
|
-
icon:
|
|
3079
|
+
label: _n(),
|
|
3080
|
+
icon: b.close({ size: 18 }),
|
|
2798
3081
|
onClick: () => {
|
|
2799
3082
|
this.expanded = !1, this.render();
|
|
2800
3083
|
}
|
|
2801
3084
|
});
|
|
2802
3085
|
const i = document.createElement("div");
|
|
2803
|
-
i.className = "vd-sidebar-header", i.appendChild(this.closeButton.element), this.body = document.createElement("div"), this.body.className = "vd-sidebar-body", this.body.appendChild(
|
|
3086
|
+
i.className = "vd-sidebar-header", i.appendChild(this.closeButton.element), this.body = document.createElement("div"), this.body.className = "vd-sidebar-body", this.body.appendChild(t), this.element = document.createElement("div"), this.element.className = "vd-sidebar vd-hidden", this.element.append(i, this.body), e.appendChild(this.element), this.openButton = new v({
|
|
2804
3087
|
variant: "outline",
|
|
2805
3088
|
size: "icon",
|
|
2806
|
-
label:
|
|
2807
|
-
icon:
|
|
3089
|
+
label: yn(),
|
|
3090
|
+
icon: b.configurator({ size: 18 }),
|
|
2808
3091
|
onClick: () => {
|
|
2809
3092
|
this.expanded = !0, this.render();
|
|
2810
3093
|
}
|
|
2811
3094
|
}), this.openButton.element.classList.add("vd-configurator-toggle", "vd-hidden"), this.actionBarSlot.appendChild(this.openButton.element), this.observe();
|
|
2812
3095
|
}
|
|
2813
|
-
setVisible(
|
|
2814
|
-
this.visible =
|
|
3096
|
+
setVisible(e) {
|
|
3097
|
+
this.visible = e, this.render();
|
|
2815
3098
|
}
|
|
2816
3099
|
destroy() {
|
|
2817
3100
|
this.observer?.disconnect(), this.observer = null, this.openButton?.element.remove(), this.element?.remove(), this.container?.classList.remove("vd-layout-sidebar-right", "vd-layout-sidebar-permanent"), this.container = null;
|
|
2818
3101
|
}
|
|
2819
3102
|
observe() {
|
|
2820
|
-
typeof ResizeObserver > "u" || this.container === null || (this.observer = new ResizeObserver((
|
|
2821
|
-
const
|
|
2822
|
-
this.setCollapsible(
|
|
3103
|
+
typeof ResizeObserver > "u" || this.container === null || (this.observer = new ResizeObserver((e) => {
|
|
3104
|
+
const t = e[0]?.contentRect.width ?? 0;
|
|
3105
|
+
this.setCollapsible(t > 0 && t < Xi);
|
|
2823
3106
|
}), this.observer.observe(this.container));
|
|
2824
3107
|
}
|
|
2825
|
-
setCollapsible(
|
|
2826
|
-
|
|
3108
|
+
setCollapsible(e) {
|
|
3109
|
+
e !== this.collapsible && (this.collapsible = e, this.expanded = !e, this.render());
|
|
2827
3110
|
}
|
|
2828
3111
|
render() {
|
|
2829
3112
|
if (this.element === null || this.openButton === null || this.closeButton === null || this.container === null)
|
|
2830
3113
|
return;
|
|
2831
|
-
const
|
|
2832
|
-
this.element.classList.toggle("vd-hidden", !this.visible), this.element.classList.toggle("vd-sidebar-collapsed",
|
|
3114
|
+
const e = this.visible && this.expanded, t = this.visible && !this.expanded;
|
|
3115
|
+
this.element.classList.toggle("vd-hidden", !this.visible), this.element.classList.toggle("vd-sidebar-collapsed", t), this.openButton.element.classList.toggle("vd-hidden", !t), this.closeButton.element.style.display = this.collapsible ? "" : "none", this.container.classList.toggle("vd-layout-sidebar-right", e), this.container.classList.toggle("vd-layout-sidebar-permanent", e && !this.collapsible);
|
|
2833
3116
|
}
|
|
2834
3117
|
}
|
|
2835
|
-
class
|
|
2836
|
-
attach(
|
|
3118
|
+
class es {
|
|
3119
|
+
attach(e, t) {
|
|
2837
3120
|
}
|
|
2838
|
-
setVisible(
|
|
3121
|
+
setVisible(e) {
|
|
2839
3122
|
}
|
|
2840
3123
|
destroy() {
|
|
2841
3124
|
}
|
|
2842
3125
|
}
|
|
2843
|
-
const
|
|
2844
|
-
"inframe-bottom-left": () => new
|
|
2845
|
-
"sidebar-right": (n) => new
|
|
2846
|
-
hidden: () => new
|
|
3126
|
+
const ts = {
|
|
3127
|
+
"inframe-bottom-left": () => new Re(),
|
|
3128
|
+
"sidebar-right": (n) => new Ji(n),
|
|
3129
|
+
hidden: () => new es()
|
|
2847
3130
|
};
|
|
2848
|
-
function
|
|
2849
|
-
return (
|
|
3131
|
+
function ns(n, e) {
|
|
3132
|
+
return (ts[n ?? ""] ?? (() => new Re()))(e);
|
|
2850
3133
|
}
|
|
2851
|
-
const
|
|
3134
|
+
const G = w.fontFamily.sans.join(", "), Z = `
|
|
2852
3135
|
position: absolute;
|
|
2853
3136
|
display: flex;
|
|
2854
3137
|
z-index: 10;
|
|
2855
3138
|
transition: inset-inline-end 0.18s ease;
|
|
2856
|
-
`,
|
|
3139
|
+
`, is = `
|
|
2857
3140
|
/* Override browser's default black fullscreen backdrop */
|
|
2858
3141
|
.vd-container:fullscreen {
|
|
2859
3142
|
background: oklch(100% 0 0);
|
|
@@ -2861,7 +3144,7 @@ const Z = w.fontFamily.sans.join(", "), W = `
|
|
|
2861
3144
|
|
|
2862
3145
|
/* Layout slots — four corners */
|
|
2863
3146
|
.vd-slot-top-right {
|
|
2864
|
-
${
|
|
3147
|
+
${Z}
|
|
2865
3148
|
inset-block-start: ${l[3]};
|
|
2866
3149
|
inset-inline-end: ${l[3]};
|
|
2867
3150
|
flex-direction: column;
|
|
@@ -2870,7 +3153,7 @@ const Z = w.fontFamily.sans.join(", "), W = `
|
|
|
2870
3153
|
}
|
|
2871
3154
|
|
|
2872
3155
|
.vd-slot-bottom-left {
|
|
2873
|
-
${
|
|
3156
|
+
${Z}
|
|
2874
3157
|
inset-block-end: ${l[3]};
|
|
2875
3158
|
inset-inline-start: ${l[3]};
|
|
2876
3159
|
flex-direction: column;
|
|
@@ -2879,7 +3162,7 @@ const Z = w.fontFamily.sans.join(", "), W = `
|
|
|
2879
3162
|
}
|
|
2880
3163
|
|
|
2881
3164
|
.vd-slot-bottom-right {
|
|
2882
|
-
${
|
|
3165
|
+
${Z}
|
|
2883
3166
|
inset-block-end: ${l[3]};
|
|
2884
3167
|
inset-inline-end: ${l[3]};
|
|
2885
3168
|
flex-direction: row;
|
|
@@ -2891,7 +3174,7 @@ const Z = w.fontFamily.sans.join(", "), W = `
|
|
|
2891
3174
|
display: flex;
|
|
2892
3175
|
flex-direction: column;
|
|
2893
3176
|
gap: ${l[1]};
|
|
2894
|
-
background: color-mix(in oklch, ${
|
|
3177
|
+
background: color-mix(in oklch, ${p.white} 85%, transparent);
|
|
2895
3178
|
backdrop-filter: blur(8px);
|
|
2896
3179
|
border-radius: ${l[2]};
|
|
2897
3180
|
padding: ${l[2]};
|
|
@@ -2919,13 +3202,13 @@ const Z = w.fontFamily.sans.join(", "), W = `
|
|
|
2919
3202
|
display: flex;
|
|
2920
3203
|
flex-direction: column;
|
|
2921
3204
|
gap: ${l[3]};
|
|
2922
|
-
background: color-mix(in oklch, ${
|
|
3205
|
+
background: color-mix(in oklch, ${p.white} 85%, transparent);
|
|
2923
3206
|
backdrop-filter: blur(8px);
|
|
2924
|
-
border: 1px solid color-mix(in oklch, ${
|
|
3207
|
+
border: 1px solid color-mix(in oklch, ${p.neutral[900]} 8%, transparent);
|
|
2925
3208
|
border-radius: ${l[3]};
|
|
2926
3209
|
padding: ${l[3]};
|
|
2927
|
-
box-shadow: 0 ${l[1]} ${l[4]} color-mix(in oklch, ${
|
|
2928
|
-
font-family: ${
|
|
3210
|
+
box-shadow: 0 ${l[1]} ${l[4]} color-mix(in oklch, ${p.neutral[900]} 6%, transparent);
|
|
3211
|
+
font-family: ${G};
|
|
2929
3212
|
}
|
|
2930
3213
|
|
|
2931
3214
|
.vd-attribute {
|
|
@@ -2938,10 +3221,10 @@ const Z = w.fontFamily.sans.join(", "), W = `
|
|
|
2938
3221
|
.vd-attribute-label {
|
|
2939
3222
|
font-size: ${w.fontSize.xs};
|
|
2940
3223
|
font-weight: ${w.fontWeight.medium};
|
|
2941
|
-
color: ${
|
|
3224
|
+
color: ${p.neutral[500]};
|
|
2942
3225
|
text-transform: uppercase;
|
|
2943
3226
|
letter-spacing: 0.05em;
|
|
2944
|
-
font-family: ${
|
|
3227
|
+
font-family: ${G};
|
|
2945
3228
|
}
|
|
2946
3229
|
|
|
2947
3230
|
/* sidebar-right layout — a docked, full-height right panel */
|
|
@@ -2977,10 +3260,10 @@ const Z = w.fontFamily.sans.join(", "), W = `
|
|
|
2977
3260
|
z-index: 11;
|
|
2978
3261
|
display: flex;
|
|
2979
3262
|
flex-direction: column;
|
|
2980
|
-
background: color-mix(in oklch, ${
|
|
3263
|
+
background: color-mix(in oklch, ${p.white} 90%, transparent);
|
|
2981
3264
|
backdrop-filter: blur(10px);
|
|
2982
|
-
border-inline-start: 1px solid color-mix(in oklch, ${
|
|
2983
|
-
box-shadow: -${l[1]} 0 ${l[4]} color-mix(in oklch, ${
|
|
3265
|
+
border-inline-start: 1px solid color-mix(in oklch, ${p.neutral[900]} 8%, transparent);
|
|
3266
|
+
box-shadow: -${l[1]} 0 ${l[4]} color-mix(in oklch, ${p.neutral[900]} 5%, transparent);
|
|
2984
3267
|
}
|
|
2985
3268
|
|
|
2986
3269
|
@media (prefers-reduced-motion: no-preference) {
|
|
@@ -3022,8 +3305,8 @@ const Z = w.fontFamily.sans.join(", "), W = `
|
|
|
3022
3305
|
flex-direction: column;
|
|
3023
3306
|
gap: ${l[2]};
|
|
3024
3307
|
padding-block-start: ${l[3]};
|
|
3025
|
-
border-block-start: 1px solid color-mix(in oklch, ${
|
|
3026
|
-
font-family: ${
|
|
3308
|
+
border-block-start: 1px solid color-mix(in oklch, ${p.neutral[900]} 8%, transparent);
|
|
3309
|
+
font-family: ${G};
|
|
3027
3310
|
}
|
|
3028
3311
|
|
|
3029
3312
|
.vd-commerce-price {
|
|
@@ -3035,12 +3318,12 @@ const Z = w.fontFamily.sans.join(", "), W = `
|
|
|
3035
3318
|
.vd-price {
|
|
3036
3319
|
font-size: ${w.fontSize.lg};
|
|
3037
3320
|
font-weight: ${w.fontWeight.semibold};
|
|
3038
|
-
color: ${
|
|
3321
|
+
color: ${p.neutral[900]};
|
|
3039
3322
|
}
|
|
3040
3323
|
|
|
3041
3324
|
.vd-vat {
|
|
3042
3325
|
font-size: ${w.fontSize.xs};
|
|
3043
|
-
color: ${
|
|
3326
|
+
color: ${p.neutral[500]};
|
|
3044
3327
|
}
|
|
3045
3328
|
|
|
3046
3329
|
.vd-cta {
|
|
@@ -3050,23 +3333,23 @@ const Z = w.fontFamily.sans.join(", "), W = `
|
|
|
3050
3333
|
|
|
3051
3334
|
/* Failed submit is the one place red belongs: a clear, recoverable error state. */
|
|
3052
3335
|
.vd-commerce[data-submit="failed"] .vd-cta {
|
|
3053
|
-
background: ${
|
|
3054
|
-
border-color: ${
|
|
3055
|
-
color: ${
|
|
3336
|
+
background: ${p.semantic.error};
|
|
3337
|
+
border-color: ${p.semantic.error};
|
|
3338
|
+
color: ${p.white};
|
|
3056
3339
|
}
|
|
3057
3340
|
|
|
3058
3341
|
`;
|
|
3059
|
-
function
|
|
3060
|
-
if (
|
|
3342
|
+
function ss() {
|
|
3343
|
+
if (xe(), document.getElementById("vd-styles") !== null)
|
|
3061
3344
|
return;
|
|
3062
3345
|
const n = document.createElement("style");
|
|
3063
|
-
n.id = "vd-styles", n.textContent =
|
|
3346
|
+
n.id = "vd-styles", n.textContent = is, document.head.appendChild(n);
|
|
3064
3347
|
}
|
|
3065
|
-
function
|
|
3066
|
-
const
|
|
3067
|
-
|
|
3348
|
+
function os(n, e) {
|
|
3349
|
+
const t = document.createElement("a");
|
|
3350
|
+
t.href = `data:image/png;base64,${n}`, t.download = e, t.click();
|
|
3068
3351
|
}
|
|
3069
|
-
class
|
|
3352
|
+
class rs {
|
|
3070
3353
|
options;
|
|
3071
3354
|
settings = {};
|
|
3072
3355
|
container = null;
|
|
@@ -3076,13 +3359,17 @@ class Qi {
|
|
|
3076
3359
|
actionBar = null;
|
|
3077
3360
|
cameraControls = null;
|
|
3078
3361
|
attributes = null;
|
|
3362
|
+
/** Rendered attribute groups by name, so a selectable snapshot can reach their controls. */
|
|
3363
|
+
groupHandles = /* @__PURE__ */ new Map();
|
|
3364
|
+
/** The latest selectable snapshot, re-applied when the controls re-render. */
|
|
3365
|
+
lastSelectable = null;
|
|
3079
3366
|
layout = null;
|
|
3080
3367
|
commerce = null;
|
|
3081
|
-
constructor(
|
|
3082
|
-
this.options =
|
|
3368
|
+
constructor(e) {
|
|
3369
|
+
this.options = e;
|
|
3083
3370
|
}
|
|
3084
|
-
attach(
|
|
3085
|
-
|
|
3371
|
+
attach(e) {
|
|
3372
|
+
ss(), this.container = e, this.loading = new Fi(e), this.slots.topRight = this.createSlot(e, "vd-slot-top-right"), this.slots.bottomRight = this.createSlot(e, "vd-slot-bottom-right");
|
|
3086
3373
|
}
|
|
3087
3374
|
onReady() {
|
|
3088
3375
|
this.loading?.hide(), this.loading = null, this.mountToolbar(), this.cameraControls !== null && (this.cameraControls.element.style.display = "flex"), this.layout?.setVisible(!0);
|
|
@@ -3090,10 +3377,10 @@ class Qi {
|
|
|
3090
3377
|
mountToolbar() {
|
|
3091
3378
|
if (this.actionBar !== null || this.slots.bottomRight === null || this.container === null)
|
|
3092
3379
|
return;
|
|
3093
|
-
const
|
|
3094
|
-
this.actionBar = new
|
|
3380
|
+
const e = typeof this.container.requestFullscreen == "function";
|
|
3381
|
+
this.actionBar = new $i({
|
|
3095
3382
|
onAr: this.options.onAr,
|
|
3096
|
-
onFullscreen:
|
|
3383
|
+
onFullscreen: e ? () => {
|
|
3097
3384
|
this.toggleFullscreen();
|
|
3098
3385
|
} : void 0
|
|
3099
3386
|
}), this.actionBar.applySettings(this.settings), this.slots.bottomRight.appendChild(this.actionBar.element), this.syncScreenshotButton(), this.placeScreenshotButton();
|
|
@@ -3101,27 +3388,49 @@ class Qi {
|
|
|
3101
3388
|
toggleFullscreen() {
|
|
3102
3389
|
this.container !== null && (document.fullscreenElement !== null ? document.exitFullscreen() : (this.options.onFullscreenEnter?.(), this.container.requestFullscreen()));
|
|
3103
3390
|
}
|
|
3104
|
-
updateProgress(
|
|
3105
|
-
this.loading?.updateProgress(
|
|
3391
|
+
updateProgress(e, t) {
|
|
3392
|
+
this.loading?.updateProgress(e, t);
|
|
3106
3393
|
}
|
|
3107
|
-
showError(
|
|
3108
|
-
this.loading?.showError(
|
|
3394
|
+
showError(e) {
|
|
3395
|
+
this.loading?.showError(e);
|
|
3109
3396
|
}
|
|
3110
|
-
applyViewerSettings(
|
|
3111
|
-
this.settings =
|
|
3397
|
+
applyViewerSettings(e) {
|
|
3398
|
+
this.settings = e, e.language !== void 0 && Se(e.language, { reload: !1 }), this.syncScreenshotButton(), this.actionBar?.applySettings(e), this.cameraControls !== null && (this.cameraControls.element.style.display = e.cameraControls === !0 ? "flex" : "none"), this.placeScreenshotButton();
|
|
3112
3399
|
}
|
|
3113
|
-
renderAttributeControls(
|
|
3114
|
-
if (!(this.container === null || this.slots.topRight === null || this.slots.bottomRight === null) && (this.cameraControls?.element.remove(), this.cameraControls = null, this.teardownConfigurator(), this.settings.cameraControls === !0 && (this.cameraControls = new z(
|
|
3115
|
-
this.
|
|
3116
|
-
|
|
3117
|
-
|
|
3400
|
+
renderAttributeControls(e, t) {
|
|
3401
|
+
if (!(this.container === null || this.slots.topRight === null || this.slots.bottomRight === null) && (this.cameraControls?.element.remove(), this.cameraControls = null, this.teardownConfigurator(), this.settings.cameraControls === !0 && (this.cameraControls = new z(
|
|
3402
|
+
this.options.cameraApi,
|
|
3403
|
+
this.options.cameraPositionApi
|
|
3404
|
+
), this.cameraControls.element.style.display = "none", this.slots.topRight.appendChild(this.cameraControls.element)), this.placeScreenshotButton(), t.length !== 0)) {
|
|
3405
|
+
this.attributes = document.createElement("div"), this.attributes.className = "vd-attributes", this.groupHandles = /* @__PURE__ */ new Map();
|
|
3406
|
+
for (const i of t) {
|
|
3407
|
+
const s = Gi(
|
|
3118
3408
|
i,
|
|
3119
|
-
|
|
3409
|
+
e,
|
|
3120
3410
|
this.options.eventBus,
|
|
3121
3411
|
this.options.onSelect,
|
|
3412
|
+
this.options.onSelectTransient,
|
|
3122
3413
|
this.options.onSubscribe
|
|
3123
|
-
)
|
|
3124
|
-
|
|
3414
|
+
);
|
|
3415
|
+
this.groupHandles.set(i.name, s), this.attributes.appendChild(s.element);
|
|
3416
|
+
}
|
|
3417
|
+
this.commerce = new Qi(this.options.configuration), this.attributes.appendChild(this.commerce.element), this.layout = ns(
|
|
3418
|
+
this.settings.configuratorLayout,
|
|
3419
|
+
this.slots.bottomRight
|
|
3420
|
+
), this.layout.attach(this.container, this.attributes), this.lastSelectable !== null && this.applySelectable(this.lastSelectable);
|
|
3421
|
+
}
|
|
3422
|
+
}
|
|
3423
|
+
/**
|
|
3424
|
+
* Grey out what the viewer reports as not pickable: per attribute in the
|
|
3425
|
+
* snapshot only the listed values stay enabled; attributes the snapshot
|
|
3426
|
+
* does not name are unrestricted. The interface renders, it never knows
|
|
3427
|
+
* the exclusion rules (kiesbaarheid live, binding-studio task 17).
|
|
3428
|
+
*/
|
|
3429
|
+
applySelectable(e) {
|
|
3430
|
+
this.lastSelectable = e;
|
|
3431
|
+
for (const [t, i] of this.groupHandles) {
|
|
3432
|
+
const s = e.find((o) => o.name === t);
|
|
3433
|
+
i.setSelectable(s?.selectable ?? null), i.setHidden(s?.hidden === !0);
|
|
3125
3434
|
}
|
|
3126
3435
|
}
|
|
3127
3436
|
get viewerSettings() {
|
|
@@ -3129,128 +3438,145 @@ class Qi {
|
|
|
3129
3438
|
}
|
|
3130
3439
|
/** Tear down the configurator panel: price + CTA, attribute controls, layout. */
|
|
3131
3440
|
teardownConfigurator() {
|
|
3132
|
-
this.commerce?.destroy(), this.commerce = null, this.attributes?.remove(), this.attributes = null, this.layout?.destroy(), this.layout = null;
|
|
3441
|
+
this.commerce?.destroy(), this.commerce = null, this.attributes?.remove(), this.attributes = null, this.groupHandles = /* @__PURE__ */ new Map(), this.layout?.destroy(), this.layout = null;
|
|
3133
3442
|
}
|
|
3134
3443
|
destroy() {
|
|
3135
3444
|
this.loading?.destroy(), this.screenshotBtn?.element.remove(), this.actionBar?.destroy(), this.actionBar?.element.remove(), this.cameraControls?.element.remove(), this.teardownConfigurator();
|
|
3136
|
-
for (const
|
|
3137
|
-
|
|
3445
|
+
for (const e of Object.values(this.slots))
|
|
3446
|
+
e?.remove();
|
|
3138
3447
|
this.container = null;
|
|
3139
3448
|
}
|
|
3140
|
-
createSlot(
|
|
3449
|
+
createSlot(e, t) {
|
|
3141
3450
|
const i = document.createElement("div");
|
|
3142
|
-
return i.className =
|
|
3451
|
+
return i.className = t, e.appendChild(i), i;
|
|
3143
3452
|
}
|
|
3144
3453
|
syncScreenshotButton() {
|
|
3145
|
-
const
|
|
3146
|
-
|
|
3454
|
+
const e = this.settings.screenshot === !0;
|
|
3455
|
+
e && this.screenshotBtn === null && (this.screenshotBtn = new v({
|
|
3147
3456
|
variant: "outline",
|
|
3148
3457
|
size: "icon",
|
|
3149
|
-
label:
|
|
3150
|
-
icon:
|
|
3458
|
+
label: fn(),
|
|
3459
|
+
icon: b.screenshot(),
|
|
3151
3460
|
onClick: () => {
|
|
3152
|
-
this.options.snapshotApi.take("snapshot.png").onDeveloped(({ data:
|
|
3153
|
-
|
|
3461
|
+
this.options.snapshotApi.take("snapshot.png").onDeveloped(({ data: t, filename: i }) => {
|
|
3462
|
+
os(t, i);
|
|
3154
3463
|
});
|
|
3155
3464
|
}
|
|
3156
|
-
})), !
|
|
3465
|
+
})), !e && this.screenshotBtn !== null && (this.screenshotBtn.element.remove(), this.screenshotBtn = null);
|
|
3157
3466
|
}
|
|
3158
3467
|
placeScreenshotButton() {
|
|
3159
3468
|
this.screenshotBtn === null || this.slots.topRight === null || (this.cameraControls !== null ? this.cameraControls.element.appendChild(this.screenshotBtn.element) : this.slots.topRight.appendChild(this.screenshotBtn.element));
|
|
3160
3469
|
}
|
|
3161
3470
|
}
|
|
3162
|
-
const
|
|
3163
|
-
class
|
|
3471
|
+
const as = {};
|
|
3472
|
+
class ls {
|
|
3164
3473
|
defaultServer = "https://server.virtualdisplay.io";
|
|
3165
3474
|
options;
|
|
3166
3475
|
serverHost;
|
|
3167
3476
|
extraParams;
|
|
3168
|
-
constructor(
|
|
3169
|
-
this.options =
|
|
3477
|
+
constructor(e, t, i) {
|
|
3478
|
+
this.options = e, this.serverHost = t, this.extraParams = i;
|
|
3170
3479
|
}
|
|
3171
3480
|
/**
|
|
3172
3481
|
* Create container and iframe, attach to parent element
|
|
3173
3482
|
*/
|
|
3174
3483
|
create() {
|
|
3175
|
-
const
|
|
3176
|
-
return
|
|
3484
|
+
const e = this.createContainer(), t = this.createIframe();
|
|
3485
|
+
return e.appendChild(t), this.attachToParent(e), { container: e, iframe: t };
|
|
3177
3486
|
}
|
|
3178
3487
|
createContainer() {
|
|
3179
|
-
const
|
|
3180
|
-
return
|
|
3488
|
+
const e = document.createElement("div");
|
|
3489
|
+
return e.className = "vd-container", Object.assign(e.style, {
|
|
3181
3490
|
position: "relative",
|
|
3182
3491
|
width: "100%",
|
|
3183
3492
|
height: "100%",
|
|
3184
3493
|
overflow: "hidden"
|
|
3185
|
-
}),
|
|
3494
|
+
}), e;
|
|
3186
3495
|
}
|
|
3187
3496
|
createIframe() {
|
|
3188
|
-
const
|
|
3189
|
-
return
|
|
3497
|
+
const e = document.createElement("iframe");
|
|
3498
|
+
return e.src = this.buildUrl(), e.setAttribute("allow", "xr-spatial-tracking; fullscreen"), e;
|
|
3190
3499
|
}
|
|
3191
|
-
attachToParent(
|
|
3192
|
-
this.getParentElement().appendChild(
|
|
3500
|
+
attachToParent(e) {
|
|
3501
|
+
this.getParentElement().appendChild(e);
|
|
3193
3502
|
}
|
|
3194
3503
|
buildUrl() {
|
|
3195
|
-
const
|
|
3196
|
-
|
|
3197
|
-
for (const [i,
|
|
3198
|
-
|
|
3199
|
-
return
|
|
3504
|
+
const e = this.getServerUrl(), t = new URL(e);
|
|
3505
|
+
this.setAddressParams(t), this.options.language !== void 0 && t.searchParams.set("language", this.options.language), this.options.session !== void 0 && t.searchParams.set("session", this.options.session), this.options.debug === !0 && t.searchParams.set("debug", "true"), this.options.traceparent !== void 0 && t.searchParams.set("traceparent", this.options.traceparent);
|
|
3506
|
+
for (const [i, s] of Object.entries(this.extraParams ?? {}))
|
|
3507
|
+
t.searchParams.set(i, s);
|
|
3508
|
+
return t.toString();
|
|
3509
|
+
}
|
|
3510
|
+
/**
|
|
3511
|
+
* Put the address form on the URL. `app` names an app row; the
|
|
3512
|
+
* `license`/`model` pair resolves to the model's default app. When both are
|
|
3513
|
+
* given, `app` wins and the pair is ignored with a warning, so adding `app`
|
|
3514
|
+
* to an existing integration is additive rather than a swap.
|
|
3515
|
+
*/
|
|
3516
|
+
setAddressParams(e) {
|
|
3517
|
+
if (this.options.app === void 0) {
|
|
3518
|
+
e.searchParams.set("license", this.options.license), e.searchParams.set("model", this.options.model);
|
|
3519
|
+
return;
|
|
3520
|
+
}
|
|
3521
|
+
e.searchParams.set("app", this.options.app), (this.options.license !== void 0 || this.options.model !== void 0) && C.warn("Both `app` and `license`/`model` were supplied: `app` wins, the pair was ignored");
|
|
3200
3522
|
}
|
|
3201
3523
|
getServerUrl() {
|
|
3202
3524
|
if (this.serverHost !== void 0)
|
|
3203
3525
|
return this.serverHost;
|
|
3204
|
-
if (
|
|
3526
|
+
if (as?.VITE_VIRTUALDISPLAY_SERVER_HOST === void 0)
|
|
3205
3527
|
return this.defaultServer;
|
|
3206
3528
|
}
|
|
3207
3529
|
getParentElement() {
|
|
3208
3530
|
if (typeof this.options.parent != "string")
|
|
3209
3531
|
return this.options.parent;
|
|
3210
|
-
const
|
|
3211
|
-
if (
|
|
3212
|
-
throw
|
|
3213
|
-
return
|
|
3532
|
+
const e = document.querySelector(this.options.parent);
|
|
3533
|
+
if (e === null)
|
|
3534
|
+
throw g.parentNotFound(this.options.parent);
|
|
3535
|
+
return e;
|
|
3214
3536
|
}
|
|
3215
3537
|
}
|
|
3216
|
-
function
|
|
3217
|
-
const { messenger:
|
|
3218
|
-
|
|
3219
|
-
|
|
3220
|
-
}),
|
|
3221
|
-
|
|
3222
|
-
}),
|
|
3223
|
-
|
|
3224
|
-
}),
|
|
3225
|
-
|
|
3226
|
-
}),
|
|
3227
|
-
|
|
3228
|
-
}),
|
|
3229
|
-
|
|
3230
|
-
}),
|
|
3231
|
-
|
|
3232
|
-
}),
|
|
3233
|
-
|
|
3234
|
-
}),
|
|
3235
|
-
}
|
|
3236
|
-
function
|
|
3237
|
-
const { messenger:
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
}),
|
|
3241
|
-
|
|
3242
|
-
}),
|
|
3243
|
-
|
|
3538
|
+
function cs(n) {
|
|
3539
|
+
const { messenger: e } = n;
|
|
3540
|
+
e.on(c.HANDSHAKE, (t) => {
|
|
3541
|
+
Me(t) && (C.info("Server handshake received, flushing publisher queue"), e.markReady());
|
|
3542
|
+
}), e.on(c.SESSION, (t) => {
|
|
3543
|
+
ze(t) && n.onSession(t.sessionId);
|
|
3544
|
+
}), e.on(c.MUTATION, (t) => {
|
|
3545
|
+
Fe(t) && (n.attributes.handleMutationResult(t), n.configuration.handleSelectionChanged(n.attributes.getSelection()));
|
|
3546
|
+
}), e.on(c.SNAPSHOT, (t) => {
|
|
3547
|
+
$e(t) && n.snapshot.handleSnapshotResult(t);
|
|
3548
|
+
}), e.on(c.CAMERA, (t) => {
|
|
3549
|
+
De(t) && n.cameraPosition.handlePositionUpdate(t);
|
|
3550
|
+
}), e.on(c.LOADING_INDICATOR, (t) => {
|
|
3551
|
+
Be(t) && (t.error !== void 0 ? n.ui.showError(t.error) : n.ui.updateProgress(t.progress, t.phase));
|
|
3552
|
+
}), e.on(c.CONFIG, (t) => {
|
|
3553
|
+
He(t) && n.applyConfig(t);
|
|
3554
|
+
}), e.on(c.MAPPING, (t) => {
|
|
3555
|
+
Ue(t) && (n.attributes.handleMappingReceived(t), n.configuration.handleSelectionChanged(n.attributes.getSelection()), n.ui.renderAttributeControls(n.attributes, t.attributes), n.readyStateTracker.handleMappingReceived());
|
|
3556
|
+
}), ds(n);
|
|
3557
|
+
}
|
|
3558
|
+
function ds(n) {
|
|
3559
|
+
const { messenger: e } = n;
|
|
3560
|
+
e.on(c.FOCUS, (t) => {
|
|
3561
|
+
qe(t) && n.focus.handleStateReceived(t);
|
|
3562
|
+
}), e.on(c.PRICING, (t) => {
|
|
3563
|
+
Ge(t) && n.configuration.handlePricingReceived(t.pricing);
|
|
3564
|
+
}), e.on(c.SYNC, (t) => {
|
|
3565
|
+
Ve(t) && n.onSync(t.connected);
|
|
3566
|
+
}), e.on(c.SELECTABLE, (t) => {
|
|
3567
|
+
je(t) && (n.selectable.handleSnapshot(t), n.ui.applySelectable(t.attributes));
|
|
3568
|
+
}), e.on(c.APP_RESOLVED, (t) => {
|
|
3569
|
+
Pe(t) && n.onAppResolved(t);
|
|
3244
3570
|
});
|
|
3245
3571
|
}
|
|
3246
|
-
class
|
|
3572
|
+
class us {
|
|
3247
3573
|
ready = !1;
|
|
3248
3574
|
onReady;
|
|
3249
|
-
constructor(
|
|
3250
|
-
this.onReady =
|
|
3575
|
+
constructor(e) {
|
|
3576
|
+
this.onReady = e;
|
|
3251
3577
|
}
|
|
3252
3578
|
handleMappingReceived() {
|
|
3253
|
-
this.ready || (this.ready = !0,
|
|
3579
|
+
this.ready || (this.ready = !0, C.info("Mapping received from server, client is now ready"), this.onReady?.());
|
|
3254
3580
|
}
|
|
3255
3581
|
get isReady() {
|
|
3256
3582
|
return this.ready;
|
|
@@ -3259,8 +3585,9 @@ class eo {
|
|
|
3259
3585
|
this.ready = !1;
|
|
3260
3586
|
}
|
|
3261
3587
|
}
|
|
3262
|
-
class
|
|
3588
|
+
class hs {
|
|
3263
3589
|
attributes;
|
|
3590
|
+
selectableState;
|
|
3264
3591
|
readyStateTracker;
|
|
3265
3592
|
messenger;
|
|
3266
3593
|
cameraApi;
|
|
@@ -3284,165 +3611,215 @@ class no {
|
|
|
3284
3611
|
mutationFailedCallbacks = [];
|
|
3285
3612
|
/** The viewer's tracking session id, once the server announces it (SESSION). */
|
|
3286
3613
|
viewerSessionId;
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3614
|
+
/** Which app the viewer resolved, once reported (APP_RESOLVED). */
|
|
3615
|
+
resolvedApp;
|
|
3616
|
+
appResolvedCallbacks = [];
|
|
3617
|
+
constructor(e, t) {
|
|
3618
|
+
this.options = e;
|
|
3619
|
+
const i = t ?? {};
|
|
3620
|
+
this.serverHost = i.serverHost, this.iframeParams = i.iframeParams, this.initializeLogging(), this.messenger = new Ze(
|
|
3291
3621
|
() => this.iframe?.contentWindow ?? null,
|
|
3292
3622
|
i.messengerOptions
|
|
3293
3623
|
);
|
|
3294
|
-
const
|
|
3295
|
-
this.messenger.send(
|
|
3624
|
+
const s = (o) => {
|
|
3625
|
+
this.messenger.send(o);
|
|
3296
3626
|
};
|
|
3297
|
-
this.attributes = new
|
|
3298
|
-
this.notifyMutationFailed(
|
|
3299
|
-
}), this.snapshotApi = new
|
|
3300
|
-
this.dispatchFocusChange(
|
|
3301
|
-
}), this.configurationApi = new
|
|
3302
|
-
(
|
|
3303
|
-
this.dispatchConfigurationChange(
|
|
3627
|
+
this.attributes = new pt(s, (o, r) => {
|
|
3628
|
+
this.notifyMutationFailed(o, r);
|
|
3629
|
+
}), this.selectableState = new ft(), this.snapshotApi = new _t(s), this.annotationsApi = new We(s), this.cameraApi = new gt(s), this.cameraPositionApi = new bt(), this.focusApi = new wt(s, (o) => {
|
|
3630
|
+
this.dispatchFocusChange(o);
|
|
3631
|
+
}), this.configurationApi = new St(
|
|
3632
|
+
(o) => {
|
|
3633
|
+
this.dispatchConfigurationChange(o);
|
|
3304
3634
|
},
|
|
3305
|
-
(
|
|
3306
|
-
this.dispatchConfigurationSubmit(
|
|
3635
|
+
(o) => {
|
|
3636
|
+
this.dispatchConfigurationSubmit(o);
|
|
3307
3637
|
}
|
|
3308
|
-
), this.eventBus = new
|
|
3638
|
+
), this.eventBus = new kt(), this.arActivation = i.createArActivation?.(s), this.syncTracker = i.createSyncTracker?.(), this.readyStateTracker = new us(() => {
|
|
3309
3639
|
this.notifyReady();
|
|
3310
|
-
});
|
|
3311
|
-
|
|
3312
|
-
|
|
3640
|
+
}), this.ui = this.createStandardInterface(), this.wireIncomingMessages(), i.registerHandlers?.(this.messenger, s), this.messenger.start(), this.createAndConnectIframe();
|
|
3641
|
+
}
|
|
3642
|
+
/** The configurator UI, every callback bridging it to the facade that owns the action. */
|
|
3643
|
+
createStandardInterface() {
|
|
3644
|
+
const e = this.arActivation;
|
|
3645
|
+
return new rs({
|
|
3313
3646
|
snapshotApi: this.snapshotApi,
|
|
3314
3647
|
cameraApi: this.cameraApi,
|
|
3315
3648
|
cameraPositionApi: this.cameraPositionApi,
|
|
3316
3649
|
eventBus: this.eventBus,
|
|
3317
3650
|
configuration: this.configurationApi,
|
|
3318
|
-
onSelect: (
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3651
|
+
onSelect: (t, i) => this.attributes.select(t, i),
|
|
3652
|
+
onSelectTransient: (t, i) => this.attributes.selectTransient(t, i),
|
|
3653
|
+
onSubscribe: (t, i) => this.attributes.onChange(t, i),
|
|
3654
|
+
...e !== void 0 && {
|
|
3655
|
+
onAr: () => {
|
|
3656
|
+
e.activate();
|
|
3657
|
+
}
|
|
3658
|
+
},
|
|
3323
3659
|
onFullscreenEnter: () => {
|
|
3324
3660
|
this.trackFullscreen();
|
|
3325
3661
|
}
|
|
3326
|
-
})
|
|
3662
|
+
});
|
|
3327
3663
|
}
|
|
3328
3664
|
/** Wire the inbound viewer protocol to the facades. */
|
|
3329
3665
|
wireIncomingMessages() {
|
|
3330
|
-
|
|
3666
|
+
cs({
|
|
3331
3667
|
messenger: this.messenger,
|
|
3332
3668
|
attributes: this.attributes,
|
|
3669
|
+
selectable: this.selectableState,
|
|
3333
3670
|
configuration: this.configurationApi,
|
|
3334
3671
|
snapshot: this.snapshotApi,
|
|
3335
3672
|
cameraPosition: this.cameraPositionApi,
|
|
3336
3673
|
focus: this.focusApi,
|
|
3337
3674
|
ui: this.ui,
|
|
3338
3675
|
readyStateTracker: this.readyStateTracker,
|
|
3339
|
-
applyConfig: (
|
|
3340
|
-
this.handleConfig(
|
|
3676
|
+
applyConfig: (e) => {
|
|
3677
|
+
this.handleConfig(e);
|
|
3341
3678
|
},
|
|
3342
|
-
onSession: (
|
|
3343
|
-
this.handleSession(
|
|
3679
|
+
onSession: (e) => {
|
|
3680
|
+
this.handleSession(e);
|
|
3344
3681
|
},
|
|
3345
|
-
onSync: (
|
|
3346
|
-
this.syncTracker?.handleSync(
|
|
3682
|
+
onSync: (e) => {
|
|
3683
|
+
this.syncTracker?.handleSync(e);
|
|
3684
|
+
},
|
|
3685
|
+
onAppResolved: (e) => {
|
|
3686
|
+
this.handleAppResolved({
|
|
3687
|
+
appType: e.appType,
|
|
3688
|
+
name: e.name,
|
|
3689
|
+
...e.slug !== void 0 && { slug: e.slug },
|
|
3690
|
+
...e.submit !== void 0 && { submit: e.submit }
|
|
3691
|
+
});
|
|
3347
3692
|
}
|
|
3348
3693
|
});
|
|
3349
3694
|
}
|
|
3695
|
+
/** Store the resolved app and notify every registered `onAppResolved` callback. */
|
|
3696
|
+
handleAppResolved(e) {
|
|
3697
|
+
this.resolvedApp = e;
|
|
3698
|
+
for (const t of this.appResolvedCallbacks)
|
|
3699
|
+
t(e);
|
|
3700
|
+
}
|
|
3350
3701
|
/** Store the tracking session id and hand it to the AR flow, which waits on it for the QR. */
|
|
3351
|
-
handleSession(
|
|
3352
|
-
this.viewerSessionId =
|
|
3702
|
+
handleSession(e) {
|
|
3703
|
+
this.viewerSessionId = e, this.arActivation?.onSession(e);
|
|
3353
3704
|
}
|
|
3354
3705
|
/** Forward a failed mutation to every registered `onMutationFailed` callback. */
|
|
3355
|
-
notifyMutationFailed(
|
|
3706
|
+
notifyMutationFailed(e, t) {
|
|
3356
3707
|
for (const i of this.mutationFailedCallbacks)
|
|
3357
|
-
i({ attribute:
|
|
3708
|
+
i({ attribute: e, value: t });
|
|
3358
3709
|
}
|
|
3359
3710
|
/** Flush the queued `onReady` callbacks once, then let the standard interface know. */
|
|
3360
3711
|
notifyReady() {
|
|
3361
|
-
const
|
|
3712
|
+
const e = this.readyCallbacks;
|
|
3362
3713
|
this.readyCallbacks = [];
|
|
3363
|
-
for (const
|
|
3364
|
-
|
|
3714
|
+
for (const t of e)
|
|
3715
|
+
t(this);
|
|
3365
3716
|
this.ui.onReady();
|
|
3366
3717
|
}
|
|
3367
3718
|
/**
|
|
3368
3719
|
* Dispatch a bubbling `vd:focus-change` event on the container so a page can
|
|
3369
3720
|
* react to focus without registering an `onChange` callback.
|
|
3370
3721
|
*/
|
|
3371
|
-
dispatchFocusChange(
|
|
3722
|
+
dispatchFocusChange(e) {
|
|
3372
3723
|
this.container?.dispatchEvent(
|
|
3373
|
-
new CustomEvent(
|
|
3724
|
+
new CustomEvent(T.FOCUS_CHANGE, { detail: e, bubbles: !0 })
|
|
3374
3725
|
);
|
|
3375
3726
|
}
|
|
3376
3727
|
/**
|
|
3377
3728
|
* Dispatch a bubbling `vd:configuration-change` event on the container so a
|
|
3378
3729
|
* page or tag manager can react to price changes without a client callback.
|
|
3379
3730
|
*/
|
|
3380
|
-
dispatchConfigurationChange(
|
|
3731
|
+
dispatchConfigurationChange(e) {
|
|
3381
3732
|
this.container?.dispatchEvent(
|
|
3382
|
-
new CustomEvent(
|
|
3733
|
+
new CustomEvent(T.CONFIGURATION_CHANGE, { detail: e ?? null, bubbles: !0 })
|
|
3383
3734
|
);
|
|
3384
3735
|
}
|
|
3385
3736
|
/** Dispatch a bubbling `vd:configuration-submit` event when the CTA is used. */
|
|
3386
|
-
dispatchConfigurationSubmit(
|
|
3737
|
+
dispatchConfigurationSubmit(e) {
|
|
3387
3738
|
this.container?.dispatchEvent(
|
|
3388
|
-
new CustomEvent(
|
|
3739
|
+
new CustomEvent(T.CONFIGURATION_SUBMIT, { detail: e, bubbles: !0 })
|
|
3389
3740
|
);
|
|
3390
3741
|
}
|
|
3391
|
-
handleConfig(
|
|
3392
|
-
const
|
|
3393
|
-
if (
|
|
3394
|
-
const
|
|
3395
|
-
if (i !== void 0 &&
|
|
3396
|
-
const
|
|
3397
|
-
|
|
3742
|
+
handleConfig(e) {
|
|
3743
|
+
const t = e.viewerSettings, i = this.options.viewerSettings;
|
|
3744
|
+
if (t !== void 0 || i !== void 0) {
|
|
3745
|
+
const s = i !== void 0 ? { ...t ?? {}, ...i } : t;
|
|
3746
|
+
if (i !== void 0 && t !== void 0) {
|
|
3747
|
+
const o = Object.entries(i).filter(([r, a]) => t[r] !== a).map(
|
|
3748
|
+
([r, a]) => `${r} (metadata: ${t[r] ?? "undefined"}, override: ${a})`
|
|
3749
|
+
);
|
|
3750
|
+
o.length > 0 && C.warn(`Viewer settings override active: ${o.join(", ")}`);
|
|
3398
3751
|
}
|
|
3399
|
-
this.ui.applyViewerSettings(
|
|
3752
|
+
this.ui.applyViewerSettings(s), this.annotationsApi.setEnabled(s.annotations !== !1);
|
|
3400
3753
|
}
|
|
3401
|
-
this.cameraPositionApi.applyLimits(
|
|
3754
|
+
this.cameraPositionApi.applyLimits(e.cameraLimits);
|
|
3402
3755
|
}
|
|
3403
3756
|
/** Tell the viewer the user entered fullscreen, so it records the engagement. */
|
|
3404
3757
|
trackFullscreen() {
|
|
3405
3758
|
this.messenger.send({ type: c.FULLSCREEN });
|
|
3406
3759
|
}
|
|
3407
3760
|
initializeLogging() {
|
|
3408
|
-
this.options.debug === !0 &&
|
|
3761
|
+
this.options.debug === !0 && mt(), C.info("Initializing Virtualdisplay client", {
|
|
3762
|
+
...this.options.app === void 0 ? { model: this.options.model } : { app: this.options.app }
|
|
3763
|
+
});
|
|
3409
3764
|
}
|
|
3410
3765
|
createAndConnectIframe() {
|
|
3411
|
-
const
|
|
3412
|
-
this.container =
|
|
3766
|
+
const t = new ls(this.options, this.serverHost, this.iframeParams).create();
|
|
3767
|
+
this.container = t.container, this.iframe = t.iframe, this.eventBus.attach(this.container), this.ui.attach(this.container);
|
|
3413
3768
|
try {
|
|
3414
3769
|
const i = new URL(this.iframe.src).origin;
|
|
3415
3770
|
this.messenger.setTargetOrigin(i);
|
|
3416
3771
|
} catch {
|
|
3417
3772
|
}
|
|
3418
3773
|
}
|
|
3419
|
-
select(
|
|
3420
|
-
this.attributes.select(
|
|
3774
|
+
select(e, t) {
|
|
3775
|
+
this.attributes.select(e, t);
|
|
3421
3776
|
}
|
|
3422
|
-
getValues(
|
|
3423
|
-
return this.attributes.getValues(
|
|
3777
|
+
getValues(e) {
|
|
3778
|
+
return this.attributes.getValues(e);
|
|
3424
3779
|
}
|
|
3425
|
-
getValue(
|
|
3426
|
-
return this.attributes.getValue(
|
|
3780
|
+
getValue(e, t) {
|
|
3781
|
+
return this.attributes.getValue(e, t);
|
|
3427
3782
|
}
|
|
3428
|
-
onChange(
|
|
3429
|
-
this.attributes.onChange(
|
|
3783
|
+
onChange(e, t) {
|
|
3784
|
+
this.attributes.onChange(e, t);
|
|
3430
3785
|
}
|
|
3431
|
-
getAttribute(
|
|
3432
|
-
return this.attributes.getAttribute(
|
|
3786
|
+
getAttribute(e) {
|
|
3787
|
+
return this.attributes.getAttribute(e);
|
|
3433
3788
|
}
|
|
3434
3789
|
get isReady() {
|
|
3435
3790
|
return this.readyStateTracker.isReady;
|
|
3436
3791
|
}
|
|
3437
|
-
onReady(
|
|
3792
|
+
onReady(e) {
|
|
3438
3793
|
if (this.readyStateTracker.isReady) {
|
|
3439
|
-
|
|
3794
|
+
e(this);
|
|
3440
3795
|
return;
|
|
3441
3796
|
}
|
|
3442
|
-
this.readyCallbacks.push(
|
|
3797
|
+
this.readyCallbacks.push(e);
|
|
3443
3798
|
}
|
|
3444
|
-
onMutationFailed(
|
|
3445
|
-
this.mutationFailedCallbacks.push(
|
|
3799
|
+
onMutationFailed(e) {
|
|
3800
|
+
this.mutationFailedCallbacks.push(e);
|
|
3801
|
+
}
|
|
3802
|
+
/**
|
|
3803
|
+
* Subscribe to the viewer's selectability snapshots (kiesbaarheid live):
|
|
3804
|
+
* per attribute, which values the buyer can pick right now. Fires with the
|
|
3805
|
+
* current snapshot immediately when one already arrived. A model without
|
|
3806
|
+
* exclusions never sends one: everything stays selectable and this never
|
|
3807
|
+
* fires.
|
|
3808
|
+
*/
|
|
3809
|
+
onSelectableChange(e) {
|
|
3810
|
+
this.selectableState.onChange(e);
|
|
3811
|
+
}
|
|
3812
|
+
/**
|
|
3813
|
+
* Subscribe to which app this viewer resolved (type, name, public submit
|
|
3814
|
+
* settings). Reported once by the viewer after its resolve; fires immediately
|
|
3815
|
+
* when the report already arrived, so registration order does not matter.
|
|
3816
|
+
*/
|
|
3817
|
+
onAppResolved(e) {
|
|
3818
|
+
this.appResolvedCallbacks.push(e), this.resolvedApp !== void 0 && e(this.resolvedApp);
|
|
3819
|
+
}
|
|
3820
|
+
/** The selectable values for one attribute right now, or null when unrestricted. */
|
|
3821
|
+
getSelectable(e) {
|
|
3822
|
+
return this.selectableState.selectableFor(e);
|
|
3446
3823
|
}
|
|
3447
3824
|
/**
|
|
3448
3825
|
* Trigger the composed AR flow directly (ar-session-handoff task 035): a host
|
|
@@ -3454,8 +3831,8 @@ class no {
|
|
|
3454
3831
|
activateAr() {
|
|
3455
3832
|
this.arActivation?.activate();
|
|
3456
3833
|
}
|
|
3457
|
-
on(
|
|
3458
|
-
this.eventBus.on(
|
|
3834
|
+
on(e, t) {
|
|
3835
|
+
this.eventBus.on(e, t);
|
|
3459
3836
|
}
|
|
3460
3837
|
get annotations() {
|
|
3461
3838
|
return this.annotationsApi;
|
|
@@ -3486,15 +3863,15 @@ class no {
|
|
|
3486
3863
|
this.readyStateTracker.clear(), this.readyCallbacks = [], this.mutationFailedCallbacks.length = 0, this.snapshotApi.clear(), this.messenger.destroy(), this.arActivation?.destroy(), this.ui.destroy(), this.container?.parentElement !== null && this.container?.parentElement !== void 0 && this.container.parentElement.removeChild(this.container), this.container = void 0, this.iframe = void 0;
|
|
3487
3864
|
}
|
|
3488
3865
|
}
|
|
3489
|
-
const
|
|
3490
|
-
function
|
|
3491
|
-
const
|
|
3492
|
-
return n.sessionId !== void 0 ?
|
|
3866
|
+
const ms = "ar.virtualdisplay.io";
|
|
3867
|
+
function ps(n) {
|
|
3868
|
+
const e = new URL(`https://${ms}/go`);
|
|
3869
|
+
return n.sessionId !== void 0 ? e.searchParams.set("session", n.sessionId) : n.app !== void 0 ? e.searchParams.set("app", n.app) : n.license !== void 0 && n.model !== void 0 && (e.searchParams.set("license", n.license), e.searchParams.set("model", n.model)), e.toString();
|
|
3493
3870
|
}
|
|
3494
|
-
const
|
|
3495
|
-
class
|
|
3871
|
+
const fs = 1500;
|
|
3872
|
+
class gs {
|
|
3496
3873
|
options;
|
|
3497
|
-
qrModal = new
|
|
3874
|
+
qrModal = new Li();
|
|
3498
3875
|
/** The viewer's tracking session id, once the engine announces it (SESSION). */
|
|
3499
3876
|
sessionId;
|
|
3500
3877
|
/** Callbacks waiting on the SESSION message, resolved (or timed out) exactly once each. */
|
|
@@ -3503,20 +3880,20 @@ class ro {
|
|
|
3503
3880
|
pendingTimers = /* @__PURE__ */ new Set();
|
|
3504
3881
|
/** Set on destroy: an in-flight hand-off must not re-mount the modal or send QR_SHOWN. */
|
|
3505
3882
|
destroyed = !1;
|
|
3506
|
-
constructor(
|
|
3507
|
-
this.options =
|
|
3883
|
+
constructor(e) {
|
|
3884
|
+
this.options = e;
|
|
3508
3885
|
}
|
|
3509
3886
|
/** Store the engine-announced tracking session id and resolve anyone waiting on it. */
|
|
3510
|
-
onSession(
|
|
3511
|
-
this.sessionId =
|
|
3512
|
-
const
|
|
3887
|
+
onSession(e) {
|
|
3888
|
+
this.sessionId = e;
|
|
3889
|
+
const t = this.waiters;
|
|
3513
3890
|
this.waiters = [];
|
|
3514
|
-
for (const i of
|
|
3515
|
-
i(
|
|
3891
|
+
for (const i of t)
|
|
3892
|
+
i(e);
|
|
3516
3893
|
}
|
|
3517
3894
|
/** The AR button handler: mobile activates AR in the engine, desktop shows the hand-off QR. */
|
|
3518
3895
|
activate() {
|
|
3519
|
-
if (
|
|
3896
|
+
if (ut()) {
|
|
3520
3897
|
this.options.send({ type: c.AR_ACTIVATE });
|
|
3521
3898
|
return;
|
|
3522
3899
|
}
|
|
@@ -3524,8 +3901,8 @@ class ro {
|
|
|
3524
3901
|
}
|
|
3525
3902
|
destroy() {
|
|
3526
3903
|
this.destroyed = !0;
|
|
3527
|
-
for (const
|
|
3528
|
-
clearTimeout(
|
|
3904
|
+
for (const e of this.pendingTimers)
|
|
3905
|
+
clearTimeout(e);
|
|
3529
3906
|
this.pendingTimers.clear(), this.waiters = [], this.qrModal.hide();
|
|
3530
3907
|
}
|
|
3531
3908
|
/**
|
|
@@ -3537,14 +3914,15 @@ class ro {
|
|
|
3537
3914
|
*/
|
|
3538
3915
|
async showQrCode() {
|
|
3539
3916
|
this.qrModal.show();
|
|
3540
|
-
const
|
|
3917
|
+
const e = await this.waitForSessionId();
|
|
3541
3918
|
if (this.destroyed)
|
|
3542
3919
|
return;
|
|
3543
|
-
const
|
|
3544
|
-
sessionId:
|
|
3920
|
+
const t = ps({
|
|
3921
|
+
sessionId: e,
|
|
3922
|
+
app: this.options.app,
|
|
3545
3923
|
license: this.options.license,
|
|
3546
3924
|
model: this.options.model
|
|
3547
|
-
}), i = await this.qrModal.update(
|
|
3925
|
+
}), i = await this.qrModal.update(t);
|
|
3548
3926
|
if (this.destroyed) {
|
|
3549
3927
|
this.qrModal.hide();
|
|
3550
3928
|
return;
|
|
@@ -3558,60 +3936,61 @@ class ro {
|
|
|
3558
3936
|
* rather than encoding a wrong one.
|
|
3559
3937
|
*/
|
|
3560
3938
|
waitForSessionId() {
|
|
3561
|
-
return this.sessionId !== void 0 ? Promise.resolve(this.sessionId) : new Promise((
|
|
3562
|
-
const
|
|
3563
|
-
this.pendingTimers.delete(
|
|
3564
|
-
},
|
|
3565
|
-
this.pendingTimers.add(
|
|
3566
|
-
this.pendingTimers.delete(
|
|
3939
|
+
return this.sessionId !== void 0 ? Promise.resolve(this.sessionId) : new Promise((e) => {
|
|
3940
|
+
const t = setTimeout(() => {
|
|
3941
|
+
this.pendingTimers.delete(t), e(void 0);
|
|
3942
|
+
}, fs);
|
|
3943
|
+
this.pendingTimers.add(t), this.waiters.push((i) => {
|
|
3944
|
+
this.pendingTimers.delete(t), clearTimeout(t), e(i);
|
|
3567
3945
|
});
|
|
3568
3946
|
});
|
|
3569
3947
|
}
|
|
3570
3948
|
}
|
|
3571
|
-
class
|
|
3949
|
+
class bs {
|
|
3572
3950
|
callbacks = [];
|
|
3573
3951
|
lastKnown;
|
|
3574
|
-
handleSync(
|
|
3575
|
-
this.lastKnown =
|
|
3576
|
-
for (const
|
|
3577
|
-
e
|
|
3952
|
+
handleSync(e) {
|
|
3953
|
+
this.lastKnown = e;
|
|
3954
|
+
for (const t of this.callbacks)
|
|
3955
|
+
t(e);
|
|
3578
3956
|
}
|
|
3579
|
-
onChange(
|
|
3580
|
-
this.callbacks.push(
|
|
3957
|
+
onChange(e) {
|
|
3958
|
+
this.callbacks.push(e), this.lastKnown !== void 0 && e(this.lastKnown);
|
|
3581
3959
|
}
|
|
3582
3960
|
}
|
|
3583
|
-
class
|
|
3961
|
+
class Ss extends hs {
|
|
3584
3962
|
syncStatusTracker;
|
|
3585
|
-
constructor(
|
|
3586
|
-
const
|
|
3587
|
-
super(
|
|
3588
|
-
createArActivation: (i) => new
|
|
3589
|
-
|
|
3590
|
-
|
|
3963
|
+
constructor(e) {
|
|
3964
|
+
const t = new bs();
|
|
3965
|
+
super(e, {
|
|
3966
|
+
createArActivation: (i) => new gs({
|
|
3967
|
+
app: e.app,
|
|
3968
|
+
license: e.license,
|
|
3969
|
+
model: e.model,
|
|
3591
3970
|
send: i
|
|
3592
3971
|
}),
|
|
3593
|
-
createSyncTracker: () =>
|
|
3594
|
-
}), this.syncStatusTracker =
|
|
3972
|
+
createSyncTracker: () => t
|
|
3973
|
+
}), this.syncStatusTracker = t;
|
|
3595
3974
|
}
|
|
3596
3975
|
/** Subscribe to the live sync channel's connection state (ar-session-handoff). Latest-wins, no buffering. */
|
|
3597
|
-
onSyncChange(
|
|
3598
|
-
this.syncStatusTracker.onChange(
|
|
3976
|
+
onSyncChange(e) {
|
|
3977
|
+
this.syncStatusTracker.onChange(e);
|
|
3599
3978
|
}
|
|
3600
3979
|
}
|
|
3601
3980
|
export {
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3981
|
+
We as Annotations,
|
|
3982
|
+
Qe as Attribute,
|
|
3983
|
+
Ye as AttributeValue,
|
|
3984
|
+
gt as Camera,
|
|
3985
|
+
St as Configuration,
|
|
3607
3986
|
A as ERROR_CODES,
|
|
3608
|
-
|
|
3609
|
-
|
|
3610
|
-
|
|
3611
|
-
|
|
3612
|
-
|
|
3613
|
-
|
|
3614
|
-
|
|
3615
|
-
|
|
3616
|
-
|
|
3987
|
+
wt as Focus,
|
|
3988
|
+
Ct as Photo,
|
|
3989
|
+
_t as Snapshot,
|
|
3990
|
+
T as VD_EVENTS,
|
|
3991
|
+
Ss as VirtualdisplayClient,
|
|
3992
|
+
g as VirtualdisplayError,
|
|
3993
|
+
mt as enableDebugMode,
|
|
3994
|
+
vs as isDebugMode,
|
|
3995
|
+
C as logger
|
|
3617
3996
|
};
|