@pie-players/pie-assessment-toolkit 1.0.0-beta.7 → 1.0.0-beta.9

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 (46) hide show
  1. package/custom-elements.json +7 -0
  2. package/dist/components/ItemScope.custom-element.js +1 -1
  3. package/dist/components/ItemToolBar.custom-element.js +1 -1
  4. package/dist/components/PieAssessmentToolkit.custom-element.js +7 -7
  5. package/dist/components/SectionToolBar.custom-element.js +1 -1
  6. package/dist/components/chunks/ItemToolBar-bsww9e8f.js +4 -0
  7. package/dist/components/chunks/ItemToolBar-eg8jarh0.js +2 -0
  8. package/dist/components/chunks/{ItemToolBar-pxan157g.js → ItemToolBar-gsb96731.js} +2 -2
  9. package/dist/components/chunks/ItemToolBar-na4e5vwt.js +2 -0
  10. package/dist/components/chunks/{ItemToolBar-xwjrpdmz.js → ItemToolBar-wcw4yxjy.js} +1 -1
  11. package/dist/components/chunks/ItemToolBar-zvy0hskj.js +40 -0
  12. package/dist/components/chunks/sre-engine-wazxma67.js +1 -0
  13. package/dist/index.d.ts +2 -2
  14. package/dist/index.js +1 -1
  15. package/dist/runtime/SectionControllerBinding.d.ts +16 -5
  16. package/dist/runtime/SectionControllerBinding.js +14 -6
  17. package/dist/runtime/registration-events.d.ts +31 -4
  18. package/dist/runtime/registration-events.js +20 -1
  19. package/dist/runtime/shell-event-bridge.d.ts +7 -1
  20. package/dist/runtime/shell-event-bridge.js +44 -1
  21. package/dist/runtime/shell-scope.d.ts +2 -2
  22. package/dist/runtime/shell-scope.js +14 -5
  23. package/dist/services/SSMLExtractor.js +8 -23
  24. package/dist/services/ToolRegistry.d.ts +11 -3
  25. package/dist/services/ToolRegistry.js +8 -4
  26. package/dist/services/ToolkitCoordinator.d.ts +12 -47
  27. package/dist/services/ToolkitCoordinator.js +45 -284
  28. package/dist/services/section-controller-types.d.ts +71 -20
  29. package/dist/services/tool-config-validation.d.ts +1 -1
  30. package/dist/services/tool-context.js +94 -11
  31. package/dist/services/tool-icons.js +2 -0
  32. package/dist/services/tool-provider-defaults.d.ts +13 -0
  33. package/dist/services/tool-provider-defaults.js +20 -0
  34. package/dist/services/tts/browser-provider.js +3 -1
  35. package/dist/services/tts/tts-lifecycle.d.ts +142 -0
  36. package/dist/services/tts/tts-lifecycle.js +341 -0
  37. package/dist/tools/content-surfaces.d.ts +35 -0
  38. package/dist/tools/content-surfaces.js +35 -0
  39. package/dist/tools/registration.d.ts +2 -0
  40. package/dist/tools/registration.js +5 -0
  41. package/package.json +8 -8
  42. package/dist/components/chunks/ItemToolBar-4vq9nbxz.js +0 -2
  43. package/dist/components/chunks/ItemToolBar-f971t0cw.js +0 -4
  44. package/dist/components/chunks/ItemToolBar-n05xjkp8.js +0 -2
  45. package/dist/components/chunks/ItemToolBar-rgmvw9sm.js +0 -40
  46. package/dist/components/chunks/sre-engine-dq0w45fv.js +0 -1
