@pie-players/pie-assessment-toolkit 0.3.69 → 0.3.71

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.
@@ -1 +1 @@
1
- import"./chunks/ItemToolBar-pe5szfyx.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-rd7te9r0.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-byq80z42.js";import{H as w,J as G,K as Y,d as U,e as V,g as F,p as E,u as W,w as X}from"./chunks/ItemToolBar-d36g3aw4.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,40 @@
1
+ import{A as U0,B as K0,D as $j,E as fL,F as CL,G as jL,H as IL,I as mj,J as r,K as uj,L as hj,N as cj,P as sj,R as ij,T as aj,c as OL,d as _j,e as Ej,f as O,g as d,h as AL,i as FL,j as vj,k as aL,l as UL,n as f0,o as XL,p as KL,q as L,s as Z0,t as gj,u as GL,v as QL,w as f,y as VL,z as H0}from"./ItemToolBar-d36g3aw4.js";import{ContextProvider as CJ}from"@pie-players/pie-context";function i0(H){return typeof H.href==="string"}function Aj(H){if(!H||typeof H!=="object"||Array.isArray(H))return!1;let R=H;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 p=typeof R.href==="string",YL=typeof R.onClick==="function";if(p===YL)return!1;if(p)return!0;return YL}function a0(H){return typeof H==="string"&&H.trimStart().startsWith("<svg")}function d0(H){return typeof H==="string"&&H.trimStart().startsWith("http")}import{sanitizeSvgIcon as W0}from"@pie-players/pie-players-shared/security";import{resolveInterfaceI18n as IJ}from"@pie-players/pie-players-shared/i18n/provider";import{collectFocusable as yJ,createFocusTrap as pJ,FOCUSABLE_SELECTOR as bJ,isProgrammaticFocusTarget as _J}from"@pie-players/pie-players-shared";var BJ={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(H){return BJ[H]||null}var SJ=["assessment","section","item","passage","rubric"],TJ=new Set(SJ);function Ij(H){return TJ.has(H)}function k0(H,R,p){let YL=H.trim(),HL=p.trim();if(!YL||!HL)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`${YL}:${R}:${HL}`}function r0(H){let R=H.split(":");if(R.length!==3)return null;let[p,YL,HL]=R;if(!p||!HL)return null;if(!Ij(YL))return null;return{baseToolId:p,scopeLevel:YL,scopeId:HL}}import"@pie-players/pie-players-shared/nds-icon-button";var AJ=(H,R)=>{if(customElements.get(H))return;try{customElements.define(H,R)}catch(p){if(!(p instanceof DOMException&&p.name==="NotSupportedError"||p&&typeof p==="object"&&p.name==="NotSupportedError")||!customElements.get(H))throw p}},w0=GL('<span class="item-toolbar__element-host svelte-rnx3ie"></span>'),EJ=GL('<span class="item-toolbar__nds-button-zoom svelte-rnx3ie"><nds-icon-button></nds-icon-button></span>',2),z0=GL('<span aria-hidden="true"></span>'),yj=GL('<img class="item-toolbar__icon-image svelte-rnx3ie" alt=""/>'),pj=GL('<i aria-hidden="true"></i>'),vJ=GL("<a><!></a>"),gJ=GL('<button type="button"><!></button>'),bj=GL('<span class="item-toolbar__controls-host svelte-rnx3ie"></span>'),$J=GL("<div></div>"),mJ=GL('<div><div class="item-toolbar__tools-row svelte-rnx3ie"><!> <!> <!></div> <!></div>'),uJ={hash:"svelte-rnx3ie",code:`.item-toolbar.svelte-rnx3ie {display:flex;flex-direction:column;align-items:flex-end;min-width:0;max-width:100%;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:wrap;gap:0.5rem;max-width:100%;min-height:var(--pie-toolbar-tools-row-height);}
2
+
3
+ /* A granted section tool must stay reachable even when there isn't room for
4
+ every button: scroll the row rather than clipping items past the edge,
5
+ which left them impossible to focus, tab to, or click. \`min-width: 0\`
6
+ beats the flex default (\`auto\`, i.e. never shrink below content), which
7
+ would otherwise keep the row at full content width and make overflow-x
8
+ moot. Item and passage rows wrap without an overflow clip so an inline
9
+ reading-controls panel can still extend outside the row. */.item-toolbar[data-level="section"].svelte-rnx3ie .item-toolbar__tools-row:where(.svelte-rnx3ie) {flex-wrap:nowrap;justify-content:flex-start;
10
+ /* Keep the focus outline inside the scrolling box on both axes. */padding:4px;scroll-padding:4px;box-sizing:border-box;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,
11
+ .item-toolbar--bottom.svelte-rnx3ie {align-items:flex-end;}.item-toolbar--left.svelte-rnx3ie,
12
+ .item-toolbar--right.svelte-rnx3ie {align-items:stretch;}.item-toolbar--left.svelte-rnx3ie .item-toolbar__tools-row:where(.svelte-rnx3ie),
13
+ .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),
14
+ .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;flex-shrink:0;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;}
15
+
16
+ /* Drive the vendored NDS icon button's outer size via its own \`--height-32\`
17
+ custom property so its light-DOM inner button matches the toolbar's
18
+ md/sm/lg dimensions (32 / 44 / 40 px) without a layout shift. The glyph
19
+ keeps the NDS-native icon size (we render size="small"), so it isn't
20
+ oversized. */.item-toolbar__nds-button-zoom.svelte-rnx3ie {display:inline-flex;flex-shrink:0;}.item-toolbar.svelte-rnx3ie nds-icon-button:where(.svelte-rnx3ie) {
21
+ /* Host-settable button size per toolbar size (drives the NDS outer button
22
+ via its own --height-32). */--height-32: var(--pie-calculator-button-size, 2rem);
23
+ /* Host-settable accent for the calculator button: the NDS tertiary glyph
24
+ colour derives from --color-interactive-blue, remapped here to a
25
+ themeable variable. --pie-calculator-button-color is package-private, so
26
+ nothing sets it and the default is what ships: it now resolves through
27
+ --pie-button-color (DaisyUI base-content) instead of holding the Figma
28
+ blue on every theme, with the literal as the no-theme last resort.
29
+ Not --pie-primary or --pie-tertiary: both are \`direct\` mappings of
30
+ DaisyUI slots chosen to pair with their own -content colour, so a glyph
31
+ taken from either sits at 1.37:1 against the page under \`pastel\` and 11
32
+ 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)));
33
+ /* NDS palette bridge — keep in sync with the copies in tool-tts-inline
34
+ and section-player SectionItemsPane (asserted by
35
+ scripts/check-theme-tokens.mjs). The vendored button paints its fill,
36
+ its on-accent glyph, its hover ring and its focus ring from the NDS
37
+ design-system palette, which no PIE theme sets, so a tertiary button
38
+ kept a #f3f5f7 pill on every page — and once the glyph followed the
39
+ 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 dj(H,R){_j(R,!0),$j(H,uJ);let p=typeof window<"u",YL=["/_fa-pro/fontawesome.min.css","/_fa-pro/light.min.css"],HL="https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5.2/css/all.min.css",rj="https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap",l0=/font.?awesome|fa-?pro/i,o0=!1,x0=()=>{if(!p||o0)return;if(o0=!0,!document.querySelector('link[href*="Roboto"]')){let U=document.createElement("link");U.rel="stylesheet",U.href=rj,document.head.appendChild(U)}if(Array.from(document.querySelectorAll('link[rel="stylesheet"][href]')).some((U)=>l0.test(U.href)))return;if(!document.querySelector(`link[href="${HL}"]`)){let U=document.createElement("link");U.rel="stylesheet",U.href=HL,document.head.appendChild(U)}for(let U of YL){if(document.querySelector(`link[href="${U}"]`))continue;let J=document.createElement("link");J.rel="stylesheet",J.href=U,document.head.appendChild(J)}},n0="__pieFaToolbarShadowInstalled",lj=(j)=>{let U=j.getRootNode();if(!(U instanceof ShadowRoot))return;let J=U;if(J[n0])return;J[n0]=!0;let K=new Set,F=(V)=>{if(!V||K.has(V))return;K.add(V);let N=document.createElement("link");N.rel="stylesheet",N.href=V,U.appendChild(N)},b=Array.from(document.querySelectorAll('link[rel="stylesheet"][href]')).filter((V)=>l0.test(V.href));for(let V of b)F(V.href)},oj=(j)=>{return x0(),lj(j),{}},nj=(j,U)=>{let J=U,K=()=>{let b=j.querySelector("button");if(b)b.setAttribute("aria-pressed",J?"true":"false")};K();let F=new MutationObserver(K);return F.observe(j,{childList:!0,subtree:!0}),{update(b){J=b,K()},destroy(){F.disconnect()}}},t0=(j)=>j.faIconName||null,tj=new aj,yL=AL(vj({})),$L=r(R,"level",7,"item"),Q0=r(R,"scopeId",7,""),B0=r(R,"itemId",7,""),S0=r(R,"sectionId",7,""),T0=r(R,"catalogId",7,""),A0=r(R,"tools",7,""),C0=r(R,"contentKind",7,"assessment-item"),xL=r(R,"position",7,"bottom"),dL=r(R,"scopeElement",7,null),I0=r(R,"toolRegistry",7,null),y0=r(R,"item",7,null),V0=r(R,"hostButtons",23,()=>[]),p0=r(R,"class",7,""),rL=r(R,"size",7,"md"),X0=r(R,"language",7,"en-US"),ML=AL(null),x=AL(null),lL=O(()=>L(x)?.ndsIcons===!0),oL=O(()=>IJ(L(x))),pL=AL(null),nL=AL(0),Y0=AL(0),b0=AL(0);XL(()=>{if(!L(ML))return;return cj(L(ML),(j)=>{FL(x,j,!0)})}),XL(()=>{if(!L(ML))return;return sj(L(ML),(j)=>{FL(pL,j,!0)})}),XL(()=>{let j=L(x)?.toolkitCoordinator;if(!j||typeof j.onPolicyChange!=="function")return;let U=j.onPolicyChange(()=>{FL(Y0,L(Y0)+1)});return()=>{try{U?.()}catch{}}}),XL(()=>{let j=L(x)?.toolkitCoordinator;if(!j||typeof j.onToolContextResolverChange!=="function")return;let U=j.onToolContextResolverChange(()=>{FL(b0,L(b0)+1)});return()=>{try{U?.()}catch{}}});let B=O(()=>L(x)?.toolCoordinator),e0=O(()=>L(x)?.ttsService),mL=O(()=>L(x)?.elementToolStateStore),D0=O(()=>L(x)?.assessmentId??""),tL=O(()=>B0()||L(pL)?.itemId||""),l=O(()=>L(pL)?.canonicalItemId||L(tL)),BL=O(()=>S0()||L(x)?.sectionId||""),uL=O(()=>C0()||L(pL)?.contentKind||($L()==="section"?"section":"assessment-item")),C=O(()=>{if($L()&&$L()!=="item")return $L();if(L(uL)==="rubric-block-stimulus")return"passage";return"item"}),PL=O(()=>{if(Q0())return Q0();if(L(C)==="section")return L(BL)||L(x)?.sectionId||"default-section";if(L(C)==="assessment")return L(x)?.assessmentId||"default-assessment";return L(l)||L(tL)||"default-item"}),Lj=O(()=>T0()||L(PL)),kL=O(()=>y0()||L(pL)?.item||null),t=O(()=>I0()||tj),ej=O(()=>ij(A0())),LJ=O(()=>L(t).normalizeToolIds(L(ej)).filter(Boolean)),jj=O(()=>{if(L(C)==="section")return"section";if(L(C)==="passage"||L(uL)==="rubric-block-stimulus")return"passage";return"item"}),O0=O(()=>{L(Y0);let j=L(x)?.toolkitCoordinator;if(!j||typeof j.decideToolPolicy!=="function")return null;return j.decideToolPolicy({level:L(jj),scope:{level:L(C),scopeId:L(PL),assessmentId:L(x)?.assessmentId,sectionId:L(BL)||void 0,itemId:L(tL)||void 0,canonicalItemId:L(l)||void 0,contentKind:L(uL)}})}),Jj=O(()=>{let j=(U)=>Array.from(new Set(U));if(L(O0))return j(L(t).normalizeToolIds(L(O0).visibleTools.map((U)=>U.toolId)).filter(Boolean));return j(L(LJ))}),jJ=O(()=>{let j=new Set;if(!L(O0))return j;for(let U of L(O0).visibleTools){if(!U.required&&!U.alwaysAvailable)continue;for(let J of L(t).normalizeToolIds([U.toolId]).filter(Boolean))j.add(J)}return j}),_0=O(()=>{if(L(C)==="section"||L(C)==="assessment")return!0;let j=L(kL)?.config;return!!(L(kL)&&j&&typeof j==="object")}),Zj=O(()=>{L(Y0);let j=L(x)?.toolkitCoordinator;if(!j||typeof j.getPolicyInputs!=="function")return null;return j.getPolicyInputs()}),hL=O(()=>L(Zj)?.assessment??null),G0=O(()=>L(Zj)?.currentItemRef??null),bL=O(()=>{if(L(C)==="section")return{level:"section",assessment:L(hL)||{},section:{}};if(L(C)==="assessment")return{level:"assessment",assessment:L(hL)||{}};if(!L(_0)||!L(kL))return null;if(L(C)==="passage")return{level:"passage",assessment:L(hL)||{},itemRef:L(G0)||{id:L(l)},passage:L(kL)};return{level:"item",assessment:L(hL)||{},itemRef:L(G0)||{id:L(l)},item:L(kL)}}),Uj=O(()=>{if(L(bL))return L(bL);return{level:"item",assessment:L(hL)||{},itemRef:L(G0)||{id:L(l)},item:L(kL)||{id:L(l),config:{}}}}),M0=O(()=>{if(L(C)!=="item"&&L(C)!=="passage")return[];if(!L(_0)||!L(kL))return[];let j=L(kL)?.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(G0)||{id:L(l)},item:L(kL),elementId:J.id}))}),JJ=O(()=>{let j=L(x)?.toolkitCoordinator||null,U=(J)=>r0(J)?J:k0(J,L(C),L(PL));return{scope:{level:L(C),scopeId:L(PL),assessmentId:L(x)?.assessmentId,sectionId:L(BL),itemId:L(tL),canonicalItemId:L(l),contentKind:L(uL)},itemId:L(PL),catalogId:L(Lj),language:X0(),i18n:L(oL),ui:{size:rL()},getScopeElement:()=>dL()||L(pL)?.scopeElement||null,getGlobalElementId:()=>{if(!L(mL)||!L(D0)||!L(BL)||!L(l))return null;return L(mL).getGlobalElementId(L(D0),L(BL),L(l),L(l))},toolCoordinator:L(B)||null,toolkitCoordinator:j,ttsService:L(e0)||null,elementToolStateStore:L(mL)||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}}),E0=O(()=>{L(b0);let j=L(x)?.toolkitCoordinator;if(!j||typeof j.hasToolContextResolver!=="function"||typeof j.resolveToolContext!=="function")return{};let U={};for(let J of L(Jj)){if(!L(t).get(J)?.supportedLevels.includes(L(C)))continue;if(!j.hasToolContextResolver(J))continue;let F=j.resolveToolContext({toolId:J,context:L(Uj),toolbarContext:L(JJ)});if(F)U[J]=F}return U}),ZJ=O(()=>{let j=L(Jj).filter((V)=>{let N=L(t).get(V);return N?N.supportedLevels.includes(L(C)):!1}),U=Object.values(L(E0)),J=new Set(U.map((V)=>V.toolId)),K=new Set(U.filter((V)=>V.visible).map((V)=>V.toolId)),F=j.filter((V)=>!J.has(V));if(L(C)==="section")return F.forEach((V)=>K.add(V)),Array.from(K);if(!L(_0))return F.forEach((V)=>K.add(V)),Array.from(K);if(!L(bL)&&L(M0).length===0)return F.forEach((V)=>K.add(V)),Array.from(K);if(F.filter((V)=>L(jJ).has(V)).forEach((V)=>K.add(V)),L(bL))L(t).filterVisibleInContext(F,L(bL)).forEach((V)=>K.add(V.toolId));for(let V of L(M0))L(t).filterVisibleInContext(F,V).forEach((N)=>K.add(N.toolId));let b=L(bL)?[L(bL),...L(M0)]:L(M0);for(let V of Array.from(K)){if(J.has(V))continue;if(!L(t).isApplicableToAnyContext(V,b))K.delete(V)}return Array.from(K)}),eL=O(()=>L(t).filterToolIdsByActivation(L(ZJ),"toolbar-toggle"));XL(()=>{if(!p)return;let j=!1;return L(t).ensureToolModulesLoaded(L(eL)).then(()=>{if(!j)FL(nL,L(nL)+1)}).catch((U)=>{console.error("[ItemToolBar] Failed to load one or more tool modules:",U)}),()=>{j=!0}});function UJ(){if(dL())return dL();return L(pL)?.scopeElement||null}function KJ(){if(!L(mL)||!L(D0)||!L(BL)||!L(l))return null;return L(mL).getGlobalElementId(L(D0),L(BL),L(l),L(l))}let _L=O(()=>{let j=L(x)?.toolkitCoordinator||null,U=(J)=>{return r0(J)?J:k0(J,L(C),L(PL))};return{scope:{level:L(C),scopeId:L(PL),assessmentId:L(x)?.assessmentId,sectionId:L(BL),itemId:L(tL),canonicalItemId:L(l),contentKind:L(uL)},itemId:L(PL),catalogId:L(Lj),language:X0(),i18n:L(oL),ui:{size:rL()},getScopeElement:UJ,getGlobalElementId:KJ,toolCoordinator:L(B)||null,toolkitCoordinator:j,ttsService:L(e0)||null,elementToolStateStore:L(mL)||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(E0)[J]??null,getToolRenderParams:(J)=>{let K=L(E0)[J]?.params??null,F=Kj.get(J);if(!F)return K;return{...K??{},...F}}}}),Kj=new Map,Qj=0,WL=O(()=>{if(!p)return[];L(nL);let j=[];for(let U of L(eL)){let J=L(t).renderForToolbar(U,L(Uj),L(_L));if(J)j.push(J)}return j}),QJ=O(()=>{if(!Array.isArray(V0()))return[];let j=[];return V0().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}),VJ=O(()=>L(WL).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(),cL()}}})),Vj=O(()=>[...L(VJ),...L(QJ)]),L0=O(()=>{let j={};for(let U of L(WL))j[U.toolId]=L(yL)[U.toolId]??U.button?.active??!1;return j}),XJ=O(()=>L(WL).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})))),YJ=O(()=>L(WL).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})))),Xj=O(()=>L(WL).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})))),Yj=O(()=>L(WL).flatMap((j)=>(j.elements||[]).map((U)=>({toolId:j.toolId,hint:U.layoutHints?.controlsRow})).filter((U)=>Boolean(U.hint)))),Dj=O(()=>L(WL).flatMap((j)=>(j.elements||[]).map((U)=>({toolId:j.toolId,hint:U.layoutHints?.headerOverlay})).filter((U)=>Boolean(U.hint)))),Oj=O(()=>L(Yj).some((j)=>j.hint?.reserveSpace===!0)),Gj=O(()=>L(Yj).some((j)=>j.hint?.showWhenToolActive===!0&&(L(L0)[j.toolId]??!1))),DJ=O(()=>xL()==="left"||xL()==="right"),Mj=O(()=>L(Dj).some((j)=>j.hint?.showWhenToolActive===!0&&(L(L0)[j.toolId]??!1))),OJ=O(()=>L(Xj).length>0||L(Oj)||L(Gj));function GJ(){if(!L(ML))return null;let j=L(ML).getRootNode();if(j instanceof ShadowRoot)return j.host;return null}XL(()=>{let j=GJ();if(!j)return;let U=L(Dj).length>0,J=L(Mj);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")}}),XL(()=>{if(!p)return;if(L(Vj).some((j)=>!!t0(j)))x0()});function N0(j){if(j.id in L(yL))return L(yL)[j.id]===!0;return j.active===!0}function Nj(j){return Cj(j)}function cL(){let j={};for(let U of L(WL))if(U.sync?.(),U.button)j[U.toolId]=U.button.active??!1;FL(yL,j,!0)}XL(()=>{let j=[];cL();for(let U of L(WL))if(U.subscribeActive){let J=!1,K=U.subscribeActive((F)=>{queueMicrotask(()=>{if(J)return;FL(yL,{...L(yL),[U.toolId]:F},!0),U.sync?.()})});j.push(()=>{J=!0,K()})}return()=>{j.forEach((U)=>U())}}),XL(()=>{let j=L(x)?.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)Qj+=1,Kj.set(J,{...K,toolRequestId:Qj});let F=k0(J,L(C),L(PL));if(!L(B).getToolState(F))L(B).registerTool(F,J);L(B).showTool(F),queueMicrotask(()=>cL())}})}),XL(()=>{if(!L(_L).subscribeVisibility)return;let j=!1,U=L(_L).subscribeVisibility(()=>{queueMicrotask(()=>{if(j)return;cL()})});return()=>{j=!0,U?.()}}),XL(()=>{let j=L(_L).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;FL(nL,L(nL)+1),cL()})});return()=>{U=!0,J?.()}});let MJ="[data-pie-tool-overlay-boundary]";function NJ(j,U){if(U.container!=="content-boundary")return j;let J=j;while(J){if(J instanceof HTMLElement&&J.matches(MJ))return J;if(J instanceof HTMLElement&&J.parentElement){J=J.parentElement;continue}let K=J.getRootNode();J=K instanceof ShadowRoot?K.host:null}return j}function v0(j,U){let J=U,K=null,F=j,b=(N)=>{if(!N)return;let e=N.__pieToolElementUnmount;if(typeof e==="function")e()},V=(N)=>{if(K===N)return;if(K){if(b(K),K.parentNode===F)F.removeChild(K)}if(K=N,K){if(F=NJ(j,J),K.parentNode&&K.parentNode!==F)K.parentNode.removeChild(K);F.appendChild(K)}};return V(U.element),{update(N){J=N,V(N.element)},destroy(){V(null)}}}function g0(j,U){let J=U,K=null,F=null,b=[],V=null,N=null,e=null,z=null,D=null,NL=null,JL=null,i=null,a=!1,S=!1,g=()=>J.mounted.entry.shell?.pageTabOrder===!0,_=()=>J.mounted.entry.shell?.ndsHeaderControls===!0,P=null,u=null,I=null,w=0,A=0,$=0,o=0,h=0,RL=0,EL=0,vL=0,wL=null,gL=[],E=0,v=0,k=J.mounted.entry.shell?.initialWidth??720,W=J.mounted.entry.shell?.initialHeight??560,SL=k,sL=W,zL=!1,qL=null,T=null,c=!1,qj=(Z)=>{if(!Z)return;let X=Z.__pieToolElementUnmount;if(typeof X==="function")X()},$0=()=>{let Z=J.mounted.entry.shell;if(!Z)return null;return{toolId:J.mounted.toolId,toolbarContext:L(_L),shellConfig:Z}},PJ=(Z)=>{let X=L(t).get(J.mounted.toolId),G=$0();if(!X?.onHostedMount||!G)return;X.onHostedMount(Z,G)},R0=()=>{let Z=L(t).get(J.mounted.toolId),X=$0();if(!Z?.onHostedResize||!X)return;Z.onHostedResize({width:k,height:W},J.mounted.entry.element,X)},kJ=()=>{let Z=L(t).get(J.mounted.toolId),X=$0();if(!Z?.onHostedUnmount||!X)return;Z.onHostedUnmount(J.mounted.entry.element,X)},LL=(Z,X,G)=>Math.max(X,Math.min(Z,G)),WJ=()=>{let Z=J.mounted.entry.shell,X=Z?.minWidth??320,G=Z?.minHeight??240,Y=Z?.maxWidth??window.innerWidth,Q=Z?.maxHeight??window.innerHeight;return{minWidth:X,minHeight:G,maxWidth:Y,maxHeight:Q}},m0=()=>{let Z=J.mounted.entry.shell?.minWidth,X=typeof Z==="number"&&Z>0&&k<Z,G=X?`${Z}px`:"";if(P)P.style.minWidth=G;if(V)V.style.minWidth="0";if(N)N.style.minWidth="0",N.style.overflowX=X?"auto":"hidden"},Fj=()=>J.mounted.entry.shell?.content?.overflowY==="auto"?"auto":"hidden",wJ=()=>{if(!V)return 0;let Z=V.getBoundingClientRect().height;if(Z>0)return Z;return V.offsetHeight||0},u0=()=>{if(!N)return;let Z=J.mounted.entry.shell;if(N.style.overflowY=Fj(),!P)return;if(Z?.content?.preserveMinHeight===!0){let X=wJ(),G=Z.minHeight??240,Y=Math.max(0,G-X),Q=Math.max(0,W-X),M=Math.max(Q,Y);P.style.height=`${M}px`,P.style.minHeight="0",P.style.flex=`0 0 ${M}px`;return}P.style.height="100%",P.style.minHeight="0",P.style.flex="1 1 auto"},zJ=()=>{let Z=J.mounted.entry.shell,X=Z?.initialWidth??720,G=Z?.initialHeight??560;if(X===SL&&G===sL)return;if(SL=X,sL=G,zL)return;k=X,W=G,P0()},q0=()=>{let{minWidth:Z,minHeight:X,maxWidth:G,maxHeight:Y}=WJ(),Q=Math.min(Z,window.innerWidth),M=Math.min(X,window.innerHeight);k=LL(k,Q,Math.max(Q,Math.min(G,window.innerWidth))),W=LL(W,M,Math.max(M,Math.min(Y,window.innerHeight))),E=LL(E,0,Math.max(0,window.innerWidth-k)),v=LL(v,0,Math.max(0,window.innerHeight-W)),j0(),m0(),u0(),R0()},TL=(Z,X)=>{zL=!0,E+=Z,v+=X,q0()},F0=(Z,X)=>{zL=!0,k+=Z,W+=X,q0()},Pj=(Z,X,G,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",(M)=>{M.stopPropagation(),G(),iL()}),Y!=="fa-light"){let M=(y)=>{y.classList.remove("fa-light"),y.classList.add(Y)},q=Q.querySelector("i.fa-light");if(q)M(q);else{let y=new MutationObserver(()=>{let s=Q.querySelector("i.fa-light");if(s)M(s),y.disconnect()});y.observe(Q,{childList:!0,subtree:!0})}}return Q},kj=(Z,X,G)=>{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(),G(),iL()},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=`${E}px`,K.style.top=`${v}px`,K.style.width=`${k}px`,K.style.height=`${W}px`,K.style.display=J.active?"flex":"none"},Wj=()=>{if(e)e.textContent=J.mounted.entry.shell?.title||J.mounted.toolId;for(let{el:Z,key:X}of b){let G=J.i18n.t(X);if(Z.tagName==="NDS-ICON-BUTTON")Z.setAttribute("button-aria-label",G);else Z.setAttribute("aria-label",G);if(Z.title)Z.title=G}},wj=()=>{if(!N)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===N)qj(P),N.removeChild(P);P=null}if(Z.parentNode&&Z.parentNode!==N)Z.parentNode.removeChild(Z);if(Z.parentNode!==N)N.appendChild(Z);P=Z,m0(),u0(),PJ(Z)},iL=()=>{if(L(B)&&K)L(B).bringToFront(K)},P0=()=>{let{innerWidth:Z,innerHeight:X}=window,G=J.mounted.entry.shell,Y=G?.initialAlign??"center",Q=G?.initialMargin??16,M=Q+60;switch(Y){case"top-left":E=Q,v=M;break;case"top-right":E=Math.max(0,Z-k-Q),v=M;break;case"bottom-left":E=Q,v=Math.max(0,X-W-M);break;case"bottom-right":E=Math.max(0,Z-k-Q),v=Math.max(0,X-W-M);break;default:E=Math.max(0,Math.round((Z-k)/2)),v=Math.max(0,Math.round((X-W)/2))}q0()},fJ=()=>{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},fj=()=>{if(!K||qL)return;let Z=zj();if(!T&&Z&&!K.contains(Z))T=Z;if(g()&&!S)document.addEventListener("keydown",c0,!0),S=!0;qL=pJ(K,{initialFocus:D,onEscape:()=>{s0()},wrap:!g(),onTabExit:g()?(X,G)=>{if(X==="backward"){if(T?.isConnected){G.preventDefault();try{T.focus()}catch{}}return}let Y=h0();if(Y){G.preventDefault();try{Y.focus()}catch{}}}:void 0})},h0=()=>{let Z=L(_L).getScopeElement?.()??null;if(!Z)return null;let X=(Y)=>{if(L(ML)&&L(ML).contains(Y))return!0;if(K&&K.contains(Y))return!0;return!1},G=(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 M=0;M<Q.children.length;M++){let q=G(Q.children[M]);if(q)return q}for(let M=0;M<Y.children.length;M++){let q=G(Y.children[M]);if(q)return q}return null};return G(Z)},HJ=()=>{if(!K)return[];return yJ(K).filter((Z)=>Z!==JL&&Z!==i)},c0=(Z)=>{if(Z.key!=="Tab")return;if(!K||!J.active)return;let X=zj();if(!X)return;if(K.contains(X))return;let G=HJ();if(G.length===0)return;if(Z.shiftKey){let Y=h0();if(X!==Y)return;Z.preventDefault();try{G[G.length-1].focus()}catch{}return}if(X!==T)return;Z.preventDefault();try{G[0].focus()}catch{}},Hj=()=>{if(S)document.removeEventListener("keydown",c0,!0),S=!1;if(!qL)return;let Z=qL;qL=null;try{Z()}catch{}fJ()},s0=()=>{L(_L).toggleTool(J.mounted.toolId),cL()},xj=(Z)=>{if(!J.mounted.entry.shell?.draggable)return;if(Z.target.closest("button")||!K)return;Z.preventDefault(),zL=!0,u=Z.pointerId,w=Z.clientX-E,A=Z.clientY-v,K.setPointerCapture(Z.pointerId),iL()},xJ=(Z)=>(X)=>{if(!K||!J.mounted.entry.shell?.resizable)return;X.preventDefault(),X.stopPropagation(),zL=!0,I=X.pointerId,wL=Z,$=k,o=W,h=X.clientX,RL=X.clientY,EL=E,vL=v,K.setPointerCapture(X.pointerId),iL()},Bj=(Z)=>{if(!K)return;if(u===Z.pointerId){Z.preventDefault();let X=Math.max(0,window.innerWidth-k),G=Math.max(0,window.innerHeight-W);E=LL(Z.clientX-w,0,X),v=LL(Z.clientY-A,0,G),j0();return}if(I===Z.pointerId){Z.preventDefault();let X=J.mounted.entry.shell,G=X?.minWidth??320,Y=X?.minHeight??240,Q=Math.min(G,window.innerWidth),M=Math.min(Y,window.innerHeight),q=X?.maxWidth??window.innerWidth,y=X?.maxHeight??window.innerHeight,s=Z.clientX-h,ZL=Z.clientY-RL;if(wL==="se")k=LL($+s,Q,Math.max(Q,Math.min(q,window.innerWidth-E))),W=LL(o+ZL,M,Math.max(M,Math.min(y,window.innerHeight-v)));else if(wL==="sw"){let n=EL+$,DL=LL($-s,Q,Math.min(q,n));E=n-DL,k=DL,W=LL(o+ZL,M,Math.max(M,Math.min(y,window.innerHeight-v)))}else if(wL==="ne"){let n=vL+o;k=LL($+s,Q,Math.max(Q,Math.min(q,window.innerWidth-E)));let DL=LL(o-ZL,M,Math.min(y,n));v=n-DL,W=DL}else if(wL==="nw"){let n=EL+$,DL=vL+o,m=LL($-s,Q,Math.min(q,n));E=n-m,k=m;let J0=LL(o-ZL,M,Math.min(y,DL));v=DL-J0,W=J0}j0(),m0(),u0(),R0()}},Sj=(Z)=>{if(!K)return;if(u===Z.pointerId)u=null,K.releasePointerCapture(Z.pointerId);if(I===Z.pointerId)I=null,K.releasePointerCapture(Z.pointerId)},Tj=()=>{q0()};if(p&&J.mounted.entry.shell){let Z=J.mounted.entry.shell?.ndsHeaderControls===!0&&L(lL);if(Z)x0();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()),V=document.createElement("div"),V.className="pie-tool-shell__header",V.style.display="flex",V.style.flexWrap="wrap",V.style.alignItems="center",V.style.justifyContent="space-between",V.style.gap="6px",V.style.padding=_()?"12px 12px 12px 28px":"10px 12px",_())V.style.minHeight="48px";if(_())V.style.background="var(--pie-section-player-card-header-background, var(--pie-button-active-bg, #f3f4f6))",V.style.color="var(--pie-text, #111827)",V.style.borderBottom="1px solid var(--pie-border-light, #e5e7eb)";else V.style.background="var(--pie-primary-dark, #2c3e50)",V.style.color="var(--pie-white, #fff)";V.style.cursor=J.mounted.entry.shell.draggable===!1?"default":"move",V.style.flex="0 0 auto",V.style.borderRadius="12px 12px 0 0",V.style.overflow="hidden",V.style.userSelect="none",V.style.webkitUserSelect="none",V.style.touchAction="none",V.setAttribute("draggable","false"),V.addEventListener("dragstart",(Q)=>Q.preventDefault()),e=document.createElement("span"),e.className="pie-tool-shell__title",e.style.minWidth="0",e.style.overflowWrap="anywhere",e.textContent=J.mounted.entry.shell.title||J.mounted.toolId,V.appendChild(e),z=document.createElement("div"),z.className="pie-tool-shell__controls",z.style.display="inline-flex",z.style.flexWrap="wrap",z.style.minWidth="0",z.style.alignItems="center",z.style.gap=_()?"6px":"4px";let X=J.mounted.entry.shell,G=(Q,M,q,y,s="fa-regular")=>{if(!z)return;let ZL=J.i18n.t(Q),n=Z?Pj(ZL,q,y,s):kj(ZL,M,y);b.push({el:n,key:Q}),z.appendChild(n)};if(X?.draggable!==!1)G("toolkit.window.moveLeftA11y","←","chevron-left",()=>TL(-24,0)),G("toolkit.window.moveRightA11y","→","chevron-right",()=>TL(24,0)),G("toolkit.window.moveUpA11y","↑","chevron-up",()=>TL(0,-24)),G("toolkit.window.moveDownA11y","↓","chevron-down",()=>TL(0,24));if(X?.resizable!==!1)G("toolkit.window.shrinkA11y","−","magnifying-glass-minus",()=>F0(-40,-40)),G("toolkit.window.growA11y","+","magnifying-glass-plus",()=>F0(40,40));if(!_()){let Q=kj(J.i18n.t("toolkit.window.centerA11y"),"◎",P0);b.push({el:Q,key:"toolkit.window.centerA11y"}),z.appendChild(Q)}let Y=null;if(_())Y=document.createElement("div"),Y.className="pie-tool-shell__header-right",Y.style.display="inline-flex",Y.style.flexWrap="wrap",Y.style.maxWidth="100%",Y.style.justifyContent="flex-end",Y.style.alignItems="center",Y.style.gap="6px",Y.appendChild(z),V.appendChild(Y);else V.appendChild(z);if(Z)D=Pj(J.i18n.t("toolkit.window.closeA11y"),"xmark",s0,"fa-regular"),b.push({el:D,key:"toolkit.window.closeA11y"}),D.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")),b.push({el:Q,key:"toolkit.window.closeA11y"});let M="http://www.w3.org/2000/svg",q=document.createElementNS(M,"svg");q.setAttribute("xmlns",M),q.setAttribute("viewBox","0 0 16 16"),q.setAttribute("aria-hidden","true");let y=document.createElementNS(M,"path");y.setAttribute("d","M3.5 3.5L12.5 12.5M12.5 3.5L3.5 12.5"),y.setAttribute("stroke","currentColor"),y.setAttribute("stroke-width","1.8"),y.setAttribute("stroke-linecap","round"),q.appendChild(y),Q.appendChild(q);let s=q.style;s.width="16px",s.height="16px",s.display="block",s.flexShrink="0",s.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=s0,D=Q}if(Y)Y.appendChild(D);else V.appendChild(D);if(V.tabIndex=0,V.onkeydown=(Q)=>{if(Q.key==="Home"){Q.preventDefault(),P0();return}let M=J.mounted.entry.shell;if(Q.shiftKey&&M?.resizable!==!1){if(Q.key==="ArrowRight"||Q.key==="ArrowDown"){Q.preventDefault(),F0(40,40);return}if(Q.key==="ArrowLeft"||Q.key==="ArrowUp"){Q.preventDefault(),F0(-40,-40);return}}if(M?.draggable!==!1){if(Q.key==="ArrowLeft")Q.preventDefault(),TL(-24,0);else if(Q.key==="ArrowRight")Q.preventDefault(),TL(24,0);else if(Q.key==="ArrowUp")Q.preventDefault(),TL(0,-24);else if(Q.key==="ArrowDown")Q.preventDefault(),TL(0,24)}},N=document.createElement("div"),N.className="pie-tool-shell__content",N.style.position="relative",N.style.width="100%",N.style.flex="1 1 auto",N.style.minHeight="0",N.style.overflowX="hidden",N.style.overflowY=Fj(),N.style.borderRadius="0 0 12px 12px",_()){let Q=(M)=>{let q=document.createElement("div");return q.tabIndex=0,q.setAttribute("aria-hidden","true"),q.setAttribute("data-pie-tool-shell-focus-guard",M),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"),i=Q("end"),JL.addEventListener("focus",(M)=>{if(a)return;a=!0;try{if(M.stopPropagation(),T?.isConnected)try{T.focus()}catch{}}finally{queueMicrotask(()=>{a=!1})}}),i.addEventListener("focus",(M)=>{if(a)return;a=!0;try{M.stopPropagation();let q=h0();if(q)try{q.focus()}catch{}}finally{queueMicrotask(()=>{a=!1})}}),K.appendChild(JL)}if(K.appendChild(V),K.appendChild(N),_()&&i)K.appendChild(i);if(J.mounted.entry.shell.resizable!==!1){let Q=(M,q,y,s,ZL,n,DL)=>{let m=document.createElement("div");if(m.className="pie-tool-shell__resize",m.style.position="absolute",m.style.width="24px",m.style.height="24px",m.style.cursor=n,m.style.zIndex="10",m.style.touchAction="none",m.setAttribute("draggable","false"),q!==null)m.style.top=q;if(y!==null)m.style.right=y;if(s!==null)m.style.bottom=s;if(ZL!==null)m.style.left=ZL;if(DL!==null)m.style.background=`linear-gradient(${DL}, transparent 0%, transparent 40%, rgba(0,0,0,0.35) 40%, rgba(0,0,0,0.35) 60%, transparent 60%, transparent 100%)`;let J0=xJ(M);m.addEventListener("pointerdown",J0),K.appendChild(m),gL.push({el:m,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(V.addEventListener("pointerdown",xj),K.addEventListener("pointermove",Bj),K.addEventListener("pointerup",Sj),K.addEventListener("pointerdown",iL),window.addEventListener("resize",Tj),document.body.appendChild(K),F=new CJ(K,{context:hj,initialValue:J.runtime}),F.connect(),P0(),j0(),Wj(),wj(),R0(),J.active)fj();c=J.active}return{update(Z){if(J=Z,!K||!N||!e||!D)return;F?.setValue(J.runtime),Wj(),zJ();let X=D.tagName.toLowerCase()==="nds-icon-button"?"inline-block":"inline-flex";if(D.style.display=J.mounted.entry.shell?.closeable===!1?"none":X,j0(),wj(),R0(),!c&&J.active)fj();else if(c&&!J.active)Hj(),T=null;c=J.active},destroy(){if(kJ(),F?.disconnect(),F=null,b.length=0,qL)Hj();if(S)document.removeEventListener("keydown",c0,!0),S=!1;for(let{el:Z,handler:X}of gL)Z.removeEventListener("pointerdown",X);if(T=null,gL.length=0,V)V.removeEventListener("pointerdown",xj),V.onkeydown=null;if(K)K.removeEventListener("pointermove",Bj),K.removeEventListener("pointerup",Sj),K.removeEventListener("pointerdown",iL);if(window.removeEventListener("resize",Tj),P&&N&&P.parentNode===N)qj(P),N.removeChild(P);if(P=null,K&&K.parentElement)K.remove()}}}var RJ={get level(){return $L()},set level(j){$L(j),d()},get scopeId(){return Q0()},set scopeId(j){Q0(j),d()},get itemId(){return B0()},set itemId(j){B0(j),d()},get sectionId(){return S0()},set sectionId(j){S0(j),d()},get catalogId(){return T0()},set catalogId(j){T0(j),d()},get tools(){return A0()},set tools(j){A0(j),d()},get contentKind(){return C0()},set contentKind(j){C0(j),d()},get position(){return xL()},set position(j){xL(j),d()},get scopeElement(){return dL()},set scopeElement(j){dL(j),d()},get toolRegistry(){return I0()},set toolRegistry(j){I0(j),d()},get item(){return y0()},set item(j){y0(j),d()},get hostButtons(){return V0()},set hostButtons(j){V0(j),d()},get class(){return p0()},set class(j){p0(j),d()},get size(){return rL()},set size(j){rL(j),d()},get language(){return X0()},set language(j){X0(j),d()}},Rj=QL(),qJ=UL(Rj);{var FJ=(j)=>{var U=mJ();let J;var K=aL(U),F=aL(K);U0(F,17,()=>L(XJ),(z)=>z.key,(z,D)=>{var NL=QL(),JL=UL(NL);{var i=(S)=>{var g=QL(),_=UL(g);H0(_,()=>L(lL),(P)=>{var u=w0();fL(u,(I,w)=>g0?.(I,w),()=>({mounted:L(D),active:L(L0)[L(D).toolId]??!1,runtime:L(x),i18n:L(oL)})),f(P,u)}),f(S,g)},a=(S)=>{var g=w0();fL(g,(_,P)=>v0?.(_,P),()=>L(D).entry),f(S,g)};VL(JL,(S)=>{if(L(D).entry.shell)S(i);else S(a,-1)})}f(z,NL)});var b=f0(F,2);U0(b,17,()=>L(Vj),(z)=>z.id,(z,D,NL,JL)=>{let i=O(()=>L(lL)&&!i0(L(D))?t0(L(D)):null);var a=QL(),S=UL(a);{var g=(I)=>{var w=EJ(),A=aL(w);CL(A,1,"item-toolbar__nds-button svelte-rnx3ie"),IL(A,"type","circle"),IL(A,"size","small"),IL(A,"variant","tertiary"),KL(()=>IL(A,"icon-name",L(i))),KL(()=>IL(A,"button-aria-label",L(D).ariaLabel||L(D).label)),KL(()=>IL(A,"title",L(D).tooltip||L(D).label)),KL(()=>IL(A,"disabled",L(D).disabled)),fL(A,($)=>oj?.($)),fL(A,($,o)=>nj?.($,o),()=>N0(L(D))),OL(w),Z0("click",A,function(...$){L(D).onClick?.apply(this,$)}),f(I,w)},_=(I)=>{var w=vJ();let A;var $=aL(w);{var o=(h)=>{var RL=QL(),EL=UL(RL);{var vL=(k)=>{var W=z0();K0(W,()=>W0(L(D).icon),!0),OL(W),f(k,W)},wL=O(()=>a0(L(D).icon)),gL=(k)=>{var W=yj();KL(()=>jL(W,"src",L(D).icon)),f(k,W)},E=O(()=>d0(L(D).icon)),v=(k)=>{let W=O(()=>Nj(L(D).icon));var SL=QL(),sL=UL(SL);{var zL=(T)=>{var c=z0();K0(c,()=>W0(L(W)),!0),OL(c),f(T,c)},qL=(T)=>{var c=pj();KL(()=>CL(c,1,`icon icon-${L(D).icon}`,"svelte-rnx3ie")),f(T,c)};VL(sL,(T)=>{if(L(W))T(zL);else T(qL,-1)})}f(k,SL)};VL(EL,(k)=>{if(L(wL))k(vL);else if(L(E))k(gL,1);else k(v,-1)})}f(h,RL)};VL($,(h)=>{if(L(D).icon)h(o)})}OL(w),KL((h)=>{A=CL(w,1,"item-toolbar__button svelte-rnx3ie",null,A,{"item-toolbar__button--active":h}),jL(w,"href",L(D).disabled?void 0:L(D).href),jL(w,"target",L(D).target),jL(w,"rel",L(D).rel),jL(w,"aria-label",L(D).ariaLabel||L(D).label),jL(w,"title",L(D).tooltip||L(D).label),jL(w,"aria-disabled",L(D).disabled?"true":void 0)},[()=>N0(L(D))]),Z0("click",w,(h)=>{if(L(D).disabled)h.preventDefault()}),f(I,w)},P=O(()=>i0(L(D))),u=(I)=>{var w=gJ();let A;var $=aL(w);{var o=(h)=>{var RL=QL(),EL=UL(RL);{var vL=(k)=>{var W=z0();K0(W,()=>W0(L(D).icon),!0),OL(W),f(k,W)},wL=O(()=>a0(L(D).icon)),gL=(k)=>{var W=yj();KL(()=>jL(W,"src",L(D).icon)),f(k,W)},E=O(()=>d0(L(D).icon)),v=(k)=>{let W=O(()=>Nj(L(D).icon));var SL=QL(),sL=UL(SL);{var zL=(T)=>{var c=z0();K0(c,()=>W0(L(W)),!0),OL(c),f(T,c)},qL=(T)=>{var c=pj();KL(()=>CL(c,1,`icon icon-${L(D).icon}`,"svelte-rnx3ie")),f(T,c)};VL(sL,(T)=>{if(L(W))T(zL);else T(qL,-1)})}f(k,SL)};VL(EL,(k)=>{if(L(wL))k(vL);else if(L(E))k(gL,1);else k(v,-1)})}f(h,RL)};VL($,(h)=>{if(L(D).icon)h(o)})}OL(w),KL((h,RL)=>{A=CL(w,1,"item-toolbar__button svelte-rnx3ie",null,A,{"item-toolbar__button--active":h}),jL(w,"aria-label",L(D).ariaLabel||L(D).label),jL(w,"aria-pressed",RL),jL(w,"title",L(D).tooltip||L(D).label),w.disabled=L(D).disabled},[()=>N0(L(D)),()=>N0(L(D))]),Z0("click",w,function(...h){L(D).onClick?.apply(this,h)}),f(I,w)};VL(S,(I)=>{if(L(i))I(g);else if(L(P))I(_,1);else I(u,-1)})}f(z,a)});var V=f0(b,2);U0(V,17,()=>L(YJ),(z)=>z.key,(z,D)=>{var NL=QL(),JL=UL(NL);{var i=(S)=>{var g=QL(),_=UL(g);H0(_,()=>L(lL),(P)=>{var u=w0();fL(u,(I,w)=>g0?.(I,w),()=>({mounted:L(D),active:L(L0)[L(D).toolId]??!1,runtime:L(x),i18n:L(oL)})),f(P,u)}),f(S,g)},a=(S)=>{var g=w0();fL(g,(_,P)=>v0?.(_,P),()=>L(D).entry),f(S,g)};VL(JL,(S)=>{if(L(D).entry.shell)S(i);else S(a,-1)})}f(z,NL)}),OL(K);var N=f0(K,2);{var e=(z)=>{var D=$J();let NL;U0(D,21,()=>L(Xj),(JL)=>JL.key,(JL,i)=>{var a=QL(),S=UL(a);{var g=(P)=>{var u=QL(),I=UL(u);H0(I,()=>L(lL),(w)=>{var A=bj();fL(A,($,o)=>g0?.($,o),()=>({mounted:L(i),active:L(L0)[L(i).toolId]??!1,runtime:L(x),i18n:L(oL)})),f(w,A)}),f(P,u)},_=(P)=>{var u=bj();fL(u,(I,w)=>v0?.(I,w),()=>L(i).entry),f(P,u)};VL(S,(P)=>{if(L(i).entry.shell)P(g);else P(_,-1)})}f(JL,a)}),OL(D),KL(()=>NL=CL(D,1,"item-toolbar__controls-row svelte-rnx3ie",null,NL,{"item-toolbar__controls-row--reserve":L(Oj),"item-toolbar__controls-row--active":L(Gj),"item-toolbar__controls-row--align-start":L(DJ)})),f(z,D)};VL(N,(z)=>{if(L(OJ))z(e)})}OL(U),mj(U,(z)=>FL(ML,z),()=>L(ML)),KL(()=>{J=CL(U,1,`item-toolbar ${p0()??""} item-toolbar--${rL()??""}`,"svelte-rnx3ie",J,{"item-toolbar--top":xL()==="top","item-toolbar--right":xL()==="right","item-toolbar--bottom":xL()==="bottom","item-toolbar--left":xL()==="left","item-toolbar--header-overlay-active":L(Mj)}),jL(U,"data-content-kind",L(uL)),jL(U,"data-level",L(C))}),Z0("focusin",K,(z)=>{if(L(C)==="section"&&z.target instanceof HTMLElement)z.target.scrollIntoView({block:"nearest",inline:"nearest"})}),f(j,U)};VL(qJ,(j)=>{if(p)j(FJ)})}return f(H,Rj),Ej(RJ)}gj(["focusin","click"]);AJ("pie-item-toolbar",uj(dj,{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"}));
40
+ export{dj as a};
@@ -0,0 +1,49 @@
1
+ var c1=((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 $4="5";if(typeof window<"u")((window.__svelte??={}).v??=new Set).add($4);var b=2,l0=4,P7=8,A7=16777216,Q0=16,o=32,B0=64,p7=128,OJ=256,W0=512,x=1024,R=2048,_=4096,l=8192,g=16384,H0=32768,U7=33554432,F0=65536,B7=131072,ZQ=262144,c0=524288,q4=1048576,v0=33554432,D0=65536,D7=2097152,I0=4194304,b0=8388608,X0=Symbol("$state"),wJ=Symbol("component"),QJ=Symbol("legacy props"),P4=Symbol(""),CJ=Symbol("proxy path"),SJ=Symbol("attributes"),WJ=Symbol("class"),KQ=Symbol("style"),XJ=Symbol("text"),GQ=Symbol("form reset"),$Q=Symbol("hmr anchor"),W7=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},qQ=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");var d7=3,R0=8;var U4=1,B4=2,PQ=4,H4=8,Y4=16,M4=1,V4=2,L4=4,F4=8,O4=16;var w4=1,C4=2;var _7="[",H7="[!",UQ="[?",I7="]",i0={};var y=Symbol("uninitialized"),O0=Symbol("filename"),S4=Symbol("hmr"),NJ="http://www.w3.org/1999/xhtml",zJ="http://www.w3.org/2000/svg",BQ="http://www.w3.org/1998/Math/MathML";var q=!0;var X7="font-weight: bold",z7="font-weight: normal";function N4(J){if(q)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`,X7,z7);else console.warn("https://svelte.dev/e/await_reactivity_loss")}function A4(J,Q){if(q)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`,X7,z7);else console.warn("https://svelte.dev/e/await_waterfall")}function D4(){if(q)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`,X7,z7);else console.warn("https://svelte.dev/e/derived_inert")}function I4(J,Q,W){if(q)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`,X7,z7);else console.warn("https://svelte.dev/e/hydration_attribute_changed")}function R4(J){if(q)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`,X7,z7);else console.warn("https://svelte.dev/e/hydration_html_changed")}function Y7(J){if(q)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`,X7,z7);else console.warn("https://svelte.dev/e/hydration_mismatch")}function j4(){if(q)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`,X7,z7);else console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function AJ(J){if(q)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`,X7,z7);else console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}function T4(){if(q)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",X7,z7);else console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}var Z7=Array.isArray,x4=Array.prototype.indexOf,M7=Array.prototype.includes,l7=Array.from,ZJ=Object.keys,c=Object.defineProperty,Y0=Object.getOwnPropertyDescriptor,DJ=Object.getOwnPropertyDescriptors,HQ=Object.prototype,k4=Array.prototype,R7=Object.getPrototypeOf,YQ=Object.isExtensible;var o0=()=>{};function IJ(J){for(var Q=0;Q<J.length;Q++)J[Q]()}function RJ(){var J,Q,W=new Promise((X,z)=>{J=X,Q=z});return{promise:W,resolve:J,reject:Q}}var MQ=new WeakMap;function E4(J){var Q=L;if(Q===null)return w.f|=b0,J;if(q&&J instanceof Error&&!MQ.has(J))MQ.set(J,G6(J,Q));if((Q.f&H0)===0&&(Q.f&l0)===0){if(q&&!Q.parent&&J instanceof Error)b4(J);throw J}w0(J,Q)}function w0(J,Q){if(Q!==null&&(Q.f&g)!==0)return;while(Q!==null){if((Q.f&p7)!==0&&(Q.f&(g|U7))===0){if((Q.f&H0)===0)throw J;try{Q.b.error(J);return}catch(W){J=W}}Q=Q.parent}if(q&&J instanceof Error)b4(J);throw J}function G6(J,Q){let W=Y0(J,"message");if(W&&!W.configurable)return;var X=KJ?" ":"\t",z=`
18
+ ${X}in ${Q.fn?.name||"<unknown>"}`,Z=Q.ctx;while(Z!==null)z+=`
19
+ ${X}in ${Z.function?.[O0].split("/").pop()}`,Z=Z.p;return{message:J.message+`
20
+ ${z}
21
+ `,stack:J.stack?.split(`
22
+ `).filter((K)=>!K.includes("svelte/src/internal")).join(`
23
+ `)}}function b4(J){let Q=MQ.get(J);if(Q)c(J,"message",{value:Q.message}),c(J,"stack",{value:Q.stack})}function y4(J){if(q){let Q=Error(`invariant_violation
24
+ 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}"
25
+ https://svelte.dev/e/invariant_violation`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/invariant_violation")}function g4(){if(q){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 v4(){if(q){let J=Error(`derived_references_self
26
+ A derived value cannot reference itself recursively
27
+ https://svelte.dev/e/derived_references_self`);throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/derived_references_self")}function VQ(J,Q,W){if(q){let X=Error(`each_key_duplicate
28
+ ${W?`Keyed each block has duplicate key \`${W}\` at indexes ${J} and ${Q}`:`Keyed each block has duplicate key at indexes ${J} and ${Q}`}
29
+ https://svelte.dev/e/each_key_duplicate`);throw X.name="Svelte error",X}else throw Error("https://svelte.dev/e/each_key_duplicate")}function m4(J,Q,W){if(q){let X=Error(`each_key_volatile
30
+ 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
31
+ https://svelte.dev/e/each_key_volatile`);throw X.name="Svelte error",X}else throw Error("https://svelte.dev/e/each_key_volatile")}function u4(J){if(q){let Q=Error(`effect_in_teardown
32
+ \`${J}\` cannot be used inside an effect cleanup function
33
+ https://svelte.dev/e/effect_in_teardown`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/effect_in_teardown")}function f4(){if(q){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 p4(J){if(q){let Q=Error(`effect_orphan
34
+ \`${J}\` can only be used inside an effect (e.g. during component initialisation)
35
+ https://svelte.dev/e/effect_orphan`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/effect_orphan")}function d4(){if(q){let J=Error(`effect_update_depth_exceeded
36
+ Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
37
+ 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 _4(){if(q){let J=Error(`hydration_failed
38
+ Failed to hydrate the application
39
+ https://svelte.dev/e/hydration_failed`);throw J.name="Svelte error",J}else throw Error("https://svelte.dev/e/hydration_failed")}function l4(J){if(q){let Q=Error(`props_invalid_value
40
+ Cannot do \`bind:${J}={undefined}\` when \`${J}\` has a fallback value
41
+ https://svelte.dev/e/props_invalid_value`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/props_invalid_value")}function c4(J){if(q){let Q=Error(`rune_outside_svelte
42
+ The \`${J}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
43
+ https://svelte.dev/e/rune_outside_svelte`);throw Q.name="Svelte error",Q}else throw Error("https://svelte.dev/e/rune_outside_svelte")}function i4(){if(q){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 o4(){if(q){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 s4(){if(q){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 a4(){if(q){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 r=!1,V7=!1,m0=!1;var A=null;function K7(J){A=J}var s0=null;function c7(J){s0=J}var j0=null;function jJ(J){j0=J}function LQ(J,Q=!1,W){if(A={p:A,i:!1,c:null,e:null,s:J,x:null,r:L,l:V7&&!Q?{s:null,u:null,$:[]}:null},q)A.function=W,j0=W}function FQ(J){var Q=A,W=Q.e;if(W!==null){Q.e=null;for(var X of W)OQ(X)}if(J!==void 0)Q.x=J;if(Q.i=!0,A=Q.p,q)j0=A?.function??null;return GJ(J)}function GJ(J={}){return c(J,wJ,{value:!0}),J}function u0(){return!V7||A!==null&&A.l===null}var j7=[];function n4(){var J=j7;j7=[],IJ(J)}function n(J){if(j7.length===0&&!T7){var Q=j7;queueMicrotask(()=>{if(Q===j7)n4()})}j7.push(J)}function t4(){while(j7.length>0)n4()}function TJ(J){return J===this.v}function xJ(J,Q){return J!=J?Q==Q:J!==Q||J!==null&&typeof J==="object"||typeof J==="function"}function kJ(J){return!xJ(J,this.v)}var $J=null;function G0(J,Q){return J.label=Q,bJ(J.v,Q),J}function bJ(J,Q){return J?.[CJ]?.(Q),J}function f0(J){let Q=Error(),W=$6();if(W.length===0)return null;return W.unshift(`
44
+ `),c(Q,"stack",{value:W.join(`
45
+ `)}),c(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(`
46
+ `),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 J8(J,Q){if(!q)throw Error("invariant(...) was not guarded by if (DEV)");if(!J)y4(Q)}function a0(J){var Q=w,W=L;u(null),f(null);try{return J()}finally{u(Q),f(W)}}function yJ(J,Q,W,X){let z=u0()?F7:x7;var Z=J.filter((P)=>!P.settled),K=Q.map(z);if(q)K.forEach((P,M)=>{P.label=Q[M].toString().replace("() => ","").replaceAll("$.eager(() => ","$state.eager(").replace(/\$\.get\((.+?)\)/g,(O,V)=>V)});if(W.length===0&&Z.length===0){X(K);return}var G=L,$=Q8(),Y=Z.length===1?Z[0].promise:Z.length>1?Promise.all(Z.map((P)=>P.promise)):null;function H(P){if((G.f&g)!==0)return;$();try{X([...K,...P])}catch(M){w0(M,G)}i7()}var B=wQ();if(W.length===0){Y.then(()=>H([])).finally(B);return}function U(){Promise.all(W.map((P)=>SQ(P))).then(H).catch((P)=>w0(P,G)).finally(B)}if(Y)Y.then(()=>{$(),U(),i7()});else U()}function Q8(){var J=L,Q=w,W=A,X=C;if(q)var z=s0;return function(K=!0){if(f(J),u(Q),K7(W),K&&(J.f&g)===0)X?.activate(),X?.apply();if(q)CQ(null),c7(z)}}var P6=!1;function i7(J=!0){if(P6=!1,f(null),u(null),K7(null),J)C?.deactivate();if(q)CQ(null),c7(null)}function wQ(){var J=L,Q=J.b,W=C,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 B6=~(R|_|x);function T(J,Q){J.f=J.f&B6|Q}function o7(J){if((J.f&W0)!==0||J.deps===null)T(J,x);else T(J,_)}var C0=null;function CQ(J){C0=J}var PJ=new Set;function F7(J){var Q=b|R;if(L!==null)L.f|=c0;let W={ctx:A,deps:null,effects:null,equals:TJ,f:Q,fn:J,reactions:null,rv:0,v:y,wv:0,parent:L,ac:null};if(q&&m0)W.created=f0("created at");return W}var s7=Symbol("obsolete");function SQ(J,Q,W){let X=L;if(X===null)g4();var z=void 0,Z=q0(y);if(q)Z.label=Q??J.toString();var K=!w,G=new Set;if(z8(()=>{var $=L;if(q)C0={effect:$,effect_deps:new Set,warned:!1};var Y=RJ();z=Y.promise;try{Promise.resolve(J()).then(Y.resolve,(P)=>{if(P!==W7)Y.reject(P)}).finally(i7)}catch(P){Y.reject(P),i7()}if(q){if(C0){if($.deps!==null)for(let P=0;P<M0;P+=1)C0.effect_deps.add($.deps[P]);if(t!==null)for(let P=0;P<t.length;P+=1)C0.effect_deps.add(t[P])}C0=null}var H=C;if(K){if(($.f&H0)!==0)var B=wQ();if(X.b?.is_rendered())H.async_deriveds.get($)?.reject(s7);else for(let P of G.values())P.reject(s7);G.add(Y),H.async_deriveds.set($,Y)}let U=(P,M=void 0)=>{if(q)C0=null;if(B?.(),G.delete(Y),M===s7)return;if(H.activate(),M)Z.f|=b0,p0(Z,M);else{if((Z.f&b0)!==0)Z.f^=b0;if(q&&W!==void 0&&!Z.equals(P))PJ.add(Z),setTimeout(()=>{if(PJ.has(Z)&&($.f&g)===0)A4(Z.label,W),PJ.delete(Z)});p0(Z,P)}H.deactivate()};Y.promise.then(U,(P)=>U(null,P||"unknown"))}),$0(()=>{for(let $ of G)$.reject(s7)}),q)Z.f|=I0;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=F7(J);if(!r)vJ(Q);return Q}function x7(J){let Q=F7(J);return Q.equals=kJ,Q}function W8(J){var Q=J.effects;if(Q!==null){J.effects=null;for(var W=0;W<Q.length;W+=1)m(Q[W])}}var NQ=[];function UJ(J){var Q,W=L,X=J.parent;if(!T0&&X!==null&&J.v!==y&&(X.f&(g|l))!==0)return D4(),J.v;if(f(X),q){let z=k7;hJ(new Set);try{if(M7.call(NQ,J))v4();NQ.push(J),J.f&=~D0,W8(J),Q=gJ(J)}finally{f(W),hJ(z),NQ.pop()}}else try{J.f&=~D0,W8(J),Q=gJ(J)}finally{f(W)}return Q}function AQ(J){var Q=UJ(J);if(!J.equals(Q)){if(J.wv=a7(),!C?.is_fork||J.deps===null){if(C!==null)C.capture(J,Q,!0),O7?.capture(J,Q,!0);else J.v=Q;if(J.deps===null){T(J,x);return}}}if(T0)return;if(e!==null){if(L7()||C?.is_fork)e.set(J,Q)}else o7(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)a0(()=>{Q.ac.abort(W7),Q.ac=null});if(Q.fn!==null)Q.teardown=o0;E7(Q,0),BJ(Q)}}function DQ(J){if(J.effects===null)return;for(let Q of J.effects)if(Q.teardown&&Q.fn!==null)r0(Q)}var k7=new Set,y0=new Map;function hJ(J){k7=J}var IQ=!1;function Z8(){IQ=!0}function q0(J,Q){var W={f:0,v:J,reactions:null,equals:TJ,rv:0,wv:0};if(q&&m0)W.created=Q??f0("created at"),W.updated=null,W.set_during_effect=!1,W.trace=null;return W}function n0(J,Q){let W=q0(J,Q);return vJ(W),W}function b7(J,Q=!1,W=!0){let X=q0(J);if(!Q)X.equals=kJ;if(V7&&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&B7)!==0)&&u0()&&(w.f&(b|Q0|I0|B7))!==0&&(d0===null||!d0.has(J)))s4();let X=W?G7(Q):Q;if(q)bJ(X,J.label);return p0(J,X,HJ)}function p0(J,Q,W=null){if(!J.equals(Q)){if(T0)y0.set(J,Q);else if(!y0.has(J))y0.set(J,J.v);var X=K0.ensure();if(X.capture(J,Q),q){if(m0||L!==null){J.updated??=new Map;let z=(J.updated.get("")?.count??0)+1;if(J.updated.set("",{error:null,count:z}),m0||z>5){let Z=f0("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(L!==null)J.set_during_effect=!0}if((J.f&b)!==0){let z=J;if((J.f&R)!==0)UJ(z);if(e===null)o7(z)}if(J.wv=a7(),K8(J,R,W),u0()&&L!==null&&(L.f&x)!==0&&(L.f&(o|B0))===0)if(x0===null)G8([J]);else x0.push(J);if(!X.is_fork&&k7.size>0&&!IQ)mJ()}return Q}function mJ(){IQ=!1;for(let J of k7){if((J.f&x)!==0)T(J,_);let Q;try{Q=w7(J)}catch{Q=!0}if(Q)r0(J)}k7.clear()}function y7(J){P0(J,J.v+1)}function K8(J,Q,W){var X=J.reactions;if(X===null)return;var z=u0(),Z=X.length;for(var K=0;K<Z;K++){var G=X[K],$=G.f;if(!z&&G===L)continue;var Y=($&R)===0;if(Y)T(G,Q);if(($&B7)!==0)k7.add(G);else if(($&b)!==0){var H=G;if(e?.delete(H),($&D0)===0){if($&W0&&(L===null||(L.f&D7)===0))G.f|=D0;K8(H,_,W)}}else if(Y){var B=G;if(($&Q0)!==0&&h0!==null)h0.add(B);if(W!==null)W.push(B);else YJ(B)}}}function $8(J){if(J===null)return;for(let Q of J){if((Q.f&b)===0||(Q.f&D0)===0)continue;Q.f^=D0,$8(Q.deps)}}function uJ(J,Q,W){if((J.f&R)!==0)Q.add(J);else if((J.f&_)!==0)W.add(J);$8(J.deps),T(J,x)}var q8=!1,fJ=!1,PW=Symbol("unmounted");function RQ(J){var Q=fJ;try{return fJ=!1,[J(),fJ]}finally{fJ=Q}}var pJ=null,r7=null,C=null,O7=null,e=null,xQ=null,T7=!1,jQ=!1,h7=null,HJ=null,P8=0,TQ=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(r7===null)pJ=r7=this;else r7.#W=this,this.#Q=r7;r7=this}#O(){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,R),Q(X);for(X of W.m)T(X,_),Q(X)}this.#V.add(J)}#L(){if(this.#J=!0,P8++>1000)this.#Y(),L6();if(q)for(let G of this.current.keys())TQ.add(G);for(let G of this.#P)this.#U.delete(G),T(G,R),this.schedule(G);for(let G of this.#U)T(G,_),this.schedule(G);let J=this.#z;this.#z=[],this.apply();var Q=h7=[],W=[],X=HJ=[];for(let G of J)try{this.#w(G,Q,W)}catch($){if(Y8(G),!this.#O())this.discard();throw $}if(C=null,X.length>0){var z=K0.ensure();for(let G of X)z.schedule(G)}if(h7=null,HJ=null,this.#O()){this.#H(W),this.#H(Q);for(let[G,$]of this.#B)H8(G,$);if(X.length>0)C.#L();return}let Z=this.#C();if(Z){this.#H(W),this.#H(Q),Z.#S(this);return}this.#P.clear(),this.#U.clear();for(let G of this.#G)G(this);this.#G.clear(),O7=this,U8(W),U8(Q),O7=null,this.#$?.resolve();var K=C;if(this.#K===0&&(this.#z.length===0||K!==null)){if(this.#Y(),r)this.#F(),C=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)y0.clear(),K.#L()}#w(J,Q,W){J.f^=x;var X=J.first;while(X!==null){var z=X.f,Z=(z&(o|B0))!==0,K=Z&&(z&x)!==0,G=K||(z&l)!==0||this.#B.has(X);if(!G&&X.fn!==null){if(Z)X.f^=x;else if((z&l0)!==0)Q.push(X);else if(r&&(z&(P7|A7))!==0)W.push(X);else if(w7(X)){if((z&Q0)!==0)this.#U.add(X);r0(X)}var $=X.first;if($!==null){X=$;continue}}while(X!==null){var Y=X.next;if(Y!==null){X=Y;break}X=X.parent}}}#C(){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}#S(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&(R|_))===0)return;for(let K of X){var z=K.f;if((z&b)!==0)Q(K);else{var Z=K;if(z&(I0|Q0)&&!this.async_deriveds.has(Z))this.#U.delete(Z),T(Z,R),this.schedule(Z)}}};for(let W of this.current.keys())Q(W);this.oncommit(()=>J.discard()),J.#Y(),C=this,this.#L()}#H(J){for(var Q=0;Q<J.length;Q+=1)uJ(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&b0)===0)this.current.set(J,[Q,W]),e?.set(J,Q);if(!this.is_fork)J.v=Q}activate(){C=this}deactivate(){C=null,e=null}flush(){try{if(q)TQ.clear();jQ=!0,C=this,this.#L()}finally{if(P8=0,xQ=null,h7=null,HJ=null,jQ=!1,C=null,e=null,y0.clear(),q)for(let J of TQ)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(s7);this.#Y(),this.#$?.resolve()}register_created_effect(J){this.#M.push(J)}#F(){for(let H=pJ;H!==null;H=H.#W){var J=H.id<this.id,Q=[];for(let[B,[U,P]]of this.current){if(H.current.has(B)){var W=H.current.get(B)[0];if(J&&U!==W)H.current.set(B,[U,P]);else continue}Q.push(B)}if(J)for(let[B,U]of this.async_deriveds){let P=H.async_deriveds.get(B);if(P)U.promise.then(P.resolve).catch(P.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(q&&!H.#q)J8(H.#z.length===0,"Batch has scheduled roots");if(J)for(let B of this.#V)H.unskip_effect(B,(U)=>{if((U.f&(Q0|I0))!==0)H.schedule(U);else H.#H([U])});H.activate();var Z=new Set,K=new Map;for(var G of Q)B8(G,z,Z,K);K=new Map;var $=[...H.current].filter(([B,U])=>{let P=this.current.get(B);if(!P)return!0;return P[0]!==U[0]||P[1]!==U[1]}).map(([B])=>B);if($.length>0){for(let B of this.#M)if((B.f&(g|l|B7))===0&&kQ(B,$,K))if((B.f&(I0|Q0))!==0)T(B,R),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,n(()=>{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.#$??=RJ()).promise}static ensure(){if(C===null){let J=C=new K0;if(!jQ&&!T7)n(()=>{if(!J.#J)J.flush()})}return C}apply(){if(!r||!this.is_fork&&this.#Q===null&&this.#W===null){e=null;return}e=new Map;for(let[Q,[W]]of this.current)e.set(Q,W);for(let Q=pJ;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(!e.has(W))e.set(W,X)}}}schedule(J){if(xQ=J,J.b?.is_pending&&(J.f&(l0|P7|A7))!==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(h7!==null&&Q===L){if(r)return;if((w===null||(w.f&b)===0)&&!q8)return}if((W&(B0|o))!==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)pJ=Q;else J.#W=Q;if(Q===null)r7=J;else Q.#Q=J;this.linked=!1}}function n7(J){var Q=T7;T7=!0;try{var W;if(J){if(C!==null&&!C.is_fork)C.flush();W=J()}while(!0){if(t4(),C===null)return W;C.flush()}}finally{T7=Q}}function L6(){if(q){var J=new Map;for(let W of C.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{d4()}catch(W){if(q)c(W,"stack",{value:""});w0(W,xQ)}}var h0=null;function U8(J){var Q=J.length;if(Q===0)return;var W=0;while(W<Q){var X=J[W++];if((X.f&(g|l))===0&&w7(X)){if(h0=new Set,r0(X),X.deps===null&&X.first===null&&X.nodes===null&&X.teardown===null&&X.ac===null)EQ(X);if(h0?.size>0){y0.clear();for(let z of h0){if((z.f&(g|l))!==0)continue;let Z=[z],K=z.parent;while(K!==null){if(h0.has(K))h0.delete(K),Z.push(K);K=K.parent}for(let G=Z.length-1;G>=0;G--){let $=Z[G];if(($.f&(g|l))!==0)continue;r0($)}}h0.clear()}}}h0=null}function B8(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)B8(z,Q,W,X);else if((Z&(I0|Q0))!==0&&(Z&R)===0&&kQ(z,Q,X))T(z,R),YJ(z)}}function kQ(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(M7.call(Q,z))return!0;if((z.f&b)!==0&&kQ(z,Q,W))return W.set(z,!0),!0}return W.set(J,!1),!1}function YJ(J){C.schedule(J)}function H8(J,Q){if((J.f&o)!==0&&(J.f&x)!==0)return;if((J.f&R)!==0)Q.d.push(J);else if((J.f&_)!==0)Q.m.push(J);T(J,x);var W=J.first;while(W!==null)H8(W,Q),W=W.next}function Y8(J){T(J,x);var Q=J.first;while(Q!==null)Y8(Q),Q=Q.next}function V8(J){if(L===null){if(w===null)p4(J);f4()}if(T0)u4(J)}function O6(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 t0(J,Q){var W=L;if(q)while(W!==null&&(W.f&B7)!==0)W=W.parent;if(W!==null&&(W.f&l)!==0)J|=l;var X={ctx:A,deps:null,nodes:null,f:J|R|W0,first:null,fn:Q,last:null,next:null,parent:W,b:W&&W.b,prev:null,teardown:null,wv:0,ac:null};if(q)X.component_function=j0;C?.register_created_effect(X);var z=X;if((J&l0)!==0)if(h7!==null)h7.push(X);else K0.ensure().schedule(X);else if(Q!==null){try{r0(X)}catch(K){throw m(X),K}if(z.deps===null&&z.teardown===null&&z.nodes===null&&z.first===z.last&&(z.f&c0)===0){if(z=z.first,(J&Q0)!==0&&(J&F0)!==0&&z!==null)z.f|=F0}}if(z!==null){if(z.parent=W,W!==null)O6(z,W);if(w!==null&&(w.f&b)!==0&&(J&B0)===0){var Z=w;(Z.effects??=[]).push(z)}}return X}function L7(){return w!==null&&!V0}function $0(J){let Q=t0(P7,null);return T(Q,x),Q.teardown=J,Q}function yQ(J){if(V8("$effect"),q)c(J,"name",{value:"$effect"});var Q=L.f,W=!w&&(Q&o)!==0&&A!==null&&!A.i;if(W){var X=A;(X.e??=[]).push(J)}else return OQ(J)}function OQ(J){return t0(l0|q4,J)}function hQ(J){K0.ensure();let Q=t0(B0|c0,J);return()=>{m(Q)}}function L8(J){K0.ensure();let Q=t0(B0|c0,J);return(W={})=>{return new Promise((X)=>{if(W.outro)e0(Q,()=>{m(Q),X(void 0)});else m(Q),X(void 0)})}}function L0(J){return t0(l0,J)}function z8(J){return t0(I0|c0,J)}function J0(J,Q=0){return t0(P7|Q,J)}function gQ(J,Q=[],W=[],X=[]){yJ(X,Q,W,(z)=>{t0(P7,()=>{J(...z.map(I))})})}function S0(J,Q=0){var W=t0(Q0|Q,J);if(q)W.dev_stack=s0;return W}function a(J){return t0(o|c0,J)}function vQ(J){var Q=J.teardown;if(Q!==null){let W=T0,X=w;bQ(!0),u(null);try{Q.call(null)}catch(z){w0(z,J.parent)}finally{bQ(W),u(X)}}}function BJ(J,Q=!1){var W=J.first;J.first=J.last=null;while(W!==null){let z=W.ac;if(z!==null)a0(()=>{z.abort(W7)});var X=W.next;if((W.f&B0)!==0)W.parent=null;else m(W,Q);W=X}}function F8(J){var Q=J.first;while(Q!==null){var W=Q.next;if((Q.f&o)===0)m(Q);Q=W}}function m(J,Q=!0){var W=!1;if((Q||(J.f&ZQ)!==0)&&J.nodes!==null&&J.nodes.end!==null)mQ(J.nodes.start,J.nodes.end),W=!0;J.f|=U7,BJ(J,Q&&!W),E7(J,0);var X=J.nodes&&J.nodes.t;if(X!==null)for(let Z of X)Z.stop();vQ(J),J.f^=U7,J.f|=g;var z=J.parent;if(z!==null&&z.first!==null)EQ(J);if(q)J.component_function=null;J.next=J.prev=J.teardown=J.ctx=J.deps=J.fn=J.nodes=J.ac=J.b=null}function mQ(J,Q){while(J!==null){var W=J===Q?null:s(J);J.remove(),J=W}}function EQ(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 e0(J,Q,W=!0){var X=[];J.f|=OJ,O8(J,X,!0);var z=()=>{if(W)m(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&l)!==0)return;J.f^=l;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&F0)!==0||(z.f&o)!==0&&(J.f&Q0)!==0;O8(z,Q,K?W:!1)}z=Z}}function t7(J){J.f&=~OJ,w8(J,!0)}function w8(J,Q){if((J.f&OJ)!==0)return;if((J.f&l)===0)return;if(J.f^=l,(J.f&x)===0)T(J,R),K0.ensure().schedule(J);var W=J.first;while(W!==null){var X=W.next,z=(W.f&F0)!==0||(W.f&o)!==0;w8(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 e7(J,Q){if(!J.nodes)return;var W=J.nodes.start,X=J.nodes.end;while(W!==null){var z=W===X?null:s(W);Q.append(W),W=z}}var C8=null;var dJ=!1,T0=!1;function bQ(J){T0=J}var w=null,V0=!1;function u(J){w=J}var L=null;function f(J){L=J}var d0=null;function vJ(J){if(w!==null&&(!r||(w.f&b)!==0))(d0??=new Set).add(J)}var t=null,M0=0,x0=null;function G8(J){x0=J}var N8=1,g7=0,C7=g7;function uQ(J){C7=J}function a7(){return++N8}function w7(J){var Q=J.f;if((Q&R)!==0)return!0;if(Q&b)J.f&=~D0;if((Q&_)!==0){var W=J.deps,X=W.length;for(var z=0;z<X;z++){var Z=W[z];if(w7(Z))AQ(Z);if(Z.wv>J.wv)return!0}if((Q&W0)!==0&&e===null)T(J,x)}return!1}function A8(J,Q,W=!0){var X=J.reactions;if(X===null)return;if(!r&&d0!==null&&d0.has(J))return;for(var z=0;z<X.length;z++){var Z=X[z];if((Z.f&b)!==0)A8(Z,Q,!1);else if(Q===Z){if(W)T(Z,R);else if((Z.f&x)!==0)T(Z,_);YJ(Z)}}}function gJ(J){var Q=t,W=M0,X=x0,z=w,Z=d0,K=A,G=V0,$=C7,Y=J.f;if(t=null,M0=0,x0=null,w=(Y&(o|B0))===0?J:null,d0=null,K7(J.ctx),V0=!1,C7=++g7,J.ac!==null)a0(()=>{J.ac.abort(W7)}),J.ac=null;try{J.f|=D7;var H=J.fn,B=H();J.f|=H0;var U=S8(J);if(u0()&&x0!==null&&!V0&&U!==null&&(J.f&(b|_|R))===0)for(var P=0;P<x0.length;P++)A8(x0[P],J);if(z!==null&&z!==J){if(g7++,z.deps!==null)for(let M=0;M<W;M+=1)z.deps[M].rv=g7;if(Q!==null)for(let M of Q)M.rv=g7;if(x0!==null)if(X===null)X=x0;else X.push(...x0)}if((J.f&b0)!==0)J.f^=b0;return B}catch(M){return S8(J),E4(M)}finally{J.f^=D7,t=Q,M0=W,x0=X,w=z,d0=Z,K7(K),V0=G,C7=$}}function S8(J){var Q=J.deps,W=C?.is_fork;if(t!==null){var X;if(!W)E7(J,M0);if(Q!==null&&M0>0){Q.length=M0+t.length;for(X=0;X<t.length;X++)Q[M0+X]=t[X]}else J.deps=Q=t;if(L7()&&(J.f&W0)!==0)for(X=M0;X<Q.length;X++)(Q[X].reactions??=[]).push(J)}else if(!W&&Q!==null&&M0<Q.length)E7(J,M0),Q.length=M0;return Q}function w6(J,Q){let W=Q.reactions;if(W!==null){var X=x4.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&&(t===null||!M7.call(t,Q))){var Z=Q;if((Z.f&W0)!==0)Z.f^=W0,Z.f&=~D0;if(Z.v!==y)o7(Z);if(Z.ac!==null)a0(()=>{Z.ac.abort(W7),Z.ac=null,T(Z,R)});X8(Z),E7(Z,0)}}function E7(J,Q){var W=J.deps;if(W===null)return;for(var X=Q;X<W.length;X++)w6(J,W[X])}function r0(J){var Q=J.f;if((Q&g)!==0)return;T(J,x);var W=L,X=dJ;if(L=J,dJ=(Q&(o|B0))===0,q){var z=j0;jJ(J.component_function);var Z=s0;c7(J.dev_stack??s0)}try{if((Q&(Q0|A7))!==0)F8(J);else BJ(J);vQ(J);var K=gJ(J);if(J.teardown=typeof K==="function"?K:null,J.wv=N8,q&&m0&&(J.f&R)!==0&&J.deps!==null){for(var G of J.deps)if(G.set_during_effect)G.wv=a7(),G.set_during_effect=!1}}finally{if(dJ=X,L=W,q)jJ(z),c7(Z)}}function I(J){var Q=J.f,W=(Q&b)!==0;if(C8?.add(J),w!==null&&!V0){var X=L!==null&&(L.f&g)!==0;if(!X&&(d0===null||!d0.has(J))){var z=w.deps;if((w.f&D7)!==0){if(J.rv<g7)if(J.rv=g7,t===null&&z!==null&&z[M0]===J)M0++;else if(t===null)t=[J];else t.push(J)}else{if(w.deps??=[],!M7.call(w.deps,J))w.deps.push(J);var Z=J.reactions;if(Z===null)J.reactions=[w];else if(!M7.call(Z,w))Z.push(w)}}}if(q){if(!V0&&C0&&C===null&&O7===null&&!C0.warned&&(C0.effect.f&D7)===0&&!C0.effect_deps.has(J)){C0.warned=!0,N4(J.label);var K=f0("traced at");if(K)console.warn(K)}if(PJ.delete(J),m0&&!V0&&$J!==null&&w!==null&&$J.reaction===w){if(J.trace)J.trace();else if(K=f0("traced at"),K){var G=$J.entries.get(J);if(G===void 0)G={traces:[]},$J.entries.set(J,G);var $=G.traces[G.traces.length-1];if(K.stack!==$?.stack)G.traces.push(K)}}}if(T0&&y0.has(J))return y0.get(J);if(W){var Y=J;if(T0){var H=Y.v;if((Y.f&x)===0&&Y.reactions!==null||I8(Y))H=UJ(Y);return y0.set(Y,H),H}var B=(Y.f&W0)===0&&!V0&&w!==null&&(dJ||(w.f&W0)!==0),U=(Y.f&H0)===0;if(w7(Y)){if(B)Y.f|=W0;AQ(Y)}if(B&&!U)DQ(Y),D8(Y)}if(e?.has(J))return e.get(J);if((J.f&b0)!==0)throw J.v;return J.v}function D8(J){if(J.f|=W0,J.deps===null)return;for(let Q of J.deps)if((Q.reactions??=[]).push(J),(Q.f&b)!==0&&(Q.f&W0)===0)DQ(Q),D8(Q)}function I8(J){if(J.v===y)return!0;if(J.deps===null)return!1;for(let Q of J.deps){if(y0.has(Q))return!0;if((Q.f&b)!==0&&I8(Q))return!0}return!1}function h(J){var Q=V0;try{return V0=!0,J()}finally{V0=Q}}function lJ(J){if(typeof J!=="object"||!J||J instanceof EventTarget)return;if(X0 in J)_J(J);else if(!Array.isArray(J))for(let Q in J){let W=J[Q];if(typeof W==="object"&&W&&X0 in W)_J(W)}}function _J(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{_J(J[X],Q)}catch(z){}let W=R7(J);if(W!==Object.prototype&&W!==Array.prototype&&W!==Map.prototype&&W!==Set.prototype&&W!==Date.prototype){let X=DJ(W);for(let z in X){let Z=X[z].get;if(Z)try{Z.call(J)}catch(K){}}}}}var C6=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function G7(J){if(typeof J!=="object"||J===null||X0 in J||wJ in J)return J;let Q=R7(J);if(Q!==HQ&&Q!==k4)return J;var W=new Map,X=Z7(J),z=n0(0),Z=q&&m0?f0("created at"):null,K=C7,G=(B)=>{if(C7===K)return B();var U=w,P=C7;u(null),uQ(K);var M=B();return u(U),uQ(P),M};if(X){if(W.set("length",n0(J.length,Z)),q)J=N6(J)}var $="";let Y=!1;function H(B){if(Y)return;Y=!0,$=B,G0(z,`${$} version`);for(let[U,P]of W)G0(P,v7($,U));Y=!1}return new Proxy(J,{defineProperty(B,U,P){if(!("value"in P)||P.configurable===!1||P.enumerable===!1||P.writable===!1)i4();var M=W.get(U);if(M===void 0)G(()=>{var O=n0(P.value,Z);if(W.set(U,O),q&&typeof U==="string")G0(O,v7($,U));return O});else P0(M,P.value,!0);return!0},deleteProperty(B,U){var P=W.get(U);if(P===void 0){if(U in B){let M=G(()=>n0(y,Z));if(W.set(U,M),y7(z),q)G0(M,v7($,U))}}else P0(P,y),y7(z);return!0},get(B,U,P){if(U===X0)return J;if(q&&U===CJ)return H;var M=W.get(U),O=U in B;if(M===void 0&&(!O||Y0(B,U)?.writable))M=G(()=>{var N=G7(O?B[U]:y),k=n0(N,Z);if(q)G0(k,v7($,U));return k}),W.set(U,M);if(M!==void 0){var V=I(M);return V===y?void 0:V}return Reflect.get(B,U,P)},getOwnPropertyDescriptor(B,U){var P=Reflect.getOwnPropertyDescriptor(B,U);if(P&&"value"in P){var M=W.get(U);if(M)P.value=I(M)}else if(P===void 0){var O=W.get(U),V=O?.v;if(O!==void 0&&V!==y)return{enumerable:!0,configurable:!0,value:V,writable:!0}}return P},has(B,U){if(U===X0)return!0;var P=W.get(U),M=P!==void 0&&P.v!==y||Reflect.has(B,U);if(P!==void 0||L!==null&&(!M||Y0(B,U)?.writable)){if(P===void 0)P=G(()=>{var V=M?G7(B[U]):y,N=n0(V,Z);if(q)G0(N,v7($,U));return N}),W.set(U,P);var O=I(P);if(O===y)return!1}return M},set(B,U,P,M){var O=W.get(U),V=U in B;if(X&&U==="length")for(var N=P;N<O.v;N+=1){var k=W.get(N+"");if(k!==void 0)P0(k,y);else if(N in B){if(k=G(()=>n0(y,Z)),W.set(N+"",k),q)G0(k,v7($,N))}}if(O===void 0){if(!V||Y0(B,U)?.writable){if(O=G(()=>n0(void 0,Z)),q)G0(O,v7($,U));P0(O,G7(P)),W.set(U,O)}}else{V=O.v!==y;var E=G(()=>G7(P));P0(O,E)}var D=Reflect.getOwnPropertyDescriptor(B,U);if(D?.set)D.set.call(M,P);if(!V){if(X&&typeof U==="string"){var E0=W.get("length"),U0=Number(U);if(Number.isInteger(U0)&&U0>=E0.v)P0(E0,U0+1)}y7(z)}return!0},ownKeys(B){I(z);var U=Reflect.ownKeys(B).filter((O)=>{var V=W.get(O);return V===void 0||V.v!==y});for(var[P,M]of W)if(M.v!==y&&!(P in B))U.push(P);return U},setPrototypeOf(){o4()}})}function v7(J,Q){if(typeof Q==="symbol")return`${J}[Symbol(${Q.description??""})]`;if(C6.test(Q))return`${J}.${Q}`;return/^\d+$/.test(Q)?`${J}[${Q}]`:`${J}['${Q}']`}function cJ(J){try{if(J!==null&&typeof J==="object"&&X0 in J)return J[X0]}catch{}return J}var S6=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(!S6.has(W))return z;return function(...Z){Z8();var K=z.apply(this,Z);return mJ(),K}}})}function R8(){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(cJ(this[$])===Z){AJ("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(cJ(this[$])===Z){AJ("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(cJ(this[$])===Z){AJ("array.includes(...)");break}}return G},Array.__svelte_cleanup=()=>{J.indexOf=W,J.lastIndexOf=X,J.includes=z}}var fQ,j8,KJ,T8,x8;function oJ(){if(fQ!==void 0)return;fQ=window,j8=document,KJ=/Firefox/.test(navigator.userAgent);var J=Element.prototype,Q=Node.prototype,W=Text.prototype;if(T8=Y0(Q,"firstChild").get,x8=Y0(Q,"nextSibling").get,YQ(J))J[WJ]=void 0,J[SJ]=null,J[KQ]=void 0,J.__e=void 0;if(YQ(W))W[XJ]=void 0;if(q)J.__svelte_meta=null,R8()}function p(J=""){return document.createTextNode(J)}function v(J){return T8.call(J)}function s(J){return x8.call(J)}function k8(J,Q){if(!F)return v(J);var W=v(S);if(W===null)W=S.appendChild(p());else if(Q&&W.nodeType!==d7){var X=p();return W?.before(X),j(X),X}if(Q)aJ(W);return j(W),W}function A6(J,Q=!1){if(!F){var W=v(J);if(W instanceof Comment&&W.data==="")return s(W);return W}if(Q){if(S?.nodeType!==d7){var X=p();return S?.before(X),j(X),X}aJ(S)}return S}function D6(J,Q=!1){if(!F)return v(J);var W=k8(J,Q);return iJ(J),W}function I6(J,Q=1,W=!1){let X=F?S:J;var z;while(Q--)z=X,X=s(X);if(!F)return X;if(W){if(X?.nodeType!==d7){var Z=p();if(X===null)z?.after(Z);else X.before(Z);return j(Z),Z}aJ(X)}return j(X),X}function qJ(J){J.textContent=""}function sJ(){if(!r)return!1;if(h0!==null)return!1;var J=L.f;return(J&H0)!==0}function k0(J,Q,W){if(Q==null||Q===NJ)return W?document.createElement(J,{is:W}):document.createElement(J);return W?document.createElementNS(Q,J,{is:W}):document.createElementNS(Q,J)}function aJ(J){if(J.nodeValue.length<65536)return;let Q=J.nextSibling;while(Q!==null&&Q.nodeType===d7)Q.remove(),J.nodeValue+=Q.nodeValue,Q=J.nextSibling}var F=!1;function d(J){F=J}var S;function j(J){if(J===null)throw Y7(),i0;return S=J}function i(){return j(s(S))}function iJ(J){if(!F)return;if(s(S)!==null)throw Y7(),i0;S=J}function pQ(J=1){if(F){var Q=J,W=S;while(Q--)W=s(W);S=W}}function J7(J=!0){var Q=0,W=S;while(!0){if(W.nodeType===R0){var X=W.data;if(X===I7){if(Q===0)return W;Q-=1}else if(X===_7||X===H7||X[0]==="["&&!isNaN(Number(X.slice(1))))Q+=1}var z=s(W);if(J)W.remove();W=z}}function MJ(J){if(!J||J.nodeType!==R0)throw Y7(),i0;return J.data}var JJ=Symbol("events"),lQ=new Set,rJ=new Set;function E8(J,Q,W){(Q[JJ]??={})[J]=W}function b8(J){for(var Q=0;Q<J.length;Q++)lQ.add(J[Q]);for(var W of rJ)W(J)}var dQ=null,_Q=!1;function cQ(J){var Q=this,W=Q.ownerDocument,X=J.type,z=J.composedPath?.()||[],Z=z[0]||J.target;if(dQ=J,!_Q)_Q=!0,setTimeout(()=>{_Q=!1,dQ=null});var K=0,G=dQ===J&&J[JJ];if(G){var $=z.indexOf(G);if($!==-1&&(Q===document||Q===window)){J[JJ]=Q;return}var Y=z.indexOf(Q);if(Y===-1)return;if($<=Y)K=$}if(Z=z[K]||J.target,Z===Q)return;c(J,"currentTarget",{configurable:!0,get(){return Z||W}});var H=w,B=L;u(null),f(null);try{var U,P=[];while(Z!==null){if(Z===Q)break;try{var M=Z[JJ]?.[X];if(M!=null&&(!Z.disabled||J.target===Z))M.call(Z,J)}catch(O){if(U)P.push(O);else U=O}if(J.cancelBubble)break;K++,Z=K<z.length?z[K]:null}if(U){for(let O of P)queueMicrotask(()=>{throw O});throw U}}finally{J[JJ]=Q,delete J.currentTarget,u(H),f(B)}}var R6=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:(J)=>{return J}});function y8(J){return R6?.createHTML(J)??J}function iQ(J){var Q=k0("template");return Q.innerHTML=y8(J.replaceAll("<!>","<!---->")),Q.content}function N0(J,Q){var W=L;if(W.nodes===null)W.nodes={start:J,end:Q,a:null,t:null}}function x6(J,Q){var W=(Q&w4)!==0,X=(Q&C4)!==0,z,Z=!J.startsWith("<!>");return()=>{if(F)return N0(S,null),S;if(z===void 0){if(z=iQ(Z?J:"<!>"+J),!W)z=v(z)}var K=X||KJ?document.importNode(z,!0):z.cloneNode(!0);if(W){var G=v(K),$=K.lastChild;N0(G,$)}else N0(K,K);return K}}function k6(){if(F)return N0(S,null),S;var J=document.createDocumentFragment(),Q=document.createComment(""),W=p();return J.append(Q,W),N0(Q,W),J}function VJ(J,Q){if(F){var W=L;if((W.f&H0)===0||W.nodes.end===null)W.nodes.end=S;i();return}if(J===null)return;J.before(Q)}var E6=/\r/g;function h8(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 $2=[...b6,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var y6=["touchstart","touchmove"];function g8(J){return y6.includes(J)}var h6=["$state","$state.raw","$derived","$derived.by"],q2=[...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 nJ(J){return J?.replace(/\//g,"/​")}function v8(J){let Q=0,W=q0(0),X;if(q)G0(W,"createSubscriber version");return()=>{if(L7())I(W),J0(()=>{if(Q===0)X=h(()=>J(()=>y7(W)));return Q+=1,()=>{n(()=>{if(Q-=1,Q===0)X?.(),X=void 0,y7(W)})}})}}var g6=F0|c0;function sQ(J,Q,W,X){new m8(J,Q,W,X)}class m8{parent;is_pending=!1;transform_error;#J;#Q=F?S: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;#O=v8(()=>{if(this.#q=q0(this.#M),q)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=L;Z.b=this,Z.f|=p7,W(z)},this.parent=L.b,this.transform_error=X??this.parent?.transform_error??((z)=>z),this.#Z=S0(()=>{if(F){let z=this.#Q;i();let Z=z.data===H7;if(z.data.startsWith(UQ)){let G=JSON.parse(z.data.slice(UQ.length));this.#w(G)}else if(Z)this.#S();else this.#L()}else this.#H()},g6),F)this.#J=S}#L(){try{this.#K=a(()=>this.#G(this.#J))}catch(J){this.error(J)}}#w(J){let Q=this.#W.failed,{reset:W,invoke_onerror:X}=this.#C(J);if(n(X),!Q)return;this.#$=a(()=>{Q(this.#J,()=>J,()=>W)})}#C(J){var Q=!1,W=!1;let X=()=>{if(Q){T4();return}if(Q=!0,W)a4();if(this.#$!==null)e0(this.#$,()=>{this.#$=null});this.#Y(()=>{this.#H()})};return{reset:X,invoke_onerror:()=>{try{W=!0,this.#W.onerror?.(J,X),W=!1}catch(Z){w0(Z,this.#Z&&this.#Z.parent)}}}}#S(){let J=this.#W.pending;if(!J)return;this.is_pending=!0,this.#X=a(()=>J(this.#J)),n(()=>{var Q=this.#z=document.createDocumentFragment(),W=p(),X=!1;if(Q.append(W),this.#K=this.#Y(()=>{try{return a(()=>this.#G(W))}catch(z){try{this.error(z),X=!0}catch(Z){w0(Z,this.#Z.parent)}return null}}),this.#K===null){if(this.#z=null,X)this.#F(C);return}if(this.#P===0)this.#J.before(Q),this.#z=null,e0(this.#X,()=>{this.#X=null}),this.#F(C)})}#H(){try{if(this.is_pending=this.has_pending_snippet(),this.#P=0,this.#M=0,this.#K=a(()=>{this.#G(this.#J)}),this.#P>0){var J=this.#z=document.createDocumentFragment();e7(this.#K,J);let Q=this.#W.pending;this.#X=a(()=>Q(this.#J))}else this.#F(C)}catch(Q){this.error(Q)}}#F(J){this.is_pending=!1,J.transfer_effects(this.#B,this.#V)}defer_effect(J){uJ(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=L,W=w,X=A;f(this.#Z),u(this.#Z),K7(this.#Z.ctx);try{return K0.ensure(),J()}finally{f(Q),u(W),K7(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.#F(Q),this.#X)e0(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,n(()=>{if(this.#U=!1,this.#q)p0(this.#q,this.#M)})}get_effect_pending(){return this.#O(),I(this.#q)}error(J){if(!this.#W.onerror&&!this.#W.failed)throw J;if(C?.is_fork){if(this.#K)C.skip_effect(this.#K);if(this.#X)C.skip_effect(this.#X);if(this.#$)C.skip_effect(this.#$);C.oncommit(()=>{this.#A(J)})}else this.#A(J)}#A(J){if(this.#K)m(this.#K),this.#K=null;if(this.#X)m(this.#X),this.#X=null;if(this.#$)m(this.#$),this.#$=null;if(F)j(this.#Q),pQ(),j(J7());let Q=this.#W.failed,W=(X)=>{let{reset:z,invoke_onerror:Z}=this.#C(X);if(Z(),Q)this.#$=this.#Y(()=>{try{return a(()=>{var K=L;K.b=this,K.f|=p7,Q(this.#J,()=>X,()=>z)})}catch(K){return w0(K,this.#Z.parent),null}})};n(()=>{var X;try{X=this.transform_error(J)}catch(z){w0(z,this.#Z&&this.#Z.parent);return}if(X!==null&&typeof X==="object"&&typeof X.then==="function")X.then(W,(z)=>w0(z,this.#Z&&this.#Z.parent));else W(X)})}}var aQ=!0;function v6(J,Q){var W=Q==null?"":typeof Q==="object"?`${Q}`:Q;if(W!==(J[XJ]??=J.nodeValue))J[XJ]=W,J.nodeValue=`${W}`}function eJ(J,Q){return u8(J,Q)}function nQ(J,Q){oJ(),Q.intro=Q.intro??!1;let W=Q.target,X=F,z=S;try{var Z=v(W);while(Z&&(Z.nodeType!==R0||Z.data!==_7))Z=s(Z);if(!Z)throw i0;d(!0),j(Z);let K=u8(J,{...Q,anchor:Z});return d(!1),K}catch(K){if(K instanceof Error&&K.message.split(`
47
+ `).some((G)=>G.startsWith("https://svelte.dev/e/")))throw K;if(K!==i0)console.warn("Failed to hydrate: ",K);if(Q.recover===!1)_4();return oJ(),qJ(W),d(!1),eJ(J,Q)}finally{d(X),j(z)}}var tJ=new Map;function u8(J,{target:Q,anchor:W,props:X={},events:z,context:Z,intro:K=!0,transformError:G}){oJ();var $=void 0,Y=L8(()=>{var H=W??Q.appendChild(p());sQ(H,{pending:()=>{}},(P)=>{LQ({});var M=A;if(Z)M.c=Z;if(z)X.$$events=z;if(F)N0(P,null);if(aQ=K,$=J(P,X)||GJ(),aQ=!0,F){if(L.nodes.end=S,S===null||S.nodeType!==R0||S.data!==I7)throw Y7(),i0}FQ()},G);var B=new Set,U=(P)=>{for(var M=0;M<P.length;M++){var O=P[M];if(B.has(O))continue;B.add(O);var V=g8(O);for(let E of[Q,document]){var N=tJ.get(E);if(N===void 0)N=new Map,tJ.set(E,N);var k=N.get(O);if(k===void 0)E.addEventListener(O,cQ,{passive:V}),N.set(O,1);else N.set(O,k+1)}}};return U(l7(lQ)),rJ.add(U),()=>{for(var P of B)for(let V of[Q,document]){var M=tJ.get(V),O=M.get(P);if(--O==0){if(V.removeEventListener(P,cQ),M.delete(P),M.size===0)tJ.delete(V)}else M.set(P,O)}if(rJ.delete(U),H!==W)H.parentNode?.removeChild(H)}});return rQ.set($,Y),$}var rQ=new WeakMap;function tQ(J,Q){let W=rQ.get(J);if(W)return rQ.delete(J),W(Q);if(q)j4();return Promise.resolve()}var f8=new Map;function p8(J,Q){var W=f8.get(J);if(!W)W=new Set,f8.set(J,W);W.add(Q)}class $7{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)t7(W),this.#G.delete(Q);else{var X=this.#W.get(Q);if(X){if(t7(X.effect),this.#Q.set(Q,X.effect),this.#W.delete(Q),q)X.fragment.lastChild[$Q]=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)m(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();e7(Z,$),$.append(p()),this.#W.set(z,{effect:Z,fragment:$})}else m(Z);this.#G.delete(z),this.#Q.delete(z)};if(this.#Z||!W)this.#G.add(z),e0(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))m(X.effect),this.#W.delete(W)};ensure(J,Q){var W=C,X=sJ();if(Q&&!this.#Q.has(J)&&!this.#W.has(J))if(X){var z=document.createDocumentFragment(),Z=p();z.append(Z),this.#W.set(J,{effect:a(()=>Q(Z)),fragment:z})}else this.#Q.set(J,a(()=>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=S;this.#K(W)}}}function f6(J,Q,W=!1){var X;if(F)X=S,i();var z=new $7(J),Z=W?F0:0;function K(G,$){if(F){var Y=MJ(X);if(G!==parseInt(Y.substring(1))){var H=J7();j(H),z.anchor=H,d(!1),z.ensure(G,$),d(!0);return}}z.ensure(G,$)}S0(()=>{var G=!1;if(Q(($,Y=0)=>{G=!0,K(Y,$)}),!G)K(-1,null)},Z)}var p6=Symbol("NaN");function d6(J,Q,W){if(F)i();var X=new $7(J),z=!u0();S0(()=>{var Z=Q();if(Z!==Z)Z=p6;if(z&&Z!==null&&typeof Z==="object")Z={};X.ensure(Z,W)})}function _6(J,Q,W){var X=[],z=Q.length,Z,K=Q.length;for(var G=0;G<z;G++){let B=Q[G];e0(B,()=>{if(Z){if(Z.pending.delete(B),Z.done.add(B),Z.pending.size===0){var U=J.outrogroups;if(eQ(J,l7(Z.done)),U.delete(Z),U.size===0)J.outrogroups=null}}else K-=1},!1)}if(K===0){var $=X.length===0&&W!==null&&J.pending.size===0;if($){var Y=W,H=Y.parentNode;qJ(H),H.append(Y),J.items.clear()}eQ(J,Q,!$)}else Z={pending:new Set(Q),done:new Set},(J.outrogroups??=new Set).add(Z)}function eQ(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|=v0;let K=document.createDocumentFragment();e7(Z,K)}else m(Q[z],W)}}var _8;function l6(J,Q,W,X,z,Z=null){var K=J,G=new Map,$=(Q&PQ)!==0;if($){var Y=J;K=F?j(v(Y)):Y.appendChild(p())}if(F)i();var H=null,B=x7(()=>{var E=W();return Z7(E)?E:E==null?[]:l7(E)});if(q)G0(B,"{#each ...}");var U,P=new Map,M=!0;function O(E){if((k.effect.f&g)!==0)return;if(k.pending.delete(E),k.fallback=H,c6(k,U,K,Q,X),H!==null)if(U.length===0)if((H.f&v0)===0)t7(H);else H.f^=v0,FJ(H,null,K);else e0(H,()=>{H=null})}function V(E){k.pending.delete(E)}var N=S0(()=>{U=I(B);var E=U.length;let D=!1;if(F){var E0=MJ(K)===H7;if(E0!==(E===0))K=J7(),j(K),d(!1),D=!0}var U0=new Set,A0=C,u7=sJ();for(var _0=0;_0<E;_0+=1){if(F&&S.nodeType===R0&&S.data===I7)K=S,D=!0,d(!1);var g0=U[_0],f7=X(g0,_0);if(q){var G4=X(g0,_0);if(f7!==G4)m4(String(_0),String(f7),String(G4))}var Q7=M?null:G.get(f7);if(Q7){if(Q7.v)p0(Q7.v,g0);if(Q7.i)p0(Q7.i,_0);if(u7)A0.unskip_effect(Q7.e)}else{if(Q7=i6(G,M?K:_8??=p(),g0,f7,_0,z,Q,W),!M)Q7.e.f|=v0;G.set(f7,Q7)}U0.add(f7)}if(E===0&&Z&&!H)if(M)H=a(()=>Z(K));else H=a(()=>Z(_8??=p())),H.f|=v0;if(E>U0.size)if(q)o6(U,X);else VQ("","","");if(F&&E>0)j(J7());if(!M)if(P.set(A0,U0),u7){for(let[Z6,K6]of G)if(!U0.has(Z6))A0.skip_effect(K6.e);A0.oncommit(O),A0.ondiscard(V)}else O(A0);if(D)d(!0);I(B)}),k={effect:N,flags:Q,items:G,pending:P,outrogroups:null,fallback:H};if(M=!1,F)K=S}function LJ(J){while(J!==null&&(J.f&o)===0)J=J.next;return J}function c6(J,Q,W,X,z){var Z=(X&H4)!==0,K=Q.length,G=J.items,$=LJ(J.effect.first),Y,H=null,B,U=[],P=[],M,O,V,N;if(Z){for(N=0;N<K;N+=1)if(M=Q[N],O=z(M,N),V=G.get(O).e,(V.f&v0)===0)V.nodes?.a?.measure(),(B??=new Set).add(V)}for(N=0;N<K;N+=1){if(M=Q[N],O=z(M,N),V=G.get(O).e,J.outrogroups!==null)for(let g0 of J.outrogroups)g0.pending.delete(V),g0.done.delete(V);if((V.f&l)!==0){if(t7(V),Z)V.nodes?.a?.unfix(),(B??=new Set).delete(V)}if((V.f&v0)!==0)if(V.f^=v0,V===$)FJ(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;S7(J,H,V),S7(J,V,k),FJ(V,k,W),H=V,U=[],P=[],$=LJ(H.next);continue}if(V!==$){if(Y!==void 0&&Y.has(V)){if(U.length<P.length){var E=P[0],D;H=E.prev;var E0=U[0],U0=U[U.length-1];for(D=0;D<U.length;D+=1)FJ(U[D],E,W);for(D=0;D<P.length;D+=1)Y.delete(P[D]);S7(J,E0.prev,U0.next),S7(J,H,E0),S7(J,U0,E),$=E,H=U0,N-=1,U=[],P=[]}else Y.delete(V),FJ(V,$,W),S7(J,V.prev,V.next),S7(J,V,H===null?J.effect.first:H.next),S7(J,H,V),H=V;continue}U=[],P=[];while($!==null&&$!==V)(Y??=new Set).add($),P.push($),$=LJ($.next);if($===null)continue}if((V.f&v0)===0)U.push(V);H=V,$=LJ(V.next)}if(J.outrogroups!==null){for(let g0 of J.outrogroups)if(g0.pending.size===0)eQ(J,l7(g0.done)),J.outrogroups?.delete(g0);if(J.outrogroups.size===0)J.outrogroups=null}if($!==null||Y!==void 0){var A0=[];if(Y!==void 0){for(V of Y)if((V.f&l)===0)A0.push(V)}while($!==null){if(($.f&l)===0&&$!==J.fallback)A0.push($);$=LJ($.next)}var u7=A0.length;if(u7>0){var _0=(X&PQ)!==0&&K===0?W:null;if(Z){for(N=0;N<u7;N+=1)A0[N].nodes?.a?.measure();for(N=0;N<u7;N+=1)A0[N].nodes?.a?.fix()}_6(J,A0,_0)}}if(Z)n(()=>{if(B===void 0)return;for(V of B)V.nodes?.a?.apply()})}function i6(J,Q,W,X,z,Z,K,G){var $=(K&U4)!==0?(K&Y4)===0?b7(W,!1,!1):q0(W):null,Y=(K&B4)!==0?q0(z):null;if(q&&$)$.trace=()=>{G()[Y?.v??z]};return{v:$,i:Y,e:a(()=>{return Z(Q,$??W,Y??z,G),()=>{J.delete(X)}})}}function FJ(J,Q,W){if(!J.nodes)return;var X=J.nodes.start,z=J.nodes.end,Z=Q&&(Q.f&v0)===0?Q.nodes.start:W;while(X!==null){var K=s(X);if(Z.before(X),X===z)return;X=K}}function S7(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 o6(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;VQ(K,G,$)}W.set(Z,z)}}function s6(J,Q,W){if(!Q||Q===h8(String(W??"")))return;let X,z=J.__svelte_meta?.loc;if(z)X=`near ${z.file}:${z.line}:${z.column}`;else if(j0?.[O0])X=`in ${j0[O0]}`;R4(nJ(X))}function a6(J,Q,W=!1,X=!1,z=!1,Z=!1){var K=J,G="";if(W){var $=J;if(F)K=j(v($))}gQ(()=>{var Y=L;if(G===(G=Q()??"")){if(F)i();return}if(W&&!F){if(Y.nodes=null,$.innerHTML=G,G!=="")N0(v($),$.lastChild);return}if(Y.nodes!==null)mQ(Y.nodes.start,Y.nodes.end),Y.nodes=null;if(G==="")return;if(F){var H=S.data,B=i(),U=B;while(B!==null&&(B.nodeType!==R0||B.data!==""))U=B,B=s(B);if(B===null)throw Y7(),i0;if(q&&!Z)s6(B.parentNode,H,G);N0(S,U),K=j(B);return}var P=X?zJ:z?BQ:void 0,M=k0(X?"svg":z?"math":"template",P);M.innerHTML=G;var O=X||z?M:M.content;if(N0(v(O),O.lastChild),X||z)while(v(O))K.before(v(O));else K.before(O)})}function r6(J,Q,W,X,z){if(F)i();if(Q.$$host?.$$shadowRoot){let G=k0("slot");if(W!=="default")G.name=W;if(VJ(J,G),z!==null){let $=p();G.append($),z($)}return}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 Q1(J,Q){L0(()=>{J=L?.parent?.nodes?.start??J;var W=J.getRootNode(),X=W.host?W:W.head??W.ownerDocument.head;if(!X.querySelector("#"+Q.hash)){let z=k0("style");if(z.id=Q.hash,z.textContent=Q.code,X.appendChild(z),q)p8(Q.hash,z)}})}function W1(J,Q,W){L0(()=>{var X=h(()=>Q(J,W?.())||{});if(W&&X?.update){var z=!1,Z={};J0(()=>{var K=W();if(lJ(K),z&&xJ(Z,K))Z=K,X.update(K)}),z=!0}if(X?.destroy)return()=>X.destroy()})}var l8=[...`
48
+ \r\f \v\uFEFF`];function c8(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||l8.includes(X[K-1]))&&(G===X.length||l8.includes(X[G])))X=(K===0?"":X.substring(0,K))+X.substring(G+1);else K=G}}}return X===""?null:X}function i8(J,Q,W,X,z,Z){var K=J[WJ];if(F||K!==W||K===void 0){var G=c8(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[WJ]=W}else if(Z&&z!==Z)for(var $ in Z){var Y=!!Z[$];if(z==null||Y!==!!z[$])J.classList.toggle($,Y)}return Z}var Y1=Symbol("class"),M1=Symbol("style"),V1=Symbol("is custom element"),L1=Symbol("is html"),F1=qQ?"link":"LINK";function a8(J,Q,W,X){var z=w1(J);if(F){if(z[Q]=J.getAttribute(Q),Q==="src"||Q==="srcset"||Q==="href"&&J.nodeName===F1){if(!X)C1(J,Q,W??"");return}}if(z[Q]===(z[Q]=W))return;if(Q==="loading")J[P4]=W;if(W==null)J.removeAttribute(Q);else if(typeof W!=="string"&&r8(J).has(Q))J[Q]=W;else J.setAttribute(Q,W)}function O1(J,Q,W){var X=w,z=L;let Z=F;if(F)d(!1);u(null),f(null);try{if(Q!=="style"&&(J4.has(J.getAttribute("is")||J.nodeName)||!customElements||customElements.get(J.getAttribute("is")||J.nodeName.toLowerCase())?r8(J).has(Q):W&&typeof W==="object"))J[Q]=W;else a8(J,Q,W==null?W:String(W))}finally{if(u(X),f(z),Z)d(!0)}}function w1(J){return J[SJ]??={[V1]:J.nodeName.includes("-"),[L1]:J.namespaceURI===NJ}}var J4=new Map;function r8(J){var Q=J.getAttribute("is")||J.nodeName,W=J4.get(Q);if(W)return W;J4.set(Q,W=new Set);var X,z=J,Z=Element.prototype;while(Z!==z){X=DJ(z);for(var K in X)if(X[K].set&&K!=="innerHTML"&&K!=="textContent"&&K!=="innerText")W.add(K);z=R7(z)}return W}function C1(J,Q,W){if(!q)return;if(Q==="srcset"&&S1(J,W))return;if(Q4(J.getAttribute(Q)??"",W))return;I4(Q,J.outerHTML.replace(J.innerHTML,J.innerHTML&&"..."),String(W))}function Q4(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 S1(J,Q){var W=o8(J.srcset),X=o8(Q);return X.length===W.length&&X.every(([z,Z],K)=>Z===W[K][1]&&(Q4(W[K][0],z)||Q4(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 W4(J,Q){return J===Q||J?.[X0]===Q}function N1(J=GJ(),Q,W,X){var z=A.r,Z=L;return L0(()=>{var K,G;return J0(()=>{K=G,G=X?.()||[],h(()=>{if(!W4(W(...G),J)){if(Q(J,...G),K&&W4(W(...K),J))Q(null,...K)}})}),()=>{let $=Z;while($!==z&&$.parent!==null&&$.parent.f&U7)$=$.parent;let Y=()=>{if(G&&W4(W(...G),J))Q(null,...G)},H=$.teardown;$.teardown=()=>{Y(),H?.()}}}),J}function A1(J,Q,W,X){var z=!V7||(W&V4)!==0,Z=(W&F4)!==0,K=(W&O4)!==0,G=X,$=!0,Y=void 0,H=()=>{if(K&&z)return Y??=F7(X),I(Y);if($)$=!1,G=K?h(X):X;return G};let B;if(Z){var U=X0 in J||QJ in J;B=Y0(J,Q)?.set??(U&&Q in J?(D)=>J[Q]=D:void 0)}var P,M=!1;if(Z)[P,M]=RQ(()=>J[Q]);else P=J[Q];if(P===void 0&&X!==void 0){if(P=H(),B){if(z)l4(Q);B(P)}}var O;if(z)O=()=>{var D=J[Q];if(D===void 0)return H();return $=!0,D};else O=()=>{var D=J[Q];if(D!==void 0)G=void 0;return D===void 0?G:D};if(z&&(W&L4)===0)return O;if(B){var V=J.$$legacy;return function(D,E0){if(arguments.length>0){if(!z||!E0||V||M)B(E0?O():D);return D}return O()}}var N=!1,k=((W&M4)!==0?F7:x7)(()=>{return N=!1,O()});if(q)k.label=Q;if(Z)I(k);var E=L;return function(D,E0){if(arguments.length>0){let U0=E0?I(k):z&&Z?G7(D):D;if(P0(k,U0),N=!0,G!==void 0)G=U0;return D}if(T0&&N||(E.f&g)!==0)return k.v;return I(k)}}function t8(J){return new e8(J)}class e8{#J;#Q;constructor(J){var Q=new Map,W=(z,Z)=>{var K=b7(Z,!1,!1);return Q.set(z,K),K};let X=new Proxy({...J.props||{},$$events:{}},{get(z,Z){return I(Q.get(Z)??W(Z,Reflect.get(z,Z)))},has(z,Z){if(Z===QJ)return!0;return I(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?nQ:eJ)(J.component,{target:J.target,anchor:J.anchor,props:X,context:J.context,intro:J.intro??!1,recover:J.recover,transformError:J.transformError}),!r&&(!J?.props?.$$host||J.sync===!1))n7();this.#J=X.$$events;for(let z of Object.keys(this.#Q)){if(z==="$set"||z==="$destroy"||z==="$on")continue;c(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=()=>{tQ(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=k0("slot");if(X!=="default")Z.name=X;VJ(z,Z)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let Q={},W=E1(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]=QQ(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=hQ(()=>{J0(()=>{this.$$r=!0;for(let X of ZJ(this.$$c)){if(!this.$$p_d[X]?.reflect)continue;this.$$d[X]=this.$$c[X];let z=QQ(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]=QQ(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 ZJ(this.$$p_d).find((Q)=>this.$$p_d[Q].attribute===J||!this.$$p_d[Q].attribute&&Q.toLowerCase()===J)||J}};function QQ(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 E1(J){let Q={};return J.childNodes.forEach((W)=>{Q[W.slot||"default"]=!0}),Q}function b1(J,Q,W,X,z,Z){let K=class extends J6{constructor(){super(J,W,z);this.$$p_d=Q}static get observedAttributes(){return ZJ(Q).map((G)=>(Q[G].attribute||G).toLowerCase())}};if(ZJ(Q).forEach((G)=>{c(K.prototype,G,{get(){return this.$$c&&G in this.$$c?this.$$c[G]:this.$$d[G]},set($){$=QQ(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)=>{c(K.prototype,G,{get(){return this.$$c?.[G]}})}),Z)K=Z(K);return J.element=K,K}if(q){let J=function(Q){if(!(Q in globalThis)){let W;Object.defineProperty(globalThis,Q,{configurable:!0,get:()=>{if(W!==void 0)return W;c4(Q)},set:(X)=>{W=X}})}};J("$state"),J("$effect"),J("$derived"),J("$inspect"),J("$props"),J("$bindable")}import{createContext as WQ}from"@pie-players/pie-context";var Q6=WQ(Symbol.for("pie.assessmentToolkit.runtimeContext")),W6=WQ(Symbol.for("pie.assessmentToolkit.hostRuntimeContext")),X6=WQ(Symbol.for("pie.assessmentToolkit.shellContext")),y1=WQ(Symbol.for("pie.assessmentToolkit.regionScopeContext"));import{ContextConsumer as h1}from"@pie-players/pie-context";function z4(J,Q,W){let X=!1,z=new h1(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 SH(J,Q){return z4(J,Q6,Q)}function NH(J,Q){return z4(J,W6,Q)}function AH(J,Q){return z4(J,X6,Q)}var XQ={assessment:[],section:[],item:[],passage:[],rubric:[],element:[]};var Z4={section:[...XQ.section],item:[...XQ.item],passage:[...XQ.passage]};function m7(J){return typeof J==="object"&&J!==null&&!Array.isArray(J)}function N7(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 g1(J){if(J==null)return;if(!m7(J))throw Error('Invalid tools config at "placement": expected an object with section/item/passage arrays.');return J}function v1(J){if(J==null)return;if(!m7(J))throw Error('Invalid tools config at "policy": expected an object with allowed/blocked arrays.');return J}function m1(J,Q){if(Q==null)return;if(!m7(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&&!m7(W.settings))throw Error(`Invalid tools config at "providers.${J}.settings": expected an object.`);if("provider"in W&&W.provider!==void 0&&!m7(W.provider)&&!(J==="textToSpeech"&&X(W.provider)))throw Error(`Invalid tools config at "providers.${J}.provider": expected an object.`);return W}function u1(J){if(J==null)return{};if(!m7(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]=m1(W,X);return Q}function K4(J){let Q=J.trim();if(!Q)return"";return Q}function q7(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=K4(W);if(!X)continue;Q.add(X)}return Array.from(Q)}function jH(J){if(!J)return[];return q7(J.split(",").map((Q)=>Q.trim()).filter(Boolean))}function f1(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 TH(J){if(J!=null&&!m7(J))throw Error('Invalid tools config: expected an object with "policy", "placement", and "providers".');let Q=v1(J?.policy),W=g1(J?.placement),X=u1(J?.providers),z=f1(J?.pnpEnforcement,"pnpEnforcement"),Z={policy:{allowed:q7(N7(Q?.allowed,"policy.allowed")),blocked:q7(N7(Q?.blocked,"policy.blocked"))},placement:{section:q7(N7(W?.section,"placement.section")).length?q7(N7(W?.section,"placement.section")):[...Z4.section],item:q7(N7(W?.item,"placement.item")).length?q7(N7(W?.item,"placement.item")):[...Z4.item],passage:q7(N7(W?.passage,"placement.passage")).length?q7(N7(W?.passage,"placement.passage")):[...Z4.passage]},providers:X};if(z)Z.pnpEnforcement=z;return Z}import{dynamicMessageKey as EH}from"@pie-players/pie-players-shared/i18n/provider";var p1=["assessment","section","item","passage","rubric","element"];function zQ(J,Q){if(typeof J!=="string"||J.trim().length===0)throw Error(`Invalid tool registration: "${Q}" must be a non-empty string.`)}var d1=[{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 _1(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 d1)if(G.test(Q))throw Error(`Invalid tool registration "${J}": "${W}" ${$}. Inline SVG icons must not include scriptable content.`)}function z6(J){zQ(J.toolId,"toolId"),zQ(J.name,"name"),zQ(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")_1(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)=>!p1.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.isApplicableToContent!==void 0&&typeof J.isApplicableToContent!=="function")throw Error(`Invalid tool registration "${J.toolId}": "isApplicableToContent" 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 l1{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 K4(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}isApplicableToAnyContext(J,Q){let W=this.get(J);if(!W?.isApplicableToContent)return!0;if(Q.length===0)return!0;return Q.some((X)=>{try{return W.isApplicableToContent?.(X)??!0}catch(z){return console.error(`Error evaluating applicability for tool '${J}':`,z),!0}})}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(zQ(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||{}}})}}
49
+ export{c1 as b,iJ as c,LQ as d,FQ as e,H6 as f,n7 as g,n0 as h,P0 as i,G7 as j,k8 as k,A6 as l,D6 as m,I6 as n,yQ as o,gQ as p,I as q,h as r,E8 as s,b8 as t,x6 as u,k6 as v,VJ as w,v6 as x,f6 as y,d6 as z,l6 as A,a6 as B,r6 as C,Q1 as D,W1 as E,i8 as F,a8 as G,O1 as H,N1 as I,A1 as J,b1 as K,Q6 as L,W6 as M,SH as N,NH as O,AH as P,q7 as Q,jH as R,TH as S,l1 as T};
@@ -226,7 +226,11 @@ export declare class HighlightCoordinator implements HighlightCoordinatorApi {
226
226
  */
227
227
  updateTTSHighlightStyle(color: string, opacity: number): void;
228
228
  /**
229
- * Cleanup - remove all highlights
229
+ * Cleanup this coordinator's highlights and observer.
230
+ *
231
+ * The stylesheet is process-global and shared by every live coordinator, so
232
+ * removing it here would break a replacement or sibling coordinator. Keep the
233
+ * single bounded style element installed for the lifetime of the document.
230
234
  */
231
235
  destroy(): void;
232
236
  }
@@ -900,20 +900,17 @@ export class HighlightCoordinator {
900
900
  this.applyAdaptiveTTSStyle();
901
901
  }
902
902
  /**
903
- * Cleanup - remove all highlights
903
+ * Cleanup this coordinator's highlights and observer.
904
+ *
905
+ * The stylesheet is process-global and shared by every live coordinator, so
906
+ * removing it here would break a replacement or sibling coordinator. Keep the
907
+ * single bounded style element installed for the lifetime of the document.
904
908
  */
905
909
  destroy() {
906
910
  if (!this.supported)
907
911
  return;
908
912
  this.clearTTS();
909
913
  this.clearAnnotations();
910
- // Remove style element
911
- if (typeof document !== "undefined") {
912
- const styleEl = document.getElementById("pie-highlight-styles");
913
- if (styleEl) {
914
- styleEl.remove();
915
- }
916
- }
917
914
  this.themeObserver?.disconnect();
918
915
  this.themeObserver = null;
919
916
  }
@@ -116,6 +116,20 @@ export interface ResolvedToolContext {
116
116
  export interface ToolRenderElement {
117
117
  element: HTMLElement | null;
118
118
  mount: "before-buttons" | "after-buttons" | "controls-row";
119
+ /**
120
+ * Which box the element is appended to. `mount` places it among the toolbar's
121
+ * own regions; this chooses the box it is positioned against.
122
+ *
123
+ * `"toolbar"` (the default) leaves it in the toolbar, whose element is the
124
+ * containing block for anything absolutely positioned inside it.
125
+ * `"content-boundary"` appends it to the nearest element the host marked with
126
+ * `data-pie-tool-overlay-boundary` — the content a tool was placed on. An
127
+ * element that draws its own surface over that content and computes its own
128
+ * coordinates needs the content's box as its frame, and the toolbar's box is a
129
+ * header-sized one. When the host declares no boundary the element stays in
130
+ * the toolbar.
131
+ */
132
+ container?: "toolbar" | "content-boundary";
119
133
  layoutHints?: {
120
134
  controlsRow?: {
121
135
  reserveSpace?: boolean;
@@ -323,7 +323,8 @@ export declare class ToolkitCoordinator {
323
323
  private readonly toolRequests;
324
324
  private readonly sectionControllers;
325
325
  private readonly sectionControllerKeys;
326
- private readonly sectionControllerInitPromises;
326
+ private readonly sectionControllerInitEntries;
327
+ private readonly sectionControllerDisposePromises;
327
328
  private readonly sectionPersistenceStrategies;
328
329
  private readonly sectionControllerLifecycleListeners;
329
330
  /**
@@ -356,14 +357,10 @@ export declare class ToolkitCoordinator {
356
357
  private readonly telemetryListeners;
357
358
  private readonly frameworkErrorBus;
358
359
  private readonly ownsFrameworkErrorBus;
360
+ private frameworkErrorHookUnsubscribe;
361
+ private disposePromise;
359
362
  /**
360
- * Unified Tool Policy Engine. Owned by the coordinator and lives
361
- * for the lifetime of the coordinator instance — there is no
362
- * explicit teardown path today; the engine and its listener set
363
- * are reclaimed by GC when the coordinator becomes unreachable.
364
- * Subscribers attached via {@link onPolicyChange} must therefore
365
- * detach via the unsubscribe function the engine returns; do not
366
- * rely on a `disposed` event being emitted on coordinator teardown.
363
+ * Unified Tool Policy Engine. Owned by the coordinator and disposed with it.
367
364
  *
368
365
  * Hosts read decisions via {@link decideToolPolicy} or subscribe
369
366
  * to changes via {@link onPolicyChange}.
@@ -409,6 +406,7 @@ export declare class ToolkitCoordinator {
409
406
  private reportedUnboundFeaturePolicy;
410
407
  private static resolveConfig;
411
408
  constructor(config: ToolkitCoordinatorConfig);
409
+ private assertNotDisposed;
412
410
  /**
413
411
  * Subscribe the canonical `onFrameworkError` hook adapter to the
414
412
  * framework-error bus.
@@ -572,6 +570,10 @@ export declare class ToolkitCoordinator {
572
570
  private resolveExistingSectionController;
573
571
  private createSectionControllerContext;
574
572
  private initializeNewSectionController;
573
+ private createSectionControllerRetirementError;
574
+ private retireUnpublishedSectionControllerIfNeeded;
575
+ private cleanupUnpublishedSectionController;
576
+ private retirePublishedSectionControllerIfNeeded;
575
577
  private finalizeSectionControllerReady;
576
578
  private handleSectionControllerInitError;
577
579
  disposeSectionController(args: {
@@ -580,8 +582,18 @@ export declare class ToolkitCoordinator {
580
582
  persistBeforeDispose?: boolean;
581
583
  clearPersistence?: boolean;
582
584
  }): Promise<void>;
585
+ private trackSectionControllerDisposal;
586
+ private disposeSectionControllerEntry;
583
587
  private runSectionControllerDisposePipeline;
584
588
  private finalizeSectionControllerDispose;
589
+ /**
590
+ * Release every resource whose lifetime is owned by this coordinator.
591
+ * Borrowed constructor inputs, including a host framework-error bus and tool
592
+ * registry, remain owned by their caller.
593
+ */
594
+ dispose(): Promise<void>;
595
+ private disposeOwnedResources;
596
+ private waitForAdmittedInitialization;
585
597
  /**
586
598
  * Initialize TTS service with provider
587
599
  */
@@ -681,11 +693,9 @@ export declare class ToolkitCoordinator {
681
693
  * that want the new visible tool set should call
682
694
  * {@link decideToolPolicy} with their level / scope.
683
695
  *
684
- * Note: the engine itself can also emit `reason: "disposed"`, but
685
- * the coordinator does not dispose its engine on teardown today,
686
- * so subscribers attached via this method will not observe that
687
- * reason. Detach via the returned unsubscribe function instead of
688
- * relying on a `disposed` event.
696
+ * The owned engine emits `reason: "disposed"` during coordinator teardown.
697
+ * Callers should still detach through the returned unsubscribe function when
698
+ * their own lifetime ends before the coordinator's.
689
699
  */
690
700
  onPolicyChange(listener: ToolPolicyChangeListener): () => void;
691
701
  /**