@pie-players/pie-assessment-toolkit 1.0.0-beta.1 → 1.0.0-beta.2

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-asenkvx6.js";import"./chunks/ItemToolBar-hzc5wyjp.js";import{H as E,M as W,O as X,_ as w,aa as G,ba as Y,v as U,w as V,y as F}from"./chunks/ItemToolBar-3zrc4p3d.js";import"./chunks/ItemToolBar-kkj69ptr.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,""),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-wbem8cna.js";import"./chunks/ItemToolBar-341vf20n.js";import{H as E,M as W,O as X,_ as w,aa as G,ba as Y,v as U,w as V,y as F}from"./chunks/ItemToolBar-jpac75fa.js";import"./chunks/ItemToolBar-kkj69ptr.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,""),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,2 @@
1
+ import{ka as D,la as z}from"./ItemToolBar-jpac75fa.js";var S=["assessment","section","item","passage","rubric"],b=new Set(S);function _(q){return b.has(q)}function d(q,J,Q){let X=q.trim(),$=Q.trim();if(!X||!$)throw Error("Tool instance ids require non-empty tool and scope ids");if(!_(J))throw Error(`Unknown tool scope level '${J}'.`);return`${X}:${J}:${$}`}function R(q){let J=q.split(":");if(J.length!==3)return null;let[Q,X,$]=J;if(!Q||!$)return null;if(!_(X))return null;return{baseToolId:Q,scopeLevel:X,scopeId:$}}import{createPieLogger as h,isGlobalDebugEnabled as P}from"@pie-players/pie-players-shared/pie";var V=h("ToolCoordinator",P),O;(function(q){q[q.BASE=0]="BASE",q[q.TOOL=1000]="TOOL",q[q.MODAL=2000]="MODAL",q[q.CONTROL=3000]="CONTROL",q[q.HIGHLIGHT=4000]="HIGHLIGHT"})(O||(O={}));function k(q,J){if(!J?.baseId)return!0;return(R(q)?.baseToolId??q)===J.baseId}function C(q){return{id:q.id,name:q.name,isVisible:q.isVisible,element:q.element,layer:q.layer}}class N{tools=new Map;listeners=new Set;subscribe(q){return this.listeners.add(q),()=>{this.listeners.delete(q)}}notifyListeners(){for(let q of this.listeners)try{q()}catch(J){console.warn("[ToolCoordinator] listener failed:",J)}}registerTool(q,J,Q,X){V.debug("registerTool called:",{id:q,name:J,hasElement:!!Q,layer:X});let $=this.tools.get(q);if($){$.name=J;let Y=$.registered;if($.registered=!0,X!==void 0&&!$.layerDeclared)$.layer=X,$.layerDeclared=!0,this.stackOnTop($);else if(!Y)this.stackOnTop($)}else $={id:q,name:J,registered:!0,element:null,layer:X??O.TOOL,layerDeclared:X!==void 0,isVisible:!1,baseZIndex:0},this.tools.set(q,$),this.stackOnTop($);if(Q)this.updateToolElement(q,Q)}unregisterTool(q){let J=this.tools.get(q);if(!J?.registered)return;this.detachElement(J),J.registered=!1}releaseTool(q){let J=this.tools.get(q);if(!J)return;if(this.detachElement(J),this.tools.delete(q),J.isVisible)this.notifyListeners()}showTool(q){let J=this.tools.get(q);if(!J){V.debug(`Tool ${q} not found`);return}if(J.element)this.bringToFront(J.element);this.setVisible(J,!0)}hideTool(q){let J=this.tools.get(q);if(!J){V.debug(`Tool ${q} not found`);return}this.setVisible(J,!1)}toggleTool(q){let J=this.tools.get(q);if(!J){V.debug(`Tool ${q} not found`);return}if(J.isVisible)this.hideTool(q);else this.showTool(q)}isToolVisible(q){return this.tools.get(q)?.isVisible??!1}bringToFront(q){let J=Array.from(this.tools.values()).find((Q)=>Q.element===q);if(!J)return;this.stackOnTop(J)}destroy(){let q=Array.from(this.tools.values()).some((J)=>J.isVisible);for(let J of this.tools.values())this.detachElement(J);if(this.tools.clear(),q)this.notifyListeners();this.listeners.clear()}setVisible(q,J){if(q.isVisible===J)return;q.isVisible=J,this.notifyListeners()}detachElement(q){if(q.element&&q.mouseDownHandler)q.element.removeEventListener("mousedown",q.mouseDownHandler);q.element=null,q.mouseDownHandler=void 0}stackOnTop(q){let J=Array.from(this.tools.values()).filter((X)=>X.registered&&X.layer===q.layer&&X!==q).sort((X,$)=>X.baseZIndex-$.baseZIndex),Q=q.layer+J.length+1;if(q.baseZIndex===Q&&J.every((X)=>X.baseZIndex<Q))return;[...J,q].forEach((X,$)=>{if(X.baseZIndex=q.layer+1+$,X.element)X.element.style.zIndex=String(X.baseZIndex)})}updateToolElement(q,J){let Q=this.tools.get(q);if(!Q?.registered){V.debug(`Tool ${q} not found`);return}if(Q.element===J)return;if(Q.element?.isConnected&&Q.element.contains(J))return;this.detachElement(Q);let X=()=>this.bringToFront(J);if(J.addEventListener("mousedown",X),Q.element=J,Q.mouseDownHandler=X,J.style.zIndex=String(Q.baseZIndex),Q.isVisible)this.bringToFront(J)}hideAllTools(q){let J=!1;for(let Q of this.tools.values()){if(!Q.isVisible||!k(Q.id,q))continue;Q.isVisible=!1,J=!0}if(J)this.notifyListeners()}getToolState(q){let J=this.tools.get(q);return J?.registered?C(J):void 0}getVisibleTools(q){return Array.from(this.tools.values()).filter((J)=>J.isVisible&&k(J.id,q)).map(C)}}import{dynamicMessageKey as t}from"@pie-players/pie-players-shared/i18n/provider";import{settleAll as f}from"@pie-players/pie-players-shared/promise";import{validateCustomElementTag as T}from"@pie-players/pie-players-shared/pie/tag-names";var E=(q,J)=>{let Q=J?.toolTagMap?.[q];if(Q===void 0&&!q.includes("-"))throw Error(`No element tag is mapped for tool "${q}". Install a tag map on the registry via setComponentOverrides({ toolTagMap }) — for the packaged capabilities, PACKAGED_TOOL_TAG_MAP from "@pie-players/pie-default-tool-loaders".`);return T(Q??q,`tool component tag for "${q}"`)};var w=(q,J,Q)=>console.error(`[ToolRegistry] Tool '${q}' ${J} check threw:`,Q);var x=["assessment","section","item","passage","rubric","element"];function G(q,J){if(typeof q!=="string"||q.trim().length===0)throw Error(`Invalid tool registration: "${J}" must be a non-empty string.`)}var L=[{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 p(q,J,Q){let X=J.trimStart(),$=X.toLowerCase().startsWith("<svg"),Y=/^https?:/i.test(X);if(/^data:/i.test(X))throw Error(`Invalid tool registration "${q}": "${Q}" may not be a data: URL.`);if(!$&&!Y)return;for(let{pattern:H,reason:W}of L)if(H.test(J))throw Error(`Invalid tool registration "${q}": "${Q}" ${W}. Inline SVG icons must not include scriptable content.`)}function Z(q){G(q.toolId,"toolId"),G(q.name,"name"),G(q.description,"description");let J=q.activation==="region";if(!J||q.icon!==void 0){if(typeof q.icon!=="string"&&typeof q.icon!=="function")throw Error(`Invalid tool registration "${q.toolId}": "icon" must be a string or function.`)}if(typeof q.icon==="string")p(q.toolId,q.icon,"icon");if(!Array.isArray(q.supportedLevels)||q.supportedLevels.length===0)throw Error(`Invalid tool registration "${q.toolId}": "supportedLevels" must be a non-empty array.`);let Q=q.supportedLevels.find((X)=>!x.includes(X));if(Q)throw Error(`Invalid tool registration "${q.toolId}": unsupported level "${Q}".`);if(q.activation!==void 0&&q.activation!=="toolbar-toggle"&&q.activation!=="selection-gateway"&&q.activation!=="region")throw Error(`Invalid tool registration "${q.toolId}": unsupported activation "${String(q.activation)}".`);if(q.surfaces!==void 0&&(!Array.isArray(q.surfaces)||q.surfaces.some((X)=>typeof X!=="string"||X.trim().length===0)))throw Error(`Invalid tool registration "${q.toolId}": "surfaces" must be an array of non-empty strings.`);if(J&&!q.surfaces?.length)throw Error(`Invalid tool registration "${q.toolId}": region tools must declare at least one host surface in "surfaces".`);if(J&&typeof q.renderSurface!=="function")throw Error(`Invalid tool registration "${q.toolId}": region tools must implement "renderSurface".`);if(q.resolvesWithoutGrant!==void 0&&typeof q.resolvesWithoutGrant!=="boolean")throw Error(`Invalid tool registration "${q.toolId}": "resolvesWithoutGrant" must be a boolean.`);if(q.resolvesWithoutGrant&&!q.requiresAuthoredContent)throw Error(`Invalid tool registration "${q.toolId}": "resolvesWithoutGrant" requires "requiresAuthoredContent".`);if(q.renderSurface!==void 0&&typeof q.renderSurface!=="function")throw Error(`Invalid tool registration "${q.toolId}": "renderSurface" must be a function.`);if(q.renderSurface&&!q.surfaces?.length)throw Error(`Invalid tool registration "${q.toolId}": "renderSurface" requires at least one entry in "surfaces".`);if(q.singletonScope!==void 0&&q.singletonScope!=="section")throw Error(`Invalid tool registration "${q.toolId}": unsupported singletonScope "${String(q.singletonScope)}".`);if(q.activation==="selection-gateway"&&q.singletonScope!=="section")throw Error(`Invalid tool registration "${q.toolId}": selection-gateway tools must declare singletonScope "section".`);if(q.activation!=="region"&&typeof q.isVisibleInContext!=="function")throw Error(`Invalid tool registration "${q.toolId}": "isVisibleInContext" must be a function.`);if(q.isVisibleInContext!==void 0&&typeof q.isVisibleInContext!=="function")throw Error(`Invalid tool registration "${q.toolId}": "isVisibleInContext" must be a function when present.`);if(q.isApplicableToContent!==void 0&&typeof q.isApplicableToContent!=="function")throw Error(`Invalid tool registration "${q.toolId}": "isApplicableToContent" must be a function when present.`);if(q.requiresAuthoredContent!==void 0){if(typeof q.requiresAuthoredContent!=="object"||q.requiresAuthoredContent===null||typeof q.requiresAuthoredContent.resolve!=="function")throw Error(`Invalid tool registration "${q.toolId}": "requiresAuthoredContent" must be an object with a "resolve" function.`)}if(q.renderToolbar!==void 0){if(typeof q.renderToolbar!=="function")throw Error(`Invalid tool registration "${q.toolId}": "renderToolbar" must be a function.`)}else if(!J)throw Error(`Invalid tool registration "${q.toolId}": "renderToolbar" must be a function.`)}class m{tools=new Map;componentOverrides={};watchedUndefinedToolElements=new Set;moduleLoaders=new Map;loadedToolModules=new Set;warnedLoaderReplacements=new Set;warnedUnregisteredAllowedTools=new Set;moduleLoadPromises=new Map;changeListeners=new Set;emitChange(q){for(let J of this.changeListeners)try{J(q)}catch(Q){console.warn("[ToolRegistry] change listener failed:",Q)}}onRegistryChange(q){this.changeListeners.add(q);let J=!0;return()=>{if(!J)return;J=!1,this.changeListeners.delete(q)}}normalizeToolId(q){return q.trim()}normalizeToolIds(q){return q.map((J)=>this.normalizeToolId(J))}register(q){if(Z(q),this.tools.has(q.toolId))throw Error(`Tool '${q.toolId}' is already registered`);this.tools.set(q.toolId,q),this.emitChange({kind:"register",toolIds:[q.toolId]})}override(q){if(Z(q),!this.tools.has(q.toolId))throw Error(`Cannot override non-existent tool '${q.toolId}'`);this.tools.set(q.toolId,q),this.emitChange({kind:"override",toolIds:[q.toolId]})}unregister(q){if(!this.tools.has(q))return;this.tools.delete(q),this.emitChange({kind:"unregister",toolIds:[q]})}get(q){return this.tools.get(q)}has(q){return this.tools.has(q)}getAllToolIds(){return Array.from(this.tools.keys())}getAllTools(){return Array.from(this.tools.values())}getToolsByLevel(q){return this.getAllTools().filter((J)=>J.supportedLevels.includes(q))}getToolActivation(q){return this.get(q)?.activation||"toolbar-toggle"}getToolSingletonScope(q){return this.get(q)?.singletonScope||null}getToolsBySurface(q){if(!q)return[];return this.getAllTools().filter((J)=>typeof J.renderSurface==="function"&&J.surfaces?.includes(q))}getContentDependentSupportIds(){return this.getAllTools().filter((q)=>q.requiresAuthoredContent).map((q)=>q.toolId).sort()}filterToolIdsByActivation(q,J){return q.filter((Q)=>this.getToolActivation(Q)===J)}filterVisibleInContext(q,J,Q=w){let X=[];for(let $ of q){let Y=this.get($);if(!Y){if(!this.warnedUnregisteredAllowedTools.has($))this.warnedUnregisteredAllowedTools.add($),console.warn(`Tool '${$}' is allowed but not registered`);continue}if(!Y.supportedLevels.includes(J.level))continue;try{if(Y.isVisibleInContext?.(J))X.push(Y)}catch(j){Q($,"tool-visibility",j)}}return X}isApplicableToAnyContext(q,J,Q=w){let X=this.get(q);if(!X?.isApplicableToContent)return!0;if(J.length===0)return!0;return J.some(($)=>{try{return X.isApplicableToContent?.($)??!0}catch(Y){return Q(q,"tool-applicability",Y),!0}})}filterDecidedToolIds(q,J,Q,X=w){let $=new Set,Y=[];for(let H of q){let W=this.normalizeToolId(H.toolId);if(!W)continue;if(H.required||H.alwaysAvailable)$.add(W);if(Y.includes(W))continue;if(!this.get(W)?.supportedLevels.includes(J))continue;Y.push(W)}if(J==="section")return Y;let j=new Set(Q.length===0?Y:Y.filter((H)=>$.has(H)));for(let H of Q){let W=Y.filter((U)=>!j.has(U));for(let U of this.filterVisibleInContext(W,H,X))j.add(U.toolId)}return Y.filter((H)=>j.has(H)&&this.isApplicableToAnyContext(H,Q,X))}getToolMetadata(){return this.getAllTools().map((q)=>({toolId:q.toolId,name:q.name,description:q.description,supportedLevels:q.supportedLevels,activation:q.activation||"toolbar-toggle",singletonScope:q.singletonScope||null,surfaces:q.surfaces||[],requiresAuthoredContent:Boolean(q.requiresAuthoredContent),contentDependencyDescription:q.requiresAuthoredContent?.description??null}))}clear(){let q=this.getAllToolIds();if(q.length===0)return;this.tools.clear(),this.emitChange({kind:"clear",toolIds:q})}setComponentOverrides(q){if(this.componentOverrides===q)return;this.componentOverrides=q,this.emitChange({kind:"component-overrides",toolIds:[]})}setToolModuleLoaders(q){let J=Object.entries(q).filter((X)=>X[1]!==void 0);for(let[X,$]of J)if(G(X,"tool module loader id"),typeof $!=="function")throw Error(`Invalid tool module loader for "${X}": expected a function.`);let Q=[];for(let[X,$]of J){if(this.moduleLoaders.get(X)===$)continue;if(this.loadedToolModules.has(X)||this.moduleLoadPromises.has(X)){this.warnLoaderReplacedAfterLoad(X);continue}this.moduleLoaders.set(X,$),Q.push(X)}if(Q.length>0)this.emitChange({kind:"module-loaders",toolIds:Q})}warnLoaderReplacedAfterLoad(q){if(this.warnedLoaderReplacements.has(q))return;this.warnedLoaderReplacements.add(q),console.warn(`[ToolRegistry] Ignored a new module loader for "${q}": its module already loaded, so the elements it defines stay in place. Register loaders before the tool first renders.`)}async ensureToolModuleLoaded(q){if(this.loadedToolModules.has(q))return;let J=this.moduleLoadPromises.get(q);if(J){await J;return}let Q=this.moduleLoaders.get(q);if(!Q){this.watchUndefinedToolElement(q);return}let X=(async()=>{await Q(),this.loadedToolModules.add(q),this.warnIfLoadedToolElementUndefined(q)})();this.moduleLoadPromises.set(q,X);try{await X}finally{this.moduleLoadPromises.delete(q)}}undefinedToolElementTag(q){if(typeof customElements>"u"||typeof document>"u")return null;let J=this.componentOverrides;if(J.toolComponentFactories?.[q])return null;let Q;try{Q=E(q,J)}catch{return null}return customElements.get(Q)?null:Q}warnIfLoadedToolElementUndefined(q){let J=this.undefinedToolElementTag(q);if(!J)return;z(document,`loadedToolElementUndefined.${q}.${J}`,`[ToolRegistry] Tool "${q}" renders <${J}>, but its module loader finished without defining it, so the tool renders blank. The tag map and the loader disagree: map "${q}" to the tag its loader defines, or register a loader that defines <${J}>. Reported once per page.`)}watchUndefinedToolElement(q){if(this.watchedUndefinedToolElements.has(q))return;let J=this.undefinedToolElementTag(q);if(!J)return;this.watchedUndefinedToolElements.add(q);let Q=document,X=setTimeout(()=>{if(customElements.get(J))return;z(Q,`undefinedToolElement.${q}`,`[ToolRegistry] Tool "${q}" renders <${J}>, which is still undefined after ${D/1000} s, and its registry has no module loader for it. Register one with setToolModuleLoaders or import the tool's package before it renders; a registry from createPackagedToolRegistry has the packaged loaders unless its toolModuleLoaders replaced them. Reported once per page.`)},D);customElements.whenDefined(J).then(()=>clearTimeout(X))}async ensureToolModulesLoaded(q){let J=await f(q.map((X)=>this.ensureToolModuleLoaded(X))),Q=new Map;return J.forEach((X,$)=>{if(X.status==="rejected")Q.set(q[$],X.reason)}),Q}isToolModuleLoaded(q){return this.loadedToolModules.has(q)}renderForToolbar(q,J,Q){let X=this.get(q);if(!X)throw Error(`Tool '${q}' is not registered`);if(typeof X.renderToolbar!=="function")throw Error(`Tool '${q}' has activation "${X.activation||"toolbar-toggle"}" and renders into a host surface, not a toolbar. Remove it from toolbar placement.`);let $={...Q,componentOverrides:this.mergeComponentOverrides(Q.componentOverrides)};return X.renderToolbar(J,$)}renderForSurface(q,J){let Q=this.get(q);if(!Q)throw Error(`Tool '${q}' is not registered`);if(typeof Q.renderSurface!=="function")throw Error(`Tool '${q}' does not render into a host surface. Surface capabilities declare "surfaces" and implement "renderSurface".`);return Q.renderSurface({...J,componentOverrides:this.mergeComponentOverrides(J.componentOverrides)})}mergeComponentOverrides(q){return{...this.componentOverrides||{},...q||{}}}}var K={assessment:[],section:[],item:[],passage:[],rubric:[],element:[]};import{isPlainRecord as B}from"@pie-players/pie-players-shared/object";var u={section:[...K.section],item:[...K.item],passage:[...K.passage]};function F(q,J){if(q==null)return[];if(!Array.isArray(q))throw Error(`Invalid tools config at "${J}": expected an array of tool ids.`);if(q.find((X)=>typeof X!=="string")!==void 0)throw Error(`Invalid tools config at "${J}": all entries must be strings.`);return q}function v(q){if(q==null)return;if(!B(q))throw Error('Invalid tools config at "placement": expected an object with section/item/passage arrays.');return q}function c(q){if(q==null)return;if(!B(q))throw Error('Invalid tools config at "policy": expected an object with allowed/blocked arrays.');return q}function y(q,J){if(J==null)return;if(!B(J))throw Error(`Invalid tools config at "providers.${q}": expected an object.`);let Q=J;if("enabled"in Q&&Q.enabled!==void 0&&typeof Q.enabled!=="boolean")throw Error(`Invalid tools config at "providers.${q}.enabled": expected a boolean.`);if("settings"in Q&&Q.settings!==void 0&&!B(Q.settings))throw Error(`Invalid tools config at "providers.${q}.settings": expected an object.`);if("provider"in Q&&Q.provider!==void 0&&!B(Q.provider))throw Error(`Invalid tools config at "providers.${q}.provider": expected an object.`);return Q}function I(q){if(q==null)return{};if(!B(q))throw Error('Invalid tools config at "providers": expected an object keyed by tool id.');let J={};for(let[Q,X]of Object.entries(q))J[Q]=y(Q,X);return J}function M(q){if(!q||q.length===0)return[];let J=new Set;for(let Q of q){if(typeof Q!=="string")throw Error("Invalid tools config: tool list entries must be strings.");let X=Q.trim();if(!X)continue;J.add(X)}return Array.from(J)}function Hq(q){if(!q)return[];return M(q.split(",").map((J)=>J.trim()).filter(Boolean))}function g(q,J){if(q==null)return;if(q==="on"||q==="off")return q;throw Error(`Invalid tools config at "${J}": expected "on" or "off", got ${JSON.stringify(q)}.`)}function A(q,J){let Q=M(F(q?.[J],`placement.${J}`));return Q.length?Q:[...u[J]]}function Wq(q){if(q!=null&&!B(q))throw Error('Invalid tools config: expected an object with "policy", "placement", and "providers".');let J=c(q?.policy),Q=v(q?.placement),X=I(q?.providers),$=g(q?.pnpEnforcement,"pnpEnforcement"),Y={policy:{allowed:M(F(J?.allowed,"policy.allowed")),blocked:M(F(J?.blocked,"policy.blocked"))},placement:{section:A(Q,"section"),item:A(Q,"item"),passage:A(Q,"passage")},providers:X};if($)Y.pnpEnforcement=$;return Y}
2
+ export{d as m,O as n,N as o,m as p,M as q,Hq as r,Wq as s};
@@ -0,0 +1,4 @@
1
+ var y9="5";if(typeof window<"u")((window.__svelte??={}).v??=new Set).add(y9);var r7=Array.isArray,g9=Array.prototype.indexOf,JQ=Array.prototype.includes,RQ=Array.from,uQ=Object.keys,U7=Object.defineProperty,P7=Object.getOwnPropertyDescriptor,X0=Object.getOwnPropertyDescriptors,g0=Object.prototype,h9=Array.prototype,UQ=Object.getPrototypeOf,h0=Object.isExtensible;var m7=()=>{};function Z0(Q){for(var J=0;J<Q.length;J++)Q[J]()}function z0(){var Q,J,W=new Promise((K,X)=>{Q=K,J=X});return{promise:W,resolve:Q,reject:J}}var y=2,u7=4,WQ=8,PQ=16777216,n=16,o=32,H7=64,jQ=128,G0=256,z7=512,x=1024,R=2048,m=4096,d=8192,E=16384,G7=32768,p7=33554432,B7=65536,HQ=131072,v0=262144,f7=524288,v9=1048576,E7=33554432,pQ=2097152,R7=4194304,j7=8388608,V7=Symbol("$state"),V0=Symbol("component"),fQ=Symbol("legacy props"),m9=Symbol(""),m0=Symbol("proxy path"),q0=Symbol("attributes"),dQ=Symbol("class"),u0=Symbol("style"),_Q=Symbol("text"),p0=Symbol("form reset"),u9=Symbol("hmr anchor"),a7=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},f0=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");var TQ=3,w7=8;var p9=1,f9=2,d0=4,d9=8,_9=16,l9=1,i9=2,c9=4,o9=8,s9=16;var r9=1,a9=2;var xQ="[",KQ="[!",_0="[?",BQ="]",Y7={};var k=Symbol("uninitialized"),k7=Symbol("filename"),n9=Symbol("hmr"),$0="http://www.w3.org/1999/xhtml",lQ="http://www.w3.org/2000/svg",l0="http://www.w3.org/1998/Math/MathML";function t9(){console.warn("https://svelte.dev/e/derived_inert")}function e9(Q,J,W){console.warn("https://svelte.dev/e/hydration_attribute_changed")}function XQ(Q){console.warn("https://svelte.dev/e/hydration_mismatch")}function QJ(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function JJ(Q){var J=L;if(J===null)return O.f|=j7,Q;if((J.f&G7)===0&&(J.f&u7)===0)throw Q;M7(Q,J)}function M7(Q,J){if(Q===Y7)throw Q;if(J!==null&&(J.f&E)!==0)return;while(J!==null){if((J.f&jQ)!==0&&(J.f&(E|p7))===0){if((J.f&G7)===0)throw Q;try{J.b.error(Q);return}catch(W){Q=W}}J=J.parent}throw Q}function KJ(){throw Error("https://svelte.dev/e/async_derived_orphan")}function XJ(Q,J,W){throw Error("https://svelte.dev/e/each_key_duplicate")}function ZJ(Q){throw Error("https://svelte.dev/e/effect_in_teardown")}function zJ(){throw Error("https://svelte.dev/e/effect_in_unowned_derived")}function GJ(Q){throw Error("https://svelte.dev/e/effect_orphan")}function VJ(){throw Error("https://svelte.dev/e/effect_update_depth_exceeded")}function qJ(){throw Error("https://svelte.dev/e/hydration_failed")}function $J(Q){throw Error("https://svelte.dev/e/props_invalid_value")}function UJ(){throw Error("https://svelte.dev/e/state_descriptors_fixed")}function PJ(){throw Error("https://svelte.dev/e/state_prototype_fixed")}function HJ(){throw Error("https://svelte.dev/e/state_unsafe_mutation")}function BJ(){throw Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var Q7=!1,ZQ=!1;var C=null;function n7(Q){C=Q}function i0(Q,J=!1,W){C={p:C,i:!1,c:null,e:null,s:Q,x:null,r:L,l:ZQ&&!J?{s:null,u:null,$:[]}:null}}function c0(Q){var J=C,W=J.e;if(W!==null){J.e=null;for(var K of W)o0(K)}if(Q!==void 0)J.x=Q;return J.i=!0,C=J.p,iQ(Q)}function iQ(Q={}){return U7(Q,V0,{value:!0}),Q}function b7(){return!ZQ||C!==null&&C.l===null}var YQ=[];function MJ(){var Q=YQ;YQ=[],Z0(Q)}function s(Q){if(YQ.length===0&&!MQ){var J=YQ;queueMicrotask(()=>{if(J===YQ)MJ()})}YQ.push(Q)}function LJ(){while(YQ.length>0)MJ()}function P0(Q){return Q===this.v}function H0(Q,J){return Q!=Q?J==J:Q!==J||Q!==null&&typeof Q==="object"||typeof Q==="function"}function B0(Q){return!H0(Q,this.v)}function LQ(Q,J){return Q.label=J,s0(Q.v,J),Q}function s0(Q,J){return Q?.[m0]?.(J),Q}function y7(Q){var J=O,W=L;u(null),_(null);try{return Q()}finally{u(J),_(W)}}function L0(Q,J,W,K){let X=b7()?GQ:FQ;var Z=Q.filter((q)=>!q.settled),z=J.map(X);if(W.length===0&&Z.length===0){K(z);return}var G=L,V=OJ(),H=Z.length===1?Z[0].promise:Z.length>1?Promise.all(Z.map((q)=>q.promise)):null;function U(q){if((G.f&E)!==0)return;V();try{K([...z,...q])}catch(Y){M7(Y,G)}EQ()}var $=r0();if(W.length===0){H.then(()=>U([])).finally($);return}function P(){Promise.all(W.map((q)=>a0(q))).then(U).catch((q)=>M7(q,G)).finally($)}if(H)H.then(()=>{if((G.f&E)!==0){$();return}V(),P(),EQ()});else P()}function OJ(){var Q=L,J=O,W=C,K=S;if(!1)var X;return function(z=!0){if(_(Q),u(J),n7(W),z&&(Q.f&E)===0)K?.activate(),K?.apply()}}var A4=!1;function EQ(Q=!0){if(A4=!1,_(null),u(null),n7(null),Q)S?.deactivate()}function r0(){var Q=L,J=Q.b,W=S,K=!!J?.is_rendered();return J?.update_pending_count(1,W),W.increment(K,Q),()=>{J?.update_pending_count(-1,W),W.decrement(K,Q)}}var j4=~(R|m|x);function T(Q,J){Q.f=Q.f&j4|J}function kQ(Q){if((Q.f&z7)!==0||Q.deps===null)T(Q,x);else T(Q,m)}function GQ(Q){var J=y|R;if(L!==null)L.f|=f7;return{ctx:C,deps:null,effects:null,equals:P0,f:J,fn:Q,reactions:null,rv:0,v:k,wv:0,parent:L,ac:null}}var bQ=Symbol("obsolete");function a0(Q,J,W){let K=L;if(K===null)KJ();var X=void 0,Z=K7(k),z=!O,G=new Set;return wJ(()=>{var V=L,H=z0();X=H.promise;try{Promise.resolve(Q()).then(H.resolve,(q)=>{if(q!==a7)H.reject(q)}).finally(EQ)}catch(q){H.reject(q),EQ()}var U=S;if(z){if((V.f&G7)!==0)var $=r0();if(K.b?.is_rendered())U.async_deriveds.get(V)?.reject(bQ);else for(let q of G.values())q.reject(bQ);G.add(H),U.async_deriveds.set(V,H)}let P=(q,Y=void 0)=>{if($?.(),G.delete(H),Y===bQ)return;if(U.activate(),Y)Z.f|=j7,g7(Z,Y);else{if((Z.f&j7)!==0)Z.f^=j7;g7(Z,q)}U.deactivate()};H.promise.then(P,(q)=>P(null,q||"unknown"))}),W7(()=>{for(let V of G)V.reject(bQ)}),new Promise((V)=>{function H(U){function $(){if(U===X)V(Z);else H(X)}U.then($,$)}H(X)})}function T4(Q){let J=GQ(Q);if(!Q7)O0(J);return J}function FQ(Q){let J=GQ(Q);return J.equals=B0,J}function x4(Q){var J=Q.effects;if(J!==null){Q.effects=null;for(var W=0;W<J.length;W+=1)h(J[W])}}function oQ(Q){var J,W=L,K=Q.parent;if(!S7&&K!==null&&Q.v!==k&&(K.f&(E|d))!==0)return t9(),Q.v;_(K);try{x4(Q),J=Q9(Q)}finally{_(W)}return J}function t0(Q){var J=oQ(Q);if(!Q.equals(J)){if(Q.wv=aQ(),!S?.is_fork||Q.deps===null){if(S!==null)S.capture(Q,J,!0),d7?.capture(Q,J,!0);else Q.v=J;if(Q.deps===null){T(Q,x);return}}}if(S7)return;if(r!==null){if(zQ()||S?.is_fork)r.set(Q,J)}else kQ(Q)}function DJ(Q){if(Q.effects===null)return;for(let J of Q.effects)if(J.teardown||J.ac){if(J.teardown?.(),J.ac!==null)y7(()=>{J.ac.abort(a7),J.ac=null});if(J.fn!==null)J.teardown=m7;OQ(J,0),rQ(J)}}function e0(Q){if(Q.effects===null)return;for(let J of Q.effects)if(J.teardown&&J.fn!==null)_7(J)}var sQ=new Set,T7=new Map;var SJ=!1;function K7(Q,J){var W={f:0,v:Q,reactions:null,equals:P0,rv:0,wv:0};return W}function l7(Q,J){let W=K7(Q,J);return O0(W),W}function wQ(Q,J=!1,W=!0){let K=K7(Q);if(!J)K.equals=B0;if(ZQ&&W&&C!==null&&C.l!==null)(C.l.s??=[]).push(K);return K}function X7(Q,J,W=!1){if(O!==null&&(!I7||(O.f&HQ)!==0)&&b7()&&(O.f&(y|n|R7|HQ))!==0&&(h7===null||!h7.has(Q)))HJ();let K=W?t7(J):J;return g7(Q,K,nQ)}var DQ=null,J9=0;function g7(Q,J,W=null){if(!Q.equals(J)){if(S7)T7.set(Q,J);else if(!T7.has(Q))T7.set(Q,Q.v);var K=J7.ensure();if(K.capture(Q,J),(Q.f&y)!==0){let X=Q;if((Q.f&R)!==0)oQ(X);if(r===null)kQ(X)}if(Q.wv=aQ(),DQ=null,J9=0,CJ(Q,R,W),DQ=null,b7()&&L!==null&&(L.f&x)!==0&&(L.f&(o|H7))===0)if(C7===null)IJ([Q]);else C7.push(Q);if(!K.is_fork&&sQ.size>0&&!SJ)W9()}return J}function W9(){SJ=!1;for(let Q of sQ){if((Q.f&x)!==0)T(Q,m);let J;try{J=VQ(Q)}catch{J=!0}if(J)_7(Q)}sQ.clear()}function SQ(Q){X7(Q,Q.v+1)}function CJ(Q,J,W){var K=Q.reactions;if(K===null)return;var X=b7(),Z=K.length;if(J9+=Z,J9>1e5&&DQ===null)DQ=new Set;if(DQ!==null){if(DQ.has(Q))return;DQ.add(Q)}for(var z=0;z<Z;z++){var G=K[z],V=G.f;if(!X&&G===L)continue;var H=(V&R)===0;if(H)T(G,J);if((V&HQ)!==0)sQ.add(G);else if((V&y)!==0){var U=G;r?.delete(U),CJ(U,m,W)}else if(H){var $=G;if((V&n)!==0&&x7!==null)x7.add($);if(W!==null)W.push($);else tQ($)}}}function D0(Q,J,W){if((Q.f&R)!==0)J.add(Q);else if((Q.f&m)!==0)W.add(Q);T(Q,x)}var w0=null,yQ=null,S=null,d7=null,r=null,X9=null,MQ=!1,K9=!1,gQ=null,nQ=null,AJ=0;var b4=1;class J7{id=b4++;#Q=!1;linked=!0;#J=null;#W=null;async_deriveds=new Map;current=new Map;previous=new Map;#G=new Set;#X=new Set;#z=0;#K=new Map;#V=null;#Z=[];#M=[];#q=new Set;#$=new Set;#P=new Map;#L=new Set;is_fork=!1;#U=!1;constructor(){if(yQ===null)w0=yQ=this;else yQ.#W=this,this.#J=yQ;yQ=this}#w(){if(this.is_fork)return!0;for(let W of this.#K.keys()){var Q=W,J=!1;while(Q.parent!==null){if(this.#P.has(Q)){J=!0;break}Q=Q.parent}if(!J)return!0}return!1}skip_effect(Q){if(!this.#P.has(Q))this.#P.set(Q,{d:[],m:[]});this.#L.delete(Q)}unskip_effect(Q,J=(W)=>this.schedule(W)){var W=this.#P.get(Q);if(W){this.#P.delete(Q);for(var K of W.d)T(K,R),J(K);for(K of W.m)T(K,m),J(K)}this.#L.add(Q)}#S(){var Q=[];for(let X of this.#Z){if((X.f&E)!==0||(X.f&(R|m))===0)continue;var J=X,W=!1;while(J.parent!==null){J=J.parent;var K=J.f;if((K&(H7|o))!==0){if((K&x)===0){W=!0;break}J.f^=x}}if(!W)Q.push(J)}return this.#Z=[],Q}#F(){this.#Q=!0;for(let z of this.#q)this.#$.delete(z),T(z,R),this.schedule(z);for(let z of this.#$)T(z,m),this.schedule(z);this.apply();var Q=gQ=[],J=[],W=nQ=[];while(this.#Z.length>0){if(AJ++>1000)this.#Y(),y4();for(let z of this.#S())try{this.#D(z,Q,J)}catch(G){if(TJ(z),!this.#w())this.discard();throw G}}if(S=null,W.length>0){var K=J7.ensure();for(let z of W)K.schedule(z)}if(gQ=null,nQ=null,this.#w()){this.#B(J),this.#B(Q);for(let[z,G]of this.#P)jJ(z,G);if(W.length>0)S.#F();return}let X=this.#H();if(X){this.#B(J),this.#B(Q),X.#C(this);return}this.#q.clear(),this.#$.clear();for(let z of this.#G)z(this);this.#G.clear(),d7=this,NJ(J),NJ(Q),d7=null,this.#V?.resolve();var Z=S;if(this.#z===0&&(this.#Z.length===0||Z!==null)){if(this.#Y(),Q7)this.#O(),S=Z}if(this.#Z.length>0)if(Z!==null){for(let z of this.#Z)Z.#Z.push(z);this.#Z=[]}else Z=this;if(Z!==null)T7.clear(),Z.#F()}#D(Q,J,W){Q.f^=x;var K=Q.first;while(K!==null){var X=K.f,Z=(X&(o|H7))!==0,z=Z&&(X&x)!==0,G=z||(X&d)!==0||this.#P.has(K);if(!G&&K.fn!==null){if(Z)K.f^=x;else if((X&u7)!==0)J.push(K);else if(Q7&&(X&(WQ|PQ))!==0)W.push(K);else if(VQ(K)){if((X&n)!==0)this.#$.add(K);_7(K)}var V=K.first;if(V!==null){K=V;continue}}while(K!==null){var H=K.next;if(H!==null){K=H;break}K=K.parent}}}#H(){var Q=this.#J;while(Q!==null){if(!Q.is_fork){for(let[J,[,W]]of this.current)if(Q.current.has(J)&&!W)return Q}Q=Q.#J}return null}#C(Q){for(let[W,K]of Q.current){if(!this.previous.has(W)&&Q.previous.has(W))this.previous.set(W,Q.previous.get(W));this.current.set(W,K)}for(let[W,K]of Q.async_deriveds){let X=this.async_deriveds.get(W);if(X)K.promise.then(X.resolve).catch(X.reject)}Q.async_deriveds.clear(),this.transfer_effects(Q.#q,Q.#$);let J=(W)=>{var K=W.reactions;if(K===null)return;if((W.f&y)!==0&&(W.f&(R|m))===0)return;for(let z of K){var X=z.f;if((X&y)!==0)J(z);else{var Z=z;if(X&(R7|n)&&!this.async_deriveds.has(Z))this.#$.delete(Z),T(Z,R),this.schedule(Z)}}};for(let W of this.current.keys())J(W);this.oncommit(()=>Q.discard()),Q.#Y(),S=this,this.#F()}#B(Q){for(var J=0;J<Q.length;J+=1)D0(Q[J],this.#q,this.#$)}capture(Q,J,W=!1){if(Q.v!==k&&!this.previous.has(Q))this.previous.set(Q,Q.v);if((Q.f&j7)===0)this.current.set(Q,[J,W]),r?.set(Q,J);if(!this.is_fork)Q.v=J}activate(){S=this}deactivate(){S=null,r=null}flush(){try{K9=!0,S=this,this.#F()}finally{AJ=0,X9=null,gQ=null,nQ=null,K9=!1,S=null,r=null,T7.clear()}}discard(){for(let Q of this.#X)Q(this);this.#X.clear();for(let Q of this.async_deriveds.values())Q.reject(bQ);this.#Y(),this.#V?.resolve()}register_created_effect(Q){this.#M.push(Q)}#O(){for(let U=w0;U!==null;U=U.#W){var Q=U.id<this.id,J=[];for(let[$,[P,q]]of this.current){if(U.current.has($)){var W=U.current.get($)[0];if(Q&&P!==W)U.current.set($,[P,q]);else continue}J.push($)}if(Q)for(let[$,P]of this.async_deriveds){let q=U.async_deriveds.get($);if(q)P.promise.then(q.resolve).catch(q.reject)}var K=[...U.current.keys()].filter(($)=>!U.current.get($)[1]);if(!U.#Q||K.length===0)continue;var X=K.filter(($)=>!this.current.has($));if(X.length===0){if(Q)U.discard()}else if(J.length>0){if(Q)for(let $ of this.#L)U.unskip_effect($,(P)=>{if((P.f&(n|R7))!==0)U.schedule(P);else U.#B([P])});U.activate();var Z=new Set,z=new Map;for(var G of J)RJ(G,X,Z,z);z=new Map;var V=[...U.current].filter(([$,P])=>{let q=this.current.get($);if(!q)return!0;return q[0]!==P[0]||q[1]!==P[1]}).map(([$])=>$);if(V.length>0){for(let $ of this.#M)if(($.f&(E|d|HQ))===0&&Z9($,V,z))if(($.f&(R7|n))!==0)T($,R),U.schedule($);else U.#q.add($)}if(U.#Z.length>0&&!U.#U){U.apply();for(var H of U.#S())U.#D(H,[],[])}U.deactivate()}}}increment(Q,J){if(this.#z+=1,Q){let W=this.#K.get(J)??0;this.#K.set(J,W+1)}}decrement(Q,J){if(this.#z-=1,Q){let W=this.#K.get(J)??0;if(W===1)this.#K.delete(J);else this.#K.set(J,W-1)}if(this.#U)return;this.#U=!0,s(()=>{if(this.#U=!1,this.linked)this.flush()})}transfer_effects(Q,J){for(let W of Q)this.#q.add(W);for(let W of J)this.#$.add(W);Q.clear(),J.clear()}oncommit(Q){this.#G.add(Q)}ondiscard(Q){this.#X.add(Q)}settled(){return(this.#V??=z0()).promise}static ensure(){if(S===null){let Q=S=new J7;if(!K9&&!MQ)s(()=>{if(!Q.#Q)Q.flush()})}return S}apply(){if(!Q7||!this.is_fork&&this.#J===null&&this.#W===null){r=null;return}r=new Map;for(let[J,[W]]of this.current)r.set(J,W);for(let J=w0;J!==null;J=J.#W){if(J===this||J.is_fork)continue;var Q=!1;if(J.id<this.id)for(let[W,[,K]]of J.current){if(K)continue;if(this.current.has(W)){Q=!0;break}}if(!Q){for(let[W,K]of J.previous)if(!r.has(W))r.set(W,K)}}}schedule(Q){if(X9=Q,Q.b?.is_pending&&(Q.f&(u7|WQ|PQ))!==0&&(Q.f&G7)===0){Q.b.defer_effect(Q);return}this.#Z.push(Q)}#Y(){if(!this.linked)return;var Q=this.#J,J=this.#W;if(Q===null)w0=J;else Q.#W=J;if(J===null)yQ=Q;else J.#J=Q;this.linked=!1}}function CQ(Q){var J=MQ,W=d7;d7=null,MQ=!0;try{var K;if(Q)CQ(),K=Q();while(!0){if(LJ(),S===null)return K;S.flush()}}finally{MQ=J,d7=W}}function y4(){if(!1){var Q;for(let W of S.current.keys())for(let[K,X]of W.updated??[])var J}try{VJ()}catch(W){M7(W,X9)}}var x7=null;function NJ(Q){var J=Q.length;if(J===0)return;var W=0;while(W<J){var K=Q[W++];if((K.f&(E|d))===0&&VQ(K)){if(x7=new Set,_7(K),K.deps===null&&K.first===null&&K.nodes===null&&K.teardown===null&&K.ac===null)z9(K);if(x7?.size>0){T7.clear();for(let X of x7){if((X.f&(E|d))!==0)continue;let Z=[X],z=X.parent;while(z!==null){if(x7.has(z))x7.delete(z),Z.push(z);z=z.parent}for(let G=Z.length-1;G>=0;G--){let V=Z[G];if((V.f&(E|d))!==0)continue;_7(V)}}x7.clear()}}}x7=null}function RJ(Q,J,W,K){if(W.has(Q))return;if(W.add(Q),Q.reactions!==null)for(let X of Q.reactions){let Z=X.f;if((Z&y)!==0)RJ(X,J,W,K);else if((Z&(R7|n))!==0&&(Z&R)===0&&Z9(X,J,K))T(X,R),tQ(X)}}function Z9(Q,J,W){let K=W.get(Q);if(K!==void 0)return K;if(Q.deps!==null)for(let X of Q.deps){if(JQ.call(J,X))return!0;if((X.f&y)!==0&&Z9(X,J,W))return W.set(X,!0),!0}return W.set(Q,!1),!1}function tQ(Q){S.schedule(Q)}function jJ(Q,J){if((Q.f&o)!==0&&(Q.f&x)!==0)return;if((Q.f&R)!==0)J.d.push(Q);else if((Q.f&m)!==0)J.m.push(Q);T(Q,x);var W=Q.first;while(W!==null)jJ(W,J),W=W.next}function TJ(Q){T(Q,x);var J=Q.first;while(J!==null)TJ(J),J=J.next}function EJ(Q){if(L===null){if(O===null)GJ(Q);zJ()}if(S7)ZJ(Q)}function h4(Q,J){var W=J.last;if(W===null)J.last=J.first=Q;else W.next=Q,Q.prev=W,J.last=Q}function i7(Q,J){var W=L;if(W!==null&&(W.f&d)!==0)Q|=d;var K={ctx:C,deps:null,nodes:null,f:Q|R|z7,first:null,fn:J,last:null,next:null,parent:W,b:W&&W.b,prev:null,teardown:null,wv:0,ac:null};S?.register_created_effect(K);var X=K;if((Q&u7)!==0)if(gQ!==null)gQ.push(K);else J7.ensure().schedule(K);else if(J!==null){try{_7(K)}catch(z){throw h(K),z}if(X.deps===null&&X.teardown===null&&X.nodes===null&&X.first===X.last&&(X.f&f7)===0){if(X=X.first,(Q&n)!==0&&(Q&B7)!==0&&X!==null)X.f|=B7}}if(X!==null){if(X.parent=W,W!==null)h4(X,W);if(O!==null&&(O.f&y)!==0&&(Q&H7)===0){var Z=O;(Z.effects??=[]).push(X)}}return K}function zQ(){return O!==null&&!I7}function W7(Q){let J=i7(WQ,null);return T(J,x),J.teardown=Q,J}function V9(Q){EJ("$effect");var J=L.f,W=!O&&(J&o)!==0&&C!==null&&!C.i;if(W){var K=C;(K.e??=[]).push(Q)}else return o0(Q)}function o0(Q){return i7(u7|v9,Q)}function q9(Q){J7.ensure();let J=i7(H7|f7,Q);return()=>{h(J)}}function kJ(Q){J7.ensure();let J=i7(H7|f7,Q);return(W={})=>{return new Promise((K)=>{if(W.outro)c7(J,()=>{h(J),K(void 0)});else h(J),K(void 0)})}}function $7(Q){return i7(u7,Q)}function wJ(Q){return i7(R7|f7,Q)}function a(Q,J=0){return i7(WQ|J,Q)}function $9(Q,J=[],W=[],K=[]){L0(K,J,W,(X)=>{i7(WQ,()=>{Q(...X.map(I))})})}function F7(Q,J=0){var W=i7(n|J,Q);return W}function c(Q){return i7(o|f7,Q)}function U9(Q){var J=Q.teardown;if(J!==null){let W=S7,K=O;G9(!0),u(null);try{J.call(null)}catch(X){M7(X,Q.parent)}finally{G9(W),u(K)}}}function rQ(Q,J=!1){var W=Q.first;Q.first=Q.last=null;while(W!==null){let X=W.ac;if(X!==null)y7(()=>{X.abort(a7)});var K=W.next;if((W.f&H7)!==0)W.parent=null;else h(W,J);W=K}}function bJ(Q){var J=Q.first;while(J!==null){var W=J.next;if((J.f&o)===0)h(J);J=W}}function h(Q,J=!0){var W=!1;if((J||(Q.f&v0)!==0)&&Q.nodes!==null&&Q.nodes.end!==null)P9(Q.nodes.start,Q.nodes.end),W=!0;Q.f|=p7,rQ(Q,J&&!W),OQ(Q,0);var K=Q.nodes&&Q.nodes.t;if(K!==null)for(let Z of K)Z.stop();U9(Q),Q.f^=p7,Q.f|=E;var X=Q.parent;if(X!==null&&X.first!==null)z9(Q);Q.next=Q.prev=Q.teardown=Q.ctx=Q.deps=Q.fn=Q.nodes=Q.ac=Q.b=null}function P9(Q,J){while(Q!==null){var W=Q===J?null:i(Q);Q.remove(),Q=W}}function z9(Q){var{parent:J,prev:W,next:K}=Q;if(W!==null)W.next=K;if(K!==null)K.prev=W;if(J!==null){if(J.first===Q)J.first=K;if(J.last===Q)J.last=W}}function c7(Q,J,W=!0){var K=[];Q.f|=G0,yJ(Q,K,!0);var X=()=>{if(W)h(Q);if(J)J()},Z=K.length;if(Z>0){var z=()=>--Z||X();for(var G of K)G.out(z)}else X()}function yJ(Q,J,W){if((Q.f&d)!==0)return;Q.f^=d;var K=Q.nodes&&Q.nodes.t;if(K!==null){for(let G of K)if(G.is_global||W)J.push(G)}var X=Q.first;while(X!==null){var Z=X.next;if((X.f&H7)===0){var z=(X.f&B7)!==0||(X.f&o)!==0&&(Q.f&n)!==0;yJ(X,J,z?W:!1)}X=Z}}function hQ(Q){Q.f&=~G0,gJ(Q,!0)}function gJ(Q,J){if((Q.f&G0)!==0)return;if((Q.f&d)===0)return;if(Q.f^=d,(Q.f&x)===0)T(Q,R),J7.ensure().schedule(Q);var W=Q.first;while(W!==null){var K=W.next,X=(W.f&B7)!==0||(W.f&o)!==0;gJ(W,X?J:!1),W=K}var Z=Q.nodes&&Q.nodes.t;if(Z!==null){for(let z of Z)if(z.is_global||J)z.in()}}function vQ(Q,J){if(!Q.nodes)return;var W=Q.nodes.start,K=Q.nodes.end;while(W!==null){var X=W===K?null:i(W);J.append(W),W=X}}var hJ=null;var S7=!1;function G9(Q){S7=Q}var O=null,I7=!1;function u(Q){O=Q}var L=null;function _(Q){L=Q}var h7=null;function O0(Q){if(O!==null&&(!Q7&&(O.f&pQ)!==0||(O.f&y)!==0))(h7??=new Set).add(Q)}var q7=null,L7=0,C7=null;function IJ(Q){C7=Q}var mJ=1,IQ=0,qQ=IQ;function H9(Q){qQ=Q}function aQ(){return++mJ}function VQ(Q){var J=Q.f;if((J&R)!==0)return!0;if((J&m)!==0){var W=Q.deps,K=W.length;for(var X=0;X<K;X++){var Z=W[X];if(VQ(Z))t0(Z);if(Z.wv>Q.wv)return!0}if((J&z7)!==0&&r===null)T(Q,x)}return!1}function uJ(Q,J,W=!0){var K=Q.reactions;if(K===null)return;if(!Q7&&h7!==null&&h7.has(Q))return;for(var X=0;X<K.length;X++){var Z=K[X];if((Z.f&y)!==0)uJ(Z,J,!1);else if(J===Z){if(W)T(Z,R);else if((Z.f&x)!==0)T(Z,m);tQ(Z)}}}function Q9(Q){var J=q7,W=L7,K=C7,X=O,Z=h7,z=C,G=I7,V=qQ,H=Q.f;if(q7=null,L7=0,C7=null,O=(H&(o|H7))===0?Q:null,h7=null,n7(Q.ctx),I7=!1,qQ=++IQ,Q.ac!==null)y7(()=>{Q.ac.abort(a7)}),Q.ac=null;try{Q.f|=pQ;var U=Q.fn,$=U();Q.f|=G7;var P=vJ(Q);if(b7()&&C7!==null&&!I7&&P!==null&&(Q.f&(y|m|R))===0)for(var q=0;q<C7.length;q++)uJ(C7[q],Q);if(X!==null&&X!==Q){if(IQ++,X.deps!==null)for(let Y=0;Y<W;Y+=1)X.deps[Y].rv=IQ;if(J!==null)for(let Y of J)Y.rv=IQ;if(C7!==null)if(K===null)K=C7;else K.push(...C7)}if((Q.f&j7)!==0)Q.f^=j7;return $}catch(Y){return vJ(Q),JJ(Y)}finally{Q.f^=pQ,q7=J,L7=W,C7=K,O=X,h7=Z,n7(z),I7=G,qQ=V}}function vJ(Q){var J=Q.deps,W=S?.is_fork;if(q7!==null){var K;if(!W)OQ(Q,L7);if(J!==null&&L7>0){J.length=L7+q7.length;for(K=0;K<q7.length;K++)J[L7+K]=q7[K]}else Q.deps=J=q7;if(zQ()&&(Q.f&z7)!==0)for(K=L7;K<J.length;K++)(J[K].reactions??=[]).push(Q)}else if(!W&&J!==null&&L7<J.length)OQ(Q,L7),J.length=L7;return J}function m4(Q,J){let W=J.reactions;if(W!==null){var K=g9.call(W,Q);if(K!==-1){var X=W.length-1;if(X===0)W=J.reactions=null;else W[K]=W[X],W.pop()}}if(W===null&&(J.f&y)!==0&&(q7===null||!JQ.call(q7,J))){var Z=J;if((Z.f&z7)!==0)Z.f^=z7;if(Z.v!==k)kQ(Z);if(Z.ac!==null)y7(()=>{Z.ac.abort(a7),Z.ac=null,T(Z,R)});DJ(Z),OQ(Z,0)}}function OQ(Q,J){var W=Q.deps;if(W===null)return;for(var K=J;K<W.length;K++)m4(Q,W[K])}function _7(Q){var J=Q.f;if((J&E)!==0)return;T(Q,x);var W=L;if(L=Q,!1)var K,X;try{if((J&(n|PQ))!==0)bJ(Q);else rQ(Q);U9(Q);var Z=Q9(Q);if(Q.teardown=typeof Z==="function"?Z:null,Q.wv=mJ,!1)for(var z of Q.deps);}finally{L=W}}function I(Q){var J=Q.f,W=(J&y)!==0;if(hJ?.add(Q),O!==null&&!I7){var K=L!==null&&(L.f&E)!==0;if(!K&&(h7===null||!h7.has(Q))){var X=O.deps;if((O.f&pQ)!==0){if(Q.rv<IQ)if(Q.rv=IQ,q7===null&&X!==null&&X[L7]===Q)L7++;else if(q7===null)q7=[Q];else q7.push(Q)}else{if(O.deps??=[],!JQ.call(O.deps,Q))O.deps.push(Q);var Z=Q.reactions;if(Z===null)Q.reactions=[O];else if(!JQ.call(Z,O))Z.push(O)}}}if(!1){if(!I7&&N4&&S===null&&d7===null&&!N4.warned&&(N4.effect.f&pQ)===0&&!N4.effect_deps.has(Q))var z;if(n0&&!I7&&N5!==null&&O!==null&&N5.reaction===O){if(Q.trace);else if(z)var G,V}}if(S7&&T7.has(Q))return T7.get(Q);if(W){var H=Q;if(S7){var U=H.v;if((H.f&x)===0&&H.reactions!==null||fJ(H))U=oQ(H);return T7.set(H,U),U}var $=(H.f&z7)===0&&!I7&&O!==null&&(O.f&z7)!==0,P=(H.f&G7)===0;if(VQ(H)){if($)H.f|=z7;t0(H)}if($&&!P)e0(H),pJ(H)}if(r?.has(Q))return r.get(Q);if((Q.f&j7)!==0)throw Q.v;return Q.v}function pJ(Q){if(Q.f|=z7,Q.deps===null)return;for(let W of Q.deps){var J=W.reactions;if(J===null)W.reactions=[Q];else if(!JQ.call(J,Q))J.push(Q);if((W.f&y)!==0&&(W.f&z7)===0)e0(W),pJ(W)}}function fJ(Q){if(Q.v===k)return!0;if(Q.deps===null)return!1;for(let J of Q.deps){if(T7.has(J))return!0;if((J.f&y)!==0&&fJ(J))return!0}return!1}function b(Q){var J=I7;try{return I7=!0,Q()}finally{I7=J}}function C0(Q){if(typeof Q!=="object"||!Q||Q instanceof EventTarget)return;if(V7 in Q)S0(Q);else if(!Array.isArray(Q))for(let J in Q){let W=Q[J];if(typeof W==="object"&&W&&V7 in W)S0(W)}}function S0(Q,J=new Set){if(typeof Q==="object"&&Q!==null&&!(Q instanceof EventTarget)&&!J.has(Q)){if(J.add(Q),Q instanceof Date)Q.getTime();for(let K in Q)try{S0(Q[K],J)}catch(X){}let W=UQ(Q);if(W!==Object.prototype&&W!==Array.prototype&&W!==Map.prototype&&W!==Set.prototype&&W!==Date.prototype){let K=X0(W);for(let X in K){let Z=K[X].get;if(Z)try{Z.call(Q)}catch(z){}}}}}var u4=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function t7(Q){if(typeof Q!=="object"||Q===null||V7 in Q||V0 in Q)return Q;let J=UQ(Q);if(J!==g0&&J!==h9)return Q;var W=new Map,K=r7(Q),X=l7(0),Z=null,z=qQ,G=($)=>{if(qQ===z)return $();var P=O,q=qQ;u(null),H9(z);var Y=$();return u(P),H9(q),Y};if(K)W.set("length",l7(Q.length,Z));var V="";let H=!1;function U($){if(H)return;H=!0,V=$,LQ(X,`${V} version`);for(let[P,q]of W)LQ(q,p4(V,P));H=!1}return new Proxy(Q,{defineProperty($,P,q){if(!("value"in q)||q.configurable===!1||q.enumerable===!1||q.writable===!1)UJ();var Y=W.get(P);if(Y===void 0)G(()=>{var F=l7(q.value,Z);return W.set(P,F),F});else X7(Y,q.value,!0);return!0},deleteProperty($,P){var q=W.get(P);if(q===void 0){if(P in $){let Y=G(()=>l7(k,Z));W.set(P,Y),SQ(X)}}else X7(q,k),SQ(X);return!0},get($,P,q){if(P===V7)return Q;var Y=W.get(P),F=P in $;if(Y===void 0&&(!F||P7($,P)?.writable))Y=G(()=>{var w=t7(F?$[P]:k),N=l7(w,Z);return N}),W.set(P,Y);if(Y!==void 0){var B=I(Y);return B===k?void 0:B}return Reflect.get($,P,q)},getOwnPropertyDescriptor($,P){this.has?.($,P);var q=Reflect.getOwnPropertyDescriptor($,P),Y=W.get(P);if(Y!==void 0){var F=I(Y);if(F===k)return;if(q&&"value"in q)q.value=F;else return{enumerable:!0,configurable:!0,value:F,writable:!0}}return q},has($,P){if(P===V7)return!0;var q=W.get(P),Y=q!==void 0&&q.v!==k||Reflect.has($,P);if(q!==void 0||L!==null&&(!Y||P7($,P)?.writable)){if(q===void 0)q=G(()=>{var B=Y?t7($[P]):k,w=l7(B,Z);return w}),W.set(P,q);var F=I(q);if(F===k)return!1}return Y},set($,P,q,Y){var F=W.get(P),B=P in $;if(K&&P==="length")for(var w=q;w<F.v;w+=1){var N=W.get(w+"");if(N!==void 0)X7(N,k);else if(w in $)N=G(()=>l7(k,Z)),W.set(w+"",N)}if(F===void 0){if(!B||P7($,P)?.writable)F=G(()=>l7(void 0,Z)),X7(F,t7(q)),W.set(P,F)}else{B=F.v!==k;var v=G(()=>t7(q));X7(F,v)}var A=Reflect.getOwnPropertyDescriptor($,P);if(A?.set)A.set.call(Y,q);if(!B){if(K&&typeof P==="string"){var N7=W.get("length"),Z7=Number(P);if(Number.isInteger(Z7)&&Z7>=N7.v)X7(N7,Z7+1)}SQ(X)}return!0},ownKeys($){I(X);var P=Reflect.ownKeys($).filter((F)=>{var B=W.get(F);return B===void 0||B.v!==k});for(var[q,Y]of W)if(Y.v!==k&&!(q in $))P.push(q);return P},setPrototypeOf(){PJ()}})}function p4(Q,J){if(typeof J==="symbol")return`${Q}[Symbol(${J.description??""})]`;if(u4.test(J))return`${Q}.${J}`;return/^\d+$/.test(J)?`${Q}[${J}]`:`${Q}['${J}']`}var B9,dJ,U0,_J,lJ;function A0(){if(B9!==void 0)return;B9=window,dJ=document,U0=/Firefox/.test(navigator.userAgent);var Q=Element.prototype,J=Node.prototype,W=Text.prototype;if(_J=P7(J,"firstChild").get,lJ=P7(J,"nextSibling").get,h0(Q))Q[dQ]=void 0,Q[q0]=null,Q[u0]=void 0,Q.__e=void 0;if(h0(W))W[_Q]=void 0}function p(Q=""){return document.createTextNode(Q)}function g(Q){return _J.call(Q)}function i(Q){return lJ.call(Q)}function iJ(Q,J){if(!M)return g(Q);var W=g(D);if(W===null)W=D.appendChild(p());else if(J&&W.nodeType!==TQ){var K=p();return W?.before(K),j(K),K}if(J)R0(W);return j(W),W}function f4(Q,J=!1){if(!M){var W=g(Q);if(W instanceof Comment&&W.data==="")return i(W);return W}if(J){if(D?.nodeType!==TQ){var K=p();return D?.before(K),j(K),K}R0(D)}return D}function d4(Q,J=!1){if(!M)return g(Q);var W=iJ(Q,J);return I0(Q),W}function _4(Q,J=1,W=!1){let K=M?D:Q;var X;while(J--)X=K,K=i(K);if(!M)return K;if(W){if(K?.nodeType!==TQ){var Z=p();if(K===null)X?.after(Z);else K.before(Z);return j(Z),Z}R0(K)}return j(K),K}function cQ(Q){Q.textContent=""}function N0(){if(!Q7)return!1;if(x7!==null)return!1;var Q=L.f;return(Q&G7)!==0}function A7(Q,J,W){if(J==null||J===$0)return W?document.createElement(Q,{is:W}):document.createElement(Q);return W?document.createElementNS(J,Q,{is:W}):document.createElementNS(J,Q)}function R0(Q){if(Q.nodeValue.length<65536)return;let J=Q.nextSibling;while(J!==null&&J.nodeType===TQ)J.remove(),Q.nodeValue+=J.nodeValue,J=Q.nextSibling}var M=!1;function f(Q){M=Q}var D;function j(Q){if(Q===null)throw XQ(),Y7;return D=Q}function l(){return j(i(D))}function I0(Q){if(!M)return;if(i(D)!==null)throw XQ(),Y7;D=Q}function Y9(Q=1){if(M){var J=Q,W=D;while(J--)W=i(W);D=W}}function o7(Q=!0){var J=0,W=D;while(!0){if(W.nodeType===w7){var K=W.data;if(K===BQ){if(J===0)return W;J-=1}else if(K===xQ||K===KQ||K[0]==="["&&!isNaN(Number(K.slice(1))))J+=1}var X=i(W);if(Q)W.remove();W=X}}function AQ(Q){if(!Q||Q.nodeType!==w7)throw XQ(),Y7;return Q.data}var mQ=Symbol("events"),F9=new Set,j0=new Set;function cJ(Q,J,W){(J[mQ]??={})[Q]=W}function oJ(Q){for(var J=0;J<Q.length;J++)F9.add(Q[J]);for(var W of j0)W(Q)}var M9=null,L9=!1;function O9(Q){var J=this,W=J.ownerDocument,K=Q.type,X=Q.composedPath?.()||[],Z=X[0]||Q.target;if(M9=Q,!L9)L9=!0,setTimeout(()=>{L9=!1,M9=null});var z=0,G=M9===Q&&Q[mQ];if(G){var V=X.indexOf(G);if(V!==-1&&(J===document||J===window)){Q[mQ]=J;return}var H=X.indexOf(J);if(H===-1)return;if(V<=H)z=V}if(Z=X[z]||Q.target,Z===J)return;U7(Q,"currentTarget",{configurable:!0,get(){return Z||W}});var U=O,$=L;u(null),_(null);try{var P,q=[];while(Z!==null){if(Z===J)break;try{var Y=Z[mQ]?.[K];if(Y!=null&&(!Z.disabled||Q.target===Z))Y.call(Z,Q)}catch(F){if(P)q.push(F);else P=F}if(Q.cancelBubble)break;z++,Z=z<X.length?X[z]:null}if(P){for(let F of q)queueMicrotask(()=>{throw F});throw P}}finally{Q[mQ]=J,delete Q.currentTarget,u(U),_($)}}var l4=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:(Q)=>{return Q}});function sJ(Q){return l4?.createHTML(Q)??Q}function D9(Q){var J=A7("template");return J.innerHTML=sJ(Q.replaceAll("<!>","<!---->")),J.content}function O7(Q,J){var W=L;if(W.nodes===null)W.nodes={start:Q,end:J,a:null,t:null}}function o4(Q,J){var W=(J&r9)!==0,K=(J&a9)!==0,X,Z=!Q.startsWith("<!>");return()=>{if(M)return O7(D,null),D;if(X===void 0){if(X=D9(Z?Q:"<!>"+Q),!W)X=g(X)}var z=K||U0?document.importNode(X,!0):X.cloneNode(!0);if(W){var G=g(z),V=z.lastChild;O7(G,V)}else O7(z,z);return z}}function s4(){if(M)return O7(D,null),D;var Q=document.createDocumentFragment(),J=document.createComment(""),W=p();return Q.append(J,W),O7(J,W),Q}function Q0(Q,J){if(M){var W=L;if((W.f&G7)===0||W.nodes.end===null)W.nodes.end=D;l();return}if(Q===null)return;Q.before(J)}var r4=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","webkitdirectory","defer","disablepictureinpicture","disableremoteplayback"];var pW=[...r4,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var a4=["touchstart","touchmove"];function rJ(Q){return a4.includes(Q)}var n4=["$state","$state.raw","$derived","$derived.by"],fW=[...n4,"$state.eager","$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$effect.pending","$inspect","$inspect().with","$inspect.trace","$host"];function aJ(Q){let J=0,W=K7(0),K;return()=>{if(zQ())I(W),a(()=>{if(J===0)K=b(()=>Q(()=>SQ(W)));return J+=1,()=>{s(()=>{if(J-=1,J===0)K?.(),K=void 0,SQ(W)})}})}}var t4=B7|f7;function S9(Q,J,W,K){new nJ(Q,J,W,K)}class nJ{parent;is_pending=!1;transform_error;#Q;#J=M?D:null;#W;#G;#X;#z=null;#K=null;#V=null;#Z=null;#M=0;#q=0;#$=!1;#P=new Set;#L=new Set;#U=null;#w=aJ(()=>{return this.#U=K7(this.#M),()=>{this.#U=null}});constructor(Q,J,W,K){if(this.#Q=Q,this.#W=J,this.#G=(X)=>{var Z=L;Z.b=this,Z.f|=jQ,W(X)},this.parent=L.b,this.transform_error=K??this.parent?.transform_error??((X)=>X),this.#X=F7(()=>{if(M){let X=AQ(this.#J);l();let Z=X===KQ;if(X.startsWith(_0)){let G=JSON.parse(X.slice(_0.length));this.#F(G)}else if(Z)this.#C();else this.#S()}else this.#B()},t4),M)this.#Q=D}#S(){try{this.#z=c(()=>this.#G(this.#Q))}catch(Q){this.error(Q)}}#F(Q){let J=this.#W.failed,{reset:W,invoke_onerror:K}=this.#D(Q);if(s(K),!J)return;this.#V=c(()=>{J(this.#Q,()=>Q,()=>W)})}#D(Q){var J=!1,W=!1;let K=()=>{if(this.#H())return;if(J){QJ();return}if(J=!0,W)BJ();if(this.#V!==null)c7(this.#V,()=>{this.#V=null});this.#Y(()=>{this.#B()})};return{reset:K,invoke_onerror:()=>{if(this.#H())return;try{W=!0,this.#W.onerror?.(Q,K),W=!1}catch(Z){M7(Z,this.#X&&this.#X.parent)}}}}#H(){return(this.#X.f&(E|p7))!==0}#C(){let Q=this.#W.pending;if(!Q)return;this.is_pending=!0,this.#K=c(()=>Q(this.#Q)),s(()=>{if(this.#H())return;var J=this.#Z=document.createDocumentFragment(),W=p(),K=!1;if(J.append(W),this.#z=this.#Y(()=>{try{return c(()=>this.#G(W))}catch(X){try{this.error(X),K=!0}catch(Z){M7(Z,this.#X.parent)}return null}}),this.#z===null){if(this.#Z=null,K)this.#O(S);return}if(this.#q===0)this.#Q.before(J),this.#Z=null,c7(this.#K,()=>{this.#K=null}),this.#O(S)})}#B(){try{if(this.is_pending=this.has_pending_snippet(),this.#q=0,this.#M=0,this.#z=c(()=>{this.#G(this.#Q)}),this.#q>0){var Q=this.#Z=document.createDocumentFragment();vQ(this.#z,Q);let J=this.#W.pending;this.#K=c(()=>J(this.#Q))}else this.#O(S)}catch(J){this.error(J)}}#O(Q){this.is_pending=!1,Q.transfer_effects(this.#P,this.#L)}defer_effect(Q){D0(Q,this.#P,this.#L)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#W.pending}#Y(Q){var J=L,W=O,K=C;_(this.#X),u(this.#X),n7(this.#X.ctx);try{return J7.ensure(),Q()}finally{_(J),u(W),n7(K)}}#I(Q,J){if(!this.has_pending_snippet()){if(this.parent)this.parent.#I(Q,J);return}if(this.#q+=Q,this.#q===0){if(this.#O(J),this.#K)c7(this.#K,()=>{this.#K=null});if(this.#Z)this.#Q.before(this.#Z),this.#Z=null}}update_pending_count(Q,J){if(this.#I(Q,J),this.#M+=Q,!this.#U||this.#$)return;this.#$=!0,s(()=>{if(this.#$=!1,this.#U)g7(this.#U,this.#M)})}get_effect_pending(){return this.#w(),I(this.#U)}error(Q){if(Q===Y7)throw Q;if(!this.#W.onerror&&!this.#W.failed)throw Q;if(S?.is_fork){if(this.#z)S.skip_effect(this.#z);if(this.#K)S.skip_effect(this.#K);if(this.#V)S.skip_effect(this.#V);S.oncommit(()=>{if(!this.#H())this.#A(Q)})}else this.#A(Q)}#A(Q){if(this.#z)h(this.#z),this.#z=null;if(this.#K)h(this.#K),this.#K=null;if(this.#V)h(this.#V),this.#V=null;if(M)j(this.#J),Y9(),j(o7());let J=this.#W.failed,W=(K)=>{if(this.#H())return;let{reset:X,invoke_onerror:Z}=this.#D(K);if(Z(),J&&!this.#H())this.#V=this.#Y(()=>{try{return c(()=>{var z=L;z.b=this,z.f|=jQ,J(this.#Q,()=>K,()=>X)})}catch(z){return M7(z,this.#X.parent),null}})};s(()=>{if(this.#H())return;var K;try{K=this.transform_error(Q)}catch(X){M7(X,this.#X&&this.#X.parent);return}if(K!==null&&typeof K==="object"&&typeof K.then==="function")K.then(W,(X)=>M7(X,this.#X&&this.#X.parent));else W(K)})}}var C9=!0;function e4(Q,J){var W=J==null?"":typeof J==="object"?`${J}`:J;if(W!==(Q[_Q]??=Q.nodeValue))Q[_Q]=W,Q.nodeValue=`${W}`}function x0(Q,J){return tJ(Q,J)}function A9(Q,J){A0(),J.intro=J.intro??!1;let W=J.target,K=M,X=D;try{var Z=g(W);while(Z&&(Z.nodeType!==w7||Z.data!==xQ))Z=i(Z);if(!Z)throw Y7;f(!0),j(Z);let z=tJ(Q,{...J,anchor:Z});return f(!1),z}catch(z){if(z instanceof Error&&z.message.split(`
2
+ `).some((G)=>G.startsWith("https://svelte.dev/e/")))throw z;if(z!==Y7)console.warn("Failed to hydrate: ",z);if(J.recover===!1)qJ();return A0(),cQ(W),f(!1),x0(Q,J)}finally{f(K),j(X)}}var T0=new Map;function tJ(Q,{target:J,anchor:W,props:K={},events:X,context:Z,intro:z=!0,transformError:G}){A0();var V=void 0,H=kJ(()=>{var U=W??J.appendChild(p());S9(U,{pending:()=>{}},(q)=>{i0({});var Y=C;if(Z)Y.c=Z;if(X)K.$$events=X;if(M)O7(q,null);if(C9=z,V=Q(q,K)||iQ(),C9=!0,M){if(L.nodes.end=D,D===null||D.nodeType!==w7||D.data!==BQ)throw XQ(),Y7}c0()},G);var $=new Set,P=(q)=>{for(var Y=0;Y<q.length;Y++){var F=q[Y];if($.has(F))continue;$.add(F);var B=rJ(F);for(let v of[J,document]){var w=T0.get(v);if(w===void 0)w=new Map,T0.set(v,w);var N=w.get(F);if(N===void 0)v.addEventListener(F,O9,{passive:B}),w.set(F,1);else w.set(F,N+1)}}};return P(RQ(F9)),j0.add(P),()=>{for(var q of $)for(let B of[J,document]){var Y=T0.get(B),F=Y.get(q);if(--F==0){if(B.removeEventListener(q,O9),Y.delete(q),Y.size===0)T0.delete(B)}else Y.set(q,F)}if(j0.delete(P),U!==W)U.parentNode?.removeChild(U)}});return I9.set(V,H),V}var I9=new WeakMap;function N9(Q,J){let W=I9.get(Q);if(W)return I9.delete(Q),W(J);return Promise.resolve()}class e7{anchor;#Q=new Map;#J=new Map;#W=new Map;#G=new Set;#X=!0;constructor(Q,J=!0){this.anchor=Q,this.#X=J}#z=(Q)=>{if(!this.#Q.has(Q))return;var J=this.#Q.get(Q),W=this.#J.get(J);if(W)hQ(W),this.#G.delete(J);else{var K=this.#W.get(J);if(K)hQ(K.effect),this.#J.set(J,K.effect),this.#W.delete(J),K.fragment.lastChild.remove(),this.anchor.before(K.fragment),W=K.effect}for(let[X,Z]of this.#Q){if(this.#Q.delete(X),X===Q)break;let z=this.#W.get(Z);if(z)h(z.effect),this.#W.delete(Z)}for(let[X,Z]of this.#J){if(X===J||this.#G.has(X))continue;let z=()=>{if(Array.from(this.#Q.values()).includes(X)){var V=document.createDocumentFragment();vQ(Z,V),V.append(p()),this.#W.set(X,{effect:Z,fragment:V})}else h(Z);this.#G.delete(X),this.#J.delete(X)};if(this.#X||!W)this.#G.add(X),c7(Z,z,!1);else z()}};#K=(Q)=>{this.#Q.delete(Q);let J=Array.from(this.#Q.values());for(let[W,K]of this.#W)if(!J.includes(W))h(K.effect),this.#W.delete(W)};ensure(Q,J){var W=S,K=N0();if(J&&!this.#J.has(Q)&&!this.#W.has(Q))if(K){var X=document.createDocumentFragment(),Z=p();X.append(Z),this.#W.set(Q,{effect:c(()=>J(Z)),fragment:X})}else this.#J.set(Q,c(()=>J(this.anchor)));if(this.#Q.set(W,Q),K){for(let[z,G]of this.#J)if(z===Q)W.unskip_effect(G);else W.skip_effect(G);for(let[z,G]of this.#W)if(z===Q)W.unskip_effect(G.effect);else W.skip_effect(G.effect);W.oncommit(this.#z),W.ondiscard(this.#K)}else{if(M)this.anchor=D;this.#z(W)}}}function W8(Q,J,W=!1){var K;if(M)K=D,l();var X=new e7(Q),Z=W?B7:0;function z(G,V){if(M){var H=AQ(K);if(G!==parseInt(H.substring(1))){var U=o7();j(U),X.anchor=U,f(!1),X.ensure(G,V),f(!0);return}}X.ensure(G,V)}F7(()=>{var G=!1;if(J((V,H=0)=>{G=!0,z(H,V)}),!G)z(-1,null)},Z)}var K8=Symbol("NaN");function X8(Q,J,W){if(M)l();var K=new e7(Q),X=!b7();F7(()=>{var Z=J();if(Z!==Z)Z=K8;if(X&&Z!==null&&typeof Z==="object")Z={};K.ensure(Z,W)})}function Z8(Q,J,W){var K=[],X=J.length,Z,z=J.length;for(var G=0;G<X;G++){let $=J[G];c7($,()=>{if(Z){if(Z.pending.delete($),Z.done.add($),Z.pending.size===0){var P=Q.outrogroups;if(R9(Q,RQ(Z.done)),P.delete(Z),P.size===0)Q.outrogroups=null}}else z-=1},!1)}if(z===0){var V=K.length===0&&W!==null&&Q.pending.size===0;if(V){var H=W,U=H.parentNode;cQ(U),U.append(H),Q.items.clear()}R9(Q,J,!V)}else Z={pending:new Set(J),done:new Set},(Q.outrogroups??=new Set).add(Z)}function R9(Q,J,W=!0){var K;if(Q.pending.size>0){K=new Set;for(let z of Q.pending.values())for(let G of z)K.add(Q.items.get(G).e)}for(var X=0;X<J.length;X++){var Z=J[X];if(K?.has(Z)){Z.f|=E7;let z=document.createDocumentFragment();vQ(Z,z)}else h(J[X],W)}}var J4;function z8(Q,J,W,K,X,Z=null){var z=Q,G=new Map,V=(J&d0)!==0;if(V){var H=Q;z=M?j(g(H)):H.appendChild(p())}if(M)l();var U=null,$=FQ(()=>{var N=W();return r7(N)?N:N==null?[]:RQ(N)}),P=new Map,q=!0;function Y(N){if((w.effect.f&E)!==0)return;w.pending.delete(N);var v=I($);if(w.fallback=U,G8(w,v,z,J,K),U!==null)if(v.length===0)if((U.f&E7)===0)hQ(U);else U.f^=E7,W0(U,null,z);else c7(U,()=>{U=null})}function F(N){w.pending.delete(N)}var B=F7(()=>{var N=I($),v=N.length;let A=!1;if(M){var N7=AQ(z)===KQ;if(N7!==(v===0))z=o7(),j(z),f(!1),A=!0}var Z7=new Set,D7=S,NQ=N0();for(var QQ=0;QQ<v;QQ+=1){if(M&&D.nodeType===w7&&D.data===BQ)z=D,A=!0,f(!1);var v7=N[QQ],K0=K(v7,QQ);if(!1)var e8;var s7=q?null:G.get(K0);if(s7){if(s7.v)g7(s7.v,v7);if(s7.i)g7(s7.i,QQ);if(NQ)D7.unskip_effect(s7.e)}else{if(s7=V8(G,q?z:J4??=p(),v7,K0,QQ,X,J,W),!q)s7.e.f|=E7;G.set(K0,s7)}Z7.add(K0)}if(v===0&&Z&&!U)if(q)U=c(()=>Z(z));else U=c(()=>Z(J4??=p())),U.f|=E7;if(v>Z7.size)XJ("","","");if(M&&v>0)j(o7());if(!q)if(P.set(D7,Z7),NQ){for(let[w4,S4]of G)if(!Z7.has(w4))D7.skip_effect(S4.e);D7.oncommit(Y),D7.ondiscard(F)}else Y(D7);if(A)f(!0);I($)}),w={effect:B,flags:J,items:G,pending:P,outrogroups:null,fallback:U};if(q=!1,M)z=D}function J0(Q){while(Q!==null&&(Q.f&o)===0)Q=Q.next;return Q}function G8(Q,J,W,K,X){var Z=(K&d9)!==0,z=J.length,G=Q.items,V=J0(Q.effect.first),H,U=null,$,P=[],q=[],Y,F,B,w;if(Z){for(w=0;w<z;w+=1)if(Y=J[w],F=X(Y,w),B=G.get(F).e,(B.f&E7)===0)B.nodes?.a?.measure(),($??=new Set).add(B)}for(w=0;w<z;w+=1){if(Y=J[w],F=X(Y,w),B=G.get(F).e,Q.outrogroups!==null)for(let v7 of Q.outrogroups)v7.pending.delete(B),v7.done.delete(B);if((B.f&d)!==0){if(hQ(B),Z)B.nodes?.a?.unfix(),($??=new Set).delete(B)}if((B.f&E7)!==0)if(B.f^=E7,B===V)W0(B,null,W);else{var N=U?U.next:V;if(B===Q.effect.last)Q.effect.last=B.prev;if(B.prev)B.prev.next=B.next;if(B.next)B.next.prev=B.prev;$Q(Q,U,B),$Q(Q,B,N),W0(B,N,W),U=B,P=[],q=[],V=J0(U.next);continue}if(B!==V){if(H!==void 0&&H.has(B)){if(P.length<q.length){var v=q[0],A;U=v.prev;var N7=P[0],Z7=P[P.length-1];for(A=0;A<P.length;A+=1)W0(P[A],v,W);for(A=0;A<q.length;A+=1)H.delete(q[A]);$Q(Q,N7.prev,Z7.next),$Q(Q,U,N7),$Q(Q,Z7,v),V=v,U=Z7,w-=1,P=[],q=[]}else H.delete(B),W0(B,V,W),$Q(Q,B.prev,B.next),$Q(Q,B,U===null?Q.effect.first:U.next),$Q(Q,U,B),U=B;continue}P=[],q=[];while(V!==null&&V!==B)(H??=new Set).add(V),q.push(V),V=J0(V.next);if(V===null)continue}if((B.f&E7)===0)P.push(B);U=B,V=J0(B.next)}if(Q.outrogroups!==null){for(let v7 of Q.outrogroups)if(v7.pending.size===0)R9(Q,RQ(v7.done)),Q.outrogroups?.delete(v7);if(Q.outrogroups.size===0)Q.outrogroups=null}if(V!==null||H!==void 0){var D7=[];if(H!==void 0){for(B of H)if((B.f&d)===0)D7.push(B)}while(V!==null){if((V.f&d)===0&&V!==Q.fallback)D7.push(V);V=J0(V.next)}var NQ=D7.length;if(NQ>0){var QQ=(K&d0)!==0&&z===0?W:null;if(Z){for(w=0;w<NQ;w+=1)D7[w].nodes?.a?.measure();for(w=0;w<NQ;w+=1)D7[w].nodes?.a?.fix()}Z8(Q,D7,QQ)}}if(Z)s(()=>{if($===void 0)return;for(B of $)B.nodes?.a?.apply()})}function V8(Q,J,W,K,X,Z,z,G){var V=(z&p9)!==0?(z&_9)===0?wQ(W,!1,!1):K7(W):null,H=(z&f9)!==0?K7(X):null;return{v:V,i:H,e:c(()=>{return Z(J,V??W,H??X,G),()=>{Q.delete(K)}})}}function W0(Q,J,W){if(!Q.nodes)return;var K=Q.nodes.start,X=Q.nodes.end,Z=J&&(J.f&E7)===0?J.nodes.start:W;while(K!==null){var z=i(K);if(Z.before(K),K===X)return;K=z}}function $Q(Q,J,W){if(J===null)Q.effect.first=W;else J.next=W;if(W===null)Q.effect.last=J;else W.prev=J}function q8(Q,J,W=!1,K=!1,X=!1,Z=!1){var z=Q,G="";if(W){var V=Q;if(M)z=j(g(V))}$9(()=>{var H=L;if(G===(G=J()??"")){if(M)l();return}if(W&&!M){if(H.nodes=null,V.innerHTML=G,G!=="")O7(g(V),V.lastChild);return}if(H.nodes!==null)P9(H.nodes.start,H.nodes.end),H.nodes=null;if(G==="")return;if(M){var U=D.data,$=l(),P=$;while($!==null&&($.nodeType!==w7||$.data!==""))P=$,$=i($);if($===null)throw XQ(),Y7;O7(D,P),z=j($);return}var q=K?lQ:X?l0:void 0,Y=A7(K?"svg":X?"math":"template",q);Y.innerHTML=G;var F=K||X?Y:Y.content;if(O7(g(F),F.lastChild),K||X)while(g(F))z.before(g(F));else z.before(F)})}function $8(Q,J,W,K,X){if(M)l();if(J.$$host?.$$shadowRoot){let G=A7("slot");if(W!=="default")G.name=W;if(Q0(Q,G),X!==null){let V=p();G.append(V),X(V)}return}var Z=J.$$slots?.[W],z=!1;if(Z===!0)Z=J[W==="default"?"children":W],z=!0;if(Z===void 0){if(X!==null)X(Q)}else Z(Q,z?()=>K:K)}function L8(Q,J){$7(()=>{Q=L?.parent?.nodes?.start??Q;var W=Q.getRootNode(),K=W.host?W:W.head??W.ownerDocument.head;if(!K.querySelector("#"+J.hash)){let X=A7("style");X.id=J.hash,X.textContent=J.code,K.appendChild(X)}})}function F8(Q,J,W){$7(()=>{var K=b(()=>J(Q,W?.())||{});if(W&&K?.update){var X=!1,Z={};a(()=>{var z=W();if(C0(z),X&&H0(Z,z))Z=z,K.update(z)}),X=!0}if(K?.destroy)return()=>K.destroy()})}function W4(Q){var J,W,K="";if(typeof Q=="string"||typeof Q=="number")K+=Q;else if(typeof Q=="object")if(Array.isArray(Q)){var X=Q.length;for(J=0;J<X;J++)Q[J]&&(W=W4(Q[J]))&&(K&&(K+=" "),K+=W)}else for(W in Q)Q[W]&&(K&&(K+=" "),K+=W);return K}function K4(){for(var Q,J,W=0,K="",X=arguments.length;W<X;W++)(Q=arguments[W])&&(J=W4(Q))&&(K&&(K+=" "),K+=J);return K}function Z4(Q){if(typeof Q==="object")return K4(Q);else return Q??""}var X4=[...`
3
+ \r\f \v\uFEFF`];function z4(Q,J,W){var K=Q==null?"":""+Q;if(J)K=K?K+" "+J:J;if(W){for(var X of Object.keys(W))if(W[X])K=K?K+" "+X:X;else if(K.length){var Z=X.length,z=0;while((z=K.indexOf(X,z))>=0){var G=z+Z;if((z===0||X4.includes(K[z-1]))&&(G===K.length||X4.includes(K[G])))K=(z===0?"":K.substring(0,z))+K.substring(G+1);else z=G}}}return K===""?null:K}function G4(Q,J,W,K,X,Z){var z=Q[dQ];if(M||z!==W||z===void 0){var G=z4(W,K,Z);if(!M||G!==Q.getAttribute("class"))if(G==null)Q.removeAttribute("class");else if(J)Q.className=G;else Q.setAttribute("class",G);Q[dQ]=W}else if(Z&&X!==Z)for(var V in Z){var H=!!Z[V];if(X==null||H!==!!X[V])Q.classList.toggle(V,H)}return Z}var T8=Symbol("class"),x8=Symbol("style"),E8=Symbol("is custom element"),k8=Symbol("is html"),b8=f0?"link":"LINK";function $4(Q,J,W,K){var X=g8(Q);if(M){if(X[J]=Q.getAttribute(J),J==="src"||J==="srcset"||J==="href"&&Q.nodeName===b8){if(!K)h8(Q,J,W??"");return}}if(X[J]===(X[J]=W))return;if(J==="loading")Q[m9]=W;if(W==null)Q.removeAttribute(J);else if(typeof W!=="string"&&U4(Q).has(J))Q[J]=W;else Q.setAttribute(J,W)}function y8(Q,J,W){var K=O,X=L;let Z=M;if(M)f(!1);u(null),_(null);try{if(J!=="style"&&(j9.has(Q.getAttribute("is")||Q.nodeName)||!customElements||customElements.get(Q.getAttribute("is")||Q.nodeName.toLowerCase())?U4(Q).has(J):W&&typeof W==="object"))Q[J]=W;else $4(Q,J,W==null?W:String(W))}finally{if(u(K),_(X),Z)f(!0)}}function g8(Q){return Q[q0]??={[E8]:Q.nodeName.includes("-"),[k8]:Q.namespaceURI===$0}}var j9=new Map;function U4(Q){var J=Q.getAttribute("is")||Q.nodeName,W=j9.get(J);if(W)return W;j9.set(J,W=new Set);var K,X=Q,Z=Element.prototype;while(Z!==X){K=X0(X);for(var z in K)if(K[z].set&&z!=="innerHTML"&&z!=="textContent"&&z!=="innerText")W.add(z);X=UQ(X)}return W}function h8(Q,J,W){return}function T9(Q,J){if(Q===J)return!0;return new URL(Q,document.baseURI).href===new URL(J,document.baseURI).href}function V4(Q){return Q.split(",").map((J)=>J.trim().split(" ").filter(Boolean))}function v8(Q,J){var W=V4(Q.srcset),K=V4(J);return K.length===W.length&&K.every(([X,Z],z)=>Z===W[z][1]&&(T9(W[z][0],X)||T9(X,W[z][0])))}class P4{#Q=new WeakMap;#J;#W;static entries=new WeakMap;constructor(Q){this.#W=Q}observe(Q,J){var W=this.#Q.get(Q)||new Set;return W.add(J),this.#Q.set(Q,W),this.#G().observe(Q,this.#W),()=>{var K=this.#Q.get(Q);if(K.delete(J),K.size===0)this.#Q.delete(Q),this.#J.unobserve(Q)}}#G(){return this.#J??(this.#J=new ResizeObserver((Q)=>{for(var J of Q){P4.entries.set(J.target,J);for(var W of this.#Q.get(J.target)||[])W(J)}}))}}function x9(Q,J){return Q===J||Q?.[V7]===J}function m8(Q=iQ(),J,W,K){var X=C.r,Z=L;return $7(()=>{var z,G;return a(()=>{z=G,G=K?.()||[],b(()=>{if(!x9(W(...G),Q)){if(J(Q,...G),z&&x9(W(...z),Q))J(null,...z)}})}),()=>{let V=Z;while(V!==X&&V.parent!==null&&V.parent.f&p7)V=V.parent;let H=()=>{if(G&&x9(W(...G),Q))J(null,...G)},U=V.teardown;V.teardown=()=>{H(),U?.()}}}),Q}var k0=!1,UG=Symbol("unmounted");function k9(Q){var J=k0;try{return k0=!1,[Q(),k0]}finally{k0=J}}function p8(Q,J,W,K){var X=!ZQ||(W&i9)!==0,Z=(W&o9)!==0,z=(W&s9)!==0,G=K,V=!0,H=void 0,U=()=>{if(z&&X)return H??=GQ(K),I(H);if(V)V=!1,G=z?b(K):K;return G};let $;if(Z){var P=V7 in Q||fQ in Q;$=P7(Q,J)?.set??(P&&J in Q?(A)=>Q[J]=A:void 0)}var q,Y=!1;if(Z)[q,Y]=k9(()=>Q[J]);else q=Q[J];if(q===void 0&&K!==void 0){if(q=U(),$){if(X)$J(J);$(q)}}var F;if(X)F=()=>{var A=Q[J];if(A===void 0)return U();return V=!0,A};else F=()=>{var A=Q[J];if(A!==void 0)G=void 0;return A===void 0?G:A};if(X&&(W&c9)===0)return F;if($){var B=Q.$$legacy;return function(A,N7){if(arguments.length>0){if(!X||!N7||B||Y)$(N7?F():A);return A}return F()}}var w=!1,N=((W&l9)!==0?GQ:FQ)(()=>{return w=!1,F()});if(Z)I(N);var v=L;return function(A,N7){if(arguments.length>0){let Z7=N7?I(N):X&&Z?t7(A):A;if(X7(N,Z7),w=!0,G!==void 0)G=Z7;return A}if(S7&&w||(v.f&E)!==0)return N.v;return I(N)}}function H4(Q){return new B4(Q)}class B4{#Q;#J;constructor(Q){var J=new Map,W=(X,Z)=>{var z=wQ(Z,!1,!1);return J.set(X,z),z};let K=new Proxy({...Q.props||{},$$events:{}},{get(X,Z){return I(J.get(Z)??W(Z,Reflect.get(X,Z)))},has(X,Z){if(Z===fQ)return!0;return I(J.get(Z)??W(Z,Reflect.get(X,Z))),Reflect.has(X,Z)},set(X,Z,z){return X7(J.get(Z)??W(Z,z),z),Reflect.set(X,Z,z)}});if(this.#J=(Q.hydrate?A9:x0)(Q.component,{target:Q.target,anchor:Q.anchor,props:K,context:Q.context,intro:Q.intro??!1,recover:Q.recover,transformError:Q.transformError}),!Q7&&(!Q?.props?.$$host||Q.sync===!1))CQ();this.#Q=K.$$events;for(let X of Object.keys(this.#J)){if(X==="$set"||X==="$destroy"||X==="$on")continue;U7(this,X,{get(){return this.#J[X]},set(Z){this.#J[X]=Z},enumerable:!0})}this.#J.$set=(X)=>{Object.assign(K,X)},this.#J.$destroy=()=>{N9(this.#J)}}$set(Q){this.#J.$set(Q)}$on(Q,J){this.#Q[Q]=this.#Q[Q]||[];let W=(...K)=>J.call(this,...K);return this.#Q[Q].push(W),()=>{this.#Q[Q]=this.#Q[Q].filter((K)=>K!==W)}}$destroy(){this.#J.$destroy()}}var Y4;if(typeof HTMLElement==="function")Y4=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(Q,J,W){super();if(this.$$ctor=Q,this.$$s=J,W)this.$$shadowRoot=this.attachShadow(W)}addEventListener(Q,J,W){if(this.$$l[Q]=this.$$l[Q]||[],this.$$l[Q].push(J),this.$$c){let K=this.$$c.$on(Q,J);this.$$l_u.set(J,K)}super.addEventListener(Q,J,W)}removeEventListener(Q,J,W){if(super.removeEventListener(Q,J,W),this.$$c){let K=this.$$l_u.get(J);if(K)K(),this.$$l_u.delete(J)}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let Q=function(K){return(X)=>{let Z=A7("slot");if(K!=="default")Z.name=K;Q0(X,Z)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let J={},W=s8(this);for(let K of this.$$s)if(K in W)if(K==="default"&&!this.$$d.children)this.$$d.children=Q(K),J.default=!0;else J[K]=Q(K);for(let K of this.attributes){let X=this.$$g_p(K.name);if(!(X in this.$$d))this.$$d[X]=b0(X,K.value,this.$$p_d,"toProp")}for(let K in this.$$p_d)if(!(K in this.$$d)&&this[K]!==void 0)this.$$d[K]=this[K],delete this[K];this.$$c=H4({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:J,$$host:this}}),this.$$me=q9(()=>{a(()=>{this.$$r=!0;for(let K of uQ(this.$$c)){if(!this.$$p_d[K]?.reflect)continue;this.$$d[K]=this.$$c[K];let X=b0(K,this.$$d[K],this.$$p_d,"toAttribute");if(X==null)this.removeAttribute(this.$$p_d[K].attribute||K);else this.setAttribute(this.$$p_d[K].attribute||K,X)}this.$$r=!1})});for(let K in this.$$l)for(let X of this.$$l[K]){let Z=this.$$c.$on(K,X);this.$$l_u.set(X,Z)}this.$$l={}}}attributeChangedCallback(Q,J,W){if(this.$$r)return;Q=this.$$g_p(Q),this.$$d[Q]=b0(Q,W,this.$$p_d,"toProp"),this.$$c?.$set({[Q]:this.$$d[Q]})}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{if(!this.$$cn&&this.$$c)this.$$c.$destroy(),this.$$me(),this.$$c=void 0})}$$g_p(Q){return uQ(this.$$p_d).find((J)=>this.$$p_d[J].attribute===Q||!this.$$p_d[J].attribute&&J.toLowerCase()===Q)||Q}};function b0(Q,J,W,K){let X=W[Q]?.type;if(J=X==="Boolean"&&typeof J!=="boolean"?J!=null:J,!K||!W[Q])return J;else if(K==="toAttribute")switch(X){case"Object":case"Array":return J==null?null:JSON.stringify(J);case"Boolean":return J?"":null;case"Number":return J==null?null:J;default:return J}else switch(X){case"Object":case"Array":return J&&JSON.parse(J);case"Boolean":return J;case"Number":return J!=null?+J:J;default:return J}}function s8(Q){let J={};return Q.childNodes.forEach((W)=>{J[W.slot||"default"]=!0}),J}function r8(Q,J,W,K,X,Z){let z=class extends Y4{constructor(){super(Q,W,X);this.$$p_d=J}static get observedAttributes(){return uQ(J).map((G)=>(J[G].attribute||G).toLowerCase())}};if(uQ(J).forEach((G)=>{U7(z.prototype,G,{get(){return this.$$c&&G in this.$$c?this.$$c[G]:this.$$d[G]},set(V){V=b0(G,V,J),this.$$d[G]=V;var H=this.$$c;if(H){var U=P7(H,G)?.get;if(U)H[G]=V;else H.$set({[G]:V})}}})}),K.forEach((G)=>{U7(z.prototype,G,{get(){return this.$$c?.[G]}})}),Z)z=Z(z);return Q.element=z,z}import{createContext as y0}from"@pie-players/pie-context";var M4=y0(Symbol.for("pie.assessmentToolkit.runtimeContext")),L4=y0(Symbol.for("pie.assessmentToolkit.hostRuntimeContext")),F4=y0(Symbol.for("pie.assessmentToolkit.shellContext")),a8=y0(Symbol.for("pie.assessmentToolkit.regionScopeContext"));import{connectContextWithRetry as b9}from"@pie-players/pie-context";var n8={bubbles:!0,composed:!0,cancelable:!1};function t8(Q,J,W={}){return new CustomEvent(Q,{detail:J,...n8,...W})}function UP(Q,J,W,K={}){return Q.dispatchEvent(t8(J,W,K))}function PP(Q,J){return b9(Q,M4,J)}function HP(Q,J){return b9(Q,F4,J)}function BP(Q,J){return b9(Q,L4,J)}var MP=1e4;function LP(Q,J,W){if(!Q)return;let K=Symbol.for(`pie.assessmentToolkit.warned.${J}`),X=Q;if(X[K])return;X[K]=!0,console.warn(W)}function OP(Q,J){return D4(Q,J,new WeakMap)}function D4(Q,J,W){if(Object.is(Q,J))return!0;let K=Array.isArray(Q);if(K!==Array.isArray(J))return!1;if(!K&&(!O4(Q)||!O4(J)))return!1;let X=Q,Z=J;if(K&&Q.length!==J.length)return!1;let z=W.get(X);if(z?.has(Z))return!0;if(!z)z=new Set,W.set(X,z);z.add(Z);let G=new Set([...Object.keys(X),...Object.keys(Z)]);for(let V of G)if(!D4(X[V],Z[V],W))return!1;return!0}function O4(Q){if(Q===null||typeof Q!=="object")return!1;let J=Object.getPrototypeOf(Q);return J===Object.prototype||J===null}
4
+ export{m7 as t,I0 as u,i0 as v,c0 as w,T4 as x,CQ as y,l7 as z,X7 as A,t7 as B,iJ as C,f4 as D,d4 as E,_4 as F,V9 as G,$9 as H,I,b as J,cJ as K,oJ as L,o4 as M,s4 as N,Q0 as O,e4 as P,W8 as Q,X8 as R,z8 as S,q8 as T,$8 as U,L8 as V,F8 as W,Z4 as X,G4 as Y,$4 as Z,y8 as _,m8 as $,p8 as aa,r8 as ba,M4 as ca,L4 as da,F4 as ea,a8 as fa,UP as ga,PP as ha,HP as ia,BP as ja,MP as ka,LP as la,OP as ma};
@@ -1,4 +1,4 @@
1
- import{m as D6,n as O6,p as N6,r as F6}from"./ItemToolBar-hzc5wyjp.js";import{$ as U6,A as r,B as j6,C as aJ,D as yJ,F as TZ,G as $,H as o,I as J,K as VZ,L as K6,M as LJ,N as xJ,O as y,Q as NJ,R as X6,S as YZ,T as Q0,V as Q6,W as LZ,X as U0,Y as OJ,Z as l,_ as BJ,aa as u,ba as V6,ca as Y6,ha as L6,ia as q6,ka as V0,la as G6,ma as r0,t as AZ,u as GJ,v as J6,w as Z6,x as G,y as h,z as UJ}from"./ItemToolBar-3zrc4p3d.js";import{ContextProvider as O9}from"@pie-players/pie-context";function j0(D,L,M,H){if(typeof D?.reportToolFailure==="function"){D.reportToolFailure(L,M,H);return}console.error(`[${L}] ${M} failed:`,H)}function K0(D){return typeof D.href==="string"}function c0(D){if(!D||typeof D!=="object"||Array.isArray(D))return!1;let L=D;if(typeof L.id!=="string"||L.id.trim().length===0)return!1;if(typeof L.label!=="string"||L.label.trim().length===0)return!1;if(L.ariaLabel!==void 0&&typeof L.ariaLabel!=="string")return!1;if(L.icon!==void 0&&typeof L.icon!=="string")return!1;if(L.tooltip!==void 0&&typeof L.tooltip!=="string")return!1;if(L.active!==void 0&&typeof L.active!=="boolean")return!1;if(L.disabled!==void 0&&typeof L.disabled!=="boolean")return!1;let M=typeof L.href==="string",H=typeof L.onClick==="function";return M!==H}function a0(D){return typeof D==="string"&&D.trimStart().startsWith("<svg")}function i0(D){return typeof D==="string"&&D.trimStart().startsWith("http")}import{sanitizeSvgIcon as o0}from"@pie-players/pie-players-shared/security";import{resolveInterfaceI18n as G9}from"@pie-players/pie-players-shared/i18n/provider";import{collectFocusable as N9,createFocusTrap as F9,createPointerGesture as P9,FOCUSABLE_SELECTOR as W9,isProgrammaticFocusTarget as M9}from"@pie-players/pie-players-shared";var Z9={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 s0(D){return Z9[D]||null}import{runtimeElementTags as j9}from"@pie-players/pie-players-shared/pie";import{parseVersionedTagName as K9}from"@pie-players/pie-players-shared/pie/tag-names";function X9(D){return D.level==="item"}function Q9(D){return D.level==="passage"}function U9(D){return D.level==="element"}function X0(D){if(Array.isArray(D))return D;if(D&&typeof D==="object")return Object.values(D);return[]}function V9(D,L){return X0(D).find((M)=>!!M&&typeof M==="object"&&M.id===L)}function Y9(D,L){if(!L||typeof L!=="object")return;let M=L,H=M[D]??M[K9(D).baseName];return typeof H==="string"&&H?H:void 0}function L9(D){let L;try{L=D.pieSupports}catch{return}if(!Array.isArray(L))return;return L.filter((M)=>typeof M==="string")}function q9(D,L){if(!D||typeof D!=="object")return null;let{id:M,element:H}=D;if(typeof H!=="string"||!H)return null;let p=Y9(H,L),FJ=j9(H,p),$J=typeof customElements>"u"?void 0:customElements;for(let IJ of FJ){let pJ=$J?.get(IJ);if(pJ)return{elementId:typeof M==="string"?M:void 0,tag:H,packageSpec:p,supports:L9(pJ),pendingTags:[]}}return{elementId:typeof M==="string"?M:void 0,tag:H,packageSpec:p,supports:void 0,pendingTags:$J?FJ:[]}}function d0(D){let L,M;if(U9(D))L=D.item.config,M=[V9(L?.models,D.elementId)];else if(X9(D))L=D.item?.config,M=X0(L?.models);else if(Q9(D))L=D.passage?.config,M=X0(L?.models);else return[];return M.flatMap((H)=>{let p=q9(H,L?.elements);return p?[p]:[]})}function l0(){let D=null;return(L,M)=>{if(!L)return D=null,null;let H=L.visibleTools.map((p)=>({toolId:p.toolId,required:p.required,alwaysAvailable:p.alwaysAvailable,activateAtInit:p.activateAtInit,parameters:p.parameters}));if(D?.renderVersion===M&&r0(D.tools,H))return D.tools;return D={renderVersion:M,tools:H},H}}import"@pie-players/pie-players-shared/nds-icon-button";var D9=(D,L)=>{if(customElements.get(D))return;try{customElements.define(D,L)}catch(M){if(!(M instanceof DOMException&&M.name==="NotSupportedError"||M&&typeof M==="object"&&M.name==="NotSupportedError")||!customElements.get(D))throw M}},n0=(D,L=AZ)=>{var M=xJ(),H=yJ(M);{var p=(n)=>{var jJ=t0();Q0(jJ,()=>o0(L()),!0),GJ(jJ),y(n,jJ)},FJ=G(()=>a0(L())),$J=(n)=>{var jJ=R9();o(()=>l(jJ,"src",L())),y(n,jJ)},IJ=G(()=>i0(L())),pJ=(n)=>{let jJ=G(()=>s0(L()));var iJ=xJ(),vJ=yJ(iJ);{var qZ=(PJ)=>{var WJ=t0();Q0(WJ,()=>o0(J(jJ)),!0),GJ(WJ),y(PJ,WJ)},SZ=(PJ)=>{var WJ=k9();o(()=>OJ(WJ,1,`icon icon-${L()}`,"svelte-1c13522")),y(PJ,WJ)};NJ(vJ,(PJ)=>{if(J(jJ))PJ(qZ);else PJ(SZ,-1)})}y(n,iJ)};NJ(H,(n)=>{if(J(FJ))n(p);else if(J(IJ))n($J,1);else n(pJ,-1)})}y(D,M)},t0=LJ('<span aria-hidden="true"></span>'),R9=LJ('<img class="item-toolbar__icon-image svelte-1c13522" alt=""/>'),k9=LJ('<i aria-hidden="true"></i>'),e0=LJ("<span></span>"),z9=LJ('<span class="item-toolbar__nds-button-zoom svelte-1c13522"><nds-icon-button></nds-icon-button></span>',2),H9=LJ("<a><!></a>"),w9=LJ('<button type="button"><!></button>'),B9=LJ("<div></div>"),I9=LJ('<div><div class="item-toolbar__tools-row svelte-1c13522"><!> <!> <!></div> <!></div>'),T9={hash:"svelte-1c13522",code:`.item-toolbar.svelte-1c13522 {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-1c13522 {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);}
1
+ import{m as D6,n as O6,p as N6,r as F6}from"./ItemToolBar-341vf20n.js";import{$ as U6,A as r,B as j6,C as aJ,D as yJ,F as TZ,G as $,H as o,I as J,K as VZ,L as K6,M as LJ,N as xJ,O as y,Q as NJ,R as X6,S as YZ,T as Q0,V as Q6,W as LZ,X as U0,Y as OJ,Z as l,_ as BJ,aa as u,ba as V6,ca as Y6,ha as L6,ia as q6,ka as V0,la as G6,ma as r0,t as AZ,u as GJ,v as J6,w as Z6,x as G,y as h,z as UJ}from"./ItemToolBar-jpac75fa.js";import{ContextProvider as O9}from"@pie-players/pie-context";function j0(D,L,M,H){if(typeof D?.reportToolFailure==="function"){D.reportToolFailure(L,M,H);return}console.error(`[${L}] ${M} failed:`,H)}function K0(D){return typeof D.href==="string"}function c0(D){if(!D||typeof D!=="object"||Array.isArray(D))return!1;let L=D;if(typeof L.id!=="string"||L.id.trim().length===0)return!1;if(typeof L.label!=="string"||L.label.trim().length===0)return!1;if(L.ariaLabel!==void 0&&typeof L.ariaLabel!=="string")return!1;if(L.icon!==void 0&&typeof L.icon!=="string")return!1;if(L.tooltip!==void 0&&typeof L.tooltip!=="string")return!1;if(L.active!==void 0&&typeof L.active!=="boolean")return!1;if(L.disabled!==void 0&&typeof L.disabled!=="boolean")return!1;let M=typeof L.href==="string",H=typeof L.onClick==="function";return M!==H}function a0(D){return typeof D==="string"&&D.trimStart().startsWith("<svg")}function i0(D){return typeof D==="string"&&D.trimStart().startsWith("http")}import{sanitizeSvgIcon as o0}from"@pie-players/pie-players-shared/security";import{resolveInterfaceI18n as G9}from"@pie-players/pie-players-shared/i18n/provider";import{collectFocusable as N9,createFocusTrap as F9,createPointerGesture as P9,FOCUSABLE_SELECTOR as W9,isProgrammaticFocusTarget as M9}from"@pie-players/pie-players-shared";var Z9={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 s0(D){return Z9[D]||null}import{runtimeElementTags as j9}from"@pie-players/pie-players-shared/pie";import{parseVersionedTagName as K9}from"@pie-players/pie-players-shared/pie/tag-names";function X9(D){return D.level==="item"}function Q9(D){return D.level==="passage"}function U9(D){return D.level==="element"}function X0(D){if(Array.isArray(D))return D;if(D&&typeof D==="object")return Object.values(D);return[]}function V9(D,L){return X0(D).find((M)=>!!M&&typeof M==="object"&&M.id===L)}function Y9(D,L){if(!L||typeof L!=="object")return;let M=L,H=M[D]??M[K9(D).baseName];return typeof H==="string"&&H?H:void 0}function L9(D){let L;try{L=D.pieSupports}catch{return}if(!Array.isArray(L))return;return L.filter((M)=>typeof M==="string")}function q9(D,L){if(!D||typeof D!=="object")return null;let{id:M,element:H}=D;if(typeof H!=="string"||!H)return null;let p=Y9(H,L),FJ=j9(H,p),$J=typeof customElements>"u"?void 0:customElements;for(let IJ of FJ){let pJ=$J?.get(IJ);if(pJ)return{elementId:typeof M==="string"?M:void 0,tag:H,packageSpec:p,supports:L9(pJ),pendingTags:[]}}return{elementId:typeof M==="string"?M:void 0,tag:H,packageSpec:p,supports:void 0,pendingTags:$J?FJ:[]}}function d0(D){let L,M;if(U9(D))L=D.item.config,M=[V9(L?.models,D.elementId)];else if(X9(D))L=D.item?.config,M=X0(L?.models);else if(Q9(D))L=D.passage?.config,M=X0(L?.models);else return[];return M.flatMap((H)=>{let p=q9(H,L?.elements);return p?[p]:[]})}function l0(){let D=null;return(L,M)=>{if(!L)return D=null,null;let H=L.visibleTools.map((p)=>({toolId:p.toolId,required:p.required,alwaysAvailable:p.alwaysAvailable,activateAtInit:p.activateAtInit,parameters:p.parameters}));if(D?.renderVersion===M&&r0(D.tools,H))return D.tools;return D={renderVersion:M,tools:H},H}}import"@pie-players/pie-players-shared/nds-icon-button";var D9=(D,L)=>{if(customElements.get(D))return;try{customElements.define(D,L)}catch(M){if(!(M instanceof DOMException&&M.name==="NotSupportedError"||M&&typeof M==="object"&&M.name==="NotSupportedError")||!customElements.get(D))throw M}},n0=(D,L=AZ)=>{var M=xJ(),H=yJ(M);{var p=(n)=>{var jJ=t0();Q0(jJ,()=>o0(L()),!0),GJ(jJ),y(n,jJ)},FJ=G(()=>a0(L())),$J=(n)=>{var jJ=R9();o(()=>l(jJ,"src",L())),y(n,jJ)},IJ=G(()=>i0(L())),pJ=(n)=>{let jJ=G(()=>s0(L()));var iJ=xJ(),vJ=yJ(iJ);{var qZ=(PJ)=>{var WJ=t0();Q0(WJ,()=>o0(J(jJ)),!0),GJ(WJ),y(PJ,WJ)},SZ=(PJ)=>{var WJ=k9();o(()=>OJ(WJ,1,`icon icon-${L()}`,"svelte-1c13522")),y(PJ,WJ)};NJ(vJ,(PJ)=>{if(J(jJ))PJ(qZ);else PJ(SZ,-1)})}y(n,iJ)};NJ(H,(n)=>{if(J(FJ))n(p);else if(J(IJ))n($J,1);else n(pJ,-1)})}y(D,M)},t0=LJ('<span aria-hidden="true"></span>'),R9=LJ('<img class="item-toolbar__icon-image svelte-1c13522" alt=""/>'),k9=LJ('<i aria-hidden="true"></i>'),e0=LJ("<span></span>"),z9=LJ('<span class="item-toolbar__nds-button-zoom svelte-1c13522"><nds-icon-button></nds-icon-button></span>',2),H9=LJ("<a><!></a>"),w9=LJ('<button type="button"><!></button>'),B9=LJ("<div></div>"),I9=LJ('<div><div class="item-toolbar__tools-row svelte-1c13522"><!> <!> <!></div> <!></div>'),T9={hash:"svelte-1c13522",code:`.item-toolbar.svelte-1c13522 {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-1c13522 {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
2
 
3
3
  /* A granted section tool must stay reachable even when there isn't room for
4
4
  every button: scroll the row rather than clipping items past the edge,
@@ -12,6 +12,7 @@
12
12
  * warnings and the toolbar and surface render helpers.
13
13
  */
14
14
  import { dynamicMessageKey } from "@pie-players/pie-players-shared/i18n/provider";
15
+ import { settleAll } from "@pie-players/pie-players-shared/promise";
15
16
  import { resolveToolTag, } from "../tools/tool-tag-map.js";
16
17
  import { PENDING_INPUT_WARNING_DELAY_MS, warnOncePerDocument, } from "../runtime/page-warnings.js";
17
18
  const logToolCallbackFailure = (toolId, phase, error) => console.error(`[ToolRegistry] Tool '${toolId}' ${phase} check threw:`, error);
@@ -608,7 +609,7 @@ export class ToolRegistry {
608
609
  * tools loaded and usable. A failed tool is retried on the next call.
609
610
  */
610
611
  async ensureToolModulesLoaded(toolIds) {
611
- const results = await Promise.allSettled(toolIds.map((toolId) => this.ensureToolModuleLoaded(toolId)));
612
+ const results = await settleAll(toolIds.map((toolId) => this.ensureToolModuleLoaded(toolId)));
612
613
  const failures = new Map();
613
614
  results.forEach((result, index) => {
614
615
  if (result.status === "rejected")
@@ -21,6 +21,7 @@
21
21
  * - tool-open requests;
22
22
  * - config-change application and TTS reconfiguration, last.
23
23
  */
24
+ import { settleAll } from "@pie-players/pie-players-shared/promise";
24
25
  import { normalizeToolsConfig, } from "./tools-config-normalizer.js";
25
26
  import { collectToolConfigDiagnostics, normalizeToolConfigStrictness, reportToolConfigDiagnostics, } from "./tool-config-validation.js";
26
27
  import { AccessibilityCatalogResolver } from "./AccessibilityCatalogResolver.js";
@@ -1272,7 +1273,7 @@ export class ToolkitCoordinator {
1272
1273
  // retired controller out of the cache immediately, but do not let its
1273
1274
  // replacement hydrate until that exact cohort's save/dispose pipeline has
1274
1275
  // settled. Other cohorts remain independent.
1275
- await Promise.allSettled([pendingDisposal]);
1276
+ await settleAll([pendingDisposal]);
1276
1277
  }
1277
1278
  if (this.disposePromise !== null) {
1278
1279
  throw new ToolkitCoordinatorDisposedError();
@@ -1540,7 +1541,7 @@ export class ToolkitCoordinator {
1540
1541
  return existingDisposal;
1541
1542
  if (!initEntry)
1542
1543
  return Promise.resolve();
1543
- const retirementBarrier = Promise.allSettled([initEntry.promise]).then(() => undefined);
1544
+ const retirementBarrier = settleAll([initEntry.promise]).then(() => undefined);
1544
1545
  return this.trackSectionControllerDisposal(mapKey, retirementBarrier);
1545
1546
  }
1546
1547
  const persistenceStrategy = this.sectionPersistenceStrategies.get(mapKey);
@@ -1576,7 +1577,7 @@ export class ToolkitCoordinator {
1576
1577
  persistenceStrategy,
1577
1578
  });
1578
1579
  const disposalBarrier = initEntry
1579
- ? Promise.allSettled([initEntry.promise]).then(() => controllerDisposalPromise)
1580
+ ? settleAll([initEntry.promise]).then(() => controllerDisposalPromise)
1580
1581
  : controllerDisposalPromise;
1581
1582
  return this.trackSectionControllerDisposal(mapKey, disposalBarrier);
1582
1583
  }
@@ -1694,7 +1695,7 @@ export class ToolkitCoordinator {
1694
1695
  attemptId: key.attemptId,
1695
1696
  });
1696
1697
  }
1697
- await Promise.allSettled(Array.from(this.sectionControllerDisposePromises.values()));
1698
+ await settleAll(Array.from(this.sectionControllerDisposePromises.values()));
1698
1699
  this.sectionControllers.clear();
1699
1700
  this.sectionControllerKeys.clear();
1700
1701
  this.sectionControllerInitEntries.clear();
@@ -1742,7 +1743,7 @@ export class ToolkitCoordinator {
1742
1743
  for (const promise of this.providerInitPromises.values()) {
1743
1744
  pending.add(promise);
1744
1745
  }
1745
- await Promise.allSettled(pending);
1746
+ await settleAll(pending);
1746
1747
  }
1747
1748
  /**
1748
1749
  * Initialize the TTS service from the `textToSpeech` tool config.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-players/pie-assessment-toolkit",
3
- "version": "1.0.0-beta.1",
3
+ "version": "1.0.0-beta.2",
4
4
  "type": "module",
5
5
  "description": "PIE assessment toolkit: composable services + reference implementation for assessment players and tool coordination",
6
6
  "license": "MIT",
@@ -69,17 +69,17 @@
69
69
  "test": "bun test"
70
70
  },
71
71
  "dependencies": {
72
- "@pie-players/pie-calculator": "1.0.0-beta.1",
73
- "@pie-players/pie-context": "1.0.0-beta.1",
74
- "@pie-players/pie-players-shared": "1.0.0-beta.1",
75
- "@pie-players/pie-tts": "1.0.0-beta.1",
72
+ "@pie-players/pie-calculator": "1.0.0-beta.2",
73
+ "@pie-players/pie-context": "1.0.0-beta.2",
74
+ "@pie-players/pie-players-shared": "1.0.0-beta.2",
75
+ "@pie-players/pie-tts": "1.0.0-beta.2",
76
76
  "speech-rule-engine": "5.0.0-rc.4"
77
77
  },
78
78
  "devDependencies": {
79
79
  "@biomejs/biome": "^2.5.15",
80
80
  "@happy-dom/global-registrator": "^20.14.5",
81
- "@pie-players/tts-client-server": "1.0.0-beta.1",
82
- "svelte": "^5.57.1",
81
+ "@pie-players/tts-client-server": "1.0.0-beta.2",
82
+ "svelte": "^5.57.2",
83
83
  "svelte-check": "^4.7.6",
84
84
  "typescript": "^5.9.3"
85
85
  },
@@ -1,4 +0,0 @@
1
- var g9="5";if(typeof window<"u")((window.__svelte??={}).v??=new Set).add(g9);var o7=Array.isArray,h9=Array.prototype.indexOf,qQ=Array.prototype.includes,AQ=Array.from,mQ=Object.keys,P7=Object.defineProperty,H7=Object.getOwnPropertyDescriptor,X0=Object.getOwnPropertyDescriptors,h0=Object.prototype,v9=Array.prototype,$Q=Object.getPrototypeOf,v0=Object.isExtensible;var h7=()=>{};function Z0(Q){for(var J=0;J<Q.length;J++)Q[J]()}function z0(){var Q,J,W=new Promise((K,X)=>{Q=K,J=X});return{promise:W,resolve:Q,reject:J}}var g=2,v7=4,e7=8,UQ=16777216,n=16,i=32,z7=64,NQ=128,G0=256,G7=512,T=1024,N=2048,m=4096,d=8192,y=16384,V7=32768,QQ=33554432,B7=65536,PQ=131072,m0=262144,m7=524288,m9=1048576,x7=33554432,uQ=2097152,N7=4194304,R7=8388608,q7=Symbol("$state"),V0=Symbol("component"),pQ=Symbol("legacy props"),u9=Symbol(""),u0=Symbol("proxy path"),q0=Symbol("attributes"),fQ=Symbol("class"),p0=Symbol("style"),dQ=Symbol("text"),f0=Symbol("form reset"),p9=Symbol("hmr anchor"),s7=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"},d0=!!globalThis.document?.contentType&&globalThis.document.contentType.includes("xml");var RQ=3,D7=8;var f9=1,d9=2,_0=4,_9=8,l9=16,i9=1,c9=2,o9=4,s9=8,r9=16;var a9=1,n9=2;var jQ="[",JQ="[!",l0="[?",HQ="]",u7={};var E=Symbol("uninitialized"),E7=Symbol("filename"),t9=Symbol("hmr"),$0="http://www.w3.org/1999/xhtml",_Q="http://www.w3.org/2000/svg",i0="http://www.w3.org/1998/Math/MathML";function e9(){console.warn("https://svelte.dev/e/derived_inert")}function QJ(Q,J,W){console.warn("https://svelte.dev/e/hydration_attribute_changed")}function WQ(Q){console.warn("https://svelte.dev/e/hydration_mismatch")}function JJ(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function WJ(Q){var J=L;if(J===null)return O.f|=R7,Q;if((J.f&V7)===0&&(J.f&v7)===0)throw Q;Y7(Q,J)}function Y7(Q,J){if(J!==null&&(J.f&y)!==0)return;while(J!==null){if((J.f&NQ)!==0&&(J.f&(y|QQ))===0){if((J.f&V7)===0)throw Q;try{J.b.error(Q);return}catch(W){Q=W}}J=J.parent}throw Q}function XJ(){throw Error("https://svelte.dev/e/async_derived_orphan")}function ZJ(Q,J,W){throw Error("https://svelte.dev/e/each_key_duplicate")}function zJ(Q){throw Error("https://svelte.dev/e/effect_in_teardown")}function GJ(){throw Error("https://svelte.dev/e/effect_in_unowned_derived")}function VJ(Q){throw Error("https://svelte.dev/e/effect_orphan")}function qJ(){throw Error("https://svelte.dev/e/effect_update_depth_exceeded")}function $J(){throw Error("https://svelte.dev/e/hydration_failed")}function UJ(Q){throw Error("https://svelte.dev/e/props_invalid_value")}function PJ(){throw Error("https://svelte.dev/e/state_descriptors_fixed")}function HJ(){throw Error("https://svelte.dev/e/state_prototype_fixed")}function BJ(){throw Error("https://svelte.dev/e/state_unsafe_mutation")}function YJ(){throw Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}var Q7=!1,KQ=!1;var C=null;function r7(Q){C=Q}function c0(Q,J=!1,W){C={p:C,i:!1,c:null,e:null,s:Q,x:null,r:L,l:KQ&&!J?{s:null,u:null,$:[]}:null}}function o0(Q){var J=C,W=J.e;if(W!==null){J.e=null;for(var K of W)s0(K)}if(Q!==void 0)J.x=Q;return J.i=!0,C=J.p,lQ(Q)}function lQ(Q={}){return P7(Q,V0,{value:!0}),Q}function k7(){return!KQ||C!==null&&C.l===null}var BQ=[];function LJ(){var Q=BQ;BQ=[],Z0(Q)}function s(Q){if(BQ.length===0&&!YQ){var J=BQ;queueMicrotask(()=>{if(J===BQ)LJ()})}BQ.push(Q)}function FJ(){while(BQ.length>0)LJ()}function P0(Q){return Q===this.v}function H0(Q,J){return Q!=Q?J==J:Q!==J||Q!==null&&typeof Q==="object"||typeof Q==="function"}function B0(Q){return!H0(Q,this.v)}function MQ(Q,J){return Q.label=J,r0(Q.v,J),Q}function r0(Q,J){return Q?.[u0]?.(J),Q}function p7(Q){var J=O,W=L;u(null),_(null);try{return Q()}finally{u(J),_(W)}}function L0(Q,J,W,K){let X=k7()?ZQ:LQ;var Z=Q.filter((q)=>!q.settled),z=J.map(X);if(W.length===0&&Z.length===0){K(z);return}var G=L,V=DJ(),H=Z.length===1?Z[0].promise:Z.length>1?Promise.all(Z.map((q)=>q.promise)):null;function P(q){if((G.f&y)!==0)return;V();try{K([...z,...q])}catch(B){Y7(B,G)}TQ()}var $=a0();if(W.length===0){H.then(()=>P([])).finally($);return}function U(){Promise.all(W.map((q)=>n0(q))).then(P).catch((q)=>Y7(q,G)).finally($)}if(H)H.then(()=>{V(),U(),TQ()});else U()}function DJ(){var Q=L,J=O,W=C,K=S;if(!1)var X;return function(z=!0){if(_(Q),u(J),r7(W),z&&(Q.f&y)===0)K?.activate(),K?.apply()}}var N4=!1;function TQ(Q=!0){if(N4=!1,_(null),u(null),r7(null),Q)S?.deactivate()}function a0(){var Q=L,J=Q.b,W=S,K=!!J?.is_rendered();return J?.update_pending_count(1,W),W.increment(K,Q),()=>{J?.update_pending_count(-1,W),W.decrement(K,Q)}}var T4=~(N|m|T);function j(Q,J){Q.f=Q.f&T4|J}function xQ(Q){if((Q.f&G7)!==0||Q.deps===null)j(Q,T);else j(Q,m)}function ZQ(Q){var J=g|N;if(L!==null)L.f|=m7;return{ctx:C,deps:null,effects:null,equals:P0,f:J,fn:Q,reactions:null,rv:0,v:E,wv:0,parent:L,ac:null}}var EQ=Symbol("obsolete");function n0(Q,J,W){let K=L;if(K===null)XJ();var X=void 0,Z=K7(E),z=!O,G=new Set;return wJ(()=>{var V=L,H=z0();X=H.promise;try{Promise.resolve(Q()).then(H.resolve,(q)=>{if(q!==s7)H.reject(q)}).finally(TQ)}catch(q){H.reject(q),TQ()}var P=S;if(z){if((V.f&V7)!==0)var $=a0();if(K.b?.is_rendered())P.async_deriveds.get(V)?.reject(EQ);else for(let q of G.values())q.reject(EQ);G.add(H),P.async_deriveds.set(V,H)}let U=(q,B=void 0)=>{if($?.(),G.delete(H),B===EQ)return;if(P.activate(),B)Z.f|=R7,b7(Z,B);else{if((Z.f&R7)!==0)Z.f^=R7;b7(Z,q)}P.deactivate()};H.promise.then(U,(q)=>U(null,q||"unknown"))}),W7(()=>{for(let V of G)V.reject(EQ)}),new Promise((V)=>{function H(P){function $(){if(P===X)V(Z);else H(X)}P.then($,$)}H(X)})}function x4(Q){let J=ZQ(Q);if(!Q7)O0(J);return J}function LQ(Q){let J=ZQ(Q);return J.equals=B0,J}function E4(Q){var J=Q.effects;if(J!==null){Q.effects=null;for(var W=0;W<J.length;W+=1)v(J[W])}}function cQ(Q){var J,W=L,K=Q.parent;if(!S7&&K!==null&&Q.v!==E&&(K.f&(y|d))!==0)return e9(),Q.v;_(K);try{E4(Q),J=J9(Q)}finally{_(W)}return J}function e0(Q){var J=cQ(Q);if(!Q.equals(J)){if(Q.wv=rQ(),!S?.is_fork||Q.deps===null){if(S!==null)S.capture(Q,J,!0),FQ?.capture(Q,J,!0);else Q.v=J;if(Q.deps===null){j(Q,T);return}}}if(S7)return;if(r!==null){if(XQ()||S?.is_fork)r.set(Q,J)}else xQ(Q)}function SJ(Q){if(Q.effects===null)return;for(let J of Q.effects)if(J.teardown||J.ac){if(J.teardown?.(),J.ac!==null)p7(()=>{J.ac.abort(s7),J.ac=null});if(J.fn!==null)J.teardown=h7;OQ(J,0),sQ(J)}}function Q9(Q){if(Q.effects===null)return;for(let J of Q.effects)if(J.teardown&&J.fn!==null)f7(J)}var oQ=new Set,j7=new Map;var CJ=!1;function K7(Q,J){var W={f:0,v:Q,reactions:null,equals:P0,rv:0,wv:0};return W}function d7(Q,J){let W=K7(Q,J);return O0(W),W}function SQ(Q,J=!1,W=!0){let K=K7(Q);if(!J)K.equals=B0;if(KQ&&W&&C!==null&&C.l!==null)(C.l.s??=[]).push(K);return K}function X7(Q,J,W=!1){if(O!==null&&(!C7||(O.f&PQ)!==0)&&k7()&&(O.f&(g|n|N7|PQ))!==0&&(y7===null||!y7.has(Q)))BJ();let K=W?a7(J):J;return b7(Q,K,aQ)}var DQ=null,W9=0;function b7(Q,J,W=null){if(!Q.equals(J)){if(S7)j7.set(Q,J);else if(!j7.has(Q))j7.set(Q,Q.v);var K=J7.ensure();if(K.capture(Q,J),(Q.f&g)!==0){let X=Q;if((Q.f&N)!==0)cQ(X);if(r===null)xQ(X)}if(Q.wv=rQ(),DQ=null,W9=0,IJ(Q,N,W),DQ=null,k7()&&L!==null&&(L.f&T)!==0&&(L.f&(i|z7))===0)if(w7===null)AJ([Q]);else w7.push(Q);if(!K.is_fork&&oQ.size>0&&!CJ)K9()}return J}function K9(){CJ=!1;for(let Q of oQ){if((Q.f&T)!==0)j(Q,m);let J;try{J=zQ(Q)}catch{J=!0}if(J)f7(Q)}oQ.clear()}function wQ(Q){X7(Q,Q.v+1)}function IJ(Q,J,W){var K=Q.reactions;if(K===null)return;var X=k7(),Z=K.length;if(W9+=Z,W9>1e5&&DQ===null)DQ=new Set;if(DQ!==null){if(DQ.has(Q))return;DQ.add(Q)}for(var z=0;z<Z;z++){var G=K[z],V=G.f;if(!X&&G===L)continue;var H=(V&N)===0;if(H)j(G,J);if((V&PQ)!==0)oQ.add(G);else if((V&g)!==0){var P=G;r?.delete(P),IJ(P,m,W)}else if(H){var $=G;if((V&n)!==0&&T7!==null)T7.add($);if(W!==null)W.push($);else nQ($)}}}function D0(Q,J,W){if((Q.f&N)!==0)J.add(Q);else if((Q.f&m)!==0)W.add(Q);j(Q,T)}var S0=null,kQ=null,S=null,FQ=null,r=null,Z9=null,YQ=!1,X9=!1,bQ=null,aQ=null,NJ=0;var y4=1;class J7{id=y4++;#Q=!1;linked=!0;#J=null;#W=null;async_deriveds=new Map;current=new Map;previous=new Map;#G=new Set;#X=new Set;#z=0;#K=new Map;#V=null;#Z=[];#B=[];#q=new Set;#$=new Set;#P=new Map;#M=new Set;is_fork=!1;#U=!1;constructor(){if(kQ===null)S0=kQ=this;else kQ.#W=this,this.#J=kQ;kQ=this}#D(){if(this.is_fork)return!0;for(let W of this.#K.keys()){var Q=W,J=!1;while(Q.parent!==null){if(this.#P.has(Q)){J=!0;break}Q=Q.parent}if(!J)return!0}return!1}skip_effect(Q){if(!this.#P.has(Q))this.#P.set(Q,{d:[],m:[]});this.#M.delete(Q)}unskip_effect(Q,J=(W)=>this.schedule(W)){var W=this.#P.get(Q);if(W){this.#P.delete(Q);for(var K of W.d)j(K,N),J(K);for(K of W.m)j(K,m),J(K)}this.#M.add(Q)}#S(){var Q=[];for(let X of this.#Z){if((X.f&y)!==0||(X.f&(N|m))===0)continue;var J=X,W=!1;while(J.parent!==null){J=J.parent;var K=J.f;if((K&(z7|i))!==0){if((K&T)===0){W=!0;break}J.f^=T}}if(!W)Q.push(J)}return this.#Z=[],Q}#L(){this.#Q=!0;for(let z of this.#q)this.#$.delete(z),j(z,N),this.schedule(z);for(let z of this.#$)j(z,m),this.schedule(z);this.apply();var Q=bQ=[],J=[],W=aQ=[];while(this.#Z.length>0){if(NJ++>1000)this.#Y(),g4();for(let z of this.#S())try{this.#F(z,Q,J)}catch(G){if(xJ(z),!this.#D())this.discard();throw G}}if(S=null,W.length>0){var K=J7.ensure();for(let z of W)K.schedule(z)}if(bQ=null,aQ=null,this.#D()){this.#H(J),this.#H(Q);for(let[z,G]of this.#P)TJ(z,G);if(W.length>0)S.#L();return}let X=this.#C();if(X){this.#H(J),this.#H(Q),X.#w(this);return}this.#q.clear(),this.#$.clear();for(let z of this.#G)z(this);this.#G.clear(),FQ=this,RJ(J),RJ(Q),FQ=null,this.#V?.resolve();var Z=S;if(this.#z===0&&(this.#Z.length===0||Z!==null)){if(this.#Y(),Q7)this.#O(),S=Z}if(this.#Z.length>0)if(Z!==null){for(let z of this.#Z)Z.#Z.push(z);this.#Z=[]}else Z=this;if(Z!==null)j7.clear(),Z.#L()}#F(Q,J,W){Q.f^=T;var K=Q.first;while(K!==null){var X=K.f,Z=(X&(i|z7))!==0,z=Z&&(X&T)!==0,G=z||(X&d)!==0||this.#P.has(K);if(!G&&K.fn!==null){if(Z)K.f^=T;else if((X&v7)!==0)J.push(K);else if(Q7&&(X&(e7|UQ))!==0)W.push(K);else if(zQ(K)){if((X&n)!==0)this.#$.add(K);f7(K)}var V=K.first;if(V!==null){K=V;continue}}while(K!==null){var H=K.next;if(H!==null){K=H;break}K=K.parent}}}#C(){var Q=this.#J;while(Q!==null){if(!Q.is_fork){for(let[J,[,W]]of this.current)if(Q.current.has(J)&&!W)return Q}Q=Q.#J}return null}#w(Q){for(let[W,K]of Q.current){if(!this.previous.has(W)&&Q.previous.has(W))this.previous.set(W,Q.previous.get(W));this.current.set(W,K)}for(let[W,K]of Q.async_deriveds){let X=this.async_deriveds.get(W);if(X)K.promise.then(X.resolve).catch(X.reject)}Q.async_deriveds.clear(),this.transfer_effects(Q.#q,Q.#$);let J=(W)=>{var K=W.reactions;if(K===null)return;if((W.f&g)!==0&&(W.f&(N|m))===0)return;for(let z of K){var X=z.f;if((X&g)!==0)J(z);else{var Z=z;if(X&(N7|n)&&!this.async_deriveds.has(Z))this.#$.delete(Z),j(Z,N),this.schedule(Z)}}};for(let W of this.current.keys())J(W);this.oncommit(()=>Q.discard()),Q.#Y(),S=this,this.#L()}#H(Q){for(var J=0;J<Q.length;J+=1)D0(Q[J],this.#q,this.#$)}capture(Q,J,W=!1){if(Q.v!==E&&!this.previous.has(Q))this.previous.set(Q,Q.v);if((Q.f&R7)===0)this.current.set(Q,[J,W]),r?.set(Q,J);if(!this.is_fork)Q.v=J}activate(){S=this}deactivate(){S=null,r=null}flush(){try{X9=!0,S=this,this.#L()}finally{NJ=0,Z9=null,bQ=null,aQ=null,X9=!1,S=null,r=null,j7.clear()}}discard(){for(let Q of this.#X)Q(this);this.#X.clear();for(let Q of this.async_deriveds.values())Q.reject(EQ);this.#Y(),this.#V?.resolve()}register_created_effect(Q){this.#B.push(Q)}#O(){for(let P=S0;P!==null;P=P.#W){var Q=P.id<this.id,J=[];for(let[$,[U,q]]of this.current){if(P.current.has($)){var W=P.current.get($)[0];if(Q&&U!==W)P.current.set($,[U,q]);else continue}J.push($)}if(Q)for(let[$,U]of this.async_deriveds){let q=P.async_deriveds.get($);if(q)U.promise.then(q.resolve).catch(q.reject)}var K=[...P.current.keys()].filter(($)=>!P.current.get($)[1]);if(!P.#Q||K.length===0)continue;var X=K.filter(($)=>!this.current.has($));if(X.length===0){if(Q)P.discard()}else if(J.length>0){if(Q)for(let $ of this.#M)P.unskip_effect($,(U)=>{if((U.f&(n|N7))!==0)P.schedule(U);else P.#H([U])});P.activate();var Z=new Set,z=new Map;for(var G of J)jJ(G,X,Z,z);z=new Map;var V=[...P.current].filter(([$,U])=>{let q=this.current.get($);if(!q)return!0;return q[0]!==U[0]||q[1]!==U[1]}).map(([$])=>$);if(V.length>0){for(let $ of this.#B)if(($.f&(y|d|PQ))===0&&z9($,V,z))if(($.f&(N7|n))!==0)j($,N),P.schedule($);else P.#q.add($)}if(P.#Z.length>0&&!P.#U){P.apply();for(var H of P.#S())P.#F(H,[],[])}P.deactivate()}}}increment(Q,J){if(this.#z+=1,Q){let W=this.#K.get(J)??0;this.#K.set(J,W+1)}}decrement(Q,J){if(this.#z-=1,Q){let W=this.#K.get(J)??0;if(W===1)this.#K.delete(J);else this.#K.set(J,W-1)}if(this.#U)return;this.#U=!0,s(()=>{if(this.#U=!1,this.linked)this.flush()})}transfer_effects(Q,J){for(let W of Q)this.#q.add(W);for(let W of J)this.#$.add(W);Q.clear(),J.clear()}oncommit(Q){this.#G.add(Q)}ondiscard(Q){this.#X.add(Q)}settled(){return(this.#V??=z0()).promise}static ensure(){if(S===null){let Q=S=new J7;if(!X9&&!YQ)s(()=>{if(!Q.#Q)Q.flush()})}return S}apply(){if(!Q7||!this.is_fork&&this.#J===null&&this.#W===null){r=null;return}r=new Map;for(let[J,[W]]of this.current)r.set(J,W);for(let J=S0;J!==null;J=J.#W){if(J===this||J.is_fork)continue;var Q=!1;if(J.id<this.id)for(let[W,[,K]]of J.current){if(K)continue;if(this.current.has(W)){Q=!0;break}}if(!Q){for(let[W,K]of J.previous)if(!r.has(W))r.set(W,K)}}}schedule(Q){if(Z9=Q,Q.b?.is_pending&&(Q.f&(v7|e7|UQ))!==0&&(Q.f&V7)===0){Q.b.defer_effect(Q);return}this.#Z.push(Q)}#Y(){if(!this.linked)return;var Q=this.#J,J=this.#W;if(Q===null)S0=J;else Q.#W=J;if(J===null)kQ=Q;else J.#J=Q;this.linked=!1}}function yQ(Q){var J=YQ;YQ=!0;try{var W;if(Q){if(S!==null&&!S.is_fork)S.flush();W=Q()}while(!0){if(FJ(),S===null)return W;S.flush()}}finally{YQ=J}}function g4(){if(!1){var Q;for(let W of S.current.keys())for(let[K,X]of W.updated??[])var J}try{qJ()}catch(W){Y7(W,Z9)}}var T7=null;function RJ(Q){var J=Q.length;if(J===0)return;var W=0;while(W<J){var K=Q[W++];if((K.f&(y|d))===0&&zQ(K)){if(T7=new Set,f7(K),K.deps===null&&K.first===null&&K.nodes===null&&K.teardown===null&&K.ac===null)G9(K);if(T7?.size>0){j7.clear();for(let X of T7){if((X.f&(y|d))!==0)continue;let Z=[X],z=X.parent;while(z!==null){if(T7.has(z))T7.delete(z),Z.push(z);z=z.parent}for(let G=Z.length-1;G>=0;G--){let V=Z[G];if((V.f&(y|d))!==0)continue;f7(V)}}T7.clear()}}}T7=null}function jJ(Q,J,W,K){if(W.has(Q))return;if(W.add(Q),Q.reactions!==null)for(let X of Q.reactions){let Z=X.f;if((Z&g)!==0)jJ(X,J,W,K);else if((Z&(N7|n))!==0&&(Z&N)===0&&z9(X,J,K))j(X,N),nQ(X)}}function z9(Q,J,W){let K=W.get(Q);if(K!==void 0)return K;if(Q.deps!==null)for(let X of Q.deps){if(qQ.call(J,X))return!0;if((X.f&g)!==0&&z9(X,J,W))return W.set(X,!0),!0}return W.set(Q,!1),!1}function nQ(Q){S.schedule(Q)}function TJ(Q,J){if((Q.f&i)!==0&&(Q.f&T)!==0)return;if((Q.f&N)!==0)J.d.push(Q);else if((Q.f&m)!==0)J.m.push(Q);j(Q,T);var W=Q.first;while(W!==null)TJ(W,J),W=W.next}function xJ(Q){j(Q,T);var J=Q.first;while(J!==null)xJ(J),J=J.next}function kJ(Q){if(L===null){if(O===null)VJ(Q);GJ()}if(S7)zJ(Q)}function v4(Q,J){var W=J.last;if(W===null)J.last=J.first=Q;else W.next=Q,Q.prev=W,J.last=Q}function _7(Q,J){var W=L;if(W!==null&&(W.f&d)!==0)Q|=d;var K={ctx:C,deps:null,nodes:null,f:Q|N|G7,first:null,fn:J,last:null,next:null,parent:W,b:W&&W.b,prev:null,teardown:null,wv:0,ac:null};S?.register_created_effect(K);var X=K;if((Q&v7)!==0)if(bQ!==null)bQ.push(K);else J7.ensure().schedule(K);else if(J!==null){try{f7(K)}catch(z){throw v(K),z}if(X.deps===null&&X.teardown===null&&X.nodes===null&&X.first===X.last&&(X.f&m7)===0){if(X=X.first,(Q&n)!==0&&(Q&B7)!==0&&X!==null)X.f|=B7}}if(X!==null){if(X.parent=W,W!==null)v4(X,W);if(O!==null&&(O.f&g)!==0&&(Q&z7)===0){var Z=O;(Z.effects??=[]).push(X)}}return K}function XQ(){return O!==null&&!C7}function W7(Q){let J=_7(e7,null);return j(J,T),J.teardown=Q,J}function q9(Q){kJ("$effect");var J=L.f,W=!O&&(J&i)!==0&&C!==null&&!C.i;if(W){var K=C;(K.e??=[]).push(Q)}else return s0(Q)}function s0(Q){return _7(v7|m9,Q)}function $9(Q){J7.ensure();let J=_7(z7|m7,Q);return()=>{v(J)}}function bJ(Q){J7.ensure();let J=_7(z7|m7,Q);return(W={})=>{return new Promise((K)=>{if(W.outro)l7(J,()=>{v(J),K(void 0)});else v(J),K(void 0)})}}function U7(Q){return _7(v7,Q)}function wJ(Q){return _7(N7|m7,Q)}function a(Q,J=0){return _7(e7|J,Q)}function U9(Q,J=[],W=[],K=[]){L0(K,J,W,(X)=>{_7(e7,()=>{Q(...X.map(A))})})}function L7(Q,J=0){var W=_7(n|J,Q);return W}function o(Q){return _7(i|m7,Q)}function P9(Q){var J=Q.teardown;if(J!==null){let W=S7,K=O;V9(!0),u(null);try{J.call(null)}catch(X){Y7(X,Q.parent)}finally{V9(W),u(K)}}}function sQ(Q,J=!1){var W=Q.first;Q.first=Q.last=null;while(W!==null){let X=W.ac;if(X!==null)p7(()=>{X.abort(s7)});var K=W.next;if((W.f&z7)!==0)W.parent=null;else v(W,J);W=K}}function yJ(Q){var J=Q.first;while(J!==null){var W=J.next;if((J.f&i)===0)v(J);J=W}}function v(Q,J=!0){var W=!1;if((J||(Q.f&m0)!==0)&&Q.nodes!==null&&Q.nodes.end!==null)H9(Q.nodes.start,Q.nodes.end),W=!0;Q.f|=QQ,sQ(Q,J&&!W),OQ(Q,0);var K=Q.nodes&&Q.nodes.t;if(K!==null)for(let Z of K)Z.stop();P9(Q),Q.f^=QQ,Q.f|=y;var X=Q.parent;if(X!==null&&X.first!==null)G9(Q);Q.next=Q.prev=Q.teardown=Q.ctx=Q.deps=Q.fn=Q.nodes=Q.ac=Q.b=null}function H9(Q,J){while(Q!==null){var W=Q===J?null:c(Q);Q.remove(),Q=W}}function G9(Q){var{parent:J,prev:W,next:K}=Q;if(W!==null)W.next=K;if(K!==null)K.prev=W;if(J!==null){if(J.first===Q)J.first=K;if(J.last===Q)J.last=W}}function l7(Q,J,W=!0){var K=[];Q.f|=G0,gJ(Q,K,!0);var X=()=>{if(W)v(Q);if(J)J()},Z=K.length;if(Z>0){var z=()=>--Z||X();for(var G of K)G.out(z)}else X()}function gJ(Q,J,W){if((Q.f&d)!==0)return;Q.f^=d;var K=Q.nodes&&Q.nodes.t;if(K!==null){for(let G of K)if(G.is_global||W)J.push(G)}var X=Q.first;while(X!==null){var Z=X.next;if((X.f&z7)===0){var z=(X.f&B7)!==0||(X.f&i)!==0&&(Q.f&n)!==0;gJ(X,J,z?W:!1)}X=Z}}function gQ(Q){Q.f&=~G0,hJ(Q,!0)}function hJ(Q,J){if((Q.f&G0)!==0)return;if((Q.f&d)===0)return;if(Q.f^=d,(Q.f&T)===0)j(Q,N),J7.ensure().schedule(Q);var W=Q.first;while(W!==null){var K=W.next,X=(W.f&B7)!==0||(W.f&i)!==0;hJ(W,X?J:!1),W=K}var Z=Q.nodes&&Q.nodes.t;if(Z!==null){for(let z of Z)if(z.is_global||J)z.in()}}function hQ(Q,J){if(!Q.nodes)return;var W=Q.nodes.start,K=Q.nodes.end;while(W!==null){var X=W===K?null:c(W);J.append(W),W=X}}var vJ=null;var w0=!1,S7=!1;function V9(Q){S7=Q}var O=null,C7=!1;function u(Q){O=Q}var L=null;function _(Q){L=Q}var y7=null;function O0(Q){if(O!==null&&(!Q7&&(O.f&uQ)!==0||(O.f&g)!==0))(y7??=new Set).add(Q)}var $7=null,M7=0,w7=null;function AJ(Q){w7=Q}var uJ=1,CQ=0,GQ=CQ;function B9(Q){GQ=Q}function rQ(){return++uJ}function zQ(Q){var J=Q.f;if((J&N)!==0)return!0;if((J&m)!==0){var W=Q.deps,K=W.length;for(var X=0;X<K;X++){var Z=W[X];if(zQ(Z))e0(Z);if(Z.wv>Q.wv)return!0}if((J&G7)!==0&&r===null)j(Q,T)}return!1}function pJ(Q,J,W=!0){var K=Q.reactions;if(K===null)return;if(!Q7&&y7!==null&&y7.has(Q))return;for(var X=0;X<K.length;X++){var Z=K[X];if((Z.f&g)!==0)pJ(Z,J,!1);else if(J===Z){if(W)j(Z,N);else if((Z.f&T)!==0)j(Z,m);nQ(Z)}}}function J9(Q){var J=$7,W=M7,K=w7,X=O,Z=y7,z=C,G=C7,V=GQ,H=Q.f;if($7=null,M7=0,w7=null,O=(H&(i|z7))===0?Q:null,y7=null,r7(Q.ctx),C7=!1,GQ=++CQ,Q.ac!==null)p7(()=>{Q.ac.abort(s7)}),Q.ac=null;try{Q.f|=uQ;var P=Q.fn,$=P();Q.f|=V7;var U=mJ(Q);if(k7()&&w7!==null&&!C7&&U!==null&&(Q.f&(g|m|N))===0)for(var q=0;q<w7.length;q++)pJ(w7[q],Q);if(X!==null&&X!==Q){if(CQ++,X.deps!==null)for(let B=0;B<W;B+=1)X.deps[B].rv=CQ;if(J!==null)for(let B of J)B.rv=CQ;if(w7!==null)if(K===null)K=w7;else K.push(...w7)}if((Q.f&R7)!==0)Q.f^=R7;return $}catch(B){return mJ(Q),WJ(B)}finally{Q.f^=uQ,$7=J,M7=W,w7=K,O=X,y7=Z,r7(z),C7=G,GQ=V}}function mJ(Q){var J=Q.deps,W=S?.is_fork;if($7!==null){var K;if(!W)OQ(Q,M7);if(J!==null&&M7>0){J.length=M7+$7.length;for(K=0;K<$7.length;K++)J[M7+K]=$7[K]}else Q.deps=J=$7;if(XQ()&&(Q.f&G7)!==0)for(K=M7;K<J.length;K++)(J[K].reactions??=[]).push(Q)}else if(!W&&J!==null&&M7<J.length)OQ(Q,M7),J.length=M7;return J}function u4(Q,J){let W=J.reactions;if(W!==null){var K=h9.call(W,Q);if(K!==-1){var X=W.length-1;if(X===0)W=J.reactions=null;else W[K]=W[X],W.pop()}}if(W===null&&(J.f&g)!==0&&($7===null||!qQ.call($7,J))){var Z=J;if((Z.f&G7)!==0)Z.f^=G7;if(Z.v!==E)xQ(Z);if(Z.ac!==null)p7(()=>{Z.ac.abort(s7),Z.ac=null,j(Z,N)});SJ(Z),OQ(Z,0)}}function OQ(Q,J){var W=Q.deps;if(W===null)return;for(var K=J;K<W.length;K++)u4(Q,W[K])}function f7(Q){var J=Q.f;if((J&y)!==0)return;j(Q,T);var W=L,K=w0;if(L=Q,w0=(J&(i|z7))===0,!1)var X,Z;try{if((J&(n|UQ))!==0)yJ(Q);else sQ(Q);P9(Q);var z=J9(Q);if(Q.teardown=typeof z==="function"?z:null,Q.wv=uJ,!1)for(var G of Q.deps);}finally{w0=K,L=W}}function A(Q){var J=Q.f,W=(J&g)!==0;if(vJ?.add(Q),O!==null&&!C7){var K=L!==null&&(L.f&y)!==0;if(!K&&(y7===null||!y7.has(Q))){var X=O.deps;if((O.f&uQ)!==0){if(Q.rv<CQ)if(Q.rv=CQ,$7===null&&X!==null&&X[M7]===Q)M7++;else if($7===null)$7=[Q];else $7.push(Q)}else{if(O.deps??=[],!qQ.call(O.deps,Q))O.deps.push(Q);var Z=Q.reactions;if(Z===null)Q.reactions=[O];else if(!qQ.call(Z,O))Z.push(O)}}}if(!1){if(!C7&&R4&&S===null&&FQ===null&&!R4.warned&&(R4.effect.f&uQ)===0&&!R4.effect_deps.has(Q))var z;if(t0&&!C7&&R5!==null&&O!==null&&R5.reaction===O){if(Q.trace);else if(z)var G,V}}if(S7&&j7.has(Q))return j7.get(Q);if(W){var H=Q;if(S7){var P=H.v;if((H.f&T)===0&&H.reactions!==null||dJ(H))P=cQ(H);return j7.set(H,P),P}var $=(H.f&G7)===0&&!C7&&O!==null&&(w0||(O.f&G7)!==0),U=(H.f&V7)===0;if(zQ(H)){if($)H.f|=G7;e0(H)}if($&&!U)Q9(H),fJ(H)}if(r?.has(Q))return r.get(Q);if((Q.f&R7)!==0)throw Q.v;return Q.v}function fJ(Q){if(Q.f|=G7,Q.deps===null)return;for(let J of Q.deps)if((J.reactions??=[]).push(Q),(J.f&g)!==0&&(J.f&G7)===0)Q9(J),fJ(J)}function dJ(Q){if(Q.v===E)return!0;if(Q.deps===null)return!1;for(let J of Q.deps){if(j7.has(J))return!0;if((J.f&g)!==0&&dJ(J))return!0}return!1}function k(Q){var J=C7;try{return C7=!0,Q()}finally{C7=J}}function I0(Q){if(typeof Q!=="object"||!Q||Q instanceof EventTarget)return;if(q7 in Q)C0(Q);else if(!Array.isArray(Q))for(let J in Q){let W=Q[J];if(typeof W==="object"&&W&&q7 in W)C0(W)}}function C0(Q,J=new Set){if(typeof Q==="object"&&Q!==null&&!(Q instanceof EventTarget)&&!J.has(Q)){if(J.add(Q),Q instanceof Date)Q.getTime();for(let K in Q)try{C0(Q[K],J)}catch(X){}let W=$Q(Q);if(W!==Object.prototype&&W!==Array.prototype&&W!==Map.prototype&&W!==Set.prototype&&W!==Date.prototype){let K=X0(W);for(let X in K){let Z=K[X].get;if(Z)try{Z.call(Q)}catch(z){}}}}}var p4=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function a7(Q){if(typeof Q!=="object"||Q===null||q7 in Q||V0 in Q)return Q;let J=$Q(Q);if(J!==h0&&J!==v9)return Q;var W=new Map,K=o7(Q),X=d7(0),Z=null,z=GQ,G=($)=>{if(GQ===z)return $();var U=O,q=GQ;u(null),B9(z);var B=$();return u(U),B9(q),B};if(K)W.set("length",d7(Q.length,Z));var V="";let H=!1;function P($){if(H)return;H=!0,V=$,MQ(X,`${V} version`);for(let[U,q]of W)MQ(q,f4(V,U));H=!1}return new Proxy(Q,{defineProperty($,U,q){if(!("value"in q)||q.configurable===!1||q.enumerable===!1||q.writable===!1)PJ();var B=W.get(U);if(B===void 0)G(()=>{var F=d7(q.value,Z);return W.set(U,F),F});else X7(B,q.value,!0);return!0},deleteProperty($,U){var q=W.get(U);if(q===void 0){if(U in $){let B=G(()=>d7(E,Z));W.set(U,B),wQ(X)}}else X7(q,E),wQ(X);return!0},get($,U,q){if(U===q7)return Q;var B=W.get(U),F=U in $;if(B===void 0&&(!F||H7($,U)?.writable))B=G(()=>{var w=a7(F?$[U]:E),b=d7(w,Z);return b}),W.set(U,B);if(B!==void 0){var Y=A(B);return Y===E?void 0:Y}return Reflect.get($,U,q)},getOwnPropertyDescriptor($,U){this.has?.($,U);var q=Reflect.getOwnPropertyDescriptor($,U),B=W.get(U);if(B!==void 0){var F=A(B);if(F===E)return;if(q&&"value"in q)q.value=F;else return{enumerable:!0,configurable:!0,value:F,writable:!0}}return q},has($,U){if(U===q7)return!0;var q=W.get(U),B=q!==void 0&&q.v!==E||Reflect.has($,U);if(q!==void 0||L!==null&&(!B||H7($,U)?.writable)){if(q===void 0)q=G(()=>{var Y=B?a7($[U]):E,w=d7(Y,Z);return w}),W.set(U,q);var F=A(q);if(F===E)return!1}return B},set($,U,q,B){var F=W.get(U),Y=U in $;if(K&&U==="length")for(var w=q;w<F.v;w+=1){var b=W.get(w+"");if(b!==void 0)X7(b,E);else if(w in $)b=G(()=>d7(E,Z)),W.set(w+"",b)}if(F===void 0){if(!Y||H7($,U)?.writable)F=G(()=>d7(void 0,Z)),X7(F,a7(q)),W.set(U,F)}else{Y=F.v!==E;var x=G(()=>a7(q));X7(F,x)}var I=Reflect.getOwnPropertyDescriptor($,U);if(I?.set)I.set.call(B,q);if(!Y){if(K&&typeof U==="string"){var A7=W.get("length"),Z7=Number(U);if(Number.isInteger(Z7)&&Z7>=A7.v)X7(A7,Z7+1)}wQ(X)}return!0},ownKeys($){A(X);var U=Reflect.ownKeys($).filter((F)=>{var Y=W.get(F);return Y===void 0||Y.v!==E});for(var[q,B]of W)if(B.v!==E&&!(q in $))U.push(q);return U},setPrototypeOf(){HJ()}})}function f4(Q,J){if(typeof J==="symbol")return`${Q}[Symbol(${J.description??""})]`;if(p4.test(J))return`${Q}.${J}`;return/^\d+$/.test(J)?`${Q}[${J}]`:`${Q}['${J}']`}var Y9,_J,U0,lJ,iJ;function N0(){if(Y9!==void 0)return;Y9=window,_J=document,U0=/Firefox/.test(navigator.userAgent);var Q=Element.prototype,J=Node.prototype,W=Text.prototype;if(lJ=H7(J,"firstChild").get,iJ=H7(J,"nextSibling").get,v0(Q))Q[fQ]=void 0,Q[q0]=null,Q[p0]=void 0,Q.__e=void 0;if(v0(W))W[dQ]=void 0}function p(Q=""){return document.createTextNode(Q)}function h(Q){return lJ.call(Q)}function c(Q){return iJ.call(Q)}function cJ(Q,J){if(!M)return h(Q);var W=h(D);if(W===null)W=D.appendChild(p());else if(J&&W.nodeType!==RQ){var K=p();return W?.before(K),R(K),K}if(J)j0(W);return R(W),W}function d4(Q,J=!1){if(!M){var W=h(Q);if(W instanceof Comment&&W.data==="")return c(W);return W}if(J){if(D?.nodeType!==RQ){var K=p();return D?.before(K),R(K),K}j0(D)}return D}function _4(Q,J=!1){if(!M)return h(Q);var W=cJ(Q,J);return A0(Q),W}function l4(Q,J=1,W=!1){let K=M?D:Q;var X;while(J--)X=K,K=c(K);if(!M)return K;if(W){if(K?.nodeType!==RQ){var Z=p();if(K===null)X?.after(Z);else K.before(Z);return R(Z),Z}j0(K)}return R(K),K}function iQ(Q){Q.textContent=""}function R0(){if(!Q7)return!1;if(T7!==null)return!1;var Q=L.f;return(Q&V7)!==0}function I7(Q,J,W){if(J==null||J===$0)return W?document.createElement(Q,{is:W}):document.createElement(Q);return W?document.createElementNS(J,Q,{is:W}):document.createElementNS(J,Q)}function j0(Q){if(Q.nodeValue.length<65536)return;let J=Q.nextSibling;while(J!==null&&J.nodeType===RQ)J.remove(),Q.nodeValue+=J.nodeValue,J=Q.nextSibling}var M=!1;function f(Q){M=Q}var D;function R(Q){if(Q===null)throw WQ(),u7;return D=Q}function l(){return R(c(D))}function A0(Q){if(!M)return;if(c(D)!==null)throw WQ(),u7;D=Q}function M9(Q=1){if(M){var J=Q,W=D;while(J--)W=c(W);D=W}}function i7(Q=!0){var J=0,W=D;while(!0){if(W.nodeType===D7){var K=W.data;if(K===HQ){if(J===0)return W;J-=1}else if(K===jQ||K===JQ||K[0]==="["&&!isNaN(Number(K.slice(1))))J+=1}var X=c(W);if(Q)W.remove();W=X}}function eQ(Q){if(!Q||Q.nodeType!==D7)throw WQ(),u7;return Q.data}var vQ=Symbol("events"),O9=new Set,T0=new Set;function oJ(Q,J,W){(J[vQ]??={})[Q]=W}function sJ(Q){for(var J=0;J<Q.length;J++)O9.add(Q[J]);for(var W of T0)W(Q)}var L9=null,F9=!1;function D9(Q){var J=this,W=J.ownerDocument,K=Q.type,X=Q.composedPath?.()||[],Z=X[0]||Q.target;if(L9=Q,!F9)F9=!0,setTimeout(()=>{F9=!1,L9=null});var z=0,G=L9===Q&&Q[vQ];if(G){var V=X.indexOf(G);if(V!==-1&&(J===document||J===window)){Q[vQ]=J;return}var H=X.indexOf(J);if(H===-1)return;if(V<=H)z=V}if(Z=X[z]||Q.target,Z===J)return;P7(Q,"currentTarget",{configurable:!0,get(){return Z||W}});var P=O,$=L;u(null),_(null);try{var U,q=[];while(Z!==null){if(Z===J)break;try{var B=Z[vQ]?.[K];if(B!=null&&(!Z.disabled||Q.target===Z))B.call(Z,Q)}catch(F){if(U)q.push(F);else U=F}if(Q.cancelBubble)break;z++,Z=z<X.length?X[z]:null}if(U){for(let F of q)queueMicrotask(()=>{throw F});throw U}}finally{Q[vQ]=J,delete Q.currentTarget,u(P),_($)}}var i4=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:(Q)=>{return Q}});function rJ(Q){return i4?.createHTML(Q)??Q}function S9(Q){var J=I7("template");return J.innerHTML=rJ(Q.replaceAll("<!>","<!---->")),J.content}function F7(Q,J){var W=L;if(W.nodes===null)W.nodes={start:Q,end:J,a:null,t:null}}function s4(Q,J){var W=(J&a9)!==0,K=(J&n9)!==0,X,Z=!Q.startsWith("<!>");return()=>{if(M)return F7(D,null),D;if(X===void 0){if(X=S9(Z?Q:"<!>"+Q),!W)X=h(X)}var z=K||U0?document.importNode(X,!0):X.cloneNode(!0);if(W){var G=h(z),V=z.lastChild;F7(G,V)}else F7(z,z);return z}}function r4(){if(M)return F7(D,null),D;var Q=document.createDocumentFragment(),J=document.createComment(""),W=p();return Q.append(J,W),F7(J,W),Q}function Q0(Q,J){if(M){var W=L;if((W.f&V7)===0||W.nodes.end===null)W.nodes.end=D;l();return}if(Q===null)return;Q.before(J)}var a4=["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 fW=[...a4,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var n4=["touchstart","touchmove"];function aJ(Q){return n4.includes(Q)}var t4=["$state","$state.raw","$derived","$derived.by"],dW=[...t4,"$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(Q){let J=0,W=K7(0),K;return()=>{if(XQ())A(W),a(()=>{if(J===0)K=k(()=>Q(()=>wQ(W)));return J+=1,()=>{s(()=>{if(J-=1,J===0)K?.(),K=void 0,wQ(W)})}})}}var e4=B7|m7;function C9(Q,J,W,K){new tJ(Q,J,W,K)}class tJ{parent;is_pending=!1;transform_error;#Q;#J=M?D:null;#W;#G;#X;#z=null;#K=null;#V=null;#Z=null;#B=0;#q=0;#$=!1;#P=new Set;#M=new Set;#U=null;#D=nJ(()=>{return this.#U=K7(this.#B),()=>{this.#U=null}});constructor(Q,J,W,K){if(this.#Q=Q,this.#W=J,this.#G=(X)=>{var Z=L;Z.b=this,Z.f|=NQ,W(X)},this.parent=L.b,this.transform_error=K??this.parent?.transform_error??((X)=>X),this.#X=L7(()=>{if(M){let X=this.#J;l();let Z=X.data===JQ;if(X.data.startsWith(l0)){let G=JSON.parse(X.data.slice(l0.length));this.#L(G)}else if(Z)this.#C();else this.#S()}else this.#w()},e4),M)this.#Q=D}#S(){try{this.#z=o(()=>this.#G(this.#Q))}catch(Q){this.error(Q)}}#L(Q){let J=this.#W.failed,{reset:W,invoke_onerror:K}=this.#F(Q);if(s(K),!J)return;this.#V=o(()=>{J(this.#Q,()=>Q,()=>W)})}#F(Q){var J=!1,W=!1;let K=()=>{if(J){JJ();return}if(J=!0,W)YJ();if(this.#V!==null)l7(this.#V,()=>{this.#V=null});this.#O(()=>{this.#w()})};return{reset:K,invoke_onerror:()=>{try{W=!0,this.#W.onerror?.(Q,K),W=!1}catch(Z){Y7(Z,this.#X&&this.#X.parent)}}}}#C(){let Q=this.#W.pending;if(!Q)return;this.is_pending=!0,this.#K=o(()=>Q(this.#Q)),s(()=>{var J=this.#Z=document.createDocumentFragment(),W=p(),K=!1;if(J.append(W),this.#z=this.#O(()=>{try{return o(()=>this.#G(W))}catch(X){try{this.error(X),K=!0}catch(Z){Y7(Z,this.#X.parent)}return null}}),this.#z===null){if(this.#Z=null,K)this.#H(S);return}if(this.#q===0)this.#Q.before(J),this.#Z=null,l7(this.#K,()=>{this.#K=null}),this.#H(S)})}#w(){try{if(this.is_pending=this.has_pending_snippet(),this.#q=0,this.#B=0,this.#z=o(()=>{this.#G(this.#Q)}),this.#q>0){var Q=this.#Z=document.createDocumentFragment();hQ(this.#z,Q);let J=this.#W.pending;this.#K=o(()=>J(this.#Q))}else this.#H(S)}catch(J){this.error(J)}}#H(Q){this.is_pending=!1,Q.transfer_effects(this.#P,this.#M)}defer_effect(Q){D0(Q,this.#P,this.#M)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#W.pending}#O(Q){var J=L,W=O,K=C;_(this.#X),u(this.#X),r7(this.#X.ctx);try{return J7.ensure(),Q()}finally{_(J),u(W),r7(K)}}#Y(Q,J){if(!this.has_pending_snippet()){if(this.parent)this.parent.#Y(Q,J);return}if(this.#q+=Q,this.#q===0){if(this.#H(J),this.#K)l7(this.#K,()=>{this.#K=null});if(this.#Z)this.#Q.before(this.#Z),this.#Z=null}}update_pending_count(Q,J){if(this.#Y(Q,J),this.#B+=Q,!this.#U||this.#$)return;this.#$=!0,s(()=>{if(this.#$=!1,this.#U)b7(this.#U,this.#B)})}get_effect_pending(){return this.#D(),A(this.#U)}error(Q){if(!this.#W.onerror&&!this.#W.failed)throw Q;if(S?.is_fork){if(this.#z)S.skip_effect(this.#z);if(this.#K)S.skip_effect(this.#K);if(this.#V)S.skip_effect(this.#V);S.oncommit(()=>{this.#I(Q)})}else this.#I(Q)}#I(Q){if(this.#z)v(this.#z),this.#z=null;if(this.#K)v(this.#K),this.#K=null;if(this.#V)v(this.#V),this.#V=null;if(M)R(this.#J),M9(),R(i7());let J=this.#W.failed,W=(K)=>{let{reset:X,invoke_onerror:Z}=this.#F(K);if(Z(),J)this.#V=this.#O(()=>{try{return o(()=>{var z=L;z.b=this,z.f|=NQ,J(this.#Q,()=>K,()=>X)})}catch(z){return Y7(z,this.#X.parent),null}})};s(()=>{var K;try{K=this.transform_error(Q)}catch(X){Y7(X,this.#X&&this.#X.parent);return}if(K!==null&&typeof K==="object"&&typeof K.then==="function")K.then(W,(X)=>Y7(X,this.#X&&this.#X.parent));else W(K)})}}var I9=!0;function Q8(Q,J){var W=J==null?"":typeof J==="object"?`${J}`:J;if(W!==(Q[dQ]??=Q.nodeValue))Q[dQ]=W,Q.nodeValue=`${W}`}function E0(Q,J){return eJ(Q,J)}function N9(Q,J){N0(),J.intro=J.intro??!1;let W=J.target,K=M,X=D;try{var Z=h(W);while(Z&&(Z.nodeType!==D7||Z.data!==jQ))Z=c(Z);if(!Z)throw u7;f(!0),R(Z);let z=eJ(Q,{...J,anchor:Z});return f(!1),z}catch(z){if(z instanceof Error&&z.message.split(`
2
- `).some((G)=>G.startsWith("https://svelte.dev/e/")))throw z;if(z!==u7)console.warn("Failed to hydrate: ",z);if(J.recover===!1)$J();return N0(),iQ(W),f(!1),E0(Q,J)}finally{f(K),R(X)}}var x0=new Map;function eJ(Q,{target:J,anchor:W,props:K={},events:X,context:Z,intro:z=!0,transformError:G}){N0();var V=void 0,H=bJ(()=>{var P=W??J.appendChild(p());C9(P,{pending:()=>{}},(q)=>{c0({});var B=C;if(Z)B.c=Z;if(X)K.$$events=X;if(M)F7(q,null);if(I9=z,V=Q(q,K)||lQ(),I9=!0,M){if(L.nodes.end=D,D===null||D.nodeType!==D7||D.data!==HQ)throw WQ(),u7}o0()},G);var $=new Set,U=(q)=>{for(var B=0;B<q.length;B++){var F=q[B];if($.has(F))continue;$.add(F);var Y=aJ(F);for(let x of[J,document]){var w=x0.get(x);if(w===void 0)w=new Map,x0.set(x,w);var b=w.get(F);if(b===void 0)x.addEventListener(F,D9,{passive:Y}),w.set(F,1);else w.set(F,b+1)}}};return U(AQ(O9)),T0.add(U),()=>{for(var q of $)for(let Y of[J,document]){var B=x0.get(Y),F=B.get(q);if(--F==0){if(Y.removeEventListener(q,D9),B.delete(q),B.size===0)x0.delete(Y)}else B.set(q,F)}if(T0.delete(U),P!==W)P.parentNode?.removeChild(P)}});return A9.set(V,H),V}var A9=new WeakMap;function R9(Q,J){let W=A9.get(Q);if(W)return A9.delete(Q),W(J);return Promise.resolve()}class n7{anchor;#Q=new Map;#J=new Map;#W=new Map;#G=new Set;#X=!0;constructor(Q,J=!0){this.anchor=Q,this.#X=J}#z=(Q)=>{if(!this.#Q.has(Q))return;var J=this.#Q.get(Q),W=this.#J.get(J);if(W)gQ(W),this.#G.delete(J);else{var K=this.#W.get(J);if(K)gQ(K.effect),this.#J.set(J,K.effect),this.#W.delete(J),K.fragment.lastChild.remove(),this.anchor.before(K.fragment),W=K.effect}for(let[X,Z]of this.#Q){if(this.#Q.delete(X),X===Q)break;let z=this.#W.get(Z);if(z)v(z.effect),this.#W.delete(Z)}for(let[X,Z]of this.#J){if(X===J||this.#G.has(X))continue;let z=()=>{if(Array.from(this.#Q.values()).includes(X)){var V=document.createDocumentFragment();hQ(Z,V),V.append(p()),this.#W.set(X,{effect:Z,fragment:V})}else v(Z);this.#G.delete(X),this.#J.delete(X)};if(this.#X||!W)this.#G.add(X),l7(Z,z,!1);else z()}};#K=(Q)=>{this.#Q.delete(Q);let J=Array.from(this.#Q.values());for(let[W,K]of this.#W)if(!J.includes(W))v(K.effect),this.#W.delete(W)};ensure(Q,J){var W=S,K=R0();if(J&&!this.#J.has(Q)&&!this.#W.has(Q))if(K){var X=document.createDocumentFragment(),Z=p();X.append(Z),this.#W.set(Q,{effect:o(()=>J(Z)),fragment:X})}else this.#J.set(Q,o(()=>J(this.anchor)));if(this.#Q.set(W,Q),K){for(let[z,G]of this.#J)if(z===Q)W.unskip_effect(G);else W.skip_effect(G);for(let[z,G]of this.#W)if(z===Q)W.unskip_effect(G.effect);else W.skip_effect(G.effect);W.oncommit(this.#z),W.ondiscard(this.#K)}else{if(M)this.anchor=D;this.#z(W)}}}function K8(Q,J,W=!1){var K;if(M)K=D,l();var X=new n7(Q),Z=W?B7:0;function z(G,V){if(M){var H=eQ(K);if(G!==parseInt(H.substring(1))){var P=i7();R(P),X.anchor=P,f(!1),X.ensure(G,V),f(!0);return}}X.ensure(G,V)}L7(()=>{var G=!1;if(J((V,H=0)=>{G=!0,z(H,V)}),!G)z(-1,null)},Z)}var X8=Symbol("NaN");function Z8(Q,J,W){if(M)l();var K=new n7(Q),X=!k7();L7(()=>{var Z=J();if(Z!==Z)Z=X8;if(X&&Z!==null&&typeof Z==="object")Z={};K.ensure(Z,W)})}function z8(Q,J,W){var K=[],X=J.length,Z,z=J.length;for(var G=0;G<X;G++){let $=J[G];l7($,()=>{if(Z){if(Z.pending.delete($),Z.done.add($),Z.pending.size===0){var U=Q.outrogroups;if(j9(Q,AQ(Z.done)),U.delete(Z),U.size===0)Q.outrogroups=null}}else z-=1},!1)}if(z===0){var V=K.length===0&&W!==null&&Q.pending.size===0;if(V){var H=W,P=H.parentNode;iQ(P),P.append(H),Q.items.clear()}j9(Q,J,!V)}else Z={pending:new Set(J),done:new Set},(Q.outrogroups??=new Set).add(Z)}function j9(Q,J,W=!0){var K;if(Q.pending.size>0){K=new Set;for(let z of Q.pending.values())for(let G of z)K.add(Q.items.get(G).e)}for(var X=0;X<J.length;X++){var Z=J[X];if(K?.has(Z)){Z.f|=x7;let z=document.createDocumentFragment();hQ(Z,z)}else v(J[X],W)}}var W4;function G8(Q,J,W,K,X,Z=null){var z=Q,G=new Map,V=(J&_0)!==0;if(V){var H=Q;z=M?R(h(H)):H.appendChild(p())}if(M)l();var P=null,$=LQ(()=>{var x=W();return o7(x)?x:x==null?[]:AQ(x)}),U,q=new Map,B=!0;function F(x){if((b.effect.f&y)!==0)return;if(b.pending.delete(x),b.fallback=P,V8(b,U,z,J,K),P!==null)if(U.length===0)if((P.f&x7)===0)gQ(P);else P.f^=x7,W0(P,null,z);else l7(P,()=>{P=null})}function Y(x){b.pending.delete(x)}var w=L7(()=>{U=A($);var x=U.length;let I=!1;if(M){var A7=eQ(z)===JQ;if(A7!==(x===0))z=i7(),R(z),f(!1),I=!0}var Z7=new Set,O7=S,IQ=R0();for(var t7=0;t7<x;t7+=1){if(M&&D.nodeType===D7&&D.data===HQ)z=D,I=!0,f(!1);var g7=U[t7],K0=K(g7,t7);if(!1)var Q1;var c7=B?null:G.get(K0);if(c7){if(c7.v)b7(c7.v,g7);if(c7.i)b7(c7.i,t7);if(IQ)O7.unskip_effect(c7.e)}else{if(c7=q8(G,B?z:W4??=p(),g7,K0,t7,X,J,W),!B)c7.e.f|=x7;G.set(K0,c7)}Z7.add(K0)}if(x===0&&Z&&!P)if(B)P=o(()=>Z(z));else P=o(()=>Z(W4??=p())),P.f|=x7;if(x>Z7.size)ZJ("","","");if(M&&x>0)R(i7());if(!B)if(q.set(O7,Z7),IQ){for(let[w4,C4]of G)if(!Z7.has(w4))O7.skip_effect(C4.e);O7.oncommit(F),O7.ondiscard(Y)}else F(O7);if(I)f(!0);A($)}),b={effect:w,flags:J,items:G,pending:q,outrogroups:null,fallback:P};if(B=!1,M)z=D}function J0(Q){while(Q!==null&&(Q.f&i)===0)Q=Q.next;return Q}function V8(Q,J,W,K,X){var Z=(K&_9)!==0,z=J.length,G=Q.items,V=J0(Q.effect.first),H,P=null,$,U=[],q=[],B,F,Y,w;if(Z){for(w=0;w<z;w+=1)if(B=J[w],F=X(B,w),Y=G.get(F).e,(Y.f&x7)===0)Y.nodes?.a?.measure(),($??=new Set).add(Y)}for(w=0;w<z;w+=1){if(B=J[w],F=X(B,w),Y=G.get(F).e,Q.outrogroups!==null)for(let g7 of Q.outrogroups)g7.pending.delete(Y),g7.done.delete(Y);if((Y.f&d)!==0){if(gQ(Y),Z)Y.nodes?.a?.unfix(),($??=new Set).delete(Y)}if((Y.f&x7)!==0)if(Y.f^=x7,Y===V)W0(Y,null,W);else{var b=P?P.next:V;if(Y===Q.effect.last)Q.effect.last=Y.prev;if(Y.prev)Y.prev.next=Y.next;if(Y.next)Y.next.prev=Y.prev;VQ(Q,P,Y),VQ(Q,Y,b),W0(Y,b,W),P=Y,U=[],q=[],V=J0(P.next);continue}if(Y!==V){if(H!==void 0&&H.has(Y)){if(U.length<q.length){var x=q[0],I;P=x.prev;var A7=U[0],Z7=U[U.length-1];for(I=0;I<U.length;I+=1)W0(U[I],x,W);for(I=0;I<q.length;I+=1)H.delete(q[I]);VQ(Q,A7.prev,Z7.next),VQ(Q,P,A7),VQ(Q,Z7,x),V=x,P=Z7,w-=1,U=[],q=[]}else H.delete(Y),W0(Y,V,W),VQ(Q,Y.prev,Y.next),VQ(Q,Y,P===null?Q.effect.first:P.next),VQ(Q,P,Y),P=Y;continue}U=[],q=[];while(V!==null&&V!==Y)(H??=new Set).add(V),q.push(V),V=J0(V.next);if(V===null)continue}if((Y.f&x7)===0)U.push(Y);P=Y,V=J0(Y.next)}if(Q.outrogroups!==null){for(let g7 of Q.outrogroups)if(g7.pending.size===0)j9(Q,AQ(g7.done)),Q.outrogroups?.delete(g7);if(Q.outrogroups.size===0)Q.outrogroups=null}if(V!==null||H!==void 0){var O7=[];if(H!==void 0){for(Y of H)if((Y.f&d)===0)O7.push(Y)}while(V!==null){if((V.f&d)===0&&V!==Q.fallback)O7.push(V);V=J0(V.next)}var IQ=O7.length;if(IQ>0){var t7=(K&_0)!==0&&z===0?W:null;if(Z){for(w=0;w<IQ;w+=1)O7[w].nodes?.a?.measure();for(w=0;w<IQ;w+=1)O7[w].nodes?.a?.fix()}z8(Q,O7,t7)}}if(Z)s(()=>{if($===void 0)return;for(Y of $)Y.nodes?.a?.apply()})}function q8(Q,J,W,K,X,Z,z,G){var V=(z&f9)!==0?(z&l9)===0?SQ(W,!1,!1):K7(W):null,H=(z&d9)!==0?K7(X):null;return{v:V,i:H,e:o(()=>{return Z(J,V??W,H??X,G),()=>{Q.delete(K)}})}}function W0(Q,J,W){if(!Q.nodes)return;var K=Q.nodes.start,X=Q.nodes.end,Z=J&&(J.f&x7)===0?J.nodes.start:W;while(K!==null){var z=c(K);if(Z.before(K),K===X)return;K=z}}function VQ(Q,J,W){if(J===null)Q.effect.first=W;else J.next=W;if(W===null)Q.effect.last=J;else W.prev=J}function $8(Q,J,W=!1,K=!1,X=!1,Z=!1){var z=Q,G="";if(W){var V=Q;if(M)z=R(h(V))}U9(()=>{var H=L;if(G===(G=J()??"")){if(M)l();return}if(W&&!M){if(H.nodes=null,V.innerHTML=G,G!=="")F7(h(V),V.lastChild);return}if(H.nodes!==null)H9(H.nodes.start,H.nodes.end),H.nodes=null;if(G==="")return;if(M){var P=D.data,$=l(),U=$;while($!==null&&($.nodeType!==D7||$.data!==""))U=$,$=c($);if($===null)throw WQ(),u7;F7(D,U),z=R($);return}var q=K?_Q:X?i0:void 0,B=I7(K?"svg":X?"math":"template",q);B.innerHTML=G;var F=K||X?B:B.content;if(F7(h(F),F.lastChild),K||X)while(h(F))z.before(h(F));else z.before(F)})}function U8(Q,J,W,K,X){if(M)l();if(J.$$host?.$$shadowRoot){let G=I7("slot");if(W!=="default")G.name=W;if(Q0(Q,G),X!==null){let V=p();G.append(V),X(V)}return}var Z=J.$$slots?.[W],z=!1;if(Z===!0)Z=J[W==="default"?"children":W],z=!0;if(Z===void 0){if(X!==null)X(Q)}else Z(Q,z?()=>K:K)}function F8(Q,J){U7(()=>{Q=L?.parent?.nodes?.start??Q;var W=Q.getRootNode(),K=W.host?W:W.head??W.ownerDocument.head;if(!K.querySelector("#"+J.hash)){let X=I7("style");X.id=J.hash,X.textContent=J.code,K.appendChild(X)}})}function O8(Q,J,W){U7(()=>{var K=k(()=>J(Q,W?.())||{});if(W&&K?.update){var X=!1,Z={};a(()=>{var z=W();if(I0(z),X&&H0(Z,z))Z=z,K.update(z)}),X=!0}if(K?.destroy)return()=>K.destroy()})}function K4(Q){var J,W,K="";if(typeof Q=="string"||typeof Q=="number")K+=Q;else if(typeof Q=="object")if(Array.isArray(Q)){var X=Q.length;for(J=0;J<X;J++)Q[J]&&(W=K4(Q[J]))&&(K&&(K+=" "),K+=W)}else for(W in Q)Q[W]&&(K&&(K+=" "),K+=W);return K}function X4(){for(var Q,J,W=0,K="",X=arguments.length;W<X;W++)(Q=arguments[W])&&(J=K4(Q))&&(K&&(K+=" "),K+=J);return K}function z4(Q){if(typeof Q==="object")return X4(Q);else return Q??""}var Z4=[...`
3
- \r\f \v\uFEFF`];function G4(Q,J,W){var K=Q==null?"":""+Q;if(J)K=K?K+" "+J:J;if(W){for(var X of Object.keys(W))if(W[X])K=K?K+" "+X:X;else if(K.length){var Z=X.length,z=0;while((z=K.indexOf(X,z))>=0){var G=z+Z;if((z===0||Z4.includes(K[z-1]))&&(G===K.length||Z4.includes(K[G])))K=(z===0?"":K.substring(0,z))+K.substring(G+1);else z=G}}}return K===""?null:K}function V4(Q,J,W,K,X,Z){var z=Q[fQ];if(M||z!==W||z===void 0){var G=G4(W,K,Z);if(!M||G!==Q.getAttribute("class"))if(G==null)Q.removeAttribute("class");else if(J)Q.className=G;else Q.setAttribute("class",G);Q[fQ]=W}else if(Z&&X!==Z)for(var V in Z){var H=!!Z[V];if(X==null||H!==!!X[V])Q.classList.toggle(V,H)}return Z}var x8=Symbol("class"),E8=Symbol("style"),k8=Symbol("is custom element"),b8=Symbol("is html"),y8=d0?"link":"LINK";function U4(Q,J,W,K){var X=h8(Q);if(M){if(X[J]=Q.getAttribute(J),J==="src"||J==="srcset"||J==="href"&&Q.nodeName===y8){if(!K)v8(Q,J,W??"");return}}if(X[J]===(X[J]=W))return;if(J==="loading")Q[u9]=W;if(W==null)Q.removeAttribute(J);else if(typeof W!=="string"&&P4(Q).has(J))Q[J]=W;else Q.setAttribute(J,W)}function g8(Q,J,W){var K=O,X=L;let Z=M;if(M)f(!1);u(null),_(null);try{if(J!=="style"&&(T9.has(Q.getAttribute("is")||Q.nodeName)||!customElements||customElements.get(Q.getAttribute("is")||Q.nodeName.toLowerCase())?P4(Q).has(J):W&&typeof W==="object"))Q[J]=W;else U4(Q,J,W==null?W:String(W))}finally{if(u(K),_(X),Z)f(!0)}}function h8(Q){return Q[q0]??={[k8]:Q.nodeName.includes("-"),[b8]:Q.namespaceURI===$0}}var T9=new Map;function P4(Q){var J=Q.getAttribute("is")||Q.nodeName,W=T9.get(J);if(W)return W;T9.set(J,W=new Set);var K,X=Q,Z=Element.prototype;while(Z!==X){K=X0(X);for(var z in K)if(K[z].set&&z!=="innerHTML"&&z!=="textContent"&&z!=="innerText")W.add(z);X=$Q(X)}return W}function v8(Q,J,W){return}function x9(Q,J){if(Q===J)return!0;return new URL(Q,document.baseURI).href===new URL(J,document.baseURI).href}function q4(Q){return Q.split(",").map((J)=>J.trim().split(" ").filter(Boolean))}function m8(Q,J){var W=q4(Q.srcset),K=q4(J);return K.length===W.length&&K.every(([X,Z],z)=>Z===W[z][1]&&(x9(W[z][0],X)||x9(X,W[z][0])))}class H4{#Q=new WeakMap;#J;#W;static entries=new WeakMap;constructor(Q){this.#W=Q}observe(Q,J){var W=this.#Q.get(Q)||new Set;return W.add(J),this.#Q.set(Q,W),this.#G().observe(Q,this.#W),()=>{var K=this.#Q.get(Q);if(K.delete(J),K.size===0)this.#Q.delete(Q),this.#J.unobserve(Q)}}#G(){return this.#J??(this.#J=new ResizeObserver((Q)=>{for(var J of Q){H4.entries.set(J.target,J);for(var W of this.#Q.get(J.target)||[])W(J)}}))}}function E9(Q,J){return Q===J||Q?.[q7]===J}function u8(Q=lQ(),J,W,K){var X=C.r,Z=L;return U7(()=>{var z,G;return a(()=>{z=G,G=K?.()||[],k(()=>{if(!E9(W(...G),Q)){if(J(Q,...G),z&&E9(W(...z),Q))J(null,...z)}})}),()=>{let V=Z;while(V!==X&&V.parent!==null&&V.parent.f&QQ)V=V.parent;let H=()=>{if(G&&E9(W(...G),Q))J(null,...G)},P=V.teardown;V.teardown=()=>{H(),P?.()}}}),Q}var b0=!1,PG=Symbol("unmounted");function b9(Q){var J=b0;try{return b0=!1,[Q(),b0]}finally{b0=J}}function f8(Q,J,W,K){var X=!KQ||(W&c9)!==0,Z=(W&s9)!==0,z=(W&r9)!==0,G=K,V=!0,H=void 0,P=()=>{if(z&&X)return H??=ZQ(K),A(H);if(V)V=!1,G=z?k(K):K;return G};let $;if(Z){var U=q7 in Q||pQ in Q;$=H7(Q,J)?.set??(U&&J in Q?(I)=>Q[J]=I:void 0)}var q,B=!1;if(Z)[q,B]=b9(()=>Q[J]);else q=Q[J];if(q===void 0&&K!==void 0){if(q=P(),$){if(X)UJ(J);$(q)}}var F;if(X)F=()=>{var I=Q[J];if(I===void 0)return P();return V=!0,I};else F=()=>{var I=Q[J];if(I!==void 0)G=void 0;return I===void 0?G:I};if(X&&(W&o9)===0)return F;if($){var Y=Q.$$legacy;return function(I,A7){if(arguments.length>0){if(!X||!A7||Y||B)$(A7?F():I);return I}return F()}}var w=!1,b=((W&i9)!==0?ZQ:LQ)(()=>{return w=!1,F()});if(Z)A(b);var x=L;return function(I,A7){if(arguments.length>0){let Z7=A7?A(b):X&&Z?a7(I):I;if(X7(b,Z7),w=!0,G!==void 0)G=Z7;return I}if(S7&&w||(x.f&y)!==0)return b.v;return A(b)}}function B4(Q){return new Y4(Q)}class Y4{#Q;#J;constructor(Q){var J=new Map,W=(X,Z)=>{var z=SQ(Z,!1,!1);return J.set(X,z),z};let K=new Proxy({...Q.props||{},$$events:{}},{get(X,Z){return A(J.get(Z)??W(Z,Reflect.get(X,Z)))},has(X,Z){if(Z===pQ)return!0;return A(J.get(Z)??W(Z,Reflect.get(X,Z))),Reflect.has(X,Z)},set(X,Z,z){return X7(J.get(Z)??W(Z,z),z),Reflect.set(X,Z,z)}});if(this.#J=(Q.hydrate?N9:E0)(Q.component,{target:Q.target,anchor:Q.anchor,props:K,context:Q.context,intro:Q.intro??!1,recover:Q.recover,transformError:Q.transformError}),!Q7&&(!Q?.props?.$$host||Q.sync===!1))yQ();this.#Q=K.$$events;for(let X of Object.keys(this.#J)){if(X==="$set"||X==="$destroy"||X==="$on")continue;P7(this,X,{get(){return this.#J[X]},set(Z){this.#J[X]=Z},enumerable:!0})}this.#J.$set=(X)=>{Object.assign(K,X)},this.#J.$destroy=()=>{R9(this.#J)}}$set(Q){this.#J.$set(Q)}$on(Q,J){this.#Q[Q]=this.#Q[Q]||[];let W=(...K)=>J.call(this,...K);return this.#Q[Q].push(W),()=>{this.#Q[Q]=this.#Q[Q].filter((K)=>K!==W)}}$destroy(){this.#J.$destroy()}}var M4;if(typeof HTMLElement==="function")M4=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(Q,J,W){super();if(this.$$ctor=Q,this.$$s=J,W)this.$$shadowRoot=this.attachShadow(W)}addEventListener(Q,J,W){if(this.$$l[Q]=this.$$l[Q]||[],this.$$l[Q].push(J),this.$$c){let K=this.$$c.$on(Q,J);this.$$l_u.set(J,K)}super.addEventListener(Q,J,W)}removeEventListener(Q,J,W){if(super.removeEventListener(Q,J,W),this.$$c){let K=this.$$l_u.get(J);if(K)K(),this.$$l_u.delete(J)}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let Q=function(K){return(X)=>{let Z=I7("slot");if(K!=="default")Z.name=K;Q0(X,Z)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let J={},W=r8(this);for(let K of this.$$s)if(K in W)if(K==="default"&&!this.$$d.children)this.$$d.children=Q(K),J.default=!0;else J[K]=Q(K);for(let K of this.attributes){let X=this.$$g_p(K.name);if(!(X in this.$$d))this.$$d[X]=y0(X,K.value,this.$$p_d,"toProp")}for(let K in this.$$p_d)if(!(K in this.$$d)&&this[K]!==void 0)this.$$d[K]=this[K],delete this[K];this.$$c=B4({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:J,$$host:this}}),this.$$me=$9(()=>{a(()=>{this.$$r=!0;for(let K of mQ(this.$$c)){if(!this.$$p_d[K]?.reflect)continue;this.$$d[K]=this.$$c[K];let X=y0(K,this.$$d[K],this.$$p_d,"toAttribute");if(X==null)this.removeAttribute(this.$$p_d[K].attribute||K);else this.setAttribute(this.$$p_d[K].attribute||K,X)}this.$$r=!1})});for(let K in this.$$l)for(let X of this.$$l[K]){let Z=this.$$c.$on(K,X);this.$$l_u.set(X,Z)}this.$$l={}}}attributeChangedCallback(Q,J,W){if(this.$$r)return;Q=this.$$g_p(Q),this.$$d[Q]=y0(Q,W,this.$$p_d,"toProp"),this.$$c?.$set({[Q]:this.$$d[Q]})}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{if(!this.$$cn&&this.$$c)this.$$c.$destroy(),this.$$me(),this.$$c=void 0})}$$g_p(Q){return mQ(this.$$p_d).find((J)=>this.$$p_d[J].attribute===Q||!this.$$p_d[J].attribute&&J.toLowerCase()===Q)||Q}};function y0(Q,J,W,K){let X=W[Q]?.type;if(J=X==="Boolean"&&typeof J!=="boolean"?J!=null:J,!K||!W[Q])return J;else if(K==="toAttribute")switch(X){case"Object":case"Array":return J==null?null:JSON.stringify(J);case"Boolean":return J?"":null;case"Number":return J==null?null:J;default:return J}else switch(X){case"Object":case"Array":return J&&JSON.parse(J);case"Boolean":return J;case"Number":return J!=null?+J:J;default:return J}}function r8(Q){let J={};return Q.childNodes.forEach((W)=>{J[W.slot||"default"]=!0}),J}function a8(Q,J,W,K,X,Z){let z=class extends M4{constructor(){super(Q,W,X);this.$$p_d=J}static get observedAttributes(){return mQ(J).map((G)=>(J[G].attribute||G).toLowerCase())}};if(mQ(J).forEach((G)=>{P7(z.prototype,G,{get(){return this.$$c&&G in this.$$c?this.$$c[G]:this.$$d[G]},set(V){V=y0(G,V,J),this.$$d[G]=V;var H=this.$$c;if(H){var P=H7(H,G)?.get;if(P)H[G]=V;else H.$set({[G]:V})}}})}),K.forEach((G)=>{P7(z.prototype,G,{get(){return this.$$c?.[G]}})}),Z)z=Z(z);return Q.element=z,z}import{createContext as g0}from"@pie-players/pie-context";var L4=g0(Symbol.for("pie.assessmentToolkit.runtimeContext")),F4=g0(Symbol.for("pie.assessmentToolkit.hostRuntimeContext")),O4=g0(Symbol.for("pie.assessmentToolkit.shellContext")),n8=g0(Symbol.for("pie.assessmentToolkit.regionScopeContext"));import{connectContextWithRetry as y9}from"@pie-players/pie-context";var t8={bubbles:!0,composed:!0,cancelable:!1};function e8(Q,J,W={}){return new CustomEvent(Q,{detail:J,...t8,...W})}function PP(Q,J,W,K={}){return Q.dispatchEvent(e8(J,W,K))}function HP(Q,J){return y9(Q,L4,J)}function BP(Q,J){return y9(Q,O4,J)}function YP(Q,J){return y9(Q,F4,J)}var LP=1e4;function FP(Q,J,W){if(!Q)return;let K=Symbol.for(`pie.assessmentToolkit.warned.${J}`),X=Q;if(X[K])return;X[K]=!0,console.warn(W)}function DP(Q,J){return S4(Q,J,new WeakMap)}function S4(Q,J,W){if(Object.is(Q,J))return!0;let K=Array.isArray(Q);if(K!==Array.isArray(J))return!1;if(!K&&(!D4(Q)||!D4(J)))return!1;let X=Q,Z=J;if(K&&Q.length!==J.length)return!1;let z=W.get(X);if(z?.has(Z))return!0;if(!z)z=new Set,W.set(X,z);z.add(Z);let G=new Set([...Object.keys(X),...Object.keys(Z)]);for(let V of G)if(!S4(X[V],Z[V],W))return!1;return!0}function D4(Q){if(Q===null||typeof Q!=="object")return!1;let J=Object.getPrototypeOf(Q);return J===Object.prototype||J===null}
4
- export{h7 as t,A0 as u,c0 as v,o0 as w,x4 as x,yQ as y,d7 as z,X7 as A,a7 as B,cJ as C,d4 as D,_4 as E,l4 as F,q9 as G,U9 as H,A as I,k as J,oJ as K,sJ as L,s4 as M,r4 as N,Q0 as O,Q8 as P,K8 as Q,Z8 as R,G8 as S,$8 as T,U8 as U,F8 as V,O8 as W,z4 as X,V4 as Y,U4 as Z,g8 as _,u8 as $,f8 as aa,a8 as ba,L4 as ca,F4 as da,O4 as ea,n8 as fa,PP as ga,HP as ha,BP as ia,YP as ja,LP as ka,FP as la,DP as ma};
@@ -1,2 +0,0 @@
1
- import{ka as D,la as A}from"./ItemToolBar-3zrc4p3d.js";var S=["assessment","section","item","passage","rubric"],b=new Set(S);function _(q){return b.has(q)}function g(q,J,Q){let X=q.trim(),$=Q.trim();if(!X||!$)throw Error("Tool instance ids require non-empty tool and scope ids");if(!_(J))throw Error(`Unknown tool scope level '${J}'.`);return`${X}:${J}:${$}`}function R(q){let J=q.split(":");if(J.length!==3)return null;let[Q,X,$]=J;if(!Q||!$)return null;if(!_(X))return null;return{baseToolId:Q,scopeLevel:X,scopeId:$}}import{createPieLogger as h,isGlobalDebugEnabled as P}from"@pie-players/pie-players-shared/pie";var V=h("ToolCoordinator",P),O;(function(q){q[q.BASE=0]="BASE",q[q.TOOL=1000]="TOOL",q[q.MODAL=2000]="MODAL",q[q.CONTROL=3000]="CONTROL",q[q.HIGHLIGHT=4000]="HIGHLIGHT"})(O||(O={}));function k(q,J){if(!J?.baseId)return!0;return(R(q)?.baseToolId??q)===J.baseId}function C(q){return{id:q.id,name:q.name,isVisible:q.isVisible,element:q.element,layer:q.layer}}class N{tools=new Map;listeners=new Set;subscribe(q){return this.listeners.add(q),()=>{this.listeners.delete(q)}}notifyListeners(){for(let q of this.listeners)try{q()}catch(J){console.warn("[ToolCoordinator] listener failed:",J)}}registerTool(q,J,Q,X){V.debug("registerTool called:",{id:q,name:J,hasElement:!!Q,layer:X});let $=this.tools.get(q);if($){$.name=J;let Y=$.registered;if($.registered=!0,X!==void 0&&!$.layerDeclared)$.layer=X,$.layerDeclared=!0,this.stackOnTop($);else if(!Y)this.stackOnTop($)}else $={id:q,name:J,registered:!0,element:null,layer:X??O.TOOL,layerDeclared:X!==void 0,isVisible:!1,baseZIndex:0},this.tools.set(q,$),this.stackOnTop($);if(Q)this.updateToolElement(q,Q)}unregisterTool(q){let J=this.tools.get(q);if(!J?.registered)return;this.detachElement(J),J.registered=!1}releaseTool(q){let J=this.tools.get(q);if(!J)return;if(this.detachElement(J),this.tools.delete(q),J.isVisible)this.notifyListeners()}showTool(q){let J=this.tools.get(q);if(!J){V.debug(`Tool ${q} not found`);return}if(J.element)this.bringToFront(J.element);this.setVisible(J,!0)}hideTool(q){let J=this.tools.get(q);if(!J){V.debug(`Tool ${q} not found`);return}this.setVisible(J,!1)}toggleTool(q){let J=this.tools.get(q);if(!J){V.debug(`Tool ${q} not found`);return}if(J.isVisible)this.hideTool(q);else this.showTool(q)}isToolVisible(q){return this.tools.get(q)?.isVisible??!1}bringToFront(q){let J=Array.from(this.tools.values()).find((Q)=>Q.element===q);if(!J)return;this.stackOnTop(J)}destroy(){let q=Array.from(this.tools.values()).some((J)=>J.isVisible);for(let J of this.tools.values())this.detachElement(J);if(this.tools.clear(),q)this.notifyListeners();this.listeners.clear()}setVisible(q,J){if(q.isVisible===J)return;q.isVisible=J,this.notifyListeners()}detachElement(q){if(q.element&&q.mouseDownHandler)q.element.removeEventListener("mousedown",q.mouseDownHandler);q.element=null,q.mouseDownHandler=void 0}stackOnTop(q){let J=Array.from(this.tools.values()).filter((X)=>X.registered&&X.layer===q.layer&&X!==q).sort((X,$)=>X.baseZIndex-$.baseZIndex),Q=q.layer+J.length+1;if(q.baseZIndex===Q&&J.every((X)=>X.baseZIndex<Q))return;[...J,q].forEach((X,$)=>{if(X.baseZIndex=q.layer+1+$,X.element)X.element.style.zIndex=String(X.baseZIndex)})}updateToolElement(q,J){let Q=this.tools.get(q);if(!Q?.registered){V.debug(`Tool ${q} not found`);return}if(Q.element===J)return;if(Q.element?.isConnected&&Q.element.contains(J))return;this.detachElement(Q);let X=()=>this.bringToFront(J);if(J.addEventListener("mousedown",X),Q.element=J,Q.mouseDownHandler=X,J.style.zIndex=String(Q.baseZIndex),Q.isVisible)this.bringToFront(J)}hideAllTools(q){let J=!1;for(let Q of this.tools.values()){if(!Q.isVisible||!k(Q.id,q))continue;Q.isVisible=!1,J=!0}if(J)this.notifyListeners()}getToolState(q){let J=this.tools.get(q);return J?.registered?C(J):void 0}getVisibleTools(q){return Array.from(this.tools.values()).filter((J)=>J.isVisible&&k(J.id,q)).map(C)}}import{dynamicMessageKey as o}from"@pie-players/pie-players-shared/i18n/provider";import{validateCustomElementTag as T}from"@pie-players/pie-players-shared/pie/tag-names";var E=(q,J)=>{let Q=J?.toolTagMap?.[q];if(Q===void 0&&!q.includes("-"))throw Error(`No element tag is mapped for tool "${q}". Install a tag map on the registry via setComponentOverrides({ toolTagMap }) — for the packaged capabilities, PACKAGED_TOOL_TAG_MAP from "@pie-players/pie-default-tool-loaders".`);return T(Q??q,`tool component tag for "${q}"`)};var w=(q,J,Q)=>console.error(`[ToolRegistry] Tool '${q}' ${J} check threw:`,Q);var f=["assessment","section","item","passage","rubric","element"];function G(q,J){if(typeof q!=="string"||q.trim().length===0)throw Error(`Invalid tool registration: "${J}" must be a non-empty string.`)}var x=[{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 L(q,J,Q){let X=J.trimStart(),$=X.toLowerCase().startsWith("<svg"),Y=/^https?:/i.test(X);if(/^data:/i.test(X))throw Error(`Invalid tool registration "${q}": "${Q}" may not be a data: URL.`);if(!$&&!Y)return;for(let{pattern:H,reason:W}of x)if(H.test(J))throw Error(`Invalid tool registration "${q}": "${Q}" ${W}. Inline SVG icons must not include scriptable content.`)}function Z(q){G(q.toolId,"toolId"),G(q.name,"name"),G(q.description,"description");let J=q.activation==="region";if(!J||q.icon!==void 0){if(typeof q.icon!=="string"&&typeof q.icon!=="function")throw Error(`Invalid tool registration "${q.toolId}": "icon" must be a string or function.`)}if(typeof q.icon==="string")L(q.toolId,q.icon,"icon");if(!Array.isArray(q.supportedLevels)||q.supportedLevels.length===0)throw Error(`Invalid tool registration "${q.toolId}": "supportedLevels" must be a non-empty array.`);let Q=q.supportedLevels.find((X)=>!f.includes(X));if(Q)throw Error(`Invalid tool registration "${q.toolId}": unsupported level "${Q}".`);if(q.activation!==void 0&&q.activation!=="toolbar-toggle"&&q.activation!=="selection-gateway"&&q.activation!=="region")throw Error(`Invalid tool registration "${q.toolId}": unsupported activation "${String(q.activation)}".`);if(q.surfaces!==void 0&&(!Array.isArray(q.surfaces)||q.surfaces.some((X)=>typeof X!=="string"||X.trim().length===0)))throw Error(`Invalid tool registration "${q.toolId}": "surfaces" must be an array of non-empty strings.`);if(J&&!q.surfaces?.length)throw Error(`Invalid tool registration "${q.toolId}": region tools must declare at least one host surface in "surfaces".`);if(J&&typeof q.renderSurface!=="function")throw Error(`Invalid tool registration "${q.toolId}": region tools must implement "renderSurface".`);if(q.resolvesWithoutGrant!==void 0&&typeof q.resolvesWithoutGrant!=="boolean")throw Error(`Invalid tool registration "${q.toolId}": "resolvesWithoutGrant" must be a boolean.`);if(q.resolvesWithoutGrant&&!q.requiresAuthoredContent)throw Error(`Invalid tool registration "${q.toolId}": "resolvesWithoutGrant" requires "requiresAuthoredContent".`);if(q.renderSurface!==void 0&&typeof q.renderSurface!=="function")throw Error(`Invalid tool registration "${q.toolId}": "renderSurface" must be a function.`);if(q.renderSurface&&!q.surfaces?.length)throw Error(`Invalid tool registration "${q.toolId}": "renderSurface" requires at least one entry in "surfaces".`);if(q.singletonScope!==void 0&&q.singletonScope!=="section")throw Error(`Invalid tool registration "${q.toolId}": unsupported singletonScope "${String(q.singletonScope)}".`);if(q.activation==="selection-gateway"&&q.singletonScope!=="section")throw Error(`Invalid tool registration "${q.toolId}": selection-gateway tools must declare singletonScope "section".`);if(q.activation!=="region"&&typeof q.isVisibleInContext!=="function")throw Error(`Invalid tool registration "${q.toolId}": "isVisibleInContext" must be a function.`);if(q.isVisibleInContext!==void 0&&typeof q.isVisibleInContext!=="function")throw Error(`Invalid tool registration "${q.toolId}": "isVisibleInContext" must be a function when present.`);if(q.isApplicableToContent!==void 0&&typeof q.isApplicableToContent!=="function")throw Error(`Invalid tool registration "${q.toolId}": "isApplicableToContent" must be a function when present.`);if(q.requiresAuthoredContent!==void 0){if(typeof q.requiresAuthoredContent!=="object"||q.requiresAuthoredContent===null||typeof q.requiresAuthoredContent.resolve!=="function")throw Error(`Invalid tool registration "${q.toolId}": "requiresAuthoredContent" must be an object with a "resolve" function.`)}if(q.renderToolbar!==void 0){if(typeof q.renderToolbar!=="function")throw Error(`Invalid tool registration "${q.toolId}": "renderToolbar" must be a function.`)}else if(!J)throw Error(`Invalid tool registration "${q.toolId}": "renderToolbar" must be a function.`)}class p{tools=new Map;componentOverrides={};watchedUndefinedToolElements=new Set;moduleLoaders=new Map;loadedToolModules=new Set;warnedLoaderReplacements=new Set;warnedUnregisteredAllowedTools=new Set;moduleLoadPromises=new Map;changeListeners=new Set;emitChange(q){for(let J of this.changeListeners)try{J(q)}catch(Q){console.warn("[ToolRegistry] change listener failed:",Q)}}onRegistryChange(q){this.changeListeners.add(q);let J=!0;return()=>{if(!J)return;J=!1,this.changeListeners.delete(q)}}normalizeToolId(q){return q.trim()}normalizeToolIds(q){return q.map((J)=>this.normalizeToolId(J))}register(q){if(Z(q),this.tools.has(q.toolId))throw Error(`Tool '${q.toolId}' is already registered`);this.tools.set(q.toolId,q),this.emitChange({kind:"register",toolIds:[q.toolId]})}override(q){if(Z(q),!this.tools.has(q.toolId))throw Error(`Cannot override non-existent tool '${q.toolId}'`);this.tools.set(q.toolId,q),this.emitChange({kind:"override",toolIds:[q.toolId]})}unregister(q){if(!this.tools.has(q))return;this.tools.delete(q),this.emitChange({kind:"unregister",toolIds:[q]})}get(q){return this.tools.get(q)}has(q){return this.tools.has(q)}getAllToolIds(){return Array.from(this.tools.keys())}getAllTools(){return Array.from(this.tools.values())}getToolsByLevel(q){return this.getAllTools().filter((J)=>J.supportedLevels.includes(q))}getToolActivation(q){return this.get(q)?.activation||"toolbar-toggle"}getToolSingletonScope(q){return this.get(q)?.singletonScope||null}getToolsBySurface(q){if(!q)return[];return this.getAllTools().filter((J)=>typeof J.renderSurface==="function"&&J.surfaces?.includes(q))}getContentDependentSupportIds(){return this.getAllTools().filter((q)=>q.requiresAuthoredContent).map((q)=>q.toolId).sort()}filterToolIdsByActivation(q,J){return q.filter((Q)=>this.getToolActivation(Q)===J)}filterVisibleInContext(q,J,Q=w){let X=[];for(let $ of q){let Y=this.get($);if(!Y){if(!this.warnedUnregisteredAllowedTools.has($))this.warnedUnregisteredAllowedTools.add($),console.warn(`Tool '${$}' is allowed but not registered`);continue}if(!Y.supportedLevels.includes(J.level))continue;try{if(Y.isVisibleInContext?.(J))X.push(Y)}catch(j){Q($,"tool-visibility",j)}}return X}isApplicableToAnyContext(q,J,Q=w){let X=this.get(q);if(!X?.isApplicableToContent)return!0;if(J.length===0)return!0;return J.some(($)=>{try{return X.isApplicableToContent?.($)??!0}catch(Y){return Q(q,"tool-applicability",Y),!0}})}filterDecidedToolIds(q,J,Q,X=w){let $=new Set,Y=[];for(let H of q){let W=this.normalizeToolId(H.toolId);if(!W)continue;if(H.required||H.alwaysAvailable)$.add(W);if(Y.includes(W))continue;if(!this.get(W)?.supportedLevels.includes(J))continue;Y.push(W)}if(J==="section")return Y;let j=new Set(Q.length===0?Y:Y.filter((H)=>$.has(H)));for(let H of Q){let W=Y.filter((U)=>!j.has(U));for(let U of this.filterVisibleInContext(W,H,X))j.add(U.toolId)}return Y.filter((H)=>j.has(H)&&this.isApplicableToAnyContext(H,Q,X))}getToolMetadata(){return this.getAllTools().map((q)=>({toolId:q.toolId,name:q.name,description:q.description,supportedLevels:q.supportedLevels,activation:q.activation||"toolbar-toggle",singletonScope:q.singletonScope||null,surfaces:q.surfaces||[],requiresAuthoredContent:Boolean(q.requiresAuthoredContent),contentDependencyDescription:q.requiresAuthoredContent?.description??null}))}clear(){let q=this.getAllToolIds();if(q.length===0)return;this.tools.clear(),this.emitChange({kind:"clear",toolIds:q})}setComponentOverrides(q){if(this.componentOverrides===q)return;this.componentOverrides=q,this.emitChange({kind:"component-overrides",toolIds:[]})}setToolModuleLoaders(q){let J=Object.entries(q).filter((X)=>X[1]!==void 0);for(let[X,$]of J)if(G(X,"tool module loader id"),typeof $!=="function")throw Error(`Invalid tool module loader for "${X}": expected a function.`);let Q=[];for(let[X,$]of J){if(this.moduleLoaders.get(X)===$)continue;if(this.loadedToolModules.has(X)||this.moduleLoadPromises.has(X)){this.warnLoaderReplacedAfterLoad(X);continue}this.moduleLoaders.set(X,$),Q.push(X)}if(Q.length>0)this.emitChange({kind:"module-loaders",toolIds:Q})}warnLoaderReplacedAfterLoad(q){if(this.warnedLoaderReplacements.has(q))return;this.warnedLoaderReplacements.add(q),console.warn(`[ToolRegistry] Ignored a new module loader for "${q}": its module already loaded, so the elements it defines stay in place. Register loaders before the tool first renders.`)}async ensureToolModuleLoaded(q){if(this.loadedToolModules.has(q))return;let J=this.moduleLoadPromises.get(q);if(J){await J;return}let Q=this.moduleLoaders.get(q);if(!Q){this.watchUndefinedToolElement(q);return}let X=(async()=>{await Q(),this.loadedToolModules.add(q),this.warnIfLoadedToolElementUndefined(q)})();this.moduleLoadPromises.set(q,X);try{await X}finally{this.moduleLoadPromises.delete(q)}}undefinedToolElementTag(q){if(typeof customElements>"u"||typeof document>"u")return null;let J=this.componentOverrides;if(J.toolComponentFactories?.[q])return null;let Q;try{Q=E(q,J)}catch{return null}return customElements.get(Q)?null:Q}warnIfLoadedToolElementUndefined(q){let J=this.undefinedToolElementTag(q);if(!J)return;A(document,`loadedToolElementUndefined.${q}.${J}`,`[ToolRegistry] Tool "${q}" renders <${J}>, but its module loader finished without defining it, so the tool renders blank. The tag map and the loader disagree: map "${q}" to the tag its loader defines, or register a loader that defines <${J}>. Reported once per page.`)}watchUndefinedToolElement(q){if(this.watchedUndefinedToolElements.has(q))return;let J=this.undefinedToolElementTag(q);if(!J)return;this.watchedUndefinedToolElements.add(q);let Q=document,X=setTimeout(()=>{if(customElements.get(J))return;A(Q,`undefinedToolElement.${q}`,`[ToolRegistry] Tool "${q}" renders <${J}>, which is still undefined after ${D/1000} s, and its registry has no module loader for it. Register one with setToolModuleLoaders or import the tool's package before it renders; a registry from createPackagedToolRegistry has the packaged loaders unless its toolModuleLoaders replaced them. Reported once per page.`)},D);customElements.whenDefined(J).then(()=>clearTimeout(X))}async ensureToolModulesLoaded(q){let J=await Promise.allSettled(q.map((X)=>this.ensureToolModuleLoaded(X))),Q=new Map;return J.forEach((X,$)=>{if(X.status==="rejected")Q.set(q[$],X.reason)}),Q}isToolModuleLoaded(q){return this.loadedToolModules.has(q)}renderForToolbar(q,J,Q){let X=this.get(q);if(!X)throw Error(`Tool '${q}' is not registered`);if(typeof X.renderToolbar!=="function")throw Error(`Tool '${q}' has activation "${X.activation||"toolbar-toggle"}" and renders into a host surface, not a toolbar. Remove it from toolbar placement.`);let $={...Q,componentOverrides:this.mergeComponentOverrides(Q.componentOverrides)};return X.renderToolbar(J,$)}renderForSurface(q,J){let Q=this.get(q);if(!Q)throw Error(`Tool '${q}' is not registered`);if(typeof Q.renderSurface!=="function")throw Error(`Tool '${q}' does not render into a host surface. Surface capabilities declare "surfaces" and implement "renderSurface".`);return Q.renderSurface({...J,componentOverrides:this.mergeComponentOverrides(J.componentOverrides)})}mergeComponentOverrides(q){return{...this.componentOverrides||{},...q||{}}}}var K={assessment:[],section:[],item:[],passage:[],rubric:[],element:[]};import{isPlainRecord as B}from"@pie-players/pie-players-shared/object";var m={section:[...K.section],item:[...K.item],passage:[...K.passage]};function F(q,J){if(q==null)return[];if(!Array.isArray(q))throw Error(`Invalid tools config at "${J}": expected an array of tool ids.`);if(q.find((X)=>typeof X!=="string")!==void 0)throw Error(`Invalid tools config at "${J}": all entries must be strings.`);return q}function u(q){if(q==null)return;if(!B(q))throw Error('Invalid tools config at "placement": expected an object with section/item/passage arrays.');return q}function v(q){if(q==null)return;if(!B(q))throw Error('Invalid tools config at "policy": expected an object with allowed/blocked arrays.');return q}function c(q,J){if(J==null)return;if(!B(J))throw Error(`Invalid tools config at "providers.${q}": expected an object.`);let Q=J;if("enabled"in Q&&Q.enabled!==void 0&&typeof Q.enabled!=="boolean")throw Error(`Invalid tools config at "providers.${q}.enabled": expected a boolean.`);if("settings"in Q&&Q.settings!==void 0&&!B(Q.settings))throw Error(`Invalid tools config at "providers.${q}.settings": expected an object.`);if("provider"in Q&&Q.provider!==void 0&&!B(Q.provider))throw Error(`Invalid tools config at "providers.${q}.provider": expected an object.`);return Q}function y(q){if(q==null)return{};if(!B(q))throw Error('Invalid tools config at "providers": expected an object keyed by tool id.');let J={};for(let[Q,X]of Object.entries(q))J[Q]=c(Q,X);return J}function M(q){if(!q||q.length===0)return[];let J=new Set;for(let Q of q){if(typeof Q!=="string")throw Error("Invalid tools config: tool list entries must be strings.");let X=Q.trim();if(!X)continue;J.add(X)}return Array.from(J)}function $q(q){if(!q)return[];return M(q.split(",").map((J)=>J.trim()).filter(Boolean))}function I(q,J){if(q==null)return;if(q==="on"||q==="off")return q;throw Error(`Invalid tools config at "${J}": expected "on" or "off", got ${JSON.stringify(q)}.`)}function z(q,J){let Q=M(F(q?.[J],`placement.${J}`));return Q.length?Q:[...m[J]]}function Yq(q){if(q!=null&&!B(q))throw Error('Invalid tools config: expected an object with "policy", "placement", and "providers".');let J=v(q?.policy),Q=u(q?.placement),X=y(q?.providers),$=I(q?.pnpEnforcement,"pnpEnforcement"),Y={policy:{allowed:M(F(J?.allowed,"policy.allowed")),blocked:M(F(J?.blocked,"policy.blocked"))},placement:{section:z(Q,"section"),item:z(Q,"item"),passage:z(Q,"passage")},providers:X};if($)Y.pnpEnforcement=$;return Y}
2
- export{g as m,O as n,N as o,p,M as q,$q as r,Yq as s};