@pie-element/simple-cloze 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * IIFE entry point for simple-cloze element.
3
- * Registers the delivery custom element when loaded as a script.
3
+ * Exports the delivery component for host/player registration.
4
4
  */
5
5
  import Element from './delivery';
6
6
  export default Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.iife.d.ts","sourceRoot":"","sources":["../src/index.iife.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,OAAO,MAAM,YAAY,CAAC;AAMjC,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"index.iife.d.ts","sourceRoot":"","sources":["../src/index.iife.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,OAAO,MAAM,YAAY,CAAC;AAEjC,eAAe,OAAO,CAAC"}
@@ -1,3 +1,3 @@
1
1
  this.SimpleClozeElement=(function(){typeof window<`u`&&((window.__svelte??={}).v??=new Set).add(`5`);var e={},t=Symbol(),n=`http://www.w3.org/1999/xhtml`,r=`http://www.w3.org/2000/svg`,i=`http://www.w3.org/1998/Math/MathML`,a=Array.isArray,o=Array.prototype.indexOf,s=Array.prototype.includes,c=Array.from,l=Object.keys,u=Object.defineProperty,d=Object.getOwnPropertyDescriptor,f=Object.getOwnPropertyDescriptors,p=Object.prototype,m=Array.prototype,h=Object.getPrototypeOf,g=Object.isExtensible,ee=()=>{};function te(e){for(var t=0;t<e.length;t++)e[t]()}function ne(){var e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}}var _=1024,v=2048,y=4096,re=8192,ie=16384,ae=32768,oe=1<<25,se=65536,ce=1<<19,le=1<<20,ue=65536,de=1<<21,fe=1<<22,pe=1<<23,me=Symbol(`$state`),he=Symbol(`legacy props`),ge=Symbol(``),b=new class extends Error{name=`StaleReactionError`;message="The reaction that called `getAbortSignal()` was re-run or destroyed"},_e=!!globalThis.document?.contentType&&globalThis.document.contentType.includes(`xml`);function ve(e){throw Error(`https://svelte.dev/e/lifecycle_outside_component`)}function ye(){throw Error(`https://svelte.dev/e/async_derived_orphan`)}function be(e){throw Error(`https://svelte.dev/e/effect_in_teardown`)}function xe(){throw Error(`https://svelte.dev/e/effect_in_unowned_derived`)}function Se(e){throw Error(`https://svelte.dev/e/effect_orphan`)}function Ce(){throw Error(`https://svelte.dev/e/effect_update_depth_exceeded`)}function we(){throw Error(`https://svelte.dev/e/hydration_failed`)}function Te(){throw Error(`https://svelte.dev/e/state_descriptors_fixed`)}function Ee(){throw Error(`https://svelte.dev/e/state_prototype_fixed`)}function De(){throw Error(`https://svelte.dev/e/state_unsafe_mutation`)}function Oe(){throw Error(`https://svelte.dev/e/svelte_boundary_reset_onerror`)}function ke(e){console.warn(`https://svelte.dev/e/hydration_mismatch`)}function Ae(){console.warn(`https://svelte.dev/e/svelte_boundary_reset_noop`)}var x=!1;function je(e){x=e}var S;function C(t){if(t===null)throw ke(),e;return S=t}function Me(){return C(L(S))}function Ne(t){if(x){if(L(S)!==null)throw ke(),e;S=t}}function Pe(e=1){if(x){for(var t=e,n=S;t--;)n=L(n);S=n}}function Fe(e=!0){for(var t=0,n=S;;){if(n.nodeType===8){var r=n.data;if(r===`]`){if(t===0)return n;--t}else (r===`[`||r===`[!`||r[0]===`[`&&!isNaN(Number(r.slice(1))))&&(t+=1)}var i=L(n);e&&n.remove(),n=i}}function Ie(t){if(!t||t.nodeType!==8)throw ke(),e;return t.data}function Le(e){return e===this.v}function Re(e,t){return e==e?e!==t||typeof e==`object`&&!!e||typeof e==`function`:t==t}function ze(e){return!Re(e,this.v)}var w=!1,Be=!1,T=null;function Ve(e){T=e}function He(e,t=!1,n){T={p:T,i:!1,c:null,e:null,s:e,x:null,r:W,l:Be&&!t?{s:null,u:null,$:[]}:null}}function Ue(e){var t=T,n=t.e;if(n!==null){t.e=null;for(var r of n)cn(r)}return e!==void 0&&(t.x=e),t.i=!0,T=t.p,e??{}}function We(){return!Be||T!==null&&T.l===null}var Ge=[];function Ke(){var e=Ge;Ge=[],te(e)}function qe(e){if(Ge.length===0&&!nt){var t=Ge;queueMicrotask(()=>{t===Ge&&Ke()})}Ge.push(e)}function Je(){for(;Ge.length>0;)Ke()}function Ye(e){var t=W;if(t===null)return V.f|=pe,e;if(!(t.f&32768)&&!(t.f&4))throw e;E(e,t)}function E(e,t){for(;t!==null;){if(t.f&128){if(!(t.f&32768))throw e;try{t.b.error(e);return}catch(t){e=t}}t=t.parent}throw e}var Xe=~(v|y|_);function D(e,t){e.f=e.f&Xe|t}function Ze(e){e.f&512||e.deps===null?D(e,_):D(e,y)}function Qe(e){if(e!==null)for(let t of e)!(t.f&2)||!(t.f&65536)||(t.f^=ue,Qe(t.deps))}function $e(e,t,n){e.f&2048?t.add(e):e.f&4096&&n.add(e),Qe(e.deps),D(e,_)}var et=!1,O=new Set,k=null,A=null,tt=null,nt=!1,rt=!1,it=null,at=null,ot=0,st=1,ct=class e{id=st++;current=new Map;previous=new Map;#e=new Set;#t=new Set;#n=0;#r=0;#i=null;#a=[];#o=new Set;#s=new Set;#c=new Map;is_fork=!1;#l=!1;#u(){return this.is_fork||this.#r>0}skip_effect(e){this.#c.has(e)||this.#c.set(e,{d:[],m:[]})}unskip_effect(e){var t=this.#c.get(e);if(t){this.#c.delete(e);for(var n of t.d)D(n,v),this.schedule(n);for(n of t.m)D(n,y),this.schedule(n)}}#d(){if(ot++>1e3&&(O.delete(this),ut()),!this.#u()){for(let e of this.#o)this.#s.delete(e),D(e,v),this.schedule(e);for(let e of this.#s)D(e,y),this.schedule(e)}let t=this.#a;this.#a=[],this.apply();var n=it=[],r=[],i=at=[];for(let e of t)try{this.#f(e,n,r)}catch(t){throw gt(e),t}if(k=null,i.length>0){var a=e.ensure();for(let e of i)a.schedule(e)}if(it=null,at=null,this.#u()){this.#p(r),this.#p(n);for(let[e,t]of this.#c)ht(e,t)}else{this.#n===0&&O.delete(this),this.#o.clear(),this.#s.clear();for(let e of this.#e)e(this);this.#e.clear(),dt(r),dt(n),this.#i?.resolve()}var o=k;if(this.#a.length>0){let e=o??=this;e.#a.push(...this.#a.filter(t=>!e.#a.includes(t)))}o!==null&&(O.add(o),o.#d()),O.has(this)||this.#m()}#f(e,t,n){e.f^=_;for(var r=e.first;r!==null;){var i=r.f,a=(i&96)!=0;if(!(a&&i&1024||i&8192||this.#c.has(r))&&r.fn!==null){a?r.f^=_:i&4?t.push(r):w&&i&16777224?n.push(r):In(r)&&(i&16&&this.#s.add(r),Vn(r));var o=r.first;if(o!==null){r=o;continue}}for(;r!==null;){var s=r.next;if(s!==null){r=s;break}r=r.parent}}}#p(e){for(var t=0;t<e.length;t+=1)$e(e[t],this.#o,this.#s)}capture(e,n){n!==t&&!this.previous.has(e)&&this.previous.set(e,n),e.f&8388608||(this.current.set(e,e.v),A?.set(e,e.v))}activate(){k=this}deactivate(){k=null,A=null}flush(){try{rt=!0,k=this,this.#d()}finally{ot=0,tt=null,it=null,at=null,rt=!1,k=null,A=null,M.clear()}}discard(){for(let e of this.#t)e(this);this.#t.clear(),O.delete(this)}#m(){for(let s of O){var e=s.id<this.id,t=[];for(let[n,r]of this.current){if(s.current.has(n))if(e&&r!==s.current.get(n))s.current.set(n,r);else continue;t.push(n)}var n=[...s.current.keys()].filter(e=>!this.current.has(e));if(n.length===0)e&&s.discard();else if(t.length>0){s.activate();var r=new Set,i=new Map;for(var a of t)ft(a,n,r,i);if(s.#a.length>0){s.apply();for(var o of s.#a)s.#f(o,[],[]);s.#a=[]}s.deactivate()}}}increment(e){this.#n+=1,e&&(this.#r+=1)}decrement(e,t){--this.#n,e&&--this.#r,!(this.#l||t)&&(this.#l=!0,qe(()=>{this.#l=!1,this.flush()}))}transfer_effects(e,t){for(let t of e)this.#o.add(t);for(let e of t)this.#s.add(e);e.clear(),t.clear()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#t.add(e)}settled(){return(this.#i??=ne()).promise}static ensure(){if(k===null){let t=k=new e;rt||(O.add(k),nt||qe(()=>{k===t&&t.flush()}))}return k}apply(){if(!w||!this.is_fork&&O.size===1){A=null;return}A=new Map(this.current);for(let e of O)if(!(e===this||e.is_fork))for(let[t,n]of e.previous)A.has(t)||A.set(t,n)}schedule(e){if(tt=e,e.b?.is_pending&&e.f&16777228&&!(e.f&32768)){e.b.defer_effect(e);return}for(var t=e;t.parent!==null;){t=t.parent;var n=t.f;if(it!==null&&t===W&&(w||(V===null||!(V.f&2))&&!et))return;if(n&96){if(!(n&1024))return;t.f^=_}}this.#a.push(t)}};function lt(e){var t=nt;nt=!0;try{var n;for(e&&(k!==null&&!k.is_fork&&k.flush(),n=e());;){if(Je(),k===null)return n;k.flush()}}finally{nt=t}}function ut(){try{Ce()}catch(e){E(e,tt)}}var j=null;function dt(e){var t=e.length;if(t!==0){for(var n=0;n<t;){var r=e[n++];if(!(r.f&24576)&&In(r)&&(j=new Set,Vn(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&bn(r),j?.size>0)){M.clear();for(let e of j){if(e.f&24576)continue;let t=[e],n=e.parent;for(;n!==null;)j.has(n)&&(j.delete(n),t.push(n)),n=n.parent;for(let e=t.length-1;e>=0;e--){let n=t[e];n.f&24576||Vn(n)}}j.clear()}}j=null}}function ft(e,t,n,r){if(!n.has(e)&&(n.add(e),e.reactions!==null))for(let i of e.reactions){let e=i.f;e&2?ft(i,t,n,r):e&4194320&&!(e&2048)&&pt(i,t,r)&&(D(i,v),mt(i))}}function pt(e,t,n){let r=n.get(e);if(r!==void 0)return r;if(e.deps!==null)for(let r of e.deps){if(s.call(t,r))return!0;if(r.f&2&&pt(r,t,n))return n.set(r,!0),!0}return n.set(e,!1),!1}function mt(e){k.schedule(e)}function ht(e,t){if(!(e.f&32&&e.f&1024)){e.f&2048?t.d.push(e):e.f&4096&&t.m.push(e),D(e,_);for(var n=e.first;n!==null;)ht(n,t),n=n.next}}function gt(e){D(e,_);for(var t=e.first;t!==null;)gt(t),t=t.next}function _t(e){let t=0,n=Lt(0),r;return()=>{an()&&(Z(n),pn(()=>(t===0&&(r=Wn(()=>e(()=>Vt(n)))),t+=1,()=>{qe(()=>{--t,t===0&&(r?.(),r=void 0,Vt(n))})})))}}var vt=se|ce;function yt(e,t,n,r){new bt(e,t,n,r)}var bt=class{parent;is_pending=!1;transform_error;#e;#t=x?S:null;#n;#r;#i;#a=null;#o=null;#s=null;#c=null;#l=0;#u=0;#d=!1;#f=new Set;#p=new Set;#m=null;#h=_t(()=>(this.#m=Lt(this.#l),()=>{this.#m=null}));constructor(e,t,n,r){this.#e=e,this.#n=t,this.#r=e=>{var t=W;t.b=this,t.f|=128,n(e)},this.parent=W.b,this.transform_error=r??this.parent?.transform_error??(e=>e),this.#i=hn(()=>{if(x){let e=this.#t;Me();let t=e.data===`[!`;if(e.data.startsWith(`[?`)){let t=JSON.parse(e.data.slice(2));this.#_(t)}else t?this.#v():this.#g()}else this.#y()},vt),x&&(this.#e=S)}#g(){try{this.#a=z(()=>this.#r(this.#e))}catch(e){this.error(e)}}#_(e){let t=this.#n.failed;t&&(this.#s=z(()=>{t(this.#e,()=>e,()=>()=>{})}))}#v(){let e=this.#n.pending;e&&(this.is_pending=!0,this.#o=z(()=>e(this.#e)),qe(()=>{var e=this.#c=document.createDocumentFragment(),t=F();e.append(t),this.#a=this.#x(()=>z(()=>this.#r(t))),this.#u===0&&(this.#e.before(e),this.#c=null,xn(this.#o,()=>{this.#o=null}),this.#b(k))}))}#y(){try{if(this.is_pending=this.has_pending_snippet(),this.#u=0,this.#l=0,this.#a=z(()=>{this.#r(this.#e)}),this.#u>0){var e=this.#c=document.createDocumentFragment();Tn(this.#a,e);let t=this.#n.pending;this.#o=z(()=>t(this.#e))}else this.#b(k)}catch(e){this.error(e)}}#b(e){this.is_pending=!1,e.transfer_effects(this.#f,this.#p)}defer_effect(e){$e(e,this.#f,this.#p)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#n.pending}#x(e){var t=W,n=V,r=T;G(this.#i),U(this.#i),Ve(this.#i.ctx);try{return ct.ensure(),e()}catch(e){return Ye(e),null}finally{G(t),U(n),Ve(r)}}#S(e,t){if(!this.has_pending_snippet()){this.parent&&this.parent.#S(e,t);return}this.#u+=e,this.#u===0&&(this.#b(t),this.#o&&xn(this.#o,()=>{this.#o=null}),this.#c&&=(this.#e.before(this.#c),null))}update_pending_count(e,t){this.#S(e,t),this.#l+=e,!(!this.#m||this.#d)&&(this.#d=!0,qe(()=>{this.#d=!1,this.#m&&zt(this.#m,this.#l)}))}get_effect_pending(){return this.#h(),Z(this.#m)}error(e){var t=this.#n.onerror;let n=this.#n.failed;if(!t&&!n)throw e;this.#a&&=(B(this.#a),null),this.#o&&=(B(this.#o),null),this.#s&&=(B(this.#s),null),x&&(C(this.#t),Pe(),C(Fe()));var r=!1,i=!1;let a=()=>{if(r){Ae();return}r=!0,i&&Oe(),this.#s!==null&&xn(this.#s,()=>{this.#s=null}),this.#x(()=>{this.#y()})},o=e=>{try{i=!0,t?.(e,a),i=!1}catch(e){E(e,this.#i&&this.#i.parent)}n&&(this.#s=this.#x(()=>{try{return z(()=>{var t=W;t.b=this,t.f|=128,n(this.#e,()=>e,()=>a)})}catch(e){return E(e,this.#i.parent),null}}))};qe(()=>{var t;try{t=this.transform_error(e)}catch(e){E(e,this.#i&&this.#i.parent);return}typeof t==`object`&&t&&typeof t.then==`function`?t.then(o,e=>E(e,this.#i&&this.#i.parent)):o(t)})}};function xt(e,t,n,r){let i=We()?Tt:Ot;var a=e.filter(e=>!e.settled);if(n.length===0&&a.length===0){r(t.map(i));return}var o=W,s=St(),c=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(e=>e.promise)):null;function l(e){s();try{r(e)}catch(e){o.f&16384||E(e,o)}Ct()}if(n.length===0){c.then(()=>l(t.map(i)));return}var u=wt();function d(){Promise.all(n.map(e=>Et(e))).then(e=>l([...t.map(i),...e])).catch(e=>E(e,o)).finally(()=>u())}c?c.then(()=>{s(),d(),Ct()}):d()}function St(){var e=W,t=V,n=T,r=k;return function(i=!0){G(e),U(t),Ve(n),i&&!(e.f&16384)&&(r?.activate(),r?.apply())}}function Ct(e=!0){G(null),U(null),Ve(null),e&&k?.deactivate()}function wt(){var e=W.b,t=k,n=e.is_rendered();return e.update_pending_count(1,t),t.increment(n),(r=!1)=>{e.update_pending_count(-1,t),t.decrement(n,r)}}function Tt(e){var n=2|v,r=V!==null&&V.f&2?V:null;return W!==null&&(W.f|=ce),{ctx:T,deps:null,effects:null,equals:Le,f:n,fn:e,reactions:null,rv:0,v:t,wv:0,parent:r??W,ac:null}}function Et(e,n,r){let i=W;i===null&&ye();var a=void 0,o=Lt(t),s=!V,c=new Map;return fn(()=>{var t=W,n=ne();a=n.promise;try{Promise.resolve(e()).then(n.resolve,n.reject).finally(Ct)}catch(e){n.reject(e),Ct()}var r=k;if(s){if(t.f&32768)var l=wt();if(i.b.is_rendered())c.get(r)?.reject(b),c.delete(r);else{for(let e of c.values())e.reject(b);c.clear()}c.set(r,n)}let u=(e,n=void 0)=>{if(l&&l(n===b),!(n===b||t.f&16384)){if(r.activate(),n)o.f|=pe,zt(o,n);else{o.f&8388608&&(o.f^=pe),zt(o,e);for(let[e,t]of c){if(c.delete(e),e===r)break;t.reject(b)}}r.deactivate()}};n.promise.then(u,e=>u(null,e||`unknown`))}),on(()=>{for(let e of c.values())e.reject(b)}),new Promise(e=>{function t(n){function r(){n===a?e(o):t(a)}n.then(r,r)}t(a)})}function Dt(e){let t=Tt(e);return w||An(t),t}function Ot(e){let t=Tt(e);return t.equals=ze,t}function kt(e){var t=e.effects;if(t!==null){e.effects=null;for(var n=0;n<t.length;n+=1)B(t[n])}}function At(e){for(var t=e.parent;t!==null;){if(!(t.f&2))return t.f&16384?null:t;t=t.parent}return null}function jt(e){var t,n=W;G(At(e));try{e.f&=~ue,kt(e),t=Rn(e)}finally{G(n)}return t}function Mt(e){var t=e.v,n=jt(e);if(!e.equals(n)&&(e.wv=Fn(),(!k?.is_fork||e.deps===null)&&(e.v=n,k?.capture(e,t),e.deps===null))){D(e,_);return}On||(A===null?Ze(e):(an()||k?.is_fork)&&A.set(e,n))}function Nt(e){if(e.effects!==null)for(let t of e.effects)(t.teardown||t.ac)&&(t.teardown?.(),t.ac?.abort(b),t.teardown=ee,t.ac=null,Bn(t,0),_n(t))}function Pt(e){if(e.effects!==null)for(let t of e.effects)t.teardown&&Vn(t)}var Ft=new Set,M=new Map,It=!1;function Lt(e,t){return{f:0,v:e,reactions:null,equals:Le,rv:0,wv:0}}function N(e,t){let n=Lt(e,t);return An(n),n}function Rt(e,t=!1,n=!0){let r=Lt(e);return t||(r.equals=ze),Be&&n&&T!==null&&T.l!==null&&(T.l.s??=[]).push(r),r}function P(e,t,n=!1){return V!==null&&(!H||V.f&131072)&&We()&&V.f&4325394&&(K===null||!s.call(K,e))&&De(),zt(e,n?Ut(t):t,at)}function zt(e,t,n=null){if(!e.equals(t)){var r=e.v;On?M.set(e,t):M.set(e,r),e.v=t;var i=ct.ensure();if(i.capture(e,r),e.f&2){let t=e;e.f&2048&&jt(t),A===null&&Ze(t)}e.wv=Fn(),Ht(e,v,n),We()&&W!==null&&W.f&1024&&!(W.f&96)&&(Y===null?jn([e]):Y.push(e)),!i.is_fork&&Ft.size>0&&!It&&Bt()}return t}function Bt(){It=!1;for(let e of Ft)e.f&1024&&D(e,y),In(e)&&Vn(e);Ft.clear()}function Vt(e){P(e,e.v+1)}function Ht(e,t,n){var r=e.reactions;if(r!==null)for(var i=We(),a=r.length,o=0;o<a;o++){var s=r[o],c=s.f;if(!(!i&&s===W)){var l=(c&v)===0;if(l&&D(s,t),c&2){var u=s;A?.delete(u),c&65536||(c&512&&(s.f|=ue),Ht(u,y,n))}else if(l){var d=s;c&16&&j!==null&&j.add(d),n===null?mt(d):n.push(d)}}}}function Ut(e){if(typeof e!=`object`||!e||me in e)return e;let n=h(e);if(n!==p&&n!==m)return e;var r=new Map,i=a(e),o=N(0),s=null,c=Nn,l=e=>{if(Nn===c)return e();var t=V,n=Nn;U(null),Pn(c);var r=e();return U(t),Pn(n),r};return i&&r.set(`length`,N(e.length,s)),new Proxy(e,{defineProperty(e,t,n){(!(`value`in n)||n.configurable===!1||n.enumerable===!1||n.writable===!1)&&Te();var i=r.get(t);return i===void 0?l(()=>{var e=N(n.value,s);return r.set(t,e),e}):P(i,n.value,!0),!0},deleteProperty(e,n){var i=r.get(n);if(i===void 0){if(n in e){let e=l(()=>N(t,s));r.set(n,e),Vt(o)}}else P(i,t),Vt(o);return!0},get(n,i,a){if(i===me)return e;var o=r.get(i),c=i in n;if(o===void 0&&(!c||d(n,i)?.writable)&&(o=l(()=>N(Ut(c?n[i]:t),s)),r.set(i,o)),o!==void 0){var u=Z(o);return u===t?void 0:u}return Reflect.get(n,i,a)},getOwnPropertyDescriptor(e,n){var i=Reflect.getOwnPropertyDescriptor(e,n);if(i&&`value`in i){var a=r.get(n);a&&(i.value=Z(a))}else if(i===void 0){var o=r.get(n),s=o?.v;if(o!==void 0&&s!==t)return{enumerable:!0,configurable:!0,value:s,writable:!0}}return i},has(e,n){if(n===me)return!0;var i=r.get(n),a=i!==void 0&&i.v!==t||Reflect.has(e,n);return(i!==void 0||W!==null&&(!a||d(e,n)?.writable))&&(i===void 0&&(i=l(()=>N(a?Ut(e[n]):t,s)),r.set(n,i)),Z(i)===t)?!1:a},set(e,n,a,c){var u=r.get(n),f=n in e;if(i&&n===`length`)for(var p=a;p<u.v;p+=1){var m=r.get(p+``);m===void 0?p in e&&(m=l(()=>N(t,s)),r.set(p+``,m)):P(m,t)}if(u===void 0)(!f||d(e,n)?.writable)&&(u=l(()=>N(void 0,s)),P(u,Ut(a)),r.set(n,u));else{f=u.v!==t;var h=l(()=>Ut(a));P(u,h)}var g=Reflect.getOwnPropertyDescriptor(e,n);if(g?.set&&g.set.call(c,a),!f){if(i&&typeof n==`string`){var ee=r.get(`length`),te=Number(n);Number.isInteger(te)&&te>=ee.v&&P(ee,te+1)}Vt(o)}return!0},ownKeys(e){Z(o);var n=Reflect.ownKeys(e).filter(e=>{var n=r.get(e);return n===void 0||n.v!==t});for(var[i,a]of r)a.v!==t&&!(i in e)&&n.push(i);return n},setPrototypeOf(){Ee()}})}var Wt,Gt,Kt,qt;function Jt(){if(Wt===void 0){Wt=window,Gt=/Firefox/.test(navigator.userAgent);var e=Element.prototype,t=Node.prototype,n=Text.prototype;Kt=d(t,`firstChild`).get,qt=d(t,`nextSibling`).get,g(e)&&(e.__click=void 0,e.__className=void 0,e.__attributes=null,e.__style=void 0,e.__e=void 0),g(n)&&(n.__t=void 0)}}function F(e=``){return document.createTextNode(e)}function I(e){return Kt.call(e)}function L(e){return qt.call(e)}function Yt(e,t){if(!x)return I(e);var n=I(S);if(n===null)n=S.appendChild(F());else if(t&&n.nodeType!==3){var r=F();return n?.before(r),C(r),r}return t&&en(n),C(n),n}function Xt(e,t=1,n=!1){let r=x?S:e;for(var i;t--;)i=r,r=L(r);if(!x)return r;if(n){if(r?.nodeType!==3){var a=F();return r===null?i?.after(a):r.before(a),C(a),a}en(r)}return C(r),r}function Zt(e){e.textContent=``}function Qt(){return!w||j!==null?!1:(W.f&ae)!==0}function $t(e,t,n){let r=n?{is:n}:void 0;return document.createElementNS(t??`http://www.w3.org/1999/xhtml`,e,r)}function en(e){if(e.nodeValue.length<65536)return;let t=e.nextSibling;for(;t!==null&&t.nodeType===3;)t.remove(),e.nodeValue+=t.nodeValue,t=e.nextSibling}function tn(e){var t=V,n=W;U(null),G(null);try{return e()}finally{U(t),G(n)}}function nn(e){W===null&&(V===null&&Se(e),xe()),On&&be(e)}function rn(e,t){var n=t.last;n===null?t.last=t.first=e:(n.next=e,e.prev=n,t.last=e)}function R(e,t){var n=W;n!==null&&n.f&8192&&(e|=re);var r={ctx:T,deps:null,nodes:null,f:e|v|512,first:null,fn:t,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null},i=r;if(e&4)it===null?ct.ensure().schedule(r):it.push(r);else if(t!==null){try{Vn(r)}catch(e){throw B(r),e}i.deps===null&&i.teardown===null&&i.nodes===null&&i.first===i.last&&!(i.f&524288)&&(i=i.first,e&16&&e&65536&&i!==null&&(i.f|=se))}if(i!==null&&(i.parent=n,n!==null&&rn(i,n),V!==null&&V.f&2&&!(e&64))){var a=V;(a.effects??=[]).push(i)}return r}function an(){return V!==null&&!H}function on(e){let t=R(8,null);return D(t,_),t.teardown=e,t}function sn(e){nn(`$effect`);var t=W.f;if(!V&&t&32&&!(t&32768)){var n=T;(n.e??=[]).push(e)}else return cn(e)}function cn(e){return R(4|le,e)}function ln(e){ct.ensure();let t=R(64|ce,e);return()=>{B(t)}}function un(e){ct.ensure();let t=R(64|ce,e);return(e={})=>new Promise(n=>{e.outro?xn(t,()=>{B(t),n(void 0)}):(B(t),n(void 0))})}function dn(e){return R(4,e)}function fn(e){return R(fe|ce,e)}function pn(e,t=0){return R(8|t,e)}function mn(e,t=[],n=[],r=[]){xt(r,t,n,t=>{R(8,()=>e(...t.map(Z)))})}function hn(e,t=0){return R(16|t,e)}function z(e){return R(32|ce,e)}function gn(e){var t=e.teardown;if(t!==null){let e=On,n=V;kn(!0),U(null);try{t.call(null)}finally{kn(e),U(n)}}}function _n(e,t=!1){var n=e.first;for(e.first=e.last=null;n!==null;){let e=n.ac;e!==null&&tn(()=>{e.abort(b)});var r=n.next;n.f&64?n.parent=null:B(n,t),n=r}}function vn(e){for(var t=e.first;t!==null;){var n=t.next;t.f&32||B(t),t=n}}function B(e,t=!0){var n=!1;(t||e.f&262144)&&e.nodes!==null&&e.nodes.end!==null&&(yn(e.nodes.start,e.nodes.end),n=!0),D(e,oe),_n(e,t&&!n),Bn(e,0);var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)e.stop();gn(e),e.f^=oe,e.f|=ie;var i=e.parent;i!==null&&i.first!==null&&bn(e),e.next=e.prev=e.teardown=e.ctx=e.deps=e.fn=e.nodes=e.ac=null}function yn(e,t){for(;e!==null;){var n=e===t?null:L(e);e.remove(),e=n}}function bn(e){var t=e.parent,n=e.prev,r=e.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),t!==null&&(t.first===e&&(t.first=r),t.last===e&&(t.last=n))}function xn(e,t,n=!0){var r=[];Sn(e,r,!0);var i=()=>{n&&B(e),t&&t()},a=r.length;if(a>0){var o=()=>--a||i();for(var s of r)s.out(o)}else i()}function Sn(e,t,n){if(!(e.f&8192)){e.f^=re;var r=e.nodes&&e.nodes.t;if(r!==null)for(let e of r)(e.is_global||n)&&t.push(e);for(var i=e.first;i!==null;){var a=i.next,o=(i.f&65536)!=0||(i.f&32)!=0&&(e.f&16)!=0;Sn(i,t,o?n:!1),i=a}}}function Cn(e){wn(e,!0)}function wn(e,t){if(e.f&8192){e.f^=re,e.f&1024||(D(e,v),ct.ensure().schedule(e));for(var n=e.first;n!==null;){var r=n.next,i=(n.f&65536)!=0||(n.f&32)!=0;wn(n,i?t:!1),n=r}var a=e.nodes&&e.nodes.t;if(a!==null)for(let e of a)(e.is_global||t)&&e.in()}}function Tn(e,t){if(e.nodes)for(var n=e.nodes.start,r=e.nodes.end;n!==null;){var i=n===r?null:L(n);t.append(n),n=i}}var En=null,Dn=!1,On=!1;function kn(e){On=e}var V=null,H=!1;function U(e){V=e}var W=null;function G(e){W=e}var K=null;function An(e){V!==null&&(!w||V.f&2)&&(K===null?K=[e]:K.push(e))}var q=null,J=0,Y=null;function jn(e){Y=e}var Mn=1,X=0,Nn=X;function Pn(e){Nn=e}function Fn(){return++Mn}function In(e){var t=e.f;if(t&2048)return!0;if(t&2&&(e.f&=~ue),t&4096){for(var n=e.deps,r=n.length,i=0;i<r;i++){var a=n[i];if(In(a)&&Mt(a),a.wv>e.wv)return!0}t&512&&A===null&&D(e,_)}return!1}function Ln(e,t,n=!0){var r=e.reactions;if(r!==null&&!(!w&&K!==null&&s.call(K,e)))for(var i=0;i<r.length;i++){var a=r[i];a.f&2?Ln(a,t,!1):t===a&&(n?D(a,v):a.f&1024&&D(a,y),mt(a))}}function Rn(e){var t=q,n=J,r=Y,i=V,a=K,o=T,s=H,c=Nn,l=e.f;q=null,J=0,Y=null,V=l&96?null:e,K=null,Ve(e.ctx),H=!1,Nn=++X,e.ac!==null&&(tn(()=>{e.ac.abort(b)}),e.ac=null);try{e.f|=de;var u=e.fn,d=u();e.f|=ae;var f=e.deps,p=k?.is_fork;if(q!==null){var m;if(p||Bn(e,J),f!==null&&J>0)for(f.length=J+q.length,m=0;m<q.length;m++)f[J+m]=q[m];else e.deps=f=q;if(an()&&e.f&512)for(m=J;m<f.length;m++)(f[m].reactions??=[]).push(e)}else !p&&f!==null&&J<f.length&&(Bn(e,J),f.length=J);if(We()&&Y!==null&&!H&&f!==null&&!(e.f&6146))for(m=0;m<Y.length;m++)Ln(Y[m],e);if(i!==null&&i!==e){if(X++,i.deps!==null)for(let e=0;e<n;e+=1)i.deps[e].rv=X;if(t!==null)for(let e of t)e.rv=X;Y!==null&&(r===null?r=Y:r.push(...Y))}return e.f&8388608&&(e.f^=pe),d}catch(e){return Ye(e)}finally{e.f^=de,q=t,J=n,Y=r,V=i,K=a,Ve(o),H=s,Nn=c}}function zn(e,t){let n=t.reactions;if(n!==null){var r=o.call(n,e);if(r!==-1){var i=n.length-1;i===0?n=t.reactions=null:(n[r]=n[i],n.pop())}}if(n===null&&t.f&2&&(q===null||!s.call(q,t))){var a=t;a.f&512&&(a.f^=512,a.f&=~ue),Ze(a),Nt(a),Bn(a,0)}}function Bn(e,t){var n=e.deps;if(n!==null)for(var r=t;r<n.length;r++)zn(e,n[r])}function Vn(e){var t=e.f;if(!(t&16384)){D(e,_);var n=W,r=Dn;W=e,Dn=!0;try{t&16777232?vn(e):_n(e),gn(e);var i=Rn(e);e.teardown=typeof i==`function`?i:null,e.wv=Mn}finally{Dn=r,W=n}}}function Z(e){var t=(e.f&2)!=0;if(En?.add(e),V!==null&&!H&&!(W!==null&&W.f&16384)&&(K===null||!s.call(K,e))){var n=V.deps;if(V.f&2097152)e.rv<X&&(e.rv=X,q===null&&n!==null&&n[J]===e?J++:q===null?q=[e]:q.push(e));else{(V.deps??=[]).push(e);var r=e.reactions;r===null?e.reactions=[V]:s.call(r,V)||r.push(V)}}if(On&&M.has(e))return M.get(e);if(t){var i=e;if(On){var a=i.v;return(!(i.f&1024)&&i.reactions!==null||Un(i))&&(a=jt(i)),M.set(i,a),a}var o=(i.f&512)==0&&!H&&V!==null&&(Dn||(V.f&512)!=0),c=(i.f&ae)===0;In(i)&&(o&&(i.f|=512),Mt(i)),o&&!c&&(Pt(i),Hn(i))}if(A?.has(e))return A.get(e);if(e.f&8388608)throw e.v;return e.v}function Hn(e){if(e.f|=512,e.deps!==null)for(let t of e.deps)(t.reactions??=[]).push(e),t.f&2&&!(t.f&512)&&(Pt(t),Hn(t))}function Un(e){if(e.v===t)return!0;if(e.deps===null)return!1;for(let t of e.deps)if(M.has(t)||t.f&2&&Un(t))return!0;return!1}function Wn(e){var t=H;try{return H=!0,e()}finally{H=t}}var Gn=Symbol(`events`),Kn=new Set,qn=new Set;function Jn(e,t,n){(t[Gn]??={})[e]=n}function Yn(e){for(var t=0;t<e.length;t++)Kn.add(e[t]);for(var n of qn)n(e)}var Xn=null;function Zn(e){var t=this,n=t.ownerDocument,r=e.type,i=e.composedPath?.()||[],a=i[0]||e.target;Xn=e;var o=0,s=Xn===e&&e[Gn];if(s){var c=i.indexOf(s);if(c!==-1&&(t===document||t===window)){e[Gn]=t;return}var l=i.indexOf(t);if(l===-1)return;c<=l&&(o=c)}if(a=i[o]||e.target,a!==t){u(e,`currentTarget`,{configurable:!0,get(){return a||n}});var d=V,f=W;U(null),G(null);try{for(var p,m=[];a!==null;){var h=a.assignedSlot||a.parentNode||a.host||null;try{var g=a[Gn]?.[r];g!=null&&(!a.disabled||e.target===a)&&g.call(a,e)}catch(e){p?m.push(e):p=e}if(e.cancelBubble||h===t||h===null)break;a=h}if(p){for(let e of m)queueMicrotask(()=>{throw e});throw p}}finally{e[Gn]=t,delete e.currentTarget,U(d),G(f)}}}var Qn=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy(`svelte-trusted-html`,{createHTML:e=>e});function $n(e){return Qn?.createHTML(e)??e}function er(e){var t=$t(`template`);return t.innerHTML=$n(e.replaceAll(`<!>`,`<!---->`)),t.content}function Q(e,t){var n=W;n.nodes===null&&(n.nodes={start:e,end:t,a:null,t:null})}function tr(e,t){var n=(t&1)!=0,r=(t&2)!=0,i,a=!e.startsWith(`<!>`);return()=>{if(x)return Q(S,null),S;i===void 0&&(i=er(a?e:`<!>`+e),n||(i=I(i)));var t=r||Gt?document.importNode(i,!0):i.cloneNode(!0);if(n){var o=I(t),s=t.lastChild;Q(o,s)}else Q(t,t);return t}}function nr(e,t,n=`svg`){var r=!e.startsWith(`<!>`),i=(t&1)!=0,a=`<${n}>${r?e:`<!>`+e}</${n}>`,o;return()=>{if(x)return Q(S,null),S;if(!o){var e=I(er(a));if(i)for(o=document.createDocumentFragment();I(e);)o.appendChild(I(e));else o=I(e)}var t=o.cloneNode(!0);if(i){var n=I(t),r=t.lastChild;Q(n,r)}else Q(t,t);return t}}function rr(e,t){return nr(e,t,`svg`)}function $(e,t){if(x){var n=W;(!(n.f&32768)||n.nodes.end===null)&&(n.nodes.end=S),Me();return}e!==null&&e.before(t)}[...`allowfullscreen.async.autofocus.autoplay.checked.controls.default.disabled.formnovalidate.indeterminate.inert.ismap.loop.multiple.muted.nomodule.novalidate.open.playsinline.readonly.required.reversed.seamless.selected.webkitdirectory.defer.disablepictureinpicture.disableremoteplayback`.split(`.`)];var ir=[`touchstart`,`touchmove`];function ar(e){return ir.includes(e)}function or(e,t){var n=t==null?``:typeof t==`object`?`${t}`:t;n!==(e.__t??=e.nodeValue)&&(e.__t=n,e.nodeValue=`${n}`)}function sr(e,t){return ur(e,t)}function cr(t,n){Jt(),n.intro=n.intro??!1;let r=n.target,i=x,a=S;try{for(var o=I(r);o&&(o.nodeType!==8||o.data!==`[`);)o=L(o);if(!o)throw e;je(!0),C(o);let i=ur(t,{...n,anchor:o});return je(!1),i}catch(i){if(i instanceof Error&&i.message.split(`
2
2
  `).some(e=>e.startsWith(`https://svelte.dev/e/`)))throw i;return i!==e&&console.warn(`Failed to hydrate: `,i),n.recover===!1&&we(),Jt(),Zt(r),je(!1),sr(t,n)}finally{je(i),C(a)}}var lr=new Map;function ur(t,{target:n,anchor:r,props:i={},events:a,context:o,intro:s=!0,transformError:l}){Jt();var u=void 0,d=un(()=>{var s=r??n.appendChild(F());yt(s,{pending:()=>{}},n=>{He({});var r=T;if(o&&(r.c=o),a&&(i.$$events=a),x&&Q(n,null),u=t(n,i)||{},x&&(W.nodes.end=S,S===null||S.nodeType!==8||S.data!==`]`))throw ke(),e;Ue()},l);var d=new Set,f=e=>{for(var t=0;t<e.length;t++){var r=e[t];if(!d.has(r)){d.add(r);var i=ar(r);for(let e of[n,document]){var a=lr.get(e);a===void 0&&(a=new Map,lr.set(e,a));var o=a.get(r);o===void 0?(e.addEventListener(r,Zn,{passive:i}),a.set(r,1)):a.set(r,o+1)}}}};return f(c(Kn)),qn.add(f),()=>{for(var e of d)for(let r of[n,document]){var t=lr.get(r),i=t.get(e);--i==0?(r.removeEventListener(e,Zn),t.delete(e),t.size===0&&lr.delete(r)):t.set(e,i)}qn.delete(f),s!==r&&s.parentNode?.removeChild(s)}});return dr.set(u,d),u}var dr=new WeakMap;function fr(e,t){let n=dr.get(e);return n?(dr.delete(e),n(t)):Promise.resolve()}var pr=class{anchor;#e=new Map;#t=new Map;#n=new Map;#r=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#a=e=>{if(this.#e.has(e)){var t=this.#e.get(e),n=this.#t.get(t);if(n)Cn(n),this.#r.delete(t);else{var r=this.#n.get(t);r&&(this.#t.set(t,r.effect),this.#n.delete(t),r.fragment.lastChild.remove(),this.anchor.before(r.fragment),n=r.effect)}for(let[t,n]of this.#e){if(this.#e.delete(t),t===e)break;let r=this.#n.get(n);r&&(B(r.effect),this.#n.delete(n))}for(let[e,r]of this.#t){if(e===t||this.#r.has(e))continue;let i=()=>{if(Array.from(this.#e.values()).includes(e)){var t=document.createDocumentFragment();Tn(r,t),t.append(F()),this.#n.set(e,{effect:r,fragment:t})}else B(r);this.#r.delete(e),this.#t.delete(e)};this.#i||!n?(this.#r.add(e),xn(r,i,!1)):i()}}};#o=e=>{this.#e.delete(e);let t=Array.from(this.#e.values());for(let[e,n]of this.#n)t.includes(e)||(B(n.effect),this.#n.delete(e))};ensure(e,t){var n=k,r=Qt();if(t&&!this.#t.has(e)&&!this.#n.has(e))if(r){var i=document.createDocumentFragment(),a=F();i.append(a),this.#n.set(e,{effect:z(()=>t(a)),fragment:i})}else this.#t.set(e,z(()=>t(this.anchor)));if(this.#e.set(n,e),r){for(let[t,r]of this.#t)t===e?n.unskip_effect(r):n.skip_effect(r);for(let[t,r]of this.#n)t===e?n.unskip_effect(r.effect):n.skip_effect(r.effect);n.oncommit(this.#a),n.ondiscard(this.#o)}else x&&(this.anchor=S),this.#a(n)}};function mr(e){T===null&&ve(`onMount`),Be&&T.l!==null?hr(T).m.push(e):sn(()=>{let t=Wn(e);if(typeof t==`function`)return t})}function hr(e){var t=e.l;return t.u??={a:[],b:[],m:[]}}function gr(e,t,n=!1){var r;x&&(r=S,Me());var i=new pr(e),a=n?se:0;function o(e,t){if(x){var n=Ie(r);if(e!==parseInt(n.substring(1))){var a=Fe();C(a),i.anchor=a,je(!1),i.ensure(e,t),je(!0);return}}i.ensure(e,t)}hn(()=>{var e=!1;t((t,n=0)=>{e=!0,o(n,t)}),e||o(-1,null)},a)}function _r(t,n,a=!1,o=!1,s=!1,c=!1){var l=t,u=``;if(a){var d=t;x&&(l=C(I(d)))}mn(()=>{var t=W;if(u===(u=n()??``)){x&&Me();return}if(a&&!x){t.nodes=null,d.innerHTML=u,u!==``&&Q(I(d),d.lastChild);return}if(t.nodes!==null&&(yn(t.nodes.start,t.nodes.end),t.nodes=null),u!==``){if(x){for(var c=S.data,f=Me(),p=f;f!==null&&(f.nodeType!==8||f.data!==``);)p=f,f=L(f);if(f===null)throw ke(),e;Q(S,p),l=C(f);return}var m=$t(o?`svg`:s?`math`:`template`,o?r:s?i:void 0);m.innerHTML=u;var h=o||s?m:m.content;if(Q(I(h),h.lastChild),o||s)for(;I(h);)l.before(I(h));else l.before(h)}})}function vr(e,t){dn(()=>{var n=e.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector(`#`+t.hash)){let e=$t(`style`);e.id=t.hash,e.textContent=t.code,r.appendChild(e)}})}function yr(e,t=!1){var n=t?` !important;`:`;`,r=``;for(var i of Object.keys(e)){var a=e[i];a!=null&&a!==``&&(r+=` `+i+`: `+a+n)}return r}function br(e){return e[0]!==`-`||e[1]!==`-`?e.toLowerCase():e}function xr(e,t){if(t){var n=``,r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,``).trim();var a=!1,o=0,s=!1,c=[];r&&c.push(...Object.keys(r).map(br)),i&&c.push(...Object.keys(i).map(br));var l=0,u=-1;let t=e.length;for(var d=0;d<t;d++){var f=e[d];if(s?f===`/`&&e[d-1]===`*`&&(s=!1):a?a===f&&(a=!1):f===`/`&&e[d+1]===`*`?s=!0:f===`"`||f===`'`?a=f:f===`(`?o++:f===`)`&&o--,!s&&a===!1&&o===0){if(f===`:`&&u===-1)u=d;else if(f===`;`||d===t-1){if(u!==-1){var p=br(e.substring(l,u).trim());if(!c.includes(p)){f!==`;`&&d++;var m=e.substring(l,d).trim();n+=` `+m+`;`}}l=d+1,u=-1}}}}return r&&(n+=yr(r)),i&&(n+=yr(i,!0)),n=n.trim(),n===``?null:n}return e==null?null:String(e)}function Sr(e,t={},n,r){for(var i in n){var a=n[i];t[i]!==a&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,a,r))}}function Cr(e,t,n,r){var i=e.__style;if(x||i!==t){var a=xr(t,r);(!x||a!==e.getAttribute(`style`))&&(a==null?e.removeAttribute(`style`):e.style.cssText=a),e.__style=t}else r&&(Array.isArray(r)?(Sr(e,n?.[0],r[0]),Sr(e,n?.[1],r[1],`important`)):Sr(e,n,r));return r}var wr=Symbol(`is custom element`),Tr=Symbol(`is html`),Er=_e?`link`:`LINK`;function Dr(e,t,n,r){var i=Or(e);x&&(i[t]=e.getAttribute(t),t===`src`||t===`srcset`||t===`href`&&e.nodeName===Er)||i[t]!==(i[t]=n)&&(t===`loading`&&(e[ge]=n),n==null?e.removeAttribute(t):typeof n!=`string`&&Ar(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function Or(e){return e.__attributes??={[wr]:e.nodeName.includes(`-`),[Tr]:e.namespaceURI===n}}var kr=new Map;function Ar(e){var t=e.getAttribute(`is`)||e.nodeName,n=kr.get(t);if(n)return n;kr.set(t,n=[]);for(var r,i=e,a=Element.prototype;a!==i;){for(var o in r=f(i),r)r[o].set&&n.push(o);i=h(i)}return n}function jr(e,t){return e===t||e?.[me]===t}function Mr(e={},t,n,r){var i=T.r,a=W;return dn(()=>{var o,s;return pn(()=>{o=s,s=r?.()||[],Wn(()=>{e!==n(...s)&&(t(e,...s),o&&jr(n(...o),e)&&t(null,...o))})}),()=>{let r=a;for(;r!==i&&r.parent!==null&&r.parent.f&33554432;)r=r.parent;let o=()=>{s&&jr(n(...s),e)&&t(null,...s)},c=r.teardown;r.teardown=()=>{o(),c?.()}}}),e}function Nr(e){return new Pr(e)}var Pr=class{#e;#t;constructor(e){var t=new Map,n=(e,n)=>{var r=Rt(n,!1,!1);return t.set(e,r),r};let r=new Proxy({...e.props||{},$$events:{}},{get(e,r){return Z(t.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===he?!0:(Z(t.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,i){return P(t.get(r)??n(r,i),i),Reflect.set(e,r,i)}});this.#t=(e.hydrate?cr:sr)(e.component,{target:e.target,anchor:e.anchor,props:r,context:e.context,intro:e.intro??!1,recover:e.recover,transformError:e.transformError}),!w&&(!e?.props?.$$host||e.sync===!1)&&lt(),this.#e=r.$$events;for(let e of Object.keys(this.#t))e===`$set`||e===`$destroy`||e===`$on`||u(this,e,{get(){return this.#t[e]},set(t){this.#t[e]=t},enumerable:!0});this.#t.$set=e=>{Object.assign(r,e)},this.#t.$destroy=()=>{fr(this.#t)}}$set(e){this.#t.$set(e)}$on(e,t){this.#e[e]=this.#e[e]||[];let n=(...e)=>t.call(this,...e);return this.#e[e].push(n),()=>{this.#e[e]=this.#e[e].filter(e=>e!==n)}}$destroy(){this.#t.$destroy()}},Fr;typeof HTMLElement==`function`&&(Fr=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;$$shadowRoot=null;constructor(e,t,n){super(),this.$$ctor=e,this.$$s=t,n&&(this.$$shadowRoot=this.attachShadow(n))}addEventListener(e,t,n){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(t),this.$$c){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}super.addEventListener(e,t,n)}removeEventListener(e,t,n){if(super.removeEventListener(e,t,n),this.$$c){let e=this.$$l_u.get(t);e&&(e(),this.$$l_u.delete(t))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){if(await Promise.resolve(),!this.$$cn||this.$$c)return;function e(e){return t=>{let n=$t(`slot`);e!==`default`&&(n.name=e),$(t,n)}}let t={},n=Lr(this);for(let r of this.$$s)r in n&&(r===`default`&&!this.$$d.children?(this.$$d.children=e(r),t.default=!0):t[r]=e(r));for(let e of this.attributes){let t=this.$$g_p(e.name);t in this.$$d||(this.$$d[t]=Ir(t,e.value,this.$$p_d,`toProp`))}for(let e in this.$$p_d)!(e in this.$$d)&&this[e]!==void 0&&(this.$$d[e]=this[e],delete this[e]);this.$$c=Nr({component:this.$$ctor,target:this.$$shadowRoot||this,props:{...this.$$d,$$slots:t,$$host:this}}),this.$$me=ln(()=>{pn(()=>{this.$$r=!0;for(let e of l(this.$$c)){if(!this.$$p_d[e]?.reflect)continue;this.$$d[e]=this.$$c[e];let t=Ir(e,this.$$d[e],this.$$p_d,`toAttribute`);t==null?this.removeAttribute(this.$$p_d[e].attribute||e):this.setAttribute(this.$$p_d[e].attribute||e,t)}this.$$r=!1})});for(let e in this.$$l)for(let t of this.$$l[e]){let n=this.$$c.$on(e,t);this.$$l_u.set(t,n)}this.$$l={}}}attributeChangedCallback(e,t,n){this.$$r||(e=this.$$g_p(e),this.$$d[e]=Ir(e,n,this.$$p_d,`toProp`),this.$$c?.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return l(this.$$p_d).find(t=>this.$$p_d[t].attribute===e||!this.$$p_d[t].attribute&&t.toLowerCase()===e)||e}});function Ir(e,t,n,r){let i=n[e]?.type;if(t=i===`Boolean`&&typeof t!=`boolean`?t!=null:t,!r||!n[e])return t;if(r===`toAttribute`)switch(i){case`Object`:case`Array`:return t==null?null:JSON.stringify(t);case`Boolean`:return t?``:null;case`Number`:return t??null;default:return t}else switch(i){case`Object`:case`Array`:return t&&JSON.parse(t);case`Boolean`:return t;case`Number`:return t==null?t:+t;default:return t}}function Lr(e){let t={};return e.childNodes.forEach(e=>{t[e.slot||`default`]=!0}),t}function Rr(e,t,n,r,i,a){let o=class extends Fr{constructor(){super(e,n,i),this.$$p_d=t}static get observedAttributes(){return l(t).map(e=>(t[e].attribute||e).toLowerCase())}};return l(t).forEach(e=>{u(o.prototype,e,{get(){return this.$$c&&e in this.$$c?this.$$c[e]:this.$$d[e]},set(n){n=Ir(e,n,t),this.$$d[e]=n;var r=this.$$c;r&&(d(r,e)?.get?r[e]=n:r.$set({[e]:n}))}})}),r.forEach(e=>{u(o.prototype,e,{get(){return this.$$c?.[e]}})}),a&&(o=a(o)),e.element=o,o}var zr=tr(`<div class="mb-4 prose"></div>`),Br=rr(`<svg style="width: 25px; height: 25px;" preserveAspectRatio="xMinYMin meet" version="1.1" viewBox="-283 359 34 35"><circle cx="-266" cy="375.9" r="14" fill="#bce2ff"></circle><path d="M-280.5,375.9c0-8,6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5s-6.5,14.5-14.5,14.5S-280.5,383.9-280.5,375.9z M-279.5,375.9c0,7.4,6.1,13.5,13.5,13.5c7.4,0,13.5-6.1,13.5-13.5s-6.1-13.5-13.5-13.5C-273.4,362.4-279.5,368.5-279.5,375.9z" fill="#bce2ff"></path><polygon points="-265.4,383.1 -258.6,377.2 -261.2,374.2 -264.3,376.9 -268.9,368.7 -272.4,370.6" fill="#1a9cff"></polygon></svg>`),Vr=rr(`<svg style="width: 25px; height: 25px;" preserveAspectRatio="xMinYMin meet" version="1.1" viewBox="-129.5 127 34 35"><path style="fill: #D0CAC5; stroke: #E6E3E0; stroke-width: 0.75; stroke-miterlimit: 10;" d="M-112.9,160.4c-8.5,0-15.5-6.9-15.5-15.5c0-8.5,6.9-15.5,15.5-15.5s15.5,6.9,15.5,15.5 C-97.4,153.5-104.3,160.4-112.9,160.4z"></path><path style="fill: #B3ABA4; stroke: #CDC7C2; stroke-width: 0.5; stroke-miterlimit: 10;" d="M-113.2,159c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-105.2,159-113.2,159z"></path><circle cx="-114.2" cy="143.5" r="14" fill="white"></circle><path d="M-114.2,158c-8,0-14.5-6.5-14.5-14.5s6.5-14.5,14.5-14.5s14.5,6.5,14.5,14.5S-106.2,158-114.2,158z M-114.2,130c-7.4,0-13.5,6.1-13.5,13.5s6.1,13.5,13.5,13.5s13.5-6.1,13.5-13.5S-106.8,130-114.2,130z" fill="#bce2ff"></path><polygon points="-114.8,150.7 -121.6,144.8 -119,141.8 -115.9,144.5 -111.3,136.3 -107.8,138.2" fill="#1a9cff"></polygon></svg>`),Hr=tr(`<button type="button" class="mb-3 flex items-center gap-2 cursor-pointer select-none"><!> <span class="text-sm hover:underline"> </span></button>`),Ur=tr(`<span class="correctness-icon svelte-1glps5n" style="background-color: #0EA449;"><svg style="width: 12px; height: 12px; color: white;" fill="currentColor" viewBox="0 0 24 24"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z"></path></svg></span>`),Wr=tr(`<span class="correctness-icon svelte-1glps5n" style="background-color: #BF0D00;"><svg style="width: 12px; height: 12px; color: white;" fill="currentColor" viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"></path></svg></span>`),Gr=tr(`<div class="p-4"><!> <!> <div class="relative inline-block"><!> <!> <input type="text" placeholder="Enter your answer..." class="outline-none px-3 py-2 rounded svelte-1glps5n"/></div></div>`),Kr={hash:`svelte-1glps5n`,code:`
3
- /* Custom styles for correct answer display */input[readonly].svelte-1glps5n {font-weight:600;}.correctness-icon.svelte-1glps5n {position:absolute;top:-8px;left:-8px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;padding:2px;}`};function qr(e,t){He(t,!0),vr(e,Kr);let n=null,r=N(!1);mr(()=>(n&&(n.value=t?.session?.response||``,n.addEventListener(`input`,i)),()=>{n&&n.removeEventListener(`input`,i)})),sn(()=>{if(n&&!Z(r)){let e=t?.session?.response||``;n.value!==e&&(n.value=e)}}),sn(()=>{n&&(Z(r)&&t?.model?.correctAnswer?n.value=t.model.correctAnswer:Z(r)||(n.value=t?.session?.response||``))});function i(e){let n=e.target,r=n.value,i={...t.session,response:r},a=n.closest(`simple-cloze`);a?._internalSession&&(a._internalSession=i);let o=new CustomEvent(`session-changed`,{bubbles:!0,composed:!0,detail:{complete:!0,component:`simple-cloze`}});a?.dispatchEvent(o)}function a(){P(r,!Z(r))}let o=Dt(()=>t?.model?.env?.mode===`evaluate`),s=Dt(()=>t?.model?.correctness),c=Dt(()=>Z(s)===`correct`),l=Dt(()=>Z(s)===`incorrect`);var u=Gr(),d=Yt(u),f=e=>{var n=zr();_r(n,()=>t.model.prompt,!0),Ne(n),$(e,n)};gr(d,e=>{t?.model?.prompt&&e(f)});var p=Xt(d,2),m=e=>{var t=Hr(),n=Yt(t),i=e=>{$(e,Br())},o=e=>{$(e,Vr())};gr(n,e=>{Z(r)?e(i):e(o,-1)});var s=Xt(n,2),c=Yt(s);Ne(s),Ne(t),mn(()=>{Dr(t,`aria-pressed`,Z(r)),or(c,`${Z(r)?`Hide`:`Show`} correct answer`)}),Jn(`click`,t,a),$(e,t)};gr(p,e=>{Z(o)&&Z(l)&&e(m)});var h=Xt(p,2),g=Yt(h),ee=e=>{$(e,Ur())};gr(g,e=>{Z(o)&&(Z(c)||Z(r))&&e(ee)});var te=Xt(g,2),ne=e=>{$(e,Wr())};gr(te,e=>{Z(o)&&Z(l)&&!Z(r)&&e(ne)});var _=Xt(te,2);let v;Mr(_,e=>n=e,()=>n),Ne(h),Ne(u),mn(()=>{_.disabled=t?.model?.disabled,_.readOnly=Z(r),v=Cr(_,``,v,{border:Z(o)&&(Z(c)||Z(r))?`solid 2px #0EA449`:Z(o)&&Z(l)&&!Z(r)?`solid 2px #BF0D00`:`solid 1px #d1d5db`,color:Z(o)&&(Z(c)||Z(l))?`black`:``})}),$(e,u),Ue()}Yn([`click`]),Rr(qr,{model:{type:`Object`},session:{type:`Object`}},[],[]);var Jr=qr.element,Yr=class extends Jr{_internalSession=null;set session(e){this._internalSession=e,super.session=e}get session(){return this._internalSession}onSessionChange=e=>{this._internalSession=e};connectedCallback(){super.connectedCallback(),this.onSessionChange=this.onSessionChange}};return typeof window<`u`&&!customElements.get(`simple-cloze-element`)&&customElements.define(`simple-cloze-element`,Yr),Yr})();
3
+ /* Custom styles for correct answer display */input[readonly].svelte-1glps5n {font-weight:600;}.correctness-icon.svelte-1glps5n {position:absolute;top:-8px;left:-8px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;padding:2px;}`};function qr(e,t){He(t,!0),vr(e,Kr);let n=null,r=N(!1);mr(()=>(n&&(n.value=t?.session?.response||``,n.addEventListener(`input`,i)),()=>{n&&n.removeEventListener(`input`,i)})),sn(()=>{if(n&&!Z(r)){let e=t?.session?.response||``;n.value!==e&&(n.value=e)}}),sn(()=>{n&&(Z(r)&&t?.model?.correctAnswer?n.value=t.model.correctAnswer:Z(r)||(n.value=t?.session?.response||``))});function i(e){let n=e.target,r=n.value,i={...t.session,response:r},a=n.closest(`simple-cloze`);a?._internalSession&&(a._internalSession=i);let o=new CustomEvent(`session-changed`,{bubbles:!0,composed:!0,detail:{complete:!0,component:`simple-cloze`}});a?.dispatchEvent(o)}function a(){P(r,!Z(r))}let o=Dt(()=>t?.model?.env?.mode===`evaluate`),s=Dt(()=>t?.model?.correctness),c=Dt(()=>Z(s)===`correct`),l=Dt(()=>Z(s)===`incorrect`);var u=Gr(),d=Yt(u),f=e=>{var n=zr();_r(n,()=>t.model.prompt,!0),Ne(n),$(e,n)};gr(d,e=>{t?.model?.prompt&&e(f)});var p=Xt(d,2),m=e=>{var t=Hr(),n=Yt(t),i=e=>{$(e,Br())},o=e=>{$(e,Vr())};gr(n,e=>{Z(r)?e(i):e(o,-1)});var s=Xt(n,2),c=Yt(s);Ne(s),Ne(t),mn(()=>{Dr(t,`aria-pressed`,Z(r)),or(c,`${Z(r)?`Hide`:`Show`} correct answer`)}),Jn(`click`,t,a),$(e,t)};gr(p,e=>{Z(o)&&Z(l)&&e(m)});var h=Xt(p,2),g=Yt(h),ee=e=>{$(e,Ur())};gr(g,e=>{Z(o)&&(Z(c)||Z(r))&&e(ee)});var te=Xt(g,2),ne=e=>{$(e,Wr())};gr(te,e=>{Z(o)&&Z(l)&&!Z(r)&&e(ne)});var _=Xt(te,2);let v;Mr(_,e=>n=e,()=>n),Ne(h),Ne(u),mn(()=>{_.disabled=t?.model?.disabled,_.readOnly=Z(r),v=Cr(_,``,v,{border:Z(o)&&(Z(c)||Z(r))?`solid 2px #0EA449`:Z(o)&&Z(l)&&!Z(r)?`solid 2px #BF0D00`:`solid 1px #d1d5db`,color:Z(o)&&(Z(c)||Z(l))?`black`:``})}),$(e,u),Ue()}Yn([`click`]),Rr(qr,{model:{type:`Object`},session:{type:`Object`}},[],[]);var Jr=qr.element;return class extends Jr{_internalSession=null;set session(e){this._internalSession=e,super.session=e}get session(){return this._internalSession}onSessionChange=e=>{this._internalSession=e};connectedCallback(){super.connectedCallback(),this.onSessionChange=this.onSessionChange}}})();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pie-element/simple-cloze",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Simple cloze (text entry) demo/template PIE element built with Svelte 5",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -44,8 +44,8 @@
44
44
  "clean": "rm -rf dist tsconfig.tsbuildinfo"
45
45
  },
46
46
  "dependencies": {
47
- "@pie-lib/editable-html-tiptap-svelte": "0.1.0",
48
- "@pie-lib-svelte/styling": "0.1.0",
47
+ "@pie-lib/editable-html-tiptap-svelte": "0.1.1",
48
+ "@pie-lib-svelte/styling": "0.1.1",
49
49
  "lodash-es": "^4.17.21"
50
50
  },
51
51
  "peerDependencies": {
package/src/index.iife.ts CHANGED
@@ -1,11 +1,7 @@
1
1
  /**
2
2
  * IIFE entry point for simple-cloze element.
3
- * Registers the delivery custom element when loaded as a script.
3
+ * Exports the delivery component for host/player registration.
4
4
  */
5
5
  import Element from './delivery';
6
6
 
7
- if (typeof window !== 'undefined' && !customElements.get('simple-cloze-element')) {
8
- customElements.define('simple-cloze-element', Element as unknown as CustomElementConstructor);
9
- }
10
-
11
7
  export default Element;