@citolab/qti-components 7.14.3 → 7.15.1

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.
Files changed (145) hide show
  1. package/cdn/index.global.js +1 -1
  2. package/cdn/index.js +4044 -4030
  3. package/custom-elements.json +10478 -26460
  4. package/dist/base.d.ts +8 -0
  5. package/dist/base.js +50 -0
  6. package/dist/{chunks/chunk-DGBI4IU5.js → chunk-2DOYPVF5.js} +252 -136
  7. package/dist/chunk-2DOYPVF5.js.map +1 -0
  8. package/dist/chunk-2ZEJ3RR5.js +89 -0
  9. package/dist/chunk-2ZEJ3RR5.js.map +1 -0
  10. package/dist/{chunks/chunk-E4GR4K26.js → chunk-352OTVTY.js} +1481 -442
  11. package/dist/chunk-352OTVTY.js.map +1 -0
  12. package/dist/{chunks/chunk-C4ELTNV7.js → chunk-C2HQFI2C.js} +857 -3819
  13. package/dist/chunk-C2HQFI2C.js.map +1 -0
  14. package/dist/chunk-DWIRLYDS.js +20 -0
  15. package/dist/chunk-DWIRLYDS.js.map +1 -0
  16. package/dist/{chunks/chunk-H2JE6IVU.js → chunk-EUXUH3YW.js} +1 -1
  17. package/dist/chunk-F44CI35W.js +145 -0
  18. package/dist/chunk-F44CI35W.js.map +1 -0
  19. package/dist/{chunks/chunk-XBPO6E25.js → chunk-INKI27D5.js} +6 -5
  20. package/dist/chunk-INKI27D5.js.map +1 -0
  21. package/dist/chunk-JEUY3MYB.js +2010 -0
  22. package/dist/chunk-JEUY3MYB.js.map +1 -0
  23. package/dist/chunk-O4XIWHTF.js +1139 -0
  24. package/dist/chunk-O4XIWHTF.js.map +1 -0
  25. package/dist/chunk-RI47B4ZT.js +1753 -0
  26. package/dist/chunk-RI47B4ZT.js.map +1 -0
  27. package/dist/{qti-loader/index.js → chunk-VEV4DGPH.js} +6 -6
  28. package/dist/chunk-VEV4DGPH.js.map +1 -0
  29. package/dist/{chunks/chunk-TN75CWLX.js → chunk-W4SQRNWO.js} +97 -2
  30. package/dist/chunk-W4SQRNWO.js.map +1 -0
  31. package/dist/elements.d.ts +1 -0
  32. package/dist/elements.js +42 -0
  33. package/dist/index.d.ts +8 -24
  34. package/dist/index.js +117 -285
  35. package/dist/index.js.map +1 -1
  36. package/dist/interactions.d.ts +1 -0
  37. package/dist/interactions.js +72 -0
  38. package/dist/item.d.ts +1 -0
  39. package/dist/item.js +23 -0
  40. package/dist/loader.d.ts +1 -0
  41. package/dist/loader.js +11 -0
  42. package/dist/processing.d.ts +1 -0
  43. package/dist/processing.js +103 -0
  44. package/dist/qti-components-jsx.d.ts +1475 -2388
  45. package/dist/test.d.ts +1 -0
  46. package/dist/{qti-test/index.js → test.js} +11 -19
  47. package/dist/transformers.d.ts +1 -0
  48. package/dist/{qti-transformers/index.js → transformers.js} +3 -3
  49. package/dist/vscode.html-custom-data.json +469 -631
  50. package/package.json +67 -164
  51. package/dist/chunks/chunk-4OGJBG35.js +0 -8
  52. package/dist/chunks/chunk-4OGJBG35.js.map +0 -1
  53. package/dist/chunks/chunk-AGV5GOTF.js +0 -234
  54. package/dist/chunks/chunk-AGV5GOTF.js.map +0 -1
  55. package/dist/chunks/chunk-BHJSX3Q6.js +0 -8
  56. package/dist/chunks/chunk-BHJSX3Q6.js.map +0 -1
  57. package/dist/chunks/chunk-C4ELTNV7.js.map +0 -1
  58. package/dist/chunks/chunk-C5RLRG3L.js +0 -10
  59. package/dist/chunks/chunk-C5RLRG3L.js.map +0 -1
  60. package/dist/chunks/chunk-CJADUWEC.js +0 -10
  61. package/dist/chunks/chunk-CJADUWEC.js.map +0 -1
  62. package/dist/chunks/chunk-DGBI4IU5.js.map +0 -1
  63. package/dist/chunks/chunk-DVQQ7I6Y.js +0 -8
  64. package/dist/chunks/chunk-DVQQ7I6Y.js.map +0 -1
  65. package/dist/chunks/chunk-E4GR4K26.js.map +0 -1
  66. package/dist/chunks/chunk-ELDMXTUQ.js +0 -31
  67. package/dist/chunks/chunk-ELDMXTUQ.js.map +0 -1
  68. package/dist/chunks/chunk-GAAFN7QF.js +0 -146
  69. package/dist/chunks/chunk-GAAFN7QF.js.map +0 -1
  70. package/dist/chunks/chunk-H6KHXSIO.js +0 -8
  71. package/dist/chunks/chunk-H6KHXSIO.js.map +0 -1
  72. package/dist/chunks/chunk-JQ6HWGRY.js +0 -22
  73. package/dist/chunks/chunk-JQ6HWGRY.js.map +0 -1
  74. package/dist/chunks/chunk-NJNQOQUU.js +0 -8
  75. package/dist/chunks/chunk-NJNQOQUU.js.map +0 -1
  76. package/dist/chunks/chunk-P4QBOVQ2.js +0 -206
  77. package/dist/chunks/chunk-P4QBOVQ2.js.map +0 -1
  78. package/dist/chunks/chunk-SV4K25ZI.js +0 -19
  79. package/dist/chunks/chunk-SV4K25ZI.js.map +0 -1
  80. package/dist/chunks/chunk-TN75CWLX.js.map +0 -1
  81. package/dist/chunks/chunk-XBPO6E25.js.map +0 -1
  82. package/dist/exports/computed-item.context.d.ts +0 -23
  83. package/dist/exports/computed-item.context.js +0 -8
  84. package/dist/exports/computed.context.d.ts +0 -34
  85. package/dist/exports/computed.context.js +0 -8
  86. package/dist/exports/config.context.d.ts +0 -14
  87. package/dist/exports/config.context.js +0 -8
  88. package/dist/exports/expression-result.d.ts +0 -19
  89. package/dist/exports/expression-result.js +0 -1
  90. package/dist/exports/interaction.d.ts +0 -46
  91. package/dist/exports/interaction.interface.d.ts +0 -13
  92. package/dist/exports/interaction.interface.js +0 -1
  93. package/dist/exports/interaction.js +0 -12
  94. package/dist/exports/item.context.d.ts +0 -11
  95. package/dist/exports/item.context.js +0 -8
  96. package/dist/exports/qti-assessment-item.context.d.ts +0 -9
  97. package/dist/exports/qti-assessment-item.context.js +0 -8
  98. package/dist/exports/qti-condition-expression.d.ts +0 -14
  99. package/dist/exports/qti-condition-expression.js +0 -11
  100. package/dist/exports/qti-condition-expression.js.map +0 -1
  101. package/dist/exports/qti-expression.d.ts +0 -23
  102. package/dist/exports/qti-expression.js +0 -10
  103. package/dist/exports/qti-expression.js.map +0 -1
  104. package/dist/exports/qti-test.d.ts +0 -12
  105. package/dist/exports/qti-test.js +0 -1
  106. package/dist/exports/qti-test.js.map +0 -1
  107. package/dist/exports/qti.context.d.ts +0 -14
  108. package/dist/exports/qti.context.js +0 -8
  109. package/dist/exports/qti.context.js.map +0 -1
  110. package/dist/exports/session.context.d.ts +0 -15
  111. package/dist/exports/session.context.js +0 -10
  112. package/dist/exports/session.context.js.map +0 -1
  113. package/dist/exports/test.context.d.ts +0 -16
  114. package/dist/exports/test.context.js +0 -10
  115. package/dist/exports/test.context.js.map +0 -1
  116. package/dist/exports/variables.d.ts +0 -2
  117. package/dist/exports/variables.js +0 -1
  118. package/dist/exports/variables.js.map +0 -1
  119. package/dist/qti-assessment-item-l-mN3teH.d.ts +0 -105
  120. package/dist/qti-components/index.d.ts +0 -1524
  121. package/dist/qti-components/index.js +0 -216
  122. package/dist/qti-components/index.js.map +0 -1
  123. package/dist/qti-item/index.d.ts +0 -114
  124. package/dist/qti-item/index.js +0 -19
  125. package/dist/qti-item/index.js.map +0 -1
  126. package/dist/qti-loader/index.d.ts +0 -21
  127. package/dist/qti-loader/index.js.map +0 -1
  128. package/dist/qti-modal-feedback-Cp3CHVKw.d.ts +0 -30
  129. package/dist/qti-test/index.d.ts +0 -480
  130. package/dist/qti-test/index.js.map +0 -1
  131. package/dist/qti-test-mmY8zNIj.d.ts +0 -120
  132. package/dist/qti-transform-test-Bz9A3hmD.d.ts +0 -63
  133. package/dist/qti-transformers/index.d.ts +0 -18
  134. package/dist/qti-transformers/index.js.map +0 -1
  135. package/dist/variables-BCkyLoXK.d.ts +0 -55
  136. package/readme.md +0 -59
  137. /package/dist/{chunks/chunk-H2JE6IVU.js.map → base.js.map} +0 -0
  138. /package/dist/{exports/computed-item.context.js.map → chunk-EUXUH3YW.js.map} +0 -0
  139. /package/dist/{exports/computed.context.js.map → elements.js.map} +0 -0
  140. /package/dist/{exports/config.context.js.map → interactions.js.map} +0 -0
  141. /package/dist/{exports/expression-result.js.map → item.js.map} +0 -0
  142. /package/dist/{exports/interaction.interface.js.map → loader.js.map} +0 -0
  143. /package/dist/{exports/interaction.js.map → processing.js.map} +0 -0
  144. /package/dist/{exports/item.context.js.map → test.js.map} +0 -0
  145. /package/dist/{exports/qti-assessment-item.context.js.map → transformers.js.map} +0 -0