@@ -0,0 +1,341 @@
1
+ /**
2
+ * The text-to-speech lifecycle of a `ToolkitCoordinator`: initialization from
3
+ * the tool config, readiness, reconfiguration, and the missing-provider report.
4
+ *
5
+ * This module is the one place in the toolkit's coordination layer allowed to
6
+ * name the read-aloud capability, the same way `services/tts/**` already is:
7
+ * the coordinator stays capability-agnostic — it hands this lifecycle the
8
+ * services it needs through `TtsLifecycleHost` and answers only generic
9
+ * questions (`ownsTool`, `isStarted`) about it — and
10
+ * `check-capability-neutrality` holds the coordinator to that, with one
11
+ * documented allowance for its public `textToSpeech`-typed config accessors.
12
+ *
13
+ * Behavior is moved, not redesigned: each method here was a private
14
+ * `ToolkitCoordinator` member, and the host adapters bind the same calls the
15
+ * members made.
16
+ */
17
+ import { BrowserTTSProvider, browserFallbackConfig, } from "./browser-provider.js";
18
+ import { buildRuntimeTTSConfig, resolveTTSBackend, resolveTTSRuntimeSettings, } from "../tts-runtime-config.js";
19
+ /** The tool id the read-aloud capability registers under. */
20
+ export const TTS_TOOL_ID = "textToSpeech";
21
+ /** The read-aloud-specific merge in a generic tool-config update. */
22
+ export function deepMergeMathSpeech(toolId, current, updates) {
23
+ if (toolId !== TTS_TOOL_ID ||
24
+ !isPlainRecord(current.mathSpeech) ||
25
+ !isPlainRecord(updates.mathSpeech)) {
26
+ return undefined;
27
+ }
28
+ return { ...current.mathSpeech, ...updates.mathSpeech };
29
+ }
30
+ function isPlainRecord(value) {
31
+ return (typeof value === "object" && value !== null && !Array.isArray(value));
32
+ }
33
+ export class TtsLifecycle {
34
+ host;
35
+ initialized = false;
36
+ /** Text-to-speech failed to start and policy does not grant it. */
37
+ degraded = false;
38
+ initPromise;
39
+ reconfigurePromise;
40
+ /**
41
+ * Whether {@link TtsLifecycle.initializeIfNeeded} has already reported a
42
+ * non-browser backend falling back to browser speech because no
43
+ * text-to-speech provider is registered. Once per coordinator: a
44
+ * text-to-speech config change re-runs initialization, and the missing
45
+ * provider is the same gap each time.
46
+ */
47
+ reportedMissingProvider = false;
48
+ /**
49
+ * The backend of a fallback missing-provider report held back while the
50
+ * registry was unsettled, reported if the bound toolkit has no registry.
51
+ */
52
+ heldMissingProviderBackend = null;
53
+ constructor(host) {
54
+ this.host = host;
55
+ }
56
+ get started() {
57
+ return this.initialized;
58
+ }
59
+ get failedUngranted() {
60
+ return this.degraded;
61
+ }
62
+ /** Whether `toolId` is the tool this lifecycle brings up. */
63
+ ownsTool(toolId) {
64
+ return toolId === TTS_TOOL_ID;
65
+ }
66
+ /** Whether initialization or a reconfiguration is in flight. */
67
+ isStarted() {
68
+ return (this.initialized ||
69
+ this.initPromise !== undefined ||
70
+ this.reconfigurePromise !== undefined);
71
+ }
72
+ /** The in-flight initialization and reconfiguration, for disposal flushes. */
73
+ flushInitPromises(pending) {
74
+ if (this.initPromise)
75
+ pending.add(this.initPromise);
76
+ if (this.reconfigurePromise)
77
+ pending.add(this.reconfigurePromise);
78
+ }
79
+ /**
80
+ * The runtime `mathSpeech` provider options for the current tool config, as
81
+ * the TTS service's math-speech source reads them.
82
+ */
83
+ mathSpeechRuntimeOptions() {
84
+ return buildRuntimeTTSConfig(resolveTTSRuntimeSettings(this.resolveToolConfig())).providerOptions?.mathSpeech;
85
+ }
86
+ /**
87
+ * Initialize the TTS service from the `textToSpeech` tool config.
88
+ */
89
+ async ensureReady() {
90
+ this.host.assertNotDisposed();
91
+ await this.waitForPendingReconfigure();
92
+ this.host.assertNotDisposed();
93
+ if (this.initialized)
94
+ return;
95
+ if (this.initPromise)
96
+ return this.initPromise;
97
+ this.initPromise = this.initializeIfNeeded()
98
+ .then(() => this.host.assertNotDisposed())
99
+ .finally(() => {
100
+ this.initPromise = undefined;
101
+ this.host.notifyReadyChange();
102
+ });
103
+ return this.initPromise;
104
+ }
105
+ waitForPendingReconfigure() {
106
+ let pending = this.reconfigurePromise;
107
+ const wait = async () => {
108
+ while (pending) {
109
+ await pending;
110
+ pending = this.reconfigurePromise;
111
+ }
112
+ };
113
+ return wait();
114
+ }
115
+ async initializeIfNeeded() {
116
+ if (this.initialized)
117
+ return;
118
+ const resolvedToolConfig = this.resolveToolConfig();
119
+ const runtimeSettings = resolveTTSRuntimeSettings(resolvedToolConfig);
120
+ const resolvedBackend = resolveTTSBackend(runtimeSettings);
121
+ const runtimeTTSConfig = buildRuntimeTTSConfig(runtimeSettings);
122
+ await this.host.hooks.onBeforeTTSInit?.({
123
+ phase: "tts-init",
124
+ details: {
125
+ backend: resolvedBackend,
126
+ },
127
+ });
128
+ this.host.assertNotDisposed();
129
+ await this.host.emitTelemetry("pie-toolkit-tts-init-start", {
130
+ backend: resolvedBackend,
131
+ });
132
+ await this.host.emitTelemetry("pie-tool-init-start", {
133
+ toolId: TTS_TOOL_ID,
134
+ operation: "tts-init",
135
+ backend: resolvedBackend,
136
+ });
137
+ if (this.host.toolProviderRegistry.has(TTS_TOOL_ID)) {
138
+ try {
139
+ // Browser speech follows a server provider that fails to start.
140
+ const ttsProvider = await this.host.initializeProvider(TTS_TOOL_ID, true);
141
+ const providerInstance = await ttsProvider.createInstance();
142
+ await this.initializeService(providerInstance, runtimeTTSConfig);
143
+ await this.host.emitTelemetry("pie-toolkit-tts-init-success", {
144
+ provider: "registry",
145
+ });
146
+ await this.host.emitTelemetry("pie-tool-init-success", {
147
+ toolId: TTS_TOOL_ID,
148
+ operation: "tts-init",
149
+ backend: resolvedBackend,
150
+ provider: "registry",
151
+ });
152
+ return;
153
+ }
154
+ catch (error) {
155
+ if (this.host.isDisposalError(error))
156
+ throw error;
157
+ const normalized = error instanceof Error ? error : new Error(String(error));
158
+ await this.host.emitTelemetry("pie-tool-init-fallback", {
159
+ toolId: TTS_TOOL_ID,
160
+ operation: "tts-init",
161
+ backend: resolvedBackend,
162
+ fromProvider: "registry",
163
+ toProvider: "browser",
164
+ reason: normalized.message,
165
+ });
166
+ console.warn("[ToolkitCoordinator] Failed to initialize TTS via registry, falling back to browser provider:", normalized);
167
+ }
168
+ }
169
+ else if (resolvedBackend !== "browser") {
170
+ this.reportMissingProvider(resolvedBackend);
171
+ }
172
+ // Browser speech, configured or standing in for a backend that has no
173
+ // provider or failed to start.
174
+ const provider = new BrowserTTSProvider();
175
+ try {
176
+ await this.initializeService(provider, resolvedBackend === "browser"
177
+ ? runtimeTTSConfig
178
+ : browserFallbackConfig(runtimeTTSConfig));
179
+ await this.host.emitTelemetry("pie-toolkit-tts-init-success", {
180
+ provider: "browser-fallback",
181
+ });
182
+ await this.host.emitTelemetry("pie-tool-init-success", {
183
+ toolId: TTS_TOOL_ID,
184
+ operation: "tts-init",
185
+ backend: resolvedBackend,
186
+ provider: "browser-fallback",
187
+ });
188
+ }
189
+ catch (error) {
190
+ if (this.host.isDisposalError(error))
191
+ throw error;
192
+ const normalized = error instanceof Error ? error : new Error(String(error));
193
+ this.host.reportStartFailure(normalized, { phase: "tts-init" }, [TTS_TOOL_ID]);
194
+ await this.host.emitTelemetry("pie-toolkit-tts-init-error", {
195
+ message: normalized.message,
196
+ });
197
+ await this.host.emitTelemetry("pie-tool-init-error", {
198
+ toolId: TTS_TOOL_ID,
199
+ operation: "tts-init",
200
+ backend: resolvedBackend,
201
+ errorType: "TTSInitError",
202
+ message: normalized.message,
203
+ });
204
+ throw normalized;
205
+ }
206
+ }
207
+ resolveToolConfig() {
208
+ const fromProviders = this.host.providersConfig()?.[TTS_TOOL_ID];
209
+ return fromProviders || {};
210
+ }
211
+ async initializeService(provider, config) {
212
+ const nextProviderOptions = {
213
+ ...config.providerOptions,
214
+ __pieTelemetry: async (eventName, payload) => {
215
+ await this.host.emitTelemetry(eventName, {
216
+ toolId: TTS_TOOL_ID,
217
+ ...(payload || {}),
218
+ });
219
+ },
220
+ };
221
+ const nextConfig = {
222
+ ...config,
223
+ providerOptions: nextProviderOptions,
224
+ };
225
+ await this.host.ttsService.initialize(provider, nextConfig);
226
+ this.host.assertNotDisposed();
227
+ this.host.ttsService.setCatalogResolver(this.host.catalogResolver);
228
+ this.initialized = true;
229
+ this.degraded = false;
230
+ this.host.clearDegradedTool(TTS_TOOL_ID);
231
+ await this.host.hooks.onTTSReady?.();
232
+ this.host.assertNotDisposed();
233
+ }
234
+ reportMissingProvider(backend) {
235
+ // The toolkit this coordinator binds to may still supply the provider.
236
+ if (this.host.isToolRegistryPending()) {
237
+ this.heldMissingProviderBackend = backend;
238
+ return;
239
+ }
240
+ if (this.reportedMissingProvider)
241
+ return;
242
+ this.reportedMissingProvider = true;
243
+ console.warn(`[ToolkitCoordinator] Text-to-speech is configured for the "${backend}" backend but falls back to browser speech: no "${TTS_TOOL_ID}" tool provider is registered. A coordinator registers tool providers only from its \`toolRegistry\`, or from its toolkit's when constructed without one, so supply one that carries the text-to-speech registration — for the packaged capability set, \`createPackagedToolRegistry()\` from "@pie-players/pie-default-tool-loaders". Reported once per coordinator.`);
244
+ }
245
+ /**
246
+ * Report a missing-provider report held back while the registry was
247
+ * unsettled, now that the registry has settled without one.
248
+ */
249
+ reportHeldMissingProvider() {
250
+ const heldBackend = this.heldMissingProviderBackend;
251
+ this.heldMissingProviderBackend = null;
252
+ if (heldBackend)
253
+ this.reportMissingProvider(heldBackend);
254
+ }
255
+ /**
256
+ * Drop a held missing-provider report without reporting it: a real registry
257
+ * settled, so the stale gap never applied.
258
+ */
259
+ discardHeldMissingProvider() {
260
+ this.heldMissingProviderBackend = null;
261
+ }
262
+ /**
263
+ * Readiness waits for text-to-speech when it is enabled and either starts
264
+ * eagerly or is granted: a granted read-aloud fails before the learner starts.
265
+ */
266
+ requiredForReadiness() {
267
+ if (this.resolveToolConfig()?.enabled === false)
268
+ return false;
269
+ return !this.host.lazyInit || this.host.isToolGranted(TTS_TOOL_ID);
270
+ }
271
+ /**
272
+ * Starts text-to-speech for readiness. A failure policy does not grant leaves
273
+ * the tool degraded, reporting itself unavailable, and readiness settles; a
274
+ * granted tool's failure rejects.
275
+ */
276
+ async startForReadiness() {
277
+ try {
278
+ await this.ensureReady();
279
+ }
280
+ catch (error) {
281
+ if (this.host.isDisposalError(error))
282
+ throw error;
283
+ if (this.host.isToolGranted(TTS_TOOL_ID))
284
+ throw error;
285
+ this.degraded = true;
286
+ this.host.notifyReadyChange();
287
+ }
288
+ }
289
+ /**
290
+ * Re-register the text-to-speech provider for the current config and registry,
291
+ * then re-initialize unless initialization is lazy. An initialization already
292
+ * running finishes first: it would otherwise mark its provider ready after the
293
+ * reset.
294
+ */
295
+ scheduleReconfigure() {
296
+ const inFlight = this.initPromise;
297
+ const reconfigurePromise = inFlight
298
+ ? inFlight.catch(() => { }).then(() => this.reconfigure())
299
+ : this.reconfigure();
300
+ this.reconfigurePromise = reconfigurePromise;
301
+ void reconfigurePromise.finally(() => {
302
+ if (this.reconfigurePromise === reconfigurePromise) {
303
+ this.reconfigurePromise = undefined;
304
+ }
305
+ });
306
+ void reconfigurePromise
307
+ .then(async () => {
308
+ if (this.host.isDisposalStarted())
309
+ return;
310
+ if (this.requiredForReadiness())
311
+ await this.startForReadiness();
312
+ })
313
+ // Reported where it failed; a granted failure has nowhere else to go.
314
+ .catch(() => { });
315
+ }
316
+ async reconfigure() {
317
+ this.initialized = false;
318
+ this.degraded = false;
319
+ this.host.clearDegradedTool(TTS_TOOL_ID);
320
+ this.initPromise = undefined;
321
+ this.host.notifyReadyChange();
322
+ try {
323
+ // The next speak waits on readiness, which starts the new provider.
324
+ this.host.ttsService.releaseProvider();
325
+ }
326
+ catch {
327
+ // noop: release best effort
328
+ }
329
+ if (this.host.toolProviderRegistry.has(TTS_TOOL_ID)) {
330
+ await this.host.toolProviderRegistry.unregister(TTS_TOOL_ID);
331
+ }
332
+ if (this.host.isDisposalStarted())
333
+ return;
334
+ const ttsRegistration = this.host
335
+ .getProviderDescriptorTools()
336
+ .find((tool) => this.ownsTool(tool.toolId));
337
+ if (!ttsRegistration)
338
+ return;
339
+ await this.host.registerProviderFromTool(ttsRegistration);
340
+ }
341
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Host surface ids a content capability can fill.
3
+ *
4
+ * A renderer opens slots in its own layout — a card's docked-media region, the
5
+ * full-width slot above its body — and a registration names the slots it can
6
+ * render into through `ToolRegistration.surfaces`. The ids live here, one
7
+ * definition for both sides of that exchange: a capability package cannot
8
+ * import a player to reach the renderer's constants, and a renderer without a
9
+ * toolbar — print — cannot import the composition layer for the packaged
10
+ * registrations', so the slot names are the toolkit's to own.
11
+ *
12
+ * The ids say nothing about geometry. How wide a slot is, where it sits, or
13
+ * that it collapses under a breakpoint is the renderer's decision; a
14
+ * registration declaring `surfaces` promises only that it can render into a
15
+ * slot with that name, whatever the renderer makes of it.
16
+ */
17
+ /**
18
+ * Host slot for media docked beside a card's content.
19
+ *
20
+ * Named for the relationship rather than for one card kind, because item cards
21
+ * and passage cards open the same slot: an alternate is authored against a
22
+ * content node, and a passage owns content nodes exactly as an item does. A
23
+ * capability declares this surface once and reaches both.
24
+ */
25
+ export declare const CONTENT_MEDIA_SURFACE = "content-media";
26
+ /**
27
+ * Host slot for a text alternate that has to be read in order with the
28
+ * content: full width, above the card body, in document flow.
29
+ *
30
+ * Separate from {@link CONTENT_MEDIA_SURFACE} because the geometry is the
31
+ * whole difference. Docked media is watched beside the content and is sized by
32
+ * an aspect ratio; a transcript or a plain-language alternate is read *before*
33
+ * the control it belongs to, which a sticky side column cannot express.
34
+ */
35
+ export declare const CONTENT_LEAD_SURFACE = "content-lead";
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Host surface ids a content capability can fill.
3
+ *
4
+ * A renderer opens slots in its own layout — a card's docked-media region, the
5
+ * full-width slot above its body — and a registration names the slots it can
6
+ * render into through `ToolRegistration.surfaces`. The ids live here, one
7
+ * definition for both sides of that exchange: a capability package cannot
8
+ * import a player to reach the renderer's constants, and a renderer without a
9
+ * toolbar — print — cannot import the composition layer for the packaged
10
+ * registrations', so the slot names are the toolkit's to own.
11
+ *
12
+ * The ids say nothing about geometry. How wide a slot is, where it sits, or
13
+ * that it collapses under a breakpoint is the renderer's decision; a
14
+ * registration declaring `surfaces` promises only that it can render into a
15
+ * slot with that name, whatever the renderer makes of it.
16
+ */
17
+ /**
18
+ * Host slot for media docked beside a card's content.
19
+ *
20
+ * Named for the relationship rather than for one card kind, because item cards
21
+ * and passage cards open the same slot: an alternate is authored against a
22
+ * content node, and a passage owns content nodes exactly as an item does. A
23
+ * capability declares this surface once and reaches both.
24
+ */
25
+ export const CONTENT_MEDIA_SURFACE = "content-media";
26
+ /**
27
+ * Host slot for a text alternate that has to be read in order with the
28
+ * content: full width, above the card body, in document flow.
29
+ *
30
+ * Separate from {@link CONTENT_MEDIA_SURFACE} because the geometry is the
31
+ * whole difference. Docked media is watched beside the content and is sized by
32
+ * an aspect ratio; a transcript or a plain-language alternate is read *before*
33
+ * the control it belongs to, which a sticky side column cannot express.
34
+ */
35
+ export const CONTENT_LEAD_SURFACE = "content-lead";
@@ -30,6 +30,7 @@ export type { ToolSelectionAction, ToolSelectionContext, } from "../services/sel
30
30
  export { resolveFallbackToolIcon } from "../services/tool-icons.js";
31
31
  export type { ContentCapabilityPhase, ContentCapabilityPolicy, ResolveContentCapabilitiesArgs, ResolvedContentCapability, } from "./content-capability-resolution.js";
32
32
  export { resolveContentCapabilities } from "./content-capability-resolution.js";
33
+ export { CONTENT_LEAD_SURFACE, CONTENT_MEDIA_SURFACE, } from "./content-surfaces.js";
33
34
  export type { ToolSurfaceHost, ToolSurfaceHostInput, ToolSurfaceHostOptions, ToolSurfaceHostSnapshot, ToolSurfaceScope, } from "./tool-surface-host.js";
34
35
  export { createToolSurfaceHost } from "./tool-surface-host.js";
35
36
  export type { ElementSupports, ToolContext, } from "../services/tool-context.js";
@@ -50,6 +51,7 @@ export { findShellScopeHost, resolveContentRegion, } from "../runtime/content-re
50
51
  export { composedClosest, composedContains, flatTextContent, isShadowRootNode, retargetToTree, } from "../services/tts/flat-tree.js";
51
52
  export type { ToolPlacementLevel } from "../services/tools-config-normalizer.js";
52
53
  export type { CalculatorToolProviderConfig, TextToSpeechToolProviderConfig, ToolProviderConfig, } from "../services/tools-config-normalizer.js";
54
+ export type { ToolConfigDiagnostic, ToolConfigDiagnosticSeverity, } from "../services/tool-config-validation.js";
53
55
  export type { ToolProviderApi } from "../services/tool-providers/ToolProviderApi.js";
54
56
  export { TTSToolProvider } from "../services/tool-providers/index.js";
55
57
  export type { NormalizedTTSSpeedOption, TTSLayoutMode, TTSSpeedOption, } from "../services/tts-runtime-config.js";
@@ -29,6 +29,11 @@ export { reportToolFailure } from "../services/tool-failure.js";
29
29
  // So a gateway button and the toolbar button for the same tool draw one icon.
30
30
  export { resolveFallbackToolIcon } from "../services/tool-icons.js";
31
31
  export { resolveContentCapabilities } from "./content-capability-resolution.js";
32
+ // The surface ids a registration declares in `surfaces` and a renderer opens in
33
+ // its own layout, one definition for both sides: a capability package cannot
34
+ // import a player, and a renderer with no coordinator — print — cannot import
35
+ // the composition layer for the packaged registrations'.
36
+ export { CONTENT_LEAD_SURFACE, CONTENT_MEDIA_SURFACE, } from "./content-surfaces.js";
32
37
  export { createToolSurfaceHost } from "./tool-surface-host.js";
33
38
  export { elementSupports, hasMathContent, hasReadableText, hasSpokenContent, hasScienceContent, } from "../services/tool-context.js";
34
39
  export { createScopedToolId, parseScopedToolId, } from "../services/tool-instance-id.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-players/pie-assessment-toolkit",
3
- "version": "1.0.0-beta.7",
3
+ "version": "1.0.0-beta.9",
4
4
  "type": "module",
5
5
  "description": "PIE assessment toolkit: composable services + reference implementation for assessment players and tool coordination",
6
6
  "license": "MIT",
@@ -69,17 +69,17 @@
69
69
  "test": "bun test"
70
70
  },
71
71
  "dependencies": {
72
- "@pie-players/pie-calculator": "1.0.0-beta.7",
73
- "@pie-players/pie-context": "1.0.0-beta.7",
74
- "@pie-players/pie-players-shared": "1.0.0-beta.7",
75
- "@pie-players/pie-tts": "1.0.0-beta.7",
72
+ "@pie-players/pie-calculator": "1.0.0-beta.9",
73
+ "@pie-players/pie-context": "1.0.0-beta.9",
74
+ "@pie-players/pie-players-shared": "1.0.0-beta.9",
75
+ "@pie-players/pie-tts": "1.0.0-beta.9",
76
76
  "speech-rule-engine": "5.0.0-rc.4"
77
77
  },
78
78
  "devDependencies": {
79
- "@biomejs/biome": "^2.6.2",
79
+ "@biomejs/biome": "^2.6.4",
80
80
  "@happy-dom/global-registrator": "^21.0.4",
81
- "@pie-players/tts-client-server": "1.0.0-beta.7",
82
- "svelte": "^5.57.2",
81
+ "@pie-players/tts-client-server": "1.0.0-beta.9",
82
+ "svelte": "^5.57.3",
83
83
  "svelte-check": "^4.7.6",
84
84
  "typescript": "^5.9.3"
85
85
  },
