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