ev-interactivity-player 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +5 -0
- package/dist/index.d.mts +1028 -0
- package/dist/index.mjs +1670 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +42 -0
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,1670 @@
|
|
|
1
|
+
import { getVisibleInteractions, resolveAction } from "ev-interactivity-core";
|
|
2
|
+
//#region ../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.6.0/node_modules/@lit-labs/ssr-dom-shim/lib/element-internals.js
|
|
3
|
+
/**
|
|
4
|
+
* @license
|
|
5
|
+
* Copyright 2023 Google LLC
|
|
6
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
7
|
+
*/
|
|
8
|
+
const ElementInternalsShim = class ElementInternals {
|
|
9
|
+
get shadowRoot() {
|
|
10
|
+
return this.__host.__shadowRoot;
|
|
11
|
+
}
|
|
12
|
+
constructor(_host) {
|
|
13
|
+
this.ariaActiveDescendantElement = null;
|
|
14
|
+
this.ariaAtomic = "";
|
|
15
|
+
this.ariaAutoComplete = "";
|
|
16
|
+
this.ariaBrailleLabel = "";
|
|
17
|
+
this.ariaBrailleRoleDescription = "";
|
|
18
|
+
this.ariaBusy = "";
|
|
19
|
+
this.ariaChecked = "";
|
|
20
|
+
this.ariaColCount = "";
|
|
21
|
+
this.ariaColIndex = "";
|
|
22
|
+
this.ariaColIndexText = "";
|
|
23
|
+
this.ariaColSpan = "";
|
|
24
|
+
this.ariaControlsElements = null;
|
|
25
|
+
this.ariaCurrent = "";
|
|
26
|
+
this.ariaDescribedByElements = null;
|
|
27
|
+
this.ariaDescription = "";
|
|
28
|
+
this.ariaDetailsElements = null;
|
|
29
|
+
this.ariaDisabled = "";
|
|
30
|
+
this.ariaErrorMessageElements = null;
|
|
31
|
+
this.ariaExpanded = "";
|
|
32
|
+
this.ariaFlowToElements = null;
|
|
33
|
+
this.ariaHasPopup = "";
|
|
34
|
+
this.ariaHidden = "";
|
|
35
|
+
this.ariaInvalid = "";
|
|
36
|
+
this.ariaKeyShortcuts = "";
|
|
37
|
+
this.ariaLabel = "";
|
|
38
|
+
this.ariaLabelledByElements = null;
|
|
39
|
+
this.ariaLevel = "";
|
|
40
|
+
this.ariaLive = "";
|
|
41
|
+
this.ariaModal = "";
|
|
42
|
+
this.ariaMultiLine = "";
|
|
43
|
+
this.ariaMultiSelectable = "";
|
|
44
|
+
this.ariaOrientation = "";
|
|
45
|
+
this.ariaOwnsElements = null;
|
|
46
|
+
this.ariaPlaceholder = "";
|
|
47
|
+
this.ariaPosInSet = "";
|
|
48
|
+
this.ariaPressed = "";
|
|
49
|
+
this.ariaReadOnly = "";
|
|
50
|
+
this.ariaRelevant = "";
|
|
51
|
+
this.ariaRequired = "";
|
|
52
|
+
this.ariaRoleDescription = "";
|
|
53
|
+
this.ariaRowCount = "";
|
|
54
|
+
this.ariaRowIndex = "";
|
|
55
|
+
this.ariaRowIndexText = "";
|
|
56
|
+
this.ariaRowSpan = "";
|
|
57
|
+
this.ariaSelected = "";
|
|
58
|
+
this.ariaSetSize = "";
|
|
59
|
+
this.ariaSort = "";
|
|
60
|
+
this.ariaValueMax = "";
|
|
61
|
+
this.ariaValueMin = "";
|
|
62
|
+
this.ariaValueNow = "";
|
|
63
|
+
this.ariaValueText = "";
|
|
64
|
+
this.role = "";
|
|
65
|
+
this.form = null;
|
|
66
|
+
this.labels = [];
|
|
67
|
+
this.states = /* @__PURE__ */ new Set();
|
|
68
|
+
this.validationMessage = "";
|
|
69
|
+
this.validity = {};
|
|
70
|
+
this.willValidate = true;
|
|
71
|
+
this.__host = _host;
|
|
72
|
+
}
|
|
73
|
+
checkValidity() {
|
|
74
|
+
console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true.");
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
reportValidity() {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
setFormValue() {}
|
|
81
|
+
setValidity() {}
|
|
82
|
+
};
|
|
83
|
+
//#endregion
|
|
84
|
+
//#region ../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.6.0/node_modules/@lit-labs/ssr-dom-shim/lib/events.js
|
|
85
|
+
/**
|
|
86
|
+
* @license
|
|
87
|
+
* Copyright 2023 Google LLC
|
|
88
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
89
|
+
*/
|
|
90
|
+
var __classPrivateFieldSet = function(receiver, state, value, kind, f) {
|
|
91
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
92
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
93
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
94
|
+
return kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;
|
|
95
|
+
};
|
|
96
|
+
var __classPrivateFieldGet = function(receiver, state, kind, f) {
|
|
97
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
98
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
99
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
100
|
+
};
|
|
101
|
+
var _Event_cancelable, _Event_bubbles, _Event_composed, _Event_defaultPrevented, _Event_timestamp, _Event_propagationStopped, _Event_type, _Event_target, _Event_isBeingDispatched, _a$1, _CustomEvent_detail, _b;
|
|
102
|
+
const NONE = 0;
|
|
103
|
+
const CAPTURING_PHASE = 1;
|
|
104
|
+
const AT_TARGET = 2;
|
|
105
|
+
const BUBBLING_PHASE = 3;
|
|
106
|
+
const enumerableProperty$1 = { __proto__: null };
|
|
107
|
+
enumerableProperty$1.enumerable = true;
|
|
108
|
+
Object.freeze(enumerableProperty$1);
|
|
109
|
+
const EventShim = (_a$1 = class Event {
|
|
110
|
+
constructor(type, options = {}) {
|
|
111
|
+
_Event_cancelable.set(this, false);
|
|
112
|
+
_Event_bubbles.set(this, false);
|
|
113
|
+
_Event_composed.set(this, false);
|
|
114
|
+
_Event_defaultPrevented.set(this, false);
|
|
115
|
+
_Event_timestamp.set(this, Date.now());
|
|
116
|
+
_Event_propagationStopped.set(this, false);
|
|
117
|
+
_Event_type.set(this, void 0);
|
|
118
|
+
_Event_target.set(this, void 0);
|
|
119
|
+
_Event_isBeingDispatched.set(this, void 0);
|
|
120
|
+
this.NONE = NONE;
|
|
121
|
+
this.CAPTURING_PHASE = CAPTURING_PHASE;
|
|
122
|
+
this.AT_TARGET = AT_TARGET;
|
|
123
|
+
this.BUBBLING_PHASE = BUBBLING_PHASE;
|
|
124
|
+
if (arguments.length === 0) throw new Error(`The type argument must be specified`);
|
|
125
|
+
if (typeof options !== "object" || !options) throw new Error(`The "options" argument must be an object`);
|
|
126
|
+
const { bubbles, cancelable, composed } = options;
|
|
127
|
+
__classPrivateFieldSet(this, _Event_cancelable, !!cancelable, "f");
|
|
128
|
+
__classPrivateFieldSet(this, _Event_bubbles, !!bubbles, "f");
|
|
129
|
+
__classPrivateFieldSet(this, _Event_composed, !!composed, "f");
|
|
130
|
+
__classPrivateFieldSet(this, _Event_type, `${type}`, "f");
|
|
131
|
+
__classPrivateFieldSet(this, _Event_target, null, "f");
|
|
132
|
+
__classPrivateFieldSet(this, _Event_isBeingDispatched, false, "f");
|
|
133
|
+
}
|
|
134
|
+
initEvent(_type, _bubbles, _cancelable) {
|
|
135
|
+
throw new Error("Method not implemented.");
|
|
136
|
+
}
|
|
137
|
+
stopImmediatePropagation() {
|
|
138
|
+
this.stopPropagation();
|
|
139
|
+
}
|
|
140
|
+
preventDefault() {
|
|
141
|
+
__classPrivateFieldSet(this, _Event_defaultPrevented, true, "f");
|
|
142
|
+
}
|
|
143
|
+
get target() {
|
|
144
|
+
return __classPrivateFieldGet(this, _Event_target, "f");
|
|
145
|
+
}
|
|
146
|
+
get currentTarget() {
|
|
147
|
+
return __classPrivateFieldGet(this, _Event_target, "f");
|
|
148
|
+
}
|
|
149
|
+
get srcElement() {
|
|
150
|
+
return __classPrivateFieldGet(this, _Event_target, "f");
|
|
151
|
+
}
|
|
152
|
+
get type() {
|
|
153
|
+
return __classPrivateFieldGet(this, _Event_type, "f");
|
|
154
|
+
}
|
|
155
|
+
get cancelable() {
|
|
156
|
+
return __classPrivateFieldGet(this, _Event_cancelable, "f");
|
|
157
|
+
}
|
|
158
|
+
get defaultPrevented() {
|
|
159
|
+
return __classPrivateFieldGet(this, _Event_cancelable, "f") && __classPrivateFieldGet(this, _Event_defaultPrevented, "f");
|
|
160
|
+
}
|
|
161
|
+
get timeStamp() {
|
|
162
|
+
return __classPrivateFieldGet(this, _Event_timestamp, "f");
|
|
163
|
+
}
|
|
164
|
+
composedPath() {
|
|
165
|
+
return __classPrivateFieldGet(this, _Event_isBeingDispatched, "f") ? [__classPrivateFieldGet(this, _Event_target, "f")] : [];
|
|
166
|
+
}
|
|
167
|
+
get returnValue() {
|
|
168
|
+
return !__classPrivateFieldGet(this, _Event_cancelable, "f") || !__classPrivateFieldGet(this, _Event_defaultPrevented, "f");
|
|
169
|
+
}
|
|
170
|
+
get bubbles() {
|
|
171
|
+
return __classPrivateFieldGet(this, _Event_bubbles, "f");
|
|
172
|
+
}
|
|
173
|
+
get composed() {
|
|
174
|
+
return __classPrivateFieldGet(this, _Event_composed, "f");
|
|
175
|
+
}
|
|
176
|
+
get eventPhase() {
|
|
177
|
+
return __classPrivateFieldGet(this, _Event_isBeingDispatched, "f") ? _a$1.AT_TARGET : _a$1.NONE;
|
|
178
|
+
}
|
|
179
|
+
get cancelBubble() {
|
|
180
|
+
return __classPrivateFieldGet(this, _Event_propagationStopped, "f");
|
|
181
|
+
}
|
|
182
|
+
set cancelBubble(value) {
|
|
183
|
+
if (value) __classPrivateFieldSet(this, _Event_propagationStopped, true, "f");
|
|
184
|
+
}
|
|
185
|
+
stopPropagation() {
|
|
186
|
+
__classPrivateFieldSet(this, _Event_propagationStopped, true, "f");
|
|
187
|
+
}
|
|
188
|
+
get isTrusted() {
|
|
189
|
+
return false;
|
|
190
|
+
}
|
|
191
|
+
}, _Event_cancelable = /* @__PURE__ */ new WeakMap(), _Event_bubbles = /* @__PURE__ */ new WeakMap(), _Event_composed = /* @__PURE__ */ new WeakMap(), _Event_defaultPrevented = /* @__PURE__ */ new WeakMap(), _Event_timestamp = /* @__PURE__ */ new WeakMap(), _Event_propagationStopped = /* @__PURE__ */ new WeakMap(), _Event_type = /* @__PURE__ */ new WeakMap(), _Event_target = /* @__PURE__ */ new WeakMap(), _Event_isBeingDispatched = /* @__PURE__ */ new WeakMap(), _a$1.NONE = NONE, _a$1.CAPTURING_PHASE = CAPTURING_PHASE, _a$1.AT_TARGET = AT_TARGET, _a$1.BUBBLING_PHASE = BUBBLING_PHASE, _a$1);
|
|
192
|
+
Object.defineProperties(EventShim.prototype, {
|
|
193
|
+
initEvent: enumerableProperty$1,
|
|
194
|
+
stopImmediatePropagation: enumerableProperty$1,
|
|
195
|
+
preventDefault: enumerableProperty$1,
|
|
196
|
+
target: enumerableProperty$1,
|
|
197
|
+
currentTarget: enumerableProperty$1,
|
|
198
|
+
srcElement: enumerableProperty$1,
|
|
199
|
+
type: enumerableProperty$1,
|
|
200
|
+
cancelable: enumerableProperty$1,
|
|
201
|
+
defaultPrevented: enumerableProperty$1,
|
|
202
|
+
timeStamp: enumerableProperty$1,
|
|
203
|
+
composedPath: enumerableProperty$1,
|
|
204
|
+
returnValue: enumerableProperty$1,
|
|
205
|
+
bubbles: enumerableProperty$1,
|
|
206
|
+
composed: enumerableProperty$1,
|
|
207
|
+
eventPhase: enumerableProperty$1,
|
|
208
|
+
cancelBubble: enumerableProperty$1,
|
|
209
|
+
stopPropagation: enumerableProperty$1,
|
|
210
|
+
isTrusted: enumerableProperty$1
|
|
211
|
+
});
|
|
212
|
+
const CustomEventShim = (_b = class CustomEvent extends EventShim {
|
|
213
|
+
constructor(type, options = {}) {
|
|
214
|
+
var _options$detail;
|
|
215
|
+
super(type, options);
|
|
216
|
+
_CustomEvent_detail.set(this, void 0);
|
|
217
|
+
__classPrivateFieldSet(this, _CustomEvent_detail, (_options$detail = options === null || options === void 0 ? void 0 : options.detail) !== null && _options$detail !== void 0 ? _options$detail : null, "f");
|
|
218
|
+
}
|
|
219
|
+
initCustomEvent(_type, _bubbles, _cancelable, _detail) {
|
|
220
|
+
throw new Error("Method not implemented.");
|
|
221
|
+
}
|
|
222
|
+
get detail() {
|
|
223
|
+
return __classPrivateFieldGet(this, _CustomEvent_detail, "f");
|
|
224
|
+
}
|
|
225
|
+
}, _CustomEvent_detail = /* @__PURE__ */ new WeakMap(), _b);
|
|
226
|
+
Object.defineProperties(CustomEventShim.prototype, { detail: enumerableProperty$1 });
|
|
227
|
+
const EventShimWithRealType = EventShim;
|
|
228
|
+
const CustomEventShimWithRealType = CustomEventShim;
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region ../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.6.0/node_modules/@lit-labs/ssr-dom-shim/lib/css.js
|
|
231
|
+
/**
|
|
232
|
+
* @license
|
|
233
|
+
* Copyright 2024 Google LLC
|
|
234
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
235
|
+
*/
|
|
236
|
+
var _a = class CSSRule {
|
|
237
|
+
constructor() {
|
|
238
|
+
this.STYLE_RULE = 1;
|
|
239
|
+
this.CHARSET_RULE = 2;
|
|
240
|
+
this.IMPORT_RULE = 3;
|
|
241
|
+
this.MEDIA_RULE = 4;
|
|
242
|
+
this.FONT_FACE_RULE = 5;
|
|
243
|
+
this.PAGE_RULE = 6;
|
|
244
|
+
this.NAMESPACE_RULE = 10;
|
|
245
|
+
this.KEYFRAMES_RULE = 7;
|
|
246
|
+
this.KEYFRAME_RULE = 8;
|
|
247
|
+
this.SUPPORTS_RULE = 12;
|
|
248
|
+
this.COUNTER_STYLE_RULE = 11;
|
|
249
|
+
this.FONT_FEATURE_VALUES_RULE = 14;
|
|
250
|
+
this.MARGIN_RULE = 9;
|
|
251
|
+
this.__parentStyleSheet = null;
|
|
252
|
+
this.cssText = "";
|
|
253
|
+
}
|
|
254
|
+
get parentRule() {
|
|
255
|
+
return null;
|
|
256
|
+
}
|
|
257
|
+
get parentStyleSheet() {
|
|
258
|
+
return this.__parentStyleSheet;
|
|
259
|
+
}
|
|
260
|
+
get type() {
|
|
261
|
+
return 0;
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
_a.STYLE_RULE = 1, _a.CHARSET_RULE = 2, _a.IMPORT_RULE = 3, _a.MEDIA_RULE = 4, _a.FONT_FACE_RULE = 5, _a.PAGE_RULE = 6, _a.NAMESPACE_RULE = 10, _a.KEYFRAMES_RULE = 7, _a.KEYFRAME_RULE = 8, _a.SUPPORTS_RULE = 12, _a.COUNTER_STYLE_RULE = 11, _a.FONT_FEATURE_VALUES_RULE = 14, _a.MARGIN_RULE = 9;
|
|
265
|
+
//#endregion
|
|
266
|
+
//#region ../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.6.0/node_modules/@lit-labs/ssr-dom-shim/index.js
|
|
267
|
+
/**
|
|
268
|
+
* @license
|
|
269
|
+
* Copyright 2019 Google LLC
|
|
270
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
271
|
+
*/
|
|
272
|
+
var _globalThis, _globalThis$Event, _globalThis2, _globalThis2$CustomEv, _globalThis3, _globalThis3$litServe;
|
|
273
|
+
(_globalThis$Event = (_globalThis = globalThis).Event) !== null && _globalThis$Event !== void 0 || (_globalThis.Event = EventShimWithRealType);
|
|
274
|
+
(_globalThis2$CustomEv = (_globalThis2 = globalThis).CustomEvent) !== null && _globalThis2$CustomEv !== void 0 || (_globalThis2.CustomEvent = CustomEventShimWithRealType);
|
|
275
|
+
const constructionToken = Symbol();
|
|
276
|
+
const isCaptureEventListener = (options) => {
|
|
277
|
+
var _options$capture;
|
|
278
|
+
return typeof options === "boolean" ? options : (_options$capture = options === null || options === void 0 ? void 0 : options.capture) !== null && _options$capture !== void 0 ? _options$capture : false;
|
|
279
|
+
};
|
|
280
|
+
const enumerableProperty = { __proto__: null };
|
|
281
|
+
enumerableProperty.enumerable = true;
|
|
282
|
+
Object.freeze(enumerableProperty);
|
|
283
|
+
/**
|
|
284
|
+
* This is a basic implementation of an EventTarget.
|
|
285
|
+
*
|
|
286
|
+
* This is not fully spec compliant (e.g. validation),
|
|
287
|
+
* but should work well enough for our use cases.
|
|
288
|
+
*
|
|
289
|
+
* @see https://dom.spec.whatwg.org/#eventtarget
|
|
290
|
+
*
|
|
291
|
+
* Example Event Path
|
|
292
|
+
* ------------------
|
|
293
|
+
*
|
|
294
|
+
* Note that this depends on the logic in `packages/labs/ssr/src/lib/render-value.ts`.
|
|
295
|
+
* Any element that is not a custom element or a slot element is skipped in the chain.
|
|
296
|
+
*
|
|
297
|
+
* <main>
|
|
298
|
+
* <my-el1>
|
|
299
|
+
* #shadow-dom (open)
|
|
300
|
+
* <div>
|
|
301
|
+
* <slot></slot>
|
|
302
|
+
* <my-el2>
|
|
303
|
+
* #shadow-dom (closed)
|
|
304
|
+
* <slot></slot>
|
|
305
|
+
* <event-dispatcher3></event-dispatcher3>
|
|
306
|
+
* <slot name="nested"></slot>
|
|
307
|
+
* </my-el2>
|
|
308
|
+
* </div>
|
|
309
|
+
* <event-dispatcher1></event-dispatcher1>
|
|
310
|
+
* <event-dispatcher2 slot="nested"></event-dispatcher2>
|
|
311
|
+
* </my-el1>
|
|
312
|
+
* </main>
|
|
313
|
+
*
|
|
314
|
+
* Given the previous structure, the event path of this shim would be as follows,
|
|
315
|
+
* for the given dispatcher with an event that bubbles (document-fragment
|
|
316
|
+
* represents a ShadowRoot/#shadow-dom instance):
|
|
317
|
+
*
|
|
318
|
+
* <event-dispatcher1>:
|
|
319
|
+
* [event-dispatcher1, slot{my-el1}, document-fragment{my-el1}, my-el1, document]
|
|
320
|
+
*
|
|
321
|
+
* <event-dispatcher2>:
|
|
322
|
+
* [
|
|
323
|
+
* event-dispatcher2,
|
|
324
|
+
* slot[name="nested"]{my-el1},
|
|
325
|
+
* slot{my-el2},
|
|
326
|
+
* document-fragment{my-el2},
|
|
327
|
+
* my-el2,
|
|
328
|
+
* document-fragment{my-el1},
|
|
329
|
+
* my-el1,
|
|
330
|
+
* document
|
|
331
|
+
* ]
|
|
332
|
+
*
|
|
333
|
+
* <event-dispatcher3> (without composed):
|
|
334
|
+
* [event-dispatcher3, document-fragment{my-el2}]
|
|
335
|
+
*
|
|
336
|
+
* <event-dispatcher3> (composed):
|
|
337
|
+
* [
|
|
338
|
+
* event-dispatcher3,
|
|
339
|
+
* document-fragment{my-el2},
|
|
340
|
+
* my-el2,
|
|
341
|
+
* document-fragment{my-el1},
|
|
342
|
+
* my-el1,
|
|
343
|
+
* document
|
|
344
|
+
* ]
|
|
345
|
+
*/
|
|
346
|
+
var EventTarget = class {
|
|
347
|
+
constructor() {
|
|
348
|
+
this.__eventListeners = /* @__PURE__ */ new Map();
|
|
349
|
+
this.__captureEventListeners = /* @__PURE__ */ new Map();
|
|
350
|
+
}
|
|
351
|
+
addEventListener(type, callback, options) {
|
|
352
|
+
var _normalizedOptions$si;
|
|
353
|
+
if (callback === void 0 || callback === null) return;
|
|
354
|
+
const eventListenersMap = isCaptureEventListener(options) ? this.__captureEventListeners : this.__eventListeners;
|
|
355
|
+
let eventListeners = eventListenersMap.get(type);
|
|
356
|
+
if (eventListeners === void 0) {
|
|
357
|
+
eventListeners = /* @__PURE__ */ new Map();
|
|
358
|
+
eventListenersMap.set(type, eventListeners);
|
|
359
|
+
} else if (eventListeners.has(callback)) return;
|
|
360
|
+
const normalizedOptions = typeof options === "object" && options ? options : {};
|
|
361
|
+
(_normalizedOptions$si = normalizedOptions.signal) === null || _normalizedOptions$si === void 0 || _normalizedOptions$si.addEventListener("abort", () => this.removeEventListener(type, callback, options));
|
|
362
|
+
eventListeners.set(callback, normalizedOptions !== null && normalizedOptions !== void 0 ? normalizedOptions : {});
|
|
363
|
+
}
|
|
364
|
+
removeEventListener(type, callback, options) {
|
|
365
|
+
if (callback === void 0 || callback === null) return;
|
|
366
|
+
const eventListenersMap = isCaptureEventListener(options) ? this.__captureEventListeners : this.__eventListeners;
|
|
367
|
+
const eventListeners = eventListenersMap.get(type);
|
|
368
|
+
if (eventListeners !== void 0) {
|
|
369
|
+
eventListeners.delete(callback);
|
|
370
|
+
if (!eventListeners.size) eventListenersMap.delete(type);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
dispatchEvent(event) {
|
|
374
|
+
let composedPath = this.__resolveFullEventPath();
|
|
375
|
+
if (!event.composed && this.__host) composedPath = composedPath.slice(0, composedPath.indexOf(this.__host));
|
|
376
|
+
let stopPropagation = false;
|
|
377
|
+
let stopImmediatePropagation = false;
|
|
378
|
+
let eventPhase = EventShimWithRealType.NONE;
|
|
379
|
+
let target = null;
|
|
380
|
+
let tmpTarget = null;
|
|
381
|
+
let currentTarget = null;
|
|
382
|
+
const originalStopPropagation = event.stopPropagation;
|
|
383
|
+
const originalStopImmediatePropagation = event.stopImmediatePropagation;
|
|
384
|
+
Object.defineProperties(event, {
|
|
385
|
+
target: {
|
|
386
|
+
get() {
|
|
387
|
+
var _target;
|
|
388
|
+
return (_target = target) !== null && _target !== void 0 ? _target : tmpTarget;
|
|
389
|
+
},
|
|
390
|
+
...enumerableProperty
|
|
391
|
+
},
|
|
392
|
+
srcElement: {
|
|
393
|
+
get() {
|
|
394
|
+
return event.target;
|
|
395
|
+
},
|
|
396
|
+
...enumerableProperty
|
|
397
|
+
},
|
|
398
|
+
currentTarget: {
|
|
399
|
+
get() {
|
|
400
|
+
return currentTarget;
|
|
401
|
+
},
|
|
402
|
+
...enumerableProperty
|
|
403
|
+
},
|
|
404
|
+
eventPhase: {
|
|
405
|
+
get() {
|
|
406
|
+
return eventPhase;
|
|
407
|
+
},
|
|
408
|
+
...enumerableProperty
|
|
409
|
+
},
|
|
410
|
+
composedPath: {
|
|
411
|
+
value: () => composedPath,
|
|
412
|
+
...enumerableProperty
|
|
413
|
+
},
|
|
414
|
+
stopPropagation: {
|
|
415
|
+
value: () => {
|
|
416
|
+
stopPropagation = true;
|
|
417
|
+
originalStopPropagation.call(event);
|
|
418
|
+
},
|
|
419
|
+
...enumerableProperty
|
|
420
|
+
},
|
|
421
|
+
stopImmediatePropagation: {
|
|
422
|
+
value: () => {
|
|
423
|
+
stopImmediatePropagation = true;
|
|
424
|
+
originalStopImmediatePropagation.call(event);
|
|
425
|
+
},
|
|
426
|
+
...enumerableProperty
|
|
427
|
+
}
|
|
428
|
+
});
|
|
429
|
+
const invokeEventListener = (listener, options, eventListenerMap) => {
|
|
430
|
+
if (typeof listener === "function") listener(event);
|
|
431
|
+
else if (typeof (listener === null || listener === void 0 ? void 0 : listener.handleEvent) === "function") listener.handleEvent(event);
|
|
432
|
+
if (options.once) eventListenerMap.delete(listener);
|
|
433
|
+
};
|
|
434
|
+
const finishDispatch = () => {
|
|
435
|
+
currentTarget = null;
|
|
436
|
+
eventPhase = EventShimWithRealType.NONE;
|
|
437
|
+
return !event.defaultPrevented;
|
|
438
|
+
};
|
|
439
|
+
const captureEventPath = composedPath.slice().reverse();
|
|
440
|
+
target = !this.__host || !event.composed ? this : null;
|
|
441
|
+
const retarget = (eventTargets) => {
|
|
442
|
+
tmpTarget = this;
|
|
443
|
+
while (tmpTarget.__host && eventTargets.includes(tmpTarget.__host)) tmpTarget = tmpTarget.__host;
|
|
444
|
+
};
|
|
445
|
+
for (const eventTarget of captureEventPath) {
|
|
446
|
+
if (!target && (!tmpTarget || tmpTarget === eventTarget.__host)) retarget(captureEventPath.slice(captureEventPath.indexOf(eventTarget)));
|
|
447
|
+
currentTarget = eventTarget;
|
|
448
|
+
eventPhase = eventTarget === event.target ? EventShimWithRealType.AT_TARGET : EventShimWithRealType.CAPTURING_PHASE;
|
|
449
|
+
const captureEventListeners = eventTarget.__captureEventListeners.get(event.type);
|
|
450
|
+
if (captureEventListeners) for (const [listener, options] of captureEventListeners) {
|
|
451
|
+
invokeEventListener(listener, options, captureEventListeners);
|
|
452
|
+
if (stopImmediatePropagation) return finishDispatch();
|
|
453
|
+
}
|
|
454
|
+
if (stopPropagation) return finishDispatch();
|
|
455
|
+
}
|
|
456
|
+
const bubbleEventPath = event.bubbles ? composedPath : [this];
|
|
457
|
+
tmpTarget = null;
|
|
458
|
+
for (const eventTarget of bubbleEventPath) {
|
|
459
|
+
if (!target && (!tmpTarget || eventTarget === tmpTarget.__host)) retarget(bubbleEventPath.slice(0, bubbleEventPath.indexOf(eventTarget) + 1));
|
|
460
|
+
currentTarget = eventTarget;
|
|
461
|
+
eventPhase = eventTarget === event.target ? EventShimWithRealType.AT_TARGET : EventShimWithRealType.BUBBLING_PHASE;
|
|
462
|
+
const eventListeners = eventTarget.__eventListeners.get(event.type);
|
|
463
|
+
if (eventListeners) for (const [listener, options] of eventListeners) {
|
|
464
|
+
invokeEventListener(listener, options, eventListeners);
|
|
465
|
+
if (stopImmediatePropagation) return finishDispatch();
|
|
466
|
+
}
|
|
467
|
+
if (stopPropagation) return finishDispatch();
|
|
468
|
+
}
|
|
469
|
+
return finishDispatch();
|
|
470
|
+
}
|
|
471
|
+
__resolveFullEventPath() {
|
|
472
|
+
if (this.__eventPathCache) return this.__eventPathCache;
|
|
473
|
+
else if (!this.__eventTargetParent) return this.__eventPathCache = [
|
|
474
|
+
this,
|
|
475
|
+
documentShim,
|
|
476
|
+
windowShim
|
|
477
|
+
];
|
|
478
|
+
else return this.__eventPathCache = [this, ...this.__eventTargetParent.__resolveFullEventPath()];
|
|
479
|
+
}
|
|
480
|
+
};
|
|
481
|
+
const attributes = /* @__PURE__ */ new WeakMap();
|
|
482
|
+
const attributesForElement = (element) => {
|
|
483
|
+
let attrs = attributes.get(element);
|
|
484
|
+
if (attrs === void 0) attributes.set(element, attrs = /* @__PURE__ */ new Map());
|
|
485
|
+
return attrs;
|
|
486
|
+
};
|
|
487
|
+
const NodeShim = class Node extends EventTarget {
|
|
488
|
+
getRootNode(options) {
|
|
489
|
+
var _host$__shadowRoot;
|
|
490
|
+
if (options === null || options === void 0 ? void 0 : options.composed) return document$1;
|
|
491
|
+
const host = this.__host;
|
|
492
|
+
return (_host$__shadowRoot = host === null || host === void 0 ? void 0 : host.__shadowRoot) !== null && _host$__shadowRoot !== void 0 ? _host$__shadowRoot : document$1;
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
const DocumentShim = class Document extends NodeShim {
|
|
496
|
+
get adoptedStyleSheets() {
|
|
497
|
+
return [];
|
|
498
|
+
}
|
|
499
|
+
createTreeWalker() {
|
|
500
|
+
return {};
|
|
501
|
+
}
|
|
502
|
+
createTextNode() {
|
|
503
|
+
return {};
|
|
504
|
+
}
|
|
505
|
+
createElement() {
|
|
506
|
+
return {};
|
|
507
|
+
}
|
|
508
|
+
};
|
|
509
|
+
const documentShim = new DocumentShim();
|
|
510
|
+
const document$1 = documentShim;
|
|
511
|
+
const WindowShim = class Window extends NodeShim {
|
|
512
|
+
constructor(token) {
|
|
513
|
+
super();
|
|
514
|
+
if (token !== constructionToken) throw new TypeError("Illegal constructor");
|
|
515
|
+
Object.assign(this, globalThis, {
|
|
516
|
+
CustomElementRegistry,
|
|
517
|
+
customElements: customElements$1,
|
|
518
|
+
document: document$1,
|
|
519
|
+
Document: DocumentShim,
|
|
520
|
+
Element: ElementShim,
|
|
521
|
+
EventTarget,
|
|
522
|
+
HTMLElement: HTMLElementShim,
|
|
523
|
+
Node: NodeShim,
|
|
524
|
+
ShadowRoot: ShadowRootShim,
|
|
525
|
+
window: this,
|
|
526
|
+
Window: WindowShim
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
};
|
|
530
|
+
const ElementShim = class Element extends NodeShim {
|
|
531
|
+
constructor() {
|
|
532
|
+
super(...arguments);
|
|
533
|
+
this.__shadowRootMode = null;
|
|
534
|
+
this.__shadowRoot = null;
|
|
535
|
+
this.__internals = null;
|
|
536
|
+
}
|
|
537
|
+
get attributes() {
|
|
538
|
+
return Array.from(attributesForElement(this)).map(([name, value]) => ({
|
|
539
|
+
name,
|
|
540
|
+
value
|
|
541
|
+
}));
|
|
542
|
+
}
|
|
543
|
+
get shadowRoot() {
|
|
544
|
+
if (this.__shadowRootMode === "closed") return null;
|
|
545
|
+
return this.__shadowRoot;
|
|
546
|
+
}
|
|
547
|
+
get localName() {
|
|
548
|
+
return this.constructor.__localName;
|
|
549
|
+
}
|
|
550
|
+
get tagName() {
|
|
551
|
+
var _this$localName;
|
|
552
|
+
return (_this$localName = this.localName) === null || _this$localName === void 0 ? void 0 : _this$localName.toUpperCase();
|
|
553
|
+
}
|
|
554
|
+
setAttribute(name, value) {
|
|
555
|
+
attributesForElement(this).set(name, String(value));
|
|
556
|
+
}
|
|
557
|
+
removeAttribute(name) {
|
|
558
|
+
attributesForElement(this).delete(name);
|
|
559
|
+
}
|
|
560
|
+
toggleAttribute(name, force) {
|
|
561
|
+
if (this.hasAttribute(name)) {
|
|
562
|
+
if (force === void 0 || !force) {
|
|
563
|
+
this.removeAttribute(name);
|
|
564
|
+
return false;
|
|
565
|
+
}
|
|
566
|
+
} else if (force === void 0 || force) {
|
|
567
|
+
this.setAttribute(name, "");
|
|
568
|
+
return true;
|
|
569
|
+
} else return false;
|
|
570
|
+
return true;
|
|
571
|
+
}
|
|
572
|
+
hasAttribute(name) {
|
|
573
|
+
return attributesForElement(this).has(name);
|
|
574
|
+
}
|
|
575
|
+
attachShadow(init) {
|
|
576
|
+
this.__shadowRootMode = init.mode;
|
|
577
|
+
const shadowRoot = new ShadowRootShim(constructionToken, init);
|
|
578
|
+
shadowRoot.__eventTargetParent = this;
|
|
579
|
+
shadowRoot.__host = this;
|
|
580
|
+
return this.__shadowRoot = shadowRoot;
|
|
581
|
+
}
|
|
582
|
+
attachInternals() {
|
|
583
|
+
if (this.__internals !== null) throw new Error("Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.");
|
|
584
|
+
const internals = new ElementInternalsShim(this);
|
|
585
|
+
this.__internals = internals;
|
|
586
|
+
return internals;
|
|
587
|
+
}
|
|
588
|
+
getAttribute(name) {
|
|
589
|
+
const value = attributesForElement(this).get(name);
|
|
590
|
+
return value !== null && value !== void 0 ? value : null;
|
|
591
|
+
}
|
|
592
|
+
};
|
|
593
|
+
const HTMLElementShim = class HTMLElement extends ElementShim {};
|
|
594
|
+
const HTMLElementShimWithRealType = HTMLElementShim;
|
|
595
|
+
const ShadowRootShim = class ShadowRoot extends NodeShim {
|
|
596
|
+
get host() {
|
|
597
|
+
return this.__host;
|
|
598
|
+
}
|
|
599
|
+
constructor(constructionToken, init) {
|
|
600
|
+
super();
|
|
601
|
+
if (constructionToken !== constructionToken) throw new TypeError("Illegal constructor");
|
|
602
|
+
this.mode = init.mode;
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
(_globalThis3$litServe = (_globalThis3 = globalThis).litServerRoot) !== null && _globalThis3$litServe !== void 0 || (_globalThis3.litServerRoot = Object.defineProperty(new HTMLElementShimWithRealType(), "localName", { get() {
|
|
606
|
+
return "lit-server-root";
|
|
607
|
+
} }));
|
|
608
|
+
function promiseWithResolvers() {
|
|
609
|
+
let resolve;
|
|
610
|
+
let reject;
|
|
611
|
+
return {
|
|
612
|
+
promise: new Promise((res, rej) => {
|
|
613
|
+
resolve = res;
|
|
614
|
+
reject = rej;
|
|
615
|
+
}),
|
|
616
|
+
resolve,
|
|
617
|
+
reject
|
|
618
|
+
};
|
|
619
|
+
}
|
|
620
|
+
var CustomElementRegistry = class {
|
|
621
|
+
constructor() {
|
|
622
|
+
this.__definitions = /* @__PURE__ */ new Map();
|
|
623
|
+
this.__reverseDefinitions = /* @__PURE__ */ new Map();
|
|
624
|
+
this.__pendingWhenDefineds = /* @__PURE__ */ new Map();
|
|
625
|
+
}
|
|
626
|
+
define(name, ctor) {
|
|
627
|
+
var _ctor$observedAttribu, _this$__pendingWhenDe;
|
|
628
|
+
if (this.__definitions.has(name)) if (process.env.NODE_ENV === "development") console.warn(`'CustomElementRegistry' already has "${name}" defined. This may have been caused by live reload or hot module replacement in which case it can be safely ignored.\nMake sure to test your application with a production build as repeat registrations will throw in production.`);
|
|
629
|
+
else throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${name}" has already been used with this registry`);
|
|
630
|
+
if (this.__reverseDefinitions.has(ctor)) throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the constructor has already been used with this registry for the tag name ${this.__reverseDefinitions.get(ctor)}`);
|
|
631
|
+
ctor.__localName = name;
|
|
632
|
+
this.__definitions.set(name, {
|
|
633
|
+
ctor,
|
|
634
|
+
observedAttributes: (_ctor$observedAttribu = ctor.observedAttributes) !== null && _ctor$observedAttribu !== void 0 ? _ctor$observedAttribu : []
|
|
635
|
+
});
|
|
636
|
+
this.__reverseDefinitions.set(ctor, name);
|
|
637
|
+
(_this$__pendingWhenDe = this.__pendingWhenDefineds.get(name)) === null || _this$__pendingWhenDe === void 0 || _this$__pendingWhenDe.resolve(ctor);
|
|
638
|
+
this.__pendingWhenDefineds.delete(name);
|
|
639
|
+
}
|
|
640
|
+
get(name) {
|
|
641
|
+
const definition = this.__definitions.get(name);
|
|
642
|
+
return definition === null || definition === void 0 ? void 0 : definition.ctor;
|
|
643
|
+
}
|
|
644
|
+
getName(ctor) {
|
|
645
|
+
var _this$__reverseDefini;
|
|
646
|
+
return (_this$__reverseDefini = this.__reverseDefinitions.get(ctor)) !== null && _this$__reverseDefini !== void 0 ? _this$__reverseDefini : null;
|
|
647
|
+
}
|
|
648
|
+
initialize(_root) {
|
|
649
|
+
throw new Error("customElements.initialize is not currently supported in SSR. Please file a bug if you need it.");
|
|
650
|
+
}
|
|
651
|
+
upgrade(_element) {
|
|
652
|
+
throw new Error("customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.");
|
|
653
|
+
}
|
|
654
|
+
async whenDefined(name) {
|
|
655
|
+
const definition = this.__definitions.get(name);
|
|
656
|
+
if (definition) return definition.ctor;
|
|
657
|
+
let withResolvers = this.__pendingWhenDefineds.get(name);
|
|
658
|
+
if (!withResolvers) {
|
|
659
|
+
withResolvers = promiseWithResolvers();
|
|
660
|
+
this.__pendingWhenDefineds.set(name, withResolvers);
|
|
661
|
+
}
|
|
662
|
+
return withResolvers.promise;
|
|
663
|
+
}
|
|
664
|
+
};
|
|
665
|
+
const customElements$1 = new CustomElementRegistry();
|
|
666
|
+
const windowShim = new WindowShim(constructionToken);
|
|
667
|
+
//#endregion
|
|
668
|
+
//#region ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/node/css-tag.js
|
|
669
|
+
/**
|
|
670
|
+
* @license
|
|
671
|
+
* Copyright 2019 Google LLC
|
|
672
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
673
|
+
*/
|
|
674
|
+
const t$2 = globalThis, e$1 = t$2.ShadowRoot && (void 0 === t$2.ShadyCSS || t$2.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype, s$2 = Symbol(), o$4 = /* @__PURE__ */ new WeakMap();
|
|
675
|
+
var n$3 = class {
|
|
676
|
+
constructor(t, e, o) {
|
|
677
|
+
if (this._$cssResult$ = !0, o !== s$2) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
|
|
678
|
+
this.cssText = t, this.t = e;
|
|
679
|
+
}
|
|
680
|
+
get styleSheet() {
|
|
681
|
+
let t = this.o;
|
|
682
|
+
const s = this.t;
|
|
683
|
+
if (e$1 && void 0 === t) {
|
|
684
|
+
const e = void 0 !== s && 1 === s.length;
|
|
685
|
+
e && (t = o$4.get(s)), void 0 === t && ((this.o = t = new CSSStyleSheet()).replaceSync(this.cssText), e && o$4.set(s, t));
|
|
686
|
+
}
|
|
687
|
+
return t;
|
|
688
|
+
}
|
|
689
|
+
toString() {
|
|
690
|
+
return this.cssText;
|
|
691
|
+
}
|
|
692
|
+
};
|
|
693
|
+
const r$4 = (t) => new n$3("string" == typeof t ? t : t + "", void 0, s$2), i$2 = (t, ...e) => {
|
|
694
|
+
return new n$3(1 === t.length ? t[0] : e.reduce((e, s, o) => e + ((t) => {
|
|
695
|
+
if (!0 === t._$cssResult$) return t.cssText;
|
|
696
|
+
if ("number" == typeof t) return t;
|
|
697
|
+
throw Error("Value passed to 'css' function must be a 'css' function result: " + t + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
|
|
698
|
+
})(s) + t[o + 1], t[0]), t, s$2);
|
|
699
|
+
}, S$1 = (s, o) => {
|
|
700
|
+
if (e$1) s.adoptedStyleSheets = o.map((t) => t instanceof CSSStyleSheet ? t : t.styleSheet);
|
|
701
|
+
else for (const e of o) {
|
|
702
|
+
const o = document.createElement("style"), n = t$2.litNonce;
|
|
703
|
+
void 0 !== n && o.setAttribute("nonce", n), o.textContent = e.cssText, s.appendChild(o);
|
|
704
|
+
}
|
|
705
|
+
}, c$2 = e$1 || void 0 === t$2.CSSStyleSheet ? (t) => t : (t) => t instanceof CSSStyleSheet ? ((t) => {
|
|
706
|
+
let e = "";
|
|
707
|
+
for (const s of t.cssRules) e += s.cssText;
|
|
708
|
+
return r$4(e);
|
|
709
|
+
})(t) : t;
|
|
710
|
+
//#endregion
|
|
711
|
+
//#region ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/node/reactive-element.js
|
|
712
|
+
var _l$customElements, _Symbol, _Symbol$metadata, _l$litPropertyMetadat, _globalThis$HTMLEleme, _l$reactiveElementVer;
|
|
713
|
+
const { is: h$1, defineProperty: r$3, getOwnPropertyDescriptor: o$3, getOwnPropertyNames: n$2, getOwnPropertySymbols: a$1, getPrototypeOf: c$1 } = Object, l$1 = globalThis;
|
|
714
|
+
(_l$customElements = l$1.customElements) !== null && _l$customElements !== void 0 || (l$1.customElements = customElements$1);
|
|
715
|
+
const p$1 = l$1.trustedTypes, d$1 = p$1 ? p$1.emptyScript : "", u$1 = l$1.reactiveElementPolyfillSupport, f$1 = (t, s) => t, b$1 = {
|
|
716
|
+
toAttribute(t, s) {
|
|
717
|
+
switch (s) {
|
|
718
|
+
case Boolean:
|
|
719
|
+
t = t ? d$1 : null;
|
|
720
|
+
break;
|
|
721
|
+
case Object:
|
|
722
|
+
case Array: t = null == t ? t : JSON.stringify(t);
|
|
723
|
+
}
|
|
724
|
+
return t;
|
|
725
|
+
},
|
|
726
|
+
fromAttribute(t, s) {
|
|
727
|
+
let i = t;
|
|
728
|
+
switch (s) {
|
|
729
|
+
case Boolean:
|
|
730
|
+
i = null !== t;
|
|
731
|
+
break;
|
|
732
|
+
case Number:
|
|
733
|
+
i = null === t ? null : Number(t);
|
|
734
|
+
break;
|
|
735
|
+
case Object:
|
|
736
|
+
case Array: try {
|
|
737
|
+
i = JSON.parse(t);
|
|
738
|
+
} catch (t) {
|
|
739
|
+
i = null;
|
|
740
|
+
}
|
|
741
|
+
}
|
|
742
|
+
return i;
|
|
743
|
+
}
|
|
744
|
+
}, m$1 = (t, s) => !h$1(t, s), y$1 = {
|
|
745
|
+
attribute: !0,
|
|
746
|
+
type: String,
|
|
747
|
+
converter: b$1,
|
|
748
|
+
reflect: !1,
|
|
749
|
+
useDefault: !1,
|
|
750
|
+
hasChanged: m$1
|
|
751
|
+
};
|
|
752
|
+
(_Symbol$metadata = (_Symbol = Symbol).metadata) !== null && _Symbol$metadata !== void 0 || (_Symbol.metadata = Symbol("metadata")), (_l$litPropertyMetadat = l$1.litPropertyMetadata) !== null && _l$litPropertyMetadat !== void 0 || (l$1.litPropertyMetadata = /* @__PURE__ */ new WeakMap());
|
|
753
|
+
var g$1 = class extends ((_globalThis$HTMLEleme = globalThis.HTMLElement) !== null && _globalThis$HTMLEleme !== void 0 ? _globalThis$HTMLEleme : HTMLElementShimWithRealType) {
|
|
754
|
+
static addInitializer(t) {
|
|
755
|
+
var _this$l;
|
|
756
|
+
this._$Ei(), ((_this$l = this.l) !== null && _this$l !== void 0 ? _this$l : this.l = []).push(t);
|
|
757
|
+
}
|
|
758
|
+
static get observedAttributes() {
|
|
759
|
+
return this.finalize(), this._$Eh && [...this._$Eh.keys()];
|
|
760
|
+
}
|
|
761
|
+
static createProperty(t, s = y$1) {
|
|
762
|
+
if (s.state && (s.attribute = !1), this._$Ei(), this.prototype.hasOwnProperty(t) && ((s = Object.create(s)).wrapped = !0), this.elementProperties.set(t, s), !s.noAccessor) {
|
|
763
|
+
const i = Symbol(), e = this.getPropertyDescriptor(t, i, s);
|
|
764
|
+
void 0 !== e && r$3(this.prototype, t, e);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
static getPropertyDescriptor(t, s, i) {
|
|
768
|
+
var _o;
|
|
769
|
+
const { get: e, set: h } = (_o = o$3(this.prototype, t)) !== null && _o !== void 0 ? _o : {
|
|
770
|
+
get() {
|
|
771
|
+
return this[s];
|
|
772
|
+
},
|
|
773
|
+
set(t) {
|
|
774
|
+
this[s] = t;
|
|
775
|
+
}
|
|
776
|
+
};
|
|
777
|
+
return {
|
|
778
|
+
get: e,
|
|
779
|
+
set(s) {
|
|
780
|
+
const r = e === null || e === void 0 ? void 0 : e.call(this);
|
|
781
|
+
h === null || h === void 0 || h.call(this, s), this.requestUpdate(t, r, i);
|
|
782
|
+
},
|
|
783
|
+
configurable: !0,
|
|
784
|
+
enumerable: !0
|
|
785
|
+
};
|
|
786
|
+
}
|
|
787
|
+
static getPropertyOptions(t) {
|
|
788
|
+
var _this$elementProperti;
|
|
789
|
+
return (_this$elementProperti = this.elementProperties.get(t)) !== null && _this$elementProperti !== void 0 ? _this$elementProperti : y$1;
|
|
790
|
+
}
|
|
791
|
+
static _$Ei() {
|
|
792
|
+
if (this.hasOwnProperty(f$1("elementProperties"))) return;
|
|
793
|
+
const t = c$1(this);
|
|
794
|
+
t.finalize(), void 0 !== t.l && (this.l = [...t.l]), this.elementProperties = new Map(t.elementProperties);
|
|
795
|
+
}
|
|
796
|
+
static finalize() {
|
|
797
|
+
if (this.hasOwnProperty(f$1("finalized"))) return;
|
|
798
|
+
if (this.finalized = !0, this._$Ei(), this.hasOwnProperty(f$1("properties"))) {
|
|
799
|
+
const t = this.properties, s = [...n$2(t), ...a$1(t)];
|
|
800
|
+
for (const i of s) this.createProperty(i, t[i]);
|
|
801
|
+
}
|
|
802
|
+
const t = this[Symbol.metadata];
|
|
803
|
+
if (null !== t) {
|
|
804
|
+
const s = litPropertyMetadata.get(t);
|
|
805
|
+
if (void 0 !== s) for (const [t, i] of s) this.elementProperties.set(t, i);
|
|
806
|
+
}
|
|
807
|
+
this._$Eh = /* @__PURE__ */ new Map();
|
|
808
|
+
for (const [t, s] of this.elementProperties) {
|
|
809
|
+
const i = this._$Eu(t, s);
|
|
810
|
+
void 0 !== i && this._$Eh.set(i, t);
|
|
811
|
+
}
|
|
812
|
+
this.elementStyles = this.finalizeStyles(this.styles);
|
|
813
|
+
}
|
|
814
|
+
static finalizeStyles(t) {
|
|
815
|
+
const s = [];
|
|
816
|
+
if (Array.isArray(t)) {
|
|
817
|
+
const e = new Set(t.flat(Infinity).reverse());
|
|
818
|
+
for (const t of e) s.unshift(c$2(t));
|
|
819
|
+
} else void 0 !== t && s.push(c$2(t));
|
|
820
|
+
return s;
|
|
821
|
+
}
|
|
822
|
+
static _$Eu(t, s) {
|
|
823
|
+
const i = s.attribute;
|
|
824
|
+
return !1 === i ? void 0 : "string" == typeof i ? i : "string" == typeof t ? t.toLowerCase() : void 0;
|
|
825
|
+
}
|
|
826
|
+
constructor() {
|
|
827
|
+
super(), this._$Ep = void 0, this.isUpdatePending = !1, this.hasUpdated = !1, this._$Em = null, this._$Ev();
|
|
828
|
+
}
|
|
829
|
+
_$Ev() {
|
|
830
|
+
var _this$constructor$l;
|
|
831
|
+
this._$ES = new Promise((t) => this.enableUpdating = t), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), (_this$constructor$l = this.constructor.l) === null || _this$constructor$l === void 0 || _this$constructor$l.forEach((t) => t(this));
|
|
832
|
+
}
|
|
833
|
+
addController(t) {
|
|
834
|
+
var _this$_$EO, _t$hostConnected;
|
|
835
|
+
((_this$_$EO = this._$EO) !== null && _this$_$EO !== void 0 ? _this$_$EO : this._$EO = /* @__PURE__ */ new Set()).add(t), void 0 !== this.renderRoot && this.isConnected && ((_t$hostConnected = t.hostConnected) === null || _t$hostConnected === void 0 || _t$hostConnected.call(t));
|
|
836
|
+
}
|
|
837
|
+
removeController(t) {
|
|
838
|
+
var _this$_$EO2;
|
|
839
|
+
(_this$_$EO2 = this._$EO) === null || _this$_$EO2 === void 0 || _this$_$EO2.delete(t);
|
|
840
|
+
}
|
|
841
|
+
_$E_() {
|
|
842
|
+
const t = /* @__PURE__ */ new Map(), s = this.constructor.elementProperties;
|
|
843
|
+
for (const i of s.keys()) this.hasOwnProperty(i) && (t.set(i, this[i]), delete this[i]);
|
|
844
|
+
t.size > 0 && (this._$Ep = t);
|
|
845
|
+
}
|
|
846
|
+
createRenderRoot() {
|
|
847
|
+
var _this$shadowRoot;
|
|
848
|
+
const t = (_this$shadowRoot = this.shadowRoot) !== null && _this$shadowRoot !== void 0 ? _this$shadowRoot : this.attachShadow(this.constructor.shadowRootOptions);
|
|
849
|
+
return S$1(t, this.constructor.elementStyles), t;
|
|
850
|
+
}
|
|
851
|
+
connectedCallback() {
|
|
852
|
+
var _this$renderRoot, _this$_$EO3;
|
|
853
|
+
(_this$renderRoot = this.renderRoot) !== null && _this$renderRoot !== void 0 || (this.renderRoot = this.createRenderRoot()), this.enableUpdating(!0), (_this$_$EO3 = this._$EO) === null || _this$_$EO3 === void 0 || _this$_$EO3.forEach((t) => {
|
|
854
|
+
var _t$hostConnected2;
|
|
855
|
+
return (_t$hostConnected2 = t.hostConnected) === null || _t$hostConnected2 === void 0 ? void 0 : _t$hostConnected2.call(t);
|
|
856
|
+
});
|
|
857
|
+
}
|
|
858
|
+
enableUpdating(t) {}
|
|
859
|
+
disconnectedCallback() {
|
|
860
|
+
var _this$_$EO4;
|
|
861
|
+
(_this$_$EO4 = this._$EO) === null || _this$_$EO4 === void 0 || _this$_$EO4.forEach((t) => {
|
|
862
|
+
var _t$hostDisconnected;
|
|
863
|
+
return (_t$hostDisconnected = t.hostDisconnected) === null || _t$hostDisconnected === void 0 ? void 0 : _t$hostDisconnected.call(t);
|
|
864
|
+
});
|
|
865
|
+
}
|
|
866
|
+
attributeChangedCallback(t, s, i) {
|
|
867
|
+
this._$AK(t, i);
|
|
868
|
+
}
|
|
869
|
+
_$ET(t, s) {
|
|
870
|
+
const i = this.constructor.elementProperties.get(t), e = this.constructor._$Eu(t, i);
|
|
871
|
+
if (void 0 !== e && !0 === i.reflect) {
|
|
872
|
+
var _i$converter;
|
|
873
|
+
const h = (void 0 !== ((_i$converter = i.converter) === null || _i$converter === void 0 ? void 0 : _i$converter.toAttribute) ? i.converter : b$1).toAttribute(s, i.type);
|
|
874
|
+
this._$Em = t, null == h ? this.removeAttribute(e) : this.setAttribute(e, h), this._$Em = null;
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
_$AK(t, s) {
|
|
878
|
+
const i = this.constructor, e = i._$Eh.get(t);
|
|
879
|
+
if (void 0 !== e && this._$Em !== e) {
|
|
880
|
+
var _t$converter, _ref, _this$_$Ej;
|
|
881
|
+
const t = i.getPropertyOptions(e), h = "function" == typeof t.converter ? { fromAttribute: t.converter } : void 0 !== ((_t$converter = t.converter) === null || _t$converter === void 0 ? void 0 : _t$converter.fromAttribute) ? t.converter : b$1;
|
|
882
|
+
this._$Em = e;
|
|
883
|
+
const r = h.fromAttribute(s, t.type);
|
|
884
|
+
this[e] = (_ref = r !== null && r !== void 0 ? r : (_this$_$Ej = this._$Ej) === null || _this$_$Ej === void 0 ? void 0 : _this$_$Ej.get(e)) !== null && _ref !== void 0 ? _ref : r, this._$Em = null;
|
|
885
|
+
}
|
|
886
|
+
}
|
|
887
|
+
requestUpdate(t, s, i, e = !1, h) {
|
|
888
|
+
if (void 0 !== t) {
|
|
889
|
+
var _i, _i$hasChanged, _this$_$Ej2;
|
|
890
|
+
const r = this.constructor;
|
|
891
|
+
if (!1 === e && (h = this[t]), (_i = i) !== null && _i !== void 0 || (i = r.getPropertyOptions(t)), !(((_i$hasChanged = i.hasChanged) !== null && _i$hasChanged !== void 0 ? _i$hasChanged : m$1)(h, s) || i.useDefault && i.reflect && h === ((_this$_$Ej2 = this._$Ej) === null || _this$_$Ej2 === void 0 ? void 0 : _this$_$Ej2.get(t)) && !this.hasAttribute(r._$Eu(t, i)))) return;
|
|
892
|
+
this.C(t, s, i);
|
|
893
|
+
}
|
|
894
|
+
!1 === this.isUpdatePending && (this._$ES = this._$EP());
|
|
895
|
+
}
|
|
896
|
+
C(t, s, { useDefault: i, reflect: e, wrapped: h }, r) {
|
|
897
|
+
var _this$_$Ej3, _ref2, _this$_$Eq;
|
|
898
|
+
i && !((_this$_$Ej3 = this._$Ej) !== null && _this$_$Ej3 !== void 0 ? _this$_$Ej3 : this._$Ej = /* @__PURE__ */ new Map()).has(t) && (this._$Ej.set(t, (_ref2 = r !== null && r !== void 0 ? r : s) !== null && _ref2 !== void 0 ? _ref2 : this[t]), !0 !== h || void 0 !== r) || (this._$AL.has(t) || (this.hasUpdated || i || (s = void 0), this._$AL.set(t, s)), !0 === e && this._$Em !== t && ((_this$_$Eq = this._$Eq) !== null && _this$_$Eq !== void 0 ? _this$_$Eq : this._$Eq = /* @__PURE__ */ new Set()).add(t));
|
|
899
|
+
}
|
|
900
|
+
async _$EP() {
|
|
901
|
+
this.isUpdatePending = !0;
|
|
902
|
+
try {
|
|
903
|
+
await this._$ES;
|
|
904
|
+
} catch (t) {
|
|
905
|
+
Promise.reject(t);
|
|
906
|
+
}
|
|
907
|
+
const t = this.scheduleUpdate();
|
|
908
|
+
return null != t && await t, !this.isUpdatePending;
|
|
909
|
+
}
|
|
910
|
+
scheduleUpdate() {
|
|
911
|
+
return this.performUpdate();
|
|
912
|
+
}
|
|
913
|
+
performUpdate() {
|
|
914
|
+
if (!this.isUpdatePending) return;
|
|
915
|
+
if (!this.hasUpdated) {
|
|
916
|
+
var _this$renderRoot2;
|
|
917
|
+
if ((_this$renderRoot2 = this.renderRoot) !== null && _this$renderRoot2 !== void 0 || (this.renderRoot = this.createRenderRoot()), this._$Ep) {
|
|
918
|
+
for (const [t, s] of this._$Ep) this[t] = s;
|
|
919
|
+
this._$Ep = void 0;
|
|
920
|
+
}
|
|
921
|
+
const t = this.constructor.elementProperties;
|
|
922
|
+
if (t.size > 0) for (const [s, i] of t) {
|
|
923
|
+
const { wrapped: t } = i, e = this[s];
|
|
924
|
+
!0 !== t || this._$AL.has(s) || void 0 === e || this.C(s, void 0, i, e);
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
let t = !1;
|
|
928
|
+
const s = this._$AL;
|
|
929
|
+
try {
|
|
930
|
+
var _this$_$EO5;
|
|
931
|
+
t = this.shouldUpdate(s), t ? (this.willUpdate(s), (_this$_$EO5 = this._$EO) === null || _this$_$EO5 === void 0 || _this$_$EO5.forEach((t) => {
|
|
932
|
+
var _t$hostUpdate;
|
|
933
|
+
return (_t$hostUpdate = t.hostUpdate) === null || _t$hostUpdate === void 0 ? void 0 : _t$hostUpdate.call(t);
|
|
934
|
+
}), this.update(s)) : this._$EM();
|
|
935
|
+
} catch (s) {
|
|
936
|
+
throw t = !1, this._$EM(), s;
|
|
937
|
+
}
|
|
938
|
+
t && this._$AE(s);
|
|
939
|
+
}
|
|
940
|
+
willUpdate(t) {}
|
|
941
|
+
_$AE(t) {
|
|
942
|
+
var _this$_$EO6;
|
|
943
|
+
(_this$_$EO6 = this._$EO) === null || _this$_$EO6 === void 0 || _this$_$EO6.forEach((t) => {
|
|
944
|
+
var _t$hostUpdated;
|
|
945
|
+
return (_t$hostUpdated = t.hostUpdated) === null || _t$hostUpdated === void 0 ? void 0 : _t$hostUpdated.call(t);
|
|
946
|
+
}), this.hasUpdated || (this.hasUpdated = !0, this.firstUpdated(t)), this.updated(t);
|
|
947
|
+
}
|
|
948
|
+
_$EM() {
|
|
949
|
+
this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = !1;
|
|
950
|
+
}
|
|
951
|
+
get updateComplete() {
|
|
952
|
+
return this.getUpdateComplete();
|
|
953
|
+
}
|
|
954
|
+
getUpdateComplete() {
|
|
955
|
+
return this._$ES;
|
|
956
|
+
}
|
|
957
|
+
shouldUpdate(t) {
|
|
958
|
+
return !0;
|
|
959
|
+
}
|
|
960
|
+
update(t) {
|
|
961
|
+
this._$Eq && (this._$Eq = this._$Eq.forEach((t) => this._$ET(t, this[t]))), this._$EM();
|
|
962
|
+
}
|
|
963
|
+
updated(t) {}
|
|
964
|
+
firstUpdated(t) {}
|
|
965
|
+
};
|
|
966
|
+
g$1.elementStyles = [], g$1.shadowRootOptions = { mode: "open" }, g$1[f$1("elementProperties")] = /* @__PURE__ */ new Map(), g$1[f$1("finalized")] = /* @__PURE__ */ new Map(), u$1 === null || u$1 === void 0 || u$1({ ReactiveElement: g$1 }), ((_l$reactiveElementVer = l$1.reactiveElementVersions) !== null && _l$reactiveElementVer !== void 0 ? _l$reactiveElementVer : l$1.reactiveElementVersions = []).push("2.1.2");
|
|
967
|
+
//#endregion
|
|
968
|
+
//#region ../../node_modules/.pnpm/lit-html@3.3.3/node_modules/lit-html/node/lit-html.js
|
|
969
|
+
var _t$litHtmlVersions;
|
|
970
|
+
/**
|
|
971
|
+
* @license
|
|
972
|
+
* Copyright 2017 Google LLC
|
|
973
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
974
|
+
*/
|
|
975
|
+
const t$1 = globalThis, i$1 = (t) => t, s$1 = t$1.trustedTypes, e = s$1 ? s$1.createPolicy("lit-html", { createHTML: (t) => t }) : void 0, h = "$lit$", o$2 = `lit$${Math.random().toFixed(9).slice(2)}$`, n$1 = "?" + o$2, r$2 = `<${n$1}>`, l = void 0 === t$1.document ? { createTreeWalker: () => ({}) } : document, c = () => l.createComment(""), a = (t) => null === t || "object" != typeof t && "function" != typeof t, u = Array.isArray, d = (t) => u(t) || "function" == typeof (t === null || t === void 0 ? void 0 : t[Symbol.iterator]), f = "[ \n\f\r]", v = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g, _ = /-->/g, m = />/g, p = RegExp(`>|${f}(?:([^\\s"'>=/]+)(${f}*=${f}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`, "g"), g = /'/g, $ = /"/g, y = /^(?:script|style|textarea|title)$/i, x = (t) => (i, ...s) => ({
|
|
976
|
+
_$litType$: t,
|
|
977
|
+
strings: i,
|
|
978
|
+
values: s
|
|
979
|
+
}), T = x(1), E = Symbol.for("lit-noChange"), A = Symbol.for("lit-nothing"), C = /* @__PURE__ */ new WeakMap(), P = l.createTreeWalker(l, 129);
|
|
980
|
+
function V(t, i) {
|
|
981
|
+
if (!u(t) || !t.hasOwnProperty("raw")) throw Error("invalid template strings array");
|
|
982
|
+
return void 0 !== e ? e.createHTML(i) : i;
|
|
983
|
+
}
|
|
984
|
+
const N = (t, i) => {
|
|
985
|
+
const s = t.length - 1, e = [];
|
|
986
|
+
let n, l = 2 === i ? "<svg>" : 3 === i ? "<math>" : "", c = v;
|
|
987
|
+
for (let i = 0; i < s; i++) {
|
|
988
|
+
var _n;
|
|
989
|
+
const s = t[i];
|
|
990
|
+
let a, u, d = -1, f = 0;
|
|
991
|
+
for (; f < s.length && (c.lastIndex = f, u = c.exec(s), null !== u);) f = c.lastIndex, c === v ? "!--" === u[1] ? c = _ : void 0 !== u[1] ? c = m : void 0 !== u[2] ? (y.test(u[2]) && (n = RegExp("</" + u[2], "g")), c = p) : void 0 !== u[3] && (c = p) : c === p ? ">" === u[0] ? (c = (_n = n) !== null && _n !== void 0 ? _n : v, d = -1) : void 0 === u[1] ? d = -2 : (d = c.lastIndex - u[2].length, a = u[1], c = void 0 === u[3] ? p : "\"" === u[3] ? $ : g) : c === $ || c === g ? c = p : c === _ || c === m ? c = v : (c = p, n = void 0);
|
|
992
|
+
const x = c === p && t[i + 1].startsWith("/>") ? " " : "";
|
|
993
|
+
l += c === v ? s + r$2 : d >= 0 ? (e.push(a), s.slice(0, d) + h + s.slice(d) + o$2 + x) : s + o$2 + (-2 === d ? i : x);
|
|
994
|
+
}
|
|
995
|
+
return [V(t, l + (t[s] || "<?>") + (2 === i ? "</svg>" : 3 === i ? "</math>" : "")), e];
|
|
996
|
+
};
|
|
997
|
+
var S = class S {
|
|
998
|
+
constructor({ strings: t, _$litType$: i }, e) {
|
|
999
|
+
let r;
|
|
1000
|
+
this.parts = [];
|
|
1001
|
+
let l = 0, a = 0;
|
|
1002
|
+
const u = t.length - 1, d = this.parts, [f, v] = N(t, i);
|
|
1003
|
+
if (this.el = S.createElement(f, e), P.currentNode = this.el.content, 2 === i || 3 === i) {
|
|
1004
|
+
const t = this.el.content.firstChild;
|
|
1005
|
+
t.replaceWith(...t.childNodes);
|
|
1006
|
+
}
|
|
1007
|
+
for (; null !== (r = P.nextNode()) && d.length < u;) {
|
|
1008
|
+
if (1 === r.nodeType) {
|
|
1009
|
+
if (r.hasAttributes()) for (const t of r.getAttributeNames()) if (t.endsWith(h)) {
|
|
1010
|
+
const i = v[a++], s = r.getAttribute(t).split(o$2), e = /([.?@])?(.*)/.exec(i);
|
|
1011
|
+
d.push({
|
|
1012
|
+
type: 1,
|
|
1013
|
+
index: l,
|
|
1014
|
+
name: e[2],
|
|
1015
|
+
strings: s,
|
|
1016
|
+
ctor: "." === e[1] ? I : "?" === e[1] ? L : "@" === e[1] ? z : H
|
|
1017
|
+
}), r.removeAttribute(t);
|
|
1018
|
+
} else t.startsWith(o$2) && (d.push({
|
|
1019
|
+
type: 6,
|
|
1020
|
+
index: l
|
|
1021
|
+
}), r.removeAttribute(t));
|
|
1022
|
+
if (y.test(r.tagName)) {
|
|
1023
|
+
const t = r.textContent.split(o$2), i = t.length - 1;
|
|
1024
|
+
if (i > 0) {
|
|
1025
|
+
r.textContent = s$1 ? s$1.emptyScript : "";
|
|
1026
|
+
for (let s = 0; s < i; s++) r.append(t[s], c()), P.nextNode(), d.push({
|
|
1027
|
+
type: 2,
|
|
1028
|
+
index: ++l
|
|
1029
|
+
});
|
|
1030
|
+
r.append(t[i], c());
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
} else if (8 === r.nodeType) if (r.data === n$1) d.push({
|
|
1034
|
+
type: 2,
|
|
1035
|
+
index: l
|
|
1036
|
+
});
|
|
1037
|
+
else {
|
|
1038
|
+
let t = -1;
|
|
1039
|
+
for (; -1 !== (t = r.data.indexOf(o$2, t + 1));) d.push({
|
|
1040
|
+
type: 7,
|
|
1041
|
+
index: l
|
|
1042
|
+
}), t += o$2.length - 1;
|
|
1043
|
+
}
|
|
1044
|
+
l++;
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
static createElement(t, i) {
|
|
1048
|
+
const s = l.createElement("template");
|
|
1049
|
+
return s.innerHTML = t, s;
|
|
1050
|
+
}
|
|
1051
|
+
};
|
|
1052
|
+
function M(t, i, s = t, e) {
|
|
1053
|
+
var _s$_$Co, _h$_$AO, _s$_$Co2;
|
|
1054
|
+
if (i === E) return i;
|
|
1055
|
+
let h = void 0 !== e ? (_s$_$Co = s._$Co) === null || _s$_$Co === void 0 ? void 0 : _s$_$Co[e] : s._$Cl;
|
|
1056
|
+
const o = a(i) ? void 0 : i._$litDirective$;
|
|
1057
|
+
return (h === null || h === void 0 ? void 0 : h.constructor) !== o && (h === null || h === void 0 || (_h$_$AO = h._$AO) === null || _h$_$AO === void 0 || _h$_$AO.call(h, !1), void 0 === o ? h = void 0 : (h = new o(t), h._$AT(t, s, e)), void 0 !== e ? ((_s$_$Co2 = s._$Co) !== null && _s$_$Co2 !== void 0 ? _s$_$Co2 : s._$Co = [])[e] = h : s._$Cl = h), void 0 !== h && (i = M(t, h._$AS(t, i.values), h, e)), i;
|
|
1058
|
+
}
|
|
1059
|
+
var k = class {
|
|
1060
|
+
constructor(t, i) {
|
|
1061
|
+
this._$AV = [], this._$AN = void 0, this._$AD = t, this._$AM = i;
|
|
1062
|
+
}
|
|
1063
|
+
get parentNode() {
|
|
1064
|
+
return this._$AM.parentNode;
|
|
1065
|
+
}
|
|
1066
|
+
get _$AU() {
|
|
1067
|
+
return this._$AM._$AU;
|
|
1068
|
+
}
|
|
1069
|
+
u(t) {
|
|
1070
|
+
var _t$creationScope;
|
|
1071
|
+
const { el: { content: i }, parts: s } = this._$AD, e = ((_t$creationScope = t === null || t === void 0 ? void 0 : t.creationScope) !== null && _t$creationScope !== void 0 ? _t$creationScope : l).importNode(i, !0);
|
|
1072
|
+
P.currentNode = e;
|
|
1073
|
+
let h = P.nextNode(), o = 0, n = 0, r = s[0];
|
|
1074
|
+
for (; void 0 !== r;) {
|
|
1075
|
+
if (o === r.index) {
|
|
1076
|
+
let i;
|
|
1077
|
+
2 === r.type ? i = new R(h, h.nextSibling, this, t) : 1 === r.type ? i = new r.ctor(h, r.name, r.strings, this, t) : 6 === r.type && (i = new W(h, this, t)), this._$AV.push(i), r = s[++n];
|
|
1078
|
+
}
|
|
1079
|
+
o !== (r === null || r === void 0 ? void 0 : r.index) && (h = P.nextNode(), o++);
|
|
1080
|
+
}
|
|
1081
|
+
return P.currentNode = l, e;
|
|
1082
|
+
}
|
|
1083
|
+
p(t) {
|
|
1084
|
+
let i = 0;
|
|
1085
|
+
for (const s of this._$AV) void 0 !== s && (void 0 !== s.strings ? (s._$AI(t, s, i), i += s.strings.length - 2) : s._$AI(t[i])), i++;
|
|
1086
|
+
}
|
|
1087
|
+
};
|
|
1088
|
+
var R = class R {
|
|
1089
|
+
get _$AU() {
|
|
1090
|
+
var _this$_$AM$_$AU, _this$_$AM;
|
|
1091
|
+
return (_this$_$AM$_$AU = (_this$_$AM = this._$AM) === null || _this$_$AM === void 0 ? void 0 : _this$_$AM._$AU) !== null && _this$_$AM$_$AU !== void 0 ? _this$_$AM$_$AU : this._$Cv;
|
|
1092
|
+
}
|
|
1093
|
+
constructor(t, i, s, e) {
|
|
1094
|
+
var _e$isConnected;
|
|
1095
|
+
this.type = 2, this._$AH = A, this._$AN = void 0, this._$AA = t, this._$AB = i, this._$AM = s, this.options = e, this._$Cv = (_e$isConnected = e === null || e === void 0 ? void 0 : e.isConnected) !== null && _e$isConnected !== void 0 ? _e$isConnected : !0;
|
|
1096
|
+
}
|
|
1097
|
+
get parentNode() {
|
|
1098
|
+
let t = this._$AA.parentNode;
|
|
1099
|
+
const i = this._$AM;
|
|
1100
|
+
return void 0 !== i && 11 === (t === null || t === void 0 ? void 0 : t.nodeType) && (t = i.parentNode), t;
|
|
1101
|
+
}
|
|
1102
|
+
get startNode() {
|
|
1103
|
+
return this._$AA;
|
|
1104
|
+
}
|
|
1105
|
+
get endNode() {
|
|
1106
|
+
return this._$AB;
|
|
1107
|
+
}
|
|
1108
|
+
_$AI(t, i = this) {
|
|
1109
|
+
t = M(this, t, i), a(t) ? t === A || null == t || "" === t ? (this._$AH !== A && this._$AR(), this._$AH = A) : t !== this._$AH && t !== E && this._(t) : void 0 !== t._$litType$ ? this.$(t) : void 0 !== t.nodeType ? this.T(t) : d(t) ? this.k(t) : this._(t);
|
|
1110
|
+
}
|
|
1111
|
+
O(t) {
|
|
1112
|
+
return this._$AA.parentNode.insertBefore(t, this._$AB);
|
|
1113
|
+
}
|
|
1114
|
+
T(t) {
|
|
1115
|
+
this._$AH !== t && (this._$AR(), this._$AH = this.O(t));
|
|
1116
|
+
}
|
|
1117
|
+
_(t) {
|
|
1118
|
+
this._$AH !== A && a(this._$AH) ? this._$AA.nextSibling.data = t : this.T(l.createTextNode(t)), this._$AH = t;
|
|
1119
|
+
}
|
|
1120
|
+
$(t) {
|
|
1121
|
+
var _this$_$AH;
|
|
1122
|
+
const { values: i, _$litType$: s } = t, e = "number" == typeof s ? this._$AC(t) : (void 0 === s.el && (s.el = S.createElement(V(s.h, s.h[0]), this.options)), s);
|
|
1123
|
+
if (((_this$_$AH = this._$AH) === null || _this$_$AH === void 0 ? void 0 : _this$_$AH._$AD) === e) this._$AH.p(i);
|
|
1124
|
+
else {
|
|
1125
|
+
const t = new k(e, this), s = t.u(this.options);
|
|
1126
|
+
t.p(i), this.T(s), this._$AH = t;
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
_$AC(t) {
|
|
1130
|
+
let i = C.get(t.strings);
|
|
1131
|
+
return void 0 === i && C.set(t.strings, i = new S(t)), i;
|
|
1132
|
+
}
|
|
1133
|
+
k(t) {
|
|
1134
|
+
u(this._$AH) || (this._$AH = [], this._$AR());
|
|
1135
|
+
const i = this._$AH;
|
|
1136
|
+
let s, e = 0;
|
|
1137
|
+
for (const h of t) e === i.length ? i.push(s = new R(this.O(c()), this.O(c()), this, this.options)) : s = i[e], s._$AI(h), e++;
|
|
1138
|
+
e < i.length && (this._$AR(s && s._$AB.nextSibling, e), i.length = e);
|
|
1139
|
+
}
|
|
1140
|
+
_$AR(t = this._$AA.nextSibling, s) {
|
|
1141
|
+
var _this$_$AP;
|
|
1142
|
+
for ((_this$_$AP = this._$AP) === null || _this$_$AP === void 0 || _this$_$AP.call(this, !1, !0, s); t !== this._$AB;) {
|
|
1143
|
+
const s = i$1(t).nextSibling;
|
|
1144
|
+
i$1(t).remove(), t = s;
|
|
1145
|
+
}
|
|
1146
|
+
}
|
|
1147
|
+
setConnected(t) {
|
|
1148
|
+
var _this$_$AP2;
|
|
1149
|
+
void 0 === this._$AM && (this._$Cv = t, (_this$_$AP2 = this._$AP) === null || _this$_$AP2 === void 0 || _this$_$AP2.call(this, t));
|
|
1150
|
+
}
|
|
1151
|
+
};
|
|
1152
|
+
var H = class {
|
|
1153
|
+
get tagName() {
|
|
1154
|
+
return this.element.tagName;
|
|
1155
|
+
}
|
|
1156
|
+
get _$AU() {
|
|
1157
|
+
return this._$AM._$AU;
|
|
1158
|
+
}
|
|
1159
|
+
constructor(t, i, s, e, h) {
|
|
1160
|
+
this.type = 1, this._$AH = A, this._$AN = void 0, this.element = t, this.name = i, this._$AM = e, this.options = h, s.length > 2 || "" !== s[0] || "" !== s[1] ? (this._$AH = Array(s.length - 1).fill(/* @__PURE__ */ new String()), this.strings = s) : this._$AH = A;
|
|
1161
|
+
}
|
|
1162
|
+
_$AI(t, i = this, s, e) {
|
|
1163
|
+
const h = this.strings;
|
|
1164
|
+
let o = !1;
|
|
1165
|
+
if (void 0 === h) t = M(this, t, i, 0), o = !a(t) || t !== this._$AH && t !== E, o && (this._$AH = t);
|
|
1166
|
+
else {
|
|
1167
|
+
var _r;
|
|
1168
|
+
const e = t;
|
|
1169
|
+
let n, r;
|
|
1170
|
+
for (t = h[0], n = 0; n < h.length - 1; n++) r = M(this, e[s + n], i, n), r === E && (r = this._$AH[n]), o || (o = !a(r) || r !== this._$AH[n]), r === A ? t = A : t !== A && (t += ((_r = r) !== null && _r !== void 0 ? _r : "") + h[n + 1]), this._$AH[n] = r;
|
|
1171
|
+
}
|
|
1172
|
+
o && !e && this.j(t);
|
|
1173
|
+
}
|
|
1174
|
+
j(t) {
|
|
1175
|
+
t === A ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t !== null && t !== void 0 ? t : "");
|
|
1176
|
+
}
|
|
1177
|
+
};
|
|
1178
|
+
var I = class extends H {
|
|
1179
|
+
constructor() {
|
|
1180
|
+
super(...arguments), this.type = 3;
|
|
1181
|
+
}
|
|
1182
|
+
j(t) {
|
|
1183
|
+
this.element[this.name] = t === A ? void 0 : t;
|
|
1184
|
+
}
|
|
1185
|
+
};
|
|
1186
|
+
var L = class extends H {
|
|
1187
|
+
constructor() {
|
|
1188
|
+
super(...arguments), this.type = 4;
|
|
1189
|
+
}
|
|
1190
|
+
j(t) {
|
|
1191
|
+
this.element.toggleAttribute(this.name, !!t && t !== A);
|
|
1192
|
+
}
|
|
1193
|
+
};
|
|
1194
|
+
var z = class extends H {
|
|
1195
|
+
constructor(t, i, s, e, h) {
|
|
1196
|
+
super(t, i, s, e, h), this.type = 5;
|
|
1197
|
+
}
|
|
1198
|
+
_$AI(t, i = this) {
|
|
1199
|
+
var _M;
|
|
1200
|
+
if ((t = (_M = M(this, t, i, 0)) !== null && _M !== void 0 ? _M : A) === E) return;
|
|
1201
|
+
const s = this._$AH, e = t === A && s !== A || t.capture !== s.capture || t.once !== s.once || t.passive !== s.passive, h = t !== A && (s === A || e);
|
|
1202
|
+
e && this.element.removeEventListener(this.name, this, s), h && this.element.addEventListener(this.name, this, t), this._$AH = t;
|
|
1203
|
+
}
|
|
1204
|
+
handleEvent(t) {
|
|
1205
|
+
var _this$options$host, _this$options;
|
|
1206
|
+
"function" == typeof this._$AH ? this._$AH.call((_this$options$host = (_this$options = this.options) === null || _this$options === void 0 ? void 0 : _this$options.host) !== null && _this$options$host !== void 0 ? _this$options$host : this.element, t) : this._$AH.handleEvent(t);
|
|
1207
|
+
}
|
|
1208
|
+
};
|
|
1209
|
+
var W = class {
|
|
1210
|
+
constructor(t, i, s) {
|
|
1211
|
+
this.element = t, this.type = 6, this._$AN = void 0, this._$AM = i, this.options = s;
|
|
1212
|
+
}
|
|
1213
|
+
get _$AU() {
|
|
1214
|
+
return this._$AM._$AU;
|
|
1215
|
+
}
|
|
1216
|
+
_$AI(t) {
|
|
1217
|
+
M(this, t);
|
|
1218
|
+
}
|
|
1219
|
+
};
|
|
1220
|
+
const j = t$1.litHtmlPolyfillSupport;
|
|
1221
|
+
j === null || j === void 0 || j(S, R), ((_t$litHtmlVersions = t$1.litHtmlVersions) !== null && _t$litHtmlVersions !== void 0 ? _t$litHtmlVersions : t$1.litHtmlVersions = []).push("3.3.3");
|
|
1222
|
+
const B = (t, i, s) => {
|
|
1223
|
+
var _s$renderBefore;
|
|
1224
|
+
const e = (_s$renderBefore = s === null || s === void 0 ? void 0 : s.renderBefore) !== null && _s$renderBefore !== void 0 ? _s$renderBefore : i;
|
|
1225
|
+
let h = e._$litPart$;
|
|
1226
|
+
if (void 0 === h) {
|
|
1227
|
+
var _s$renderBefore2;
|
|
1228
|
+
const t = (_s$renderBefore2 = s === null || s === void 0 ? void 0 : s.renderBefore) !== null && _s$renderBefore2 !== void 0 ? _s$renderBefore2 : null;
|
|
1229
|
+
e._$litPart$ = h = new R(i.insertBefore(c(), t), t, void 0, s !== null && s !== void 0 ? s : {});
|
|
1230
|
+
}
|
|
1231
|
+
return h._$AI(t), h;
|
|
1232
|
+
};
|
|
1233
|
+
//#endregion
|
|
1234
|
+
//#region ../../node_modules/.pnpm/lit-element@4.2.2/node_modules/lit-element/lit-element.js
|
|
1235
|
+
var _s$litElementHydrateS, _s$litElementVersions;
|
|
1236
|
+
/**
|
|
1237
|
+
* @license
|
|
1238
|
+
* Copyright 2017 Google LLC
|
|
1239
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1240
|
+
*/ const s = globalThis;
|
|
1241
|
+
var i = class extends g$1 {
|
|
1242
|
+
constructor() {
|
|
1243
|
+
super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
|
|
1244
|
+
}
|
|
1245
|
+
createRenderRoot() {
|
|
1246
|
+
var _this$renderOptions, _this$renderOptions$r;
|
|
1247
|
+
const t = super.createRenderRoot();
|
|
1248
|
+
return (_this$renderOptions$r = (_this$renderOptions = this.renderOptions).renderBefore) !== null && _this$renderOptions$r !== void 0 || (_this$renderOptions.renderBefore = t.firstChild), t;
|
|
1249
|
+
}
|
|
1250
|
+
update(t) {
|
|
1251
|
+
const r = this.render();
|
|
1252
|
+
this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t), this._$Do = B(r, this.renderRoot, this.renderOptions);
|
|
1253
|
+
}
|
|
1254
|
+
connectedCallback() {
|
|
1255
|
+
var _this$_$Do;
|
|
1256
|
+
super.connectedCallback(), (_this$_$Do = this._$Do) === null || _this$_$Do === void 0 || _this$_$Do.setConnected(!0);
|
|
1257
|
+
}
|
|
1258
|
+
disconnectedCallback() {
|
|
1259
|
+
var _this$_$Do2;
|
|
1260
|
+
super.disconnectedCallback(), (_this$_$Do2 = this._$Do) === null || _this$_$Do2 === void 0 || _this$_$Do2.setConnected(!1);
|
|
1261
|
+
}
|
|
1262
|
+
render() {
|
|
1263
|
+
return E;
|
|
1264
|
+
}
|
|
1265
|
+
};
|
|
1266
|
+
i._$litElement$ = !0, i["finalized"] = !0, (_s$litElementHydrateS = s.litElementHydrateSupport) === null || _s$litElementHydrateS === void 0 || _s$litElementHydrateS.call(s, { LitElement: i });
|
|
1267
|
+
const o$1 = s.litElementPolyfillSupport;
|
|
1268
|
+
o$1 === null || o$1 === void 0 || o$1({ LitElement: i });
|
|
1269
|
+
((_s$litElementVersions = s.litElementVersions) !== null && _s$litElementVersions !== void 0 ? _s$litElementVersions : s.litElementVersions = []).push("4.2.2");
|
|
1270
|
+
//#endregion
|
|
1271
|
+
//#region ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/node/decorators/custom-element.js
|
|
1272
|
+
/**
|
|
1273
|
+
* @license
|
|
1274
|
+
* Copyright 2017 Google LLC
|
|
1275
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1276
|
+
*/
|
|
1277
|
+
const t = (t) => (e, o) => {
|
|
1278
|
+
void 0 !== o ? o.addInitializer(() => {
|
|
1279
|
+
customElements.define(t, e);
|
|
1280
|
+
}) : customElements.define(t, e);
|
|
1281
|
+
};
|
|
1282
|
+
//#endregion
|
|
1283
|
+
//#region ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/node/decorators/property.js
|
|
1284
|
+
/**
|
|
1285
|
+
* @license
|
|
1286
|
+
* Copyright 2017 Google LLC
|
|
1287
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1288
|
+
*/ const o = {
|
|
1289
|
+
attribute: !0,
|
|
1290
|
+
type: String,
|
|
1291
|
+
converter: b$1,
|
|
1292
|
+
reflect: !1,
|
|
1293
|
+
hasChanged: m$1
|
|
1294
|
+
}, r$1 = (t = o, e, r) => {
|
|
1295
|
+
const { kind: n, metadata: i } = r;
|
|
1296
|
+
let s = globalThis.litPropertyMetadata.get(i);
|
|
1297
|
+
if (void 0 === s && globalThis.litPropertyMetadata.set(i, s = /* @__PURE__ */ new Map()), "setter" === n && ((t = Object.create(t)).wrapped = !0), s.set(r.name, t), "accessor" === n) {
|
|
1298
|
+
const { name: o } = r;
|
|
1299
|
+
return {
|
|
1300
|
+
set(r) {
|
|
1301
|
+
const n = e.get.call(this);
|
|
1302
|
+
e.set.call(this, r), this.requestUpdate(o, n, t, !0, r);
|
|
1303
|
+
},
|
|
1304
|
+
init(e) {
|
|
1305
|
+
return void 0 !== e && this.C(o, void 0, t, e), e;
|
|
1306
|
+
}
|
|
1307
|
+
};
|
|
1308
|
+
}
|
|
1309
|
+
if ("setter" === n) {
|
|
1310
|
+
const { name: o } = r;
|
|
1311
|
+
return function(r) {
|
|
1312
|
+
const n = this[o];
|
|
1313
|
+
e.call(this, r), this.requestUpdate(o, n, t, !0, r);
|
|
1314
|
+
};
|
|
1315
|
+
}
|
|
1316
|
+
throw Error("Unsupported decorator location: " + n);
|
|
1317
|
+
};
|
|
1318
|
+
function n(t) {
|
|
1319
|
+
return (e, o) => "object" == typeof o ? r$1(t, e, o) : ((t, e, o) => {
|
|
1320
|
+
const r = e.hasOwnProperty(o);
|
|
1321
|
+
return e.constructor.createProperty(o, t), r ? Object.getOwnPropertyDescriptor(e, o) : void 0;
|
|
1322
|
+
})(t, e, o);
|
|
1323
|
+
}
|
|
1324
|
+
//#endregion
|
|
1325
|
+
//#region ../../node_modules/.pnpm/@lit+reactive-element@2.1.2/node_modules/@lit/reactive-element/node/decorators/state.js
|
|
1326
|
+
/**
|
|
1327
|
+
* @license
|
|
1328
|
+
* Copyright 2017 Google LLC
|
|
1329
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
1330
|
+
*/ function r(r) {
|
|
1331
|
+
return n({
|
|
1332
|
+
...r,
|
|
1333
|
+
state: !0,
|
|
1334
|
+
attribute: !1
|
|
1335
|
+
});
|
|
1336
|
+
}
|
|
1337
|
+
//#endregion
|
|
1338
|
+
//#region \0@oxc-project+runtime@0.134.0/helpers/esm/decorate.js
|
|
1339
|
+
function __decorate(decorators, target, key, desc) {
|
|
1340
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
1341
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
1342
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
1343
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
1344
|
+
}
|
|
1345
|
+
//#endregion
|
|
1346
|
+
//#region src/element.ts
|
|
1347
|
+
let EgPlayer = class EgPlayer extends i {
|
|
1348
|
+
constructor(..._args) {
|
|
1349
|
+
super(..._args);
|
|
1350
|
+
this.scenes = [];
|
|
1351
|
+
this.currentSceneId = null;
|
|
1352
|
+
this.currentTime = 0;
|
|
1353
|
+
this.sceneDuration = 0;
|
|
1354
|
+
this._visible = [];
|
|
1355
|
+
this._answers = /* @__PURE__ */ new Map();
|
|
1356
|
+
this._completed = /* @__PURE__ */ new Set();
|
|
1357
|
+
this._prevVisibleIds = /* @__PURE__ */ new Set();
|
|
1358
|
+
this._autoAdvancedSceneId = null;
|
|
1359
|
+
this._prevSeekable = null;
|
|
1360
|
+
}
|
|
1361
|
+
willUpdate() {
|
|
1362
|
+
var _scene$interactions, _scene$interactions2;
|
|
1363
|
+
const scene = this.scenes.find((s) => s.id === this.currentSceneId);
|
|
1364
|
+
const visible = getVisibleInteractions(scene, this.currentTime);
|
|
1365
|
+
const visibleIds = new Set(visible.map((i) => i.id));
|
|
1366
|
+
for (const i of visible) if ((i.waitForClick || i.required) && !this._prevVisibleIds.has(i.id)) this.dispatchEvent(new CustomEvent("intent", {
|
|
1367
|
+
detail: { type: "pause" },
|
|
1368
|
+
bubbles: true,
|
|
1369
|
+
composed: true
|
|
1370
|
+
}));
|
|
1371
|
+
this._prevVisibleIds = visibleIds;
|
|
1372
|
+
this._visible = visible;
|
|
1373
|
+
const seekable = !(scene === null || scene === void 0 || (_scene$interactions = scene.interactions) === null || _scene$interactions === void 0 ? void 0 : _scene$interactions.some((i) => "waitForClick" in i && i.waitForClick));
|
|
1374
|
+
if (this._prevSeekable !== seekable) {
|
|
1375
|
+
this._prevSeekable = seekable;
|
|
1376
|
+
this.dispatchEvent(new CustomEvent("seekabilitychange", {
|
|
1377
|
+
detail: { seekable },
|
|
1378
|
+
bubbles: true,
|
|
1379
|
+
composed: true
|
|
1380
|
+
}));
|
|
1381
|
+
}
|
|
1382
|
+
const hasWaitForClickInteraction = scene === null || scene === void 0 || (_scene$interactions2 = scene.interactions) === null || _scene$interactions2 === void 0 ? void 0 : _scene$interactions2.some((i) => "waitForClick" in i && i.waitForClick);
|
|
1383
|
+
const hasBlockingVisible = visible.some((i) => (i.waitForClick || i.required) && !this._completed.has(i.id));
|
|
1384
|
+
if (this.sceneDuration > 0 && this.currentTime >= this.sceneDuration && !hasWaitForClickInteraction && !hasBlockingVisible && this.currentSceneId && this._autoAdvancedSceneId !== this.currentSceneId) {
|
|
1385
|
+
this._autoAdvancedSceneId = this.currentSceneId;
|
|
1386
|
+
const currentScene = this.scenes.find((s) => s.id === this.currentSceneId);
|
|
1387
|
+
const nextScene = currentScene ? this.scenes.filter((s) => s.order > currentScene.order).sort((a, b) => a.order - b.order)[0] : void 0;
|
|
1388
|
+
const intent = nextScene ? {
|
|
1389
|
+
type: "navigate",
|
|
1390
|
+
sceneId: nextScene.id
|
|
1391
|
+
} : {
|
|
1392
|
+
type: "navigate",
|
|
1393
|
+
sceneId: null
|
|
1394
|
+
};
|
|
1395
|
+
this.dispatchEvent(new CustomEvent("intent", {
|
|
1396
|
+
detail: intent,
|
|
1397
|
+
bubbles: true,
|
|
1398
|
+
composed: true
|
|
1399
|
+
}));
|
|
1400
|
+
}
|
|
1401
|
+
if (this.currentSceneId !== this._autoAdvancedSceneId) this._autoAdvancedSceneId = null;
|
|
1402
|
+
}
|
|
1403
|
+
render() {
|
|
1404
|
+
return T`
|
|
1405
|
+
<div class="overlay-root">
|
|
1406
|
+
${this._visible.map((i) => i.type === "button" ? this.renderButton(i) : this.renderQuiz(i))}
|
|
1407
|
+
</div>
|
|
1408
|
+
`;
|
|
1409
|
+
}
|
|
1410
|
+
renderButton(i) {
|
|
1411
|
+
return T`<button class="btn" style=${`
|
|
1412
|
+
left: ${i.position.x}%;
|
|
1413
|
+
top: ${i.position.y}%;
|
|
1414
|
+
width: ${i.position.w}%;
|
|
1415
|
+
height: ${i.position.h}%;
|
|
1416
|
+
--btn-bg: ${i.style.btnBg};
|
|
1417
|
+
color: ${i.style.textBg};
|
|
1418
|
+
`} @click=${() => this.emitIntentForAction(i)}>
|
|
1419
|
+
<span class="btn__bg"></span>
|
|
1420
|
+
<span class="btn__label">${i.label}</span>
|
|
1421
|
+
</button>`;
|
|
1422
|
+
}
|
|
1423
|
+
renderQuiz(i) {
|
|
1424
|
+
var _i$options$find$corre, _i$options$find;
|
|
1425
|
+
const style = `
|
|
1426
|
+
left: ${i.position.x}%;
|
|
1427
|
+
top: ${i.position.y}%;
|
|
1428
|
+
width: ${i.position.w}%;
|
|
1429
|
+
`;
|
|
1430
|
+
const answeredId = this._answers.get(i.id);
|
|
1431
|
+
const answered = answeredId != null;
|
|
1432
|
+
const gotItRight = answered && ((_i$options$find$corre = (_i$options$find = i.options.find((o) => o.id === answeredId)) === null || _i$options$find === void 0 ? void 0 : _i$options$find.correct) !== null && _i$options$find$corre !== void 0 ? _i$options$find$corre : false);
|
|
1433
|
+
return T`
|
|
1434
|
+
<div class="quiz" style=${style} role="group" aria-label=${i.question}>
|
|
1435
|
+
<p class="quiz__question">${i.question}</p>
|
|
1436
|
+
<div class="quiz__options">
|
|
1437
|
+
${i.options.map((o) => {
|
|
1438
|
+
const chosen = o.id === answeredId;
|
|
1439
|
+
const reveal = answered && o.correct;
|
|
1440
|
+
return T`<button class=${[
|
|
1441
|
+
"quiz__option",
|
|
1442
|
+
reveal ? "is-correct" : "",
|
|
1443
|
+
answered && chosen && !o.correct ? "is-wrong" : "",
|
|
1444
|
+
answered && !chosen && !o.correct ? "is-muted" : ""
|
|
1445
|
+
].filter(Boolean).join(" ")} ?disabled=${answered} @click=${() => this.answer(i.id, o.id)}>
|
|
1446
|
+
<span class="quiz__mark">${reveal ? "✓" : chosen ? "✗" : ""}</span>
|
|
1447
|
+
<span>${o.label}</span>
|
|
1448
|
+
</button>`;
|
|
1449
|
+
})}
|
|
1450
|
+
</div>
|
|
1451
|
+
${answered ? T`
|
|
1452
|
+
<p class="quiz__feedback ${gotItRight ? "is-correct" : "is-wrong"}">
|
|
1453
|
+
${gotItRight ? "Correct!" : "Not quite."}
|
|
1454
|
+
</p>
|
|
1455
|
+
<button class="quiz__continue" @click=${() => this.emitIntentForAction(i)}>Continue</button>
|
|
1456
|
+
` : null}
|
|
1457
|
+
</div>
|
|
1458
|
+
`;
|
|
1459
|
+
}
|
|
1460
|
+
answer(interactionId, optionId) {
|
|
1461
|
+
if (this._answers.has(interactionId)) return;
|
|
1462
|
+
const next = new Map(this._answers);
|
|
1463
|
+
next.set(interactionId, optionId);
|
|
1464
|
+
this._answers = next;
|
|
1465
|
+
}
|
|
1466
|
+
emitIntentForAction(i) {
|
|
1467
|
+
if (!this.currentSceneId) return;
|
|
1468
|
+
if ((i.required || i.waitForClick) && !this._completed.has(i.id)) {
|
|
1469
|
+
const next = new Set(this._completed);
|
|
1470
|
+
next.add(i.id);
|
|
1471
|
+
this._completed = next;
|
|
1472
|
+
this.dispatchEvent(new CustomEvent("satisfied", {
|
|
1473
|
+
detail: { id: i.id },
|
|
1474
|
+
bubbles: true,
|
|
1475
|
+
composed: true
|
|
1476
|
+
}));
|
|
1477
|
+
}
|
|
1478
|
+
const intent = resolveAction(this.scenes, this.currentSceneId, i.action);
|
|
1479
|
+
this.dispatchEvent(new CustomEvent("intent", {
|
|
1480
|
+
detail: intent,
|
|
1481
|
+
bubbles: true,
|
|
1482
|
+
composed: true
|
|
1483
|
+
}));
|
|
1484
|
+
}
|
|
1485
|
+
};
|
|
1486
|
+
EgPlayer.styles = i$2`
|
|
1487
|
+
:host {
|
|
1488
|
+
position: absolute;
|
|
1489
|
+
inset: 0;
|
|
1490
|
+
pointer-events: none;
|
|
1491
|
+
display: block;
|
|
1492
|
+
font-family: inherit;
|
|
1493
|
+
}
|
|
1494
|
+
/* Container-query context: all sizes below are % of the canvas width (cqw),
|
|
1495
|
+
so elements look identical at every host size. 1cqw = 1% of canvas width. */
|
|
1496
|
+
.overlay-root {
|
|
1497
|
+
position: absolute;
|
|
1498
|
+
inset: 0;
|
|
1499
|
+
container-type: inline-size;
|
|
1500
|
+
}
|
|
1501
|
+
button {
|
|
1502
|
+
font: inherit;
|
|
1503
|
+
cursor: pointer;
|
|
1504
|
+
border: 0;
|
|
1505
|
+
}
|
|
1506
|
+
/* Button styling scales with the button's own size (container-type: size),
|
|
1507
|
+
matching the PIXI render on the editor canvas:
|
|
1508
|
+
radius = 12% of height, font-size = max(12px, 40% of height). */
|
|
1509
|
+
.btn {
|
|
1510
|
+
position: absolute;
|
|
1511
|
+
pointer-events: auto;
|
|
1512
|
+
container-type: size;
|
|
1513
|
+
border: 0;
|
|
1514
|
+
padding: 0;
|
|
1515
|
+
background: transparent;
|
|
1516
|
+
display: grid;
|
|
1517
|
+
place-items: center;
|
|
1518
|
+
font: inherit;
|
|
1519
|
+
}
|
|
1520
|
+
.btn__bg {
|
|
1521
|
+
position: absolute;
|
|
1522
|
+
inset: 0;
|
|
1523
|
+
background: var(--btn-bg);
|
|
1524
|
+
border-radius: 12cqh;
|
|
1525
|
+
pointer-events: none;
|
|
1526
|
+
overflow: hidden;
|
|
1527
|
+
}
|
|
1528
|
+
/* Shimmer cue: a diagonal band sweeps across the button to signal "click me".
|
|
1529
|
+
Mode 1 (current): always while the button is visible. To switch to mode 2
|
|
1530
|
+
(only while playback is waiting on this interaction), gate this rule on a
|
|
1531
|
+
runtime-applied class, e.g. .btn.is-waiting .btn__bg::after. */
|
|
1532
|
+
.btn__bg::after {
|
|
1533
|
+
content: '';
|
|
1534
|
+
position: absolute;
|
|
1535
|
+
inset: 0;
|
|
1536
|
+
background: linear-gradient(
|
|
1537
|
+
115deg,
|
|
1538
|
+
transparent 35%,
|
|
1539
|
+
rgba(255, 255, 255, 0.45) 50%,
|
|
1540
|
+
transparent 65%
|
|
1541
|
+
);
|
|
1542
|
+
background-size: 200% 100%;
|
|
1543
|
+
animation: btn-shimmer 2.4s linear infinite;
|
|
1544
|
+
pointer-events: none;
|
|
1545
|
+
}
|
|
1546
|
+
/* Seamless loop: movement (200%) equals the gradient period
|
|
1547
|
+
(background-size: 200%), so the visible state at 0% and 100% is identical
|
|
1548
|
+
and the wrap is invisible. */
|
|
1549
|
+
@keyframes btn-shimmer {
|
|
1550
|
+
0% { background-position: 100% 0; }
|
|
1551
|
+
100% { background-position: -100% 0; }
|
|
1552
|
+
}
|
|
1553
|
+
.btn__label {
|
|
1554
|
+
position: relative;
|
|
1555
|
+
font-size: max(12px, 40cqh);
|
|
1556
|
+
font-weight: 600;
|
|
1557
|
+
line-height: 1;
|
|
1558
|
+
white-space: nowrap;
|
|
1559
|
+
overflow: hidden;
|
|
1560
|
+
text-overflow: ellipsis;
|
|
1561
|
+
max-width: 96%;
|
|
1562
|
+
padding: 0 4cqh;
|
|
1563
|
+
box-sizing: border-box;
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
/* Quiz card */
|
|
1567
|
+
.quiz {
|
|
1568
|
+
position: absolute;
|
|
1569
|
+
pointer-events: auto;
|
|
1570
|
+
box-sizing: border-box;
|
|
1571
|
+
display: flex;
|
|
1572
|
+
flex-direction: column;
|
|
1573
|
+
gap: 0.9cqw;
|
|
1574
|
+
padding: 1.4cqw;
|
|
1575
|
+
border-radius: 0.9cqw;
|
|
1576
|
+
background: rgba(17, 24, 39, 0.92);
|
|
1577
|
+
color: #fff;
|
|
1578
|
+
box-shadow: 0 0.5cqw 1.5cqw rgba(0, 0, 0, 0.35);
|
|
1579
|
+
backdrop-filter: blur(2px);
|
|
1580
|
+
}
|
|
1581
|
+
.quiz__question {
|
|
1582
|
+
margin: 0;
|
|
1583
|
+
font-size: 1.5cqw;
|
|
1584
|
+
font-weight: 700;
|
|
1585
|
+
line-height: 1.3;
|
|
1586
|
+
}
|
|
1587
|
+
.quiz__options {
|
|
1588
|
+
display: flex;
|
|
1589
|
+
flex-direction: column;
|
|
1590
|
+
gap: 0.6cqw;
|
|
1591
|
+
}
|
|
1592
|
+
.quiz__option {
|
|
1593
|
+
display: flex;
|
|
1594
|
+
align-items: center;
|
|
1595
|
+
gap: 0.7cqw;
|
|
1596
|
+
width: 100%;
|
|
1597
|
+
text-align: left;
|
|
1598
|
+
padding: 0.8cqw 1cqw;
|
|
1599
|
+
border-radius: 0.6cqw;
|
|
1600
|
+
background: #fff;
|
|
1601
|
+
color: #111827;
|
|
1602
|
+
border: 0.15cqw solid transparent;
|
|
1603
|
+
font-size: 1.3cqw;
|
|
1604
|
+
transition: background 0.15s, border-color 0.15s, opacity 0.15s;
|
|
1605
|
+
}
|
|
1606
|
+
.quiz__option:hover:not(:disabled) {
|
|
1607
|
+
background: #eef2ff;
|
|
1608
|
+
}
|
|
1609
|
+
.quiz__option:disabled {
|
|
1610
|
+
cursor: default;
|
|
1611
|
+
}
|
|
1612
|
+
.quiz__option.is-correct {
|
|
1613
|
+
background: #ecfdf5;
|
|
1614
|
+
border-color: #10b981;
|
|
1615
|
+
color: #065f46;
|
|
1616
|
+
}
|
|
1617
|
+
.quiz__option.is-wrong {
|
|
1618
|
+
background: #fef2f2;
|
|
1619
|
+
border-color: #ef4444;
|
|
1620
|
+
color: #991b1b;
|
|
1621
|
+
}
|
|
1622
|
+
.quiz__option.is-muted {
|
|
1623
|
+
opacity: 0.55;
|
|
1624
|
+
}
|
|
1625
|
+
.quiz__mark {
|
|
1626
|
+
flex: 0 0 auto;
|
|
1627
|
+
width: 1.4cqw;
|
|
1628
|
+
height: 1.4cqw;
|
|
1629
|
+
display: inline-flex;
|
|
1630
|
+
align-items: center;
|
|
1631
|
+
justify-content: center;
|
|
1632
|
+
font-size: 1.1cqw;
|
|
1633
|
+
font-weight: 700;
|
|
1634
|
+
}
|
|
1635
|
+
.quiz__feedback {
|
|
1636
|
+
margin: 0;
|
|
1637
|
+
font-size: 1.2cqw;
|
|
1638
|
+
font-weight: 600;
|
|
1639
|
+
}
|
|
1640
|
+
.quiz__feedback.is-correct {
|
|
1641
|
+
color: #6ee7b7;
|
|
1642
|
+
}
|
|
1643
|
+
.quiz__feedback.is-wrong {
|
|
1644
|
+
color: #fca5a5;
|
|
1645
|
+
}
|
|
1646
|
+
.quiz__continue {
|
|
1647
|
+
align-self: flex-end;
|
|
1648
|
+
padding: 0.7cqw 1.4cqw;
|
|
1649
|
+
border-radius: 0.6cqw;
|
|
1650
|
+
background: #65c86d;
|
|
1651
|
+
color: #fff;
|
|
1652
|
+
font-weight: 600;
|
|
1653
|
+
font-size: 1.3cqw;
|
|
1654
|
+
}
|
|
1655
|
+
.quiz__continue:hover {
|
|
1656
|
+
background: #4fb358;
|
|
1657
|
+
}
|
|
1658
|
+
`;
|
|
1659
|
+
__decorate([n({ attribute: false })], EgPlayer.prototype, "scenes", void 0);
|
|
1660
|
+
__decorate([n({ attribute: false })], EgPlayer.prototype, "currentSceneId", void 0);
|
|
1661
|
+
__decorate([n({ type: Number })], EgPlayer.prototype, "currentTime", void 0);
|
|
1662
|
+
__decorate([n({ type: Number })], EgPlayer.prototype, "sceneDuration", void 0);
|
|
1663
|
+
__decorate([r()], EgPlayer.prototype, "_visible", void 0);
|
|
1664
|
+
__decorate([r()], EgPlayer.prototype, "_answers", void 0);
|
|
1665
|
+
__decorate([r()], EgPlayer.prototype, "_completed", void 0);
|
|
1666
|
+
EgPlayer = __decorate([t("eg-player")], EgPlayer);
|
|
1667
|
+
//#endregion
|
|
1668
|
+
export { EgPlayer };
|
|
1669
|
+
|
|
1670
|
+
//# sourceMappingURL=index.mjs.map
|