cognikit 0.1.2 → 0.2.0

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.
package/dist/client.js CHANGED
@@ -1,5 +1,5 @@
1
1
  var HTMLElement = globalThis.HTMLElement ?? class {}; var customElements = globalThis.customElements ?? { get() { return undefined; }, define() {} };
2
- function Je(){let e=globalThis;if(typeof e.HTMLElement>"u"&&(e.HTMLElement=class{}),typeof e.customElements>"u"){let n=new Map;e.customElements={define(t,r){n.has(t)||n.set(t,r)},get(t){return n.get(t)},getName(t){for(let[r,i]of n.entries())if(i===t)return r;return null},upgrade(){},whenDefined(){return Promise.resolve(class{})}}}}Je();var O=new Map,C=e=>{let n=O.get(e.id);if(n){if(n.ctor===e.ctor)return;throw new Error(`Duplicate interaction id: "${e.id}"`)}O.set(e.id,e)},va=e=>O.delete(e),xa=()=>{O.clear()},wa=()=>O,ya=()=>Array.from(O.values()),pi=e=>O.get(e)??null,hi=(e,...n)=>{let t=pi(e);if(!t)throw new Error(`Unknown interaction "${e}"`);return new t.ctor(...n)};var qe=class{constructor(){this._current=0;this._total=0}initialize(n){if(n<0)throw new Error("Total must be non-negative");this._total=n,this._current=0}setCurrent(n){n<0?this._current=0:n>this._total?this._current=this._total:this._current=n}increment(){this._current<this._total&&this._current++}decrement(){this._current>0&&this._current--}reset(){this._current=0}getPercentage(){return this._total===0?0:Math.round(this._current/this._total*100)}isComplete(){return this._current===this._total&&this._total>0}get current(){return this._current}get total(){return this._total}get remaining(){return Math.max(0,this._total-this._current)}};var gi=`
2
+ function et(){let e=globalThis;if(typeof e.HTMLElement>"u"&&(e.HTMLElement=class{}),typeof e.customElements>"u"){let n=new Map;e.customElements={define(t,r){n.has(t)||n.set(t,r)},get(t){return n.get(t)},getName(t){for(let[r,i]of n.entries())if(i===t)return r;return null},upgrade(){},whenDefined(){return Promise.resolve(class{})}}}}et();var O=new Map,k=e=>{let n=O.get(e.id);if(n){if(n.ctor===e.ctor)return;throw new Error(`Duplicate interaction id: "${e.id}"`)}O.set(e.id,e)},Sa=e=>O.delete(e),Ta=()=>{O.clear()},$a=()=>O,Aa=()=>Array.from(O.values()),fi=e=>O.get(e)??null,bi=(e,...n)=>{let t=fi(e);if(!t)throw new Error(`Unknown interaction "${e}"`);return new t.ctor(...n)};var ze=class{constructor(){this._current=0;this._total=0}initialize(n){if(n<0)throw new Error("Total must be non-negative");this._total=n,this._current=0}setCurrent(n){n<0?this._current=0:n>this._total?this._current=this._total:this._current=n}increment(){this._current<this._total&&this._current++}decrement(){this._current>0&&this._current--}reset(){this._current=0}getPercentage(){return this._total===0?0:Math.round(this._current/this._total*100)}isComplete(){return this._current===this._total&&this._total>0}get current(){return this._current}get total(){return this._total}get remaining(){return Math.max(0,this._total-this._current)}};var vi=`
3
3
  @keyframes shake {
4
4
  0%, 100% { transform: translateX(0); }
5
5
  25% { transform: translateX(-8px); }
@@ -91,11 +91,11 @@ function Je(){let e=globalThis;if(typeof e.HTMLElement>"u"&&(e.HTMLElement=class
91
91
  50% { transform: rotate(180deg) translateX(50px) rotate(-180deg) scale(1.5); }
92
92
  100% { transform: rotate(360deg) translateX(0) rotate(-360deg); }
93
93
  }
94
- `,yt={shake:"0.4s","pulse-green":"2s infinite","bounce-in":"0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55)",float:"3s ease-in-out infinite",rubber:"0.6s",jello:"0.8s",heartbeat:"1.5s ease-in-out infinite",shimmer:"2s infinite",wobble:"4s infinite",pop:"0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)","fade-slide":"0.5s ease-out",swing:"2s infinite",flash:"0.5s",orbit:"1s ease-in-out","spin-pulse":"3s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite"},M=class{constructor(){this.isEnabled=!1}static{this.injectedRoots=new WeakSet}static injectKeyframes(n){if(this.injectedRoots.has(n))return;let t=document.createElement("style");t.textContent=gi,n.prepend(t),this.injectedRoots.add(n)}animate(n,t,r){if(!this.isEnabled)return;n.style.animation="";let i=r?.duration||"",o=r?.timing||"",a=r?.iterations||"",s=r?.delay||"",l="";i||o||a||s?l=`${t} ${i} ${o} ${s} ${a}`.trim():l=`${t} ${yt[t]}`,n.style.animation=l}stop(n){n.style.animation=""}animateFor(n,t,r,i){this.isEnabled&&(this.animate(n,t,i),setTimeout(()=>{this.stop(n)},r))}getAvailableAnimations(){return Object.keys(yt)}addAnimationClass(n,t){this.isEnabled&&n.classList.add(`anim-${t}`)}removeAnimationClass(n,t){n.classList.remove(`anim-${t}`)}};var mi={"--edu-bg":"247 249 252","--edu-card":"255 255 255","--edu-ink":"31 41 55","--edu-second-ink":"71 85 105","--edu-third-ink":"100 116 139","--edu-inverted-ink":"248 250 252","--edu-success":"22 163 74","--edu-error":"220 38 38","--edu-warning":"255 222 33","--edu-neutral":"14 165 233","--edu-first-accent":"49 120 198","--edu-second-accent":"245 158 11","--edu-third-accent":"236 72 153","--edu-border":"229 231 235","--edu-muted":"243 244 246","--edu-radius":"0.375rem","--edu-shadow-color":"0 0 0","--edu-pad":"1rem","--edu-mar":"0"},L={audioBaseUrl:null,soundFiles:{},injectThemeVariables:!0,themeVariables:{}},Et="cognikit-theme-variables";function fi(e){e.audioBaseUrl!==void 0&&(L.audioBaseUrl=e.audioBaseUrl),e.soundFiles&&(L.soundFiles={...L.soundFiles,...e.soundFiles}),e.injectThemeVariables!==void 0&&(L.injectThemeVariables=e.injectThemeVariables),e.themeVariables&&(L.themeVariables={...L.themeVariables,...e.themeVariables}),ze()}function ze(){if(typeof document>"u"||!L.injectThemeVariables)return;let e=document.documentElement,n=window.getComputedStyle(e),t={...mi,...L.themeVariables},r=document.getElementById(Et);r||(r=document.createElement("style"),r.id=Et,document.head.appendChild(r));let i=Object.entries(t).filter(([o])=>n.getPropertyValue(o).trim()==="");r.textContent=i.length===0?"":`:root {
95
- ${i.map(([o,a])=>` ${o}: ${a};`).join(`
94
+ `,Ct={shake:"0.4s","pulse-green":"2s infinite","bounce-in":"0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55)",float:"3s ease-in-out infinite",rubber:"0.6s",jello:"0.8s",heartbeat:"1.5s ease-in-out infinite",shimmer:"2s infinite",wobble:"4s infinite",pop:"0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)","fade-slide":"0.5s ease-out",swing:"2s infinite",flash:"0.5s",orbit:"1s ease-in-out","spin-pulse":"3s cubic-bezier(0.175, 0.885, 0.32, 1.275) infinite"},L=class{constructor(){this.isEnabled=!1}static{this.injectedRoots=new WeakSet}static injectKeyframes(n){if(this.injectedRoots.has(n))return;let t=document.createElement("style");t.textContent=vi,n.prepend(t),this.injectedRoots.add(n)}animate(n,t,r){if(!this.isEnabled)return;n.style.animation="";let i=r?.duration||"",o=r?.timing||"",a=r?.iterations||"",s=r?.delay||"",l="";i||o||a||s?l=`${t} ${i} ${o} ${s} ${a}`.trim():l=`${t} ${Ct[t]}`,n.style.animation=l}stop(n){n.style.animation=""}animateFor(n,t,r,i){this.isEnabled&&(this.animate(n,t,i),setTimeout(()=>{this.stop(n)},r))}getAvailableAnimations(){return Object.keys(Ct)}addAnimationClass(n,t){this.isEnabled&&n.classList.add(`anim-${t}`)}removeAnimationClass(n,t){n.classList.remove(`anim-${t}`)}};var He={"default-light":{"--edu-bg":"247 249 252","--edu-card":"255 255 255","--edu-ink":"31 41 55","--edu-second-ink":"71 85 105","--edu-third-ink":"100 116 139","--edu-inverted-ink":"248 250 252","--edu-success":"22 163 74","--edu-error":"220 38 38","--edu-warning":"255 222 33","--edu-neutral":"14 165 233","--edu-first-accent":"49 120 198","--edu-second-accent":"245 158 11","--edu-third-accent":"236 72 153","--edu-border":"229 231 235","--edu-muted":"243 244 246","--edu-radius":"0.375rem","--edu-shadow-color":"0 0 0","--edu-pad":"1rem","--edu-mar":"0"},"default-dark":{"--edu-bg":"15 23 42","--edu-card":"30 41 59","--edu-ink":"241 245 249","--edu-second-ink":"203 213 225","--edu-third-ink":"148 163 184","--edu-inverted-ink":"15 23 42","--edu-success":"74 222 128","--edu-error":"248 113 113","--edu-warning":"250 204 21","--edu-neutral":"56 189 248","--edu-first-accent":"96 165 250","--edu-second-accent":"251 191 36","--edu-third-accent":"244 114 182","--edu-border":"71 85 105","--edu-muted":"51 65 85","--edu-radius":"0.375rem","--edu-shadow-color":"2 6 23","--edu-pad":"1rem","--edu-mar":"0"},"ocean-light":{"--edu-bg":"239 246 255","--edu-card":"255 255 255","--edu-ink":"8 47 73","--edu-second-ink":"14 116 144","--edu-third-ink":"8 145 178","--edu-inverted-ink":"239 246 255","--edu-success":"5 150 105","--edu-error":"225 29 72","--edu-warning":"245 158 11","--edu-neutral":"2 132 199","--edu-first-accent":"6 182 212","--edu-second-accent":"59 130 246","--edu-third-accent":"14 165 233","--edu-border":"186 230 253","--edu-muted":"224 242 254","--edu-radius":"0.5rem","--edu-shadow-color":"8 47 73","--edu-pad":"1rem","--edu-mar":"0"},"ocean-dark":{"--edu-bg":"8 47 73","--edu-card":"12 74 110","--edu-ink":"236 254 255","--edu-second-ink":"165 243 252","--edu-third-ink":"103 232 249","--edu-inverted-ink":"8 47 73","--edu-success":"52 211 153","--edu-error":"251 113 133","--edu-warning":"251 191 36","--edu-neutral":"34 211 238","--edu-first-accent":"103 232 249","--edu-second-accent":"56 189 248","--edu-third-accent":"45 212 191","--edu-border":"14 116 144","--edu-muted":"14 116 144","--edu-radius":"0.5rem","--edu-shadow-color":"8 47 73","--edu-pad":"1rem","--edu-mar":"0"},"forest-light":{"--edu-bg":"240 253 244","--edu-card":"255 255 255","--edu-ink":"20 83 45","--edu-second-ink":"22 101 52","--edu-third-ink":"74 124 89","--edu-inverted-ink":"240 253 244","--edu-success":"22 163 74","--edu-error":"220 38 38","--edu-warning":"234 179 8","--edu-neutral":"34 197 94","--edu-first-accent":"34 197 94","--edu-second-accent":"132 204 22","--edu-third-accent":"16 185 129","--edu-border":"187 247 208","--edu-muted":"220 252 231","--edu-radius":"0.5rem","--edu-shadow-color":"20 83 45","--edu-pad":"1rem","--edu-mar":"0"},"forest-dark":{"--edu-bg":"20 83 45","--edu-card":"22 101 52","--edu-ink":"240 253 244","--edu-second-ink":"187 247 208","--edu-third-ink":"134 239 172","--edu-inverted-ink":"20 83 45","--edu-success":"74 222 128","--edu-error":"248 113 113","--edu-warning":"250 204 21","--edu-neutral":"74 222 128","--edu-first-accent":"134 239 172","--edu-second-accent":"190 242 100","--edu-third-accent":"52 211 153","--edu-border":"34 197 94","--edu-muted":"21 128 61","--edu-radius":"0.5rem","--edu-shadow-color":"20 83 45","--edu-pad":"1rem","--edu-mar":"0"}},tt=He["default-light"],y={audioBaseUrl:null,soundFiles:{},injectThemeVariables:!0,theme:null,themeVariables:{}},kt="cognikit-theme-variables";function xi(e){e.audioBaseUrl!==void 0&&(y.audioBaseUrl=e.audioBaseUrl),e.soundFiles&&(y.soundFiles={...y.soundFiles,...e.soundFiles}),e.injectThemeVariables!==void 0&&(y.injectThemeVariables=e.injectThemeVariables),e.theme!==void 0&&(y.theme=e.theme),e.themeVariables===null&&(y.themeVariables={}),e.themeVariables&&(y.themeVariables={...y.themeVariables,...e.themeVariables}),W()}function wi(){return y}function yi(){return He}function $t(e=y.theme,n=y.themeVariables){return{...e?He[e]:tt,...n}}function Ei(e,n){y.theme=e,n!==void 0&&(y.themeVariables={...n}),W()}function Ci(){y.theme=null,y.themeVariables={},W()}function W(){if(typeof document>"u")return;let e=document.getElementById(kt);if(e||(e=document.createElement("style"),e.id=kt,document.head.appendChild(e)),!y.injectThemeVariables){e.textContent="";return}let n=document.documentElement,t=window.getComputedStyle(n),r=$t();if(y.theme!==null||Object.keys(y.themeVariables).length>0){e.textContent=Tt(r);return}let o=Object.entries(tt).filter(([a])=>t.getPropertyValue(a).trim()==="");e.textContent=o.length===0?"":Tt(Object.fromEntries(o))}function At(e,n){let t=y.soundFiles[e];return t?St(t,y.audioBaseUrl):y.audioBaseUrl?St(n,y.audioBaseUrl):null}function St(e,n){return Si(e)||e.startsWith("data:")?e:n?new URL(e,ki(n)).href:e}function ki(e){return typeof window>"u"?e:new URL(e,document.baseURI||window.location.href).href}function Si(e){return/^https?:\/\//.test(e)}function Tt(e){return`:root {
95
+ ${Object.entries(e).map(([n,t])=>` ${n}: ${t};`).join(`
96
96
  `)}
97
- }`}function kt(e,n){let t=L.soundFiles[e];return t?Ct(t,L.audioBaseUrl):L.audioBaseUrl?Ct(n,L.audioBaseUrl):null}function Ct(e,n){return vi(e)||e.startsWith("data:")?e:n?new URL(e,bi(n)).href:e}function bi(e){return typeof window>"u"?e:new URL(e,document.baseURI||window.location.href).href}function vi(e){return/^https?:\/\//.test(e)}var H=class{constructor(){this.isEnabled=!0;this.audioCache=new Map;this.activeSounds=new Set;this.localSounds={success:"success.mp3",failure:"failure.mp3",pop:"pop.mp3","low-time":"low-time.mp3",start:"start.mp3",flip:"flip.mp3"}}async playSound(n,t={}){if(this.isEnabled)try{let r=this.resolveUrl(n),i=await this.getAudio(r);this.configureAudio(i,t),await this.playAudio(i,t)}catch(r){let i=r instanceof Error?r:new Error(String(r));console.warn(`[SoundManager] Failed to play sound "${n}":`,i.message),t.onError&&t.onError(i)}}async preload(n){let t=n.map(async r=>{try{let i=this.resolveUrl(r);await this.getAudio(i)}catch(i){console.warn(`[SoundManager] Failed to preload sound "${r}":`,i)}});await Promise.allSettled(t)}stopAll(){this.activeSounds.forEach(n=>{n.pause(),n.currentTime=0}),this.activeSounds.clear()}stop(n){let t=this.resolveUrl(n),r=this.audioCache.get(t);r&&(r.pause(),r.currentTime=0,this.activeSounds.delete(r))}clearCache(){this.stopAll(),this.audioCache.clear()}setGlobalVolume(n){let t=Math.max(0,Math.min(1,n));this.activeSounds.forEach(r=>{r.volume=t})}resolveUrl(n){if(n in this.localSounds){let t=this.localSounds[n],r=kt(n,t);if(!r)throw new Error(`No configured URL for sound "${n}"`);return r}return n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:"),n}async getAudio(n){if(this.audioCache.has(n))return this.audioCache.get(n).cloneNode(!0);let t=new Audio,r=new Promise((i,o)=>{let a=setTimeout(()=>{o(new Error("Audio loading timeout"))},1e4);t.addEventListener("canplaythrough",()=>{clearTimeout(a),i()},{once:!0}),t.addEventListener("error",()=>{clearTimeout(a),o(new Error(`Failed to load audio: ${n}`))},{once:!0})});return t.src=n,t.preload="auto",t.load(),await r,this.audioCache.set(n,t),t.cloneNode(!0)}configureAudio(n,t){n.volume=t.volume!==void 0?Math.max(0,Math.min(1,t.volume)):1,n.loop=t.loop??!1,n.playbackRate=t.playbackRate??1,t.fadeIn&&t.fadeIn>0&&(n.volume=0,this.fadeVolume(n,t.volume??1,t.fadeIn))}async playAudio(n,t){this.activeSounds.add(n);let r=()=>{this.activeSounds.delete(n),t.onEnd&&t.onEnd()};n.addEventListener("ended",r,{once:!0}),t.fadeOut&&t.fadeOut>0&&!t.loop&&n.addEventListener("timeupdate",()=>{n.duration-n.currentTime<=t.fadeOut/1e3&&this.fadeVolume(n,0,t.fadeOut)});try{await n.play()}catch(i){throw this.activeSounds.delete(n),new Error(`Playback failed: ${i instanceof Error?i.message:String(i)}`)}}fadeVolume(n,t,r){let i=n.volume,o=t-i,a=Date.now(),s=()=>{let l=Date.now()-a,c=Math.min(l/r,1);n.volume=i+o*c,c<1&&this.activeSounds.has(n)&&requestAnimationFrame(s)};requestAnimationFrame(s)}},He=new H;var x=class extends HTMLElement{constructor(t,r,i,o){super();this.isValid=!0;this.implementsProgress=!0;this._initialized=!1;this.errors="";if(!t||!r){console.warn("[BaseInteraction] Constructor called without required parameters"),this.id=crypto.randomUUID(),this.data=t,this.config=r||{},this.assets=i||null,this.isValid=!1;return}if(this.id=crypto.randomUUID(),this.data=t,this.config=r,this.assets=i||null,o){let a=o(this.data);a.ok||(this.isValid=!1,Object.entries(a.errors).forEach(([s,l])=>{this.errors=`${this.errors}
98
- ${s}: ${l}`}))}this.progressTracker=new qe,this.soundManager=new H,this.animationsManager=new M,this.animationsManager.isEnabled=this.config?.animationsEnabled??!0,this.soundManager.isEnabled=this.config?.soundEnabled??!0,this.setAttribute("variant",this.config?.variant??"elegant")}connectedCallback(){if(!this._initialized){if(this._initialized=!0,!this.isValid)return;this.initialize(),requestAnimationFrame(()=>{this.render(),this.emitReady()})}}disconnectedCallback(){this.cleanup()}initialize(){}cleanup(){}initializeProgress(t){this.progressTracker.initialize(t),this.emitProgress()}setProgress(t){this.progressTracker.setCurrent(t),this.emitProgress()}incrementProgress(){this.progressTracker.increment(),this.emitProgress()}decrementProgress(){this.progressTracker.decrement(),this.emitProgress()}getProgress(){return{current:this.progressTracker.current,total:this.progressTracker.total,percentage:this.progressTracker.getPercentage()}}emitReady(){this.dispatchEvent(new CustomEvent("interaction:ready",{detail:{id:this.id},bubbles:!0,composed:!0}))}emitProgress(){let t=this.getProgress();this.dispatchEvent(new CustomEvent("interaction:progress",{detail:t,bubbles:!0,composed:!0}))}emitStateChange(){this.dispatchEvent(new CustomEvent("interaction:state-change",{detail:{state:this.getCurrentState(),isComplete:this.isInteractionComplete()},bubbles:!0,composed:!0}))}emitComplete(){this.dispatchEvent(new CustomEvent("interaction:complete",{detail:{state:this.getCurrentState(),id:this.id},bubbles:!0,composed:!0}))}emitHintShown(t){this.dispatchEvent(new CustomEvent("interaction:hint-shown",{detail:{message:t},bubbles:!0,composed:!0}))}emitError(t,r){this.dispatchEvent(new CustomEvent("interaction:error",{detail:{error:t,message:r||t.message},bubbles:!0,composed:!0}))}onChange(t){}setSteps(t){}submit(){this.setAttribute("inert",""),this.emitComplete()}hint(){this.onHint()}reset(){this.progressTracker.reset(),this.emitProgress(),this.removeAttribute("inert"),this.render()}set(t){this.config.variant=t,this.setAttribute("variant",t),this.onVariantChange(t)}get(){return this.getAttribute("variant")||this.config.variant||"outline"}};var St=`<div class="chip-container" part="container">
97
+ }`}var H=class{constructor(){this.isEnabled=!0;this.audioCache=new Map;this.activeSounds=new Set;this.localSounds={success:"success.mp3",failure:"failure.mp3",pop:"pop.mp3","low-time":"low-time.mp3",start:"start.mp3",flip:"flip.mp3"}}async playSound(n,t={}){if(this.isEnabled)try{let r=this.resolveUrl(n),i=await this.getAudio(r);this.configureAudio(i,t),await this.playAudio(i,t)}catch(r){let i=r instanceof Error?r:new Error(String(r));console.warn(`[SoundManager] Failed to play sound "${n}":`,i.message),t.onError&&t.onError(i)}}async preload(n){let t=n.map(async r=>{try{let i=this.resolveUrl(r);await this.getAudio(i)}catch(i){console.warn(`[SoundManager] Failed to preload sound "${r}":`,i)}});await Promise.allSettled(t)}stopAll(){this.activeSounds.forEach(n=>{n.pause(),n.currentTime=0}),this.activeSounds.clear()}stop(n){let t=this.resolveUrl(n),r=this.audioCache.get(t);r&&(r.pause(),r.currentTime=0,this.activeSounds.delete(r))}clearCache(){this.stopAll(),this.audioCache.clear()}setGlobalVolume(n){let t=Math.max(0,Math.min(1,n));this.activeSounds.forEach(r=>{r.volume=t})}resolveUrl(n){if(n in this.localSounds){let t=this.localSounds[n],r=At(n,t);if(!r)throw new Error(`No configured URL for sound "${n}"`);return r}return n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:"),n}async getAudio(n){if(this.audioCache.has(n))return this.audioCache.get(n).cloneNode(!0);let t=new Audio,r=new Promise((i,o)=>{let a=setTimeout(()=>{o(new Error("Audio loading timeout"))},1e4);t.addEventListener("canplaythrough",()=>{clearTimeout(a),i()},{once:!0}),t.addEventListener("error",()=>{clearTimeout(a),o(new Error(`Failed to load audio: ${n}`))},{once:!0})});return t.src=n,t.preload="auto",t.load(),await r,this.audioCache.set(n,t),t.cloneNode(!0)}configureAudio(n,t){n.volume=t.volume!==void 0?Math.max(0,Math.min(1,t.volume)):1,n.loop=t.loop??!1,n.playbackRate=t.playbackRate??1,t.fadeIn&&t.fadeIn>0&&(n.volume=0,this.fadeVolume(n,t.volume??1,t.fadeIn))}async playAudio(n,t){this.activeSounds.add(n);let r=()=>{this.activeSounds.delete(n),t.onEnd&&t.onEnd()};n.addEventListener("ended",r,{once:!0}),t.fadeOut&&t.fadeOut>0&&!t.loop&&n.addEventListener("timeupdate",()=>{n.duration-n.currentTime<=t.fadeOut/1e3&&this.fadeVolume(n,0,t.fadeOut)});try{await n.play()}catch(i){throw this.activeSounds.delete(n),new Error(`Playback failed: ${i instanceof Error?i.message:String(i)}`)}}fadeVolume(n,t,r){let i=n.volume,o=t-i,a=Date.now(),s=()=>{let l=Date.now()-a,c=Math.min(l/r,1);n.volume=i+o*c,c<1&&this.activeSounds.has(n)&&requestAnimationFrame(s)};requestAnimationFrame(s)}},Ne=new H;var x=class extends HTMLElement{constructor(t,r,i,o){super();this.isValid=!0;this.implementsProgress=!0;this._initialized=!1;this.errors="";if(!t||!r){console.warn("[BaseInteraction] Constructor called without required parameters"),this.id=crypto.randomUUID(),this.data=t,this.config=r||{},this.assets=i||null,this.isValid=!1;return}if(this.id=crypto.randomUUID(),this.data=t,this.config=r,this.assets=i||null,o){let a=o(this.data);a.ok||(this.isValid=!1,Object.entries(a.errors).forEach(([s,l])=>{this.errors=`${this.errors}
98
+ ${s}: ${l}`}))}this.progressTracker=new ze,this.soundManager=new H,this.animationsManager=new L,this.animationsManager.isEnabled=this.config?.animationsEnabled??!0,this.soundManager.isEnabled=this.config?.soundEnabled??!0,this.setAttribute("variant",this.config?.variant??"elegant")}connectedCallback(){if(!this._initialized){if(this._initialized=!0,!this.isValid)return;this.initialize(),requestAnimationFrame(()=>{this.render(),this.emitReady()})}}disconnectedCallback(){this.cleanup()}initialize(){}cleanup(){}initializeProgress(t){this.progressTracker.initialize(t),this.emitProgress()}setProgress(t){this.progressTracker.setCurrent(t),this.emitProgress()}incrementProgress(){this.progressTracker.increment(),this.emitProgress()}decrementProgress(){this.progressTracker.decrement(),this.emitProgress()}getProgress(){return{current:this.progressTracker.current,total:this.progressTracker.total,percentage:this.progressTracker.getPercentage()}}emitReady(){this.dispatchEvent(new CustomEvent("interaction:ready",{detail:{id:this.id},bubbles:!0,composed:!0}))}emitProgress(){let t=this.getProgress();this.dispatchEvent(new CustomEvent("interaction:progress",{detail:t,bubbles:!0,composed:!0}))}emitStateChange(){this.dispatchEvent(new CustomEvent("interaction:state-change",{detail:{state:this.getCurrentState(),isComplete:this.isInteractionComplete()},bubbles:!0,composed:!0}))}emitComplete(){this.dispatchEvent(new CustomEvent("interaction:complete",{detail:{state:this.getCurrentState(),id:this.id},bubbles:!0,composed:!0}))}emitHintShown(t){this.dispatchEvent(new CustomEvent("interaction:hint-shown",{detail:{message:t},bubbles:!0,composed:!0}))}emitError(t,r){this.dispatchEvent(new CustomEvent("interaction:error",{detail:{error:t,message:r||t.message},bubbles:!0,composed:!0}))}onChange(t){}setSteps(t){}submit(){this.setAttribute("inert",""),this.emitComplete()}hint(){this.onHint()}reset(){this.progressTracker.reset(),this.emitProgress(),this.removeAttribute("inert"),this.render()}set(t){this.config.variant=t,this.setAttribute("variant",t),this.onVariantChange(t)}get(){return this.getAttribute("variant")||this.config.variant||"outline"}};var _t=`<div class="chip-container" part="container">
99
99
 
100
100
  <div class="content-zone" part="content-zone" role="button" tabindex="0" aria-pressed="false">
101
101
  <span class="prefix" part="prefix"></span>
@@ -122,7 +122,7 @@ ${i.map(([o,a])=>` ${o}: ${a};`).join(`
122
122
  </div>
123
123
  </div>
124
124
 
125
- `;var Tt=`/* ==================== BASE STYLES ==================== */
125
+ `;var It=`/* ==================== BASE STYLES ==================== */
126
126
 
127
127
  * { box-sizing: border-box; }
128
128
 
@@ -665,7 +665,7 @@ ${i.map(([o,a])=>` ${o}: ${a};`).join(`
665
665
  :host([variant="sign"]) ::slotted(img.chip-image) {
666
666
  transform: skewX(-10deg);
667
667
  }
668
- `;var yi=`
668
+ `;var Ai=`
669
669
  <style>
670
670
  :host {
671
671
  display: none;
@@ -845,7 +845,7 @@ ${i.map(([o,a])=>` ${o}: ${a};`).join(`
845
845
  <slot name="footer"></slot>
846
846
  </div>
847
847
  </div>
848
- `,he=class extends HTMLElement{constructor(){super();this.handleEscape=t=>{t.key==="Escape"&&this.hasAttribute("open")&&this.close()};this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=yi,this.$backdrop=this.shadowRoot.querySelector(".backdrop"),this.$dialog=this.shadowRoot.querySelector(".dialog"),this.$title=this.shadowRoot.querySelector("#title"),this.$content=this.shadowRoot.querySelector(".content"),this.$footer=this.shadowRoot.querySelector(".footer"),this.$closeBtn=this.shadowRoot.querySelector(".close-btn")}static get observedAttributes(){return["open","title"]}connectedCallback(){this.$backdrop.addEventListener("click",()=>this.close()),this.$closeBtn.addEventListener("click",()=>this.close()),document.addEventListener("keydown",this.handleEscape);let t=this.shadowRoot.querySelector('slot[name="footer"]');t.addEventListener("slotchange",()=>{let r=t.assignedNodes().length>0;this.$footer.style.display=r?"flex":"none"})}disconnectedCallback(){document.removeEventListener("keydown",this.handleEscape)}attributeChangedCallback(t,r,i){t==="title"?this.$title.textContent=i||"":t==="open"&&i!==r&&(this.hasAttribute("open")?document.body.style.overflow="hidden":document.body.style.overflow="")}open(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("dialog:open",{bubbles:!0,composed:!0}))}close(){this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("dialog:close",{bubbles:!0,composed:!0}))}setContent(t){this.$content.innerHTML=t}get isOpen(){return this.hasAttribute("open")}get title(){return this.getAttribute("title")||""}set title(t){this.setAttribute("title",t)}};customElements.get("edu-dialog")||customElements.define("edu-dialog",he);function D(e,n,t){if(!t||!e.startsWith("@:")||e.length<3){n.textContent=e;return}let r=e.slice(2,e.length);if(!t[r]){n.textContent=r;return}let i=t[r],o=i.type;switch(n.modality=o,o){case"image":n.data=i.url;break;case"video":break;case"audio":break;case"html":n.data=i.content;break}}var et=class extends HTMLElement{static get observedAttributes(){return["accent","variant","selected","prefix","disabled","modality","state","display","color","colored","draggable"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=St;let n=document.createElement("style");n.textContent=Tt,this.shadowRoot.append(n),this.$prefix=this.shadowRoot.querySelector(".prefix"),this.$chip=this.shadowRoot.querySelector(".content-zone"),this.$dragHandler=this.shadowRoot.querySelector(".drag-handle"),this.$dialog=new he,M.injectKeyframes(this.shadowRoot)}connectedCallback(){this.hasAttribute("variant")||(this.variant="outline"),this.sync()}attributeChangedCallback(){this.sync()}getButton(){return this.$chip}getPrefix(){return this.$prefix}getDragHandler(){return this.$dragHandler}sync(){this.hasAttribute("prefix")&&(this.$prefix.textContent=this.prefix??""),this.hasAttribute("draggable")&&(this.style.userSelect="none",this.style.touchAction="none");let n=this.selected?"true":"false";this.$chip.setAttribute("aria-pressed",n)}updateContent(){if(!this.hasAttribute("data")||!this.hasAttribute("modality"))return;let n=this.getAttribute("modality"),t=this.getAttribute("data");switch(n){case"image":this.innerHTML=`<img src="${t}" alt="no image" class="chip-image" width="64" height="64"/>`;break;case"audio":break;case"video":break;case"html":this.innerHTML=t}}get variant(){return this.getAttribute("variant")??"outline"}set variant(n){this.setAttribute("variant",n)}get prefix(){return this.getAttribute("prefix")}set prefix(n){n==null||n===""?this.removeAttribute("prefix"):this.setAttribute("prefix",String(n))}get chipState(){return this.getAttribute("state")}set chipState(n){n==null?this.removeAttribute("state"):this.setAttribute("state",String(n))}get draggable(){return this.hasAttribute("draggable")}set draggable(n){n==null||n===!1?this.removeAttribute("draggable"):this.setAttribute("draggable","true")}get color(){return this.getAttribute("color")}set color(n){n==null||n===""?this.removeAttribute("color"):(this.setAttribute("color",String(n)),this.style.setProperty("--chip-colored-color",String(n)))}get colored(){return this.hasAttribute("colored")}set colored(n){n?this.setAttribute("colored","true"):this.removeAttribute("colored")}set data(n){n==null||n===""?this.removeAttribute("data"):(this.setAttribute("data",String(n)),this.updateContent())}set modality(n){n==null?this.removeAttribute("modality"):(console.log(1),this.setAttribute("modality",String(n)),this.updateContent())}get disabled(){return this.hasAttribute("disabled")}set disabled(n){n?(this.setAttribute("aria-disabled","true"),this.$chip.setAttribute("aria-disabled","true"),this.$dragHandler.setAttribute("aria-disabled","true")):(this.removeAttribute("aria-disabled"),this.$chip.removeAttribute("aria-disabled"),this.$dragHandler.removeAttribute("aria-disabled"))}get selected(){return this.hasAttribute("selected")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}get value(){return this.getAttribute("value")??""}set value(n){this.setAttribute("value",String(n))}toggle(n){return typeof n=="boolean"?this.selected=n:this.selected=!this.selected,this.selected}removeSelf(){this.remove()}};customElements.get("edu-chip")||customElements.define("edu-chip",et);var Ei=`
848
+ `,ge=class extends HTMLElement{constructor(){super();this.handleEscape=t=>{t.key==="Escape"&&this.hasAttribute("open")&&this.close()};this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=Ai,this.$backdrop=this.shadowRoot.querySelector(".backdrop"),this.$dialog=this.shadowRoot.querySelector(".dialog"),this.$title=this.shadowRoot.querySelector("#title"),this.$content=this.shadowRoot.querySelector(".content"),this.$footer=this.shadowRoot.querySelector(".footer"),this.$closeBtn=this.shadowRoot.querySelector(".close-btn")}static get observedAttributes(){return["open","title"]}connectedCallback(){this.$backdrop.addEventListener("click",()=>this.close()),this.$closeBtn.addEventListener("click",()=>this.close()),document.addEventListener("keydown",this.handleEscape);let t=this.shadowRoot.querySelector('slot[name="footer"]');t.addEventListener("slotchange",()=>{let r=t.assignedNodes().length>0;this.$footer.style.display=r?"flex":"none"})}disconnectedCallback(){document.removeEventListener("keydown",this.handleEscape)}attributeChangedCallback(t,r,i){t==="title"?this.$title.textContent=i||"":t==="open"&&i!==r&&(this.hasAttribute("open")?document.body.style.overflow="hidden":document.body.style.overflow="")}open(){this.setAttribute("open",""),this.dispatchEvent(new CustomEvent("dialog:open",{bubbles:!0,composed:!0}))}close(){this.removeAttribute("open"),this.dispatchEvent(new CustomEvent("dialog:close",{bubbles:!0,composed:!0}))}setContent(t){this.$content.innerHTML=t}get isOpen(){return this.hasAttribute("open")}get title(){return this.getAttribute("title")||""}set title(t){this.setAttribute("title",t)}};customElements.get("edu-dialog")||customElements.define("edu-dialog",ge);function D(e,n,t){if(!t||!e.startsWith("@:")||e.length<3){n.textContent=e;return}let r=e.slice(2,e.length);if(!t[r]){n.textContent=r;return}let i=t[r],o=i.type;switch(n.modality=o,o){case"image":n.data=i.url;break;case"video":break;case"audio":break;case"html":n.data=i.content;break}}var rt=class extends HTMLElement{static get observedAttributes(){return["accent","variant","selected","prefix","disabled","modality","state","display","color","colored","draggable"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=_t;let n=document.createElement("style");n.textContent=It,this.shadowRoot.append(n),this.$prefix=this.shadowRoot.querySelector(".prefix"),this.$chip=this.shadowRoot.querySelector(".content-zone"),this.$dragHandler=this.shadowRoot.querySelector(".drag-handle"),this.$dialog=new ge,L.injectKeyframes(this.shadowRoot)}connectedCallback(){this.hasAttribute("variant")||(this.variant="outline"),this.sync()}attributeChangedCallback(){this.sync()}getButton(){return this.$chip}getPrefix(){return this.$prefix}getDragHandler(){return this.$dragHandler}sync(){this.hasAttribute("prefix")&&(this.$prefix.textContent=this.prefix??""),this.hasAttribute("draggable")&&(this.style.userSelect="none",this.style.touchAction="none");let n=this.selected?"true":"false";this.$chip.setAttribute("aria-pressed",n)}updateContent(){if(!this.hasAttribute("data")||!this.hasAttribute("modality"))return;let n=this.getAttribute("modality"),t=this.getAttribute("data");switch(n){case"image":this.innerHTML=`<img src="${t}" alt="no image" class="chip-image" width="64" height="64"/>`;break;case"audio":break;case"video":break;case"html":this.innerHTML=t}}get variant(){return this.getAttribute("variant")??"outline"}set variant(n){this.setAttribute("variant",n)}get prefix(){return this.getAttribute("prefix")}set prefix(n){n==null||n===""?this.removeAttribute("prefix"):this.setAttribute("prefix",String(n))}get chipState(){return this.getAttribute("state")}set chipState(n){n==null?this.removeAttribute("state"):this.setAttribute("state",String(n))}get draggable(){return this.hasAttribute("draggable")}set draggable(n){n==null||n===!1?this.removeAttribute("draggable"):this.setAttribute("draggable","true")}get color(){return this.getAttribute("color")}set color(n){n==null||n===""?this.removeAttribute("color"):(this.setAttribute("color",String(n)),this.style.setProperty("--chip-colored-color",String(n)))}get colored(){return this.hasAttribute("colored")}set colored(n){n?this.setAttribute("colored","true"):this.removeAttribute("colored")}set data(n){n==null||n===""?this.removeAttribute("data"):(this.setAttribute("data",String(n)),this.updateContent())}set modality(n){n==null?this.removeAttribute("modality"):(console.log(1),this.setAttribute("modality",String(n)),this.updateContent())}get disabled(){return this.hasAttribute("disabled")}set disabled(n){n?(this.setAttribute("aria-disabled","true"),this.$chip.setAttribute("aria-disabled","true"),this.$dragHandler.setAttribute("aria-disabled","true")):(this.removeAttribute("aria-disabled"),this.$chip.removeAttribute("aria-disabled"),this.$dragHandler.removeAttribute("aria-disabled"))}get selected(){return this.hasAttribute("selected")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}get value(){return this.getAttribute("value")??""}set value(n){this.setAttribute("value",String(n))}toggle(n){return typeof n=="boolean"?this.selected=n:this.selected=!this.selected,this.selected}removeSelf(){this.remove()}};customElements.get("edu-chip")||customElements.define("edu-chip",rt);var _i=`
849
849
  <style>
850
850
  :host {
851
851
  display: block;
@@ -1000,40 +1000,40 @@ ${i.map(([o,a])=>` ${o}: ${a};`).join(`
1000
1000
  <div class="block" part="block">
1001
1001
  <slot></slot>
1002
1002
  </div>
1003
- `,V=class extends HTMLElement{static get observedAttributes(){return["variant"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=Ei,this.$blockEl=this.shadowRoot.querySelector(".block"),M.injectKeyframes(this.shadowRoot)}connectedCallback(){this.hasAttribute("variant")||(this.variant="outline"),this.sync()}attributeChangedCallback(){this.sync()}sync(){this.$blockEl&&this.$blockEl.setAttribute("variant",this.variant)}getBlock(){return this.$blockEl}get variant(){return this.getAttribute("variant")??"outline"}set variant(n){this.setAttribute("variant",n)}setAccentColor(n){this.shadowRoot.host.style.setProperty("--accent-color",n)}removeSelf(){this.remove()}};customElements.get("edu-block")||customElements.define("edu-block",V);function Ot(e){return typeof e>"u"||e===null}function Ci(e){return typeof e=="object"&&e!==null}function ki(e){return Array.isArray(e)?e:Ot(e)?[]:[e]}function Si(e,n){var t,r,i,o;if(n)for(o=Object.keys(n),t=0,r=o.length;t<r;t+=1)i=o[t],e[i]=n[i];return e}function Ti(e,n){var t="",r;for(r=0;r<n;r+=1)t+=e;return t}function $i(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Ai=Ot,_i=Ci,Ii=ki,Mi=Ti,Li=$i,Di=Si,k={isNothing:Ai,isObject:_i,toArray:Ii,repeat:Mi,isNegativeZero:Li,extend:Di};function Vt(e,n){var t="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(t+='in "'+e.mark.name+'" '),t+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!n&&e.mark.snippet&&(t+=`
1004
-
1005
- `+e.mark.snippet),r+" "+t):r}function me(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=Vt(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}me.prototype=Object.create(Error.prototype);me.prototype.constructor=me;me.prototype.toString=function(n){return this.name+": "+Vt(this,n)};var A=me;function tt(e,n,t,r,i){var o="",a="",s=Math.floor(i/2)-1;return r-n>s&&(o=" ... ",n=r-s+o.length),t-r>s&&(a=" ...",t=r+s-a.length),{str:o+e.slice(n,t).replace(/\t/g,"\u2192")+a,pos:r-n+o.length}}function rt(e,n){return k.repeat(" ",n-e.length)+e}function Ri(e,n){if(n=Object.create(n||null),!e.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var t=/\r?\n|\r|\0/g,r=[0],i=[],o,a=-1;o=t.exec(e.buffer);)i.push(o.index),r.push(o.index+o[0].length),e.position<=o.index&&a<0&&(a=r.length-2);a<0&&(a=r.length-1);var s="",l,c,d=Math.min(e.line+n.linesAfter,i.length).toString().length,u=n.maxLength-(n.indent+d+3);for(l=1;l<=n.linesBefore&&!(a-l<0);l++)c=tt(e.buffer,r[a-l],i[a-l],e.position-(r[a]-r[a-l]),u),s=k.repeat(" ",n.indent)+rt((e.line-l+1).toString(),d)+" | "+c.str+`
1006
- `+s;for(c=tt(e.buffer,r[a],i[a],e.position,u),s+=k.repeat(" ",n.indent)+rt((e.line+1).toString(),d)+" | "+c.str+`
1007
- `,s+=k.repeat("-",n.indent+d+3+c.pos)+`^
1008
- `,l=1;l<=n.linesAfter&&!(a+l>=i.length);l++)c=tt(e.buffer,r[a+l],i[a+l],e.position-(r[a]-r[a+l]),u),s+=k.repeat(" ",n.indent)+rt((e.line+l+1).toString(),d)+" | "+c.str+`
1009
- `;return s.replace(/\n$/,"")}var Pi=Ri,Bi=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],qi=["scalar","sequence","mapping"];function zi(e){var n={};return e!==null&&Object.keys(e).forEach(function(t){e[t].forEach(function(r){n[String(r)]=t})}),n}function Hi(e,n){if(n=n||{},Object.keys(n).forEach(function(t){if(Bi.indexOf(t)===-1)throw new A('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.options=n,this.tag=e,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(t){return t},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=zi(n.styleAliases||null),qi.indexOf(this.kind)===-1)throw new A('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var T=Hi;function $t(e,n){var t=[];return e[n].forEach(function(r){var i=t.length;t.forEach(function(o,a){o.tag===r.tag&&o.kind===r.kind&&o.multi===r.multi&&(i=a)}),t[i]=r}),t}function Gi(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,t;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(n=0,t=arguments.length;n<t;n+=1)arguments[n].forEach(r);return e}function nt(e){return this.extend(e)}nt.prototype.extend=function(n){var t=[],r=[];if(n instanceof T)r.push(n);else if(Array.isArray(n))r=r.concat(n);else if(n&&(Array.isArray(n.implicit)||Array.isArray(n.explicit)))n.implicit&&(t=t.concat(n.implicit)),n.explicit&&(r=r.concat(n.explicit));else throw new A("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(o){if(!(o instanceof T))throw new A("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new A("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new A("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(o){if(!(o instanceof T))throw new A("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(nt.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=$t(i,"implicit"),i.compiledExplicit=$t(i,"explicit"),i.compiledTypeMap=Gi(i.compiledImplicit,i.compiledExplicit),i};var Ft=nt,jt=new T("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Ut=new T("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Yt=new T("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Kt=new Ft({explicit:[jt,Ut,Yt]});function Ni(e){if(e===null)return!0;var n=e.length;return n===1&&e==="~"||n===4&&(e==="null"||e==="Null"||e==="NULL")}function Oi(){return null}function Vi(e){return e===null}var Wt=new T("tag:yaml.org,2002:null",{kind:"scalar",resolve:Ni,construct:Oi,predicate:Vi,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Fi(e){if(e===null)return!1;var n=e.length;return n===4&&(e==="true"||e==="True"||e==="TRUE")||n===5&&(e==="false"||e==="False"||e==="FALSE")}function ji(e){return e==="true"||e==="True"||e==="TRUE"}function Ui(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var Qt=new T("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Fi,construct:ji,predicate:Ui,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Yi(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Ki(e){return 48<=e&&e<=55}function Wi(e){return 48<=e&&e<=57}function Qi(e){if(e===null)return!1;var n=e.length,t=0,r=!1,i;if(!n)return!1;if(i=e[t],(i==="-"||i==="+")&&(i=e[++t]),i==="0"){if(t+1===n)return!0;if(i=e[++t],i==="b"){for(t++;t<n;t++)if(i=e[t],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(t++;t<n;t++)if(i=e[t],i!=="_"){if(!Yi(e.charCodeAt(t)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(t++;t<n;t++)if(i=e[t],i!=="_"){if(!Ki(e.charCodeAt(t)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;t<n;t++)if(i=e[t],i!=="_"){if(!Wi(e.charCodeAt(t)))return!1;r=!0}return!(!r||i==="_")}function Zi(e){var n=e,t=1,r;if(n.indexOf("_")!==-1&&(n=n.replace(/_/g,"")),r=n[0],(r==="-"||r==="+")&&(r==="-"&&(t=-1),n=n.slice(1),r=n[0]),n==="0")return 0;if(r==="0"){if(n[1]==="b")return t*parseInt(n.slice(2),2);if(n[1]==="x")return t*parseInt(n.slice(2),16);if(n[1]==="o")return t*parseInt(n.slice(2),8)}return t*parseInt(n,10)}function Xi(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!k.isNegativeZero(e)}var Zt=new T("tag:yaml.org,2002:int",{kind:"scalar",resolve:Qi,construct:Zi,predicate:Xi,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),Ji=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function en(e){return!(e===null||!Ji.test(e)||e[e.length-1]==="_")}function tn(e){var n,t;return n=e.replace(/_/g,"").toLowerCase(),t=n[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:t*parseFloat(n,10)}var rn=/^[-+]?[0-9]+e/;function nn(e,n){var t;if(isNaN(e))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(k.isNegativeZero(e))return"-0.0";return t=e.toString(10),rn.test(t)?t.replace("e",".e"):t}function on(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||k.isNegativeZero(e))}var Xt=new T("tag:yaml.org,2002:float",{kind:"scalar",resolve:en,construct:tn,predicate:on,represent:nn,defaultStyle:"lowercase"}),Jt=Kt.extend({implicit:[Wt,Qt,Zt,Xt]}),er=Jt,tr=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),rr=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function an(e){return e===null?!1:tr.exec(e)!==null||rr.exec(e)!==null}function sn(e){var n,t,r,i,o,a,s,l=0,c=null,d,u,p;if(n=tr.exec(e),n===null&&(n=rr.exec(e)),n===null)throw new Error("Date resolve error");if(t=+n[1],r=+n[2]-1,i=+n[3],!n[4])return new Date(Date.UTC(t,r,i));if(o=+n[4],a=+n[5],s=+n[6],n[7]){for(l=n[7].slice(0,3);l.length<3;)l+="0";l=+l}return n[9]&&(d=+n[10],u=+(n[11]||0),c=(d*60+u)*6e4,n[9]==="-"&&(c=-c)),p=new Date(Date.UTC(t,r,i,o,a,s,l)),c&&p.setTime(p.getTime()-c),p}function ln(e){return e.toISOString()}var ir=new T("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:an,construct:sn,instanceOf:Date,represent:ln});function cn(e){return e==="<<"||e===null}var nr=new T("tag:yaml.org,2002:merge",{kind:"scalar",resolve:cn}),ct=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
1010
- \r`;function dn(e){if(e===null)return!1;var n,t,r=0,i=e.length,o=ct;for(t=0;t<i;t++)if(n=o.indexOf(e.charAt(t)),!(n>64)){if(n<0)return!1;r+=6}return r%8===0}function un(e){var n,t,r=e.replace(/[\r\n=]/g,""),i=r.length,o=ct,a=0,s=[];for(n=0;n<i;n++)n%4===0&&n&&(s.push(a>>16&255),s.push(a>>8&255),s.push(a&255)),a=a<<6|o.indexOf(r.charAt(n));return t=i%4*6,t===0?(s.push(a>>16&255),s.push(a>>8&255),s.push(a&255)):t===18?(s.push(a>>10&255),s.push(a>>2&255)):t===12&&s.push(a>>4&255),new Uint8Array(s)}function pn(e){var n="",t=0,r,i,o=e.length,a=ct;for(r=0;r<o;r++)r%3===0&&r&&(n+=a[t>>18&63],n+=a[t>>12&63],n+=a[t>>6&63],n+=a[t&63]),t=(t<<8)+e[r];return i=o%3,i===0?(n+=a[t>>18&63],n+=a[t>>12&63],n+=a[t>>6&63],n+=a[t&63]):i===2?(n+=a[t>>10&63],n+=a[t>>4&63],n+=a[t<<2&63],n+=a[64]):i===1&&(n+=a[t>>2&63],n+=a[t<<4&63],n+=a[64],n+=a[64]),n}function hn(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var or=new T("tag:yaml.org,2002:binary",{kind:"scalar",resolve:dn,construct:un,predicate:hn,represent:pn}),gn=Object.prototype.hasOwnProperty,mn=Object.prototype.toString;function fn(e){if(e===null)return!0;var n=[],t,r,i,o,a,s=e;for(t=0,r=s.length;t<r;t+=1){if(i=s[t],a=!1,mn.call(i)!=="[object Object]")return!1;for(o in i)if(gn.call(i,o))if(!a)a=!0;else return!1;if(!a)return!1;if(n.indexOf(o)===-1)n.push(o);else return!1}return!0}function bn(e){return e!==null?e:[]}var ar=new T("tag:yaml.org,2002:omap",{kind:"sequence",resolve:fn,construct:bn}),vn=Object.prototype.toString;function xn(e){if(e===null)return!0;var n,t,r,i,o,a=e;for(o=new Array(a.length),n=0,t=a.length;n<t;n+=1){if(r=a[n],vn.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;o[n]=[i[0],r[i[0]]]}return!0}function wn(e){if(e===null)return[];var n,t,r,i,o,a=e;for(o=new Array(a.length),n=0,t=a.length;n<t;n+=1)r=a[n],i=Object.keys(r),o[n]=[i[0],r[i[0]]];return o}var sr=new T("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:xn,construct:wn}),yn=Object.prototype.hasOwnProperty;function En(e){if(e===null)return!0;var n,t=e;for(n in t)if(yn.call(t,n)&&t[n]!==null)return!1;return!0}function Cn(e){return e!==null?e:{}}var lr=new T("tag:yaml.org,2002:set",{kind:"mapping",resolve:En,construct:Cn}),dt=er.extend({implicit:[ir,nr],explicit:[or,ar,sr,lr]}),N=Object.prototype.hasOwnProperty,Ge=1,cr=2,dr=3,Ne=4,it=1,kn=2,At=3,Sn=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Tn=/[\x85\u2028\u2029]/,$n=/[,\[\]\{\}]/,ur=/^(?:!|!!|![a-z\-]+!)$/i,pr=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function _t(e){return Object.prototype.toString.call(e)}function R(e){return e===10||e===13}function j(e){return e===9||e===32}function _(e){return e===9||e===32||e===10||e===13}function Q(e){return e===44||e===91||e===93||e===123||e===125}function An(e){var n;return 48<=e&&e<=57?e-48:(n=e|32,97<=n&&n<=102?n-97+10:-1)}function _n(e){return e===120?2:e===117?4:e===85?8:0}function In(e){return 48<=e&&e<=57?e-48:-1}function It(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
1011
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function Mn(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function hr(e,n,t){n==="__proto__"?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,writable:!0,value:t}):e[n]=t}var gr=new Array(256),mr=new Array(256);for(F=0;F<256;F++)gr[F]=It(F)?1:0,mr[F]=It(F);var F;function Ln(e,n){this.input=e,this.filename=n.filename||null,this.schema=n.schema||dt,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function fr(e,n){var t={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return t.snippet=Pi(t),new A(n,t)}function f(e,n){throw fr(e,n)}function Oe(e,n){e.onWarning&&e.onWarning.call(null,fr(e,n))}var Mt={YAML:function(n,t,r){var i,o,a;n.version!==null&&f(n,"duplication of %YAML directive"),r.length!==1&&f(n,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&f(n,"ill-formed argument of the YAML directive"),o=parseInt(i[1],10),a=parseInt(i[2],10),o!==1&&f(n,"unacceptable YAML version of the document"),n.version=r[0],n.checkLineBreaks=a<2,a!==1&&a!==2&&Oe(n,"unsupported YAML version of the document")},TAG:function(n,t,r){var i,o;r.length!==2&&f(n,"TAG directive accepts exactly two arguments"),i=r[0],o=r[1],ur.test(i)||f(n,"ill-formed tag handle (first argument) of the TAG directive"),N.call(n.tagMap,i)&&f(n,'there is a previously declared suffix for "'+i+'" tag handle'),pr.test(o)||f(n,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{f(n,"tag prefix is malformed: "+o)}n.tagMap[i]=o}};function G(e,n,t,r){var i,o,a,s;if(n<t){if(s=e.input.slice(n,t),r)for(i=0,o=s.length;i<o;i+=1)a=s.charCodeAt(i),a===9||32<=a&&a<=1114111||f(e,"expected valid JSON character");else Sn.test(s)&&f(e,"the stream contains non-printable characters");e.result+=s}}function Lt(e,n,t,r){var i,o,a,s;for(k.isObject(t)||f(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(t),a=0,s=i.length;a<s;a+=1)o=i[a],N.call(n,o)||(hr(n,o,t[o]),r[o]=!0)}function Z(e,n,t,r,i,o,a,s,l){var c,d;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),c=0,d=i.length;c<d;c+=1)Array.isArray(i[c])&&f(e,"nested arrays are not supported inside keys"),typeof i=="object"&&_t(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&_t(i)==="[object Object]"&&(i="[object Object]"),i=String(i),n===null&&(n={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(c=0,d=o.length;c<d;c+=1)Lt(e,n,o[c],t);else Lt(e,n,o,t);else!e.json&&!N.call(t,i)&&N.call(n,i)&&(e.line=a||e.line,e.lineStart=s||e.lineStart,e.position=l||e.position,f(e,"duplicated mapping key")),hr(n,i,o),delete t[i];return n}function ut(e){var n;n=e.input.charCodeAt(e.position),n===10?e.position++:n===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):f(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function y(e,n,t){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;j(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(n&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(R(i))for(ut(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return t!==-1&&r!==0&&e.lineIndent<t&&Oe(e,"deficient indentation"),r}function je(e){var n=e.position,t;return t=e.input.charCodeAt(n),!!((t===45||t===46)&&t===e.input.charCodeAt(n+1)&&t===e.input.charCodeAt(n+2)&&(n+=3,t=e.input.charCodeAt(n),t===0||_(t)))}function pt(e,n){n===1?e.result+=" ":n>1&&(e.result+=k.repeat(`
1012
- `,n-1))}function Dn(e,n,t){var r,i,o,a,s,l,c,d,u=e.kind,p=e.result,h;if(h=e.input.charCodeAt(e.position),_(h)||Q(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(i=e.input.charCodeAt(e.position+1),_(i)||t&&Q(i)))return!1;for(e.kind="scalar",e.result="",o=a=e.position,s=!1;h!==0;){if(h===58){if(i=e.input.charCodeAt(e.position+1),_(i)||t&&Q(i))break}else if(h===35){if(r=e.input.charCodeAt(e.position-1),_(r))break}else{if(e.position===e.lineStart&&je(e)||t&&Q(h))break;if(R(h))if(l=e.line,c=e.lineStart,d=e.lineIndent,y(e,!1,-1),e.lineIndent>=n){s=!0,h=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=c,e.lineIndent=d;break}}s&&(G(e,o,a,!1),pt(e,e.line-l),o=a=e.position,s=!1),j(h)||(a=e.position+1),h=e.input.charCodeAt(++e.position)}return G(e,o,a,!1),e.result?!0:(e.kind=u,e.result=p,!1)}function Rn(e,n){var t,r,i;if(t=e.input.charCodeAt(e.position),t!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(t=e.input.charCodeAt(e.position))!==0;)if(t===39)if(G(e,r,e.position,!0),t=e.input.charCodeAt(++e.position),t===39)r=e.position,e.position++,i=e.position;else return!0;else R(t)?(G(e,r,i,!0),pt(e,y(e,!1,n)),r=i=e.position):e.position===e.lineStart&&je(e)?f(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);f(e,"unexpected end of the stream within a single quoted scalar")}function Pn(e,n){var t,r,i,o,a,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,t=r=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return G(e,t,e.position,!0),e.position++,!0;if(s===92){if(G(e,t,e.position,!0),s=e.input.charCodeAt(++e.position),R(s))y(e,!1,n);else if(s<256&&gr[s])e.result+=mr[s],e.position++;else if((a=_n(s))>0){for(i=a,o=0;i>0;i--)s=e.input.charCodeAt(++e.position),(a=An(s))>=0?o=(o<<4)+a:f(e,"expected hexadecimal character");e.result+=Mn(o),e.position++}else f(e,"unknown escape sequence");t=r=e.position}else R(s)?(G(e,t,r,!0),pt(e,y(e,!1,n)),t=r=e.position):e.position===e.lineStart&&je(e)?f(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}f(e,"unexpected end of the stream within a double quoted scalar")}function Bn(e,n){var t=!0,r,i,o,a=e.tag,s,l=e.anchor,c,d,u,p,h,g=Object.create(null),m,b,w,v;if(v=e.input.charCodeAt(e.position),v===91)d=93,h=!1,s=[];else if(v===123)d=125,h=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),v=e.input.charCodeAt(++e.position);v!==0;){if(y(e,!0,n),v=e.input.charCodeAt(e.position),v===d)return e.position++,e.tag=a,e.anchor=l,e.kind=h?"mapping":"sequence",e.result=s,!0;t?v===44&&f(e,"expected the node content, but found ','"):f(e,"missed comma between flow collection entries"),b=m=w=null,u=p=!1,v===63&&(c=e.input.charCodeAt(e.position+1),_(c)&&(u=p=!0,e.position++,y(e,!0,n))),r=e.line,i=e.lineStart,o=e.position,X(e,n,Ge,!1,!0),b=e.tag,m=e.result,y(e,!0,n),v=e.input.charCodeAt(e.position),(p||e.line===r)&&v===58&&(u=!0,v=e.input.charCodeAt(++e.position),y(e,!0,n),X(e,n,Ge,!1,!0),w=e.result),h?Z(e,s,g,b,m,w,r,i,o):u?s.push(Z(e,null,g,b,m,w,r,i,o)):s.push(m),y(e,!0,n),v=e.input.charCodeAt(e.position),v===44?(t=!0,v=e.input.charCodeAt(++e.position)):t=!1}f(e,"unexpected end of the stream within a flow collection")}function qn(e,n){var t,r,i=it,o=!1,a=!1,s=n,l=0,c=!1,d,u;if(u=e.input.charCodeAt(e.position),u===124)r=!1;else if(u===62)r=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)it===i?i=u===43?At:kn:f(e,"repeat of a chomping mode identifier");else if((d=In(u))>=0)d===0?f(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?f(e,"repeat of an indentation width identifier"):(s=n+d-1,a=!0);else break;if(j(u)){do u=e.input.charCodeAt(++e.position);while(j(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!R(u)&&u!==0)}for(;u!==0;){for(ut(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!a||e.lineIndent<s)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>s&&(s=e.lineIndent),R(u)){l++;continue}if(e.lineIndent<s){i===At?e.result+=k.repeat(`
1013
- `,o?1+l:l):i===it&&o&&(e.result+=`
1014
- `);break}for(r?j(u)?(c=!0,e.result+=k.repeat(`
1015
- `,o?1+l:l)):c?(c=!1,e.result+=k.repeat(`
1016
- `,l+1)):l===0?o&&(e.result+=" "):e.result+=k.repeat(`
1017
- `,l):e.result+=k.repeat(`
1018
- `,o?1+l:l),o=!0,a=!0,l=0,t=e.position;!R(u)&&u!==0;)u=e.input.charCodeAt(++e.position);G(e,t,e.position,!1)}return!0}function Dt(e,n){var t,r=e.tag,i=e.anchor,o=[],a,s=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,f(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!_(a))));){if(s=!0,e.position++,y(e,!0,-1)&&e.lineIndent<=n){o.push(null),l=e.input.charCodeAt(e.position);continue}if(t=e.line,X(e,n,dr,!1,!0),o.push(e.result),y(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===t||e.lineIndent>n)&&l!==0)f(e,"bad indentation of a sequence entry");else if(e.lineIndent<n)break}return s?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=o,!0):!1}function zn(e,n,t){var r,i,o,a,s,l,c=e.tag,d=e.anchor,u={},p=Object.create(null),h=null,g=null,m=null,b=!1,w=!1,v;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),v=e.input.charCodeAt(e.position);v!==0;){if(!b&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,f(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),o=e.line,(v===63||v===58)&&_(r))v===63?(b&&(Z(e,u,p,h,g,null,a,s,l),h=g=m=null),w=!0,b=!0,i=!0):b?(b=!1,i=!0):f(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,v=r;else{if(a=e.line,s=e.lineStart,l=e.position,!X(e,t,cr,!1,!0))break;if(e.line===o){for(v=e.input.charCodeAt(e.position);j(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),_(v)||f(e,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(Z(e,u,p,h,g,null,a,s,l),h=g=m=null),w=!0,b=!1,i=!1,h=e.tag,g=e.result;else if(w)f(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=d,!0}else if(w)f(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=d,!0}if((e.line===o||e.lineIndent>n)&&(b&&(a=e.line,s=e.lineStart,l=e.position),X(e,n,Ne,!0,i)&&(b?g=e.result:m=e.result),b||(Z(e,u,p,h,g,m,a,s,l),h=g=m=null),y(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>n)&&v!==0)f(e,"bad indentation of a mapping entry");else if(e.lineIndent<n)break}return b&&Z(e,u,p,h,g,null,a,s,l),w&&(e.tag=c,e.anchor=d,e.kind="mapping",e.result=u),w}function Hn(e){var n,t=!1,r=!1,i,o,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&f(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(t=!0,a=e.input.charCodeAt(++e.position)):a===33?(r=!0,i="!!",a=e.input.charCodeAt(++e.position)):i="!",n=e.position,t){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(o=e.input.slice(n,e.position),a=e.input.charCodeAt(++e.position)):f(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!_(a);)a===33&&(r?f(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(n-1,e.position+1),ur.test(i)||f(e,"named tag handle cannot contain such characters"),r=!0,n=e.position+1)),a=e.input.charCodeAt(++e.position);o=e.input.slice(n,e.position),$n.test(o)&&f(e,"tag suffix cannot contain flow indicator characters")}o&&!pr.test(o)&&f(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{f(e,"tag name is malformed: "+o)}return t?e.tag=o:N.call(e.tagMap,i)?e.tag=e.tagMap[i]+o:i==="!"?e.tag="!"+o:i==="!!"?e.tag="tag:yaml.org,2002:"+o:f(e,'undeclared tag handle "'+i+'"'),!0}function Gn(e){var n,t;if(t=e.input.charCodeAt(e.position),t!==38)return!1;for(e.anchor!==null&&f(e,"duplication of an anchor property"),t=e.input.charCodeAt(++e.position),n=e.position;t!==0&&!_(t)&&!Q(t);)t=e.input.charCodeAt(++e.position);return e.position===n&&f(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(n,e.position),!0}function Nn(e){var n,t,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),n=e.position;r!==0&&!_(r)&&!Q(r);)r=e.input.charCodeAt(++e.position);return e.position===n&&f(e,"name of an alias node must contain at least one character"),t=e.input.slice(n,e.position),N.call(e.anchorMap,t)||f(e,'unidentified alias "'+t+'"'),e.result=e.anchorMap[t],y(e,!0,-1),!0}function X(e,n,t,r,i){var o,a,s,l=1,c=!1,d=!1,u,p,h,g,m,b;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=a=s=Ne===t||dr===t,r&&y(e,!0,-1)&&(c=!0,e.lineIndent>n?l=1:e.lineIndent===n?l=0:e.lineIndent<n&&(l=-1)),l===1)for(;Hn(e)||Gn(e);)y(e,!0,-1)?(c=!0,s=o,e.lineIndent>n?l=1:e.lineIndent===n?l=0:e.lineIndent<n&&(l=-1)):s=!1;if(s&&(s=c||i),(l===1||Ne===t)&&(Ge===t||cr===t?m=n:m=n+1,b=e.position-e.lineStart,l===1?s&&(Dt(e,b)||zn(e,b,m))||Bn(e,m)?d=!0:(a&&qn(e,m)||Rn(e,m)||Pn(e,m)?d=!0:Nn(e)?(d=!0,(e.tag!==null||e.anchor!==null)&&f(e,"alias node should not have any properties")):Dn(e,m,Ge===t)&&(d=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(d=s&&Dt(e,b))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&f(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,p=e.implicitTypes.length;u<p;u+=1)if(g=e.implicitTypes[u],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(N.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,h=e.typeMap.multi[e.kind||"fallback"],u=0,p=h.length;u<p;u+=1)if(e.tag.slice(0,h[u].tag.length)===h[u].tag){g=h[u];break}g||f(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&f(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):f(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||d}function On(e){var n=e.position,t,r,i,o=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(y(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(o=!0,a=e.input.charCodeAt(++e.position),t=e.position;a!==0&&!_(a);)a=e.input.charCodeAt(++e.position);for(r=e.input.slice(t,e.position),i=[],r.length<1&&f(e,"directive name must not be less than one character in length");a!==0;){for(;j(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!R(a));break}if(R(a))break;for(t=e.position;a!==0&&!_(a);)a=e.input.charCodeAt(++e.position);i.push(e.input.slice(t,e.position))}a!==0&&ut(e),N.call(Mt,r)?Mt[r](e,r,i):Oe(e,'unknown document directive "'+r+'"')}if(y(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,y(e,!0,-1)):o&&f(e,"directives end mark is expected"),X(e,e.lineIndent-1,Ne,!1,!0),y(e,!0,-1),e.checkLineBreaks&&Tn.test(e.input.slice(n,e.position))&&Oe(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&je(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,y(e,!0,-1));return}if(e.position<e.length-1)f(e,"end of the stream or a document separator is expected");else return}function br(e,n){e=String(e),n=n||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
1019
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var t=new Ln(e,n),r=e.indexOf("\0");for(r!==-1&&(t.position=r,f(t,"null byte is not allowed in input")),t.input+="\0";t.input.charCodeAt(t.position)===32;)t.lineIndent+=1,t.position+=1;for(;t.position<t.length-1;)On(t);return t.documents}function Vn(e,n,t){n!==null&&typeof n=="object"&&typeof t>"u"&&(t=n,n=null);var r=br(e,t);if(typeof n!="function")return r;for(var i=0,o=r.length;i<o;i+=1)n(r[i])}function Fn(e,n){var t=br(e,n);if(t.length!==0){if(t.length===1)return t[0];throw new A("expected a single document in the stream, but found more")}}var jn=Vn,Un=Fn,vr={loadAll:jn,load:Un},xr=Object.prototype.toString,wr=Object.prototype.hasOwnProperty,ht=65279,Yn=9,fe=10,Kn=13,Wn=32,Qn=33,Zn=34,ot=35,Xn=37,Jn=38,eo=39,to=42,yr=44,ro=45,Ve=58,io=61,no=62,oo=63,ao=64,Er=91,Cr=93,so=96,kr=123,lo=124,Sr=125,$={};$[0]="\\0";$[7]="\\a";$[8]="\\b";$[9]="\\t";$[10]="\\n";$[11]="\\v";$[12]="\\f";$[13]="\\r";$[27]="\\e";$[34]='\\"';$[92]="\\\\";$[133]="\\N";$[160]="\\_";$[8232]="\\L";$[8233]="\\P";var co=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],uo=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function po(e,n){var t,r,i,o,a,s,l;if(n===null)return{};for(t={},r=Object.keys(n),i=0,o=r.length;i<o;i+=1)a=r[i],s=String(n[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&wr.call(l.styleAliases,s)&&(s=l.styleAliases[s]),t[a]=s;return t}function ho(e){var n,t,r;if(n=e.toString(16).toUpperCase(),e<=255)t="x",r=2;else if(e<=65535)t="u",r=4;else if(e<=4294967295)t="U",r=8;else throw new A("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+t+k.repeat("0",r-n.length)+n}var go=1,be=2;function mo(e){this.schema=e.schema||dt,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=k.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=po(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?be:go,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function Rt(e,n){for(var t=k.repeat(" ",n),r=0,i=-1,o="",a,s=e.length;r<s;)i=e.indexOf(`
1003
+ `,V=class extends HTMLElement{static get observedAttributes(){return["variant"]}constructor(){super(),this.attachShadow({mode:"open"}),this.shadowRoot.innerHTML=_i,this.$blockEl=this.shadowRoot.querySelector(".block"),L.injectKeyframes(this.shadowRoot)}connectedCallback(){this.hasAttribute("variant")||(this.variant="outline"),this.sync()}attributeChangedCallback(){this.sync()}sync(){this.$blockEl&&this.$blockEl.setAttribute("variant",this.variant)}getBlock(){return this.$blockEl}get variant(){return this.getAttribute("variant")??"outline"}set variant(n){this.setAttribute("variant",n)}setAccentColor(n){this.shadowRoot.host.style.setProperty("--accent-color",n)}removeSelf(){this.remove()}};customElements.get("edu-block")||customElements.define("edu-block",V);function Ut(e){return typeof e>"u"||e===null}function Ii(e){return typeof e=="object"&&e!==null}function Mi(e){return Array.isArray(e)?e:Ut(e)?[]:[e]}function Li(e,n){var t,r,i,o;if(n)for(o=Object.keys(n),t=0,r=o.length;t<r;t+=1)i=o[t],e[i]=n[i];return e}function Di(e,n){var t="",r;for(r=0;r<n;r+=1)t+=e;return t}function Ri(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Pi=Ut,Bi=Ii,qi=Mi,zi=Di,Hi=Ri,Ni=Li,S={isNothing:Pi,isObject:Bi,toArray:qi,repeat:zi,isNegativeZero:Hi,extend:Ni};function Yt(e,n){var t="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(t+='in "'+e.mark.name+'" '),t+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!n&&e.mark.snippet&&(t+=`
1004
+
1005
+ `+e.mark.snippet),r+" "+t):r}function fe(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=Yt(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}fe.prototype=Object.create(Error.prototype);fe.prototype.constructor=fe;fe.prototype.toString=function(n){return this.name+": "+Yt(this,n)};var _=fe;function it(e,n,t,r,i){var o="",a="",s=Math.floor(i/2)-1;return r-n>s&&(o=" ... ",n=r-s+o.length),t-r>s&&(a=" ...",t=r+s-a.length),{str:o+e.slice(n,t).replace(/\t/g,"\u2192")+a,pos:r-n+o.length}}function nt(e,n){return S.repeat(" ",n-e.length)+e}function Gi(e,n){if(n=Object.create(n||null),!e.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var t=/\r?\n|\r|\0/g,r=[0],i=[],o,a=-1;o=t.exec(e.buffer);)i.push(o.index),r.push(o.index+o[0].length),e.position<=o.index&&a<0&&(a=r.length-2);a<0&&(a=r.length-1);var s="",l,c,d=Math.min(e.line+n.linesAfter,i.length).toString().length,u=n.maxLength-(n.indent+d+3);for(l=1;l<=n.linesBefore&&!(a-l<0);l++)c=it(e.buffer,r[a-l],i[a-l],e.position-(r[a]-r[a-l]),u),s=S.repeat(" ",n.indent)+nt((e.line-l+1).toString(),d)+" | "+c.str+`
1006
+ `+s;for(c=it(e.buffer,r[a],i[a],e.position,u),s+=S.repeat(" ",n.indent)+nt((e.line+1).toString(),d)+" | "+c.str+`
1007
+ `,s+=S.repeat("-",n.indent+d+3+c.pos)+`^
1008
+ `,l=1;l<=n.linesAfter&&!(a+l>=i.length);l++)c=it(e.buffer,r[a+l],i[a+l],e.position-(r[a]-r[a+l]),u),s+=S.repeat(" ",n.indent)+nt((e.line+l+1).toString(),d)+" | "+c.str+`
1009
+ `;return s.replace(/\n$/,"")}var Oi=Gi,Vi=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Fi=["scalar","sequence","mapping"];function ji(e){var n={};return e!==null&&Object.keys(e).forEach(function(t){e[t].forEach(function(r){n[String(r)]=t})}),n}function Ui(e,n){if(n=n||{},Object.keys(n).forEach(function(t){if(Vi.indexOf(t)===-1)throw new _('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.options=n,this.tag=e,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(t){return t},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=ji(n.styleAliases||null),Fi.indexOf(this.kind)===-1)throw new _('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var $=Ui;function Mt(e,n){var t=[];return e[n].forEach(function(r){var i=t.length;t.forEach(function(o,a){o.tag===r.tag&&o.kind===r.kind&&o.multi===r.multi&&(i=a)}),t[i]=r}),t}function Yi(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,t;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(n=0,t=arguments.length;n<t;n+=1)arguments[n].forEach(r);return e}function at(e){return this.extend(e)}at.prototype.extend=function(n){var t=[],r=[];if(n instanceof $)r.push(n);else if(Array.isArray(n))r=r.concat(n);else if(n&&(Array.isArray(n.implicit)||Array.isArray(n.explicit)))n.implicit&&(t=t.concat(n.implicit)),n.explicit&&(r=r.concat(n.explicit));else throw new _("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(o){if(!(o instanceof $))throw new _("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new _("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new _("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(o){if(!(o instanceof $))throw new _("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(at.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=Mt(i,"implicit"),i.compiledExplicit=Mt(i,"explicit"),i.compiledTypeMap=Yi(i.compiledImplicit,i.compiledExplicit),i};var Kt=at,Wt=new $("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Qt=new $("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Zt=new $("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),Xt=new Kt({explicit:[Wt,Qt,Zt]});function Ki(e){if(e===null)return!0;var n=e.length;return n===1&&e==="~"||n===4&&(e==="null"||e==="Null"||e==="NULL")}function Wi(){return null}function Qi(e){return e===null}var Jt=new $("tag:yaml.org,2002:null",{kind:"scalar",resolve:Ki,construct:Wi,predicate:Qi,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Zi(e){if(e===null)return!1;var n=e.length;return n===4&&(e==="true"||e==="True"||e==="TRUE")||n===5&&(e==="false"||e==="False"||e==="FALSE")}function Xi(e){return e==="true"||e==="True"||e==="TRUE"}function Ji(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var er=new $("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Zi,construct:Xi,predicate:Ji,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function en(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function tn(e){return 48<=e&&e<=55}function rn(e){return 48<=e&&e<=57}function nn(e){if(e===null)return!1;var n=e.length,t=0,r=!1,i;if(!n)return!1;if(i=e[t],(i==="-"||i==="+")&&(i=e[++t]),i==="0"){if(t+1===n)return!0;if(i=e[++t],i==="b"){for(t++;t<n;t++)if(i=e[t],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(t++;t<n;t++)if(i=e[t],i!=="_"){if(!en(e.charCodeAt(t)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(t++;t<n;t++)if(i=e[t],i!=="_"){if(!tn(e.charCodeAt(t)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;t<n;t++)if(i=e[t],i!=="_"){if(!rn(e.charCodeAt(t)))return!1;r=!0}return!(!r||i==="_")}function on(e){var n=e,t=1,r;if(n.indexOf("_")!==-1&&(n=n.replace(/_/g,"")),r=n[0],(r==="-"||r==="+")&&(r==="-"&&(t=-1),n=n.slice(1),r=n[0]),n==="0")return 0;if(r==="0"){if(n[1]==="b")return t*parseInt(n.slice(2),2);if(n[1]==="x")return t*parseInt(n.slice(2),16);if(n[1]==="o")return t*parseInt(n.slice(2),8)}return t*parseInt(n,10)}function an(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!S.isNegativeZero(e)}var tr=new $("tag:yaml.org,2002:int",{kind:"scalar",resolve:nn,construct:on,predicate:an,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),sn=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function ln(e){return!(e===null||!sn.test(e)||e[e.length-1]==="_")}function cn(e){var n,t;return n=e.replace(/_/g,"").toLowerCase(),t=n[0]==="-"?-1:1,"+-".indexOf(n[0])>=0&&(n=n.slice(1)),n===".inf"?t===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:n===".nan"?NaN:t*parseFloat(n,10)}var dn=/^[-+]?[0-9]+e/;function un(e,n){var t;if(isNaN(e))switch(n){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(n){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(n){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(S.isNegativeZero(e))return"-0.0";return t=e.toString(10),dn.test(t)?t.replace("e",".e"):t}function pn(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||S.isNegativeZero(e))}var rr=new $("tag:yaml.org,2002:float",{kind:"scalar",resolve:ln,construct:cn,predicate:pn,represent:un,defaultStyle:"lowercase"}),ir=Xt.extend({implicit:[Jt,er,tr,rr]}),nr=ir,or=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),ar=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function hn(e){return e===null?!1:or.exec(e)!==null||ar.exec(e)!==null}function gn(e){var n,t,r,i,o,a,s,l=0,c=null,d,u,p;if(n=or.exec(e),n===null&&(n=ar.exec(e)),n===null)throw new Error("Date resolve error");if(t=+n[1],r=+n[2]-1,i=+n[3],!n[4])return new Date(Date.UTC(t,r,i));if(o=+n[4],a=+n[5],s=+n[6],n[7]){for(l=n[7].slice(0,3);l.length<3;)l+="0";l=+l}return n[9]&&(d=+n[10],u=+(n[11]||0),c=(d*60+u)*6e4,n[9]==="-"&&(c=-c)),p=new Date(Date.UTC(t,r,i,o,a,s,l)),c&&p.setTime(p.getTime()-c),p}function mn(e){return e.toISOString()}var sr=new $("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:hn,construct:gn,instanceOf:Date,represent:mn});function fn(e){return e==="<<"||e===null}var lr=new $("tag:yaml.org,2002:merge",{kind:"scalar",resolve:fn}),ut=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
1010
+ \r`;function bn(e){if(e===null)return!1;var n,t,r=0,i=e.length,o=ut;for(t=0;t<i;t++)if(n=o.indexOf(e.charAt(t)),!(n>64)){if(n<0)return!1;r+=6}return r%8===0}function vn(e){var n,t,r=e.replace(/[\r\n=]/g,""),i=r.length,o=ut,a=0,s=[];for(n=0;n<i;n++)n%4===0&&n&&(s.push(a>>16&255),s.push(a>>8&255),s.push(a&255)),a=a<<6|o.indexOf(r.charAt(n));return t=i%4*6,t===0?(s.push(a>>16&255),s.push(a>>8&255),s.push(a&255)):t===18?(s.push(a>>10&255),s.push(a>>2&255)):t===12&&s.push(a>>4&255),new Uint8Array(s)}function xn(e){var n="",t=0,r,i,o=e.length,a=ut;for(r=0;r<o;r++)r%3===0&&r&&(n+=a[t>>18&63],n+=a[t>>12&63],n+=a[t>>6&63],n+=a[t&63]),t=(t<<8)+e[r];return i=o%3,i===0?(n+=a[t>>18&63],n+=a[t>>12&63],n+=a[t>>6&63],n+=a[t&63]):i===2?(n+=a[t>>10&63],n+=a[t>>4&63],n+=a[t<<2&63],n+=a[64]):i===1&&(n+=a[t>>2&63],n+=a[t<<4&63],n+=a[64],n+=a[64]),n}function wn(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var cr=new $("tag:yaml.org,2002:binary",{kind:"scalar",resolve:bn,construct:vn,predicate:wn,represent:xn}),yn=Object.prototype.hasOwnProperty,En=Object.prototype.toString;function Cn(e){if(e===null)return!0;var n=[],t,r,i,o,a,s=e;for(t=0,r=s.length;t<r;t+=1){if(i=s[t],a=!1,En.call(i)!=="[object Object]")return!1;for(o in i)if(yn.call(i,o))if(!a)a=!0;else return!1;if(!a)return!1;if(n.indexOf(o)===-1)n.push(o);else return!1}return!0}function kn(e){return e!==null?e:[]}var dr=new $("tag:yaml.org,2002:omap",{kind:"sequence",resolve:Cn,construct:kn}),Sn=Object.prototype.toString;function Tn(e){if(e===null)return!0;var n,t,r,i,o,a=e;for(o=new Array(a.length),n=0,t=a.length;n<t;n+=1){if(r=a[n],Sn.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;o[n]=[i[0],r[i[0]]]}return!0}function $n(e){if(e===null)return[];var n,t,r,i,o,a=e;for(o=new Array(a.length),n=0,t=a.length;n<t;n+=1)r=a[n],i=Object.keys(r),o[n]=[i[0],r[i[0]]];return o}var ur=new $("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Tn,construct:$n}),An=Object.prototype.hasOwnProperty;function _n(e){if(e===null)return!0;var n,t=e;for(n in t)if(An.call(t,n)&&t[n]!==null)return!1;return!0}function In(e){return e!==null?e:{}}var pr=new $("tag:yaml.org,2002:set",{kind:"mapping",resolve:_n,construct:In}),pt=nr.extend({implicit:[sr,lr],explicit:[cr,dr,ur,pr]}),G=Object.prototype.hasOwnProperty,Ge=1,hr=2,gr=3,Oe=4,ot=1,Mn=2,Lt=3,Ln=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Dn=/[\x85\u2028\u2029]/,Rn=/[,\[\]\{\}]/,mr=/^(?:!|!!|![a-z\-]+!)$/i,fr=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Dt(e){return Object.prototype.toString.call(e)}function R(e){return e===10||e===13}function j(e){return e===9||e===32}function I(e){return e===9||e===32||e===10||e===13}function Z(e){return e===44||e===91||e===93||e===123||e===125}function Pn(e){var n;return 48<=e&&e<=57?e-48:(n=e|32,97<=n&&n<=102?n-97+10:-1)}function Bn(e){return e===120?2:e===117?4:e===85?8:0}function qn(e){return 48<=e&&e<=57?e-48:-1}function Rt(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
1011
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function zn(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}function br(e,n,t){n==="__proto__"?Object.defineProperty(e,n,{configurable:!0,enumerable:!0,writable:!0,value:t}):e[n]=t}var vr=new Array(256),xr=new Array(256);for(F=0;F<256;F++)vr[F]=Rt(F)?1:0,xr[F]=Rt(F);var F;function Hn(e,n){this.input=e,this.filename=n.filename||null,this.schema=n.schema||pt,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function wr(e,n){var t={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return t.snippet=Oi(t),new _(n,t)}function f(e,n){throw wr(e,n)}function Ve(e,n){e.onWarning&&e.onWarning.call(null,wr(e,n))}var Pt={YAML:function(n,t,r){var i,o,a;n.version!==null&&f(n,"duplication of %YAML directive"),r.length!==1&&f(n,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&f(n,"ill-formed argument of the YAML directive"),o=parseInt(i[1],10),a=parseInt(i[2],10),o!==1&&f(n,"unacceptable YAML version of the document"),n.version=r[0],n.checkLineBreaks=a<2,a!==1&&a!==2&&Ve(n,"unsupported YAML version of the document")},TAG:function(n,t,r){var i,o;r.length!==2&&f(n,"TAG directive accepts exactly two arguments"),i=r[0],o=r[1],mr.test(i)||f(n,"ill-formed tag handle (first argument) of the TAG directive"),G.call(n.tagMap,i)&&f(n,'there is a previously declared suffix for "'+i+'" tag handle'),fr.test(o)||f(n,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{f(n,"tag prefix is malformed: "+o)}n.tagMap[i]=o}};function N(e,n,t,r){var i,o,a,s;if(n<t){if(s=e.input.slice(n,t),r)for(i=0,o=s.length;i<o;i+=1)a=s.charCodeAt(i),a===9||32<=a&&a<=1114111||f(e,"expected valid JSON character");else Ln.test(s)&&f(e,"the stream contains non-printable characters");e.result+=s}}function Bt(e,n,t,r){var i,o,a,s;for(S.isObject(t)||f(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(t),a=0,s=i.length;a<s;a+=1)o=i[a],G.call(n,o)||(br(n,o,t[o]),r[o]=!0)}function X(e,n,t,r,i,o,a,s,l){var c,d;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),c=0,d=i.length;c<d;c+=1)Array.isArray(i[c])&&f(e,"nested arrays are not supported inside keys"),typeof i=="object"&&Dt(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&Dt(i)==="[object Object]"&&(i="[object Object]"),i=String(i),n===null&&(n={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(c=0,d=o.length;c<d;c+=1)Bt(e,n,o[c],t);else Bt(e,n,o,t);else!e.json&&!G.call(t,i)&&G.call(n,i)&&(e.line=a||e.line,e.lineStart=s||e.lineStart,e.position=l||e.position,f(e,"duplicated mapping key")),br(n,i,o),delete t[i];return n}function ht(e){var n;n=e.input.charCodeAt(e.position),n===10?e.position++:n===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):f(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function E(e,n,t){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;j(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(n&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(R(i))for(ht(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return t!==-1&&r!==0&&e.lineIndent<t&&Ve(e,"deficient indentation"),r}function Ue(e){var n=e.position,t;return t=e.input.charCodeAt(n),!!((t===45||t===46)&&t===e.input.charCodeAt(n+1)&&t===e.input.charCodeAt(n+2)&&(n+=3,t=e.input.charCodeAt(n),t===0||I(t)))}function gt(e,n){n===1?e.result+=" ":n>1&&(e.result+=S.repeat(`
1012
+ `,n-1))}function Nn(e,n,t){var r,i,o,a,s,l,c,d,u=e.kind,p=e.result,h;if(h=e.input.charCodeAt(e.position),I(h)||Z(h)||h===35||h===38||h===42||h===33||h===124||h===62||h===39||h===34||h===37||h===64||h===96||(h===63||h===45)&&(i=e.input.charCodeAt(e.position+1),I(i)||t&&Z(i)))return!1;for(e.kind="scalar",e.result="",o=a=e.position,s=!1;h!==0;){if(h===58){if(i=e.input.charCodeAt(e.position+1),I(i)||t&&Z(i))break}else if(h===35){if(r=e.input.charCodeAt(e.position-1),I(r))break}else{if(e.position===e.lineStart&&Ue(e)||t&&Z(h))break;if(R(h))if(l=e.line,c=e.lineStart,d=e.lineIndent,E(e,!1,-1),e.lineIndent>=n){s=!0,h=e.input.charCodeAt(e.position);continue}else{e.position=a,e.line=l,e.lineStart=c,e.lineIndent=d;break}}s&&(N(e,o,a,!1),gt(e,e.line-l),o=a=e.position,s=!1),j(h)||(a=e.position+1),h=e.input.charCodeAt(++e.position)}return N(e,o,a,!1),e.result?!0:(e.kind=u,e.result=p,!1)}function Gn(e,n){var t,r,i;if(t=e.input.charCodeAt(e.position),t!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(t=e.input.charCodeAt(e.position))!==0;)if(t===39)if(N(e,r,e.position,!0),t=e.input.charCodeAt(++e.position),t===39)r=e.position,e.position++,i=e.position;else return!0;else R(t)?(N(e,r,i,!0),gt(e,E(e,!1,n)),r=i=e.position):e.position===e.lineStart&&Ue(e)?f(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);f(e,"unexpected end of the stream within a single quoted scalar")}function On(e,n){var t,r,i,o,a,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,t=r=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return N(e,t,e.position,!0),e.position++,!0;if(s===92){if(N(e,t,e.position,!0),s=e.input.charCodeAt(++e.position),R(s))E(e,!1,n);else if(s<256&&vr[s])e.result+=xr[s],e.position++;else if((a=Bn(s))>0){for(i=a,o=0;i>0;i--)s=e.input.charCodeAt(++e.position),(a=Pn(s))>=0?o=(o<<4)+a:f(e,"expected hexadecimal character");e.result+=zn(o),e.position++}else f(e,"unknown escape sequence");t=r=e.position}else R(s)?(N(e,t,r,!0),gt(e,E(e,!1,n)),t=r=e.position):e.position===e.lineStart&&Ue(e)?f(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}f(e,"unexpected end of the stream within a double quoted scalar")}function Vn(e,n){var t=!0,r,i,o,a=e.tag,s,l=e.anchor,c,d,u,p,h,g=Object.create(null),m,b,w,v;if(v=e.input.charCodeAt(e.position),v===91)d=93,h=!1,s=[];else if(v===123)d=125,h=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),v=e.input.charCodeAt(++e.position);v!==0;){if(E(e,!0,n),v=e.input.charCodeAt(e.position),v===d)return e.position++,e.tag=a,e.anchor=l,e.kind=h?"mapping":"sequence",e.result=s,!0;t?v===44&&f(e,"expected the node content, but found ','"):f(e,"missed comma between flow collection entries"),b=m=w=null,u=p=!1,v===63&&(c=e.input.charCodeAt(e.position+1),I(c)&&(u=p=!0,e.position++,E(e,!0,n))),r=e.line,i=e.lineStart,o=e.position,J(e,n,Ge,!1,!0),b=e.tag,m=e.result,E(e,!0,n),v=e.input.charCodeAt(e.position),(p||e.line===r)&&v===58&&(u=!0,v=e.input.charCodeAt(++e.position),E(e,!0,n),J(e,n,Ge,!1,!0),w=e.result),h?X(e,s,g,b,m,w,r,i,o):u?s.push(X(e,null,g,b,m,w,r,i,o)):s.push(m),E(e,!0,n),v=e.input.charCodeAt(e.position),v===44?(t=!0,v=e.input.charCodeAt(++e.position)):t=!1}f(e,"unexpected end of the stream within a flow collection")}function Fn(e,n){var t,r,i=ot,o=!1,a=!1,s=n,l=0,c=!1,d,u;if(u=e.input.charCodeAt(e.position),u===124)r=!1;else if(u===62)r=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)ot===i?i=u===43?Lt:Mn:f(e,"repeat of a chomping mode identifier");else if((d=qn(u))>=0)d===0?f(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):a?f(e,"repeat of an indentation width identifier"):(s=n+d-1,a=!0);else break;if(j(u)){do u=e.input.charCodeAt(++e.position);while(j(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!R(u)&&u!==0)}for(;u!==0;){for(ht(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!a||e.lineIndent<s)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!a&&e.lineIndent>s&&(s=e.lineIndent),R(u)){l++;continue}if(e.lineIndent<s){i===Lt?e.result+=S.repeat(`
1013
+ `,o?1+l:l):i===ot&&o&&(e.result+=`
1014
+ `);break}for(r?j(u)?(c=!0,e.result+=S.repeat(`
1015
+ `,o?1+l:l)):c?(c=!1,e.result+=S.repeat(`
1016
+ `,l+1)):l===0?o&&(e.result+=" "):e.result+=S.repeat(`
1017
+ `,l):e.result+=S.repeat(`
1018
+ `,o?1+l:l),o=!0,a=!0,l=0,t=e.position;!R(u)&&u!==0;)u=e.input.charCodeAt(++e.position);N(e,t,e.position,!1)}return!0}function qt(e,n){var t,r=e.tag,i=e.anchor,o=[],a,s=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,f(e,"tab characters must not be used in indentation")),!(l!==45||(a=e.input.charCodeAt(e.position+1),!I(a))));){if(s=!0,e.position++,E(e,!0,-1)&&e.lineIndent<=n){o.push(null),l=e.input.charCodeAt(e.position);continue}if(t=e.line,J(e,n,gr,!1,!0),o.push(e.result),E(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===t||e.lineIndent>n)&&l!==0)f(e,"bad indentation of a sequence entry");else if(e.lineIndent<n)break}return s?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=o,!0):!1}function jn(e,n,t){var r,i,o,a,s,l,c=e.tag,d=e.anchor,u={},p=Object.create(null),h=null,g=null,m=null,b=!1,w=!1,v;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),v=e.input.charCodeAt(e.position);v!==0;){if(!b&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,f(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),o=e.line,(v===63||v===58)&&I(r))v===63?(b&&(X(e,u,p,h,g,null,a,s,l),h=g=m=null),w=!0,b=!0,i=!0):b?(b=!1,i=!0):f(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,v=r;else{if(a=e.line,s=e.lineStart,l=e.position,!J(e,t,hr,!1,!0))break;if(e.line===o){for(v=e.input.charCodeAt(e.position);j(v);)v=e.input.charCodeAt(++e.position);if(v===58)v=e.input.charCodeAt(++e.position),I(v)||f(e,"a whitespace character is expected after the key-value separator within a block mapping"),b&&(X(e,u,p,h,g,null,a,s,l),h=g=m=null),w=!0,b=!1,i=!1,h=e.tag,g=e.result;else if(w)f(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=d,!0}else if(w)f(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=d,!0}if((e.line===o||e.lineIndent>n)&&(b&&(a=e.line,s=e.lineStart,l=e.position),J(e,n,Oe,!0,i)&&(b?g=e.result:m=e.result),b||(X(e,u,p,h,g,m,a,s,l),h=g=m=null),E(e,!0,-1),v=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>n)&&v!==0)f(e,"bad indentation of a mapping entry");else if(e.lineIndent<n)break}return b&&X(e,u,p,h,g,null,a,s,l),w&&(e.tag=c,e.anchor=d,e.kind="mapping",e.result=u),w}function Un(e){var n,t=!1,r=!1,i,o,a;if(a=e.input.charCodeAt(e.position),a!==33)return!1;if(e.tag!==null&&f(e,"duplication of a tag property"),a=e.input.charCodeAt(++e.position),a===60?(t=!0,a=e.input.charCodeAt(++e.position)):a===33?(r=!0,i="!!",a=e.input.charCodeAt(++e.position)):i="!",n=e.position,t){do a=e.input.charCodeAt(++e.position);while(a!==0&&a!==62);e.position<e.length?(o=e.input.slice(n,e.position),a=e.input.charCodeAt(++e.position)):f(e,"unexpected end of the stream within a verbatim tag")}else{for(;a!==0&&!I(a);)a===33&&(r?f(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(n-1,e.position+1),mr.test(i)||f(e,"named tag handle cannot contain such characters"),r=!0,n=e.position+1)),a=e.input.charCodeAt(++e.position);o=e.input.slice(n,e.position),Rn.test(o)&&f(e,"tag suffix cannot contain flow indicator characters")}o&&!fr.test(o)&&f(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{f(e,"tag name is malformed: "+o)}return t?e.tag=o:G.call(e.tagMap,i)?e.tag=e.tagMap[i]+o:i==="!"?e.tag="!"+o:i==="!!"?e.tag="tag:yaml.org,2002:"+o:f(e,'undeclared tag handle "'+i+'"'),!0}function Yn(e){var n,t;if(t=e.input.charCodeAt(e.position),t!==38)return!1;for(e.anchor!==null&&f(e,"duplication of an anchor property"),t=e.input.charCodeAt(++e.position),n=e.position;t!==0&&!I(t)&&!Z(t);)t=e.input.charCodeAt(++e.position);return e.position===n&&f(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(n,e.position),!0}function Kn(e){var n,t,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),n=e.position;r!==0&&!I(r)&&!Z(r);)r=e.input.charCodeAt(++e.position);return e.position===n&&f(e,"name of an alias node must contain at least one character"),t=e.input.slice(n,e.position),G.call(e.anchorMap,t)||f(e,'unidentified alias "'+t+'"'),e.result=e.anchorMap[t],E(e,!0,-1),!0}function J(e,n,t,r,i){var o,a,s,l=1,c=!1,d=!1,u,p,h,g,m,b;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=a=s=Oe===t||gr===t,r&&E(e,!0,-1)&&(c=!0,e.lineIndent>n?l=1:e.lineIndent===n?l=0:e.lineIndent<n&&(l=-1)),l===1)for(;Un(e)||Yn(e);)E(e,!0,-1)?(c=!0,s=o,e.lineIndent>n?l=1:e.lineIndent===n?l=0:e.lineIndent<n&&(l=-1)):s=!1;if(s&&(s=c||i),(l===1||Oe===t)&&(Ge===t||hr===t?m=n:m=n+1,b=e.position-e.lineStart,l===1?s&&(qt(e,b)||jn(e,b,m))||Vn(e,m)?d=!0:(a&&Fn(e,m)||Gn(e,m)||On(e,m)?d=!0:Kn(e)?(d=!0,(e.tag!==null||e.anchor!==null)&&f(e,"alias node should not have any properties")):Nn(e,m,Ge===t)&&(d=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):l===0&&(d=s&&qt(e,b))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&f(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,p=e.implicitTypes.length;u<p;u+=1)if(g=e.implicitTypes[u],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(G.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,h=e.typeMap.multi[e.kind||"fallback"],u=0,p=h.length;u<p;u+=1)if(e.tag.slice(0,h[u].tag.length)===h[u].tag){g=h[u];break}g||f(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&f(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):f(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||d}function Wn(e){var n=e.position,t,r,i,o=!1,a;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(a=e.input.charCodeAt(e.position))!==0&&(E(e,!0,-1),a=e.input.charCodeAt(e.position),!(e.lineIndent>0||a!==37));){for(o=!0,a=e.input.charCodeAt(++e.position),t=e.position;a!==0&&!I(a);)a=e.input.charCodeAt(++e.position);for(r=e.input.slice(t,e.position),i=[],r.length<1&&f(e,"directive name must not be less than one character in length");a!==0;){for(;j(a);)a=e.input.charCodeAt(++e.position);if(a===35){do a=e.input.charCodeAt(++e.position);while(a!==0&&!R(a));break}if(R(a))break;for(t=e.position;a!==0&&!I(a);)a=e.input.charCodeAt(++e.position);i.push(e.input.slice(t,e.position))}a!==0&&ht(e),G.call(Pt,r)?Pt[r](e,r,i):Ve(e,'unknown document directive "'+r+'"')}if(E(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,E(e,!0,-1)):o&&f(e,"directives end mark is expected"),J(e,e.lineIndent-1,Oe,!1,!0),E(e,!0,-1),e.checkLineBreaks&&Dn.test(e.input.slice(n,e.position))&&Ve(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Ue(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,E(e,!0,-1));return}if(e.position<e.length-1)f(e,"end of the stream or a document separator is expected");else return}function yr(e,n){e=String(e),n=n||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
1019
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var t=new Hn(e,n),r=e.indexOf("\0");for(r!==-1&&(t.position=r,f(t,"null byte is not allowed in input")),t.input+="\0";t.input.charCodeAt(t.position)===32;)t.lineIndent+=1,t.position+=1;for(;t.position<t.length-1;)Wn(t);return t.documents}function Qn(e,n,t){n!==null&&typeof n=="object"&&typeof t>"u"&&(t=n,n=null);var r=yr(e,t);if(typeof n!="function")return r;for(var i=0,o=r.length;i<o;i+=1)n(r[i])}function Zn(e,n){var t=yr(e,n);if(t.length!==0){if(t.length===1)return t[0];throw new _("expected a single document in the stream, but found more")}}var Xn=Qn,Jn=Zn,Er={loadAll:Xn,load:Jn},Cr=Object.prototype.toString,kr=Object.prototype.hasOwnProperty,mt=65279,eo=9,be=10,to=13,ro=32,io=33,no=34,st=35,oo=37,ao=38,so=39,lo=42,Sr=44,co=45,Fe=58,uo=61,po=62,ho=63,go=64,Tr=91,$r=93,mo=96,Ar=123,fo=124,_r=125,A={};A[0]="\\0";A[7]="\\a";A[8]="\\b";A[9]="\\t";A[10]="\\n";A[11]="\\v";A[12]="\\f";A[13]="\\r";A[27]="\\e";A[34]='\\"';A[92]="\\\\";A[133]="\\N";A[160]="\\_";A[8232]="\\L";A[8233]="\\P";var bo=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],vo=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function xo(e,n){var t,r,i,o,a,s,l;if(n===null)return{};for(t={},r=Object.keys(n),i=0,o=r.length;i<o;i+=1)a=r[i],s=String(n[a]),a.slice(0,2)==="!!"&&(a="tag:yaml.org,2002:"+a.slice(2)),l=e.compiledTypeMap.fallback[a],l&&kr.call(l.styleAliases,s)&&(s=l.styleAliases[s]),t[a]=s;return t}function wo(e){var n,t,r;if(n=e.toString(16).toUpperCase(),e<=255)t="x",r=2;else if(e<=65535)t="u",r=4;else if(e<=4294967295)t="U",r=8;else throw new _("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+t+S.repeat("0",r-n.length)+n}var yo=1,ve=2;function Eo(e){this.schema=e.schema||pt,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=S.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=xo(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?ve:yo,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function zt(e,n){for(var t=S.repeat(" ",n),r=0,i=-1,o="",a,s=e.length;r<s;)i=e.indexOf(`
1020
1020
  `,r),i===-1?(a=e.slice(r),r=s):(a=e.slice(r,i+1),r=i+1),a.length&&a!==`
1021
- `&&(o+=t),o+=a;return o}function at(e,n){return`
1022
- `+k.repeat(" ",e.indent*n)}function fo(e,n){var t,r,i;for(t=0,r=e.implicitTypes.length;t<r;t+=1)if(i=e.implicitTypes[t],i.resolve(n))return!0;return!1}function Fe(e){return e===Wn||e===Yn}function ve(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==ht||65536<=e&&e<=1114111}function Pt(e){return ve(e)&&e!==ht&&e!==Kn&&e!==fe}function Bt(e,n,t){var r=Pt(e),i=r&&!Fe(e);return(t?r:r&&e!==yr&&e!==Er&&e!==Cr&&e!==kr&&e!==Sr)&&e!==ot&&!(n===Ve&&!i)||Pt(n)&&!Fe(n)&&e===ot||n===Ve&&i}function bo(e){return ve(e)&&e!==ht&&!Fe(e)&&e!==ro&&e!==oo&&e!==Ve&&e!==yr&&e!==Er&&e!==Cr&&e!==kr&&e!==Sr&&e!==ot&&e!==Jn&&e!==to&&e!==Qn&&e!==lo&&e!==io&&e!==no&&e!==eo&&e!==Zn&&e!==Xn&&e!==ao&&e!==so}function vo(e){return!Fe(e)&&e!==Ve}function ge(e,n){var t=e.charCodeAt(n),r;return t>=55296&&t<=56319&&n+1<e.length&&(r=e.charCodeAt(n+1),r>=56320&&r<=57343)?(t-55296)*1024+r-56320+65536:t}function Tr(e){var n=/^\n* /;return n.test(e)}var $r=1,st=2,Ar=3,_r=4,W=5;function xo(e,n,t,r,i,o,a,s){var l,c=0,d=null,u=!1,p=!1,h=r!==-1,g=-1,m=bo(ge(e,0))&&vo(ge(e,e.length-1));if(n||a)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=ge(e,l),!ve(c))return W;m=m&&Bt(c,d,s),d=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=ge(e,l),c===fe)u=!0,h&&(p=p||l-g-1>r&&e[g+1]!==" ",g=l);else if(!ve(c))return W;m=m&&Bt(c,d,s),d=c}p=p||h&&l-g-1>r&&e[g+1]!==" "}return!u&&!p?m&&!a&&!i(e)?$r:o===be?W:st:t>9&&Tr(e)?W:a?o===be?W:st:p?_r:Ar}function wo(e,n,t,r,i){e.dump=function(){if(n.length===0)return e.quotingType===be?'""':"''";if(!e.noCompatMode&&(co.indexOf(n)!==-1||uo.test(n)))return e.quotingType===be?'"'+n+'"':"'"+n+"'";var o=e.indent*Math.max(1,t),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),s=r||e.flowLevel>-1&&t>=e.flowLevel;function l(c){return fo(e,c)}switch(xo(n,s,e.indent,a,l,e.quotingType,e.forceQuotes&&!r,i)){case $r:return n;case st:return"'"+n.replace(/'/g,"''")+"'";case Ar:return"|"+qt(n,e.indent)+zt(Rt(n,o));case _r:return">"+qt(n,e.indent)+zt(Rt(yo(n,a),o));case W:return'"'+Eo(n)+'"';default:throw new A("impossible error: invalid scalar style")}}()}function qt(e,n){var t=Tr(e)?String(n):"",r=e[e.length-1]===`
1021
+ `&&(o+=t),o+=a;return o}function lt(e,n){return`
1022
+ `+S.repeat(" ",e.indent*n)}function Co(e,n){var t,r,i;for(t=0,r=e.implicitTypes.length;t<r;t+=1)if(i=e.implicitTypes[t],i.resolve(n))return!0;return!1}function je(e){return e===ro||e===eo}function xe(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==mt||65536<=e&&e<=1114111}function Ht(e){return xe(e)&&e!==mt&&e!==to&&e!==be}function Nt(e,n,t){var r=Ht(e),i=r&&!je(e);return(t?r:r&&e!==Sr&&e!==Tr&&e!==$r&&e!==Ar&&e!==_r)&&e!==st&&!(n===Fe&&!i)||Ht(n)&&!je(n)&&e===st||n===Fe&&i}function ko(e){return xe(e)&&e!==mt&&!je(e)&&e!==co&&e!==ho&&e!==Fe&&e!==Sr&&e!==Tr&&e!==$r&&e!==Ar&&e!==_r&&e!==st&&e!==ao&&e!==lo&&e!==io&&e!==fo&&e!==uo&&e!==po&&e!==so&&e!==no&&e!==oo&&e!==go&&e!==mo}function So(e){return!je(e)&&e!==Fe}function me(e,n){var t=e.charCodeAt(n),r;return t>=55296&&t<=56319&&n+1<e.length&&(r=e.charCodeAt(n+1),r>=56320&&r<=57343)?(t-55296)*1024+r-56320+65536:t}function Ir(e){var n=/^\n* /;return n.test(e)}var Mr=1,ct=2,Lr=3,Dr=4,Q=5;function To(e,n,t,r,i,o,a,s){var l,c=0,d=null,u=!1,p=!1,h=r!==-1,g=-1,m=ko(me(e,0))&&So(me(e,e.length-1));if(n||a)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=me(e,l),!xe(c))return Q;m=m&&Nt(c,d,s),d=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=me(e,l),c===be)u=!0,h&&(p=p||l-g-1>r&&e[g+1]!==" ",g=l);else if(!xe(c))return Q;m=m&&Nt(c,d,s),d=c}p=p||h&&l-g-1>r&&e[g+1]!==" "}return!u&&!p?m&&!a&&!i(e)?Mr:o===ve?Q:ct:t>9&&Ir(e)?Q:a?o===ve?Q:ct:p?Dr:Lr}function $o(e,n,t,r,i){e.dump=function(){if(n.length===0)return e.quotingType===ve?'""':"''";if(!e.noCompatMode&&(bo.indexOf(n)!==-1||vo.test(n)))return e.quotingType===ve?'"'+n+'"':"'"+n+"'";var o=e.indent*Math.max(1,t),a=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),s=r||e.flowLevel>-1&&t>=e.flowLevel;function l(c){return Co(e,c)}switch(To(n,s,e.indent,a,l,e.quotingType,e.forceQuotes&&!r,i)){case Mr:return n;case ct:return"'"+n.replace(/'/g,"''")+"'";case Lr:return"|"+Gt(n,e.indent)+Ot(zt(n,o));case Dr:return">"+Gt(n,e.indent)+Ot(zt(Ao(n,a),o));case Q:return'"'+_o(n)+'"';default:throw new _("impossible error: invalid scalar style")}}()}function Gt(e,n){var t=Ir(e)?String(n):"",r=e[e.length-1]===`
1023
1023
  `,i=r&&(e[e.length-2]===`
1024
1024
  `||e===`
1025
1025
  `),o=i?"+":r?"":"-";return t+o+`
1026
- `}function zt(e){return e[e.length-1]===`
1027
- `?e.slice(0,-1):e}function yo(e,n){for(var t=/(\n+)([^\n]*)/g,r=function(){var c=e.indexOf(`
1028
- `);return c=c!==-1?c:e.length,t.lastIndex=c,Ht(e.slice(0,c),n)}(),i=e[0]===`
1026
+ `}function Ot(e){return e[e.length-1]===`
1027
+ `?e.slice(0,-1):e}function Ao(e,n){for(var t=/(\n+)([^\n]*)/g,r=function(){var c=e.indexOf(`
1028
+ `);return c=c!==-1?c:e.length,t.lastIndex=c,Vt(e.slice(0,c),n)}(),i=e[0]===`
1029
1029
  `||e[0]===" ",o,a;a=t.exec(e);){var s=a[1],l=a[2];o=l[0]===" ",r+=s+(!i&&!o&&l!==""?`
1030
- `:"")+Ht(l,n),i=o}return r}function Ht(e,n){if(e===""||e[0]===" ")return e;for(var t=/ [^ ]/g,r,i=0,o,a=0,s=0,l="";r=t.exec(e);)s=r.index,s-i>n&&(o=a>i?a:s,l+=`
1030
+ `:"")+Vt(l,n),i=o}return r}function Vt(e,n){if(e===""||e[0]===" ")return e;for(var t=/ [^ ]/g,r,i=0,o,a=0,s=0,l="";r=t.exec(e);)s=r.index,s-i>n&&(o=a>i?a:s,l+=`
1031
1031
  `+e.slice(i,o),i=o+1),a=s;return l+=`
1032
1032
  `,e.length-i>n&&a>i?l+=e.slice(i,a)+`
1033
- `+e.slice(a+1):l+=e.slice(i),l.slice(1)}function Eo(e){for(var n="",t=0,r,i=0;i<e.length;t>=65536?i+=2:i++)t=ge(e,i),r=$[t],!r&&ve(t)?(n+=e[i],t>=65536&&(n+=e[i+1])):n+=r||ho(t);return n}function Co(e,n,t){var r="",i=e.tag,o,a,s;for(o=0,a=t.length;o<a;o+=1)s=t[o],e.replacer&&(s=e.replacer.call(t,String(o),s)),(z(e,n,s,!1,!1)||typeof s>"u"&&z(e,n,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function Gt(e,n,t,r){var i="",o=e.tag,a,s,l;for(a=0,s=t.length;a<s;a+=1)l=t[a],e.replacer&&(l=e.replacer.call(t,String(a),l)),(z(e,n+1,l,!0,!0,!1,!0)||typeof l>"u"&&z(e,n+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=at(e,n)),e.dump&&fe===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=o,e.dump=i||"[]"}function ko(e,n,t){var r="",i=e.tag,o=Object.keys(t),a,s,l,c,d;for(a=0,s=o.length;a<s;a+=1)d="",r!==""&&(d+=", "),e.condenseFlow&&(d+='"'),l=o[a],c=t[l],e.replacer&&(c=e.replacer.call(t,l,c)),z(e,n,l,!1,!1)&&(e.dump.length>1024&&(d+="? "),d+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),z(e,n,c,!1,!1)&&(d+=e.dump,r+=d));e.tag=i,e.dump="{"+r+"}"}function So(e,n,t,r){var i="",o=e.tag,a=Object.keys(t),s,l,c,d,u,p;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new A("sortKeys must be a boolean or a function");for(s=0,l=a.length;s<l;s+=1)p="",(!r||i!=="")&&(p+=at(e,n)),c=a[s],d=t[c],e.replacer&&(d=e.replacer.call(t,c,d)),z(e,n+1,c,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&fe===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,u&&(p+=at(e,n)),z(e,n+1,d,!0,u)&&(e.dump&&fe===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,i+=p));e.tag=o,e.dump=i||"{}"}function Nt(e,n,t){var r,i,o,a,s,l;for(i=t?e.explicitTypes:e.implicitTypes,o=0,a=i.length;o<a;o+=1)if(s=i[o],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof n=="object"&&n instanceof s.instanceOf)&&(!s.predicate||s.predicate(n))){if(t?s.multi&&s.representName?e.tag=s.representName(n):e.tag=s.tag:e.tag="?",s.represent){if(l=e.styleMap[s.tag]||s.defaultStyle,xr.call(s.represent)==="[object Function]")r=s.represent(n,l);else if(wr.call(s.represent,l))r=s.represent[l](n,l);else throw new A("!<"+s.tag+'> tag resolver accepts not "'+l+'" style');e.dump=r}return!0}return!1}function z(e,n,t,r,i,o,a){e.tag=null,e.dump=t,Nt(e,t,!1)||Nt(e,t,!0);var s=xr.call(e.dump),l=r,c;r&&(r=e.flowLevel<0||e.flowLevel>n);var d=s==="[object Object]"||s==="[object Array]",u,p;if(d&&(u=e.duplicates.indexOf(t),p=u!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&n>0)&&(i=!1),p&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(d&&p&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),s==="[object Object]")r&&Object.keys(e.dump).length!==0?(So(e,n,e.dump,i),p&&(e.dump="&ref_"+u+e.dump)):(ko(e,n,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump));else if(s==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!a&&n>0?Gt(e,n-1,e.dump,i):Gt(e,n,e.dump,i),p&&(e.dump="&ref_"+u+e.dump)):(Co(e,n,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump));else if(s==="[object String]")e.tag!=="?"&&wo(e,e.dump,n,o,l);else{if(s==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new A("unacceptable kind of an object to dump "+s)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function To(e,n){var t=[],r=[],i,o;for(lt(e,t,r),i=0,o=r.length;i<o;i+=1)n.duplicates.push(t[r[i]]);n.usedDuplicates=new Array(o)}function lt(e,n,t){var r,i,o;if(e!==null&&typeof e=="object")if(i=n.indexOf(e),i!==-1)t.indexOf(i)===-1&&t.push(i);else if(n.push(e),Array.isArray(e))for(i=0,o=e.length;i<o;i+=1)lt(e[i],n,t);else for(r=Object.keys(e),i=0,o=r.length;i<o;i+=1)lt(e[r[i]],n,t)}function $o(e,n){n=n||{};var t=new mo(n);t.noRefs||To(e,t);var r=e;return t.replacer&&(r=t.replacer.call({"":r},"",r)),z(t,0,r,!0,!0)?t.dump+`
1034
- `:""}var Ao=$o,_o={dump:Ao};function gt(e,n){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}var Io=T,Mo=Ft,Lo=Kt,Do=Jt,Ro=er,Po=dt,Bo=vr.load,qo=vr.loadAll,zo=_o.dump,Ho=A,Go={binary:or,float:Xt,map:Yt,null:Wt,pairs:sr,set:lr,timestamp:ir,bool:Qt,int:Zt,merge:nr,omap:ar,seq:Ut,str:jt},No=gt("safeLoad","load"),Oo=gt("safeLoadAll","loadAll"),Vo=gt("safeDump","dump"),Ir={Type:Io,Schema:Mo,FAILSAFE_SCHEMA:Lo,JSON_SCHEMA:Do,CORE_SCHEMA:Ro,DEFAULT_SCHEMA:Po,load:Bo,loadAll:qo,dump:zo,YAMLException:Ho,types:Go,safeLoad:No,safeLoadAll:Oo,safeDump:Vo};var U=["#10b981","#f59e0b","#06b6d4","#ec4899","#8b5cf6","#3b82f6","#f43f5e","#84cc16","#a855f7","#6366f1"];function S(e){let n=e.length,t;for(;n!==0;)t=Math.floor(Math.random()*n),n--,[e[n],e[t]]=[e[t],e[n]];return e}var P=(e,n=0)=>{let t=3735928559^n,r=1103547991^n;for(let i=0,o;i<e.length;i++)o=e.charCodeAt(i),t=Math.imul(t^o,265443561),r=Math.imul(r^o,159334677);return t=Math.imul(t^r>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),(4294967296*(2009751&r)+(t>>>0)).toString()};function E(e){return e.replace(/[&<>"']/g,n=>n==="&"?"&amp;":n==="<"?"&lt;":n===">"?"&gt;":n==='"'?"&quot;":"&#39;")}function Fo(e){try{return Ir.load(e)}catch(n){throw new Error(`Invalid YAML assets:
1035
- ${n instanceof Error?n.message:String(n)}`)}}function I(e){return typeof e=="string"}function mt(e){return typeof e=="number"}function ft(e){return/^(\d{1,2}:)?\d{1,2}:\d{2}$/.test(e)}function Mr(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function Ue(e){return typeof e=="object"&&e!==null&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}function Y(e){return e.split("|").map(n=>n.trim()).filter(Boolean)}var J=e=>[...new Set(e)];var xe=class extends Error{constructor(n){super(`Asset validation failed:n- ${n.join(`
1036
- - `)}`),this.name="AssetValidationError",this.issues=n}};function jo(e){let n=[];if(!Ue(e))throw new xe(["Top-level assets must be an object/map like { mango: {...}, trend: {...} }"]);let t=e,r={};for(let[o,a]of Object.entries(t)){if(!o||typeof o!="string"){n.push(`Asset key must be a non-empty string (got: ${String(o)})`);continue}if(/^[a-zA-Z0-9._-]+$/.test(o)||n.push(`Asset id "${o}" has invalid chars; use letters/numbers/._-`),!Ue(a)){n.push(`Asset "${o}" must be an object (got: ${Mr(a)})`);continue}let s=a,l=s.type,c=!!s.dialog;if(!I(l)){n.push(`Asset "${o}" missing string field "type"`);continue}if(!Uo(l)){n.push(`Asset "${o}" has unsupported type "${l}" (use image|video|audio|html)`);continue}switch(l){case"image":{let d=s.url;I(d)||n.push(`Asset "${o}" (image) missing "url"`);let u=s.size;u!==void 0&&!I(u)&&n.push(`Asset "${o}" (image) field "size" must be a string`),I(d)&&(r[o]={id:o,type:l,dialog:c,url:d,...I(u)?{size:u}:{}});break}case"video":{let d=s.url;I(d)||n.push(`Asset "${o}" (video) missing "url"`);let u=s.span,p;if(u!==void 0)if(!Ue(u))n.push(`Asset "${o}" (video) field "span" must be an object`);else{let h=u.from,g=u.to;!I(h)||!I(g)?n.push(`Asset "${o}" (video) span requires string "from" and "to"`):((!ft(h)||!ft(g))&&n.push(`Asset "${o}" (video) span times should look like "02:15" or "01:02:45"`),p={from:h,to:g})}I(d)&&(r[o]={id:o,type:l,dialog:c,url:d,...p?{span:p}:{}});break}case"audio":{let d=s.url;I(d)||n.push(`Asset "${o}" (audio) missing "url"`);let u=s.volume;u!==void 0&&(!mt(u)||!Number.isFinite(u)?n.push(`Asset "${o}" (audio) field "volume" must be a number`):(u<0||u>100)&&n.push(`Asset "${o}" (audio) field "volume" must be between 0 and 100`)),I(d)&&(r[o]={id:o,type:l,dialog:c,url:d,...mt(u)?{volume:u}:{}});break}case"html":{let d=s.content;if(!I(d)){n.push(`Asset "${o}" (html) missing string field "content"`);break}r[o]={id:o,type:l,dialog:c,content:d};break}case"tts":{let d=s.content;if(!I(d)){n.push(`Asset "${o}" (tts) missing string field "content"`);break}r[o]={id:o,type:l,dialog:c,content:d};break}}}if(n.length)throw new xe(n);let i=Object.keys(r).sort((o,a)=>o.localeCompare(a)).map(o=>r[o]);return{assetsById:r,assetsList:i}}function Uo(e){return e==="image"||e==="video"||e==="audio"||e==="html"}function we(e,n,t){let r=0,i=0;return e.forEach(a=>{a.items.forEach(s=>{i++;let l=n.get(s),c=t.querySelector(`[data-label="${s}"]`);l===a.label?(r++,c.chipState="correct"):c.chipState="wrong"})}),{score:i>0?Math.round(r/i*100):0,correct:r,total:i}}var ye=class extends x{constructor(t,r,i){super(t,r,i);this.interactionMechanic="static";this.categories=["none"];this.allItems=[];this.categoryColors=["#94a3b8","#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1"];this.currentColor=this.categoryColors[0];this.data.categories.forEach(({label:o,items:a})=>{this.categories.push(o),this.allItems.push(...a)}),this.currentCategory=this.categories[0],this.data.distractors&&this.allItems.push(...this.data.distractors),this.allItems=S(this.allItems),this.categorized=new Map,this.initializeProgress(this.allItems.length)}initialize(){}cleanup(){}onVariantChange(t){this.querySelectorAll("edu-chip, edu-block").forEach(r=>{r.variant!==void 0&&(r.variant=t)})}render(){this.innerHTML=`
1033
+ `+e.slice(a+1):l+=e.slice(i),l.slice(1)}function _o(e){for(var n="",t=0,r,i=0;i<e.length;t>=65536?i+=2:i++)t=me(e,i),r=A[t],!r&&xe(t)?(n+=e[i],t>=65536&&(n+=e[i+1])):n+=r||wo(t);return n}function Io(e,n,t){var r="",i=e.tag,o,a,s;for(o=0,a=t.length;o<a;o+=1)s=t[o],e.replacer&&(s=e.replacer.call(t,String(o),s)),(z(e,n,s,!1,!1)||typeof s>"u"&&z(e,n,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function Ft(e,n,t,r){var i="",o=e.tag,a,s,l;for(a=0,s=t.length;a<s;a+=1)l=t[a],e.replacer&&(l=e.replacer.call(t,String(a),l)),(z(e,n+1,l,!0,!0,!1,!0)||typeof l>"u"&&z(e,n+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=lt(e,n)),e.dump&&be===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=o,e.dump=i||"[]"}function Mo(e,n,t){var r="",i=e.tag,o=Object.keys(t),a,s,l,c,d;for(a=0,s=o.length;a<s;a+=1)d="",r!==""&&(d+=", "),e.condenseFlow&&(d+='"'),l=o[a],c=t[l],e.replacer&&(c=e.replacer.call(t,l,c)),z(e,n,l,!1,!1)&&(e.dump.length>1024&&(d+="? "),d+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),z(e,n,c,!1,!1)&&(d+=e.dump,r+=d));e.tag=i,e.dump="{"+r+"}"}function Lo(e,n,t,r){var i="",o=e.tag,a=Object.keys(t),s,l,c,d,u,p;if(e.sortKeys===!0)a.sort();else if(typeof e.sortKeys=="function")a.sort(e.sortKeys);else if(e.sortKeys)throw new _("sortKeys must be a boolean or a function");for(s=0,l=a.length;s<l;s+=1)p="",(!r||i!=="")&&(p+=lt(e,n)),c=a[s],d=t[c],e.replacer&&(d=e.replacer.call(t,c,d)),z(e,n+1,c,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&be===e.dump.charCodeAt(0)?p+="?":p+="? "),p+=e.dump,u&&(p+=lt(e,n)),z(e,n+1,d,!0,u)&&(e.dump&&be===e.dump.charCodeAt(0)?p+=":":p+=": ",p+=e.dump,i+=p));e.tag=o,e.dump=i||"{}"}function jt(e,n,t){var r,i,o,a,s,l;for(i=t?e.explicitTypes:e.implicitTypes,o=0,a=i.length;o<a;o+=1)if(s=i[o],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof n=="object"&&n instanceof s.instanceOf)&&(!s.predicate||s.predicate(n))){if(t?s.multi&&s.representName?e.tag=s.representName(n):e.tag=s.tag:e.tag="?",s.represent){if(l=e.styleMap[s.tag]||s.defaultStyle,Cr.call(s.represent)==="[object Function]")r=s.represent(n,l);else if(kr.call(s.represent,l))r=s.represent[l](n,l);else throw new _("!<"+s.tag+'> tag resolver accepts not "'+l+'" style');e.dump=r}return!0}return!1}function z(e,n,t,r,i,o,a){e.tag=null,e.dump=t,jt(e,t,!1)||jt(e,t,!0);var s=Cr.call(e.dump),l=r,c;r&&(r=e.flowLevel<0||e.flowLevel>n);var d=s==="[object Object]"||s==="[object Array]",u,p;if(d&&(u=e.duplicates.indexOf(t),p=u!==-1),(e.tag!==null&&e.tag!=="?"||p||e.indent!==2&&n>0)&&(i=!1),p&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(d&&p&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),s==="[object Object]")r&&Object.keys(e.dump).length!==0?(Lo(e,n,e.dump,i),p&&(e.dump="&ref_"+u+e.dump)):(Mo(e,n,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump));else if(s==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!a&&n>0?Ft(e,n-1,e.dump,i):Ft(e,n,e.dump,i),p&&(e.dump="&ref_"+u+e.dump)):(Io(e,n,e.dump),p&&(e.dump="&ref_"+u+" "+e.dump));else if(s==="[object String]")e.tag!=="?"&&$o(e,e.dump,n,o,l);else{if(s==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new _("unacceptable kind of an object to dump "+s)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function Do(e,n){var t=[],r=[],i,o;for(dt(e,t,r),i=0,o=r.length;i<o;i+=1)n.duplicates.push(t[r[i]]);n.usedDuplicates=new Array(o)}function dt(e,n,t){var r,i,o;if(e!==null&&typeof e=="object")if(i=n.indexOf(e),i!==-1)t.indexOf(i)===-1&&t.push(i);else if(n.push(e),Array.isArray(e))for(i=0,o=e.length;i<o;i+=1)dt(e[i],n,t);else for(r=Object.keys(e),i=0,o=r.length;i<o;i+=1)dt(e[r[i]],n,t)}function Ro(e,n){n=n||{};var t=new Eo(n);t.noRefs||Do(e,t);var r=e;return t.replacer&&(r=t.replacer.call({"":r},"",r)),z(t,0,r,!0,!0)?t.dump+`
1034
+ `:""}var Po=Ro,Bo={dump:Po};function ft(e,n){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}var qo=$,zo=Kt,Ho=Xt,No=ir,Go=nr,Oo=pt,Vo=Er.load,Fo=Er.loadAll,jo=Bo.dump,Uo=_,Yo={binary:cr,float:rr,map:Zt,null:Jt,pairs:ur,set:pr,timestamp:sr,bool:er,int:tr,merge:lr,omap:dr,seq:Qt,str:Wt},Ko=ft("safeLoad","load"),Wo=ft("safeLoadAll","loadAll"),Qo=ft("safeDump","dump"),Rr={Type:qo,Schema:zo,FAILSAFE_SCHEMA:Ho,JSON_SCHEMA:No,CORE_SCHEMA:Go,DEFAULT_SCHEMA:Oo,load:Vo,loadAll:Fo,dump:jo,YAMLException:Uo,types:Yo,safeLoad:Ko,safeLoadAll:Wo,safeDump:Qo};var U=["#10b981","#f59e0b","#06b6d4","#ec4899","#8b5cf6","#3b82f6","#f43f5e","#84cc16","#a855f7","#6366f1"];function T(e){let n=e.length,t;for(;n!==0;)t=Math.floor(Math.random()*n),n--,[e[n],e[t]]=[e[t],e[n]];return e}var P=(e,n=0)=>{let t=3735928559^n,r=1103547991^n;for(let i=0,o;i<e.length;i++)o=e.charCodeAt(i),t=Math.imul(t^o,265443561),r=Math.imul(r^o,159334677);return t=Math.imul(t^r>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),(4294967296*(2009751&r)+(t>>>0)).toString()};function C(e){return e.replace(/[&<>"']/g,n=>n==="&"?"&amp;":n==="<"?"&lt;":n===">"?"&gt;":n==='"'?"&quot;":"&#39;")}function Zo(e){try{return Rr.load(e)}catch(n){throw new Error(`Invalid YAML assets:
1035
+ ${n instanceof Error?n.message:String(n)}`)}}function M(e){return typeof e=="string"}function bt(e){return typeof e=="number"}function vt(e){return/^(\d{1,2}:)?\d{1,2}:\d{2}$/.test(e)}function Pr(e){return e===null?"null":Array.isArray(e)?"array":typeof e}function Ye(e){return typeof e=="object"&&e!==null&&(Object.getPrototypeOf(e)===Object.prototype||Object.getPrototypeOf(e)===null)}function Y(e){return e.split("|").map(n=>n.trim()).filter(Boolean)}var ee=e=>[...new Set(e)];var we=class extends Error{constructor(n){super(`Asset validation failed:n- ${n.join(`
1036
+ - `)}`),this.name="AssetValidationError",this.issues=n}};function Xo(e){let n=[];if(!Ye(e))throw new we(["Top-level assets must be an object/map like { mango: {...}, trend: {...} }"]);let t=e,r={};for(let[o,a]of Object.entries(t)){if(!o||typeof o!="string"){n.push(`Asset key must be a non-empty string (got: ${String(o)})`);continue}if(/^[a-zA-Z0-9._-]+$/.test(o)||n.push(`Asset id "${o}" has invalid chars; use letters/numbers/._-`),!Ye(a)){n.push(`Asset "${o}" must be an object (got: ${Pr(a)})`);continue}let s=a,l=s.type,c=!!s.dialog;if(!M(l)){n.push(`Asset "${o}" missing string field "type"`);continue}if(!Jo(l)){n.push(`Asset "${o}" has unsupported type "${l}" (use image|video|audio|html)`);continue}switch(l){case"image":{let d=s.url;M(d)||n.push(`Asset "${o}" (image) missing "url"`);let u=s.size;u!==void 0&&!M(u)&&n.push(`Asset "${o}" (image) field "size" must be a string`),M(d)&&(r[o]={id:o,type:l,dialog:c,url:d,...M(u)?{size:u}:{}});break}case"video":{let d=s.url;M(d)||n.push(`Asset "${o}" (video) missing "url"`);let u=s.span,p;if(u!==void 0)if(!Ye(u))n.push(`Asset "${o}" (video) field "span" must be an object`);else{let h=u.from,g=u.to;!M(h)||!M(g)?n.push(`Asset "${o}" (video) span requires string "from" and "to"`):((!vt(h)||!vt(g))&&n.push(`Asset "${o}" (video) span times should look like "02:15" or "01:02:45"`),p={from:h,to:g})}M(d)&&(r[o]={id:o,type:l,dialog:c,url:d,...p?{span:p}:{}});break}case"audio":{let d=s.url;M(d)||n.push(`Asset "${o}" (audio) missing "url"`);let u=s.volume;u!==void 0&&(!bt(u)||!Number.isFinite(u)?n.push(`Asset "${o}" (audio) field "volume" must be a number`):(u<0||u>100)&&n.push(`Asset "${o}" (audio) field "volume" must be between 0 and 100`)),M(d)&&(r[o]={id:o,type:l,dialog:c,url:d,...bt(u)?{volume:u}:{}});break}case"html":{let d=s.content;if(!M(d)){n.push(`Asset "${o}" (html) missing string field "content"`);break}r[o]={id:o,type:l,dialog:c,content:d};break}case"tts":{let d=s.content;if(!M(d)){n.push(`Asset "${o}" (tts) missing string field "content"`);break}r[o]={id:o,type:l,dialog:c,content:d};break}}}if(n.length)throw new we(n);let i=Object.keys(r).sort((o,a)=>o.localeCompare(a)).map(o=>r[o]);return{assetsById:r,assetsList:i}}function Jo(e){return e==="image"||e==="video"||e==="audio"||e==="html"}function ye(e,n,t){let r=0,i=0;return e.forEach(a=>{a.items.forEach(s=>{i++;let l=n.get(s),c=t.querySelector(`[data-label="${s}"]`);l===a.label?(r++,c.chipState="correct"):c.chipState="wrong"})}),{score:i>0?Math.round(r/i*100):0,correct:r,total:i}}var Ee=class extends x{constructor(t,r,i){super(t,r,i);this.interactionMechanic="static";this.categories=["none"];this.allItems=[];this.categoryColors=["#94a3b8","#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#ec4899","#14b8a6","#f97316","#6366f1"];this.currentColor=this.categoryColors[0];this.data.categories.forEach(({label:o,items:a})=>{this.categories.push(o),this.allItems.push(...a)}),this.currentCategory=this.categories[0],this.data.distractors&&this.allItems.push(...this.data.distractors),this.allItems=T(this.allItems),this.categorized=new Map,this.initializeProgress(this.allItems.length)}initialize(){}cleanup(){}onVariantChange(t){this.querySelectorAll("edu-chip, edu-block").forEach(r=>{r.variant!==void 0&&(r.variant=t)})}render(){this.innerHTML=`
1037
1037
  <style>
1038
1038
  open-classification {
1039
1039
  --current-color: #94a3b8;
@@ -1193,7 +1193,7 @@ ${n instanceof Error?n.message:String(n)}`)}}function I(e){return typeof e=="str
1193
1193
  </div>
1194
1194
  `,this.style.setProperty("--current-color",this.currentColor),this.$categoriesBar=this.querySelector("#categories-bar"),this.setCategories(this.$categoriesBar);let t=this.querySelector(".items-container");this.setItems(t)}setItems(t){this.allItems.forEach((r,i)=>{let o=document.createElement("edu-chip");o.variant=this.config.variant,o.dataset.label=r,D(r,o,this.assets?.assetsById),o.addEventListener("click",a=>{let s=a.currentTarget,l=s.dataset.label;if(this.categorized.get(l)===this.currentCategory){this.categorized.delete(l),s.colored=!1,this.decrementProgress(),this.emitStateChange();return}this.categorized.has(l)||this.incrementProgress(),this.categorized.set(l,this.currentCategory),s.color=this.currentColor,s.colored=!0,this.emitStateChange()}),t.append(o)})}setCategories(t){this.categories.forEach((r,i)=>{let o=new V;o.variant=this.config.variant;let a=this.categoryColors[i%this.categoryColors.length];o.dataset.category=r,o.dataset.color=a,o.style.setProperty("--category-color",a),o.innerHTML=`
1195
1195
  <div class="category-label">${r}</div>
1196
- `,o.addEventListener("click",s=>{let l=s.currentTarget;this.currentCategory=l.dataset.category,this.currentColor=l.dataset.color,this.style.setProperty("--current-color",this.currentColor),t.querySelectorAll("edu-block").forEach(c=>c.classList.remove("active")),o.classList.add("active")}),r===this.currentCategory&&o.classList.add("active"),t.append(o)})}getCurrentState(){return{categorized:Object.fromEntries(this.categorized),progress:this.progressTracker.current}}isInteractionComplete(){if(this.categorized.size!==this.allItems.length)return!1;for(let t of this.categorized.values())if(t==null)return!1;return!0}onHint(){let t=this.allItems.filter(i=>!this.categorized.has(i));if(t.length===0){alert('All items are categorized! Click "Check" to submit.'),this.emitHintShown("All items categorized");return}let r=t[0];alert(`Hint: You haven't categorized "${r}" yet. Which category does it belong to?`),this.emitHintShown(`Uncategorized item: ${r}`)}submit(){super.submit();let t=we(this.data.categories,this.categorized,this);console.log(`Classification Score: ${t.score.toFixed(1)}% (${t.correct}/${t.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0})),this.setAttribute("inert","")}reset(){super.reset(),this.categorized.clear(),this.querySelectorAll("edu-chip").forEach(t=>{t.classList.remove("colorized"),t.style.setProperty("--current-color","")})}};customElements.get("open-classification")||customElements.define("open-classification",ye);var Ee=class extends x{constructor(t,r,i){super(t,r,i);this.interactionMechanic="automatic-sequencing";this.categories=[];this.allItems=[];this.categorized=new Map;this.zones=[];this.chips=[];this.activeChip=null;this.currentZone=null;this.isDragging=!1;this.startX=0;this.startY=0;this.offsetX=0;this.offsetY=0;this.data.categories.forEach(({label:o,items:a})=>{this.categories.push(o),this.allItems.push(...a)}),this.data.distractors&&console.warn("Found a distractor in a Sequential Classification interaction, those are not useful and will be ignored"),this.allItems=this.config.shuffle?S(this.allItems):this.allItems,this.initializeProgress(this.allItems.length),this.boundPointerMove=this.handlePointerMove.bind(this),this.boundPointerUp=this.handlePointerUp.bind(this),this.variant=this.config.variant}initialize(){window.addEventListener("pointermove",this.boundPointerMove),window.addEventListener("pointerup",this.boundPointerUp)}cleanup(){window.removeEventListener("pointermove",this.boundPointerMove),window.removeEventListener("pointerup",this.boundPointerUp)}onVariantChange(t){this.querySelectorAll("edu-chip, edu-block").forEach(r=>{r.variant!==void 0&&(r.variant=t)}),this.variant=t}render(){let t=Math.min(this.categories.length,4);this.innerHTML=`
1196
+ `,o.addEventListener("click",s=>{let l=s.currentTarget;this.currentCategory=l.dataset.category,this.currentColor=l.dataset.color,this.style.setProperty("--current-color",this.currentColor),t.querySelectorAll("edu-block").forEach(c=>c.classList.remove("active")),o.classList.add("active")}),r===this.currentCategory&&o.classList.add("active"),t.append(o)})}getCurrentState(){return{categorized:Object.fromEntries(this.categorized),progress:this.progressTracker.current}}isInteractionComplete(){if(this.categorized.size!==this.allItems.length)return!1;for(let t of this.categorized.values())if(t==null)return!1;return!0}onHint(){let t=this.allItems.filter(i=>!this.categorized.has(i));if(t.length===0){alert('All items are categorized! Click "Check" to submit.'),this.emitHintShown("All items categorized");return}let r=t[0];alert(`Hint: You haven't categorized "${r}" yet. Which category does it belong to?`),this.emitHintShown(`Uncategorized item: ${r}`)}submit(){super.submit();let t=ye(this.data.categories,this.categorized,this);console.log(`Classification Score: ${t.score.toFixed(1)}% (${t.correct}/${t.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0})),this.setAttribute("inert","")}reset(){super.reset(),this.categorized.clear(),this.querySelectorAll("edu-chip").forEach(t=>{t.classList.remove("colorized"),t.style.setProperty("--current-color","")})}};customElements.get("open-classification")||customElements.define("open-classification",Ee);var Ce=class extends x{constructor(t,r,i){super(t,r,i);this.interactionMechanic="automatic-sequencing";this.categories=[];this.allItems=[];this.categorized=new Map;this.zones=[];this.chips=[];this.activeChip=null;this.currentZone=null;this.isDragging=!1;this.startX=0;this.startY=0;this.offsetX=0;this.offsetY=0;this.data.categories.forEach(({label:o,items:a})=>{this.categories.push(o),this.allItems.push(...a)}),this.data.distractors&&console.warn("Found a distractor in a Sequential Classification interaction, those are not useful and will be ignored"),this.allItems=this.config.shuffle?T(this.allItems):this.allItems,this.initializeProgress(this.allItems.length),this.boundPointerMove=this.handlePointerMove.bind(this),this.boundPointerUp=this.handlePointerUp.bind(this),this.variant=this.config.variant}initialize(){window.addEventListener("pointermove",this.boundPointerMove),window.addEventListener("pointerup",this.boundPointerUp)}cleanup(){window.removeEventListener("pointermove",this.boundPointerMove),window.removeEventListener("pointerup",this.boundPointerUp)}onVariantChange(t){this.querySelectorAll("edu-chip, edu-block").forEach(r=>{r.variant!==void 0&&(r.variant=t)}),this.variant=t}render(){let t=Math.min(this.categories.length,4);this.innerHTML=`
1197
1197
  <style>
1198
1198
  sequential-classification {
1199
1199
  display: flex;
@@ -1352,7 +1352,7 @@ ${n instanceof Error?n.message:String(n)}`)}}function I(e){return typeof e=="str
1352
1352
  <div id="zones-grid"></div>
1353
1353
  </div>
1354
1354
  </div>
1355
- `,this.container=this.querySelector("#container"),this.centerZone=this.querySelector("#center-zone"),this.zonesGrid=this.querySelector("#zones-grid"),this.createDropZones(),this.showNextChip()}createDropZones(){let t=this.querySelector("#zones-grid");this.categories.forEach((r,i)=>{let o=document.createElement("edu-block");o.variant=this.variant,o.setAccentColor(U[i%U.length]),o.classList.add("zone","empty"),o.textContent=`${r}: 0`,o.dataset.label=r,t.appendChild(o),this.zones.push(o)})}showNextChip(){let t=this.allItems.find(i=>!this.categorized.has(i));if(!t){this.centerZone.classList.add("empty");return}let r=document.createElement("edu-chip");r.variant=this.variant,D(t,r,this.assets?.assetsById),r.prefix=(this.allItems.indexOf(t)+1).toString(),r.draggable=!0,r.dataset.label=t,r.addEventListener("pointerdown",i=>this.handlePointerDown(i,r)),this.container.appendChild(r),this.chips.push(r),requestAnimationFrame(()=>{let i=this.centerZone.getBoundingClientRect(),o=this.container.getBoundingClientRect(),a=r.getBoundingClientRect(),s=i.left-o.left+(i.width-a.width)/2,l=i.top-o.top+(i.height-a.height)/2;r.style.left=`${s}px`,r.style.top=`${l}px`})}reparentChip(t,r){if(t.parentElement===r)return;let i=t.getBoundingClientRect(),o=r.getBoundingClientRect(),a=i.left-o.left,s=i.top-o.top;r===this.zonesGrid&&(a+=this.zonesGrid.scrollLeft,s+=this.zonesGrid.scrollTop),t.style.left=`${a}px`,t.style.top=`${s}px`,r.appendChild(t)}handlePointerDown(t,r){t.preventDefault(),this.reparentChip(r,this.container),this.activeChip=r,this.isDragging=!0,r.classList.add("dragging");let i=r.getBoundingClientRect(),o=this.container.getBoundingClientRect();this.offsetX=t.clientX-i.left,this.offsetY=t.clientY-i.top,this.chips.forEach(a=>{a!==r&&(a.style.opacity="0.3")}),this.handlePointerMove(t)}handlePointerMove(t){if(!this.isDragging||!this.activeChip)return;let r=this.container.getBoundingClientRect(),i=t.clientX-r.left-this.offsetX,o=t.clientY-r.top-this.offsetY,a=this.activeChip.getBoundingClientRect();i=Math.max(0,Math.min(i,r.width-a.width)),o=Math.max(0,Math.min(o,r.height-a.height)),this.activeChip.style.left=`${i}px`,this.activeChip.style.top=`${o}px`,this.checkZoneOverlap(t.clientX,t.clientY)}handlePointerUp(t){if(!this.isDragging||!this.activeChip)return;this.isDragging=!1,this.chips.forEach(i=>i.style.opacity="1"),this.activeChip.classList.remove("dragging");let r=this.activeChip.dataset.label;if(this.currentZone){let i=this.currentZone.dataset.label,o=this.categorized.get(r);o!==i&&(this.categorized.set(r,i),this.emitStateChange(),o===void 0&&(this.incrementProgress(),this.showNextChip()),o===null&&this.incrementProgress()),this.reparentChip(this.activeChip,this.zonesGrid)}else this.categorized.get(r)&&(this.categorized.set(r,null),this.decrementProgress()),this.reparentChip(this.activeChip,this.container);this.zones.forEach(i=>{i.classList.remove("highlight");let o=Array.from(this.categorized.values()).filter(a=>a===i.dataset.label).length;i.textContent=`${i.dataset.label}: ${o}`,o>0?i.classList.remove("empty"):i.classList.add("empty")}),this.activeChip=null,this.currentZone=null}checkZoneOverlap(t,r){this.currentZone=null;for(let i of this.zones){let o=i.getBoundingClientRect();t>=o.left&&t<=o.right&&r>=o.top&&r<=o.bottom?(i.classList.add("highlight"),this.currentZone=i):i.classList.remove("highlight")}}getCurrentState(){return{categorized:Object.fromEntries(this.categorized),progress:this.progressTracker.current}}isInteractionComplete(){return this.categorized.size===this.allItems.length}onHint(){let t=this.allItems.filter(o=>!this.categorized.has(o));if(t.length===0){alert('All items are categorized! Click "Check" to submit.'),this.emitHintShown("All items categorized");return}let r=t[0],i=this.data.categories.find(o=>o.items.includes(r))?.label;i&&(alert(`Hint: "${r}" belongs to "${i}".`),this.emitHintShown(`Item: ${r} \u2192 Category: ${i}`))}submit(){super.submit();let t=we(this.data.categories,this.categorized,this);console.log(`Classification Score: ${t.score.toFixed(1)}% (${t.correct}/${t.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this.categorized.clear(),this.chips.forEach(t=>t.remove()),this.chips=[],this.centerZone.classList.remove("empty"),this.activeChip=null,this.currentZone=null,this.isDragging=!1,this.zonesGrid&&(this.zonesGrid.scrollTop=0),this.showNextChip()}};customElements.get("sequential-classification")||customElements.define("sequential-classification",Ee);var Yo={audio:`
1355
+ `,this.container=this.querySelector("#container"),this.centerZone=this.querySelector("#center-zone"),this.zonesGrid=this.querySelector("#zones-grid"),this.createDropZones(),this.showNextChip()}createDropZones(){let t=this.querySelector("#zones-grid");this.categories.forEach((r,i)=>{let o=document.createElement("edu-block");o.variant=this.variant,o.setAccentColor(U[i%U.length]),o.classList.add("zone","empty"),o.textContent=`${r}: 0`,o.dataset.label=r,t.appendChild(o),this.zones.push(o)})}showNextChip(){let t=this.allItems.find(i=>!this.categorized.has(i));if(!t){this.centerZone.classList.add("empty");return}let r=document.createElement("edu-chip");r.variant=this.variant,D(t,r,this.assets?.assetsById),r.prefix=(this.allItems.indexOf(t)+1).toString(),r.draggable=!0,r.dataset.label=t,r.addEventListener("pointerdown",i=>this.handlePointerDown(i,r)),this.container.appendChild(r),this.chips.push(r),requestAnimationFrame(()=>{let i=this.centerZone.getBoundingClientRect(),o=this.container.getBoundingClientRect(),a=r.getBoundingClientRect(),s=i.left-o.left+(i.width-a.width)/2,l=i.top-o.top+(i.height-a.height)/2;r.style.left=`${s}px`,r.style.top=`${l}px`})}reparentChip(t,r){if(t.parentElement===r)return;let i=t.getBoundingClientRect(),o=r.getBoundingClientRect(),a=i.left-o.left,s=i.top-o.top;r===this.zonesGrid&&(a+=this.zonesGrid.scrollLeft,s+=this.zonesGrid.scrollTop),t.style.left=`${a}px`,t.style.top=`${s}px`,r.appendChild(t)}handlePointerDown(t,r){t.preventDefault(),this.reparentChip(r,this.container),this.activeChip=r,this.isDragging=!0,r.classList.add("dragging");let i=r.getBoundingClientRect(),o=this.container.getBoundingClientRect();this.offsetX=t.clientX-i.left,this.offsetY=t.clientY-i.top,this.chips.forEach(a=>{a!==r&&(a.style.opacity="0.3")}),this.handlePointerMove(t)}handlePointerMove(t){if(!this.isDragging||!this.activeChip)return;let r=this.container.getBoundingClientRect(),i=t.clientX-r.left-this.offsetX,o=t.clientY-r.top-this.offsetY,a=this.activeChip.getBoundingClientRect();i=Math.max(0,Math.min(i,r.width-a.width)),o=Math.max(0,Math.min(o,r.height-a.height)),this.activeChip.style.left=`${i}px`,this.activeChip.style.top=`${o}px`,this.checkZoneOverlap(t.clientX,t.clientY)}handlePointerUp(t){if(!this.isDragging||!this.activeChip)return;this.isDragging=!1,this.chips.forEach(i=>i.style.opacity="1"),this.activeChip.classList.remove("dragging");let r=this.activeChip.dataset.label;if(this.currentZone){let i=this.currentZone.dataset.label,o=this.categorized.get(r);o!==i&&(this.categorized.set(r,i),this.emitStateChange(),o===void 0&&(this.incrementProgress(),this.showNextChip()),o===null&&this.incrementProgress()),this.reparentChip(this.activeChip,this.zonesGrid)}else this.categorized.get(r)&&(this.categorized.set(r,null),this.decrementProgress()),this.reparentChip(this.activeChip,this.container);this.zones.forEach(i=>{i.classList.remove("highlight");let o=Array.from(this.categorized.values()).filter(a=>a===i.dataset.label).length;i.textContent=`${i.dataset.label}: ${o}`,o>0?i.classList.remove("empty"):i.classList.add("empty")}),this.activeChip=null,this.currentZone=null}checkZoneOverlap(t,r){this.currentZone=null;for(let i of this.zones){let o=i.getBoundingClientRect();t>=o.left&&t<=o.right&&r>=o.top&&r<=o.bottom?(i.classList.add("highlight"),this.currentZone=i):i.classList.remove("highlight")}}getCurrentState(){return{categorized:Object.fromEntries(this.categorized),progress:this.progressTracker.current}}isInteractionComplete(){return this.categorized.size===this.allItems.length}onHint(){let t=this.allItems.filter(o=>!this.categorized.has(o));if(t.length===0){alert('All items are categorized! Click "Check" to submit.'),this.emitHintShown("All items categorized");return}let r=t[0],i=this.data.categories.find(o=>o.items.includes(r))?.label;i&&(alert(`Hint: "${r}" belongs to "${i}".`),this.emitHintShown(`Item: ${r} \u2192 Category: ${i}`))}submit(){super.submit();let t=ye(this.data.categories,this.categorized,this);console.log(`Classification Score: ${t.score.toFixed(1)}% (${t.correct}/${t.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this.categorized.clear(),this.chips.forEach(t=>t.remove()),this.chips=[],this.centerZone.classList.remove("empty"),this.activeChip=null,this.currentZone=null,this.isDragging=!1,this.zonesGrid&&(this.zonesGrid.scrollTop=0),this.showNextChip()}};customElements.get("sequential-classification")||customElements.define("sequential-classification",Ce);var ea={audio:`
1356
1356
  <svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
1357
1357
  <path d="M11 5 6 9H3v6h3l5 4V5Z"/>
1358
1358
  <path d="M15.5 8.5a5 5 0 0 1 0 7"/>
@@ -1411,7 +1411,7 @@ ${n instanceof Error?n.message:String(n)}`)}}function I(e){return typeof e=="str
1411
1411
  <rect x="3" y="5" width="14" height="14" rx="2"/>
1412
1412
  <path d="m17 10 4-2.5v9L17 14"/>
1413
1413
  </svg>
1414
- `};function B(e){return Yo[e]}function Lr(e,n,t){if(n.innerHTML="",!e.startsWith("@:")||!t||e.length<3){n.textContent=e;return}let r=e.slice(2),i=t[r];if(!i){n.textContent=r;return}console.log("DIALOG",i.dialog),i.dialog===!0?Ko(n,i):Wo(n,i)}function Ko(e,n){let t=document.createElement("button");t.className="media-dialog-trigger";let r={image:`${B("image")}View Image`,video:`${B("video")}Play Video`,audio:`${B("audio")}Play Audio`,html:`${B("data")}View Content`,tts:`${B("audio")}Play Audio`};t.innerHTML=r[n.type],t.style.cssText=`
1414
+ `};function B(e){return ea[e]}function Br(e,n,t){if(n.innerHTML="",!e.startsWith("@:")||!t||e.length<3){n.textContent=e;return}let r=e.slice(2),i=t[r];if(!i){n.textContent=r;return}console.log("DIALOG",i.dialog),i.dialog===!0?ta(n,i):ra(n,i)}function ta(e,n){let t=document.createElement("button");t.className="media-dialog-trigger";let r={image:`${B("image")}View Image`,video:`${B("video")}Play Video`,audio:`${B("audio")}Play Audio`,html:`${B("data")}View Content`,tts:`${B("audio")}Play Audio`};t.innerHTML=r[n.type],t.style.cssText=`
1415
1415
  width: 80%;
1416
1416
  justify-content: center;
1417
1417
  padding: 1rem 1.5rem;
@@ -1426,7 +1426,7 @@ ${n instanceof Error?n.message:String(n)}`)}}function I(e){return typeof e=="str
1426
1426
  display: inline-flex;
1427
1427
  align-items: center;
1428
1428
  gap: 0.5rem;
1429
- `,t.addEventListener("mouseenter",()=>{t.style.transform="translateY(-2px)",t.style.boxShadow="0 4px 12px rgba(0,0,0,0.15)"}),t.addEventListener("mouseleave",()=>{t.style.transform="translateY(0)",t.style.boxShadow="none"}),t.addEventListener("click",()=>{Dr(n)}),e.appendChild(t)}function Wo(e,n){let t=document.createElement("div");t.style.cssText=`
1429
+ `,t.addEventListener("mouseenter",()=>{t.style.transform="translateY(-2px)",t.style.boxShadow="0 4px 12px rgba(0,0,0,0.15)"}),t.addEventListener("mouseleave",()=>{t.style.transform="translateY(0)",t.style.boxShadow="none"}),t.addEventListener("click",()=>{qr(n)}),e.appendChild(t)}function ra(e,n){let t=document.createElement("div");t.style.cssText=`
1430
1430
  position: relative;
1431
1431
  display: flex;
1432
1432
  justify-content: center;
@@ -1455,7 +1455,7 @@ overflow-x: hidden;`;let r=document.createElement("edu-media");r.setAttribute("t
1455
1455
  transition: all 0.2s;
1456
1456
  z-index: 10;
1457
1457
  opacity: 0.8;
1458
- `,o.addEventListener("mouseenter",()=>{o.style.opacity="1",o.style.transform="scale(1.1)"}),o.addEventListener("mouseleave",()=>{o.style.opacity="0.8",o.style.transform="scale(1)"}),o.addEventListener("click",()=>{Dr(n)}),t.appendChild(r),t.appendChild(o),e.appendChild(t)}function Dr(e){let n=document.querySelector("edu-dialog#asset-dialog");n||(n=document.createElement("edu-dialog"),n.id="asset-dialog",document.body.appendChild(n));let t={image:"Image",video:"Video",audio:"Audio",html:"Content",tts:"Audio"};n.title=t[e.type];let r=document.createElement("edu-media");r.setAttribute("type",e.type),e.type==="image"||e.type==="video"||e.type==="audio"?r.setAttribute("data",e.url):(e.type==="html"||e.type==="tts")&&r.setAttribute("data",e.content);let i={};e.type==="image"&&e.size?i.size="large":e.type==="video"&&e.span?i.span=e.span:(e.type==="audio"||e.type==="tts")&&e.volume!==void 0&&(i.volume=e.volume),Object.keys(i).length>0&&r.setAttribute("spec",JSON.stringify(i)),n.innerHTML="",n.appendChild(r),n.open()}var bt=class extends HTMLElement{constructor(){super();this.mediaType=null;this.mediaData=null;this.mediaSpec=null;this.audioPlaying=!1;this.currentAudioUrl=null}static get observedAttributes(){return["type","data","spec"]}connectedCallback(){this.render()}attributeChangedCallback(t,r,i){if(r!==i){if(t==="type")this.mediaType=i;else if(t==="data")this.mediaData=i;else if(t==="spec")try{this.mediaSpec=i?JSON.parse(i):null}catch{console.warn("[EduMedia] Invalid spec JSON:",i),this.mediaSpec=null}this.isConnected&&this.render()}}disconnectedCallback(){this.audioPlaying&&this.currentAudioUrl&&(He.stop(this.currentAudioUrl),this.audioPlaying=!1)}render(){if(!this.mediaType||!this.mediaData){this.innerHTML="";return}switch(this.mediaType){case"image":this.renderImage();break;case"video":this.renderVideo();break;case"audio":this.renderAudio();break;case"html":this.renderHtml();break;case"tts":this.innerHTML='<div style="font-style: italic; color: gray;">TTS not yet supported</div>';break;default:console.warn(`[EduMedia] Unknown media type: ${this.mediaType}`),this.innerHTML=""}}renderImage(){let t=this.mediaSpec?.size||"medium";this.innerHTML=`
1458
+ `,o.addEventListener("mouseenter",()=>{o.style.opacity="1",o.style.transform="scale(1.1)"}),o.addEventListener("mouseleave",()=>{o.style.opacity="0.8",o.style.transform="scale(1)"}),o.addEventListener("click",()=>{qr(n)}),t.appendChild(r),t.appendChild(o),e.appendChild(t)}function qr(e){let n=document.querySelector("edu-dialog#asset-dialog");n||(n=document.createElement("edu-dialog"),n.id="asset-dialog",document.body.appendChild(n));let t={image:"Image",video:"Video",audio:"Audio",html:"Content",tts:"Audio"};n.title=t[e.type];let r=document.createElement("edu-media");r.setAttribute("type",e.type),e.type==="image"||e.type==="video"||e.type==="audio"?r.setAttribute("data",e.url):(e.type==="html"||e.type==="tts")&&r.setAttribute("data",e.content);let i={};e.type==="image"&&e.size?i.size="large":e.type==="video"&&e.span?i.span=e.span:(e.type==="audio"||e.type==="tts")&&e.volume!==void 0&&(i.volume=e.volume),Object.keys(i).length>0&&r.setAttribute("spec",JSON.stringify(i)),n.innerHTML="",n.appendChild(r),n.open()}var xt=class extends HTMLElement{constructor(){super();this.mediaType=null;this.mediaData=null;this.mediaSpec=null;this.audioPlaying=!1;this.currentAudioUrl=null}static get observedAttributes(){return["type","data","spec"]}connectedCallback(){this.render()}attributeChangedCallback(t,r,i){if(r!==i){if(t==="type")this.mediaType=i;else if(t==="data")this.mediaData=i;else if(t==="spec")try{this.mediaSpec=i?JSON.parse(i):null}catch{console.warn("[EduMedia] Invalid spec JSON:",i),this.mediaSpec=null}this.isConnected&&this.render()}}disconnectedCallback(){this.audioPlaying&&this.currentAudioUrl&&(Ne.stop(this.currentAudioUrl),this.audioPlaying=!1)}render(){if(!this.mediaType||!this.mediaData){this.innerHTML="";return}switch(this.mediaType){case"image":this.renderImage();break;case"video":this.renderVideo();break;case"audio":this.renderAudio();break;case"html":this.renderHtml();break;case"tts":this.innerHTML='<div style="font-style: italic; color: gray;">TTS not yet supported</div>';break;default:console.warn(`[EduMedia] Unknown media type: ${this.mediaType}`),this.innerHTML=""}}renderImage(){let t=this.mediaSpec?.size||"medium";this.innerHTML=`
1459
1459
  <style>
1460
1460
  :host {
1461
1461
  display: block;
@@ -1558,7 +1558,7 @@ overflow-x: hidden;`;let r=document.createElement("edu-media");r.setAttribute("t
1558
1558
  </button>
1559
1559
  <div class="audio-label">Audio clip</div>
1560
1560
  </div>
1561
- `;let i=this.querySelector(".audio-button");i&&i.addEventListener("click",async()=>{this.audioPlaying?(He.stop(this.mediaData),this.audioPlaying=!1,this.currentAudioUrl=null,i.title="Play audio"):(this.currentAudioUrl=this.mediaData,console.log(this.currentAudioUrl),await He.playSound(this.mediaData,{volume:t,loop:r,onEnd:()=>{this.audioPlaying=!1,this.currentAudioUrl=null,i.title="Play audio"},onError:o=>{console.error("[EduMedia] Audio playback error:",o),this.audioPlaying=!1,this.currentAudioUrl=null,i.title="Play audio"}}),this.audioPlaying=!0,i.title="Stop audio")})}renderHtml(){this.innerHTML=`
1561
+ `;let i=this.querySelector(".audio-button");i&&i.addEventListener("click",async()=>{this.audioPlaying?(Ne.stop(this.mediaData),this.audioPlaying=!1,this.currentAudioUrl=null,i.title="Play audio"):(this.currentAudioUrl=this.mediaData,console.log(this.currentAudioUrl),await Ne.playSound(this.mediaData,{volume:t,loop:r,onEnd:()=>{this.audioPlaying=!1,this.currentAudioUrl=null,i.title="Play audio"},onError:o=>{console.error("[EduMedia] Audio playback error:",o),this.audioPlaying=!1,this.currentAudioUrl=null,i.title="Play audio"}}),this.audioPlaying=!0,i.title="Stop audio")})}renderHtml(){this.innerHTML=`
1562
1562
  <style>
1563
1563
  :host {
1564
1564
  display: block;
@@ -1575,7 +1575,7 @@ overflow-x: hidden;`;let r=document.createElement("edu-media");r.setAttribute("t
1575
1575
  }
1576
1576
  </style>
1577
1577
  <div class="media-html">${this.mediaData}</div>
1578
- `}parseTime(t){let r=t.split(":").map(i=>parseInt(i,10));return r.length===2?r[0]*60+r[1]:r.length===3?r[0]*3600+r[1]*60+r[2]:null}};customElements.get("edu-media")||customElements.define("edu-media",bt);function Rr(e,n){let t=0,r=e.data.length;e.data.forEach(a=>{let s=new Set(a.correctOptions),l=new Set(n[a.question]||[]),c=0,d=0,u=0;l.forEach(m=>{s.has(m)?c++:d++}),s.forEach(m=>{l.has(m)||u++});let p=s.size,h=c-d-u,g=Math.max(0,h/p*100);t+=g});let i=Math.round(t/r),o=0;return e.data.forEach(a=>{let s=new Set(a.correctOptions),l=new Set(n[a.question]||[]);s.size===l.size&&[...s].every(c=>l.has(c))&&o++}),{score:i,correct:o,total:r}}var ee=class extends x{constructor(t,r,i){super(t,r,i);this.interactionMechanic="sequential";this.currentQuestionIndex=0;this.userAnswers={};this.shuffledOptions=new Map;this.isGraded=!1;this.data.data.forEach(o=>{this.userAnswers[o.question]=[],this.config.shuffle?this.shuffledOptions.set(o.question,S([...o.options])):this.shuffledOptions.set(o.question,[...o.options])}),this.variant=this.config.variant,this.initializeProgress(this.data.data.length)}get slidesCount(){return this.data.data.length}initialize(){}cleanup(){}onVariantChange(t){this.querySelectorAll("edu-chip, edu-block").forEach(r=>{r.variant!==void 0&&(r.variant=t)}),this.variant=t}setSteps(t){let r=t-1;r>=0&&r<this.data.data.length&&(this.currentQuestionIndex=r,this.renderCurrentQuestion())}render(){this.innerHTML=`
1578
+ `}parseTime(t){let r=t.split(":").map(i=>parseInt(i,10));return r.length===2?r[0]*60+r[1]:r.length===3?r[0]*3600+r[1]*60+r[2]:null}};customElements.get("edu-media")||customElements.define("edu-media",xt);function zr(e,n){let t=0,r=e.data.length;e.data.forEach(a=>{let s=new Set(a.correctOptions),l=new Set(n[a.question]||[]),c=0,d=0,u=0;l.forEach(m=>{s.has(m)?c++:d++}),s.forEach(m=>{l.has(m)||u++});let p=s.size,h=c-d-u,g=Math.max(0,h/p*100);t+=g});let i=Math.round(t/r),o=0;return e.data.forEach(a=>{let s=new Set(a.correctOptions),l=new Set(n[a.question]||[]);s.size===l.size&&[...s].every(c=>l.has(c))&&o++}),{score:i,correct:o,total:r}}var te=class extends x{constructor(t,r,i){super(t,r,i);this.interactionMechanic="sequential";this.currentQuestionIndex=0;this.userAnswers={};this.shuffledOptions=new Map;this.isGraded=!1;this.data.data.forEach(o=>{this.userAnswers[o.question]=[],this.config.shuffle?this.shuffledOptions.set(o.question,T([...o.options])):this.shuffledOptions.set(o.question,[...o.options])}),this.variant=this.config.variant,this.initializeProgress(this.data.data.length)}get slidesCount(){return this.data.data.length}initialize(){}cleanup(){}onVariantChange(t){this.querySelectorAll("edu-chip, edu-block").forEach(r=>{r.variant!==void 0&&(r.variant=t)}),this.variant=t}setSteps(t){let r=t-1;r>=0&&r<this.data.data.length&&(this.currentQuestionIndex=r,this.renderCurrentQuestion())}render(){this.innerHTML=`
1579
1579
  <style>
1580
1580
  mcq-interaction {
1581
1581
  display: flex;
@@ -1727,8 +1727,8 @@ overflow-x: hidden;`;let r=document.createElement("edu-media");r.setAttribute("t
1727
1727
  <div class="options-container"></div>
1728
1728
  </div>
1729
1729
  </div>
1730
- `,this.$modeLabel=this.querySelector(".mode-label"),this.$optionsContainer=this.querySelector(".options-container");let t=this.querySelector("#question-block");this.$questionBlock=document.createElement("edu-block"),this.$questionBlock.variant=this.config.variant,this.$questionBlock.innerHTML='<div class="question-text"></div>',t.appendChild(this.$questionBlock),this.$questionText=this.$questionBlock.querySelector(".question-text"),this.renderCurrentQuestion()}renderCurrentQuestion(){let t=this.data.data[this.currentQuestionIndex];if(!t)return;let r=t.correctOptions.length===1;this.$modeLabel.textContent=r?"Multiple Choice":"Multiple Response",Lr(t.question,this.$questionText,this.assets?.assetsById);let i=this.shuffledOptions.get(t.question)||t.options;this.$optionsContainer.innerHTML="",i.forEach((o,a)=>{let s=document.createElement("edu-chip");s.variant=this.variant,s.prefix=`${a+1}:`,s.dataset.option=o,D(o,s,this.assets?.assetsById);let l=this.userAnswers[t.question]?.includes(o);if(l&&(s.selected=!0,s.classList.add("selected")),this.isGraded){let c=t.correctOptions.includes(o);l&&c?s.chipState="correct":l&&!c?s.chipState="wrong":!l&&c&&(s.chipState="missed")}this.isGraded||s.addEventListener("click",()=>{this.handleOptionClick(o,s,r)}),this.$optionsContainer.appendChild(s)})}handleOptionClick(t,r,i){let o=this.data.data[this.currentQuestionIndex],a=this.userAnswers[o.question];if(i){let s=a.includes(t);this.$optionsContainer.querySelectorAll("edu-chip").forEach(l=>{l.selected=!1,l.classList.remove("selected")}),this.userAnswers[o.question]=[],s||(r.selected=!0,r.classList.add("selected"),this.userAnswers[o.question]=[t])}else{let s=a.indexOf(t);s>-1?(a.splice(s,1),r.selected=!1,r.classList.remove("selected")):(a.push(t),r.selected=!0,r.classList.add("selected"))}this.updateProgress(),this.emitStateChange()}updateProgress(){let t=0;this.data.data.forEach(r=>{this.userAnswers[r.question]?.length>0&&t++}),this.setProgress(t)}getCurrentState(){return{...this.userAnswers}}isInteractionComplete(){return this.data.data.every(t=>this.userAnswers[t.question]?.length>0)}onHint(){let t=this.data.data[this.currentQuestionIndex];this.userAnswers[t.question]?.length>0?(alert("Hint: You've selected an answer. Review your choice and make sure it's correct before submitting."),this.emitHintShown(`Answer exists for question ${this.currentQuestionIndex+1}`)):(alert("Hint: This question requires at least one selection. Read the question carefully and choose the best answer(s)."),this.emitHintShown(`No answer selected for question ${this.currentQuestionIndex+1}`))}submit(){super.submit();let t=Rr(this.data,this.userAnswers);console.log(`Recognition Score: ${t.score}% (${t.correct}/${t.total} questions fully correct)`),this.isGraded=!0,this.renderCurrentQuestion(),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0})),this.setAttribute("inert","")}reset(){super.reset(),this.data.data.forEach(t=>{this.userAnswers[t.question]=[]}),this.isGraded=!1,this.currentQuestionIndex=0,this.renderCurrentQuestion()}};customElements.get("mcq-interaction")||customElements.define("mcq-interaction",ee);function Ls(e){let n=[],t={},r=e.split(`
1731
- `).map(s=>s.trim()).filter(Boolean),i=null,o=0;for(let s=0;s<r.length;s++){let l=r[s];if(l.startsWith("#")){i=l.substring(1).trim(),o++;continue}if(l.endsWith(";")){if(!i){t[`parse.noQuestion.line${s+1}`]=`Line ${s+1}: Found options without a preceding question (# question).`;continue}let c=l.slice(0,-1).trim(),d=c.match(/\[([^\]]+)\]/),u=[],p=c;d&&(u=d[1].split("|").map(w=>w.trim()).filter(Boolean),p=c.replace(/\[([^\]]+)\]/,"").trim());let h=p.split("|").map(b=>b.trim()).filter(Boolean),g=[...u,...h],m=new Set;for(let b of g){if(m.has(b)){t[`parse.duplicate.q${o}`]=`Question ${o}: Duplicate option "${b}" found.`;break}m.add(b)}n.push({question:i,correctOptions:u,options:g}),i=null}else t[`parse.missingSemicolon.line${s+1}`]=`Line ${s+1}: Options line must end with ';'.`}i&&(t["parse.danglingQuestion"]=`Question "${i}" has no options defined.`);let a={type:"recognition",data:n};return Object.keys(t).length>0?{data:a,errors:t}:{data:a}}function Rs(e){let n={};return!e.data||e.data.length===0?(n["validation.noQuestions"]="No questions found. Expected at least one question with format: # question\\n[correct] | incorrect;",{ok:!1,errors:n}):(e.data.forEach((t,r)=>{let i=r+1;if((!t.question||t.question.trim()==="")&&(n[`validation.emptyQuestion.q${i}`]=`Question ${i}: Question text cannot be empty.`),(!t.correctOptions||t.correctOptions.length===0)&&(n[`validation.noCorrectOptions.q${i}`]=`Question ${i}: Must have at least one correct answer. Use [correct] syntax.`),(!t.options||t.options.length<2)&&(n[`validation.insufficientOptions.q${i}`]=`Question ${i}: Must have at least 2 options (correct and incorrect).`),t.options&&t.options.forEach((o,a)=>{(!o||o.trim()==="")&&(n[`validation.emptyOption.q${i}.opt${a+1}`]=`Question ${i}, Option ${a+1}: Option text cannot be empty.`)}),t.correctOptions&&t.options&&t.correctOptions.forEach(o=>{t.options.includes(o)||(n[`validation.missingCorrectOption.q${i}`]=`Question ${i}: Correct option "${o}" not found in options array.`)}),t.options){let o=new Set;t.options.forEach(a=>{o.has(a)&&(n[`validation.duplicateOption.q${i}`]=`Question ${i}: Duplicate option "${a}" found.`),o.add(a)})}}),Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0})}function Pr(e,n,t){let r=0;for(let[a,s]of n.entries()){let l=t.querySelector(`[data-val="${a}"]`),c=e.find(d=>d.left===a);c&&c.right===s?(l.chipState="correct",r++):l.chipState="wrong"}let i=e.length,o=i>0?r/i*100:0;return console.log(`Association Score: ${o.toFixed(1)}% (${r}/${i} correct)`),{score:o,correct:r,total:i,answerKey:e,userResponse:n}}var Ce=class extends x{constructor(t,r,i,o){super(t,r,i);this.interactionMechanic="static";this.leftItems=[];this.rightItems=[];this.matched=new Map;this.matchColors=new Map;this.data.pairs.forEach(({left:a,right:s})=>{this.leftItems.push(a),this.rightItems.push(s)}),this.data.distractors&&this.rightItems.push(...this.data.distractors),this.config.shuffle&&(this.leftItems=S(this.leftItems),this.rightItems=S(this.rightItems)),this.initializeProgress(this.leftItems.length),this.currentColor=U[0]}initialize(){}cleanup(){}onVariantChange(t){this.querySelectorAll("edu-chip").forEach(r=>{r.variant!==void 0&&(r.variant=t)})}render(){this.innerHTML=`
1730
+ `,this.$modeLabel=this.querySelector(".mode-label"),this.$optionsContainer=this.querySelector(".options-container");let t=this.querySelector("#question-block");this.$questionBlock=document.createElement("edu-block"),this.$questionBlock.variant=this.config.variant,this.$questionBlock.innerHTML='<div class="question-text"></div>',t.appendChild(this.$questionBlock),this.$questionText=this.$questionBlock.querySelector(".question-text"),this.renderCurrentQuestion()}renderCurrentQuestion(){let t=this.data.data[this.currentQuestionIndex];if(!t)return;let r=t.correctOptions.length===1;this.$modeLabel.textContent=r?"Multiple Choice":"Multiple Response",Br(t.question,this.$questionText,this.assets?.assetsById);let i=this.shuffledOptions.get(t.question)||t.options;this.$optionsContainer.innerHTML="",i.forEach((o,a)=>{let s=document.createElement("edu-chip");s.variant=this.variant,s.prefix=`${a+1}:`,s.dataset.option=o,D(o,s,this.assets?.assetsById);let l=this.userAnswers[t.question]?.includes(o);if(l&&(s.selected=!0,s.classList.add("selected")),this.isGraded){let c=t.correctOptions.includes(o);l&&c?s.chipState="correct":l&&!c?s.chipState="wrong":!l&&c&&(s.chipState="missed")}this.isGraded||s.addEventListener("click",()=>{this.handleOptionClick(o,s,r)}),this.$optionsContainer.appendChild(s)})}handleOptionClick(t,r,i){let o=this.data.data[this.currentQuestionIndex],a=this.userAnswers[o.question];if(i){let s=a.includes(t);this.$optionsContainer.querySelectorAll("edu-chip").forEach(l=>{l.selected=!1,l.classList.remove("selected")}),this.userAnswers[o.question]=[],s||(r.selected=!0,r.classList.add("selected"),this.userAnswers[o.question]=[t])}else{let s=a.indexOf(t);s>-1?(a.splice(s,1),r.selected=!1,r.classList.remove("selected")):(a.push(t),r.selected=!0,r.classList.add("selected"))}this.updateProgress(),this.emitStateChange()}updateProgress(){let t=0;this.data.data.forEach(r=>{this.userAnswers[r.question]?.length>0&&t++}),this.setProgress(t)}getCurrentState(){return{...this.userAnswers}}isInteractionComplete(){return this.data.data.every(t=>this.userAnswers[t.question]?.length>0)}onHint(){let t=this.data.data[this.currentQuestionIndex];this.userAnswers[t.question]?.length>0?(alert("Hint: You've selected an answer. Review your choice and make sure it's correct before submitting."),this.emitHintShown(`Answer exists for question ${this.currentQuestionIndex+1}`)):(alert("Hint: This question requires at least one selection. Read the question carefully and choose the best answer(s)."),this.emitHintShown(`No answer selected for question ${this.currentQuestionIndex+1}`))}submit(){super.submit();let t=zr(this.data,this.userAnswers);console.log(`Recognition Score: ${t.score}% (${t.correct}/${t.total} questions fully correct)`),this.isGraded=!0,this.renderCurrentQuestion(),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0})),this.setAttribute("inert","")}reset(){super.reset(),this.data.data.forEach(t=>{this.userAnswers[t.question]=[]}),this.isGraded=!1,this.currentQuestionIndex=0,this.renderCurrentQuestion()}};customElements.get("mcq-interaction")||customElements.define("mcq-interaction",te);function Hs(e){let n=[],t={},r=e.split(`
1731
+ `).map(s=>s.trim()).filter(Boolean),i=null,o=0;for(let s=0;s<r.length;s++){let l=r[s];if(l.startsWith("#")){i=l.substring(1).trim(),o++;continue}if(l.endsWith(";")){if(!i){t[`parse.noQuestion.line${s+1}`]=`Line ${s+1}: Found options without a preceding question (# question).`;continue}let c=l.slice(0,-1).trim(),d=c.match(/\[([^\]]+)\]/),u=[],p=c;d&&(u=d[1].split("|").map(w=>w.trim()).filter(Boolean),p=c.replace(/\[([^\]]+)\]/,"").trim());let h=p.split("|").map(b=>b.trim()).filter(Boolean),g=[...u,...h],m=new Set;for(let b of g){if(m.has(b)){t[`parse.duplicate.q${o}`]=`Question ${o}: Duplicate option "${b}" found.`;break}m.add(b)}n.push({question:i,correctOptions:u,options:g}),i=null}else t[`parse.missingSemicolon.line${s+1}`]=`Line ${s+1}: Options line must end with ';'.`}i&&(t["parse.danglingQuestion"]=`Question "${i}" has no options defined.`);let a={type:"recognition",data:n};return Object.keys(t).length>0?{data:a,errors:t}:{data:a}}function Gs(e){let n={};return!e.data||e.data.length===0?(n["validation.noQuestions"]="No questions found. Expected at least one question with format: # question\\n[correct] | incorrect;",{ok:!1,errors:n}):(e.data.forEach((t,r)=>{let i=r+1;if((!t.question||t.question.trim()==="")&&(n[`validation.emptyQuestion.q${i}`]=`Question ${i}: Question text cannot be empty.`),(!t.correctOptions||t.correctOptions.length===0)&&(n[`validation.noCorrectOptions.q${i}`]=`Question ${i}: Must have at least one correct answer. Use [correct] syntax.`),(!t.options||t.options.length<2)&&(n[`validation.insufficientOptions.q${i}`]=`Question ${i}: Must have at least 2 options (correct and incorrect).`),t.options&&t.options.forEach((o,a)=>{(!o||o.trim()==="")&&(n[`validation.emptyOption.q${i}.opt${a+1}`]=`Question ${i}, Option ${a+1}: Option text cannot be empty.`)}),t.correctOptions&&t.options&&t.correctOptions.forEach(o=>{t.options.includes(o)||(n[`validation.missingCorrectOption.q${i}`]=`Question ${i}: Correct option "${o}" not found in options array.`)}),t.options){let o=new Set;t.options.forEach(a=>{o.has(a)&&(n[`validation.duplicateOption.q${i}`]=`Question ${i}: Duplicate option "${a}" found.`),o.add(a)})}}),Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0})}function Hr(e,n,t){let r=0;for(let[a,s]of n.entries()){let l=t.querySelector(`[data-val="${a}"]`),c=e.find(d=>d.left===a);c&&c.right===s?(l.chipState="correct",r++):l.chipState="wrong"}let i=e.length,o=i>0?r/i*100:0;return console.log(`Association Score: ${o.toFixed(1)}% (${r}/${i} correct)`),{score:o,correct:r,total:i,answerKey:e,userResponse:n}}var ke=class extends x{constructor(t,r,i,o){super(t,r,i);this.interactionMechanic="static";this.leftItems=[];this.rightItems=[];this.matched=new Map;this.matchColors=new Map;this.data.pairs.forEach(({left:a,right:s})=>{this.leftItems.push(a),this.rightItems.push(s)}),this.data.distractors&&this.rightItems.push(...this.data.distractors),this.config.shuffle&&(this.leftItems=T(this.leftItems),this.rightItems=T(this.rightItems)),this.initializeProgress(this.leftItems.length),this.currentColor=U[0]}initialize(){}cleanup(){}onVariantChange(t){this.querySelectorAll("edu-chip").forEach(r=>{r.variant!==void 0&&(r.variant=t)})}render(){this.innerHTML=`
1732
1732
  <style>
1733
1733
  simultaneous-association {
1734
1734
  --current-color: #3b82f6;
@@ -1823,7 +1823,7 @@ overflow-x: hidden;`;let r=document.createElement("edu-media");r.setAttribute("t
1823
1823
  <div class="items-list" id="right-col" data-compact="${this.rightItems.length>=7}"></div>
1824
1824
  </div>
1825
1825
  </div>
1826
- `,this.$leftCol=this.querySelector("#left-col"),this.$rightCol=this.querySelector("#right-col"),this.renderItems()}renderItems(){this.leftItems.forEach((t,r)=>{let i=document.createElement("edu-chip");i.variant=this.config.variant,D(t,i,this.assets?.assetsById),i.dataset.val=t,i.addEventListener("click",o=>{let a=o.currentTarget,s=a.dataset.val;if(this.currentSelected===s){a.selected=!1,this.currentSelected="",this.currentEl=null;return}if(this.matched.get(s)){let l=this.matched.get(s),c=this.querySelector(`[data-val="${l}"]`);a.color="",a.colored=!1,c.colored=!1,c.color="",this.matched.delete(s),this.matchColors.delete(s),this.decrementProgress(),this.emitStateChange();return}this.currentSelected&&(this.currentEl.selected=!1),this.currentSelected=s,this.currentEl=a,a.selected=!0}),this.$leftCol.append(i)}),this.rightItems.forEach((t,r)=>{let i=document.createElement("edu-chip");i.variant=this.config.variant,D(t,i,this.assets?.assetsById),i.dataset.val=t,i.dataset.colorIndex=`${r+1}`,i.addEventListener("click",o=>{let a=o.currentTarget,s=a.dataset.val;if(this.currentSelected===s){this.currentSelected="",this.currentEl=null,a.selected=!1;return}if(![...this.matched.values()].includes(s)){if(this.currentSelected)if(this.leftItems.includes(this.currentSelected)&&this.rightItems.includes(s)){let c=Number(a.dataset.colorIndex)%U.length,d=U[c];this.matched.set(this.currentSelected,s),this.matchColors.set(this.currentSelected,d),a.selected=!1,this.currentEl.selected=!1,a.color=d,a.colored=!0,this.currentEl.color=d,this.currentEl.colored=!0,this.incrementProgress(),this.emitStateChange(),this.currentSelected="",this.currentEl=null;return}else this.currentEl.selected=!1;this.currentSelected=s,this.currentEl=a,a.selected=!0}}),this.$rightCol.append(i)})}getCurrentState(){return{matched:Object.fromEntries(this.matched),progress:this.progressTracker.current}}isInteractionComplete(){return this.matched.size===this.leftItems.length}onHint(){let t=this.leftItems.filter(i=>!this.matched.has(i));if(t.length===0){alert('All items are matched! Click "Check" to submit.'),this.emitHintShown("All items matched");return}let r=t[0];alert(`Hint: You haven't matched "${r}" yet. Select it from the left, then select its match from the right.`),this.emitHintShown(`Unmatched: ${r}`)}submit(){super.submit();let t=Pr(this.data.pairs,this.matched,this);this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this.matched.clear(),this.matchColors.clear(),this.currentSelected="",this.currentEl=null,this.querySelectorAll("edu-chip").forEach(t=>{t.classList.remove("colorized","selected"),t.style.setProperty("--current-color","")})}};customElements.get("simultaneous-association")||customElements.define("simultaneous-association",Ce);var te=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._recalledItems=new Set;this.initializeProgress(t.items.length)}initialize(){}cleanup(){}onVariantChange(t){this._$textInput&&(this._$textInput.variant=t),this._$addButton&&(this._$addButton.variant=t),this._$chipsContainer?.querySelectorAll("edu-chip").forEach(r=>{r.variant=t})}render(){this.innerHTML=`
1826
+ `,this.$leftCol=this.querySelector("#left-col"),this.$rightCol=this.querySelector("#right-col"),this.renderItems()}renderItems(){this.leftItems.forEach((t,r)=>{let i=document.createElement("edu-chip");i.variant=this.config.variant,D(t,i,this.assets?.assetsById),i.dataset.val=t,i.addEventListener("click",o=>{let a=o.currentTarget,s=a.dataset.val;if(this.currentSelected===s){a.selected=!1,this.currentSelected="",this.currentEl=null;return}if(this.matched.get(s)){let l=this.matched.get(s),c=this.querySelector(`[data-val="${l}"]`);a.color="",a.colored=!1,c.colored=!1,c.color="",this.matched.delete(s),this.matchColors.delete(s),this.decrementProgress(),this.emitStateChange();return}this.currentSelected&&(this.currentEl.selected=!1),this.currentSelected=s,this.currentEl=a,a.selected=!0}),this.$leftCol.append(i)}),this.rightItems.forEach((t,r)=>{let i=document.createElement("edu-chip");i.variant=this.config.variant,D(t,i,this.assets?.assetsById),i.dataset.val=t,i.dataset.colorIndex=`${r+1}`,i.addEventListener("click",o=>{let a=o.currentTarget,s=a.dataset.val;if(this.currentSelected===s){this.currentSelected="",this.currentEl=null,a.selected=!1;return}if(![...this.matched.values()].includes(s)){if(this.currentSelected)if(this.leftItems.includes(this.currentSelected)&&this.rightItems.includes(s)){let c=Number(a.dataset.colorIndex)%U.length,d=U[c];this.matched.set(this.currentSelected,s),this.matchColors.set(this.currentSelected,d),a.selected=!1,this.currentEl.selected=!1,a.color=d,a.colored=!0,this.currentEl.color=d,this.currentEl.colored=!0,this.incrementProgress(),this.emitStateChange(),this.currentSelected="",this.currentEl=null;return}else this.currentEl.selected=!1;this.currentSelected=s,this.currentEl=a,a.selected=!0}}),this.$rightCol.append(i)})}getCurrentState(){return{matched:Object.fromEntries(this.matched),progress:this.progressTracker.current}}isInteractionComplete(){return this.matched.size===this.leftItems.length}onHint(){let t=this.leftItems.filter(i=>!this.matched.has(i));if(t.length===0){alert('All items are matched! Click "Check" to submit.'),this.emitHintShown("All items matched");return}let r=t[0];alert(`Hint: You haven't matched "${r}" yet. Select it from the left, then select its match from the right.`),this.emitHintShown(`Unmatched: ${r}`)}submit(){super.submit();let t=Hr(this.data.pairs,this.matched,this);this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this.matched.clear(),this.matchColors.clear(),this.currentSelected="",this.currentEl=null,this.querySelectorAll("edu-chip").forEach(t=>{t.classList.remove("colorized","selected"),t.style.setProperty("--current-color","")})}};customElements.get("simultaneous-association")||customElements.define("simultaneous-association",ke);var re=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._recalledItems=new Set;this.initializeProgress(t.items.length)}initialize(){}cleanup(){}onVariantChange(t){this._$textInput&&(this._$textInput.variant=t),this._$addButton&&(this._$addButton.variant=t),this._$chipsContainer?.querySelectorAll("edu-chip").forEach(r=>{r.variant=t})}render(){this.innerHTML=`
1827
1827
  <style>
1828
1828
  list-recall {
1829
1829
  display: flex;
@@ -1903,7 +1903,7 @@ overflow-x: hidden;`;let r=document.createElement("edu-media");r.setAttribute("t
1903
1903
  <edu-input type="text" placeholder="Enter an item..."></edu-input>
1904
1904
  <edu-input as="button">Add</edu-input>
1905
1905
  </div>
1906
- `,this._$chipsContainer=this.querySelector(".chips-container"),this._$textInput=this.querySelector('edu-input[type="text"]'),this._$addButton=this.querySelector('edu-input[as="button"]'),this._$textInput.variant=this.config.variant,this._$addButton.variant=this.config.variant,this._$addButton.addEventListener("click",()=>this.handleAddItem()),this._$textInput.addEventListener("keydown",t=>{t.key==="Enter"&&(t.preventDefault(),this.handleAddItem())})}handleAddItem(){let t=this._$textInput.value.trim();if(!t)return;let r=t.toLowerCase();if(this._recalledItems.has(r)){alert("You have already added this item."),this._$textInput.value="";return}if(this._recalledItems.size>=this.data.items.length){alert(`You can only add up to ${this.data.items.length} items.`),this._$textInput.value="";return}this._recalledItems.add(r),this.addChip(t),this._$textInput.value="",this.setProgress(this._recalledItems.size),this.emitStateChange()}addChip(t){let r=document.createElement("edu-chip");r.textContent=t,r.variant=this.config.variant,r.value=t.toLowerCase(),r.addEventListener("click",()=>{let i=r.value;this._recalledItems.delete(i),r.remove(),this.setProgress(this._recalledItems.size),this.emitStateChange()}),this._$chipsContainer.appendChild(r)}getCurrentState(){return Array.from(this._recalledItems)}isInteractionComplete(){return this._recalledItems.size===this.data.items.length}onHint(){let t=this._recalledItems.size,r=this.data.items.length;t===0?(alert(`Hint: Try to recall all ${r} items from memory.`),this.emitHintShown("No items recalled yet")):t<r?(alert(`Hint: You've recalled ${t} out of ${r} items. Keep going!`),this.emitHintShown(`${t}/${r} items recalled`)):(alert(`Great! You've recalled all items. Click "Check" to submit.`),this.emitHintShown("All items recalled"))}submit(){super.submit();let t=this.gradeRecall();console.log(`List Recall Score: ${t.score.toFixed(1)}% (${t.correct}/${t.total} correct)`),this.applyGradingFeedback(t),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}gradeRecall(){let t=this.data.items.map(s=>s.toLowerCase()),r=Array.from(this._recalledItems),i=0;for(let s of r)t.includes(s)&&i++;let o=this.data.items.length;return{score:o>0?Math.round(i/o*100):0,correct:i,total:o,answerKey:this.data.items,userResponse:r}}applyGradingFeedback(t){let r=this.data.items.map(o=>o.toLowerCase());this._$chipsContainer.querySelectorAll("edu-chip").forEach(o=>{let a=o.value;r.includes(a)?o.chipState="correct":o.chipState="wrong"})}reset(){super.reset(),this._recalledItems.clear(),this._$chipsContainer.innerHTML="";let t=this._$textInput.querySelector(".control");t&&(t.value=""),this.setProgress(0)}};customElements.get("list-recall")||customElements.define("list-recall",te);function el(e){let n=[],t=[],r=new Map,i={},o=/^\s*(?<category>[A-Z_](?:[A-Z0-9_]* ?[A-Z0-9_]+)*)\s*=\s*(?<items>[^;]+?)\s*;\s*$/gm,a=[...e.matchAll(o)];a.length===0&&(i["parse.noMatches"]="No valid category entries found. Expected lines like: CATEGORY = item1 | item2;");let s=new Set;for(let c of a){let d=c.groups?.category??"",u=c.groups?.items??"",p=d.trim().toLowerCase();if(r.has(p)){i[`parse.duplicateCategory.${p}`]=`Duplicate category "${p}" was defined more than once. Merge them into a single entry.`;continue}let h=u.split("|").map(g=>g.replace(/\s+/g," ").trim()).filter(Boolean);if(h.length===0){i[`parse.emptyCategory.${p}`]=`Category "${p}" has no items. Expected at least one item before ';'.`,t.push(p),r.set(p,[]);continue}t.push(p);for(let g of h)s.has(g)||(s.add(g),n.push(g));r.set(p,h)}let l={rows:n,cols:t,answerKey:r};return Object.keys(i).length>0?{data:l,errors:i}:{data:l}}function tl(e){let n={},t=[],r=new Map,i=/^\s*(?<category>[a-z_](?:[a-z0-9_]* ?[a-z0-9_]+)*)\s*=\s*(?<values>[^;]+?)\s*;/gim,o=[...e.matchAll(i)];if(o.length===0)return n["parse.noMatches"]="No valid category entries found. Expected lines like: category = val1 | val2;",{data:{rows:[],cols:[],answerKey:{}},errors:n};let a=new Set;for(let d of o){let u=d.groups?.category??"",p=d.groups?.values??"",h=u.trim().toLowerCase();if(a.has(h)){n[`parse.duplicateCategory.${h}`]=`Duplicate category "${h}" was defined more than once.`;continue}a.add(h);let g=p.split("|").map(m=>m.trim()).filter(Boolean);t.push(h),r.set(h,g)}let s=t.length;for(let d of t){let u=r.get(d)??[],p=s-1;u.length!==p&&(n[`parse.valueCount.${d}`]=`Category "${d}" has ${u.length} values, but expected ${p} (n-1 where n=${s}).`)}let l={};for(let d=0;d<t.length;d++){let u=t[d],p=r.get(u)??[];l[u]={};let h=0;for(let g=0;g<t.length;g++){if(d===g)continue;let m=t[g],b=p[h],w=null;if(b!==void 0&&b!==""){let v=Number(b);w=isNaN(v)?b:v}l[u][m]=w,h++}}let c={rows:t,cols:t,answerKey:l};return Object.keys(n).length>0?{data:c,errors:n}:{data:c}}function rl(e){let n={},t=[],r=[],i={},o=/^\s*=\s*(?<cols>[^;]+?)\s*;/m,a=e.match(o);if(!a)return n["parse.noHeader"]="Missing header line. Expected first line like: = col1 | col2 | col3;",{data:{rows:[],cols:[],answerKey:{}},errors:n};if(t=(a.groups?.cols??"").split("|").map(p=>p.trim()).filter(Boolean),t.length===0)return n["parse.emptyHeader"]='Header line has no columns. Expected at least one column after "=".',{data:{rows:[],cols:[],answerKey:{}},errors:n};let l=/^\s*(?<row>[^=]+?)\s*=\s*(?<values>[^;]+?)\s*;/gm,c=[...e.matchAll(l)],d=new Set;for(let p of c){let h=p.groups?.row??"",g=p.groups?.values??"";if(h.trim()==="")continue;let m=h.trim();if(d.has(m)){n[`parse.duplicateRow.${m}`]=`Duplicate row "${m}" was defined more than once.`;continue}d.add(m);let b=g.split("|").map(w=>w.trim()).filter(w=>w!=="");if(b.length!==t.length){n[`parse.valueCount.${m}`]=`Row "${m}" has ${b.length} values, but expected ${t.length} (matching column count).`;continue}r.push(m),i[m]={};for(let w=0;w<t.length;w++){let v=t[w],q=b[w];if(q==="-"){i[m][v]=null;continue}let K=null;if(q!==void 0&&q!==""){let wt=Number(q);K=isNaN(wt)?q:wt}i[m][v]=K}}r.length===0&&(n["parse.noRows"]="No data rows found. Expected at least one line like: row = val1 | val2;");let u={rows:r,cols:t,answerKey:i};return Object.keys(n).length>0?{data:u,errors:n}:{data:u}}function nl(e,n="classification"){let t={},r=e.answerKey;e.cols.length===0&&(t["cols.empty"]="No categories were found. Expected at least one CATEGORY = ... ; entry."),e.rows.length===0&&(t["rows.empty"]="No row items were found. Expected at least one item in any category.");for(let i of e.cols)e.rows.includes(i)&&(t[`cols.rowConflict.${i}`]=`Category "${i}" is also present as an item. Category labels cannot be used as row items.`);for(let i of e.cols){let o=r.get(i);if(!o){t[`answerKey.missing.${i}`]=`Category "${i}" has no entry in answerKey. This usually indicates a parser issue.`;continue}o.length===0&&(t[`answerKey.emptyCategory.${i}`]=`Category "${i}" has no items. Each category must include at least one item.`)}for(let[i,o]of r.entries()){let a=new Set;for(let s of o){if(a.has(s)){t[`answerKey.duplicateItem.${i}`]=`Category "${i}" includes duplicate item "${s}". Remove duplicates.`;break}a.add(s)}}if(n==="n-ary"){let i=new Map;for(let[o,a]of r.entries())for(let s of a){let l=i.get(s);l?l.push(o):i.set(s,[o])}for(let o of e.rows){let a=i.get(o)??[];if(a.length===0){t[`nary.unassigned.${o}`]=`Item "${o}" is not assigned to any category. In n-ary tables, every item must belong to exactly one category.`;continue}a.length>1&&(t[`nary.multiCategory.${o}`]=`Item "${o}" appears in multiple categories (${a.join(", ")}). In n-ary tables, items must belong to exactly one category.`)}}return Object.keys(t).length>0?{ok:!1,errors:t}:{ok:!0}}function ol(e){let n={};if(e.rows.length===0&&(n["rows.empty"]="No rows found. Expected at least one category."),e.cols.length===0&&(n["cols.empty"]="No columns found. Expected at least one category."),e.rows.length!==e.cols.length)n["symmetry.lengthMismatch"]=`Rows (${e.rows.length}) and columns (${e.cols.length}) must have the same length for adjacency tables.`;else{let t=new Set(e.rows),r=new Set(e.cols);for(let i of e.rows)r.has(i)||(n[`symmetry.rowNotInCols.${i}`]=`Row "${i}" does not appear in columns. Adjacency tables must be symmetric.`);for(let i of e.cols)t.has(i)||(n[`symmetry.colNotInRows.${i}`]=`Column "${i}" does not appear in rows. Adjacency tables must be symmetric.`)}for(let t of e.rows){if(!e.answerKey[t]){n[`answerKey.missingRow.${t}`]=`Row "${t}" has no entry in answer key.`;continue}for(let r of e.cols)if(t===r){let i=e.answerKey[t][r];i!=null&&(n[`answerKey.diagonalValue.${t}`]=`Diagonal cell (${t}, ${t}) should be empty, but has value "${i}".`)}else e.answerKey[t][r]===void 0&&(n[`answerKey.missingCell.${t}.${r}`]=`Missing value at cell (${t}, ${r}). All non-diagonal cells must have values.`)}return Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0}}function al(e){let n={};e.cols.length===0&&(n["cols.empty"]="No columns found. Expected at least one column in header line."),e.rows.length===0&&(n["rows.empty"]="No rows found. Expected at least one data row.");let t=new Set(e.cols);for(let r of e.rows)t.has(r)&&(n[`naming.rowColConflict.${r}`]=`Row name "${r}" is also a column name. This creates ambiguity and should be avoided.`);for(let r of e.rows){if(!e.answerKey[r]){n[`answerKey.missingRow.${r}`]=`Row "${r}" has no entry in answer key.`;continue}for(let i of e.cols)e.answerKey[r][i]===void 0&&(n[`answerKey.missingCell.${r}.${i}`]=`Missing value at cell (${r}, ${i}). Cells must have values or be marked as disabled with '-'.`)}return Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0}}function ke(e){let n=[];for(let t of Object.values(e))for(let r of Object.values(t))r!==null&&n.push(r);return n}function Ye(e){let n=ke(e);return Array.from(new Set(n))}function Ke(e){let n=new Set(e.filter(t=>t!==null));return e.every(t=>t===null||typeof t=="number")?"number":n.size>0&&n.size<=10?"select":"text"}function Se(e,n){return e===null||n===null?!1:typeof e=="number"&&typeof n=="number"?Math.abs(e-n)<1e-4:String(e).trim()===String(n).trim()}function Br(e,n,t){let r=0,i=t.length;for(let a of t){let s=n[a]?.selectedCols??[],l=null;for(let[c,d]of e.entries())if(d.includes(a)){l=c;break}s.length===1&&s[0]===l&&r++}return{score:i>0?Math.round(r/i*100):0,correct:r,total:i}}function qr(e,n,t,r){let i=0,o=0;for(let s of t)for(let l of r){let c=e[s]?.[l];if(c===null)continue;let d=n[s]?.values[l];o++,Se(c,d)&&i++}return{score:o>0?Math.round(i/o*100):0,correct:i,total:o}}function zr(e,n,t,r){let i=0,o=0;for(let s of t){let l=new Set(n[s]?.selectedCols??[]),c=new Set;for(let[d,u]of e.entries())u.includes(s)&&c.add(d);for(let d of r){let u=c.has(d),p=l.has(d);u===p&&i++,o++}}return{score:o>0?Math.round(i/o*100):0,correct:i,total:o}}function Hr(e,n,t){let r=0,i=0;for(let a of t)for(let s of t){if(a===s)continue;let l=e[a]?.[s],c=n[a]?.values[s];i++,Se(l,c)&&r++}return{score:i>0?Math.round(r/i*100):0,correct:r,total:i}}function Gr(e,n,t){let r={};for(let i of t){r[i]={};for(let o of t){if(i===o)continue;let a=e[i]?.[o],s=n[i]?.values[o];s==null||s===""?r[i][o]="missed":Se(a,s)?r[i][o]="correct":r[i][o]="wrong"}}return r}function Nr(e,n,t,r){let i={};for(let o of t){i[o]={};for(let a of r){let s=e[o]?.[a];if(s===null)continue;let l=n[o]?.values[a];l==null||l===""?i[o][a]="missed":Se(s,l)?i[o][a]="correct":i[o][a]="wrong"}}return i}function Or(e,n,t,r){let i={};for(let o of t){i[o]={};let a=new Set(n[o]?.selectedCols??[]),s=new Set;for(let[l,c]of e.entries())c.includes(o)&&s.add(l);for(let l of r){let c=s.has(l),d=a.has(l);c===d?i[o][l]="correct":!d&&c?i[o][l]="missed":i[o][l]="wrong"}}return i}function Vr(e,n,t){let r={};for(let i of t){r[i]={};let o=n[i]?.selectedCols??[],a=null;for(let[s,l]of e.entries())if(l.includes(i)){a=s;break}if(o.length===1){let s=o[0];s===a?r[i][s]="correct":r[i][s]="wrong"}else o.length===0&&a&&(r[i][a]="missed")}return r}var Fr=`/* ===========================================
1906
+ `,this._$chipsContainer=this.querySelector(".chips-container"),this._$textInput=this.querySelector('edu-input[type="text"]'),this._$addButton=this.querySelector('edu-input[as="button"]'),this._$textInput.variant=this.config.variant,this._$addButton.variant=this.config.variant,this._$addButton.addEventListener("click",()=>this.handleAddItem()),this._$textInput.addEventListener("keydown",t=>{t.key==="Enter"&&(t.preventDefault(),this.handleAddItem())})}handleAddItem(){let t=this._$textInput.value.trim();if(!t)return;let r=t.toLowerCase();if(this._recalledItems.has(r)){alert("You have already added this item."),this._$textInput.value="";return}if(this._recalledItems.size>=this.data.items.length){alert(`You can only add up to ${this.data.items.length} items.`),this._$textInput.value="";return}this._recalledItems.add(r),this.addChip(t),this._$textInput.value="",this.setProgress(this._recalledItems.size),this.emitStateChange()}addChip(t){let r=document.createElement("edu-chip");r.textContent=t,r.variant=this.config.variant,r.value=t.toLowerCase(),r.addEventListener("click",()=>{let i=r.value;this._recalledItems.delete(i),r.remove(),this.setProgress(this._recalledItems.size),this.emitStateChange()}),this._$chipsContainer.appendChild(r)}getCurrentState(){return Array.from(this._recalledItems)}isInteractionComplete(){return this._recalledItems.size===this.data.items.length}onHint(){let t=this._recalledItems.size,r=this.data.items.length;t===0?(alert(`Hint: Try to recall all ${r} items from memory.`),this.emitHintShown("No items recalled yet")):t<r?(alert(`Hint: You've recalled ${t} out of ${r} items. Keep going!`),this.emitHintShown(`${t}/${r} items recalled`)):(alert(`Great! You've recalled all items. Click "Check" to submit.`),this.emitHintShown("All items recalled"))}submit(){super.submit();let t=this.gradeRecall();console.log(`List Recall Score: ${t.score.toFixed(1)}% (${t.correct}/${t.total} correct)`),this.applyGradingFeedback(t),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}gradeRecall(){let t=this.data.items.map(s=>s.toLowerCase()),r=Array.from(this._recalledItems),i=0;for(let s of r)t.includes(s)&&i++;let o=this.data.items.length;return{score:o>0?Math.round(i/o*100):0,correct:i,total:o,answerKey:this.data.items,userResponse:r}}applyGradingFeedback(t){let r=this.data.items.map(o=>o.toLowerCase());this._$chipsContainer.querySelectorAll("edu-chip").forEach(o=>{let a=o.value;r.includes(a)?o.chipState="correct":o.chipState="wrong"})}reset(){super.reset(),this._recalledItems.clear(),this._$chipsContainer.innerHTML="";let t=this._$textInput.querySelector(".control");t&&(t.value=""),this.setProgress(0)}};customElements.get("list-recall")||customElements.define("list-recall",re);function sl(e){let n=[],t=[],r=new Map,i={},o=/^\s*(?<category>[A-Z_](?:[A-Z0-9_]* ?[A-Z0-9_]+)*)\s*=\s*(?<items>[^;]+?)\s*;\s*$/gm,a=[...e.matchAll(o)];a.length===0&&(i["parse.noMatches"]="No valid category entries found. Expected lines like: CATEGORY = item1 | item2;");let s=new Set;for(let c of a){let d=c.groups?.category??"",u=c.groups?.items??"",p=d.trim().toLowerCase();if(r.has(p)){i[`parse.duplicateCategory.${p}`]=`Duplicate category "${p}" was defined more than once. Merge them into a single entry.`;continue}let h=u.split("|").map(g=>g.replace(/\s+/g," ").trim()).filter(Boolean);if(h.length===0){i[`parse.emptyCategory.${p}`]=`Category "${p}" has no items. Expected at least one item before ';'.`,t.push(p),r.set(p,[]);continue}t.push(p);for(let g of h)s.has(g)||(s.add(g),n.push(g));r.set(p,h)}let l={rows:n,cols:t,answerKey:r};return Object.keys(i).length>0?{data:l,errors:i}:{data:l}}function ll(e){let n={},t=[],r=new Map,i=/^\s*(?<category>[a-z_](?:[a-z0-9_]* ?[a-z0-9_]+)*)\s*=\s*(?<values>[^;]+?)\s*;/gim,o=[...e.matchAll(i)];if(o.length===0)return n["parse.noMatches"]="No valid category entries found. Expected lines like: category = val1 | val2;",{data:{rows:[],cols:[],answerKey:{}},errors:n};let a=new Set;for(let d of o){let u=d.groups?.category??"",p=d.groups?.values??"",h=u.trim().toLowerCase();if(a.has(h)){n[`parse.duplicateCategory.${h}`]=`Duplicate category "${h}" was defined more than once.`;continue}a.add(h);let g=p.split("|").map(m=>m.trim()).filter(Boolean);t.push(h),r.set(h,g)}let s=t.length;for(let d of t){let u=r.get(d)??[],p=s-1;u.length!==p&&(n[`parse.valueCount.${d}`]=`Category "${d}" has ${u.length} values, but expected ${p} (n-1 where n=${s}).`)}let l={};for(let d=0;d<t.length;d++){let u=t[d],p=r.get(u)??[];l[u]={};let h=0;for(let g=0;g<t.length;g++){if(d===g)continue;let m=t[g],b=p[h],w=null;if(b!==void 0&&b!==""){let v=Number(b);w=isNaN(v)?b:v}l[u][m]=w,h++}}let c={rows:t,cols:t,answerKey:l};return Object.keys(n).length>0?{data:c,errors:n}:{data:c}}function cl(e){let n={},t=[],r=[],i={},o=/^\s*=\s*(?<cols>[^;]+?)\s*;/m,a=e.match(o);if(!a)return n["parse.noHeader"]="Missing header line. Expected first line like: = col1 | col2 | col3;",{data:{rows:[],cols:[],answerKey:{}},errors:n};if(t=(a.groups?.cols??"").split("|").map(p=>p.trim()).filter(Boolean),t.length===0)return n["parse.emptyHeader"]='Header line has no columns. Expected at least one column after "=".',{data:{rows:[],cols:[],answerKey:{}},errors:n};let l=/^\s*(?<row>[^=]+?)\s*=\s*(?<values>[^;]+?)\s*;/gm,c=[...e.matchAll(l)],d=new Set;for(let p of c){let h=p.groups?.row??"",g=p.groups?.values??"";if(h.trim()==="")continue;let m=h.trim();if(d.has(m)){n[`parse.duplicateRow.${m}`]=`Duplicate row "${m}" was defined more than once.`;continue}d.add(m);let b=g.split("|").map(w=>w.trim()).filter(w=>w!=="");if(b.length!==t.length){n[`parse.valueCount.${m}`]=`Row "${m}" has ${b.length} values, but expected ${t.length} (matching column count).`;continue}r.push(m),i[m]={};for(let w=0;w<t.length;w++){let v=t[w],q=b[w];if(q==="-"){i[m][v]=null;continue}let K=null;if(q!==void 0&&q!==""){let Et=Number(q);K=isNaN(Et)?q:Et}i[m][v]=K}}r.length===0&&(n["parse.noRows"]="No data rows found. Expected at least one line like: row = val1 | val2;");let u={rows:r,cols:t,answerKey:i};return Object.keys(n).length>0?{data:u,errors:n}:{data:u}}function ul(e,n="classification"){let t={},r=e.answerKey;e.cols.length===0&&(t["cols.empty"]="No categories were found. Expected at least one CATEGORY = ... ; entry."),e.rows.length===0&&(t["rows.empty"]="No row items were found. Expected at least one item in any category.");for(let i of e.cols)e.rows.includes(i)&&(t[`cols.rowConflict.${i}`]=`Category "${i}" is also present as an item. Category labels cannot be used as row items.`);for(let i of e.cols){let o=r.get(i);if(!o){t[`answerKey.missing.${i}`]=`Category "${i}" has no entry in answerKey. This usually indicates a parser issue.`;continue}o.length===0&&(t[`answerKey.emptyCategory.${i}`]=`Category "${i}" has no items. Each category must include at least one item.`)}for(let[i,o]of r.entries()){let a=new Set;for(let s of o){if(a.has(s)){t[`answerKey.duplicateItem.${i}`]=`Category "${i}" includes duplicate item "${s}". Remove duplicates.`;break}a.add(s)}}if(n==="n-ary"){let i=new Map;for(let[o,a]of r.entries())for(let s of a){let l=i.get(s);l?l.push(o):i.set(s,[o])}for(let o of e.rows){let a=i.get(o)??[];if(a.length===0){t[`nary.unassigned.${o}`]=`Item "${o}" is not assigned to any category. In n-ary tables, every item must belong to exactly one category.`;continue}a.length>1&&(t[`nary.multiCategory.${o}`]=`Item "${o}" appears in multiple categories (${a.join(", ")}). In n-ary tables, items must belong to exactly one category.`)}}return Object.keys(t).length>0?{ok:!1,errors:t}:{ok:!0}}function pl(e){let n={};if(e.rows.length===0&&(n["rows.empty"]="No rows found. Expected at least one category."),e.cols.length===0&&(n["cols.empty"]="No columns found. Expected at least one category."),e.rows.length!==e.cols.length)n["symmetry.lengthMismatch"]=`Rows (${e.rows.length}) and columns (${e.cols.length}) must have the same length for adjacency tables.`;else{let t=new Set(e.rows),r=new Set(e.cols);for(let i of e.rows)r.has(i)||(n[`symmetry.rowNotInCols.${i}`]=`Row "${i}" does not appear in columns. Adjacency tables must be symmetric.`);for(let i of e.cols)t.has(i)||(n[`symmetry.colNotInRows.${i}`]=`Column "${i}" does not appear in rows. Adjacency tables must be symmetric.`)}for(let t of e.rows){if(!e.answerKey[t]){n[`answerKey.missingRow.${t}`]=`Row "${t}" has no entry in answer key.`;continue}for(let r of e.cols)if(t===r){let i=e.answerKey[t][r];i!=null&&(n[`answerKey.diagonalValue.${t}`]=`Diagonal cell (${t}, ${t}) should be empty, but has value "${i}".`)}else e.answerKey[t][r]===void 0&&(n[`answerKey.missingCell.${t}.${r}`]=`Missing value at cell (${t}, ${r}). All non-diagonal cells must have values.`)}return Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0}}function hl(e){let n={};e.cols.length===0&&(n["cols.empty"]="No columns found. Expected at least one column in header line."),e.rows.length===0&&(n["rows.empty"]="No rows found. Expected at least one data row.");let t=new Set(e.cols);for(let r of e.rows)t.has(r)&&(n[`naming.rowColConflict.${r}`]=`Row name "${r}" is also a column name. This creates ambiguity and should be avoided.`);for(let r of e.rows){if(!e.answerKey[r]){n[`answerKey.missingRow.${r}`]=`Row "${r}" has no entry in answer key.`;continue}for(let i of e.cols)e.answerKey[r][i]===void 0&&(n[`answerKey.missingCell.${r}.${i}`]=`Missing value at cell (${r}, ${i}). Cells must have values or be marked as disabled with '-'.`)}return Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0}}function Se(e){let n=[];for(let t of Object.values(e))for(let r of Object.values(t))r!==null&&n.push(r);return n}function Ke(e){let n=Se(e);return Array.from(new Set(n))}function We(e){let n=new Set(e.filter(t=>t!==null));return e.every(t=>t===null||typeof t=="number")?"number":n.size>0&&n.size<=10?"select":"text"}function Te(e,n){return e===null||n===null?!1:typeof e=="number"&&typeof n=="number"?Math.abs(e-n)<1e-4:String(e).trim()===String(n).trim()}function Nr(e,n,t){let r=0,i=t.length;for(let a of t){let s=n[a]?.selectedCols??[],l=null;for(let[c,d]of e.entries())if(d.includes(a)){l=c;break}s.length===1&&s[0]===l&&r++}return{score:i>0?Math.round(r/i*100):0,correct:r,total:i}}function Gr(e,n,t,r){let i=0,o=0;for(let s of t)for(let l of r){let c=e[s]?.[l];if(c===null)continue;let d=n[s]?.values[l];o++,Te(c,d)&&i++}return{score:o>0?Math.round(i/o*100):0,correct:i,total:o}}function Or(e,n,t,r){let i=0,o=0;for(let s of t){let l=new Set(n[s]?.selectedCols??[]),c=new Set;for(let[d,u]of e.entries())u.includes(s)&&c.add(d);for(let d of r){let u=c.has(d),p=l.has(d);u===p&&i++,o++}}return{score:o>0?Math.round(i/o*100):0,correct:i,total:o}}function Vr(e,n,t){let r=0,i=0;for(let a of t)for(let s of t){if(a===s)continue;let l=e[a]?.[s],c=n[a]?.values[s];i++,Te(l,c)&&r++}return{score:i>0?Math.round(r/i*100):0,correct:r,total:i}}function Fr(e,n,t){let r={};for(let i of t){r[i]={};for(let o of t){if(i===o)continue;let a=e[i]?.[o],s=n[i]?.values[o];s==null||s===""?r[i][o]="missed":Te(a,s)?r[i][o]="correct":r[i][o]="wrong"}}return r}function jr(e,n,t,r){let i={};for(let o of t){i[o]={};for(let a of r){let s=e[o]?.[a];if(s===null)continue;let l=n[o]?.values[a];l==null||l===""?i[o][a]="missed":Te(s,l)?i[o][a]="correct":i[o][a]="wrong"}}return i}function Ur(e,n,t,r){let i={};for(let o of t){i[o]={};let a=new Set(n[o]?.selectedCols??[]),s=new Set;for(let[l,c]of e.entries())c.includes(o)&&s.add(l);for(let l of r){let c=s.has(l),d=a.has(l);c===d?i[o][l]="correct":!d&&c?i[o][l]="missed":i[o][l]="wrong"}}return i}function Yr(e,n,t){let r={};for(let i of t){r[i]={};let o=n[i]?.selectedCols??[],a=null;for(let[s,l]of e.entries())if(l.includes(i)){a=s;break}if(o.length===1){let s=o[0];s===a?r[i][s]="correct":r[i][s]="wrong"}else o.length===0&&a&&(r[i][a]="missed")}return r}var Kr=`/* ===========================================
1907
1907
  BASE TABLE STYLES
1908
1908
  =========================================== */
1909
1909
 
@@ -2446,19 +2446,19 @@ input[type="radio"] {
2446
2446
  min-width: clamp(48px, 10cqw, 60px);
2447
2447
  }
2448
2448
  }
2449
- `;function re(e){return E(e)}var We=class extends HTMLElement{constructor(){super();this._state={};this._mounted=!1;this.onChange=t=>{let r=t.target,i=r.getAttribute?.("data-r"),o=r.getAttribute?.("data-c");if(!i||!o||!this._config)return;let a=this._config.cellKind,s=null;r instanceof HTMLInputElement&&(a==="checkbox"||a==="radio"?s=r.checked:a==="text"?s=r.value:a==="number"&&(s=r.value===""?null:Number(r.value))),r instanceof HTMLSelectElement&&(s=r.value===""?null:r.value),this.applyCellValue(i,o,s),this.emitChange(i,o,s)};this.onInput=t=>{};this.attachShadow({mode:"open"});let t=document.createElement("section");t.className="wrap",this.shadowRoot.append(t),this.$wrapEl=t}static get observedAttributes(){return["variant"]}connectedCallback(){this._mounted=!0,this.shadowRoot?.addEventListener("change",this.onChange),this.shadowRoot?.addEventListener("input",this.onInput),this.render()}disconnectedCallback(){this._mounted=!1}set config(t){this._config=t,this._state=this.initState(t),t.variant&&this.setAttribute("variant",t.variant),this.render()}get config(){if(!this._config)throw new Error("<edu-table>: spec not set");return this._config}get value(){return this._state}set value(t){this._state=t,this.render()}getValue(){return this._state}setValue(t){this._state=t,this.render()}getState(){let t=this._config;if(!t)return{};let r={};for(let i of t.rows){let o=this._state[i]??{},a=[];for(let s of t.cols){let l=o[s]??null;(t.cellKind==="checkbox"||t.cellKind==="radio")&&l===!0&&a.push(s)}r[i]={selectedCols:a,values:{...o}}}return r}attributeChangedCallback(t,r,i){r!==i&&t==="variant"&&(this.setAttribute("variant",i),this.$wrapEl.querySelectorAll("edu-input").forEach(o=>{o.setAttribute("variant",i)}))}initState(t){let r={};for(let i of t.rows){r[i]={};for(let o of t.cols)switch(t.cellKind){case"checkbox":case"radio":r[i][o]=!1;break;case"select":case"text":case"number":r[i][o]=null;break}}return r}render(){if(!this._mounted||!this.shadowRoot)return;if(!this._config){this.$wrapEl.innerHTML="<style>:host{display:block}</style><div></div>";return}let t=this._config,r=t.shuffle?S(t.cols):t.cols,i=`
2449
+ `;function ie(e){return C(e)}var Qe=class extends HTMLElement{constructor(){super();this._state={};this._mounted=!1;this.onChange=t=>{let r=t.target,i=r.getAttribute?.("data-r"),o=r.getAttribute?.("data-c");if(!i||!o||!this._config)return;let a=this._config.cellKind,s=null;r instanceof HTMLInputElement&&(a==="checkbox"||a==="radio"?s=r.checked:a==="text"?s=r.value:a==="number"&&(s=r.value===""?null:Number(r.value))),r instanceof HTMLSelectElement&&(s=r.value===""?null:r.value),this.applyCellValue(i,o,s),this.emitChange(i,o,s)};this.onInput=t=>{};this.attachShadow({mode:"open"});let t=document.createElement("section");t.className="wrap",this.shadowRoot.append(t),this.$wrapEl=t}static get observedAttributes(){return["variant"]}connectedCallback(){this._mounted=!0,this.shadowRoot?.addEventListener("change",this.onChange),this.shadowRoot?.addEventListener("input",this.onInput),this.render()}disconnectedCallback(){this._mounted=!1}set config(t){this._config=t,this._state=this.initState(t),t.variant&&this.setAttribute("variant",t.variant),this.render()}get config(){if(!this._config)throw new Error("<edu-table>: spec not set");return this._config}get value(){return this._state}set value(t){this._state=t,this.render()}getValue(){return this._state}setValue(t){this._state=t,this.render()}getState(){let t=this._config;if(!t)return{};let r={};for(let i of t.rows){let o=this._state[i]??{},a=[];for(let s of t.cols){let l=o[s]??null;(t.cellKind==="checkbox"||t.cellKind==="radio")&&l===!0&&a.push(s)}r[i]={selectedCols:a,values:{...o}}}return r}attributeChangedCallback(t,r,i){r!==i&&t==="variant"&&(this.setAttribute("variant",i),this.$wrapEl.querySelectorAll("edu-input").forEach(o=>{o.setAttribute("variant",i)}))}initState(t){let r={};for(let i of t.rows){r[i]={};for(let o of t.cols)switch(t.cellKind){case"checkbox":case"radio":r[i][o]=!1;break;case"select":case"text":case"number":r[i][o]=null;break}}return r}render(){if(!this._mounted||!this.shadowRoot)return;if(!this._config){this.$wrapEl.innerHTML="<style>:host{display:block}</style><div></div>";return}let t=this._config,r=t.shuffle?T(t.cols):t.cols,i=`
2450
2450
  <tr>
2451
2451
  <th></th>
2452
- ${r.map(s=>`<th scope="col">${E(s)}</th>`).join("")}
2452
+ ${r.map(s=>`<th scope="col">${C(s)}</th>`).join("")}
2453
2453
  </tr>
2454
- `,a=(t.shuffle?S(t.rows):t.rows).map(s=>{let l=r.map(c=>this.renderCell(t,s,c)).join("");return`<tr><th scope="row">${E(s)}</th>${l}</tr>`}).join("");this.$wrapEl.innerHTML=`
2455
- <style>${Fr}</style>
2454
+ `,a=(t.shuffle?T(t.rows):t.rows).map(s=>{let l=r.map(c=>this.renderCell(t,s,c)).join("");return`<tr><th scope="row">${C(s)}</th>${l}</tr>`}).join("");this.$wrapEl.innerHTML=`
2455
+ <style>${Kr}</style>
2456
2456
  <table part="table">
2457
2457
  <thead>${i}</thead>
2458
2458
  <tbody>${a}</tbody>
2459
2459
  </table>
2460
- `}renderCell(t,r,i){if(t.disabled?.(r,i)??!1)return'<td aria-disabled="true" class="disabled-cell"></td>';let a=`cell-${P(r)}-${P(i)}`,s=this._state[r]?.[i]??null,l=t.gradingState?.[r]?.[i],c=l?`cell-${l}`:"",d=p=>`<td class="${c}">${p}</td>`,u=`id="${a}" data-r="${re(r)}" data-c="${re(i)}"
2461
- aria-label="${re(`${r} / ${i}`)}" variant="${this.getAttribute("variant")}" `;switch(t.cellKind){case"checkbox":return d(`<input ${u} type="checkbox" ${s===!0?"checked":""}/>`);case"radio":{let p=s===!0?"checked":"";return d(`<input ${u} type="radio" name="row-${P(r)}" ${p}/>`)}case"text":{let p=s==null?"":String(s);return d(`<edu-input ${u} type="text" value="${re(p)}"/>`)}case"number":{let p=s==null?"":String(s);return d(`<edu-input ${u} type="number" value="${re(p)}"/>`)}case"select":{let p=t.allowed?.(r,i)??[],h=s==null?"":String(s),g=['<option value=""></option>',...p.map(m=>{let b=String(m),w=b===h?"selected":"";return`<option value="${re(b)}" ${w}>${E(b)}</option>`})].join("");return d(`<edu-input as="select" ${u}>${g}</select>`)}}}reset(){this._config&&(this._state=this.initState(this._config),this.render(),this.dispatchEvent(new CustomEvent("reset",{bubbles:!0,composed:!0})))}setGradingState(t){this._config&&(this._config.gradingState=t,this.render())}clearGradingState(){this._config&&(this._config.gradingState=void 0,this.render())}applyCellValue(t,r,i){let o=this._config;if(o&&!o.disabled?.(t,r)){if(o.cellKind==="select"){let a=o.allowed?.(t,r);if(a&&i!==null&&!a.some(s=>String(s)===String(i)))return}if(this._state[t]??={},this._config.cellKind==="radio"&&i===!0){for(let a of this._config.cols)this._state[t][a]=!1;this._state[t][r]=!0;return}this._state[t][r]=i}}emitChange(t,r,i){let o={row:t,col:r,value:i,state:this.getValue(),selection:this.getState()};this.dispatchEvent(new CustomEvent("change",{detail:o,bubbles:!0,composed:!0}))}};customElements.get("edu-table")||customElements.define("edu-table",We);var Te=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";let i=ke(t.answerKey),o=Ke(i);this._tableConfig={rows:t.rows,cols:t.cols,answerKey:t.answerKey,cellKind:o,preset:"lookup",disabled:(s,l)=>t.answerKey[s]?.[l]===null,allowed:o==="select"?()=>Ye(t.answerKey):void 0,variant:r.variant??"outline",shuffle:r.shuffle??!1};let a=0;for(let s of t.rows)for(let l of t.cols)t.answerKey[s]?.[l]!==null&&a++;this.initializeProgress(a)}initialize(){}cleanup(){}onVariantChange(t){this._tableConfig.variant=t,this._$table&&this._$table.setAttribute("variant",t)}render(){this._tableConfig.variant=this.config.variant,this._$table=document.createElement("edu-table"),this._$table.config=this._tableConfig,this._$table.addEventListener("change",()=>{this.updateProgressBasedOnCompletion(),this.emitStateChange()}),this.innerHTML=`
2460
+ `}renderCell(t,r,i){if(t.disabled?.(r,i)??!1)return'<td aria-disabled="true" class="disabled-cell"></td>';let a=`cell-${P(r)}-${P(i)}`,s=this._state[r]?.[i]??null,l=t.gradingState?.[r]?.[i],c=l?`cell-${l}`:"",d=p=>`<td class="${c}">${p}</td>`,u=`id="${a}" data-r="${ie(r)}" data-c="${ie(i)}"
2461
+ aria-label="${ie(`${r} / ${i}`)}" variant="${this.getAttribute("variant")}" `;switch(t.cellKind){case"checkbox":return d(`<input ${u} type="checkbox" ${s===!0?"checked":""}/>`);case"radio":{let p=s===!0?"checked":"";return d(`<input ${u} type="radio" name="row-${P(r)}" ${p}/>`)}case"text":{let p=s==null?"":String(s);return d(`<edu-input ${u} type="text" value="${ie(p)}"/>`)}case"number":{let p=s==null?"":String(s);return d(`<edu-input ${u} type="number" value="${ie(p)}"/>`)}case"select":{let p=t.allowed?.(r,i)??[],h=s==null?"":String(s),g=['<option value=""></option>',...p.map(m=>{let b=String(m),w=b===h?"selected":"";return`<option value="${ie(b)}" ${w}>${C(b)}</option>`})].join("");return d(`<edu-input as="select" ${u}>${g}</select>`)}}}reset(){this._config&&(this._state=this.initState(this._config),this.render(),this.dispatchEvent(new CustomEvent("reset",{bubbles:!0,composed:!0})))}setGradingState(t){this._config&&(this._config.gradingState=t,this.render())}clearGradingState(){this._config&&(this._config.gradingState=void 0,this.render())}applyCellValue(t,r,i){let o=this._config;if(o&&!o.disabled?.(t,r)){if(o.cellKind==="select"){let a=o.allowed?.(t,r);if(a&&i!==null&&!a.some(s=>String(s)===String(i)))return}if(this._state[t]??={},this._config.cellKind==="radio"&&i===!0){for(let a of this._config.cols)this._state[t][a]=!1;this._state[t][r]=!0;return}this._state[t][r]=i}}emitChange(t,r,i){let o={row:t,col:r,value:i,state:this.getValue(),selection:this.getState()};this.dispatchEvent(new CustomEvent("change",{detail:o,bubbles:!0,composed:!0}))}};customElements.get("edu-table")||customElements.define("edu-table",Qe);var $e=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";let i=Se(t.answerKey),o=We(i);this._tableConfig={rows:t.rows,cols:t.cols,answerKey:t.answerKey,cellKind:o,preset:"lookup",disabled:(s,l)=>t.answerKey[s]?.[l]===null,allowed:o==="select"?()=>Ke(t.answerKey):void 0,variant:r.variant??"outline",shuffle:r.shuffle??!1};let a=0;for(let s of t.rows)for(let l of t.cols)t.answerKey[s]?.[l]!==null&&a++;this.initializeProgress(a)}initialize(){}cleanup(){}onVariantChange(t){this._tableConfig.variant=t,this._$table&&this._$table.setAttribute("variant",t)}render(){this._tableConfig.variant=this.config.variant,this._$table=document.createElement("edu-table"),this._$table.config=this._tableConfig,this._$table.addEventListener("change",()=>{this.updateProgressBasedOnCompletion(),this.emitStateChange()}),this.innerHTML=`
2462
2462
  <style>
2463
2463
  :host {
2464
2464
  display: flex;
@@ -2487,7 +2487,7 @@ input[type="radio"] {
2487
2487
  <div class="table-container">
2488
2488
  <div class="table-wrapper"></div>
2489
2489
  </div>
2490
- `,this.querySelector(".table-wrapper").appendChild(this._$table)}updateProgressBasedOnCompletion(){let t=this._$table.getState(),r=0;for(let i of this.data.rows)for(let o of this.data.cols){if(this.data.answerKey[i]?.[o]===null)continue;let a=t[i]?.values[o];a!=null&&a!==""&&r++}this.setProgress(r)}getCurrentState(){return this._$table.getState()}isInteractionComplete(){let t=this._$table.getState();for(let r of this.data.rows)for(let i of this.data.cols){if(this.data.answerKey[r]?.[i]===null)continue;let o=t[r]?.values[i];if(o==null||o==="")return!1}return!0}onHint(){let t=this._$table.getState();for(let r of this.data.rows)for(let i of this.data.cols){if(this.data.answerKey[r]?.[i]===null)continue;let o=t[r]?.values[i];if(o==null||o===""){alert(`Hint: You haven't filled the cell for "${r}" / "${i}" yet.`),this.emitHintShown(`Empty cell: ${r} / ${i}`);return}}alert('All cells are complete! Click "Check" to submit.'),this.emitHintShown("All cells complete")}submit(){super.submit();let t=this.getCurrentState(),r=qr(this.data.answerKey,t,this.data.rows,this.data.cols),i=Nr(this.data.answerKey,t,this.data.rows,this.data.cols);this._$table.setGradingState(i),console.log(`Lookup Table Score: ${r.score.toFixed(1)}% (${r.correct}/${r.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:r},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$table&&(this._$table.reset(),this._$table.clearGradingState())}};customElements.get("lookup-table")||customElements.define("lookup-table",Te);var $e=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._tableConfig={rows:t.rows,cols:t.cols,answerKey:t.answerKey,cellKind:"checkbox",preset:"classification",variant:r.variant??"outline",shuffle:r.shuffle},this.initializeProgress(t.rows.length)}initialize(){}cleanup(){}onVariantChange(t){this._tableConfig.variant=t,this._$table&&this._$table.setAttribute("variant",t)}render(){this._tableConfig.variant=this.config.variant,this._$table=document.createElement("edu-table"),this._$table.config=this._tableConfig,this._$table.addEventListener("change",()=>{this.updateProgressBasedOnCompletion(),this.emitStateChange()}),this.innerHTML="",this.appendChild(this._$table)}updateProgressBasedOnCompletion(){let t=this._$table.getState(),r=0;for(let i of this.data.rows)t[i]?.selectedCols.length>0&&r++;this.setProgress(r)}getCurrentState(){return this._$table.getState()}isInteractionComplete(){let t=this._$table.getState();return this.data.rows.every(r=>t[r]?.selectedCols.length>0)}onHint(){let t=this._$table.getState(),r=this.data.rows.filter(o=>!t[o]||t[o].selectedCols.length===0);if(r.length===0){alert('All rows are complete! Click "Check" to submit.'),this.emitHintShown("All rows complete");return}let i=r[0];alert(`Hint: You haven't classified "${i}" yet. Which categories does it belong to?`),this.emitHintShown(`Incomplete row: ${i}`)}submit(){super.submit();let t=this.getCurrentState(),r=zr(this.data.answerKey,t,this.data.rows,this.data.cols),i=Or(this.data.answerKey,t,this.data.rows,this.data.cols);this._$table.setGradingState(i),console.log(`Classification Score: ${r.score.toFixed(1)}% (${r.correct}/${r.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:r},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$table&&(this._$table.reset(),this._$table.clearGradingState())}};customElements.get("classification-matrix")||customElements.define("classification-matrix",$e);var Ae=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._tableConfig={rows:t.rows,cols:t.cols,answerKey:t.answerKey,cellKind:"radio",preset:"n-ary",variant:r.variant??"outline",shuffle:!0},this.initializeProgress(t.rows.length)}initialize(){}cleanup(){}onVariantChange(t){this._tableConfig.variant=t,this._$table&&this._$table.setAttribute("variant",t)}render(){this._tableConfig.variant=this.config.variant,this._$table=document.createElement("edu-table"),this._$table.config=this._tableConfig,this._$table.addEventListener("change",()=>{this.updateProgressBasedOnCompletion(),this.emitStateChange()}),this.innerHTML=`
2490
+ `,this.querySelector(".table-wrapper").appendChild(this._$table)}updateProgressBasedOnCompletion(){let t=this._$table.getState(),r=0;for(let i of this.data.rows)for(let o of this.data.cols){if(this.data.answerKey[i]?.[o]===null)continue;let a=t[i]?.values[o];a!=null&&a!==""&&r++}this.setProgress(r)}getCurrentState(){return this._$table.getState()}isInteractionComplete(){let t=this._$table.getState();for(let r of this.data.rows)for(let i of this.data.cols){if(this.data.answerKey[r]?.[i]===null)continue;let o=t[r]?.values[i];if(o==null||o==="")return!1}return!0}onHint(){let t=this._$table.getState();for(let r of this.data.rows)for(let i of this.data.cols){if(this.data.answerKey[r]?.[i]===null)continue;let o=t[r]?.values[i];if(o==null||o===""){alert(`Hint: You haven't filled the cell for "${r}" / "${i}" yet.`),this.emitHintShown(`Empty cell: ${r} / ${i}`);return}}alert('All cells are complete! Click "Check" to submit.'),this.emitHintShown("All cells complete")}submit(){super.submit();let t=this.getCurrentState(),r=Gr(this.data.answerKey,t,this.data.rows,this.data.cols),i=jr(this.data.answerKey,t,this.data.rows,this.data.cols);this._$table.setGradingState(i),console.log(`Lookup Table Score: ${r.score.toFixed(1)}% (${r.correct}/${r.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:r},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$table&&(this._$table.reset(),this._$table.clearGradingState())}};customElements.get("lookup-table")||customElements.define("lookup-table",$e);var Ae=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._tableConfig={rows:t.rows,cols:t.cols,answerKey:t.answerKey,cellKind:"checkbox",preset:"classification",variant:r.variant??"outline",shuffle:r.shuffle},this.initializeProgress(t.rows.length)}initialize(){}cleanup(){}onVariantChange(t){this._tableConfig.variant=t,this._$table&&this._$table.setAttribute("variant",t)}render(){this._tableConfig.variant=this.config.variant,this._$table=document.createElement("edu-table"),this._$table.config=this._tableConfig,this._$table.addEventListener("change",()=>{this.updateProgressBasedOnCompletion(),this.emitStateChange()}),this.innerHTML="",this.appendChild(this._$table)}updateProgressBasedOnCompletion(){let t=this._$table.getState(),r=0;for(let i of this.data.rows)t[i]?.selectedCols.length>0&&r++;this.setProgress(r)}getCurrentState(){return this._$table.getState()}isInteractionComplete(){let t=this._$table.getState();return this.data.rows.every(r=>t[r]?.selectedCols.length>0)}onHint(){let t=this._$table.getState(),r=this.data.rows.filter(o=>!t[o]||t[o].selectedCols.length===0);if(r.length===0){alert('All rows are complete! Click "Check" to submit.'),this.emitHintShown("All rows complete");return}let i=r[0];alert(`Hint: You haven't classified "${i}" yet. Which categories does it belong to?`),this.emitHintShown(`Incomplete row: ${i}`)}submit(){super.submit();let t=this.getCurrentState(),r=Or(this.data.answerKey,t,this.data.rows,this.data.cols),i=Ur(this.data.answerKey,t,this.data.rows,this.data.cols);this._$table.setGradingState(i),console.log(`Classification Score: ${r.score.toFixed(1)}% (${r.correct}/${r.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:r},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$table&&(this._$table.reset(),this._$table.clearGradingState())}};customElements.get("classification-matrix")||customElements.define("classification-matrix",Ae);var _e=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._tableConfig={rows:t.rows,cols:t.cols,answerKey:t.answerKey,cellKind:"radio",preset:"n-ary",variant:r.variant??"outline",shuffle:!0},this.initializeProgress(t.rows.length)}initialize(){}cleanup(){}onVariantChange(t){this._tableConfig.variant=t,this._$table&&this._$table.setAttribute("variant",t)}render(){this._tableConfig.variant=this.config.variant,this._$table=document.createElement("edu-table"),this._$table.config=this._tableConfig,this._$table.addEventListener("change",()=>{this.updateProgressBasedOnCompletion(),this.emitStateChange()}),this.innerHTML=`
2491
2491
  <style>
2492
2492
  nary-choice-table {
2493
2493
  display: flex;
@@ -2516,7 +2516,7 @@ input[type="radio"] {
2516
2516
  <div class="table-container">
2517
2517
  <div class="table-wrapper"></div>
2518
2518
  </div>
2519
- `,this.querySelector(".table-wrapper").appendChild(this._$table)}updateProgressBasedOnCompletion(){let t=this._$table.getState(),r=0;for(let i of this.data.rows)t[i]?.selectedCols.length===1&&r++;this.setProgress(r)}getCurrentState(){return this._$table.getState()}isInteractionComplete(){let t=this._$table.getState();return this.data.rows.every(r=>t[r]?.selectedCols.length===1)}onHint(){let t=this._$table.getState(),r=this.data.rows.filter(o=>!t[o]||t[o].selectedCols.length!==1);if(r.length===0){alert('All rows are complete! Click "Check" to submit.'),this.emitHintShown("All rows complete");return}let i=r[0];alert(`Hint: You haven't selected a category for "${i}" yet. Which one does it belong to?`),this.emitHintShown(`Incomplete row: ${i}`)}submit(){super.submit();let t=this.getCurrentState(),r=Br(this.data.answerKey,t,this.data.rows),i=Vr(this.data.answerKey,t,this.data.rows);this._$table.setGradingState(i),console.log(`N-ary Choice Score: ${r.score.toFixed(1)}% (${r.correct}/${r.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:r},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$table&&(this._$table.reset(),this._$table.clearGradingState())}};customElements.get("nary-choice-table")||customElements.define("nary-choice-table",Ae);var _e=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";let i=ke(t.answerKey),o=Ke(i);this._tableConfig={rows:t.rows,cols:t.cols,answerKey:t.answerKey,cellKind:o,preset:"adjacency",disabled:(s,l)=>s===l,allowed:o==="select"?()=>Ye(t.answerKey):void 0,variant:r.variant??"outline",shuffle:r.shuffle??!1};let a=t.rows.length*(t.rows.length-1);this.initializeProgress(a)}initialize(){}cleanup(){}onVariantChange(t){this._tableConfig.variant=t,this._$table&&this._$table.setAttribute("variant",t)}render(){this._tableConfig.variant=this.config.variant,this._$table=document.createElement("edu-table"),this._$table.config=this._tableConfig,this._$table.addEventListener("change",()=>{this.updateProgressBasedOnCompletion(),this.emitStateChange()}),this.innerHTML=`
2519
+ `,this.querySelector(".table-wrapper").appendChild(this._$table)}updateProgressBasedOnCompletion(){let t=this._$table.getState(),r=0;for(let i of this.data.rows)t[i]?.selectedCols.length===1&&r++;this.setProgress(r)}getCurrentState(){return this._$table.getState()}isInteractionComplete(){let t=this._$table.getState();return this.data.rows.every(r=>t[r]?.selectedCols.length===1)}onHint(){let t=this._$table.getState(),r=this.data.rows.filter(o=>!t[o]||t[o].selectedCols.length!==1);if(r.length===0){alert('All rows are complete! Click "Check" to submit.'),this.emitHintShown("All rows complete");return}let i=r[0];alert(`Hint: You haven't selected a category for "${i}" yet. Which one does it belong to?`),this.emitHintShown(`Incomplete row: ${i}`)}submit(){super.submit();let t=this.getCurrentState(),r=Nr(this.data.answerKey,t,this.data.rows),i=Yr(this.data.answerKey,t,this.data.rows);this._$table.setGradingState(i),console.log(`N-ary Choice Score: ${r.score.toFixed(1)}% (${r.correct}/${r.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:r},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$table&&(this._$table.reset(),this._$table.clearGradingState())}};customElements.get("nary-choice-table")||customElements.define("nary-choice-table",_e);var Ie=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";let i=Se(t.answerKey),o=We(i);this._tableConfig={rows:t.rows,cols:t.cols,answerKey:t.answerKey,cellKind:o,preset:"adjacency",disabled:(s,l)=>s===l,allowed:o==="select"?()=>Ke(t.answerKey):void 0,variant:r.variant??"outline",shuffle:r.shuffle??!1};let a=t.rows.length*(t.rows.length-1);this.initializeProgress(a)}initialize(){}cleanup(){}onVariantChange(t){this._tableConfig.variant=t,this._$table&&this._$table.setAttribute("variant",t)}render(){this._tableConfig.variant=this.config.variant,this._$table=document.createElement("edu-table"),this._$table.config=this._tableConfig,this._$table.addEventListener("change",()=>{this.updateProgressBasedOnCompletion(),this.emitStateChange()}),this.innerHTML=`
2520
2520
  <style>
2521
2521
  :host {
2522
2522
  display: flex;
@@ -2545,10 +2545,10 @@ input[type="radio"] {
2545
2545
  <div class="table-container">
2546
2546
  <div class="table-wrapper"></div>
2547
2547
  </div>
2548
- `,this.querySelector(".table-wrapper").appendChild(this._$table)}updateProgressBasedOnCompletion(){let t=this._$table.getState(),r=0;for(let i of this.data.rows)for(let o of this.data.cols){if(i===o)continue;let a=t[i]?.values[o];a!=null&&a!==""&&r++}this.setProgress(r)}getCurrentState(){return this._$table.getState()}isInteractionComplete(){let t=this._$table.getState();for(let r of this.data.rows)for(let i of this.data.cols){if(r===i)continue;let o=t[r]?.values[i];if(o==null||o==="")return!1}return!0}onHint(){let t=this._$table.getState();for(let r of this.data.rows)for(let i of this.data.cols){if(r===i)continue;let o=t[r]?.values[i];if(o==null||o===""){alert(`Hint: You haven't filled the cell for "${r}" \u2192 "${i}" yet.`),this.emitHintShown(`Empty cell: ${r} \u2192 ${i}`);return}}alert('All cells are complete! Click "Check" to submit.'),this.emitHintShown("All cells complete")}submit(){super.submit();let t=this.getCurrentState(),r=Hr(this.data.answerKey,t,this.data.rows),i=Gr(this.data.answerKey,t,this.data.rows);this._$table.setGradingState(i),console.log(`Adjacency Table Score: ${r.score.toFixed(1)}% (${r.correct}/${r.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:r},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$table&&(this._$table.reset(),this._$table.clearGradingState())}};customElements.get("adjacency-table")||customElements.define("adjacency-table",_e);var Zo=/\[([^\]]+)\]/g,Xo=/^\s*(-?\d+)\s*(\.\.)\s*(-?\d+)\s*$/,Jo=/^\d{4}\/(0[1-9]|1[0-2])\/(0[1-9]|[12]\d|3[01])$/,ea=/^([01]\d|2[0-3]):[0-5]\d$/,jr=e=>{let n=Y(e);if(n.length===0||n.some(o=>!o))return{ok:!1,data:null,errors:{"@tx":"provide at least one non-empty answer."}};let t=J(n),r=`text-${P(e)}`,i=`<edu-input type="text" id="${r}" variant="outline" autocomplete="off"></edu-input>`;return{ok:!0,data:{type:"text",id:r,value:t,html:i},errors:null}},Ur=e=>{let t=[...e.matchAll(Zo)].flatMap(c=>Y(c[1])),r=e.replace(/\[|\]/g,""),i=[" ",...S(J(Y(r)))];if(i.length===0)return{ok:!1,data:null,errors:{"@sl":"provide at least one option for the select."}};if(t.length===0)return{ok:!1,data:null,errors:{"@sl":"Mark at least one correct option inside of square brackets."}};let o=[...i],a=`select-${P(e)}-${Math.random().toString(36).slice(2)}`,s=o.map(c=>`<option>${c}</option>`).join(""),l=`<edu-input as="select" id="${a}" variant="outline">${s}</edu-input>`;return{ok:!0,data:{type:"select",id:a,correctOptions:t,options:i,html:l},errors:null}},Yr=e=>{let n=Y(e);if(n.length===0||n.some(a=>!a.trim()))return{ok:!1,data:null,errors:{"@nm":"provide at least one non-empty option."}};let t=[],r=[];for(let a of n){let s=a.match(Xo);if(s){let l=parseInt(s[1],10),c=parseInt(s[3],10);if(Number.isNaN(l)||Number.isNaN(c)||l>c)return{ok:!1,data:null,errors:{"@nm":"Invalid range ${t}"}};r.push({from:l,to:c})}else{let l=Number(a.trim());if(!Number.isInteger(l))return{ok:!1,data:null,errors:{"@nm":"${t} is not an integer."}};t.push(l)}}let i=`number-${P(e)}-${Math.random().toString(36).slice(2)}`,o=`<edu-input type="number" variant="outline" id="${i}"></edu-input>`;return{ok:!0,data:{type:"number",id:i,targets:J(t),ranges:r,html:o},errors:null}},Kr=e=>{let n=Y(e);if(n.length===0||n.some(a=>!a.trim()))return{ok:!1,data:null,errors:{"@dt":"provide at least one non-empty date option."}};let t=[];for(let a of n){let s=a.trim();if(!Jo.test(s))return{ok:!1,data:null,errors:{"@dt":`"${s}" is not a valid date. Expected format: YYYY/MM/DD`}};t.push(s)}let r=J(t),i=`date-${P(e)}`,o=`<edu-input type="date" id="${i}" variant="outline"></edu-input>`;return{ok:!0,data:{type:"date",id:i,value:r[0],html:o},errors:null}},Wr=e=>{let n=Y(e);if(n.length===0||n.some(a=>!a.trim()))return{ok:!1,data:null,errors:{"@tm":"provide at least one non-empty time option."}};let t=[];for(let a of n){let s=a.trim();if(!ea.test(s))return{ok:!1,data:null,errors:{"@tm":`"${s}" is not a valid time. Expected format: HH:MM (24-hour)`}};t.push(s)}let r=J(t),i=`time-${P(e)}`,o=`<edu-input type="time" id="${i}" variant="outline"></edu-input>`;return{ok:!0,data:{type:"time",id:i,value:r[0],html:o},errors:null}};function Qr(e){return e.trim().split(";;")}var Zr=["tx","nm","sl","dt","tm"],ta={tx:jr,nm:Yr,sl:Ur,dt:Kr,tm:Wr},Xr=e=>{let n=[],t=[],r={},i,o=/^\s*=\s*\[([^\]]+)\]\s*;/m,a=e.match(o);a&&(i=a[1].split("|").map(h=>h.trim().replace(/^["']|["']$/g,"")).filter(Boolean),e=e.replace(o,""));let s="",l=!1,c=null,d=0;for(;d<e.length;){let p=e[d];if(d+1<e.length&&p==="["&&e[d+1]==="["){s+="[",d+=2;continue}if(p==="["){s.trim().length>0&&(n.push(s.trim()),s=""),l=!0,c={words:[],startPos:n.length,endPos:n.length},d++;continue}if(p==="]"){if(!l){r[`at:${d}`]="Unexpected closing bracket ']' without matching opening bracket.",d++;continue}if(s.trim().length>0){let h=s.trim();c.words.push(h),n.push(h),s=""}c.words.length===0?r[`at:${d}`]="Empty brackets [] are not allowed as targets.":(c.endPos=n.length-1,t.push(c)),c=null,l=!1,d++;continue}if(p===" "||p===`
2549
- `||p===" "||p==="\r"){if(s.trim().length>0){let h=s.trim();l&&c.words.push(h),n.push(h),s=""}d++;continue}s+=p,d++}if(s.trim().length>0){let p=s.trim();l&&(c.words.push(p),c.endPos=n.length,t.push(c)),n.push(p)}l&&(r.unclosed="Unclosed opening bracket '['. Expected ']'.");let u=Object.keys(r).length>0;return{ok:!u,data:{type:"base",parts:n,targets:t,...i&&{distractors:i}},errors:u?r:null}},Jr=e=>{let n={},t=[],r=[],i="",o=0;for(;o<e.length;){let s=e[o];if(o+1<e.length&&s==="@"&&e[o+1]==="@"){i+="@",o+=2;continue}if(s!=="@"){if(s===" "||s===`
2550
- `||s===" "||s==="\r"){i.trim().length>0&&(t.push(i.trim()),i=""),o++;continue}i+=s,o++;continue}i.trim().length>0&&(t.push(i.trim()),i="");let l=o;o++;let c="";for(;o<e.length&&/[a-z]/i.test(e[o]);)c+=e[o++];if(!c||!Zr.includes(c)){n[`at:${l}`]=`Invalid element reference "@${c}". Expected one of: ${Zr.join(", ")}.`;continue}if(o>=e.length||e[o]!=="("){n[`at:${l}`]=`Expected '(' after @${c} at position ${o}.`;continue}o++;let d="",u=!1;for(;o<e.length;){if(e[o]===")"){u=!0,o++;break}d+=e[o++]}if(!u){n[`at:${l}`]=`Unclosed parenthesis for @${c}. Expected ')'.`;continue}let p=ta[c];if(!p){n[`at:${l}`]=`No parser found for @${c}.`;continue}let h=p(d);if(!h.ok){n[`at:${l}`]=h.errors?JSON.stringify(h.errors):`Failed to parse @${c}(${d})`;continue}t.push(h.data.html);let g={id:h.data.id,expectedValue:h.data};r.push(g)}i.trim().length>0&&t.push(i.trim());let a=Object.keys(n).length>0;return{ok:!a,data:{type:"blanks",parts:t,targets:r},errors:a?n:null}},ei=e=>{let n=[],t={},r=new Map,i="",o=0;for(;o<e.length;){let l=e[o];if(o+1<e.length&&l==="@"&&e[o+1]==="@"){i+="@",o+=2;continue}if(l!=="@"){if(l===" "||l===`
2551
- `||l===" "||l==="\r"){i.trim().length>0&&(n.push(i.trim()),i=""),o++;continue}i+=l,o++;continue}i.trim().length>0&&(n.push(i.trim()),i="");let c=o;o++;let d="";for(;o<e.length&&/[a-z]/i.test(e[o]);)d+=e[o++];if(d!=="ct"){t[`at:${c}`]=`Invalid reference "@${d}". Expected "@ct" for classification.`;continue}if(o>=e.length||e[o]!=="("){t[`at:${c}`]=`Expected '(' after @ct at position ${o}.`;continue}o++;let u="",p=!1;for(;o<e.length;){if(e[o]===")"){p=!0,o++;break}u+=e[o++]}if(!p){t[`at:${c}`]="Unclosed parenthesis for @ct. Expected ')'.";continue}let h=u.split(",").map(K=>K.trim());if(h.length!==2){t[`at:${c}`]=`Invalid @ct syntax. Expected: @ct(category, word). Got: @ct(${u})`;continue}let[g,m]=h;if(!g||!m){t[`at:${c}`]=`Category and word cannot be empty in @ct(${u}).`;continue}let b=m.split(/\s+/).filter(Boolean),w=n.length;for(let K of b)n.push(K);let v=n.length-1,q={words:b,startPos:w,endPos:v};r.has(g)||r.set(g,[]),r.get(g).push(q)}i.trim().length>0&&n.push(i.trim());let a=[];for(let[l,c]of r.entries())a.push({category:l,targets:c});let s=Object.keys(t).length>0;return{ok:!s,data:{type:"classification",parts:n,targets:a},errors:s?t:null}},ra={base:Xr,blanks:Jr,classification:ei};function ia(e,n){let t=Qr(e),r=ra[n],i=[],o=[];for(let a of t){let s=r(a);if(!s.ok){s.errors&&(Array.isArray(s.errors)?o.push(...s.errors):o.push(s.errors));continue}i.push(s.data)}return o.length>0?{ok:!1,data:null,errors:o}:{ok:!0,data:i,errors:null}}function ti(e){let n={};if((!e.parts||e.parts.length===0)&&(n["parts.empty"]="No parts found. Text must contain at least one word."),(!e.targets||e.targets.length===0)&&(n["targets.empty"]="No targets found. Text must contain at least one [target] to interact with."),e.targets&&e.targets.length>0&&e.parts&&e.parts.length>0)for(let t=0;t<e.targets.length;t++){let r=e.targets[t],i=`targets[${t}]`;if(!r.words||r.words.length===0){n[`${i}.words.empty`]=`Target ${t} has no words. Each target must contain at least one word.`;continue}if(r.startPos<0&&(n[`${i}.startPos.negative`]=`Target ${t} has negative startPos (${r.startPos}).`),r.endPos<0&&(n[`${i}.endPos.negative`]=`Target ${t} has negative endPos (${r.endPos}).`),r.startPos>r.endPos&&(n[`${i}.position.invalid`]=`Target ${t} has startPos (${r.startPos}) greater than endPos (${r.endPos}).`),r.startPos>=e.parts.length&&(n[`${i}.startPos.outOfBounds`]=`Target ${t} startPos (${r.startPos}) is out of bounds (parts length: ${e.parts.length}).`),r.endPos>=e.parts.length&&(n[`${i}.endPos.outOfBounds`]=`Target ${t} endPos (${r.endPos}) is out of bounds (parts length: ${e.parts.length}).`),r.startPos<e.parts.length&&r.endPos<e.parts.length){let o=r.endPos-r.startPos+1;r.words.length!==o&&(n[`${i}.words.countMismatch`]=`Target ${t} has ${r.words.length} words but position range indicates ${o} words.`);for(let a=0;a<r.words.length;a++){let s=r.startPos+a;if(s<e.parts.length){let l=e.parts[s],c=r.words[a];l!==c&&(n[`${i}.words[${a}].mismatch`]=`Target ${t} word "${c}" doesn't match part at position ${s}: "${l}".`)}}}}if(e.distractors)if(!Array.isArray(e.distractors))n["distractors.notArray"]="Distractors must be an array.";else{e.distractors.length===0&&(n["distractors.empty"]="Distractors array is empty. Remove distractors field or add at least one distractor.");let t=new Set;for(let r=0;r<e.distractors.length;r++){let i=e.distractors[r];t.has(i)&&(n[`distractors[${r}].duplicate`]=`Duplicate distractor found: "${i}".`),t.add(i),(!i||i.trim().length===0)&&(n[`distractors[${r}].empty`]=`Distractor at index ${r} is empty.`)}}return Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0,errors:null}}function ri(e){let n={};(!e.parts||e.parts.length===0)&&(n["parts.empty"]="No parts found. Text must contain at least one part."),(!e.targets||e.targets.length===0)&&(n["targets.empty"]="No targets found. Text must contain at least one input element (@tx, @nm, @sl, @dt, @tm).");let t=new Set;if(e.targets&&e.targets.length>0)for(let r=0;r<e.targets.length;r++){let i=e.targets[r],o=`targets[${r}]`;if(!i.id||i.id.trim().length===0?n[`${o}.id.empty`]=`Target ${r} has no ID. Each input element must have a unique ID.`:(t.has(i.id)&&(n[`${o}.id.duplicate`]=`Duplicate ID found: "${i.id}". Each input element must have a unique ID.`),t.add(i.id)),!i.expectedValue){n[`${o}.expectedValue.missing`]=`Target ${r} has no expectedValue. Each input element must define expected answer data.`;continue}let a=i.expectedValue;a.type||(n[`${o}.expectedValue.type.missing`]=`Target ${r} expectedValue has no type field.`),a.id||(n[`${o}.expectedValue.id.missing`]=`Target ${r} expectedValue has no id field.`),a.html||(n[`${o}.expectedValue.html.missing`]=`Target ${r} expectedValue has no html field.`);let s=a.type;if(s)switch(s){case"text":(!("value"in a)||!Array.isArray(a.value))&&(n[`${o}.expectedValue.text.value`]=`Target ${r} is type 'text' but has no valid 'value' array.`);break;case"number":"targets"in a||(n[`${o}.expectedValue.number.targets`]=`Target ${r} is type 'number' but has no 'targets' field.`);break;case"select":(!("correctOptions"in a)||!("options"in a))&&(n[`${o}.expectedValue.select.options`]=`Target ${r} is type 'select' but is missing 'correctOptions' or 'options' fields.`);break;case"date":case"time":"value"in a||(n[`${o}.expectedValue.${s}.value`]=`Target ${r} is type '${s}' but has no 'value' field.`);break}}return Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0,errors:null}}function ii(e){let n={};(!e.parts||e.parts.length===0)&&(n["parts.empty"]="No parts found. Text must contain at least one word."),(!e.targets||e.targets.length===0)&&(n["targets.empty"]="No categories found. Text must contain at least one @ct(category, word) reference.");let t=new Set;if(e.targets&&e.targets.length>0)for(let r=0;r<e.targets.length;r++){let i=e.targets[r],o=`targets[${r}]`;if(!i.category||i.category.trim().length===0?n[`${o}.category.empty`]=`Category ${r} has no name.`:(t.has(i.category)&&(n[`${o}.category.duplicate`]=`Duplicate category found: "${i.category}". Each category must have a unique name.`),t.add(i.category)),!i.targets||i.targets.length===0){n[`${o}.targets.empty`]=`Category "${i.category}" has no targets. Each category must contain at least one word.`;continue}for(let a=0;a<i.targets.length;a++){let s=i.targets[a],l=`${o}.targets[${a}]`;if(!s.words||s.words.length===0){n[`${l}.words.empty`]=`Category "${i.category}" target ${a} has no words.`;continue}if(s.startPos<0&&(n[`${l}.startPos.negative`]=`Category "${i.category}" target ${a} has negative startPos.`),s.endPos<0&&(n[`${l}.endPos.negative`]=`Category "${i.category}" target ${a} has negative endPos.`),s.startPos>s.endPos&&(n[`${l}.position.invalid`]=`Category "${i.category}" target ${a} has startPos greater than endPos.`),e.parts&&e.parts.length>0&&(s.startPos>=e.parts.length&&(n[`${l}.startPos.outOfBounds`]=`Category "${i.category}" target ${a} startPos is out of bounds.`),s.endPos>=e.parts.length&&(n[`${l}.endPos.outOfBounds`]=`Category "${i.category}" target ${a} endPos is out of bounds.`),s.startPos<e.parts.length&&s.endPos<e.parts.length)){let c=s.endPos-s.startPos+1;s.words.length!==c&&(n[`${l}.words.countMismatch`]=`Category "${i.category}" target ${a} word count mismatch.`)}}}return Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0,errors:null}}function na(e){switch(e.type){case"base":return ti(e);case"blanks":return ri(e);case"classification":return ii(e);default:return{ok:!1,errors:{"type.invalid":`Unknown text engine type: ${e.type}`}}}}function Ie(e,n){let t=new Set(n.selectedIndices??[]),r=new Set;for(let p of e.targets)for(let h=p.startPos;h<=p.endPos;h++)r.add(h);let i=0,o=0,a=0;for(let p=0;p<e.parts.length;p++){let h=r.has(p),g=t.has(p);h&&g?i++:h&&!g?a++:!h&&g&&o++}let s=r.size,l=i+o>0?i/(i+o):0,c=i+a>0?i/(i+a):0,d=l+c>0?2*l*c/(l+c):0;return{score:Math.round(d*100),correct:i,total:s}}function oa(e,n){let t=new Set,r=n.dndPlacements??{};for(let l of e.targets)for(let c=l.startPos;c<=l.endPos;c++)t.add(c);let i=0;if(Object.keys(r).length>0)for(let l of t){let c=e.parts[l],d=r[l];d&&Qe(d)===Qe(c)&&i++}else{let l=new Set(n.placedIndices??[]);for(let c of l)t.has(c)&&i++}let a=t.size;return{score:a>0?Math.round(i/a*100):0,correct:i,total:a}}function aa(e,n){let t={},r=n.dndPlacements??{};for(let i of e.targets)for(let o=i.startPos;o<=i.endPos;o++){let a=e.parts[o],s=r[o];s?Qe(s)===Qe(a)?t[o]="correct":t[o]="wrong":t[o]="missed"}return t}function Me(e,n,t){let r=n.transformations??{},i=0,o=0;for(let s=0;s<e.targets.length;s++){let l=t[s],c=r[s];l&&(o++,c&&l.length===c.length&&l.every((u,p)=>u.toLowerCase().trim()===(c[p]||"").toLowerCase().trim())&&i++)}return{score:o>0?Math.round(i/o*100):0,correct:i,total:o}}function vt(e,n,t){let r=n.transformations??{},i={};for(let o=0;o<e.targets.length;o++){let a=t[o],s=r[o];if(!a){i[o]="missed";continue}if(!s||s.length===0){i[o]="missed";continue}if(a.length===s.length){let l=a.every((c,d)=>c.toLowerCase().trim()===(s[d]||"").toLowerCase().trim());i[o]=l?"correct":"wrong"}else i[o]="wrong"}return i}function Le(e,n){let t=new Set(n.selectedIndices??[]),r=new Set,i={};for(let o of e.targets)for(let a=o.startPos;a<=o.endPos;a++)r.add(a);for(let o=0;o<e.parts.length;o++){let a=r.has(o),s=t.has(o);a&&s?i[o]="correct":a&&!s?i[o]="missed":!a&&s&&(i[o]="wrong")}return i}function De(e,n){let t=0,r=e.targets.length;for(let o of e.targets){let a=n.inputValues[o.id],s=o.expectedValue;ai(s,a)&&t++}return{score:r>0?Math.round(t/r*100):0,correct:t,total:r}}function Re(e,n){let t={};for(let r of e.targets){let i=n.inputValues[r.id],o=r.expectedValue;i==null||i===""?t[r.id]="missed":ai(o,i)?t[r.id]="correct":t[r.id]="wrong"}return t}function ai(e,n){if(n==null||n==="")return!1;switch(e.type){case"text":{let t=String(n).toLowerCase().trim();return e.value.some(r=>r.toLowerCase().trim()===t)}case"number":{let t=Number(n);return isNaN(t)?!1:e.targets.includes(t)?!0:e.ranges?e.ranges.some(r=>t>=r.from&&t<=r.to):!1}case"select":{let t=String(n).trim();return e.correctOptions.some(r=>String(r).trim()===t)}case"date":{let t=ni(String(e.value)),r=ni(String(n));return t.length>0&&t===r}case"time":{let t=oi(String(e.value)),r=oi(String(n));return t.length>0&&t===r}default:return!1}}function Qe(e){return String(e).trim().toLowerCase()}function ni(e){return String(e).trim().replace(/\//g,"-")}function oi(e){let n=String(e).trim(),t=n.match(/^([01]\d|2[0-3]):([0-5]\d)(?::[0-5]\d)?$/);return t?`${t[1]}:${t[2]}`:n}function Pe(e,n){let t=0,r=0,i=new Map;for(let a of e.targets)for(let s of a.targets)for(let l=s.startPos;l<=s.endPos;l++)i.set(l,a.category),r++;for(let[a,s]of Object.entries(n.wordCategories)){let l=Number(a),c=i.get(l);c&&s===c&&t++}return{score:r>0?Math.round(t/r*100):0,correct:t,total:r}}function Be(e,n){let t={},r=new Map;for(let i of e.targets)for(let o of i.targets)for(let a=o.startPos;a<=o.endPos;a++)r.set(a,i.category);for(let[i,o]of r){let a=n.wordCategories[i];a?a===o?t[i]="correct":t[i]="wrong":t[i]="missed"}return t}var si=`/* ==================== BASE STYLES ==================== */
2548
+ `,this.querySelector(".table-wrapper").appendChild(this._$table)}updateProgressBasedOnCompletion(){let t=this._$table.getState(),r=0;for(let i of this.data.rows)for(let o of this.data.cols){if(i===o)continue;let a=t[i]?.values[o];a!=null&&a!==""&&r++}this.setProgress(r)}getCurrentState(){return this._$table.getState()}isInteractionComplete(){let t=this._$table.getState();for(let r of this.data.rows)for(let i of this.data.cols){if(r===i)continue;let o=t[r]?.values[i];if(o==null||o==="")return!1}return!0}onHint(){let t=this._$table.getState();for(let r of this.data.rows)for(let i of this.data.cols){if(r===i)continue;let o=t[r]?.values[i];if(o==null||o===""){alert(`Hint: You haven't filled the cell for "${r}" \u2192 "${i}" yet.`),this.emitHintShown(`Empty cell: ${r} \u2192 ${i}`);return}}alert('All cells are complete! Click "Check" to submit.'),this.emitHintShown("All cells complete")}submit(){super.submit();let t=this.getCurrentState(),r=Vr(this.data.answerKey,t,this.data.rows),i=Fr(this.data.answerKey,t,this.data.rows);this._$table.setGradingState(i),console.log(`Adjacency Table Score: ${r.score.toFixed(1)}% (${r.correct}/${r.total} correct)`),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:r},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$table&&(this._$table.reset(),this._$table.clearGradingState())}};customElements.get("adjacency-table")||customElements.define("adjacency-table",Ie);var na=/\[([^\]]+)\]/g,oa=/^\s*(-?\d+)\s*(\.\.)\s*(-?\d+)\s*$/,aa=/^\d{4}\/(0[1-9]|1[0-2])\/(0[1-9]|[12]\d|3[01])$/,sa=/^([01]\d|2[0-3]):[0-5]\d$/,Wr=e=>{let n=Y(e);if(n.length===0||n.some(o=>!o))return{ok:!1,data:null,errors:{"@tx":"provide at least one non-empty answer."}};let t=ee(n),r=`text-${P(e)}`,i=`<edu-input type="text" id="${r}" variant="outline" autocomplete="off"></edu-input>`;return{ok:!0,data:{type:"text",id:r,value:t,html:i},errors:null}},Qr=e=>{let t=[...e.matchAll(na)].flatMap(c=>Y(c[1])),r=e.replace(/\[|\]/g,""),i=[" ",...T(ee(Y(r)))];if(i.length===0)return{ok:!1,data:null,errors:{"@sl":"provide at least one option for the select."}};if(t.length===0)return{ok:!1,data:null,errors:{"@sl":"Mark at least one correct option inside of square brackets."}};let o=[...i],a=`select-${P(e)}-${Math.random().toString(36).slice(2)}`,s=o.map(c=>`<option>${c}</option>`).join(""),l=`<edu-input as="select" id="${a}" variant="outline">${s}</edu-input>`;return{ok:!0,data:{type:"select",id:a,correctOptions:t,options:i,html:l},errors:null}},Zr=e=>{let n=Y(e);if(n.length===0||n.some(a=>!a.trim()))return{ok:!1,data:null,errors:{"@nm":"provide at least one non-empty option."}};let t=[],r=[];for(let a of n){let s=a.match(oa);if(s){let l=parseInt(s[1],10),c=parseInt(s[3],10);if(Number.isNaN(l)||Number.isNaN(c)||l>c)return{ok:!1,data:null,errors:{"@nm":"Invalid range ${t}"}};r.push({from:l,to:c})}else{let l=Number(a.trim());if(!Number.isInteger(l))return{ok:!1,data:null,errors:{"@nm":"${t} is not an integer."}};t.push(l)}}let i=`number-${P(e)}-${Math.random().toString(36).slice(2)}`,o=`<edu-input type="number" variant="outline" id="${i}"></edu-input>`;return{ok:!0,data:{type:"number",id:i,targets:ee(t),ranges:r,html:o},errors:null}},Xr=e=>{let n=Y(e);if(n.length===0||n.some(a=>!a.trim()))return{ok:!1,data:null,errors:{"@dt":"provide at least one non-empty date option."}};let t=[];for(let a of n){let s=a.trim();if(!aa.test(s))return{ok:!1,data:null,errors:{"@dt":`"${s}" is not a valid date. Expected format: YYYY/MM/DD`}};t.push(s)}let r=ee(t),i=`date-${P(e)}`,o=`<edu-input type="date" id="${i}" variant="outline"></edu-input>`;return{ok:!0,data:{type:"date",id:i,value:r[0],html:o},errors:null}},Jr=e=>{let n=Y(e);if(n.length===0||n.some(a=>!a.trim()))return{ok:!1,data:null,errors:{"@tm":"provide at least one non-empty time option."}};let t=[];for(let a of n){let s=a.trim();if(!sa.test(s))return{ok:!1,data:null,errors:{"@tm":`"${s}" is not a valid time. Expected format: HH:MM (24-hour)`}};t.push(s)}let r=ee(t),i=`time-${P(e)}`,o=`<edu-input type="time" id="${i}" variant="outline"></edu-input>`;return{ok:!0,data:{type:"time",id:i,value:r[0],html:o},errors:null}};function ei(e){return e.trim().split(";;")}var ti=["tx","nm","sl","dt","tm"],la={tx:Wr,nm:Zr,sl:Qr,dt:Xr,tm:Jr},ri=e=>{let n=[],t=[],r={},i,o=/^\s*=\s*\[([^\]]+)\]\s*;/m,a=e.match(o);a&&(i=a[1].split("|").map(h=>h.trim().replace(/^["']|["']$/g,"")).filter(Boolean),e=e.replace(o,""));let s="",l=!1,c=null,d=0;for(;d<e.length;){let p=e[d];if(d+1<e.length&&p==="["&&e[d+1]==="["){s+="[",d+=2;continue}if(p==="["){s.trim().length>0&&(n.push(s.trim()),s=""),l=!0,c={words:[],startPos:n.length,endPos:n.length},d++;continue}if(p==="]"){if(!l){r[`at:${d}`]="Unexpected closing bracket ']' without matching opening bracket.",d++;continue}if(s.trim().length>0){let h=s.trim();c.words.push(h),n.push(h),s=""}c.words.length===0?r[`at:${d}`]="Empty brackets [] are not allowed as targets.":(c.endPos=n.length-1,t.push(c)),c=null,l=!1,d++;continue}if(p===" "||p===`
2549
+ `||p===" "||p==="\r"){if(s.trim().length>0){let h=s.trim();l&&c.words.push(h),n.push(h),s=""}d++;continue}s+=p,d++}if(s.trim().length>0){let p=s.trim();l&&(c.words.push(p),c.endPos=n.length,t.push(c)),n.push(p)}l&&(r.unclosed="Unclosed opening bracket '['. Expected ']'.");let u=Object.keys(r).length>0;return{ok:!u,data:{type:"base",parts:n,targets:t,...i&&{distractors:i}},errors:u?r:null}},ii=e=>{let n={},t=[],r=[],i="",o=0;for(;o<e.length;){let s=e[o];if(o+1<e.length&&s==="@"&&e[o+1]==="@"){i+="@",o+=2;continue}if(s!=="@"){if(s===" "||s===`
2550
+ `||s===" "||s==="\r"){i.trim().length>0&&(t.push(i.trim()),i=""),o++;continue}i+=s,o++;continue}i.trim().length>0&&(t.push(i.trim()),i="");let l=o;o++;let c="";for(;o<e.length&&/[a-z]/i.test(e[o]);)c+=e[o++];if(!c||!ti.includes(c)){n[`at:${l}`]=`Invalid element reference "@${c}". Expected one of: ${ti.join(", ")}.`;continue}if(o>=e.length||e[o]!=="("){n[`at:${l}`]=`Expected '(' after @${c} at position ${o}.`;continue}o++;let d="",u=!1;for(;o<e.length;){if(e[o]===")"){u=!0,o++;break}d+=e[o++]}if(!u){n[`at:${l}`]=`Unclosed parenthesis for @${c}. Expected ')'.`;continue}let p=la[c];if(!p){n[`at:${l}`]=`No parser found for @${c}.`;continue}let h=p(d);if(!h.ok){n[`at:${l}`]=h.errors?JSON.stringify(h.errors):`Failed to parse @${c}(${d})`;continue}t.push(h.data.html);let g={id:h.data.id,expectedValue:h.data};r.push(g)}i.trim().length>0&&t.push(i.trim());let a=Object.keys(n).length>0;return{ok:!a,data:{type:"blanks",parts:t,targets:r},errors:a?n:null}},ni=e=>{let n=[],t={},r=new Map,i="",o=0;for(;o<e.length;){let l=e[o];if(o+1<e.length&&l==="@"&&e[o+1]==="@"){i+="@",o+=2;continue}if(l!=="@"){if(l===" "||l===`
2551
+ `||l===" "||l==="\r"){i.trim().length>0&&(n.push(i.trim()),i=""),o++;continue}i+=l,o++;continue}i.trim().length>0&&(n.push(i.trim()),i="");let c=o;o++;let d="";for(;o<e.length&&/[a-z]/i.test(e[o]);)d+=e[o++];if(d!=="ct"){t[`at:${c}`]=`Invalid reference "@${d}". Expected "@ct" for classification.`;continue}if(o>=e.length||e[o]!=="("){t[`at:${c}`]=`Expected '(' after @ct at position ${o}.`;continue}o++;let u="",p=!1;for(;o<e.length;){if(e[o]===")"){p=!0,o++;break}u+=e[o++]}if(!p){t[`at:${c}`]="Unclosed parenthesis for @ct. Expected ')'.";continue}let h=u.split(",").map(K=>K.trim());if(h.length!==2){t[`at:${c}`]=`Invalid @ct syntax. Expected: @ct(category, word). Got: @ct(${u})`;continue}let[g,m]=h;if(!g||!m){t[`at:${c}`]=`Category and word cannot be empty in @ct(${u}).`;continue}let b=m.split(/\s+/).filter(Boolean),w=n.length;for(let K of b)n.push(K);let v=n.length-1,q={words:b,startPos:w,endPos:v};r.has(g)||r.set(g,[]),r.get(g).push(q)}i.trim().length>0&&n.push(i.trim());let a=[];for(let[l,c]of r.entries())a.push({category:l,targets:c});let s=Object.keys(t).length>0;return{ok:!s,data:{type:"classification",parts:n,targets:a},errors:s?t:null}},ca={base:ri,blanks:ii,classification:ni};function da(e,n){let t=ei(e),r=ca[n],i=[],o=[];for(let a of t){let s=r(a);if(!s.ok){s.errors&&(Array.isArray(s.errors)?o.push(...s.errors):o.push(s.errors));continue}i.push(s.data)}return o.length>0?{ok:!1,data:null,errors:o}:{ok:!0,data:i,errors:null}}function oi(e){let n={};if((!e.parts||e.parts.length===0)&&(n["parts.empty"]="No parts found. Text must contain at least one word."),(!e.targets||e.targets.length===0)&&(n["targets.empty"]="No targets found. Text must contain at least one [target] to interact with."),e.targets&&e.targets.length>0&&e.parts&&e.parts.length>0)for(let t=0;t<e.targets.length;t++){let r=e.targets[t],i=`targets[${t}]`;if(!r.words||r.words.length===0){n[`${i}.words.empty`]=`Target ${t} has no words. Each target must contain at least one word.`;continue}if(r.startPos<0&&(n[`${i}.startPos.negative`]=`Target ${t} has negative startPos (${r.startPos}).`),r.endPos<0&&(n[`${i}.endPos.negative`]=`Target ${t} has negative endPos (${r.endPos}).`),r.startPos>r.endPos&&(n[`${i}.position.invalid`]=`Target ${t} has startPos (${r.startPos}) greater than endPos (${r.endPos}).`),r.startPos>=e.parts.length&&(n[`${i}.startPos.outOfBounds`]=`Target ${t} startPos (${r.startPos}) is out of bounds (parts length: ${e.parts.length}).`),r.endPos>=e.parts.length&&(n[`${i}.endPos.outOfBounds`]=`Target ${t} endPos (${r.endPos}) is out of bounds (parts length: ${e.parts.length}).`),r.startPos<e.parts.length&&r.endPos<e.parts.length){let o=r.endPos-r.startPos+1;r.words.length!==o&&(n[`${i}.words.countMismatch`]=`Target ${t} has ${r.words.length} words but position range indicates ${o} words.`);for(let a=0;a<r.words.length;a++){let s=r.startPos+a;if(s<e.parts.length){let l=e.parts[s],c=r.words[a];l!==c&&(n[`${i}.words[${a}].mismatch`]=`Target ${t} word "${c}" doesn't match part at position ${s}: "${l}".`)}}}}if(e.distractors)if(!Array.isArray(e.distractors))n["distractors.notArray"]="Distractors must be an array.";else{e.distractors.length===0&&(n["distractors.empty"]="Distractors array is empty. Remove distractors field or add at least one distractor.");let t=new Set;for(let r=0;r<e.distractors.length;r++){let i=e.distractors[r];t.has(i)&&(n[`distractors[${r}].duplicate`]=`Duplicate distractor found: "${i}".`),t.add(i),(!i||i.trim().length===0)&&(n[`distractors[${r}].empty`]=`Distractor at index ${r} is empty.`)}}return Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0,errors:null}}function ai(e){let n={};(!e.parts||e.parts.length===0)&&(n["parts.empty"]="No parts found. Text must contain at least one part."),(!e.targets||e.targets.length===0)&&(n["targets.empty"]="No targets found. Text must contain at least one input element (@tx, @nm, @sl, @dt, @tm).");let t=new Set;if(e.targets&&e.targets.length>0)for(let r=0;r<e.targets.length;r++){let i=e.targets[r],o=`targets[${r}]`;if(!i.id||i.id.trim().length===0?n[`${o}.id.empty`]=`Target ${r} has no ID. Each input element must have a unique ID.`:(t.has(i.id)&&(n[`${o}.id.duplicate`]=`Duplicate ID found: "${i.id}". Each input element must have a unique ID.`),t.add(i.id)),!i.expectedValue){n[`${o}.expectedValue.missing`]=`Target ${r} has no expectedValue. Each input element must define expected answer data.`;continue}let a=i.expectedValue;a.type||(n[`${o}.expectedValue.type.missing`]=`Target ${r} expectedValue has no type field.`),a.id||(n[`${o}.expectedValue.id.missing`]=`Target ${r} expectedValue has no id field.`),a.html||(n[`${o}.expectedValue.html.missing`]=`Target ${r} expectedValue has no html field.`);let s=a.type;if(s)switch(s){case"text":(!("value"in a)||!Array.isArray(a.value))&&(n[`${o}.expectedValue.text.value`]=`Target ${r} is type 'text' but has no valid 'value' array.`);break;case"number":"targets"in a||(n[`${o}.expectedValue.number.targets`]=`Target ${r} is type 'number' but has no 'targets' field.`);break;case"select":(!("correctOptions"in a)||!("options"in a))&&(n[`${o}.expectedValue.select.options`]=`Target ${r} is type 'select' but is missing 'correctOptions' or 'options' fields.`);break;case"date":case"time":"value"in a||(n[`${o}.expectedValue.${s}.value`]=`Target ${r} is type '${s}' but has no 'value' field.`);break}}return Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0,errors:null}}function si(e){let n={};(!e.parts||e.parts.length===0)&&(n["parts.empty"]="No parts found. Text must contain at least one word."),(!e.targets||e.targets.length===0)&&(n["targets.empty"]="No categories found. Text must contain at least one @ct(category, word) reference.");let t=new Set;if(e.targets&&e.targets.length>0)for(let r=0;r<e.targets.length;r++){let i=e.targets[r],o=`targets[${r}]`;if(!i.category||i.category.trim().length===0?n[`${o}.category.empty`]=`Category ${r} has no name.`:(t.has(i.category)&&(n[`${o}.category.duplicate`]=`Duplicate category found: "${i.category}". Each category must have a unique name.`),t.add(i.category)),!i.targets||i.targets.length===0){n[`${o}.targets.empty`]=`Category "${i.category}" has no targets. Each category must contain at least one word.`;continue}for(let a=0;a<i.targets.length;a++){let s=i.targets[a],l=`${o}.targets[${a}]`;if(!s.words||s.words.length===0){n[`${l}.words.empty`]=`Category "${i.category}" target ${a} has no words.`;continue}if(s.startPos<0&&(n[`${l}.startPos.negative`]=`Category "${i.category}" target ${a} has negative startPos.`),s.endPos<0&&(n[`${l}.endPos.negative`]=`Category "${i.category}" target ${a} has negative endPos.`),s.startPos>s.endPos&&(n[`${l}.position.invalid`]=`Category "${i.category}" target ${a} has startPos greater than endPos.`),e.parts&&e.parts.length>0&&(s.startPos>=e.parts.length&&(n[`${l}.startPos.outOfBounds`]=`Category "${i.category}" target ${a} startPos is out of bounds.`),s.endPos>=e.parts.length&&(n[`${l}.endPos.outOfBounds`]=`Category "${i.category}" target ${a} endPos is out of bounds.`),s.startPos<e.parts.length&&s.endPos<e.parts.length)){let c=s.endPos-s.startPos+1;s.words.length!==c&&(n[`${l}.words.countMismatch`]=`Category "${i.category}" target ${a} word count mismatch.`)}}}return Object.keys(n).length>0?{ok:!1,errors:n}:{ok:!0,errors:null}}function ua(e){switch(e.type){case"base":return oi(e);case"blanks":return ai(e);case"classification":return si(e);default:return{ok:!1,errors:{"type.invalid":`Unknown text engine type: ${e.type}`}}}}function Me(e,n){let t=new Set(n.selectedIndices??[]),r=new Set;for(let p of e.targets)for(let h=p.startPos;h<=p.endPos;h++)r.add(h);let i=0,o=0,a=0;for(let p=0;p<e.parts.length;p++){let h=r.has(p),g=t.has(p);h&&g?i++:h&&!g?a++:!h&&g&&o++}let s=r.size,l=i+o>0?i/(i+o):0,c=i+a>0?i/(i+a):0,d=l+c>0?2*l*c/(l+c):0;return{score:Math.round(d*100),correct:i,total:s}}function pa(e,n){let t=new Set,r=n.dndPlacements??{};for(let l of e.targets)for(let c=l.startPos;c<=l.endPos;c++)t.add(c);let i=0;if(Object.keys(r).length>0)for(let l of t){let c=e.parts[l],d=r[l];d&&Ze(d)===Ze(c)&&i++}else{let l=new Set(n.placedIndices??[]);for(let c of l)t.has(c)&&i++}let a=t.size;return{score:a>0?Math.round(i/a*100):0,correct:i,total:a}}function ha(e,n){let t={},r=n.dndPlacements??{};for(let i of e.targets)for(let o=i.startPos;o<=i.endPos;o++){let a=e.parts[o],s=r[o];s?Ze(s)===Ze(a)?t[o]="correct":t[o]="wrong":t[o]="missed"}return t}function Le(e,n,t){let r=n.transformations??{},i=0,o=0;for(let s=0;s<e.targets.length;s++){let l=t[s],c=r[s];l&&(o++,c&&l.length===c.length&&l.every((u,p)=>u.toLowerCase().trim()===(c[p]||"").toLowerCase().trim())&&i++)}return{score:o>0?Math.round(i/o*100):0,correct:i,total:o}}function wt(e,n,t){let r=n.transformations??{},i={};for(let o=0;o<e.targets.length;o++){let a=t[o],s=r[o];if(!a){i[o]="missed";continue}if(!s||s.length===0){i[o]="missed";continue}if(a.length===s.length){let l=a.every((c,d)=>c.toLowerCase().trim()===(s[d]||"").toLowerCase().trim());i[o]=l?"correct":"wrong"}else i[o]="wrong"}return i}function De(e,n){let t=new Set(n.selectedIndices??[]),r=new Set,i={};for(let o of e.targets)for(let a=o.startPos;a<=o.endPos;a++)r.add(a);for(let o=0;o<e.parts.length;o++){let a=r.has(o),s=t.has(o);a&&s?i[o]="correct":a&&!s?i[o]="missed":!a&&s&&(i[o]="wrong")}return i}function Re(e,n){let t=0,r=e.targets.length;for(let o of e.targets){let a=n.inputValues[o.id],s=o.expectedValue;di(s,a)&&t++}return{score:r>0?Math.round(t/r*100):0,correct:t,total:r}}function Pe(e,n){let t={};for(let r of e.targets){let i=n.inputValues[r.id],o=r.expectedValue;i==null||i===""?t[r.id]="missed":di(o,i)?t[r.id]="correct":t[r.id]="wrong"}return t}function di(e,n){if(n==null||n==="")return!1;switch(e.type){case"text":{let t=String(n).toLowerCase().trim();return e.value.some(r=>r.toLowerCase().trim()===t)}case"number":{let t=Number(n);return isNaN(t)?!1:e.targets.includes(t)?!0:e.ranges?e.ranges.some(r=>t>=r.from&&t<=r.to):!1}case"select":{let t=String(n).trim();return e.correctOptions.some(r=>String(r).trim()===t)}case"date":{let t=li(String(e.value)),r=li(String(n));return t.length>0&&t===r}case"time":{let t=ci(String(e.value)),r=ci(String(n));return t.length>0&&t===r}default:return!1}}function Ze(e){return String(e).trim().toLowerCase()}function li(e){return String(e).trim().replace(/\//g,"-")}function ci(e){let n=String(e).trim(),t=n.match(/^([01]\d|2[0-3]):([0-5]\d)(?::[0-5]\d)?$/);return t?`${t[1]}:${t[2]}`:n}function Be(e,n){let t=0,r=0,i=new Map;for(let a of e.targets)for(let s of a.targets)for(let l=s.startPos;l<=s.endPos;l++)i.set(l,a.category),r++;for(let[a,s]of Object.entries(n.wordCategories)){let l=Number(a),c=i.get(l);c&&s===c&&t++}return{score:r>0?Math.round(t/r*100):0,correct:t,total:r}}function qe(e,n){let t={},r=new Map;for(let i of e.targets)for(let o of i.targets)for(let a=o.startPos;a<=o.endPos;a++)r.set(a,i.category);for(let[i,o]of r){let a=n.wordCategories[i];a?a===o?t[i]="correct":t[i]="wrong":t[i]="missed"}return t}var ui=`/* ==================== BASE STYLES ==================== */
2552
2552
 
2553
2553
  * { box-sizing: border-box; }
2554
2554
 
@@ -3060,7 +3060,7 @@ input[type="radio"] {
3060
3060
  gap: 1.1rem;
3061
3061
  }
3062
3062
  }
3063
- `;var la=`
3063
+ `;var ma=`
3064
3064
  :host {
3065
3065
  display: inline-flex;
3066
3066
  align-items: center;
@@ -3185,24 +3185,24 @@ slot {
3185
3185
  background: rgb(var(--edu-warning) / 0.1);
3186
3186
  box-shadow: 0 0 0 2px rgb(var(--edu-warning) / 0.2);
3187
3187
  }
3188
- `,ca=["input","select","textarea","button"],Ze=class extends HTMLElement{constructor(){super();this.$slot=null;this.controlEl=null;this.currentTag="input";this.handleSlotChange=()=>{this.syncAttributes(),this.syncContent()};this.attachShadow({mode:"open"})}static get observedAttributes(){return["as","variant","state","disabled","readonly","required","placeholder","value","type","name","autocomplete","min","max","step","pattern","rows","cols","multiple","size"]}connectedCallback(){this.hasAttribute("variant")||(this.variant="outline"),this.render(),this.$slot?.addEventListener("slotchange",this.handleSlotChange),this.syncAttributes(),this.syncContent()}disconnectedCallback(){this.$slot?.removeEventListener("slotchange",this.handleSlotChange)}attributeChangedCallback(t,r,i){r!==i&&(t==="as"&&this.render(),this.syncAttributes(),this.syncContent())}getTag(){let t=(this.getAttribute("as")??"input").toLowerCase();return ca.includes(t)?t:"input"}render(){let t=this.getTag();if(this.controlEl&&this.currentTag===t)return;this.currentTag=t,this.shadowRoot.innerHTML="";let r=document.createElement("style");r.textContent=la,this.shadowRoot.append(r);let i=document.createElement(t);i.className="control",i.setAttribute("part","control"),this.$slot=document.createElement("slot"),this.shadowRoot.append(i,this.$slot),this.controlEl=i}applyAttr(t){this.controlEl&&(this.hasAttribute(t)?this.controlEl.setAttribute(t,this.getAttribute(t)??""):this.controlEl.removeAttribute(t))}applyBoolAttr(t){this.controlEl&&(this.hasAttribute(t)?this.controlEl.setAttribute(t,""):this.controlEl.removeAttribute(t))}syncAttributes(){this.controlEl&&(this.applyBoolAttr("disabled"),this.applyBoolAttr("readonly"),this.applyBoolAttr("required"),this.applyAttr("placeholder"),this.applyAttr("name"),this.applyAttr("autocomplete"),this.applyAttr("min"),this.applyAttr("max"),this.applyAttr("step"),this.applyAttr("pattern"),this.controlEl instanceof HTMLInputElement&&this.applyAttr("type"),this.controlEl instanceof HTMLTextAreaElement&&(this.applyAttr("rows"),this.applyAttr("cols")),this.controlEl instanceof HTMLSelectElement&&(this.applyBoolAttr("multiple"),this.applyAttr("size")),"value"in this.controlEl&&(this.hasAttribute("value")?this.controlEl.value=this.getAttribute("value")??"":this.controlEl.value=""))}syncContent(){if(!this.controlEl||!this.$slot)return;let r=this.$slot.assignedNodes({flatten:!0}).filter(i=>i.nodeType===Node.TEXT_NODE?i.textContent?.trim():i.nodeType===Node.ELEMENT_NODE);if(this.controlEl instanceof HTMLSelectElement){this.controlEl.innerHTML="",r.forEach(i=>{(i instanceof HTMLOptionElement||i instanceof HTMLOptGroupElement)&&this.controlEl.append(i.cloneNode(!0))});return}if(this.controlEl instanceof HTMLButtonElement){this.controlEl.innerHTML="",r.forEach(i=>{this.controlEl.append(i.cloneNode(!0))});return}if(this.controlEl instanceof HTMLTextAreaElement&&!this.hasAttribute("value")){let i=r.map(o=>o.textContent??"").join("");this.controlEl.value=i}}get variant(){return this.getAttribute("variant")??"outline"}set variant(t){this.setAttribute("variant",t)}get value(){return this.controlEl&&"value"in this.controlEl?this.controlEl.value:this.getAttribute("value")??""}set value(t){this.setAttribute("value",String(t)),this.controlEl&&"value"in this.controlEl&&(this.controlEl.value=t)}};customElements.get("edu-input")||customElements.define("edu-input",Ze);var Xe=class extends HTMLElement{constructor(){super();this._state={};this._mounted=!1;this.onClick=t=>{let r=t.target;if(r.classList.contains("word-selectable")){let i=parseInt(r.getAttribute("data-index")??"");isNaN(i)||this.toggleWordSelection(i)}if(r.classList.contains("category-btn")){let i=r.getAttribute("data-category");i&&this.setActiveCategory(i)}if(r.classList.contains("word-classifiable")){let i=parseInt(r.getAttribute("data-index")??"");!isNaN(i)&&this._activeCategory&&this.assignWordToCategory(i,this._activeCategory)}if(r.classList.contains("dropzone-filled")){let i=parseInt(r.getAttribute("data-index")??"");isNaN(i)||this.clearDropzone(i)}};this.onChange=t=>{let r=t.target;if(r.tagName==="EDU-INPUT"||r.tagName==="INPUT"){let i=r.getAttribute("id");if(i){let o=r.value;this.updateInputValue(i,o)}}};this.onInput=t=>{let r=t.target;if(r.tagName==="EDU-INPUT"||r.tagName==="INPUT"){let i=r.getAttribute("id");if(i){let o=r.value;this.updateInputValue(i,o)}}if(r.hasAttribute("contenteditable")&&r.getAttribute("contenteditable")==="true"){let i=parseInt(r.getAttribute("data-target-index")??"");if(!isNaN(i)){let o=r.textContent??"";this.updateTransformation(i,o)}}};this.onDragStart=t=>{let r=t,i=r.target;if(!r.dataTransfer||!i.classList.contains("chip"))return;let o=i.getAttribute("data-word")||i.textContent||"";o&&(r.dataTransfer.setData("text/plain",o),r.dataTransfer.effectAllowed="move")};this.onDragOver=t=>{let r=t;r.target.classList.contains("dropzone")&&(r.preventDefault(),r.dataTransfer.dropEffect="move")};this.onDrop=t=>{let r=t,i=r.target;if(!i.classList.contains("dropzone")||(r.preventDefault(),!r.dataTransfer))return;let o=parseInt(i.getAttribute("data-index")??"");if(isNaN(o))return;let a=r.dataTransfer.getData("text/plain");a&&this.placeWordInDropzone(o,a)};this._activeCategory=null;this.attachShadow({mode:"open"});let t=document.createElement("section");t.className="wrap",this.shadowRoot.append(t),this.$wrapEl=t}static get observedAttributes(){return["variant"]}connectedCallback(){this._mounted=!0,this.shadowRoot?.addEventListener("click",this.onClick),this.shadowRoot?.addEventListener("change",this.onChange),this.shadowRoot?.addEventListener("input",this.onInput),this.shadowRoot?.addEventListener("dragstart",this.onDragStart),this.shadowRoot?.addEventListener("dragover",this.onDragOver),this.shadowRoot?.addEventListener("drop",this.onDrop),this.render()}disconnectedCallback(){this._mounted=!1,this.shadowRoot?.removeEventListener("click",this.onClick),this.shadowRoot?.removeEventListener("change",this.onChange),this.shadowRoot?.removeEventListener("input",this.onInput),this.shadowRoot?.removeEventListener("dragstart",this.onDragStart),this.shadowRoot?.removeEventListener("dragover",this.onDragOver),this.shadowRoot?.removeEventListener("drop",this.onDrop)}set config(t){this._config=t,this._state=this.initState(t),t.variant&&this.setAttribute("variant",t.variant),this.render()}get config(){if(!this._config)throw new Error("<edu-text>: config not set");return this._config}getValue(){switch(this._config.data.type){case"base":if(this._config.mode==="highlight")return{selectedIndices:Array.from(this._state.selectedIndices??[])};if(this._config.mode==="dnd"){let r=this._state.dndPlacements??{};return{placedIndices:Object.keys(r).map(i=>Number(i)),dndPlacements:{...r}}}else if(this._config.mode==="transformation")return{transformations:this._state.transformations??{}};break;case"blanks":return{inputValues:this._state.inputValues??{}};case"classification":return{wordCategories:this._state.wordCategories??{}}}return{}}getState(){return{...this._state}}setState(t){t&&(this._state={...this._state,...t.selectedIndices?{selectedIndices:new Set(t.selectedIndices)}:{},...t.dndPlacements?{dndPlacements:{...t.dndPlacements}}:{},...t.inputValues?{inputValues:{...t.inputValues}}:{},...t.wordCategories?{wordCategories:{...t.wordCategories}}:{},...t.transformations?{transformations:{...t.transformations}}:{}},this.render())}reset(){this._config&&(this._state=this.initState(this._config),this.render(),this.dispatchEvent(new CustomEvent("reset",{bubbles:!0,composed:!0})))}setGradingState(t){this._config&&(this._config.gradingState=t,this.render())}clearGradingState(){this._config&&(this._config.gradingState=void 0,this.render())}attributeChangedCallback(t,r,i){r!==i&&t==="variant"&&(this.setAttribute("variant",i),this.shadowRoot?.querySelectorAll("edu-input").forEach(o=>{let a=o;a.variant!==void 0&&(a.variant=i)}),this.shadowRoot?.querySelectorAll("edu-block").forEach(o=>{let a=o;a.variant!==void 0&&(a.variant=i)}),this.render())}upsertHtmlAttribute(t,r,i){let o=new RegExp(`${r}="[^"]*"`,"i");return o.test(t)?t.replace(o,`${r}="${i}"`):t.replace(/<([a-z0-9-]+)/i,`<$1 ${r}="${i}"`)}removeHtmlAttribute(t,r){let i=new RegExp(`\\s${r}="[^"]*"`,"ig");return t.replace(i,"")}upsertHtmlClass(t,r){let i=/class="([^"]*)"/i;return i.test(t)?t.replace(i,(o,a)=>{let s=String(a||"").split(/\s+/).filter(Boolean);return s.includes(r)||s.push(r),`class="${s.join(" ")}"`}):t.replace(/<([a-z0-9-]+)/i,`<$1 class="${r}"`)}removeHtmlClassPrefix(t,r){let i=/class="([^"]*)"/i;return i.test(t)?t.replace(i,(o,a)=>{let s=String(a||"").split(/\s+/).filter(Boolean).filter(l=>!l.startsWith(r));return s.length>0?`class="${s.join(" ")}"`:""}):t}initState(t){let r={};switch(t.data.type){case"base":t.mode==="highlight"||t.mode==="dnd"?(r.selectedIndices=new Set,t.mode==="dnd"&&(r.dndPlacements={})):t.mode==="transformation"&&(r.transformations={});break;case"blanks":r.inputValues={};break;case"classification":r.wordCategories={};break}return r}render(){if(!this._mounted||!this.shadowRoot)return;if(!this._config){this.$wrapEl.innerHTML="<style>:host{display:block}</style><div></div>";return}let t=this._config,r=t.data,i="";switch(t.mode){case"highlight":i=this.renderHighlight(r);break;case"blanks":i=this.renderBlanks(r);break;case"classification":i=this.renderClassification(r);break;case"dnd":i=this.renderDND(r);break;case"transformation":i=this.renderTransformation(r);break}this.$wrapEl.innerHTML=`
3189
- <style>${si}</style>
3188
+ `,fa=["input","select","textarea","button"],Xe=class extends HTMLElement{constructor(){super();this.$slot=null;this.controlEl=null;this.currentTag="input";this.handleSlotChange=()=>{this.syncAttributes(),this.syncContent()};this.attachShadow({mode:"open"})}static get observedAttributes(){return["as","variant","state","disabled","readonly","required","placeholder","value","type","name","autocomplete","min","max","step","pattern","rows","cols","multiple","size"]}connectedCallback(){this.hasAttribute("variant")||(this.variant="outline"),this.render(),this.$slot?.addEventListener("slotchange",this.handleSlotChange),this.syncAttributes(),this.syncContent()}disconnectedCallback(){this.$slot?.removeEventListener("slotchange",this.handleSlotChange)}attributeChangedCallback(t,r,i){r!==i&&(t==="as"&&this.render(),this.syncAttributes(),this.syncContent())}getTag(){let t=(this.getAttribute("as")??"input").toLowerCase();return fa.includes(t)?t:"input"}render(){let t=this.getTag();if(this.controlEl&&this.currentTag===t)return;this.currentTag=t,this.shadowRoot.innerHTML="";let r=document.createElement("style");r.textContent=ma,this.shadowRoot.append(r);let i=document.createElement(t);i.className="control",i.setAttribute("part","control"),this.$slot=document.createElement("slot"),this.shadowRoot.append(i,this.$slot),this.controlEl=i}applyAttr(t){this.controlEl&&(this.hasAttribute(t)?this.controlEl.setAttribute(t,this.getAttribute(t)??""):this.controlEl.removeAttribute(t))}applyBoolAttr(t){this.controlEl&&(this.hasAttribute(t)?this.controlEl.setAttribute(t,""):this.controlEl.removeAttribute(t))}syncAttributes(){this.controlEl&&(this.applyBoolAttr("disabled"),this.applyBoolAttr("readonly"),this.applyBoolAttr("required"),this.applyAttr("placeholder"),this.applyAttr("name"),this.applyAttr("autocomplete"),this.applyAttr("min"),this.applyAttr("max"),this.applyAttr("step"),this.applyAttr("pattern"),this.controlEl instanceof HTMLInputElement&&this.applyAttr("type"),this.controlEl instanceof HTMLTextAreaElement&&(this.applyAttr("rows"),this.applyAttr("cols")),this.controlEl instanceof HTMLSelectElement&&(this.applyBoolAttr("multiple"),this.applyAttr("size")),"value"in this.controlEl&&(this.hasAttribute("value")?this.controlEl.value=this.getAttribute("value")??"":this.controlEl.value=""))}syncContent(){if(!this.controlEl||!this.$slot)return;let r=this.$slot.assignedNodes({flatten:!0}).filter(i=>i.nodeType===Node.TEXT_NODE?i.textContent?.trim():i.nodeType===Node.ELEMENT_NODE);if(this.controlEl instanceof HTMLSelectElement){this.controlEl.innerHTML="",r.forEach(i=>{(i instanceof HTMLOptionElement||i instanceof HTMLOptGroupElement)&&this.controlEl.append(i.cloneNode(!0))});return}if(this.controlEl instanceof HTMLButtonElement){this.controlEl.innerHTML="",r.forEach(i=>{this.controlEl.append(i.cloneNode(!0))});return}if(this.controlEl instanceof HTMLTextAreaElement&&!this.hasAttribute("value")){let i=r.map(o=>o.textContent??"").join("");this.controlEl.value=i}}get variant(){return this.getAttribute("variant")??"outline"}set variant(t){this.setAttribute("variant",t)}get value(){return this.controlEl&&"value"in this.controlEl?this.controlEl.value:this.getAttribute("value")??""}set value(t){this.setAttribute("value",String(t)),this.controlEl&&"value"in this.controlEl&&(this.controlEl.value=t)}};customElements.get("edu-input")||customElements.define("edu-input",Xe);var Je=class extends HTMLElement{constructor(){super();this._state={};this._mounted=!1;this.onClick=t=>{let r=t.target;if(r.classList.contains("word-selectable")){let i=parseInt(r.getAttribute("data-index")??"");isNaN(i)||this.toggleWordSelection(i)}if(r.classList.contains("category-btn")){let i=r.getAttribute("data-category");i&&this.setActiveCategory(i)}if(r.classList.contains("word-classifiable")){let i=parseInt(r.getAttribute("data-index")??"");!isNaN(i)&&this._activeCategory&&this.assignWordToCategory(i,this._activeCategory)}if(r.classList.contains("dropzone-filled")){let i=parseInt(r.getAttribute("data-index")??"");isNaN(i)||this.clearDropzone(i)}};this.onChange=t=>{let r=t.target;if(r.tagName==="EDU-INPUT"||r.tagName==="INPUT"){let i=r.getAttribute("id");if(i){let o=r.value;this.updateInputValue(i,o)}}};this.onInput=t=>{let r=t.target;if(r.tagName==="EDU-INPUT"||r.tagName==="INPUT"){let i=r.getAttribute("id");if(i){let o=r.value;this.updateInputValue(i,o)}}if(r.hasAttribute("contenteditable")&&r.getAttribute("contenteditable")==="true"){let i=parseInt(r.getAttribute("data-target-index")??"");if(!isNaN(i)){let o=r.textContent??"";this.updateTransformation(i,o)}}};this.onDragStart=t=>{let r=t,i=r.target;if(!r.dataTransfer||!i.classList.contains("chip"))return;let o=i.getAttribute("data-word")||i.textContent||"";o&&(r.dataTransfer.setData("text/plain",o),r.dataTransfer.effectAllowed="move")};this.onDragOver=t=>{let r=t;r.target.classList.contains("dropzone")&&(r.preventDefault(),r.dataTransfer.dropEffect="move")};this.onDrop=t=>{let r=t,i=r.target;if(!i.classList.contains("dropzone")||(r.preventDefault(),!r.dataTransfer))return;let o=parseInt(i.getAttribute("data-index")??"");if(isNaN(o))return;let a=r.dataTransfer.getData("text/plain");a&&this.placeWordInDropzone(o,a)};this._activeCategory=null;this.attachShadow({mode:"open"});let t=document.createElement("section");t.className="wrap",this.shadowRoot.append(t),this.$wrapEl=t}static get observedAttributes(){return["variant"]}connectedCallback(){this._mounted=!0,this.shadowRoot?.addEventListener("click",this.onClick),this.shadowRoot?.addEventListener("change",this.onChange),this.shadowRoot?.addEventListener("input",this.onInput),this.shadowRoot?.addEventListener("dragstart",this.onDragStart),this.shadowRoot?.addEventListener("dragover",this.onDragOver),this.shadowRoot?.addEventListener("drop",this.onDrop),this.render()}disconnectedCallback(){this._mounted=!1,this.shadowRoot?.removeEventListener("click",this.onClick),this.shadowRoot?.removeEventListener("change",this.onChange),this.shadowRoot?.removeEventListener("input",this.onInput),this.shadowRoot?.removeEventListener("dragstart",this.onDragStart),this.shadowRoot?.removeEventListener("dragover",this.onDragOver),this.shadowRoot?.removeEventListener("drop",this.onDrop)}set config(t){this._config=t,this._state=this.initState(t),t.variant&&this.setAttribute("variant",t.variant),this.render()}get config(){if(!this._config)throw new Error("<edu-text>: config not set");return this._config}getValue(){switch(this._config.data.type){case"base":if(this._config.mode==="highlight")return{selectedIndices:Array.from(this._state.selectedIndices??[])};if(this._config.mode==="dnd"){let r=this._state.dndPlacements??{};return{placedIndices:Object.keys(r).map(i=>Number(i)),dndPlacements:{...r}}}else if(this._config.mode==="transformation")return{transformations:this._state.transformations??{}};break;case"blanks":return{inputValues:this._state.inputValues??{}};case"classification":return{wordCategories:this._state.wordCategories??{}}}return{}}getState(){return{...this._state}}setState(t){t&&(this._state={...this._state,...t.selectedIndices?{selectedIndices:new Set(t.selectedIndices)}:{},...t.dndPlacements?{dndPlacements:{...t.dndPlacements}}:{},...t.inputValues?{inputValues:{...t.inputValues}}:{},...t.wordCategories?{wordCategories:{...t.wordCategories}}:{},...t.transformations?{transformations:{...t.transformations}}:{}},this.render())}reset(){this._config&&(this._state=this.initState(this._config),this.render(),this.dispatchEvent(new CustomEvent("reset",{bubbles:!0,composed:!0})))}setGradingState(t){this._config&&(this._config.gradingState=t,this.render())}clearGradingState(){this._config&&(this._config.gradingState=void 0,this.render())}attributeChangedCallback(t,r,i){r!==i&&t==="variant"&&(this.setAttribute("variant",i),this.shadowRoot?.querySelectorAll("edu-input").forEach(o=>{let a=o;a.variant!==void 0&&(a.variant=i)}),this.shadowRoot?.querySelectorAll("edu-block").forEach(o=>{let a=o;a.variant!==void 0&&(a.variant=i)}),this.render())}upsertHtmlAttribute(t,r,i){let o=new RegExp(`${r}="[^"]*"`,"i");return o.test(t)?t.replace(o,`${r}="${i}"`):t.replace(/<([a-z0-9-]+)/i,`<$1 ${r}="${i}"`)}removeHtmlAttribute(t,r){let i=new RegExp(`\\s${r}="[^"]*"`,"ig");return t.replace(i,"")}upsertHtmlClass(t,r){let i=/class="([^"]*)"/i;return i.test(t)?t.replace(i,(o,a)=>{let s=String(a||"").split(/\s+/).filter(Boolean);return s.includes(r)||s.push(r),`class="${s.join(" ")}"`}):t.replace(/<([a-z0-9-]+)/i,`<$1 class="${r}"`)}removeHtmlClassPrefix(t,r){let i=/class="([^"]*)"/i;return i.test(t)?t.replace(i,(o,a)=>{let s=String(a||"").split(/\s+/).filter(Boolean).filter(l=>!l.startsWith(r));return s.length>0?`class="${s.join(" ")}"`:""}):t}initState(t){let r={};switch(t.data.type){case"base":t.mode==="highlight"||t.mode==="dnd"?(r.selectedIndices=new Set,t.mode==="dnd"&&(r.dndPlacements={})):t.mode==="transformation"&&(r.transformations={});break;case"blanks":r.inputValues={};break;case"classification":r.wordCategories={};break}return r}render(){if(!this._mounted||!this.shadowRoot)return;if(!this._config){this.$wrapEl.innerHTML="<style>:host{display:block}</style><div></div>";return}let t=this._config,r=t.data,i="";switch(t.mode){case"highlight":i=this.renderHighlight(r);break;case"blanks":i=this.renderBlanks(r);break;case"classification":i=this.renderClassification(r);break;case"dnd":i=this.renderDND(r);break;case"transformation":i=this.renderTransformation(r);break}this.$wrapEl.innerHTML=`
3189
+ <style>${ui}</style>
3190
3190
  <div class="text-content" part="content">
3191
3191
  ${i}
3192
3192
  </div>
3193
- `}renderHighlight(t){let r=t.parts,i=this._state.selectedIndices??new Set,o=this._config.gradingState??{};return r.map((a,s)=>{let l=i.has(s),c=o[s],d=["word","word-selectable"];return l&&d.push("word-selected"),c&&d.push(`word-${c}`),`<span class="${d.join(" ")}" data-index="${s}">${E(a)}</span>`}).join(" ")}renderBlanks(t){let r=this._config.gradingState??{},i=this.getAttribute("variant")??this._config.variant??"outline";return t.parts.map((o,a)=>{if(o.startsWith("<")){let s=t.targets.find(l=>l.expectedValue.html===o);if(s){let l=r[s.id],c=l?`input-${l}`:"",d=this._state.inputValues?.[s.id]??"",u=o;if(/<edu-input\b/i.test(u)&&(u=this.upsertHtmlAttribute(u,"variant",i)),u=this.removeHtmlClassPrefix(u,"input-"),u=this.removeHtmlAttribute(u,"state"),l&&(/<edu-input\b/i.test(u)?u=this.upsertHtmlAttribute(u,"state",l):c&&(u=this.upsertHtmlClass(u,c))),d!==""){let p=E(String(d));u.includes("<edu-input")?/value="[^"]*"/.test(u)?u=u.replace(/value="[^"]*"/,`value="${p}"`):u=u.replace("<edu-input",`<edu-input value="${p}"`):u.includes("<input")&&(/value="[^"]*"/.test(u)?u=u.replace(/value="[^"]*"/,`value="${p}"`):u=u.replace("<input",`<input value="${p}"`))}return u}return o}else return`<span class="word">${E(o)}</span>`}).join(" ")}renderClassification(t){let r=t.parts,i=this._state.wordCategories??{},o=this._config.gradingState??{},a=this.getAttribute("variant")??"outline",s=t.targets.map(p=>p.category),l={},c=["--edu-first-accent","--edu-second-accent","--edu-third-accent","--edu-neutral"];s.forEach((p,h)=>{l[p]=c[h%c.length]});let d=r.map((p,h)=>{let g=i[h],m=o[h],b=["word","word-classifiable"];g&&b.push("word-assigned"),m&&b.push(`word-${m}`);let w=g?`style="--category-color: var(${l[g]})"`:"";return`
3193
+ `}renderHighlight(t){let r=t.parts,i=this._state.selectedIndices??new Set,o=this._config.gradingState??{};return r.map((a,s)=>{let l=i.has(s),c=o[s],d=["word","word-selectable"];return l&&d.push("word-selected"),c&&d.push(`word-${c}`),`<span class="${d.join(" ")}" data-index="${s}">${C(a)}</span>`}).join(" ")}renderBlanks(t){let r=this._config.gradingState??{},i=this.getAttribute("variant")??this._config.variant??"outline";return t.parts.map((o,a)=>{if(o.startsWith("<")){let s=t.targets.find(l=>l.expectedValue.html===o);if(s){let l=r[s.id],c=l?`input-${l}`:"",d=this._state.inputValues?.[s.id]??"",u=o;if(/<edu-input\b/i.test(u)&&(u=this.upsertHtmlAttribute(u,"variant",i)),u=this.removeHtmlClassPrefix(u,"input-"),u=this.removeHtmlAttribute(u,"state"),l&&(/<edu-input\b/i.test(u)?u=this.upsertHtmlAttribute(u,"state",l):c&&(u=this.upsertHtmlClass(u,c))),d!==""){let p=C(String(d));u.includes("<edu-input")?/value="[^"]*"/.test(u)?u=u.replace(/value="[^"]*"/,`value="${p}"`):u=u.replace("<edu-input",`<edu-input value="${p}"`):u.includes("<input")&&(/value="[^"]*"/.test(u)?u=u.replace(/value="[^"]*"/,`value="${p}"`):u=u.replace("<input",`<input value="${p}"`))}return u}return o}else return`<span class="word">${C(o)}</span>`}).join(" ")}renderClassification(t){let r=t.parts,i=this._state.wordCategories??{},o=this._config.gradingState??{},a=this.getAttribute("variant")??"outline",s=t.targets.map(p=>p.category),l={},c=["--edu-first-accent","--edu-second-accent","--edu-third-accent","--edu-neutral"];s.forEach((p,h)=>{l[p]=c[h%c.length]});let d=r.map((p,h)=>{let g=i[h],m=o[h],b=["word","word-classifiable"];g&&b.push("word-assigned"),m&&b.push(`word-${m}`);let w=g?`style="--category-color: var(${l[g]})"`:"";return`
3194
3194
  <span class="${b.join(" ")}" data-index="${h}" ${w}>
3195
- ${E(p)}
3195
+ ${C(p)}
3196
3196
  </span>
3197
3197
  `}).join(" "),u=`
3198
3198
  <div class="categories" part="categories">
3199
3199
  ${s.map(p=>`
3200
3200
  <edu-block class="category-btn"
3201
3201
  ${this._activeCategory===p?'data-active="true"':""}
3202
- data-category="${E(p)}"
3203
- variant="${E(a)}"
3202
+ data-category="${C(p)}"
3203
+ variant="${C(a)}"
3204
3204
  style="--category-color: var(${l[p]})">
3205
- ${E(p)}
3205
+ ${C(p)}
3206
3206
  </edu-block>
3207
3207
  `).join("")}
3208
3208
  </div>
@@ -3211,7 +3211,7 @@ slot {
3211
3211
  <div class="words" part="words">${d}</div>
3212
3212
  ${u}
3213
3213
  </div>
3214
- `}renderDND(t){let r=t.parts,i=this._state.dndPlacements??{},o=this._config.gradingState??{},a=new Set;for(let h of t.targets)for(let g=h.startPos;g<=h.endPos;g++)a.add(g);let s=r.map((h,g)=>{if(a.has(g)){let m=i[g],b=!!m,w=o[g],v=["dropzone"];b&&v.push("dropzone-filled"),w&&v.push(`dropzone-${w}`);let q=b?E(m):"";return`<span class="${v.join(" ")}" data-index="${g}">${q}</span>`}else return`<span class="word">${E(h)}</span>`}).join(" "),l=[...t.targets.flatMap(h=>h.words)];t.distractors&&l.push(...t.distractors);let c=Object.values(i),d=[...l];for(let h of c){let g=d.findIndex(m=>li(m)===li(h));g!==-1&&d.splice(g,1)}let p=S(d).map(h=>`<div class="chip" draggable="true" data-word="${E(h)}">${E(h)}</div>`).join("");return`
3214
+ `}renderDND(t){let r=t.parts,i=this._state.dndPlacements??{},o=this._config.gradingState??{},a=new Set;for(let h of t.targets)for(let g=h.startPos;g<=h.endPos;g++)a.add(g);let s=r.map((h,g)=>{if(a.has(g)){let m=i[g],b=!!m,w=o[g],v=["dropzone"];b&&v.push("dropzone-filled"),w&&v.push(`dropzone-${w}`);let q=b?C(m):"";return`<span class="${v.join(" ")}" data-index="${g}">${q}</span>`}else return`<span class="word">${C(h)}</span>`}).join(" "),l=[...t.targets.flatMap(h=>h.words)];t.distractors&&l.push(...t.distractors);let c=Object.values(i),d=[...l];for(let h of c){let g=d.findIndex(m=>pi(m)===pi(h));g!==-1&&d.splice(g,1)}let p=T(d).map(h=>`<div class="chip" draggable="true" data-word="${C(h)}">${C(h)}</div>`).join("");return`
3215
3215
  <div class="dnd-container">
3216
3216
  <div class="dnd-text">${s}</div>
3217
3217
  <div class="dnd-chips">${p}</div>
@@ -3220,8 +3220,8 @@ slot {
3220
3220
  <span class="${h.join(" ")}"
3221
3221
  contenteditable="true"
3222
3222
  data-target-index="${c}"
3223
- data-original="${E(s)}">${E(p)}</span>
3224
- `}else return`<span class="word">${E(s)}</span>`}).join(" ")}toggleWordSelection(t){this._state.selectedIndices||(this._state.selectedIndices=new Set),this._state.selectedIndices.has(t)?this._state.selectedIndices.delete(t):this._state.selectedIndices.add(t),this.render(),this.emitChange()}setActiveCategory(t){this._activeCategory=t,this.shadowRoot?.querySelectorAll(".category-btn").forEach(r=>{r.getAttribute("data-category")===t?(r.classList.add("category-active"),r.setAttribute("data-active","true")):(r.classList.remove("category-active"),r.removeAttribute("data-active")),r instanceof V&&(r.variant=this.getAttribute("variant")??"outline")})}assignWordToCategory(t,r){this._state.wordCategories||(this._state.wordCategories={}),this._state.wordCategories[t]===r?delete this._state.wordCategories[t]:this._state.wordCategories[t]=r,this.render(),this.emitChange()}updateInputValue(t,r){this._state.inputValues||(this._state.inputValues={}),this._state.inputValues[t]=r,this.emitChange()}updateTransformation(t,r){this._state.transformations||(this._state.transformations={});let i=r.split(/\s+/).filter(Boolean);this._state.transformations[t]=i,this.emitChange()}placeWordInDropzone(t,r){this._state.dndPlacements||(this._state.dndPlacements={}),this._state.dndPlacements[t]=r,this.render(),this.emitChange()}clearDropzone(t){this._state.dndPlacements&&t in this._state.dndPlacements&&(delete this._state.dndPlacements[t],this.render(),this.emitChange())}emitChange(){let t={userState:this.getValue(),dataType:this._config.data.type};this.dispatchEvent(new CustomEvent("change",{detail:t,bubbles:!0,composed:!0}))}};function li(e){return e.trim().toLowerCase()}customElements.get("edu-text")||customElements.define("edu-text",Xe);var ie=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._textConfig={data:t,mode:"highlight",variant:r.variant??"outline"},this.implementsProgress=!1}initialize(){}cleanup(){}onVariantChange(t){this.config.variant=t,this._textConfig.variant=t,this._$text&&this._$text.setAttribute("variant",t)}render(){this._textConfig.variant=this.config.variant,this._$text=document.createElement("edu-text"),this._$text.config=this._textConfig,this._$text.addEventListener("change",()=>{this.emitStateChange()}),this.innerHTML=`
3223
+ data-original="${C(s)}">${C(p)}</span>
3224
+ `}else return`<span class="word">${C(s)}</span>`}).join(" ")}toggleWordSelection(t){this._state.selectedIndices||(this._state.selectedIndices=new Set),this._state.selectedIndices.has(t)?this._state.selectedIndices.delete(t):this._state.selectedIndices.add(t),this.render(),this.emitChange()}setActiveCategory(t){this._activeCategory=t,this.shadowRoot?.querySelectorAll(".category-btn").forEach(r=>{r.getAttribute("data-category")===t?(r.classList.add("category-active"),r.setAttribute("data-active","true")):(r.classList.remove("category-active"),r.removeAttribute("data-active")),r instanceof V&&(r.variant=this.getAttribute("variant")??"outline")})}assignWordToCategory(t,r){this._state.wordCategories||(this._state.wordCategories={}),this._state.wordCategories[t]===r?delete this._state.wordCategories[t]:this._state.wordCategories[t]=r,this.render(),this.emitChange()}updateInputValue(t,r){this._state.inputValues||(this._state.inputValues={}),this._state.inputValues[t]=r,this.emitChange()}updateTransformation(t,r){this._state.transformations||(this._state.transformations={});let i=r.split(/\s+/).filter(Boolean);this._state.transformations[t]=i,this.emitChange()}placeWordInDropzone(t,r){this._state.dndPlacements||(this._state.dndPlacements={}),this._state.dndPlacements[t]=r,this.render(),this.emitChange()}clearDropzone(t){this._state.dndPlacements&&t in this._state.dndPlacements&&(delete this._state.dndPlacements[t],this.render(),this.emitChange())}emitChange(){let t={userState:this.getValue(),dataType:this._config.data.type};this.dispatchEvent(new CustomEvent("change",{detail:t,bubbles:!0,composed:!0}))}};function pi(e){return e.trim().toLowerCase()}customElements.get("edu-text")||customElements.define("edu-text",Je);var ne=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._textConfig={data:t,mode:"highlight",variant:r.variant??"outline"},this.implementsProgress=!1}initialize(){}cleanup(){}onVariantChange(t){this.config.variant=t,this._textConfig.variant=t,this._$text&&this._$text.setAttribute("variant",t)}render(){this._textConfig.variant=this.config.variant,this._$text=document.createElement("edu-text"),this._$text.config=this._textConfig,this._$text.addEventListener("change",()=>{this.emitStateChange()}),this.innerHTML=`
3225
3225
  <style>
3226
3226
  mark-the-words {
3227
3227
  display: flex;
@@ -3250,7 +3250,7 @@ slot {
3250
3250
  <div class="text-container">
3251
3251
  <div class="text-wrapper"></div>
3252
3252
  </div>
3253
- `,this.querySelector(".text-wrapper").appendChild(this._$text)}getCurrentState(){return this._$text?this._$text.getValue():{selectedIndices:[]}}isInteractionComplete(){let t=this.getCurrentState(),r=new Set(t.selectedIndices??[]);for(let i of this.data.targets)for(let o=i.startPos;o<=i.endPos;o++)if(!r.has(o))return!1;return!0}onHint(){let t=this.getCurrentState(),r=new Set(t.selectedIndices??[]),i=[];for(let o of this.data.targets)for(let a=o.startPos;a<=o.endPos;a++)r.has(a)||i.push(a);if(i.length>0){let o=i[Math.floor(Math.random()*i.length)],a=this.data.parts[o];this.emitHintShown(`Try selecting: "${a}"`)}else this.emitHintShown("All target words have been selected!")}getUserData(){return this.getCurrentState()}submit(){super.submit();let t=this.grade();this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}grade(){let t=this.getUserData(),r=Ie(this.data,t),i=Le(this.data,t);return this._$text&&this._$text.setGradingState(i),r}reset(){super.reset(),this._$text&&(this._$text.reset(),this._$text.clearGradingState())}};customElements.get("mark-the-words")||customElements.define("mark-the-words",ie);var ne=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="sequential";this._slides=[];this._currentStep=0;this._responses={};this._gradingByStep={};this._isGraded=!1;if(this._slides=(Array.isArray(t)?t:[]).filter(i=>i.type==="base"),this._slides.length===0){this.isValid=!1,this.errors="SequentialMarkTheWords requires at least one base slide.";return}this._textConfig={data:this._slides[0],mode:"highlight",variant:r.variant??"outline"},this.initializeProgress(this.getTotalTargetCount())}get slidesCount(){return this._slides.length}initialize(){}cleanup(){}onVariantChange(t){this.config.variant=t,this._textConfig.variant=t,this._$text&&this._$text.setAttribute("variant",t)}setSteps(t){this.saveCurrentStepResponse();let r=Math.max(0,Math.min(this._slides.length-1,t-1));r!==this._currentStep&&(this._currentStep=r,this.render())}render(){if(this._slides.length===0)return;this._textConfig={data:this._slides[this._currentStep],mode:"highlight",variant:this.config.variant},this._$text=document.createElement("edu-text"),this._$text.config=this._textConfig;let t=this._responses[this._currentStep];t?.selectedIndices&&this._$text.setState({selectedIndices:new Set(t.selectedIndices)});let r=this._gradingByStep[this._currentStep];this._isGraded&&r&&this._$text.setGradingState(r),this._$text.addEventListener("change",()=>{this.saveCurrentStepResponse(),this.updateProgressAcrossSteps(),this._isGraded&&(delete this._gradingByStep[this._currentStep],this._$text.clearGradingState()),this.emitStateChange()}),this.innerHTML=`
3253
+ `,this.querySelector(".text-wrapper").appendChild(this._$text)}getCurrentState(){return this._$text?this._$text.getValue():{selectedIndices:[]}}isInteractionComplete(){let t=this.getCurrentState(),r=new Set(t.selectedIndices??[]);for(let i of this.data.targets)for(let o=i.startPos;o<=i.endPos;o++)if(!r.has(o))return!1;return!0}onHint(){let t=this.getCurrentState(),r=new Set(t.selectedIndices??[]),i=[];for(let o of this.data.targets)for(let a=o.startPos;a<=o.endPos;a++)r.has(a)||i.push(a);if(i.length>0){let o=i[Math.floor(Math.random()*i.length)],a=this.data.parts[o];this.emitHintShown(`Try selecting: "${a}"`)}else this.emitHintShown("All target words have been selected!")}getUserData(){return this.getCurrentState()}submit(){super.submit();let t=this.grade();this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}grade(){let t=this.getUserData(),r=Me(this.data,t),i=De(this.data,t);return this._$text&&this._$text.setGradingState(i),r}reset(){super.reset(),this._$text&&(this._$text.reset(),this._$text.clearGradingState())}};customElements.get("mark-the-words")||customElements.define("mark-the-words",ne);var oe=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="sequential";this._slides=[];this._currentStep=0;this._responses={};this._gradingByStep={};this._isGraded=!1;if(this._slides=(Array.isArray(t)?t:[]).filter(i=>i.type==="base"),this._slides.length===0){this.isValid=!1,this.errors="SequentialMarkTheWords requires at least one base slide.";return}this._textConfig={data:this._slides[0],mode:"highlight",variant:r.variant??"outline"},this.initializeProgress(this.getTotalTargetCount())}get slidesCount(){return this._slides.length}initialize(){}cleanup(){}onVariantChange(t){this.config.variant=t,this._textConfig.variant=t,this._$text&&this._$text.setAttribute("variant",t)}setSteps(t){this.saveCurrentStepResponse();let r=Math.max(0,Math.min(this._slides.length-1,t-1));r!==this._currentStep&&(this._currentStep=r,this.render())}render(){if(this._slides.length===0)return;this._textConfig={data:this._slides[this._currentStep],mode:"highlight",variant:this.config.variant},this._$text=document.createElement("edu-text"),this._$text.config=this._textConfig;let t=this._responses[this._currentStep];t?.selectedIndices&&this._$text.setState({selectedIndices:new Set(t.selectedIndices)});let r=this._gradingByStep[this._currentStep];this._isGraded&&r&&this._$text.setGradingState(r),this._$text.addEventListener("change",()=>{this.saveCurrentStepResponse(),this.updateProgressAcrossSteps(),this._isGraded&&(delete this._gradingByStep[this._currentStep],this._$text.clearGradingState()),this.emitStateChange()}),this.innerHTML=`
3254
3254
  <style>
3255
3255
  sequential-mark-the-words {
3256
3256
  display: flex;
@@ -3279,7 +3279,7 @@ slot {
3279
3279
  <div class="text-container">
3280
3280
  <div class="text-wrapper"></div>
3281
3281
  </div>
3282
- `,this.querySelector(".text-wrapper").appendChild(this._$text)}getTargetCountForSlide(t){let r=0;for(let i of t.targets)r+=i.endPos-i.startPos+1;return r}getTotalTargetCount(){return this._slides.reduce((t,r)=>t+this.getTargetCountForSlide(r),0)}saveCurrentStepResponse(){this._$text&&(this._responses[this._currentStep]=this._$text.getValue())}getResponseForStep(t){return this._responses[t]??{selectedIndices:[]}}getTargetIndices(t){let r=new Set;for(let i of t.targets)for(let o=i.startPos;o<=i.endPos;o++)r.add(o);return r}updateProgressAcrossSteps(){let t=0;for(let r=0;r<this._slides.length;r++){let i=this._slides[r],o=this.getResponseForStep(r),a=new Set(o.selectedIndices??[]),s=this.getTargetIndices(i);for(let l of s)a.has(l)&&t++}this.setProgress(t)}getCurrentState(){return this.saveCurrentStepResponse(),{step:this._currentStep,responses:this._responses}}isInteractionComplete(){return this.getProgress().current===this.getProgress().total}onHint(){this.saveCurrentStepResponse();let t=this._slides[this._currentStep],r=this.getResponseForStep(this._currentStep),i=new Set(r.selectedIndices??[]),o=[];for(let a of t.targets)for(let s=a.startPos;s<=a.endPos;s++)i.has(s)||o.push(s);if(o.length>0){let a=o[Math.floor(Math.random()*o.length)];this.emitHintShown(`Try selecting: "${t.parts[a]}"`);return}this.emitHintShown("This step is complete. Move to another step or submit.")}grade(){this.saveCurrentStepResponse();let t=0,r=0,i={};for(let s=0;s<this._slides.length;s++){let l=this._slides[s],c=this.getResponseForStep(s),d=Ie(l,c);t+=d.correct,r+=d.total,i[s]=Le(l,c)}this._gradingByStep=i,this._isGraded=!0;let o=this._gradingByStep[this._currentStep];return o&&this._$text.setGradingState(o),{score:r>0?Math.round(t/r*100):0,correct:t,total:r}}submit(){super.submit();let t=this.grade();this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this._responses={},this._gradingByStep={},this._isGraded=!1,this._currentStep=0,this._$text&&(this._$text.reset(),this._$text.clearGradingState()),this.setProgress(0),this.render()}};customElements.get("sequential-mark-the-words")||customElements.define("sequential-mark-the-words",ne);var oe=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._textConfig={data:t,mode:"classification",variant:r.variant??"outline"},this.implementsProgress=!1}initialize(){}cleanup(){}onVariantChange(t){this.config.variant=t,this._textConfig.variant=t,this._$text&&this._$text.setAttribute("variant",t)}render(){this._textConfig.variant=this.config.variant,this._$text=document.createElement("edu-text"),this._$text.config=this._textConfig,this._$text.addEventListener("change",()=>{this.emitStateChange()}),this.innerHTML=`
3282
+ `,this.querySelector(".text-wrapper").appendChild(this._$text)}getTargetCountForSlide(t){let r=0;for(let i of t.targets)r+=i.endPos-i.startPos+1;return r}getTotalTargetCount(){return this._slides.reduce((t,r)=>t+this.getTargetCountForSlide(r),0)}saveCurrentStepResponse(){this._$text&&(this._responses[this._currentStep]=this._$text.getValue())}getResponseForStep(t){return this._responses[t]??{selectedIndices:[]}}getTargetIndices(t){let r=new Set;for(let i of t.targets)for(let o=i.startPos;o<=i.endPos;o++)r.add(o);return r}updateProgressAcrossSteps(){let t=0;for(let r=0;r<this._slides.length;r++){let i=this._slides[r],o=this.getResponseForStep(r),a=new Set(o.selectedIndices??[]),s=this.getTargetIndices(i);for(let l of s)a.has(l)&&t++}this.setProgress(t)}getCurrentState(){return this.saveCurrentStepResponse(),{step:this._currentStep,responses:this._responses}}isInteractionComplete(){return this.getProgress().current===this.getProgress().total}onHint(){this.saveCurrentStepResponse();let t=this._slides[this._currentStep],r=this.getResponseForStep(this._currentStep),i=new Set(r.selectedIndices??[]),o=[];for(let a of t.targets)for(let s=a.startPos;s<=a.endPos;s++)i.has(s)||o.push(s);if(o.length>0){let a=o[Math.floor(Math.random()*o.length)];this.emitHintShown(`Try selecting: "${t.parts[a]}"`);return}this.emitHintShown("This step is complete. Move to another step or submit.")}grade(){this.saveCurrentStepResponse();let t=0,r=0,i={};for(let s=0;s<this._slides.length;s++){let l=this._slides[s],c=this.getResponseForStep(s),d=Me(l,c);t+=d.correct,r+=d.total,i[s]=De(l,c)}this._gradingByStep=i,this._isGraded=!0;let o=this._gradingByStep[this._currentStep];return o&&this._$text.setGradingState(o),{score:r>0?Math.round(t/r*100):0,correct:t,total:r}}submit(){super.submit();let t=this.grade();this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this._responses={},this._gradingByStep={},this._isGraded=!1,this._currentStep=0,this._$text&&(this._$text.reset(),this._$text.clearGradingState()),this.setProgress(0),this.render()}};customElements.get("sequential-mark-the-words")||customElements.define("sequential-mark-the-words",oe);var ae=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._textConfig={data:t,mode:"classification",variant:r.variant??"outline"},this.implementsProgress=!1}initialize(){}cleanup(){}onVariantChange(t){this.config.variant=t,this._textConfig.variant=t,this._$text&&this._$text.setAttribute("variant",t)}render(){this._textConfig.variant=this.config.variant,this._$text=document.createElement("edu-text"),this._$text.config=this._textConfig,this._$text.addEventListener("change",()=>{this.emitStateChange()}),this.innerHTML=`
3283
3283
  <style>
3284
3284
  categorize-the-words {
3285
3285
  display: flex;
@@ -3308,7 +3308,7 @@ slot {
3308
3308
  <div class="text-container">
3309
3309
  <div class="text-wrapper"></div>
3310
3310
  </div>
3311
- `,this.querySelector(".text-wrapper").appendChild(this._$text)}getTargetIndices(){let t=new Set;for(let r of this.data.targets)for(let i of r.targets)for(let o=i.startPos;o<=i.endPos;o++)t.add(o);return t}getCurrentState(){return this._$text?this._$text.getValue():{wordCategories:{}}}isInteractionComplete(){let t=this.getCurrentState(),r=this.getTargetIndices();for(let i of r)if(!t.wordCategories[i])return!1;return!0}onHint(){let t=this.getCurrentState();for(let r of this.data.targets)for(let i of r.targets)for(let o=i.startPos;o<=i.endPos;o++)if(!t.wordCategories[o]){this.emitHintShown(`Try categorizing "${this.data.parts[o]}"`);return}this.emitHintShown("All target words are categorized.")}grade(){let t=this.getCurrentState(),r=Pe(this.data,t),i=Be(this.data,t);return this._$text&&this._$text.setGradingState(i),r}submit(){super.submit();let t=this.grade();this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$text&&(this._$text.reset(),this._$text.clearGradingState())}};customElements.get("categorize-the-words")||customElements.define("categorize-the-words",oe);var ae=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="sequential";this._slides=[];this._currentStep=0;this._responses={};this._gradingByStep={};this._isGraded=!1;if(this._slides=(Array.isArray(t)?t:[]).filter(i=>i.type==="classification"),this._slides.length===0){this.isValid=!1,this.errors="SequentialCategorizeTheWords requires at least one classification slide.";return}this._textConfig={data:this._slides[0],mode:"classification",variant:r.variant??"outline"},this.initializeProgress(this.getTotalTargetCount())}get slidesCount(){return this._slides.length}initialize(){}cleanup(){}onVariantChange(t){this.config.variant=t,this._textConfig.variant=t,this._$text&&this._$text.setAttribute("variant",t)}setSteps(t){this.saveCurrentStepResponse();let r=Math.max(0,Math.min(this._slides.length-1,t-1));r!==this._currentStep&&(this._currentStep=r,this.render())}render(){if(this._slides.length===0)return;this._textConfig={data:this._slides[this._currentStep],mode:"classification",variant:this.config.variant},this._$text=document.createElement("edu-text"),this._$text.config=this._textConfig;let t=this._responses[this._currentStep];t?.wordCategories&&this._$text.setState({wordCategories:t.wordCategories});let r=this._gradingByStep[this._currentStep];this._isGraded&&r&&this._$text.setGradingState(r),this._$text.addEventListener("change",()=>{this.saveCurrentStepResponse(),this.updateProgressAcrossSteps(),this._isGraded&&(delete this._gradingByStep[this._currentStep],this._$text.clearGradingState()),this.emitStateChange()}),this.innerHTML=`
3311
+ `,this.querySelector(".text-wrapper").appendChild(this._$text)}getTargetIndices(){let t=new Set;for(let r of this.data.targets)for(let i of r.targets)for(let o=i.startPos;o<=i.endPos;o++)t.add(o);return t}getCurrentState(){return this._$text?this._$text.getValue():{wordCategories:{}}}isInteractionComplete(){let t=this.getCurrentState(),r=this.getTargetIndices();for(let i of r)if(!t.wordCategories[i])return!1;return!0}onHint(){let t=this.getCurrentState();for(let r of this.data.targets)for(let i of r.targets)for(let o=i.startPos;o<=i.endPos;o++)if(!t.wordCategories[o]){this.emitHintShown(`Try categorizing "${this.data.parts[o]}"`);return}this.emitHintShown("All target words are categorized.")}grade(){let t=this.getCurrentState(),r=Be(this.data,t),i=qe(this.data,t);return this._$text&&this._$text.setGradingState(i),r}submit(){super.submit();let t=this.grade();this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$text&&(this._$text.reset(),this._$text.clearGradingState())}};customElements.get("categorize-the-words")||customElements.define("categorize-the-words",ae);var se=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="sequential";this._slides=[];this._currentStep=0;this._responses={};this._gradingByStep={};this._isGraded=!1;if(this._slides=(Array.isArray(t)?t:[]).filter(i=>i.type==="classification"),this._slides.length===0){this.isValid=!1,this.errors="SequentialCategorizeTheWords requires at least one classification slide.";return}this._textConfig={data:this._slides[0],mode:"classification",variant:r.variant??"outline"},this.initializeProgress(this.getTotalTargetCount())}get slidesCount(){return this._slides.length}initialize(){}cleanup(){}onVariantChange(t){this.config.variant=t,this._textConfig.variant=t,this._$text&&this._$text.setAttribute("variant",t)}setSteps(t){this.saveCurrentStepResponse();let r=Math.max(0,Math.min(this._slides.length-1,t-1));r!==this._currentStep&&(this._currentStep=r,this.render())}render(){if(this._slides.length===0)return;this._textConfig={data:this._slides[this._currentStep],mode:"classification",variant:this.config.variant},this._$text=document.createElement("edu-text"),this._$text.config=this._textConfig;let t=this._responses[this._currentStep];t?.wordCategories&&this._$text.setState({wordCategories:t.wordCategories});let r=this._gradingByStep[this._currentStep];this._isGraded&&r&&this._$text.setGradingState(r),this._$text.addEventListener("change",()=>{this.saveCurrentStepResponse(),this.updateProgressAcrossSteps(),this._isGraded&&(delete this._gradingByStep[this._currentStep],this._$text.clearGradingState()),this.emitStateChange()}),this.innerHTML=`
3312
3312
  <style>
3313
3313
  sequential-categorize-the-words {
3314
3314
  display: flex;
@@ -3337,7 +3337,7 @@ slot {
3337
3337
  <div class="text-container">
3338
3338
  <div class="text-wrapper"></div>
3339
3339
  </div>
3340
- `,this.querySelector(".text-wrapper").appendChild(this._$text)}getTargetIndices(t){let r=new Set;for(let i of t.targets)for(let o of i.targets)for(let a=o.startPos;a<=o.endPos;a++)r.add(a);return r}getTotalTargetCount(){return this._slides.reduce((t,r)=>t+this.getTargetIndices(r).size,0)}saveCurrentStepResponse(){this._$text&&(this._responses[this._currentStep]=this._$text.getValue())}getResponseForStep(t){return this._responses[t]??{wordCategories:{}}}updateProgressAcrossSteps(){let t=0;for(let r=0;r<this._slides.length;r++){let i=this._slides[r],o=this.getResponseForStep(r),a=this.getTargetIndices(i);for(let s of a)o.wordCategories[s]&&t++}this.setProgress(t)}getCurrentState(){return this.saveCurrentStepResponse(),{step:this._currentStep,responses:this._responses}}isInteractionComplete(){return this.getProgress().current===this.getProgress().total}onHint(){this.saveCurrentStepResponse();let t=this._slides[this._currentStep],r=this.getResponseForStep(this._currentStep),i=this.getTargetIndices(t);for(let o of i)if(!r.wordCategories[o]){this.emitHintShown(`Try categorizing "${t.parts[o]}"`);return}this.emitHintShown("This step is complete. Move to another step or submit.")}grade(){this.saveCurrentStepResponse();let t=0,r=0,i={};for(let s=0;s<this._slides.length;s++){let l=this._slides[s],c=this.getResponseForStep(s),d=Pe(l,c);t+=d.correct,r+=d.total,i[s]=Be(l,c)}this._gradingByStep=i,this._isGraded=!0;let o=this._gradingByStep[this._currentStep];return o&&this._$text.setGradingState(o),{score:r>0?Math.round(t/r*100):0,correct:t,total:r}}submit(){super.submit();let t=this.grade();this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this._responses={},this._gradingByStep={},this._isGraded=!1,this._currentStep=0,this._$text&&(this._$text.reset(),this._$text.clearGradingState()),this.setProgress(0),this.render()}};customElements.get("sequential-categorize-the-words")||customElements.define("sequential-categorize-the-words",ae);var se=class extends x{constructor(t,r,i){super(t,r);this.interactionMechanic="static";this._expectedTransformations=i??{},Object.keys(this._expectedTransformations).length===0&&t.targets.forEach((o,a)=>{this._expectedTransformations[a]=o.words}),this._textConfig={data:t,mode:"transformation",variant:r.variant??"outline"},this.implementsProgress=!1}initialize(){}cleanup(){}onVariantChange(t){this.config.variant=t,this._textConfig.variant=t,this._$text&&this._$text.setAttribute("variant",t)}render(){this._textConfig.variant=this.config.variant,this._$text=document.createElement("edu-text"),this._$text.config=this._textConfig,this._$text.addEventListener("change",()=>{this.emitStateChange()}),this.innerHTML=`
3340
+ `,this.querySelector(".text-wrapper").appendChild(this._$text)}getTargetIndices(t){let r=new Set;for(let i of t.targets)for(let o of i.targets)for(let a=o.startPos;a<=o.endPos;a++)r.add(a);return r}getTotalTargetCount(){return this._slides.reduce((t,r)=>t+this.getTargetIndices(r).size,0)}saveCurrentStepResponse(){this._$text&&(this._responses[this._currentStep]=this._$text.getValue())}getResponseForStep(t){return this._responses[t]??{wordCategories:{}}}updateProgressAcrossSteps(){let t=0;for(let r=0;r<this._slides.length;r++){let i=this._slides[r],o=this.getResponseForStep(r),a=this.getTargetIndices(i);for(let s of a)o.wordCategories[s]&&t++}this.setProgress(t)}getCurrentState(){return this.saveCurrentStepResponse(),{step:this._currentStep,responses:this._responses}}isInteractionComplete(){return this.getProgress().current===this.getProgress().total}onHint(){this.saveCurrentStepResponse();let t=this._slides[this._currentStep],r=this.getResponseForStep(this._currentStep),i=this.getTargetIndices(t);for(let o of i)if(!r.wordCategories[o]){this.emitHintShown(`Try categorizing "${t.parts[o]}"`);return}this.emitHintShown("This step is complete. Move to another step or submit.")}grade(){this.saveCurrentStepResponse();let t=0,r=0,i={};for(let s=0;s<this._slides.length;s++){let l=this._slides[s],c=this.getResponseForStep(s),d=Be(l,c);t+=d.correct,r+=d.total,i[s]=qe(l,c)}this._gradingByStep=i,this._isGraded=!0;let o=this._gradingByStep[this._currentStep];return o&&this._$text.setGradingState(o),{score:r>0?Math.round(t/r*100):0,correct:t,total:r}}submit(){super.submit();let t=this.grade();this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this._responses={},this._gradingByStep={},this._isGraded=!1,this._currentStep=0,this._$text&&(this._$text.reset(),this._$text.clearGradingState()),this.setProgress(0),this.render()}};customElements.get("sequential-categorize-the-words")||customElements.define("sequential-categorize-the-words",se);var le=class extends x{constructor(t,r,i){super(t,r);this.interactionMechanic="static";this._expectedTransformations=i??{},Object.keys(this._expectedTransformations).length===0&&t.targets.forEach((o,a)=>{this._expectedTransformations[a]=o.words}),this._textConfig={data:t,mode:"transformation",variant:r.variant??"outline"},this.implementsProgress=!1}initialize(){}cleanup(){}onVariantChange(t){this.config.variant=t,this._textConfig.variant=t,this._$text&&this._$text.setAttribute("variant",t)}render(){this._textConfig.variant=this.config.variant,this._$text=document.createElement("edu-text"),this._$text.config=this._textConfig,this._$text.addEventListener("change",()=>{this.emitStateChange()}),this.innerHTML=`
3341
3341
  <style>
3342
3342
  edu-text {
3343
3343
  display: flex;
@@ -3366,7 +3366,7 @@ slot {
3366
3366
  <div class="text-container">
3367
3367
  <div class="text-wrapper"></div>
3368
3368
  </div>
3369
- `,this.querySelector(".text-wrapper").appendChild(this._$text)}getCurrentState(){return this._$text?this._$text.getValue():{transformations:{}}}isInteractionComplete(){let r=this.getCurrentState().transformations??{};for(let i=0;i<this.data.targets.length;i++){let o=r[i];if(!o||o.length===0)return!1}return!0}onHint(){let r=this.getCurrentState().transformations??{};for(let i=0;i<this.data.targets.length;i++)if(!r[i]||r[i].length===0){let a=this.data.targets[i].words.join(" "),s=this._expectedTransformations[i]?.join(" ")||a;this.emitHintShown(`Transform "${a}" to "${s}"`);return}this.emitHintShown("All transformations have been attempted!")}getUserData(){return this.getCurrentState()}submit(){super.submit();let t=this.grade();this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}grade(){let t=this.getUserData(),r=Me(this.data,t,this._expectedTransformations),i={};for(let o=0;o<this.data.targets.length;o++){let a=this._expectedTransformations[o],s=t.transformations?.[o];if(!s)i[o]="missed";else if(a&&a.length===s.length){let l=a.every((c,d)=>c.toLowerCase().trim()===(s[d]||"").toLowerCase().trim());i[o]=l?"correct":"wrong"}else i[o]="wrong"}return this._$text&&this._$text.setGradingState(i),r}reset(){super.reset(),this._$text&&(this._$text.reset(),this._$text.clearGradingState())}setExpectedTransformations(t){this._expectedTransformations=t}};customElements.get("text-transformation")||customElements.define("text-transformation",se);var le=class extends x{constructor(t,r,i){super(t,r);this.interactionMechanic="sequential";this._slides=[];this._currentStep=0;this._responses={};this._gradingByStep={};this._isGraded=!1;this._expectedByStep={};if(this._slides=(Array.isArray(t)?t:[]).filter(o=>o.type==="base"),this._slides.length===0){this.isValid=!1,this.errors="SequentialTextTransformation requires at least one base slide.";return}this._textConfig={data:this._slides[0],mode:"transformation",variant:r.variant??"outline"},this._expectedByStep=i??this.buildDefaultExpectations(),this.initializeProgress(this.getTotalTargetCount())}get slidesCount(){return this._slides.length}initialize(){}cleanup(){}onVariantChange(t){this.config.variant=t,this._textConfig.variant=t,this._$text&&this._$text.setAttribute("variant",t)}setSteps(t){this.saveCurrentStepResponse();let r=Math.max(0,Math.min(this._slides.length-1,t-1));r!==this._currentStep&&(this._currentStep=r,this.render())}render(){if(this._slides.length===0)return;this._textConfig={data:this._slides[this._currentStep],mode:"transformation",variant:this.config.variant},this._$text=document.createElement("edu-text"),this._$text.config=this._textConfig;let t=this._responses[this._currentStep];t?.transformations&&this._$text.setState({transformations:t.transformations});let r=this._gradingByStep[this._currentStep];this._isGraded&&r&&this._$text.setGradingState(r),this._$text.addEventListener("change",()=>{this.saveCurrentStepResponse(),this.updateProgressAcrossSteps(),this._isGraded&&(delete this._gradingByStep[this._currentStep],this._$text.clearGradingState()),this.emitStateChange()}),this.innerHTML=`
3369
+ `,this.querySelector(".text-wrapper").appendChild(this._$text)}getCurrentState(){return this._$text?this._$text.getValue():{transformations:{}}}isInteractionComplete(){let r=this.getCurrentState().transformations??{};for(let i=0;i<this.data.targets.length;i++){let o=r[i];if(!o||o.length===0)return!1}return!0}onHint(){let r=this.getCurrentState().transformations??{};for(let i=0;i<this.data.targets.length;i++)if(!r[i]||r[i].length===0){let a=this.data.targets[i].words.join(" "),s=this._expectedTransformations[i]?.join(" ")||a;this.emitHintShown(`Transform "${a}" to "${s}"`);return}this.emitHintShown("All transformations have been attempted!")}getUserData(){return this.getCurrentState()}submit(){super.submit();let t=this.grade();this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}grade(){let t=this.getUserData(),r=Le(this.data,t,this._expectedTransformations),i={};for(let o=0;o<this.data.targets.length;o++){let a=this._expectedTransformations[o],s=t.transformations?.[o];if(!s)i[o]="missed";else if(a&&a.length===s.length){let l=a.every((c,d)=>c.toLowerCase().trim()===(s[d]||"").toLowerCase().trim());i[o]=l?"correct":"wrong"}else i[o]="wrong"}return this._$text&&this._$text.setGradingState(i),r}reset(){super.reset(),this._$text&&(this._$text.reset(),this._$text.clearGradingState())}setExpectedTransformations(t){this._expectedTransformations=t}};customElements.get("text-transformation")||customElements.define("text-transformation",le);var ce=class extends x{constructor(t,r,i){super(t,r);this.interactionMechanic="sequential";this._slides=[];this._currentStep=0;this._responses={};this._gradingByStep={};this._isGraded=!1;this._expectedByStep={};if(this._slides=(Array.isArray(t)?t:[]).filter(o=>o.type==="base"),this._slides.length===0){this.isValid=!1,this.errors="SequentialTextTransformation requires at least one base slide.";return}this._textConfig={data:this._slides[0],mode:"transformation",variant:r.variant??"outline"},this._expectedByStep=i??this.buildDefaultExpectations(),this.initializeProgress(this.getTotalTargetCount())}get slidesCount(){return this._slides.length}initialize(){}cleanup(){}onVariantChange(t){this.config.variant=t,this._textConfig.variant=t,this._$text&&this._$text.setAttribute("variant",t)}setSteps(t){this.saveCurrentStepResponse();let r=Math.max(0,Math.min(this._slides.length-1,t-1));r!==this._currentStep&&(this._currentStep=r,this.render())}render(){if(this._slides.length===0)return;this._textConfig={data:this._slides[this._currentStep],mode:"transformation",variant:this.config.variant},this._$text=document.createElement("edu-text"),this._$text.config=this._textConfig;let t=this._responses[this._currentStep];t?.transformations&&this._$text.setState({transformations:t.transformations});let r=this._gradingByStep[this._currentStep];this._isGraded&&r&&this._$text.setGradingState(r),this._$text.addEventListener("change",()=>{this.saveCurrentStepResponse(),this.updateProgressAcrossSteps(),this._isGraded&&(delete this._gradingByStep[this._currentStep],this._$text.clearGradingState()),this.emitStateChange()}),this.innerHTML=`
3370
3370
  <style>
3371
3371
  sequential-text-transformation {
3372
3372
  display: flex;
@@ -3395,7 +3395,7 @@ slot {
3395
3395
  <div class="text-container">
3396
3396
  <div class="text-wrapper"></div>
3397
3397
  </div>
3398
- `,this.querySelector(".text-wrapper").appendChild(this._$text)}getTotalTargetCount(){return this._slides.reduce((t,r)=>t+r.targets.length,0)}buildDefaultExpectations(){let t={};for(let r=0;r<this._slides.length;r++){let i=this._slides[r];t[r]={};for(let o=0;o<i.targets.length;o++)t[r][o]=i.targets[o].words}return t}getExpectedForStep(t){return this._expectedByStep[t]??{}}saveCurrentStepResponse(){this._$text&&(this._responses[this._currentStep]=this._$text.getValue())}getResponseForStep(t){return this._responses[t]??{transformations:{}}}updateProgressAcrossSteps(){let t=0;for(let r=0;r<this._slides.length;r++){let i=this._slides[r],a=this.getResponseForStep(r).transformations??{};t+=i.targets.filter((s,l)=>{let c=a[l];return Array.isArray(c)&&c.length>0}).length}this.setProgress(t)}getCurrentState(){return this.saveCurrentStepResponse(),{step:this._currentStep,responses:this._responses}}isInteractionComplete(){return this.getProgress().current===this.getProgress().total}onHint(){this.saveCurrentStepResponse();let t=this._slides[this._currentStep],i=this.getResponseForStep(this._currentStep).transformations??{},o=this.getExpectedForStep(this._currentStep);for(let a=0;a<t.targets.length;a++)if(!i[a]||i[a].length===0){let s=t.targets[a].words.join(" "),l=o[a]?.join(" ")||s;this.emitHintShown(`Transform "${s}" to "${l}"`);return}this.emitHintShown("This step is complete. Move to another step or submit.")}grade(){this.saveCurrentStepResponse();let t=0,r=0,i={};for(let s=0;s<this._slides.length;s++){let l=this._slides[s],c=this.getResponseForStep(s),d=this.getExpectedForStep(s),u=Me(l,c,d);t+=u.correct,r+=u.total,i[s]=vt(l,c,d)}this._gradingByStep=i,this._isGraded=!0;let o=this._gradingByStep[this._currentStep];return o&&this._$text.setGradingState(o),{score:r>0?Math.round(t/r*100):0,correct:t,total:r}}submit(){super.submit();let t=this.grade();this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this._responses={},this._gradingByStep={},this._isGraded=!1,this._currentStep=0,this._$text&&(this._$text.reset(),this._$text.clearGradingState()),this.setProgress(0),this.render()}setExpectedTransformationsByStep(t){this._expectedByStep=t}};customElements.get("sequential-text-transformation")||customElements.define("sequential-text-transformation",le);var ce=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._textConfig={data:t,mode:"blanks",variant:r.variant??"outline"},this.initializeProgress(t.targets.length)}initialize(){}cleanup(){}onVariantChange(t){this.config.variant=t,this._textConfig.variant=t,this._$text&&this._$text.setAttribute("variant",t)}render(){this._textConfig.variant=this.config.variant,this._$text=document.createElement("edu-text"),this._$text.config=this._textConfig,this._$text.addEventListener("change",()=>{this.updateProgressBasedOnInputs(),this.emitStateChange()}),this.innerHTML=`
3398
+ `,this.querySelector(".text-wrapper").appendChild(this._$text)}getTotalTargetCount(){return this._slides.reduce((t,r)=>t+r.targets.length,0)}buildDefaultExpectations(){let t={};for(let r=0;r<this._slides.length;r++){let i=this._slides[r];t[r]={};for(let o=0;o<i.targets.length;o++)t[r][o]=i.targets[o].words}return t}getExpectedForStep(t){return this._expectedByStep[t]??{}}saveCurrentStepResponse(){this._$text&&(this._responses[this._currentStep]=this._$text.getValue())}getResponseForStep(t){return this._responses[t]??{transformations:{}}}updateProgressAcrossSteps(){let t=0;for(let r=0;r<this._slides.length;r++){let i=this._slides[r],a=this.getResponseForStep(r).transformations??{};t+=i.targets.filter((s,l)=>{let c=a[l];return Array.isArray(c)&&c.length>0}).length}this.setProgress(t)}getCurrentState(){return this.saveCurrentStepResponse(),{step:this._currentStep,responses:this._responses}}isInteractionComplete(){return this.getProgress().current===this.getProgress().total}onHint(){this.saveCurrentStepResponse();let t=this._slides[this._currentStep],i=this.getResponseForStep(this._currentStep).transformations??{},o=this.getExpectedForStep(this._currentStep);for(let a=0;a<t.targets.length;a++)if(!i[a]||i[a].length===0){let s=t.targets[a].words.join(" "),l=o[a]?.join(" ")||s;this.emitHintShown(`Transform "${s}" to "${l}"`);return}this.emitHintShown("This step is complete. Move to another step or submit.")}grade(){this.saveCurrentStepResponse();let t=0,r=0,i={};for(let s=0;s<this._slides.length;s++){let l=this._slides[s],c=this.getResponseForStep(s),d=this.getExpectedForStep(s),u=Le(l,c,d);t+=u.correct,r+=u.total,i[s]=wt(l,c,d)}this._gradingByStep=i,this._isGraded=!0;let o=this._gradingByStep[this._currentStep];return o&&this._$text.setGradingState(o),{score:r>0?Math.round(t/r*100):0,correct:t,total:r}}submit(){super.submit();let t=this.grade();this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this._responses={},this._gradingByStep={},this._isGraded=!1,this._currentStep=0,this._$text&&(this._$text.reset(),this._$text.clearGradingState()),this.setProgress(0),this.render()}setExpectedTransformationsByStep(t){this._expectedByStep=t}};customElements.get("sequential-text-transformation")||customElements.define("sequential-text-transformation",ce);var de=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="static";this._textConfig={data:t,mode:"blanks",variant:r.variant??"outline"},this.initializeProgress(t.targets.length)}initialize(){}cleanup(){}onVariantChange(t){this.config.variant=t,this._textConfig.variant=t,this._$text&&this._$text.setAttribute("variant",t)}render(){this._textConfig.variant=this.config.variant,this._$text=document.createElement("edu-text"),this._$text.config=this._textConfig,this._$text.addEventListener("change",()=>{this.updateProgressBasedOnInputs(),this.emitStateChange()}),this.innerHTML=`
3399
3399
  <style>
3400
3400
  fill-blanks {
3401
3401
  display: flex;
@@ -3424,7 +3424,7 @@ slot {
3424
3424
  <div class="text-container">
3425
3425
  <div class="text-wrapper"></div>
3426
3426
  </div>
3427
- `,this.querySelector(".text-wrapper").appendChild(this._$text)}getCurrentState(){return this._$text?this._$text.getValue():{inputValues:{}}}updateProgressBasedOnInputs(){let r=this.getCurrentState().inputValues??{},i=this.data.targets.filter(o=>{let a=r[o.id];return a!=null&&String(a).trim()!==""}).length;this.setProgress(i)}isInteractionComplete(){return this.getProgress().current===this.getProgress().total}onHint(){let r=this.getCurrentState().inputValues??{},i=this.data.targets.find(o=>{let a=r[o.id];return a==null||String(a).trim()===""});if(!i){this.emitHintShown("All blanks are filled. Submit to check answers.");return}this.emitHintShown(this.getHintText(i))}getHintText(t){switch(t.expectedValue.type){case"text":return"Fill the missing text blank.";case"number":return"Fill the numeric blank.";case"select":return"Choose the right option in the select blank.";case"date":return"Fill the date blank in the expected format.";case"time":return"Fill the time blank in the expected format.";default:return"Complete the next blank."}}grade(){let t=this.getCurrentState(),r=De(this.data,t),i=Re(this.data,t);return this._$text&&this._$text.setGradingState(i),r}submit(){super.submit();let t=this.grade();this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$text&&(this._$text.reset(),this._$text.clearGradingState())}};customElements.get("fill-blanks")||customElements.define("fill-blanks",ce);var de=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="sequential";this._slides=[];this._currentStep=0;this._responses={};this._gradingByStep={};this._isGraded=!1;if(this._slides=(Array.isArray(t)?t:[]).filter(i=>i.type==="blanks"),this._slides.length===0){this.isValid=!1,this.errors="SequentialFillBlanks requires at least one blanks slide.";return}this._textConfig={data:this._slides[0],mode:"blanks",variant:r.variant??"outline"},this.initializeProgress(this.getTotalTargetCount())}get slidesCount(){return this._slides.length}initialize(){}cleanup(){}onVariantChange(t){this.config.variant=t,this._textConfig.variant=t,this._$text&&this._$text.setAttribute("variant",t)}setSteps(t){this.saveCurrentStepResponse();let r=Math.max(0,Math.min(this._slides.length-1,t-1));r!==this._currentStep&&(this._currentStep=r,this.render())}render(){if(this._slides.length===0)return;this._textConfig={data:this._slides[this._currentStep],mode:"blanks",variant:this.config.variant},this._$text=document.createElement("edu-text"),this._$text.config=this._textConfig;let t=this._responses[this._currentStep];t?.inputValues&&this._$text.setState({inputValues:t.inputValues});let r=this._gradingByStep[this._currentStep];this._isGraded&&r&&this._$text.setGradingState(r),this._$text.addEventListener("change",()=>{this.saveCurrentStepResponse(),this.updateProgressAcrossSteps(),this._isGraded&&(delete this._gradingByStep[this._currentStep],this._$text.clearGradingState()),this.emitStateChange()}),this.innerHTML=`
3427
+ `,this.querySelector(".text-wrapper").appendChild(this._$text)}getCurrentState(){return this._$text?this._$text.getValue():{inputValues:{}}}updateProgressBasedOnInputs(){let r=this.getCurrentState().inputValues??{},i=this.data.targets.filter(o=>{let a=r[o.id];return a!=null&&String(a).trim()!==""}).length;this.setProgress(i)}isInteractionComplete(){return this.getProgress().current===this.getProgress().total}onHint(){let r=this.getCurrentState().inputValues??{},i=this.data.targets.find(o=>{let a=r[o.id];return a==null||String(a).trim()===""});if(!i){this.emitHintShown("All blanks are filled. Submit to check answers.");return}this.emitHintShown(this.getHintText(i))}getHintText(t){switch(t.expectedValue.type){case"text":return"Fill the missing text blank.";case"number":return"Fill the numeric blank.";case"select":return"Choose the right option in the select blank.";case"date":return"Fill the date blank in the expected format.";case"time":return"Fill the time blank in the expected format.";default:return"Complete the next blank."}}grade(){let t=this.getCurrentState(),r=Re(this.data,t),i=Pe(this.data,t);return this._$text&&this._$text.setGradingState(i),r}submit(){super.submit();let t=this.grade();this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this._$text&&(this._$text.reset(),this._$text.clearGradingState())}};customElements.get("fill-blanks")||customElements.define("fill-blanks",de);var ue=class extends x{constructor(t,r){super(t,r);this.interactionMechanic="sequential";this._slides=[];this._currentStep=0;this._responses={};this._gradingByStep={};this._isGraded=!1;if(this._slides=(Array.isArray(t)?t:[]).filter(i=>i.type==="blanks"),this._slides.length===0){this.isValid=!1,this.errors="SequentialFillBlanks requires at least one blanks slide.";return}this._textConfig={data:this._slides[0],mode:"blanks",variant:r.variant??"outline"},this.initializeProgress(this.getTotalTargetCount())}get slidesCount(){return this._slides.length}initialize(){}cleanup(){}onVariantChange(t){this.config.variant=t,this._textConfig.variant=t,this._$text&&this._$text.setAttribute("variant",t)}setSteps(t){this.saveCurrentStepResponse();let r=Math.max(0,Math.min(this._slides.length-1,t-1));r!==this._currentStep&&(this._currentStep=r,this.render())}render(){if(this._slides.length===0)return;this._textConfig={data:this._slides[this._currentStep],mode:"blanks",variant:this.config.variant},this._$text=document.createElement("edu-text"),this._$text.config=this._textConfig;let t=this._responses[this._currentStep];t?.inputValues&&this._$text.setState({inputValues:t.inputValues});let r=this._gradingByStep[this._currentStep];this._isGraded&&r&&this._$text.setGradingState(r),this._$text.addEventListener("change",()=>{this.saveCurrentStepResponse(),this.updateProgressAcrossSteps(),this._isGraded&&(delete this._gradingByStep[this._currentStep],this._$text.clearGradingState()),this.emitStateChange()}),this.innerHTML=`
3428
3428
  <style>
3429
3429
  sequential-fill-blanks {
3430
3430
  display: flex;
@@ -3460,8 +3460,8 @@ slot {
3460
3460
  <div class="text-container">
3461
3461
  <div class="text-wrapper"></div>
3462
3462
  </div>
3463
- `,this.querySelector(".text-wrapper").appendChild(this._$text)}getTotalTargetCount(){return this._slides.reduce((t,r)=>t+r.targets.length,0)}saveCurrentStepResponse(){this._$text&&(this._responses[this._currentStep]=this._$text.getValue())}getResponseForStep(t){return this._responses[t]??{inputValues:{}}}updateProgressAcrossSteps(){let t=0;for(let r=0;r<this._slides.length;r++){let i=this._slides[r],a=this.getResponseForStep(r).inputValues??{};t+=i.targets.filter(s=>{let l=a[s.id];return l!=null&&String(l).trim()!==""}).length}this.setProgress(t)}getCurrentState(){return this.saveCurrentStepResponse(),{step:this._currentStep,responses:this._responses}}isInteractionComplete(){return this.getProgress().current===this.getProgress().total}onHint(){this.saveCurrentStepResponse();let t=this._slides[this._currentStep],i=this.getResponseForStep(this._currentStep).inputValues??{},o=t.targets.find(a=>{let s=i[a.id];return s==null||String(s).trim()===""});if(!o){this.emitHintShown("This step is complete. Move to another step or submit.");return}this.emitHintShown(`Complete the ${o.expectedValue.type} input on this step.`)}grade(){this.saveCurrentStepResponse();let t=0,r=0,i={};for(let s=0;s<this._slides.length;s++){let l=this._slides[s],c=this.getResponseForStep(s),d=De(l,c);t+=d.correct,r+=d.total,i[s]=Re(l,c)}this._gradingByStep=i,this._isGraded=!0;let o=this._gradingByStep[this._currentStep];return o&&this._$text.setGradingState(o),{score:r>0?Math.round(t/r*100):0,correct:t,total:r}}submit(){super.submit();let t=this.grade();this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this._responses={},this._gradingByStep={},this._isGraded=!1,this._currentStep=0,this._$text&&(this._$text.reset(),this._$text.clearGradingState()),this.setProgress(0),this.render()}};customElements.get("sequential-fill-blanks")||customElements.define("sequential-fill-blanks",de);function da(e){let n={};if(!e)return n.data="Data is required",{ok:!1,errors:n};if(e.type!=="seriation"&&(n.type='Data type must be "seriation"'),!Array.isArray(e.items))return n.items="Items must be an array",{ok:!1,errors:n};e.items.length<2&&(n.items="At least 2 items are required for seriation"),e.items.some(i=>typeof i!="string"||i.trim()==="")&&(n.items="All items must be non-empty strings"),new Set(e.items).size!==e.items.length&&(n.items="All items must be unique (duplicates found)");let r=Object.keys(n).length===0;return{ok:r,errors:r?null:n}}function xt(e,n,t){let r=0,i=0,o=e.length;e.forEach((s,l)=>{let c=n.indexOf(s),d=t.querySelector(`[data-item="${s}"]`);if(c===-1){d&&(d.chipState="wrong");return}let u=Math.abs(c-l);u===0?(r+=100,i++,d&&(d.chipState="correct")):u===1?(r+=50,d&&(d.chipState="missed")):d&&(d.chipState="wrong")});let a=o>0?r/o:0;return console.log(`Seriation Score: ${a.toFixed(1)}% (${i}/${o} in correct position)`),{score:a,correct:i,total:o,answerKey:e,userResponse:n}}function ua(e){try{if(!e||typeof e!="string")return{ok:!1,errors:{input:"Input must be a non-empty string"}};let n=e.trim();if(n.length===0)return{ok:!1,errors:{input:"Input cannot be empty"}};let t=[];return n.includes("|")?t=n.split("|").map(i=>i.trim()).filter(i=>i.length>0):t=n.split(`
3464
- `).map(i=>i.replace(/^\s*[\d\w]+[\.\)]\s*/,"").trim()).filter(i=>i.length>0),t.length<2?{ok:!1,errors:{items:"At least 2 items are required for seriation"}}:{ok:!0,data:{type:"seriation",items:t}}}catch(n){return{ok:!1,errors:{"Parse Error":`${n instanceof Error?n.message:String(n)}`}}}}var ue=class extends x{constructor(t,r,i){super(t,r,i);this.interactionMechanic="static";this.currentOrder=[];this.isGraded=!1;this.draggedRowIndex=null;this.dragOverRowIndex=null;this.isDragging=!1;this.draggedRow=null;this.dragOffsetY=0;this.MAX_ITEMS=10;this.MIN_ITEM_HEIGHT=44;if(!this.isValid||!this.data||!this.config)return;let o=this.data.items;this.data.items=o,this.config.shuffle?this.currentOrder=S([...this.data.items]):this.currentOrder=[...this.data.items],this.implementsProgress=!1,this.variant=this.config.variant}initialize(){this.boundPointerMove=this.handlePointerMove.bind(this),this.boundPointerUp=this.handlePointerUp.bind(this),window.addEventListener("pointermove",this.boundPointerMove),window.addEventListener("pointerup",this.boundPointerUp)}cleanup(){window.removeEventListener("pointermove",this.boundPointerMove),window.removeEventListener("pointerup",this.boundPointerUp)}onVariantChange(t){this.querySelectorAll("edu-chip").forEach(r=>{r.variant!==void 0&&(r.variant=t)}),this.variant=t}render(){this.innerHTML=`
3463
+ `,this.querySelector(".text-wrapper").appendChild(this._$text)}getTotalTargetCount(){return this._slides.reduce((t,r)=>t+r.targets.length,0)}saveCurrentStepResponse(){this._$text&&(this._responses[this._currentStep]=this._$text.getValue())}getResponseForStep(t){return this._responses[t]??{inputValues:{}}}updateProgressAcrossSteps(){let t=0;for(let r=0;r<this._slides.length;r++){let i=this._slides[r],a=this.getResponseForStep(r).inputValues??{};t+=i.targets.filter(s=>{let l=a[s.id];return l!=null&&String(l).trim()!==""}).length}this.setProgress(t)}getCurrentState(){return this.saveCurrentStepResponse(),{step:this._currentStep,responses:this._responses}}isInteractionComplete(){return this.getProgress().current===this.getProgress().total}onHint(){this.saveCurrentStepResponse();let t=this._slides[this._currentStep],i=this.getResponseForStep(this._currentStep).inputValues??{},o=t.targets.find(a=>{let s=i[a.id];return s==null||String(s).trim()===""});if(!o){this.emitHintShown("This step is complete. Move to another step or submit.");return}this.emitHintShown(`Complete the ${o.expectedValue.type} input on this step.`)}grade(){this.saveCurrentStepResponse();let t=0,r=0,i={};for(let s=0;s<this._slides.length;s++){let l=this._slides[s],c=this.getResponseForStep(s),d=Re(l,c);t+=d.correct,r+=d.total,i[s]=Pe(l,c)}this._gradingByStep=i,this._isGraded=!0;let o=this._gradingByStep[this._currentStep];return o&&this._$text.setGradingState(o),{score:r>0?Math.round(t/r*100):0,correct:t,total:r}}submit(){super.submit();let t=this.grade();this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0}))}reset(){super.reset(),this._responses={},this._gradingByStep={},this._isGraded=!1,this._currentStep=0,this._$text&&(this._$text.reset(),this._$text.clearGradingState()),this.setProgress(0),this.render()}};customElements.get("sequential-fill-blanks")||customElements.define("sequential-fill-blanks",ue);function ba(e){let n={};if(!e)return n.data="Data is required",{ok:!1,errors:n};if(e.type!=="seriation"&&(n.type='Data type must be "seriation"'),!Array.isArray(e.items))return n.items="Items must be an array",{ok:!1,errors:n};e.items.length<2&&(n.items="At least 2 items are required for seriation"),e.items.some(i=>typeof i!="string"||i.trim()==="")&&(n.items="All items must be non-empty strings"),new Set(e.items).size!==e.items.length&&(n.items="All items must be unique (duplicates found)");let r=Object.keys(n).length===0;return{ok:r,errors:r?null:n}}function yt(e,n,t){let r=0,i=0,o=e.length;e.forEach((s,l)=>{let c=n.indexOf(s),d=t.querySelector(`[data-item="${s}"]`);if(c===-1){d&&(d.chipState="wrong");return}let u=Math.abs(c-l);u===0?(r+=100,i++,d&&(d.chipState="correct")):u===1?(r+=50,d&&(d.chipState="missed")):d&&(d.chipState="wrong")});let a=o>0?r/o:0;return console.log(`Seriation Score: ${a.toFixed(1)}% (${i}/${o} in correct position)`),{score:a,correct:i,total:o,answerKey:e,userResponse:n}}function va(e){try{if(!e||typeof e!="string")return{ok:!1,errors:{input:"Input must be a non-empty string"}};let n=e.trim();if(n.length===0)return{ok:!1,errors:{input:"Input cannot be empty"}};let t=[];return n.includes("|")?t=n.split("|").map(i=>i.trim()).filter(i=>i.length>0):t=n.split(`
3464
+ `).map(i=>i.replace(/^\s*[\d\w]+[\.\)]\s*/,"").trim()).filter(i=>i.length>0),t.length<2?{ok:!1,errors:{items:"At least 2 items are required for seriation"}}:{ok:!0,data:{type:"seriation",items:t}}}catch(n){return{ok:!1,errors:{"Parse Error":`${n instanceof Error?n.message:String(n)}`}}}}var pe=class extends x{constructor(t,r,i){super(t,r,i);this.interactionMechanic="static";this.currentOrder=[];this.isGraded=!1;this.draggedRowIndex=null;this.dragOverRowIndex=null;this.isDragging=!1;this.draggedRow=null;this.dragOffsetY=0;this.MAX_ITEMS=10;this.MIN_ITEM_HEIGHT=44;if(!this.isValid||!this.data||!this.config)return;let o=this.data.items;this.data.items=o,this.config.shuffle?this.currentOrder=T([...this.data.items]):this.currentOrder=[...this.data.items],this.implementsProgress=!1,this.variant=this.config.variant}initialize(){this.boundPointerMove=this.handlePointerMove.bind(this),this.boundPointerUp=this.handlePointerUp.bind(this),window.addEventListener("pointermove",this.boundPointerMove),window.addEventListener("pointerup",this.boundPointerUp)}cleanup(){window.removeEventListener("pointermove",this.boundPointerMove),window.removeEventListener("pointerup",this.boundPointerUp)}onVariantChange(t){this.querySelectorAll("edu-chip").forEach(r=>{r.variant!==void 0&&(r.variant=t)}),this.variant=t}render(){this.innerHTML=`
3465
3465
  <style>
3466
3466
  rank-order {
3467
3467
  display: flex;
@@ -3680,7 +3680,7 @@ slot {
3680
3680
  <div class="container">
3681
3681
  <div class="rows-container"></div>
3682
3682
  </div>
3683
- `,this.$container=this.querySelector(".container"),this.$rowsContainer=this.querySelector(".rows-container"),this.renderRows()}renderRows(){this.$rowsContainer.innerHTML="",this.currentOrder.forEach((t,r)=>{let i=document.createElement("div");i.className="row",i.dataset.index=String(r);let o=document.createElement("div");o.className="chip-wrapper";let a=document.createElement("edu-chip");a.variant=this.variant,a.dataset.item=t,a.prefix=String(r+1),a.draggable=!0,D(t,a,this.assets?.assetsById),this.isGraded&&(this.data.items.indexOf(t)===r?a.chipState="correct":a.chipState="wrong"),o.appendChild(a);let s=document.createElement("div");s.className="controls";let l=this.createButton("up",r);s.appendChild(l),i.appendChild(o),i.appendChild(s),this.isGraded||i.addEventListener("pointerdown",c=>this.handlePointerDown(c,r)),this.$rowsContainer.appendChild(i)})}createButton(t,r){let i=document.createElement("button");i.className="btn",i.dataset.direction=t,i.dataset.index=String(r),i.setAttribute("aria-label",t==="up"?"Move up":"Move down"),t==="up"&&r===0&&(i.disabled=!0),t==="down"&&r===this.currentOrder.length-1&&(i.disabled=!0),this.isGraded&&(i.disabled=!0);let o=t==="up"?B("up"):B("down");return i.innerHTML=o,i.addEventListener("click",()=>{t==="up"&&r>0?this.swapItems(r,r-1):t==="down"&&r<this.currentOrder.length-1&&this.swapItems(r,r+1)}),i}swapItems(t,r){let i=this.currentOrder[t];this.currentOrder[t]=this.currentOrder[r],this.currentOrder[r]=i,this.renderRows(),this.emitStateChange()}handlePointerDown(t,r){if(t.target.closest(".btn, .controls"))return;t.preventDefault(),t.stopPropagation(),this.isDragging=!0,this.draggedRow=t.currentTarget,this.draggedRowIndex=r;let i=this.draggedRow.getBoundingClientRect();this.dragOffsetY=t.clientY-i.top;try{this.draggedRow.setPointerCapture(t.pointerId)}catch(o){console.warn("Failed to capture pointer:",o)}this.draggedRow.classList.add("dragging"),this.$rowsContainer.style.userSelect="none"}handlePointerMove(t){if(!this.isDragging||!this.draggedRow)return;let r=this.getRowIndexAtY(t.clientY);if(this.$rowsContainer.querySelectorAll(".row").forEach(i=>{i.classList.remove("drag-over")}),r!==-1&&r!==this.draggedRowIndex){let i=Array.from(this.$rowsContainer.children);i[r]&&i[r].classList.add("drag-over")}}handlePointerUp(t){if(!this.isDragging||!this.draggedRow)return;try{this.draggedRow.releasePointerCapture(t.pointerId)}catch{}let r=this.getRowIndexAtY(t.clientY);r!==-1&&r!==this.draggedRowIndex&&this.swapItems(this.draggedRowIndex,r),this.$rowsContainer.querySelectorAll(".row").forEach(i=>{i.classList.remove("dragging","drag-over")}),this.$rowsContainer.style.userSelect="",this.isDragging=!1,this.draggedRow=null,this.draggedRowIndex=null,this.dragOverRowIndex=null}getRowIndexAtY(t){let r=Array.from(this.$rowsContainer.children);for(let i=0;i<r.length;i++){let o=r[i].getBoundingClientRect();if(t>=o.top&&t<=o.bottom)return i}return-1}getCurrentState(){return{currentOrder:[...this.currentOrder],correctOrder:[...this.data.items]}}isInteractionComplete(){return!0}onHint(){let t=0;this.currentOrder.forEach((r,i)=>{this.data.items[i]===r&&t++}),t===this.currentOrder.length?(alert('All items are in the correct order! Click "Check" to submit.'),this.emitHintShown("All items correctly ordered")):(alert(`Hint: ${t} out of ${this.currentOrder.length} items are in the correct position. Keep reordering!`),this.emitHintShown(`${t}/${this.currentOrder.length} correct`))}submit(){super.submit();let t=xt(this.data.items,this.currentOrder,this);console.log(`Rank Order Score: ${t.score.toFixed(1)}% (${t.correct}/${t.total} correct)`),this.isGraded=!0,this.renderRows(),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0})),this.setAttribute("inert","")}reset(){super.reset(),this.config.shuffle?this.currentOrder=S([...this.data.items]):this.currentOrder=[...this.data.items],this.isGraded=!1,this.renderRows()}};customElements.get("rank-order")||customElements.define("rank-order",ue);var ci=!1,pa=()=>{ci||(ci=!0,C({id:"open-classification",label:"Open Classification",elementTag:"open-classification",cognitiveOp:"classification",mechanic:"static",engine:"direct",ctor:ye,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}),C({id:"sequential-classification",label:"Sequential Classification",elementTag:"sequential-classification",cognitiveOp:"classification",mechanic:"automatic-sequencing",engine:"direct",ctor:Ee,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}),C({id:"mcq",label:"Multiple Choice / Multiple Response",elementTag:"mcq-interaction",cognitiveOp:"recognition",mechanic:"sequential",engine:"direct",ctor:ee,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}),C({id:"simultaneous-association",label:"Simultaneous Association",elementTag:"simultaneous-association",cognitiveOp:"association",mechanic:"static",engine:"direct",ctor:Ce,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}),C({id:"list-recall",label:"List Recall",elementTag:"list-recall",cognitiveOp:"freerecall",mechanic:"static",engine:"direct",ctor:te,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),C({id:"lookup-table",label:"Lookup Table",elementTag:"lookup-table",cognitiveOp:"production",mechanic:"static",engine:"tables",ctor:Te,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),C({id:"classification-matrix",label:"Classification Matrix",elementTag:"classification-matrix",cognitiveOp:"classification",mechanic:"static",engine:"tables",ctor:$e,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),C({id:"nary-choice-table",label:"N-ary Choice Table",elementTag:"nary-choice-table",cognitiveOp:"discrimination",mechanic:"static",engine:"tables",ctor:Ae,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),C({id:"adjacency-table",label:"Adjacency Table",elementTag:"adjacency-table",cognitiveOp:"association",mechanic:"static",engine:"tables",ctor:_e,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),C({id:"mark-the-words",label:"Mark The Words",elementTag:"mark-the-words",cognitiveOp:"recognition",mechanic:"static",engine:"text",ctor:ie,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),C({id:"sequential-mark-the-words",label:"Sequential Mark The Words",elementTag:"sequential-mark-the-words",cognitiveOp:"recognition",mechanic:"sequential",engine:"text",ctor:ne,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),C({id:"categorize-the-words",label:"Categorize The Words",elementTag:"categorize-the-words",cognitiveOp:"classification",mechanic:"static",engine:"text",ctor:oe,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),C({id:"sequential-categorize-the-words",label:"Sequential Categorize The Words",elementTag:"sequential-categorize-the-words",cognitiveOp:"classification",mechanic:"sequential",engine:"text",ctor:ae,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),C({id:"text-transformation",label:"Text Transformation",elementTag:"text-transformation",cognitiveOp:"transformation",mechanic:"static",engine:"text",ctor:se,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),C({id:"sequential-text-transformation",label:"Sequential Text Transformation",elementTag:"sequential-text-transformation",cognitiveOp:"transformation",mechanic:"sequential",engine:"text",ctor:le,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),C({id:"fill-blanks",label:"Fill Blanks",elementTag:"fill-blanks",cognitiveOp:"cuedrecall",mechanic:"static",engine:"text",ctor:ce,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),C({id:"sequential-fill-blanks",label:"Sequential Fill Blanks",elementTag:"sequential-fill-blanks",cognitiveOp:"cuedrecall",mechanic:"sequential",engine:"text",ctor:de,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),C({id:"rank-order",label:"Rank Order",elementTag:"rank-order",cognitiveOp:"seriation",mechanic:"static",engine:"direct",ctor:ue,capabilities:{isSequential:!1,implementsProgress:!1,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}))};pa();var di=`<header part='header'>
3683
+ `,this.$container=this.querySelector(".container"),this.$rowsContainer=this.querySelector(".rows-container"),this.renderRows()}renderRows(){this.$rowsContainer.innerHTML="",this.currentOrder.forEach((t,r)=>{let i=document.createElement("div");i.className="row",i.dataset.index=String(r);let o=document.createElement("div");o.className="chip-wrapper";let a=document.createElement("edu-chip");a.variant=this.variant,a.dataset.item=t,a.prefix=String(r+1),a.draggable=!0,D(t,a,this.assets?.assetsById),this.isGraded&&(this.data.items.indexOf(t)===r?a.chipState="correct":a.chipState="wrong"),o.appendChild(a);let s=document.createElement("div");s.className="controls";let l=this.createButton("up",r);s.appendChild(l),i.appendChild(o),i.appendChild(s),this.isGraded||i.addEventListener("pointerdown",c=>this.handlePointerDown(c,r)),this.$rowsContainer.appendChild(i)})}createButton(t,r){let i=document.createElement("button");i.className="btn",i.dataset.direction=t,i.dataset.index=String(r),i.setAttribute("aria-label",t==="up"?"Move up":"Move down"),t==="up"&&r===0&&(i.disabled=!0),t==="down"&&r===this.currentOrder.length-1&&(i.disabled=!0),this.isGraded&&(i.disabled=!0);let o=t==="up"?B("up"):B("down");return i.innerHTML=o,i.addEventListener("click",()=>{t==="up"&&r>0?this.swapItems(r,r-1):t==="down"&&r<this.currentOrder.length-1&&this.swapItems(r,r+1)}),i}swapItems(t,r){let i=this.currentOrder[t];this.currentOrder[t]=this.currentOrder[r],this.currentOrder[r]=i,this.renderRows(),this.emitStateChange()}handlePointerDown(t,r){if(t.target.closest(".btn, .controls"))return;t.preventDefault(),t.stopPropagation(),this.isDragging=!0,this.draggedRow=t.currentTarget,this.draggedRowIndex=r;let i=this.draggedRow.getBoundingClientRect();this.dragOffsetY=t.clientY-i.top;try{this.draggedRow.setPointerCapture(t.pointerId)}catch(o){console.warn("Failed to capture pointer:",o)}this.draggedRow.classList.add("dragging"),this.$rowsContainer.style.userSelect="none"}handlePointerMove(t){if(!this.isDragging||!this.draggedRow)return;let r=this.getRowIndexAtY(t.clientY);if(this.$rowsContainer.querySelectorAll(".row").forEach(i=>{i.classList.remove("drag-over")}),r!==-1&&r!==this.draggedRowIndex){let i=Array.from(this.$rowsContainer.children);i[r]&&i[r].classList.add("drag-over")}}handlePointerUp(t){if(!this.isDragging||!this.draggedRow)return;try{this.draggedRow.releasePointerCapture(t.pointerId)}catch{}let r=this.getRowIndexAtY(t.clientY);r!==-1&&r!==this.draggedRowIndex&&this.swapItems(this.draggedRowIndex,r),this.$rowsContainer.querySelectorAll(".row").forEach(i=>{i.classList.remove("dragging","drag-over")}),this.$rowsContainer.style.userSelect="",this.isDragging=!1,this.draggedRow=null,this.draggedRowIndex=null,this.dragOverRowIndex=null}getRowIndexAtY(t){let r=Array.from(this.$rowsContainer.children);for(let i=0;i<r.length;i++){let o=r[i].getBoundingClientRect();if(t>=o.top&&t<=o.bottom)return i}return-1}getCurrentState(){return{currentOrder:[...this.currentOrder],correctOrder:[...this.data.items]}}isInteractionComplete(){return!0}onHint(){let t=0;this.currentOrder.forEach((r,i)=>{this.data.items[i]===r&&t++}),t===this.currentOrder.length?(alert('All items are in the correct order! Click "Check" to submit.'),this.emitHintShown("All items correctly ordered")):(alert(`Hint: ${t} out of ${this.currentOrder.length} items are in the correct position. Keep reordering!`),this.emitHintShown(`${t}/${this.currentOrder.length} correct`))}submit(){super.submit();let t=yt(this.data.items,this.currentOrder,this);console.log(`Rank Order Score: ${t.score.toFixed(1)}% (${t.correct}/${t.total} correct)`),this.isGraded=!0,this.renderRows(),this.dispatchEvent(new CustomEvent("interaction:graded",{detail:{result:t},bubbles:!0,composed:!0})),this.setAttribute("inert","")}reset(){super.reset(),this.config.shuffle?this.currentOrder=T([...this.data.items]):this.currentOrder=[...this.data.items],this.isGraded=!1,this.renderRows()}};customElements.get("rank-order")||customElements.define("rank-order",pe);var hi=!1,xa=()=>{hi||(hi=!0,k({id:"open-classification",label:"Open Classification",elementTag:"open-classification",cognitiveOp:"classification",mechanic:"static",engine:"direct",ctor:Ee,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}),k({id:"sequential-classification",label:"Sequential Classification",elementTag:"sequential-classification",cognitiveOp:"classification",mechanic:"automatic-sequencing",engine:"direct",ctor:Ce,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}),k({id:"mcq",label:"Multiple Choice / Multiple Response",elementTag:"mcq-interaction",cognitiveOp:"recognition",mechanic:"sequential",engine:"direct",ctor:te,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}),k({id:"simultaneous-association",label:"Simultaneous Association",elementTag:"simultaneous-association",cognitiveOp:"association",mechanic:"static",engine:"direct",ctor:ke,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}),k({id:"list-recall",label:"List Recall",elementTag:"list-recall",cognitiveOp:"freerecall",mechanic:"static",engine:"direct",ctor:re,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),k({id:"lookup-table",label:"Lookup Table",elementTag:"lookup-table",cognitiveOp:"production",mechanic:"static",engine:"tables",ctor:$e,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),k({id:"classification-matrix",label:"Classification Matrix",elementTag:"classification-matrix",cognitiveOp:"classification",mechanic:"static",engine:"tables",ctor:Ae,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),k({id:"nary-choice-table",label:"N-ary Choice Table",elementTag:"nary-choice-table",cognitiveOp:"discrimination",mechanic:"static",engine:"tables",ctor:_e,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),k({id:"adjacency-table",label:"Adjacency Table",elementTag:"adjacency-table",cognitiveOp:"association",mechanic:"static",engine:"tables",ctor:Ie,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!0,hasValidator:!0,hasGrader:!0}}),k({id:"mark-the-words",label:"Mark The Words",elementTag:"mark-the-words",cognitiveOp:"recognition",mechanic:"static",engine:"text",ctor:ne,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),k({id:"sequential-mark-the-words",label:"Sequential Mark The Words",elementTag:"sequential-mark-the-words",cognitiveOp:"recognition",mechanic:"sequential",engine:"text",ctor:oe,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),k({id:"categorize-the-words",label:"Categorize The Words",elementTag:"categorize-the-words",cognitiveOp:"classification",mechanic:"static",engine:"text",ctor:ae,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),k({id:"sequential-categorize-the-words",label:"Sequential Categorize The Words",elementTag:"sequential-categorize-the-words",cognitiveOp:"classification",mechanic:"sequential",engine:"text",ctor:se,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),k({id:"text-transformation",label:"Text Transformation",elementTag:"text-transformation",cognitiveOp:"transformation",mechanic:"static",engine:"text",ctor:le,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),k({id:"sequential-text-transformation",label:"Sequential Text Transformation",elementTag:"sequential-text-transformation",cognitiveOp:"transformation",mechanic:"sequential",engine:"text",ctor:ce,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),k({id:"fill-blanks",label:"Fill Blanks",elementTag:"fill-blanks",cognitiveOp:"cuedrecall",mechanic:"static",engine:"text",ctor:de,capabilities:{isSequential:!1,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),k({id:"sequential-fill-blanks",label:"Sequential Fill Blanks",elementTag:"sequential-fill-blanks",cognitiveOp:"cuedrecall",mechanic:"sequential",engine:"text",ctor:ue,capabilities:{isSequential:!0,implementsProgress:!0,usesAssets:!1,hasParser:!1,hasValidator:!0,hasGrader:!0}}),k({id:"rank-order",label:"Rank Order",elementTag:"rank-order",cognitiveOp:"seriation",mechanic:"static",engine:"direct",ctor:pe,capabilities:{isSequential:!1,implementsProgress:!1,usesAssets:!0,hasParser:!0,hasValidator:!0,hasGrader:!0}}))};xa();var gi=`<header part='header'>
3684
3684
  <div class="prompt-container">
3685
3685
  <button class="prompt-btn btn" title="See Prompt Data" part="see-prompt">
3686
3686
  <svg viewBox="0 0 24 24" width="20" height="20" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
@@ -3767,7 +3767,7 @@ slot {
3767
3767
 
3768
3768
  </div>
3769
3769
  </footer>
3770
- `;var ui=`:host {
3770
+ `;var mi=`:host {
3771
3771
  display: flex;
3772
3772
  width: 100%;
3773
3773
  height: 100%;
@@ -4587,12 +4587,12 @@ footer {
4587
4587
  box-shadow: 0 4px 8px rgba(var(--edu-first-accent), 0.2);
4588
4588
  }
4589
4589
  }
4590
- `;var pe=class extends HTMLElement{constructor(){super();this.soundManager=new H;this.animationsManager=new M;this.timerInterval=null;this.remainingSeconds=0;this.interactionComplete=!1;this.attemptCount=0;this.attemptLimit=null;this.currentScreen="interaction";this.attachShadow({mode:"open"});let t=document.createElement("style");t.textContent=ui,this.shadowRoot.append(t);let r=document.createElement("section");r.className="wrap",r.innerHTML=di,this.shadowRoot.append(r),M.injectKeyframes(this.shadowRoot),this.$headerEl=r.querySelector("header"),this.$footerEl=r.querySelector("footer"),this.$titleEl=r.querySelector(".title"),this.$promptBtn=r.querySelector(".prompt-btn"),this.$timerEl=r.querySelector(".timer"),this.$checkBtn=r.querySelector(".check-btn"),this.$scoresBtn=r.querySelector(".scores-btn"),this.$seeAnswersBtn=r.querySelector(".see-answers-btn"),this.$retryBtn=r.querySelector(".retry-btn"),this.$radioNav=r.querySelector(".radio-nav"),this.$progressContainer=r.querySelector(".progress-container"),this.$progressBar=r.querySelector(".progress-bar"),this.$progressIcon=r.querySelector(".progress-icon-wrapper"),this.$progressCounter=r.querySelector(".progress-counter"),this.$contentEl=r.querySelector('[part="content"]'),this.animationsManager.isEnabled=!0,this.$interactionScreen=r.querySelector('[data-screen="interaction"]'),this.$errorContent=r.querySelector(".error-content"),this.$attemptsMessage=r.querySelector(".attempts-message"),this.$scoreDisplay=r.querySelector(".score-display"),this.$timerDisplay=r.querySelector(".timer-display"),this.setupShellListeners()}static get observedAttributes(){return["show-header","show-footer"]}connectedCallback(){this.hasAttribute("show-header")||this.setAttribute("show-header","true"),this.hasAttribute("show-footer")||this.setAttribute("show-footer","true"),this.updateVisibility(),this.animationsManager.animate(this.$progressIcon,"heartbeat"),this.animationsManager.animate(this.$promptBtn,"wobble")}disconnectedCallback(){this.stopTimer(),this.removeInteractionListeners()}attributeChangedCallback(t,r,i){r!==i&&this.updateVisibility()}setInteraction(t){if(this.stopTimer(),!t.isValid){this.$errorContent.textContent=t.errors??"Error loading the interaction.",this.switchScreen("error");return}this.soundManager.playSound("start"),this.interaction&&(this.removeInteractionListeners(),this.$interactionScreen.innerHTML=""),this.interaction=t,this.interactionComplete=!1;let r=this.interaction.config;this.reset(),this.switchScreen("interaction");let i=r.variant??"elegant";this.setAttribute("variant",i),this.interaction.onVariantChange(i),this.$titleEl.textContent=r.prompt||"",r.promptData&&r.promptModality?(this.$titleEl.style.cursor="pointer",this.$titleEl.title="Click to view prompt details",this.$promptBtn.addEventListener("click",()=>this.openPromptDialog()),this.$titleEl.addEventListener("click",()=>this.openPromptDialog())):(this.$titleEl.style.cursor="",this.$titleEl.style.textDecoration="",this.$titleEl.title=""),r.timer!==null&&r.timer>30?(this.remainingSeconds=r.timer,this.$timerEl.classList.remove("edu-hidden"),this.updateTimerDisplay(),this.startTimer()):this.$timerEl.classList.add("edu-hidden"),this.attemptLimit=r.attemptLimit,this.attemptCount=0,this.interaction.interactionMechanic==="sequential"?(this.$radioNav.dataset.active="true",this.renderRadioNav()):this.$radioNav.dataset.active="false",this.interaction.implementsProgress?(this.$checkBtn.classList.add("edu-hidden"),this.$progressContainer.classList.remove("edu-hidden"),this.$progressCounter.textContent=`0/${this.interaction.progressTracker.total}`):(this.$progressContainer.classList.add("edu-hidden"),this.$checkBtn.classList.remove("edu-hidden")),this.setupInteractionListeners(),this.$interactionScreen.innerHTML="",this.$interactionScreen.appendChild(t)}removeInteraction(){this.interaction&&(this.removeInteractionListeners(),this.$interactionScreen.innerHTML="",this.interaction=void 0,this.interactionComplete=!1)}setupShellListeners(){this.$checkBtn.addEventListener("click",()=>{this.soundManager.playSound("pop");try{this.interaction.submit()}catch(t){console.error("Submit failed:",t)}}),this.$seeAnswersBtn.addEventListener("click",()=>{this.soundManager.playSound("pop"),this.currentScreen==="solution"?this.switchScreen("interaction"):this.switchScreen("solution")}),this.$scoresBtn.addEventListener("click",()=>{this.soundManager.playSound("pop"),this.currentScreen==="score"?this.switchScreen("interaction"):this.switchScreen("score")}),this.$timerEl.addEventListener("click",()=>{this.soundManager.playSound("pop"),this.$timerDisplay.append(this.$timerEl),this.currentScreen==="time"?(this.switchScreen("interaction"),this.$headerEl.append(this.$timerEl)):this.switchScreen("time")}),this.$retryBtn.addEventListener("click",()=>this.handleRetry()),this.$radioNav.addEventListener("change",t=>{let r=t.target;if(r.type==="radio"){let i=parseInt(r.id.replace("step-",""),10);this.interaction&&this.interaction.setSteps(i),this.dispatchEvent(new CustomEvent("navigation-change",{detail:{step:i},bubbles:!0,composed:!0}))}})}setupInteractionListeners(){this.interaction.addEventListener("interaction:ready",t=>{console.log("[Shell] Interaction ready:",t.detail.id)}),this.interaction.addEventListener("interaction:progress",t=>{let{current:r,total:i,percentage:o}=t.detail;this.updateProgress(r,i),r===i&&i>0?(this.interactionComplete=!0,this.$checkBtn.classList.remove("edu-hidden")):(this.interactionComplete=!1,this.interaction.implementsProgress&&this.$checkBtn.classList.add("edu-hidden"))}),this.interaction.addEventListener("interaction:complete",t=>{console.log("[Shell] Interaction complete:",t.detail),this.stopTimer(),this.handleCompletion(t.detail.state)}),this.interaction.addEventListener("interaction:graded",t=>{t.detail.result.score===100?(this.soundManager.playSound("success"),this.animationsManager.animate(this.$progressIcon,"spin-pulse")):(this.soundManager.playSound("failure"),this.animationsManager.animate(this.$progressIcon,"shake")),this.handleGraded(t.detail.result)}),this.interaction.addEventListener("interaction:hint-shown",t=>{console.log("[Shell] Hint shown:",t.detail.message)}),this.interaction.addEventListener("interaction:error",t=>{console.error("[Shell] Interaction error:",t.detail),alert(t.detail.message)})}removeInteractionListeners(){}updateProgress(t,r){this.$progressBar.max=r,this.$progressBar.value=t??0,this.$progressCounter.textContent=`${t}/${r}`;let i=r>0?t/r*100:0,a=this.$progressBar.offsetWidth*i/100-12;this.$progressIcon.style.left=`${Math.max(0,a)}px`}handleCompletion(t){this.dispatchEvent(new CustomEvent("shell:interaction-complete",{detail:{state:t},bubbles:!0,composed:!0})),console.log("[Shell] Interaction submitted with state:",t)}handleGraded(t){this.$checkBtn.classList.add("edu-hidden"),this.$seeAnswersBtn.classList.remove("edu-hidden"),this.$scoresBtn.classList.remove("edu-hidden"),this.$retryBtn.classList.remove("edu-hidden"),this.attemptLimit&&this.attemptCount>this.attemptLimit&&this.$retryBtn.classList.add("edu-hidden");let r=t.score;this.$scoreDisplay.innerHTML=`
4590
+ `;var he=class extends HTMLElement{constructor(){super();this.soundManager=new H;this.animationsManager=new L;this.timerInterval=null;this.remainingSeconds=0;this.interactionComplete=!1;this.attemptCount=0;this.attemptLimit=null;this.currentScreen="interaction";this.attachShadow({mode:"open"});let t=document.createElement("style");t.textContent=mi,this.shadowRoot.append(t);let r=document.createElement("section");r.className="wrap",r.innerHTML=gi,this.shadowRoot.append(r),L.injectKeyframes(this.shadowRoot),this.$headerEl=r.querySelector("header"),this.$footerEl=r.querySelector("footer"),this.$titleEl=r.querySelector(".title"),this.$promptBtn=r.querySelector(".prompt-btn"),this.$timerEl=r.querySelector(".timer"),this.$checkBtn=r.querySelector(".check-btn"),this.$scoresBtn=r.querySelector(".scores-btn"),this.$seeAnswersBtn=r.querySelector(".see-answers-btn"),this.$retryBtn=r.querySelector(".retry-btn"),this.$radioNav=r.querySelector(".radio-nav"),this.$progressContainer=r.querySelector(".progress-container"),this.$progressBar=r.querySelector(".progress-bar"),this.$progressIcon=r.querySelector(".progress-icon-wrapper"),this.$progressCounter=r.querySelector(".progress-counter"),this.$contentEl=r.querySelector('[part="content"]'),this.animationsManager.isEnabled=!0,this.$interactionScreen=r.querySelector('[data-screen="interaction"]'),this.$errorContent=r.querySelector(".error-content"),this.$attemptsMessage=r.querySelector(".attempts-message"),this.$scoreDisplay=r.querySelector(".score-display"),this.$timerDisplay=r.querySelector(".timer-display"),this.setupShellListeners()}static get observedAttributes(){return["show-header","show-footer"]}connectedCallback(){this.hasAttribute("show-header")||this.setAttribute("show-header","true"),this.hasAttribute("show-footer")||this.setAttribute("show-footer","true"),this.updateVisibility(),this.animationsManager.animate(this.$progressIcon,"heartbeat"),this.animationsManager.animate(this.$promptBtn,"wobble")}disconnectedCallback(){this.stopTimer(),this.removeInteractionListeners()}attributeChangedCallback(t,r,i){r!==i&&this.updateVisibility()}setInteraction(t){if(this.stopTimer(),!t.isValid){this.$errorContent.textContent=t.errors??"Error loading the interaction.",this.switchScreen("error");return}this.soundManager.playSound("start"),this.interaction&&(this.removeInteractionListeners(),this.$interactionScreen.innerHTML=""),this.interaction=t,this.interactionComplete=!1;let r=this.interaction.config;this.reset(),this.switchScreen("interaction");let i=r.variant??"elegant";this.setAttribute("variant",i),this.interaction.onVariantChange(i),this.$titleEl.textContent=r.prompt||"",r.promptData&&r.promptModality?(this.$titleEl.style.cursor="pointer",this.$titleEl.title="Click to view prompt details",this.$promptBtn.addEventListener("click",()=>this.openPromptDialog()),this.$titleEl.addEventListener("click",()=>this.openPromptDialog())):(this.$titleEl.style.cursor="",this.$titleEl.style.textDecoration="",this.$titleEl.title=""),r.timer!==null&&r.timer>30?(this.remainingSeconds=r.timer,this.$timerEl.classList.remove("edu-hidden"),this.updateTimerDisplay(),this.startTimer()):this.$timerEl.classList.add("edu-hidden"),this.attemptLimit=r.attemptLimit,this.attemptCount=0,this.interaction.interactionMechanic==="sequential"?(this.$radioNav.dataset.active="true",this.renderRadioNav()):this.$radioNav.dataset.active="false",this.interaction.implementsProgress?(this.$checkBtn.classList.add("edu-hidden"),this.$progressContainer.classList.remove("edu-hidden"),this.$progressCounter.textContent=`0/${this.interaction.progressTracker.total}`):(this.$progressContainer.classList.add("edu-hidden"),this.$checkBtn.classList.remove("edu-hidden")),this.setupInteractionListeners(),this.$interactionScreen.innerHTML="",this.$interactionScreen.appendChild(t)}removeInteraction(){this.interaction&&(this.removeInteractionListeners(),this.$interactionScreen.innerHTML="",this.interaction=void 0,this.interactionComplete=!1)}setupShellListeners(){this.$checkBtn.addEventListener("click",()=>{this.soundManager.playSound("pop");try{this.interaction.submit()}catch(t){console.error("Submit failed:",t)}}),this.$seeAnswersBtn.addEventListener("click",()=>{this.soundManager.playSound("pop"),this.currentScreen==="solution"?this.switchScreen("interaction"):this.switchScreen("solution")}),this.$scoresBtn.addEventListener("click",()=>{this.soundManager.playSound("pop"),this.currentScreen==="score"?this.switchScreen("interaction"):this.switchScreen("score")}),this.$timerEl.addEventListener("click",()=>{this.soundManager.playSound("pop"),this.$timerDisplay.append(this.$timerEl),this.currentScreen==="time"?(this.switchScreen("interaction"),this.$headerEl.append(this.$timerEl)):this.switchScreen("time")}),this.$retryBtn.addEventListener("click",()=>this.handleRetry()),this.$radioNav.addEventListener("change",t=>{let r=t.target;if(r.type==="radio"){let i=parseInt(r.id.replace("step-",""),10);this.interaction&&this.interaction.setSteps(i),this.dispatchEvent(new CustomEvent("navigation-change",{detail:{step:i},bubbles:!0,composed:!0}))}})}setupInteractionListeners(){this.interaction.addEventListener("interaction:ready",t=>{console.log("[Shell] Interaction ready:",t.detail.id)}),this.interaction.addEventListener("interaction:progress",t=>{let{current:r,total:i,percentage:o}=t.detail;this.updateProgress(r,i),r===i&&i>0?(this.interactionComplete=!0,this.$checkBtn.classList.remove("edu-hidden")):(this.interactionComplete=!1,this.interaction.implementsProgress&&this.$checkBtn.classList.add("edu-hidden"))}),this.interaction.addEventListener("interaction:complete",t=>{console.log("[Shell] Interaction complete:",t.detail),this.stopTimer(),this.handleCompletion(t.detail.state)}),this.interaction.addEventListener("interaction:graded",t=>{t.detail.result.score===100?(this.soundManager.playSound("success"),this.animationsManager.animate(this.$progressIcon,"spin-pulse")):(this.soundManager.playSound("failure"),this.animationsManager.animate(this.$progressIcon,"shake")),this.handleGraded(t.detail.result)}),this.interaction.addEventListener("interaction:hint-shown",t=>{console.log("[Shell] Hint shown:",t.detail.message)}),this.interaction.addEventListener("interaction:error",t=>{console.error("[Shell] Interaction error:",t.detail),alert(t.detail.message)})}removeInteractionListeners(){}updateProgress(t,r){this.$progressBar.max=r,this.$progressBar.value=t??0,this.$progressCounter.textContent=`${t}/${r}`;let i=r>0?t/r*100:0,a=this.$progressBar.offsetWidth*i/100-12;this.$progressIcon.style.left=`${Math.max(0,a)}px`}handleCompletion(t){this.dispatchEvent(new CustomEvent("shell:interaction-complete",{detail:{state:t},bubbles:!0,composed:!0})),console.log("[Shell] Interaction submitted with state:",t)}handleGraded(t){this.$checkBtn.classList.add("edu-hidden"),this.$seeAnswersBtn.classList.remove("edu-hidden"),this.$scoresBtn.classList.remove("edu-hidden"),this.$retryBtn.classList.remove("edu-hidden"),this.attemptLimit&&this.attemptCount>this.attemptLimit&&this.$retryBtn.classList.add("edu-hidden");let r=t.score;this.$scoreDisplay.innerHTML=`
4591
4591
  <div style="font-size: 4rem; font-weight: 700; color: ${r>=75?"rgb(var(--edu-success))":r>=50?"rgba(139, 195, 74)":r>=25?"rgb(var(--edu-warning))":"rgb(var(--edu-error))"}">${r}%</div>
4592
4592
  <div style="font-size: 1.5rem; margin-top: 1rem; color: rgb(var(--edu-second-ink));">
4593
4593
  ${r===100?"Perfect Score! \u{1F389}":r>=75?"Great Job!":r>=50?"Good Effort!":r>=25?"Keep Trying!":"Try Again!"}
4594
4594
  </div>
4595
- `,this.$progressIcon.classList.remove("score-fail","score-low","score-mid","score-high"),this.$progressBar.classList.remove("score-fail","score-low","score-mid","score-high");let i="";r<=25?i="score-fail":r<=50?i="score-low":r<=75?i="score-mid":i="score-high",this.$progressIcon.classList.add(i),this.$progressBar.classList.add(i)}reset(){this.resetTimer(),this.interaction.implementsProgress||this.$checkBtn.classList.remove("edu-hidden"),this.$seeAnswersBtn.classList.add("edu-hidden"),this.$scoresBtn.classList.add("edu-hidden"),this.$retryBtn.classList.add("edu-hidden"),this.$progressIcon.classList.remove("score-fail","score-low","score-mid","score-high"),this.$progressBar.classList.remove("score-fail","score-low","score-mid","score-high"),this.animationsManager.animate(this.$progressIcon,"heartbeat"),this.$progressBar.value=0,this.updateProgress(0,this.interaction.progressTracker.total),this.interaction.interactionMechanic==="sequential"&&this.renderRadioNav()}handleRetry(){if(this.$retryBtn.classList.add("edu-hidden"),this.soundManager.playSound("pop"),this.attemptCount++,this.attemptLimit&&this.attemptLimit>0){let t=this.attemptLimit-this.attemptCount+1;this.$attemptsMessage.textContent=`${t} attempt${t!==1?"s":""} remaining`,this.switchScreen("attempts"),setTimeout(()=>{this.switchScreen("interaction"),this.reset(),this.resumeTimer(),this.interaction?.reset(),this.soundManager.playSound("flip")},2e3)}else this.switchScreen("interaction"),this.interaction?.reset()}openPromptDialog(){let t=this.interaction?.config;if(!t)return;this.soundManager.playSound("pop");let r=document.querySelector("edu-dialog#prompt-dialog");r||(r=document.createElement("edu-dialog"),r.id="prompt-dialog",document.body.appendChild(r)),r.title=t.construct||this.interaction?.config.promptModality||"Prompt";let i=document.createElement("edu-media");i.setAttribute("type",t.promptModality),i.setAttribute("data",t.promptData),t.promptDataSpec&&i.setAttribute("spec",t.promptDataSpec),r.innerHTML="",r.appendChild(i),r.open()}switchScreen(t){this.shadowRoot.querySelectorAll(".screen").forEach(r=>{let i=r.getAttribute("data-screen");r.style.display=i===t?"block":"none"}),this.currentScreen=t,console.log(`[Shell] Switched to screen: ${t}`)}startTimer(){this.timerInterval=window.setInterval(()=>{this.remainingSeconds--,this.updateTimerDisplay(),this.remainingSeconds<=0&&(this.stopTimer(),this.handleTimerComplete())},1e3)}stopTimer(){this.timerInterval!==null&&(clearInterval(this.timerInterval),this.timerInterval=null)}getFormattedTime(t){let r=Math.floor(t/60),i=t%60;return`${r}:${i.toString().padStart(2,"0")}`}updateTimerDisplay(){this.$timerEl.textContent=this.getFormattedTime(this.remainingSeconds),this.remainingSeconds===30&&(this.soundManager.playSound("low-time"),this.animationsManager.animate(this.$timerEl,"shake")),delete this.$timerEl.dataset.warning,delete this.$timerEl.dataset.danger,this.remainingSeconds<=10?this.$timerEl.dataset.danger="true":this.remainingSeconds<=30&&(this.$timerEl.dataset.warning="true")}handleTimerComplete(){console.log("[Shell] Timer complete");try{this.interaction.submit()}catch(t){console.error("Auto-submit on timer failed:",t)}this.dispatchEvent(new CustomEvent("shell:timer-complete",{bubbles:!0,composed:!0}))}pauseTimer(){this.stopTimer()}resumeTimer(){this.remainingSeconds>0&&this.timerInterval===null&&this.startTimer()}resetTimer(){this.stopTimer(),this.remainingSeconds=this.interaction.config.timer,this.updateTimerDisplay()}updateVisibility(){let t=this.getAttribute("show-header")!=="false",r=this.getAttribute("show-footer")!=="false";this.$headerEl.style.display=t?"":"none",this.$footerEl.style.display=r?"":"none"}renderRadioNav(){let t=this.interaction&&"slidesCount"in this.interaction?this.interaction.slidesCount:1;this.$radioNav.innerHTML="";for(let r=1;r<=t;r++){let i=document.createElement("input");i.type="radio",i.name="step-nav",i.id=`step-${r}`,r===1&&(i.checked=!0);let o=document.createElement("label");o.htmlFor=`step-${r}`,o.textContent=String(r),this.$radioNav.appendChild(i),this.$radioNav.appendChild(o)}}getContentArea(){return this.$contentEl}};customElements.get("edu-window")||customElements.define("edu-window",pe);Je();ze();export{_e as AdjacencyTable,xe as AssetValidationError,x as BaseInteraction,oe as CategorizeTheWords,$e as ClassificationMatrix,We as EduTable,Xe as EduText,ce as FillBlanks,pe as InteractionsBaseShell,te as ListRecall,Te as LookupTable,ee as MCQ,ie as MarkTheWords,Ae as NaryChoiceTable,ye as OpenClassification,ue as RankOrder,ae as SequentialCategorizeTheWords,Ee as SequentialClassification,de as SequentialFillBlanks,ne as SequentialMarkTheWords,le as SequentialTextTransformation,Ce as SimultaneousAssociation,se as TextTransformation,tl as adjacencyTableDataParser,ol as adjacencyTableDataValidator,Hr as adjacencyTableGrader,el as basicTableDataParser,nl as basicTableDataValidator,zr as classificationTableGrader,xa as clearInteractionRegistry,Se as compareValues,fi as configureCognikit,hi as createInteraction,Ke as detectCellKind,ze as ensureCognikitTheme,Gr as getAdjacencyCellGrading,Ye as getAllUniqueValues,ke as getAllValues,Re as getBlanksGradingState,Or as getClassificationCellGrading,Be as getClassificationGradingState,aa as getDNDGradingState,Le as getHighlightGradingState,pi as getInteraction,wa as getInteractionRegistry,Nr as getLookupCellGrading,Vr as getNaryCellGrading,vt as getTransformationGradingState,ya as listInteractions,rl as lookupTableDataParser,al as lookupTableDataValidator,qr as lookupTableGrader,Br as naryTableGrader,ia as parseTextEngineSequential,Fo as parseYamlAssets,Rr as recognitionGrader,Ls as recognitionParser,Rs as recognitionValidator,pa as registerBuiltInInteractions,C as registerInteraction,xt as seriationGrader,ua as seriationParser,da as seriationValidator,ti as textEngineBaseDataValidator,Xr as textEngineBaseGrammarParser,ri as textEngineBlanksDataValidator,De as textEngineBlanksGrader,Jr as textEngineBlanksGrammarParser,ii as textEngineClassificationDataValidator,Pe as textEngineClassificationGrader,ei as textEngineClassificationGrammarParser,oa as textEngineDNDGrader,na as textEngineDataValidator,Ie as textEngineHighlightGrader,Me as textEngineTransformationGrader,va as unregisterInteraction,jo as validateAndNormalizeAssets};
4595
+ `,this.$progressIcon.classList.remove("score-fail","score-low","score-mid","score-high"),this.$progressBar.classList.remove("score-fail","score-low","score-mid","score-high");let i="";r<=25?i="score-fail":r<=50?i="score-low":r<=75?i="score-mid":i="score-high",this.$progressIcon.classList.add(i),this.$progressBar.classList.add(i)}reset(){this.resetTimer(),this.interaction.implementsProgress||this.$checkBtn.classList.remove("edu-hidden"),this.$seeAnswersBtn.classList.add("edu-hidden"),this.$scoresBtn.classList.add("edu-hidden"),this.$retryBtn.classList.add("edu-hidden"),this.$progressIcon.classList.remove("score-fail","score-low","score-mid","score-high"),this.$progressBar.classList.remove("score-fail","score-low","score-mid","score-high"),this.animationsManager.animate(this.$progressIcon,"heartbeat"),this.$progressBar.value=0,this.updateProgress(0,this.interaction.progressTracker.total),this.interaction.interactionMechanic==="sequential"&&this.renderRadioNav()}handleRetry(){if(this.$retryBtn.classList.add("edu-hidden"),this.soundManager.playSound("pop"),this.attemptCount++,this.attemptLimit&&this.attemptLimit>0){let t=this.attemptLimit-this.attemptCount+1;this.$attemptsMessage.textContent=`${t} attempt${t!==1?"s":""} remaining`,this.switchScreen("attempts"),setTimeout(()=>{this.switchScreen("interaction"),this.reset(),this.resumeTimer(),this.interaction?.reset(),this.soundManager.playSound("flip")},2e3)}else this.switchScreen("interaction"),this.interaction?.reset()}openPromptDialog(){let t=this.interaction?.config;if(!t)return;this.soundManager.playSound("pop");let r=document.querySelector("edu-dialog#prompt-dialog");r||(r=document.createElement("edu-dialog"),r.id="prompt-dialog",document.body.appendChild(r)),r.title=t.construct||this.interaction?.config.promptModality||"Prompt";let i=document.createElement("edu-media");i.setAttribute("type",t.promptModality),i.setAttribute("data",t.promptData),t.promptDataSpec&&i.setAttribute("spec",t.promptDataSpec),r.innerHTML="",r.appendChild(i),r.open()}switchScreen(t){this.shadowRoot.querySelectorAll(".screen").forEach(r=>{let i=r.getAttribute("data-screen");r.style.display=i===t?"block":"none"}),this.currentScreen=t,console.log(`[Shell] Switched to screen: ${t}`)}startTimer(){this.timerInterval=window.setInterval(()=>{this.remainingSeconds--,this.updateTimerDisplay(),this.remainingSeconds<=0&&(this.stopTimer(),this.handleTimerComplete())},1e3)}stopTimer(){this.timerInterval!==null&&(clearInterval(this.timerInterval),this.timerInterval=null)}getFormattedTime(t){let r=Math.floor(t/60),i=t%60;return`${r}:${i.toString().padStart(2,"0")}`}updateTimerDisplay(){this.$timerEl.textContent=this.getFormattedTime(this.remainingSeconds),this.remainingSeconds===30&&(this.soundManager.playSound("low-time"),this.animationsManager.animate(this.$timerEl,"shake")),delete this.$timerEl.dataset.warning,delete this.$timerEl.dataset.danger,this.remainingSeconds<=10?this.$timerEl.dataset.danger="true":this.remainingSeconds<=30&&(this.$timerEl.dataset.warning="true")}handleTimerComplete(){console.log("[Shell] Timer complete");try{this.interaction.submit()}catch(t){console.error("Auto-submit on timer failed:",t)}this.dispatchEvent(new CustomEvent("shell:timer-complete",{bubbles:!0,composed:!0}))}pauseTimer(){this.stopTimer()}resumeTimer(){this.remainingSeconds>0&&this.timerInterval===null&&this.startTimer()}resetTimer(){this.stopTimer(),this.remainingSeconds=this.interaction.config.timer,this.updateTimerDisplay()}updateVisibility(){let t=this.getAttribute("show-header")!=="false",r=this.getAttribute("show-footer")!=="false";this.$headerEl.style.display=t?"":"none",this.$footerEl.style.display=r?"":"none"}renderRadioNav(){let t=this.interaction&&"slidesCount"in this.interaction?this.interaction.slidesCount:1;this.$radioNav.innerHTML="";for(let r=1;r<=t;r++){let i=document.createElement("input");i.type="radio",i.name="step-nav",i.id=`step-${r}`,r===1&&(i.checked=!0);let o=document.createElement("label");o.htmlFor=`step-${r}`,o.textContent=String(r),this.$radioNav.appendChild(i),this.$radioNav.appendChild(o)}}getContentArea(){return this.$contentEl}};customElements.get("edu-window")||customElements.define("edu-window",he);et();W();export{Ie as AdjacencyTable,we as AssetValidationError,x as BaseInteraction,ae as CategorizeTheWords,Ae as ClassificationMatrix,Qe as EduTable,Je as EduText,de as FillBlanks,he as InteractionsBaseShell,re as ListRecall,$e as LookupTable,te as MCQ,ne as MarkTheWords,_e as NaryChoiceTable,Ee as OpenClassification,pe as RankOrder,se as SequentialCategorizeTheWords,Ce as SequentialClassification,ue as SequentialFillBlanks,oe as SequentialMarkTheWords,ce as SequentialTextTransformation,ke as SimultaneousAssociation,le as TextTransformation,ll as adjacencyTableDataParser,pl as adjacencyTableDataValidator,Vr as adjacencyTableGrader,sl as basicTableDataParser,ul as basicTableDataValidator,Or as classificationTableGrader,Ta as clearInteractionRegistry,He as cognikitThemePresets,Te as compareValues,xi as configureCognikit,bi as createInteraction,tt as defaultCognikitThemeVariables,We as detectCellKind,W as ensureCognikitTheme,Fr as getAdjacencyCellGrading,Ke as getAllUniqueValues,Se as getAllValues,Pe as getBlanksGradingState,Ur as getClassificationCellGrading,qe as getClassificationGradingState,wi as getCognikitConfig,yi as getCognikitThemePresets,ha as getDNDGradingState,De as getHighlightGradingState,fi as getInteraction,$a as getInteractionRegistry,jr as getLookupCellGrading,Yr as getNaryCellGrading,wt as getTransformationGradingState,Aa as listInteractions,cl as lookupTableDataParser,hl as lookupTableDataValidator,Gr as lookupTableGrader,Nr as naryTableGrader,da as parseTextEngineSequential,Zo as parseYamlAssets,zr as recognitionGrader,Hs as recognitionParser,Gs as recognitionValidator,xa as registerBuiltInInteractions,k as registerInteraction,Ci as resetCognikitTheme,$t as resolveCognikitTheme,yt as seriationGrader,va as seriationParser,ba as seriationValidator,Ei as setCognikitTheme,oi as textEngineBaseDataValidator,ri as textEngineBaseGrammarParser,ai as textEngineBlanksDataValidator,Re as textEngineBlanksGrader,ii as textEngineBlanksGrammarParser,si as textEngineClassificationDataValidator,Be as textEngineClassificationGrader,ni as textEngineClassificationGrammarParser,pa as textEngineDNDGrader,ua as textEngineDataValidator,Me as textEngineHighlightGrader,Le as textEngineTransformationGrader,Sa as unregisterInteraction,Xo as validateAndNormalizeAssets};
4596
4596
  /*! Bundled license information:
4597
4597
 
4598
4598
  js-yaml/dist/js-yaml.mjs: