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