@@ -0,0 +1,2010 @@
1
+ import {
2
+ __decorateClass
3
+ } from "./chunk-EUXUH3YW.js";
4
+
5
+ // ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/context-request-event.js
6
+ var s = class extends Event {
7
+ constructor(s7, t5, e7, o7) {
8
+ super("context-request", { bubbles: true, composed: true }), this.context = s7, this.contextTarget = t5, this.callback = e7, this.subscribe = o7 ?? false;
9
+ }
10
+ };
11
+
12
+ // ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/create-context.js
13
+ function n(n6) {
14
+ return n6;
15
+ }
16
+
17
+ // ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/controllers/context-consumer.js
18
+ var s2 = class {
19
+ constructor(t5, s7, i5, h3) {
20
+ if (this.subscribe = false, this.provided = false, this.value = void 0, this.t = (t6, s8) => {
21
+ this.unsubscribe && (this.unsubscribe !== s8 && (this.provided = false, this.unsubscribe()), this.subscribe || this.unsubscribe()), this.value = t6, this.host.requestUpdate(), this.provided && !this.subscribe || (this.provided = true, this.callback && this.callback(t6, s8)), this.unsubscribe = s8;
22
+ }, this.host = t5, void 0 !== s7.context) {
23
+ const t6 = s7;
24
+ this.context = t6.context, this.callback = t6.callback, this.subscribe = t6.subscribe ?? false;
25
+ } else this.context = s7, this.callback = i5, this.subscribe = h3 ?? false;
26
+ this.host.addController(this);
27
+ }
28
+ hostConnected() {
29
+ this.dispatchRequest();
30
+ }
31
+ hostDisconnected() {
32
+ this.unsubscribe && (this.unsubscribe(), this.unsubscribe = void 0);
33
+ }
34
+ dispatchRequest() {
35
+ this.host.dispatchEvent(new s(this.context, this.host, this.t, this.subscribe));
36
+ }
37
+ };
38
+
39
+ // ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/value-notifier.js
40
+ var s3 = class {
41
+ get value() {
42
+ return this.o;
43
+ }
44
+ set value(s7) {
45
+ this.setValue(s7);
46
+ }
47
+ setValue(s7, t5 = false) {
48
+ const i5 = t5 || !Object.is(s7, this.o);
49
+ this.o = s7, i5 && this.updateObservers();
50
+ }
51
+ constructor(s7) {
52
+ this.subscriptions = /* @__PURE__ */ new Map(), this.updateObservers = () => {
53
+ for (const [s8, { disposer: t5 }] of this.subscriptions) s8(this.o, t5);
54
+ }, void 0 !== s7 && (this.value = s7);
55
+ }
56
+ addCallback(s7, t5, i5) {
57
+ if (!i5) return void s7(this.value);
58
+ this.subscriptions.has(s7) || this.subscriptions.set(s7, { disposer: () => {
59
+ this.subscriptions.delete(s7);
60
+ }, consumerHost: t5 });
61
+ const { disposer: h3 } = this.subscriptions.get(s7);
62
+ s7(this.value, h3);
63
+ }
64
+ clearCallbacks() {
65
+ this.subscriptions.clear();
66
+ }
67
+ };
68
+
69
+ // ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/controllers/context-provider.js
70
+ var e = class extends Event {
71
+ constructor(t5, s7) {
72
+ super("context-provider", { bubbles: true, composed: true }), this.context = t5, this.contextTarget = s7;
73
+ }
74
+ };
75
+ var i = class extends s3 {
76
+ constructor(s7, e7, i5) {
77
+ super(void 0 !== e7.context ? e7.initialValue : i5), this.onContextRequest = (t5) => {
78
+ if (t5.context !== this.context) return;
79
+ const s8 = t5.contextTarget ?? t5.composedPath()[0];
80
+ s8 !== this.host && (t5.stopPropagation(), this.addCallback(t5.callback, s8, t5.subscribe));
81
+ }, this.onProviderRequest = (s8) => {
82
+ if (s8.context !== this.context) return;
83
+ if ((s8.contextTarget ?? s8.composedPath()[0]) === this.host) return;
84
+ const e8 = /* @__PURE__ */ new Set();
85
+ for (const [s9, { consumerHost: i6 }] of this.subscriptions) e8.has(s9) || (e8.add(s9), i6.dispatchEvent(new s(this.context, i6, s9, true)));
86
+ s8.stopPropagation();
87
+ }, this.host = s7, void 0 !== e7.context ? this.context = e7.context : this.context = e7, this.attachListeners(), this.host.addController?.(this);
88
+ }
89
+ attachListeners() {
90
+ this.host.addEventListener("context-request", this.onContextRequest), this.host.addEventListener("context-provider", this.onProviderRequest);
91
+ }
92
+ hostConnected() {
93
+ this.host.dispatchEvent(new e(this.context, this.host));
94
+ }
95
+ };
96
+
97
+ // ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/decorators/provide.js
98
+ function e2({ context: e7 }) {
99
+ return (n6, i5) => {
100
+ const r6 = /* @__PURE__ */ new WeakMap();
101
+ if ("object" == typeof i5) return { get() {
102
+ return n6.get.call(this);
103
+ }, set(t5) {
104
+ return r6.get(this).setValue(t5), n6.set.call(this, t5);
105
+ }, init(n7) {
106
+ return r6.set(this, new i(this, { context: e7, initialValue: n7 })), n7;
107
+ } };
108
+ {
109
+ n6.constructor.addInitializer(((n7) => {
110
+ r6.set(n7, new i(n7, { context: e7 }));
111
+ }));
112
+ const o7 = Object.getOwnPropertyDescriptor(n6, i5);
113
+ let s7;
114
+ if (void 0 === o7) {
115
+ const t5 = /* @__PURE__ */ new WeakMap();
116
+ s7 = { get() {
117
+ return t5.get(this);
118
+ }, set(e8) {
119
+ r6.get(this).setValue(e8), t5.set(this, e8);
120
+ }, configurable: true, enumerable: true };
121
+ } else {
122
+ const t5 = o7.set;
123
+ s7 = { ...o7, set(e8) {
124
+ r6.get(this).setValue(e8), t5?.call(this, e8);
125
+ } };
126
+ }
127
+ return void Object.defineProperty(n6, i5, s7);
128
+ }
129
+ };
130
+ }
131
+
132
+ // ../../node_modules/.pnpm/@lit+context@1.1.6/node_modules/@lit/context/lib/decorators/consume.js
133
+ function c({ context: c5, subscribe: e7 }) {
134
+ return (o7, n6) => {
135
+ "object" == typeof n6 ? n6.addInitializer((function() {
136
+ new s2(this, { context: c5, callback: (t5) => {
137
+ o7.set.call(this, t5);
138
+ }, subscribe: e7 });
139
+ })) : o7.constructor.addInitializer(((o8) => {
140
+ new s2(o8, { context: c5, callback: (t5) => {
141
+ o8[n6] = t5;
142
+ }, subscribe: e7 });
143
+ }));
144
+ };
145
+ }
146
+
147
+ // ../qti-base/src/context/computed-item.context.ts
148
+ var computedItemContext = n(Symbol("computedItemContext"));
149
+
150
+ // ../qti-base/src/context/computed.context.ts
151
+ var computedContext = n(Symbol("computedContext"));
152
+
153
+ // ../qti-base/src/context/config.context.ts
154
+ var configContext = n(Symbol("configContext"));
155
+
156
+ // ../qti-base/src/context/item.context.ts
157
+ var itemContextVariables = [
158
+ {
159
+ identifier: "completionStatus",
160
+ cardinality: "single",
161
+ baseType: "string",
162
+ value: "unknown",
163
+ type: "outcome"
164
+ },
165
+ {
166
+ identifier: "numAttempts",
167
+ cardinality: "single",
168
+ baseType: "integer",
169
+ value: "0",
170
+ type: "response"
171
+ }
172
+ ];
173
+
174
+ // ../qti-base/src/context/qti-assessment-item.context.ts
175
+ var itemContext = n(Symbol("item"));
176
+
177
+ // ../qti-base/src/context/qti.context.ts
178
+ var qtiContext = n(Symbol("qtiContext"));
179
+
180
+ // ../qti-base/src/context/session.context.ts
181
+ var INITIAL_SESSION_CONTEXT = { view: "candidate" };
182
+ var sessionContext = n(Symbol("testContext"));
183
+
184
+ // ../qti-base/src/context/test.context.ts
185
+ var INITIAL_TEST_CONTEXT = { items: [], testOutcomeVariables: [] };
186
+ var testContext = n(Symbol("testContext"));
187
+
188
+ // ../../node_modules/.pnpm/@lit+reactive-element@2.1.1/node_modules/@lit/reactive-element/node/decorators/custom-element.js
189
+ var t2 = (t5) => (e7, o7) => {
190
+ void 0 !== o7 ? o7.addInitializer((() => {
191
+ customElements.define(t5, e7);
192
+ })) : customElements.define(t5, e7);
193
+ };
194
+
195
+ // ../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.4.0/node_modules/@lit-labs/ssr-dom-shim/lib/element-internals.js
196
+ var ElementInternalsShim = class ElementInternals {
197
+ get shadowRoot() {
198
+ return this.__host.__shadowRoot;
199
+ }
200
+ constructor(_host) {
201
+ this.ariaAtomic = "";
202
+ this.ariaAutoComplete = "";
203
+ this.ariaBrailleLabel = "";
204
+ this.ariaBrailleRoleDescription = "";
205
+ this.ariaBusy = "";
206
+ this.ariaChecked = "";
207
+ this.ariaColCount = "";
208
+ this.ariaColIndex = "";
209
+ this.ariaColSpan = "";
210
+ this.ariaCurrent = "";
211
+ this.ariaDescription = "";
212
+ this.ariaDisabled = "";
213
+ this.ariaExpanded = "";
214
+ this.ariaHasPopup = "";
215
+ this.ariaHidden = "";
216
+ this.ariaInvalid = "";
217
+ this.ariaKeyShortcuts = "";
218
+ this.ariaLabel = "";
219
+ this.ariaLevel = "";
220
+ this.ariaLive = "";
221
+ this.ariaModal = "";
222
+ this.ariaMultiLine = "";
223
+ this.ariaMultiSelectable = "";
224
+ this.ariaOrientation = "";
225
+ this.ariaPlaceholder = "";
226
+ this.ariaPosInSet = "";
227
+ this.ariaPressed = "";
228
+ this.ariaReadOnly = "";
229
+ this.ariaRequired = "";
230
+ this.ariaRoleDescription = "";
231
+ this.ariaRowCount = "";
232
+ this.ariaRowIndex = "";
233
+ this.ariaRowSpan = "";
234
+ this.ariaSelected = "";
235
+ this.ariaSetSize = "";
236
+ this.ariaSort = "";
237
+ this.ariaValueMax = "";
238
+ this.ariaValueMin = "";
239
+ this.ariaValueNow = "";
240
+ this.ariaValueText = "";
241
+ this.role = "";
242
+ this.form = null;
243
+ this.labels = [];
244
+ this.states = /* @__PURE__ */ new Set();
245
+ this.validationMessage = "";
246
+ this.validity = {};
247
+ this.willValidate = true;
248
+ this.__host = _host;
249
+ }
250
+ checkValidity() {
251
+ console.warn("`ElementInternals.checkValidity()` was called on the server.This method always returns true.");
252
+ return true;
253
+ }
254
+ reportValidity() {
255
+ return true;
256
+ }
257
+ setFormValue() {
258
+ }
259
+ setValidity() {
260
+ }
261
+ };
262
+
263
+ // ../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.4.0/node_modules/@lit-labs/ssr-dom-shim/lib/events.js
264
+ var __classPrivateFieldSet = function(receiver, state, value, kind, f3) {
265
+ if (kind === "m") throw new TypeError("Private method is not writable");
266
+ if (kind === "a" && !f3) throw new TypeError("Private accessor was defined without a setter");
267
+ if (typeof state === "function" ? receiver !== state || !f3 : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
268
+ return kind === "a" ? f3.call(receiver, value) : f3 ? f3.value = value : state.set(receiver, value), value;
269
+ };
270
+ var __classPrivateFieldGet = function(receiver, state, kind, f3) {
271
+ if (kind === "a" && !f3) throw new TypeError("Private accessor was defined without a getter");
272
+ if (typeof state === "function" ? receiver !== state || !f3 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
273
+ return kind === "m" ? f3 : kind === "a" ? f3.call(receiver) : f3 ? f3.value : state.get(receiver);
274
+ };
275
+ var _Event_cancelable;
276
+ var _Event_bubbles;
277
+ var _Event_composed;
278
+ var _Event_defaultPrevented;
279
+ var _Event_timestamp;
280
+ var _Event_propagationStopped;
281
+ var _Event_type;
282
+ var _Event_target;
283
+ var _Event_isBeingDispatched;
284
+ var _a;
285
+ var _CustomEvent_detail;
286
+ var _b;
287
+ var isCaptureEventListener = (options) => typeof options === "boolean" ? options : options?.capture ?? false;
288
+ var NONE = 0;
289
+ var CAPTURING_PHASE = 1;
290
+ var AT_TARGET = 2;
291
+ var BUBBLING_PHASE = 3;
292
+ var EventTarget = class {
293
+ constructor() {
294
+ this.__eventListeners = /* @__PURE__ */ new Map();
295
+ this.__captureEventListeners = /* @__PURE__ */ new Map();
296
+ }
297
+ addEventListener(type, callback, options) {
298
+ if (callback === void 0 || callback === null) {
299
+ return;
300
+ }
301
+ const eventListenersMap = isCaptureEventListener(options) ? this.__captureEventListeners : this.__eventListeners;
302
+ let eventListeners = eventListenersMap.get(type);
303
+ if (eventListeners === void 0) {
304
+ eventListeners = /* @__PURE__ */ new Map();
305
+ eventListenersMap.set(type, eventListeners);
306
+ } else if (eventListeners.has(callback)) {
307
+ return;
308
+ }
309
+ const normalizedOptions = typeof options === "object" && options ? options : {};
310
+ normalizedOptions.signal?.addEventListener("abort", () => this.removeEventListener(type, callback, options));
311
+ eventListeners.set(callback, normalizedOptions ?? {});
312
+ }
313
+ removeEventListener(type, callback, options) {
314
+ if (callback === void 0 || callback === null) {
315
+ return;
316
+ }
317
+ const eventListenersMap = isCaptureEventListener(options) ? this.__captureEventListeners : this.__eventListeners;
318
+ const eventListeners = eventListenersMap.get(type);
319
+ if (eventListeners !== void 0) {
320
+ eventListeners.delete(callback);
321
+ if (!eventListeners.size) {
322
+ eventListenersMap.delete(type);
323
+ }
324
+ }
325
+ }
326
+ dispatchEvent(event) {
327
+ const composedPath = [this];
328
+ let parent = this.__eventTargetParent;
329
+ if (event.composed) {
330
+ while (parent) {
331
+ composedPath.push(parent);
332
+ parent = parent.__eventTargetParent;
333
+ }
334
+ } else {
335
+ while (parent && parent !== this.__host) {
336
+ composedPath.push(parent);
337
+ parent = parent.__eventTargetParent;
338
+ }
339
+ }
340
+ let stopPropagation = false;
341
+ let stopImmediatePropagation = false;
342
+ let eventPhase = NONE;
343
+ let target = null;
344
+ let tmpTarget = null;
345
+ let currentTarget = null;
346
+ const originalStopPropagation = event.stopPropagation;
347
+ const originalStopImmediatePropagation = event.stopImmediatePropagation;
348
+ Object.defineProperties(event, {
349
+ target: {
350
+ get() {
351
+ return target ?? tmpTarget;
352
+ },
353
+ ...enumerableProperty
354
+ },
355
+ srcElement: {
356
+ get() {
357
+ return event.target;
358
+ },
359
+ ...enumerableProperty
360
+ },
361
+ currentTarget: {
362
+ get() {
363
+ return currentTarget;
364
+ },
365
+ ...enumerableProperty
366
+ },
367
+ eventPhase: {
368
+ get() {
369
+ return eventPhase;
370
+ },
371
+ ...enumerableProperty
372
+ },
373
+ composedPath: {
374
+ value: () => composedPath,
375
+ ...enumerableProperty
376
+ },
377
+ stopPropagation: {
378
+ value: () => {
379
+ stopPropagation = true;
380
+ originalStopPropagation.call(event);
381
+ },
382
+ ...enumerableProperty
383
+ },
384
+ stopImmediatePropagation: {
385
+ value: () => {
386
+ stopImmediatePropagation = true;
387
+ originalStopImmediatePropagation.call(event);
388
+ },
389
+ ...enumerableProperty
390
+ }
391
+ });
392
+ const invokeEventListener = (listener, options, eventListenerMap) => {
393
+ if (typeof listener === "function") {
394
+ listener(event);
395
+ } else if (typeof listener?.handleEvent === "function") {
396
+ listener.handleEvent(event);
397
+ }
398
+ if (options.once) {
399
+ eventListenerMap.delete(listener);
400
+ }
401
+ };
402
+ const finishDispatch = () => {
403
+ currentTarget = null;
404
+ eventPhase = NONE;
405
+ return !event.defaultPrevented;
406
+ };
407
+ const captureEventPath = composedPath.slice().reverse();
408
+ target = !this.__host || !event.composed ? this : null;
409
+ const retarget = (eventTargets) => {
410
+ tmpTarget = this;
411
+ while (tmpTarget.__host && eventTargets.includes(tmpTarget.__host)) {
412
+ tmpTarget = tmpTarget.__host;
413
+ }
414
+ };
415
+ for (const eventTarget of captureEventPath) {
416
+ if (!target && (!tmpTarget || tmpTarget === eventTarget.__host)) {
417
+ retarget(captureEventPath.slice(captureEventPath.indexOf(eventTarget)));
418
+ }
419
+ currentTarget = eventTarget;
420
+ eventPhase = eventTarget === event.target ? AT_TARGET : CAPTURING_PHASE;
421
+ const captureEventListeners = eventTarget.__captureEventListeners.get(event.type);
422
+ if (captureEventListeners) {
423
+ for (const [listener, options] of captureEventListeners) {
424
+ invokeEventListener(listener, options, captureEventListeners);
425
+ if (stopImmediatePropagation) {
426
+ return finishDispatch();
427
+ }
428
+ }
429
+ }
430
+ if (stopPropagation) {
431
+ return finishDispatch();
432
+ }
433
+ }
434
+ const bubbleEventPath = event.bubbles ? composedPath : [this];
435
+ tmpTarget = null;
436
+ for (const eventTarget of bubbleEventPath) {
437
+ if (!target && (!tmpTarget || eventTarget === tmpTarget.__host)) {
438
+ retarget(bubbleEventPath.slice(0, bubbleEventPath.indexOf(eventTarget) + 1));
439
+ }
440
+ currentTarget = eventTarget;
441
+ eventPhase = eventTarget === event.target ? AT_TARGET : BUBBLING_PHASE;
442
+ const captureEventListeners = eventTarget.__eventListeners.get(event.type);
443
+ if (captureEventListeners) {
444
+ for (const [listener, options] of captureEventListeners) {
445
+ invokeEventListener(listener, options, captureEventListeners);
446
+ if (stopImmediatePropagation) {
447
+ return finishDispatch();
448
+ }
449
+ }
450
+ }
451
+ if (stopPropagation) {
452
+ return finishDispatch();
453
+ }
454
+ }
455
+ return finishDispatch();
456
+ }
457
+ };
458
+ var EventTargetShimWithRealType = EventTarget;
459
+ var enumerableProperty = { __proto__: null };
460
+ enumerableProperty.enumerable = true;
461
+ Object.freeze(enumerableProperty);
462
+ var EventShim = (_a = class Event2 {
463
+ constructor(type, options = {}) {
464
+ _Event_cancelable.set(this, false);
465
+ _Event_bubbles.set(this, false);
466
+ _Event_composed.set(this, false);
467
+ _Event_defaultPrevented.set(this, false);
468
+ _Event_timestamp.set(this, Date.now());
469
+ _Event_propagationStopped.set(this, false);
470
+ _Event_type.set(this, void 0);
471
+ _Event_target.set(this, void 0);
472
+ _Event_isBeingDispatched.set(this, void 0);
473
+ this.NONE = NONE;
474
+ this.CAPTURING_PHASE = CAPTURING_PHASE;
475
+ this.AT_TARGET = AT_TARGET;
476
+ this.BUBBLING_PHASE = BUBBLING_PHASE;
477
+ if (arguments.length === 0)
478
+ throw new Error(`The type argument must be specified`);
479
+ if (typeof options !== "object" || !options) {
480
+ throw new Error(`The "options" argument must be an object`);
481
+ }
482
+ const { bubbles, cancelable, composed } = options;
483
+ __classPrivateFieldSet(this, _Event_cancelable, !!cancelable, "f");
484
+ __classPrivateFieldSet(this, _Event_bubbles, !!bubbles, "f");
485
+ __classPrivateFieldSet(this, _Event_composed, !!composed, "f");
486
+ __classPrivateFieldSet(this, _Event_type, `${type}`, "f");
487
+ __classPrivateFieldSet(this, _Event_target, null, "f");
488
+ __classPrivateFieldSet(this, _Event_isBeingDispatched, false, "f");
489
+ }
490
+ initEvent(_type, _bubbles, _cancelable) {
491
+ throw new Error("Method not implemented.");
492
+ }
493
+ stopImmediatePropagation() {
494
+ this.stopPropagation();
495
+ }
496
+ preventDefault() {
497
+ __classPrivateFieldSet(this, _Event_defaultPrevented, true, "f");
498
+ }
499
+ get target() {
500
+ return __classPrivateFieldGet(this, _Event_target, "f");
501
+ }
502
+ get currentTarget() {
503
+ return __classPrivateFieldGet(this, _Event_target, "f");
504
+ }
505
+ get srcElement() {
506
+ return __classPrivateFieldGet(this, _Event_target, "f");
507
+ }
508
+ get type() {
509
+ return __classPrivateFieldGet(this, _Event_type, "f");
510
+ }
511
+ get cancelable() {
512
+ return __classPrivateFieldGet(this, _Event_cancelable, "f");
513
+ }
514
+ get defaultPrevented() {
515
+ return __classPrivateFieldGet(this, _Event_cancelable, "f") && __classPrivateFieldGet(this, _Event_defaultPrevented, "f");
516
+ }
517
+ get timeStamp() {
518
+ return __classPrivateFieldGet(this, _Event_timestamp, "f");
519
+ }
520
+ composedPath() {
521
+ return __classPrivateFieldGet(this, _Event_isBeingDispatched, "f") ? [__classPrivateFieldGet(this, _Event_target, "f")] : [];
522
+ }
523
+ get returnValue() {
524
+ return !__classPrivateFieldGet(this, _Event_cancelable, "f") || !__classPrivateFieldGet(this, _Event_defaultPrevented, "f");
525
+ }
526
+ get bubbles() {
527
+ return __classPrivateFieldGet(this, _Event_bubbles, "f");
528
+ }
529
+ get composed() {
530
+ return __classPrivateFieldGet(this, _Event_composed, "f");
531
+ }
532
+ get eventPhase() {
533
+ return __classPrivateFieldGet(this, _Event_isBeingDispatched, "f") ? _a.AT_TARGET : _a.NONE;
534
+ }
535
+ get cancelBubble() {
536
+ return __classPrivateFieldGet(this, _Event_propagationStopped, "f");
537
+ }
538
+ set cancelBubble(value) {
539
+ if (value) {
540
+ __classPrivateFieldSet(this, _Event_propagationStopped, true, "f");
541
+ }
542
+ }
543
+ stopPropagation() {
544
+ __classPrivateFieldSet(this, _Event_propagationStopped, true, "f");
545
+ }
546
+ get isTrusted() {
547
+ return false;
548
+ }
549
+ }, _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.NONE = NONE, _a.CAPTURING_PHASE = CAPTURING_PHASE, _a.AT_TARGET = AT_TARGET, _a.BUBBLING_PHASE = BUBBLING_PHASE, _a);
550
+ Object.defineProperties(EventShim.prototype, {
551
+ initEvent: enumerableProperty,
552
+ stopImmediatePropagation: enumerableProperty,
553
+ preventDefault: enumerableProperty,
554
+ target: enumerableProperty,
555
+ currentTarget: enumerableProperty,
556
+ srcElement: enumerableProperty,
557
+ type: enumerableProperty,
558
+ cancelable: enumerableProperty,
559
+ defaultPrevented: enumerableProperty,
560
+ timeStamp: enumerableProperty,
561
+ composedPath: enumerableProperty,
562
+ returnValue: enumerableProperty,
563
+ bubbles: enumerableProperty,
564
+ composed: enumerableProperty,
565
+ eventPhase: enumerableProperty,
566
+ cancelBubble: enumerableProperty,
567
+ stopPropagation: enumerableProperty,
568
+ isTrusted: enumerableProperty
569
+ });
570
+ var CustomEventShim = (_b = class CustomEvent2 extends EventShim {
571
+ constructor(type, options = {}) {
572
+ super(type, options);
573
+ _CustomEvent_detail.set(this, void 0);
574
+ __classPrivateFieldSet(this, _CustomEvent_detail, options?.detail ?? null, "f");
575
+ }
576
+ initCustomEvent(_type, _bubbles, _cancelable, _detail) {
577
+ throw new Error("Method not implemented.");
578
+ }
579
+ get detail() {
580
+ return __classPrivateFieldGet(this, _CustomEvent_detail, "f");
581
+ }
582
+ }, _CustomEvent_detail = /* @__PURE__ */ new WeakMap(), _b);
583
+ Object.defineProperties(CustomEventShim.prototype, {
584
+ detail: enumerableProperty
585
+ });
586
+ var EventShimWithRealType = EventShim;
587
+ var CustomEventShimWithRealType = CustomEventShim;
588
+
589
+ // ../../node_modules/.pnpm/@lit-labs+ssr-dom-shim@1.4.0/node_modules/@lit-labs/ssr-dom-shim/index.js
590
+ globalThis.Event ??= EventShimWithRealType;
591
+ globalThis.CustomEvent ??= CustomEventShimWithRealType;
592
+ var attributes = /* @__PURE__ */ new WeakMap();
593
+ var attributesForElement = (element) => {
594
+ let attrs = attributes.get(element);
595
+ if (attrs === void 0) {
596
+ attributes.set(element, attrs = /* @__PURE__ */ new Map());
597
+ }
598
+ return attrs;
599
+ };
600
+ var ElementShim = class Element extends EventTargetShimWithRealType {
601
+ constructor() {
602
+ super(...arguments);
603
+ this.__shadowRootMode = null;
604
+ this.__shadowRoot = null;
605
+ this.__internals = null;
606
+ }
607
+ get attributes() {
608
+ return Array.from(attributesForElement(this)).map(([name, value]) => ({
609
+ name,
610
+ value
611
+ }));
612
+ }
613
+ get shadowRoot() {
614
+ if (this.__shadowRootMode === "closed") {
615
+ return null;
616
+ }
617
+ return this.__shadowRoot;
618
+ }
619
+ get localName() {
620
+ return this.constructor.__localName;
621
+ }
622
+ get tagName() {
623
+ return this.localName?.toUpperCase();
624
+ }
625
+ setAttribute(name, value) {
626
+ attributesForElement(this).set(name, String(value));
627
+ }
628
+ removeAttribute(name) {
629
+ attributesForElement(this).delete(name);
630
+ }
631
+ toggleAttribute(name, force) {
632
+ if (this.hasAttribute(name)) {
633
+ if (force === void 0 || !force) {
634
+ this.removeAttribute(name);
635
+ return false;
636
+ }
637
+ } else {
638
+ if (force === void 0 || force) {
639
+ this.setAttribute(name, "");
640
+ return true;
641
+ } else {
642
+ return false;
643
+ }
644
+ }
645
+ return true;
646
+ }
647
+ hasAttribute(name) {
648
+ return attributesForElement(this).has(name);
649
+ }
650
+ attachShadow(init) {
651
+ const shadowRoot = { host: this };
652
+ this.__shadowRootMode = init.mode;
653
+ if (init && init.mode === "open") {
654
+ this.__shadowRoot = shadowRoot;
655
+ }
656
+ return shadowRoot;
657
+ }
658
+ attachInternals() {
659
+ if (this.__internals !== null) {
660
+ throw new Error(`Failed to execute 'attachInternals' on 'HTMLElement': ElementInternals for the specified element was already attached.`);
661
+ }
662
+ const internals = new ElementInternalsShim(this);
663
+ this.__internals = internals;
664
+ return internals;
665
+ }
666
+ getAttribute(name) {
667
+ const value = attributesForElement(this).get(name);
668
+ return value ?? null;
669
+ }
670
+ };
671
+ var HTMLElementShim = class HTMLElement extends ElementShim {
672
+ };
673
+ var HTMLElementShimWithRealType = HTMLElementShim;
674
+ globalThis.litServerRoot ??= Object.defineProperty(new HTMLElementShimWithRealType(), "localName", {
675
+ // Patch localName (and tagName) to return a unique name.
676
+ get() {
677
+ return "lit-server-root";
678
+ }
679
+ });
680
+ function promiseWithResolvers() {
681
+ let resolve;
682
+ let reject;
683
+ const promise = new Promise((res, rej) => {
684
+ resolve = res;
685
+ reject = rej;
686
+ });
687
+ return { promise, resolve, reject };
688
+ }
689
+ var CustomElementRegistry = class {
690
+ constructor() {
691
+ this.__definitions = /* @__PURE__ */ new Map();
692
+ this.__reverseDefinitions = /* @__PURE__ */ new Map();
693
+ this.__pendingWhenDefineds = /* @__PURE__ */ new Map();
694
+ }
695
+ define(name, ctor) {
696
+ if (this.__definitions.has(name)) {
697
+ if (process.env.NODE_ENV === "development") {
698
+ 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.
699
+ Make sure to test your application with a production build as repeat registrations will throw in production.`);
700
+ } else {
701
+ throw new Error(`Failed to execute 'define' on 'CustomElementRegistry': the name "${name}" has already been used with this registry`);
702
+ }
703
+ }
704
+ if (this.__reverseDefinitions.has(ctor)) {
705
+ 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)}`);
706
+ }
707
+ ctor.__localName = name;
708
+ this.__definitions.set(name, {
709
+ ctor,
710
+ // Note it's important we read `observedAttributes` in case it is a getter
711
+ // with side-effects, as is the case in Lit, where it triggers class
712
+ // finalization.
713
+ //
714
+ // TODO(aomarks) To be spec compliant, we should also capture the
715
+ // registration-time lifecycle methods like `connectedCallback`. For them
716
+ // to be actually accessible to e.g. the Lit SSR element renderer, though,
717
+ // we'd need to introduce a new API for accessing them (since `get` only
718
+ // returns the constructor).
719
+ observedAttributes: ctor.observedAttributes ?? []
720
+ });
721
+ this.__reverseDefinitions.set(ctor, name);
722
+ this.__pendingWhenDefineds.get(name)?.resolve(ctor);
723
+ this.__pendingWhenDefineds.delete(name);
724
+ }
725
+ get(name) {
726
+ const definition = this.__definitions.get(name);
727
+ return definition?.ctor;
728
+ }
729
+ getName(ctor) {
730
+ return this.__reverseDefinitions.get(ctor) ?? null;
731
+ }
732
+ upgrade(_element) {
733
+ throw new Error(`customElements.upgrade is not currently supported in SSR. Please file a bug if you need it.`);
734
+ }
735
+ async whenDefined(name) {
736
+ const definition = this.__definitions.get(name);
737
+ if (definition) {
738
+ return definition.ctor;
739
+ }
740
+ let withResolvers = this.__pendingWhenDefineds.get(name);
741
+ if (!withResolvers) {
742
+ withResolvers = promiseWithResolvers();
743
+ this.__pendingWhenDefineds.set(name, withResolvers);
744
+ }
745
+ return withResolvers.promise;
746
+ }
747
+ };
748
+ var CustomElementRegistryShimWithRealType = CustomElementRegistry;
749
+ var customElements2 = new CustomElementRegistryShimWithRealType();
750
+
751
+ // ../../node_modules/.pnpm/@lit+reactive-element@2.1.1/node_modules/@lit/reactive-element/node/css-tag.js
752
+ var t3 = globalThis;
753
+ var e3 = t3.ShadowRoot && (void 0 === t3.ShadyCSS || t3.ShadyCSS.nativeShadow) && "adoptedStyleSheets" in Document.prototype && "replace" in CSSStyleSheet.prototype;
754
+ var s4 = Symbol();
755
+ var o = /* @__PURE__ */ new WeakMap();
756
+ var n2 = class {
757
+ constructor(t5, e7, o7) {
758
+ if (this._$cssResult$ = true, o7 !== s4) throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");
759
+ this.cssText = t5, this.t = e7;
760
+ }
761
+ get styleSheet() {
762
+ let t5 = this.o;
763
+ const s7 = this.t;
764
+ if (e3 && void 0 === t5) {
765
+ const e7 = void 0 !== s7 && 1 === s7.length;
766
+ e7 && (t5 = o.get(s7)), void 0 === t5 && ((this.o = t5 = new CSSStyleSheet()).replaceSync(this.cssText), e7 && o.set(s7, t5));
767
+ }
768
+ return t5;
769
+ }
770
+ toString() {
771
+ return this.cssText;
772
+ }
773
+ };
774
+ var r = (t5) => new n2("string" == typeof t5 ? t5 : t5 + "", void 0, s4);
775
+ var i2 = (t5, ...e7) => {
776
+ const o7 = 1 === t5.length ? t5[0] : e7.reduce(((e8, s7, o8) => e8 + ((t6) => {
777
+ if (true === t6._$cssResult$) return t6.cssText;
778
+ if ("number" == typeof t6) return t6;
779
+ throw Error("Value passed to 'css' function must be a 'css' function result: " + t6 + ". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.");
780
+ })(s7) + t5[o8 + 1]), t5[0]);
781
+ return new n2(o7, t5, s4);
782
+ };
783
+ var S = (s7, o7) => {
784
+ if (e3) s7.adoptedStyleSheets = o7.map(((t5) => t5 instanceof CSSStyleSheet ? t5 : t5.styleSheet));
785
+ else for (const e7 of o7) {
786
+ const o8 = document.createElement("style"), n6 = t3.litNonce;
787
+ void 0 !== n6 && o8.setAttribute("nonce", n6), o8.textContent = e7.cssText, s7.appendChild(o8);
788
+ }
789
+ };
790
+ var c2 = e3 || void 0 === t3.CSSStyleSheet ? (t5) => t5 : (t5) => t5 instanceof CSSStyleSheet ? ((t6) => {
791
+ let e7 = "";
792
+ for (const s7 of t6.cssRules) e7 += s7.cssText;
793
+ return r(e7);
794
+ })(t5) : t5;
795
+
796
+ // ../../node_modules/.pnpm/@lit+reactive-element@2.1.1/node_modules/@lit/reactive-element/node/reactive-element.js
797
+ var { is: h, defineProperty: r2, getOwnPropertyDescriptor: o2, getOwnPropertyNames: n3, getOwnPropertySymbols: a, getPrototypeOf: c3 } = Object;
798
+ var l = globalThis;
799
+ l.customElements ??= customElements2;
800
+ var p = l.trustedTypes;
801
+ var d = p ? p.emptyScript : "";
802
+ var u = l.reactiveElementPolyfillSupport;
803
+ var f = (t5, s7) => t5;
804
+ var b = { toAttribute(t5, s7) {
805
+ switch (s7) {
806
+ case Boolean:
807
+ t5 = t5 ? d : null;
808
+ break;
809
+ case Object:
810
+ case Array:
811
+ t5 = null == t5 ? t5 : JSON.stringify(t5);
812
+ }
813
+ return t5;
814
+ }, fromAttribute(t5, s7) {
815
+ let i5 = t5;
816
+ switch (s7) {
817
+ case Boolean:
818
+ i5 = null !== t5;
819
+ break;
820
+ case Number:
821
+ i5 = null === t5 ? null : Number(t5);
822
+ break;
823
+ case Object:
824
+ case Array:
825
+ try {
826
+ i5 = JSON.parse(t5);
827
+ } catch (t6) {
828
+ i5 = null;
829
+ }
830
+ }
831
+ return i5;
832
+ } };
833
+ var m = (t5, s7) => !h(t5, s7);
834
+ var y = { attribute: true, type: String, converter: b, reflect: false, useDefault: false, hasChanged: m };
835
+ Symbol.metadata ??= Symbol("metadata"), l.litPropertyMetadata ??= /* @__PURE__ */ new WeakMap();
836
+ var g = class extends (globalThis.HTMLElement ?? HTMLElementShimWithRealType) {
837
+ static addInitializer(t5) {
838
+ this._$Ei(), (this.l ??= []).push(t5);
839
+ }
840
+ static get observedAttributes() {
841
+ return this.finalize(), this._$Eh && [...this._$Eh.keys()];
842
+ }
843
+ static createProperty(t5, s7 = y) {
844
+ if (s7.state && (s7.attribute = false), this._$Ei(), this.prototype.hasOwnProperty(t5) && ((s7 = Object.create(s7)).wrapped = true), this.elementProperties.set(t5, s7), !s7.noAccessor) {
845
+ const i5 = Symbol(), e7 = this.getPropertyDescriptor(t5, i5, s7);
846
+ void 0 !== e7 && r2(this.prototype, t5, e7);
847
+ }
848
+ }
849
+ static getPropertyDescriptor(t5, s7, i5) {
850
+ const { get: e7, set: h3 } = o2(this.prototype, t5) ?? { get() {
851
+ return this[s7];
852
+ }, set(t6) {
853
+ this[s7] = t6;
854
+ } };
855
+ return { get: e7, set(s8) {
856
+ const r6 = e7?.call(this);
857
+ h3?.call(this, s8), this.requestUpdate(t5, r6, i5);
858
+ }, configurable: true, enumerable: true };
859
+ }
860
+ static getPropertyOptions(t5) {
861
+ return this.elementProperties.get(t5) ?? y;
862
+ }
863
+ static _$Ei() {
864
+ if (this.hasOwnProperty(f("elementProperties"))) return;
865
+ const t5 = c3(this);
866
+ t5.finalize(), void 0 !== t5.l && (this.l = [...t5.l]), this.elementProperties = new Map(t5.elementProperties);
867
+ }
868
+ static finalize() {
869
+ if (this.hasOwnProperty(f("finalized"))) return;
870
+ if (this.finalized = true, this._$Ei(), this.hasOwnProperty(f("properties"))) {
871
+ const t6 = this.properties, s7 = [...n3(t6), ...a(t6)];
872
+ for (const i5 of s7) this.createProperty(i5, t6[i5]);
873
+ }
874
+ const t5 = this[Symbol.metadata];
875
+ if (null !== t5) {
876
+ const s7 = litPropertyMetadata.get(t5);
877
+ if (void 0 !== s7) for (const [t6, i5] of s7) this.elementProperties.set(t6, i5);
878
+ }
879
+ this._$Eh = /* @__PURE__ */ new Map();
880
+ for (const [t6, s7] of this.elementProperties) {
881
+ const i5 = this._$Eu(t6, s7);
882
+ void 0 !== i5 && this._$Eh.set(i5, t6);
883
+ }
884
+ this.elementStyles = this.finalizeStyles(this.styles);
885
+ }
886
+ static finalizeStyles(t5) {
887
+ const s7 = [];
888
+ if (Array.isArray(t5)) {
889
+ const e7 = new Set(t5.flat(1 / 0).reverse());
890
+ for (const t6 of e7) s7.unshift(c2(t6));
891
+ } else void 0 !== t5 && s7.push(c2(t5));
892
+ return s7;
893
+ }
894
+ static _$Eu(t5, s7) {
895
+ const i5 = s7.attribute;
896
+ return false === i5 ? void 0 : "string" == typeof i5 ? i5 : "string" == typeof t5 ? t5.toLowerCase() : void 0;
897
+ }
898
+ constructor() {
899
+ super(), this._$Ep = void 0, this.isUpdatePending = false, this.hasUpdated = false, this._$Em = null, this._$Ev();
900
+ }
901
+ _$Ev() {
902
+ this._$ES = new Promise(((t5) => this.enableUpdating = t5)), this._$AL = /* @__PURE__ */ new Map(), this._$E_(), this.requestUpdate(), this.constructor.l?.forEach(((t5) => t5(this)));
903
+ }
904
+ addController(t5) {
905
+ (this._$EO ??= /* @__PURE__ */ new Set()).add(t5), void 0 !== this.renderRoot && this.isConnected && t5.hostConnected?.();
906
+ }
907
+ removeController(t5) {
908
+ this._$EO?.delete(t5);
909
+ }
910
+ _$E_() {
911
+ const t5 = /* @__PURE__ */ new Map(), s7 = this.constructor.elementProperties;
912
+ for (const i5 of s7.keys()) this.hasOwnProperty(i5) && (t5.set(i5, this[i5]), delete this[i5]);
913
+ t5.size > 0 && (this._$Ep = t5);
914
+ }
915
+ createRenderRoot() {
916
+ const t5 = this.shadowRoot ?? this.attachShadow(this.constructor.shadowRootOptions);
917
+ return S(t5, this.constructor.elementStyles), t5;
918
+ }
919
+ connectedCallback() {
920
+ this.renderRoot ??= this.createRenderRoot(), this.enableUpdating(true), this._$EO?.forEach(((t5) => t5.hostConnected?.()));
921
+ }
922
+ enableUpdating(t5) {
923
+ }
924
+ disconnectedCallback() {
925
+ this._$EO?.forEach(((t5) => t5.hostDisconnected?.()));
926
+ }
927
+ attributeChangedCallback(t5, s7, i5) {
928
+ this._$AK(t5, i5);
929
+ }
930
+ _$ET(t5, s7) {
931
+ const i5 = this.constructor.elementProperties.get(t5), e7 = this.constructor._$Eu(t5, i5);
932
+ if (void 0 !== e7 && true === i5.reflect) {
933
+ const h3 = (void 0 !== i5.converter?.toAttribute ? i5.converter : b).toAttribute(s7, i5.type);
934
+ this._$Em = t5, null == h3 ? this.removeAttribute(e7) : this.setAttribute(e7, h3), this._$Em = null;
935
+ }
936
+ }
937
+ _$AK(t5, s7) {
938
+ const i5 = this.constructor, e7 = i5._$Eh.get(t5);
939
+ if (void 0 !== e7 && this._$Em !== e7) {
940
+ const t6 = i5.getPropertyOptions(e7), h3 = "function" == typeof t6.converter ? { fromAttribute: t6.converter } : void 0 !== t6.converter?.fromAttribute ? t6.converter : b;
941
+ this._$Em = e7;
942
+ const r6 = h3.fromAttribute(s7, t6.type);
943
+ this[e7] = r6 ?? this._$Ej?.get(e7) ?? r6, this._$Em = null;
944
+ }
945
+ }
946
+ requestUpdate(t5, s7, i5) {
947
+ if (void 0 !== t5) {
948
+ const e7 = this.constructor, h3 = this[t5];
949
+ if (i5 ??= e7.getPropertyOptions(t5), !((i5.hasChanged ?? m)(h3, s7) || i5.useDefault && i5.reflect && h3 === this._$Ej?.get(t5) && !this.hasAttribute(e7._$Eu(t5, i5)))) return;
950
+ this.C(t5, s7, i5);
951
+ }
952
+ false === this.isUpdatePending && (this._$ES = this._$EP());
953
+ }
954
+ C(t5, s7, { useDefault: i5, reflect: e7, wrapped: h3 }, r6) {
955
+ i5 && !(this._$Ej ??= /* @__PURE__ */ new Map()).has(t5) && (this._$Ej.set(t5, r6 ?? s7 ?? this[t5]), true !== h3 || void 0 !== r6) || (this._$AL.has(t5) || (this.hasUpdated || i5 || (s7 = void 0), this._$AL.set(t5, s7)), true === e7 && this._$Em !== t5 && (this._$Eq ??= /* @__PURE__ */ new Set()).add(t5));
956
+ }
957
+ async _$EP() {
958
+ this.isUpdatePending = true;
959
+ try {
960
+ await this._$ES;
961
+ } catch (t6) {
962
+ Promise.reject(t6);
963
+ }
964
+ const t5 = this.scheduleUpdate();
965
+ return null != t5 && await t5, !this.isUpdatePending;
966
+ }
967
+ scheduleUpdate() {
968
+ return this.performUpdate();
969
+ }
970
+ performUpdate() {
971
+ if (!this.isUpdatePending) return;
972
+ if (!this.hasUpdated) {
973
+ if (this.renderRoot ??= this.createRenderRoot(), this._$Ep) {
974
+ for (const [t7, s8] of this._$Ep) this[t7] = s8;
975
+ this._$Ep = void 0;
976
+ }
977
+ const t6 = this.constructor.elementProperties;
978
+ if (t6.size > 0) for (const [s8, i5] of t6) {
979
+ const { wrapped: t7 } = i5, e7 = this[s8];
980
+ true !== t7 || this._$AL.has(s8) || void 0 === e7 || this.C(s8, void 0, i5, e7);
981
+ }
982
+ }
983
+ let t5 = false;
984
+ const s7 = this._$AL;
985
+ try {
986
+ t5 = this.shouldUpdate(s7), t5 ? (this.willUpdate(s7), this._$EO?.forEach(((t6) => t6.hostUpdate?.())), this.update(s7)) : this._$EM();
987
+ } catch (s8) {
988
+ throw t5 = false, this._$EM(), s8;
989
+ }
990
+ t5 && this._$AE(s7);
991
+ }
992
+ willUpdate(t5) {
993
+ }
994
+ _$AE(t5) {
995
+ this._$EO?.forEach(((t6) => t6.hostUpdated?.())), this.hasUpdated || (this.hasUpdated = true, this.firstUpdated(t5)), this.updated(t5);
996
+ }
997
+ _$EM() {
998
+ this._$AL = /* @__PURE__ */ new Map(), this.isUpdatePending = false;
999
+ }
1000
+ get updateComplete() {
1001
+ return this.getUpdateComplete();
1002
+ }
1003
+ getUpdateComplete() {
1004
+ return this._$ES;
1005
+ }
1006
+ shouldUpdate(t5) {
1007
+ return true;
1008
+ }
1009
+ update(t5) {
1010
+ this._$Eq &&= this._$Eq.forEach(((t6) => this._$ET(t6, this[t6]))), this._$EM();
1011
+ }
1012
+ updated(t5) {
1013
+ }
1014
+ firstUpdated(t5) {
1015
+ }
1016
+ };
1017
+ g.elementStyles = [], g.shadowRootOptions = { mode: "open" }, g[f("elementProperties")] = /* @__PURE__ */ new Map(), g[f("finalized")] = /* @__PURE__ */ new Map(), u?.({ ReactiveElement: g }), (l.reactiveElementVersions ??= []).push("2.1.1");
1018
+
1019
+ // ../../node_modules/.pnpm/@lit+reactive-element@2.1.1/node_modules/@lit/reactive-element/node/decorators/property.js
1020
+ var o3 = { attribute: true, type: String, converter: b, reflect: false, hasChanged: m };
1021
+ var r3 = (t5 = o3, e7, r6) => {
1022
+ const { kind: n6, metadata: i5 } = r6;
1023
+ let s7 = globalThis.litPropertyMetadata.get(i5);
1024
+ if (void 0 === s7 && globalThis.litPropertyMetadata.set(i5, s7 = /* @__PURE__ */ new Map()), "setter" === n6 && ((t5 = Object.create(t5)).wrapped = true), s7.set(r6.name, t5), "accessor" === n6) {
1025
+ const { name: o7 } = r6;
1026
+ return { set(r7) {
1027
+ const n7 = e7.get.call(this);
1028
+ e7.set.call(this, r7), this.requestUpdate(o7, n7, t5);
1029
+ }, init(e8) {
1030
+ return void 0 !== e8 && this.C(o7, void 0, t5, e8), e8;
1031
+ } };
1032
+ }
1033
+ if ("setter" === n6) {
1034
+ const { name: o7 } = r6;
1035
+ return function(r7) {
1036
+ const n7 = this[o7];
1037
+ e7.call(this, r7), this.requestUpdate(o7, n7, t5);
1038
+ };
1039
+ }
1040
+ throw Error("Unsupported decorator location: " + n6);
1041
+ };
1042
+ function n4(t5) {
1043
+ return (e7, o7) => "object" == typeof o7 ? r3(t5, e7, o7) : ((t6, e8, o8) => {
1044
+ const r6 = e8.hasOwnProperty(o8);
1045
+ return e8.constructor.createProperty(o8, t6), r6 ? Object.getOwnPropertyDescriptor(e8, o8) : void 0;
1046
+ })(t5, e7, o7);
1047
+ }
1048
+
1049
+ // ../../node_modules/.pnpm/@lit+reactive-element@2.1.1/node_modules/@lit/reactive-element/node/decorators/state.js
1050
+ function r4(r6) {
1051
+ return n4({ ...r6, state: true, attribute: false });
1052
+ }
1053
+
1054
+ // ../../node_modules/.pnpm/@lit+reactive-element@2.1.1/node_modules/@lit/reactive-element/node/decorators/base.js
1055
+ var e4 = (e7, t5, c5) => (c5.configurable = true, c5.enumerable = true, Reflect.decorate && "object" != typeof t5 && Object.defineProperty(e7, t5, c5), c5);
1056
+
1057
+ // ../../node_modules/.pnpm/@lit+reactive-element@2.1.1/node_modules/@lit/reactive-element/node/decorators/query.js
1058
+ function e5(e7, r6) {
1059
+ return (n6, s7, i5) => {
1060
+ const o7 = (t5) => t5.renderRoot?.querySelector(e7) ?? null;
1061
+ if (r6) {
1062
+ const { get: e8, set: r7 } = "object" == typeof s7 ? n6 : i5 ?? (() => {
1063
+ const t5 = Symbol();
1064
+ return { get() {
1065
+ return this[t5];
1066
+ }, set(e9) {
1067
+ this[t5] = e9;
1068
+ } };
1069
+ })();
1070
+ return e4(n6, s7, { get() {
1071
+ let t5 = e8.call(this);
1072
+ return void 0 === t5 && (t5 = o7(this), (null !== t5 || this.hasUpdated) && r7.call(this, t5)), t5;
1073
+ } });
1074
+ }
1075
+ return e4(n6, s7, { get() {
1076
+ return o7(this);
1077
+ } });
1078
+ };
1079
+ }
1080
+
1081
+ // ../../node_modules/.pnpm/@lit+reactive-element@2.1.1/node_modules/@lit/reactive-element/node/decorators/query-assigned-elements.js
1082
+ function o4(o7) {
1083
+ return (e7, n6) => {
1084
+ const { slot: r6, selector: s7 } = o7 ?? {}, c5 = "slot" + (r6 ? `[name=${r6}]` : ":not([name])");
1085
+ return e4(e7, n6, { get() {
1086
+ const t5 = this.renderRoot?.querySelector(c5), e8 = t5?.assignedElements(o7) ?? [];
1087
+ return void 0 === s7 ? e8 : e8.filter(((t6) => t6.matches(s7)));
1088
+ } });
1089
+ };
1090
+ }
1091
+
1092
+ // ../../node_modules/.pnpm/lit-html@3.3.1/node_modules/lit-html/node/lit-html.js
1093
+ var t4 = globalThis;
1094
+ var i3 = t4.trustedTypes;
1095
+ var s5 = i3 ? i3.createPolicy("lit-html", { createHTML: (t5) => t5 }) : void 0;
1096
+ var e6 = "$lit$";
1097
+ var h2 = `lit$${Math.random().toFixed(9).slice(2)}$`;
1098
+ var o5 = "?" + h2;
1099
+ var n5 = `<${o5}>`;
1100
+ var r5 = void 0 === t4.document ? { createTreeWalker: () => ({}) } : document;
1101
+ var l2 = () => r5.createComment("");
1102
+ var c4 = (t5) => null === t5 || "object" != typeof t5 && "function" != typeof t5;
1103
+ var a2 = Array.isArray;
1104
+ var u2 = (t5) => a2(t5) || "function" == typeof t5?.[Symbol.iterator];
1105
+ var d2 = "[ \n\f\r]";
1106
+ var f2 = /<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g;
1107
+ var v = /-->/g;
1108
+ var _ = />/g;
1109
+ var m2 = RegExp(`>|${d2}(?:([^\\s"'>=/]+)(${d2}*=${d2}*(?:[^
1110
+ \f\r"'\`<>=]|("|')|))|$)`, "g");
1111
+ var p2 = /'/g;
1112
+ var g2 = /"/g;
1113
+ var $ = /^(?:script|style|textarea|title)$/i;
1114
+ var y2 = (t5) => (i5, ...s7) => ({ _$litType$: t5, strings: i5, values: s7 });
1115
+ var x = y2(1);
1116
+ var T = y2(2);
1117
+ var b2 = y2(3);
1118
+ var w = Symbol.for("lit-noChange");
1119
+ var E = Symbol.for("lit-nothing");
1120
+ var A = /* @__PURE__ */ new WeakMap();
1121
+ var C = r5.createTreeWalker(r5, 129);
1122
+ function P(t5, i5) {
1123
+ if (!a2(t5) || !t5.hasOwnProperty("raw")) throw Error("invalid template strings array");
1124
+ return void 0 !== s5 ? s5.createHTML(i5) : i5;
1125
+ }
1126
+ var V = (t5, i5) => {
1127
+ const s7 = t5.length - 1, o7 = [];
1128
+ let r6, l3 = 2 === i5 ? "<svg>" : 3 === i5 ? "<math>" : "", c5 = f2;
1129
+ for (let i6 = 0; i6 < s7; i6++) {
1130
+ const s8 = t5[i6];
1131
+ let a3, u3, d3 = -1, y3 = 0;
1132
+ for (; y3 < s8.length && (c5.lastIndex = y3, u3 = c5.exec(s8), null !== u3); ) y3 = c5.lastIndex, c5 === f2 ? "!--" === u3[1] ? c5 = v : void 0 !== u3[1] ? c5 = _ : void 0 !== u3[2] ? ($.test(u3[2]) && (r6 = RegExp("</" + u3[2], "g")), c5 = m2) : void 0 !== u3[3] && (c5 = m2) : c5 === m2 ? ">" === u3[0] ? (c5 = r6 ?? f2, d3 = -1) : void 0 === u3[1] ? d3 = -2 : (d3 = c5.lastIndex - u3[2].length, a3 = u3[1], c5 = void 0 === u3[3] ? m2 : '"' === u3[3] ? g2 : p2) : c5 === g2 || c5 === p2 ? c5 = m2 : c5 === v || c5 === _ ? c5 = f2 : (c5 = m2, r6 = void 0);
1133
+ const x2 = c5 === m2 && t5[i6 + 1].startsWith("/>") ? " " : "";
1134
+ l3 += c5 === f2 ? s8 + n5 : d3 >= 0 ? (o7.push(a3), s8.slice(0, d3) + e6 + s8.slice(d3) + h2 + x2) : s8 + h2 + (-2 === d3 ? i6 : x2);
1135
+ }
1136
+ return [P(t5, l3 + (t5[s7] || "<?>") + (2 === i5 ? "</svg>" : 3 === i5 ? "</math>" : "")), o7];
1137
+ };
1138
+ var N = class _N {
1139
+ constructor({ strings: t5, _$litType$: s7 }, n6) {
1140
+ let r6;
1141
+ this.parts = [];
1142
+ let c5 = 0, a3 = 0;
1143
+ const u3 = t5.length - 1, d3 = this.parts, [f3, v2] = V(t5, s7);
1144
+ if (this.el = _N.createElement(f3, n6), C.currentNode = this.el.content, 2 === s7 || 3 === s7) {
1145
+ const t6 = this.el.content.firstChild;
1146
+ t6.replaceWith(...t6.childNodes);
1147
+ }
1148
+ for (; null !== (r6 = C.nextNode()) && d3.length < u3; ) {
1149
+ if (1 === r6.nodeType) {
1150
+ if (r6.hasAttributes()) for (const t6 of r6.getAttributeNames()) if (t6.endsWith(e6)) {
1151
+ const i5 = v2[a3++], s8 = r6.getAttribute(t6).split(h2), e7 = /([.?@])?(.*)/.exec(i5);
1152
+ d3.push({ type: 1, index: c5, name: e7[2], strings: s8, ctor: "." === e7[1] ? H : "?" === e7[1] ? I : "@" === e7[1] ? L : R }), r6.removeAttribute(t6);
1153
+ } else t6.startsWith(h2) && (d3.push({ type: 6, index: c5 }), r6.removeAttribute(t6));
1154
+ if ($.test(r6.tagName)) {
1155
+ const t6 = r6.textContent.split(h2), s8 = t6.length - 1;
1156
+ if (s8 > 0) {
1157
+ r6.textContent = i3 ? i3.emptyScript : "";
1158
+ for (let i5 = 0; i5 < s8; i5++) r6.append(t6[i5], l2()), C.nextNode(), d3.push({ type: 2, index: ++c5 });
1159
+ r6.append(t6[s8], l2());
1160
+ }
1161
+ }
1162
+ } else if (8 === r6.nodeType) if (r6.data === o5) d3.push({ type: 2, index: c5 });
1163
+ else {
1164
+ let t6 = -1;
1165
+ for (; -1 !== (t6 = r6.data.indexOf(h2, t6 + 1)); ) d3.push({ type: 7, index: c5 }), t6 += h2.length - 1;
1166
+ }
1167
+ c5++;
1168
+ }
1169
+ }
1170
+ static createElement(t5, i5) {
1171
+ const s7 = r5.createElement("template");
1172
+ return s7.innerHTML = t5, s7;
1173
+ }
1174
+ };
1175
+ function S2(t5, i5, s7 = t5, e7) {
1176
+ if (i5 === w) return i5;
1177
+ let h3 = void 0 !== e7 ? s7._$Co?.[e7] : s7._$Cl;
1178
+ const o7 = c4(i5) ? void 0 : i5._$litDirective$;
1179
+ return h3?.constructor !== o7 && (h3?._$AO?.(false), void 0 === o7 ? h3 = void 0 : (h3 = new o7(t5), h3._$AT(t5, s7, e7)), void 0 !== e7 ? (s7._$Co ??= [])[e7] = h3 : s7._$Cl = h3), void 0 !== h3 && (i5 = S2(t5, h3._$AS(t5, i5.values), h3, e7)), i5;
1180
+ }
1181
+ var M = class {
1182
+ constructor(t5, i5) {
1183
+ this._$AV = [], this._$AN = void 0, this._$AD = t5, this._$AM = i5;
1184
+ }
1185
+ get parentNode() {
1186
+ return this._$AM.parentNode;
1187
+ }
1188
+ get _$AU() {
1189
+ return this._$AM._$AU;
1190
+ }
1191
+ u(t5) {
1192
+ const { el: { content: i5 }, parts: s7 } = this._$AD, e7 = (t5?.creationScope ?? r5).importNode(i5, true);
1193
+ C.currentNode = e7;
1194
+ let h3 = C.nextNode(), o7 = 0, n6 = 0, l3 = s7[0];
1195
+ for (; void 0 !== l3; ) {
1196
+ if (o7 === l3.index) {
1197
+ let i6;
1198
+ 2 === l3.type ? i6 = new k(h3, h3.nextSibling, this, t5) : 1 === l3.type ? i6 = new l3.ctor(h3, l3.name, l3.strings, this, t5) : 6 === l3.type && (i6 = new z(h3, this, t5)), this._$AV.push(i6), l3 = s7[++n6];
1199
+ }
1200
+ o7 !== l3?.index && (h3 = C.nextNode(), o7++);
1201
+ }
1202
+ return C.currentNode = r5, e7;
1203
+ }
1204
+ p(t5) {
1205
+ let i5 = 0;
1206
+ for (const s7 of this._$AV) void 0 !== s7 && (void 0 !== s7.strings ? (s7._$AI(t5, s7, i5), i5 += s7.strings.length - 2) : s7._$AI(t5[i5])), i5++;
1207
+ }
1208
+ };
1209
+ var k = class _k {
1210
+ get _$AU() {
1211
+ return this._$AM?._$AU ?? this._$Cv;
1212
+ }
1213
+ constructor(t5, i5, s7, e7) {
1214
+ this.type = 2, this._$AH = E, this._$AN = void 0, this._$AA = t5, this._$AB = i5, this._$AM = s7, this.options = e7, this._$Cv = e7?.isConnected ?? true;
1215
+ }
1216
+ get parentNode() {
1217
+ let t5 = this._$AA.parentNode;
1218
+ const i5 = this._$AM;
1219
+ return void 0 !== i5 && 11 === t5?.nodeType && (t5 = i5.parentNode), t5;
1220
+ }
1221
+ get startNode() {
1222
+ return this._$AA;
1223
+ }
1224
+ get endNode() {
1225
+ return this._$AB;
1226
+ }
1227
+ _$AI(t5, i5 = this) {
1228
+ t5 = S2(this, t5, i5), c4(t5) ? t5 === E || null == t5 || "" === t5 ? (this._$AH !== E && this._$AR(), this._$AH = E) : t5 !== this._$AH && t5 !== w && this._(t5) : void 0 !== t5._$litType$ ? this.$(t5) : void 0 !== t5.nodeType ? this.T(t5) : u2(t5) ? this.k(t5) : this._(t5);
1229
+ }
1230
+ O(t5) {
1231
+ return this._$AA.parentNode.insertBefore(t5, this._$AB);
1232
+ }
1233
+ T(t5) {
1234
+ this._$AH !== t5 && (this._$AR(), this._$AH = this.O(t5));
1235
+ }
1236
+ _(t5) {
1237
+ this._$AH !== E && c4(this._$AH) ? this._$AA.nextSibling.data = t5 : this.T(r5.createTextNode(t5)), this._$AH = t5;
1238
+ }
1239
+ $(t5) {
1240
+ const { values: i5, _$litType$: s7 } = t5, e7 = "number" == typeof s7 ? this._$AC(t5) : (void 0 === s7.el && (s7.el = N.createElement(P(s7.h, s7.h[0]), this.options)), s7);
1241
+ if (this._$AH?._$AD === e7) this._$AH.p(i5);
1242
+ else {
1243
+ const t6 = new M(e7, this), s8 = t6.u(this.options);
1244
+ t6.p(i5), this.T(s8), this._$AH = t6;
1245
+ }
1246
+ }
1247
+ _$AC(t5) {
1248
+ let i5 = A.get(t5.strings);
1249
+ return void 0 === i5 && A.set(t5.strings, i5 = new N(t5)), i5;
1250
+ }
1251
+ k(t5) {
1252
+ a2(this._$AH) || (this._$AH = [], this._$AR());
1253
+ const i5 = this._$AH;
1254
+ let s7, e7 = 0;
1255
+ for (const h3 of t5) e7 === i5.length ? i5.push(s7 = new _k(this.O(l2()), this.O(l2()), this, this.options)) : s7 = i5[e7], s7._$AI(h3), e7++;
1256
+ e7 < i5.length && (this._$AR(s7 && s7._$AB.nextSibling, e7), i5.length = e7);
1257
+ }
1258
+ _$AR(t5 = this._$AA.nextSibling, i5) {
1259
+ for (this._$AP?.(false, true, i5); t5 !== this._$AB; ) {
1260
+ const i6 = t5.nextSibling;
1261
+ t5.remove(), t5 = i6;
1262
+ }
1263
+ }
1264
+ setConnected(t5) {
1265
+ void 0 === this._$AM && (this._$Cv = t5, this._$AP?.(t5));
1266
+ }
1267
+ };
1268
+ var R = class {
1269
+ get tagName() {
1270
+ return this.element.tagName;
1271
+ }
1272
+ get _$AU() {
1273
+ return this._$AM._$AU;
1274
+ }
1275
+ constructor(t5, i5, s7, e7, h3) {
1276
+ this.type = 1, this._$AH = E, this._$AN = void 0, this.element = t5, this.name = i5, this._$AM = e7, this.options = h3, s7.length > 2 || "" !== s7[0] || "" !== s7[1] ? (this._$AH = Array(s7.length - 1).fill(new String()), this.strings = s7) : this._$AH = E;
1277
+ }
1278
+ _$AI(t5, i5 = this, s7, e7) {
1279
+ const h3 = this.strings;
1280
+ let o7 = false;
1281
+ if (void 0 === h3) t5 = S2(this, t5, i5, 0), o7 = !c4(t5) || t5 !== this._$AH && t5 !== w, o7 && (this._$AH = t5);
1282
+ else {
1283
+ const e8 = t5;
1284
+ let n6, r6;
1285
+ for (t5 = h3[0], n6 = 0; n6 < h3.length - 1; n6++) r6 = S2(this, e8[s7 + n6], i5, n6), r6 === w && (r6 = this._$AH[n6]), o7 ||= !c4(r6) || r6 !== this._$AH[n6], r6 === E ? t5 = E : t5 !== E && (t5 += (r6 ?? "") + h3[n6 + 1]), this._$AH[n6] = r6;
1286
+ }
1287
+ o7 && !e7 && this.j(t5);
1288
+ }
1289
+ j(t5) {
1290
+ t5 === E ? this.element.removeAttribute(this.name) : this.element.setAttribute(this.name, t5 ?? "");
1291
+ }
1292
+ };
1293
+ var H = class extends R {
1294
+ constructor() {
1295
+ super(...arguments), this.type = 3;
1296
+ }
1297
+ j(t5) {
1298
+ this.element[this.name] = t5 === E ? void 0 : t5;
1299
+ }
1300
+ };
1301
+ var I = class extends R {
1302
+ constructor() {
1303
+ super(...arguments), this.type = 4;
1304
+ }
1305
+ j(t5) {
1306
+ this.element.toggleAttribute(this.name, !!t5 && t5 !== E);
1307
+ }
1308
+ };
1309
+ var L = class extends R {
1310
+ constructor(t5, i5, s7, e7, h3) {
1311
+ super(t5, i5, s7, e7, h3), this.type = 5;
1312
+ }
1313
+ _$AI(t5, i5 = this) {
1314
+ if ((t5 = S2(this, t5, i5, 0) ?? E) === w) return;
1315
+ const s7 = this._$AH, e7 = t5 === E && s7 !== E || t5.capture !== s7.capture || t5.once !== s7.once || t5.passive !== s7.passive, h3 = t5 !== E && (s7 === E || e7);
1316
+ e7 && this.element.removeEventListener(this.name, this, s7), h3 && this.element.addEventListener(this.name, this, t5), this._$AH = t5;
1317
+ }
1318
+ handleEvent(t5) {
1319
+ "function" == typeof this._$AH ? this._$AH.call(this.options?.host ?? this.element, t5) : this._$AH.handleEvent(t5);
1320
+ }
1321
+ };
1322
+ var z = class {
1323
+ constructor(t5, i5, s7) {
1324
+ this.element = t5, this.type = 6, this._$AN = void 0, this._$AM = i5, this.options = s7;
1325
+ }
1326
+ get _$AU() {
1327
+ return this._$AM._$AU;
1328
+ }
1329
+ _$AI(t5) {
1330
+ S2(this, t5);
1331
+ }
1332
+ };
1333
+ var W = { M: e6, P: h2, A: o5, C: 1, L: V, R: M, D: u2, V: S2, I: k, H: R, N: I, U: L, B: H, F: z };
1334
+ var Z = t4.litHtmlPolyfillSupport;
1335
+ Z?.(N, k), (t4.litHtmlVersions ??= []).push("3.3.1");
1336
+ var j = (t5, i5, s7) => {
1337
+ const e7 = s7?.renderBefore ?? i5;
1338
+ let h3 = e7._$litPart$;
1339
+ if (void 0 === h3) {
1340
+ const t6 = s7?.renderBefore ?? null;
1341
+ e7._$litPart$ = h3 = new k(i5.insertBefore(l2(), t6), t6, void 0, s7 ?? {});
1342
+ }
1343
+ return h3._$AI(t5), h3;
1344
+ };
1345
+
1346
+ // ../../node_modules/.pnpm/lit-element@4.2.1/node_modules/lit-element/lit-element.js
1347
+ var s6 = globalThis;
1348
+ var i4 = class extends g {
1349
+ constructor() {
1350
+ super(...arguments), this.renderOptions = { host: this }, this._$Do = void 0;
1351
+ }
1352
+ createRenderRoot() {
1353
+ const t5 = super.createRenderRoot();
1354
+ return this.renderOptions.renderBefore ??= t5.firstChild, t5;
1355
+ }
1356
+ update(t5) {
1357
+ const r6 = this.render();
1358
+ this.hasUpdated || (this.renderOptions.isConnected = this.isConnected), super.update(t5), this._$Do = j(r6, this.renderRoot, this.renderOptions);
1359
+ }
1360
+ connectedCallback() {
1361
+ super.connectedCallback(), this._$Do?.setConnected(true);
1362
+ }
1363
+ disconnectedCallback() {
1364
+ super.disconnectedCallback(), this._$Do?.setConnected(false);
1365
+ }
1366
+ render() {
1367
+ return w;
1368
+ }
1369
+ };
1370
+ i4._$litElement$ = true, i4["finalized"] = true, s6.litElementHydrateSupport?.({ LitElement: i4 });
1371
+ var o6 = s6.litElementPolyfillSupport;
1372
+ o6?.({ LitElement: i4 });
1373
+ (s6.litElementVersions ??= []).push("4.2.1");
1374
+
1375
+ // ../qti-base/src/abstract/interaction.ts
1376
+ var Correctness = /* @__PURE__ */ ((Correctness2) => {
1377
+ Correctness2["Correct"] = "correct";
1378
+ Correctness2["PartiallyCorrect"] = "partially-correct";
1379
+ Correctness2["Incorrect"] = "incorrect";
1380
+ return Correctness2;
1381
+ })(Correctness || {});
1382
+ var Interaction = class extends i4 {
1383
+ constructor() {
1384
+ super();
1385
+ this.disabled = false;
1386
+ this.readonly = false;
1387
+ this._internals = this.attachInternals();
1388
+ }
1389
+ static {
1390
+ this.formAssociated = true;
1391
+ }
1392
+ get internals() {
1393
+ return this._internals;
1394
+ }
1395
+ get isFullCorrectResponse() {
1396
+ return this._isFullCorrectResponse;
1397
+ }
1398
+ set isFullCorrectResponse(val) {
1399
+ this._isFullCorrectResponse = val;
1400
+ if (val) {
1401
+ this.disabled = true;
1402
+ this.setAttribute("response-identifier", this.responseIdentifier + "_cr");
1403
+ }
1404
+ }
1405
+ get correctResponse() {
1406
+ return this._correctResponse;
1407
+ }
1408
+ set correctResponse(val) {
1409
+ this._correctResponse = val;
1410
+ }
1411
+ get correctness() {
1412
+ const responseVariable = this.responseVariable;
1413
+ if (!responseVariable || responseVariable.correctResponse === null) return null;
1414
+ return responseVariable.correctResponse === responseVariable.value ? "correct" /* Correct */ : "incorrect" /* Incorrect */;
1415
+ }
1416
+ get isInline() {
1417
+ return false;
1418
+ }
1419
+ get responseVariable() {
1420
+ const responseVariables = this._context.variables.filter((v2) => v2.type === "response");
1421
+ const responseIdentifier = this.getAttribute("response-identifier");
1422
+ return responseVariables.find((v2) => v2.identifier === responseIdentifier);
1423
+ }
1424
+ toggleCorrectResponse(show) {
1425
+ const correctResponseMode = this?.configContext?.correctResponseMode || "internal";
1426
+ if (correctResponseMode === "full") {
1427
+ this.toggleFullCorrectResponse(show);
1428
+ } else {
1429
+ this.toggleInternalCorrectResponse(show);
1430
+ }
1431
+ }
1432
+ async toggleFullCorrectResponse(show) {
1433
+ const nextSibling = this.nextSibling;
1434
+ const nextSiblingIsFullCorrectResponse = nextSibling instanceof HTMLDivElement && nextSibling?.classList.contains("full-correct-response");
1435
+ const responseVariable = this.responseVariable;
1436
+ if (!responseVariable) {
1437
+ return;
1438
+ }
1439
+ const showFullCorrectResponse = show && (this?.configContext?.fullCorrectResponseOnlyWhenIncorrect === false || this.correctness !== "correct" /* Correct */);
1440
+ if (!showFullCorrectResponse) {
1441
+ if (!nextSiblingIsFullCorrectResponse) {
1442
+ return;
1443
+ }
1444
+ this.parentElement?.removeChild(nextSibling);
1445
+ }
1446
+ if (nextSiblingIsFullCorrectResponse) {
1447
+ return;
1448
+ }
1449
+ const clone = this.cloneNode(true);
1450
+ const containerDiv = document.createElement("div");
1451
+ containerDiv.classList.add("full-correct-response");
1452
+ if (this.isInline) {
1453
+ containerDiv.classList.add("full-correct-response-inline");
1454
+ } else {
1455
+ containerDiv.classList.add("full-correct-response-block");
1456
+ }
1457
+ containerDiv.role = "full-correct-response";
1458
+ containerDiv.appendChild(clone);
1459
+ clone.isFullCorrectResponse = true;
1460
+ this.parentElement?.insertBefore(containerDiv, this.nextSibling);
1461
+ await clone.updateComplete;
1462
+ clone.response = Array.isArray(responseVariable.correctResponse) ? [...responseVariable.correctResponse] : responseVariable.correctResponse;
1463
+ }
1464
+ toggleInternalCorrectResponse(show) {
1465
+ const responseVariable = this.responseVariable;
1466
+ this.correctResponse = show ? responseVariable?.correctResponse : responseVariable?.cardinality === "single" ? "" : [];
1467
+ }
1468
+ toggleCandidateCorrection(show) {
1469
+ const responseVariable = this.responseVariable;
1470
+ if (!responseVariable) return;
1471
+ this._internals.states.delete("candidate-correct");
1472
+ this._internals.states.delete("candidate-partially-correct");
1473
+ this._internals.states.delete("candidate-incorrect");
1474
+ if (!show) {
1475
+ return;
1476
+ }
1477
+ if (this.correctness === "correct" /* Correct */) {
1478
+ this._internals.states.add("candidate-correct");
1479
+ }
1480
+ if (this.correctness === "partially-correct" /* PartiallyCorrect */) {
1481
+ this._internals.states.add("candidate-partially-correct");
1482
+ }
1483
+ if (this.correctness === "incorrect" /* Incorrect */) {
1484
+ this._internals.states.add("candidate-incorrect");
1485
+ }
1486
+ }
1487
+ get value() {
1488
+ return JSON.stringify(this.response);
1489
+ }
1490
+ set value(val) {
1491
+ this.response = val ? JSON.parse(val) : null;
1492
+ }
1493
+ reportValidity() {
1494
+ return this._internals.reportValidity();
1495
+ }
1496
+ reset() {
1497
+ this.response = null;
1498
+ }
1499
+ // attributeChangedCallback(name: string, _old: string | null, value: string | null): void {
1500
+ // super.attributeChangedCallback(name, _old, value);
1501
+ // // changing attributes in lit is not a thing, they are defined in the QTI XML and will never change
1502
+ // // except in storybook where we can change the value of the attribute
1503
+ // // this can make the internal state out of sync with the attribute
1504
+ // // so we reset the value to null to force the internal state to be reset
1505
+ // const attributeNamesToExclude = ['style', 'class'];
1506
+ // if (!attributeNamesToExclude.includes(name)) {
1507
+ // this.reset();
1508
+ // }
1509
+ // }
1510
+ connectedCallback() {
1511
+ super.connectedCallback();
1512
+ if (this.isFullCorrectResponse) {
1513
+ return;
1514
+ }
1515
+ this.dispatchEvent(
1516
+ new CustomEvent("qti-register-interaction", {
1517
+ bubbles: true,
1518
+ composed: true,
1519
+ cancelable: false,
1520
+ detail: {
1521
+ interactionElement: this,
1522
+ responseIdentifier: this.responseIdentifier
1523
+ }
1524
+ })
1525
+ );
1526
+ }
1527
+ saveResponse(value) {
1528
+ this.dispatchEvent(
1529
+ new CustomEvent("qti-interaction-response", {
1530
+ bubbles: true,
1531
+ composed: true,
1532
+ cancelable: false,
1533
+ detail: {
1534
+ responseIdentifier: this.responseIdentifier,
1535
+ response: Array.isArray(value) ? [...value] : value
1536
+ }
1537
+ })
1538
+ );
1539
+ }
1540
+ };
1541
+ __decorateClass([
1542
+ c({ context: itemContext, subscribe: true })
1543
+ ], Interaction.prototype, "_context", 2);
1544
+ __decorateClass([
1545
+ c({ context: configContext, subscribe: true })
1546
+ ], Interaction.prototype, "configContext", 2);
1547
+ __decorateClass([
1548
+ n4({ type: String, attribute: "response-identifier" })
1549
+ ], Interaction.prototype, "responseIdentifier", 2);
1550
+ __decorateClass([
1551
+ n4({ reflect: true, type: Boolean })
1552
+ ], Interaction.prototype, "disabled", 2);
1553
+ __decorateClass([
1554
+ n4({ reflect: true, type: Boolean })
1555
+ ], Interaction.prototype, "readonly", 2);
1556
+ __decorateClass([
1557
+ r4()
1558
+ ], Interaction.prototype, "_isFullCorrectResponse", 2);
1559
+ __decorateClass([
1560
+ r4()
1561
+ ], Interaction.prototype, "_correctResponse", 2);
1562
+
1563
+ // ../qti-base/src/abstract/qti-variable-declaration.ts
1564
+ var QtiVariableDeclaration = class extends i4 {
1565
+ render() {
1566
+ return x`<slot></slot>`;
1567
+ }
1568
+ defaultValues(cardinality) {
1569
+ const htmlValues = Array.from(this.querySelectorAll("qti-default-value > qti-value"));
1570
+ if (htmlValues.length === 0) {
1571
+ return null;
1572
+ }
1573
+ const defaultValues = htmlValues.map((n6) => n6.innerHTML.trim());
1574
+ if (defaultValues.length > 1 || cardinality === "multiple" || cardinality === "ordered") {
1575
+ return defaultValues;
1576
+ }
1577
+ return defaultValues[0];
1578
+ }
1579
+ };
1580
+
1581
+ // ../qti-base/src/abstract/qti-expression.ts
1582
+ var QtiExpression = class extends i4 {
1583
+ constructor() {
1584
+ super(...arguments);
1585
+ this.getVariables = () => (
1586
+ // FIXME: if this itself is multiple, this will never enter the qti-multiple switch
1587
+ // See this example here: https://github.com/1EdTech/qti-examples/blob/master/qtiv3-examples/packaging/items/Example05-feedbackBlock-adaptive.xml
1588
+ Array.from(this.children).map((e7) => {
1589
+ console.debug("getVariables", e7.tagName.toLowerCase());
1590
+ switch (e7.tagName.toLowerCase()) {
1591
+ case "qti-base-value": {
1592
+ return {
1593
+ baseType: e7.getAttribute("base-type"),
1594
+ value: e7.textContent.trim(),
1595
+ cardinality: "single"
1596
+ };
1597
+ }
1598
+ case "qti-variable": {
1599
+ const identifier = e7.getAttribute("identifier") || "";
1600
+ if (identifier === "QTI_CONTEXT") {
1601
+ if (!this.qtiContext?.QTI_CONTEXT) {
1602
+ console.warn("QTI_CONTEXT not available");
1603
+ return {
1604
+ identifier: "QTI_CONTEXT",
1605
+ baseType: "record",
1606
+ value: this.qtiContext.QTI_CONTEXT,
1607
+ cardinality: "record",
1608
+ type: "context"
1609
+ };
1610
+ }
1611
+ return {
1612
+ identifier: "QTI_CONTEXT",
1613
+ baseType: "record",
1614
+ value: this.qtiContext.QTI_CONTEXT,
1615
+ cardinality: "record",
1616
+ type: "context"
1617
+ };
1618
+ }
1619
+ const variable = this.context.variables.find((v2) => v2.identifier === identifier) || null;
1620
+ return variable;
1621
+ }
1622
+ case "qti-multiple": {
1623
+ const multiple = e7;
1624
+ const values = multiple.getResult();
1625
+ console.debug("values", values);
1626
+ if (values?.length > 0) {
1627
+ return {
1628
+ identifier: "",
1629
+ baseType: values[0].baseType,
1630
+ value: values.map((v2) => v2.value),
1631
+ cardinality: "multiple",
1632
+ type: "response"
1633
+ };
1634
+ }
1635
+ return null;
1636
+ }
1637
+ case "qti-ordered": {
1638
+ const multiple = e7;
1639
+ const values = multiple.getResult();
1640
+ if (values?.length > 0) {
1641
+ return {
1642
+ identifier: "",
1643
+ baseType: values[0].baseType,
1644
+ value: values.map((v2) => v2.value),
1645
+ cardinality: "ordered",
1646
+ type: "response"
1647
+ };
1648
+ }
1649
+ return null;
1650
+ }
1651
+ case "qti-correct": {
1652
+ const identifier = e7.getAttribute("identifier") || "";
1653
+ const responseVariable = this.context?.variables?.find((v2) => v2.identifier === identifier) || null;
1654
+ return {
1655
+ baseType: responseVariable.baseType,
1656
+ value: responseVariable.correctResponse,
1657
+ cardinality: responseVariable.cardinality
1658
+ };
1659
+ }
1660
+ default: {
1661
+ try {
1662
+ const expression = e7;
1663
+ const value = expression.getResult();
1664
+ return {
1665
+ baseType: "integer",
1666
+ value: value?.toString() || null,
1667
+ cardinality: "single"
1668
+ };
1669
+ } catch (error) {
1670
+ console.warn("default not sufficient");
1671
+ }
1672
+ return null;
1673
+ }
1674
+ }
1675
+ }).filter((v2) => v2 !== null)
1676
+ );
1677
+ }
1678
+ static {
1679
+ // hide the slot with css
1680
+ this.styles = i2`
1681
+ slot {
1682
+ display: none;
1683
+ }
1684
+ `;
1685
+ }
1686
+ render() {
1687
+ return x`<pre>${JSON.stringify(this.result, null, 2)}</pre>
1688
+ <slot></slot>`;
1689
+ }
1690
+ calculate() {
1691
+ this.result = this.getResult();
1692
+ return this.result;
1693
+ }
1694
+ getResult() {
1695
+ throw new Error("Not implemented");
1696
+ }
1697
+ };
1698
+ __decorateClass([
1699
+ r4()
1700
+ ], QtiExpression.prototype, "result", 2);
1701
+ __decorateClass([
1702
+ c({ context: itemContext, subscribe: true }),
1703
+ r4()
1704
+ ], QtiExpression.prototype, "context", 2);
1705
+ __decorateClass([
1706
+ c({ context: qtiContext, subscribe: true }),
1707
+ r4()
1708
+ ], QtiExpression.prototype, "qtiContext", 2);
1709
+
1710
+ // ../qti-base/src/abstract/qti-condition-expression.ts
1711
+ var QtiConditionExpression = class extends QtiExpression {
1712
+ calculate() {
1713
+ this.result = this.getResult();
1714
+ return this.result;
1715
+ }
1716
+ getResult() {
1717
+ throw new Error("Not implemented");
1718
+ }
1719
+ };
1720
+
1721
+ // ../qti-base/src/utils/utils.ts
1722
+ var decimalSeparator = () => {
1723
+ return new Intl.NumberFormat().format(0.1).replace(/\d/g, "");
1724
+ };
1725
+ var convertNumberToUniversalFormat = (number) => {
1726
+ if (typeof number === "string") {
1727
+ return number;
1728
+ }
1729
+ const dSep = decimalSeparator();
1730
+ if (dSep === ".") {
1731
+ return number.toLocaleString();
1732
+ } else {
1733
+ return number.toString().replace(".", "").replace(dSep, ".");
1734
+ }
1735
+ };
1736
+ function IsNullOrUndefined(value) {
1737
+ return value === null || value === void 0;
1738
+ }
1739
+ function removeDoubleSlashes(str) {
1740
+ const singleForwardSlashes = str.replace(/([^:]\/)\/+/g, "$1").replace(/\/\//g, "/").replace("http:/", "http://").replace("https:/", "https://");
1741
+ return singleForwardSlashes;
1742
+ }
1743
+
1744
+ // ../qti-base/src/abstract/qti-feedback.ts
1745
+ var QtiFeedback = class extends i4 {
1746
+ connectedCallback() {
1747
+ super.connectedCallback();
1748
+ this.dispatchEvent(
1749
+ new CustomEvent("qti-register-feedback", {
1750
+ bubbles: true,
1751
+ composed: true,
1752
+ detail: this
1753
+ })
1754
+ );
1755
+ }
1756
+ checkShowFeedback(outcomeIdentifier) {
1757
+ const outcomeVariable = this._context.variables.find((v2) => v2.identifier === outcomeIdentifier) || null;
1758
+ if (this.outcomeIdentifier !== outcomeIdentifier || !outcomeVariable) return;
1759
+ let isFound = false;
1760
+ if (Array.isArray(outcomeVariable.value)) {
1761
+ isFound = outcomeVariable.value.includes(this.identifier);
1762
+ } else {
1763
+ isFound = !IsNullOrUndefined(this.identifier) && !IsNullOrUndefined(outcomeVariable?.value) && this.identifier === outcomeVariable.value || false;
1764
+ }
1765
+ this.showFeedback(isFound);
1766
+ }
1767
+ showFeedback(value) {
1768
+ this.showStatus = value && this.showHide === "show" || !value && this.showHide === "hide" ? "on" : "off";
1769
+ }
1770
+ };
1771
+ __decorateClass([
1772
+ n4({ type: String, attribute: "show-hide" })
1773
+ ], QtiFeedback.prototype, "showHide", 2);
1774
+ __decorateClass([
1775
+ n4({ type: String, attribute: "outcome-identifier" })
1776
+ ], QtiFeedback.prototype, "outcomeIdentifier", 2);
1777
+ __decorateClass([
1778
+ n4({ type: String })
1779
+ ], QtiFeedback.prototype, "identifier", 2);
1780
+ __decorateClass([
1781
+ n4({ type: String, attribute: false })
1782
+ ], QtiFeedback.prototype, "showStatus", 2);
1783
+ __decorateClass([
1784
+ c({ context: itemContext, subscribe: true }),
1785
+ r4()
1786
+ ], QtiFeedback.prototype, "_context", 2);
1787
+
1788
+ // ../qti-base/src/lib/qti-rule-base.ts
1789
+ var QtiRuleElement = class extends i4 {
1790
+ };
1791
+
1792
+ // ../qti-base/src/utils/scoring-helper.ts
1793
+ var ScoringHelper = class {
1794
+ /**
1795
+ * Checks if a given point is within a specified area.
1796
+ * @param point The point to test, represented as a string "x y" (e.g., "102 113").
1797
+ * @param areaKey The area definition, including shape and coordinates (e.g., "circle,102,113,16").
1798
+ * @param baseType The base type of the response, must be "point" for this method to proceed.
1799
+ * @returns True if the point is within the area; false otherwise.
1800
+ */
1801
+ static isPointInArea(point, areaKey, baseType) {
1802
+ if (baseType !== "point") {
1803
+ console.warn(`Base type ${baseType} is not supported for point area mapping.`);
1804
+ return false;
1805
+ }
1806
+ const [px, py] = point.split(" ").map(Number);
1807
+ const [shape, ...coords] = areaKey.split(",");
1808
+ const coordinates = coords.map(Number);
1809
+ switch (shape.toLowerCase()) {
1810
+ case "circle":
1811
+ case "default": {
1812
+ const [cx, cy, radius] = coordinates;
1813
+ if (coordinates.length !== 3) {
1814
+ console.warn(`Invalid circle definition: ${areaKey}`);
1815
+ return false;
1816
+ }
1817
+ const distance = Math.sqrt((px - cx) ** 2 + (py - cy) ** 2);
1818
+ return distance <= radius;
1819
+ }
1820
+ case "rect": {
1821
+ const [x1, y1, x2, y22] = coordinates;
1822
+ if (coordinates.length !== 4) {
1823
+ console.warn(`Invalid rectangle definition: ${areaKey}`);
1824
+ return false;
1825
+ }
1826
+ return px >= x1 && px <= x2 && py >= y1 && py <= y22;
1827
+ }
1828
+ case "ellipse": {
1829
+ const [cx, cy, rx, ry] = coordinates;
1830
+ if (coordinates.length !== 4) {
1831
+ console.warn(`Invalid ellipse definition: ${areaKey}`);
1832
+ return false;
1833
+ }
1834
+ const normalizedX = (px - cx) ** 2 / rx ** 2;
1835
+ const normalizedY = (py - cy) ** 2 / ry ** 2;
1836
+ return normalizedX + normalizedY <= 1;
1837
+ }
1838
+ case "poly": {
1839
+ if (coordinates.length < 6 || coordinates.length % 2 !== 0) {
1840
+ console.warn(`Invalid polygon definition: ${areaKey}`);
1841
+ return false;
1842
+ }
1843
+ const vertices = [];
1844
+ for (let i5 = 0; i5 < coordinates.length; i5 += 2) {
1845
+ vertices.push({ x: coordinates[i5], y: coordinates[i5 + 1] });
1846
+ }
1847
+ return this.isPointInPolygon({ x: px, y: py }, vertices);
1848
+ }
1849
+ default:
1850
+ console.warn(`Unsupported shape type: ${shape}`);
1851
+ return false;
1852
+ }
1853
+ }
1854
+ /**
1855
+ * Checks if a point is inside a polygon using the ray-casting algorithm.
1856
+ * @param point The point to test.
1857
+ * @param vertices The vertices of the polygon in order (array of {x, y} objects).
1858
+ * @returns True if the point is inside the polygon; false otherwise.
1859
+ */
1860
+ static isPointInPolygon(point, vertices) {
1861
+ let inside = false;
1862
+ for (let i5 = 0, j2 = vertices.length - 1; i5 < vertices.length; j2 = i5++) {
1863
+ const xi = vertices[i5].x, yi = vertices[i5].y;
1864
+ const xj = vertices[j2].x, yj = vertices[j2].y;
1865
+ const intersect = yi > point.y !== yj > point.y && point.x < (xj - xi) * (point.y - yi) / (yj - yi) + xi;
1866
+ if (intersect) inside = !inside;
1867
+ }
1868
+ return inside;
1869
+ }
1870
+ static compareSingleValues(value1, value2, baseType) {
1871
+ switch (baseType) {
1872
+ case "identifier":
1873
+ case "string":
1874
+ return value1 === value2;
1875
+ case "integer": {
1876
+ const int1 = parseInt(value1, 10);
1877
+ const int2 = parseInt(value2, 10);
1878
+ if (!isNaN(int1) && !isNaN(int2)) {
1879
+ return int1 === int2;
1880
+ } else {
1881
+ console.error(`Cannot convert ${value1} and/or ${value2} to int.`);
1882
+ }
1883
+ break;
1884
+ }
1885
+ case "float": {
1886
+ const float1 = parseFloat(value1);
1887
+ const float2 = parseFloat(value2);
1888
+ if (!isNaN(float1) && !isNaN(float2)) {
1889
+ return float1 === float2;
1890
+ } else {
1891
+ console.error(`couldn't convert ${value1} and/or ${value2} to float.`);
1892
+ }
1893
+ break;
1894
+ }
1895
+ case "pair":
1896
+ case "directedPair": {
1897
+ const pair1 = value1.split(" ").sort();
1898
+ const pair2 = value2.split(" ").sort();
1899
+ if (pair1.length === 2 && pair2.length === 2) {
1900
+ if (baseType === "pair") {
1901
+ pair1.sort();
1902
+ pair2.sort();
1903
+ }
1904
+ return pair1.join(" ") === pair2.join(" ");
1905
+ } else {
1906
+ console.error(`compared two pair but one of the values does not have 2 values: 1: ${value1} 2: ${value2}`);
1907
+ }
1908
+ break;
1909
+ }
1910
+ }
1911
+ return false;
1912
+ }
1913
+ };
1914
+
1915
+ export {
1916
+ e2 as e,
1917
+ c,
1918
+ computedItemContext,
1919
+ computedContext,
1920
+ configContext,
1921
+ itemContextVariables,
1922
+ itemContext,
1923
+ qtiContext,
1924
+ INITIAL_SESSION_CONTEXT,
1925
+ sessionContext,
1926
+ INITIAL_TEST_CONTEXT,
1927
+ testContext,
1928
+ t2 as t,
1929
+ i2 as i,
1930
+ n4 as n,
1931
+ r4 as r,
1932
+ e5 as e2,
1933
+ o4 as o,
1934
+ x,
1935
+ T,
1936
+ w,
1937
+ E,
1938
+ W,
1939
+ i4 as i2,
1940
+ Correctness,
1941
+ Interaction,
1942
+ QtiVariableDeclaration,
1943
+ QtiExpression,
1944
+ QtiConditionExpression,
1945
+ decimalSeparator,
1946
+ convertNumberToUniversalFormat,
1947
+ IsNullOrUndefined,
1948
+ removeDoubleSlashes,
1949
+ QtiFeedback,
1950
+ QtiRuleElement,
1951
+ ScoringHelper
1952
+ };
1953
+ /*! Bundled license information:
1954
+
1955
+ @lit/context/lib/context-request-event.js:
1956
+ @lit/context/lib/create-context.js:
1957
+ @lit/context/lib/controllers/context-consumer.js:
1958
+ @lit/context/lib/value-notifier.js:
1959
+ @lit/context/lib/controllers/context-provider.js:
1960
+ @lit/context/lib/context-root.js:
1961
+ @lit/reactive-element/node/decorators/query-assigned-elements.js:
1962
+ (**
1963
+ * @license
1964
+ * Copyright 2021 Google LLC
1965
+ * SPDX-License-Identifier: BSD-3-Clause
1966
+ *)
1967
+
1968
+ @lit/context/lib/decorators/provide.js:
1969
+ @lit/reactive-element/node/decorators/custom-element.js:
1970
+ @lit/reactive-element/node/decorators/property.js:
1971
+ @lit/reactive-element/node/decorators/state.js:
1972
+ @lit/reactive-element/node/decorators/event-options.js:
1973
+ @lit/reactive-element/node/decorators/base.js:
1974
+ @lit/reactive-element/node/decorators/query.js:
1975
+ @lit/reactive-element/node/decorators/query-all.js:
1976
+ @lit/reactive-element/node/decorators/query-async.js:
1977
+ @lit/reactive-element/node/decorators/query-assigned-nodes.js:
1978
+ lit-html/node/lit-html.js:
1979
+ lit-element/lit-element.js:
1980
+ (**
1981
+ * @license
1982
+ * Copyright 2017 Google LLC
1983
+ * SPDX-License-Identifier: BSD-3-Clause
1984
+ *)
1985
+
1986
+ @lit/context/lib/decorators/consume.js:
1987
+ lit-html/node/is-server.js:
1988
+ (**
1989
+ * @license
1990
+ * Copyright 2022 Google LLC
1991
+ * SPDX-License-Identifier: BSD-3-Clause
1992
+ *)
1993
+
1994
+ @lit-labs/ssr-dom-shim/lib/element-internals.js:
1995
+ @lit-labs/ssr-dom-shim/lib/events.js:
1996
+ (**
1997
+ * @license
1998
+ * Copyright 2023 Google LLC
1999
+ * SPDX-License-Identifier: BSD-3-Clause
2000
+ *)
2001
+
2002
+ @lit-labs/ssr-dom-shim/index.js:
2003
+ @lit/reactive-element/node/css-tag.js:
2004
+ (**
2005
+ * @license
2006
+ * Copyright 2019 Google LLC
2007
+ * SPDX-License-Identifier: BSD-3-Clause
2008
+ *)
2009
+ */
2010
+ //# sourceMappingURL=chunk-JEUY3MYB.js.map