@pie-players/pie-assessment-toolkit 0.3.67 → 0.3.68

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 (57) hide show
  1. package/README.md +1 -1
  2. package/dist/attempt/AssessmentSession.d.ts +7 -27
  3. package/dist/components/ItemToolBar.custom-element.js +1 -1
  4. package/dist/components/PieAssessmentToolkit.custom-element.js +13 -13
  5. package/dist/components/SectionToolBar.custom-element.js +1 -1
  6. package/dist/components/chunks/ItemToolBar-38mhtjsq.js +51 -0
  7. package/dist/components/chunks/ItemToolBar-9ymm7pd1.js +46 -0
  8. package/dist/components/item-toolbar-element.js +1 -0
  9. package/dist/components/pie-assessment-toolkit-element.js +1 -0
  10. package/dist/components/section-toolbar-element.js +1 -0
  11. package/dist/context/assessment-toolkit-context.d.ts +28 -0
  12. package/dist/index.d.ts +7 -3
  13. package/dist/index.js +4 -2
  14. package/dist/runtime/SectionRuntimeEngine.d.ts +56 -0
  15. package/dist/runtime/SectionRuntimeEngine.js +66 -1
  16. package/dist/runtime/core/engine-resolver.d.ts +25 -1
  17. package/dist/runtime/registration-events.d.ts +52 -0
  18. package/dist/runtime/registration-events.js +2 -0
  19. package/dist/services/AccessibilityCatalogResolver.js +21 -5
  20. package/dist/services/I18nService.d.ts +28 -100
  21. package/dist/services/I18nService.js +43 -233
  22. package/dist/services/TTSService.d.ts +12 -0
  23. package/dist/services/TTSService.js +18 -17
  24. package/dist/services/ToolRegistry.d.ts +86 -2
  25. package/dist/services/ToolRegistry.js +30 -0
  26. package/dist/services/ToolkitCoordinator.d.ts +39 -37
  27. package/dist/services/ToolkitCoordinator.js +40 -0
  28. package/dist/services/audio-handoff.d.ts +39 -0
  29. package/dist/services/audio-handoff.js +58 -0
  30. package/dist/services/catalog-media.d.ts +35 -4
  31. package/dist/services/catalog-media.js +92 -3
  32. package/dist/services/framework-error.d.ts +15 -1
  33. package/dist/services/interfaces.d.ts +28 -0
  34. package/dist/services/pnp-standard-features.d.ts +1 -1
  35. package/dist/services/section-controller-types.d.ts +218 -7
  36. package/dist/services/selection-action.d.ts +49 -0
  37. package/dist/services/selection-action.js +10 -0
  38. package/dist/services/spoken-audio-cards.js +5 -1
  39. package/dist/services/tool-context.d.ts +6 -5
  40. package/dist/services/tool-context.js +197 -152
  41. package/dist/services/tool-icons.d.ts +18 -0
  42. package/dist/services/tool-icons.js +31 -0
  43. package/dist/services/tool-providers/DesmosToolProvider.d.ts +6 -5
  44. package/dist/services/tool-request.d.ts +106 -0
  45. package/dist/services/tool-request.js +127 -0
  46. package/dist/services/toolbar-items.d.ts +6 -0
  47. package/dist/tools/client.d.ts +0 -1
  48. package/dist/tools/client.js +0 -2
  49. package/dist/tools/internal.d.ts +6 -0
  50. package/dist/tools/internal.js +7 -0
  51. package/dist/tools/tool-surface-host.d.ts +57 -0
  52. package/dist/tools/tool-surface-host.js +610 -0
  53. package/package.json +10 -10
  54. package/dist/components/chunks/ItemToolBar-8jgdz50p.js +0 -51
  55. package/dist/components/chunks/ItemToolBar-cvs646j3.js +0 -36
  56. package/dist/tools/calculators/desmos-provider.d.ts +0 -46
  57. package/dist/tools/calculators/desmos-provider.js +0 -393