@@ -1,2 +0,0 @@
1
- import{ContextProvider as z,FEATURE_DECISION_APPLIED_EVENT as q,itemFeatureDecisionsContext as B}from"@pie-players/pie-context";var J=["autoplayAudio"],I=Object.freeze({features:Object.freeze({})});function K(E){let R=E.canonicalItemId||E.itemId;return{level:"item",scopeId:R,itemId:E.itemId,canonicalItemId:R}}function P(E,R){if(!R||typeof E?.decideFeaturePolicy!=="function")return I;let V={};for(let _ of J){let N=E.decideFeaturePolicy(_,R);if(N.rule==="none")continue;V[_]={granted:N.granted,rule:N.rule}}return{features:V}}function Y(E){let R=new z(E,{context:B,initialValue:I});R.connect();let V=JSON.stringify(I.features),_=null,N=null,A=null,G=()=>{let T=P(_,N),M=JSON.stringify(T.features);if(M===V)return;V=M,R.setValue(T)},L=()=>{let T=A;A=null;try{T?.()}catch{}},j=(T)=>{let M=T.detail;if(!M||!N)return;_?.reportFeatureDecisionApplied?.(M,N)};return E.addEventListener(q,j),{setCoordinator(T){if(T===_)return;if(L(),_=T,T&&typeof T.onPolicyChange==="function")A=T.onPolicyChange((M)=>{if(M.reason==="disposed")L(),_=null;G()});G()},setItem(T){let M=T?.itemId?K(T):null;if(M?.scopeId===N?.scopeId&&M?.itemId===N?.itemId)return;N=M,G()},disconnect(){E.removeEventListener(q,j),L(),_=null,N=null,R.disconnect()}}}var $="pie-register",b="pie-unregister",U="pie-item-session-changed",k="item-session-changed",O="pie-content-loaded",m="pie-item-player-error",S="pie-formative-action",D="pie-media-time-source";var H=(E)=>Array.isArray(E)&&E.length>0;function Q(E){if(E.kind==="passage")return{ownerKind:"passage",assessmentId:E.assessmentId,sectionId:E.sectionId,passageId:E.canonicalItemId||E.itemId};return{ownerKind:"itemModel",assessmentId:E.assessmentId,sectionId:E.sectionId,itemId:E.itemId,canonicalItemId:E.canonicalItemId||E.itemId}}function W(E,R){if(!E)return[];let V=Q(R),_=[];if(H(E.accessibilityCatalogs))_.push({context:V,catalogs:E.accessibilityCatalogs});if(H(E.config?.extractedCatalogs))_.push({context:V,catalogs:E.config.extractedCatalogs});if(R.kind==="passage")return _;if(V.ownerKind!=="itemModel")return _;for(let N of E.config?.models??[]){if(!H(N.accessibilityCatalogs))continue;_.push({context:{...V,modelId:N.id},catalogs:N.accessibilityCatalogs})}return _}function C(E,R){let V=W(E,{kind:R,itemId:""});try{return JSON.stringify(V.map((_)=>[_.context.modelId??null,_.catalogs]))}catch{return null}}
2
- export{J as a,Y as b,$ as c,b as d,U as e,k as f,O as g,m as h,S as i,D as j,Q as k,W as l,C as m};
@@ -1,4 +0,0 @@
1
- var y9="5";if(typeof window<"u")((window.__svelte??={}).v??=new Set).add(y9);var r7=Array.isArray,g9=Array.prototype.indexOf,JQ=Array.prototype.includes,RQ=Array.from,uQ=Object.keys,U7=Object.defineProperty,P7=Object.getOwnPropertyDescriptor,X0=Object.getOwnPropertyDescriptors,g0=Object.prototype,h9=Array.prototype,UQ=Object.getPrototypeOf,h0=Object.isExtensible;var m7=()=>{};function Z0(Q){for(var J=0;J<Q.length;J++)Q[J]()}function z0(){var Q,J,W=new Promise((K,X)=>{Q=K,J=X});return{promise:W,resolve:Q,reject:J}}var y=2,u7=4,WQ=8,PQ=16777216,n=16,o=32,H7=64,jQ=128,G0=256,z7=512,x=1024,R=2048,m=4096,d=8192,E=16384,G7=32768,p7=33554432,B7=65536,HQ=131072,v0=262144,f7=524288,v9=1048576,E7=33554432,pQ=2097152,R7=4194304,j7=8388608,V7=Symbol("$state"),V0=Symbol("component"),fQ=Symbol("legacy props"),m9=Symbol(""),m0=Symbol("proxy path"),q0=Symbol("attributes"),dQ=Symbol("class"),u0=Symbol("style"),_Q=Symbol("text"),p0=Symbol("form reset"),u9=Symbol("hmr anchor"),a7=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},f0=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");var TQ=3,w7=8;var p9=1,f9=2,d0=4,d9=8,_9=16,l9=1,i9=2,c9=4,o9=8,s9=16;var r9=1,a9=2;var xQ="[",KQ="[!",_0="[?",BQ="]",Y7={};var k=Symbol("uninitialized"),k7=Symbol("filename"),n9=Symbol("hmr"),$0="http://www.w3.org/1999/xhtml",lQ="http://www.w3.org/2000/svg",l0="http://www.w3.org/1998/Math/MathML";function t9(){console.warn("https://svelte.dev/e/derived_inert")}function e9(Q,J,W){console.warn("https://svelte.dev/e/hydration_attribute_changed")}function XQ(Q){console.warn("https://svelte.dev/e/hydration_mismatch")}function QJ(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function JJ(Q){var J=L;if(J===null)return O.f|=j7,Q;if((J.f&G7)===0&&(J.f&u7)===0)throw Q;M7(Q,J)}function M7(Q,J){if(Q===Y7)throw Q;if(J!==null&&(J.f&E)!==0)return;while(J!==null){if((J.f&jQ)!==0&&(J.f&(E|p7))===0){if((J.f&G7)===0)throw Q;try{J.b.error(Q);return}catch(W){Q=W}}J=J.parent}throw Q}function KJ(){throw Error("https://svelte.dev/e/async_derived_orphan")}function XJ(Q,J,W){throw Error("https://svelte.dev/e/each_key_duplicate")}function ZJ(Q){throw Error("https://svelte.dev/e/effect_in_teardown")}function zJ(){throw Error("https://svelte.dev/e/effect_in_unowned_derived")}function GJ(Q){throw Error("https://svelte.dev/e/effect_orphan")}function VJ(){throw Error("https://svelte.dev/e/effect_update_depth_exceeded")}function qJ(){throw Error("https://svelte.dev/e/hydration_failed")}function $J(Q){throw Error("https://svelte.dev/e/props_invalid_value")}function UJ(){throw Error("https://svelte.dev/e/state_descriptors_fixed")}function PJ(){throw Error("https://svelte.dev/e/state_prototype_fixed")}function HJ(){throw Error("https://svelte.dev/e/state_unsafe_mutation")}function BJ(){throw Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var Q7=!1,ZQ=!1;var C=null;function n7(Q){C=Q}function i0(Q,J=!1,W){C={p:C,i:!1,c:null,e:null,s:Q,x:null,r:L,l:ZQ&&!J?{s:null,u:null,$:[]}:null}}function c0(Q){var J=C,W=J.e;if(W!==null){J.e=null;for(var K of W)o0(K)}if(Q!==void 0)J.x=Q;return J.i=!0,C=J.p,iQ(Q)}function iQ(Q={}){return U7(Q,V0,{value:!0}),Q}function b7(){return!ZQ||C!==null&&C.l===null}var YQ=[];function MJ(){var Q=YQ;YQ=[],Z0(Q)}function s(Q){if(YQ.length===0&&!MQ){var J=YQ;queueMicrotask(()=>{if(J===YQ)MJ()})}YQ.push(Q)}function LJ(){while(YQ.length>0)MJ()}function P0(Q){return Q===this.v}function H0(Q,J){return Q!=Q?J==J:Q!==J||Q!==null&&typeof Q==="object"||typeof Q==="function"}function B0(Q){return!H0(Q,this.v)}function LQ(Q,J){return Q.label=J,s0(Q.v,J),Q}function s0(Q,J){return Q?.[m0]?.(J),Q}function y7(Q){var J=O,W=L;u(null),_(null);try{return Q()}finally{u(J),_(W)}}function L0(Q,J,W,K){let X=b7()?GQ:FQ;var Z=Q.filter((q)=>!q.settled),z=J.map(X);if(W.length===0&&Z.length===0){K(z);return}var G=L,V=OJ(),H=Z.length===1?Z[0].promise:Z.length>1?Promise.all(Z.map((q)=>q.promise)):null;function U(q){if((G.f&E)!==0)return;V();try{K([...z,...q])}catch(Y){M7(Y,G)}EQ()}var $=r0();if(W.length===0){H.then(()=>U([])).finally($);return}function P(){Promise.all(W.map((q)=>a0(q))).then(U).catch((q)=>M7(q,G)).finally($)}if(H)H.then(()=>{if((G.f&E)!==0){$();return}V(),P(),EQ()});else P()}function OJ(){var Q=L,J=O,W=C,K=S;if(!1)var X;return function(z=!0){if(_(Q),u(J),n7(W),z&&(Q.f&E)===0)K?.activate(),K?.apply()}}var A4=!1;function EQ(Q=!0){if(A4=!1,_(null),u(null),n7(null),Q)S?.deactivate()}function r0(){var Q=L,J=Q.b,W=S,K=!!J?.is_rendered();return J?.update_pending_count(1,W),W.increment(K,Q),()=>{J?.update_pending_count(-1,W),W.decrement(K,Q)}}var j4=~(R|m|x);function T(Q,J){Q.f=Q.f&j4|J}function kQ(Q){if((Q.f&z7)!==0||Q.deps===null)T(Q,x);else T(Q,m)}function GQ(Q){var J=y|R;if(L!==null)L.f|=f7;return{ctx:C,deps:null,effects:null,equals:P0,f:J,fn:Q,reactions:null,rv:0,v:k,wv:0,parent:L,ac:null}}var bQ=Symbol("obsolete");function a0(Q,J,W){let K=L;if(K===null)KJ();var X=void 0,Z=K7(k),z=!O,G=new Set;return wJ(()=>{var V=L,H=z0();X=H.promise;try{Promise.resolve(Q()).then(H.resolve,(q)=>{if(q!==a7)H.reject(q)}).finally(EQ)}catch(q){H.reject(q),EQ()}var U=S;if(z){if((V.f&G7)!==0)var $=r0();if(K.b?.is_rendered())U.async_deriveds.get(V)?.reject(bQ);else for(let q of G.values())q.reject(bQ);G.add(H),U.async_deriveds.set(V,H)}let P=(q,Y=void 0)=>{if($?.(),G.delete(H),Y===bQ)return;if(U.activate(),Y)Z.f|=j7,g7(Z,Y);else{if((Z.f&j7)!==0)Z.f^=j7;g7(Z,q)}U.deactivate()};H.promise.then(P,(q)=>P(null,q||"unknown"))}),W7(()=>{for(let V of G)V.reject(bQ)}),new Promise((V)=>{function H(U){function $(){if(U===X)V(Z);else H(X)}U.then($,$)}H(X)})}function T4(Q){let J=GQ(Q);if(!Q7)O0(J);return J}function FQ(Q){let J=GQ(Q);return J.equals=B0,J}function x4(Q){var J=Q.effects;if(J!==null){Q.effects=null;for(var W=0;W<J.length;W+=1)h(J[W])}}function oQ(Q){var J,W=L,K=Q.parent;if(!S7&&K!==null&&Q.v!==k&&(K.f&(E|d))!==0)return t9(),Q.v;_(K);try{x4(Q),J=Q9(Q)}finally{_(W)}return J}function t0(Q){var J=oQ(Q);if(!Q.equals(J)){if(Q.wv=aQ(),!S?.is_fork||Q.deps===null){if(S!==null)S.capture(Q,J,!0),d7?.capture(Q,J,!0);else Q.v=J;if(Q.deps===null){T(Q,x);return}}}if(S7)return;if(r!==null){if(zQ()||S?.is_fork)r.set(Q,J)}else kQ(Q)}function DJ(Q){if(Q.effects===null)return;for(let J of Q.effects)if(J.teardown||J.ac){if(J.teardown?.(),J.ac!==null)y7(()=>{J.ac.abort(a7),J.ac=null});if(J.fn!==null)J.teardown=m7;OQ(J,0),rQ(J)}}function e0(Q){if(Q.effects===null)return;for(let J of Q.effects)if(J.teardown&&J.fn!==null)_7(J)}var sQ=new Set,T7=new Map;var SJ=!1;function K7(Q,J){var W={f:0,v:Q,reactions:null,equals:P0,rv:0,wv:0};return W}function l7(Q,J){let W=K7(Q,J);return O0(W),W}function wQ(Q,J=!1,W=!0){let K=K7(Q);if(!J)K.equals=B0;if(ZQ&&W&&C!==null&&C.l!==null)(C.l.s??=[]).push(K);return K}function X7(Q,J,W=!1){if(O!==null&&(!I7||(O.f&HQ)!==0)&&b7()&&(O.f&(y|n|R7|HQ))!==0&&(h7===null||!h7.has(Q)))HJ();let K=W?t7(J):J;return g7(Q,K,nQ)}var DQ=null,J9=0;function g7(Q,J,W=null){if(!Q.equals(J)){if(S7)T7.set(Q,J);else if(!T7.has(Q))T7.set(Q,Q.v);var K=J7.ensure();if(K.capture(Q,J),(Q.f&y)!==0){let X=Q;if((Q.f&R)!==0)oQ(X);if(r===null)kQ(X)}if(Q.wv=aQ(),DQ=null,J9=0,CJ(Q,R,W),DQ=null,b7()&&L!==null&&(L.f&x)!==0&&(L.f&(o|H7))===0)if(C7===null)IJ([Q]);else C7.push(Q);if(!K.is_fork&&sQ.size>0&&!SJ)W9()}return J}function W9(){SJ=!1;for(let Q of sQ){if((Q.f&x)!==0)T(Q,m);let J;try{J=VQ(Q)}catch{J=!0}if(J)_7(Q)}sQ.clear()}function SQ(Q){X7(Q,Q.v+1)}function CJ(Q,J,W){var K=Q.reactions;if(K===null)return;var X=b7(),Z=K.length;if(J9+=Z,J9>1e5&&DQ===null)DQ=new Set;if(DQ!==null){if(DQ.has(Q))return;DQ.add(Q)}for(var z=0;z<Z;z++){var G=K[z],V=G.f;if(!X&&G===L)continue;var H=(V&R)===0;if(H)T(G,J);if((V&HQ)!==0)sQ.add(G);else if((V&y)!==0){var U=G;r?.delete(U),CJ(U,m,W)}else if(H){var $=G;if((V&n)!==0&&x7!==null)x7.add($);if(W!==null)W.push($);else tQ($)}}}function D0(Q,J,W){if((Q.f&R)!==0)J.add(Q);else if((Q.f&m)!==0)W.add(Q);T(Q,x)}var w0=null,yQ=null,S=null,d7=null,r=null,X9=null,MQ=!1,K9=!1,gQ=null,nQ=null,AJ=0;var b4=1;class J7{id=b4++;#Q=!1;linked=!0;#J=null;#W=null;async_deriveds=new Map;current=new Map;previous=new Map;#G=new Set;#X=new Set;#z=0;#K=new Map;#V=null;#Z=[];#M=[];#q=new Set;#$=new Set;#P=new Map;#L=new Set;is_fork=!1;#U=!1;constructor(){if(yQ===null)w0=yQ=this;else yQ.#W=this,this.#J=yQ;yQ=this}#w(){if(this.is_fork)return!0;for(let W of this.#K.keys()){var Q=W,J=!1;while(Q.parent!==null){if(this.#P.has(Q)){J=!0;break}Q=Q.parent}if(!J)return!0}return!1}skip_effect(Q){if(!this.#P.has(Q))this.#P.set(Q,{d:[],m:[]});this.#L.delete(Q)}unskip_effect(Q,J=(W)=>this.schedule(W)){var W=this.#P.get(Q);if(W){this.#P.delete(Q);for(var K of W.d)T(K,R),J(K);for(K of W.m)T(K,m),J(K)}this.#L.add(Q)}#S(){var Q=[];for(let X of this.#Z){if((X.f&E)!==0||(X.f&(R|m))===0)continue;var J=X,W=!1;while(J.parent!==null){J=J.parent;var K=J.f;if((K&(H7|o))!==0){if((K&x)===0){W=!0;break}J.f^=x}}if(!W)Q.push(J)}return this.#Z=[],Q}#F(){this.#Q=!0;for(let z of this.#q)this.#$.delete(z),T(z,R),this.schedule(z);for(let z of this.#$)T(z,m),this.schedule(z);this.apply();var Q=gQ=[],J=[],W=nQ=[];while(this.#Z.length>0){if(AJ++>1000)this.#Y(),y4();for(let z of this.#S())try{this.#D(z,Q,J)}catch(G){if(TJ(z),!this.#w())this.discard();throw G}}if(S=null,W.length>0){var K=J7.ensure();for(let z of W)K.schedule(z)}if(gQ=null,nQ=null,this.#w()){this.#B(J),this.#B(Q);for(let[z,G]of this.#P)jJ(z,G);if(W.length>0)S.#F();return}let X=this.#H();if(X){this.#B(J),this.#B(Q),X.#C(this);return}this.#q.clear(),this.#$.clear();for(let z of this.#G)z(this);this.#G.clear(),d7=this,NJ(J),NJ(Q),d7=null,this.#V?.resolve();var Z=S;if(this.#z===0&&(this.#Z.length===0||Z!==null)){if(this.#Y(),Q7)this.#O(),S=Z}if(this.#Z.length>0)if(Z!==null){for(let z of this.#Z)Z.#Z.push(z);this.#Z=[]}else Z=this;if(Z!==null)T7.clear(),Z.#F()}#D(Q,J,W){Q.f^=x;var K=Q.first;while(K!==null){var X=K.f,Z=(X&(o|H7))!==0,z=Z&&(X&x)!==0,G=z||(X&d)!==0||this.#P.has(K);if(!G&&K.fn!==null){if(Z)K.f^=x;else if((X&u7)!==0)J.push(K);else if(Q7&&(X&(WQ|PQ))!==0)W.push(K);else if(VQ(K)){if((X&n)!==0)this.#$.add(K);_7(K)}var V=K.first;if(V!==null){K=V;continue}}while(K!==null){var H=K.next;if(H!==null){K=H;break}K=K.parent}}}#H(){var Q=this.#J;while(Q!==null){if(!Q.is_fork){for(let[J,[,W]]of this.current)if(Q.current.has(J)&&!W)return Q}Q=Q.#J}return null}#C(Q){for(let[W,K]of Q.current){if(!this.previous.has(W)&&Q.previous.has(W))this.previous.set(W,Q.previous.get(W));this.current.set(W,K)}for(let[W,K]of Q.async_deriveds){let X=this.async_deriveds.get(W);if(X)K.promise.then(X.resolve).catch(X.reject)}Q.async_deriveds.clear(),this.transfer_effects(Q.#q,Q.#$);let J=(W)=>{var K=W.reactions;if(K===null)return;if((W.f&y)!==0&&(W.f&(R|m))===0)return;for(let z of K){var X=z.f;if((X&y)!==0)J(z);else{var Z=z;if(X&(R7|n)&&!this.async_deriveds.has(Z))this.#$.delete(Z),T(Z,R),this.schedule(Z)}}};for(let W of this.current.keys())J(W);this.oncommit(()=>Q.discard()),Q.#Y(),S=this,this.#F()}#B(Q){for(var J=0;J<Q.length;J+=1)D0(Q[J],this.#q,this.#$)}capture(Q,J,W=!1){if(Q.v!==k&&!this.previous.has(Q))this.previous.set(Q,Q.v);if((Q.f&j7)===0)this.current.set(Q,[J,W]),r?.set(Q,J);if(!this.is_fork)Q.v=J}activate(){S=this}deactivate(){S=null,r=null}flush(){try{K9=!0,S=this,this.#F()}finally{AJ=0,X9=null,gQ=null,nQ=null,K9=!1,S=null,r=null,T7.clear()}}discard(){for(let Q of this.#X)Q(this);this.#X.clear();for(let Q of this.async_deriveds.values())Q.reject(bQ);this.#Y(),this.#V?.resolve()}register_created_effect(Q){this.#M.push(Q)}#O(){for(let U=w0;U!==null;U=U.#W){var Q=U.id<this.id,J=[];for(let[$,[P,q]]of this.current){if(U.current.has($)){var W=U.current.get($)[0];if(Q&&P!==W)U.current.set($,[P,q]);else continue}J.push($)}if(Q)for(let[$,P]of this.async_deriveds){let q=U.async_deriveds.get($);if(q)P.promise.then(q.resolve).catch(q.reject)}var K=[...U.current.keys()].filter(($)=>!U.current.get($)[1]);if(!U.#Q||K.length===0)continue;var X=K.filter(($)=>!this.current.has($));if(X.length===0){if(Q)U.discard()}else if(J.length>0){if(Q)for(let $ of this.#L)U.unskip_effect($,(P)=>{if((P.f&(n|R7))!==0)U.schedule(P);else U.#B([P])});U.activate();var Z=new Set,z=new Map;for(var G of J)RJ(G,X,Z,z);z=new Map;var V=[...U.current].filter(([$,P])=>{let q=this.current.get($);if(!q)return!0;return q[0]!==P[0]||q[1]!==P[1]}).map(([$])=>$);if(V.length>0){for(let $ of this.#M)if(($.f&(E|d|HQ))===0&&Z9($,V,z))if(($.f&(R7|n))!==0)T($,R),U.schedule($);else U.#q.add($)}if(U.#Z.length>0&&!U.#U){U.apply();for(var H of U.#S())U.#D(H,[],[])}U.deactivate()}}}increment(Q,J){if(this.#z+=1,Q){let W=this.#K.get(J)??0;this.#K.set(J,W+1)}}decrement(Q,J){if(this.#z-=1,Q){let W=this.#K.get(J)??0;if(W===1)this.#K.delete(J);else this.#K.set(J,W-1)}if(this.#U)return;this.#U=!0,s(()=>{if(this.#U=!1,this.linked)this.flush()})}transfer_effects(Q,J){for(let W of Q)this.#q.add(W);for(let W of J)this.#$.add(W);Q.clear(),J.clear()}oncommit(Q){this.#G.add(Q)}ondiscard(Q){this.#X.add(Q)}settled(){return(this.#V??=z0()).promise}static ensure(){if(S===null){let Q=S=new J7;if(!K9&&!MQ)s(()=>{if(!Q.#Q)Q.flush()})}return S}apply(){if(!Q7||!this.is_fork&&this.#J===null&&this.#W===null){r=null;return}r=new Map;for(let[J,[W]]of this.current)r.set(J,W);for(let J=w0;J!==null;J=J.#W){if(J===this||J.is_fork)continue;var Q=!1;if(J.id<this.id)for(let[W,[,K]]of J.current){if(K)continue;if(this.current.has(W)){Q=!0;break}}if(!Q){for(let[W,K]of J.previous)if(!r.has(W))r.set(W,K)}}}schedule(Q){if(X9=Q,Q.b?.is_pending&&(Q.f&(u7|WQ|PQ))!==0&&(Q.f&G7)===0){Q.b.defer_effect(Q);return}this.#Z.push(Q)}#Y(){if(!this.linked)return;var Q=this.#J,J=this.#W;if(Q===null)w0=J;else Q.#W=J;if(J===null)yQ=Q;else J.#J=Q;this.linked=!1}}function CQ(Q){var J=MQ,W=d7;d7=null,MQ=!0;try{var K;if(Q)CQ(),K=Q();while(!0){if(LJ(),S===null)return K;S.flush()}}finally{MQ=J,d7=W}}function y4(){if(!1){var Q;for(let W of S.current.keys())for(let[K,X]of W.updated??[])var J}try{VJ()}catch(W){M7(W,X9)}}var x7=null;function NJ(Q){var J=Q.length;if(J===0)return;var W=0;while(W<J){var K=Q[W++];if((K.f&(E|d))===0&&VQ(K)){if(x7=new Set,_7(K),K.deps===null&&K.first===null&&K.nodes===null&&K.teardown===null&&K.ac===null)z9(K);if(x7?.size>0){T7.clear();for(let X of x7){if((X.f&(E|d))!==0)continue;let Z=[X],z=X.parent;while(z!==null){if(x7.has(z))x7.delete(z),Z.push(z);z=z.parent}for(let G=Z.length-1;G>=0;G--){let V=Z[G];if((V.f&(E|d))!==0)continue;_7(V)}}x7.clear()}}}x7=null}function RJ(Q,J,W,K){if(W.has(Q))return;if(W.add(Q),Q.reactions!==null)for(let X of Q.reactions){let Z=X.f;if((Z&y)!==0)RJ(X,J,W,K);else if((Z&(R7|n))!==0&&(Z&R)===0&&Z9(X,J,K))T(X,R),tQ(X)}}function Z9(Q,J,W){let K=W.get(Q);if(K!==void 0)return K;if(Q.deps!==null)for(let X of Q.deps){if(JQ.call(J,X))return!0;if((X.f&y)!==0&&Z9(X,J,W))return W.set(X,!0),!0}return W.set(Q,!1),!1}function tQ(Q){S.schedule(Q)}function jJ(Q,J){if((Q.f&o)!==0&&(Q.f&x)!==0)return;if((Q.f&R)!==0)J.d.push(Q);else if((Q.f&m)!==0)J.m.push(Q);T(Q,x);var W=Q.first;while(W!==null)jJ(W,J),W=W.next}function TJ(Q){T(Q,x);var J=Q.first;while(J!==null)TJ(J),J=J.next}function EJ(Q){if(L===null){if(O===null)GJ(Q);zJ()}if(S7)ZJ(Q)}function h4(Q,J){var W=J.last;if(W===null)J.last=J.first=Q;else W.next=Q,Q.prev=W,J.last=Q}function i7(Q,J){var W=L;if(W!==null&&(W.f&d)!==0)Q|=d;var K={ctx:C,deps:null,nodes:null,f:Q|R|z7,first:null,fn:J,last:null,next:null,parent:W,b:W&&W.b,prev:null,teardown:null,wv:0,ac:null};S?.register_created_effect(K);var X=K;if((Q&u7)!==0)if(gQ!==null)gQ.push(K);else J7.ensure().schedule(K);else if(J!==null){try{_7(K)}catch(z){throw h(K),z}if(X.deps===null&&X.teardown===null&&X.nodes===null&&X.first===X.last&&(X.f&f7)===0){if(X=X.first,(Q&n)!==0&&(Q&B7)!==0&&X!==null)X.f|=B7}}if(X!==null){if(X.parent=W,W!==null)h4(X,W);if(O!==null&&(O.f&y)!==0&&(Q&H7)===0){var Z=O;(Z.effects??=[]).push(X)}}return K}function zQ(){return O!==null&&!I7}function W7(Q){let J=i7(WQ,null);return T(J,x),J.teardown=Q,J}function V9(Q){EJ("$effect");var J=L.f,W=!O&&(J&o)!==0&&C!==null&&!C.i;if(W){var K=C;(K.e??=[]).push(Q)}else return o0(Q)}function o0(Q){return i7(u7|v9,Q)}function q9(Q){J7.ensure();let J=i7(H7|f7,Q);return()=>{h(J)}}function kJ(Q){J7.ensure();let J=i7(H7|f7,Q);return(W={})=>{return new Promise((K)=>{if(W.outro)c7(J,()=>{h(J),K(void 0)});else h(J),K(void 0)})}}function $7(Q){return i7(u7,Q)}function wJ(Q){return i7(R7|f7,Q)}function a(Q,J=0){return i7(WQ|J,Q)}function $9(Q,J=[],W=[],K=[]){L0(K,J,W,(X)=>{i7(WQ,()=>{Q(...X.map(I))})})}function F7(Q,J=0){var W=i7(n|J,Q);return W}function c(Q){return i7(o|f7,Q)}function U9(Q){var J=Q.teardown;if(J!==null){let W=S7,K=O;G9(!0),u(null);try{J.call(null)}catch(X){M7(X,Q.parent)}finally{G9(W),u(K)}}}function rQ(Q,J=!1){var W=Q.first;Q.first=Q.last=null;while(W!==null){let X=W.ac;if(X!==null)y7(()=>{X.abort(a7)});var K=W.next;if((W.f&H7)!==0)W.parent=null;else h(W,J);W=K}}function bJ(Q){var J=Q.first;while(J!==null){var W=J.next;if((J.f&o)===0)h(J);J=W}}function h(Q,J=!0){var W=!1;if((J||(Q.f&v0)!==0)&&Q.nodes!==null&&Q.nodes.end!==null)P9(Q.nodes.start,Q.nodes.end),W=!0;Q.f|=p7,rQ(Q,J&&!W),OQ(Q,0);var K=Q.nodes&&Q.nodes.t;if(K!==null)for(let Z of K)Z.stop();U9(Q),Q.f^=p7,Q.f|=E;var X=Q.parent;if(X!==null&&X.first!==null)z9(Q);Q.next=Q.prev=Q.teardown=Q.ctx=Q.deps=Q.fn=Q.nodes=Q.ac=Q.b=null}function P9(Q,J){while(Q!==null){var W=Q===J?null:i(Q);Q.remove(),Q=W}}function z9(Q){var{parent:J,prev:W,next:K}=Q;if(W!==null)W.next=K;if(K!==null)K.prev=W;if(J!==null){if(J.first===Q)J.first=K;if(J.last===Q)J.last=W}}function c7(Q,J,W=!0){var K=[];Q.f|=G0,yJ(Q,K,!0);var X=()=>{if(W)h(Q);if(J)J()},Z=K.length;if(Z>0){var z=()=>--Z||X();for(var G of K)G.out(z)}else X()}function yJ(Q,J,W){if((Q.f&d)!==0)return;Q.f^=d;var K=Q.nodes&&Q.nodes.t;if(K!==null){for(let G of K)if(G.is_global||W)J.push(G)}var X=Q.first;while(X!==null){var Z=X.next;if((X.f&H7)===0){var z=(X.f&B7)!==0||(X.f&o)!==0&&(Q.f&n)!==0;yJ(X,J,z?W:!1)}X=Z}}function hQ(Q){Q.f&=~G0,gJ(Q,!0)}function gJ(Q,J){if((Q.f&G0)!==0)return;if((Q.f&d)===0)return;if(Q.f^=d,(Q.f&x)===0)T(Q,R),J7.ensure().schedule(Q);var W=Q.first;while(W!==null){var K=W.next,X=(W.f&B7)!==0||(W.f&o)!==0;gJ(W,X?J:!1),W=K}var Z=Q.nodes&&Q.nodes.t;if(Z!==null){for(let z of Z)if(z.is_global||J)z.in()}}function vQ(Q,J){if(!Q.nodes)return;var W=Q.nodes.start,K=Q.nodes.end;while(W!==null){var X=W===K?null:i(W);J.append(W),W=X}}var hJ=null;var S7=!1;function G9(Q){S7=Q}var O=null,I7=!1;function u(Q){O=Q}var L=null;function _(Q){L=Q}var h7=null;function O0(Q){if(O!==null&&(!Q7&&(O.f&pQ)!==0||(O.f&y)!==0))(h7??=new Set).add(Q)}var q7=null,L7=0,C7=null;function IJ(Q){C7=Q}var mJ=1,IQ=0,qQ=IQ;function H9(Q){qQ=Q}function aQ(){return++mJ}function VQ(Q){var J=Q.f;if((J&R)!==0)return!0;if((J&m)!==0){var W=Q.deps,K=W.length;for(var X=0;X<K;X++){var Z=W[X];if(VQ(Z))t0(Z);if(Z.wv>Q.wv)return!0}if((J&z7)!==0&&r===null)T(Q,x)}return!1}function uJ(Q,J,W=!0){var K=Q.reactions;if(K===null)return;if(!Q7&&h7!==null&&h7.has(Q))return;for(var X=0;X<K.length;X++){var Z=K[X];if((Z.f&y)!==0)uJ(Z,J,!1);else if(J===Z){if(W)T(Z,R);else if((Z.f&x)!==0)T(Z,m);tQ(Z)}}}function Q9(Q){var J=q7,W=L7,K=C7,X=O,Z=h7,z=C,G=I7,V=qQ,H=Q.f;if(q7=null,L7=0,C7=null,O=(H&(o|H7))===0?Q:null,h7=null,n7(Q.ctx),I7=!1,qQ=++IQ,Q.ac!==null)y7(()=>{Q.ac.abort(a7)}),Q.ac=null;try{Q.f|=pQ;var U=Q.fn,$=U();Q.f|=G7;var P=vJ(Q);if(b7()&&C7!==null&&!I7&&P!==null&&(Q.f&(y|m|R))===0)for(var q=0;q<C7.length;q++)uJ(C7[q],Q);if(X!==null&&X!==Q){if(IQ++,X.deps!==null)for(let Y=0;Y<W;Y+=1)X.deps[Y].rv=IQ;if(J!==null)for(let Y of J)Y.rv=IQ;if(C7!==null)if(K===null)K=C7;else K.push(...C7)}if((Q.f&j7)!==0)Q.f^=j7;return $}catch(Y){return vJ(Q),JJ(Y)}finally{Q.f^=pQ,q7=J,L7=W,C7=K,O=X,h7=Z,n7(z),I7=G,qQ=V}}function vJ(Q){var J=Q.deps,W=S?.is_fork;if(q7!==null){var K;if(!W)OQ(Q,L7);if(J!==null&&L7>0){J.length=L7+q7.length;for(K=0;K<q7.length;K++)J[L7+K]=q7[K]}else Q.deps=J=q7;if(zQ()&&(Q.f&z7)!==0)for(K=L7;K<J.length;K++)(J[K].reactions??=[]).push(Q)}else if(!W&&J!==null&&L7<J.length)OQ(Q,L7),J.length=L7;return J}function m4(Q,J){let W=J.reactions;if(W!==null){var K=g9.call(W,Q);if(K!==-1){var X=W.length-1;if(X===0)W=J.reactions=null;else W[K]=W[X],W.pop()}}if(W===null&&(J.f&y)!==0&&(q7===null||!JQ.call(q7,J))){var Z=J;if((Z.f&z7)!==0)Z.f^=z7;if(Z.v!==k)kQ(Z);if(Z.ac!==null)y7(()=>{Z.ac.abort(a7),Z.ac=null,T(Z,R)});DJ(Z),OQ(Z,0)}}function OQ(Q,J){var W=Q.deps;if(W===null)return;for(var K=J;K<W.length;K++)m4(Q,W[K])}function _7(Q){var J=Q.f;if((J&E)!==0)return;T(Q,x);var W=L;if(L=Q,!1)var K,X;try{if((J&(n|PQ))!==0)bJ(Q);else rQ(Q);U9(Q);var Z=Q9(Q);if(Q.teardown=typeof Z==="function"?Z:null,Q.wv=mJ,!1)for(var z of Q.deps);}finally{L=W}}function I(Q){var J=Q.f,W=(J&y)!==0;if(hJ?.add(Q),O!==null&&!I7){var K=L!==null&&(L.f&E)!==0;if(!K&&(h7===null||!h7.has(Q))){var X=O.deps;if((O.f&pQ)!==0){if(Q.rv<IQ)if(Q.rv=IQ,q7===null&&X!==null&&X[L7]===Q)L7++;else if(q7===null)q7=[Q];else q7.push(Q)}else{if(O.deps??=[],!JQ.call(O.deps,Q))O.deps.push(Q);var Z=Q.reactions;if(Z===null)Q.reactions=[O];else if(!JQ.call(Z,O))Z.push(O)}}}if(!1){if(!I7&&N4&&S===null&&d7===null&&!N4.warned&&(N4.effect.f&pQ)===0&&!N4.effect_deps.has(Q))var z;if(n0&&!I7&&N5!==null&&O!==null&&N5.reaction===O){if(Q.trace);else if(z)var G,V}}if(S7&&T7.has(Q))return T7.get(Q);if(W){var H=Q;if(S7){var U=H.v;if((H.f&x)===0&&H.reactions!==null||fJ(H))U=oQ(H);return T7.set(H,U),U}var $=(H.f&z7)===0&&!I7&&O!==null&&(O.f&z7)!==0,P=(H.f&G7)===0;if(VQ(H)){if($)H.f|=z7;t0(H)}if($&&!P)e0(H),pJ(H)}if(r?.has(Q))return r.get(Q);if((Q.f&j7)!==0)throw Q.v;return Q.v}function pJ(Q){if(Q.f|=z7,Q.deps===null)return;for(let W of Q.deps){var J=W.reactions;if(J===null)W.reactions=[Q];else if(!JQ.call(J,Q))J.push(Q);if((W.f&y)!==0&&(W.f&z7)===0)e0(W),pJ(W)}}function fJ(Q){if(Q.v===k)return!0;if(Q.deps===null)return!1;for(let J of Q.deps){if(T7.has(J))return!0;if((J.f&y)!==0&&fJ(J))return!0}return!1}function b(Q){var J=I7;try{return I7=!0,Q()}finally{I7=J}}function C0(Q){if(typeof Q!=="object"||!Q||Q instanceof EventTarget)return;if(V7 in Q)S0(Q);else if(!Array.isArray(Q))for(let J in Q){let W=Q[J];if(typeof W==="object"&&W&&V7 in W)S0(W)}}function S0(Q,J=new Set){if(typeof Q==="object"&&Q!==null&&!(Q instanceof EventTarget)&&!J.has(Q)){if(J.add(Q),Q instanceof Date)Q.getTime();for(let K in Q)try{S0(Q[K],J)}catch(X){}let W=UQ(Q);if(W!==Object.prototype&&W!==Array.prototype&&W!==Map.prototype&&W!==Set.prototype&&W!==Date.prototype){let K=X0(W);for(let X in K){let Z=K[X].get;if(Z)try{Z.call(Q)}catch(z){}}}}}var u4=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function t7(Q){if(typeof Q!=="object"||Q===null||V7 in Q||V0 in Q)return Q;let J=UQ(Q);if(J!==g0&&J!==h9)return Q;var W=new Map,K=r7(Q),X=l7(0),Z=null,z=qQ,G=($)=>{if(qQ===z)return $();var P=O,q=qQ;u(null),H9(z);var Y=$();return u(P),H9(q),Y};if(K)W.set("length",l7(Q.length,Z));var V="";let H=!1;function U($){if(H)return;H=!0,V=$,LQ(X,`${V} version`);for(let[P,q]of W)LQ(q,p4(V,P));H=!1}return new Proxy(Q,{defineProperty($,P,q){if(!("value"in q)||q.configurable===!1||q.enumerable===!1||q.writable===!1)UJ();var Y=W.get(P);if(Y===void 0)G(()=>{var F=l7(q.value,Z);return W.set(P,F),F});else X7(Y,q.value,!0);return!0},deleteProperty($,P){var q=W.get(P);if(q===void 0){if(P in $){let Y=G(()=>l7(k,Z));W.set(P,Y),SQ(X)}}else X7(q,k),SQ(X);return!0},get($,P,q){if(P===V7)return Q;var Y=W.get(P),F=P in $;if(Y===void 0&&(!F||P7($,P)?.writable))Y=G(()=>{var w=t7(F?$[P]:k),N=l7(w,Z);return N}),W.set(P,Y);if(Y!==void 0){var B=I(Y);return B===k?void 0:B}return Reflect.get($,P,q)},getOwnPropertyDescriptor($,P){this.has?.($,P);var q=Reflect.getOwnPropertyDescriptor($,P),Y=W.get(P);if(Y!==void 0){var F=I(Y);if(F===k)return;if(q&&"value"in q)q.value=F;else return{enumerable:!0,configurable:!0,value:F,writable:!0}}return q},has($,P){if(P===V7)return!0;var q=W.get(P),Y=q!==void 0&&q.v!==k||Reflect.has($,P);if(q!==void 0||L!==null&&(!Y||P7($,P)?.writable)){if(q===void 0)q=G(()=>{var B=Y?t7($[P]):k,w=l7(B,Z);return w}),W.set(P,q);var F=I(q);if(F===k)return!1}return Y},set($,P,q,Y){var F=W.get(P),B=P in $;if(K&&P==="length")for(var w=q;w<F.v;w+=1){var N=W.get(w+"");if(N!==void 0)X7(N,k);else if(w in $)N=G(()=>l7(k,Z)),W.set(w+"",N)}if(F===void 0){if(!B||P7($,P)?.writable)F=G(()=>l7(void 0,Z)),X7(F,t7(q)),W.set(P,F)}else{B=F.v!==k;var v=G(()=>t7(q));X7(F,v)}var A=Reflect.getOwnPropertyDescriptor($,P);if(A?.set)A.set.call(Y,q);if(!B){if(K&&typeof P==="string"){var N7=W.get("length"),Z7=Number(P);if(Number.isInteger(Z7)&&Z7>=N7.v)X7(N7,Z7+1)}SQ(X)}return!0},ownKeys($){I(X);var P=Reflect.ownKeys($).filter((F)=>{var B=W.get(F);return B===void 0||B.v!==k});for(var[q,Y]of W)if(Y.v!==k&&!(q in $))P.push(q);return P},setPrototypeOf(){PJ()}})}function p4(Q,J){if(typeof J==="symbol")return`${Q}[Symbol(${J.description??""})]`;if(u4.test(J))return`${Q}.${J}`;return/^\d+$/.test(J)?`${Q}[${J}]`:`${Q}['${J}']`}var B9,dJ,U0,_J,lJ;function A0(){if(B9!==void 0)return;B9=window,dJ=document,U0=/Firefox/.test(navigator.userAgent);var Q=Element.prototype,J=Node.prototype,W=Text.prototype;if(_J=P7(J,"firstChild").get,lJ=P7(J,"nextSibling").get,h0(Q))Q[dQ]=void 0,Q[q0]=null,Q[u0]=void 0,Q.__e=void 0;if(h0(W))W[_Q]=void 0}function p(Q=""){return document.createTextNode(Q)}function g(Q){return _J.call(Q)}function i(Q){return lJ.call(Q)}function iJ(Q,J){if(!M)return g(Q);var W=g(D);if(W===null)W=D.appendChild(p());else if(J&&W.nodeType!==TQ){var K=p();return W?.before(K),j(K),K}if(J)R0(W);return j(W),W}function f4(Q,J=!1){if(!M){var W=g(Q);if(W instanceof Comment&&W.data==="")return i(W);return W}if(J){if(D?.nodeType!==TQ){var K=p();return D?.before(K),j(K),K}R0(D)}return D}function d4(Q,J=!1){if(!M)return g(Q);var W=iJ(Q,J);return I0(Q),W}function _4(Q,J=1,W=!1){let K=M?D:Q;var X;while(J--)X=K,K=i(K);if(!M)return K;if(W){if(K?.nodeType!==TQ){var Z=p();if(K===null)X?.after(Z);else K.before(Z);return j(Z),Z}R0(K)}return j(K),K}function cQ(Q){Q.textContent=""}function N0(){if(!Q7)return!1;if(x7!==null)return!1;var Q=L.f;return(Q&G7)!==0}function A7(Q,J,W){if(J==null||J===$0)return W?document.createElement(Q,{is:W}):document.createElement(Q);return W?document.createElementNS(J,Q,{is:W}):document.createElementNS(J,Q)}function R0(Q){if(Q.nodeValue.length<65536)return;let J=Q.nextSibling;while(J!==null&&J.nodeType===TQ)J.remove(),Q.nodeValue+=J.nodeValue,J=Q.nextSibling}var M=!1;function f(Q){M=Q}var D;function j(Q){if(Q===null)throw XQ(),Y7;return D=Q}function l(){return j(i(D))}function I0(Q){if(!M)return;if(i(D)!==null)throw XQ(),Y7;D=Q}function Y9(Q=1){if(M){var J=Q,W=D;while(J--)W=i(W);D=W}}function o7(Q=!0){var J=0,W=D;while(!0){if(W.nodeType===w7){var K=W.data;if(K===BQ){if(J===0)return W;J-=1}else if(K===xQ||K===KQ||K[0]==="["&&!isNaN(Number(K.slice(1))))J+=1}var X=i(W);if(Q)W.remove();W=X}}function AQ(Q){if(!Q||Q.nodeType!==w7)throw XQ(),Y7;return Q.data}var mQ=Symbol("events"),F9=new Set,j0=new Set;function cJ(Q,J,W){(J[mQ]??={})[Q]=W}function oJ(Q){for(var J=0;J<Q.length;J++)F9.add(Q[J]);for(var W of j0)W(Q)}var M9=null,L9=!1;function O9(Q){var J=this,W=J.ownerDocument,K=Q.type,X=Q.composedPath?.()||[],Z=X[0]||Q.target;if(M9=Q,!L9)L9=!0,setTimeout(()=>{L9=!1,M9=null});var z=0,G=M9===Q&&Q[mQ];if(G){var V=X.indexOf(G);if(V!==-1&&(J===document||J===window)){Q[mQ]=J;return}var H=X.indexOf(J);if(H===-1)return;if(V<=H)z=V}if(Z=X[z]||Q.target,Z===J)return;U7(Q,"currentTarget",{configurable:!0,get(){return Z||W}});var U=O,$=L;u(null),_(null);try{var P,q=[];while(Z!==null){if(Z===J)break;try{var Y=Z[mQ]?.[K];if(Y!=null&&(!Z.disabled||Q.target===Z))Y.call(Z,Q)}catch(F){if(P)q.push(F);else P=F}if(Q.cancelBubble)break;z++,Z=z<X.length?X[z]:null}if(P){for(let F of q)queueMicrotask(()=>{throw F});throw P}}finally{Q[mQ]=J,delete Q.currentTarget,u(U),_($)}}var l4=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:(Q)=>{return Q}});function sJ(Q){return l4?.createHTML(Q)??Q}function D9(Q){var J=A7("template");return J.innerHTML=sJ(Q.replaceAll("<!>","<!---->")),J.content}function O7(Q,J){var W=L;if(W.nodes===null)W.nodes={start:Q,end:J,a:null,t:null}}function o4(Q,J){var W=(J&r9)!==0,K=(J&a9)!==0,X,Z=!Q.startsWith("<!>");return()=>{if(M)return O7(D,null),D;if(X===void 0){if(X=D9(Z?Q:"<!>"+Q),!W)X=g(X)}var z=K||U0?document.importNode(X,!0):X.cloneNode(!0);if(W){var G=g(z),V=z.lastChild;O7(G,V)}else O7(z,z);return z}}function s4(){if(M)return O7(D,null),D;var Q=document.createDocumentFragment(),J=document.createComment(""),W=p();return Q.append(J,W),O7(J,W),Q}function Q0(Q,J){if(M){var W=L;if((W.f&G7)===0||W.nodes.end===null)W.nodes.end=D;l();return}if(Q===null)return;Q.before(J)}var r4=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","webkitdirectory","defer","disablepictureinpicture","disableremoteplayback"];var pW=[...r4,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var a4=["touchstart","touchmove"];function rJ(Q){return a4.includes(Q)}var n4=["$state","$state.raw","$derived","$derived.by"],fW=[...n4,"$state.eager","$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$effect.pending","$inspect","$inspect().with","$inspect.trace","$host"];function aJ(Q){let J=0,W=K7(0),K;return()=>{if(zQ())I(W),a(()=>{if(J===0)K=b(()=>Q(()=>SQ(W)));return J+=1,()=>{s(()=>{if(J-=1,J===0)K?.(),K=void 0,SQ(W)})}})}}var t4=B7|f7;function S9(Q,J,W,K){new nJ(Q,J,W,K)}class nJ{parent;is_pending=!1;transform_error;#Q;#J=M?D:null;#W;#G;#X;#z=null;#K=null;#V=null;#Z=null;#M=0;#q=0;#$=!1;#P=new Set;#L=new Set;#U=null;#w=aJ(()=>{return this.#U=K7(this.#M),()=>{this.#U=null}});constructor(Q,J,W,K){if(this.#Q=Q,this.#W=J,this.#G=(X)=>{var Z=L;Z.b=this,Z.f|=jQ,W(X)},this.parent=L.b,this.transform_error=K??this.parent?.transform_error??((X)=>X),this.#X=F7(()=>{if(M){let X=AQ(this.#J);l();let Z=X===KQ;if(X.startsWith(_0)){let G=JSON.parse(X.slice(_0.length));this.#F(G)}else if(Z)this.#C();else this.#S()}else this.#B()},t4),M)this.#Q=D}#S(){try{this.#z=c(()=>this.#G(this.#Q))}catch(Q){this.error(Q)}}#F(Q){let J=this.#W.failed,{reset:W,invoke_onerror:K}=this.#D(Q);if(s(K),!J)return;this.#V=c(()=>{J(this.#Q,()=>Q,()=>W)})}#D(Q){var J=!1,W=!1;let K=()=>{if(this.#H())return;if(J){QJ();return}if(J=!0,W)BJ();if(this.#V!==null)c7(this.#V,()=>{this.#V=null});this.#Y(()=>{this.#B()})};return{reset:K,invoke_onerror:()=>{if(this.#H())return;try{W=!0,this.#W.onerror?.(Q,K),W=!1}catch(Z){M7(Z,this.#X&&this.#X.parent)}}}}#H(){return(this.#X.f&(E|p7))!==0}#C(){let Q=this.#W.pending;if(!Q)return;this.is_pending=!0,this.#K=c(()=>Q(this.#Q)),s(()=>{if(this.#H())return;var J=this.#Z=document.createDocumentFragment(),W=p(),K=!1;if(J.append(W),this.#z=this.#Y(()=>{try{return c(()=>this.#G(W))}catch(X){try{this.error(X),K=!0}catch(Z){M7(Z,this.#X.parent)}return null}}),this.#z===null){if(this.#Z=null,K)this.#O(S);return}if(this.#q===0)this.#Q.before(J),this.#Z=null,c7(this.#K,()=>{this.#K=null}),this.#O(S)})}#B(){try{if(this.is_pending=this.has_pending_snippet(),this.#q=0,this.#M=0,this.#z=c(()=>{this.#G(this.#Q)}),this.#q>0){var Q=this.#Z=document.createDocumentFragment();vQ(this.#z,Q);let J=this.#W.pending;this.#K=c(()=>J(this.#Q))}else this.#O(S)}catch(J){this.error(J)}}#O(Q){this.is_pending=!1,Q.transfer_effects(this.#P,this.#L)}defer_effect(Q){D0(Q,this.#P,this.#L)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#W.pending}#Y(Q){var J=L,W=O,K=C;_(this.#X),u(this.#X),n7(this.#X.ctx);try{return J7.ensure(),Q()}finally{_(J),u(W),n7(K)}}#I(Q,J){if(!this.has_pending_snippet()){if(this.parent)this.parent.#I(Q,J);return}if(this.#q+=Q,this.#q===0){if(this.#O(J),this.#K)c7(this.#K,()=>{this.#K=null});if(this.#Z)this.#Q.before(this.#Z),this.#Z=null}}update_pending_count(Q,J){if(this.#I(Q,J),this.#M+=Q,!this.#U||this.#$)return;this.#$=!0,s(()=>{if(this.#$=!1,this.#U)g7(this.#U,this.#M)})}get_effect_pending(){return this.#w(),I(this.#U)}error(Q){if(Q===Y7)throw Q;if(!this.#W.onerror&&!this.#W.failed)throw Q;if(S?.is_fork){if(this.#z)S.skip_effect(this.#z);if(this.#K)S.skip_effect(this.#K);if(this.#V)S.skip_effect(this.#V);S.oncommit(()=>{if(!this.#H())this.#A(Q)})}else this.#A(Q)}#A(Q){if(this.#z)h(this.#z),this.#z=null;if(this.#K)h(this.#K),this.#K=null;if(this.#V)h(this.#V),this.#V=null;if(M)j(this.#J),Y9(),j(o7());let J=this.#W.failed,W=(K)=>{if(this.#H())return;let{reset:X,invoke_onerror:Z}=this.#D(K);if(Z(),J&&!this.#H())this.#V=this.#Y(()=>{try{return c(()=>{var z=L;z.b=this,z.f|=jQ,J(this.#Q,()=>K,()=>X)})}catch(z){return M7(z,this.#X.parent),null}})};s(()=>{if(this.#H())return;var K;try{K=this.transform_error(Q)}catch(X){M7(X,this.#X&&this.#X.parent);return}if(K!==null&&typeof K==="object"&&typeof K.then==="function")K.then(W,(X)=>M7(X,this.#X&&this.#X.parent));else W(K)})}}var C9=!0;function e4(Q,J){var W=J==null?"":typeof J==="object"?`${J}`:J;if(W!==(Q[_Q]??=Q.nodeValue))Q[_Q]=W,Q.nodeValue=`${W}`}function x0(Q,J){return tJ(Q,J)}function A9(Q,J){A0(),J.intro=J.intro??!1;let W=J.target,K=M,X=D;try{var Z=g(W);while(Z&&(Z.nodeType!==w7||Z.data!==xQ))Z=i(Z);if(!Z)throw Y7;f(!0),j(Z);let z=tJ(Q,{...J,anchor:Z});return f(!1),z}catch(z){if(z instanceof Error&&z.message.split(`
2
- `).some((G)=>G.startsWith("https://svelte.dev/e/")))throw z;if(z!==Y7)console.warn("Failed to hydrate: ",z);if(J.recover===!1)qJ();return A0(),cQ(W),f(!1),x0(Q,J)}finally{f(K),j(X)}}var T0=new Map;function tJ(Q,{target:J,anchor:W,props:K={},events:X,context:Z,intro:z=!0,transformError:G}){A0();var V=void 0,H=kJ(()=>{var U=W??J.appendChild(p());S9(U,{pending:()=>{}},(q)=>{i0({});var Y=C;if(Z)Y.c=Z;if(X)K.$$events=X;if(M)O7(q,null);if(C9=z,V=Q(q,K)||iQ(),C9=!0,M){if(L.nodes.end=D,D===null||D.nodeType!==w7||D.data!==BQ)throw XQ(),Y7}c0()},G);var $=new Set,P=(q)=>{for(var Y=0;Y<q.length;Y++){var F=q[Y];if($.has(F))continue;$.add(F);var B=rJ(F);for(let v of[J,document]){var w=T0.get(v);if(w===void 0)w=new Map,T0.set(v,w);var N=w.get(F);if(N===void 0)v.addEventListener(F,O9,{passive:B}),w.set(F,1);else w.set(F,N+1)}}};return P(RQ(F9)),j0.add(P),()=>{for(var q of $)for(let B of[J,document]){var Y=T0.get(B),F=Y.get(q);if(--F==0){if(B.removeEventListener(q,O9),Y.delete(q),Y.size===0)T0.delete(B)}else Y.set(q,F)}if(j0.delete(P),U!==W)U.parentNode?.removeChild(U)}});return I9.set(V,H),V}var I9=new WeakMap;function N9(Q,J){let W=I9.get(Q);if(W)return I9.delete(Q),W(J);return Promise.resolve()}class e7{anchor;#Q=new Map;#J=new Map;#W=new Map;#G=new Set;#X=!0;constructor(Q,J=!0){this.anchor=Q,this.#X=J}#z=(Q)=>{if(!this.#Q.has(Q))return;var J=this.#Q.get(Q),W=this.#J.get(J);if(W)hQ(W),this.#G.delete(J);else{var K=this.#W.get(J);if(K)hQ(K.effect),this.#J.set(J,K.effect),this.#W.delete(J),K.fragment.lastChild.remove(),this.anchor.before(K.fragment),W=K.effect}for(let[X,Z]of this.#Q){if(this.#Q.delete(X),X===Q)break;let z=this.#W.get(Z);if(z)h(z.effect),this.#W.delete(Z)}for(let[X,Z]of this.#J){if(X===J||this.#G.has(X))continue;let z=()=>{if(Array.from(this.#Q.values()).includes(X)){var V=document.createDocumentFragment();vQ(Z,V),V.append(p()),this.#W.set(X,{effect:Z,fragment:V})}else h(Z);this.#G.delete(X),this.#J.delete(X)};if(this.#X||!W)this.#G.add(X),c7(Z,z,!1);else z()}};#K=(Q)=>{this.#Q.delete(Q);let J=Array.from(this.#Q.values());for(let[W,K]of this.#W)if(!J.includes(W))h(K.effect),this.#W.delete(W)};ensure(Q,J){var W=S,K=N0();if(J&&!this.#J.has(Q)&&!this.#W.has(Q))if(K){var X=document.createDocumentFragment(),Z=p();X.append(Z),this.#W.set(Q,{effect:c(()=>J(Z)),fragment:X})}else this.#J.set(Q,c(()=>J(this.anchor)));if(this.#Q.set(W,Q),K){for(let[z,G]of this.#J)if(z===Q)W.unskip_effect(G);else W.skip_effect(G);for(let[z,G]of this.#W)if(z===Q)W.unskip_effect(G.effect);else W.skip_effect(G.effect);W.oncommit(this.#z),W.ondiscard(this.#K)}else{if(M)this.anchor=D;this.#z(W)}}}function W8(Q,J,W=!1){var K;if(M)K=D,l();var X=new e7(Q),Z=W?B7:0;function z(G,V){if(M){var H=AQ(K);if(G!==parseInt(H.substring(1))){var U=o7();j(U),X.anchor=U,f(!1),X.ensure(G,V),f(!0);return}}X.ensure(G,V)}F7(()=>{var G=!1;if(J((V,H=0)=>{G=!0,z(H,V)}),!G)z(-1,null)},Z)}var K8=Symbol("NaN");function X8(Q,J,W){if(M)l();var K=new e7(Q),X=!b7();F7(()=>{var Z=J();if(Z!==Z)Z=K8;if(X&&Z!==null&&typeof Z==="object")Z={};K.ensure(Z,W)})}function Z8(Q,J,W){var K=[],X=J.length,Z,z=J.length;for(var G=0;G<X;G++){let $=J[G];c7($,()=>{if(Z){if(Z.pending.delete($),Z.done.add($),Z.pending.size===0){var P=Q.outrogroups;if(R9(Q,RQ(Z.done)),P.delete(Z),P.size===0)Q.outrogroups=null}}else z-=1},!1)}if(z===0){var V=K.length===0&&W!==null&&Q.pending.size===0;if(V){var H=W,U=H.parentNode;cQ(U),U.append(H),Q.items.clear()}R9(Q,J,!V)}else Z={pending:new Set(J),done:new Set},(Q.outrogroups??=new Set).add(Z)}function R9(Q,J,W=!0){var K;if(Q.pending.size>0){K=new Set;for(let z of Q.pending.values())for(let G of z)K.add(Q.items.get(G).e)}for(var X=0;X<J.length;X++){var Z=J[X];if(K?.has(Z)){Z.f|=E7;let z=document.createDocumentFragment();vQ(Z,z)}else h(J[X],W)}}var J4;function z8(Q,J,W,K,X,Z=null){var z=Q,G=new Map,V=(J&d0)!==0;if(V){var H=Q;z=M?j(g(H)):H.appendChild(p())}if(M)l();var U=null,$=FQ(()=>{var N=W();return r7(N)?N:N==null?[]:RQ(N)}),P=new Map,q=!0;function Y(N){if((w.effect.f&E)!==0)return;w.pending.delete(N);var v=I($);if(w.fallback=U,G8(w,v,z,J,K),U!==null)if(v.length===0)if((U.f&E7)===0)hQ(U);else U.f^=E7,W0(U,null,z);else c7(U,()=>{U=null})}function F(N){w.pending.delete(N)}var B=F7(()=>{var N=I($),v=N.length;let A=!1;if(M){var N7=AQ(z)===KQ;if(N7!==(v===0))z=o7(),j(z),f(!1),A=!0}var Z7=new Set,D7=S,NQ=N0();for(var QQ=0;QQ<v;QQ+=1){if(M&&D.nodeType===w7&&D.data===BQ)z=D,A=!0,f(!1);var v7=N[QQ],K0=K(v7,QQ);if(!1)var e8;var s7=q?null:G.get(K0);if(s7){if(s7.v)g7(s7.v,v7);if(s7.i)g7(s7.i,QQ);if(NQ)D7.unskip_effect(s7.e)}else{if(s7=V8(G,q?z:J4??=p(),v7,K0,QQ,X,J,W),!q)s7.e.f|=E7;G.set(K0,s7)}Z7.add(K0)}if(v===0&&Z&&!U)if(q)U=c(()=>Z(z));else U=c(()=>Z(J4??=p())),U.f|=E7;if(v>Z7.size)XJ("","","");if(M&&v>0)j(o7());if(!q)if(P.set(D7,Z7),NQ){for(let[w4,S4]of G)if(!Z7.has(w4))D7.skip_effect(S4.e);D7.oncommit(Y),D7.ondiscard(F)}else Y(D7);if(A)f(!0);I($)}),w={effect:B,flags:J,items:G,pending:P,outrogroups:null,fallback:U};if(q=!1,M)z=D}function J0(Q){while(Q!==null&&(Q.f&o)===0)Q=Q.next;return Q}function G8(Q,J,W,K,X){var Z=(K&d9)!==0,z=J.length,G=Q.items,V=J0(Q.effect.first),H,U=null,$,P=[],q=[],Y,F,B,w;if(Z){for(w=0;w<z;w+=1)if(Y=J[w],F=X(Y,w),B=G.get(F).e,(B.f&E7)===0)B.nodes?.a?.measure(),($??=new Set).add(B)}for(w=0;w<z;w+=1){if(Y=J[w],F=X(Y,w),B=G.get(F).e,Q.outrogroups!==null)for(let v7 of Q.outrogroups)v7.pending.delete(B),v7.done.delete(B);if((B.f&d)!==0){if(hQ(B),Z)B.nodes?.a?.unfix(),($??=new Set).delete(B)}if((B.f&E7)!==0)if(B.f^=E7,B===V)W0(B,null,W);else{var N=U?U.next:V;if(B===Q.effect.last)Q.effect.last=B.prev;if(B.prev)B.prev.next=B.next;if(B.next)B.next.prev=B.prev;$Q(Q,U,B),$Q(Q,B,N),W0(B,N,W),U=B,P=[],q=[],V=J0(U.next);continue}if(B!==V){if(H!==void 0&&H.has(B)){if(P.length<q.length){var v=q[0],A;U=v.prev;var N7=P[0],Z7=P[P.length-1];for(A=0;A<P.length;A+=1)W0(P[A],v,W);for(A=0;A<q.length;A+=1)H.delete(q[A]);$Q(Q,N7.prev,Z7.next),$Q(Q,U,N7),$Q(Q,Z7,v),V=v,U=Z7,w-=1,P=[],q=[]}else H.delete(B),W0(B,V,W),$Q(Q,B.prev,B.next),$Q(Q,B,U===null?Q.effect.first:U.next),$Q(Q,U,B),U=B;continue}P=[],q=[];while(V!==null&&V!==B)(H??=new Set).add(V),q.push(V),V=J0(V.next);if(V===null)continue}if((B.f&E7)===0)P.push(B);U=B,V=J0(B.next)}if(Q.outrogroups!==null){for(let v7 of Q.outrogroups)if(v7.pending.size===0)R9(Q,RQ(v7.done)),Q.outrogroups?.delete(v7);if(Q.outrogroups.size===0)Q.outrogroups=null}if(V!==null||H!==void 0){var D7=[];if(H!==void 0){for(B of H)if((B.f&d)===0)D7.push(B)}while(V!==null){if((V.f&d)===0&&V!==Q.fallback)D7.push(V);V=J0(V.next)}var NQ=D7.length;if(NQ>0){var QQ=(K&d0)!==0&&z===0?W:null;if(Z){for(w=0;w<NQ;w+=1)D7[w].nodes?.a?.measure();for(w=0;w<NQ;w+=1)D7[w].nodes?.a?.fix()}Z8(Q,D7,QQ)}}if(Z)s(()=>{if($===void 0)return;for(B of $)B.nodes?.a?.apply()})}function V8(Q,J,W,K,X,Z,z,G){var V=(z&p9)!==0?(z&_9)===0?wQ(W,!1,!1):K7(W):null,H=(z&f9)!==0?K7(X):null;return{v:V,i:H,e:c(()=>{return Z(J,V??W,H??X,G),()=>{Q.delete(K)}})}}function W0(Q,J,W){if(!Q.nodes)return;var K=Q.nodes.start,X=Q.nodes.end,Z=J&&(J.f&E7)===0?J.nodes.start:W;while(K!==null){var z=i(K);if(Z.before(K),K===X)return;K=z}}function $Q(Q,J,W){if(J===null)Q.effect.first=W;else J.next=W;if(W===null)Q.effect.last=J;else W.prev=J}function q8(Q,J,W=!1,K=!1,X=!1,Z=!1){var z=Q,G="";if(W){var V=Q;if(M)z=j(g(V))}$9(()=>{var H=L;if(G===(G=J()??"")){if(M)l();return}if(W&&!M){if(H.nodes=null,V.innerHTML=G,G!=="")O7(g(V),V.lastChild);return}if(H.nodes!==null)P9(H.nodes.start,H.nodes.end),H.nodes=null;if(G==="")return;if(M){var U=D.data,$=l(),P=$;while($!==null&&($.nodeType!==w7||$.data!==""))P=$,$=i($);if($===null)throw XQ(),Y7;O7(D,P),z=j($);return}var q=K?lQ:X?l0:void 0,Y=A7(K?"svg":X?"math":"template",q);Y.innerHTML=G;var F=K||X?Y:Y.content;if(O7(g(F),F.lastChild),K||X)while(g(F))z.before(g(F));else z.before(F)})}function $8(Q,J,W,K,X){if(M)l();if(J.$$host?.$$shadowRoot){let G=A7("slot");if(W!=="default")G.name=W;if(Q0(Q,G),X!==null){let V=p();G.append(V),X(V)}return}var Z=J.$$slots?.[W],z=!1;if(Z===!0)Z=J[W==="default"?"children":W],z=!0;if(Z===void 0){if(X!==null)X(Q)}else Z(Q,z?()=>K:K)}function L8(Q,J){$7(()=>{Q=L?.parent?.nodes?.start??Q;var W=Q.getRootNode(),K=W.host?W:W.head??W.ownerDocument.head;if(!K.querySelector("#"+J.hash)){let X=A7("style");X.id=J.hash,X.textContent=J.code,K.appendChild(X)}})}function F8(Q,J,W){$7(()=>{var K=b(()=>J(Q,W?.())||{});if(W&&K?.update){var X=!1,Z={};a(()=>{var z=W();if(C0(z),X&&H0(Z,z))Z=z,K.update(z)}),X=!0}if(K?.destroy)return()=>K.destroy()})}function W4(Q){var J,W,K="";if(typeof Q=="string"||typeof Q=="number")K+=Q;else if(typeof Q=="object")if(Array.isArray(Q)){var X=Q.length;for(J=0;J<X;J++)Q[J]&&(W=W4(Q[J]))&&(K&&(K+=" "),K+=W)}else for(W in Q)Q[W]&&(K&&(K+=" "),K+=W);return K}function K4(){for(var Q,J,W=0,K="",X=arguments.length;W<X;W++)(Q=arguments[W])&&(J=W4(Q))&&(K&&(K+=" "),K+=J);return K}function Z4(Q){if(typeof Q==="object")return K4(Q);else return Q??""}var X4=[...`
3
- \r\f \v\uFEFF`];function z4(Q,J,W){var K=Q==null?"":""+Q;if(J)K=K?K+" "+J:J;if(W){for(var X of Object.keys(W))if(W[X])K=K?K+" "+X:X;else if(K.length){var Z=X.length,z=0;while((z=K.indexOf(X,z))>=0){var G=z+Z;if((z===0||X4.includes(K[z-1]))&&(G===K.length||X4.includes(K[G])))K=(z===0?"":K.substring(0,z))+K.substring(G+1);else z=G}}}return K===""?null:K}function G4(Q,J,W,K,X,Z){var z=Q[dQ];if(M||z!==W||z===void 0){var G=z4(W,K,Z);if(!M||G!==Q.getAttribute("class"))if(G==null)Q.removeAttribute("class");else if(J)Q.className=G;else Q.setAttribute("class",G);Q[dQ]=W}else if(Z&&X!==Z)for(var V in Z){var H=!!Z[V];if(X==null||H!==!!X[V])Q.classList.toggle(V,H)}return Z}var T8=Symbol("class"),x8=Symbol("style"),E8=Symbol("is custom element"),k8=Symbol("is html"),b8=f0?"link":"LINK";function $4(Q,J,W,K){var X=g8(Q);if(M){if(X[J]=Q.getAttribute(J),J==="src"||J==="srcset"||J==="href"&&Q.nodeName===b8){if(!K)h8(Q,J,W??"");return}}if(X[J]===(X[J]=W))return;if(J==="loading")Q[m9]=W;if(W==null)Q.removeAttribute(J);else if(typeof W!=="string"&&U4(Q).has(J))Q[J]=W;else Q.setAttribute(J,W)}function y8(Q,J,W){var K=O,X=L;let Z=M;if(M)f(!1);u(null),_(null);try{if(J!=="style"&&(j9.has(Q.getAttribute("is")||Q.nodeName)||!customElements||customElements.get(Q.getAttribute("is")||Q.nodeName.toLowerCase())?U4(Q).has(J):W&&typeof W==="object"))Q[J]=W;else $4(Q,J,W==null?W:String(W))}finally{if(u(K),_(X),Z)f(!0)}}function g8(Q){return Q[q0]??={[E8]:Q.nodeName.includes("-"),[k8]:Q.namespaceURI===$0}}var j9=new Map;function U4(Q){var J=Q.getAttribute("is")||Q.nodeName,W=j9.get(J);if(W)return W;j9.set(J,W=new Set);var K,X=Q,Z=Element.prototype;while(Z!==X){K=X0(X);for(var z in K)if(K[z].set&&z!=="innerHTML"&&z!=="textContent"&&z!=="innerText")W.add(z);X=UQ(X)}return W}function h8(Q,J,W){return}function T9(Q,J){if(Q===J)return!0;return new URL(Q,document.baseURI).href===new URL(J,document.baseURI).href}function V4(Q){return Q.split(",").map((J)=>J.trim().split(" ").filter(Boolean))}function v8(Q,J){var W=V4(Q.srcset),K=V4(J);return K.length===W.length&&K.every(([X,Z],z)=>Z===W[z][1]&&(T9(W[z][0],X)||T9(X,W[z][0])))}class P4{#Q=new WeakMap;#J;#W;static entries=new WeakMap;constructor(Q){this.#W=Q}observe(Q,J){var W=this.#Q.get(Q)||new Set;return W.add(J),this.#Q.set(Q,W),this.#G().observe(Q,this.#W),()=>{var K=this.#Q.get(Q);if(K.delete(J),K.size===0)this.#Q.delete(Q),this.#J.unobserve(Q)}}#G(){return this.#J??(this.#J=new ResizeObserver((Q)=>{for(var J of Q){P4.entries.set(J.target,J);for(var W of this.#Q.get(J.target)||[])W(J)}}))}}function x9(Q,J){return Q===J||Q?.[V7]===J}function m8(Q=iQ(),J,W,K){var X=C.r,Z=L;return $7(()=>{var z,G;return a(()=>{z=G,G=K?.()||[],b(()=>{if(!x9(W(...G),Q)){if(J(Q,...G),z&&x9(W(...z),Q))J(null,...z)}})}),()=>{let V=Z;while(V!==X&&V.parent!==null&&V.parent.f&p7)V=V.parent;let H=()=>{if(G&&x9(W(...G),Q))J(null,...G)},U=V.teardown;V.teardown=()=>{H(),U?.()}}}),Q}var k0=!1,UG=Symbol("unmounted");function k9(Q){var J=k0;try{return k0=!1,[Q(),k0]}finally{k0=J}}function p8(Q,J,W,K){var X=!ZQ||(W&i9)!==0,Z=(W&o9)!==0,z=(W&s9)!==0,G=K,V=!0,H=void 0,U=()=>{if(z&&X)return H??=GQ(K),I(H);if(V)V=!1,G=z?b(K):K;return G};let $;if(Z){var P=V7 in Q||fQ in Q;$=P7(Q,J)?.set??(P&&J in Q?(A)=>Q[J]=A:void 0)}var q,Y=!1;if(Z)[q,Y]=k9(()=>Q[J]);else q=Q[J];if(q===void 0&&K!==void 0){if(q=U(),$){if(X)$J(J);$(q)}}var F;if(X)F=()=>{var A=Q[J];if(A===void 0)return U();return V=!0,A};else F=()=>{var A=Q[J];if(A!==void 0)G=void 0;return A===void 0?G:A};if(X&&(W&c9)===0)return F;if($){var B=Q.$$legacy;return function(A,N7){if(arguments.length>0){if(!X||!N7||B||Y)$(N7?F():A);return A}return F()}}var w=!1,N=((W&l9)!==0?GQ:FQ)(()=>{return w=!1,F()});if(Z)I(N);var v=L;return function(A,N7){if(arguments.length>0){let Z7=N7?I(N):X&&Z?t7(A):A;if(X7(N,Z7),w=!0,G!==void 0)G=Z7;return A}if(S7&&w||(v.f&E)!==0)return N.v;return I(N)}}function H4(Q){return new B4(Q)}class B4{#Q;#J;constructor(Q){var J=new Map,W=(X,Z)=>{var z=wQ(Z,!1,!1);return J.set(X,z),z};let K=new Proxy({...Q.props||{},$$events:{}},{get(X,Z){return I(J.get(Z)??W(Z,Reflect.get(X,Z)))},has(X,Z){if(Z===fQ)return!0;return I(J.get(Z)??W(Z,Reflect.get(X,Z))),Reflect.has(X,Z)},set(X,Z,z){return X7(J.get(Z)??W(Z,z),z),Reflect.set(X,Z,z)}});if(this.#J=(Q.hydrate?A9:x0)(Q.component,{target:Q.target,anchor:Q.anchor,props:K,context:Q.context,intro:Q.intro??!1,recover:Q.recover,transformError:Q.transformError}),!Q7&&(!Q?.props?.$$host||Q.sync===!1))CQ();this.#Q=K.$$events;for(let X of Object.keys(this.#J)){if(X==="$set"||X==="$destroy"||X==="$on")continue;U7(this,X,{get(){return this.#J[X]},set(Z){this.#J[X]=Z},enumerable:!0})}this.#J.$set=(X)=>{Object.assign(K,X)},this.#J.$destroy=()=>{N9(this.#J)}}$set(Q){this.#J.$set(Q)}$on(Q,J){this.#Q[Q]=this.#Q[Q]||[];let W=(...K)=>J.call(this,...K);return this.#Q[Q].push(W),()=>{this.#Q[Q]=this.#Q[Q].filter((K)=>K!==W)}}$destroy(){this.#J.$destroy()}}var Y4;if(typeof HTMLElement==="function")Y4=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(Q,J,W){super();if(this.$$ctor=Q,this.$$s=J,W)this.$$shadowRoot=this.attachShadow(W)}addEventListener(Q,J,W){if(this.$$l[Q]=this.$$l[Q]||[],this.$$l[Q].push(J),this.$$c){let K=this.$$c.$on(Q,J);this.$$l_u.set(J,K)}super.addEventListener(Q,J,W)}removeEventListener(Q,J,W){if(super.removeEventListener(Q,J,W),this.$$c){let K=this.$$l_u.get(J);if(K)K(),this.$$l_u.delete(J)}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let Q=function(K){return(X)=>{let Z=A7("slot");if(K!=="default")Z.name=K;Q0(X,Z)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let J={},W=s8(this);for(let K of this.$$s)if(K in W)if(K==="default"&&!this.$$d.children)this.$$d.children=Q(K),J.default=!0;else J[K]=Q(K);for(let K of this.attributes){let X=this.$$g_p(K.name);if(!(X in this.$$d))this.$$d[X]=b0(X,K.value,this.$$p_d,"toProp")}for(let K in this.$$p_d)if(!(K in this.$$d)&&this[K]!==void 0)this.$$d[K]=this[K],delete this[K];this.$$c=H4({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:J,$$host:this}}),this.$$me=q9(()=>{a(()=>{this.$$r=!0;for(let K of uQ(this.$$c)){if(!this.$$p_d[K]?.reflect)continue;this.$$d[K]=this.$$c[K];let X=b0(K,this.$$d[K],this.$$p_d,"toAttribute");if(X==null)this.removeAttribute(this.$$p_d[K].attribute||K);else this.setAttribute(this.$$p_d[K].attribute||K,X)}this.$$r=!1})});for(let K in this.$$l)for(let X of this.$$l[K]){let Z=this.$$c.$on(K,X);this.$$l_u.set(X,Z)}this.$$l={}}}attributeChangedCallback(Q,J,W){if(this.$$r)return;Q=this.$$g_p(Q),this.$$d[Q]=b0(Q,W,this.$$p_d,"toProp"),this.$$c?.$set({[Q]:this.$$d[Q]})}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{if(!this.$$cn&&this.$$c)this.$$c.$destroy(),this.$$me(),this.$$c=void 0})}$$g_p(Q){return uQ(this.$$p_d).find((J)=>this.$$p_d[J].attribute===Q||!this.$$p_d[J].attribute&&J.toLowerCase()===Q)||Q}};function b0(Q,J,W,K){let X=W[Q]?.type;if(J=X==="Boolean"&&typeof J!=="boolean"?J!=null:J,!K||!W[Q])return J;else if(K==="toAttribute")switch(X){case"Object":case"Array":return J==null?null:JSON.stringify(J);case"Boolean":return J?"":null;case"Number":return J==null?null:J;default:return J}else switch(X){case"Object":case"Array":return J&&JSON.parse(J);case"Boolean":return J;case"Number":return J!=null?+J:J;default:return J}}function s8(Q){let J={};return Q.childNodes.forEach((W)=>{J[W.slot||"default"]=!0}),J}function r8(Q,J,W,K,X,Z){let z=class extends Y4{constructor(){super(Q,W,X);this.$$p_d=J}static get observedAttributes(){return uQ(J).map((G)=>(J[G].attribute||G).toLowerCase())}};if(uQ(J).forEach((G)=>{U7(z.prototype,G,{get(){return this.$$c&&G in this.$$c?this.$$c[G]:this.$$d[G]},set(V){V=b0(G,V,J),this.$$d[G]=V;var H=this.$$c;if(H){var U=P7(H,G)?.get;if(U)H[G]=V;else H.$set({[G]:V})}}})}),K.forEach((G)=>{U7(z.prototype,G,{get(){return this.$$c?.[G]}})}),Z)z=Z(z);return Q.element=z,z}import{createContext as y0}from"@pie-players/pie-context";var M4=y0(Symbol.for("pie.assessmentToolkit.runtimeContext")),L4=y0(Symbol.for("pie.assessmentToolkit.hostRuntimeContext")),F4=y0(Symbol.for("pie.assessmentToolkit.shellContext")),a8=y0(Symbol.for("pie.assessmentToolkit.regionScopeContext"));import{connectContextWithRetry as b9}from"@pie-players/pie-context";var n8={bubbles:!0,composed:!0,cancelable:!1};function t8(Q,J,W={}){return new CustomEvent(Q,{detail:J,...n8,...W})}function UP(Q,J,W,K={}){return Q.dispatchEvent(t8(J,W,K))}function PP(Q,J){return b9(Q,M4,J)}function HP(Q,J){return b9(Q,F4,J)}function BP(Q,J){return b9(Q,L4,J)}var MP=1e4;function LP(Q,J,W){if(!Q)return;let K=Symbol.for(`pie.assessmentToolkit.warned.${J}`),X=Q;if(X[K])return;X[K]=!0,console.warn(W)}function OP(Q,J){return D4(Q,J,new WeakMap)}function D4(Q,J,W){if(Object.is(Q,J))return!0;let K=Array.isArray(Q);if(K!==Array.isArray(J))return!1;if(!K&&(!O4(Q)||!O4(J)))return!1;let X=Q,Z=J;if(K&&Q.length!==J.length)return!1;let z=W.get(X);if(z?.has(Z))return!0;if(!z)z=new Set,W.set(X,z);z.add(Z);let G=new Set([...Object.keys(X),...Object.keys(Z)]);for(let V of G)if(!D4(X[V],Z[V],W))return!1;return!0}function O4(Q){if(Q===null||typeof Q!=="object")return!1;let J=Object.getPrototypeOf(Q);return J===Object.prototype||J===null}
4
- export{m7 as v,I0 as w,i0 as x,c0 as y,T4 as z,CQ as A,l7 as B,X7 as C,t7 as D,iJ as E,f4 as F,d4 as G,_4 as H,V9 as I,$9 as J,I as K,b as L,cJ as M,oJ as N,o4 as O,s4 as P,Q0 as Q,e4 as R,W8 as S,X8 as T,z8 as U,q8 as V,$8 as W,L8 as X,F8 as Y,Z4 as Z,G4 as _,$4 as $,y8 as aa,m8 as ba,p8 as ca,r8 as da,M4 as ea,L4 as fa,F4 as ga,a8 as ha,UP as ia,PP as ja,HP as ka,BP as la,MP as ma,LP as na,OP as oa};