@@ -1 +1 @@
1
- import"./chunks/ItemToolBar-cvs646j3.js";import{H as w,J as G,K as Y,d as U,e as V,g as F,o as E,t as W,v as X}from"./chunks/ItemToolBar-8jgdz50p.js";var x=(H,A)=>{if(customElements.get(H))return;try{customElements.define(H,A)}catch(C){if(!(C instanceof DOMException&&C.name==="NotSupportedError"||C&&typeof C==="object"&&C.name==="NotSupportedError")||!customElements.get(H))throw C}},D=W("<pie-item-toolbar></pie-item-toolbar>",2);function Z(H,A){U(A,!0);let C=G(A,"enabledTools",7,""),J=G(A,"position",7,"bottom"),K=G(A,"sectionId",7,""),L=G(A,"size",7,"md"),M=G(A,"language",7,"en-US"),O=G(A,"toolRegistry",7,null),P=G(A,"item",7,null),Q=G(A,"hostButtons",23,()=>[]);var j={get enabledTools(){return C()},set enabledTools(k){C(k),F()},get position(){return J()},set position(k){J(k),F()},get sectionId(){return K()},set sectionId(k){K(k),F()},get size(){return L()},set size(k){L(k),F()},get language(){return M()},set language(k){M(k),F()},get toolRegistry(){return O()},set toolRegistry(k){O(k),F()},get item(){return P()},set item(k){P(k),F()},get hostButtons(){return Q()},set hostButtons(k){Q(k),F()}},q=D();return w(q,"level","section"),E(()=>w(q,"scope-id",K())),E(()=>w(q,"section-id",K())),E(()=>w(q,"tools",C())),w(q,"content-kind","section"),E(()=>w(q,"position",J())),E(()=>w(q,"size",L())),E(()=>w(q,"language",M())),E(()=>w(q,"toolRegistry",O())),E(()=>w(q,"item",P())),E(()=>w(q,"hostButtons",Q())),X(H,q),V(j)}x("pie-section-toolbar",Y(Z,{enabledTools:{attribute:"enabled-tools",type:"String"},position:{attribute:"position",type:"String"},sectionId:{attribute:"section-id",type:"String"},size:{attribute:"size",type:"String"},language:{attribute:"language",type:"String"},toolRegistry:{type:"Object"},item:{type:"Object"},hostButtons:{type:"Object"}},[],[],{mode:"open"}));export{Z as default};
1
+ import"./chunks/ItemToolBar-9ymm7pd1.js";import{H as w,J as G,K as Y,d as U,e as V,g as F,o as E,t as W,v as X}from"./chunks/ItemToolBar-38mhtjsq.js";var x=(H,A)=>{if(customElements.get(H))return;try{customElements.define(H,A)}catch(C){if(!(C instanceof DOMException&&C.name==="NotSupportedError"||C&&typeof C==="object"&&C.name==="NotSupportedError")||!customElements.get(H))throw C}},D=W("<pie-item-toolbar></pie-item-toolbar>",2);function Z(H,A){U(A,!0);let C=G(A,"enabledTools",7,""),J=G(A,"position",7,"bottom"),K=G(A,"sectionId",7,""),L=G(A,"size",7,"md"),M=G(A,"language",7,"en-US"),O=G(A,"toolRegistry",7,null),P=G(A,"item",7,null),Q=G(A,"hostButtons",23,()=>[]);var j={get enabledTools(){return C()},set enabledTools(k){C(k),F()},get position(){return J()},set position(k){J(k),F()},get sectionId(){return K()},set sectionId(k){K(k),F()},get size(){return L()},set size(k){L(k),F()},get language(){return M()},set language(k){M(k),F()},get toolRegistry(){return O()},set toolRegistry(k){O(k),F()},get item(){return P()},set item(k){P(k),F()},get hostButtons(){return Q()},set hostButtons(k){Q(k),F()}},q=D();return w(q,"level","section"),E(()=>w(q,"scope-id",K())),E(()=>w(q,"section-id",K())),E(()=>w(q,"tools",C())),w(q,"content-kind","section"),E(()=>w(q,"position",J())),E(()=>w(q,"size",L())),E(()=>w(q,"language",M())),E(()=>w(q,"toolRegistry",O())),E(()=>w(q,"item",P())),E(()=>w(q,"hostButtons",Q())),X(H,q),V(j)}x("pie-section-toolbar",Y(Z,{enabledTools:{attribute:"enabled-tools",type:"String"},position:{attribute:"position",type:"String"},sectionId:{attribute:"section-id",type:"String"},size:{attribute:"size",type:"String"},language:{attribute:"language",type:"String"},toolRegistry:{type:"Object"},item:{type:"Object"},hostButtons:{type:"Object"}},[],[],{mode:"open"}));export{Z as default};
@@ -0,0 +1,51 @@
1
+ var p1=((J)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(J,{get:(Q,W)=>(typeof require<"u"?require:Q)[W]}):J)(function(J){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+J+'" is not supported')});var K4="5";if(typeof window<"u")((window.__svelte??={}).v??=new Set).add(K4);var b=2,_0=4,PJ=8,NJ=16777216,W0=16,c=32,B0=64,fJ=128,X0=512,x=1024,I=2048,m=4096,_=8192,g=16384,H0=32768,pJ=33554432,O0=65536,UJ=131072,W7=262144,l0=524288,G4=1048576,y0=33554432,A0=65536,AJ=2097152,D0=4194304,k0=8388608,i=Symbol("$state"),QQ=Symbol("legacy props"),$4=Symbol(""),OQ=Symbol("proxy path"),FQ=Symbol("attributes"),WQ=Symbol("class"),XQ=Symbol("style"),zQ=Symbol("text"),X7=Symbol("form reset"),z7=Symbol("hmr anchor"),XJ=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},Z7=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");var dJ=3,I0=8;var q4=1,P4=2,K7=4,U4=8,B4=16,H4=1,Y4=2,M4=4,V4=8,L4=16;var O4=1,F4=2;var _J="[",BJ="[!",G7="[?",DJ="]",c0={};var y=Symbol("uninitialized"),F0=Symbol("filename"),w4=Symbol("hmr"),wQ="http://www.w3.org/1999/xhtml",ZQ="http://www.w3.org/2000/svg",$7="http://www.w3.org/1998/Math/MathML";var P=!0;var i0="font-weight: bold",o0="font-weight: normal";function S4(J){if(P)console.warn(`%c[svelte] await_reactivity_loss
2
+ %cDetected reactivity loss when reading \`${J}\`. This happens when state is read in an async function after an earlier \`await\`
3
+ https://svelte.dev/e/await_reactivity_loss`,i0,o0);else console.warn("https://svelte.dev/e/await_reactivity_loss")}function C4(J,Q){if(P)console.warn(`%c[svelte] await_waterfall
4
+ %cAn async derived, \`${J}\` (${Q}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app
5
+ https://svelte.dev/e/await_waterfall`,i0,o0);else console.warn("https://svelte.dev/e/await_waterfall")}function N4(){if(P)console.warn(`%c[svelte] derived_inert
6
+ %cReading a derived belonging to a now-destroyed effect may result in stale values
7
+ https://svelte.dev/e/derived_inert`,i0,o0);else console.warn("https://svelte.dev/e/derived_inert")}function A4(J,Q,W){if(P)console.warn(`%c[svelte] hydration_attribute_changed
8
+ %cThe \`${J}\` attribute on \`${Q}\` changed its value between server and client renders. The client value, \`${W}\`, will be ignored in favour of the server value
9
+ https://svelte.dev/e/hydration_attribute_changed`,i0,o0);else console.warn("https://svelte.dev/e/hydration_attribute_changed")}function D4(J){if(P)console.warn(`%c[svelte] hydration_html_changed
10
+ %c${J?`The value of an \`{@html ...}\` block ${J} changed between server and client renders. The client value will be ignored in favour of the server value`:"The value of an `{@html ...}` block changed between server and client renders. The client value will be ignored in favour of the server value"}
11
+ https://svelte.dev/e/hydration_html_changed`,i0,o0);else console.warn("https://svelte.dev/e/hydration_html_changed")}function HJ(J){if(P)console.warn(`%c[svelte] hydration_mismatch
12
+ %c${J?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${J}`:"Hydration failed because the initial UI does not match what was rendered on the server"}
13
+ https://svelte.dev/e/hydration_mismatch`,i0,o0);else console.warn("https://svelte.dev/e/hydration_mismatch")}function I4(){if(P)console.warn(`%c[svelte] lifecycle_double_unmount
14
+ %cTried to unmount a component that was not mounted
15
+ https://svelte.dev/e/lifecycle_double_unmount`,i0,o0);else console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function SQ(J){if(P)console.warn(`%c[svelte] state_proxy_equality_mismatch
16
+ %cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${J}\` will produce unexpected results
17
+ https://svelte.dev/e/state_proxy_equality_mismatch`,i0,o0);else console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function R4(){if(P)console.warn(`%c[svelte] state_proxy_unmount
18
+ %cTried to unmount a state proxy, rather than a component
19
+ https://svelte.dev/e/state_proxy_unmount`,i0,o0);else console.warn("https://svelte.dev/e/state_proxy_unmount")}function j4(){if(P)console.warn("%c[svelte] svelte_boundary_reset_noop\n%cA `<svelte:boundary>` `reset` function only resets the boundary the first time it is called\nhttps://svelte.dev/e/svelte_boundary_reset_noop",i0,o0);else console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var zJ=Array.isArray,T4=Array.prototype.indexOf,YJ=Array.prototype.includes,lJ=Array.from,KQ=Object.keys,n=Object.defineProperty,Y0=Object.getOwnPropertyDescriptor,CQ=Object.getOwnPropertyDescriptors,q7=Object.prototype,x4=Array.prototype,IJ=Object.getPrototypeOf,P7=Object.isExtensible;var s0=()=>{};function NQ(J){for(var Q=0;Q<J.length;Q++)J[Q]()}function AQ(){var J,Q,W=new Promise((X,z)=>{J=X,Q=z});return{promise:W,resolve:J,reject:Q}}function k4(J){if(P){let Q=Error(`invariant_violation
20
+ An invariant violation occurred, meaning Svelte's internal assumptions were flawed. This is a bug in Svelte, not your app — please open an issue at https://github.com/sveltejs/svelte, citing the following message: "${J}"
21
+ https://svelte.dev/e/invariant_violation`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/invariant_violation")}function b4(){if(P){let J=Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/async_derived_orphan")}function y4(){if(P){let J=Error(`derived_references_self
22
+ A derived value cannot reference itself recursively
23
+ https://svelte.dev/e/derived_references_self`);throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/derived_references_self")}function U7(J,Q,W){if(P){let X=Error(`each_key_duplicate
24
+ ${W?`Keyed each block has duplicate key \`${W}\` at indexes ${J} and ${Q}`:`Keyed each block has duplicate key at indexes ${J} and ${Q}`}
25
+ https://svelte.dev/e/each_key_duplicate`);throw X.name="Svelte error",X}else throw Error("https://svelte.dev/e/each_key_duplicate")}function h4(J,Q,W){if(P){let X=Error(`each_key_volatile
26
+ Keyed each block has key that is not idempotent — the key for item at index ${J} was \`${Q}\` but is now \`${W}\`. Keys must be the same each time for a given item
27
+ https://svelte.dev/e/each_key_volatile`);throw X.name="Svelte error",X}else throw Error("https://svelte.dev/e/each_key_volatile")}function g4(J){if(P){let Q=Error(`effect_in_teardown
28
+ \`${J}\` cannot be used inside an effect cleanup function
29
+ https://svelte.dev/e/effect_in_teardown`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/effect_in_teardown")}function v4(){if(P){let J=Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/effect_in_unowned_derived")}function m4(J){if(P){let Q=Error(`effect_orphan
30
+ \`${J}\` can only be used inside an effect (e.g. during component initialisation)
31
+ https://svelte.dev/e/effect_orphan`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/effect_orphan")}function u4(){if(P){let J=Error(`effect_update_depth_exceeded
32
+ Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
33
+ https://svelte.dev/e/effect_update_depth_exceeded`);throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/effect_update_depth_exceeded")}function f4(){if(P){let J=Error(`hydration_failed
34
+ Failed to hydrate the application
35
+ https://svelte.dev/e/hydration_failed`);throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/hydration_failed")}function p4(J){if(P){let Q=Error(`props_invalid_value
36
+ Cannot do \`bind:${J}={undefined}\` when \`${J}\` has a fallback value
37
+ https://svelte.dev/e/props_invalid_value`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/props_invalid_value")}function d4(J){if(P){let Q=Error(`rune_outside_svelte
38
+ The \`${J}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
39
+ https://svelte.dev/e/rune_outside_svelte`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/rune_outside_svelte")}function _4(){if(P){let J=Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/state_descriptors_fixed")}function l4(){if(P){let J=Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/state_prototype_fixed")}function c4(){if(P){let J=Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/state_unsafe_mutation")}function i4(){if(P){let J=Error("svelte_boundary_reset_onerror\nA `<svelte:boundary>` `reset` function cannot be called while an error is still being handled\nhttps://svelte.dev/e/svelte_boundary_reset_onerror");throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var t=!1,MJ=!1,h0=!1;var A=null;function ZJ(J){A=J}var a0=null;function cJ(J){a0=J}var R0=null;function DQ(J){R0=J}function B7(J,Q=!1,W){if(A={p:A,i:!1,c:null,e:null,s:J,x:null,r:O,l:MJ&&!Q?{s:null,u:null,$:[]}:null},P)A.function=W,R0=W}function H7(J){var Q=A,W=Q.e;if(W!==null){Q.e=null;for(var X of W)Y7(X)}if(J!==void 0)Q.x=J;if(Q.i=!0,A=Q.p,P)R0=A?.function??null;return J??{}}function g0(){return!MJ||A!==null&&A.l===null}var RJ=[];function s4(){var J=RJ;RJ=[],NQ(J)}function o(J){if(RJ.length===0&&!jJ){var Q=RJ;queueMicrotask(()=>{if(Q===RJ)s4()})}RJ.push(J)}function a4(){while(RJ.length>0)s4()}var M7=new WeakMap;function IQ(J){var Q=O;if(Q===null)return w.f|=k0,J;if(P&&J instanceof Error&&!M7.has(J))M7.set(J,G6(J,Q));if((Q.f&H0)===0&&(Q.f&_0)===0){if(P&&!Q.parent&&J instanceof Error)r4(J);throw J}v0(J,Q)}function v0(J,Q){if(Q!==null&&(Q.f&g)!==0)return;while(Q!==null){if((Q.f&fJ)!==0){if((Q.f&H0)===0)throw J;try{Q.b.error(J);return}catch(W){J=W}}Q=Q.parent}if(P&&J instanceof Error)r4(J);throw J}function G6(J,Q){let W=Y0(J,"message");if(W&&!W.configurable)return;var X=GQ?" ":"\t",z=`
40
+ ${X}in ${Q.fn?.name||"<unknown>"}`,Z=Q.ctx;while(Z!==null)z+=`
41
+ ${X}in ${Z.function?.[F0].split("/").pop()}`,Z=Z.p;return{message:J.message+`
42
+ ${z}
43
+ `,stack:J.stack?.split(`
44
+ `).filter((K)=>!K.includes("svelte/src/internal")).join(`
45
+ `)}}function r4(J){let Q=M7.get(J);if(Q)n(J,"message",{value:Q.message}),n(J,"stack",{value:Q.stack})}function RQ(J){return J===this.v}function jQ(J,Q){return J!=J?Q==Q:J!==Q||J!==null&&typeof J==="object"||typeof J==="function"}function TQ(J){return!jQ(J,this.v)}var $Q=null;function G0(J,Q){return J.label=Q,kQ(J.v,Q),J}function kQ(J,Q){return J?.[OQ]?.(Q),J}function m0(J){let Q=Error(),W=$6();if(W.length===0)return null;return W.unshift(`
46
+ `),n(Q,"stack",{value:W.join(`
47
+ `)}),n(Q,"name",{value:J}),Q}function $6(){let J=Error.stackTraceLimit;Error.stackTraceLimit=1/0;let Q=Error().stack;if(Error.stackTraceLimit=J,!Q)return[];let W=Q.split(`
48
+ `),X=[];for(let z=0;z<W.length;z++){let Z=W[z],K=Z.replaceAll("\\","/");if(Z.trim()==="Error")continue;if(Z.includes("validate_each_keys"))return[];if(K.includes("svelte/src/internal")||K.includes("node_modules/.vite"))continue;X.push(Z)}return X}function t4(J,Q){if(!P)throw Error("invariant(...) was not guarded by if (DEV)");if(!J)k4(Q)}function r0(J){var Q=w,W=O;f(null),p(null);try{return J()}finally{f(Q),p(W)}}function e4(J){let Q=0,W=q0(0),X;if(P)G0(W,"createSubscriber version");return()=>{if(VJ())R(W),e(()=>{if(Q===0)X=h(()=>J(()=>TJ(W)));return Q+=1,()=>{o(()=>{if(Q-=1,Q===0)X?.(),X=void 0,TJ(W)})}})}}var P6=~(I|m|x);function T(J,Q){J.f=J.f&P6|Q}function iJ(J){if((J.f&X0)!==0||J.deps===null)T(J,x);else T(J,m)}function J8(J){if(J===null)return;for(let Q of J){if((Q.f&b)===0||(Q.f&A0)===0)continue;Q.f^=A0,J8(Q.deps)}}function EQ(J,Q,W){if((J.f&I)!==0)Q.add(J);else if((J.f&m)!==0)W.add(J);J8(J.deps),T(J,x)}var U6=O0|l0;function O7(J,Q,W,X){new F7(J,Q,W,X)}class F7{parent;is_pending=!1;transform_error;#J;#Q=F?C:null;#W;#G;#Z;#K=null;#X=null;#$=null;#z=null;#M=0;#P=0;#U=!1;#B=new Set;#V=new Set;#q=null;#F=e4(()=>{if(this.#q=q0(this.#M),P)G0(this.#q,"$effect.pending()");return()=>{this.#q=null}});constructor(J,Q,W,X){if(this.#J=J,this.#W=Q,this.#G=(z)=>{var Z=O;Z.b=this,Z.f|=fJ,W(z)},this.parent=O.b,this.transform_error=X??this.parent?.transform_error??((z)=>z),this.#Z=w0(()=>{if(F){let z=this.#Q;l();let Z=z.data===BJ;if(z.data.startsWith(G7)){let G=JSON.parse(z.data.slice(G7.length));this.#w(G)}else if(Z)this.#C();else this.#L()}else this.#H()},U6),F)this.#J=C}#L(){try{this.#K=s(()=>this.#G(this.#J))}catch(J){this.error(J)}}#w(J){let Q=this.#W.failed,{reset:W,invoke_onerror:X}=this.#S(J);if(o(X),!Q)return;this.#$=s(()=>{Q(this.#J,()=>J,()=>W)})}#S(J){var Q=!1,W=!1;let X=()=>{if(Q){j4();return}if(Q=!0,W)i4();if(this.#$!==null)n0(this.#$,()=>{this.#$=null});this.#Y(()=>{this.#H()})};return{reset:X,invoke_onerror:()=>{try{W=!0,this.#W.onerror?.(J,X),W=!1}catch(Z){v0(Z,this.#Z&&this.#Z.parent)}}}}#C(){let J=this.#W.pending;if(!J)return;this.is_pending=!0,this.#X=s(()=>J(this.#J)),o(()=>{var Q=this.#z=document.createDocumentFragment(),W=a();if(Q.append(W),this.#K=this.#Y(()=>{return s(()=>this.#G(W))}),this.#P===0)this.#J.before(Q),this.#z=null,n0(this.#X,()=>{this.#X=null}),this.#O(S)})}#H(){try{if(this.is_pending=this.has_pending_snippet(),this.#P=0,this.#M=0,this.#K=s(()=>{this.#G(this.#J)}),this.#P>0){var J=this.#z=document.createDocumentFragment();oJ(this.#K,J);let Q=this.#W.pending;this.#X=s(()=>Q(this.#J))}else this.#O(S)}catch(Q){this.error(Q)}}#O(J){this.is_pending=!1,J.transfer_effects(this.#B,this.#V)}defer_effect(J){EQ(J,this.#B,this.#V)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#W.pending}#Y(J){var Q=O,W=w,X=A;p(this.#Z),f(this.#Z),ZJ(this.#Z.ctx);try{return K0.ensure(),J()}catch(z){return IQ(z),null}finally{p(Q),f(W),ZJ(X)}}#N(J,Q){if(!this.has_pending_snippet()){if(this.parent)this.parent.#N(J,Q);return}if(this.#P+=J,this.#P===0){if(this.#O(Q),this.#X)n0(this.#X,()=>{this.#X=null});if(this.#z)this.#J.before(this.#z),this.#z=null}}update_pending_count(J,Q){if(this.#N(J,Q),this.#M+=J,!this.#q||this.#U)return;this.#U=!0,o(()=>{if(this.#U=!1,this.#q)u0(this.#q,this.#M)})}get_effect_pending(){return this.#F(),R(this.#q)}error(J){if(!this.#W.onerror&&!this.#W.failed)throw J;if(S?.is_fork){if(this.#K)S.skip_effect(this.#K);if(this.#X)S.skip_effect(this.#X);if(this.#$)S.skip_effect(this.#$);S.oncommit(()=>{this.#A(J)})}else this.#A(J)}#A(J){if(this.#K)v(this.#K),this.#K=null;if(this.#X)v(this.#X),this.#X=null;if(this.#$)v(this.#$),this.#$=null;if(F)j(this.#Q),L7(),j(t0());let Q=this.#W.failed,W=(X)=>{let{reset:z,invoke_onerror:Z}=this.#S(X);if(Z(),Q)this.#$=this.#Y(()=>{try{return s(()=>{var K=O;K.b=this,K.f|=fJ,Q(this.#J,()=>X,()=>z)})}catch(K){return v0(K,this.#Z.parent),null}})};o(()=>{var X;try{X=this.transform_error(J)}catch(z){v0(z,this.#Z&&this.#Z.parent);return}if(X!==null&&typeof X==="object"&&typeof X.then==="function")X.then(W,(z)=>v0(z,this.#Z&&this.#Z.parent));else W(X)})}}function bQ(J,Q,W,X){let z=g0()?LJ:xJ;var Z=J.filter((U)=>!U.settled),K=Q.map(z);if(P)K.forEach((U,M)=>{U.label=Q[M].toString().replace("() => ","").replaceAll("$.eager(() => ","$state.eager(").replace(/\$\.get\((.+?)\)/g,(L,V)=>V)});if(W.length===0&&Z.length===0){X(K);return}var G=O,$=Q8(),Y=Z.length===1?Z[0].promise:Z.length>1?Promise.all(Z.map((U)=>U.promise)):null;function H(U){if((G.f&g)!==0)return;$();try{X([...K,...U])}catch(M){v0(M,G)}sJ()}var B=w7();if(W.length===0){Y.then(()=>H([])).finally(B);return}function q(){Promise.all(W.map((U)=>C7(U))).then(H).catch((U)=>v0(U,G)).finally(B)}if(Y)Y.then(()=>{$(),q(),sJ()});else q()}function Q8(){var J=O,Q=w,W=A,X=S;if(P)var z=a0;return function(K=!0){if(p(J),f(Q),ZJ(W),K&&(J.f&g)===0)X?.activate(),X?.apply();if(P)S7(null),cJ(z)}}function sJ(J=!0){if(p(null),f(null),ZJ(null),J)S?.deactivate();if(P)S7(null),cJ(null)}function w7(){var J=O,Q=J.b,W=S,X=!!Q?.is_rendered();return Q?.update_pending_count(1,W),W.increment(X,J),()=>{Q?.update_pending_count(-1,W),W.decrement(X,J)}}var S0=null;function S7(J){S0=J}var PQ=new Set;function LJ(J){var Q=b|I;if(O!==null)O.f|=l0;let W={ctx:A,deps:null,effects:null,equals:RQ,f:Q,fn:J,reactions:null,rv:0,v:y,wv:0,parent:O,ac:null};if(P&&h0)W.created=m0("created at");return W}var aJ=Symbol("obsolete");function C7(J,Q,W){let X=O;if(X===null)b4();var z=void 0,Z=q0(y);if(P)Z.label=Q??J.toString();var K=!w,G=new Set;if(z8(()=>{var $=O;if(P)S0={effect:$,effect_deps:new Set,warned:!1};var Y=AQ();z=Y.promise;try{Promise.resolve(J()).then(Y.resolve,(U)=>{if(U!==XJ)Y.reject(U)}).finally(sJ)}catch(U){Y.reject(U),sJ()}if(P){if(S0){if($.deps!==null)for(let U=0;U<M0;U+=1)S0.effect_deps.add($.deps[U]);if(J0!==null)for(let U=0;U<J0.length;U+=1)S0.effect_deps.add(J0[U])}S0=null}var H=S;if(K){if(($.f&H0)!==0)var B=w7();if(X.b?.is_rendered())H.async_deriveds.get($)?.reject(aJ);else for(let U of G.values())U.reject(aJ);G.add(Y),H.async_deriveds.set($,Y)}let q=(U,M=void 0)=>{if(P)S0=null;if(B?.(),G.delete(Y),M===aJ)return;if(H.activate(),M)Z.f|=k0,u0(Z,M);else{if((Z.f&k0)!==0)Z.f^=k0;if(P&&W!==void 0&&!Z.equals(U))PQ.add(Z),setTimeout(()=>{if(PQ.has(Z)&&($.f&g)===0)C4(Z.label,W),PQ.delete(Z)});u0(Z,U)}H.deactivate()};Y.promise.then(q,(U)=>q(null,U||"unknown"))}),$0(()=>{for(let $ of G)$.reject(aJ)}),P)Z.f|=D0;return new Promise(($)=>{function Y(H){function B(){if(H===z)$(Z);else Y(z)}H.then(B,B)}Y(z)})}function H6(J){let Q=LJ(J);if(!t)gQ(Q);return Q}function xJ(J){let Q=LJ(J);return Q.equals=TQ,Q}function W8(J){var Q=J.effects;if(Q!==null){J.effects=null;for(var W=0;W<Q.length;W+=1)v(Q[W])}}var N7=[];function UQ(J){var Q,W=O,X=J.parent;if(!j0&&X!==null&&J.v!==y&&(X.f&(g|_))!==0)return N4(),J.v;if(p(X),P){let z=kJ;yQ(new Set);try{if(YJ.call(N7,J))y4();N7.push(J),J.f&=~A0,W8(J),Q=hQ(J)}finally{p(W),yQ(z),N7.pop()}}else try{J.f&=~A0,W8(J),Q=hQ(J)}finally{p(W)}return Q}function A7(J){var Q=UQ(J);if(!J.equals(Q)){if(J.wv=rJ(),!S?.is_fork||J.deps===null){if(S!==null)S.capture(J,Q,!0),OJ?.capture(J,Q,!0);else J.v=Q;if(J.deps===null){T(J,x);return}}}if(j0)return;if(Q0!==null){if(VJ()||S?.is_fork)Q0.set(J,Q)}else iJ(J)}function X8(J){if(J.effects===null)return;for(let Q of J.effects)if(Q.teardown||Q.ac){if(Q.teardown?.(),Q.ac!==null)r0(()=>{Q.ac.abort(XJ),Q.ac=null});if(Q.fn!==null)Q.teardown=s0;EJ(Q,0),BQ(Q)}}function D7(J){if(J.effects===null)return;for(let Q of J.effects)if(Q.teardown&&Q.fn!==null)e0(Q)}var kJ=new Set,KJ=new Map;function yQ(J){kJ=J}var I7=!1;function Z8(){I7=!0}function q0(J,Q){var W={f:0,v:J,reactions:null,equals:RQ,rv:0,wv:0};if(P&&h0)W.created=Q??m0("created at"),W.updated=null,W.set_during_effect=!1,W.trace=null;return W}function JJ(J,Q){let W=q0(J,Q);return gQ(W),W}function bJ(J,Q=!1,W=!0){let X=q0(J);if(!Q)X.equals=TQ;if(MJ&&W&&A!==null&&A.l!==null)(A.l.s??=[]).push(X);return X}function P0(J,Q,W=!1){if(w!==null&&(!V0||(w.f&UJ)!==0)&&g0()&&(w.f&(b|W0|D0|UJ))!==0&&(f0===null||!f0.has(J)))c4();let X=W?GJ(Q):Q;if(P)kQ(X,J.label);return u0(J,X,HQ)}function u0(J,Q,W=null){if(!J.equals(Q)){KJ.set(J,j0?Q:J.v);var X=K0.ensure();if(X.capture(J,Q),P){if(h0||O!==null){J.updated??=new Map;let z=(J.updated.get("")?.count??0)+1;if(J.updated.set("",{error:null,count:z}),h0||z>5){let Z=m0("updated at");if(Z!==null){let K=J.updated.get(Z.stack);if(!K)K={error:Z,count:0},J.updated.set(Z.stack,K);K.count++}}}if(O!==null)J.set_during_effect=!0}if((J.f&b)!==0){let z=J;if((J.f&I)!==0)UQ(z);if(Q0===null)iJ(z)}if(J.wv=rJ(),K8(J,I,W),g0()&&O!==null&&(O.f&x)!==0&&(O.f&(c|B0))===0)if(T0===null)G8([J]);else T0.push(J);if(!X.is_fork&&kJ.size>0&&!I7)vQ()}return Q}function vQ(){I7=!1;for(let J of kJ){if((J.f&x)!==0)T(J,m);let Q;try{Q=FJ(J)}catch{Q=!0}if(Q)e0(J)}kJ.clear()}function TJ(J){P0(J,J.v+1)}function K8(J,Q,W){var X=J.reactions;if(X===null)return;var z=g0(),Z=X.length;for(var K=0;K<Z;K++){var G=X[K],$=G.f;if(!z&&G===O)continue;var Y=($&I)===0;if(Y)T(G,Q);if(($&UJ)!==0)kJ.add(G);else if(($&b)!==0){var H=G;if(Q0?.delete(H),($&A0)===0){if($&X0&&(O===null||(O.f&AJ)===0))G.f|=A0;K8(H,m,W)}}else if(Y){var B=G;if(($&W0)!==0&&E0!==null)E0.add(B);if(W!==null)W.push(B);else YQ(B)}}}var $8=!1,mQ=!1,IW=Symbol("unmounted");function R7(J){var Q=mQ;try{return mQ=!1,[J(),mQ]}finally{mQ=Q}}var uQ=null,nJ=null,S=null,OJ=null,Q0=null,x7=null,jJ=!1,j7=!1,yJ=null,HQ=null,q8=0,T7=new Set,V6=1;class K0{id=V6++;#J=!1;linked=!0;#Q=null;#W=null;async_deriveds=new Map;current=new Map;previous=new Map;#G=new Set;#Z=new Set;#K=0;#X=new Map;#$=null;#z=[];#M=[];#P=new Set;#U=new Set;#B=new Map;#V=new Set;is_fork=!1;#q=!1;constructor(){if(nJ===null)uQ=nJ=this;else nJ.#W=this,this.#Q=nJ;nJ=this}#F(){if(this.is_fork)return!0;for(let W of this.#X.keys()){var J=W,Q=!1;while(J.parent!==null){if(this.#B.has(J)){Q=!0;break}J=J.parent}if(!Q)return!0}return!1}skip_effect(J){if(!this.#B.has(J))this.#B.set(J,{d:[],m:[]});this.#V.delete(J)}unskip_effect(J,Q=(W)=>this.schedule(W)){var W=this.#B.get(J);if(W){this.#B.delete(J);for(var X of W.d)T(X,I),Q(X);for(X of W.m)T(X,m),Q(X)}this.#V.add(J)}#L(){if(this.#J=!0,q8++>1000)this.#Y(),L6();if(P)for(let G of this.current.keys())T7.add(G);for(let G of this.#P)this.#U.delete(G),T(G,I),this.schedule(G);for(let G of this.#U)T(G,m),this.schedule(G);let J=this.#z;this.#z=[],this.apply();var Q=yJ=[],W=[],X=HQ=[];for(let G of J)try{this.#w(G,Q,W)}catch($){if(H8(G),!this.#F())this.discard();throw $}if(S=null,X.length>0){var z=K0.ensure();for(let G of X)z.schedule(G)}if(yJ=null,HQ=null,this.#F()){this.#H(W),this.#H(Q);for(let[G,$]of this.#B)B8(G,$);if(X.length>0)S.#L();return}let Z=this.#S();if(Z){this.#H(W),this.#H(Q),Z.#C(this);return}this.#P.clear(),this.#U.clear();for(let G of this.#G)G(this);this.#G.clear(),OJ=this,P8(W),P8(Q),OJ=null,this.#$?.resolve();var K=S;if(this.#K===0&&(this.#z.length===0||K!==null)){if(this.#Y(),t)this.#O(),S=K}if(this.#z.length>0)if(K!==null){let G=K;G.#z.push(...this.#z.filter(($)=>!G.#z.includes($)))}else K=this;if(K!==null)K.#L()}#w(J,Q,W){J.f^=x;var X=J.first;while(X!==null){var z=X.f,Z=(z&(c|B0))!==0,K=Z&&(z&x)!==0,G=K||(z&_)!==0||this.#B.has(X);if(!G&&X.fn!==null){if(Z)X.f^=x;else if((z&_0)!==0)Q.push(X);else if(t&&(z&(PJ|NJ))!==0)W.push(X);else if(FJ(X)){if((z&W0)!==0)this.#U.add(X);e0(X)}var $=X.first;if($!==null){X=$;continue}}while(X!==null){var Y=X.next;if(Y!==null){X=Y;break}X=X.parent}}}#S(){var J=this.#Q;while(J!==null){if(!J.is_fork){for(let[Q,[,W]]of this.current)if(J.current.has(Q)&&!W)return J}J=J.#Q}return null}#C(J){for(let[W,X]of J.current){if(!this.previous.has(W)&&J.previous.has(W))this.previous.set(W,J.previous.get(W));this.current.set(W,X)}for(let[W,X]of J.async_deriveds){let z=this.async_deriveds.get(W);if(z)X.promise.then(z.resolve).catch(z.reject)}J.async_deriveds.clear(),this.transfer_effects(J.#P,J.#U);let Q=(W)=>{var X=W.reactions;if(X===null)return;if((W.f&b)!==0&&(W.f&(I|m))===0)return;for(let K of X){var z=K.f;if((z&b)!==0)Q(K);else{var Z=K;if(z&(D0|W0)&&!this.async_deriveds.has(Z))this.#U.delete(Z),T(Z,I),this.schedule(Z)}}};for(let W of this.current.keys())Q(W);this.oncommit(()=>J.discard()),J.#Y(),S=this,this.#L()}#H(J){for(var Q=0;Q<J.length;Q+=1)EQ(J[Q],this.#P,this.#U)}capture(J,Q,W=!1){if(J.v!==y&&!this.previous.has(J))this.previous.set(J,J.v);if((J.f&k0)===0)this.current.set(J,[Q,W]),Q0?.set(J,Q);if(!this.is_fork)J.v=Q}activate(){S=this}deactivate(){S=null,Q0=null}flush(){try{if(P)T7.clear();j7=!0,S=this,this.#L()}finally{if(q8=0,x7=null,yJ=null,HQ=null,j7=!1,S=null,Q0=null,KJ.clear(),P)for(let J of T7)J.updated=null}}discard(){for(let J of this.#Z)J(this);this.#Z.clear();for(let J of this.async_deriveds.values())J.reject(aJ);this.#Y(),this.#$?.resolve()}register_created_effect(J){this.#M.push(J)}#O(){for(let H=uQ;H!==null;H=H.#W){var J=H.id<this.id,Q=[];for(let[B,[q,U]]of this.current){if(H.current.has(B)){var W=H.current.get(B)[0];if(J&&q!==W)H.current.set(B,[q,U]);else continue}Q.push(B)}if(J)for(let[B,q]of this.async_deriveds){let U=H.async_deriveds.get(B);if(U)q.promise.then(U.resolve).catch(U.reject)}var X=[...H.current.keys()].filter((B)=>!H.current.get(B)[1]);if(!H.#J||X.length===0)continue;var z=X.filter((B)=>!this.current.has(B));if(z.length===0){if(J)H.discard()}else if(Q.length>0){if(P&&!H.#q)t4(H.#z.length===0,"Batch has scheduled roots");if(J)for(let B of this.#V)H.unskip_effect(B,(q)=>{if((q.f&(W0|D0))!==0)H.schedule(q);else H.#H([q])});H.activate();var Z=new Set,K=new Map;for(var G of Q)U8(G,z,Z,K);K=new Map;var $=[...H.current].filter(([B,q])=>{let U=this.current.get(B);if(!U)return!0;return U[0]!==q[0]||U[1]!==q[1]}).map(([B])=>B);if($.length>0){for(let B of this.#M)if((B.f&(g|_|UJ))===0&&k7(B,$,K))if((B.f&(D0|W0))!==0)T(B,I),H.schedule(B);else H.#P.add(B)}if(H.#z.length>0&&!H.#q){H.apply();for(var Y of H.#z)H.#w(Y,[],[]);H.#z=[]}H.deactivate()}}}increment(J,Q){if(this.#K+=1,J){let W=this.#X.get(Q)??0;this.#X.set(Q,W+1)}}decrement(J,Q){if(this.#K-=1,J){let W=this.#X.get(Q)??0;if(W===1)this.#X.delete(Q);else this.#X.set(Q,W-1)}if(this.#q)return;this.#q=!0,o(()=>{if(this.#q=!1,this.linked)this.flush()})}transfer_effects(J,Q){for(let W of J)this.#P.add(W);for(let W of Q)this.#U.add(W);J.clear(),Q.clear()}oncommit(J){this.#G.add(J)}ondiscard(J){this.#Z.add(J)}settled(){return(this.#$??=AQ()).promise}static ensure(){if(S===null){let J=S=new K0;if(!j7&&!jJ)o(()=>{if(!J.#J)J.flush()})}return S}apply(){if(!t||!this.is_fork&&this.#Q===null&&this.#W===null){Q0=null;return}Q0=new Map;for(let[Q,[W]]of this.current)Q0.set(Q,W);for(let Q=uQ;Q!==null;Q=Q.#W){if(Q===this||Q.is_fork)continue;var J=!1;if(Q.id<this.id)for(let[W,[,X]]of Q.current){if(X)continue;if(this.current.has(W)){J=!0;break}}if(!J){for(let[W,X]of Q.previous)if(!Q0.has(W))Q0.set(W,X)}}}schedule(J){if(x7=J,J.b?.is_pending&&(J.f&(_0|PJ|NJ))!==0&&(J.f&H0)===0){J.b.defer_effect(J);return}var Q=J;while(Q.parent!==null){Q=Q.parent;var W=Q.f;if(yJ!==null&&Q===O){if(t)return;if((w===null||(w.f&b)===0)&&!$8)return}if((W&(B0|c))!==0){if((W&x)===0)return;Q.f^=x}}this.#z.push(Q)}#Y(){if(!this.linked)return;var J=this.#Q,Q=this.#W;if(J===null)uQ=Q;else J.#W=Q;if(Q===null)nJ=J;else Q.#Q=J;this.linked=!1}}function tJ(J){var Q=jJ;jJ=!0;try{var W;if(J){if(S!==null&&!S.is_fork)S.flush();W=J()}while(!0){if(a4(),S===null)return W;S.flush()}}finally{jJ=Q}}function L6(){if(P){var J=new Map;for(let W of S.current.keys())for(let[X,z]of W.updated??[]){var Q=J.get(X);if(!Q)Q={error:z.error,count:0},J.set(X,Q);Q.count+=z.count}for(let W of J.values())if(W.error)console.error(W.error)}try{u4()}catch(W){if(P)n(W,"stack",{value:""});v0(W,x7)}}var E0=null;function P8(J){var Q=J.length;if(Q===0)return;var W=0;while(W<Q){var X=J[W++];if((X.f&(g|_))===0&&FJ(X)){if(E0=new Set,e0(X),X.deps===null&&X.first===null&&X.nodes===null&&X.teardown===null&&X.ac===null)E7(X);if(E0?.size>0){KJ.clear();for(let z of E0){if((z.f&(g|_))!==0)continue;let Z=[z],K=z.parent;while(K!==null){if(E0.has(K))E0.delete(K),Z.push(K);K=K.parent}for(let G=Z.length-1;G>=0;G--){let $=Z[G];if(($.f&(g|_))!==0)continue;e0($)}}E0.clear()}}}E0=null}function U8(J,Q,W,X){if(W.has(J))return;if(W.add(J),J.reactions!==null)for(let z of J.reactions){let Z=z.f;if((Z&b)!==0)U8(z,Q,W,X);else if((Z&(D0|W0))!==0&&(Z&I)===0&&k7(z,Q,X))T(z,I),YQ(z)}}function k7(J,Q,W){let X=W.get(J);if(X!==void 0)return X;if(J.deps!==null)for(let z of J.deps){if(YJ.call(Q,z))return!0;if((z.f&b)!==0&&k7(z,Q,W))return W.set(z,!0),!0}return W.set(J,!1),!1}function YQ(J){S.schedule(J)}function B8(J,Q){if((J.f&c)!==0&&(J.f&x)!==0)return;if((J.f&I)!==0)Q.d.push(J);else if((J.f&m)!==0)Q.m.push(J);T(J,x);var W=J.first;while(W!==null)B8(W,Q),W=W.next}function H8(J){T(J,x);var Q=J.first;while(Q!==null)H8(Q),Q=Q.next}function M8(J){if(O===null){if(w===null)m4(J);v4()}if(j0)g4(J)}function F6(J,Q){var W=Q.last;if(W===null)Q.last=Q.first=J;else W.next=J,J.prev=W,Q.last=J}function QJ(J,Q){var W=O;if(P)while(W!==null&&(W.f&UJ)!==0)W=W.parent;if(W!==null&&(W.f&_)!==0)J|=_;var X={ctx:A,deps:null,nodes:null,f:J|I|X0,first:null,fn:Q,last:null,next:null,parent:W,b:W&&W.b,prev:null,teardown:null,wv:0,ac:null};if(P)X.component_function=R0;S?.register_created_effect(X);var z=X;if((J&_0)!==0)if(yJ!==null)yJ.push(X);else K0.ensure().schedule(X);else if(Q!==null){try{e0(X)}catch(K){throw v(X),K}if(z.deps===null&&z.teardown===null&&z.nodes===null&&z.first===z.last&&(z.f&l0)===0){if(z=z.first,(J&W0)!==0&&(J&O0)!==0&&z!==null)z.f|=O0}}if(z!==null){if(z.parent=W,W!==null)F6(z,W);if(w!==null&&(w.f&b)!==0&&(J&B0)===0){var Z=w;(Z.effects??=[]).push(z)}}return X}function VJ(){return w!==null&&!V0}function $0(J){let Q=QJ(PJ,null);return T(Q,x),Q.teardown=J,Q}function y7(J){if(M8("$effect"),P)n(J,"name",{value:"$effect"});var Q=O.f,W=!w&&(Q&c)!==0&&A!==null&&!A.i;if(W){var X=A;(X.e??=[]).push(J)}else return Y7(J)}function Y7(J){return QJ(_0|G4,J)}function h7(J){K0.ensure();let Q=QJ(B0|l0,J);return()=>{v(Q)}}function V8(J){K0.ensure();let Q=QJ(B0|l0,J);return(W={})=>{return new Promise((X)=>{if(W.outro)n0(Q,()=>{v(Q),X(void 0)});else v(Q),X(void 0)})}}function L0(J){return QJ(_0,J)}function z8(J){return QJ(D0|l0,J)}function e(J,Q=0){return QJ(PJ|Q,J)}function g7(J,Q=[],W=[],X=[]){bQ(X,Q,W,(z)=>{QJ(PJ,()=>{J(...z.map(R))})})}function w0(J,Q=0){var W=QJ(W0|Q,J);if(P)W.dev_stack=a0;return W}function s(J){return QJ(c|l0,J)}function v7(J){var Q=J.teardown;if(Q!==null){let W=j0,X=w;b7(!0),f(null);try{Q.call(null)}finally{b7(W),f(X)}}}function BQ(J,Q=!1){var W=J.first;J.first=J.last=null;while(W!==null){let z=W.ac;if(z!==null)r0(()=>{z.abort(XJ)});var X=W.next;if((W.f&B0)!==0)W.parent=null;else v(W,Q);W=X}}function L8(J){var Q=J.first;while(Q!==null){var W=Q.next;if((Q.f&c)===0)v(Q);Q=W}}function v(J,Q=!0){var W=!1;if((Q||(J.f&W7)!==0)&&J.nodes!==null&&J.nodes.end!==null)m7(J.nodes.start,J.nodes.end),W=!0;J.f|=pJ,BQ(J,Q&&!W),EJ(J,0);var X=J.nodes&&J.nodes.t;if(X!==null)for(let Z of X)Z.stop();v7(J),J.f^=pJ,J.f|=g;var z=J.parent;if(z!==null&&z.first!==null)E7(J);if(P)J.component_function=null;J.next=J.prev=J.teardown=J.ctx=J.deps=J.fn=J.nodes=J.ac=J.b=null}function m7(J,Q){while(J!==null){var W=J===Q?null:r(J);J.remove(),J=W}}function E7(J){var{parent:Q,prev:W,next:X}=J;if(W!==null)W.next=X;if(X!==null)X.prev=W;if(Q!==null){if(Q.first===J)Q.first=X;if(Q.last===J)Q.last=W}}function n0(J,Q,W=!0){var X=[];O8(J,X,!0);var z=()=>{if(W)v(J);if(Q)Q()},Z=X.length;if(Z>0){var K=()=>--Z||z();for(var G of X)G.out(K)}else z()}function O8(J,Q,W){if((J.f&_)!==0)return;J.f^=_;var X=J.nodes&&J.nodes.t;if(X!==null){for(let G of X)if(G.is_global||W)Q.push(G)}var z=J.first;while(z!==null){var Z=z.next;if((z.f&B0)===0){var K=(z.f&O0)!==0||(z.f&c)!==0&&(J.f&W0)!==0;O8(z,Q,K?W:!1)}z=Z}}function eJ(J){F8(J,!0)}function F8(J,Q){if((J.f&_)===0)return;if(J.f^=_,(J.f&x)===0)T(J,I),K0.ensure().schedule(J);var W=J.first;while(W!==null){var X=W.next,z=(W.f&O0)!==0||(W.f&c)!==0;F8(W,z?Q:!1),W=X}var Z=J.nodes&&J.nodes.t;if(Z!==null){for(let K of Z)if(K.is_global||Q)K.in()}}function oJ(J,Q){if(!J.nodes)return;var W=J.nodes.start,X=J.nodes.end;while(W!==null){var z=W===X?null:r(W);Q.append(W),W=z}}var w8=null;var fQ=!1,j0=!1;function b7(J){j0=J}var w=null,V0=!1;function f(J){w=J}var O=null;function p(J){O=J}var f0=null;function gQ(J){if(w!==null&&(!t||(w.f&b)!==0))(f0??=new Set).add(J)}var J0=null,M0=0,T0=null;function G8(J){T0=J}var S8=1,hJ=0,wJ=hJ;function u7(J){wJ=J}function rJ(){return++S8}function FJ(J){var Q=J.f;if((Q&I)!==0)return!0;if(Q&b)J.f&=~A0;if((Q&m)!==0){var W=J.deps,X=W.length;for(var z=0;z<X;z++){var Z=W[z];if(FJ(Z))A7(Z);if(Z.wv>J.wv)return!0}if((Q&X0)!==0&&Q0===null)T(J,x)}return!1}function C8(J,Q,W=!0){var X=J.reactions;if(X===null)return;if(!t&&f0!==null&&f0.has(J))return;for(var z=0;z<X.length;z++){var Z=X[z];if((Z.f&b)!==0)C8(Z,Q,!1);else if(Q===Z){if(W)T(Z,I);else if((Z.f&x)!==0)T(Z,m);YQ(Z)}}}function hQ(J){var Q=J0,W=M0,X=T0,z=w,Z=f0,K=A,G=V0,$=wJ,Y=J.f;if(J0=null,M0=0,T0=null,w=(Y&(c|B0))===0?J:null,f0=null,ZJ(J.ctx),V0=!1,wJ=++hJ,J.ac!==null)r0(()=>{J.ac.abort(XJ)}),J.ac=null;try{J.f|=AJ;var H=J.fn,B=H();J.f|=H0;var q=J.deps,U=S?.is_fork;if(J0!==null){var M;if(!U)EJ(J,M0);if(q!==null&&M0>0){q.length=M0+J0.length;for(M=0;M<J0.length;M++)q[M0+M]=J0[M]}else J.deps=q=J0;if(VJ()&&(J.f&X0)!==0)for(M=M0;M<q.length;M++)(q[M].reactions??=[]).push(J)}else if(!U&&q!==null&&M0<q.length)EJ(J,M0),q.length=M0;if(g0()&&T0!==null&&!V0&&q!==null&&(J.f&(b|m|I))===0)for(M=0;M<T0.length;M++)C8(T0[M],J);if(z!==null&&z!==J){if(hJ++,z.deps!==null)for(let L=0;L<W;L+=1)z.deps[L].rv=hJ;if(Q!==null)for(let L of Q)L.rv=hJ;if(T0!==null)if(X===null)X=T0;else X.push(...T0)}if((J.f&k0)!==0)J.f^=k0;return B}catch(L){return IQ(L)}finally{J.f^=AJ,J0=Q,M0=W,T0=X,w=z,f0=Z,ZJ(K),V0=G,wJ=$}}function w6(J,Q){let W=Q.reactions;if(W!==null){var X=T4.call(W,J);if(X!==-1){var z=W.length-1;if(z===0)W=Q.reactions=null;else W[X]=W[z],W.pop()}}if(W===null&&(Q.f&b)!==0&&(J0===null||!YJ.call(J0,Q))){var Z=Q;if((Z.f&X0)!==0)Z.f^=X0,Z.f&=~A0;if(Z.v!==y)iJ(Z);if(Z.ac!==null)r0(()=>{Z.ac.abort(XJ),Z.ac=null,T(Z,I)});X8(Z),EJ(Z,0)}}function EJ(J,Q){var W=J.deps;if(W===null)return;for(var X=Q;X<W.length;X++)w6(J,W[X])}function e0(J){var Q=J.f;if((Q&g)!==0)return;T(J,x);var W=O,X=fQ;if(O=J,fQ=(Q&(c|B0))===0,P){var z=R0;DQ(J.component_function);var Z=a0;cJ(J.dev_stack??a0)}try{if((Q&(W0|NJ))!==0)L8(J);else BQ(J);v7(J);var K=hQ(J);if(J.teardown=typeof K==="function"?K:null,J.wv=S8,P&&h0&&(J.f&I)!==0&&J.deps!==null){for(var G of J.deps)if(G.set_during_effect)G.wv=rJ(),G.set_during_effect=!1}}finally{if(fQ=X,O=W,P)DQ(z),cJ(Z)}}function R(J){var Q=J.f,W=(Q&b)!==0;if(w8?.add(J),w!==null&&!V0){var X=O!==null&&(O.f&g)!==0;if(!X&&(f0===null||!f0.has(J))){var z=w.deps;if((w.f&AJ)!==0){if(J.rv<hJ)if(J.rv=hJ,J0===null&&z!==null&&z[M0]===J)M0++;else if(J0===null)J0=[J];else J0.push(J)}else{if(w.deps??=[],!YJ.call(w.deps,J))w.deps.push(J);var Z=J.reactions;if(Z===null)J.reactions=[w];else if(!YJ.call(Z,w))Z.push(w)}}}if(P){if(!V0&&S0&&S===null&&OJ===null&&!S0.warned&&(S0.effect.f&AJ)===0&&!S0.effect_deps.has(J)){S0.warned=!0,S4(J.label);var K=m0("traced at");if(K)console.warn(K)}if(PQ.delete(J),h0&&!V0&&$Q!==null&&w!==null&&$Q.reaction===w){if(J.trace)J.trace();else if(K=m0("traced at"),K){var G=$Q.entries.get(J);if(G===void 0)G={traces:[]},$Q.entries.set(J,G);var $=G.traces[G.traces.length-1];if(K.stack!==$?.stack)G.traces.push(K)}}}if(j0&&KJ.has(J))return KJ.get(J);if(W){var Y=J;if(j0){var H=Y.v;if((Y.f&x)===0&&Y.reactions!==null||A8(Y))H=UQ(Y);return KJ.set(Y,H),H}var B=(Y.f&X0)===0&&!V0&&w!==null&&(fQ||(w.f&X0)!==0),q=(Y.f&H0)===0;if(FJ(Y)){if(B)Y.f|=X0;A7(Y)}if(B&&!q)D7(Y),N8(Y)}if(Q0?.has(J))return Q0.get(J);if((J.f&k0)!==0)throw J.v;return J.v}function N8(J){if(J.f|=X0,J.deps===null)return;for(let Q of J.deps)if((Q.reactions??=[]).push(J),(Q.f&b)!==0&&(Q.f&X0)===0)D7(Q),N8(Q)}function A8(J){if(J.v===y)return!0;if(J.deps===null)return!1;for(let Q of J.deps){if(KJ.has(Q))return!0;if((Q.f&b)!==0&&A8(Q))return!0}return!1}function h(J){var Q=V0;try{return V0=!0,J()}finally{V0=Q}}function dQ(J){if(typeof J!=="object"||!J||J instanceof EventTarget)return;if(i in J)pQ(J);else if(!Array.isArray(J))for(let Q in J){let W=J[Q];if(typeof W==="object"&&W&&i in W)pQ(W)}}function pQ(J,Q=new Set){if(typeof J==="object"&&J!==null&&!(J instanceof EventTarget)&&!Q.has(J)){if(Q.add(J),J instanceof Date)J.getTime();for(let X in J)try{pQ(J[X],Q)}catch(z){}let W=IJ(J);if(W!==Object.prototype&&W!==Array.prototype&&W!==Map.prototype&&W!==Set.prototype&&W!==Date.prototype){let X=CQ(W);for(let z in X){let Z=X[z].get;if(Z)try{Z.call(J)}catch(K){}}}}}var S6=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function GJ(J){if(typeof J!=="object"||J===null||i in J)return J;let Q=IJ(J);if(Q!==q7&&Q!==x4)return J;var W=new Map,X=zJ(J),z=JJ(0),Z=P&&h0?m0("created at"):null,K=wJ,G=(B)=>{if(wJ===K)return B();var q=w,U=wJ;f(null),u7(K);var M=B();return f(q),u7(U),M};if(X){if(W.set("length",JJ(J.length,Z)),P)J=N6(J)}var $="";let Y=!1;function H(B){if(Y)return;Y=!0,$=B,G0(z,`${$} version`);for(let[q,U]of W)G0(U,gJ($,q));Y=!1}return new Proxy(J,{defineProperty(B,q,U){if(!("value"in U)||U.configurable===!1||U.enumerable===!1||U.writable===!1)_4();var M=W.get(q);if(M===void 0)G(()=>{var L=JJ(U.value,Z);if(W.set(q,L),P&&typeof q==="string")G0(L,gJ($,q));return L});else P0(M,U.value,!0);return!0},deleteProperty(B,q){var U=W.get(q);if(U===void 0){if(q in B){let M=G(()=>JJ(y,Z));if(W.set(q,M),TJ(z),P)G0(M,gJ($,q))}}else P0(U,y),TJ(z);return!0},get(B,q,U){if(q===i)return J;if(P&&q===OQ)return H;var M=W.get(q),L=q in B;if(M===void 0&&(!L||Y0(B,q)?.writable))M=G(()=>{var N=GJ(L?B[q]:y),k=JJ(N,Z);if(P)G0(k,gJ($,q));return k}),W.set(q,M);if(M!==void 0){var V=R(M);return V===y?void 0:V}return Reflect.get(B,q,U)},getOwnPropertyDescriptor(B,q){var U=Reflect.getOwnPropertyDescriptor(B,q);if(U&&"value"in U){var M=W.get(q);if(M)U.value=R(M)}else if(U===void 0){var L=W.get(q),V=L?.v;if(L!==void 0&&V!==y)return{enumerable:!0,configurable:!0,value:V,writable:!0}}return U},has(B,q){if(q===i)return!0;var U=W.get(q),M=U!==void 0&&U.v!==y||Reflect.has(B,q);if(U!==void 0||O!==null&&(!M||Y0(B,q)?.writable)){if(U===void 0)U=G(()=>{var V=M?GJ(B[q]):y,N=JJ(V,Z);if(P)G0(N,gJ($,q));return N}),W.set(q,U);var L=R(U);if(L===y)return!1}return M},set(B,q,U,M){var L=W.get(q),V=q in B;if(X&&q==="length")for(var N=U;N<L.v;N+=1){var k=W.get(N+"");if(k!==void 0)P0(k,y);else if(N in B){if(k=G(()=>JJ(y,Z)),W.set(N+"",k),P)G0(k,gJ($,N))}}if(L===void 0){if(!V||Y0(B,q)?.writable){if(L=G(()=>JJ(void 0,Z)),P)G0(L,gJ($,q));P0(L,GJ(U)),W.set(q,L)}}else{V=L.v!==y;var E=G(()=>GJ(U));P0(L,E)}var D=Reflect.getOwnPropertyDescriptor(B,q);if(D?.set)D.set.call(M,U);if(!V){if(X&&typeof q==="string"){var x0=W.get("length"),U0=Number(q);if(Number.isInteger(U0)&&U0>=x0.v)P0(x0,U0+1)}TJ(z)}return!0},ownKeys(B){R(z);var q=Reflect.ownKeys(B).filter((L)=>{var V=W.get(L);return V===void 0||V.v!==y});for(var[U,M]of W)if(M.v!==y&&!(U in B))q.push(U);return q},setPrototypeOf(){l4()}})}function gJ(J,Q){if(typeof Q==="symbol")return`${J}[Symbol(${Q.description??""})]`;if(S6.test(Q))return`${J}.${Q}`;return/^\d+$/.test(Q)?`${J}[${Q}]`:`${J}['${Q}']`}function _Q(J){try{if(J!==null&&typeof J==="object"&&i in J)return J[i]}catch{}return J}var C6=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function N6(J){return new Proxy(J,{get(Q,W,X){var z=Reflect.get(Q,W,X);if(!C6.has(W))return z;return function(...Z){Z8();var K=z.apply(this,Z);return vQ(),K}}})}function D8(){let{prototype:J,__svelte_cleanup:Q}=Array;if(Q)Q();let{indexOf:W,lastIndexOf:X,includes:z}=J;J.indexOf=function(Z,K){let G=W.call(this,Z,K);if(G===-1){for(let $=K??0;$<this.length;$+=1)if(_Q(this[$])===Z){SQ("array.indexOf(...)");break}}return G},J.lastIndexOf=function(Z,K){let G=X.call(this,Z,K??this.length-1);if(G===-1){for(let $=0;$<=(K??this.length-1);$+=1)if(_Q(this[$])===Z){SQ("array.lastIndexOf(...)");break}}return G},J.includes=function(Z,K){let G=z.call(this,Z,K);if(!G){for(let $=0;$<this.length;$+=1)if(_Q(this[$])===Z){SQ("array.includes(...)");break}}return G},Array.__svelte_cleanup=()=>{J.indexOf=W,J.lastIndexOf=X,J.includes=z}}var f7,I8,GQ,R8,j8;function lQ(){if(f7!==void 0)return;f7=window,I8=document,GQ=/Firefox/.test(navigator.userAgent);var J=Element.prototype,Q=Node.prototype,W=Text.prototype;if(R8=Y0(Q,"firstChild").get,j8=Y0(Q,"nextSibling").get,P7(J))J[WQ]=void 0,J[FQ]=null,J[XQ]=void 0,J.__e=void 0;if(P7(W))W[zQ]=void 0;if(P)J.__svelte_meta=null,D8()}function a(J=""){return document.createTextNode(J)}function u(J){return R8.call(J)}function r(J){return j8.call(J)}function A6(J,Q){if(!F)return u(J);var W=u(C);if(W===null)W=C.appendChild(a());else if(Q&&W.nodeType!==dJ){var X=a();return W?.before(X),j(X),X}if(Q)iQ(W);return j(W),W}function D6(J,Q=!1){if(!F){var W=u(J);if(W instanceof Comment&&W.data==="")return r(W);return W}if(Q){if(C?.nodeType!==dJ){var X=a();return C?.before(X),j(X),X}iQ(C)}return C}function I6(J,Q=1,W=!1){let X=F?C:J;var z;while(Q--)z=X,X=r(X);if(!F)return X;if(W){if(X?.nodeType!==dJ){var Z=a();if(X===null)z?.after(Z);else X.before(Z);return j(Z),Z}iQ(X)}return j(X),X}function qQ(J){J.textContent=""}function cQ(){if(!t)return!1;if(E0!==null)return!1;var J=O.f;return(J&H0)!==0}function p0(J,Q,W){if(Q==null||Q===wQ)return W?document.createElement(J,{is:W}):document.createElement(J);return W?document.createElementNS(Q,J,{is:W}):document.createElementNS(Q,J)}function iQ(J){if(J.nodeValue.length<65536)return;let Q=J.nextSibling;while(Q!==null&&Q.nodeType===dJ)Q.remove(),J.nodeValue+=Q.nodeValue,Q=J.nextSibling}var F=!1;function d(J){F=J}var C;function j(J){if(J===null)throw HJ(),c0;return C=J}function l(){return j(r(C))}function T8(J){if(!F)return;if(r(C)!==null)throw HJ(),c0;C=J}function L7(J=1){if(F){var Q=J,W=C;while(Q--)W=r(W);C=W}}function t0(J=!0){var Q=0,W=C;while(!0){if(W.nodeType===I0){var X=W.data;if(X===DJ){if(Q===0)return W;Q-=1}else if(X===_J||X===BJ||X[0]==="["&&!isNaN(Number(X.slice(1))))Q+=1}var z=r(W);if(J)W.remove();W=z}}function MQ(J){if(!J||J.nodeType!==I0)throw HJ(),c0;return J.data}var JQ=Symbol("events"),p7=new Set,oQ=new Set;function k8(J,Q,W){(Q[JQ]??={})[J]=W}function E8(J){for(var Q=0;Q<J.length;Q++)p7.add(J[Q]);for(var W of oQ)W(J)}var x8=null;function d7(J){var Q=this,W=Q.ownerDocument,X=J.type,z=J.composedPath?.()||[],Z=z[0]||J.target;x8=J;var K=0,G=x8===J&&J[JQ];if(G){var $=z.indexOf(G);if($!==-1&&(Q===document||Q===window)){J[JQ]=Q;return}var Y=z.indexOf(Q);if(Y===-1)return;if($<=Y)K=$}if(Z=z[K]||J.target,Z===Q)return;n(J,"currentTarget",{configurable:!0,get(){return Z||W}});var H=w,B=O;f(null),p(null);try{var q,U=[];while(Z!==null){if(Z===Q)break;try{var M=Z[JQ]?.[X];if(M!=null&&(!Z.disabled||J.target===Z))M.call(Z,J)}catch(L){if(q)U.push(L);else q=L}if(J.cancelBubble)break;K++,Z=K<z.length?z[K]:null}if(q){for(let L of U)queueMicrotask(()=>{throw L});throw q}}finally{J[JQ]=Q,delete J.currentTarget,f(H),p(B)}}var R6=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:(J)=>{return J}});function b8(J){return R6?.createHTML(J)??J}function _7(J){var Q=p0("template");return Q.innerHTML=b8(J.replaceAll("<!>","<!---->")),Q.content}function C0(J,Q){var W=O;if(W.nodes===null)W.nodes={start:J,end:Q,a:null,t:null}}function x6(J,Q){var W=(Q&O4)!==0,X=(Q&F4)!==0,z,Z=!J.startsWith("<!>");return()=>{if(F)return C0(C,null),C;if(z===void 0){if(z=_7(Z?J:"<!>"+J),!W)z=u(z)}var K=X||GQ?document.importNode(z,!0):z.cloneNode(!0);if(W){var G=u(K),$=K.lastChild;C0(G,$)}else C0(K,K);return K}}function k6(){if(F)return C0(C,null),C;var J=document.createDocumentFragment(),Q=document.createComment(""),W=a();return J.append(Q,W),C0(Q,W),J}function l7(J,Q){if(F){var W=O;if((W.f&H0)===0||W.nodes.end===null)W.nodes.end=C;l();return}if(J===null)return;J.before(Q)}var E6=/\r/g;function y8(J){J=J.replace(E6,"");let Q=5381,W=J.length;while(W--)Q=(Q<<5)-Q^J.charCodeAt(W);return(Q>>>0).toString(36)}var b6=["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 N2=[...b6,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var y6=["touchstart","touchmove"];function h8(J){return y6.includes(J)}var h6=["$state","$state.raw","$derived","$derived.by"],A2=[...h6,"$state.eager","$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$effect.pending","$inspect","$inspect().with","$inspect.trace","$host"];function sQ(J){return J?.replace(/\//g,"/​")}var c7=!0;function g6(J,Q){var W=Q==null?"":typeof Q==="object"?`${Q}`:Q;if(W!==(J[zQ]??=J.nodeValue))J[zQ]=W,J.nodeValue=`${W}`}function rQ(J,Q){return g8(J,Q)}function o7(J,Q){lQ(),Q.intro=Q.intro??!1;let W=Q.target,X=F,z=C;try{var Z=u(W);while(Z&&(Z.nodeType!==I0||Z.data!==_J))Z=r(Z);if(!Z)throw c0;d(!0),j(Z);let K=g8(J,{...Q,anchor:Z});return d(!1),K}catch(K){if(K instanceof Error&&K.message.split(`
49
+ `).some((G)=>G.startsWith("https://svelte.dev/e/")))throw K;if(K!==c0)console.warn("Failed to hydrate: ",K);if(Q.recover===!1)f4();return lQ(),qQ(W),d(!1),rQ(J,Q)}finally{d(X),j(z)}}var aQ=new Map;function g8(J,{target:Q,anchor:W,props:X={},events:z,context:Z,intro:K=!0,transformError:G}){lQ();var $=void 0,Y=V8(()=>{var H=W??Q.appendChild(a());O7(H,{pending:()=>{}},(U)=>{B7({});var M=A;if(Z)M.c=Z;if(z)X.$$events=z;if(F)C0(U,null);if(c7=K,$=J(U,X)||{},c7=!0,F){if(O.nodes.end=C,C===null||C.nodeType!==I0||C.data!==DJ)throw HJ(),c0}H7()},G);var B=new Set,q=(U)=>{for(var M=0;M<U.length;M++){var L=U[M];if(B.has(L))continue;B.add(L);var V=h8(L);for(let E of[Q,document]){var N=aQ.get(E);if(N===void 0)N=new Map,aQ.set(E,N);var k=N.get(L);if(k===void 0)E.addEventListener(L,d7,{passive:V}),N.set(L,1);else N.set(L,k+1)}}};return q(lJ(p7)),oQ.add(q),()=>{for(var U of B)for(let V of[Q,document]){var M=aQ.get(V),L=M.get(U);if(--L==0){if(V.removeEventListener(U,d7),M.delete(U),M.size===0)aQ.delete(V)}else M.set(U,L)}if(oQ.delete(q),H!==W)H.parentNode?.removeChild(H)}});return i7.set($,Y),$}var i7=new WeakMap;function s7(J,Q){let W=i7.get(J);if(W)return i7.delete(J),W(Q);if(P)if(i in J)R4();else I4();return Promise.resolve()}var v8=new Map;function m8(J,Q){var W=v8.get(J);if(!W)W=new Set,v8.set(J,W);W.add(Q)}class $J{anchor;#J=new Map;#Q=new Map;#W=new Map;#G=new Set;#Z=!0;constructor(J,Q=!0){this.anchor=J,this.#Z=Q}#K=(J)=>{if(!this.#J.has(J))return;var Q=this.#J.get(J),W=this.#Q.get(Q);if(W)eJ(W),this.#G.delete(Q);else{var X=this.#W.get(Q);if(X){if(eJ(X.effect),this.#Q.set(Q,X.effect),this.#W.delete(Q),P)X.fragment.lastChild[z7]=this.anchor;X.fragment.lastChild.remove(),this.anchor.before(X.fragment),W=X.effect}}for(let[z,Z]of this.#J){if(this.#J.delete(z),z===J)break;let K=this.#W.get(Z);if(K)v(K.effect),this.#W.delete(Z)}for(let[z,Z]of this.#Q){if(z===Q||this.#G.has(z))continue;let K=()=>{if(Array.from(this.#J.values()).includes(z)){var $=document.createDocumentFragment();oJ(Z,$),$.append(a()),this.#W.set(z,{effect:Z,fragment:$})}else v(Z);this.#G.delete(z),this.#Q.delete(z)};if(this.#Z||!W)this.#G.add(z),n0(Z,K,!1);else K()}};#X=(J)=>{this.#J.delete(J);let Q=Array.from(this.#J.values());for(let[W,X]of this.#W)if(!Q.includes(W))v(X.effect),this.#W.delete(W)};ensure(J,Q){var W=S,X=cQ();if(Q&&!this.#Q.has(J)&&!this.#W.has(J))if(X){var z=document.createDocumentFragment(),Z=a();z.append(Z),this.#W.set(J,{effect:s(()=>Q(Z)),fragment:z})}else this.#Q.set(J,s(()=>Q(this.anchor)));if(this.#J.set(W,J),X){for(let[K,G]of this.#Q)if(K===J)W.unskip_effect(G);else W.skip_effect(G);for(let[K,G]of this.#W)if(K===J)W.unskip_effect(G.effect);else W.skip_effect(G.effect);W.oncommit(this.#K),W.ondiscard(this.#X)}else{if(F)this.anchor=C;this.#K(W)}}}function u6(J,Q,W=!1){var X;if(F)X=C,l();var z=new $J(J),Z=W?O0:0;function K(G,$){if(F){var Y=MQ(X);if(G!==parseInt(Y.substring(1))){var H=t0();j(H),z.anchor=H,d(!1),z.ensure(G,$),d(!0);return}}z.ensure(G,$)}w0(()=>{var G=!1;if(Q(($,Y=0)=>{G=!0,K(Y,$)}),!G)K(-1,null)},Z)}var f6=Symbol("NaN");function p6(J,Q,W){if(F)l();var X=new $J(J),z=!g0();w0(()=>{var Z=Q();if(Z!==Z)Z=f6;if(z&&Z!==null&&typeof Z==="object")Z={};X.ensure(Z,W)})}function d6(J,Q,W){var X=[],z=Q.length,Z,K=Q.length;for(var G=0;G<z;G++){let B=Q[G];n0(B,()=>{if(Z){if(Z.pending.delete(B),Z.done.add(B),Z.pending.size===0){var q=J.outrogroups;if(a7(J,lJ(Z.done)),q.delete(Z),q.size===0)J.outrogroups=null}}else K-=1},!1)}if(K===0){var $=X.length===0&&W!==null;if($){var Y=W,H=Y.parentNode;qQ(H),H.append(Y),J.items.clear()}a7(J,Q,!$)}else Z={pending:new Set(Q),done:new Set},(J.outrogroups??=new Set).add(Z)}function a7(J,Q,W=!0){var X;if(J.pending.size>0){X=new Set;for(let K of J.pending.values())for(let G of K)X.add(J.items.get(G).e)}for(var z=0;z<Q.length;z++){var Z=Q[z];if(X?.has(Z)){Z.f|=y0;let K=document.createDocumentFragment();oJ(Z,K)}else v(Q[z],W)}}var f8;function _6(J,Q,W,X,z,Z=null){var K=J,G=new Map,$=(Q&K7)!==0;if($){var Y=J;K=F?j(u(Y)):Y.appendChild(a())}if(F)l();var H=null,B=xJ(()=>{var E=W();return zJ(E)?E:E==null?[]:lJ(E)});if(P)G0(B,"{#each ...}");var q,U=new Map,M=!0;function L(E){if((k.effect.f&g)!==0)return;if(k.pending.delete(E),k.fallback=H,l6(k,q,K,Q,X),H!==null)if(q.length===0)if((H.f&y0)===0)eJ(H);else H.f^=y0,LQ(H,null,K);else n0(H,()=>{H=null})}function V(E){k.pending.delete(E)}var N=w0(()=>{q=R(B);var E=q.length;let D=!1;if(F){var x0=MQ(K)===BJ;if(x0!==(E===0))K=t0(),j(K),d(!1),D=!0}var U0=new Set,N0=S,mJ=cQ();for(var d0=0;d0<E;d0+=1){if(F&&C.nodeType===I0&&C.data===DJ)K=C,D=!0,d(!1);var b0=q[d0],uJ=X(b0,d0);if(P){var Z4=X(b0,d0);if(uJ!==Z4)h4(String(d0),String(uJ),String(Z4))}var WJ=M?null:G.get(uJ);if(WJ){if(WJ.v)u0(WJ.v,b0);if(WJ.i)u0(WJ.i,d0);if(mJ)N0.unskip_effect(WJ.e)}else{if(WJ=c6(G,M?K:f8??=a(),b0,uJ,d0,z,Q,W),!M)WJ.e.f|=y0;G.set(uJ,WJ)}U0.add(uJ)}if(E===0&&Z&&!H)if(M)H=s(()=>Z(K));else H=s(()=>Z(f8??=a())),H.f|=y0;if(E>U0.size)if(P)i6(q,X);else U7("","","");if(F&&E>0)j(t0());if(!M)if(U.set(N0,U0),mJ){for(let[Z6,K6]of G)if(!U0.has(Z6))N0.skip_effect(K6.e);N0.oncommit(L),N0.ondiscard(V)}else L(N0);if(D)d(!0);R(B)}),k={effect:N,flags:Q,items:G,pending:U,outrogroups:null,fallback:H};if(M=!1,F)K=C}function VQ(J){while(J!==null&&(J.f&c)===0)J=J.next;return J}function l6(J,Q,W,X,z){var Z=(X&U4)!==0,K=Q.length,G=J.items,$=VQ(J.effect.first),Y,H=null,B,q=[],U=[],M,L,V,N;if(Z){for(N=0;N<K;N+=1)if(M=Q[N],L=z(M,N),V=G.get(L).e,(V.f&y0)===0)V.nodes?.a?.measure(),(B??=new Set).add(V)}for(N=0;N<K;N+=1){if(M=Q[N],L=z(M,N),V=G.get(L).e,J.outrogroups!==null)for(let b0 of J.outrogroups)b0.pending.delete(V),b0.done.delete(V);if((V.f&_)!==0){if(eJ(V),Z)V.nodes?.a?.unfix(),(B??=new Set).delete(V)}if((V.f&y0)!==0)if(V.f^=y0,V===$)LQ(V,null,W);else{var k=H?H.next:$;if(V===J.effect.last)J.effect.last=V.prev;if(V.prev)V.prev.next=V.next;if(V.next)V.next.prev=V.prev;SJ(J,H,V),SJ(J,V,k),LQ(V,k,W),H=V,q=[],U=[],$=VQ(H.next);continue}if(V!==$){if(Y!==void 0&&Y.has(V)){if(q.length<U.length){var E=U[0],D;H=E.prev;var x0=q[0],U0=q[q.length-1];for(D=0;D<q.length;D+=1)LQ(q[D],E,W);for(D=0;D<U.length;D+=1)Y.delete(U[D]);SJ(J,x0.prev,U0.next),SJ(J,H,x0),SJ(J,U0,E),$=E,H=U0,N-=1,q=[],U=[]}else Y.delete(V),LQ(V,$,W),SJ(J,V.prev,V.next),SJ(J,V,H===null?J.effect.first:H.next),SJ(J,H,V),H=V;continue}q=[],U=[];while($!==null&&$!==V)(Y??=new Set).add($),U.push($),$=VQ($.next);if($===null)continue}if((V.f&y0)===0)q.push(V);H=V,$=VQ(V.next)}if(J.outrogroups!==null){for(let b0 of J.outrogroups)if(b0.pending.size===0)a7(J,lJ(b0.done)),J.outrogroups?.delete(b0);if(J.outrogroups.size===0)J.outrogroups=null}if($!==null||Y!==void 0){var N0=[];if(Y!==void 0){for(V of Y)if((V.f&_)===0)N0.push(V)}while($!==null){if(($.f&_)===0&&$!==J.fallback)N0.push($);$=VQ($.next)}var mJ=N0.length;if(mJ>0){var d0=(X&K7)!==0&&K===0?W:null;if(Z){for(N=0;N<mJ;N+=1)N0[N].nodes?.a?.measure();for(N=0;N<mJ;N+=1)N0[N].nodes?.a?.fix()}d6(J,N0,d0)}}if(Z)o(()=>{if(B===void 0)return;for(V of B)V.nodes?.a?.apply()})}function c6(J,Q,W,X,z,Z,K,G){var $=(K&q4)!==0?(K&B4)===0?bJ(W,!1,!1):q0(W):null,Y=(K&P4)!==0?q0(z):null;if(P&&$)$.trace=()=>{G()[Y?.v??z]};return{v:$,i:Y,e:s(()=>{return Z(Q,$??W,Y??z,G),()=>{J.delete(X)}})}}function LQ(J,Q,W){if(!J.nodes)return;var X=J.nodes.start,z=J.nodes.end,Z=Q&&(Q.f&y0)===0?Q.nodes.start:W;while(X!==null){var K=r(X);if(Z.before(X),X===z)return;X=K}}function SJ(J,Q,W){if(Q===null)J.effect.first=W;else Q.next=W;if(W===null)J.effect.last=Q;else W.prev=Q}function i6(J,Q){let W=new Map,X=J.length;for(let z=0;z<X;z++){let Z=Q(J[z],z);if(W.has(Z)){let K=String(W.get(Z)),G=String(z),$=String(Z);if($.startsWith("[object "))$=null;U7(K,G,$)}W.set(Z,z)}}function o6(J,Q,W){if(!Q||Q===y8(String(W??"")))return;let X,z=J.__svelte_meta?.loc;if(z)X=`near ${z.file}:${z.line}:${z.column}`;else if(R0?.[F0])X=`in ${R0[F0]}`;D4(sQ(X))}function s6(J,Q,W=!1,X=!1,z=!1,Z=!1){var K=J,G="";if(W){var $=J;if(F)K=j(u($))}g7(()=>{var Y=O;if(G===(G=Q()??"")){if(F)l();return}if(W&&!F){if(Y.nodes=null,$.innerHTML=G,G!=="")C0(u($),$.lastChild);return}if(Y.nodes!==null)m7(Y.nodes.start,Y.nodes.end),Y.nodes=null;if(G==="")return;if(F){var H=C.data,B=l(),q=B;while(B!==null&&(B.nodeType!==I0||B.data!==""))q=B,B=r(B);if(B===null)throw HJ(),c0;if(P&&!Z)o6(B.parentNode,H,G);C0(C,q),K=j(B);return}var U=X?ZQ:z?$7:void 0,M=p0(X?"svg":z?"math":"template",U);M.innerHTML=G;var L=X||z?M:M.content;if(C0(u(L),L.lastChild),X||z)while(u(L))K.before(u(L));else K.before(L)})}function a6(J,Q,W,X,z){if(F)l();var Z=Q.$$slots?.[W],K=!1;if(Z===!0)Z=Q[W==="default"?"children":W],K=!0;if(Z===void 0){if(z!==null)z(J)}else Z(J,K?()=>X:X)}function J1(J,Q){L0(()=>{var W=J.getRootNode(),X=W.host?W:W.head??W.ownerDocument.head;if(!X.querySelector("#"+Q.hash)){let z=p0("style");if(z.id=Q.hash,z.textContent=Q.code,X.appendChild(z),P)m8(Q.hash,z)}})}function Q1(J,Q,W){L0(()=>{var X=h(()=>Q(J,W?.())||{});if(W&&X?.update){var z=!1,Z={};e(()=>{var K=W();if(dQ(K),z&&jQ(Z,K))Z=K,X.update(K)}),z=!0}if(X?.destroy)return()=>X.destroy()})}var p8=[...`
50
+ \r\f \v\uFEFF`];function _8(J,Q,W){var X=J==null?"":""+J;if(Q)X=X?X+" "+Q:Q;if(W){for(var z of Object.keys(W))if(W[z])X=X?X+" "+z:z;else if(X.length){var Z=z.length,K=0;while((K=X.indexOf(z,K))>=0){var G=K+Z;if((K===0||p8.includes(X[K-1]))&&(G===X.length||p8.includes(X[G])))X=(K===0?"":X.substring(0,K))+X.substring(G+1);else K=G}}}return X===""?null:X}function d8(J,Q=!1){var W=Q?" !important;":";",X="";for(var z of Object.keys(J)){var Z=J[z];if(Z!=null&&Z!=="")X+=" "+z+": "+Z+W}return X}function r7(J){if(J[0]!=="-"||J[1]!=="-")return J.toLowerCase();return J}function l8(J,Q){if(Q){var W="",X,z;if(Array.isArray(Q))X=Q[0],z=Q[1];else X=Q;if(J){J=String(J).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var Z=!1,K=0,G=!1,$=[];if(X)$.push(...Object.keys(X).map(r7));if(z)$.push(...Object.keys(z).map(r7));var Y=0,H=-1;let L=J.length;for(var B=0;B<L;B++){var q=J[B];if(G){if(q==="/"&&J[B-1]==="*")G=!1}else if(Z){if(Z===q)Z=!1}else if(q==="/"&&J[B+1]==="*")G=!0;else if(q==='"'||q==="'")Z=q;else if(q==="(")K++;else if(q===")")K--;if(!G&&Z===!1&&K===0){if(q===":"&&H===-1)H=B;else if(q===";"||B===L-1){if(H!==-1){var U=r7(J.substring(Y,H).trim());if(!$.includes(U)){if(q!==";")B++;var M=J.substring(Y,B).trim();W+=" "+M+";"}}Y=B+1,H=-1}}}}if(X)W+=d8(X);if(z)W+=d8(z,!0);return W=W.trim(),W===""?null:W}return J==null?null:String(J)}function c8(J,Q,W,X,z,Z){var K=J[WQ];if(F||K!==W||K===void 0){var G=_8(W,X,Z);if(!F||G!==J.getAttribute("class"))if(G==null)J.removeAttribute("class");else if(Q)J.className=G;else J.setAttribute("class",G);J[WQ]=W}else if(Z&&z!==Z)for(var $ in Z){var Y=!!Z[$];if(z==null||Y!==!!z[$])J.classList.toggle($,Y)}return Z}function n7(J,Q={},W,X){for(var z in W){var Z=W[z];if(Q[z]!==Z)if(W[z]==null)J.style.removeProperty(z);else J.style.setProperty(z,Z,X)}}function i8(J,Q,W,X){var z=J[XQ];if(F||z!==Q){var Z=l8(Q,X);if(!F||Z!==J.getAttribute("style"))if(Z==null)J.removeAttribute("style");else J.style.cssText=Z;J[XQ]=Q}else if(X)if(Array.isArray(X))n7(J,W?.[0],X[0]),n7(J,W?.[1],X[1],"important");else n7(J,W,X);return X}var P1=Symbol("class"),U1=Symbol("style"),B1=Symbol("is custom element"),H1=Symbol("is html"),Y1=Z7?"link":"LINK";function a8(J,Q,W,X){var z=V1(J);if(F){if(z[Q]=J.getAttribute(Q),Q==="src"||Q==="srcset"||Q==="href"&&J.nodeName===Y1){if(!X)L1(J,Q,W??"");return}}if(z[Q]===(z[Q]=W))return;if(Q==="loading")J[$4]=W;if(W==null)J.removeAttribute(Q);else if(typeof W!=="string"&&r8(J).includes(Q))J[Q]=W;else J.setAttribute(Q,W)}function M1(J,Q,W){var X=w,z=O;let Z=F;if(F)d(!1);f(null),p(null);try{if(Q!=="style"&&(t7.has(J.getAttribute("is")||J.nodeName)||!customElements||customElements.get(J.getAttribute("is")||J.nodeName.toLowerCase())?r8(J).includes(Q):W&&typeof W==="object"))J[Q]=W;else a8(J,Q,W==null?W:String(W))}finally{if(f(X),p(z),Z)d(!0)}}function V1(J){return J[FQ]??={[B1]:J.nodeName.includes("-"),[H1]:J.namespaceURI===wQ}}var t7=new Map;function r8(J){var Q=J.getAttribute("is")||J.nodeName,W=t7.get(Q);if(W)return W;t7.set(Q,W=[]);var X,z=J,Z=Element.prototype;while(Z!==z){X=CQ(z);for(var K in X)if(X[K].set&&K!=="innerHTML"&&K!=="textContent"&&K!=="innerText")W.push(K);z=IJ(z)}return W}function L1(J,Q,W){if(!P)return;if(Q==="srcset"&&O1(J,W))return;if(e7(J.getAttribute(Q)??"",W))return;A4(Q,J.outerHTML.replace(J.innerHTML,J.innerHTML&&"..."),String(W))}function e7(J,Q){if(J===Q)return!0;return new URL(J,document.baseURI).href===new URL(Q,document.baseURI).href}function o8(J){return J.split(",").map((Q)=>Q.trim().split(" ").filter(Boolean))}function O1(J,Q){var W=o8(J.srcset),X=o8(Q);return X.length===W.length&&X.every(([z,Z],K)=>Z===W[K][1]&&(e7(W[K][0],z)||e7(z,W[K][0])))}class n8{#J=new WeakMap;#Q;#W;static entries=new WeakMap;constructor(J){this.#W=J}observe(J,Q){var W=this.#J.get(J)||new Set;return W.add(Q),this.#J.set(J,W),this.#G().observe(J,this.#W),()=>{var X=this.#J.get(J);if(X.delete(Q),X.size===0)this.#J.delete(J),this.#Q.unobserve(J)}}#G(){return this.#Q??(this.#Q=new ResizeObserver((J)=>{for(var Q of J){n8.entries.set(Q.target,Q);for(var W of this.#J.get(Q.target)||[])W(Q)}}))}}function J4(J,Q){return J===Q||J?.[i]===Q}function F1(J={},Q,W,X){var z=A.r,Z=O;return L0(()=>{var K,G;return e(()=>{K=G,G=X?.()||[],h(()=>{if(!J4(W(...G),J)){if(Q(J,...G),K&&J4(W(...K),J))Q(null,...K)}})}),()=>{let $=Z;while($!==z&&$.parent!==null&&$.parent.f&pJ)$=$.parent;let Y=()=>{if(G&&J4(W(...G),J))Q(null,...G)},H=$.teardown;$.teardown=()=>{Y(),H?.()}}}),J}function w1(J,Q,W,X){var z=!MJ||(W&Y4)!==0,Z=(W&V4)!==0,K=(W&L4)!==0,G=X,$=!0,Y=void 0,H=()=>{if(K&&z)return Y??=LJ(X),R(Y);if($)$=!1,G=K?h(X):X;return G};let B;if(Z){var q=i in J||QQ in J;B=Y0(J,Q)?.set??(q&&Q in J?(D)=>J[Q]=D:void 0)}var U,M=!1;if(Z)[U,M]=R7(()=>J[Q]);else U=J[Q];if(U===void 0&&X!==void 0){if(U=H(),B){if(z)p4(Q);B(U)}}var L;if(z)L=()=>{var D=J[Q];if(D===void 0)return H();return $=!0,D};else L=()=>{var D=J[Q];if(D!==void 0)G=void 0;return D===void 0?G:D};if(z&&(W&M4)===0)return L;if(B){var V=J.$$legacy;return function(D,x0){if(arguments.length>0){if(!z||!x0||V||M)B(x0?L():D);return D}return L()}}var N=!1,k=((W&H4)!==0?LJ:xJ)(()=>{return N=!1,L()});if(P)k.label=Q;if(Z)R(k);var E=O;return function(D,x0){if(arguments.length>0){let U0=x0?R(k):z&&Z?GJ(D):D;if(P0(k,U0),N=!0,G!==void 0)G=U0;return D}if(j0&&N||(E.f&g)!==0)return k.v;return R(k)}}function t8(J){return new e8(J)}class e8{#J;#Q;constructor(J){var Q=new Map,W=(z,Z)=>{var K=bJ(Z,!1,!1);return Q.set(z,K),K};let X=new Proxy({...J.props||{},$$events:{}},{get(z,Z){return R(Q.get(Z)??W(Z,Reflect.get(z,Z)))},has(z,Z){if(Z===QQ)return!0;return R(Q.get(Z)??W(Z,Reflect.get(z,Z))),Reflect.has(z,Z)},set(z,Z,K){return P0(Q.get(Z)??W(Z,K),K),Reflect.set(z,Z,K)}});if(this.#Q=(J.hydrate?o7:rQ)(J.component,{target:J.target,anchor:J.anchor,props:X,context:J.context,intro:J.intro??!1,recover:J.recover,transformError:J.transformError}),!t&&(!J?.props?.$$host||J.sync===!1))tJ();this.#J=X.$$events;for(let z of Object.keys(this.#Q)){if(z==="$set"||z==="$destroy"||z==="$on")continue;n(this,z,{get(){return this.#Q[z]},set(Z){this.#Q[z]=Z},enumerable:!0})}this.#Q.$set=(z)=>{Object.assign(X,z)},this.#Q.$destroy=()=>{s7(this.#Q)}}$set(J){this.#Q.$set(J)}$on(J,Q){this.#J[J]=this.#J[J]||[];let W=(...X)=>Q.call(this,...X);return this.#J[J].push(W),()=>{this.#J[J]=this.#J[J].filter((X)=>X!==W)}}$destroy(){this.#Q.$destroy()}}var J6;if(typeof HTMLElement==="function")J6=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(J,Q,W){super();if(this.$$ctor=J,this.$$s=Q,W)this.$$shadowRoot=this.attachShadow(W)}addEventListener(J,Q,W){if(this.$$l[J]=this.$$l[J]||[],this.$$l[J].push(Q),this.$$c){let X=this.$$c.$on(J,Q);this.$$l_u.set(Q,X)}super.addEventListener(J,Q,W)}removeEventListener(J,Q,W){if(super.removeEventListener(J,Q,W),this.$$c){let X=this.$$l_u.get(Q);if(X)X(),this.$$l_u.delete(Q)}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let J=function(X){return(z)=>{let Z=p0("slot");if(X!=="default")Z.name=X;l7(z,Z)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let Q={},W=j1(this);for(let X of this.$$s)if(X in W)if(X==="default"&&!this.$$d.children)this.$$d.children=J(X),Q.default=!0;else Q[X]=J(X);for(let X of this.attributes){let z=this.$$g_p(X.name);if(!(z in this.$$d))this.$$d[z]=tQ(z,X.value,this.$$p_d,"toProp")}for(let X in this.$$p_d)if(!(X in this.$$d)&&this[X]!==void 0)this.$$d[X]=this[X],delete this[X];this.$$c=t8({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:Q,$$host:this}}),this.$$me=h7(()=>{e(()=>{this.$$r=!0;for(let X of KQ(this.$$c)){if(!this.$$p_d[X]?.reflect)continue;this.$$d[X]=this.$$c[X];let z=tQ(X,this.$$d[X],this.$$p_d,"toAttribute");if(z==null)this.removeAttribute(this.$$p_d[X].attribute||X);else this.setAttribute(this.$$p_d[X].attribute||X,z)}this.$$r=!1})});for(let X in this.$$l)for(let z of this.$$l[X]){let Z=this.$$c.$on(X,z);this.$$l_u.set(z,Z)}this.$$l={}}}attributeChangedCallback(J,Q,W){if(this.$$r)return;J=this.$$g_p(J),this.$$d[J]=tQ(J,W,this.$$p_d,"toProp"),this.$$c?.$set({[J]:this.$$d[J]})}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{if(!this.$$cn&&this.$$c)this.$$c.$destroy(),this.$$me(),this.$$c=void 0})}$$g_p(J){return KQ(this.$$p_d).find((Q)=>this.$$p_d[Q].attribute===J||!this.$$p_d[Q].attribute&&Q.toLowerCase()===J)||J}};function tQ(J,Q,W,X){let z=W[J]?.type;if(Q=z==="Boolean"&&typeof Q!=="boolean"?Q!=null:Q,!X||!W[J])return Q;else if(X==="toAttribute")switch(z){case"Object":case"Array":return Q==null?null:JSON.stringify(Q);case"Boolean":return Q?"":null;case"Number":return Q==null?null:Q;default:return Q}else switch(z){case"Object":case"Array":return Q&&JSON.parse(Q);case"Boolean":return Q;case"Number":return Q!=null?+Q:Q;default:return Q}}function j1(J){let Q={};return J.childNodes.forEach((W)=>{Q[W.slot||"default"]=!0}),Q}function T1(J,Q,W,X,z,Z){let K=class extends J6{constructor(){super(J,W,z);this.$$p_d=Q}static get observedAttributes(){return KQ(Q).map((G)=>(Q[G].attribute||G).toLowerCase())}};if(KQ(Q).forEach((G)=>{n(K.prototype,G,{get(){return this.$$c&&G in this.$$c?this.$$c[G]:this.$$d[G]},set($){$=tQ(G,$,Q),this.$$d[G]=$;var Y=this.$$c;if(Y){var H=Y0(Y,G)?.get;if(H)Y[G]=$;else Y.$set({[G]:$})}}})}),X.forEach((G)=>{n(K.prototype,G,{get(){return this.$$c?.[G]}})}),Z)K=Z(K);return J.element=K,K}if(P){let J=function(Q){if(!(Q in globalThis)){let W;Object.defineProperty(globalThis,Q,{configurable:!0,get:()=>{if(W!==void 0)return W;d4(Q)},set:(X)=>{W=X}})}};J("$state"),J("$effect"),J("$derived"),J("$inspect"),J("$props"),J("$bindable")}import{createContext as eQ}from"@pie-players/pie-context";var Q6=eQ(Symbol.for("pie.assessmentToolkit.runtimeContext")),W6=eQ(Symbol.for("pie.assessmentToolkit.hostRuntimeContext")),X6=eQ(Symbol.for("pie.assessmentToolkit.shellContext")),x1=eQ(Symbol.for("pie.assessmentToolkit.regionScopeContext"));import{ContextConsumer as k1}from"@pie-players/pie-context";function W4(J,Q,W){let X=!1,z=new k1(J,{context:Q,subscribe:!0,onValue:(Y)=>{X=!0,W(Y)}});z.connect();let Z=(Y)=>{if(Y.context!==Q)return;z.requestValue()};J.addEventListener("context-provider",Z);let K=0,G=200,$=globalThis.setInterval(()=>{if(X||K>=G){globalThis.clearInterval($);return}K+=1,z.requestValue()},50);return()=>{globalThis.clearInterval($),J.removeEventListener("context-provider",Z),z.disconnect()}}function qH(J,Q){return W4(J,Q6,Q)}function PH(J,Q){return W4(J,W6,Q)}function UH(J,Q){return W4(J,X6,Q)}var J7={assessment:[],section:[],item:[],passage:[],rubric:[],element:[]};var X4={section:[...J7.section],item:[...J7.item],passage:[...J7.passage]};function vJ(J){return typeof J==="object"&&J!==null&&!Array.isArray(J)}function CJ(J,Q){if(J==null)return[];if(!Array.isArray(J))throw Error(`Invalid tools config at "${Q}": expected an array of tool ids.`);if(J.find((X)=>typeof X!=="string")!==void 0)throw Error(`Invalid tools config at "${Q}": all entries must be strings.`);return J}function E1(J){if(J==null)return;if(!vJ(J))throw Error('Invalid tools config at "placement": expected an object with section/item/passage arrays.');return J}function b1(J){if(J==null)return;if(!vJ(J))throw Error('Invalid tools config at "policy": expected an object with allowed/blocked arrays.');return J}function y1(J,Q){if(Q==null)return;if(!vJ(Q))throw Error(`Invalid tools config at "providers.${J}": expected an object.`);let W=Q,X=(z)=>z==="polly"||z==="google"||z==="custom";if("enabled"in W&&W.enabled!==void 0&&typeof W.enabled!=="boolean")throw Error(`Invalid tools config at "providers.${J}.enabled": expected a boolean.`);if("settings"in W&&W.settings!==void 0&&!vJ(W.settings))throw Error(`Invalid tools config at "providers.${J}.settings": expected an object.`);if("provider"in W&&W.provider!==void 0&&!vJ(W.provider)&&!(J==="textToSpeech"&&X(W.provider)))throw Error(`Invalid tools config at "providers.${J}.provider": expected an object.`);return W}function h1(J){if(J==null)return{};if(!vJ(J))throw Error('Invalid tools config at "providers": expected an object keyed by tool id.');let Q={};for(let[W,X]of Object.entries(J))Q[W]=y1(W,X);return Q}function z4(J){let Q=J.trim();if(!Q)return"";return Q}function qJ(J){if(!J||J.length===0)return[];let Q=new Set;for(let W of J){if(typeof W!=="string")throw Error("Invalid tools config: tool list entries must be strings.");let X=z4(W);if(!X)continue;Q.add(X)}return Array.from(Q)}function MH(J){if(!J)return[];return qJ(J.split(",").map((Q)=>Q.trim()).filter(Boolean))}function g1(J,Q){if(J==null)return;if(J==="on"||J==="off")return J;throw Error(`Invalid tools config at "${Q}": expected "on" or "off", got ${JSON.stringify(J)}.`)}function VH(J){if(J!=null&&!vJ(J))throw Error('Invalid tools config: expected an object with "policy", "placement", and "providers".');let Q=b1(J?.policy),W=E1(J?.placement),X=h1(J?.providers),z=g1(J?.pnpEnforcement,"pnpEnforcement"),Z={policy:{allowed:qJ(CJ(Q?.allowed,"policy.allowed")),blocked:qJ(CJ(Q?.blocked,"policy.blocked"))},placement:{section:qJ(CJ(W?.section,"placement.section")).length?qJ(CJ(W?.section,"placement.section")):[...X4.section],item:qJ(CJ(W?.item,"placement.item")).length?qJ(CJ(W?.item,"placement.item")):[...X4.item],passage:qJ(CJ(W?.passage,"placement.passage")).length?qJ(CJ(W?.passage,"placement.passage")):[...X4.passage]},providers:X};if(z)Z.pnpEnforcement=z;return Z}import{dynamicMessageKey as FH}from"@pie-players/pie-players-shared/i18n/provider";var v1=["assessment","section","item","passage","rubric","element"];function Q7(J,Q){if(typeof J!=="string"||J.trim().length===0)throw Error(`Invalid tool registration: "${Q}" must be a non-empty string.`)}var m1=[{pattern:/<script\b/i,reason:"contains a <script> tag"},{pattern:/\son[a-z]+\s*=/i,reason:"contains an inline event handler (on*=) attribute"},{pattern:/javascript:/i,reason:"contains a javascript: URL"},{pattern:/<foreignObject\b/i,reason:"contains a <foreignObject> element"}];function u1(J,Q,W){let X=Q.trimStart(),z=X.toLowerCase().startsWith("<svg"),Z=/^https?:/i.test(X);if(/^data:/i.test(X))throw Error(`Invalid tool registration "${J}": "${W}" may not be a data: URL.`);if(!z&&!Z)return;for(let{pattern:G,reason:$}of m1)if(G.test(Q))throw Error(`Invalid tool registration "${J}": "${W}" ${$}. Inline SVG icons must not include scriptable content.`)}function z6(J){Q7(J.toolId,"toolId"),Q7(J.name,"name"),Q7(J.description,"description");let Q=J.activation==="region";if(!Q||J.icon!==void 0){if(typeof J.icon!=="string"&&typeof J.icon!=="function")throw Error(`Invalid tool registration "${J.toolId}": "icon" must be a string or function.`)}if(typeof J.icon==="string")u1(J.toolId,J.icon,"icon");if(!Array.isArray(J.supportedLevels)||J.supportedLevels.length===0)throw Error(`Invalid tool registration "${J.toolId}": "supportedLevels" must be a non-empty array.`);let W=J.supportedLevels.find((X)=>!v1.includes(X));if(W)throw Error(`Invalid tool registration "${J.toolId}": unsupported level "${W}".`);if(J.activation!==void 0&&J.activation!=="toolbar-toggle"&&J.activation!=="selection-gateway"&&J.activation!=="region")throw Error(`Invalid tool registration "${J.toolId}": unsupported activation "${String(J.activation)}".`);if(J.surfaces!==void 0&&(!Array.isArray(J.surfaces)||J.surfaces.some((X)=>typeof X!=="string"||X.trim().length===0)))throw Error(`Invalid tool registration "${J.toolId}": "surfaces" must be an array of non-empty strings.`);if(Q&&!J.surfaces?.length)throw Error(`Invalid tool registration "${J.toolId}": region tools must declare at least one host surface in "surfaces".`);if(Q&&typeof J.renderSurface!=="function")throw Error(`Invalid tool registration "${J.toolId}": region tools must implement "renderSurface".`);if(J.resolvesWithoutGrant!==void 0&&typeof J.resolvesWithoutGrant!=="boolean")throw Error(`Invalid tool registration "${J.toolId}": "resolvesWithoutGrant" must be a boolean.`);if(J.resolvesWithoutGrant&&!J.requiresAuthoredContent)throw Error(`Invalid tool registration "${J.toolId}": "resolvesWithoutGrant" requires "requiresAuthoredContent".`);if(J.renderSurface!==void 0&&typeof J.renderSurface!=="function")throw Error(`Invalid tool registration "${J.toolId}": "renderSurface" must be a function.`);if(J.renderSurface&&!J.surfaces?.length)throw Error(`Invalid tool registration "${J.toolId}": "renderSurface" requires at least one entry in "surfaces".`);if(J.singletonScope!==void 0&&J.singletonScope!=="section")throw Error(`Invalid tool registration "${J.toolId}": unsupported singletonScope "${String(J.singletonScope)}".`);if(J.activation==="selection-gateway"&&J.singletonScope!=="section")throw Error(`Invalid tool registration "${J.toolId}": selection-gateway tools must declare singletonScope "section".`);if(J.pnpSupportIds!==void 0&&(!Array.isArray(J.pnpSupportIds)||J.pnpSupportIds.some((X)=>typeof X!=="string"||X.trim().length===0)))throw Error(`Invalid tool registration "${J.toolId}": "pnpSupportIds" must be an array of non-empty strings.`);if(J.activation!=="region"&&typeof J.isVisibleInContext!=="function")throw Error(`Invalid tool registration "${J.toolId}": "isVisibleInContext" must be a function.`);if(J.isVisibleInContext!==void 0&&typeof J.isVisibleInContext!=="function")throw Error(`Invalid tool registration "${J.toolId}": "isVisibleInContext" must be a function when present.`);if(J.requiresAuthoredContent!==void 0){if(typeof J.requiresAuthoredContent!=="object"||J.requiresAuthoredContent===null||typeof J.requiresAuthoredContent.resolve!=="function")throw Error(`Invalid tool registration "${J.toolId}": "requiresAuthoredContent" must be an object with a "resolve" function.`);if(!J.pnpSupportIds?.length)throw Error(`Invalid tool registration "${J.toolId}": "requiresAuthoredContent" requires at least one entry in "pnpSupportIds", which is what a host filters a default grant list on.`)}if(J.renderToolbar!==void 0){if(typeof J.renderToolbar!=="function")throw Error(`Invalid tool registration "${J.toolId}": "renderToolbar" must be a function.`)}else if(!Q)throw Error(`Invalid tool registration "${J.toolId}": "renderToolbar" must be a function.`)}class f1{tools=new Map;pnpIndex=new Map;componentOverrides={};moduleLoaders=new Map;loadedToolModules=new Set;moduleLoadPromises=new Map;changeListeners=new Set;emitChange(J){for(let Q of this.changeListeners)try{Q(J)}catch(W){console.warn("[ToolRegistry] change listener failed:",W)}}onRegistryChange(J){this.changeListeners.add(J);let Q=!0;return()=>{if(!Q)return;Q=!1,this.changeListeners.delete(J)}}normalizeToolId(J){return z4(J)}normalizeToolIds(J){return J.map((Q)=>this.normalizeToolId(Q))}register(J){if(z6(J),this.tools.has(J.toolId))throw Error(`Tool '${J.toolId}' is already registered`);if(this.tools.set(J.toolId,J),J.pnpSupportIds)for(let Q of J.pnpSupportIds){if(!this.pnpIndex.has(Q))this.pnpIndex.set(Q,new Set);this.pnpIndex.get(Q).add(J.toolId)}this.emitChange({kind:"register",toolIds:[J.toolId]})}override(J){if(z6(J),!this.tools.has(J.toolId))throw Error(`Cannot override non-existent tool '${J.toolId}'`);let Q=this.tools.get(J.toolId);if(Q.pnpSupportIds)for(let W of Q.pnpSupportIds)this.pnpIndex.get(W)?.delete(J.toolId);if(this.tools.set(J.toolId,J),J.pnpSupportIds)for(let W of J.pnpSupportIds){if(!this.pnpIndex.has(W))this.pnpIndex.set(W,new Set);this.pnpIndex.get(W).add(J.toolId)}this.emitChange({kind:"override",toolIds:[J.toolId]})}unregister(J){let Q=this.tools.get(J);if(!Q)return;if(Q.pnpSupportIds)for(let W of Q.pnpSupportIds)this.pnpIndex.get(W)?.delete(J);this.tools.delete(J),this.emitChange({kind:"unregister",toolIds:[J]})}get(J){return this.tools.get(J)}has(J){return this.tools.has(J)}getAllToolIds(){return Array.from(this.tools.keys())}getAllTools(){return Array.from(this.tools.values())}getToolsByPNPSupport(J){return this.pnpIndex.get(J)||new Set}getToolsByLevel(J){return this.getAllTools().filter((Q)=>Q.supportedLevels.includes(J))}getToolActivation(J){return this.get(J)?.activation||"toolbar-toggle"}getToolSingletonScope(J){return this.get(J)?.singletonScope||null}getToolsBySurface(J){if(!J)return[];return this.getAllTools().filter((Q)=>typeof Q.renderSurface==="function"&&Q.surfaces?.includes(J))}getContentDependentSupportIds(){let J=new Set;for(let Q of this.getAllTools()){if(!Q.requiresAuthoredContent)continue;for(let W of Q.pnpSupportIds||[])J.add(W)}return[...J].sort()}filterToolIdsByActivation(J,Q){return J.filter((W)=>this.getToolActivation(W)===Q)}filterVisibleInContext(J,Q){let W=[];for(let X of J){let z=this.get(X);if(!z){console.warn(`Tool '${X}' is allowed but not registered`);continue}if(!z.supportedLevels.includes(Q.level))continue;try{if(z.isVisibleInContext?.(Q))W.push(z)}catch(Z){console.error(`Error evaluating visibility for tool '${X}':`,Z)}}return W}getToolMetadata(){return this.getAllTools().map((J)=>({toolId:J.toolId,name:J.name,description:J.description,pnpSupportIds:J.pnpSupportIds||[],supportedLevels:J.supportedLevels,activation:J.activation||"toolbar-toggle",singletonScope:J.singletonScope||null,surfaces:J.surfaces||[],requiresAuthoredContent:Boolean(J.requiresAuthoredContent),contentDependencyDescription:J.requiresAuthoredContent?.description??null}))}generatePNPSupportsFromTools(J){let Q=new Set;for(let W of J){let X=this.get(W);if(X?.pnpSupportIds)for(let z of X.pnpSupportIds)Q.add(z)}return Array.from(Q)}clear(){let J=this.getAllToolIds();if(J.length===0)return;this.tools.clear(),this.pnpIndex.clear(),this.emitChange({kind:"clear",toolIds:J})}setComponentOverrides(J){if(this.componentOverrides===J)return;this.componentOverrides=J,this.emitChange({kind:"component-overrides",toolIds:[]})}setToolModuleLoaders(J){let Q=Object.entries(J).filter((X)=>X[1]!==void 0);for(let[X,z]of Q)if(Q7(X,"tool module loader id"),typeof z!=="function")throw Error(`Invalid tool module loader for "${X}": expected a function.`);let W=[];for(let[X,z]of Q){if(this.moduleLoaders.get(X)===z)continue;this.moduleLoaders.set(X,z),W.push(X)}if(W.length>0)this.emitChange({kind:"module-loaders",toolIds:W})}async ensureToolModuleLoaded(J){if(this.loadedToolModules.has(J))return;let Q=this.moduleLoadPromises.get(J);if(Q){await Q;return}let W=this.moduleLoaders.get(J);if(!W)return;let X=(async()=>{await W(),this.loadedToolModules.add(J)})();this.moduleLoadPromises.set(J,X);try{await X}finally{this.moduleLoadPromises.delete(J)}}async ensureToolModulesLoaded(J){await Promise.all(J.map((Q)=>this.ensureToolModuleLoaded(Q)))}isToolModuleLoaded(J){return this.loadedToolModules.has(J)}renderForToolbar(J,Q,W){let X=this.get(J);if(!X)throw Error(`Tool '${J}' is not registered`);if(typeof X.renderToolbar!=="function")throw Error(`Tool '${J}' has activation "${X.activation||"toolbar-toggle"}" and renders into a host surface, not a toolbar. Remove it from toolbar placement.`);let z={...W,componentOverrides:{...this.componentOverrides||{},...W.componentOverrides||{}}};return X.renderToolbar(Q,z)}renderForSurface(J,Q){let W=this.get(J);if(!W)throw Error(`Tool '${J}' is not registered`);if(typeof W.renderSurface!=="function")throw Error(`Tool '${J}' does not render into a host surface. Surface capabilities declare "surfaces" and implement "renderSurface".`);return W.renderSurface({...Q,componentOverrides:{...this.componentOverrides||{},...Q.componentOverrides||{}}})}}
51
+ export{p1 as b,T8 as c,B7 as d,H7 as e,H6 as f,tJ as g,JJ as h,P0 as i,GJ as j,A6 as k,D6 as l,I6 as m,y7 as n,g7 as o,R as p,h as q,k8 as r,E8 as s,x6 as t,k6 as u,l7 as v,g6 as w,u6 as x,p6 as y,_6 as z,s6 as A,a6 as B,J1 as C,Q1 as D,c8 as E,i8 as F,a8 as G,M1 as H,F1 as I,w1 as J,T1 as K,Q6 as L,W6 as M,qH as N,PH as O,UH as P,qJ as Q,MH as R,VH as S,f1 as T};
@@ -0,0 +1,46 @@
1
+ import{A as U0,C as mj,D as xL,E as CL,F as hj,G as LL,H as IL,I as uj,J as d,K as cj,L as sj,N as ij,P as aj,R as dj,T as rj,c as GL,d as Ej,e as vj,f as O,g as a,h as HL,i as ML,j as gj,k as iL,l as UL,m as k0,n as KL,o as QL,p as L,r as w0,s as $j,t as NL,u as XL,v as z,x as VL,y as z0,z as Z0}from"./ItemToolBar-38mhtjsq.js";import{ContextProvider as TJ}from"@pie-players/pie-context";function c0(f){return typeof f.href==="string"}function Aj(f){if(!f||typeof f!=="object"||Array.isArray(f))return!1;let R=f;if(typeof R.id!=="string"||R.id.trim().length===0)return!1;if(typeof R.label!=="string"||R.label.trim().length===0)return!1;if(R.ariaLabel!==void 0&&typeof R.ariaLabel!=="string")return!1;if(R.icon!==void 0&&typeof R.icon!=="string")return!1;if(R.tooltip!==void 0&&typeof R.tooltip!=="string")return!1;if(R.active!==void 0&&typeof R.active!=="boolean")return!1;if(R.disabled!==void 0&&typeof R.disabled!=="boolean")return!1;let y=typeof R.href==="string",DL=typeof R.onClick==="function";if(y===DL)return!1;if(y)return!0;return DL}function s0(f){return typeof f==="string"&&f.trimStart().startsWith("<svg")}function i0(f){return typeof f==="string"&&f.trimStart().startsWith("http")}import{sanitizeSvgIcon as F0}from"@pie-players/pie-players-shared/security";import{resolveInterfaceI18n as AJ}from"@pie-players/pie-players-shared/i18n/provider";import{approximateZoomFromWidths as CJ,computeZoomCompensation as IJ,ICON_BUTTON_ZOOM_OPTIONS as yj}from"@pie-players/pie-players-shared/ui/zoom-compensation";import{collectFocusable as yJ,createFocusTrap as pJ,FOCUSABLE_SELECTOR as bJ,isProgrammaticFocusTarget as _J}from"@pie-players/pie-players-shared";var xJ={calculator:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M7 2h10a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2Zm0 2v4h10V4H7Zm0 6v2h2v-2H7Zm4 0v2h2v-2h-2Zm4 0v2h2v-2h-2Zm-8 4v2h2v-2H7Zm4 0v2h2v-2h-2Zm4 0v2h2v-2h-2Zm-8 4v2h2v-2H7Zm4 0v2h2v-2h-2Zm4 0v2h2v-2h-2Z" fill="currentColor"/></svg>',"volume-up":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M14 3.23v2.06A7.002 7.002 0 0 1 19 12a7 7 0 0 1-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77Zm-2 17.75V3L7 8H3v8h4l5 5Zm4.5-9a4.5 4.5 0 0 0-2.5-4.03v8.05A4.5 4.5 0 0 0 16.5 12Z" fill="currentColor"/></svg>',swatch:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 3a9 9 0 1 0 9 9c0-.55-.45-1-1-1h-2.5a1.5 1.5 0 0 1 0-3H20a1 1 0 0 0 1-1 8.99 8.99 0 0 0-9-4Zm-5.5 9A1.5 1.5 0 1 1 8 13.5 1.5 1.5 0 0 1 6.5 12Zm3-4A1.5 1.5 0 1 1 11 9.5 1.5 1.5 0 0 1 9.5 8Zm5 0A1.5 1.5 0 1 1 16 9.5 1.5 1.5 0 0 1 14.5 8Z" fill="currentColor"/></svg>',"chart-bar":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4.75 5a.76.76 0 0 1 .75.75v11c0 .438.313.75.75.75h13a.76.76 0 0 1 .696 1.039.74.74 0 0 1-.696.461h-13C5 19 4 18 4 16.75v-11A.74.74 0 0 1 4.75 5ZM8 8.25a.74.74 0 0 1 .75-.75h6.5a.76.76 0 0 1 .696 1.039.74.74 0 0 1-.696.461h-6.5A.722.722 0 0 1 8 8.25Zm.75 2.25h4.5a.76.76 0 0 1 .696 1.039.74.74 0 0 1-.696.461h-4.5a.723.723 0 0 1-.75-.75.74.74 0 0 1 .75-.75Zm0 3h8.5a.76.76 0 0 1 .696 1.039.74.74 0 0 1-.696.461h-8.5a.723.723 0 0 1-.75-.75.74.74 0 0 1 .75-.75Z" fill="currentColor"/></svg>',beaker:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M5 21c-.85 0-1.454-.38-1.813-1.137-.358-.759-.27-1.463.263-2.113L9 11V5H8a.968.968 0 0 1-.713-.287A.968.968 0 0 1 7 4c0-.283.096-.52.287-.712A.968.968 0 0 1 8 3h8c.283 0 .52.096.712.288.192.191.288.429.288.712s-.096.52-.288.713A.968.968 0 0 1 16 5h-1v6l5.55 6.75c.533.65.62 1.354.262 2.113C20.454 20.62 19.85 21 19 21H5Zm2-3h10l-3.4-4h-3.2L7 18Zm-2 1h14l-6-7.3V5h-2v6.7L5 19Z" fill="currentColor"/></svg>',protractor:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m6.75 21-.25-2.2 2.85-7.85a3.95 3.95 0 0 0 1.75.95l-2.75 7.55L6.75 21Zm10.5 0-1.6-1.55-2.75-7.55a3.948 3.948 0 0 0 1.75-.95l2.85 7.85-.25 2.2ZM12 11a2.893 2.893 0 0 1-2.125-.875A2.893 2.893 0 0 1 9 8c0-.65.188-1.23.563-1.737A2.935 2.935 0 0 1 11 5.2V3h2v2.2c.583.2 1.063.554 1.438 1.063C14.812 6.77 15 7.35 15 8c0 .833-.292 1.542-.875 2.125A2.893 2.893 0 0 1 12 11Zm0-2c.283 0 .52-.096.713-.287A.967.967 0 0 0 13 8a.967.967 0 0 0-.287-.713A.968.968 0 0 0 12 7a.968.968 0 0 0-.713.287A.967.967 0 0 0 11 8c0 .283.096.52.287.713.192.191.43.287.713.287Z" fill="currentColor"/></svg>',"bars-3":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M6.85 15c.517 0 .98-.15 1.388-.45.408-.3.695-.692.862-1.175l.375-1.15c.267-.8.2-1.537-.2-2.213C8.875 9.337 8.3 9 7.55 9H4.025l.475 3.925c.083.583.346 1.075.787 1.475.442.4.963.6 1.563.6Zm10.3 0c.6 0 1.12-.2 1.563-.6.441-.4.704-.892.787-1.475L19.975 9h-3.5c-.75 0-1.325.342-1.725 1.025-.4.683-.467 1.425-.2 2.225l.35 1.125c.167.483.454.875.862 1.175.409.3.871.45 1.388.45Zm-10.3 2c-1.1 0-2.063-.363-2.887-1.088a4.198 4.198 0 0 1-1.438-2.737L2 9H1V7h6.55c.733 0 1.404.18 2.013.537A3.906 3.906 0 0 1 11 9h2.025c.35-.617.83-1.104 1.438-1.463A3.892 3.892 0 0 1 16.474 7H23v2h-1l-.525 4.175a4.198 4.198 0 0 1-1.438 2.737A4.238 4.238 0 0 1 17.15 17c-.95 0-1.804-.27-2.562-.813A4.234 4.234 0 0 1 13 14.026l-.375-1.125a21.35 21.35 0 0 1-.1-.363 4.926 4.926 0 0 1-.1-.537h-.85c-.033.2-.067.363-.1.488a21.35 21.35 0 0 1-.1.362L11 14a4.3 4.3 0 0 1-1.588 2.175A4.258 4.258 0 0 1 6.85 17Z" fill="currentColor"/></svg>',ruler:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="m8.8 10.95 2.15-2.175-1.4-1.425-1.1 1.1-1.4-1.4 1.075-1.1L7 4.825 4.825 7 8.8 10.95Zm8.2 8.225L19.175 17l-1.125-1.125-1.1 1.075-1.4-1.4 1.075-1.1-1.425-1.4-2.15 2.15L17 19.175ZM7.25 21H3v-4.25l4.375-4.375L2 7l5-5 5.4 5.4 3.775-3.8c.2-.2.425-.35.675-.45a2.068 2.068 0 0 1 1.55 0c.25.1.475.25.675.45L20.4 4.95c.2.2.35.425.45.675.1.25.15.508.15.775a1.975 1.975 0 0 1-.6 1.425l-3.775 3.8L22 17l-5 5-5.375-5.375L7.25 21ZM5 19h1.4l9.8-9.775L14.775 7.8 5 17.6V19Z" fill="currentColor"/></svg>',"book-open":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M12 6.25a6.6 6.6 0 0 0-2.3-1.32A8.6 8.6 0 0 0 7 4.5c-.63 0-1.25.06-1.85.18-.6.12-1.19.3-1.76.54a1.5 1.5 0 0 0-.93 1.4v10.1c0 .52.26.98.68 1.24.42.26.92.28 1.35.06.36-.18.75-.31 1.18-.4.42-.09.86-.13 1.33-.13.78 0 1.53.14 2.24.42.7.28 1.35.7 1.93 1.24l.83-.75.83.75c.58-.54 1.22-.96 1.93-1.24a6.1 6.1 0 0 1 2.24-.42c.47 0 .91.04 1.33.13.43.09.82.22 1.18.4.43.22.93.2 1.35-.06.42-.26.68-.72.68-1.24V6.62c0-.6-.36-1.15-.93-1.4a9.3 9.3 0 0 0-1.76-.54A9.8 9.8 0 0 0 17 4.5a8.6 8.6 0 0 0-2.7.43A6.6 6.6 0 0 0 12 6.25Zm1 10.06V8.02c.55-.5 1.16-.88 1.84-1.13A6 6 0 0 1 17 6.5c.45 0 .89.04 1.32.11.43.08.85.19 1.26.34v9.24a8.2 8.2 0 0 0-1.28-.24A10 10 0 0 0 17 15.85c-.72 0-1.42.09-2.09.26a7.7 7.7 0 0 0-1.91.8Zm-2 0a7.7 7.7 0 0 0-1.91-.8 8.4 8.4 0 0 0-2.09-.26c-.44 0-.87.02-1.3.07-.43.05-.86.13-1.28.24V6.95c.41-.15.83-.26 1.26-.34A7.7 7.7 0 0 1 7 6.5c.76 0 1.48.13 2.16.39.68.25 1.29.63 1.84 1.13Z" fill="currentColor"/></svg>',photo:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 21c-.55 0-1.02-.2-1.41-.59A1.93 1.93 0 0 1 2 19V5c0-.55.2-1.02.59-1.41A1.93 1.93 0 0 1 4 3h16c.55 0 1.02.2 1.41.59.39.39.59.86.59 1.41v14c0 .55-.2 1.02-.59 1.41-.39.39-.86.59-1.41.59H4Zm0-2h16V5H4v14Zm1.5-2.5h13l-4.1-5.47-3.4 4.47-2.5-3.25L5.5 16.5ZM8.5 10a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3Z" fill="currentColor"/></svg>'};function Cj(f){return xJ[f]||null}var fJ=["assessment","section","item","passage","rubric"],SJ=new Set(fJ);function Ij(f){return SJ.has(f)}function q0(f,R,y){let DL=f.trim(),fL=y.trim();if(!DL||!fL)throw Error("Tool instance ids require non-empty tool and scope ids");if(!Ij(R))throw Error(`Unknown tool scope level '${R}'. Register custom levels with registerToolScopeLevel().`);return`${DL}:${R}:${fL}`}function a0(f){let R=f.split(":");if(R.length!==3)return null;let[y,DL,fL]=R;if(!y||!fL)return null;if(!Ij(DL))return null;return{baseToolId:y,scopeLevel:DL,scopeId:fL}}import"@pie-players/pie-players-shared/nds-icon-button";var BJ=(f,R)=>{if(customElements.get(f))return;try{customElements.define(f,R)}catch(y){if(!(y instanceof DOMException&&y.name==="NotSupportedError"||y&&typeof y==="object"&&y.name==="NotSupportedError")||!customElements.get(f))throw y}},P0=NL('<span class="item-toolbar__element-host svelte-rnx3ie"></span>'),EJ=NL('<span class="item-toolbar__nds-button-zoom svelte-rnx3ie"><nds-icon-button></nds-icon-button></span>',2),W0=NL('<span aria-hidden="true"></span>'),pj=NL('<img class="item-toolbar__icon-image svelte-rnx3ie" alt=""/>'),bj=NL('<i aria-hidden="true"></i>'),vJ=NL("<a><!></a>"),gJ=NL('<button type="button"><!></button>'),_j=NL('<span class="item-toolbar__controls-host svelte-rnx3ie"></span>'),$J=NL("<div></div>"),mJ=NL('<div><div class="item-toolbar__tools-row svelte-rnx3ie"><!> <!> <!></div> <!></div>'),hJ={hash:"svelte-rnx3ie",code:`.item-toolbar.svelte-rnx3ie {display:flex;flex-direction:column;align-items:flex-end;gap:0;--pie-toolbar-tools-row-height: 2rem;--pie-tts-controls-row-height: 2.875rem;}.item-toolbar__tools-row.svelte-rnx3ie {display:flex;align-items:center;justify-content:flex-end;flex-wrap:nowrap;
2
+ /* Cap the gap between toolbar items (e.g. TTS play ↔ calculator) at its
3
+ 200%-zoom size with the same factor the buttons use, so the spacing
4
+ doesn't keep growing past 200% while the buttons themselves freeze. */gap:calc(0.5rem * var(--pie-toolbar-zoom-comp, 1));min-height:var(--pie-toolbar-tools-row-height);}
5
+
6
+ /* A granted section tool must stay reachable even when there isn't room for
7
+ every button: scroll the row rather than clipping items past the edge,
8
+ which left them impossible to focus, tab to, or click. \`min-width: 0\`
9
+ beats the flex default (\`auto\`, i.e. never shrink below content), which
10
+ would otherwise keep the row at full content width and make overflow-x
11
+ moot. Scoped to section level: an item's own toolbar hosts far fewer
12
+ tools and, for the inline TTS tool's "expanding row" layout, relies on
13
+ this row growing freely to host its reading-controls panel — capping its
14
+ width here clips that panel instead. */.item-toolbar[data-level="section"].svelte-rnx3ie .item-toolbar__tools-row:where(.svelte-rnx3ie) {overflow-x:auto;max-width:100%;min-width:0;}.item-toolbar__controls-row.svelte-rnx3ie {display:flex;align-items:center;justify-content:flex-end;width:100%;min-height:0;height:auto;}.item-toolbar__controls-row--reserve.svelte-rnx3ie {min-height:var(--pie-tts-controls-row-height);height:var(--pie-tts-controls-row-height);}.item-toolbar__controls-row--active.svelte-rnx3ie {min-height:var(--pie-tts-controls-row-height);height:var(--pie-tts-controls-row-height);}.item-toolbar__controls-row--align-start.svelte-rnx3ie {justify-content:flex-start;}.item-toolbar__controls-host.svelte-rnx3ie {display:inline-flex;align-items:center;justify-content:flex-end;width:100%;}.item-toolbar--top.svelte-rnx3ie,
15
+ .item-toolbar--bottom.svelte-rnx3ie {align-items:flex-end;}.item-toolbar--left.svelte-rnx3ie,
16
+ .item-toolbar--right.svelte-rnx3ie {align-items:stretch;}.item-toolbar--left.svelte-rnx3ie .item-toolbar__tools-row:where(.svelte-rnx3ie),
17
+ .item-toolbar--right.svelte-rnx3ie .item-toolbar__tools-row:where(.svelte-rnx3ie) {flex-direction:column;align-items:center;justify-content:flex-start;flex-wrap:nowrap;}.item-toolbar--left.svelte-rnx3ie .item-toolbar__controls-row:where(.svelte-rnx3ie),
18
+ .item-toolbar--right.svelte-rnx3ie .item-toolbar__controls-row:where(.svelte-rnx3ie) {justify-content:flex-start;width:auto;min-height:0;height:auto;}.item-toolbar__button.svelte-rnx3ie {display:flex;align-items:center;justify-content:center;width:2rem;height:2rem;padding:0.25rem;border:1px solid var(--pie-button-border, var(--pie-border, #ccc));border-radius:0.25rem;background-color:var(--pie-button-bg, var(--pie-background, white));color:var(--pie-button-color, var(--pie-text, #333));cursor:pointer;transition:all 0.15s ease;text-decoration:none;}
19
+
20
+ /* Drive the vendored NDS icon button's outer size via its own \`--height-32\`
21
+ custom property so its light-DOM inner button matches the toolbar's
22
+ md/sm/lg dimensions (32 / 44 / 40 px) without a layout shift. The glyph
23
+ keeps the NDS-native icon size (we render size="small"), so it isn't
24
+ oversized. */
25
+ /* Freeze the calculator's header open/close button at its 200%-zoom size
26
+ (factor is 1 at zoom <= 200%). Zoom on this wrapper, not the host. */.item-toolbar__nds-button-zoom.svelte-rnx3ie {display:inline-flex;zoom:var(--pie-toolbar-zoom-comp, 1);}.item-toolbar.svelte-rnx3ie nds-icon-button:where(.svelte-rnx3ie) {
27
+ /* Host-settable button size per toolbar size (drives the NDS outer button
28
+ via its own --height-32). */--height-32: var(--pie-calculator-button-size, 2rem);
29
+ /* Host-settable accent for the calculator button: the NDS tertiary glyph
30
+ colour derives from --color-interactive-blue, remapped here to a
31
+ themeable variable. --pie-calculator-button-color is package-private, so
32
+ nothing sets it and the default is what ships: it now resolves through
33
+ --pie-button-color (DaisyUI base-content) instead of holding the Figma
34
+ blue on every theme, with the literal as the no-theme last resort.
35
+ Not --pie-primary or --pie-tertiary: both are \`direct\` mappings of
36
+ DaisyUI slots chosen to pair with their own -content colour, so a glyph
37
+ taken from either sits at 1.37:1 against the page under \`pastel\` and 11
38
+ of the 35 shipped themes fall under SC 1.4.11's 3:1. */--color-interactive-blue: var(--pie-calculator-button-color, var(--pie-button-color, var(--pie-text, #222)));
39
+ /* NDS palette bridge — keep in sync with the copies in tool-tts-inline
40
+ and section-player SectionItemsPane (asserted by
41
+ scripts/check-theme-tokens.mjs). The vendored button paints its fill,
42
+ its on-accent glyph, its hover ring and its focus ring from the NDS
43
+ design-system palette, which no PIE theme sets, so a tertiary button
44
+ kept a #f3f5f7 pill on every page — and once the glyph followed the
45
+ theme, a light glyph landed on that light pill. */--color-new-gray: var(--pie-background-dark, #f3f5f7);--color-primary-white: var(--pie-white, #ffffff);--color-primary-black: var(--pie-text, #000000);--color-focus-blue: var(--pie-button-focus-outline, #2b87ff);}.item-toolbar--sm.svelte-rnx3ie nds-icon-button:where(.svelte-rnx3ie) {--height-32: var(--pie-calculator-button-size-sm, 2.75rem);}.item-toolbar--lg.svelte-rnx3ie nds-icon-button:where(.svelte-rnx3ie) {--height-32: var(--pie-calculator-button-size-lg, 2.5rem);}.item-toolbar__element-host.svelte-rnx3ie {display:contents;}.item-toolbar--sm.svelte-rnx3ie .item-toolbar__button:where(.svelte-rnx3ie) {width:2.75rem;height:2.75rem;}.item-toolbar--sm.svelte-rnx3ie {--pie-toolbar-tools-row-height: 2.75rem;--pie-tts-controls-row-height: 3.625rem;}.item-toolbar--lg.svelte-rnx3ie .item-toolbar__button:where(.svelte-rnx3ie) {width:2.5rem;height:2.5rem;}.item-toolbar--lg.svelte-rnx3ie {--pie-toolbar-tools-row-height: 2.5rem;--pie-tts-controls-row-height: 3.375rem;}.item-toolbar__button.svelte-rnx3ie:hover:not(:disabled) {background-color:var(--pie-button-hover-bg, var(--pie-secondary-background, #f5f5f5));border-color:var(--pie-button-hover-border, var(--pie-button-border, var(--pie-border, #ccc)));color:var(--pie-button-hover-color, var(--pie-button-color, var(--pie-text, #333)));transform:translateY(-1px);box-shadow:0 2px 4px color-mix(in srgb, var(--pie-black, #000) 10%, transparent);}.item-toolbar__button.svelte-rnx3ie:active:not(:disabled) {transform:translateY(0);box-shadow:none;}.item-toolbar__button--active.svelte-rnx3ie {background-color:var(--pie-primary, #1976d2);color:var(--pie-white, #fff);border-color:var(--pie-primary, #1976d2);}.item-toolbar__button--active.svelte-rnx3ie:hover:not(:disabled) {background-color:var(--pie-primary-dark, #1565c0);}.item-toolbar__button.svelte-rnx3ie:focus-visible {outline:2px solid var(--pie-button-focus-outline, var(--pie-primary, #1976d2));outline-offset:2px;}.item-toolbar__button.svelte-rnx3ie:disabled {opacity:0.5;cursor:not-allowed;}.item-toolbar__button.svelte-rnx3ie svg {width:100%;height:100%;}.item-toolbar__icon-image.svelte-rnx3ie {width:100%;height:100%;object-fit:contain;}`};function lj(f,R){Ej(R,!0),mj(f,hJ);let y=typeof window<"u",DL=["/_fa-pro/fontawesome.min.css","/_fa-pro/light.min.css"],fL="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.2/css/all.min.css",oj="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap",d0=/font.?awesome|fa-?pro/i,r0=!1,H0=()=>{if(!y||r0)return;if(r0=!0,!document.querySelector('link[href*="Roboto"]')){let U=document.createElement("link");U.rel="stylesheet",U.href=oj,document.head.appendChild(U)}if(Array.from(document.querySelectorAll('link[rel="stylesheet"][href]')).some((U)=>d0.test(U.href)))return;if(!document.querySelector(`link[href="${fL}"]`)){let U=document.createElement("link");U.rel="stylesheet",U.href=fL,document.head.appendChild(U)}for(let U of DL){if(document.querySelector(`link[href="${U}"]`))continue;let J=document.createElement("link");J.rel="stylesheet",J.href=U,document.head.appendChild(J)}},l0="__pieFaToolbarShadowInstalled",nj=(j)=>{let U=j.getRootNode();if(!(U instanceof ShadowRoot))return;let J=U;if(J[l0])return;J[l0]=!0;let K=new Set,F=(D)=>{if(!D||K.has(D))return;K.add(D);let H=document.createElement("link");H.rel="stylesheet",H.href=D,U.appendChild(H)},G=Array.from(document.querySelectorAll('link[rel="stylesheet"][href]')).filter((D)=>d0.test(D.href));for(let D of G)F(D.href)},tj=(j)=>{return H0(),nj(j),{}},ej=(j,U)=>{let J=U,K=()=>{let G=j.querySelector("button");if(G)G.setAttribute("aria-pressed",J?"true":"false")};K();let F=new MutationObserver(K);return F.observe(j,{childList:!0,subtree:!0}),{update(G){J=G,K()},destroy(){F.disconnect()}}},o0=(j)=>j.faIconName||null,LJ=new rj,yL=HL(gj({})),gL=d(R,"level",7,"item"),K0=d(R,"scopeId",7,""),x0=d(R,"itemId",7,""),f0=d(R,"sectionId",7,""),S0=d(R,"catalogId",7,""),B0=d(R,"tools",7,""),T0=d(R,"contentKind",7,"assessment-item"),SL=d(R,"position",7,"bottom"),aL=d(R,"scopeElement",7,null),A0=d(R,"toolRegistry",7,null),C0=d(R,"item",7,null),Q0=d(R,"hostButtons",23,()=>[]),I0=d(R,"class",7,""),dL=d(R,"size",7,"md"),X0=d(R,"language",7,"en-US"),RL=HL(null);function n0(){if(typeof window>"u")return 1;return IJ(CJ(window.outerWidth,window.innerWidth),yj.maxZoom,yj.minCompensation)}let t0=HL(1);KL(()=>{if(typeof window>"u")return;let j=()=>{ML(t0,n0(),!0)};return j(),window.addEventListener("resize",j),()=>window.removeEventListener("resize",j)});let S=HL(null),rL=O(()=>L(S)?.ndsIcons===!0),lL=O(()=>AJ(L(S))),pL=HL(null),oL=HL(0),V0=HL(0),y0=HL(0);KL(()=>{if(!L(RL))return;return ij(L(RL),(j)=>{ML(S,j,!0)})}),KL(()=>{if(!L(RL))return;return aj(L(RL),(j)=>{ML(pL,j,!0)})}),KL(()=>{let j=L(S)?.toolkitCoordinator;if(!j||typeof j.onPolicyChange!=="function")return;let U=j.onPolicyChange(()=>{ML(V0,L(V0)+1)});return()=>{try{U?.()}catch{}}}),KL(()=>{let j=L(S)?.toolkitCoordinator;if(!j||typeof j.onToolContextResolverChange!=="function")return;let U=j.onToolContextResolverChange(()=>{ML(y0,L(y0)+1)});return()=>{try{U?.()}catch{}}});let B=O(()=>L(S)?.toolCoordinator),e0=O(()=>L(S)?.ttsService),$L=O(()=>L(S)?.elementToolStateStore),Y0=O(()=>L(S)?.assessmentId??""),nL=O(()=>x0()||L(pL)?.itemId||""),r=O(()=>L(pL)?.canonicalItemId||L(nL)),BL=O(()=>f0()||L(S)?.sectionId||""),mL=O(()=>T0()||L(pL)?.contentKind||(gL()==="section"?"section":"assessment-item")),p=O(()=>{if(gL()&&gL()!=="item")return gL();if(L(mL)==="rubric-block-stimulus")return"passage";return"item"}),PL=O(()=>{if(K0())return K0();if(L(p)==="section")return L(BL)||L(S)?.sectionId||"default-section";if(L(p)==="assessment")return L(S)?.assessmentId||"default-assessment";return L(r)||L(nL)||"default-item"}),Lj=O(()=>S0()||L(PL)),WL=O(()=>C0()||L(pL)?.item||null),jL=O(()=>A0()||LJ),jJ=O(()=>dj(B0())),JJ=O(()=>L(jL).normalizeToolIds(L(jJ)).filter(Boolean)),jj=O(()=>{if(L(p)==="section")return"section";if(L(p)==="passage"||L(mL)==="rubric-block-stimulus")return"passage";return"item"}),D0=O(()=>{L(V0);let j=L(S)?.toolkitCoordinator;if(!j||typeof j.decideToolPolicy!=="function")return null;return j.decideToolPolicy({level:L(jj),scope:{level:L(p),scopeId:L(PL),assessmentId:L(S)?.assessmentId,sectionId:L(BL)||void 0,itemId:L(nL)||void 0,canonicalItemId:L(r)||void 0,contentKind:L(mL)}})}),Jj=O(()=>{let j=(U)=>Array.from(new Set(U));if(L(D0))return j(L(jL).normalizeToolIds(L(D0).visibleTools.map((U)=>U.toolId)).filter(Boolean));return j(L(JJ))}),ZJ=O(()=>{let j=new Set;if(!L(D0))return j;for(let U of L(D0).visibleTools){if(!U.required&&!U.alwaysAvailable)continue;for(let J of L(jL).normalizeToolIds([U.toolId]).filter(Boolean))j.add(J)}return j}),p0=O(()=>{if(L(p)==="section"||L(p)==="assessment")return!0;let j=L(WL)?.config;return!!(L(WL)&&j&&typeof j==="object")}),Zj=O(()=>{L(V0);let j=L(S)?.toolkitCoordinator;if(!j||typeof j.getPolicyInputs!=="function")return null;return j.getPolicyInputs()}),hL=O(()=>L(Zj)?.assessment??null),O0=O(()=>L(Zj)?.currentItemRef??null),tL=O(()=>{if(L(p)==="section")return{level:"section",assessment:L(hL)||{},section:{}};if(L(p)==="assessment")return{level:"assessment",assessment:L(hL)||{}};if(!L(p0)||!L(WL))return null;if(L(p)==="passage")return{level:"passage",assessment:L(hL)||{},itemRef:L(O0)||{id:L(r)},passage:L(WL)};return{level:"item",assessment:L(hL)||{},itemRef:L(O0)||{id:L(r)},item:L(WL)}}),Uj=O(()=>{if(L(tL))return L(tL);return{level:"item",assessment:L(hL)||{},itemRef:L(O0)||{id:L(r)},item:L(WL)||{id:L(r),config:{}}}}),Kj=O(()=>{if(L(p)!=="item"&&L(p)!=="passage")return[];if(!L(p0)||!L(WL))return[];let j=L(WL)?.config?.models;return(Array.isArray(j)?j:j&&typeof j==="object"?Object.values(j):[]).filter((J)=>J&&typeof J==="object"&&typeof J.id==="string").map((J)=>({level:"element",assessment:L(hL)||{},itemRef:L(O0)||{id:L(r)},item:L(WL),elementId:J.id}))}),UJ=O(()=>{let j=L(S)?.toolkitCoordinator||null,U=(J)=>a0(J)?J:q0(J,L(p),L(PL));return{scope:{level:L(p),scopeId:L(PL),assessmentId:L(S)?.assessmentId,sectionId:L(BL),itemId:L(nL),canonicalItemId:L(r),contentKind:L(mL)},itemId:L(PL),catalogId:L(Lj),language:X0(),i18n:L(lL),ui:{size:dL()},getScopeElement:()=>aL()||L(pL)?.scopeElement||null,getGlobalElementId:()=>{if(!L($L)||!L(Y0)||!L(BL)||!L(r))return null;return L($L).getGlobalElementId(L(Y0),L(BL),L(r),L(r))},toolCoordinator:L(B)||null,toolkitCoordinator:j,ttsService:L(e0)||null,elementToolStateStore:L($L)||null,toggleTool:(J)=>{if(!L(B))return;let K=U(J);if(!L(B).getToolState(K))L(B).registerTool(K,J);L(B).toggleTool(K)},isToolVisible:(J)=>{if(!L(B))return!1;return L(B).isToolVisible(U(J))},subscribeVisibility:L(B)?(J)=>L(B).subscribe(J):null}}),b0=O(()=>{L(y0);let j=L(S)?.toolkitCoordinator;if(!j||typeof j.hasToolContextResolver!=="function"||typeof j.resolveToolContext!=="function")return{};let U={};for(let J of L(Jj)){if(!L(jL).get(J)?.supportedLevels.includes(L(p)))continue;if(!j.hasToolContextResolver(J))continue;let F=j.resolveToolContext({toolId:J,context:L(Uj),toolbarContext:L(UJ)});if(F)U[J]=F}return U}),KJ=O(()=>{let j=L(Jj).filter((G)=>{let D=L(jL).get(G);return D?D.supportedLevels.includes(L(p)):!1}),U=Object.values(L(b0)),J=new Set(U.map((G)=>G.toolId)),K=new Set(U.filter((G)=>G.visible).map((G)=>G.toolId)),F=j.filter((G)=>!J.has(G));if(L(p)==="section")return F.forEach((G)=>K.add(G)),Array.from(K);if(!L(p0))return F.forEach((G)=>K.add(G)),Array.from(K);if(!L(tL)&&L(Kj).length===0)return F.forEach((G)=>K.add(G)),Array.from(K);if(F.filter((G)=>L(ZJ).has(G)).forEach((G)=>K.add(G)),L(tL))L(jL).filterVisibleInContext(F,L(tL)).forEach((G)=>K.add(G.toolId));for(let G of L(Kj))L(jL).filterVisibleInContext(F,G).forEach((D)=>K.add(D.toolId));return Array.from(K)}),eL=O(()=>L(jL).filterToolIdsByActivation(L(KJ),"toolbar-toggle"));KL(()=>{if(!y)return;let j=!1;return L(jL).ensureToolModulesLoaded(L(eL)).then(()=>{if(!j)ML(oL,L(oL)+1)}).catch((U)=>{console.error("[ItemToolBar] Failed to load one or more tool modules:",U)}),()=>{j=!0}});function QJ(){if(aL())return aL();return L(pL)?.scopeElement||null}function XJ(){if(!L($L)||!L(Y0)||!L(BL)||!L(r))return null;return L($L).getGlobalElementId(L(Y0),L(BL),L(r),L(r))}let bL=O(()=>{let j=L(S)?.toolkitCoordinator||null,U=(J)=>{return a0(J)?J:q0(J,L(p),L(PL))};return{scope:{level:L(p),scopeId:L(PL),assessmentId:L(S)?.assessmentId,sectionId:L(BL),itemId:L(nL),canonicalItemId:L(r),contentKind:L(mL)},itemId:L(PL),catalogId:L(Lj),language:X0(),i18n:L(lL),ui:{size:dL()},getScopeElement:QJ,getGlobalElementId:XJ,toolCoordinator:L(B)||null,toolkitCoordinator:j,ttsService:L(e0)||null,elementToolStateStore:L($L)||null,toggleTool:(J)=>{if(!L(B))return;let K=U(J);if(!L(B).getToolState(K))L(B).registerTool(K,J);L(B).toggleTool(K)},isToolVisible:(J)=>{if(!L(B))return!1;return L(B).isToolVisible(U(J))},subscribeVisibility:L(B)?(J)=>L(B).subscribe(J):null,getResolvedToolContext:(J)=>L(b0)[J]??null,getToolRenderParams:(J)=>{let K=L(b0)[J]?.params??null,F=Qj.get(J);if(!F)return K;return{...K??{},...F}}}}),Qj=new Map,Xj=0,kL=O(()=>{if(!y)return[];L(oL);let j=[];for(let U of L(eL)){let J=L(jL).renderForToolbar(U,L(Uj),L(bL));if(J)j.push(J)}return j}),VJ=O(()=>{if(!Array.isArray(Q0()))return[];let j=[];return Q0().forEach((U,J)=>{if(Aj(U)){j.push(U);return}console.warn(`[ItemToolBar] Ignoring invalid host button at index ${J}. Expected { id, label, href | onClick } with valid types.`)}),j}),YJ=O(()=>L(kL).filter((j)=>!!j.button).map((j)=>{let U=j.button;return{id:j.toolId,label:U.label,ariaLabel:U.ariaLabel||U.label,icon:U.icon,faIconName:U.faIconName,tooltip:U.tooltip||U.label,disabled:U.disabled,active:L(yL)[j.toolId]??U.active??!1,onClick:()=>{U.onClick(),uL()}}})),Vj=O(()=>[...L(YJ),...L(VJ)]),L0=O(()=>{let j={};for(let U of L(kL))j[U.toolId]=L(yL)[U.toolId]??U.button?.active??!1;return j}),DJ=O(()=>L(kL).flatMap((j)=>(j.elements||[]).filter((U)=>U.mount==="before-buttons").filter((U)=>Boolean(U.element)).map((U,J)=>({key:`before-${j.toolId}-${J}`,toolId:j.toolId,entry:U})))),OJ=O(()=>L(kL).flatMap((j)=>(j.elements||[]).filter((U)=>U.mount==="after-buttons").filter((U)=>Boolean(U.element)).map((U,J)=>({key:`after-${j.toolId}-${J}`,toolId:j.toolId,entry:U})))),Yj=O(()=>L(kL).flatMap((j)=>(j.elements||[]).filter((U)=>U.mount==="controls-row").filter((U)=>Boolean(U.element)).map((U,J)=>({key:`controls-row-${j.toolId}-${J}`,toolId:j.toolId,entry:U})))),Dj=O(()=>L(kL).flatMap((j)=>(j.elements||[]).map((U)=>({toolId:j.toolId,hint:U.layoutHints?.controlsRow})).filter((U)=>Boolean(U.hint)))),Oj=O(()=>L(kL).flatMap((j)=>(j.elements||[]).map((U)=>({toolId:j.toolId,hint:U.layoutHints?.headerOverlay})).filter((U)=>Boolean(U.hint)))),Gj=O(()=>L(Dj).some((j)=>j.hint?.reserveSpace===!0)),Mj=O(()=>L(Dj).some((j)=>j.hint?.showWhenToolActive===!0&&(L(L0)[j.toolId]??!1))),GJ=O(()=>SL()==="left"||SL()==="right"),Nj=O(()=>L(Oj).some((j)=>j.hint?.showWhenToolActive===!0&&(L(L0)[j.toolId]??!1))),MJ=O(()=>L(Yj).length>0||L(Gj)||L(Mj));function NJ(){if(!L(RL))return null;let j=L(RL).getRootNode();if(j instanceof ShadowRoot)return j.host;return null}KL(()=>{let j=NJ();if(!j)return;let U=L(Oj).length>0,J=L(Nj);return j.setAttribute("data-pie-header-overlay",U?"true":"false"),j.setAttribute("data-pie-header-overlay-active",J?"true":"false"),()=>{j.removeAttribute("data-pie-header-overlay"),j.removeAttribute("data-pie-header-overlay-active")}}),KL(()=>{if(!y)return;if(L(Vj).some((j)=>!!o0(j)))H0()});function G0(j){if(j.id in L(yL))return L(yL)[j.id]===!0;return j.active===!0}function Rj(j){return Cj(j)}function uL(){let j={};for(let U of L(kL))if(U.sync?.(),U.button)j[U.toolId]=U.button.active??!1;ML(yL,j,!0)}KL(()=>{let j=[];uL();for(let U of L(kL))if(U.subscribeActive){let J=!1,K=U.subscribeActive((F)=>{queueMicrotask(()=>{if(J)return;ML(yL,{...L(yL),[U.toolId]:F},!0),U.sync?.()})});j.push(()=>{J=!0,K()})}return()=>{j.forEach((U)=>U())}}),KL(()=>{let j=L(S)?.toolkitCoordinator;if(typeof j?.registerToolRequestTarget!=="function")return;let U=L(jj);return j.registerToolRequestTarget({level:U,hostsTool:(J)=>L(eL).includes(J),open:(J,K)=>{if(!L(B))return;if(!L(eL).includes(J))return;if(K&&Object.keys(K).length>0)Xj+=1,Qj.set(J,{...K,toolRequestId:Xj});let F=q0(J,L(p),L(PL));if(!L(B).getToolState(F))L(B).registerTool(F,J);L(B).showTool(F),queueMicrotask(()=>uL())}})}),KL(()=>{if(!L(bL).subscribeVisibility)return;let j=!1,U=L(bL).subscribeVisibility(()=>{queueMicrotask(()=>{if(j)return;uL()})});return()=>{j=!0,U?.()}}),KL(()=>{let j=L(bL).toolkitCoordinator;if(typeof j?.subscribeTelemetry!=="function")return;let U=!1,J=j.subscribeTelemetry(({eventName:K,payload:F})=>{if(K!=="pie-toolkit-tool-config-updated")return;if(F?.toolId&&!L(eL).includes(F.toolId))return;queueMicrotask(()=>{if(U)return;ML(oL,L(oL)+1),uL()})});return()=>{U=!0,J?.()}});function _0(j,U){let J=null,K=(G)=>{if(!G)return;let D=G.__pieToolElementUnmount;if(typeof D==="function")D()},F=(G)=>{if(J===G)return;if(J){if(K(J),J.parentNode===j)j.removeChild(J)}if(J=G,J){if(J.parentNode&&J.parentNode!==j)J.parentNode.removeChild(J);j.appendChild(J)}};return F(U),{update(G){F(G)},destroy(){F(null)}}}function E0(j,U){let J=U,K=null,F=null,G=[],D=null,H=null,wL=null,x=null,V=null,qL=null,JL=null,c=null,i=!1,T=!1,v=()=>J.mounted.entry.shell?.pageTabOrder===!0,b=()=>J.mounted.entry.shell?.ndsHeaderControls===!0,P=null,m=null,C=null,W=0,A=0,g=0,l=0,h=0,FL=0,_L=0,EL=0,zL=null,vL=[],_=0,E=0,k=J.mounted.entry.shell?.initialWidth??720,w=J.mounted.entry.shell?.initialHeight??560,YL=null,t=null,TL=!1,cL=(Z)=>{if(!Z)return;let X=Z.__pieToolElementUnmount;if(typeof X==="function")X()},s=()=>{let Z=J.mounted.entry.shell;if(!Z)return null;return{toolId:J.mounted.toolId,toolbarContext:L(bL),shellConfig:Z}},o=(Z)=>{let X=L(jL).get(J.mounted.toolId),M=s();if(!X?.onHostedMount||!M)return;X.onHostedMount(Z,M)},M0=()=>{let Z=L(jL).get(J.mounted.toolId),X=s();if(!Z?.onHostedResize||!X)return;Z.onHostedResize({width:k,height:w},J.mounted.entry.element,X)},PJ=()=>{let Z=L(jL).get(J.mounted.toolId),X=s();if(!Z?.onHostedUnmount||!X)return;Z.onHostedUnmount(J.mounted.entry.element,X)},e=(Z,X,M)=>Math.max(X,Math.min(Z,M)),WJ=()=>{let Z=J.mounted.entry.shell,X=Z?.minWidth??320,M=Z?.minHeight??240,Y=Z?.maxWidth??window.innerWidth,Q=Z?.maxHeight??window.innerHeight;return{minWidth:X,minHeight:M,maxWidth:Y,maxHeight:Q}},v0=()=>{let Z=J.mounted.entry.shell?.minWidth,X=typeof Z==="number"&&Z>0&&k<Z,M=X?`${Z}px`:"";if(P)P.style.minWidth=M;if(D)D.style.minWidth=M;if(H)H.style.minWidth=M;if(K)K.style.overflowX=X?"auto":"visible",K.style.overflowY="visible"},Fj=()=>J.mounted.entry.shell?.content?.overflowY==="auto"?"auto":"hidden",kJ=()=>{if(!D)return 0;let Z=D.getBoundingClientRect().height;if(Z>0)return Z;return D.offsetHeight||0},g0=()=>{if(!H)return;let Z=J.mounted.entry.shell;if(H.style.overflowX="hidden",H.style.overflowY=Fj(),!P)return;if(Z?.content?.preserveMinHeight===!0){let X=kJ(),M=Z.minHeight??240,Y=Math.max(0,M-X),Q=Math.max(0,w-X),N=Math.max(Q,Y);P.style.height=`${N}px`,P.style.minHeight="0",P.style.flex=`0 0 ${N}px`;return}P.style.height="100%",P.style.minHeight="0",P.style.flex="1 1 auto"},N0=()=>{let{minWidth:Z,minHeight:X,maxWidth:M,maxHeight:Y}=WJ(),Q=Math.min(Z,window.innerWidth),N=Math.min(X,window.innerHeight);k=e(k,Q,Math.max(Q,Math.min(M,window.innerWidth))),w=e(w,N,Math.max(N,Math.min(Y,window.innerHeight))),_=e(_,0,Math.max(0,window.innerWidth-k)),E=e(E,0,Math.max(0,window.innerHeight-w)),j0(),v0(),g0(),M0()},AL=(Z,X)=>{_+=Z,E+=X,N0()},R0=(Z,X)=>{k+=Z,w+=X,N0()},Pj=(Z,X,M,Y="fa-regular")=>{let Q=document.createElement("nds-icon-button");if(Q.setAttribute("variant","tertiary"),Q.setAttribute("size","small"),Q.setAttribute("type","circle"),Q.setAttribute("icon-name",X),Q.setAttribute("button-aria-label",Z),Q.title=Z,Q.addEventListener("click",(N)=>{N.stopPropagation(),M(),sL()}),Y!=="fa-light"){let N=(I)=>{I.classList.remove("fa-light"),I.classList.add(Y)},q=Q.querySelector("i.fa-light");if(q)N(q);else{let I=new MutationObserver(()=>{let u=Q.querySelector("i.fa-light");if(u)N(u),I.disconnect()});I.observe(Q,{childList:!0,subtree:!0})}}return Q},Wj=(Z,X,M)=>{let Y=document.createElement("button");return Y.type="button",Y.className="pie-tool-shell__control",Y.setAttribute("aria-label",Z),Y.title=Z,Y.textContent=X,Y.style.border="1px solid transparent",Y.style.background="color-mix(in srgb, var(--pie-white, #fff) 10%, transparent)",Y.style.color="inherit",Y.style.cursor="pointer",Y.style.display="inline-flex",Y.style.alignItems="center",Y.style.justifyContent="center",Y.style.width="28px",Y.style.height="28px",Y.style.padding="0",Y.style.fontSize="14px",Y.style.fontWeight="700",Y.style.borderRadius="8px",Y.style.lineHeight="1",Y.onclick=(Q)=>{Q.stopPropagation(),M(),sL()},Y.onfocus=()=>{Y.style.outline="2px solid var(--pie-button-focus-outline, var(--pie-primary, #4A90E2))",Y.style.outlineOffset="2px"},Y.onblur=()=>{Y.style.outline="none",Y.style.outlineOffset="0"},Y},j0=()=>{if(!K)return;K.style.left=`${_}px`,K.style.top=`${E}px`,K.style.width=`${k}px`,K.style.height=`${w}px`,K.style.display=J.active?"flex":"none",K.style.setProperty("--pie-tool-shell-zoom-comp",String(n0()))},kj=()=>{if(wL)wL.textContent=J.mounted.entry.shell?.title||J.mounted.toolId;for(let{el:Z,key:X}of G){let M=J.i18n.t(X);if(Z.tagName==="NDS-ICON-BUTTON")Z.setAttribute("button-aria-label",M);else Z.setAttribute("aria-label",M);if(Z.title)Z.title=M}},wj=()=>{if(!H)return;let Z=J.mounted.entry.element;if(Z.style.display="block",Z.style.width="100%",Z.style.height="100%",Z.style.flex="1 1 auto",Z.style.minHeight="0",P&&P!==Z){if(P.parentNode===H)cL(P),H.removeChild(P);P=null}if(Z.parentNode&&Z.parentNode!==H)Z.parentNode.removeChild(Z);if(Z.parentNode!==H)H.appendChild(Z);P=Z,v0(),g0(),o(Z)},sL=()=>{if(L(B)&&K)L(B).bringToFront(K)},$0=()=>{let{innerWidth:Z,innerHeight:X}=window,M=J.mounted.entry.shell,Y=M?.initialAlign??"center",Q=M?.initialMargin??16,N=Q+60;switch(Y){case"top-left":_=Q,E=N;break;case"top-right":_=Math.max(0,Z-k-Q),E=N;break;case"bottom-left":_=Q,E=Math.max(0,X-w-N);break;case"bottom-right":_=Math.max(0,Z-k-Q),E=Math.max(0,X-w-N);break;default:_=Math.max(0,Math.round((Z-k)/2)),E=Math.max(0,Math.round((X-w)/2))}N0()},wJ=()=>{let Z=t;if(!Z)return;queueMicrotask(()=>{if(!Z.isConnected)return;try{Z.focus()}catch{}})},zj=()=>{if(typeof document>"u")return null;let Z=document.activeElement;while(Z){let X=Z.shadowRoot;if(X&&X.activeElement&&X.activeElement!==Z)Z=X.activeElement;else break}return Z??null},Hj=()=>{if(!K||YL)return;let Z=zj();if(!t&&Z&&!K.contains(Z))t=Z;if(v()&&!T)document.addEventListener("keydown",h0,!0),T=!0;YL=pJ(K,{initialFocus:V,onEscape:()=>{u0()},wrap:!v(),onTabExit:v()?(X,M)=>{if(X==="backward"){if(t?.isConnected){M.preventDefault();try{t.focus()}catch{}}return}let Y=m0();if(Y){M.preventDefault();try{Y.focus()}catch{}}}:void 0})},m0=()=>{let Z=L(bL).getScopeElement?.()??null;if(!Z)return null;let X=(Y)=>{if(L(RL)&&L(RL).contains(Y))return!0;if(K&&K.contains(Y))return!0;return!1},M=(Y)=>{if(Y instanceof HTMLElement){if(X(Y))return null;if(Y.matches?.(bJ)&&_J(Y))return Y}let Q=Y.shadowRoot;if(Q)for(let N=0;N<Q.children.length;N++){let q=M(Q.children[N]);if(q)return q}for(let N=0;N<Y.children.length;N++){let q=M(Y.children[N]);if(q)return q}return null};return M(Z)},zJ=()=>{if(!K)return[];return yJ(K).filter((Z)=>Z!==JL&&Z!==c)},h0=(Z)=>{if(Z.key!=="Tab")return;if(!K||!J.active)return;let X=zj();if(!X)return;if(K.contains(X))return;let M=zJ();if(M.length===0)return;if(Z.shiftKey){let Y=m0();if(X!==Y)return;Z.preventDefault();try{M[M.length-1].focus()}catch{}return}if(X!==t)return;Z.preventDefault();try{M[0].focus()}catch{}},xj=()=>{if(T)document.removeEventListener("keydown",h0,!0),T=!1;if(!YL)return;let Z=YL;YL=null;try{Z()}catch{}wJ()},u0=()=>{L(bL).toggleTool(J.mounted.toolId),uL()},fj=(Z)=>{if(!J.mounted.entry.shell?.draggable)return;if(Z.target.closest("button")||!K)return;Z.preventDefault(),m=Z.pointerId,W=Z.clientX-_,A=Z.clientY-E,K.setPointerCapture(Z.pointerId),sL()},HJ=(Z)=>(X)=>{if(!K||!J.mounted.entry.shell?.resizable)return;X.preventDefault(),X.stopPropagation(),C=X.pointerId,zL=Z,g=k,l=w,h=X.clientX,FL=X.clientY,_L=_,EL=E,K.setPointerCapture(X.pointerId),sL()},Sj=(Z)=>{if(!K)return;if(m===Z.pointerId){Z.preventDefault();let X=Math.max(0,window.innerWidth-k),M=Math.max(0,window.innerHeight-w);_=e(Z.clientX-W,0,X),E=e(Z.clientY-A,0,M),j0();return}if(C===Z.pointerId){Z.preventDefault();let X=J.mounted.entry.shell,M=X?.minWidth??320,Y=X?.minHeight??240,Q=Math.min(M,window.innerWidth),N=Math.min(Y,window.innerHeight),q=X?.maxWidth??window.innerWidth,I=X?.maxHeight??window.innerHeight,u=Z.clientX-h,ZL=Z.clientY-FL;if(zL==="se")k=e(g+u,Q,Math.max(Q,Math.min(q,window.innerWidth-_))),w=e(l+ZL,N,Math.max(N,Math.min(I,window.innerHeight-E)));else if(zL==="sw"){let n=_L+g,OL=e(g-u,Q,Math.min(q,n));_=n-OL,k=OL,w=e(l+ZL,N,Math.max(N,Math.min(I,window.innerHeight-E)))}else if(zL==="ne"){let n=EL+l;k=e(g+u,Q,Math.max(Q,Math.min(q,window.innerWidth-_)));let OL=e(l-ZL,N,Math.min(I,n));E=n-OL,w=OL}else if(zL==="nw"){let n=_L+g,OL=EL+l,$=e(g-u,Q,Math.min(q,n));_=n-$,k=$;let J0=e(l-ZL,N,Math.min(I,OL));E=OL-J0,w=J0}j0(),v0(),g0(),M0()}},Bj=(Z)=>{if(!K)return;if(m===Z.pointerId)m=null,K.releasePointerCapture(Z.pointerId);if(C===Z.pointerId)C=null,K.releasePointerCapture(Z.pointerId)},Tj=()=>{N0()};if(y&&J.mounted.entry.shell){let Z=J.mounted.entry.shell?.ndsHeaderControls===!0&&L(rL);if(Z)H0();if(K=document.createElement("div"),K.className="pie-tool-shell",K.setAttribute("data-pie-tool-shell",J.mounted.toolId),K.style.position="fixed",K.style.zIndex="2000",K.style.background="var(--pie-background, #fff)",K.style.border="1px solid var(--pie-border-light, #d1d5db)",K.style.borderRadius="12px",K.style.boxShadow="0 10px 40px color-mix(in srgb, var(--pie-black, #000) 25%, transparent)",K.style.setProperty("--color-interactive-blue","var(--pie-calculator-button-color, var(--pie-button-color, var(--pie-text, #222)))"),K.style.setProperty("--color-new-gray","var(--pie-background-dark, #f3f5f7)"),K.style.setProperty("--color-primary-white","var(--pie-white, #ffffff)"),K.style.setProperty("--color-primary-black","var(--pie-text, #000000)"),K.style.setProperty("--color-focus-blue","var(--pie-button-focus-outline, #2b87ff)"),K.style.overflow="visible",K.style.display=J.active?"flex":"none",K.style.flexDirection="column",K.style.userSelect="none",K.style.webkitUserSelect="none",K.style.touchAction="none",K.setAttribute("draggable","false"),K.addEventListener("dragstart",(Q)=>Q.preventDefault()),D=document.createElement("div"),D.className="pie-tool-shell__header",D.style.display="flex",D.style.alignItems="center",D.style.justifyContent="space-between",D.style.gap="6px",D.style.padding=b()?"12px 12px 12px 28px":"10px 12px",b())D.style.minHeight="48px";if(b())D.style.background="var(--pie-section-player-card-header-background, var(--pie-button-active-bg, #f3f4f6))",D.style.color="var(--pie-text, #111827)",D.style.borderBottom="1px solid var(--pie-border-light, #e5e7eb)";else D.style.background="var(--pie-primary-dark, #2c3e50)",D.style.color="var(--pie-white, #fff)";D.style.cursor=J.mounted.entry.shell.draggable===!1?"default":"move",D.style.flex="0 0 auto",D.style.borderRadius="12px 12px 0 0",D.style.overflow="hidden",D.style.userSelect="none",D.style.webkitUserSelect="none",D.style.touchAction="none",D.setAttribute("draggable","false"),D.addEventListener("dragstart",(Q)=>Q.preventDefault()),wL=document.createElement("span"),wL.className="pie-tool-shell__title",wL.textContent=J.mounted.entry.shell.title||J.mounted.toolId,D.appendChild(wL),x=document.createElement("div"),x.className="pie-tool-shell__controls",x.style.display="inline-flex",x.style.alignItems="center",x.style.gap=b()?"6px":"4px";let X=J.mounted.entry.shell,M=(Q,N,q,I,u="fa-regular")=>{if(!x)return;let ZL=J.i18n.t(Q),n=Z?Pj(ZL,q,I,u):Wj(ZL,N,I);G.push({el:n,key:Q}),x.appendChild(n)};if(X?.draggable!==!1)M("toolkit.window.moveLeftA11y","←","chevron-left",()=>AL(-24,0)),M("toolkit.window.moveRightA11y","→","chevron-right",()=>AL(24,0)),M("toolkit.window.moveUpA11y","↑","chevron-up",()=>AL(0,-24)),M("toolkit.window.moveDownA11y","↓","chevron-down",()=>AL(0,24));if(X?.resizable!==!1)M("toolkit.window.shrinkA11y","−","magnifying-glass-minus",()=>R0(-40,-40)),M("toolkit.window.growA11y","+","magnifying-glass-plus",()=>R0(40,40));if(!b()){let Q=Wj(J.i18n.t("toolkit.window.centerA11y"),"◎",$0);G.push({el:Q,key:"toolkit.window.centerA11y"}),x.appendChild(Q)}let Y=null;if(b())Y=document.createElement("div"),Y.className="pie-tool-shell__header-right",Y.style.display="inline-flex",Y.style.alignItems="center",Y.style.gap="6px",Y.style.setProperty("zoom","var(--pie-tool-shell-zoom-comp, 1)"),Y.appendChild(x),D.appendChild(Y);else D.appendChild(x);if(Z)V=Pj(J.i18n.t("toolkit.window.closeA11y"),"xmark",u0,"fa-regular"),G.push({el:V,key:"toolkit.window.closeA11y"}),V.style.display=J.mounted.entry.shell.closeable===!1?"none":"inline-block";else{let Q=document.createElement("button");Q.type="button",Q.className="pie-tool-shell__close",Q.setAttribute("aria-label",J.i18n.t("toolkit.window.closeA11y")),G.push({el:Q,key:"toolkit.window.closeA11y"});let N="http://www.w3.org/2000/svg",q=document.createElementNS(N,"svg");q.setAttribute("xmlns",N),q.setAttribute("viewBox","0 0 16 16"),q.setAttribute("aria-hidden","true");let I=document.createElementNS(N,"path");I.setAttribute("d","M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5"),I.setAttribute("stroke","currentColor"),I.setAttribute("stroke-width","1.8"),I.setAttribute("stroke-linecap","round"),q.appendChild(I),Q.appendChild(q);let u=q.style;u.width="16px",u.height="16px",u.display="block",u.flexShrink="0",u.pointerEvents="none";let ZL="color-mix(in srgb, var(--pie-white, #fff) 8%, transparent)",n="color-mix(in srgb, var(--pie-white, #fff) 18%, transparent)";Q.style.border="1px solid transparent",Q.style.background=ZL,Q.style.color="inherit",Q.style.cursor="pointer",Q.style.display="inline-flex",Q.style.alignItems="center",Q.style.justifyItems="center",Q.style.width="28px",Q.style.height="28px",Q.style.padding="0",Q.style.borderRadius="8px",Q.style.lineHeight="0",Q.style.transition="background-color 0.15s ease, border-color 0.15s ease",Q.style.display=J.mounted.entry.shell.closeable===!1?"none":"inline-flex",Q.onmouseenter=()=>{Q.style.background=n},Q.onmouseleave=()=>{Q.style.background=ZL},Q.onfocus=()=>{Q.style.outline="2px solid var(--pie-button-focus-outline, var(--pie-primary, #4A90E2))",Q.style.outlineOffset="2px"},Q.onblur=()=>{Q.style.outline="none",Q.style.outlineOffset="0"},Q.onclick=u0,V=Q}if(Y)Y.appendChild(V);else D.appendChild(V);if(D.tabIndex=0,D.onkeydown=(Q)=>{if(Q.key==="Home"){Q.preventDefault(),$0();return}let N=J.mounted.entry.shell;if(Q.shiftKey&&N?.resizable!==!1){if(Q.key==="ArrowRight"||Q.key==="ArrowDown"){Q.preventDefault(),R0(40,40);return}if(Q.key==="ArrowLeft"||Q.key==="ArrowUp"){Q.preventDefault(),R0(-40,-40);return}}if(N?.draggable!==!1){if(Q.key==="ArrowLeft")Q.preventDefault(),AL(-24,0);else if(Q.key==="ArrowRight")Q.preventDefault(),AL(24,0);else if(Q.key==="ArrowUp")Q.preventDefault(),AL(0,-24);else if(Q.key==="ArrowDown")Q.preventDefault(),AL(0,24)}},H=document.createElement("div"),H.className="pie-tool-shell__content",H.style.position="relative",H.style.width="100%",H.style.flex="1 1 auto",H.style.minHeight="0",H.style.overflowX="hidden",H.style.overflowY=Fj(),H.style.borderRadius="0 0 12px 12px",b()){let Q=(N)=>{let q=document.createElement("div");return q.tabIndex=0,q.setAttribute("aria-hidden","true"),q.setAttribute("data-pie-tool-shell-focus-guard",N),q.style.position="absolute",q.style.width="1px",q.style.height="1px",q.style.padding="0",q.style.margin="-1px",q.style.overflow="hidden",q.style.clipPath="inset(50%)",q.style.whiteSpace="nowrap",q.style.border="0",q};JL=Q("start"),c=Q("end"),JL.addEventListener("focus",(N)=>{if(i)return;i=!0;try{if(N.stopPropagation(),t?.isConnected)try{t.focus()}catch{}}finally{queueMicrotask(()=>{i=!1})}}),c.addEventListener("focus",(N)=>{if(i)return;i=!0;try{N.stopPropagation();let q=m0();if(q)try{q.focus()}catch{}}finally{queueMicrotask(()=>{i=!1})}}),K.appendChild(JL)}if(K.appendChild(D),K.appendChild(H),b()&&c)K.appendChild(c);if(J.mounted.entry.shell.resizable!==!1){let Q=(N,q,I,u,ZL,n,OL)=>{let $=document.createElement("div");if($.className="pie-tool-shell__resize",$.style.position="absolute",$.style.width="24px",$.style.height="24px",$.style.cursor=n,$.style.zIndex="10",$.style.touchAction="none",$.setAttribute("draggable","false"),q!==null)$.style.top=q;if(I!==null)$.style.right=I;if(u!==null)$.style.bottom=u;if(ZL!==null)$.style.left=ZL;if(OL!==null)$.style.background=`linear-gradient(${OL}, transparent 0%, transparent 40%, rgba(0,0,0,0.35) 40%, rgba(0,0,0,0.35) 60%, transparent 60%, transparent 100%)`;let J0=HJ(N);$.addEventListener("pointerdown",J0),K.appendChild($),vL.push({el:$,handler:J0})};Q("se",null,"0","0",null,"nwse-resize",null),Q("nw","0",null,null,"0","nwse-resize","135deg"),Q("ne","0","0",null,null,"nesw-resize",null),Q("sw",null,null,"0","0","nesw-resize",null)}if(D.addEventListener("pointerdown",fj),K.addEventListener("pointermove",Sj),K.addEventListener("pointerup",Bj),K.addEventListener("pointerdown",sL),window.addEventListener("resize",Tj),document.body.appendChild(K),F=new TJ(K,{context:sj,initialValue:J.runtime}),F.connect(),$0(),j0(),kj(),wj(),M0(),J.active)Hj();TL=J.active}return{update(Z){if(J=Z,!K||!H||!wL||!V)return;F?.setValue(J.runtime),kj();let X=V.tagName.toLowerCase()==="nds-icon-button"?"inline-block":"inline-flex";if(V.style.display=J.mounted.entry.shell?.closeable===!1?"none":X,j0(),wj(),M0(),!TL&&J.active)Hj();else if(TL&&!J.active)xj(),t=null;TL=J.active},destroy(){if(PJ(),F?.disconnect(),F=null,G.length=0,YL)xj();if(T)document.removeEventListener("keydown",h0,!0),T=!1;for(let{el:Z,handler:X}of vL)Z.removeEventListener("pointerdown",X);if(t=null,vL.length=0,D)D.removeEventListener("pointerdown",fj),D.onkeydown=null;if(K)K.removeEventListener("pointermove",Sj),K.removeEventListener("pointerup",Bj),K.removeEventListener("pointerdown",sL);if(window.removeEventListener("resize",Tj),P&&H&&P.parentNode===H)cL(P),H.removeChild(P);if(P=null,K&&K.parentElement)K.remove()}}}var RJ={get level(){return gL()},set level(j){gL(j),a()},get scopeId(){return K0()},set scopeId(j){K0(j),a()},get itemId(){return x0()},set itemId(j){x0(j),a()},get sectionId(){return f0()},set sectionId(j){f0(j),a()},get catalogId(){return S0()},set catalogId(j){S0(j),a()},get tools(){return B0()},set tools(j){B0(j),a()},get contentKind(){return T0()},set contentKind(j){T0(j),a()},get position(){return SL()},set position(j){SL(j),a()},get scopeElement(){return aL()},set scopeElement(j){aL(j),a()},get toolRegistry(){return A0()},set toolRegistry(j){A0(j),a()},get item(){return C0()},set item(j){C0(j),a()},get hostButtons(){return Q0()},set hostButtons(j){Q0(j),a()},get class(){return I0()},set class(j){I0(j),a()},get size(){return dL()},set size(j){dL(j),a()},get language(){return X0()},set language(j){X0(j),a()}},qj=XL(),qJ=UL(qj);{var FJ=(j)=>{var U=mJ();let J;var K=iL(U),F=iL(K);Z0(F,17,()=>L(DJ),(x)=>x.key,(x,V)=>{var qL=XL(),JL=UL(qL);{var c=(T)=>{var v=XL(),b=UL(v);z0(b,()=>L(rL),(P)=>{var m=P0();xL(m,(C,W)=>E0?.(C,W),()=>({mounted:L(V),active:L(L0)[L(V).toolId]??!1,runtime:L(S),i18n:L(lL)})),z(P,m)}),z(T,v)},i=(T)=>{var v=P0();xL(v,(b,P)=>_0?.(b,P),()=>L(V).entry.element),z(T,v)};VL(JL,(T)=>{if(L(V).entry.shell)T(c);else T(i,-1)})}z(x,qL)});var G=k0(F,2);Z0(G,17,()=>L(Vj),(x)=>x.id,(x,V,qL,JL)=>{let c=O(()=>L(rL)&&!c0(L(V))?o0(L(V)):null);var i=XL(),T=UL(i);{var v=(C)=>{var W=EJ(),A=iL(W);CL(A,1,"item-toolbar__nds-button svelte-rnx3ie"),IL(A,"type","circle"),IL(A,"size","small"),IL(A,"variant","tertiary"),QL(()=>IL(A,"icon-name",L(c))),QL(()=>IL(A,"button-aria-label",L(V).ariaLabel||L(V).label)),QL(()=>IL(A,"title",L(V).tooltip||L(V).label)),QL(()=>IL(A,"disabled",L(V).disabled)),xL(A,(g)=>tj?.(g)),xL(A,(g,l)=>ej?.(g,l),()=>G0(L(V))),GL(W),w0("click",A,function(...g){L(V).onClick?.apply(this,g)}),z(C,W)},b=(C)=>{var W=vJ();let A;var g=iL(W);{var l=(h)=>{var FL=XL(),_L=UL(FL);{var EL=(k)=>{var w=W0();U0(w,()=>F0(L(V).icon),!0),GL(w),z(k,w)},zL=O(()=>s0(L(V).icon)),vL=(k)=>{var w=pj();QL(()=>LL(w,"src",L(V).icon)),z(k,w)},_=O(()=>i0(L(V).icon)),E=(k)=>{let w=O(()=>Rj(L(V).icon));var YL=XL(),t=UL(YL);{var TL=(s)=>{var o=W0();U0(o,()=>F0(L(w)),!0),GL(o),z(s,o)},cL=(s)=>{var o=bj();QL(()=>CL(o,1,`icon icon-${L(V).icon}`,"svelte-rnx3ie")),z(s,o)};VL(t,(s)=>{if(L(w))s(TL);else s(cL,-1)})}z(k,YL)};VL(_L,(k)=>{if(L(zL))k(EL);else if(L(_))k(vL,1);else k(E,-1)})}z(h,FL)};VL(g,(h)=>{if(L(V).icon)h(l)})}GL(W),QL((h)=>{A=CL(W,1,"item-toolbar__button svelte-rnx3ie",null,A,h),LL(W,"href",L(V).disabled?void 0:L(V).href),LL(W,"target",L(V).target),LL(W,"rel",L(V).rel),LL(W,"aria-label",L(V).ariaLabel||L(V).label),LL(W,"title",L(V).tooltip||L(V).label),LL(W,"aria-disabled",L(V).disabled?"true":void 0)},[()=>({"item-toolbar__button--active":G0(L(V))})]),w0("click",W,(h)=>{if(L(V).disabled)h.preventDefault()}),z(C,W)},P=O(()=>c0(L(V))),m=(C)=>{var W=gJ();let A;var g=iL(W);{var l=(h)=>{var FL=XL(),_L=UL(FL);{var EL=(k)=>{var w=W0();U0(w,()=>F0(L(V).icon),!0),GL(w),z(k,w)},zL=O(()=>s0(L(V).icon)),vL=(k)=>{var w=pj();QL(()=>LL(w,"src",L(V).icon)),z(k,w)},_=O(()=>i0(L(V).icon)),E=(k)=>{let w=O(()=>Rj(L(V).icon));var YL=XL(),t=UL(YL);{var TL=(s)=>{var o=W0();U0(o,()=>F0(L(w)),!0),GL(o),z(s,o)},cL=(s)=>{var o=bj();QL(()=>CL(o,1,`icon icon-${L(V).icon}`,"svelte-rnx3ie")),z(s,o)};VL(t,(s)=>{if(L(w))s(TL);else s(cL,-1)})}z(k,YL)};VL(_L,(k)=>{if(L(zL))k(EL);else if(L(_))k(vL,1);else k(E,-1)})}z(h,FL)};VL(g,(h)=>{if(L(V).icon)h(l)})}GL(W),QL((h,FL)=>{A=CL(W,1,"item-toolbar__button svelte-rnx3ie",null,A,h),LL(W,"aria-label",L(V).ariaLabel||L(V).label),LL(W,"aria-pressed",FL),LL(W,"title",L(V).tooltip||L(V).label),W.disabled=L(V).disabled},[()=>({"item-toolbar__button--active":G0(L(V))}),()=>G0(L(V))]),w0("click",W,function(...h){L(V).onClick?.apply(this,h)}),z(C,W)};VL(T,(C)=>{if(L(c))C(v);else if(L(P))C(b,1);else C(m,-1)})}z(x,i)});var D=k0(G,2);Z0(D,17,()=>L(OJ),(x)=>x.key,(x,V)=>{var qL=XL(),JL=UL(qL);{var c=(T)=>{var v=XL(),b=UL(v);z0(b,()=>L(rL),(P)=>{var m=P0();xL(m,(C,W)=>E0?.(C,W),()=>({mounted:L(V),active:L(L0)[L(V).toolId]??!1,runtime:L(S),i18n:L(lL)})),z(P,m)}),z(T,v)},i=(T)=>{var v=P0();xL(v,(b,P)=>_0?.(b,P),()=>L(V).entry.element),z(T,v)};VL(JL,(T)=>{if(L(V).entry.shell)T(c);else T(i,-1)})}z(x,qL)}),GL(K);var H=k0(K,2);{var wL=(x)=>{var V=$J();let qL;Z0(V,21,()=>L(Yj),(JL)=>JL.key,(JL,c)=>{var i=XL(),T=UL(i);{var v=(P)=>{var m=XL(),C=UL(m);z0(C,()=>L(rL),(W)=>{var A=_j();xL(A,(g,l)=>E0?.(g,l),()=>({mounted:L(c),active:L(L0)[L(c).toolId]??!1,runtime:L(S),i18n:L(lL)})),z(W,A)}),z(P,m)},b=(P)=>{var m=_j();xL(m,(C,W)=>_0?.(C,W),()=>L(c).entry.element),z(P,m)};VL(T,(P)=>{if(L(c).entry.shell)P(v);else P(b,-1)})}z(JL,i)}),GL(V),QL(()=>qL=CL(V,1,"item-toolbar__controls-row svelte-rnx3ie",null,qL,{"item-toolbar__controls-row--reserve":L(Gj),"item-toolbar__controls-row--active":L(Mj),"item-toolbar__controls-row--align-start":L(GJ)})),z(x,V)};VL(H,(x)=>{if(L(MJ))x(wL)})}GL(U),uj(U,(x)=>ML(RL,x),()=>L(RL)),QL(()=>{J=CL(U,1,`item-toolbar ${I0()??""} item-toolbar--${dL()??""}`,"svelte-rnx3ie",J,{"item-toolbar--top":SL()==="top","item-toolbar--right":SL()==="right","item-toolbar--bottom":SL()==="bottom","item-toolbar--left":SL()==="left","item-toolbar--header-overlay-active":L(Nj)}),LL(U,"data-content-kind",L(mL)),LL(U,"data-level",L(p)),hj(U,`--pie-toolbar-zoom-comp: ${L(t0)};`)}),z(j,U)};VL(qJ,(j)=>{if(y)j(FJ)})}return z(f,qj),vj(RJ)}$j(["click"]);BJ("pie-item-toolbar",cj(lj,{level:{attribute:"level",type:"String"},scopeId:{attribute:"scope-id",type:"String"},itemId:{attribute:"item-id",type:"String"},sectionId:{attribute:"section-id",type:"String"},catalogId:{attribute:"catalog-id",type:"String"},tools:{attribute:"tools",type:"String"},contentKind:{attribute:"content-kind",type:"String"},position:{attribute:"position",type:"String"},size:{attribute:"size",type:"String"},language:{attribute:"language",type:"String"},scopeElement:{type:"Object"},toolRegistry:{type:"Object"},item:{type:"Object"},hostButtons:{type:"Object"},class:{}},[],[],{mode:"open"}));
46
+ export{lj as a};
@@ -1 +1,2 @@
1
1
  import "./ItemToolBar.custom-element.js";
2
+ export {};
@@ -1 +1,2 @@
1
1
  import "./PieAssessmentToolkit.custom-element.js";
2
+ export {};
@@ -1 +1,2 @@
1
1
  import "./SectionToolBar.custom-element.js";
2
+ export {};
@@ -1,3 +1,4 @@
1
+ import type { I18nProvider } from "@pie-players/pie-players-shared/i18n/types";
1
2
  import type { LoaderConfig } from "@pie-players/pie-players-shared/loader-config";
2
3
  import type { AccessibilityCatalogResolverApi, ElementToolStateStoreApi, HighlightCoordinatorApi, ToolCoordinatorApi, ToolkitCoordinatorApi, TtsServiceApi } from "../services/interfaces.js";
3
4
  import type { TTSHighlightTargetResolver } from "../services/tts/highlight-target-resolver.js";
@@ -28,6 +29,33 @@ export interface AssessmentToolkitRuntimeContext {
28
29
  * `runtime.ndsIcons` (or the `nds-icons` attribute on the toolkit).
29
30
  */
30
31
  ndsIcons?: boolean;
32
+ /**
33
+ * Interface locale: the language this deployment renders its *own* UI in —
34
+ * toolbar labels, tool panels, `aria-label`s. Not the language of the
35
+ * authored content, which is a fact about the item and travels on `env`.
36
+ *
37
+ * A composition context in the sense of `composition-context.md`: the
38
+ * deployment knows it and no tool can. Sourced from the host's
39
+ * `runtime.locale` (or the `locale` attribute on the toolkit), defaulting to
40
+ * `en-US` with no host input — never `navigator.language`, because a
41
+ * rendered-string change reaches a host's live delivery on their next install
42
+ * with no build signal on their side.
43
+ */
44
+ locale?: string;
45
+ /**
46
+ * The provider resolving {@link locale} to strings.
47
+ *
48
+ * Published here rather than constructed per tool so one catalog load serves
49
+ * every capability on the page, and so a host that supplies its own
50
+ * `I18nProvider` implementation reaches all of them. A tool that finds no
51
+ * context falls back to `getDefaultI18n()`, which is English-only and needs no
52
+ * publisher — the graceful default the pull pattern requires.
53
+ *
54
+ * The change signal is this context's own republish: the value re-derives when
55
+ * `locale` moves, so resolvers re-read instead of pinning the first provider
56
+ * they saw.
57
+ */
58
+ i18n?: I18nProvider;
31
59
  reportSessionChanged?: (itemId: string, detail: unknown) => void;
32
60
  }
33
61
  export declare const assessmentToolkitRuntimeContext: {
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ export type { TTSHighlightContext, TTSHighlightTargetResolver, TTSHighlightTarge
11
11
  export { assessmentToolkitHostRuntimeContext, assessmentToolkitRegionScopeContext, assessmentToolkitRuntimeContext, assessmentToolkitShellContext, } from "./context/assessment-toolkit-context.js";
12
12
  export { connectAssessmentToolkitHostRuntimeContext, connectAssessmentToolkitRegionScopeContext, connectAssessmentToolkitRuntimeContext, connectAssessmentToolkitShellContext, } from "./context/runtime-context-consumer.js";
13
13
  export { catalogOwnerContextFor, type CatalogOwnerContext, type CatalogOwnerIdentity, type CatalogOwnerKind, type CatalogSourceEntity, } from "./services/catalog-owner.js";
14
- export { PIE_INTERNAL_CONTENT_LOADED_EVENT, PIE_INTERNAL_ITEM_SESSION_CHANGED_EVENT, PIE_INTERNAL_ITEM_PLAYER_ERROR_EVENT, PIE_ITEM_SESSION_CHANGED_EVENT, PIE_REGISTER_EVENT, PIE_UNREGISTER_EVENT, type InternalContentLoadedDetail, type InternalItemSessionChangedDetail, type InternalItemPlayerErrorDetail, type ItemSessionChangedDetail, type RuntimeRegistrationDetail, type RuntimeRegistrationKind, } from "./runtime/registration-events.js";
14
+ export { PIE_INTERNAL_CONTENT_LOADED_EVENT, PIE_INTERNAL_FORMATIVE_ACTION_EVENT, PIE_INTERNAL_ITEM_SESSION_CHANGED_EVENT, PIE_INTERNAL_ITEM_PLAYER_ERROR_EVENT, PIE_INTERNAL_MEDIA_TIME_SOURCE_EVENT, PIE_ITEM_SESSION_CHANGED_EVENT, PIE_REGISTER_EVENT, PIE_UNREGISTER_EVENT, type InternalContentLoadedDetail, type InternalFormativeActionDetail, type InternalItemSessionChangedDetail, type InternalItemPlayerErrorDetail, type InternalMediaTimeSourceDetail, type ItemSessionChangedDetail, type RuntimeRegistrationDetail, type RuntimeRegistrationKind, } from "./runtime/registration-events.js";
15
15
  export { connectToolRegionScopeContext, connectToolRuntimeContext, connectToolShellContext, createCrossBoundaryEvent, dispatchCrossBoundaryEvent, isContextValueDefined, } from "./runtime/tool-host-contract.js";
16
16
  export type { AccessibilityCatalogResolverApi, ElementToolStateStoreApi, HighlightCoordinatorApi, I18nServiceApi, ThemeProviderApi, ToolCoordinatorApi, ToolkitCoordinatorApi, TtsServiceApi, ToolState, } from "./services/interfaces.js";
17
17
  export type { CatalogCardForm, CatalogChangeEvent, CatalogChangeListener, CatalogChangeReason, CatalogLookupContext, CatalogLookupOptions, CatalogOwnerCard, CatalogOwnerRegistration, CatalogOwnerSnapshot, CatalogOwnerView, CatalogStatistics, CatalogType, ResolvedCatalog, } from "./services/AccessibilityCatalogResolver.js";
@@ -22,10 +22,13 @@ export type { Annotation } from "./services/HighlightCoordinator.js";
22
22
  export { HighlightColor, HighlightCoordinator, HighlightType, } from "./services/HighlightCoordinator.js";
23
23
  export type { SerializedRange } from "./services/RangeSerializer.js";
24
24
  export { RangeSerializer } from "./services/RangeSerializer.js";
25
- export type { I18nConfig, PluralTranslation, TranslationBundle, } from "./services/I18nService.js";
25
+ export type { I18nConfig, I18nProvider, InterpolationValues, LocaleCode, MessageCatalog, MessageKeyInput, PluralOptions, TextDirection, } from "./services/I18nService.js";
26
26
  export { I18nService } from "./services/I18nService.js";
27
27
  export type { ResolvedToolContext, ToolbarContext, ToolContextResolver, ToolContextResolverContext, ToolContextResolverMap, ToolContextResolverResult, ToolActivation, ToolContentDependency, ToolContentDependencyContext, ToolModuleLoader, ToolRegistryChangeEvent, ToolRegistryChangeKind, ToolRegistryChangeListener, ToolSingletonScope, ToolSurfaceRenderContext, ToolSurfaceRenderResult, ToolSurfaceServices, ToolToolbarButtonDefinition, ToolToolbarRenderResult, ToolWindowShellAction, ToolWindowShellAlign, ToolWindowShellConfig, ToolWindowShellContentConfig, ToolRegistration, } from "./services/ToolRegistry.js";
28
28
  export { ToolRegistry } from "./services/ToolRegistry.js";
29
+ export type { ToolOpenRequest, ToolRequestTarget, } from "./services/tool-request.js";
30
+ export { DEFAULT_TOOL_REQUEST_LEVEL } from "./services/tool-request.js";
31
+ export type { ToolSelectionAction, ToolSelectionContext, } from "./services/selection-action.js";
29
32
  export type { AssessmentToolContext, BaseToolContext, ElementToolContext, ItemToolContext, PassageToolContext, RubricToolContext, SectionToolContext, ToolContext, ToolLevel, } from "./services/tool-context.js";
30
33
  export { extractTextContent, hasChoiceInteraction, hasMathContent, hasReadableText, isAssessmentContext, isElementContext, isItemContext, isPassageContext, isRubricContext, isSectionContext, } from "./services/tool-context.js";
31
34
  export { DEFAULT_TOOL_PLACEMENT } from "./services/createDefaultToolRegistry.js";
@@ -35,7 +38,7 @@ export { createEmptyPersonalNeedsProfile } from "./services/defaultPersonalNeeds
35
38
  export type { ToolComponentFactory, ToolComponentFactoryMap, ToolComponentOverrides, ToolTagMap, } from "./tools/tool-tag-map.js";
36
39
  export { createToolElement, resolveToolTag, toToolIdFromTag, } from "./tools/tool-tag-map.js";
37
40
  export { ALL_STANDARD_ACCESS_FEATURES, EXAMPLE_PNP_CONFIGURATIONS, getFeatureCategory, getFeaturesInCategory, isStandardAccessFeature, QTI_STANDARD_ACCESS_FEATURES, } from "./services/pnp-standard-features.js";
38
- export { applyMediaFragment, isSafeMediaSrc, normalizeMediaFragment, normalizeMediaSources, trimmedOrUndefined, } from "./services/catalog-media.js";
41
+ export { applyMediaFragment, enforceMediaFragment, isSafeMediaSrc, isUnsupportedMediaAssetVersion, normalizeMediaFragment, normalizeMediaSources, SUPPORTED_MEDIA_ASSET_VERSION, trimmedOrUndefined, } from "./services/catalog-media.js";
39
42
  export type { SpokenAudioMedia } from "./services/spoken-audio-cards.js";
40
43
  export { resolveSpokenAudioMedia, SPOKEN_CATALOG_TYPE, } from "./services/spoken-audio-cards.js";
41
44
  export type { ExtractionResult } from "./services/SSMLExtractor.js";
@@ -60,6 +63,7 @@ export { createScopedToolId, parseScopedToolId, toOverlayToolId, } from "./servi
60
63
  export type { TTSConfig } from "./services/TTSService.js";
61
64
  export { PlaybackState, TTSService } from "./services/TTSService.js";
62
65
  export { PIE_TTS_CONTROL_HANDOFF_EVENT, type TTSControlHandoffDetail, } from "./services/tts-control-events.js";
66
+ export { bindTtsAudioHandoff, pauseTtsForMediaAudio, } from "./services/audio-handoff.js";
63
67
  export { BrowserTTSProvider } from "./services/tts/browser-provider.js";
64
68
  export type { SREMathSpeechOptions } from "./services/tts/math-speech.js";
65
69
  export type { NormalizedTTSSpeedOption, TTSHostToolbarLayout, TTSLayoutMode, TTSRuntimeSettings, TTSSpeedOption, TTSSpeedOptionConfig, } from "./services/tts-runtime-config.js";
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@
9
9
  export { assessmentToolkitHostRuntimeContext, assessmentToolkitRegionScopeContext, assessmentToolkitRuntimeContext, assessmentToolkitShellContext, } from "./context/assessment-toolkit-context.js";
10
10
  export { connectAssessmentToolkitHostRuntimeContext, connectAssessmentToolkitRegionScopeContext, connectAssessmentToolkitRuntimeContext, connectAssessmentToolkitShellContext, } from "./context/runtime-context-consumer.js";
11
11
  export { catalogOwnerContextFor, } from "./services/catalog-owner.js";
12
- export { PIE_INTERNAL_CONTENT_LOADED_EVENT, PIE_INTERNAL_ITEM_SESSION_CHANGED_EVENT, PIE_INTERNAL_ITEM_PLAYER_ERROR_EVENT, PIE_ITEM_SESSION_CHANGED_EVENT, PIE_REGISTER_EVENT, PIE_UNREGISTER_EVENT, } from "./runtime/registration-events.js";
12
+ export { PIE_INTERNAL_CONTENT_LOADED_EVENT, PIE_INTERNAL_FORMATIVE_ACTION_EVENT, PIE_INTERNAL_ITEM_SESSION_CHANGED_EVENT, PIE_INTERNAL_ITEM_PLAYER_ERROR_EVENT, PIE_INTERNAL_MEDIA_TIME_SOURCE_EVENT, PIE_ITEM_SESSION_CHANGED_EVENT, PIE_REGISTER_EVENT, PIE_UNREGISTER_EVENT, } from "./runtime/registration-events.js";
13
13
  export { connectToolRegionScopeContext, connectToolRuntimeContext, connectToolShellContext, createCrossBoundaryEvent, dispatchCrossBoundaryEvent, isContextValueDefined, } from "./runtime/tool-host-contract.js";
14
14
  export { AccessibilityCatalogResolver, catalogCardForm, isKnownCatalogType, KNOWN_CATALOG_TYPES, } from "./services/AccessibilityCatalogResolver.js";
15
15
  // Context Variable Store (QTI 3.0 Context Declarations)
@@ -20,6 +20,7 @@ export { HighlightColor, HighlightCoordinator, HighlightType, } from "./services
20
20
  export { RangeSerializer } from "./services/RangeSerializer.js";
21
21
  export { I18nService } from "./services/I18nService.js";
22
22
  export { ToolRegistry } from "./services/ToolRegistry.js";
23
+ export { DEFAULT_TOOL_REQUEST_LEVEL } from "./services/tool-request.js";
23
24
  export { extractTextContent, hasChoiceInteraction, hasMathContent, hasReadableText, isAssessmentContext, isElementContext, isItemContext, isPassageContext, isRubricContext, isSectionContext, } from "./services/tool-context.js";
24
25
  export { DEFAULT_TOOL_PLACEMENT } from "./services/createDefaultToolRegistry.js";
25
26
  export { createToolsConfig } from "./services/create-tools-config.js";
@@ -32,7 +33,7 @@ export { ALL_STANDARD_ACCESS_FEATURES, EXAMPLE_PNP_CONFIGURATIONS, getFeatureCat
32
33
  // the public surface through `sign-language-cards.js` until signing moved to
33
34
  // `@pie-players/pie-tool-sign-language`; it is exported from its own module now,
34
35
  // alongside the validators a capability package needs to read a media payload.
35
- export { applyMediaFragment, isSafeMediaSrc, normalizeMediaFragment, normalizeMediaSources, trimmedOrUndefined, } from "./services/catalog-media.js";
36
+ export { applyMediaFragment, enforceMediaFragment, isSafeMediaSrc, isUnsupportedMediaAssetVersion, normalizeMediaFragment, normalizeMediaSources, SUPPORTED_MEDIA_ASSET_VERSION, trimmedOrUndefined, } from "./services/catalog-media.js";
36
37
  export { resolveSpokenAudioMedia, SPOKEN_CATALOG_TYPE, } from "./services/spoken-audio-cards.js";
37
38
  export { SSMLExtractor } from "./services/SSMLExtractor.js";
38
39
  export { ThemeProvider } from "./services/ThemeProvider.js";
@@ -47,6 +48,7 @@ export { frameworkErrorFromToolConfigValidation, normalizeAndValidateToolsConfig
47
48
  export { createScopedToolId, parseScopedToolId, toOverlayToolId, } from "./services/tool-instance-id.js";
48
49
  export { PlaybackState, TTSService } from "./services/TTSService.js";
49
50
  export { PIE_TTS_CONTROL_HANDOFF_EVENT, } from "./services/tts-control-events.js";
51
+ export { bindTtsAudioHandoff, pauseTtsForMediaAudio, } from "./services/audio-handoff.js";
50
52
  export { BrowserTTSProvider } from "./services/tts/browser-provider.js";
51
53
  export { DEFAULT_TTS_SPEED_OPTIONS, formatTTSSpeedOptionsAsText, normalizeTTSLayoutMode, normalizeTTSSpeedControlOptions, normalizeTTSSpeedOptionConfigs, normalizeTTSSpeedOptions, parseTTSSpeedOptionsFromText, resolveTTSHostToolbarLayout, resolveTTSLayoutMode, resolveTTSRuntimeSettings, } from "./services/tts-runtime-config.js";
52
54
  export { createFetchItemLoader, createLoadItem, ItemLoadError, } from "./item-loader.js";