@xtrable-ltd/nanoesis 0.1.24 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/dist/adapter-azure-blob.js +5 -2
  2. package/dist/{chunk-NYAKX3NO.js → chunk-H6ZHZWDJ.js} +5 -5
  3. package/dist/{chunk-MYRB56TQ.js → chunk-TEIQFPNO.js} +1 -1
  4. package/dist/editor-api.js +2 -2
  5. package/dist/index.js +1 -1
  6. package/dist/mcp.js +3 -3
  7. package/editor/assets/{MigrationsPane-BPluopZZ.js → MigrationsPane-BEY3O03s.js} +1 -1
  8. package/editor/assets/{TemplatesPane-DPxDC7lv.js → TemplatesPane-Dt8Z7trK.js} +7 -7
  9. package/editor/assets/{cssMode-Dx3AlfE7.js → cssMode-D9n2swjt.js} +1 -1
  10. package/editor/assets/{freemarker2-BrE64rGl.js → freemarker2-DPD1J29I.js} +1 -1
  11. package/editor/assets/{handlebars-Dmct-h7-.js → handlebars-D3A5tmfF.js} +1 -1
  12. package/editor/assets/{html-COEwkE8E.js → html-ChVj5GP3.js} +1 -1
  13. package/editor/assets/{htmlMode-CQfLiaoY.js → htmlMode-BLNw3RHS.js} +1 -1
  14. package/editor/assets/index-D4IOSCAV.css +7 -0
  15. package/editor/assets/index-DbxwBEBR.js +145 -0
  16. package/editor/assets/{javascript-CWY7A3RQ.js → javascript-DNcoKqyy.js} +1 -1
  17. package/editor/assets/{jsonMode-BLIzeRrH.js → jsonMode-DMU6Vb_m.js} +1 -1
  18. package/editor/assets/{liquid-DE4N9HCE.js → liquid-BXHGTS2v.js} +1 -1
  19. package/editor/assets/{mdx-EHmT8vIf.js → mdx-BV8b_dZV.js} +1 -1
  20. package/editor/assets/{python-UqX-1t0u.js → python-C4cGrrAN.js} +1 -1
  21. package/editor/assets/{razor-CbOExQTE.js → razor-DW1FX8pl.js} +1 -1
  22. package/editor/assets/{tsMode-2vMWvrQA.js → tsMode-C141_BK1.js} +1 -1
  23. package/editor/assets/{typescript-Cn6ZVleZ.js → typescript-CakAGQIi.js} +1 -1
  24. package/editor/assets/{xml-Ba0Fxp6f.js → xml-BbYDGoTr.js} +1 -1
  25. package/editor/assets/{yaml-BgkDyEaM.js → yaml-CSwnT3wl.js} +1 -1
  26. package/editor/index.html +2 -2
  27. package/package.json +1 -1
  28. package/editor/assets/index-B3xz0QIE.js +0 -143
  29. package/editor/assets/index-C9dl_3yI.css +0 -7
@@ -0,0 +1,145 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./TemplatesPane-Dt8Z7trK.js","./TemplatesPane-C-T4XiLp.css","./MigrationsPane-BEY3O03s.js","./MigrationsPane-BAHPPSXP.css"])))=>i.map(i=>d[i]);
2
+ var kv=Object.defineProperty;var r0=t=>{throw TypeError(t)};var Pv=(t,e,n)=>e in t?kv(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ve=(t,e,n)=>Pv(t,typeof e!="symbol"?e+"":e,n),Nc=(t,e,n)=>e.has(t)||r0("Cannot "+n);var X=(t,e,n)=>(Nc(t,e,"read from private field"),n?n.call(t):e.get(t)),Ue=(t,e,n)=>e.has(t)?r0("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),je=(t,e,n,r)=>(Nc(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),et=(t,e,n)=>(Nc(t,e,"access private method"),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();const xm=!1;var Mf=Array.isArray,Mv=Array.prototype.indexOf,Ca=Array.prototype.includes,Hl=Array.from,Bv=Object.defineProperty,Gs=Object.getOwnPropertyDescriptor,Rm=Object.getOwnPropertyDescriptors,Fv=Object.prototype,Uv=Array.prototype,Bf=Object.getPrototypeOf,s0=Object.isExtensible;function ao(t){return typeof t=="function"}const Ff=()=>{};function Hv(t){return t()}function od(t){for(var e=0;e<t.length;e++)t[e]()}function Dm(){var t,e,n=new Promise((r,s)=>{t=r,e=s});return{promise:n,resolve:t,reject:e}}function qv(t,e){if(Array.isArray(t))return t;if(!(Symbol.iterator in t))return Array.from(t);const n=[];for(const r of t)if(n.push(r),n.length===e)break;return n}const dn=2,Di=4,iu=8,Uf=1<<24,yr=16,Cr=32,Zs=64,ud=128,or=512,Qt=1024,rn=2048,ns=4096,Ln=8192,ur=16384,Ga=32768,ld=1<<25,Ts=65536,hl=1<<17,jv=1<<18,Vi=1<<19,km=1<<20,Xr=1<<25,Ba=65536,pl=1<<21,Ei=1<<22,Ks=1<<23,Qr=Symbol("$state"),Pm=Symbol("legacy props"),$v=Symbol(""),Qu=Symbol("attributes"),cd=Symbol("class"),dd=Symbol("style"),mo=Symbol("text"),Zu=Symbol("form reset"),ql=new class extends Error{constructor(){super(...arguments);ve(this,"name","StaleReactionError");ve(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var Cm;const Hf=!!((Cm=globalThis.document)!=null&&Cm.contentType)&&globalThis.document.contentType.includes("xml");function Mm(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Yv(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function zv(t,e,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function Wv(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function Gv(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function Kv(t){throw new Error("https://svelte.dev/e/effect_orphan")}function Vv(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function Xv(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function Qv(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Zv(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Jv(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function eE(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const tE=1,nE=2,Bm=4,rE=8,sE=16,aE=1,iE=2,oE=4,uE=8,lE=16,cE=1,dE=2,jt=Symbol("uninitialized"),Fm="http://www.w3.org/1999/xhtml",fE="http://www.w3.org/2000/svg",hE="@attach";function pE(){console.warn("https://svelte.dev/e/derived_inert")}function mE(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function gE(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function Um(t){return t===this.v}function bE(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Hm(t){return!bE(t,this.v)}let Xi=!1,vE=!1;function EE(){Xi=!0}let At=null;function ki(t){At=t}function TE(t){return _E().get(t)}function it(t,e=!1,n){At={p:At,i:!1,c:null,e:null,s:t,x:null,r:Xe,l:Xi&&!e?{s:null,u:null,$:[]}:null}}function ot(t){var e=At,n=e.e;if(n!==null){e.e=null;for(var r of n)l1(r)}return e.i=!0,At=e.p,{}}function Qi(){return!Xi||At!==null&&At.l===null}function _E(t){return At===null&&Mm(),At.c??(At.c=new Map(AE(At)||void 0))}function AE(t){let e=t.p;for(;e!==null;){const n=e.c;if(n!==null)return n;e=e.p}return null}let va=[];function qm(){var t=va;va=[],od(t)}function wr(t){if(va.length===0&&!yo){var e=va;queueMicrotask(()=>{e===va&&qm()})}va.push(t)}function yE(){for(;va.length>0;)qm()}function jm(t){var e=Xe;if(e===null)return Qe.f|=Ks,t;if((e.f&Ga)===0&&(e.f&Di)===0)throw t;qs(t,e)}function qs(t,e){for(;e!==null;){if((e.f&ud)!==0){if((e.f&Ga)===0)throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}const NE=-7169;function Dt(t,e){t.f=t.f&NE|e}function qf(t){(t.f&or)!==0||t.deps===null?Dt(t,Qt):Dt(t,ns)}function $m(t){if(t!==null)for(const e of t)(e.f&dn)===0||(e.f&Ba)===0||(e.f^=Ba,$m(e.deps))}function Ym(t,e,n){(t.f&rn)!==0?e.add(t):(t.f&ns)!==0&&n.add(t),$m(t.deps),Dt(t,Qt)}let Cu=!1;function SE(t){var e=Cu;try{return Cu=!1,[t(),Cu]}finally{Cu=e}}let Sc=null,ii=null,ke=null,Ao=null,un=null,fd=null,yo=!1,wc=!1,gi=null,Ju=null;var a0=0;let wE=1;var wi,Bs,Aa,Ii,Ci,ya,Li,hs,Jo,Un,eu,Fs,Wr,Gr,Oi,Na,ht,hd,go,pd,zm,Wm,el,IE,md,ui;const Pl=class Pl{constructor(){Ue(this,ht);ve(this,"id",wE++);Ue(this,wi,!1);ve(this,"linked",!0);Ue(this,Bs,null);Ue(this,Aa,null);ve(this,"async_deriveds",new Map);ve(this,"current",new Map);ve(this,"previous",new Map);ve(this,"unblocked",new Set);Ue(this,Ii,new Set);Ue(this,Ci,new Set);Ue(this,ya,new Set);Ue(this,Li,0);Ue(this,hs,new Map);Ue(this,Jo,null);Ue(this,Un,[]);Ue(this,eu,[]);Ue(this,Fs,new Set);Ue(this,Wr,new Set);Ue(this,Gr,new Map);Ue(this,Oi,new Set);ve(this,"is_fork",!1);Ue(this,Na,!1)}skip_effect(e){X(this,Gr).has(e)||X(this,Gr).set(e,{d:[],m:[]}),X(this,Oi).delete(e)}unskip_effect(e,n=r=>this.schedule(r)){var r=X(this,Gr).get(e);if(r){X(this,Gr).delete(e);for(var s of r.d)Dt(s,rn),n(s);for(s of r.m)Dt(s,ns),n(s)}X(this,Oi).add(e)}capture(e,n,r=!1){e.v!==jt&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&Ks)===0&&(this.current.set(e,[n,r]),un==null||un.set(e,n)),this.is_fork||(e.v=n)}activate(){ke=this}deactivate(){ke=null,un=null}flush(){try{wc=!0,ke=this,et(this,ht,go).call(this)}finally{a0=0,fd=null,gi=null,Ju=null,wc=!1,ke=null,un=null,La.clear()}}discard(){for(const e of X(this,Ci))e(this);X(this,Ci).clear(),X(this,ya).clear(),et(this,ht,ui).call(this)}register_created_effect(e){X(this,eu).push(e)}increment(e,n){if(je(this,Li,X(this,Li)+1),e){let r=X(this,hs).get(n)??0;X(this,hs).set(n,r+1)}}decrement(e,n){if(je(this,Li,X(this,Li)-1),e){let r=X(this,hs).get(n)??0;r===1?X(this,hs).delete(n):X(this,hs).set(n,r-1)}X(this,Na)||(je(this,Na,!0),wr(()=>{je(this,Na,!1),this.linked&&this.flush()}))}transfer_effects(e,n){for(const r of e)X(this,Fs).add(r);for(const r of n)X(this,Wr).add(r);e.clear(),n.clear()}oncommit(e){X(this,Ii).add(e)}ondiscard(e){X(this,Ci).add(e)}on_fork_commit(e){X(this,ya).add(e)}run_fork_commit_callbacks(){for(const e of X(this,ya))e(this);X(this,ya).clear()}settled(){return(X(this,Jo)??je(this,Jo,Dm())).promise}static ensure(){var e;if(ke===null){const n=ke=new Pl;et(e=n,ht,md).call(e),!wc&&!yo&&wr(()=>{X(n,wi)||n.flush()})}return ke}apply(){{un=null;return}}schedule(e){var s;if(fd=e,(s=e.b)!=null&&s.is_pending&&(e.f&(Di|iu|Uf))!==0&&(e.f&Ga)===0){e.b.defer_effect(e);return}for(var n=e;n.parent!==null;){n=n.parent;var r=n.f;if(gi!==null&&n===Xe&&(Qe===null||(Qe.f&dn)===0))return;if((r&(Zs|Cr))!==0){if((r&Qt)===0)return;n.f^=Qt}}X(this,Un).push(n)}};wi=new WeakMap,Bs=new WeakMap,Aa=new WeakMap,Ii=new WeakMap,Ci=new WeakMap,ya=new WeakMap,Li=new WeakMap,hs=new WeakMap,Jo=new WeakMap,Un=new WeakMap,eu=new WeakMap,Fs=new WeakMap,Wr=new WeakMap,Gr=new WeakMap,Oi=new WeakMap,Na=new WeakMap,ht=new WeakSet,hd=function(){if(this.is_fork)return!0;for(const r of X(this,hs).keys()){for(var e=r,n=!1;e.parent!==null;){if(X(this,Gr).has(e)){n=!0;break}e=e.parent}if(!n)return!0}return!1},go=function(){var u,d,h,g;if(je(this,wi,!0),a0++>1e3&&(et(this,ht,ui).call(this),LE()),!et(this,ht,hd).call(this)){for(const f of X(this,Fs))X(this,Wr).delete(f),Dt(f,rn),this.schedule(f);for(const f of X(this,Wr))Dt(f,ns),this.schedule(f)}const e=X(this,Un);je(this,Un,[]),this.apply();var n=gi=[],r=[],s=Ju=[];for(const f of e)try{et(this,ht,pd).call(this,f,n,r)}catch(p){throw Vm(f),p}if(ke=null,s.length>0){var a=Pl.ensure();for(const f of s)a.schedule(f)}if(gi=null,Ju=null,et(this,ht,hd).call(this)){et(this,ht,el).call(this,r),et(this,ht,el).call(this,n);for(const[f,p]of X(this,Gr))Km(f,p);s.length>0&&et(u=ke,ht,go).call(u);return}const i=et(this,ht,zm).call(this);if(i){et(d=i,ht,Wm).call(d,this);return}X(this,Fs).clear(),X(this,Wr).clear();for(const f of X(this,Ii))f(this);X(this,Ii).clear(),Ao=this,i0(r),i0(n),Ao=null,(h=X(this,Jo))==null||h.resolve();var o=ke;if(this.linked&&X(this,Li)===0&&et(this,ht,ui).call(this),X(this,Un).length>0){o===null&&(o=this,et(this,ht,md).call(this));const f=o;X(f,Un).push(...X(this,Un).filter(p=>!X(f,Un).includes(p)))}o!==null&&et(g=o,ht,go).call(g)},pd=function(e,n,r){e.f^=Qt;for(var s=e.first;s!==null;){var a=s.f,i=(a&(Cr|Zs))!==0,o=i&&(a&Qt)!==0,u=o||(a&Ln)!==0||X(this,Gr).has(s);if(!u&&s.fn!==null){i?s.f^=Qt:(a&Di)!==0?n.push(s):lu(s)&&((a&yr)!==0&&X(this,Wr).add(s),Fi(s));var d=s.first;if(d!==null){s=d;continue}}for(;s!==null;){var h=s.next;if(h!==null){s=h;break}s=s.parent}}},zm=function(){for(var e=X(this,Bs);e!==null;){if(!e.is_fork){for(const[n,[,r]]of this.current)if(e.current.has(n)&&!r)return e}e=X(e,Bs)}return null},Wm=function(e){var r;for(const[s,a]of e.current)!this.previous.has(s)&&e.previous.has(s)&&this.previous.set(s,e.previous.get(s)),this.current.set(s,a);for(const[s,a]of e.async_deriveds){const i=this.async_deriveds.get(s);i&&a.promise.then(i.resolve)}const n=s=>{var a=s.reactions;if(a!==null)for(const u of a){var i=u.f;if((i&dn)!==0)n(u);else{var o=u;i&(Ei|yr)&&!this.async_deriveds.has(o)&&(X(this,Wr).delete(o),Dt(o,rn),this.schedule(o))}}};for(const s of this.current.keys())n(s);this.oncommit(()=>e.discard()),et(r=e,ht,ui).call(r),ke=this,et(this,ht,go).call(this)},el=function(e){for(var n=0;n<e.length;n+=1)Ym(e[n],X(this,Fs),X(this,Wr))},IE=function(){var h;et(this,ht,ui).call(this);for(let g=Sc;g!==null;g=X(g,Aa)){var e=g.id<this.id,n=[];for(const[f,[p,b]]of this.current){if(g.current.has(f)){var r=g.current.get(f)[0];if(e&&p!==r)g.current.set(f,[p,b]);else continue}n.push(f)}if(e)for(const[f,p]of this.async_deriveds){const b=g.async_deriveds.get(f);b&&p.promise.then(b.resolve)}if(X(g,wi)){var s=[...g.current.keys()].filter(f=>!this.current.has(f));if(s.length===0)e&&g.discard();else if(n.length>0){if(e)for(const f of X(this,Oi))g.unskip_effect(f,p=>{var b;(p.f&(yr|Ei))!==0?g.schedule(p):et(b=g,ht,el).call(b,[p])});g.activate();var a=new Set,i=new Map;for(var o of n)Gm(o,s,a,i);i=new Map;var u=[...g.current.keys()].filter(f=>this.current.has(f)?this.current.get(f)[0]!==f.v:!0);if(u.length>0)for(const f of X(this,eu))(f.f&(ur|Ln|hl))===0&&jf(f,u,i)&&((f.f&(Ei|yr))!==0?(Dt(f,rn),g.schedule(f)):X(g,Fs).add(f));if(X(g,Un).length>0&&!X(g,Na)){g.apply();for(var d of X(g,Un))et(h=g,ht,pd).call(h,d,[],[]);je(g,Un,[])}g.deactivate()}}}},md=function(){ii===null?Sc=ii=this:(je(ii,Aa,this),je(this,Bs,ii)),ii=this},ui=function(){var e=X(this,Bs),n=X(this,Aa);e===null?Sc=n:je(e,Aa,n),n===null?ii=e:je(n,Bs,e),this.linked=!1};let Fa=Pl;function CE(t){var e=yo;yo=!0;try{for(var n;;){if(yE(),ke===null)return n;ke.flush()}}finally{yo=e}}function LE(){try{Vv()}catch(t){qs(t,fd)}}let gr=null;function i0(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var r=t[n++];if((r.f&(ur|Ln))===0&&lu(r)&&(gr=new Set,Fi(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&f1(r),(gr==null?void 0:gr.size)>0)){La.clear();for(const s of gr){if((s.f&(ur|Ln))!==0)continue;const a=[s];let i=s.parent;for(;i!==null;)gr.has(i)&&(gr.delete(i),a.push(i)),i=i.parent;for(let o=a.length-1;o>=0;o--){const u=a[o];(u.f&(ur|Ln))===0&&Fi(u)}}gr.clear()}}gr=null}}function Gm(t,e,n,r){if(!n.has(t)&&(n.add(t),t.reactions!==null))for(const s of t.reactions){const a=s.f;(a&dn)!==0?Gm(s,e,n,r):(a&(Ei|yr))!==0&&(a&rn)===0&&jf(s,e,r)&&(Dt(s,rn),$f(s))}}function jf(t,e,n){const r=n.get(t);if(r!==void 0)return r;if(t.deps!==null)for(const s of t.deps){if(Ca.call(e,s))return!0;if((s.f&dn)!==0&&jf(s,e,n))return n.set(s,!0),!0}return n.set(t,!1),!1}function $f(t){ke.schedule(t)}function Km(t,e){if(!((t.f&Cr)!==0&&(t.f&Qt)!==0)){(t.f&rn)!==0?e.d.push(t):(t.f&ns)!==0&&e.m.push(t),Dt(t,Qt);for(var n=t.first;n!==null;)Km(n,e),n=n.next}}function Vm(t){Dt(t,Qt);for(var e=t.first;e!==null;)Vm(e),e=e.next}function OE(t){let e=0,n=Ua(0),r;return()=>{Gf()&&(l(n),$l(()=>(e===0&&(r=ea(()=>t(()=>No(n)))),e+=1,()=>{wr(()=>{e-=1,e===0&&(r==null||r(),r=void 0,No(n))})})))}}var xE=Ts|Vi;function RE(t,e,n,r){new DE(t,e,n,r)}var Jn,Pf,er,Sa,Rn,tr,wn,Hn,ps,wa,Us,xi,tu,nu,ms,Ml,kt,kE,PE,ME,gd,tl,nl,bd,vd;class DE{constructor(e,n,r,s){Ue(this,kt);ve(this,"parent");ve(this,"is_pending",!1);ve(this,"transform_error");Ue(this,Jn);Ue(this,Pf,null);Ue(this,er);Ue(this,Sa);Ue(this,Rn);Ue(this,tr,null);Ue(this,wn,null);Ue(this,Hn,null);Ue(this,ps,null);Ue(this,wa,0);Ue(this,Us,0);Ue(this,xi,!1);Ue(this,tu,new Set);Ue(this,nu,new Set);Ue(this,ms,null);Ue(this,Ml,OE(()=>(je(this,ms,Ua(X(this,wa))),()=>{je(this,ms,null)})));var a;je(this,Jn,e),je(this,er,n),je(this,Sa,i=>{var o=Xe;o.b=this,o.f|=ud,r(i)}),this.parent=Xe.b,this.transform_error=s??((a=this.parent)==null?void 0:a.transform_error)??(i=>i),je(this,Rn,Ka(()=>{et(this,kt,gd).call(this)},xE))}defer_effect(e){Ym(e,X(this,tu),X(this,nu))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!X(this,er).pending}update_pending_count(e,n){et(this,kt,bd).call(this,e,n),je(this,wa,X(this,wa)+e),!(!X(this,ms)||X(this,xi))&&(je(this,xi,!0),wr(()=>{je(this,xi,!1),X(this,ms)&&Mi(X(this,ms),X(this,wa))}))}get_effect_pending(){return X(this,Ml).call(this),l(X(this,ms))}error(e){if(!X(this,er).onerror&&!X(this,er).failed)throw e;ke!=null&&ke.is_fork?(X(this,tr)&&ke.skip_effect(X(this,tr)),X(this,wn)&&ke.skip_effect(X(this,wn)),X(this,Hn)&&ke.skip_effect(X(this,Hn)),ke.on_fork_commit(()=>{et(this,kt,vd).call(this,e)})):et(this,kt,vd).call(this,e)}}Jn=new WeakMap,Pf=new WeakMap,er=new WeakMap,Sa=new WeakMap,Rn=new WeakMap,tr=new WeakMap,wn=new WeakMap,Hn=new WeakMap,ps=new WeakMap,wa=new WeakMap,Us=new WeakMap,xi=new WeakMap,tu=new WeakMap,nu=new WeakMap,ms=new WeakMap,Ml=new WeakMap,kt=new WeakSet,kE=function(){try{je(this,tr,kn(()=>X(this,Sa).call(this,X(this,Jn))))}catch(e){this.error(e)}},PE=function(e){const n=X(this,er).failed;n&&je(this,Hn,kn(()=>{n(X(this,Jn),()=>e,()=>()=>{})}))},ME=function(){const e=X(this,er).pending;e&&(this.is_pending=!0,je(this,wn,kn(()=>e(X(this,Jn)))),wr(()=>{var n=je(this,ps,document.createDocumentFragment()),r=Zr();n.append(r),je(this,tr,et(this,kt,nl).call(this,()=>kn(()=>X(this,Sa).call(this,r)))),X(this,Us)===0&&(X(this,Jn).before(n),je(this,ps,null),Oa(X(this,wn),()=>{je(this,wn,null)}),et(this,kt,tl).call(this,ke))}))},gd=function(){try{if(this.is_pending=this.has_pending_snippet(),je(this,Us,0),je(this,wa,0),je(this,tr,kn(()=>{X(this,Sa).call(this,X(this,Jn))})),X(this,Us)>0){var e=je(this,ps,document.createDocumentFragment());Xf(X(this,tr),e);const n=X(this,er).pending;je(this,wn,kn(()=>n(X(this,Jn))))}else et(this,kt,tl).call(this,ke)}catch(n){this.error(n)}},tl=function(e){this.is_pending=!1,e.transfer_effects(X(this,tu),X(this,nu))},nl=function(e){var n=Xe,r=Qe,s=At;rs(X(this,Rn)),cr(X(this,Rn)),ki(X(this,Rn).ctx);try{return Fa.ensure(),e()}catch(a){return jm(a),null}finally{rs(n),cr(r),ki(s)}},bd=function(e,n){var r;if(!this.has_pending_snippet()){this.parent&&et(r=this.parent,kt,bd).call(r,e,n);return}je(this,Us,X(this,Us)+e),X(this,Us)===0&&(et(this,kt,tl).call(this,n),X(this,wn)&&Oa(X(this,wn),()=>{je(this,wn,null)}),X(this,ps)&&(X(this,Jn).before(X(this,ps)),je(this,ps,null)))},vd=function(e){X(this,tr)&&(ln(X(this,tr)),je(this,tr,null)),X(this,wn)&&(ln(X(this,wn)),je(this,wn,null)),X(this,Hn)&&(ln(X(this,Hn)),je(this,Hn,null));var n=X(this,er).onerror;let r=X(this,er).failed;var s=!1,a=!1;const i=()=>{if(s){gE();return}s=!0,a&&eE(),X(this,Hn)!==null&&Oa(X(this,Hn),()=>{je(this,Hn,null)}),et(this,kt,nl).call(this,()=>{et(this,kt,gd).call(this)})},o=u=>{try{a=!0,n==null||n(u,i),a=!1}catch(d){qs(d,X(this,Rn)&&X(this,Rn).parent)}r&&je(this,Hn,et(this,kt,nl).call(this,()=>{try{return kn(()=>{var d=Xe;d.b=this,d.f|=ud,r(X(this,Jn),()=>u,()=>i)})}catch(d){return qs(d,X(this,Rn).parent),null}}))};wr(()=>{var u;try{u=this.transform_error(e)}catch(d){qs(d,X(this,Rn)&&X(this,Rn).parent);return}u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(o,d=>qs(d,X(this,Rn)&&X(this,Rn).parent)):o(u)})};function Xm(t,e,n,r){const s=Qi()?Pi:Yf;var a=t.filter(f=>!f.settled);if(n.length===0&&a.length===0){r(e.map(s));return}var i=Xe,o=BE(),u=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(f=>f.promise)):null;function d(f){if((i.f&ur)===0){o();try{r(f)}catch(p){qs(p,i)}ml()}}var h=Qm();if(n.length===0){u.then(()=>d(e.map(s))).finally(h);return}function g(){Promise.all(n.map(f=>FE(f))).then(f=>d([...e.map(s),...f])).catch(f=>qs(f,i)).finally(h)}u?u.then(()=>{o(),g(),ml()}):g()}function BE(){var t=Xe,e=Qe,n=At,r=ke;return function(a=!0){rs(t),cr(e),ki(n),a&&(t.f&ur)===0&&(r==null||r.activate(),r==null||r.apply())}}function ml(t=!0){rs(null),cr(null),ki(null),t&&(ke==null||ke.deactivate())}function Qm(){var t=Xe,e=t.b,n=ke,r=e.is_rendered();return e.update_pending_count(1,n),n.increment(r,t),()=>{e.update_pending_count(-1,n),n.decrement(r,t)}}function Pi(t){var e=dn|rn;return Xe!==null&&(Xe.f|=Vi),{ctx:At,deps:null,effects:null,equals:Um,f:e,fn:t,reactions:null,rv:0,v:jt,wv:0,parent:Xe,ac:null}}const Lu=Symbol("obsolete");function FE(t,e,n){let r=Xe;r===null&&Yv();var s=void 0,a=Ua(jt),i=!Qe,o=new Set;return VE(()=>{var p;var u=Xe,d=Dm();s=d.promise;try{Promise.resolve(t()).then(d.resolve,b=>{b!==ql&&d.reject(b)}).finally(ml)}catch(b){d.reject(b),ml()}var h=ke;if(i){if((u.f&Ga)!==0)var g=Qm();if(r.b.is_rendered())(p=h.async_deriveds.get(u))==null||p.reject(Lu);else for(const b of o.values())b.reject(Lu);o.add(d),h.async_deriveds.set(u,d)}const f=(b,A=void 0)=>{g==null||g(),o.delete(d),A!==Lu&&(h.activate(),A?(a.f|=Ks,Mi(a,A)):((a.f&Ks)!==0&&(a.f^=Ks),Mi(a,b)),h.deactivate())};d.promise.then(f,b=>f(null,b||"unknown"))}),uu(()=>{for(const u of o)u.reject(Lu)}),new Promise(u=>{function d(h){function g(){h===s?u(a):d(s)}h.then(g,g)}d(s)})}function Ae(t){const e=Pi(t);return m1(e),e}function Yf(t){const e=Pi(t);return e.equals=Hm,e}function UE(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)ln(e[n])}}function zf(t){var e,n=Xe,r=t.parent;if(!_s&&r!==null&&t.v!==jt&&(r.f&(ur|Ln))!==0)return pE(),t.v;rs(r);try{t.f&=~Ba,UE(t),e=E1(t)}finally{rs(n)}return e}function Zm(t){var e=zf(t);if(!t.equals(e)&&(t.wv=b1(),(!(ke!=null&&ke.is_fork)||t.deps===null)&&(ke!==null?(ke.capture(t,e,!0),Ao==null||Ao.capture(t,e,!0)):t.v=e,t.deps===null))){Dt(t,Qt);return}_s||(un!==null?(Gf()||ke!=null&&ke.is_fork)&&un.set(t,e):qf(t))}function HE(t){var e,n;if(t.effects!==null)for(const r of t.effects)(r.teardown||r.ac)&&((e=r.teardown)==null||e.call(r),(n=r.ac)==null||n.abort(ql),r.fn!==null&&(r.teardown=Ff),r.ac=null,Uo(r,0),Kf(r))}function Jm(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&e.fn!==null&&Fi(e)}let gl=new Set;const La=new Map;let e1=!1;function Ua(t,e){var n={f:0,v:t,reactions:null,equals:Um,rv:0,wv:0};return n}function J(t,e){const n=Ua(t);return m1(n),n}function qE(t,e=!1,n=!0){var s;const r=Ua(t);return e||(r.equals=Hm),Xi&&n&&At!==null&&At.l!==null&&((s=At.l).s??(s.s=[])).push(r),r}function y(t,e,n=!1){Qe!==null&&(!Nr||(Qe.f&hl)!==0)&&Qi()&&(Qe.f&(dn|yr|Ei|hl))!==0&&(lr===null||!Ca.call(lr,t))&&Jv();let r=n?ft(e):e;return Mi(t,r,Ju)}function Mi(t,e,n=null){if(!t.equals(e)){La.set(t,_s?e:t.v);var r=Fa.ensure();if(r.capture(t,e),(t.f&dn)!==0){const s=t;(t.f&rn)!==0&&zf(s),un===null&&qf(s)}t.wv=b1(),t1(t,rn,n),Qi()&&Xe!==null&&(Xe.f&Qt)!==0&&(Xe.f&(Cr|Zs))===0&&(Zn===null?ZE([t]):Zn.push(t)),!r.is_fork&&gl.size>0&&!e1&&jE()}return e}function jE(){e1=!1;for(const t of gl){(t.f&Qt)!==0&&Dt(t,ns);let e;try{e=lu(t)}catch{e=!0}e&&Fi(t)}gl.clear()}function No(t){y(t,t.v+1)}function t1(t,e,n){var r=t.reactions;if(r!==null)for(var s=Qi(),a=r.length,i=0;i<a;i++){var o=r[i],u=o.f;if(!(!s&&o===Xe)){var d=(u&rn)===0;if(d&&Dt(o,e),(u&hl)!==0)gl.add(o);else if((u&dn)!==0){var h=o;un==null||un.delete(h),(u&Ba)===0&&(u&or&&(Xe===null||(Xe.f&pl)===0)&&(o.f|=Ba),t1(h,ns,n))}else if(d){var g=o;(u&yr)!==0&&gr!==null&&gr.add(g),n!==null?n.push(g):$f(g)}}}}function ft(t){if(typeof t!="object"||t===null||Qr in t)return t;const e=Bf(t);if(e!==Fv&&e!==Uv)return t;var n=new Map,r=Mf(t),s=J(0),a=xa,i=o=>{if(xa===a)return o();var u=Qe,d=xa;cr(null),d0(a);var h=o();return cr(u),d0(d),h};return r&&n.set("length",J(t.length)),new Proxy(t,{defineProperty(o,u,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&Qv();var h=n.get(u);return h===void 0?i(()=>{var g=J(d.value);return n.set(u,g),g}):y(h,d.value,!0),!0},deleteProperty(o,u){var d=n.get(u);if(d===void 0){if(u in o){const h=i(()=>J(jt));n.set(u,h),No(s)}}else y(d,jt),No(s);return!0},get(o,u,d){var p;if(u===Qr)return t;var h=n.get(u),g=u in o;if(h===void 0&&(!g||(p=Gs(o,u))!=null&&p.writable)&&(h=i(()=>{var b=ft(g?o[u]:jt),A=J(b);return A}),n.set(u,h)),h!==void 0){var f=l(h);return f===jt?void 0:f}return Reflect.get(o,u,d)},getOwnPropertyDescriptor(o,u){var d=Reflect.getOwnPropertyDescriptor(o,u);if(d&&"value"in d){var h=n.get(u);h&&(d.value=l(h))}else if(d===void 0){var g=n.get(u),f=g==null?void 0:g.v;if(g!==void 0&&f!==jt)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return d},has(o,u){var f;if(u===Qr)return!0;var d=n.get(u),h=d!==void 0&&d.v!==jt||Reflect.has(o,u);if(d!==void 0||Xe!==null&&(!h||(f=Gs(o,u))!=null&&f.writable)){d===void 0&&(d=i(()=>{var p=h?ft(o[u]):jt,b=J(p);return b}),n.set(u,d));var g=l(d);if(g===jt)return!1}return h},set(o,u,d,h){var I;var g=n.get(u),f=u in o;if(r&&u==="length")for(var p=d;p<g.v;p+=1){var b=n.get(p+"");b!==void 0?y(b,jt):p in o&&(b=i(()=>J(jt)),n.set(p+"",b))}if(g===void 0)(!f||(I=Gs(o,u))!=null&&I.writable)&&(g=i(()=>J(void 0)),y(g,ft(d)),n.set(u,g));else{f=g.v!==jt;var A=i(()=>ft(d));y(g,A)}var T=Reflect.getOwnPropertyDescriptor(o,u);if(T!=null&&T.set&&T.set.call(h,d),!f){if(r&&typeof u=="string"){var E=n.get("length"),x=Number(u);Number.isInteger(x)&&x>=E.v&&y(E,x+1)}No(s)}return!0},ownKeys(o){l(s);var u=Reflect.ownKeys(o).filter(g=>{var f=n.get(g);return f===void 0||f.v!==jt});for(var[d,h]of n)h.v!==jt&&!(d in o)&&u.push(d);return u},setPrototypeOf(){Zv()}})}function o0(t){try{if(t!==null&&typeof t=="object"&&Qr in t)return t[Qr]}catch{}return t}function n1(t,e){return Object.is(o0(t),o0(e))}var u0,r1,s1,a1;function $E(){if(u0===void 0){u0=window,r1=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;s1=Gs(e,"firstChild").get,a1=Gs(e,"nextSibling").get,s0(t)&&(t[cd]=void 0,t[Qu]=null,t[dd]=void 0,t.__e=void 0),s0(n)&&(n[mo]=void 0)}}function Zr(t=""){return document.createTextNode(t)}function Bi(t){return s1.call(t)}function ou(t){return a1.call(t)}function S(t,e){return Bi(t)}function Je(t,e=!1){{var n=Bi(t);return n instanceof Comment&&n.data===""?ou(n):n}}function O(t,e=1,n=!1){let r=t;for(;e--;)r=ou(r);return r}function YE(t){t.textContent=""}function i1(){return!1}function o1(t,e,n){return document.createElementNS(e??Fm,t,void 0)}function Ha(t,e){if(e){const n=document.body;t.autofocus=!0,wr(()=>{document.activeElement===n&&t.focus()})}}let l0=!1;function zE(){l0||(l0=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n[Zu])==null||e.call(n)})},{capture:!0}))}function jl(t){var e=Qe,n=Xe;cr(null),rs(null);try{return t()}finally{cr(e),rs(n)}}function Wf(t,e,n,r=n){t.addEventListener(e,()=>jl(n));const s=t[Zu];s?t[Zu]=()=>{s(),r(!0)}:t[Zu]=()=>r(!0),zE()}function u1(t){Xe===null&&(Qe===null&&Kv(),Gv()),_s&&Wv()}function WE(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function Or(t,e){var n=Xe;n!==null&&(n.f&Ln)!==0&&(t|=Ln);var r={ctx:At,deps:null,nodes:null,f:t|rn|or,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};ke==null||ke.register_created_effect(r);var s=r;if((t&Di)!==0)gi!==null?gi.push(r):Fa.ensure().schedule(r);else if(e!==null){try{Fi(r)}catch(i){throw ln(r),i}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&Vi)===0&&(s=s.first,(t&yr)!==0&&(t&Ts)!==0&&s!==null&&(s.f|=Ts))}if(s!==null&&(s.parent=n,n!==null&&WE(s,n),Qe!==null&&(Qe.f&dn)!==0&&(t&Zs)===0)){var a=Qe;(a.effects??(a.effects=[])).push(s)}return r}function Gf(){return Qe!==null&&!Nr}function uu(t){const e=Or(iu,null);return Dt(e,Qt),e.teardown=t,e}function St(t){u1();var e=Xe.f,n=!Qe&&(e&Cr)!==0&&(e&Ga)===0;if(n){var r=At;(r.e??(r.e=[])).push(t)}else return l1(t)}function l1(t){return Or(Di|km,t)}function GE(t){return u1(),Or(iu|km,t)}function KE(t){Fa.ensure();const e=Or(Zs|Vi,t);return(n={})=>new Promise(r=>{n.outro?Oa(e,()=>{ln(e),r(void 0)}):(ln(e),r(void 0))})}function Zi(t){return Or(Di,t)}function VE(t){return Or(Ei|Vi,t)}function $l(t,e=0){return Or(iu|e,t)}function ie(t,e=[],n=[],r=[]){Xm(r,e,n,s=>{Or(iu,()=>t(...s.map(l)))})}function Ka(t,e=0){var n=Or(yr|e,t);return n}function c1(t,e=0){var n=Or(Uf|e,t);return n}function kn(t){return Or(Cr|Vi,t)}function d1(t){var e=t.teardown;if(e!==null){const n=_s,r=Qe;c0(!0),cr(null);try{e.call(null)}finally{c0(n),cr(r)}}}function Kf(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const s=n.ac;s!==null&&jl(()=>{s.abort(ql)});var r=n.next;(n.f&Zs)!==0?n.parent=null:ln(n,e),n=r}}function XE(t){for(var e=t.first;e!==null;){var n=e.next;(e.f&Cr)===0&&ln(e),e=n}}function ln(t,e=!0){var n=!1;(e||(t.f&jv)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(QE(t.nodes.start,t.nodes.end),n=!0),Dt(t,ld),Kf(t,e&&!n),Uo(t,0);var r=t.nodes&&t.nodes.t;if(r!==null)for(const a of r)a.stop();d1(t),t.f^=ld,t.f|=ur;var s=t.parent;s!==null&&s.first!==null&&f1(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function QE(t,e){for(;t!==null;){var n=t===e?null:ou(t);t.remove(),t=n}}function f1(t){var e=t.parent,n=t.prev,r=t.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),e!==null&&(e.first===t&&(e.first=r),e.last===t&&(e.last=n))}function Oa(t,e,n=!0){var r=[];h1(t,r,!0);var s=()=>{n&&ln(t),e&&e()},a=r.length;if(a>0){var i=()=>--a||s();for(var o of r)o.out(i)}else s()}function h1(t,e,n){if((t.f&Ln)===0){t.f^=Ln;var r=t.nodes&&t.nodes.t;if(r!==null)for(const o of r)(o.is_global||n)&&e.push(o);for(var s=t.first;s!==null;){var a=s.next;if((s.f&Zs)===0){var i=(s.f&Ts)!==0||(s.f&Cr)!==0&&(t.f&yr)!==0;h1(s,e,i?n:!1)}s=a}}}function Vf(t){p1(t,!0)}function p1(t,e){if((t.f&Ln)!==0){t.f^=Ln,(t.f&Qt)===0&&(Dt(t,rn),Fa.ensure().schedule(t));for(var n=t.first;n!==null;){var r=n.next,s=(n.f&Ts)!==0||(n.f&Cr)!==0;p1(n,s?e:!1),n=r}var a=t.nodes&&t.nodes.t;if(a!==null)for(const i of a)(i.is_global||e)&&i.in()}}function Xf(t,e){if(t.nodes)for(var n=t.nodes.start,r=t.nodes.end;n!==null;){var s=n===r?null:ou(n);e.append(n),n=s}}let rl=!1,_s=!1;function c0(t){_s=t}let Qe=null,Nr=!1;function cr(t){Qe=t}let Xe=null;function rs(t){Xe=t}let lr=null;function m1(t){Qe!==null&&(lr===null?lr=[t]:lr.push(t))}let Dn=null,Fn=0,Zn=null;function ZE(t){Zn=t}let g1=1,Ea=0,xa=Ea;function d0(t){xa=t}function b1(){return++g1}function lu(t){var e=t.f;if((e&rn)!==0)return!0;if(e&dn&&(t.f&=~Ba),(e&ns)!==0){for(var n=t.deps,r=n.length,s=0;s<r;s++){var a=n[s];if(lu(a)&&Zm(a),a.wv>t.wv)return!0}(e&or)!==0&&un===null&&Dt(t,Qt)}return!1}function v1(t,e,n=!0){var r=t.reactions;if(r!==null&&!(lr!==null&&Ca.call(lr,t)))for(var s=0;s<r.length;s++){var a=r[s];(a.f&dn)!==0?v1(a,e,!1):e===a&&(n?Dt(a,rn):(a.f&Qt)!==0&&Dt(a,ns),$f(a))}}function E1(t){var A;var e=Dn,n=Fn,r=Zn,s=Qe,a=lr,i=At,o=Nr,u=xa,d=t.f;Dn=null,Fn=0,Zn=null,Qe=(d&(Cr|Zs))===0?t:null,lr=null,ki(t.ctx),Nr=!1,xa=++Ea,t.ac!==null&&(jl(()=>{t.ac.abort(ql)}),t.ac=null);try{t.f|=pl;var h=t.fn,g=h();t.f|=Ga;var f=t.deps,p=ke==null?void 0:ke.is_fork;if(Dn!==null){var b;if(p||Uo(t,Fn),f!==null&&Fn>0)for(f.length=Fn+Dn.length,b=0;b<Dn.length;b++)f[Fn+b]=Dn[b];else t.deps=f=Dn;if(Gf()&&(t.f&or)!==0)for(b=Fn;b<f.length;b++)((A=f[b]).reactions??(A.reactions=[])).push(t)}else!p&&f!==null&&Fn<f.length&&(Uo(t,Fn),f.length=Fn);if(Qi()&&Zn!==null&&!Nr&&f!==null&&(t.f&(dn|ns|rn))===0)for(b=0;b<Zn.length;b++)v1(Zn[b],t);if(s!==null&&s!==t){if(Ea++,s.deps!==null)for(let T=0;T<n;T+=1)s.deps[T].rv=Ea;if(e!==null)for(const T of e)T.rv=Ea;Zn!==null&&(r===null?r=Zn:r.push(...Zn))}return(t.f&Ks)!==0&&(t.f^=Ks),g}catch(T){return jm(T)}finally{t.f^=pl,Dn=e,Fn=n,Zn=r,Qe=s,lr=a,ki(i),Nr=o,xa=u}}function JE(t,e){let n=e.reactions;if(n!==null){var r=Mv.call(n,t);if(r!==-1){var s=n.length-1;s===0?n=e.reactions=null:(n[r]=n[s],n.pop())}}if(n===null&&(e.f&dn)!==0&&(Dn===null||!Ca.call(Dn,e))){var a=e;(a.f&or)!==0&&(a.f^=or,a.f&=~Ba),a.v!==jt&&qf(a),HE(a),Uo(a,0)}}function Uo(t,e){var n=t.deps;if(n!==null)for(var r=e;r<n.length;r++)JE(t,n[r])}function Fi(t){var e=t.f;if((e&ur)===0){Dt(t,Qt);var n=Xe,r=rl;Xe=t,rl=!0;try{(e&(yr|Uf))!==0?XE(t):Kf(t),d1(t);var s=E1(t);t.teardown=typeof s=="function"?s:null,t.wv=g1;var a;xm&&vE&&(t.f&rn)!==0&&t.deps}finally{rl=r,Xe=n}}}async function T1(){await Promise.resolve(),CE()}function l(t){var e=t.f,n=(e&dn)!==0;if(Qe!==null&&!Nr){var r=Xe!==null&&(Xe.f&ur)!==0;if(!r&&(lr===null||!Ca.call(lr,t))){var s=Qe.deps;if((Qe.f&pl)!==0)t.rv<Ea&&(t.rv=Ea,Dn===null&&s!==null&&s[Fn]===t?Fn++:Dn===null?Dn=[t]:Dn.push(t));else{Qe.deps??(Qe.deps=[]),Ca.call(Qe.deps,t)||Qe.deps.push(t);var a=t.reactions;a===null?t.reactions=[Qe]:Ca.call(a,Qe)||a.push(Qe)}}}if(_s&&La.has(t))return La.get(t);if(n){var i=t;if(_s){var o=i.v;return((i.f&Qt)===0&&i.reactions!==null||A1(i))&&(o=zf(i)),La.set(i,o),o}var u=(i.f&or)===0&&!Nr&&Qe!==null&&(rl||(Qe.f&or)!==0),d=(i.f&Ga)===0;lu(i)&&(u&&(i.f|=or),Zm(i)),u&&!d&&(Jm(i),_1(i))}if(un!=null&&un.has(t))return un.get(t);if((t.f&Ks)!==0)throw t.v;return t.v}function _1(t){if(t.f|=or,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),(e.f&dn)!==0&&(e.f&or)===0&&(Jm(e),_1(e))}function A1(t){if(t.v===jt)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(La.has(e)||(e.f&dn)!==0&&A1(e))return!0;return!1}function ea(t){var e=Nr;try{return Nr=!0,t()}finally{Nr=e}}function eT(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(Qr in t)Ed(t);else if(!Array.isArray(t))for(let e in t){const n=t[e];typeof n=="object"&&n&&Qr in n&&Ed(n)}}}function Ed(t,e=new Set){if(typeof t=="object"&&t!==null&&!(t instanceof EventTarget)&&!e.has(t)){e.add(t),t instanceof Date&&t.getTime();for(let r in t)try{Ed(t[r],e)}catch{}const n=Bf(t);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=Rm(n);for(let s in r){const a=r[s].get;if(a)try{a.call(t)}catch{}}}}}function tT(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const nT=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function rT(t){return nT.includes(t)}const sT={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function aT(t){return t=t.toLowerCase(),sT[t]??t}const iT=["touchstart","touchmove"];function oT(t){return iT.includes(t)}const Ta=Symbol("events"),y1=new Set,Td=new Set;function N1(t,e,n,r={}){function s(a){if(r.capture||_d.call(e,a),!a.cancelBubble)return jl(()=>n==null?void 0:n.call(this,a))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?wr(()=>{e.addEventListener(t,s,r)}):e.addEventListener(t,s,r),s}function Pe(t,e,n,r,s){var a={capture:r,passive:s},i=N1(t,e,n,a);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&uu(()=>{e.removeEventListener(t,i,a)})}function ae(t,e,n){(e[Ta]??(e[Ta]={}))[t]=n}function vt(t){for(var e=0;e<t.length;e++)y1.add(t[e]);for(var n of Td)n(t)}let f0=null;function _d(t){var T,E;var e=this,n=e.ownerDocument,r=t.type,s=((T=t.composedPath)==null?void 0:T.call(t))||[],a=s[0]||t.target;f0=t;var i=0,o=f0===t&&t[Ta];if(o){var u=s.indexOf(o);if(u!==-1&&(e===document||e===window)){t[Ta]=e;return}var d=s.indexOf(e);if(d===-1)return;u<=d&&(i=u)}if(a=s[i]||t.target,a!==e){Bv(t,"currentTarget",{configurable:!0,get(){return a||n}});var h=Qe,g=Xe;cr(null),rs(null);try{for(var f,p=[];a!==null;){var b=a.assignedSlot||a.parentNode||a.host||null;try{var A=(E=a[Ta])==null?void 0:E[r];A!=null&&(!a.disabled||t.target===a)&&A.call(a,t)}catch(x){f?p.push(x):f=x}if(t.cancelBubble||b===e||b===null)break;a=b}if(f){for(let x of p)queueMicrotask(()=>{throw x});throw f}}finally{t[Ta]=e,delete t.currentTarget,cr(h),rs(g)}}}var Lm;const Ic=((Lm=globalThis==null?void 0:globalThis.window)==null?void 0:Lm.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function uT(t){return(Ic==null?void 0:Ic.createHTML(t))??t}function S1(t){var e=o1("template");return e.innerHTML=uT(t.replaceAll("<!>","<!---->")),e.content}function Ui(t,e){var n=Xe;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function K(t,e){var n=(e&cE)!==0,r=(e&dE)!==0,s,a=!t.startsWith("<!>");return()=>{s===void 0&&(s=S1(a?t:"<!>"+t),n||(s=Bi(s)));var i=r||r1?document.importNode(s,!0):s.cloneNode(!0);if(n){var o=Bi(i),u=i.lastChild;Ui(o,u)}else Ui(i,i);return i}}function lT(t,e,n="svg"){var r=!t.startsWith("<!>"),s=`<${n}>${r?t:"<!>"+t}</${n}>`,a;return()=>{if(!a){var i=S1(s),o=Bi(i);a=Bi(o)}var u=a.cloneNode(!0);return Ui(u,u),u}}function cT(t,e){return lT(t,e,"svg")}function bl(t=""){{var e=Zr(t+"");return Ui(e,e),e}}function jn(){var t=document.createDocumentFragment(),e=document.createComment(""),n=Zr();return t.append(e,n),Ui(e,n),t}function j(t,e){t!==null&&t.before(e)}function ue(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t[mo]??(t[mo]=t.nodeValue))&&(t[mo]=n,t.nodeValue=`${n}`)}function dT(t,e){return fT(t,e)}const Ou=new Map;function fT(t,{target:e,anchor:n,props:r={},events:s,context:a,intro:i=!0,transformError:o}){$E();var u=void 0,d=KE(()=>{var h=n??e.appendChild(Zr());RE(h,{pending:()=>{}},p=>{it({});var b=At;a&&(b.c=a),s&&(r.$$events=s),u=t(p,r)||{},ot()},o);var g=new Set,f=p=>{for(var b=0;b<p.length;b++){var A=p[b];if(!g.has(A)){g.add(A);var T=oT(A);for(const I of[e,document]){var E=Ou.get(I);E===void 0&&(E=new Map,Ou.set(I,E));var x=E.get(A);x===void 0?(I.addEventListener(A,_d,{passive:T}),E.set(A,1)):E.set(A,x+1)}}}};return f(Hl(y1)),Td.add(f),()=>{var T;for(var p of g)for(const E of[e,document]){var b=Ou.get(E),A=b.get(p);--A==0?(E.removeEventListener(p,_d),b.delete(p),b.size===0&&Ou.delete(E)):b.set(p,A)}Td.delete(f),h!==n&&((T=h.parentNode)==null||T.removeChild(h))}});return hT.set(u,d),u}let hT=new WeakMap;var Er,Kr,qn,Ia,ru,su,Bl;class cu{constructor(e,n=!0){ve(this,"anchor");Ue(this,Er,new Map);Ue(this,Kr,new Map);Ue(this,qn,new Map);Ue(this,Ia,new Set);Ue(this,ru,!0);Ue(this,su,e=>{if(X(this,Er).has(e)){var n=X(this,Er).get(e),r=X(this,Kr).get(n);if(r)Vf(r),X(this,Ia).delete(n);else{var s=X(this,qn).get(n);s&&(X(this,Kr).set(n,s.effect),X(this,qn).delete(n),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),r=s.effect)}for(const[a,i]of X(this,Er)){if(X(this,Er).delete(a),a===e)break;const o=X(this,qn).get(i);o&&(ln(o.effect),X(this,qn).delete(i))}for(const[a,i]of X(this,Kr)){if(a===n||X(this,Ia).has(a))continue;const o=()=>{if(Array.from(X(this,Er).values()).includes(a)){var d=document.createDocumentFragment();Xf(i,d),d.append(Zr()),X(this,qn).set(a,{effect:i,fragment:d})}else ln(i);X(this,Ia).delete(a),X(this,Kr).delete(a)};X(this,ru)||!r?(X(this,Ia).add(a),Oa(i,o,!1)):o()}}});Ue(this,Bl,e=>{X(this,Er).delete(e);const n=Array.from(X(this,Er).values());for(const[r,s]of X(this,qn))n.includes(r)||(ln(s.effect),X(this,qn).delete(r))});this.anchor=e,je(this,ru,n)}ensure(e,n){var r=ke,s=i1();if(n&&!X(this,Kr).has(e)&&!X(this,qn).has(e))if(s){var a=document.createDocumentFragment(),i=Zr();a.append(i),X(this,qn).set(e,{effect:kn(()=>n(i)),fragment:a})}else X(this,Kr).set(e,kn(()=>n(this.anchor)));if(X(this,Er).set(r,e),s){for(const[o,u]of X(this,Kr))o===e?r.unskip_effect(u):r.skip_effect(u);for(const[o,u]of X(this,qn))o===e?r.unskip_effect(u.effect):r.skip_effect(u.effect);r.oncommit(X(this,su)),r.ondiscard(X(this,Bl))}else X(this,su).call(this,r)}}Er=new WeakMap,Kr=new WeakMap,qn=new WeakMap,Ia=new WeakMap,ru=new WeakMap,su=new WeakMap,Bl=new WeakMap;function fe(t,e,n=!1){var r=new cu(t),s=n?Ts:0;function a(i,o){r.ensure(i,o)}Ka(()=>{var i=!1;e((o,u=0)=>{i=!0,a(u,o)}),i||a(-1,null)},s)}const pT=Symbol("NaN");function mT(t,e,n){var r=new cu(t),s=!Qi();Ka(()=>{var a=e();a!==a&&(a=pT),s&&a!==null&&typeof a=="object"&&(a={}),r.ensure(a,n)})}function Ho(t,e){return e}function gT(t,e,n){for(var r=[],s=e.length,a,i=e.length,o=0;o<s;o++){let g=e[o];Oa(g,()=>{if(a){if(a.pending.delete(g),a.done.add(g),a.pending.size===0){var f=t.outrogroups;Ad(t,Hl(a.done)),f.delete(a),f.size===0&&(t.outrogroups=null)}}else i-=1},!1)}if(i===0){var u=r.length===0&&n!==null;if(u){var d=n,h=d.parentNode;YE(h),h.append(d),t.items.clear()}Ad(t,e,!u)}else a={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(a)}function Ad(t,e,n=!0){var r;if(t.pending.size>0){r=new Set;for(const i of t.pending.values())for(const o of i)r.add(t.items.get(o).e)}for(var s=0;s<e.length;s++){var a=e[s];if(r!=null&&r.has(a)){a.f|=Xr;const i=document.createDocumentFragment();Xf(a,i)}else ln(e[s],n)}}var h0;function Ct(t,e,n,r,s,a=null){var i=t,o=new Map,u=(e&Bm)!==0;if(u){var d=t;i=d.appendChild(Zr())}var h=null,g=Yf(()=>{var I=n();return Mf(I)?I:I==null?[]:Hl(I)}),f,p=new Map,b=!0;function A(I){(x.effect.f&ur)===0&&(x.pending.delete(I),x.fallback=h,bT(x,f,i,e,r),h!==null&&(f.length===0?(h.f&Xr)===0?Vf(h):(h.f^=Xr,bo(h,null,i)):Oa(h,()=>{h=null})))}function T(I){x.pending.delete(I)}var E=Ka(()=>{f=l(g);for(var I=f.length,U=new Set,P=ke,ee=i1(),F=0;F<I;F+=1){var G=f[F],Q=r(G,F),ne=b?null:o.get(Q);ne?(ne.v&&Mi(ne.v,G),ne.i&&Mi(ne.i,F),ee&&P.unskip_effect(ne.e)):(ne=vT(o,b?i:h0??(h0=Zr()),G,Q,F,s,e,n),b||(ne.e.f|=Xr),o.set(Q,ne)),U.add(Q)}if(I===0&&a&&!h&&(b?h=kn(()=>a(i)):(h=kn(()=>a(h0??(h0=Zr()))),h.f|=Xr)),I>U.size&&zv(),!b)if(p.set(P,U),ee){for(const[_,M]of o)U.has(_)||P.skip_effect(M.e);P.oncommit(A),P.ondiscard(T)}else A(P);l(g)}),x={effect:E,items:o,pending:p,outrogroups:null,fallback:h};b=!1}function io(t){for(;t!==null&&(t.f&Cr)===0;)t=t.next;return t}function bT(t,e,n,r,s){var ne,_,M,v,C,R,D,W,$;var a=(r&rE)!==0,i=e.length,o=t.items,u=io(t.effect.first),d,h=null,g,f=[],p=[],b,A,T,E;if(a)for(E=0;E<i;E+=1)b=e[E],A=s(b,E),T=o.get(A).e,(T.f&Xr)===0&&((_=(ne=T.nodes)==null?void 0:ne.a)==null||_.measure(),(g??(g=new Set)).add(T));for(E=0;E<i;E+=1){if(b=e[E],A=s(b,E),T=o.get(A).e,t.outrogroups!==null)for(const B of t.outrogroups)B.pending.delete(T),B.done.delete(T);if((T.f&Ln)!==0&&(Vf(T),a&&((v=(M=T.nodes)==null?void 0:M.a)==null||v.unfix(),(g??(g=new Set)).delete(T))),(T.f&Xr)!==0)if(T.f^=Xr,T===u)bo(T,null,n);else{var x=h?h.next:u;T===t.effect.last&&(t.effect.last=T.prev),T.prev&&(T.prev.next=T.next),T.next&&(T.next.prev=T.prev),Rs(t,h,T),Rs(t,T,x),bo(T,x,n),h=T,f=[],p=[],u=io(h.next);continue}if(T!==u){if(d!==void 0&&d.has(T)){if(f.length<p.length){var I=p[0],U;h=I.prev;var P=f[0],ee=f[f.length-1];for(U=0;U<f.length;U+=1)bo(f[U],I,n);for(U=0;U<p.length;U+=1)d.delete(p[U]);Rs(t,P.prev,ee.next),Rs(t,h,P),Rs(t,ee,I),u=I,h=ee,E-=1,f=[],p=[]}else d.delete(T),bo(T,u,n),Rs(t,T.prev,T.next),Rs(t,T,h===null?t.effect.first:h.next),Rs(t,h,T),h=T;continue}for(f=[],p=[];u!==null&&u!==T;)(d??(d=new Set)).add(u),p.push(u),u=io(u.next);if(u===null)continue}(T.f&Xr)===0&&f.push(T),h=T,u=io(T.next)}if(t.outrogroups!==null){for(const B of t.outrogroups)B.pending.size===0&&(Ad(t,Hl(B.done)),(C=t.outrogroups)==null||C.delete(B));t.outrogroups.size===0&&(t.outrogroups=null)}if(u!==null||d!==void 0){var F=[];if(d!==void 0)for(T of d)(T.f&Ln)===0&&F.push(T);for(;u!==null;)(u.f&Ln)===0&&u!==t.fallback&&F.push(u),u=io(u.next);var G=F.length;if(G>0){var Q=(r&Bm)!==0&&i===0?n:null;if(a){for(E=0;E<G;E+=1)(D=(R=F[E].nodes)==null?void 0:R.a)==null||D.measure();for(E=0;E<G;E+=1)($=(W=F[E].nodes)==null?void 0:W.a)==null||$.fix()}gT(t,F,Q)}}a&&wr(()=>{var B,Y;if(g!==void 0)for(T of g)(Y=(B=T.nodes)==null?void 0:B.a)==null||Y.apply()})}function vT(t,e,n,r,s,a,i,o){var u=(i&tE)!==0?(i&sE)===0?qE(n,!1,!1):Ua(n):null,d=(i&nE)!==0?Ua(s):null;return{v:u,i:d,e:kn(()=>(a(e,u??n,d??s,o),()=>{t.delete(r)}))}}function bo(t,e,n){if(t.nodes)for(var r=t.nodes.start,s=t.nodes.end,a=e&&(e.f&Xr)===0?e.nodes.start:n;r!==null;){var i=ou(r);if(a.before(r),r===s)return;r=i}}function Rs(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}function ET(t,e,...n){var r=new cu(t);Ka(()=>{const s=e()??null;r.ensure(s,s&&(a=>s(a,...n)))},Ts)}function p0(t,e,n){var r=new cu(t);Ka(()=>{var s=e()??null;r.ensure(s,s&&(a=>n(a,s)))},Ts)}function TT(t,e,n,r,s,a){var i=null,o=t,u=new cu(o,!1);Ka(()=>{const d=e()||null;var h=fE;if(d===null){u.ensure(null,null);return}return u.ensure(d,g=>{if(d){if(i=o1(d,h),Ui(i,i),r){var f=i.appendChild(Zr());r(i,f)}Xe.nodes.end=i,g.before(i)}}),()=>{}},Ts),uu(()=>{})}function _T(t,e,n){Zi(()=>{var r=ea(()=>e(t,n==null?void 0:n())||{});if(r!=null&&r.destroy)return()=>r.destroy()})}function AT(t,e){var n=void 0,r;c1(()=>{n!==(n=e())&&(r&&(ln(r),r=null),n&&(r=kn(()=>{Zi(()=>n(t))})))})}function w1(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=w1(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function yT(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=w1(t))&&(r&&(r+=" "),r+=e);return r}function I1(t){return typeof t=="object"?yT(t):t??""}const m0=[...`
3
+ \r\f \v\uFEFF`];function NT(t,e,n){var r=t==null?"":""+t;if(e&&(r=r?r+" "+e:e),n){for(var s of Object.keys(n))if(n[s])r=r?r+" "+s:s;else if(r.length)for(var a=s.length,i=0;(i=r.indexOf(s,i))>=0;){var o=i+a;(i===0||m0.includes(r[i-1]))&&(o===r.length||m0.includes(r[o]))?r=(i===0?"":r.substring(0,i))+r.substring(o+1):i=o}}return r===""?null:r}function g0(t,e=!1){var n=e?" !important;":";",r="";for(var s of Object.keys(t)){var a=t[s];a!=null&&a!==""&&(r+=" "+s+": "+a+n)}return r}function Cc(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function ST(t,e){if(e){var n="",r,s;if(Array.isArray(e)?(r=e[0],s=e[1]):r=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var a=!1,i=0,o=!1,u=[];r&&u.push(...Object.keys(r).map(Cc)),s&&u.push(...Object.keys(s).map(Cc));var d=0,h=-1;const A=t.length;for(var g=0;g<A;g++){var f=t[g];if(o?f==="/"&&t[g-1]==="*"&&(o=!1):a?a===f&&(a=!1):f==="/"&&t[g+1]==="*"?o=!0:f==='"'||f==="'"?a=f:f==="("?i++:f===")"&&i--,!o&&a===!1&&i===0){if(f===":"&&h===-1)h=g;else if(f===";"||g===A-1){if(h!==-1){var p=Cc(t.substring(d,h).trim());if(!u.includes(p)){f!==";"&&g++;var b=t.substring(d,g).trim();n+=" "+b+";"}}d=g+1,h=-1}}}}return r&&(n+=g0(r)),s&&(n+=g0(s,!0)),n=n.trim(),n===""?null:n}return t==null?null:String(t)}function Ze(t,e,n,r,s,a){var i=t[cd];if(i!==n||i===void 0){var o=NT(n,r,a);o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o),t[cd]=n}else if(a&&s!==a)for(var u in a){var d=!!a[u];(s==null||d!==!!s[u])&&t.classList.toggle(u,d)}return a}function Lc(t,e={},n,r){for(var s in n){var a=n[s];e[s]!==a&&(n[s]==null?t.style.removeProperty(s):t.style.setProperty(s,a,r))}}function Qf(t,e,n,r){var s=t[dd];if(s!==e){var a=ST(e,r);a==null?t.removeAttribute("style"):t.style.cssText=a,t[dd]=e}else r&&(Array.isArray(r)?(Lc(t,n==null?void 0:n[0],r[0]),Lc(t,n==null?void 0:n[1],r[1],"important")):Lc(t,n,r));return r}function vl(t,e,n=!1){if(t.multiple){if(e==null)return;if(!Mf(e))return mE();for(var r of t.options)r.selected=e.includes(So(r));return}for(r of t.options){var s=So(r);if(n1(s,e)){r.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function C1(t){var e=new MutationObserver(()=>{vl(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),uu(()=>{e.disconnect()})}function qa(t,e,n=e){var r=new WeakSet,s=!0;Wf(t,"change",a=>{var i=a?"[selected]":":checked",o;if(t.multiple)o=[].map.call(t.querySelectorAll(i),So);else{var u=t.querySelector(i)??t.querySelector("option:not([disabled])");o=u&&So(u)}n(o),t.__value=o,ke!==null&&r.add(ke)}),Zi(()=>{var a=e();if(t===document.activeElement){var i=ke;if(r.has(i))return}if(vl(t,a,s),s&&a===void 0){var o=t.querySelector(":checked");o!==null&&(a=So(o),n(a))}t.__value=a,s=!1}),C1(t)}function So(t){return"__value"in t?t.__value:t.value}const oo=Symbol("class"),uo=Symbol("style"),L1=Symbol("is custom element"),O1=Symbol("is html"),wT=Hf?"option":"OPTION",IT=Hf?"select":"SELECT",CT=Hf?"progress":"PROGRESS";function LT(t,e){var n=Yl(t);n.value===(n.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==CT)||(t.value=e??"")}function OT(t,e){var n=Yl(t);n.checked!==(n.checked=e??void 0)&&(t.checked=e)}function xT(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function be(t,e,n,r){var s=Yl(t);s[e]!==(s[e]=n)&&(e==="loading"&&(t[$v]=n),n==null?t.removeAttribute(e):typeof n!="string"&&x1(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function RT(t,e,n,r,s=!1,a=!1){var i=Yl(t),o=i[L1],u=!i[O1],d=e||{},h=t.nodeName===wT;for(var g in e)g in n||(n[g]=null);n.class?n.class=I1(n.class):n[oo]&&(n.class=null),n[uo]&&(n.style??(n.style=null));var f=x1(t);for(const I in n){let U=n[I];if(h&&I==="value"&&U==null){t.value=t.__value="",d[I]=U;continue}if(I==="class"){var p=t.namespaceURI==="http://www.w3.org/1999/xhtml";Ze(t,p,U,r,e==null?void 0:e[oo],n[oo]),d[I]=U,d[oo]=n[oo];continue}if(I==="style"){Qf(t,U,e==null?void 0:e[uo],n[uo]),d[I]=U,d[uo]=n[uo];continue}var b=d[I];if(!(U===b&&!(U===void 0&&t.hasAttribute(I)))){d[I]=U;var A=I[0]+I[1];if(A!=="$$")if(A==="on"){const P={},ee="$$"+I;let F=I.slice(2);var T=rT(F);if(tT(F)&&(F=F.slice(0,-7),P.capture=!0),!T&&b){if(U!=null)continue;t.removeEventListener(F,d[ee],P),d[ee]=null}if(T)ae(F,t,U),vt([F]);else if(U!=null){let G=function(Q){d[I].call(this,Q)};d[ee]=N1(F,t,G,P)}}else if(I==="style")be(t,I,U);else if(I==="autofocus")Ha(t,!!U);else if(!o&&(I==="__value"||I==="value"&&U!=null))t.value=t.__value=U;else if(I==="selected"&&h)xT(t,U);else{var E=I;u||(E=aT(E));var x=E==="defaultValue"||E==="defaultChecked";if(U==null&&!o&&!x)if(i[I]=null,E==="value"||E==="checked"){let P=t;const ee=e===void 0;if(E==="value"){let F=P.defaultValue;P.removeAttribute(E),P.defaultValue=F,P.value=P.__value=ee?F:null}else{let F=P.defaultChecked;P.removeAttribute(E),P.defaultChecked=F,P.checked=ee?F:!1}}else t.removeAttribute(I);else x||f.includes(E)&&(o||typeof U!="string")?(t[E]=U,E in i&&(i[E]=jt)):typeof U!="function"&&be(t,E,U)}}}return d}function b0(t,e,n=[],r=[],s=[],a,i=!1,o=!1){Xm(s,n,r,u=>{var d=void 0,h={},g=t.nodeName===IT,f=!1;if(c1(()=>{var b=e(...u.map(l)),A=RT(t,d,b,a,i,o);f&&g&&"value"in b&&vl(t,b.value);for(let E of Object.getOwnPropertySymbols(h))b[E]||ln(h[E]);for(let E of Object.getOwnPropertySymbols(b)){var T=b[E];E.description===hE&&(!d||T!==d[E])&&(h[E]&&ln(h[E]),h[E]=kn(()=>AT(t,()=>T))),A[E]=T}d=A}),g){var p=t;Zi(()=>{vl(p,d.value,!0),C1(p)})}f=!0})}function Yl(t){return t[Qu]??(t[Qu]={[L1]:t.nodeName.includes("-"),[O1]:t.namespaceURI===Fm})}var v0=new Map;function x1(t){var e=t.getAttribute("is")||t.nodeName,n=v0.get(e);if(n)return n;v0.set(e,n=[]);for(var r,s=t,a=Element.prototype;a!==s;){r=Rm(s);for(var i in r)r[i].set&&i!=="innerHTML"&&i!=="textContent"&&i!=="innerText"&&n.push(i);s=Bf(s)}return n}function _t(t,e,n=e){var r=new WeakSet;Wf(t,"input",async s=>{var a=s?t.defaultValue:t.value;if(a=xc(t)?Rc(a):a,n(a),ke!==null&&r.add(ke),await T1(),a!==(a=e())){var i=t.selectionStart,o=t.selectionEnd,u=t.value.length;if(t.value=a??"",o!==null){var d=t.value.length;i===o&&o===u&&d>u?(t.selectionStart=d,t.selectionEnd=d):(t.selectionStart=i,t.selectionEnd=Math.min(o,d))}}}),ea(e)==null&&t.value&&(n(xc(t)?Rc(t.value):t.value),ke!==null&&r.add(ke)),$l(()=>{var s=e();if(t===document.activeElement){var a=ke;if(r.has(a))return}xc(t)&&s===Rc(t.value)||t.type==="date"&&!s&&!t.value||s!==t.value&&(t.value=s??"")})}const Oc=new Set;function DT(t,e,n,r,s=r){var a=n.getAttribute("type")==="checkbox",i=t;if(e!==null)for(var o of e)i=i[o]??(i[o]=[]);i.push(n),Wf(n,"change",()=>{var u=n.__value;a&&(u=kT(i,u,n.checked)),s(u)},()=>s(a?[]:null)),$l(()=>{var u=r();a?(u=u||[],n.checked=u.includes(n.__value)):n.checked=n1(n.__value,u)}),uu(()=>{var u=i.indexOf(n);u!==-1&&i.splice(u,1)}),Oc.has(i)||(Oc.add(i),wr(()=>{i.sort((u,d)=>u.compareDocumentPosition(d)===4?-1:1),Oc.delete(i)})),wr(()=>{})}function kT(t,e,n){for(var r=new Set,s=0;s<t.length;s+=1)t[s].checked&&r.add(t[s].__value);return n||r.delete(e),Array.from(r)}function xc(t){var e=t.type;return e==="number"||e==="range"}function Rc(t){return t===""?null:+t}var Hs,Ri,au,Fl,R1;const Ul=class Ul{constructor(e){Ue(this,Fl);Ue(this,Hs,new WeakMap);Ue(this,Ri);Ue(this,au);je(this,au,e)}observe(e,n){var r=X(this,Hs).get(e)||new Set;return r.add(n),X(this,Hs).set(e,r),et(this,Fl,R1).call(this).observe(e,X(this,au)),()=>{var s=X(this,Hs).get(e);s.delete(n),s.size===0&&(X(this,Hs).delete(e),X(this,Ri).unobserve(e))}}};Hs=new WeakMap,Ri=new WeakMap,au=new WeakMap,Fl=new WeakSet,R1=function(){return X(this,Ri)??je(this,Ri,new ResizeObserver(e=>{for(var n of e){Ul.entries.set(n.target,n);for(var r of X(this,Hs).get(n.target)||[])r(n)}}))},ve(Ul,"entries",new WeakMap);let yd=Ul;var PT=new yd({box:"border-box"});function MT(t,e,n){var r=PT.observe(t,()=>n(t[e]));Zi(()=>(ea(()=>n(t[e])),r))}function Dc(t,e){return t===e||(t==null?void 0:t[Qr])===e}function sn(t={},e,n,r){var s=At.r,a=Xe;return Zi(()=>{var i,o;return $l(()=>{i=o,o=[],ea(()=>{Dc(n(...o),t)||(e(t,...o),i&&Dc(n(...i),t)&&e(null,...i))})}),()=>{let u=a;for(;u!==s&&u.parent!==null&&u.parent.f&ld;)u=u.parent;const d=()=>{o&&Dc(n(...o),t)&&e(null,...o)},h=u.teardown;u.teardown=()=>{d(),h==null||h()}}}),t}function D1(t=!1){const e=At,n=e.l.u;if(!n)return;let r=()=>eT(e.s);if(t){let s=0,a={};const i=Pi(()=>{let o=!1;const u=e.s;for(const d in u)u[d]!==a[d]&&(a[d]=u[d],o=!0);return o&&s++,s});r=()=>l(i)}n.b.length&&GE(()=>{E0(e,r),od(n.b)}),St(()=>{const s=ea(()=>n.m.map(Hv));return()=>{for(const a of s)typeof a=="function"&&a()}}),n.a.length&&St(()=>{E0(e,r),od(n.a)})}function E0(t,e){if(t.l.s)for(const n of t.l.s)l(n);e()}const BT={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function dr(t,e,n){return new Proxy({props:t,exclude:e},BT)}const FT={get(t,e){let n=t.props.length;for(;n--;){let r=t.props[n];if(ao(r)&&(r=r()),typeof r=="object"&&r!==null&&e in r)return r[e]}},set(t,e,n){let r=t.props.length;for(;r--;){let s=t.props[r];ao(s)&&(s=s());const a=Gs(s,e);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(t,e){let n=t.props.length;for(;n--;){let r=t.props[n];if(ao(r)&&(r=r()),typeof r=="object"&&r!==null&&e in r){const s=Gs(r,e);return s&&!s.configurable&&(s.configurable=!0),s}}},has(t,e){if(e===Qr||e===Pm)return!1;for(let n of t.props)if(ao(n)&&(n=n()),n!=null&&e in n)return!0;return!1},ownKeys(t){const e=[];for(let n of t.props)if(ao(n)&&(n=n()),!!n){for(const r in n)e.includes(r)||e.push(r);for(const r of Object.getOwnPropertySymbols(n))e.includes(r)||e.push(r)}return e}};function xr(...t){return new Proxy({props:t},FT)}function $n(t,e,n,r){var U;var s=!Xi||(n&iE)!==0,a=(n&uE)!==0,i=(n&lE)!==0,o=r,u=!0,d=void 0,h=()=>i&&s?(d??(d=Pi(r)),l(d)):(u&&(u=!1,o=i?ea(r):r),o);let g;if(a){var f=Qr in t||Pm in t;g=((U=Gs(t,e))==null?void 0:U.set)??(f&&e in t?P=>t[e]=P:void 0)}var p,b=!1;a?[p,b]=SE(()=>t[e]):p=t[e],p===void 0&&r!==void 0&&(p=h(),g&&(s&&Xv(),g(p)));var A;if(s?A=()=>{var P=t[e];return P===void 0?h():(u=!0,P)}:A=()=>{var P=t[e];return P!==void 0&&(o=void 0),P===void 0?o:P},s&&(n&oE)===0)return A;if(g){var T=t.$$legacy;return(function(P,ee){return arguments.length>0?((!s||!ee||T||b)&&g(ee?A():P),P):A()})}var E=!1,x=((n&aE)!==0?Pi:Yf)(()=>(E=!1,A()));a&&l(x);var I=Xe;return(function(P,ee){if(arguments.length>0){const F=ee?l(x):s&&a?ft(P):P;return y(x,F),E=!0,o!==void 0&&(o=F),P}return _s&&E||(I.f&ur)!==0?x.v:l(x)})}function Va(t){At===null&&Mm(),Xi&&At.l!==null?UT(At).m.push(t):St(()=>{const e=ea(t);if(typeof e=="function")return e})}function UT(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}const HT="5";var Om;typeof window<"u"&&((Om=window.__svelte??(window.__svelte={})).v??(Om.v=new Set)).add(HT);EE();function bs(t){return t.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function Zf(t){const e=t.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim().replace(/\s+/g," ");return e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1)}const qT={html:"text/html; charset=utf-8",json:"application/json; charset=utf-8",js:"text/javascript; charset=utf-8",mjs:"text/javascript; charset=utf-8",css:"text/css; charset=utf-8",txt:"text/plain; charset=utf-8",xml:"application/xml; charset=utf-8",svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp",avif:"image/avif",gif:"image/gif",ico:"image/x-icon",woff:"font/woff",woff2:"font/woff2",map:"application/json; charset=utf-8"};function jT(t){const e=t.slice(t.lastIndexOf(".")+1).toLowerCase();return qT[e]??"application/octet-stream"}class _a extends Error{constructor(e){super(e),this.name="ContentParseError"}}const $T=new Set(["template","title","isPublished","fields","created","published","updated"]);function Nd(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Sd(t){return t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function YT(t){return Nd(t)&&Object.values(t).every(Sd)}function zT(t,e){if(Sd(e))return e;if(Array.isArray(e)){if(e.every(Sd)||e.every(YT))return e;throw new _a(`Field "${t}" array must hold only primitives or only flat records (no nesting).`)}throw new _a(`Field "${t}" must be a primitive or an array, not a bare object.`)}function xu(t,e){const n=t[e];if(n!==void 0){if(typeof n!="string")throw new _a(`"${e}" must be a string when present.`);return n}}function zl(t){return k1(t).item}function k1(t){if(!Nd(t))throw new _a("A content item must be a JSON object.");if(typeof t.title!="string")throw new _a('A content item requires a string "title".');let e=!1;if(t.isPublished!==void 0){if(typeof t.isPublished!="boolean")throw new _a(`"isPublished" must be a boolean when present, got ${JSON.stringify(t.isPublished)}.`);e=t.isPublished}let n={};if(t.fields!==void 0){if(!Nd(t.fields))throw new _a('"fields" must be an object.');n=Object.fromEntries(Object.entries(t.fields).map(([d,h])=>[d,zT(d,h)]))}const r=xu(t,"template"),s=xu(t,"created"),a=xu(t,"published"),i=xu(t,"updated"),o=Object.keys(t).filter(d=>!$T.has(d)).sort();return{item:{title:t.title,isPublished:e,fields:n,...r!==void 0&&{template:r},...s!==void 0&&{created:s},...a!==void 0&&{published:a},...i!==void 0&&{updated:i}},diagnostics:{unknownTopLevelKeys:o}}}function T0(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function P1(t){if(!T0(t))return{order:[]};const e=Array.isArray(t.order)?t.order.filter(a=>typeof a=="string"):[],n=typeof t.name=="string"?t.name:void 0,r=typeof t.defaultTemplate=="string"?t.defaultTemplate:void 0,s=T0(t.collection)?{recursive:t.collection.recursive===!0}:void 0;return{order:e,...n!==void 0&&{name:n},...r!==void 0&&{defaultTemplate:r},...s!==void 0&&{collection:s}}}const M1="_sort.json",WT="_redirects.json",GT="_site.json",KT="assets",_0=".json",tt={content:"content",templates:"templates",components:"components",public:"public"};function Jr(...t){return t.filter(e=>e!=="").join("/")}async function Jf(t,e=tt.content){return B1(t,e,"","")}async function B1(t,e,n,r){const[s,a]=await Promise.all([t.list(e),XT(t,e)]),i=new Map;for(const u of s)if(u.kind==="file"){if(u.name===M1||u.name===WT||u.name===GT||!u.name.endsWith(_0))continue;const d=u.name.slice(0,-_0.length);i.set(d,await VT(t,Jr(e,u.name),d,r))}else{if(u.name===KT)continue;const d=Jr(r,u.name);i.set(u.name,await B1(t,Jr(e,u.name),u.name,d))}const o=a.name??(n===""?"":Zf(n));return{kind:"dir",slug:n,name:o,path:r,children:QT(i,a.order),...a.collection!==void 0&&{collection:a.collection},...a.defaultTemplate!==void 0&&{defaultTemplate:a.defaultTemplate}}}async function VT(t,e,n,r){const s=await t.readText(e);try{const{item:a,diagnostics:i}=k1(JSON.parse(s));return{kind:"item",slug:n,path:Jr(r,n),item:a,...i.unknownTopLevelKeys.length>0&&{parseDiagnostics:i}}}catch(a){throw new Error(`Failed to load ${e}: ${a.message}`)}}async function XT(t,e){const n=Jr(e,M1);if(!await t.exists(n))return{order:[]};try{return P1(JSON.parse(await t.readText(n)))}catch{return{order:[]}}}function QT(t,e){const n=[],r=new Set;for(const s of e){const a=t.get(s);a!==void 0&&(n.push(a),r.add(s))}for(const[s,a]of t)r.has(s)||n.push(a);return n}function eh(t,e=tt.components){return th(t,e,"html")}function F1(t,e=tt.components){return th(t,e,"css")}function U1(t,e=tt.components){return th(t,e,"js")}async function th(t,e,n){const r=`.${n}`,s=new Map,a=async i=>{if(await t.exists(i))for(const o of await t.list(i)){const u=Jr(i,o.name);if(o.kind==="dir")await a(u);else if(o.name.endsWith(r)){const d=o.name.slice(0,-r.length).toLowerCase();s.set(d,await t.readText(u))}}};return await a(e),s}async function El(t,e,n=tt.templates){return t.readText(Jr(n,`${e}.html`))}function ZT(t,e,n=tt.templates){return rh(t,Jr(n,`${e}.css`))}function JT(t,e,n=tt.templates){return rh(t,Jr(n,`${e}.js`))}const du="document";function nh(t,e=tt.templates){return rh(t,Jr(e,`${du}.html`))}async function rh(t,e){try{return await t.readText(e)}catch{return}}const e_=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Ot="�";var w;(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(w||(w={}));const xn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function H1(t){return t>=55296&&t<=57343}function t_(t){return t>=56320&&t<=57343}function n_(t,e){return(t-55296)*1024+9216+e}function q1(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function j1(t){return t>=64976&&t<=65007||e_.has(t)}var re;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(re||(re={}));const r_=65536;class s_{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=r_,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:r,col:s,offset:a}=this,i=s+n,o=a+n;return{code:e,startLine:r,endLine:r,startCol:i,endCol:i,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(t_(n))return this.pos++,this._addGap(),n_(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,w.EOF;return this._err(re.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let r=0;r<e.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==e.charCodeAt(r))return!1;return!0}peek(e){const n=this.pos+e;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,w.EOF;const r=this.html.charCodeAt(n);return r===w.CARRIAGE_RETURN?w.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,w.EOF;let e=this.html.charCodeAt(this.pos);return e===w.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,w.LINE_FEED):e===w.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,H1(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===w.LINE_FEED||e===w.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){q1(e)?this._err(re.controlCharacterInInputStream):j1(e)&&this._err(re.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var at;(function(t){t[t.CHARACTER=0]="CHARACTER",t[t.NULL_CHARACTER=1]="NULL_CHARACTER",t[t.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",t[t.START_TAG=3]="START_TAG",t[t.END_TAG=4]="END_TAG",t[t.COMMENT=5]="COMMENT",t[t.DOCTYPE=6]="DOCTYPE",t[t.EOF=7]="EOF",t[t.HIBERNATION=8]="HIBERNATION"})(at||(at={}));function $1(t,e){for(let n=t.attrs.length-1;n>=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}const a_=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏ੊ઑඡ๭༉༦჊ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ὾⁠↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms„‹•˜¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲ΂ϏϢϸontourIntegraìȹoɴ͹\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՗՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲ׌y;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱cò׋؀JTabcdfgorstר׬ׯ׺؀ؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d׷׸䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇܎ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ޷޼߂ߐĀiyޱ޵rc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄΀HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶߻dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣ঳সে্਷ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗ࡜ࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४Ānrࢃ࢏gleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpw৔ਖਛgȀLRlr৞৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼੝੠੷੼અઋ઎p;椅y;䐜Ādl੥੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑ඗ඞcy;䐊cute;䅃ƀaey઴હાron;䅇dil;䅅;䐝ƀgswે૰଎ativeƀMTV૓૟૨ediumSpace;怋hiĀcn૦૘ë૙eryThiî૙tedĀGL૸ଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷ଺reak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊ஛ement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater΀;EFGLSTஶஷ஽௉௓௘௥扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲௽ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ೒拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨೹setĀ;E೰ೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂ෉෕ෛ෠෧෼ขภยา฿ไlig;䅒cute耻Ó䃓Āiy෎ීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲ෶cr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬื฼de耻Õ䃕es;樷ml耻Ö䃖erĀBP๋๠Āar๐๓r;怾acĀek๚๜;揞et;掴arenthesis;揜Ҁacfhilors๿ງຊຏຒດຝະ໼rtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ໠໤檻cedesȀ;EST່້໏໚扺qual;檯lantEqual;扼ilde;找me;怳Ādp໩໮uct;戏ortionĀ;aȥ໹l;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬؀BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁࿫࿳ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL࿜࿝࿡憒ar;懥eftArrow;懄eiling;按oǵ࿹\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»࿝pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄ቉ቕ቞ቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHc቎ቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗Āeiቻ኉Dzኀ\0ኇefore;戴a;䎘Ācn኎ኘkSpace;쀀  Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0᏿ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0጖y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻፿on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtè૙a;䎖r;愨pf;愤cr;쀀𝒵௡ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚΀;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒΀;Eaeiop዁ᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;e዁ᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;e዁ᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰ᜼ᝃᝈ᝸᝽០៦ᠹᡐᜍ᤽᥈ᥰot;櫭Ācrᛶ᜞kȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e᜚᜛戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀako៭ᠦᠵĀcn៲ᠣkƀlst៺֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘᠝斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈؀DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬ᣿ᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教΀;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ᣷᣹᣻᣽;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ᤟;敛;敘;攘;攔΀;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģ᥂bar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;e᜚᜜lƀ;bhᥨᥩᥫ䁜;槅sub;柈Ŭᥴ᥾lĀ;e᥹᥺怢t»᥺pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭍᭒\0᯽\0ᰌƀcpr᦭ᦲ᧝ute;䄇̀;abcdsᦿᧀᧄ᧊᧕᧙戩nd;橄rcup;橉Āau᧏᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r΀;Ecefms᩟᩠ᩢᩫ᪤᪪᪮旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖᪚᪟»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇᫔᫺\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ᫙\0\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩eóɍǧ᫾\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯΀delprvw᭠᭬᭷ᮂᮬᯔ᯹arrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;p᭿ᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰸᰻᰿ᱝᱩᱵᲊᲞᲬᲷ᳻᳿ᴍᵻᶑᶫᶻ᷆᷍rò΁ar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂͸᳖᳜᳠mƀ;oș᳊᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄ὎὚ĀDoḆᴴoôᲉĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»Ṻƀaeiἒ἖Ἒls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙ῜ῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao‌⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧‪‬\0‮耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₟₥₰₴⃰⃵⃺⃿℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕ₝ute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽⃉ƀ;qsؾٌ⃄lanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqr׮ⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0↎proø₞r;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢␧␭␱␵␻ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀஀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼rò৆òΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonó྘quigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d྘➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ᠛旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐௏쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop඄⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roø඄urĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓΀;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨í஘istĀ;s஠டr;쀀𝔫ȀEest௅⩦⩹⩼ƀ;qs஼⩭௡ƀ;qs஼௅⩴lanô௢ií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚΀AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs఻⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs఻⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast୻⭕⭚⭟lleì୻l;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖ΀chimpqu⮽⯍⯙⬄୸⯤⯯Ȁ;cerല⯆ഷ⯉uå൅;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭å೸åഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñ೗Ā;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰⳴ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥ⵲ⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;c᪞ⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\0\0⵼\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕ⶘ⶥⶨrò᪀Āir⶝ⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔ⷗ǒr;榷rp;榹΀;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ⹞\0⹽\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ⹧⹲຅脀¶;l⹭⹮䂶leìЃɩ⹸\0\0⹻m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳⻴ᤈ⻹⻽⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp໬⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t໻⾴ï໻rel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⿚⋢⿟⿥⿫⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei⿾々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔઀ABHabcdefhilmnoprstux぀けさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤΀cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstw࿜ガクシスゼゾダッデナp;極Ā;f࿠ゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes㄂㄄;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ì࿲âヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘㇤㇮rrowĀ;t࿜ㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowó࿪arpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓rò࿪aòՑ;怏oustĀ;a㈞㈟掱che»㈟mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦΀Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼਴t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì⹯耻­䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;q኱ኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫ਩war;椪lig耻ß䃟௡㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rë๟ƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproø዁im»ኬsðኞĀas㚺㚮ð዁rn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈ΀adempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xô᝷headĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜΀eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roð໻tré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚΀cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜ៟tré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),i_=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function o_(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=i_.get(t))!==null&&e!==void 0?e:t}var nn;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(nn||(nn={}));const u_=32;var js;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(js||(js={}));function wd(t){return t>=nn.ZERO&&t<=nn.NINE}function l_(t){return t>=nn.UPPER_A&&t<=nn.UPPER_F||t>=nn.LOWER_A&&t<=nn.LOWER_F}function c_(t){return t>=nn.UPPER_A&&t<=nn.UPPER_Z||t>=nn.LOWER_A&&t<=nn.LOWER_Z||wd(t)}function d_(t){return t===nn.EQUALS||c_(t)}var tn;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(tn||(tn={}));var gs;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(gs||(gs={}));class f_{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=tn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=gs.Strict}startEntity(e){this.decodeMode=e,this.state=tn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case tn.EntityStart:return e.charCodeAt(n)===nn.NUM?(this.state=tn.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=tn.NamedEntity,this.stateNamedEntity(e,n));case tn.NumericStart:return this.stateNumericStart(e,n);case tn.NumericDecimal:return this.stateNumericDecimal(e,n);case tn.NumericHex:return this.stateNumericHex(e,n);case tn.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|u_)===nn.LOWER_X?(this.state=tn.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=tn.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,s){if(n!==r){const a=r-n;this.result=this.result*Math.pow(s,a)+Number.parseInt(e.substr(n,a),s),this.consumed+=a}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const s=e.charCodeAt(n);if(wd(s)||l_(s))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const s=e.charCodeAt(n);if(wd(s))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===nn.SEMI)this.consumed+=1;else if(this.decodeMode===gs.Strict)return 0;return this.emitCodePoint(o_(this.result),this.consumed),this.errors&&(e!==nn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let s=r[this.treeIndex],a=(s&js.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const i=e.charCodeAt(n);if(this.treeIndex=h_(r,s,this.treeIndex+Math.max(1,a),i),this.treeIndex<0)return this.result===0||this.decodeMode===gs.Attribute&&(a===0||d_(i))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&js.VALUE_LENGTH)>>14,a!==0){if(i===nn.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==gs.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,s=(r[n]&js.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[e]&~js.VALUE_LENGTH:s[e+1],r),n===3&&this.emitCodePoint(s[e+2],r),r}end(){var e;switch(this.state){case tn.NamedEntity:return this.result!==0&&(this.decodeMode!==gs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case tn.NumericDecimal:return this.emitNumericEntity(0,2);case tn.NumericHex:return this.emitNumericEntity(0,3);case tn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case tn.EntityStart:return 0}}}function h_(t,e,n,r){const s=(e&js.BRANCH_LENGTH)>>7,a=e&js.JUMP_TABLE;if(s===0)return a!==0&&r===a?n:-1;if(a){const u=r-a;return u<0||u>=s?-1:t[n+u]-1}let i=n,o=i+s-1;for(;i<=o;){const u=i+o>>>1,d=t[u];if(d<r)i=u+1;else if(d>r)o=u-1;else return t[u+s]}return-1}var ce;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})(ce||(ce={}));var Ra;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(Ra||(Ra={}));var nr;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(nr||(nr={}));var Z;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(Z||(Z={}));var c;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(c||(c={}));const p_=new Map([[Z.A,c.A],[Z.ADDRESS,c.ADDRESS],[Z.ANNOTATION_XML,c.ANNOTATION_XML],[Z.APPLET,c.APPLET],[Z.AREA,c.AREA],[Z.ARTICLE,c.ARTICLE],[Z.ASIDE,c.ASIDE],[Z.B,c.B],[Z.BASE,c.BASE],[Z.BASEFONT,c.BASEFONT],[Z.BGSOUND,c.BGSOUND],[Z.BIG,c.BIG],[Z.BLOCKQUOTE,c.BLOCKQUOTE],[Z.BODY,c.BODY],[Z.BR,c.BR],[Z.BUTTON,c.BUTTON],[Z.CAPTION,c.CAPTION],[Z.CENTER,c.CENTER],[Z.CODE,c.CODE],[Z.COL,c.COL],[Z.COLGROUP,c.COLGROUP],[Z.DD,c.DD],[Z.DESC,c.DESC],[Z.DETAILS,c.DETAILS],[Z.DIALOG,c.DIALOG],[Z.DIR,c.DIR],[Z.DIV,c.DIV],[Z.DL,c.DL],[Z.DT,c.DT],[Z.EM,c.EM],[Z.EMBED,c.EMBED],[Z.FIELDSET,c.FIELDSET],[Z.FIGCAPTION,c.FIGCAPTION],[Z.FIGURE,c.FIGURE],[Z.FONT,c.FONT],[Z.FOOTER,c.FOOTER],[Z.FOREIGN_OBJECT,c.FOREIGN_OBJECT],[Z.FORM,c.FORM],[Z.FRAME,c.FRAME],[Z.FRAMESET,c.FRAMESET],[Z.H1,c.H1],[Z.H2,c.H2],[Z.H3,c.H3],[Z.H4,c.H4],[Z.H5,c.H5],[Z.H6,c.H6],[Z.HEAD,c.HEAD],[Z.HEADER,c.HEADER],[Z.HGROUP,c.HGROUP],[Z.HR,c.HR],[Z.HTML,c.HTML],[Z.I,c.I],[Z.IMG,c.IMG],[Z.IMAGE,c.IMAGE],[Z.INPUT,c.INPUT],[Z.IFRAME,c.IFRAME],[Z.KEYGEN,c.KEYGEN],[Z.LABEL,c.LABEL],[Z.LI,c.LI],[Z.LINK,c.LINK],[Z.LISTING,c.LISTING],[Z.MAIN,c.MAIN],[Z.MALIGNMARK,c.MALIGNMARK],[Z.MARQUEE,c.MARQUEE],[Z.MATH,c.MATH],[Z.MENU,c.MENU],[Z.META,c.META],[Z.MGLYPH,c.MGLYPH],[Z.MI,c.MI],[Z.MO,c.MO],[Z.MN,c.MN],[Z.MS,c.MS],[Z.MTEXT,c.MTEXT],[Z.NAV,c.NAV],[Z.NOBR,c.NOBR],[Z.NOFRAMES,c.NOFRAMES],[Z.NOEMBED,c.NOEMBED],[Z.NOSCRIPT,c.NOSCRIPT],[Z.OBJECT,c.OBJECT],[Z.OL,c.OL],[Z.OPTGROUP,c.OPTGROUP],[Z.OPTION,c.OPTION],[Z.P,c.P],[Z.PARAM,c.PARAM],[Z.PLAINTEXT,c.PLAINTEXT],[Z.PRE,c.PRE],[Z.RB,c.RB],[Z.RP,c.RP],[Z.RT,c.RT],[Z.RTC,c.RTC],[Z.RUBY,c.RUBY],[Z.S,c.S],[Z.SCRIPT,c.SCRIPT],[Z.SEARCH,c.SEARCH],[Z.SECTION,c.SECTION],[Z.SELECT,c.SELECT],[Z.SOURCE,c.SOURCE],[Z.SMALL,c.SMALL],[Z.SPAN,c.SPAN],[Z.STRIKE,c.STRIKE],[Z.STRONG,c.STRONG],[Z.STYLE,c.STYLE],[Z.SUB,c.SUB],[Z.SUMMARY,c.SUMMARY],[Z.SUP,c.SUP],[Z.TABLE,c.TABLE],[Z.TBODY,c.TBODY],[Z.TEMPLATE,c.TEMPLATE],[Z.TEXTAREA,c.TEXTAREA],[Z.TFOOT,c.TFOOT],[Z.TD,c.TD],[Z.TH,c.TH],[Z.THEAD,c.THEAD],[Z.TITLE,c.TITLE],[Z.TR,c.TR],[Z.TRACK,c.TRACK],[Z.TT,c.TT],[Z.U,c.U],[Z.UL,c.UL],[Z.SVG,c.SVG],[Z.VAR,c.VAR],[Z.WBR,c.WBR],[Z.XMP,c.XMP]]);function Wl(t){var e;return(e=p_.get(t))!==null&&e!==void 0?e:c.UNKNOWN}const me=c,m_={[ce.HTML]:new Set([me.ADDRESS,me.APPLET,me.AREA,me.ARTICLE,me.ASIDE,me.BASE,me.BASEFONT,me.BGSOUND,me.BLOCKQUOTE,me.BODY,me.BR,me.BUTTON,me.CAPTION,me.CENTER,me.COL,me.COLGROUP,me.DD,me.DETAILS,me.DIR,me.DIV,me.DL,me.DT,me.EMBED,me.FIELDSET,me.FIGCAPTION,me.FIGURE,me.FOOTER,me.FORM,me.FRAME,me.FRAMESET,me.H1,me.H2,me.H3,me.H4,me.H5,me.H6,me.HEAD,me.HEADER,me.HGROUP,me.HR,me.HTML,me.IFRAME,me.IMG,me.INPUT,me.LI,me.LINK,me.LISTING,me.MAIN,me.MARQUEE,me.MENU,me.META,me.NAV,me.NOEMBED,me.NOFRAMES,me.NOSCRIPT,me.OBJECT,me.OL,me.P,me.PARAM,me.PLAINTEXT,me.PRE,me.SCRIPT,me.SECTION,me.SELECT,me.SOURCE,me.STYLE,me.SUMMARY,me.TABLE,me.TBODY,me.TD,me.TEMPLATE,me.TEXTAREA,me.TFOOT,me.TH,me.THEAD,me.TITLE,me.TR,me.TRACK,me.UL,me.WBR,me.XMP]),[ce.MATHML]:new Set([me.MI,me.MO,me.MN,me.MS,me.MTEXT,me.ANNOTATION_XML]),[ce.SVG]:new Set([me.TITLE,me.FOREIGN_OBJECT,me.DESC]),[ce.XLINK]:new Set,[ce.XML]:new Set,[ce.XMLNS]:new Set},Id=new Set([me.H1,me.H2,me.H3,me.H4,me.H5,me.H6]),g_=new Set([Z.STYLE,Z.SCRIPT,Z.XMP,Z.IFRAME,Z.NOEMBED,Z.NOFRAMES,Z.PLAINTEXT]);function b_(t,e){return g_.has(t)||e&&t===Z.NOSCRIPT}var L;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(L||(L={}));const Mn={DATA:L.DATA,RCDATA:L.RCDATA,RAWTEXT:L.RAWTEXT,SCRIPT_DATA:L.SCRIPT_DATA,PLAINTEXT:L.PLAINTEXT,CDATA_SECTION:L.CDATA_SECTION};function v_(t){return t>=w.DIGIT_0&&t<=w.DIGIT_9}function vo(t){return t>=w.LATIN_CAPITAL_A&&t<=w.LATIN_CAPITAL_Z}function E_(t){return t>=w.LATIN_SMALL_A&&t<=w.LATIN_SMALL_Z}function Ds(t){return E_(t)||vo(t)}function A0(t){return Ds(t)||v_(t)}function Ru(t){return t+32}function Y1(t){return t===w.SPACE||t===w.LINE_FEED||t===w.TABULATION||t===w.FORM_FEED}function y0(t){return Y1(t)||t===w.SOLIDUS||t===w.GREATER_THAN_SIGN}function T_(t){return t===w.NULL?re.nullCharacterReference:t>1114111?re.characterReferenceOutsideUnicodeRange:H1(t)?re.surrogateCharacterReference:j1(t)?re.noncharacterCharacterReference:q1(t)||t===w.CARRIAGE_RETURN?re.controlCharacterReference:null}class __{constructor(e,n){this.options=e,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=L.DATA,this.returnState=L.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new s_(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new f_(a_,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(re.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(re.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=T_(r);s&&this._err(s,1)}}:void 0)}_err(e,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(e,n))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e==null||e())}write(e,n,r){this.active=!0,this.preprocessor.write(e,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let n=0;n<e;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,n){return this.preprocessor.startsWith(e,n)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:at.START_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:at.END_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:at.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:at.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,n){this.currentCharacterToken={type:e,chars:n,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,n;const r=this.currentToken;if($1(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(e=(n=r.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(re.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=Wl(e.tagName),e.type===at.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(re.endTagWithAttributes),e.selfClosing&&this._err(re.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case at.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case at.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case at.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:at.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,n)}_emitCodePoint(e){const n=Y1(e)?at.WHITESPACE_CHARACTER:e===w.NULL?at.NULL_CHARACTER:at.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(at.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=L.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?gs.Attribute:gs.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===L.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===L.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===L.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case L.DATA:{this._stateData(e);break}case L.RCDATA:{this._stateRcdata(e);break}case L.RAWTEXT:{this._stateRawtext(e);break}case L.SCRIPT_DATA:{this._stateScriptData(e);break}case L.PLAINTEXT:{this._statePlaintext(e);break}case L.TAG_OPEN:{this._stateTagOpen(e);break}case L.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case L.TAG_NAME:{this._stateTagName(e);break}case L.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case L.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case L.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case L.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case L.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case L.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case L.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case L.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case L.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case L.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case L.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case L.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case L.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case L.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case L.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case L.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case L.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case L.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case L.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case L.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case L.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case L.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case L.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case L.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case L.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case L.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case L.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case L.BOGUS_COMMENT:{this._stateBogusComment(e);break}case L.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case L.COMMENT_START:{this._stateCommentStart(e);break}case L.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case L.COMMENT:{this._stateComment(e);break}case L.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case L.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case L.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case L.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case L.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case L.COMMENT_END:{this._stateCommentEnd(e);break}case L.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case L.DOCTYPE:{this._stateDoctype(e);break}case L.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case L.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case L.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case L.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case L.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case L.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case L.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case L.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case L.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case L.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case L.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case L.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case L.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case L.CDATA_SECTION:{this._stateCdataSection(e);break}case L.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case L.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case L.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case L.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case w.LESS_THAN_SIGN:{this.state=L.TAG_OPEN;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.NULL:{this._err(re.unexpectedNullCharacter),this._emitCodePoint(e);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case w.AMPERSAND:{this._startCharacterReference();break}case w.LESS_THAN_SIGN:{this.state=L.RCDATA_LESS_THAN_SIGN;break}case w.NULL:{this._err(re.unexpectedNullCharacter),this._emitChars(Ot);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case w.LESS_THAN_SIGN:{this.state=L.RAWTEXT_LESS_THAN_SIGN;break}case w.NULL:{this._err(re.unexpectedNullCharacter),this._emitChars(Ot);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_LESS_THAN_SIGN;break}case w.NULL:{this._err(re.unexpectedNullCharacter),this._emitChars(Ot);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case w.NULL:{this._err(re.unexpectedNullCharacter),this._emitChars(Ot);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Ds(e))this._createStartTagToken(),this.state=L.TAG_NAME,this._stateTagName(e);else switch(e){case w.EXCLAMATION_MARK:{this.state=L.MARKUP_DECLARATION_OPEN;break}case w.SOLIDUS:{this.state=L.END_TAG_OPEN;break}case w.QUESTION_MARK:{this._err(re.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=L.BOGUS_COMMENT,this._stateBogusComment(e);break}case w.EOF:{this._err(re.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(re.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=L.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Ds(e))this._createEndTagToken(),this.state=L.TAG_NAME,this._stateTagName(e);else switch(e){case w.GREATER_THAN_SIGN:{this._err(re.missingEndTagName),this.state=L.DATA;break}case w.EOF:{this._err(re.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(re.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=L.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=L.BEFORE_ATTRIBUTE_NAME;break}case w.SOLIDUS:{this.state=L.SELF_CLOSING_START_TAG;break}case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentTagToken();break}case w.NULL:{this._err(re.unexpectedNullCharacter),n.tagName+=Ot;break}case w.EOF:{this._err(re.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(vo(e)?Ru(e):e)}}_stateRcdataLessThanSign(e){e===w.SOLIDUS?this.state=L.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=L.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Ds(e)?(this.state=L.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=L.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=L.BEFORE_ATTRIBUTE_NAME,!1;case w.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=L.SELF_CLOSING_START_TAG,!1;case w.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=L.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=L.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===w.SOLIDUS?this.state=L.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=L.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Ds(e)?(this.state=L.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=L.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=L.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case w.SOLIDUS:{this.state=L.SCRIPT_DATA_END_TAG_OPEN;break}case w.EXCLAMATION_MARK:{this.state=L.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=L.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Ds(e)?(this.state=L.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=L.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=L.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===w.HYPHEN_MINUS?(this.state=L.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=L.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===w.HYPHEN_MINUS?(this.state=L.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=L.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case w.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case w.NULL:{this._err(re.unexpectedNullCharacter),this._emitChars(Ot);break}case w.EOF:{this._err(re.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case w.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case w.NULL:{this._err(re.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_ESCAPED,this._emitChars(Ot);break}case w.EOF:{this._err(re.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case w.HYPHEN_MINUS:{this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case w.GREATER_THAN_SIGN:{this.state=L.SCRIPT_DATA,this._emitChars(">");break}case w.NULL:{this._err(re.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_ESCAPED,this._emitChars(Ot);break}case w.EOF:{this._err(re.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===w.SOLIDUS?this.state=L.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Ds(e)?(this._emitChars("<"),this.state=L.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Ds(e)?(this.state=L.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(xn.SCRIPT,!1)&&y0(this.preprocessor.peek(xn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<xn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=L.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case w.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case w.NULL:{this._err(re.unexpectedNullCharacter),this._emitChars(Ot);break}case w.EOF:{this._err(re.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case w.HYPHEN_MINUS:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case w.NULL:{this._err(re.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ot);break}case w.EOF:{this._err(re.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case w.HYPHEN_MINUS:{this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case w.GREATER_THAN_SIGN:{this.state=L.SCRIPT_DATA,this._emitChars(">");break}case w.NULL:{this._err(re.unexpectedNullCharacter),this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ot);break}case w.EOF:{this._err(re.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===w.SOLIDUS?(this.state=L.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(xn.SCRIPT,!1)&&y0(this.preprocessor.peek(xn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<xn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=L.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=L.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.SOLIDUS:case w.GREATER_THAN_SIGN:case w.EOF:{this.state=L.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case w.EQUALS_SIGN:{this._err(re.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=L.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=L.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:case w.SOLIDUS:case w.GREATER_THAN_SIGN:case w.EOF:{this._leaveAttrName(),this.state=L.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case w.EQUALS_SIGN:{this._leaveAttrName(),this.state=L.BEFORE_ATTRIBUTE_VALUE;break}case w.QUOTATION_MARK:case w.APOSTROPHE:case w.LESS_THAN_SIGN:{this._err(re.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case w.NULL:{this._err(re.unexpectedNullCharacter),this.currentAttr.name+=Ot;break}default:this.currentAttr.name+=String.fromCodePoint(vo(e)?Ru(e):e)}}_stateAfterAttributeName(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.SOLIDUS:{this.state=L.SELF_CLOSING_START_TAG;break}case w.EQUALS_SIGN:{this.state=L.BEFORE_ATTRIBUTE_VALUE;break}case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentTagToken();break}case w.EOF:{this._err(re.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=L.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.QUOTATION_MARK:{this.state=L.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this.state=L.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(re.missingAttributeValue),this.state=L.DATA,this.emitCurrentTagToken();break}default:this.state=L.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case w.QUOTATION_MARK:{this.state=L.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.NULL:{this._err(re.unexpectedNullCharacter),this.currentAttr.value+=Ot;break}case w.EOF:{this._err(re.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case w.APOSTROPHE:{this.state=L.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.NULL:{this._err(re.unexpectedNullCharacter),this.currentAttr.value+=Ot;break}case w.EOF:{this._err(re.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this._leaveAttrValue(),this.state=L.BEFORE_ATTRIBUTE_NAME;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=L.DATA,this.emitCurrentTagToken();break}case w.NULL:{this._err(re.unexpectedNullCharacter),this.currentAttr.value+=Ot;break}case w.QUOTATION_MARK:case w.APOSTROPHE:case w.LESS_THAN_SIGN:case w.EQUALS_SIGN:case w.GRAVE_ACCENT:{this._err(re.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case w.EOF:{this._err(re.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this._leaveAttrValue(),this.state=L.BEFORE_ATTRIBUTE_NAME;break}case w.SOLIDUS:{this._leaveAttrValue(),this.state=L.SELF_CLOSING_START_TAG;break}case w.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=L.DATA,this.emitCurrentTagToken();break}case w.EOF:{this._err(re.eofInTag),this._emitEOFToken();break}default:this._err(re.missingWhitespaceBetweenAttributes),this.state=L.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case w.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=L.DATA,this.emitCurrentTagToken();break}case w.EOF:{this._err(re.eofInTag),this._emitEOFToken();break}default:this._err(re.unexpectedSolidusInTag),this.state=L.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentComment(n);break}case w.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case w.NULL:{this._err(re.unexpectedNullCharacter),n.data+=Ot;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(xn.DASH_DASH,!0)?(this._createCommentToken(xn.DASH_DASH.length+1),this.state=L.COMMENT_START):this._consumeSequenceIfMatch(xn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(xn.DOCTYPE.length+1),this.state=L.DOCTYPE):this._consumeSequenceIfMatch(xn.CDATA_START,!0)?this.inForeignNode?this.state=L.CDATA_SECTION:(this._err(re.cdataInHtmlContent),this._createCommentToken(xn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=L.BOGUS_COMMENT):this._ensureHibernation()||(this._err(re.incorrectlyOpenedComment),this._createCommentToken(2),this.state=L.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case w.HYPHEN_MINUS:{this.state=L.COMMENT_START_DASH;break}case w.GREATER_THAN_SIGN:{this._err(re.abruptClosingOfEmptyComment),this.state=L.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=L.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{this.state=L.COMMENT_END;break}case w.GREATER_THAN_SIGN:{this._err(re.abruptClosingOfEmptyComment),this.state=L.DATA,this.emitCurrentComment(n);break}case w.EOF:{this._err(re.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=L.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{this.state=L.COMMENT_END_DASH;break}case w.LESS_THAN_SIGN:{n.data+="<",this.state=L.COMMENT_LESS_THAN_SIGN;break}case w.NULL:{this._err(re.unexpectedNullCharacter),n.data+=Ot;break}case w.EOF:{this._err(re.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case w.EXCLAMATION_MARK:{n.data+="!",this.state=L.COMMENT_LESS_THAN_SIGN_BANG;break}case w.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=L.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===w.HYPHEN_MINUS?this.state=L.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=L.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===w.HYPHEN_MINUS?this.state=L.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=L.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==w.GREATER_THAN_SIGN&&e!==w.EOF&&this._err(re.nestedComment),this.state=L.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{this.state=L.COMMENT_END;break}case w.EOF:{this._err(re.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=L.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentComment(n);break}case w.EXCLAMATION_MARK:{this.state=L.COMMENT_END_BANG;break}case w.HYPHEN_MINUS:{n.data+="-";break}case w.EOF:{this._err(re.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=L.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{n.data+="--!",this.state=L.COMMENT_END_DASH;break}case w.GREATER_THAN_SIGN:{this._err(re.incorrectlyClosedComment),this.state=L.DATA,this.emitCurrentComment(n);break}case w.EOF:{this._err(re.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=L.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=L.BEFORE_DOCTYPE_NAME;break}case w.GREATER_THAN_SIGN:{this.state=L.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case w.EOF:{this._err(re.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingWhitespaceBeforeDoctypeName),this.state=L.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(vo(e))this._createDoctypeToken(String.fromCharCode(Ru(e))),this.state=L.DOCTYPE_NAME;else switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.NULL:{this._err(re.unexpectedNullCharacter),this._createDoctypeToken(Ot),this.state=L.DOCTYPE_NAME;break}case w.GREATER_THAN_SIGN:{this._err(re.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.EOF:{this._err(re.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=L.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=L.AFTER_DOCTYPE_NAME;break}case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.NULL:{this._err(re.unexpectedNullCharacter),n.name+=Ot;break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(vo(e)?Ru(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(xn.PUBLIC,!1)?this.state=L.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(xn.SYSTEM,!1)?this.state=L.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(re.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=L.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case w.QUOTATION_MARK:{this._err(re.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this._err(re.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(re.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.QUOTATION_MARK:{n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{n.publicId="",this.state=L.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(re.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case w.QUOTATION_MARK:{this.state=L.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case w.NULL:{this._err(re.unexpectedNullCharacter),n.publicId+=Ot;break}case w.GREATER_THAN_SIGN:{this._err(re.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case w.APOSTROPHE:{this.state=L.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case w.NULL:{this._err(re.unexpectedNullCharacter),n.publicId+=Ot;break}case w.GREATER_THAN_SIGN:{this._err(re.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=L.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case w.GREATER_THAN_SIGN:{this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.QUOTATION_MARK:{this._err(re.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this._err(re.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.QUOTATION_MARK:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=L.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case w.QUOTATION_MARK:{this._err(re.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this._err(re.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(re.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.QUOTATION_MARK:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{n.systemId="",this.state=L.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(re.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case w.QUOTATION_MARK:{this.state=L.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case w.NULL:{this._err(re.unexpectedNullCharacter),n.systemId+=Ot;break}case w.GREATER_THAN_SIGN:{this._err(re.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case w.APOSTROPHE:{this.state=L.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case w.NULL:{this._err(re.unexpectedNullCharacter),n.systemId+=Ot;break}case w.GREATER_THAN_SIGN:{this._err(re.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=L.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case w.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=L.DATA;break}case w.NULL:{this._err(re.unexpectedNullCharacter);break}case w.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case w.RIGHT_SQUARE_BRACKET:{this.state=L.CDATA_SECTION_BRACKET;break}case w.EOF:{this._err(re.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===w.RIGHT_SQUARE_BRACKET?this.state=L.CDATA_SECTION_END:(this._emitChars("]"),this.state=L.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case w.GREATER_THAN_SIGN:{this.state=L.DATA;break}case w.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=L.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(w.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&A0(this.preprocessor.peek(1))?L.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){A0(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===w.SEMICOLON&&this._err(re.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const z1=new Set([c.DD,c.DT,c.LI,c.OPTGROUP,c.OPTION,c.P,c.RB,c.RP,c.RT,c.RTC]),N0=new Set([...z1,c.CAPTION,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]),Tl=new Set([c.APPLET,c.CAPTION,c.HTML,c.MARQUEE,c.OBJECT,c.TABLE,c.TD,c.TEMPLATE,c.TH]),A_=new Set([...Tl,c.OL,c.UL]),y_=new Set([...Tl,c.BUTTON]),S0=new Set([c.ANNOTATION_XML,c.MI,c.MN,c.MO,c.MS,c.MTEXT]),w0=new Set([c.DESC,c.FOREIGN_OBJECT,c.TITLE]),N_=new Set([c.TR,c.TEMPLATE,c.HTML]),S_=new Set([c.TBODY,c.TFOOT,c.THEAD,c.TEMPLATE,c.HTML]),w_=new Set([c.TABLE,c.TEMPLATE,c.HTML]),I_=new Set([c.TD,c.TH]);class C_{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=c.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===c.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===ce.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,n){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,n,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,n){const r=this._indexOf(e);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(e,n,r){const s=this._indexOf(e)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==ce.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(e){for(;this.stackTop>=e;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<e)}}popUntilElementPopped(e){const n=this._indexOf(e);this.shortenToLength(Math.max(n,0))}popUntilPopped(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Id,ce.HTML)}popUntilTableCellPopped(){this.popUntilPopped(I_,ce.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,n){for(let r=this.stackTop;r>=0;r--)if(e.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(w_,ce.HTML)}clearBackToTableBodyContext(){this.clearBackTo(S_,ce.HTML)}clearBackToTableRowContext(){this.clearBackTo(N_,ce.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===c.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===c.HTML}hasInDynamicScope(e,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case ce.HTML:{if(s===e)return!0;if(n.has(s))return!1;break}case ce.SVG:{if(w0.has(s))return!1;break}case ce.MATHML:{if(S0.has(s))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Tl)}hasInListItemScope(e){return this.hasInDynamicScope(e,A_)}hasInButtonScope(e){return this.hasInDynamicScope(e,y_)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case ce.HTML:{if(Id.has(n))return!0;if(Tl.has(n))return!1;break}case ce.SVG:{if(w0.has(n))return!1;break}case ce.MATHML:{if(S0.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ce.HTML)switch(this.tagIDs[n]){case e:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===ce.HTML)switch(this.tagIDs[e]){case c.TBODY:case c.THEAD:case c.TFOOT:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ce.HTML)switch(this.tagIDs[n]){case e:return!0;case c.OPTION:case c.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&z1.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&N0.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&N0.has(this.currentTagId);)this.pop()}}const kc=3;var Vr;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(Vr||(Vr={}));const I0={type:Vr.Marker};class L_{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],s=n.length,a=this.treeAdapter.getTagName(e),i=this.treeAdapter.getNamespaceURI(e);for(let o=0;o<this.entries.length;o++){const u=this.entries[o];if(u.type===Vr.Marker)break;const{element:d}=u;if(this.treeAdapter.getTagName(d)===a&&this.treeAdapter.getNamespaceURI(d)===i){const h=this.treeAdapter.getAttrList(d);h.length===s&&r.push({idx:o,attrs:h})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<kc)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<kc)return;const s=new Map(n.map(i=>[i.name,i.value]));let a=0;for(let i=0;i<r.length;i++){const o=r[i];o.attrs.every(u=>s.get(u.name)===u.value)&&(a+=1,a>=kc&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(I0)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:Vr.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Vr.Element,element:e,token:n})}removeEntry(e){const n=this.entries.indexOf(e);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const e=this.entries.indexOf(I0);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===Vr.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===Vr.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===Vr.Element&&n.element===e)}}const fs={createDocument(){return{nodeName:"#document",mode:nr.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,n){return{nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const r=t.childNodes.indexOf(n);t.childNodes.splice(r,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,n,r){const s=t.childNodes.find(a=>a.nodeName==="#documentType");if(s)s.name=e,s.publicId=n,s.systemId=r;else{const a={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};fs.appendChild(t,a)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(fs.isTextNode(n)){n.value+=e;return}}fs.appendChild(t,fs.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&fs.isTextNode(r)?r.value+=e:fs.insertBefore(t,fs.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(r=>r.name));for(let r=0;r<e.length;r++)n.has(e[r].name)||t.attrs.push(e[r])},getFirstChild(t){return t.childNodes[0]},getChildNodes(t){return t.childNodes},getParentNode(t){return t.parentNode},getAttrList(t){return t.attrs},getTagName(t){return t.tagName},getNamespaceURI(t){return t.namespaceURI},getTextNodeContent(t){return t.value},getCommentNodeContent(t){return t.data},getDocumentTypeNodeName(t){return t.name},getDocumentTypeNodePublicId(t){return t.publicId},getDocumentTypeNodeSystemId(t){return t.systemId},isTextNode(t){return t.nodeName==="#text"},isCommentNode(t){return t.nodeName==="#comment"},isDocumentTypeNode(t){return t.nodeName==="#documentType"},isElementNode(t){return Object.prototype.hasOwnProperty.call(t,"tagName")},setNodeSourceCodeLocation(t,e){t.sourceCodeLocation=e},getNodeSourceCodeLocation(t){return t.sourceCodeLocation},updateNodeSourceCodeLocation(t,e){t.sourceCodeLocation={...t.sourceCodeLocation,...e}}},W1="html",O_="about:legacy-compat",x_="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",G1=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],R_=[...G1,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],D_=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),K1=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],k_=[...K1,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function C0(t,e){return e.some(n=>t.startsWith(n))}function P_(t){return t.name===W1&&t.publicId===null&&(t.systemId===null||t.systemId===O_)}function M_(t){if(t.name!==W1)return nr.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===x_)return nr.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),D_.has(n))return nr.QUIRKS;let r=e===null?R_:G1;if(C0(n,r))return nr.QUIRKS;if(r=e===null?K1:k_,C0(n,r))return nr.LIMITED_QUIRKS}return nr.NO_QUIRKS}const L0={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},B_="definitionurl",F_="definitionURL",U_=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(t=>[t.toLowerCase(),t])),H_=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ce.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ce.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ce.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ce.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ce.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ce.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ce.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ce.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ce.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ce.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ce.XMLNS}]]),q_=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),j_=new Set([c.B,c.BIG,c.BLOCKQUOTE,c.BODY,c.BR,c.CENTER,c.CODE,c.DD,c.DIV,c.DL,c.DT,c.EM,c.EMBED,c.H1,c.H2,c.H3,c.H4,c.H5,c.H6,c.HEAD,c.HR,c.I,c.IMG,c.LI,c.LISTING,c.MENU,c.META,c.NOBR,c.OL,c.P,c.PRE,c.RUBY,c.S,c.SMALL,c.SPAN,c.STRONG,c.STRIKE,c.SUB,c.SUP,c.TABLE,c.TT,c.U,c.UL,c.VAR]);function $_(t){const e=t.tagID;return e===c.FONT&&t.attrs.some(({name:r})=>r===Ra.COLOR||r===Ra.SIZE||r===Ra.FACE)||j_.has(e)}function V1(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===B_){t.attrs[e].name=F_;break}}function X1(t){for(let e=0;e<t.attrs.length;e++){const n=U_.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function sh(t){for(let e=0;e<t.attrs.length;e++){const n=H_.get(t.attrs[e].name);n&&(t.attrs[e].prefix=n.prefix,t.attrs[e].name=n.name,t.attrs[e].namespace=n.namespace)}}function Y_(t){const e=q_.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=Wl(t.tagName))}function z_(t,e){return e===ce.MATHML&&(t===c.MI||t===c.MO||t===c.MN||t===c.MS||t===c.MTEXT)}function W_(t,e,n){if(e===ce.MATHML&&t===c.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===Ra.ENCODING){const s=n[r].value.toLowerCase();return s===L0.TEXT_HTML||s===L0.APPLICATION_XML}}return e===ce.SVG&&(t===c.FOREIGN_OBJECT||t===c.DESC||t===c.TITLE)}function G_(t,e,n,r){return(!r||r===ce.HTML)&&W_(t,e,n)||(!r||r===ce.MATHML)&&z_(t,e)}const K_="hidden",V_=8,X_=3;var k;(function(t){t[t.INITIAL=0]="INITIAL",t[t.BEFORE_HTML=1]="BEFORE_HTML",t[t.BEFORE_HEAD=2]="BEFORE_HEAD",t[t.IN_HEAD=3]="IN_HEAD",t[t.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",t[t.AFTER_HEAD=5]="AFTER_HEAD",t[t.IN_BODY=6]="IN_BODY",t[t.TEXT=7]="TEXT",t[t.IN_TABLE=8]="IN_TABLE",t[t.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",t[t.IN_CAPTION=10]="IN_CAPTION",t[t.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",t[t.IN_TABLE_BODY=12]="IN_TABLE_BODY",t[t.IN_ROW=13]="IN_ROW",t[t.IN_CELL=14]="IN_CELL",t[t.IN_SELECT=15]="IN_SELECT",t[t.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",t[t.IN_TEMPLATE=17]="IN_TEMPLATE",t[t.AFTER_BODY=18]="AFTER_BODY",t[t.IN_FRAMESET=19]="IN_FRAMESET",t[t.AFTER_FRAMESET=20]="AFTER_FRAMESET",t[t.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",t[t.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(k||(k={}));const Q_={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},Q1=new Set([c.TABLE,c.TBODY,c.TFOOT,c.THEAD,c.TR]),O0={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:fs,onParseError:null};class Z1{constructor(e,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=k.INITIAL,this.originalInsertionMode=k.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...O0,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new __(this.options,this),this.activeFormattingElements=new L_(this.treeAdapter),this.fragmentContextID=r?Wl(this.treeAdapter.getTagName(r)):c.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new C_(this.document,this.treeAdapter,this)}static parse(e,n){const r=new this(n);return r.tokenizer.write(e,!0),r.document}static getFragmentParser(e,n){const r={...O0,...n};e??(e=r.treeAdapter.createElement(Z.TEMPLATE,ce.HTML,[]));const s=r.treeAdapter.createElement("documentmock",ce.HTML,[]),a=new this(r,s,e);return a.fragmentContextID===c.TEMPLATE&&a.tmplInsertionModeStack.unshift(k.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,r){var s;if(!this.onParseError)return;const a=(s=e.location)!==null&&s!==void 0?s:Q_,i={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(i)}onItemPush(e,n,r){var s,a;(a=(s=this.treeAdapter).onItemPush)===null||a===void 0||a.call(s,e),r&&this.openElements.stackTop>0&&this._setContextModes(e,n)}onItemPop(e,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,e,this.openElements.current),n){let a,i;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,i=this.fragmentContextID):{current:a,currentTagId:i}=this.openElements,this._setContextModes(a,i)}}_setContextModes(e,n){const r=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===ce.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,ce.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=k.TEXT}switchToPlaintextParsing(){this.insertionMode=k.TEXT,this.originalInsertionMode=k.IN_BODY,this.tokenizer.state=Mn.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===Z.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ce.HTML))switch(this.fragmentContextID){case c.TITLE:case c.TEXTAREA:{this.tokenizer.state=Mn.RCDATA;break}case c.STYLE:case c.XMP:case c.IFRAME:case c.NOEMBED:case c.NOFRAMES:case c.NOSCRIPT:{this.tokenizer.state=Mn.RAWTEXT;break}case c.SCRIPT:{this.tokenizer.state=Mn.SCRIPT_DATA;break}case c.PLAINTEXT:{this.tokenizer.state=Mn.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",r=e.publicId||"",s=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),e.location){const i=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));i&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,e)}}_appendElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location)}_insertElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID)}_insertFakeElement(e,n){const r=this.treeAdapter.createElement(e,ce.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,ce.HTML,e.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(Z.HTML,ce.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,c.HTML)}_appendCommentNode(e,n){const r=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,e.location)}_insertCharacters(e){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,e.chars,r):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const s=this.treeAdapter.getChildNodes(n),a=r?s.lastIndexOf(r):s.length,i=s[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){const{endLine:u,endCol:d,endOffset:h}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:u,endCol:d,endOffset:h})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,n){for(let r=this.treeAdapter.getFirstChild(e);r;r=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(e),a=n.type===at.END_TAG&&s===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,a)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,e.tagID===c.SVG&&this.treeAdapter.getTagName(n)===Z.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ce.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===c.MGLYPH||e.tagID===c.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ce.HTML)}_processToken(e){switch(e.type){case at.CHARACTER:{this.onCharacter(e);break}case at.NULL_CHARACTER:{this.onNullCharacter(e);break}case at.COMMENT:{this.onComment(e);break}case at.DOCTYPE:{this.onDoctype(e);break}case at.START_TAG:{this._processStartTag(e);break}case at.END_TAG:{this.onEndTag(e);break}case at.EOF:{this.onEof(e);break}case at.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const s=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return G_(e,s,a,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Vr.Marker||this.openElements.contains(s.element)),r=n===-1?e-1:n-1;for(let s=r;s>=0;s--){const a=this.activeFormattingElements.entries[s];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=k.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(c.P),this.openElements.popUntilTagNamePopped(c.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case c.TR:{this.insertionMode=k.IN_ROW;return}case c.TBODY:case c.THEAD:case c.TFOOT:{this.insertionMode=k.IN_TABLE_BODY;return}case c.CAPTION:{this.insertionMode=k.IN_CAPTION;return}case c.COLGROUP:{this.insertionMode=k.IN_COLUMN_GROUP;return}case c.TABLE:{this.insertionMode=k.IN_TABLE;return}case c.BODY:{this.insertionMode=k.IN_BODY;return}case c.FRAMESET:{this.insertionMode=k.IN_FRAMESET;return}case c.SELECT:{this._resetInsertionModeForSelect(e);return}case c.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case c.HTML:{this.insertionMode=this.headElement?k.AFTER_HEAD:k.BEFORE_HEAD;return}case c.TD:case c.TH:{if(e>0){this.insertionMode=k.IN_CELL;return}break}case c.HEAD:{if(e>0){this.insertionMode=k.IN_HEAD;return}break}}this.insertionMode=k.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===c.TEMPLATE)break;if(r===c.TABLE){this.insertionMode=k.IN_SELECT_IN_TABLE;return}}this.insertionMode=k.IN_SELECT}_isElementCausesFosterParenting(e){return Q1.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case c.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===ce.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case c.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const r=this.treeAdapter.getNamespaceURI(e);return m_[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){IA(this,e);return}switch(this.insertionMode){case k.INITIAL:{lo(this,e);break}case k.BEFORE_HTML:{wo(this,e);break}case k.BEFORE_HEAD:{Io(this,e);break}case k.IN_HEAD:{Co(this,e);break}case k.IN_HEAD_NO_SCRIPT:{Lo(this,e);break}case k.AFTER_HEAD:{Oo(this,e);break}case k.IN_BODY:case k.IN_CAPTION:case k.IN_CELL:case k.IN_TEMPLATE:{eg(this,e);break}case k.TEXT:case k.IN_SELECT:case k.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case k.IN_TABLE:case k.IN_TABLE_BODY:case k.IN_ROW:{Pc(this,e);break}case k.IN_TABLE_TEXT:{ig(this,e);break}case k.IN_COLUMN_GROUP:{_l(this,e);break}case k.AFTER_BODY:{Al(this,e);break}case k.AFTER_AFTER_BODY:{sl(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){wA(this,e);return}switch(this.insertionMode){case k.INITIAL:{lo(this,e);break}case k.BEFORE_HTML:{wo(this,e);break}case k.BEFORE_HEAD:{Io(this,e);break}case k.IN_HEAD:{Co(this,e);break}case k.IN_HEAD_NO_SCRIPT:{Lo(this,e);break}case k.AFTER_HEAD:{Oo(this,e);break}case k.TEXT:{this._insertCharacters(e);break}case k.IN_TABLE:case k.IN_TABLE_BODY:case k.IN_ROW:{Pc(this,e);break}case k.IN_COLUMN_GROUP:{_l(this,e);break}case k.AFTER_BODY:{Al(this,e);break}case k.AFTER_AFTER_BODY:{sl(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Cd(this,e);return}switch(this.insertionMode){case k.INITIAL:case k.BEFORE_HTML:case k.BEFORE_HEAD:case k.IN_HEAD:case k.IN_HEAD_NO_SCRIPT:case k.AFTER_HEAD:case k.IN_BODY:case k.IN_TABLE:case k.IN_CAPTION:case k.IN_COLUMN_GROUP:case k.IN_TABLE_BODY:case k.IN_ROW:case k.IN_CELL:case k.IN_SELECT:case k.IN_SELECT_IN_TABLE:case k.IN_TEMPLATE:case k.IN_FRAMESET:case k.AFTER_FRAMESET:{Cd(this,e);break}case k.IN_TABLE_TEXT:{co(this,e);break}case k.AFTER_BODY:{s2(this,e);break}case k.AFTER_AFTER_BODY:case k.AFTER_AFTER_FRAMESET:{a2(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case k.INITIAL:{i2(this,e);break}case k.BEFORE_HEAD:case k.IN_HEAD:case k.IN_HEAD_NO_SCRIPT:case k.AFTER_HEAD:{this._err(e,re.misplacedDoctype);break}case k.IN_TABLE_TEXT:{co(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,re.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?CA(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case k.INITIAL:{lo(this,e);break}case k.BEFORE_HTML:{o2(this,e);break}case k.BEFORE_HEAD:{l2(this,e);break}case k.IN_HEAD:{Rr(this,e);break}case k.IN_HEAD_NO_SCRIPT:{f2(this,e);break}case k.AFTER_HEAD:{p2(this,e);break}case k.IN_BODY:{En(this,e);break}case k.IN_TABLE:{Hi(this,e);break}case k.IN_TABLE_TEXT:{co(this,e);break}case k.IN_CAPTION:{cA(this,e);break}case k.IN_COLUMN_GROUP:{oh(this,e);break}case k.IN_TABLE_BODY:{Vl(this,e);break}case k.IN_ROW:{Xl(this,e);break}case k.IN_CELL:{hA(this,e);break}case k.IN_SELECT:{lg(this,e);break}case k.IN_SELECT_IN_TABLE:{mA(this,e);break}case k.IN_TEMPLATE:{bA(this,e);break}case k.AFTER_BODY:{EA(this,e);break}case k.IN_FRAMESET:{TA(this,e);break}case k.AFTER_FRAMESET:{AA(this,e);break}case k.AFTER_AFTER_BODY:{NA(this,e);break}case k.AFTER_AFTER_FRAMESET:{SA(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?LA(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case k.INITIAL:{lo(this,e);break}case k.BEFORE_HTML:{u2(this,e);break}case k.BEFORE_HEAD:{c2(this,e);break}case k.IN_HEAD:{d2(this,e);break}case k.IN_HEAD_NO_SCRIPT:{h2(this,e);break}case k.AFTER_HEAD:{m2(this,e);break}case k.IN_BODY:{Kl(this,e);break}case k.TEXT:{eA(this,e);break}case k.IN_TABLE:{qo(this,e);break}case k.IN_TABLE_TEXT:{co(this,e);break}case k.IN_CAPTION:{dA(this,e);break}case k.IN_COLUMN_GROUP:{fA(this,e);break}case k.IN_TABLE_BODY:{Ld(this,e);break}case k.IN_ROW:{ug(this,e);break}case k.IN_CELL:{pA(this,e);break}case k.IN_SELECT:{cg(this,e);break}case k.IN_SELECT_IN_TABLE:{gA(this,e);break}case k.IN_TEMPLATE:{vA(this,e);break}case k.AFTER_BODY:{fg(this,e);break}case k.IN_FRAMESET:{_A(this,e);break}case k.AFTER_FRAMESET:{yA(this,e);break}case k.AFTER_AFTER_BODY:{sl(this,e);break}}}onEof(e){switch(this.insertionMode){case k.INITIAL:{lo(this,e);break}case k.BEFORE_HTML:{wo(this,e);break}case k.BEFORE_HEAD:{Io(this,e);break}case k.IN_HEAD:{Co(this,e);break}case k.IN_HEAD_NO_SCRIPT:{Lo(this,e);break}case k.AFTER_HEAD:{Oo(this,e);break}case k.IN_BODY:case k.IN_TABLE:case k.IN_CAPTION:case k.IN_COLUMN_GROUP:case k.IN_TABLE_BODY:case k.IN_ROW:case k.IN_CELL:case k.IN_SELECT:case k.IN_SELECT_IN_TABLE:{sg(this,e);break}case k.TEXT:{tA(this,e);break}case k.IN_TABLE_TEXT:{co(this,e);break}case k.IN_TEMPLATE:{dg(this,e);break}case k.AFTER_BODY:case k.IN_FRAMESET:case k.AFTER_FRAMESET:case k.AFTER_AFTER_BODY:case k.AFTER_AFTER_FRAMESET:{ih(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===w.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case k.IN_HEAD:case k.IN_HEAD_NO_SCRIPT:case k.AFTER_HEAD:case k.TEXT:case k.IN_COLUMN_GROUP:case k.IN_SELECT:case k.IN_SELECT_IN_TABLE:case k.IN_FRAMESET:case k.AFTER_FRAMESET:{this._insertCharacters(e);break}case k.IN_BODY:case k.IN_CAPTION:case k.IN_CELL:case k.IN_TEMPLATE:case k.AFTER_BODY:case k.AFTER_AFTER_BODY:case k.AFTER_AFTER_FRAMESET:{J1(this,e);break}case k.IN_TABLE:case k.IN_TABLE_BODY:case k.IN_ROW:{Pc(this,e);break}case k.IN_TABLE_TEXT:{ag(this,e);break}}}}function Z_(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):rg(t,e),n}function J_(t,e){let n=null,r=t.openElements.stackTop;for(;r>=0;r--){const s=t.openElements.items[r];if(s===e.element)break;t._isSpecialElement(s,t.openElements.tagIDs[r])&&(n=s)}return n||(t.openElements.shortenToLength(Math.max(r,0)),t.activeFormattingElements.removeEntry(e)),n}function e2(t,e,n){let r=e,s=t.openElements.getCommonAncestor(e);for(let a=0,i=s;i!==n;a++,i=s){s=t.openElements.getCommonAncestor(i);const o=t.activeFormattingElements.getElementEntry(i),u=o&&a>=X_;!o||u?(u&&t.activeFormattingElements.removeEntry(o),t.openElements.remove(i)):(i=t2(t,o),r===e&&(t.activeFormattingElements.bookmark=o),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(i,r),r=i)}return r}function t2(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),r=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,r),e.element=r,r}function n2(t,e,n){const r=t.treeAdapter.getTagName(e),s=Wl(r);if(t._isElementCausesFosterParenting(s))t._fosterParentElement(n);else{const a=t.treeAdapter.getNamespaceURI(e);s===c.TEMPLATE&&a===ce.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function r2(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:s}=n,a=t.treeAdapter.createElement(s.tagName,r,s.attrs);t._adoptNodes(e,a),t.treeAdapter.appendChild(e,a),t.activeFormattingElements.insertElementAfterBookmark(a,s),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,a,s.tagID)}function ah(t,e){for(let n=0;n<V_;n++){const r=Z_(t,e);if(!r)break;const s=J_(t,r);if(!s)break;t.activeFormattingElements.bookmark=r;const a=e2(t,s,r.element),i=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(a),i&&n2(t,i,a),r2(t,s,r)}}function Cd(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function s2(t,e){t._appendCommentNode(e,t.openElements.items[0])}function a2(t,e){t._appendCommentNode(e,t.document)}function ih(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let r=t.openElements.stackTop;r>=n;r--)t._setEndLocation(t.openElements.items[r],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const r=t.openElements.items[0],s=t.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(t._setEndLocation(r,e),t.openElements.stackTop>=1)){const a=t.openElements.items[1],i=t.treeAdapter.getNodeSourceCodeLocation(a);i&&!i.endTag&&t._setEndLocation(a,e)}}}}function i2(t,e){t._setDocumentType(e);const n=e.forceQuirks?nr.QUIRKS:M_(e);P_(e)||t._err(e,re.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=k.BEFORE_HTML}function lo(t,e){t._err(e,re.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,nr.QUIRKS),t.insertionMode=k.BEFORE_HTML,t._processToken(e)}function o2(t,e){e.tagID===c.HTML?(t._insertElement(e,ce.HTML),t.insertionMode=k.BEFORE_HEAD):wo(t,e)}function u2(t,e){const n=e.tagID;(n===c.HTML||n===c.HEAD||n===c.BODY||n===c.BR)&&wo(t,e)}function wo(t,e){t._insertFakeRootElement(),t.insertionMode=k.BEFORE_HEAD,t._processToken(e)}function l2(t,e){switch(e.tagID){case c.HTML:{En(t,e);break}case c.HEAD:{t._insertElement(e,ce.HTML),t.headElement=t.openElements.current,t.insertionMode=k.IN_HEAD;break}default:Io(t,e)}}function c2(t,e){const n=e.tagID;n===c.HEAD||n===c.BODY||n===c.HTML||n===c.BR?Io(t,e):t._err(e,re.endTagWithoutMatchingOpenElement)}function Io(t,e){t._insertFakeElement(Z.HEAD,c.HEAD),t.headElement=t.openElements.current,t.insertionMode=k.IN_HEAD,t._processToken(e)}function Rr(t,e){switch(e.tagID){case c.HTML:{En(t,e);break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:{t._appendElement(e,ce.HTML),e.ackSelfClosing=!0;break}case c.TITLE:{t._switchToTextParsing(e,Mn.RCDATA);break}case c.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,Mn.RAWTEXT):(t._insertElement(e,ce.HTML),t.insertionMode=k.IN_HEAD_NO_SCRIPT);break}case c.NOFRAMES:case c.STYLE:{t._switchToTextParsing(e,Mn.RAWTEXT);break}case c.SCRIPT:{t._switchToTextParsing(e,Mn.SCRIPT_DATA);break}case c.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=k.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(k.IN_TEMPLATE);break}case c.HEAD:{t._err(e,re.misplacedStartTagForHeadElement);break}default:Co(t,e)}}function d2(t,e){switch(e.tagID){case c.HEAD:{t.openElements.pop(),t.insertionMode=k.AFTER_HEAD;break}case c.BODY:case c.BR:case c.HTML:{Co(t,e);break}case c.TEMPLATE:{Xa(t,e);break}default:t._err(e,re.endTagWithoutMatchingOpenElement)}}function Xa(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==c.TEMPLATE&&t._err(e,re.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,re.endTagWithoutMatchingOpenElement)}function Co(t,e){t.openElements.pop(),t.insertionMode=k.AFTER_HEAD,t._processToken(e)}function f2(t,e){switch(e.tagID){case c.HTML:{En(t,e);break}case c.BASEFONT:case c.BGSOUND:case c.HEAD:case c.LINK:case c.META:case c.NOFRAMES:case c.STYLE:{Rr(t,e);break}case c.NOSCRIPT:{t._err(e,re.nestedNoscriptInHead);break}default:Lo(t,e)}}function h2(t,e){switch(e.tagID){case c.NOSCRIPT:{t.openElements.pop(),t.insertionMode=k.IN_HEAD;break}case c.BR:{Lo(t,e);break}default:t._err(e,re.endTagWithoutMatchingOpenElement)}}function Lo(t,e){const n=e.type===at.EOF?re.openElementsLeftAfterEof:re.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=k.IN_HEAD,t._processToken(e)}function p2(t,e){switch(e.tagID){case c.HTML:{En(t,e);break}case c.BODY:{t._insertElement(e,ce.HTML),t.framesetOk=!1,t.insertionMode=k.IN_BODY;break}case c.FRAMESET:{t._insertElement(e,ce.HTML),t.insertionMode=k.IN_FRAMESET;break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{t._err(e,re.abandonedHeadElementChild),t.openElements.push(t.headElement,c.HEAD),Rr(t,e),t.openElements.remove(t.headElement);break}case c.HEAD:{t._err(e,re.misplacedStartTagForHeadElement);break}default:Oo(t,e)}}function m2(t,e){switch(e.tagID){case c.BODY:case c.HTML:case c.BR:{Oo(t,e);break}case c.TEMPLATE:{Xa(t,e);break}default:t._err(e,re.endTagWithoutMatchingOpenElement)}}function Oo(t,e){t._insertFakeElement(Z.BODY,c.BODY),t.insertionMode=k.IN_BODY,Gl(t,e)}function Gl(t,e){switch(e.type){case at.CHARACTER:{eg(t,e);break}case at.WHITESPACE_CHARACTER:{J1(t,e);break}case at.COMMENT:{Cd(t,e);break}case at.START_TAG:{En(t,e);break}case at.END_TAG:{Kl(t,e);break}case at.EOF:{sg(t,e);break}}}function J1(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function eg(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function g2(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function b2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function v2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,ce.HTML),t.insertionMode=k.IN_FRAMESET)}function E2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,ce.HTML)}function T2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&Id.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,ce.HTML)}function _2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,ce.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function A2(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,ce.HTML),n||(t.formElement=t.openElements.current))}function y2(t,e){t.framesetOk=!1;const n=e.tagID;for(let r=t.openElements.stackTop;r>=0;r--){const s=t.openElements.tagIDs[r];if(n===c.LI&&s===c.LI||(n===c.DD||n===c.DT)&&(s===c.DD||s===c.DT)){t.openElements.generateImpliedEndTagsWithExclusion(s),t.openElements.popUntilTagNamePopped(s);break}if(s!==c.ADDRESS&&s!==c.DIV&&s!==c.P&&t._isSpecialElement(t.openElements.items[r],s))break}t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,ce.HTML)}function N2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,ce.HTML),t.tokenizer.state=Mn.PLAINTEXT}function S2(t,e){t.openElements.hasInScope(c.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,ce.HTML),t.framesetOk=!1}function w2(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(Z.A);n&&(ah(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,ce.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function I2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,ce.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function C2(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(c.NOBR)&&(ah(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,ce.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function L2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,ce.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function O2(t,e){t.treeAdapter.getDocumentMode(t.document)!==nr.QUIRKS&&t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,ce.HTML),t.framesetOk=!1,t.insertionMode=k.IN_TABLE}function tg(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,ce.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function ng(t){const e=$1(t,Ra.TYPE);return e!=null&&e.toLowerCase()===K_}function x2(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,ce.HTML),ng(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function R2(t,e){t._appendElement(e,ce.HTML),e.ackSelfClosing=!0}function D2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._appendElement(e,ce.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function k2(t,e){e.tagName=Z.IMG,e.tagID=c.IMG,tg(t,e)}function P2(t,e){t._insertElement(e,ce.HTML),t.skipNextNewLine=!0,t.tokenizer.state=Mn.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=k.TEXT}function M2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,Mn.RAWTEXT)}function B2(t,e){t.framesetOk=!1,t._switchToTextParsing(e,Mn.RAWTEXT)}function x0(t,e){t._switchToTextParsing(e,Mn.RAWTEXT)}function F2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,ce.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===k.IN_TABLE||t.insertionMode===k.IN_CAPTION||t.insertionMode===k.IN_TABLE_BODY||t.insertionMode===k.IN_ROW||t.insertionMode===k.IN_CELL?k.IN_SELECT_IN_TABLE:k.IN_SELECT}function U2(t,e){t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,ce.HTML)}function H2(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,ce.HTML)}function q2(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(c.RTC),t._insertElement(e,ce.HTML)}function j2(t,e){t._reconstructActiveFormattingElements(),V1(e),sh(e),e.selfClosing?t._appendElement(e,ce.MATHML):t._insertElement(e,ce.MATHML),e.ackSelfClosing=!0}function $2(t,e){t._reconstructActiveFormattingElements(),X1(e),sh(e),e.selfClosing?t._appendElement(e,ce.SVG):t._insertElement(e,ce.SVG),e.ackSelfClosing=!0}function R0(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,ce.HTML)}function En(t,e){switch(e.tagID){case c.I:case c.S:case c.B:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.SMALL:case c.STRIKE:case c.STRONG:{I2(t,e);break}case c.A:{w2(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{T2(t,e);break}case c.P:case c.DL:case c.OL:case c.UL:case c.DIV:case c.DIR:case c.NAV:case c.MAIN:case c.MENU:case c.ASIDE:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.DETAILS:case c.ADDRESS:case c.ARTICLE:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{E2(t,e);break}case c.LI:case c.DD:case c.DT:{y2(t,e);break}case c.BR:case c.IMG:case c.WBR:case c.AREA:case c.EMBED:case c.KEYGEN:{tg(t,e);break}case c.HR:{D2(t,e);break}case c.RB:case c.RTC:{H2(t,e);break}case c.RT:case c.RP:{q2(t,e);break}case c.PRE:case c.LISTING:{_2(t,e);break}case c.XMP:{M2(t,e);break}case c.SVG:{$2(t,e);break}case c.HTML:{g2(t,e);break}case c.BASE:case c.LINK:case c.META:case c.STYLE:case c.TITLE:case c.SCRIPT:case c.BGSOUND:case c.BASEFONT:case c.TEMPLATE:{Rr(t,e);break}case c.BODY:{b2(t,e);break}case c.FORM:{A2(t,e);break}case c.NOBR:{C2(t,e);break}case c.MATH:{j2(t,e);break}case c.TABLE:{O2(t,e);break}case c.INPUT:{x2(t,e);break}case c.PARAM:case c.TRACK:case c.SOURCE:{R2(t,e);break}case c.IMAGE:{k2(t,e);break}case c.BUTTON:{S2(t,e);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{L2(t,e);break}case c.IFRAME:{B2(t,e);break}case c.SELECT:{F2(t,e);break}case c.OPTION:case c.OPTGROUP:{U2(t,e);break}case c.NOEMBED:case c.NOFRAMES:{x0(t,e);break}case c.FRAMESET:{v2(t,e);break}case c.TEXTAREA:{P2(t,e);break}case c.NOSCRIPT:{t.options.scriptingEnabled?x0(t,e):R0(t,e);break}case c.PLAINTEXT:{N2(t,e);break}case c.COL:case c.TH:case c.TD:case c.TR:case c.HEAD:case c.FRAME:case c.TBODY:case c.TFOOT:case c.THEAD:case c.CAPTION:case c.COLGROUP:break;default:R0(t,e)}}function Y2(t,e){if(t.openElements.hasInScope(c.BODY)&&(t.insertionMode=k.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function z2(t,e){t.openElements.hasInScope(c.BODY)&&(t.insertionMode=k.AFTER_BODY,fg(t,e))}function W2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function G2(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(c.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(c.FORM):n&&t.openElements.remove(n))}function K2(t){t.openElements.hasInButtonScope(c.P)||t._insertFakeElement(Z.P,c.P),t._closePElement()}function V2(t){t.openElements.hasInListItemScope(c.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(c.LI),t.openElements.popUntilTagNamePopped(c.LI))}function X2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function Q2(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function Z2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function J2(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(Z.BR,c.BR),t.openElements.pop(),t.framesetOk=!1}function rg(t,e){const n=e.tagName,r=e.tagID;for(let s=t.openElements.stackTop;s>0;s--){const a=t.openElements.items[s],i=t.openElements.tagIDs[s];if(r===i&&(r!==c.UNKNOWN||t.treeAdapter.getTagName(a)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=s&&t.openElements.shortenToLength(s);break}if(t._isSpecialElement(a,i))break}}function Kl(t,e){switch(e.tagID){case c.A:case c.B:case c.I:case c.S:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.NOBR:case c.SMALL:case c.STRIKE:case c.STRONG:{ah(t,e);break}case c.P:{K2(t);break}case c.DL:case c.UL:case c.OL:case c.DIR:case c.DIV:case c.NAV:case c.PRE:case c.MAIN:case c.MENU:case c.ASIDE:case c.BUTTON:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.ADDRESS:case c.ARTICLE:case c.DETAILS:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.LISTING:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{W2(t,e);break}case c.LI:{V2(t);break}case c.DD:case c.DT:{X2(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{Q2(t);break}case c.BR:{J2(t);break}case c.BODY:{Y2(t,e);break}case c.HTML:{z2(t,e);break}case c.FORM:{G2(t);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{Z2(t,e);break}case c.TEMPLATE:{Xa(t,e);break}default:rg(t,e)}}function sg(t,e){t.tmplInsertionModeStack.length>0?dg(t,e):ih(t,e)}function eA(t,e){var n;e.tagID===c.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function tA(t,e){t._err(e,re.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function Pc(t,e){if(t.openElements.currentTagId!==void 0&&Q1.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=k.IN_TABLE_TEXT,e.type){case at.CHARACTER:{ig(t,e);break}case at.WHITESPACE_CHARACTER:{ag(t,e);break}}else fu(t,e)}function nA(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,ce.HTML),t.insertionMode=k.IN_CAPTION}function rA(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,ce.HTML),t.insertionMode=k.IN_COLUMN_GROUP}function sA(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(Z.COLGROUP,c.COLGROUP),t.insertionMode=k.IN_COLUMN_GROUP,oh(t,e)}function aA(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,ce.HTML),t.insertionMode=k.IN_TABLE_BODY}function iA(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(Z.TBODY,c.TBODY),t.insertionMode=k.IN_TABLE_BODY,Vl(t,e)}function oA(t,e){t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function uA(t,e){ng(e)?t._appendElement(e,ce.HTML):fu(t,e),e.ackSelfClosing=!0}function lA(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,ce.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function Hi(t,e){switch(e.tagID){case c.TD:case c.TH:case c.TR:{iA(t,e);break}case c.STYLE:case c.SCRIPT:case c.TEMPLATE:{Rr(t,e);break}case c.COL:{sA(t,e);break}case c.FORM:{lA(t,e);break}case c.TABLE:{oA(t,e);break}case c.TBODY:case c.TFOOT:case c.THEAD:{aA(t,e);break}case c.INPUT:{uA(t,e);break}case c.CAPTION:{nA(t,e);break}case c.COLGROUP:{rA(t,e);break}default:fu(t,e)}}function qo(t,e){switch(e.tagID){case c.TABLE:{t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode());break}case c.TEMPLATE:{Xa(t,e);break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:fu(t,e)}}function fu(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,Gl(t,e),t.fosterParentingEnabled=n}function ag(t,e){t.pendingCharacterTokens.push(e)}function ig(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function co(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)fu(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const og=new Set([c.CAPTION,c.COL,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]);function cA(t,e){const n=e.tagID;og.has(n)?t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=k.IN_TABLE,Hi(t,e)):En(t,e)}function dA(t,e){const n=e.tagID;switch(n){case c.CAPTION:case c.TABLE:{t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=k.IN_TABLE,n===c.TABLE&&qo(t,e));break}case c.BODY:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:Kl(t,e)}}function oh(t,e){switch(e.tagID){case c.HTML:{En(t,e);break}case c.COL:{t._appendElement(e,ce.HTML),e.ackSelfClosing=!0;break}case c.TEMPLATE:{Rr(t,e);break}default:_l(t,e)}}function fA(t,e){switch(e.tagID){case c.COLGROUP:{t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=k.IN_TABLE);break}case c.TEMPLATE:{Xa(t,e);break}case c.COL:break;default:_l(t,e)}}function _l(t,e){t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=k.IN_TABLE,t._processToken(e))}function Vl(t,e){switch(e.tagID){case c.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,ce.HTML),t.insertionMode=k.IN_ROW;break}case c.TH:case c.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(Z.TR,c.TR),t.insertionMode=k.IN_ROW,Xl(t,e);break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=k.IN_TABLE,Hi(t,e));break}default:Hi(t,e)}}function Ld(t,e){const n=e.tagID;switch(e.tagID){case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=k.IN_TABLE);break}case c.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=k.IN_TABLE,qo(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:case c.TR:break;default:qo(t,e)}}function Xl(t,e){switch(e.tagID){case c.TH:case c.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,ce.HTML),t.insertionMode=k.IN_CELL,t.activeFormattingElements.insertMarker();break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=k.IN_TABLE_BODY,Vl(t,e));break}default:Hi(t,e)}}function ug(t,e){switch(e.tagID){case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=k.IN_TABLE_BODY);break}case c.TABLE:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=k.IN_TABLE_BODY,Ld(t,e));break}case c.TBODY:case c.TFOOT:case c.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(c.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=k.IN_TABLE_BODY,Ld(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:break;default:qo(t,e)}}function hA(t,e){const n=e.tagID;og.has(n)?(t.openElements.hasInTableScope(c.TD)||t.openElements.hasInTableScope(c.TH))&&(t._closeTableCell(),Xl(t,e)):En(t,e)}function pA(t,e){const n=e.tagID;switch(n){case c.TD:case c.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=k.IN_ROW);break}case c.TABLE:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),ug(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:break;default:Kl(t,e)}}function lg(t,e){switch(e.tagID){case c.HTML:{En(t,e);break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._insertElement(e,ce.HTML);break}case c.OPTGROUP:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._insertElement(e,ce.HTML);break}case c.HR:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._appendElement(e,ce.HTML),e.ackSelfClosing=!0;break}case c.INPUT:case c.KEYGEN:case c.TEXTAREA:case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),e.tagID!==c.SELECT&&t._processStartTag(e));break}case c.SCRIPT:case c.TEMPLATE:{Rr(t,e);break}}}function cg(t,e){switch(e.tagID){case c.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===c.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===c.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop();break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop();break}case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode());break}case c.TEMPLATE:{Xa(t,e);break}}}function mA(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t._processStartTag(e)):lg(t,e)}function gA(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t.onEndTag(e)):cg(t,e)}function bA(t,e){switch(e.tagID){case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{Rr(t,e);break}case c.CAPTION:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.tmplInsertionModeStack[0]=k.IN_TABLE,t.insertionMode=k.IN_TABLE,Hi(t,e);break}case c.COL:{t.tmplInsertionModeStack[0]=k.IN_COLUMN_GROUP,t.insertionMode=k.IN_COLUMN_GROUP,oh(t,e);break}case c.TR:{t.tmplInsertionModeStack[0]=k.IN_TABLE_BODY,t.insertionMode=k.IN_TABLE_BODY,Vl(t,e);break}case c.TD:case c.TH:{t.tmplInsertionModeStack[0]=k.IN_ROW,t.insertionMode=k.IN_ROW,Xl(t,e);break}default:t.tmplInsertionModeStack[0]=k.IN_BODY,t.insertionMode=k.IN_BODY,En(t,e)}}function vA(t,e){e.tagID===c.TEMPLATE&&Xa(t,e)}function dg(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):ih(t,e)}function EA(t,e){e.tagID===c.HTML?En(t,e):Al(t,e)}function fg(t,e){var n;if(e.tagID===c.HTML){if(t.fragmentContext||(t.insertionMode=k.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===c.HTML){t._setEndLocation(t.openElements.items[0],e);const r=t.openElements.items[1];r&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&t._setEndLocation(r,e)}}else Al(t,e)}function Al(t,e){t.insertionMode=k.IN_BODY,Gl(t,e)}function TA(t,e){switch(e.tagID){case c.HTML:{En(t,e);break}case c.FRAMESET:{t._insertElement(e,ce.HTML);break}case c.FRAME:{t._appendElement(e,ce.HTML),e.ackSelfClosing=!0;break}case c.NOFRAMES:{Rr(t,e);break}}}function _A(t,e){e.tagID===c.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==c.FRAMESET&&(t.insertionMode=k.AFTER_FRAMESET))}function AA(t,e){switch(e.tagID){case c.HTML:{En(t,e);break}case c.NOFRAMES:{Rr(t,e);break}}}function yA(t,e){e.tagID===c.HTML&&(t.insertionMode=k.AFTER_AFTER_FRAMESET)}function NA(t,e){e.tagID===c.HTML?En(t,e):sl(t,e)}function sl(t,e){t.insertionMode=k.IN_BODY,Gl(t,e)}function SA(t,e){switch(e.tagID){case c.HTML:{En(t,e);break}case c.NOFRAMES:{Rr(t,e);break}}}function wA(t,e){e.chars=Ot,t._insertCharacters(e)}function IA(t,e){t._insertCharacters(e),t.framesetOk=!1}function hg(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==ce.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function CA(t,e){if($_(e))hg(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===ce.MATHML?V1(e):r===ce.SVG&&(Y_(e),X1(e)),sh(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function LA(t,e){if(e.tagID===c.P||e.tagID===c.BR){hg(t),t._endTagOutsideForeignContent(e);return}for(let n=t.openElements.stackTop;n>0;n--){const r=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(r)===ce.HTML){t._endTagOutsideForeignContent(e);break}const s=t.treeAdapter.getTagName(r);if(s.toLowerCase()===e.tagName){e.tagName=s,t.openElements.shortenToLength(n);break}}}function pg(t,e){return function(r){let s,a=0,i="";for(;s=t.exec(r);)a!==s.index&&(i+=r.substring(a,s.index)),i+=e.get(s[0].charCodeAt(0)),a=s.index+1;return i+r.substring(a)}}const OA=pg(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),xA=pg(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]])),RA=new Set([Z.AREA,Z.BASE,Z.BASEFONT,Z.BGSOUND,Z.BR,Z.COL,Z.EMBED,Z.FRAME,Z.HR,Z.IMG,Z.INPUT,Z.KEYGEN,Z.LINK,Z.META,Z.PARAM,Z.SOURCE,Z.TRACK,Z.WBR]);function mg(t,e){return e.treeAdapter.isElementNode(t)&&e.treeAdapter.getNamespaceURI(t)===ce.HTML&&RA.has(e.treeAdapter.getTagName(t))}const DA={treeAdapter:fs,scriptingEnabled:!0};function kA(t,e){const n={...DA,...e};return mg(t,n)?"":gg(t,n)}function gg(t,e){let n="";const r=e.treeAdapter.isElementNode(t)&&e.treeAdapter.getTagName(t)===Z.TEMPLATE&&e.treeAdapter.getNamespaceURI(t)===ce.HTML?e.treeAdapter.getTemplateContent(t):t,s=e.treeAdapter.getChildNodes(r);if(s)for(const a of s)n+=PA(a,e);return n}function PA(t,e){return e.treeAdapter.isElementNode(t)?MA(t,e):e.treeAdapter.isTextNode(t)?FA(t,e):e.treeAdapter.isCommentNode(t)?UA(t,e):e.treeAdapter.isDocumentTypeNode(t)?HA(t,e):""}function MA(t,e){const n=e.treeAdapter.getTagName(t);return`<${n}${BA(t,e)}>${mg(t,e)?"":`${gg(t,e)}</${n}>`}`}function BA(t,{treeAdapter:e}){let n="";for(const r of e.getAttrList(t)){if(n+=" ",r.namespace)switch(r.namespace){case ce.XML:{n+=`xml:${r.name}`;break}case ce.XMLNS:{r.name!=="xmlns"&&(n+="xmlns:"),n+=r.name;break}case ce.XLINK:{n+=`xlink:${r.name}`;break}default:n+=`${r.prefix}:${r.name}`}else n+=r.name;n+=`="${OA(r.value)}"`}return n}function FA(t,e){const{treeAdapter:n}=e,r=n.getTextNodeContent(t),s=n.getParentNode(t),a=s&&n.isElementNode(s)&&n.getTagName(s);return a&&n.getNamespaceURI(s)===ce.HTML&&b_(a,e.scriptingEnabled)?r:xA(r)}function UA(t,{treeAdapter:e}){return`<!--${e.getCommentNodeContent(t)}-->`}function HA(t,{treeAdapter:e}){return`<!DOCTYPE ${e.getDocumentTypeNodeName(t)}>`}function qA(t,e){return Z1.parse(t,e)}function uh(t,e,n){typeof t=="string"&&(n=e,e=t,t=null);const r=Z1.getFragmentParser(t,n);return r.tokenizer.write(e,!0),r.getFragment()}function Yn(t){return"tagName"in t}function ss(t){return t.nodeName==="#text"}function Nt(t,e){var n;return(n=t.attrs.find(r=>r.name===e))==null?void 0:n.value}function Vs(t,e){return t.attrs.some(n=>n.name===e)}function D0(t,e,n){const r=t.attrs.find(s=>s.name===e);r?r.value=n:t.attrs.push({name:e,value:n})}function lh(t,e){t.attrs=t.attrs.filter(n=>n.name!==e)}function Xs(t){return uh(t).childNodes}function jA(t){const e=t.trimStart().toLowerCase();return e.startsWith("<!doctype")||e.startsWith("<html")}function qi(t){return jA(t)?qA(t).childNodes:uh(t).childNodes}function $A(t){const e=uh("");return e.childNodes=t,kA(e)}const ch={image:{type:"image",valueKind:"asset",control:"image",multiline:!1},file:{type:"file",valueKind:"asset",control:"file",multiline:!1},url:{type:"url",valueKind:"url",control:"url",multiline:!1},email:{type:"email",valueKind:"text",control:"email",multiline:!1},phone:{type:"phone",valueKind:"text",control:"phone",multiline:!1},date:{type:"date",valueKind:"text",control:"date",multiline:!1},time:{type:"time",valueKind:"text",control:"time",multiline:!1},code:{type:"code",valueKind:"text",control:"code",multiline:!0},richtext:{type:"richtext",valueKind:"html",control:"richtext",multiline:!0},authors:{type:"authors",valueKind:"authors",control:"authors",multiline:!1},text:{type:"text",valueKind:"text",control:"text",multiline:!0},shorttext:{type:"shorttext",valueKind:"text",control:"shorttext",multiline:!1}};function YA(t){return Object.prototype.hasOwnProperty.call(ch,t)}function ja(t){return ch[t].valueKind}const zA=new Set(["h1","h2","h3","h4","h5","h6","title","label","th","caption","figcaption","legend","summary","option","dt","button"]),WA=new Set(["code","pre","kbd","samp"]),GA=new Set(["p","span","li","td","dd","strong","em","b","i","small","time","a","figcaption","div","article","section","main","aside","blockquote"]);function Da(t){if(t.annotation!==void 0&&YA(t.annotation))return t.annotation;if(t.attribute!==void 0){const e=t.attribute,n=(t.valuePrefix??"").toLowerCase();if(e==="href"){if(n.endsWith("mailto:"))return"email";if(n.endsWith("tel:"))return"phone";if(t.wholeValue)return t.download===!0?"file":"url"}return t.wholeValue&&e==="src"?t.tag==="img"?"image":"file":t.wholeValue&&t.tag==="source"&&e==="srcset"?"file":"shorttext"}return WA.has(t.tag)?"code":zA.has(t.tag)?"shorttext":GA.has(t.tag)?"text":"shorttext"}const KA=/\{([A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*)\}/g;function vs(t){const e=[];for(const n of t.matchAll(KA)){const s=(n[1]??"").split(".");e.push({raw:n[0],name:s[0]??"",path:s,dotted:s.length>1})}return e}function ka(t){var r;const e=t.trim(),n=vs(e);return n.length===1&&((r=n[0])==null?void 0:r.raw)===e?n[0]:null}function Ql(t,e){return t.replace(/\{([A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*)\}/g,(n,r)=>{const s=r.split(".");return e({raw:n,name:s[0]??"",path:s,dotted:s.length>1})})}function dh(t){const e=t.indexOf("{");return(e===-1?t:t.slice(0,e)).toLowerCase()}function bg(t){const e=k0(Nt(t,"data-minlength")),n=k0(Nt(t,"data-maxlength"));return{...e!==void 0&&{minLength:e},...n!==void 0&&{maxLength:n}}}function k0(t){if(t===void 0)return;const e=Number(t);return Number.isInteger(e)&&e>=0?e:void 0}function Es(t,e=new Map){return Eg(t,e,new Set)}function vg(t,e,n){if(n.has(t))return new Map;const r=e.get(t);if(r===void 0)return new Map;const s=Eg(r,e,new Set(n).add(t));return new Map(s.map(a=>[a.name,a.type]))}function Eg(t,e,n){const r=[],s=new Map,a=h=>{const g=s.get(h);if(g!==void 0)return g;const f={name:h,type:"shorttext",label:Zf(h),required:!1,multiline:!1};return s.set(h,f),r.push(h),f},i=(h,g)=>{if(s.has(h))return;const f=a(h);f.type=g,f.multiline=ch[g].multiline},o=h=>{const g=Nt(h,"data-field")??VA(h);if(g===void 0)return;const f=a(g);Vs(h,"data-required")&&(f.required=!0);const p=Nt(h,"data-help");p!==void 0&&(f.help=p);const b=Nt(h,"data-label");b!==void 0&&(f.label=b);const{minLength:A,maxLength:T}=bg(h);A!==void 0&&(f.minLength=A),T!==void 0&&(f.maxLength=T)},u=h=>{const g=ka(h);for(const f of vs(h))f.dotted||i(f.name,Da({tag:"",wholeValue:(g==null?void 0:g.name)===f.name}))},d=h=>{for(const g of h){if(!Yn(g)){ss(g)&&u(g.value);continue}const f=Nt(g,"data-each");if(f!==void 0){const A=a(f);A.type="url",A.multiple=!0;const T=Nt(g,"data-pick-from");T!==void 0&&(A.pickFrom=T),o(g);continue}if(Vs(g,"data-each-in"))continue;const p=Nt(g,"data-type"),b=e.has(g.tagName)?vg(g.tagName,e,n):void 0;for(const A of g.attrs){const T=ka(A.value);for(const E of vs(A.value)){if(E.dotted)continue;const x=(T==null?void 0:T.name)===E.name,I=x?b==null?void 0:b.get(A.name):void 0;i(E.name,I??Da({tag:g.tagName,attribute:A.name,wholeValue:x,valuePrefix:dh(A.value),download:Vs(g,"download"),...p!==void 0&&{annotation:p}}))}}for(const A of g.childNodes){if(!ss(A))continue;const T=ka(A.value);for(const E of vs(A.value))E.dotted||i(E.name,Da({tag:g.tagName,wholeValue:(T==null?void 0:T.name)===E.name,...p!==void 0&&{annotation:p}}))}o(g),d(g.childNodes)}};return d(qi(t)),r.map(h=>XA(s.get(h)))}function VA(t){for(const e of t.attrs){const n=vs(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}for(const e of t.childNodes)if(ss(e)){const n=vs(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}}function XA(t){return{name:t.name,type:t.type,label:t.label,required:t.required,multiline:t.multiline,...t.help!==void 0&&{help:t.help},...t.minLength!==void 0&&{minLength:t.minLength},...t.maxLength!==void 0&&{maxLength:t.maxLength},...t.multiple!==void 0&&{multiple:t.multiple},...t.pickFrom!==void 0&&{pickFrom:t.pickFrom}}}function QA(t,e){if(t===e)return!1;const n=ja(t),r=ja(e);return r==="html"?!1:n==="html"||t==="date"&&e==="time"||t==="time"&&e==="date"||(a=>a==="shorttext"||a==="text"||a==="code"||a==="email"||a==="phone")(t)&&(e==="date"||e==="time")?!0:!(n===r||r==="text")}function ZA(t,e){const n=new Map(t.map(o=>[o.name,o])),r=new Map(e.map(o=>[o.name,o])),s=[],a=[],i=[];for(const[o,u]of n){const d=r.get(o);d===void 0?a.push({name:o,type:u.type}):d.type!==u.type&&i.push({name:o,from:u.type,to:d.type,destructive:QA(u.type,d.type)})}for(const[o,u]of r)n.has(o)||s.push({name:o,type:u.type});return{added:s.sort((o,u)=>o.name.localeCompare(u.name)),removed:a.sort((o,u)=>o.name.localeCompare(u.name)),typeChanged:i.sort((o,u)=>o.name.localeCompare(u.name))}}const P0=/^(.+)@v([1-9]\d*)$/;function fh(t){const e=P0.exec(t);if(!e)return null;const n=e[1];return P0.test(n)?null:{base:n,version:Number.parseInt(e[2],10)}}function Od(t){return fh(t)!==null}function iD(t){const e=fh(t);return e?e.base:t}function JA(t){const e=fh(t);return e?e.version:null}const M0="ref:";function Zl(t){return t.startsWith(M0)?t.slice(M0.length):void 0}function B0(t){const e=new Set,n=r=>{for(const s of r)if(Yn(s)){for(const a of s.attrs){const i=Zl(a.value);i!==void 0&&e.add(i)}n(s.childNodes)}};return n(qi(t)),[...e].sort()}function xd(t,e=new Map){const n=new Set,r=[],s=[],a=new Set,i=new Set,o=new Set,u=new Map,d=new Set,h=g=>{for(const f of g){if(!Yn(f))continue;const p=ey(f);p!==void 0&&o.add(p);const b=Nt(f,"data-each-in");if(b!==void 0){r.push(b);continue}const A=Nt(f,"data-each");if(A!==void 0&&s.push(A),Vs(f,"data-required")){const I=F0(f);I!==void 0&&n.add(I)}const T=bg(f);if(T.minLength!==void 0||T.maxLength!==void 0){const I=F0(f);I!==void 0&&u.set(I,T)}const E=Nt(f,"data-type"),x=e.has(f.tagName)?vg(f.tagName,e,new Set):void 0;for(const I of f.attrs){const U=Zl(I.value);U!==void 0&&d.add(U);const P=ka(I.value);if(P===null||P.dotted)continue;const ee=(x==null?void 0:x.get(I.name))??Da({tag:f.tagName,attribute:I.name,wholeValue:!0,valuePrefix:dh(I.value),download:Vs(f,"download"),...E!==void 0&&{annotation:E}});ee==="image"?a.add(P.name):ee==="file"?i.add(P.name):ee==="richtext"&&o.add(P.name)}h(f.childNodes)}};return h(qi(t)),{requiredFields:[...n],queryLoopPaths:r,curatedLoopFields:s,imageFields:[...a],fileFields:[...i],richTextFields:[...o],constraints:u,references:[...d].sort()}}function ey(t){const e=t.childNodes.filter(i=>!(ss(i)&&i.value.trim()==="")),n=e[0];if(e.length!==1||n===void 0||!ss(n))return;const r=ka(n.value);if(r===null||r.dotted)return;const s=Nt(t,"data-type"),a=Da({tag:t.tagName,wholeValue:!0,...s!==void 0&&{annotation:s}});return ja(a)==="html"?r.name:void 0}function F0(t){const e=Nt(t,"data-field");if(e!==void 0)return e;for(const n of t.attrs){const r=vs(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}for(const n of t.childNodes)if(ss(n)){const r=vs(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}}function ty(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Mc(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function ny(t){return JSON.stringify(t).slice(1,-1)}function yl(t){let e="";for(const r of t){const s=r.codePointAt(0);s!==void 0&&s>32&&(e+=r)}const n=e.toLowerCase();return n.startsWith("javascript:")||n.startsWith("vbscript:")?"#":t}function ry(t){if(!Array.isArray(t))return[];const e=[];for(const n of t){if(n===null||typeof n!="object")continue;const r=n,s=typeof r.name=="string"?r.name:"";s.trim()!==""&&e.push({name:s,...typeof r.user=="string"&&r.user!==""&&{user:r.user},...typeof r.href=="string"&&r.href!==""&&{href:r.href}})}return e}function sy(t){if(t.length===0)return"";if(t.length===1)return t[0]??"";const e=t[t.length-1]??"";return`${t.slice(0,-1).join(", ")} and ${e}`}function ay(t,e){const n=ry(t).map(r=>{const s=r.user!==void 0?e==null?void 0:e(r.user):void 0;return ty((s==null?void 0:s.displayName)??r.name)});return sy(n)}const iy="public, max-age=31536000, immutable",oy=[400,800,1200,1600],uy={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png"};function ly(t){return t==="jpeg"?"jpg":t}function cy(t){const e=t.slice(t.lastIndexOf(".")+1).toLowerCase();return e==="png"?"png":e==="webp"?"webp":"jpeg"}function dy(t){let e=2166136261;for(let n=0;n<t.length;n+=1)e^=t[n]??0,e=Math.imul(e,16777619);return(e>>>0).toString(36)}async function fy(t,e,n){var T;const r=cy(e),s=[...new Set(["avif","webp",r])],a=await n.encode(t,{widths:oy,formats:s}),i=dy(t),o=e.slice(0,e.lastIndexOf(".")>=0?e.lastIndexOf("."):e.length),u=[],d=E=>{const x=`${o}.${i}-${E.width}.${ly(E.format)}`;return u.push({path:x,contents:E.bytes,cacheControl:iy}),`/${x}`},h=new Map;for(const E of[...a.variants].sort((x,I)=>x.width-I.width)){const x=d(E),I=h.get(E.format)??[];I.push({url:x,width:E.width}),h.set(E.format,I)}const g=E=>(h.get(E)??[]).map(x=>`${x.url} ${x.width}w`).join(", "),f=["avif","webp"].filter(E=>h.has(E)).map(E=>({format:E,mime:uy[E],srcset:g(E)})),p=h.get(r)??[],b=((T=p[p.length-1])==null?void 0:T.url)??`/${e}`,A={width:a.sourceWidth,height:a.sourceHeight,sources:f,fallbackSrc:b,...a.blurDataUri!==void 0&&{blurDataUri:a.blurDataUri}};return{artifacts:u,info:A}}function Tg(t,e){const n=t.sources.map(a=>`<source type="${a.mime}" srcset="${Mc(a.srcset)}">`).join(""),r=e.filter(([a])=>a!=="src"&&a!=="width"&&a!=="height").map(([a,i])=>` ${a}="${Mc(i)}"`).join(""),s=`<img src="${Mc(t.fallbackSrc)}" width="${t.width}" height="${t.height}" loading="lazy" decoding="async"${r}>`;return`<picture>${n}${s}</picture>`}const hy=["data-each-in","data-each","data-sort","data-limit","data-pick-from"],py=["data-type","data-field","data-required","data-help","data-label"];function Rd(t){const e={components:t.components,usedComponents:new Set,...t.context!==void 0&&{context:t.context},...t.media!==void 0&&{media:t.media},...t.authorDirectory!==void 0&&{authorDirectory:t.authorDirectory},...t.componentStyles!==void 0&&{componentStyles:t.componentStyles}},n=jo(qi(t.template),t.scope,e),r=t.document===void 0?n:Ng(jo(qi(t.document),t.scope,e),n);return my(r,t,e),$A(r)}function my(t,e,n){var i,o,u,d;const r=(i=e.templateStyle)==null?void 0:i.trim();if(r){const h=Xs(`<style>
4
+ ${r}
5
+ </style>`),g=Dd(t,"head");g?g.childNodes.push(...h):t.unshift(...h)}const s=[],a=(o=e.templateScript)==null?void 0:o.trim();a&&s.push(a);for(const h of[...n.usedComponents].sort()){const g=(d=(u=e.componentScripts)==null?void 0:u.get(h))==null?void 0:d.trim();g&&s.push(g)}if(s.length>0){const h=s.flatMap(f=>Xs(`<script>
6
+ ${f}
7
+ <\/script>`)),g=Dd(t,"body");g?g.childNodes.push(...h):t.push(...h)}}function Dd(t,e){for(const n of t){if(!Yn(n))continue;if(n.tagName===e)return n;const r=Dd(n.childNodes,e);if(r!==void 0)return r}}function U0(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"url"in t}function kd(t){return t==null?"":Array.isArray(t)?t.map(e=>e===null?"":String(e)).join(", "):String(t)}function Jl(t){return e=>{const n=t[e.name];if(U0(n)){if(e.path.length===1)return n.url;const r=n.fields[e.path[1]??""];return U0(r)?r.url:kd(r)}return e.dotted?"":kd(n)}}function jo(t,e,n){const r=[];for(const s of t)Yn(s)?r.push(..._g(s,e,n)):(ss(s)&&(s.value=Ql(s.value,Jl(e))),r.push(s));return r}function _g(t,e,n){if(Vs(t,"data-each-in")||Vs(t,"data-each"))return gy(t,e,n);if(n.components.has(t.tagName))return Ty(t,e,n);by(t,e,n);const r=Nt(t,"data-type");for(const a of py)lh(t,a);if(t.tagName==="img"&&n.media!==void 0){const a=n.media.image(Nt(t,"src")??"");if(a!==void 0){const i=t.attrs.map(o=>[o.name,o.value]);return Xs(Tg(a,i))}}if(Ey(t))return q0(t,e,"json"),[t];if(t.tagName==="script"||t.tagName==="style")return q0(t,e,"raw"),[t];const s=vy(t,r);if((s==null?void 0:s.kind)==="html"){const a=Xs(kd(e[s.token.name]));return t.childNodes=Ag(a,n),[t]}return(s==null?void 0:s.kind)==="authors"?(t.childNodes=Xs(ay(e[s.token.name],n.authorDirectory)),[t]):(t.childNodes=jo(t.childNodes,e,n),[t])}function Ag(t,e){var r;const n=[];for(const s of t){if(!Yn(s)){n.push(s);continue}if(s.childNodes=Ag(s.childNodes,e),s.tagName==="img"){const i=Nt(s,"src"),o=i!==void 0?(r=e.media)==null?void 0:r.image(i):void 0;if(o!==void 0){const u=s.attrs.map(d=>[d.name,d.value]);n.push(...Xs(Tg(o,u)));continue}i!==void 0&&D0(s,"src",H0(i,e))}const a=Nt(s,"href");a!==void 0&&D0(s,"href",H0(a,e)),n.push(s)}return n}function H0(t,e){var r;const n=Pd(t,e);return yl(n!==void 0?n:((r=e.media)==null?void 0:r.file(t))??t)}function Pd(t,e){var r,s;const n=Zl(t);if(n!==void 0)return((s=(r=e.context)==null?void 0:r.reference(n))==null?void 0:s.url)??"#"}function gy(t,e,n){if(n.context===void 0)return[];const r=Nt(t,"data-each-in");let s;if(r!==void 0){const i=Nt(t,"data-limit"),o=i!==void 0?Number.parseInt(i,10):void 0,u=Nt(t,"data-sort");s=n.context.collection(r,{...u!==void 0&&{sort:u},...o!==void 0&&!Number.isNaN(o)&&{limit:o}})}else{const i=Nt(t,"data-each")??"",o=e[i];s=(Array.isArray(o)?o.filter(d=>typeof d=="string"):typeof o=="string"?[o]:[]).map(d=>{var h;return(h=n.context)==null?void 0:h.reference(d)}).filter(d=>d!==void 0)}const a=[];for(const i of s){const o=yg(t);for(const u of hy)lh(o,u);a.push(..._g(o,{...e,item:i},n))}return a}function yg(t){if(Yn(t)){const e={...t,attrs:t.attrs.map(n=>({...n})),childNodes:[]};return e.childNodes=t.childNodes.map(yg),e}return{...t}}function by(t,e,n){var r;for(const s of t.attrs){if(vs(s.value).length===0){const g=Pd(s.value,n);g!==void 0&&(s.value=yl(g));continue}const a=Nt(t,"data-type"),i=ka(s.value)!==null,o=Da({tag:t.tagName,attribute:s.name,wholeValue:i,valuePrefix:dh(s.value),download:Vs(t,"download"),...a!==void 0&&{annotation:a}});let u=Ql(s.value,Jl(e));const d=Pd(u,n);d!==void 0&&(u=d);const h=(r=n.media)==null?void 0:r.file(u);h!==void 0&&(u=h),i&&ja(o)==="url"&&(u=yl(u)),s.value=u}}function q0(t,e,n){const r=Jl(e);for(const s of t.childNodes)ss(s)&&(s.value=Ql(s.value,a=>{const i=r(a);return n==="json"?ny(i):i}))}function vy(t,e){const n=t.childNodes.filter(i=>!(ss(i)&&i.value.trim()==="")),r=n[0];if(n.length!==1||r===void 0||!ss(r))return null;const s=ka(r.value);if(s===null||s.dotted)return null;const a=Da({tag:t.tagName,wholeValue:!0,...e!==void 0&&{annotation:e}});return{token:s,kind:ja(a)}}function Ey(t){var e;return t.tagName==="script"&&((e=Nt(t,"type"))==null?void 0:e.toLowerCase())==="application/ld+json"}function Ty(t,e,n){var h,g;const r=n.components.get(t.tagName);if(r===void 0)return[t];const s=Jl(e),a={};for(const f of t.attrs)a[f.name]=Ql(f.value,s);const i=jo(t.childNodes,e,n),o=jo(qi(r),a,n),u=Ng(o,i);n.usedComponents.add(t.tagName);const d=(g=(h=n.componentStyles)==null?void 0:h.get(t.tagName))==null?void 0:g.trim();if(d){const f=u.find(Yn);if(f!==void 0){const p=Xs(`<style>@scope {
8
+ ${d}
9
+ }</style>`);f.childNodes=[...p,...f.childNodes]}}return u}function Ng(t,e){const n=new Map,r=[];for(const s of e){const a=Yn(s)?Nt(s,"slot"):void 0;if(a!==void 0){Yn(s)&&lh(s,"slot");const i=n.get(a)??[];i.push(s),n.set(a,i)}else r.push(s)}return Md(t,n,r)}function Md(t,e,n){const r=[];for(const s of t)if(Yn(s)&&s.tagName==="slot"){const a=Nt(s,"name"),i=a!==void 0?e.get(a):n;i&&i.length>0?r.push(...i):r.push(...Md(s.childNodes,e,n))}else Yn(s)&&(s.childNodes=Md(s.childNodes,e,n)),r.push(s);return r}async function _y(t,e,n){const r=new Array(t.length),s=Math.max(1,Math.min(Math.floor(e),t.length));let a=0;const i=async()=>{for(;a<t.length;){const o=a++;r[o]=await n(t[o],o)}};return await Promise.all(Array.from({length:s},()=>i())),r}function Ay(t){return t.split("/").filter(e=>e!=="")}function vr(t){const e=Ay(t),n=e[e.length-1]==="index"?e.slice(0,-1):e;return n.length===0?"/":`/${n.join("/")}/`}const yy=4;async function Ny(t,e,n={}){const[r,s,a,i]=await Promise.all([Jf(t),eh(t),F1(t),U1(t)]),o=Sg(r,e,void 0);if(o===void 0)return;const u=n.draft??o.node.item,d=u.template??o.dirTemplate;if(d===void 0)return;const[h,g,f,p]=await Promise.all([El(t,d),ZT(t,d),JT(t,d),nh(t)]),b=xd(h,s),A={...o.node,item:u};let T,E=[];if(n.media!==void 0)T=n.media;else{const I=await Sy(t,A,b,n.imageEncoder,yy);T=I.media,E=I.mediaArtifacts}return{html:Rd({template:h,scope:hh(u),components:s,context:wg(r),media:T,componentStyles:a,componentScripts:i,...n.authorDirectory!==void 0&&{authorDirectory:n.authorDirectory},...p!==void 0&&{document:p},...g!==void 0&&{templateStyle:g},...f!==void 0&&{templateScript:f}}),mediaArtifacts:E}}function Sg(t,e,n){const r=t.defaultTemplate??n;for(const s of t.children)if(s.kind==="item"){if(s.path===e)return{node:s,dirTemplate:r}}else{const a=Sg(s,e,r);if(a!==void 0)return a}}async function Sy(t,e,n,r,s){const a=wy(e.path),i=e.item.fields,o=new Map,u=new Map,d=[];for(const h of n.fileFields)for(const g of Y0(i[h])){const f=$0(a,g),p=await j0(t,`content/${f}`);p!==void 0&&(d.push({path:f,contents:p}),u.set(g,`/${f}`))}if(r!==void 0){const h=new Set;for(const f of n.imageFields)for(const p of Y0(i[f]))h.add(p);for(const f of n.richTextFields){const p=i[f];if(typeof p=="string")for(const b of Iy(p))h.add(b)}const g=await _y([...h],s,async f=>{const p=$0(a,f),b=await j0(t,`content/${p}`);if(b!==void 0)return{ref:f,...await fy(b,p,r)}});for(const f of g)f!==void 0&&(d.push(...f.artifacts),o.set(f.ref,f.info))}return{media:{image:h=>o.get(h),file:h=>u.get(h)},mediaArtifacts:d}}async function j0(t,e){try{return await t.readBytes(e)}catch{return}}function wy(t){const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function $0(t,e){return[t,e.replace(/^\/+/,"")].filter(n=>n!=="").join("/")}function Iy(t){const e=[],n=r=>{for(const s of r)if(Yn(s)){if(s.tagName==="img"){const a=Nt(s,"src");a!==void 0&&Cy(a)&&e.push(a)}n(s.childNodes)}};return n(Xs(t)),e}function Cy(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function Y0(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function hh(t){return{...t.fields,title:t.title,...t.created!==void 0&&{created:t.created},...t.published!==void 0&&{published:t.published},...t.updated!==void 0&&{updated:t.updated}}}function Ly(t){const e=new Map,n=new Map,r=s=>{n.set(s.path,s);for(const a of s.children)a.kind==="item"?e.set(a.path,a):r(a)};return r(t),{items:e,dirs:n}}function z0(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}function wg(t){const{items:e,dirs:n}=Ly(t),r=s=>({url:vr(s.path),fields:hh(s.item)});return{collection(s,a){var f;const i=n.get(z0(s));if(i===void 0)return[];const o=((f=i.collection)==null?void 0:f.recursive)??!1,u=[],d=p=>{for(const b of p.children)b.kind==="item"?b.slug!=="index"&&b.item.isPublished&&u.push(b):o&&d(b)};d(i);const h=Oy(u,a.sort);return(a.limit!==void 0?h.slice(0,a.limit):h).map(r)},reference(s){const a=e.get(z0(s));if(!(a===void 0||!a.item.isPublished))return r(a)}}}function Oy(t,e){if(e===void 0)return[...t];const[n="published",r]=e.trim().split(/\s+/),s=i=>{const o=hh(i.item)[n];return o==null?"":String(o)},a=[...t].sort((i,o)=>s(i).localeCompare(s(o)));return r==="desc"?a.reverse():a}async function xy(t){var M;const[e,n,r]=await Promise.all([Jf(t),eh(t),nh(t)]),{items:s,dirs:a,published:i}=Ry(e);let o=null;if(r!==void 0)try{o=xd(r,n)}catch{o=null}const u=(o==null?void 0:o.requiredFields)??[],d=(o==null?void 0:o.constraints)??new Map,h=[],g=(v,C,R,D)=>{h.push({severity:v,code:C,message:R,...D!==void 0&&{path:D}})},f=(v,C,R)=>{const D=s.get(G0(v));D===void 0?g("error","reference-missing",`"${C}" references "${v}" (${R}), which does not exist.`,C):D.item.isPublished||g("error","reference-unpublished",`"${C}" references "${v}" (${R}), which is not published.`,C)},p=(v,C,R)=>{for(const[D,{minLength:W,maxLength:$}]of v){const B=C[D];if(typeof B!="string"||B==="")continue;const{length:Y}=B;W!==void 0&&Y<W&&g("warning","value-too-short",`"${R}" field "${D}" is ${Y} characters; the minimum is ${W}.`,R),$!==void 0&&Y>$&&g("warning","value-too-long",`"${R}" field "${D}" is ${Y} characters; the maximum is ${$}.`,R)}},b=new Map,A=new Map,T=async v=>{const C=b.get(v);if(C!==void 0||b.has(v))return C??null;let R;try{const D=await El(t,v);A.set(v,D),R=xd(D,n)}catch{R=null}return b.set(v,R),R},E=new Map,x=v=>{const C=E.get(v);if(C!==void 0)return C;const R=A.get(v),D=new Set(R!==void 0?Es(R,n).map(W=>W.name):[]);return E.set(v,D),D},I=new Map,U=async v=>{if(I.has(v))return I.get(v)??null;const C=await ee(v);if(C===null)return I.set(v,null),null;let R;try{R=await El(t,C)}catch{return I.set(v,null),null}const D=A.get(v);if(D===void 0)return I.set(v,null),null;const W=ZA(Es(R,n),Es(D,n)),$=new Set(W.typeChanged.filter(B=>B.destructive&&ja(B.from)!==ja(B.to)).map(B=>B.name));return I.set(v,$),$},P=new Map,ee=async v=>{if(P.has(v))return P.get(v)??null;const C=v.lastIndexOf("/"),R=C===-1?"templates":`templates/${v.slice(0,C)}`,D=C===-1?v:v.slice(C+1);let W;try{W=await t.list(R)}catch{return P.set(v,null),null}let $=0,B=null;const Y=`${D}@v`;for(const V of W){if(V.kind!=="file"||!V.name.endsWith(".html"))continue;const te=V.name.slice(0,-5);if(!te.startsWith(Y))continue;const de=JA(te);de!==null&&de>$&&($=de,B=C===-1?te:`${v.slice(0,C)}/${te}`)}return P.set(v,B),B},F=new Map;for(const{node:v,templateName:C}of i){const R=F.get(vr(v.path))??[];R.push(v.path),F.set(vr(v.path),R);const D=((M=v.parseDiagnostics)==null?void 0:M.unknownTopLevelKeys)??[];if(D.length>0&&g("warning","content.unknown-top-level-key",`"${v.path}" has top-level key${D.length===1?"":"s"} the parser does not recognise: ${D.map(B=>`"${B}"`).join(", ")}. They were dropped — content values belong under "fields" (and system keys are case-sensitive: "isPublished", not "IsPublished").`,v.path),C===void 0){g("error","no-template",`"${v.path}" has no template (no per-item or folder default).`,v.path);continue}const W=await T(C);if(W===null){const B=Od(C)?" (the snapshot may have been deleted while this item still pins to it — restore it, rebind the item to current via the Migrations workspace, or delete this item).":"";g("error","template-missing",`"${v.path}" uses template "${C}", which does not exist.${B}`,v.path);continue}if(!Od(C)){const B=x(C),Y=Object.keys(v.item.fields),V=Y.filter(de=>!B.has(de));V.length>0&&g("warning","content.schema-drift",`"${v.path}" has field${V.length===1?"":"s"} not rendered by template "${C}": ${V.map(de=>`"${de}"`).join(", ")}. Open the Migrations workspace to drop, rename, or keep them.`,v.path);const te=await U(C);if(te!==null&&te.size>0){const de=Y.filter(ge=>te.has(ge));de.length>0&&g("warning","content.type-drift",`"${v.path}" has field${de.length===1?"":"s"} whose stored value now renders under a different kind in template "${C}": ${de.map(ge=>`"${ge}"`).join(", ")}. The value carries over but may look different (e.g. rich text shown as escaped text). Re-edit the field, or revert the template's type change if it wasn't intended.`,v.path)}}const $=Dy(v.item);for(const B of W.requiredFields)W0($[B])&&g("error","required-empty",`"${v.path}" is missing required field "${B}".`,v.path);for(const B of u)W0($[B])&&g("error","required-empty",`"${v.path}" is missing required meta field "${B}" (document shell).`,v.path);p(W.constraints,$,v.path),p(d,$,v.path);for(const B of W.queryLoopPaths)a.has(G0(B))||g("error","loop-target-missing",`"${v.path}" loops over "${B}", which is not a directory.`,v.path);for(const B of W.curatedLoopFields)for(const Y of ky(v.item.fields[B]))f(Y,v.path,`field "${B}"`);for(const[B,Y]of Object.entries($)){if(typeof Y!="string")continue;const V=Zl(Y);if(V!==void 0&&f(V,v.path,`field "${B}"`),W.richTextFields.includes(B))for(const te of B0(Y))f(te,v.path,`field "${B}"`)}}const G=tt.templates;if(o!==null)for(const v of o.references)f(v,`${G}/${du}.html`,"link");for(const[v,C]of b)if(C!==null)for(const R of C.references)f(R,`${G}/${v}.html`,"link");for(const[v,C]of n)for(const R of B0(C))f(R,`${tt.components}/${v}.html`,"link");for(const[v,C]of F)C.length>1&&g("error","url-collision",`URL ${v} is produced by multiple items: ${C.join(", ")}.`);const Q=new Map;for(const v of await Py(t)){const R=v.slice(v.lastIndexOf("/")+1).slice(0,-5).toLowerCase(),D=Q.get(R)??[];D.push(`${tt.components}/${v}`),Q.set(R,D)}for(const[v,C]of[...Q].sort(([R],[D])=>R.localeCompare(D)))C.length>1&&g("error","component-tag-collision",`Multiple components resolve to <${v}>: ${C.join(", ")}.`);const ne=h.filter(v=>v.severity==="error"),_=h.filter(v=>v.severity==="warning");return{diagnostics:h,errors:ne,warnings:_,ok:ne.length===0}}function Ry(t){const e=new Map,n=new Map,r=[],s=(a,i)=>{n.set(a.path,a);const o=a.defaultTemplate??i;for(const u of a.children){if(u.kind==="dir"){s(u,o);continue}e.set(u.path,u),u.item.isPublished&&r.push({node:u,templateName:u.item.template??o})}};return s(t,void 0),{items:e,dirs:n,published:r}}function Dy(t){return{...t.fields,title:t.title,...t.created!==void 0&&{created:t.created},...t.published!==void 0&&{published:t.published},...t.updated!==void 0&&{updated:t.updated}}}function W0(t){return t==null||t===""?!0:Array.isArray(t)?t.length===0:!1}function ky(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function G0(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}async function Py(t){const e=tt.components;if(!await t.exists(e))return[];const n=[],r=async(s,a)=>{for(const i of await t.list(s)){const o=a===""?i.name:`${a}/${i.name}`;i.kind==="dir"?await r(`${s}/${i.name}`,o):i.name.endsWith(".html")&&n.push(o)}};return await r(e,""),n.sort()}function Bc(t,e){return t===null?!1:t.roles.includes("admin")?!0:t.roles.includes(e)}let Ig="";function Pa(t){return`${Ig}${t}`}function My(t){Ig=t.replace(/\/+$/,"")}async function By(){try{const t=await fetch("/config.json",{cache:"no-store"});if(!t.ok)return;const e=await t.json();typeof e.apiUrl=="string"&&My(e.apiUrl)}catch{}}async function Ke(t,e={}){const n=typeof t=="string"?Pa(t):t,r=await K0(n,e,dt.token);if(r.status!==401||dt.token===null)return r;const s=await dt.refresh();return s===null?r:K0(n,e,s)}async function K0(t,e,n){const r=new Headers(e.headers);return n!==null&&r.set("authorization",`Bearer ${n}`),fetch(t,{...e,headers:r})}async function Qa(t,e){const n=await Ke(t,e);return n.ok?{ok:!0}:{ok:!1,error:(await n.json().catch(()=>({}))).error??`HTTP ${n.status}`}}const Du="nanoesis.jwt",Fy=540*1e3;function Uy(){let t=J("loading"),e=J(null),n=J(null),r=J(!1),s=null;function a(E,x){y(e,E,!0),y(n,x,!0),y(t,"authenticated"),localStorage.setItem(Du,E),o()}function i(){y(e,null),y(n,null),y(t,"unauthenticated"),localStorage.removeItem(Du),u()}function o(){u(),s=setInterval(()=>{d()},Fy)}function u(){s!==null&&(clearInterval(s),s=null)}async function d(){if(l(e)===null)return null;const E=l(e),x=await fetch(Pa("/api/refresh"),{method:"POST",headers:{authorization:`Bearer ${E}`}});if(!x.ok)return i(),null;const I=await x.json().catch(()=>({}));return!I.ok||I.token===void 0||I.principal===void 0?(i(),null):(a(I.token,I.principal),I.token)}async function h(){y(t,"loading");let E;try{E=await fetch(Pa("/api/auth/state"))}catch{y(t,"no-auth");return}if(E.status===404){y(t,"no-auth");return}if(!E.ok){y(t,"unauthenticated");return}const x=await E.json();y(r,x.firstRun,!0);const I=localStorage.getItem(Du);I!==null&&I!==""&&(y(e,I,!0),await d()!==null)||y(t,"unauthenticated")}async function g(E,x){const I=await fetch(Pa("/api/login"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({username:E,password:x})}),U=await I.json().catch(()=>({}));return!I.ok||!U.ok||U.token===void 0||U.principal===void 0?{ok:!1,error:U.error??`HTTP ${I.status}`}:(y(r,!1),a(U.token,U.principal),{ok:!0})}async function f(){if(l(e)!==null)try{await Ke("/api/logout",{method:"POST"})}catch{}i()}async function p(E,x){const I=await Ke("/api/me/password",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({currentPassword:E,newPassword:x})}),U=await I.json().catch(()=>({}));return!I.ok||!U.ok||U.token===void 0?{ok:!1,error:U.error??`HTTP ${I.status}`}:(y(e,U.token,!0),localStorage.setItem(Du,U.token),{ok:!0})}async function b(){const E=await Ke("/api/me/token",{method:"POST"}),x=await E.json().catch(()=>({}));return!E.ok||x.ok!==!0||x.token===void 0?{ok:!1,error:x.error??`HTTP ${E.status}`}:{ok:!0,token:x.token,...x.expiresAt!==void 0&&{expiresAt:x.expiresAt}}}async function A(){const E=await Ke("/api/me/token",{method:"DELETE"});return E.ok?{ok:!0}:{ok:!1,error:(await E.json().catch(()=>({}))).error??`HTTP ${E.status}`}}function T(){return l(t)==="no-auth"}return{get status(){return l(t)},get token(){return l(e)},get principal(){return l(n)},get firstRun(){return l(r)},get canAuthor(){return T()||Bc(l(n),"author")},get canDevelop(){return T()||Bc(l(n),"developer")},get isAdmin(){return T()||Bc(l(n),"admin")},init:h,login:g,logout:f,refresh:d,changePassword:p,createMcpToken:b,revokeMcpTokens:A}}const dt=Uy(),V0={name:null,logoUrl:null};async function Hy(){try{const t=await fetch(Pa("/api/branding"));if(!t.ok)return V0;const e=await t.json();return e.logoUrl===null?e:{name:e.name,logoUrl:Pa(e.logoUrl)}}catch{return V0}}function qy(t){return Qa("/api/branding",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({name:t})})}function jy(t){return Qa("/api/branding/logo",{method:"POST",headers:{"content-type":t.type},body:t})}function $y(){return Qa("/api/branding/logo",{method:"DELETE"})}function Yy(){let t=J(null),e=J(null);async function n(){const r=await Hy();y(t,r.name,!0),y(e,r.logoUrl,!0)}return{get name(){return l(t)},get logoUrl(){return l(e)},load:n}}const In=Yy();let xo=J(null);const zy={get pending(){return l(xo)}};function X0(t=""){return new Promise(e=>{y(xo,{current:t,resolve:e},!0)})}function ku(t){l(xo)!==null&&(l(xo).resolve(t),y(xo,null))}var Wy=K(`<h2 class="svelte-trwq3g">Image description</h2> <p class="hint svelte-trwq3g">Describe the image for readers using a screen reader and for when it fails to load.
10
+ Leave it empty if the image is purely decorative.</p> <label class="field svelte-trwq3g"><span class="svelte-trwq3g">Alt text</span> <textarea rows="3" placeholder="e.g. Two people texting, frowning at their phones" class="svelte-trwq3g"></textarea></label> <div class="actions svelte-trwq3g"><button type="button" class="ghost svelte-trwq3g">Cancel</button> <button type="button" class="primary svelte-trwq3g">Save</button></div>`,1),Gy=K('<dialog aria-label="Image description" class="svelte-trwq3g"><!></dialog>');function Ky(t,e){it(e,!0);let n=J(void 0),r=J("");const s=Ae(()=>zy.pending);St(()=>{var d,h;if(l(s)===null){(d=l(n))==null||d.close();return}y(r,l(s).current,!0),(h=l(n))==null||h.showModal()});function a(){ku(l(r).trim())}var i=Gy(),o=S(i);{var u=d=>{var h=Wy(),g=O(Je(h),4),f=O(S(g),2);Ha(f,!0);var p=O(g,2),b=S(p),A=O(b,2);ae("keydown",f,T=>{T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),a())}),_t(f,()=>l(r),T=>y(r,T)),ae("click",b,()=>ku(null)),ae("click",A,a),j(d,h)};fe(o,d=>{l(s)!==null&&d(u)})}sn(i,d=>y(n,d),()=>l(n)),Pe("close",i,()=>ku(null)),Pe("cancel",i,()=>ku(null)),j(t,i),ot()}vt(["keydown","click"]);const Vy="modulepreload",Xy=function(t,e){return new URL(t,e).href},Q0={},Z0=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let i=function(h){return Promise.all(h.map(g=>Promise.resolve(g).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const o=document.getElementsByTagName("link"),u=document.querySelector("meta[property=csp-nonce]"),d=(u==null?void 0:u.nonce)||(u==null?void 0:u.getAttribute("nonce"));s=i(n.map(h=>{if(h=Xy(h,r),h in Q0)return;Q0[h]=!0;const g=h.endsWith(".css"),f=g?'[rel="stylesheet"]':"";if(!!r)for(let A=o.length-1;A>=0;A--){const T=o[A];if(T.href===h&&(!g||T.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${f}`))return;const b=document.createElement("link");if(b.rel=g?"stylesheet":Vy,g||(b.as="script"),b.crossOrigin="",b.href=h,d&&b.setAttribute("nonce",d),document.head.appendChild(b),g)return new Promise((A,T)=>{b.addEventListener("load",A),b.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(i){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i}return s.then(i=>{for(const o of i||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})};function ta(t){return Array.isArray?Array.isArray(t):Lg(t)==="[object Array]"}function Qy(t){if(typeof t=="string")return t;if(typeof t=="bigint")return t.toString();const e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function Bd(t){return t==null?"":Qy(t)}function Cn(t){return typeof t=="string"}function al(t){return typeof t=="number"}function Zy(t){return t===!0||t===!1||Jy(t)&&Lg(t)=="[object Boolean]"}function Cg(t){return typeof t=="object"}function Jy(t){return Cg(t)&&t!==null}function Pn(t){return t!=null}function Pu(t){return!t.trim().length}function Lg(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const e3="Incorrect 'index' type",t3=t=>`Invalid value for key ${t}`,n3=t=>`Pattern length exceeds max of ${t}.`,r3=t=>`Missing ${t} property in key`,s3=t=>`Property 'weight' in key '${t}' must be a positive integer`,J0=Object.prototype.hasOwnProperty;class a3{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(r=>{const s=Og(r);this._keys.push(s),this._keyMap[s.id]=s,n+=s.weight}),this._keys.forEach(r=>{r.weight/=n})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Og(t){let e=null,n=null,r=null,s=1,a=null;if(Cn(t)||ta(t))r=t,e=ep(t),n=Fd(t);else{if(!J0.call(t,"name"))throw new Error(r3("name"));const i=t.name;if(r=i,J0.call(t,"weight")&&(s=t.weight,s<=0))throw new Error(s3(i));e=ep(i),n=Fd(i),a=t.getFn}return{path:e,id:n,weight:s,src:r,getFn:a}}function ep(t){return ta(t)?t:t.split(".")}function Fd(t){return ta(t)?t.join("."):t}function i3(t,e){const n=[];let r=!1;const s=(a,i,o,u)=>{if(Pn(a))if(!i[o])n.push(u!==void 0?{v:a,i:u}:a);else{const d=i[o],h=a[d];if(!Pn(h))return;if(o===i.length-1&&(Cn(h)||al(h)||Zy(h)||typeof h=="bigint"))n.push(u!==void 0?{v:Bd(h),i:u}:Bd(h));else if(ta(h)){r=!0;for(let g=0,f=h.length;g<f;g+=1)s(h[g],i,o+1,g)}else i.length&&s(h,i,o+1,u)}};return s(t,Cn(e)?e.split("."):e,0),r?n:n[0]}const o3={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},u3={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},l3={location:0,threshold:.6,distance:100},c3={useExtendedSearch:!1,useTokenSearch:!1,getFn:i3,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},Be=Object.freeze({...u3,...o3,...l3,...c3}),d3=/[^ ]+/g;function f3(t=1,e=3){const n=new Map,r=Math.pow(10,e);return{get(s){const a=s.match(d3).length;if(n.has(a))return n.get(a);const i=1/Math.pow(a,.5*t),o=parseFloat(Math.round(i*r)/r);return n.set(a,o),o},clear(){n.clear()}}}class ph{constructor({getFn:e=Be.getFn,fieldNormWeight:n=Be.fieldNormWeight}={}){this.norm=f3(n,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Cn(this.docs[0])?this.docs.forEach((e,n)=>{this._addString(e,n)}):this.docs.forEach((e,n)=>{this._addObject(e,n)}),this.norm.clear())}add(e){const n=this.size();Cn(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let n=e,r=this.size();n<r;n+=1)this.records[n].i-=1}removeAll(e){for(let n=e.length-1;n>=0;n-=1)this.records.splice(e[n],1);for(let n=0,r=this.records.length;n<r;n+=1)this.records[n].i=n}getValueForItemAtKeyId(e,n){return e[this._keysMap[n]]}size(){return this.records.length}_addString(e,n){if(!Pn(e)||Pu(e))return;const r={v:e,i:n,n:this.norm.get(e)};this.records.push(r)}_addObject(e,n){const r={i:n,$:{}};this.keys.forEach((s,a)=>{const i=s.getFn?s.getFn(e):this.getFn(e,s.path);if(Pn(i)){if(ta(i)){const o=[];for(let u=0,d=i.length;u<d;u+=1){const h=i[u];if(Pn(h)){if(Cn(h)){if(!Pu(h)){const g={v:h,i:u,n:this.norm.get(h)};o.push(g)}}else if(Pn(h.v)){const g=Cn(h.v)?h.v:Bd(h.v);if(!Pu(g)){const f={v:g,i:h.i,n:this.norm.get(g)};o.push(f)}}}}r.$[a]=o}else if(Cn(i)&&!Pu(i)){const o={v:i,n:this.norm.get(i)};r.$[a]=o}}}),this.records.push(r)}toJSON(){return{keys:this.keys.map(({getFn:e,...n})=>n),records:this.records}}}function xg(t,e,{getFn:n=Be.getFn,fieldNormWeight:r=Be.fieldNormWeight}={}){const s=new ph({getFn:n,fieldNormWeight:r});return s.setKeys(t.map(Og)),s.setSources(e),s.create(),s}function h3(t,{getFn:e=Be.getFn,fieldNormWeight:n=Be.fieldNormWeight}={}){const{keys:r,records:s}=t,a=new ph({getFn:e,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(s),a}function p3(t=[],e=Be.minMatchCharLength){const n=[];let r=-1,s=-1,a=0;for(let i=t.length;a<i;a+=1){const o=t[a];o&&r===-1?r=a:!o&&r!==-1&&(s=a-1,s-r+1>=e&&n.push([r,s]),r=-1)}return t[a-1]&&a-r>=e&&n.push([r,a-1]),n}const ba=32;function m3(t,e,n,{location:r=Be.location,distance:s=Be.distance,threshold:a=Be.threshold,findAllMatches:i=Be.findAllMatches,minMatchCharLength:o=Be.minMatchCharLength,includeMatches:u=Be.includeMatches,ignoreLocation:d=Be.ignoreLocation}={}){if(e.length>ba)throw new Error(n3(ba));const h=e.length,g=t.length,f=Math.max(0,Math.min(r,g));let p=a,b=f;const A=(G,Q)=>{const ne=G/h;if(d)return ne;const _=Math.abs(f-Q);return s?ne+_/s:_?1:ne},T=o>1||u,E=T?Array(g):[];let x;for(;(x=t.indexOf(e,b))>-1;){const G=A(0,x);if(p=Math.min(G,p),b=x+h,T){let Q=0;for(;Q<h;)E[x+Q]=1,Q+=1}}b=-1;let I=[],U=1,P=h+g;const ee=1<<h-1;for(let G=0;G<h;G+=1){let Q=0,ne=P;for(;Q<ne;)A(G,f+ne)<=p?Q=ne:P=ne,ne=Math.floor((P-Q)/2+Q);P=ne;let _=Math.max(1,f-ne+1);const M=i?g:Math.min(f+ne,g)+h,v=Array(M+2);v[M+1]=(1<<G)-1;for(let R=M;R>=_;R-=1){const D=R-1,W=n[t[D]];if(T&&(E[D]=+!!W),v[R]=(v[R+1]<<1|1)&W,G&&(v[R]|=(I[R+1]|I[R])<<1|1|I[R+1]),v[R]&ee&&(U=A(G,D),U<=p)){if(p=U,b=D,b<=f)break;_=Math.max(1,2*f-b)}}if(A(G+1,f)>p)break;I=v}const F={isMatch:b>=0,score:Math.max(.001,U)};if(T){const G=p3(E,o);G.length?u&&(F.indices=G):F.isMatch=!1}return F}function g3(t){const e={};for(let n=0,r=t.length;n<r;n+=1){const s=t.charAt(n);e[s]=(e[s]||0)|1<<r-n-1}return e}function mh(t){if(t.length<=1)return t;t.sort((n,r)=>n[0]-r[0]||n[1]-r[1]);const e=[t[0]];for(let n=1,r=t.length;n<r;n+=1){const s=e[e.length-1],a=t[n];a[0]<=s[1]+1?s[1]=Math.max(s[1],a[1]):e.push(a)}return e}const Rg={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},b3=new RegExp("["+Object.keys(Rg).join("")+"]","g"),$o=String.prototype.normalize?t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(b3,e=>Rg[e]):t=>t;class gh{constructor(e,{location:n=Be.location,threshold:r=Be.threshold,distance:s=Be.distance,includeMatches:a=Be.includeMatches,findAllMatches:i=Be.findAllMatches,minMatchCharLength:o=Be.minMatchCharLength,isCaseSensitive:u=Be.isCaseSensitive,ignoreDiacritics:d=Be.ignoreDiacritics,ignoreLocation:h=Be.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:u,ignoreDiacritics:d,ignoreLocation:h},e=u?e:e.toLowerCase(),e=d?$o(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const g=(p,b)=>{this.chunks.push({pattern:p,alphabet:g3(p),startIndex:b})},f=this.pattern.length;if(f>ba){let p=0;const b=f%ba,A=f-b;for(;p<A;)g(this.pattern.substr(p,ba),p),p+=ba;if(b){const T=f-ba;g(this.pattern.substr(T),T)}}else g(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s}=this.options;if(e=n?e:e.toLowerCase(),e=r?$o(e):e,this.pattern===e){const A={isMatch:!0,score:0};return s&&(A.indices=[[0,e.length-1]]),A}const{location:a,distance:i,threshold:o,findAllMatches:u,minMatchCharLength:d,ignoreLocation:h}=this.options,g=[];let f=0,p=!1;this.chunks.forEach(({pattern:A,alphabet:T,startIndex:E})=>{const{isMatch:x,score:I,indices:U}=m3(e,A,T,{location:a+E,distance:i,threshold:o,findAllMatches:u,minMatchCharLength:d,includeMatches:s,ignoreLocation:h});x&&(p=!0),f+=I,x&&U&&g.push(...U)});const b={isMatch:p,score:p?f/this.chunks.length:1};return p&&s&&(b.indices=mh(g)),b}}class na{constructor(e){this.pattern=e}static isMultiMatch(e){return tp(e,this.multiRegex)}static isSingleMatch(e){return tp(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function tp(t,e){const n=t.match(e);return n?n[1]:null}class v3 extends na{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const n=e===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class E3 extends na{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const r=e.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class T3 extends na{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const n=e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class _3 extends na{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const n=!e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class A3 extends na{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const n=e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class y3 extends na{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const n=!e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class Dg extends na{constructor(e,{location:n=Be.location,threshold:r=Be.threshold,distance:s=Be.distance,includeMatches:a=Be.includeMatches,findAllMatches:i=Be.findAllMatches,minMatchCharLength:o=Be.minMatchCharLength,isCaseSensitive:u=Be.isCaseSensitive,ignoreDiacritics:d=Be.ignoreDiacritics,ignoreLocation:h=Be.ignoreLocation}={}){super(e),this._bitapSearch=new gh(e,{location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:u,ignoreDiacritics:d,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class kg extends na{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let n=0,r;const s=[],a=this.pattern.length;for(;(r=e.indexOf(this.pattern,n))>-1;)n=r+a,s.push([r,n-1]);const i=!!s.length;return{isMatch:i,score:i?0:1,indices:s}}}const Ud=[v3,kg,T3,_3,y3,A3,E3,Dg],np=Ud.length,N3="\0",S3="|";function w3(t){const e=[],n=t.length;let r=0;for(;r<n;){for(;r<n&&t[r]===" ";)r++;if(r>=n)break;let s=r;for(;s<n&&t[s]!==" "&&t[s]!=='"';)s++;if(s<n&&t[s]==='"'){for(s++;s<n;){if(t[s]==='"'){const a=s+1;if(a>=n||t[a]===" "){s++;break}if(t[a]==="$"&&(a+1>=n||t[a+1]===" ")){s+=2;break}}s++}e.push(t.substring(r,s)),r=s}else{for(;s<n&&t[s]!==" ";)s++;e.push(t.substring(r,s)),r=s}}return e}function I3(t,e={}){return t.replace(/\\\|/g,N3).split(S3).map(r=>{const s=r.replace(/\u0000/g,"|"),a=w3(s.trim()).filter(o=>o&&!!o.trim()),i=[];for(let o=0,u=a.length;o<u;o+=1){const d=a[o];let h=!1,g=-1;for(;!h&&++g<np;){const f=Ud[g],p=f.isMultiMatch(d);p&&(i.push(new f(p,e)),h=!0)}if(!h)for(g=-1;++g<np;){const f=Ud[g],p=f.isSingleMatch(d);if(p){i.push(new f(p,e));break}}}return i})}const C3=new Set([Dg.type,kg.type]);class L3{constructor(e,{isCaseSensitive:n=Be.isCaseSensitive,ignoreDiacritics:r=Be.ignoreDiacritics,includeMatches:s=Be.includeMatches,minMatchCharLength:a=Be.minMatchCharLength,ignoreLocation:i=Be.ignoreLocation,findAllMatches:o=Be.findAllMatches,location:u=Be.location,threshold:d=Be.threshold,distance:h=Be.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s,minMatchCharLength:a,findAllMatches:o,ignoreLocation:i,location:u,threshold:d,distance:h},e=n?e:e.toLowerCase(),e=r?$o(e):e,this.pattern=e,this.query=I3(this.pattern,this.options)}static condition(e,n){return n.useExtendedSearch}searchIn(e){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:s,ignoreDiacritics:a}=this.options;e=s?e:e.toLowerCase(),e=a?$o(e):e;let i=0;const o=[];let u=0,d=!1;for(let h=0,g=n.length;h<g;h+=1){const f=n[h];o.length=0,i=0,d=!1;for(let p=0,b=f.length;p<b;p+=1){const A=f[p],{isMatch:T,indices:E,score:x}=A.search(e);if(T){i+=1,u+=x;const I=A.constructor.type;I.startsWith("inverse")&&(d=!0),r&&(C3.has(I)?o.push(...E):o.push(E))}else{u=0,i=0,o.length=0,d=!1;break}}if(i){const p={isMatch:!0,score:u/i};return d&&(p.hasInverse=!0),r&&(p.indices=mh(o)),p}}return{isMatch:!1,score:1}}}const Hd=[];function bh(...t){Hd.push(...t)}function Nl(t,e){for(let n=0,r=Hd.length;n<r;n+=1){const s=Hd[n];if(s.condition(t,e))return new s(t,e)}return new gh(t,e)}const Sl={AND:"$and",OR:"$or"},qd={PATH:"$path",PATTERN:"$val"},jd=t=>!!(t[Sl.AND]||t[Sl.OR]),O3=t=>!!t[qd.PATH],x3=t=>!ta(t)&&Cg(t)&&!jd(t),rp=t=>({[Sl.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function Pg(t,e,{auto:n=!0}={}){const r=s=>{if(Cn(s)){const u={keyId:null,pattern:s};return n&&(u.searcher=Nl(s,e)),u}const a=Object.keys(s),i=O3(s);if(!i&&a.length>1&&!jd(s))return r(rp(s));if(x3(s)){const u=i?s[qd.PATH]:a[0],d=i?s[qd.PATTERN]:s[u];if(!Cn(d))throw new Error(t3(u));const h={keyId:Fd(u),pattern:d};return n&&(h.searcher=Nl(d,e)),h}const o={children:[],operator:a[0]};return a.forEach(u=>{const d=s[u];ta(d)&&d.forEach(h=>{o.children.push(r(h))})}),o};return jd(t)||(t=rp(t)),r(t)}function $d(t,{ignoreFieldNorm:e=Be.ignoreFieldNorm}){let n=1;return t.forEach(({key:r,norm:s,score:a})=>{const i=r?r.weight:null;n*=Math.pow(a===0&&i?Number.EPSILON:a,(i||1)*(e?1:s))}),n}function R3(t,{ignoreFieldNorm:e=Be.ignoreFieldNorm}){t.forEach(n=>{n.score=$d(n.matches,{ignoreFieldNorm:e})})}class D3{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){const n=this.heap;for(;e>0;){const r=e-1>>1;if(n[e].score<=n[r].score)break;const s=n[e];n[e]=n[r],n[r]=s,e=r}}_sinkDown(e){const n=this.heap,r=n.length;let s=e;do{e=s;const a=2*e+1,i=2*e+2;if(a<r&&n[a].score>n[s].score&&(s=a),i<r&&n[i].score>n[s].score&&(s=i),s!==e){const o=n[e];n[e]=n[s],n[s]=o}}while(s!==e)}}function k3(t,e){const n=t.matches;e.matches=[],Pn(n)&&n.forEach(r=>{if(!Pn(r.indices)||!r.indices.length)return;const{indices:s,value:a}=r,i={indices:s,value:a};r.key&&(i.key=r.key.src),r.idx>-1&&(i.refIndex=r.idx),e.matches.push(i)})}function P3(t,e){e.score=t.score}function M3(t,e,{includeMatches:n=Be.includeMatches,includeScore:r=Be.includeScore}={}){const s=[];return n&&s.push(k3),r&&s.push(P3),t.map(a=>{const{idx:i}=a,o={item:e[i],refIndex:i};return s.length&&s.forEach(u=>{u(a,o)}),o})}const B3=/\b\w+\b/g;function Yd({isCaseSensitive:t=!1,ignoreDiacritics:e=!1}={}){return{tokenize(n){return t||(n=n.toLowerCase()),e&&(n=$o(n)),n.match(B3)||[]}}}function F3(t,e,n){const r=new Map,s=new Map;let a=0;function i(o,u,d,h){const g=n.tokenize(o);if(!g.length)return;a++;const f=new Map;for(const p of g)f.set(p,(f.get(p)||0)+1);for(const[p,b]of f){const A={docIdx:u,keyIdx:d,subIdx:h,tf:b};let T=r.get(p);T||(T=[],r.set(p,T)),T.push(A),s.set(p,(s.get(p)||0)+1)}}for(const o of t){const{i:u,v:d,$:h}=o;if(d!==void 0){i(d,u,-1,-1);continue}if(h)for(let g=0;g<e;g++){const f=h[g];if(f)if(Array.isArray(f))for(const p of f)i(p.v,u,g,p.i??-1);else i(f.v,u,g,-1)}}return{terms:r,fieldCount:a,df:s}}function U3(t,e,n,r){const{i:s,v:a,$:i}=e;function o(u,d,h){const g=r.tokenize(u);if(!g.length)return;t.fieldCount++;const f=new Map;for(const p of g)f.set(p,(f.get(p)||0)+1);for(const[p,b]of f){const A={docIdx:s,keyIdx:d,subIdx:h,tf:b};let T=t.terms.get(p);T||(T=[],t.terms.set(p,T)),T.push(A),t.df.set(p,(t.df.get(p)||0)+1)}}if(a!==void 0){o(a,-1,-1);return}if(i)for(let u=0;u<n;u++){const d=i[u];if(d)if(Array.isArray(d))for(const h of d)o(h.v,u,h.i??-1);else o(d.v,u,-1)}}function sp(t,e){for(const[n,r]of t.terms){const s=r.filter(i=>i.docIdx!==e),a=r.length-s.length;a>0&&(t.fieldCount-=a,t.df.set(n,(t.df.get(n)||0)-a),s.length===0?(t.terms.delete(n),t.df.delete(n)):t.terms.set(n,s))}}class ra{constructor(e,n,r){this.options={...Be,...n},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new a3(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,r),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const n=this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options,r=Nl(e,n);return this._lastQuery=e,this._lastSearcher=r,r}setCollection(e,n){if(this._docs=e,n&&!(n instanceof ph))throw new Error(e3);if(this._myIndex=n||xg(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const r=Yd({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=F3(this._myIndex.records,this._myIndex.keys.length,r)}}add(e){if(Pn(e)&&(this._docs.push(e),this._myIndex.add(e),this._invertedIndex)){const n=this._myIndex.records[this._myIndex.records.length-1],r=Yd({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});U3(this._invertedIndex,n,this._myIndex.keys.length,r)}}remove(e=()=>!1){const n=[],r=[];for(let s=0,a=this._docs.length;s<a;s+=1)e(this._docs[s],s)&&(n.push(this._docs[s]),r.push(s));if(r.length){if(this._invertedIndex)for(const s of r)sp(this._invertedIndex,s);for(let s=r.length-1;s>=0;s-=1)this._docs.splice(r[s],1);this._myIndex.removeAll(r)}return n}removeAt(e){this._invertedIndex&&sp(this._invertedIndex,e);const n=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),n}getIndex(){return this._myIndex}search(e,n){const{limit:r=-1}=n||{},{includeMatches:s,includeScore:a,shouldSort:i,sortFn:o,ignoreFieldNorm:u}=this.options;if(Cn(e)&&!e.trim()){let g=this._docs.map((f,p)=>({item:f,refIndex:p}));return al(r)&&r>-1&&(g=g.slice(0,r)),g}const d=al(r)&&r>0&&Cn(e);let h;if(d){const g=new D3(r);Cn(this._docs[0])?this._searchStringList(e,{heap:g,ignoreFieldNorm:u}):this._searchObjectList(e,{heap:g,ignoreFieldNorm:u}),h=g.extractSorted(o)}else h=Cn(e)?Cn(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),R3(h,{ignoreFieldNorm:u}),i&&h.sort(o),al(r)&&r>-1&&(h=h.slice(0,r));return M3(h,this._docs,{includeMatches:s,includeScore:a})}_searchStringList(e,{heap:n,ignoreFieldNorm:r}={}){const s=this._getSearcher(e),{records:a}=this._myIndex,i=n?null:[];return a.forEach(({v:o,i:u,n:d})=>{if(!Pn(o))return;const{isMatch:h,score:g,indices:f}=s.searchIn(o);if(h){const p={item:o,idx:u,matches:[{score:g,value:o,norm:d,indices:f}]};n?(p.score=$d(p.matches,{ignoreFieldNorm:r}),n.shouldInsert(p.score)&&n.insert(p)):i.push(p)}}),i}_searchLogical(e){const n=Pg(e,this.options),r=(o,u,d)=>{if(!("children"in o)){const{keyId:p,searcher:b}=o;let A;return p===null?(A=[],this._myIndex.keys.forEach((T,E)=>{A.push(...this._findMatches({key:T,value:u[E],searcher:b}))})):A=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(u,p),searcher:b}),A&&A.length?[{idx:d,item:u,matches:A}]:[]}const{children:h,operator:g}=o,f=[];for(let p=0,b=h.length;p<b;p+=1){const A=h[p],T=r(A,u,d);if(T.length)f.push(...T);else if(g===Sl.AND)return[]}return f},s=this._myIndex.records,a=new Map,i=[];return s.forEach(({$:o,i:u})=>{if(Pn(o)){const d=r(n,o,u);d.length&&(a.has(u)||(a.set(u,{idx:u,item:o,matches:[]}),i.push(a.get(u))),d.forEach(({matches:h})=>{a.get(u).matches.push(...h)}))}}),i}_searchObjectList(e,{heap:n,ignoreFieldNorm:r}={}){const s=this._getSearcher(e),{keys:a,records:i}=this._myIndex,o=n?null:[];return i.forEach(({$:u,i:d})=>{if(!Pn(u))return;const h=[];let g=!1,f=!1;if(a.forEach((p,b)=>{const A=this._findMatches({key:p,value:u[b],searcher:s});A.length?(h.push(...A),A[0].hasInverse&&(f=!0)):g=!0}),!(f&&g)&&h.length){const p={idx:d,item:u,matches:h};n?(p.score=$d(p.matches,{ignoreFieldNorm:r}),n.shouldInsert(p.score)&&n.insert(p)):o.push(p)}}),o}_findMatches({key:e,value:n,searcher:r}){if(!Pn(n))return[];const s=[];if(ta(n))n.forEach(({v:a,i,n:o})=>{if(!Pn(a))return;const{isMatch:u,score:d,indices:h,hasInverse:g}=r.searchIn(a);u&&s.push({score:d,key:e,value:a,idx:i,norm:o,indices:h,hasInverse:g})});else{const{v:a,n:i}=n,{isMatch:o,score:u,indices:d,hasInverse:h}=r.searchIn(a);o&&s.push({score:u,key:e,value:a,norm:i,indices:d,hasInverse:h})}return s}}class H3{static condition(e,n){return n.useTokenSearch}constructor(e,n){this.options=n,this.analyzer=Yd({isCaseSensitive:n.isCaseSensitive,ignoreDiacritics:n.ignoreDiacritics});const r=this.analyzer.tokenize(e),s=n._invertedIndex,{df:a,fieldCount:i}=s;this.termSearchers=[],this.idfWeights=[];for(const o of r){this.termSearchers.push(new gh(o,{location:n.location,threshold:n.threshold,distance:n.distance,includeMatches:n.includeMatches,findAllMatches:n.findAllMatches,minMatchCharLength:n.minMatchCharLength,isCaseSensitive:n.isCaseSensitive,ignoreDiacritics:n.ignoreDiacritics,ignoreLocation:!0}));const u=a.get(o)||0,d=Math.log(1+(i-u+.5)/(u+.5));this.idfWeights.push(d)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const n=[];let r=0,s=0,a=0;for(let u=0;u<this.termSearchers.length;u++){const d=this.termSearchers[u].searchIn(e),h=this.idfWeights[u];s+=h,d.isMatch&&(a++,r+=h*(1-d.score),d.indices&&n.push(...d.indices))}if(a===0)return{isMatch:!1,score:1};const i=s>0?1-r/s:0,o={isMatch:!0,score:Math.max(.001,i)};return this.options.includeMatches&&n.length&&(o.indices=mh(n)),o}}ra.version="7.3.0";ra.createIndex=xg;ra.parseIndex=h3;ra.config=Be;ra.match=function(t,e,n){return Nl(t,{...Be,...n}).searchIn(e)};ra.parseQuery=Pg;bh(L3);bh(H3);ra.use=function(...t){t.forEach(e=>bh(e))};function q3(t,e,n=30){const r=e.trim().toLowerCase();if(r==="")return[];const s=[],a=new Set,i=u=>{a.has(u.path)||(a.add(u.path),s.push(u))};for(const u of t)u.title.toLowerCase()===r&&i(u);for(const u of t)u.title.toLowerCase().startsWith(r)&&i(u);for(const u of t)u.title.toLowerCase().includes(r)&&i(u);const o=new ra(t,{keys:["title"],threshold:.4,ignoreLocation:!0});for(const u of o.search(e))i(u.item);return s.slice(0,n)}const j3=new Set(["jpg","jpeg","png","webp","avif","gif","svg"]);function Mg(t){const e=t.lastIndexOf(".");return e>0?t.slice(e+1).toLowerCase():""}function Bg(...t){return t.filter(e=>e!=="").join("/")}function $3(t){return j3.has(Mg(t))}function Y3(t){return Bg(tt.content,t,"assets")}function ji(t,e){return Bg(tt.content,t,e)}function ec(t,e){return Fg(ji(t,e))}function Fg(t){return Pa(`/api/read?path=${encodeURIComponent(t)}`)}function Ug(t){return`assets/${t}`}function Hg(t){const e=t.lastIndexOf("."),n=e>0?t.slice(0,e):t,r=Mg(t),s=bs(n)||"image";return r===""?s:`${s}.${r}`}class z3{async list(e){return await(await Ke(`/api/list?dir=${encodeURIComponent(e)}`)).json()}async readText(e){const n=await Ke(`/api/read?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Not found: ${e}`);return n.text()}async readBytes(e){const n=await Ke(`/api/read?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Not found: ${e}`);return new Uint8Array(await n.arrayBuffer())}async exists(e){return(await(await Ke(`/api/exists?path=${encodeURIComponent(e)}`)).json()).exists}}function il(t){const e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function ap(t,e){const n=t.lastIndexOf("/");return n===-1?e:`${t.slice(0,n+1)}${e}`}let Fc=J(0);const vh={get value(){return l(Fc)},bump(){y(Fc,l(Fc)+1)}};function W3(t){return{image:()=>{},file:e=>G3(e)?ec(t,e):void 0}}function G3(t){return t.startsWith("assets/")}async function zd(t,e){const n=new Map,r=async a=>(n.has(a)||n.set(a,await e(a)),n.get(a)),s=await V3(t,r);return Q3(s,r)}function Eh(t){return t.startsWith("/")&&!t.startsWith("//")}function qg(t){return`data:${t.contentType};base64,${K3(t.bytes)}`}function K3(t){let e="";for(let r=0;r<t.length;r+=32768)e+=String.fromCharCode(...t.subarray(r,r+32768));return btoa(e)}async function V3(t,e){var a;const n=new Set([...t.matchAll(/<link\b[^>]*>/gi)].map(i=>i[0])),r=new Map;for(const i of n){const o=(a=i.match(/\bhref="([^"]*)"/i))==null?void 0:a[1];if(o===void 0||!Eh(o))continue;const u=await e(o);if(u!==void 0)if(/\brel="[^"]*stylesheet[^"]*"/i.test(i)){const d=new TextDecoder().decode(u.bytes);r.set(i,`<style>
11
+ ${await X3(d,e)}
12
+ </style>`)}else r.set(i,i.replace(/(\bhref=")[^"]*"/i,`$1${qg(u)}"`))}let s=t;for(const[i,o]of r)s=s.split(i).join(o);return s}async function X3(t,e){const n=new Set;for(const s of t.matchAll(/url\(\s*['"]?([^)'"]*)['"]?\s*\)/gi))Eh(s[1])&&n.add(s[1]);const r=await $g(n,e);return jg(t,r)}async function Q3(t,e){const n=new Set,r=o=>{o!==void 0&&Eh(o)&&n.add(o)};for(const o of t.matchAll(/\s(?:src|poster)="([^"]*)"/g))r(o[1]);for(const o of t.matchAll(/\ssrcset="([^"]*)"/g))for(const u of ip(o[1]))r(u.url);for(const o of t.matchAll(/url\(\s*['"]?([^)'"]*)['"]?\s*\)/gi))r(o[1]);const s=await $g(n,e),a=o=>s.get(o)??o,i=t.replace(/(\s(?:src|poster)=")([^"]*)"/g,(o,u,d)=>s.has(d)?`${u}${a(d)}"`:o).replace(/(\ssrcset=")([^"]*)"/g,(o,u,d)=>{const h=ip(d).map(({url:g,descriptor:f})=>[a(g),f].filter(p=>p!=="").join(" ")).join(", ");return`${u}${h}"`});return jg(i,s)}function jg(t,e){return t.replace(/url\(\s*(['"]?)([^)'"]*)\1\s*\)/gi,(n,r,s)=>e.has(s)?`url(${r}${e.get(s)}${r})`:n)}async function $g(t,e){const n=new Map;return await Promise.all([...t].map(async r=>{const s=await e(r);s!==void 0&&n.set(r,qg(s))})),n}function ip(t){return t.split(",").map(e=>e.trim()).filter(e=>e!=="").map(e=>{const[n,...r]=e.split(/\s+/);return{url:n??"",descriptor:r.join(" ")}})}const Z3=`<svg xmlns='http://www.w3.org/2000/svg' width='800' height='450' viewBox='0 0 800 450' role='img' aria-label='Image placeholder'>
13
+ <rect width='800' height='450' fill='#e2e8f0'/>
14
+ <path d='M0 0 800 450 M800 0 0 450' stroke='#cbd5e1' stroke-width='2'/>
15
+ <rect x='300' y='150' width='200' height='130' rx='10' fill='#cbd5e1'/>
16
+ <circle cx='350' cy='195' r='18' fill='#94a3b8'/>
17
+ <path d='M308 280 380 210 432 258 470 228 492 280Z' fill='#94a3b8'/>
18
+ <text x='400' y='330' font-family='system-ui, sans-serif' font-size='24' fill='#64748b' text-anchor='middle'>image</text>
19
+ </svg>`,Yg=`data:image/svg+xml,${encodeURIComponent(Z3)}`;function J3(t){switch(t.type){case"image":return Yg;case"file":case"url":return"#";case"email":return"name@example.com";case"phone":return"+1 555-0100";case"date":return"2026-01-01";case"time":return"09:00";case"code":return`// ${t.label}`;case"richtext":return`<p>${t.label}, sample rich text. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>`;case"authors":return[{name:"Ada Lovelace"},{name:"Alan Turing"}];case"text":return`${t.label}, sample paragraph text. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.`;case"shorttext":default:return t.label}}function eN(t){const e={};for(const n of t)n.multiple!==!0&&(e[n.name]=J3(n));return e}function tN(t,e){if(e===void 0)return t;const n={...t};for(const[r,s]of Object.entries(e))s!==""&&(n[r]=s);return n}function nN(t,e){const n={};if(e===void 0)return n;for(const r of t){if(r.multiple!==!0)continue;const s=e[r.name];if(s===void 0||s.trim()==="")continue;const a=s.split(/[\n,]+/).map(i=>i.trim()).filter(i=>i!=="");a.length>0&&(n[r.name]=a)}return n}function rN(t){return t.startsWith(`${tt.components}/`)}function sN(t){const e=t.replace(/\.html$/,""),n=e.lastIndexOf("/");return(n===-1?e:e.slice(n+1)).toLowerCase()}const zg={htmlAttrs:"",headStyles:""};function aN(t){var s,a,i;if(t===void 0||t.trim()==="")return zg;const e=((a=(s=t.match(/<html\b([^>]*)>/i))==null?void 0:s[1])==null?void 0:a.trim())??"",n=((i=t.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i))==null?void 0:i[1])??"",r=[];for(const o of n.matchAll(/<link\b[^>]*>/gi))/\brel=(["'])[^"']*stylesheet[^"']*\1/i.test(o[0])&&r.push(o[0]);for(const o of n.matchAll(/<style\b[^>]*>[\s\S]*?<\/style>/gi))r.push(o[0]);return{htmlAttrs:e,headStyles:r.join(`
20
+ `)}}function Wg(t){const e=t.htmlAttrs.trim()===""?'lang="en"':t.htmlAttrs.trim(),n=t.headStyles.trim()===""?"":`
21
+ ${t.headStyles}`;return`<!doctype html>
22
+ <html ${e}>
23
+ <head>
24
+ <meta charset="utf-8" />
25
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
26
+ <title>${t.title}</title>
27
+ <style>body { margin: 16px; font-family: system-ui, sans-serif; }</style>${n}
28
+ </head>
29
+ <body>
30
+ ${t.body}
31
+ </body>
32
+ </html>`}function iN(t,e,n=zg){const r=e.filter(a=>a.multiple!==!0).map(a=>`${a.name}="{${a.name}}"`).join(" "),s=r===""?`<${t}>`:`<${t} ${r}>`;return Wg({htmlAttrs:n.htmlAttrs,headStyles:n.headStyles,title:`${t} preview`,body:`${s}Sample slot content</${t}>`})}function op(){return{image:()=>{},file:t=>uN(t)?Yg:void 0}}const oN=/\.(?:apng|avif|gif|jpe?g|png|svg|webp)$/i;function uN(t){return t===""||t.startsWith("/")||t.startsWith("data:")||/^[a-z][a-z0-9+.-]*:/i.test(t)?!1:oN.test(t)}const nt=new z3,Wd=new Map;let Gd,Kd,Vd,wl,Xd;function Th(){return Xd??(Xd=Jf(nt)),Xd}async function Qd(){const t=[],e=n=>{for(const r of n.children)r.kind==="dir"&&(t.push(r.path),e(r))};return e(await Th()),t.sort()}async function lN(){const t=await Ke("/api/authors");return t.ok?await t.json():[]}function Ji(){Xd=void 0,vh.bump()}const up=".json",_h="_sort.json",cN="assets",dN=new Set([_h,"_redirects.json","_site.json"]);function Zd(t,e){return t===""?e:`${t}/${e}`}function Ah(t){return t===""?tt.content:`${tt.content}/${t}`}async function yh(t){try{return P1(JSON.parse(await nt.readText(`${t}/${_h}`)))}catch{return{order:[]}}}function fN(t,e){const n=[],r=new Set;for(const s of e){const a=t.get(s);a!==void 0&&(n.push(a),r.add(s))}for(const[s,a]of t)r.has(s)||n.push(a);return n}async function hN(t){try{const{title:e}=zl(JSON.parse(await nt.readText(t)));return e===""?void 0:e}catch{return}}async function Jd(t){return t===""?"Home":(await yh(Ah(t))).name??Zf(il(t))}async function pN(t){return await hN($s(Zd(t,"index")))??await Jd(t)}async function Gg(t){const e=Ah(t),[n,r]=await Promise.all([nt.list(e),yh(e)]),s=new Map;for(const a of n)if(a.kind==="file"){if(dN.has(a.name)||!a.name.endsWith(up))continue;const i=a.name.slice(0,-up.length);try{const o=zl(JSON.parse(await nt.readText(`${e}/${a.name}`)));s.set(i,{kind:"item",slug:i,path:Zd(t,i),title:o.title,isPublished:o.isPublished,template:o.template})}catch{}}else if(a.name!==cN){const i=Zd(t,a.name);s.set(a.name,{kind:"dir",slug:a.name,path:i,name:await pN(i)})}return{entries:fN(s,r.order),defaultTemplate:r.defaultTemplate}}function mN(t){const e=[],n=(r,s)=>{const a=r.defaultTemplate??s;for(const i of r.children)i.kind==="item"?e.push({path:i.path,title:i.item.title,isPublished:i.item.isPublished,template:i.item.template??a}):n(i,a)};return n(t,void 0),e}async function Kg(t,e=30){return t.trim()===""?[]:q3(mN(await Th()),t,e)}async function gN(t,e){if(e!==void 0&&e!=="")return e;let n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"";for(;;){const r=await yh(Ah(n));if(r.defaultTemplate!==void 0&&r.defaultTemplate!=="")return r.defaultTemplate;if(n==="")break;n=n.includes("/")?n.slice(0,n.lastIndexOf("/")):""}}async function bN(t){const e=Wd.get(t);if(e!==void 0)return e;const n=await El(nt,t);return Wd.set(t,n),n}function hu(){return Gd??(Gd=eh(nt)),Gd}function vN(){return Kd??(Kd=F1(nt)),Kd}function EN(){return Vd??(Vd=U1(nt)),Vd}async function TN(t){const[e,n]=await Promise.all([bN(t),hu()]);return Es(e,n)}function Vg(){return wl??(wl=nh(nt)),wl}async function _N(){const[t,e]=await Promise.all([Vg(),hu()]);return t===void 0?[]:Es(t,e).filter(n=>n.name!=="title")}const ef=`${tt.templates}/${du}.html`;function oD(){return nt.exists(ef)}const AN=`<!doctype html>
33
+ <html lang="en">
34
+ <head>
35
+ <meta charset="utf-8" />
36
+ <meta name="viewport" content="width=device-width, initial-scale=1" />
37
+ <title>{title}</title>
38
+ <link rel="stylesheet" href="/styles.css" />
39
+ </head>
40
+ <body>
41
+ <slot></slot>
42
+ </body>
43
+ </html>
44
+ `;async function uD(){if(await nt.exists(ef))return;const t=await Ke(`/api/write?path=${encodeURIComponent(ef)}`,{method:"POST",body:AN});if(!t.ok)throw new Error(`Create document shell failed (${t.status})`);wl=void 0}async function lD(){const t=await hu();return[...t.entries()].map(([e,n])=>({tag:e,props:Es(n,t).map(r=>r.name)}))}async function lp(t){const e=await nt.readText(`${tt.content}/${t}.json`);return zl(JSON.parse(e))}async function Xg(t,e){const n=`${tt.content}/${t}.json`,r=await Ke(`/api/write?path=${encodeURIComponent(n)}`,{method:"POST",headers:{"content-type":"application/json"},body:e});if(!r.ok)throw new Error(`Save failed (${r.status})`);Ji()}function yN(){return xy(nt)}async function NN(){const t=await Ke("/api/publish",{method:"POST"});if(t.status===404)throw new Error("Publishing runs on the host, start it with `npm run example:azure`.");const e=await t.json().catch(()=>({}));if(t.ok)return{ok:!0,written:e.written??0,...e.summary!==void 0&&{summary:e.summary}};if(t.status===422)return{ok:!1,errors:e.errors??["Validation failed."],...e.summary!==void 0&&{summary:e.summary}};throw new Error(`Publish failed (${t.status})`)}async function SN(){const t=await Ke("/api/scaffold",{method:"POST"});if(t.status===404)throw new Error("Scaffolding runs on the host, start it with `npm run example:azure`.");const e=await t.json().catch(()=>({}));if(t.ok)return{created:e.created??[],skipped:e.skipped??[]};throw t.status===409?new Error("This site already has content, scaffolding is only for an empty site."):t.status===403?new Error("Only an admin can scaffold a starter site."):new Error(e.error??`Scaffold failed (${t.status})`)}async function cp(t,e){const n=await nt.readText(`${tt.content}/${t}.json`),r=JSON.parse(n);e===""?delete r.template:r.template=e,await Xg(t,`${JSON.stringify(r,null,2)}
45
+ `)}async function wN(t,e){return(await nt.list(Y3(t))).filter(r=>r.kind==="file"&&e(r.name)).map(r=>r.name).sort()}function IN(t){return wN(t,e=>!$3(e))}async function Nh(t,e){const n=Hg(e.name),r=Ug(n),s=await Ke(`/api/write?path=${encodeURIComponent(ji(t,r))}`,{method:"POST",body:await e.arrayBuffer()});if(!s.ok)throw new Error(`Upload failed (${s.status})`);return r}async function CN(t,e){try{await Il(ji(t,e))}catch{}}async function tf(t){const e=[],n=async(r,s)=>{for(const a of await nt.list(r)){const i=s===""?a.name:`${s}/${a.name}`;a.kind==="dir"?await n(`${r}/${a.name}`,i):a.name.endsWith(".html")&&e.push(i.slice(0,-5))}};return await n(t,""),e.sort()}async function LN(){const t=[],e=async(n,r)=>{for(const s of await nt.list(n)){const a=r===""?s.name:`${r}/${s.name}`;s.kind==="dir"?await e(`${n}/${s.name}`,a):t.push(a)}};return await e(tt.public,""),t.sort()}const ON=["templates","components","public"],Qg=".gitkeep";function Zg(t){const e=t.split("/")[0];return e==="templates"||e==="components"}async function Sh(t){const e=Zg(t),n=[],r=[];for(const s of await nt.list(t)){const a=`${t}/${s.name}`;if(s.kind==="dir")n.push({kind:"dir",name:s.name,path:a});else{if(s.name===Qg)continue;if(e){if(t===tt.templates&&s.name===`${du}.html`)continue;s.name.endsWith(".html")&&r.push({kind:"file",name:s.name.slice(0,-5),path:a})}else r.push({kind:"file",name:s.name,path:a})}}return n.sort((s,a)=>s.name.localeCompare(a.name)),r.sort((s,a)=>s.name.localeCompare(a.name)),[...n,...r]}async function cD(t){const e=[t],n=async r=>{for(const s of await Sh(r))s.kind==="dir"&&(e.push(s.path),await n(s.path))};return await n(t),e}async function dD(t,e){const n=e.split("/").map(i=>bs(i)).filter(i=>i!=="").join("/");if(n==="")throw new Error("A folder name is required.");const r=`${t}/${n}`,s=`${r}/${Qg}`;if(await nt.exists(s))throw new Error(`"${r}" already exists.`);const a=await Ke(`/api/write?path=${encodeURIComponent(s)}`,{method:"POST",body:""});if(!a.ok)throw new Error(`Create folder failed (${a.status})`);return r}async function fD(t,e){const n=t.slice(t.lastIndexOf("/")+1),r=`${e}/${n}`;return r===t?t:(await(Zg(t)?WN(t,r):$a(t,r)),r)}async function hD(t,e){const n=t.slice(t.lastIndexOf("/")+1),r=`${e}/${n}`;if(e===t||e.startsWith(`${t}/`))throw new Error("Cannot move a folder into itself.");return r===t?t:(await $a(t,r),r)}function xN(t,e){const n=t.slice(t.lastIndexOf("/")+1);return n===e?4:n.startsWith(e)?3:n.includes(e)?2:t.includes(e)?1:0}async function pD(t){const e=t.trim().toLowerCase();if(e==="")return[];const[n,r,s]=await Promise.all([tf("templates"),tf("components"),LN()]);return[...n.map(i=>({label:i,path:`templates/${i}.html`,root:"templates"})),...r.map(i=>({label:i,path:`components/${i}.html`,root:"components"})),...s.map(i=>({label:i,path:`public/${i}`,root:"public"}))].map(i=>({hit:i,score:xN(i.label.toLowerCase(),e)})).filter(i=>i.score>0).sort((i,o)=>o.score-i.score||i.hit.label.localeCompare(o.hit.label)).slice(0,30).map(i=>i.hit)}function mD(t){return nt.readText(t)}async function RN(t){const e=await Ke(`/api/read?path=${encodeURIComponent(t)}`);if(!e.ok)throw new Error(`Not found: ${t}`);return URL.createObjectURL(await e.blob())}async function DN(t,e){return RN(ji(t,e))}async function gD(t){if(await nt.exists(t))throw new Error(`"${t}" already exists.`);const e=await Ke(`/api/write?path=${encodeURIComponent(t)}`,{method:"POST",body:""});if(!e.ok)throw new Error(`Create failed (${e.status})`)}async function bD(t,e){const n=`${t}/${Hg(e.name)}`;if(await nt.exists(n))throw new Error(`"${n}" already exists.`);const r=await Ke(`/api/write?path=${encodeURIComponent(n)}`,{method:"POST",body:await e.arrayBuffer()});if(!r.ok)throw new Error(`Upload failed (${r.status})`);return n}async function Jg(t,e,n){const r=`${tt.content}/${t}.json`;if(await nt.exists(r))throw new Error(`"${t}" already exists.`);const s={title:e,isPublished:!1};n!==void 0&&n!==""&&(s.template=n),s.fields={};const a=await Ke(`/api/write?path=${encodeURIComponent(r)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(s,null,2)}
46
+ `});if(!a.ok)throw new Error(`Create failed (${a.status})`);Ji()}function kN(t){return nt.exists(`${tt.content}/${t}.json`)}async function PN(t,e){const n=e.split("/").map(u=>({raw:u.trim(),slug:bs(u)})).filter(u=>u.slug!==""),r=n.at(-1);if(r===void 0)throw new Error("A folder name is required.");const s=n.map(u=>u.slug).join("/"),a=t===""?s:`${t}/${s}`,i=`${tt.content}/${a}/${_h}`;if(await nt.exists(i))throw new Error(`"${a}" already exists.`);const o=await Ke(`/api/write?path=${encodeURIComponent(i)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify({name:r.raw},null,2)}
47
+ `});if(!o.ok)throw new Error(`Create folder failed (${o.status})`);return Ji(),a}function wh(t){return t===""?`${tt.content}/_sort.json`:`${tt.content}/${t}/_sort.json`}async function Ih(t){try{const e=JSON.parse(await nt.readText(wh(t)));return typeof e=="object"&&e!==null?e:{}}catch{return{}}}async function MN(t){const e=await Ih(t);return typeof e.defaultTemplate=="string"?e.defaultTemplate:""}async function BN(t,e){const n=await Ih(t);e===""?delete n.defaultTemplate:n.defaultTemplate=e;const r=await Ke(`/api/write?path=${encodeURIComponent(wh(t))}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
48
+ `});if(!r.ok)throw new Error(`Save failed (${r.status})`)}async function FN(t,e){const n=await Ih(t);n.order=[...e];const r=await Ke(`/api/write?path=${encodeURIComponent(wh(t))}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
49
+ `});if(!r.ok)throw new Error(`Reorder failed (${r.status})`)}async function vD(t,e){const n=await Ke(`/api/write?path=${encodeURIComponent(t)}`,{method:"POST",body:e});if(!n.ok)throw new Error(`Save failed (${n.status})`);Ch(t);const r=await n.json().catch(()=>({}));return{...r.stamped!==void 0&&{stamped:r.stamped},...r.stampIncomplete===!0&&{stampIncomplete:!0},...r.schemaDelta!==void 0&&{schemaDelta:r.schemaDelta}}}function Ch(...t){t.some(n=>n.endsWith(".html")&&(n.startsWith("templates/")||n.startsWith("components/")))&&(Wd.clear(),Gd=void 0,wl=void 0,vh.bump()),t.some(n=>n.startsWith(`${tt.components}/`))&&(Kd=void 0,Vd=void 0),t.some(n=>n.startsWith(`${tt.content}/`))&&Ji()}function $s(t){return`${tt.content}/${t}.json`}function Ti(t){return`${tt.content}/${t}`}async function Il(t){const e=await Ke(`/api/delete?path=${encodeURIComponent(t)}`,{method:"POST"});if(!e.ok)throw new Error(`Delete failed (${e.status})`);Ch(t)}async function $a(t,e){const n=await Ke(`/api/rename?from=${encodeURIComponent(t)}&to=${encodeURIComponent(e)}`,{method:"POST"});if(!n.ok){const r=n.status===409?"a file or folder with that name already exists":`status ${n.status}`;throw new Error(`Rename failed, ${r}.`)}Ch(t,e)}const UN=/assets\/[A-Za-z0-9._-]+/g;async function HN(t,e,n){const r=ji(t,n),s=ji(e,n);if(r===s)return;const a=await Ke(`/api/read?path=${encodeURIComponent(r)}`);if(!a.ok)return;const i=await Ke(`/api/write?path=${encodeURIComponent(s)}`,{method:"POST",body:await a.arrayBuffer()});if(!i.ok)throw new Error(`Copying ${n} failed (${i.status})`)}async function qN(t,e){const n=t.lastIndexOf("/"),r=n>=0?t.slice(n+1):t,s=n>=0?t.slice(0,n):"";if(e===s)return t;const a=e===""?r:`${e}/${r}`;if(await nt.exists($s(a)))throw new Error(`"${r}" already exists in that folder.`);const i=await nt.readText($s(t));for(const o of new Set(i.match(UN)??[]))await HN(s,e,o);return await $a($s(t),$s(a)),Ji(),a}async function jN(t,e){const n=t.lastIndexOf("/"),r=n>=0?t.slice(n+1):t,s=n>=0?t.slice(0,n):"";if(e===s)return t;if(e===t||e.startsWith(`${t}/`))throw new Error("Cannot move a folder into itself.");const a=e===""?r:`${e}/${r}`;if(await nt.exists(Ti(a)))throw new Error(`A folder named "${r}" already exists there.`);return await $a(Ti(t),Ti(a)),Ji(),a}const eb=`${tt.content}/_redirects.json`;async function $N(){try{const t=JSON.parse(await nt.readText(eb));return Array.isArray(t)?t:[]}catch{return[]}}async function Mu(t,e){if(t!==e)try{const n=await $N();n.push({from:t,to:e});const r=await Ke(`/api/write?path=${encodeURIComponent(eb)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
50
+ `});if(!r.ok)throw new Error(`status ${r.status}`)}catch(n){console.warn(`Could not record redirect ${t} → ${e}:`,n)}}const tb=`${tt.content}/_site.json`;async function YN(){try{const t=JSON.parse(await nt.readText(tb));return{baseUrl:typeof t.baseUrl=="string"?t.baseUrl:""}}catch{return{baseUrl:""}}}async function zN(t){const e=t.baseUrl.trim(),n=`${JSON.stringify(e===""?{}:{baseUrl:e},null,2)}
51
+ `,r=await Ke(`/api/write?path=${encodeURIComponent(tb)}`,{method:"POST",headers:{"content-type":"application/json"},body:n});if(!r.ok)throw new Error(`Saving site settings failed (${r.status}).`)}const nb=["html","css","js"];async function ED(t){const e=t.replace(/\.html$/,"");await Promise.all(nb.map(n=>Il(`${e}.${n}`)))}async function WN(t,e){const n=t.replace(/\.html$/,""),r=e.replace(/\.html$/,"");for(const s of nb){const a=`${n}.${s}`;await nt.exists(a)&&await $a(a,`${r}.${s}`)}}async function GN(t,e){const n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"",r=await Ny(nt,t,{draft:e,media:W3(n)});return r===void 0?void 0:zd(r.html,nf)}async function nf(t){const e=t.startsWith("/api/")?t:Fg(`public/${t.slice(1)}`);try{const n=await Ke(e);if(!n.ok)return;const r=new Uint8Array(await n.arrayBuffer());return{contentType:n.headers.get("content-type")??(t.startsWith("/api/")?"":jT(t)),bytes:r}}catch{return}}async function TD(t){return Es(t,await hu())}async function _D(t,e,n){const[r,s,a,i,o]=await Promise.all([hu(),vN(),EN(),Th(),Vg()]),u=wg(i),d=aN(o),h=p=>({...tN(eN(p),n),...nN(p,n)});if(rN(t)){const p=sN(t),b=new Map(r).set(p,e.html),A=dp(new Map(s),p,e.css),T=dp(new Map(a),p,e.js),E=Es(e.html,b);return zd(Rd({template:iN(p,E,d),scope:h(E),components:b,componentStyles:A,componentScripts:T,context:u,media:op()}),nf)}const g=Es(e.html,r),f=Rd({template:e.html,scope:h(g),components:r,componentStyles:s,componentScripts:a,context:u,media:op(),...e.css.trim()!==""&&{templateStyle:e.css},...e.js.trim()!==""&&{templateScript:e.js}});return zd(Wg({htmlAttrs:d.htmlAttrs,headStyles:d.headStyles,title:"Template preview",body:f}),nf)}function dp(t,e,n){return n.trim()===""?t.delete(e):t.set(e,n),t}function KN(t,e){if(e==="title")return t.title;if(e==="created")return t.created??"";if(e==="published")return t.published??"";if(e==="updated")return t.updated??"";const n=t.fields[e];return n==null?"":Array.isArray(n)?n.some(r=>r!==null&&typeof r=="object")?JSON.stringify(n):n.map(String).join(", "):String(n)}const rb="nanoesis:tree-expanded";function VN(){try{const t=JSON.parse(localStorage.getItem(rb)??"");if(Array.isArray(t)){const e={};for(const n of t)typeof n=="string"&&(e[n]=!0);return e}}catch{}return{}}const As=ft({}),_i=ft({}),$i=ft(VN());function sb(){const t=Object.keys($i).filter(e=>$i[e]);localStorage.setItem(rb,JSON.stringify(t))}function bi(t){return As[t]}function XN(t){return _i[t]===!0}function li(t){return t===""||$i[t]===!0}async function tc(t){if(!(As[t]!==void 0||_i[t])){_i[t]=!0;try{As[t]=await Gg(t)}finally{_i[t]=!1}}}async function Sn(t){_i[t]=!0;try{As[t]=await Gg(t)}finally{_i[t]=!1}}async function QN(){await Promise.all(Object.keys(As).map(t=>Sn(t)))}function rf(t){return t.includes("/")?t.slice(0,t.lastIndexOf("/")):""}function ab(t){return t==="index"?"":t.endsWith("/index")?t.slice(0,-6):null}function sf(t,e,n){const r=As[t];if(r===void 0)return;let s=!1;const a=r.entries.map(i=>i.path!==e?i:(s=!0,n(i)));s&&(As[t]={...r,entries:a})}function ZN(t,e){const n=ab(t);if(n!==null){n!==""&&sf(rf(n),n,r=>r.kind==="dir"?{...r,name:e}:r);return}sf(rf(t),t,r=>r.kind==="item"?{...r,title:e}:r)}function JN(t,e){ab(t)===null&&sf(rf(t),t,n=>n.kind==="item"?{...n,isPublished:e}:n)}function e6(t,e){const n=As[t];if(n===void 0)return;const r=new Map(n.entries.map(a=>[a.slug,a])),s=[];for(const a of e){const i=r.get(a);i!==void 0&&(s.push(i),r.delete(a))}for(const a of r.values())s.push(a);As[t]={...n,entries:s}}async function fp(t){li(t)?$i[t]=!1:($i[t]=!0,await tc(t)),sb()}async function fo(t){const e=t.split("/");e.pop();let n="";for(const r of e)n=n===""?r:`${n}/${r}`,$i[n]=!0,await tc(n);sb()}const ib="nanoesis:dev-tree-expanded";function t6(){try{const t=JSON.parse(localStorage.getItem(ib)??"");if(Array.isArray(t)){const e={};for(const n of t)typeof n=="string"&&(e[n]=!0);return e}}catch{}return Object.fromEntries(ON.map(t=>[t,!0]))}const Yo=ft({}),Ai=ft({}),Ma=ft(t6());function ob(){const t=Object.keys(Ma).filter(e=>Ma[e]);localStorage.setItem(ib,JSON.stringify(t))}function AD(t){return Yo[t]}function yD(t){return Ai[t]===!0}function ND(t){return Ma[t]===!0}async function ub(t){if(!(Yo[t]!==void 0||Ai[t])){Ai[t]=!0;try{Yo[t]=await Sh(t)}finally{Ai[t]=!1}}}async function n6(t){Ai[t]=!0;try{Yo[t]=await Sh(t)}finally{Ai[t]=!1}}async function r6(){await Promise.all(Object.keys(Yo).map(t=>n6(t)))}async function SD(t){Ma[t]?Ma[t]=!1:(Ma[t]=!0,await ub(t)),ob()}let Sr=J(null),Lh=J(null);function wD(){return l(Sr)}function ID(){return l(Lh)}function CD(t,e){y(Sr,{entry:t,parent:e},!0)}function LD(t){y(Lh,t,!0)}function OD(){y(Sr,null),y(Lh,null)}const s6=new Set(["templates/home.html"]);function lb(t){return s6.has(t)}function xD(t,e){if(l(Sr)===null||e!=="dir"||lb(l(Sr).entry.path))return!1;const n=l(Sr).entry.path;return t!==n&&l(Sr).parent!==t&&!t.startsWith(`${n}/`)&&n.split("/")[0]===t.split("/")[0]}function RD(t){return l(Sr)===null||lb(l(Sr).entry.path)?!1:l(Sr).parent!==t&&l(Sr).entry.path.split("/")[0]===t}async function DD(t){const e=t.split("/");e.pop();let n="";for(const r of e)n=n===""?r:`${n}/${r}`,Ma[n]=!0,await ub(n);ob()}const a6=9e4;function i6(t){if(typeof t!="object"||t===null)return{changed:!1,added:0,removed:0};const e=t,n=typeof e.added=="number"?e.added:0,r=typeof e.removed=="number"?e.removed:0;return{changed:n>0||r>0,added:n,removed:r}}function o6(t){const e=t.intervalMs??a6;let n=null,r=!1;async function s(){if(!(r||!t.isVisible())){r=!0;try{const a=await t.reconcileOnce();a.changed&&t.onChanged(a)}catch{}finally{r=!1}}}return{start(){n===null&&(n=setInterval(()=>void s(),e))},stop(){n!==null&&(clearInterval(n),n=null)}}}let Ft=J(null);const Bu={get pending(){return l(Ft)}};function Cl(t,e={}){return new Promise(n=>{y(Ft,{kind:"confirm",message:t,options:e,resolve:n},!0)})}function Ro(t,e={}){return new Promise(n=>{y(Ft,{kind:"prompt",message:t,options:e,resolve:n},!0)})}function kD(t,e,n={}){return new Promise(r=>{y(Ft,{kind:"select",message:t,choices:e,options:n,resolve:r},!0)})}function u6(t,e){return new Promise(n=>{y(Ft,{kind:"decide",message:t,options:e,resolve:n},!0)})}function Xt(t,e={}){return new Promise(n=>{y(Ft,{kind:"alert",message:t,options:e,resolve:n},!0)})}function Uc(t){var e;((e=l(Ft))==null?void 0:e.kind)==="confirm"&&(l(Ft).resolve(t),y(Ft,null))}function Hc(t){var e;((e=l(Ft))==null?void 0:e.kind)==="prompt"&&(l(Ft).resolve(t),y(Ft,null))}function qc(t){var e;((e=l(Ft))==null?void 0:e.kind)==="select"&&(l(Ft).resolve(t),y(Ft,null))}function Fu(t){var e;((e=l(Ft))==null?void 0:e.kind)==="decide"&&(l(Ft).resolve(t),y(Ft,null))}function hp(){var t;((t=l(Ft))==null?void 0:t.kind)==="alert"&&(l(Ft).resolve(),y(Ft,null))}let pp=J(null);const Uu=ft({}),af={get active(){return l(pp)},get hasDirty(){return Object.keys(Uu).length>0},isDirty(t){return Uu[t]===!0},setActive(t){y(pp,t,!0)},setDirty(t,e){e?Uu[t]=!0:delete Uu[t]}};async function cb(t){const e=af.active;if(e===null||!af.isDirty(e.key))return!0;const n=t===void 0?"":`
52
+
53
+ ${t}`,r=await u6(`You have unsaved changes to ${e.key}. Save them, discard them, or stay on this file?${n}`,{title:"Unsaved changes",primaryLabel:"Save",secondaryLabel:"Discard",cancelLabel:"Stay",secondaryDanger:!0});if(r==="cancel")return!1;if(r==="secondary")return e.discard(),!0;try{return await e.flush(),!0}catch(s){return await Xt(`Couldn't save ${e.key}: ${s instanceof Error?s.message:String(s)}
54
+
55
+ You're still on this file — try again or discard.`,{title:"Save failed"}),!1}}const db="nanoesis-restore:",fb="nanoesis:unit-values:",hb="nanoesis:tree-expanded",pb="nanoesis:dev-tree-expanded";function l6(t){t.removeItem(hb),t.removeItem(pb);for(let e=t.length-1;e>=0;e--){const n=t.key(e);n!==null&&(n.startsWith(db)||n.startsWith(fb))&&t.removeItem(n)}}function mp(t,e){t.removeItem(`${db}${e}`),t.removeItem(`${fb}${e}`);for(const n of[hb,pb]){const r=t.getItem(n);if(r!==null)try{const s=JSON.parse(r);if(!Array.isArray(s))continue;const a=s.filter(i=>typeof i=="string"&&i!==e&&!i.startsWith(`${e}/`));a.length!==s.length&&t.setItem(n,JSON.stringify(a))}catch{}}}/**
56
+ * @file
57
+ * @license @lucide/svelte v1.16.0 - ISC
58
+ *
59
+ * This source code is licensed under the ISC license.
60
+ * See the LICENSE file in the root directory of this source tree.
61
+ */const c6={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
62
+ * @file
63
+ * @license @lucide/svelte v1.16.0 - ISC
64
+ *
65
+ * This source code is licensed under the ISC license.
66
+ * See the LICENSE file in the root directory of this source tree.
67
+ */const d6=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
68
+ * @file
69
+ * @license @lucide/svelte v1.16.0 - ISC
70
+ *
71
+ * This source code is licensed under the ISC license.
72
+ * See the LICENSE file in the root directory of this source tree.
73
+ */const f6=Symbol("lucide-context"),h6=()=>TE(f6);var p6=cT("<svg><!><!></svg>");function Dr(t,e){it(e,!0);const n=h6()??{},r=$n(e,"color",19,()=>n.color??"currentColor"),s=$n(e,"size",19,()=>n.size??24),a=$n(e,"strokeWidth",19,()=>n.strokeWidth??2),i=$n(e,"absoluteStrokeWidth",19,()=>n.absoluteStrokeWidth??!1),o=$n(e,"iconNode",19,()=>[]),u=dr(e,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]),d=Ae(()=>i()?Number(a())*24/Number(s()):a());var h=p6();b0(h,p=>({...c6,...p,...u,width:s(),height:s(),stroke:r(),"stroke-width":l(d),class:["lucide-icon lucide",n.class,e.name&&`lucide-${e.name}`,e.class]}),[()=>!e.children&&!d6(u)&&{"aria-hidden":"true"}]);var g=S(h);Ct(g,17,o,Ho,(p,b)=>{var A=Ae(()=>qv(l(b),2));let T=()=>l(A)[0],E=()=>l(A)[1];var x=jn(),I=Je(x);TT(I,T,!0,(U,P)=>{b0(U,()=>({...E()}))}),j(p,x)});var f=O(g);ET(f,()=>e.children??Ff),j(t,h),ot()}function Oh(t,e){let n=dr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M14 17H5"}],["path",{d:"M19 7h-9"}],["circle",{cx:"17",cy:"17",r:"3"}],["circle",{cx:"7",cy:"7",r:"3"}]];Dr(t,xr({name:"settings-2"},()=>n,{get iconNode(){return r}}))}function m6(t,e){let n=dr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];Dr(t,xr({name:"plus"},()=>n,{get iconNode(){return r}}))}function xh(t,e){let n=dr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];Dr(t,xr({name:"x"},()=>n,{get iconNode(){return r}}))}function g6(t,e){let n=dr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m9 18 6-6-6-6"}]];Dr(t,xr({name:"chevron-right"},()=>n,{get iconNode(){return r}}))}function b6(t,e){let n=dr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m6 9 6 6 6-6"}]];Dr(t,xr({name:"chevron-down"},()=>n,{get iconNode(){return r}}))}function mb(t,e){let n=dr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];Dr(t,xr({name:"search"},()=>n,{get iconNode(){return r}}))}function v6(t,e){let n=dr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}]];Dr(t,xr({name:"house"},()=>n,{get iconNode(){return r}}))}function E6(t,e){let n=dr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]];Dr(t,xr({name:"link"},()=>n,{get iconNode(){return r}}))}function T6(t,e){let n=dr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M15 3h6v6"}],["path",{d:"M10 14 21 3"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}]];Dr(t,xr({name:"external-link"},()=>n,{get iconNode(){return r}}))}function of(t,e){let n=dr(e,["$$slots","$$events","$$legacy"]);const r=[["circle",{cx:"9",cy:"12",r:"1"}],["circle",{cx:"9",cy:"5",r:"1"}],["circle",{cx:"9",cy:"19",r:"1"}],["circle",{cx:"15",cy:"12",r:"1"}],["circle",{cx:"15",cy:"5",r:"1"}],["circle",{cx:"15",cy:"19",r:"1"}]];Dr(t,xr({name:"grip-vertical"},()=>n,{get iconNode(){return r}}))}function _6(t,e){let n=dr(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 10v6"}],["path",{d:"M9 13h6"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"}]];Dr(t,xr({name:"folder-plus"},()=>n,{get iconNode(){return r}}))}let Rh=J(null),Dh=J(null);function vi(){return l(Rh)}function gp(){return l(Dh)}function A6(t,e){y(Rh,{entry:t,parent:e},!0)}function jc(t){y(Dh,t,!0)}function ks(){y(Rh,null),y(Dh,null)}let $c=J(null);const uf={get target(){return l($c)},request(t){y($c,t,!0)},clear(){y($c,null)}};function y6(){let t=J("content");return{get mode(){return l(t)},set(e){y(t,e,!0)}}}const Tr=y6(),N6="nanoesis-restore:";function lf(t){return`${N6}${t}`}function S6(t,e,n){t.getItem(lf(e))===null&&t.setItem(lf(e),JSON.stringify(n))}function w6(t,e){const n=t.getItem(lf(e));if(n===null)return null;try{return JSON.parse(n)}catch{return null}}function I6(){let t=J("saved"),e=null;return{get state(){return l(t)},get canRetry(){return l(t)==="error"&&e!==null},saving(){y(t,"saving")},saved(){y(t,"saved"),e=null},failed(n){y(t,"error"),e=n},retry(){e==null||e()},reset(){y(t,"saved"),e=null}}}const Ms=I6(),C6=new Set(["title","created","published","updated"]);function L6(t){let e;try{e=JSON.parse(t===""?"[]":t)}catch{return[]}if(!Array.isArray(e))return[];const n=[];for(const r of e){if(r===null||typeof r!="object")continue;const s=r,a=typeof s.name=="string"?s.name.trim():"";if(a==="")continue;const i={name:a};typeof s.user=="string"&&s.user!==""&&(i.user=s.user),typeof s.href=="string"&&s.href!==""&&(i.href=s.href),n.push(i)}return n}function O6(t,e,n){if(t.type==="authors")return L6(n);if(t.multiple||Array.isArray(e))return n.split(",").map(r=>r.trim()).filter(r=>r.length>0);if(typeof e=="number"){const r=Number(n);return Number.isFinite(r)?r:n}return typeof e=="boolean"?n==="true":n}function x6(t){return t===""||Array.isArray(t)&&t.length===0}function bp(t,e,n,r=t.isPublished){const s={...t.fields},a={title:t.title,created:t.created,published:t.published,updated:t.updated};for(const o of e){const u=n[o.name]??"";if(C6.has(o.name)){a[o.name]=o.name==="title"?u:u||void 0;continue}const d=O6(o,t.fields[o.name],u);x6(d)?delete s[o.name]:s[o.name]=d}const i={};return t.template!==void 0&&(i.template=t.template),i.title=a.title,i.isPublished=r,a.created!==void 0&&(i.created=a.created),a.published!==void 0&&(i.published=a.published),a.updated!==void 0&&(i.updated=a.updated),i.fields=s,`${JSON.stringify(i,null,2)}
74
+ `}function cf(t,e,n){if(e<0||e>=t.length)return[...t];const r=[...t],s=Math.max(0,Math.min(r.length-1,n)),[a]=r.splice(e,1);return r.splice(s,0,a),r}let R6=0;var D6=K('<li draggable="true"><span class="grip svelte-5hnbr8" aria-hidden="true"><!></span> <span class="name svelte-5hnbr8"> </span> <button type="button" class="remove svelte-5hnbr8"><!></button></li>'),k6=K('<ul class="pills svelte-5hnbr8"></ul>'),P6=K('<li role="option"> </li>'),M6=K('<ul class="suggestions svelte-5hnbr8" role="listbox"><!> <li role="option"> </li></ul>'),B6=K('<div class="authors svelte-5hnbr8" role="group"><!> <div class="add svelte-5hnbr8"><input type="text" class="add-input svelte-5hnbr8" placeholder="Add an author…" autocomplete="off" role="combobox" aria-autocomplete="list"/> <!></div></div>');function F6(t,e){it(e,!0);function n(V){if(V.trim()==="")return[];try{const te=JSON.parse(V);return Array.isArray(te)?te.flatMap(de=>{if(de===null||typeof de!="object")return[];const ge=de,pe=typeof ge.name=="string"?ge.name:"";return pe.trim()===""?[]:[{name:pe,...typeof ge.user=="string"&&ge.user!==""?{user:ge.user}:{}}]}):[]}catch{return[]}}const r=Ae(()=>n(e.value)),s=`authors-${++R6}`;let a=J(ft([])),i=J(""),o=J(!1),u=J(0),d=J(void 0),h=J(null),g=J(null);St(()=>{lN().then(V=>y(a,V,!0))});const f=Ae(()=>new Map(l(a).map(V=>[V.user,V.name]))),p=Ae(()=>new Set(l(r).map(V=>V.user).filter(V=>V!==void 0)));function b(V){return V.user!==void 0?l(f).get(V.user)??V.name:V.name}const A=Ae(()=>{const V=l(i).trim().toLowerCase();return V===""?[]:l(a).filter(te=>!l(p).has(te.user)&&te.name.toLowerCase().includes(V)).slice(0,6)}),T=Ae(()=>l(o)&&l(i).trim()!==""),E=Ae(()=>l(A).length),x=Ae(()=>l(T)?l(u)<l(A).length?`${s}-opt-${l(u)}`:`${s}-guest`:void 0);function I(V){e.onchange(V.length===0?"":JSON.stringify(V))}function U(V){l(p).has(V.user)||(I([...l(r),{name:V.name,user:V.user}]),y(i,""))}function P(V){const te=V.trim();te!==""&&(I([...l(r),{name:te}]),y(i,""))}function ee(){const V=l(A)[l(u)];V!==void 0?U(V):P(l(i))}function F(){var V,te;(te=(V=l(d))==null?void 0:V.children[l(u)])==null||te.scrollIntoView({block:"nearest"})}function G(V){if(!l(T)){V.key==="Enter"&&(V.preventDefault(),P(l(i)));return}const te=l(A).length+1;V.key==="ArrowDown"?(V.preventDefault(),y(u,(l(u)+1)%te),F()):V.key==="ArrowUp"?(V.preventDefault(),y(u,(l(u)-1+te)%te),F()):V.key==="Enter"?(V.preventDefault(),ee()):V.key==="Escape"&&(V.preventDefault(),y(i,""))}function Q(V){I(l(r).filter((te,de)=>de!==V))}function ne(V,te){var de;y(h,V,!0),(de=te.dataTransfer)==null||de.setData("text/plain",String(V)),te.dataTransfer&&(te.dataTransfer.effectAllowed="move")}function _(V,te){l(h)!==null&&(te.preventDefault(),y(g,V,!0))}function M(V){l(h)!==null&&l(h)!==V&&I(cf(l(r),l(h),V)),y(h,null),y(g,null)}function v(){y(h,null),y(g,null)}var C=B6(),R=S(C);{var D=V=>{var te=k6();Ct(te,21,()=>l(r),Ho,(de,ge,pe)=>{var Ie=D6();let le;var he=S(Ie),Ne=S(he);of(Ne,{size:14});var ye=O(he,2),we=S(ye),xe=O(ye,2),Me=S(xe);xh(Me,{size:14,"aria-hidden":"true"}),ie((Ge,We)=>{le=Ze(Ie,1,"pill svelte-5hnbr8",null,le,{guest:l(ge).user===void 0,dragging:l(h)===pe,over:l(g)===pe&&l(h)!==pe}),be(ye,"title",l(ge).user??"Guest"),ue(we,Ge),be(xe,"aria-label",We)},[()=>b(l(ge)),()=>`Remove ${b(l(ge))}`]),Pe("dragstart",Ie,Ge=>ne(pe,Ge)),Pe("dragover",Ie,Ge=>_(pe,Ge)),Pe("drop",Ie,()=>M(pe)),Pe("dragend",Ie,v),ae("click",xe,()=>Q(pe)),j(de,Ie)}),j(V,te)};fe(R,V=>{l(r).length>0&&V(D)})}var W=O(R,2),$=S(W),B=O($,2);{var Y=V=>{var te=M6(),de=S(te);Ct(de,19,()=>l(A),le=>le.user,(le,he,Ne)=>{var ye=P6();let we;var xe=S(ye);ie(()=>{be(ye,"id",`${s}-opt-${l(Ne)}`),we=Ze(ye,1,"option svelte-5hnbr8",null,we,{active:l(Ne)===l(u)}),be(ye,"aria-selected",l(Ne)===l(u)),ue(xe,l(he).name)}),ae("click",ye,()=>U(l(he))),Pe("mouseenter",ye,()=>y(u,l(Ne),!0)),j(le,ye)});var ge=O(de,2);let pe;var Ie=S(ge);sn(te,le=>y(d,le),()=>l(d)),ie(le=>{be(te,"id",`${s}-listbox`),be(ge,"id",`${s}-guest`),pe=Ze(ge,1,"option guest-option svelte-5hnbr8",null,pe,{active:l(u)===l(E)}),be(ge,"aria-selected",l(u)===l(E)),ue(Ie,`Add “${le??""}” as a guest`)},[()=>l(i).trim()]),ae("click",ge,()=>P(l(i))),Pe("mouseenter",ge,()=>y(u,l(E),!0)),j(V,te)};fe(B,V=>{l(T)&&V(Y)})}ie(()=>{be(C,"aria-labelledby",e.labelledBy),be($,"aria-expanded",l(T)),be($,"aria-controls",`${s}-listbox`),be($,"aria-activedescendant",l(x))}),ae("input",$,()=>y(u,0)),ae("keydown",$,G),Pe("focus",$,()=>{y(o,!0),y(u,0)}),Pe("blur",$,()=>setTimeout(()=>y(o,!1),120)),_t($,()=>l(i),V=>y(i,V)),j(t,C),ot()}vt(["click","input","keydown"]);var U6=K('<div class="current svelte-1nm0yno"><a class="filename svelte-1nm0yno" download=""> </a> <button type="button" class="link svelte-1nm0yno">Remove</button></div>'),H6=K('<p class="empty svelte-1nm0yno">No file selected.</p>'),q6=K('<li class="hint svelte-1nm0yno">Loading…</li>'),j6=K('<li class="hint svelte-1nm0yno">No files here yet, upload one above.</li>'),$6=K('<li><button type="button"> </button></li>'),Y6=K('<ul class="library svelte-1nm0yno" aria-label="File library"><!></ul>'),z6=K('<p class="error svelte-1nm0yno" role="alert"> </p>'),W6=K('<div class="file-field svelte-1nm0yno" role="group"><!> <div class="actions svelte-1nm0yno"><button type="button" class="action svelte-1nm0yno"> </button> <label class="action upload svelte-1nm0yno">Upload… <input type="file" class="svelte-1nm0yno"/></label></div> <!> <!></div>');function G6(t,e){it(e,!0);let n=J(ft([])),r=J(!1),s=J(!1),a=!1,i=J(null);const o=Ae(()=>e.value.split("/").pop()??e.value);async function u(){y(s,!0);try{y(n,await IN(e.itemDir),!0),a=!0}finally{y(s,!1)}}function d(){y(r,!l(r)),l(r)&&!a&&u()}function h(Q){var M;const ne=Q.currentTarget,_=(M=ne.files)==null?void 0:M[0];ne.value="",_&&g(_)}async function g(Q){y(i,null);try{e.onchange(await Nh(e.itemDir,Q)),a=!1,l(r)&&await u()}catch(ne){y(i,ne instanceof Error?ne.message:String(ne),!0)}}var f=W6(),p=S(f);{var b=Q=>{var ne=U6(),_=S(ne),M=S(_),v=O(_,2);ie(C=>{be(_,"href",C),ue(M,l(o))},[()=>ec(e.itemDir,e.value)]),ae("click",v,()=>e.onchange("")),j(Q,ne)},A=Q=>{var ne=H6();j(Q,ne)};fe(p,Q=>{e.value?Q(b):Q(A,-1)})}var T=O(p,2),E=S(T),x=S(E),I=O(E,2),U=O(S(I)),P=O(T,2);{var ee=Q=>{var ne=Y6(),_=S(ne);{var M=R=>{var D=q6();j(R,D)},v=R=>{var D=j6();j(R,D)},C=R=>{var D=jn(),W=Je(D);Ct(W,16,()=>l(n),$=>$,($,B)=>{const Y=Ae(()=>Ug(B));var V=$6(),te=S(V);let de;var ge=S(te);ie(()=>{de=Ze(te,1,"file svelte-1nm0yno",null,de,{selected:e.value===l(Y)}),be(te,"aria-pressed",e.value===l(Y)),ue(ge,B)}),ae("click",te,()=>e.onchange(l(Y))),j($,V)}),j(R,D)};fe(_,R=>{l(s)?R(M):l(n).length===0?R(v,1):R(C,-1)})}j(Q,ne)};fe(P,Q=>{l(r)&&Q(ee)})}var F=O(P,2);{var G=Q=>{var ne=z6(),_=S(ne);ie(()=>ue(_,l(i))),j(Q,ne)};fe(F,Q=>{l(i)&&Q(G)})}ie(()=>{be(f,"aria-labelledby",e.labelledBy),be(E,"aria-expanded",l(r)),ue(x,l(r)?"Hide files":"Choose from files")}),ae("click",E,d),ae("change",U,h),j(t,f),ot()}vt(["click","change"]);var K6=K('<div class="preview svelte-s6anrr"><img class="preview-img svelte-s6anrr" alt=""/> <div class="preview-meta svelte-s6anrr"><span class="filename svelte-s6anrr"> </span> <div class="row svelte-s6anrr"><label> <input type="file" accept="image/*" class="svelte-s6anrr"/></label> <button type="button" class="link svelte-s6anrr">Remove</button></div></div></div>'),V6=K('<label> <input type="file" accept="image/*" class="svelte-s6anrr"/></label>'),X6=K('<p class="error svelte-s6anrr" role="alert"> </p>'),Q6=K('<div class="image-field svelte-s6anrr" role="group"><!> <!></div>');function Z6(t,e){it(e,!0);let n=J(!1),r=J(null),s=J("");St(()=>{const p=e.value;if(p===""){y(s,"");return}if(/^(\/|[a-z][a-z0-9+.-]*:)/i.test(p)){y(s,p,!0);return}let b=null,A=!1;return DN(e.itemDir,p).then(T=>{if(A){URL.revokeObjectURL(T);return}b=T,y(s,T,!0)}).catch(()=>{A||y(s,"")}),()=>{A=!0,b!==null&&URL.revokeObjectURL(b)}});function a(p){var T;const b=p.currentTarget,A=(T=b.files)==null?void 0:T[0];b.value="",A&&i(A)}async function i(p){y(r,null),y(n,!0);try{e.onchange(await Nh(e.itemDir,p))}catch(b){y(r,b instanceof Error?b.message:String(b),!0)}finally{y(n,!1)}}var o=Q6(),u=S(o);{var d=p=>{var b=K6(),A=S(b),T=O(A,2),E=S(T),x=S(E),I=O(E,2),U=S(I);let P;var ee=S(U),F=O(ee),G=O(U,2);ie(()=>{be(A,"src",l(s)),ue(x,e.value),P=Ze(U,1,"action svelte-s6anrr",null,P,{busy:l(n)}),ue(ee,`${l(n)?"Uploading…":"Replace…"} `),F.disabled=l(n)}),ae("change",F,a),ae("click",G,()=>e.onchange("")),j(p,b)},h=p=>{var b=V6();let A;var T=S(b),E=O(T);ie(()=>{A=Ze(b,1,"action svelte-s6anrr",null,A,{busy:l(n)}),ue(T,`${l(n)?"Uploading…":"Upload image…"} `),E.disabled=l(n)}),ae("change",E,a),j(p,b)};fe(u,p=>{e.value?p(d):p(h,-1)})}var g=O(u,2);{var f=p=>{var b=X6(),A=S(b);ie(()=>ue(A,l(r))),j(p,b)};fe(g,p=>{l(r)&&p(f)})}ie(()=>be(o,"aria-labelledby",e.labelledBy)),j(t,o),ot()}vt(["change","click"]);var J6=K("<option> </option>"),eS=K("<option>Top level</option>"),tS=K("<option> </option>"),nS=K('<div class="section svelte-wge2ya"><h3 class="svelte-wge2ya">Move</h3> <div class="manage svelte-wge2ya"><label class="grow svelte-wge2ya"><span class="visually-hidden svelte-wge2ya">Move to folder</span> <select class="svelte-wge2ya"><option disabled="">Move to…</option><!><!></select></label> <button type="button" class="ghost svelte-wge2ya">Move</button></div></div>'),rS=K('<button type="button" class="ghost svelte-wge2ya">Change URL…</button>'),sS=K('<button type="button" class="ghost danger svelte-wge2ya">Delete…</button>'),aS=K(`<p class="help svelte-wge2ya">Changes the page’s URL (its slug, the filename). The <strong>title</strong> is edited as the
75
+ heading at the top of the form.</p>`),iS=K('<div class="section svelte-wge2ya"><h3 class="svelte-wge2ya">Manage item</h3> <div class="manage svelte-wge2ya"><!> <!></div> <!></div>'),oS=K('<dialog aria-label="Edit item" class="svelte-wge2ya"><form><h2 class="svelte-wge2ya">Edit item</h2> <label class="svelte-wge2ya"><span class="svelte-wge2ya">Template</span> <select class="svelte-wge2ya"></select> <span class="help svelte-wge2ya">Switching keeps any field values the new template doesn’t use.</span></label> <!> <!> <div class="actions svelte-wge2ya"><button type="button" class="ghost svelte-wge2ya">Cancel</button> <button type="submit" class="primary svelte-wge2ya">Save</button></div></form></dialog>');function uS(t,e){it(e,!0);const n=$n(e,"currentFolder",3,""),r=$n(e,"folders",19,()=>[]);let s,a=J(ft(e.templateName));const i="\0";let o=J(i);const u=Ae(()=>r().filter(P=>P!==n())),d=Ae(()=>e.templates.includes(e.templateName)?e.templates:[e.templateName,...e.templates]);Va(()=>s.showModal());function h(P){P.preventDefault(),l(a)!==e.templateName?e.onchangetemplate(l(a)):e.onclose()}var g=oS(),f=S(g),p=O(S(f),2),b=O(S(p),2);Ct(b,20,()=>l(d),P=>P,(P,ee)=>{var F=J6(),G=S(F),Q={};ie(()=>{ue(G,ee),Q!==(Q=ee)&&(F.value=(F.__value=ee)??"")}),j(P,F)});var A=O(p,2);{var T=P=>{var ee=nS(),F=O(S(ee),2),G=S(F),Q=O(S(G),2),ne=S(Q);ne.value=ne.__value=i;var _=O(ne);{var M=R=>{var D=eS();D.value=D.__value="",j(R,D)};fe(_,R=>{n()!==""&&R(M)})}var v=O(_);Ct(v,16,()=>l(u),R=>R,(R,D)=>{var W=tS(),$=S(W),B={};ie(()=>{ue($,`${D??""}/`),B!==(B=D)&&(W.value=(W.__value=D)??"")}),j(R,W)});var C=O(G,2);ie(()=>C.disabled=l(o)===i),qa(Q,()=>l(o),R=>y(o,R)),ae("click",C,()=>e.onmove(l(o))),j(P,ee)};fe(A,P=>{e.onmove&&P(T)})}var E=O(A,2);{var x=P=>{var ee=iS(),F=O(S(ee),2),G=S(F);{var Q=C=>{var R=rS();ae("click",R,function(...D){var W;(W=e.onrename)==null||W.apply(this,D)}),j(C,R)};fe(G,C=>{e.onrename&&C(Q)})}var ne=O(G,2);{var _=C=>{var R=sS();ae("click",R,function(...D){var W;(W=e.ondelete)==null||W.apply(this,D)}),j(C,R)};fe(ne,C=>{e.ondelete&&C(_)})}var M=O(F,2);{var v=C=>{var R=aS();j(C,R)};fe(M,C=>{e.onrename&&C(v)})}j(P,ee)};fe(E,P=>{(e.onrename||e.ondelete)&&P(x)})}var I=O(E,2),U=S(I);sn(g,P=>s=P,()=>s),Pe("close",g,function(...P){var ee;(ee=e.onclose)==null||ee.apply(this,P)}),Pe("cancel",g,function(...P){var ee;(ee=e.onclose)==null||ee.apply(this,P)}),Pe("submit",f,h),qa(b,()=>l(a),P=>y(a,P)),ae("click",U,function(...P){var ee;(ee=e.onclose)==null||ee.apply(this,P)}),j(t,g),ot()}vt(["click"]);let Do=J(null);const lS={get pending(){return l(Do)}};function gb(t=""){return new Promise(e=>{y(Do,{current:t,resolve:e},!0)})}function oi(t){l(Do)!==null&&(l(Do).resolve(t),y(Do,null))}const kh="ref:";function zo(t){return t.startsWith(kh)}function df(t){return zo(t)?t.slice(kh.length):t}function cS(t){return`${kh}${t}`}var dS=K('<!> <span class="target svelte-147ryxk"> </span>',1),fS=K('<!> <span class="target svelte-147ryxk"> </span>',1),hS=K('<span class="value svelte-147ryxk"><!></span> <button type="button" class="action svelte-147ryxk">Edit</button> <button type="button" class="action svelte-147ryxk">Clear</button>',1),pS=K('<button type="button" class="action svelte-147ryxk">Set link…</button>'),mS=K('<div class="link-field svelte-147ryxk" role="group"><!></div>');function gS(t,e){it(e,!0);async function n(){const o=await gb(e.value);o!==null&&e.onchange(o)}var r=mS(),s=S(r);{var a=o=>{var u=hS(),d=Je(u),h=S(d);{var g=T=>{var E=dS(),x=Je(E);E6(x,{size:14,"aria-hidden":"true"});var I=O(x,2),U=S(I);ie((P,ee)=>{be(I,"title",P),ue(U,ee)},[()=>`Page: ${df(e.value)}`,()=>df(e.value)]),j(T,E)},f=Ae(()=>zo(e.value)),p=T=>{var E=fS(),x=Je(E);T6(x,{size:14,"aria-hidden":"true"});var I=O(x,2),U=S(I);ie(()=>{be(I,"title",e.value),ue(U,e.value)}),j(T,E)};fe(h,T=>{l(f)?T(g):T(p,-1)})}var b=O(d,2),A=O(b,2);ae("click",b,n),ae("click",A,()=>e.onchange("")),j(o,u)},i=o=>{var u=pS();ae("click",u,n),j(o,u)};fe(s,o=>{e.value?o(a):o(i,-1)})}ie(()=>be(r,"aria-labelledby",e.labelledBy)),j(t,r),ot()}vt(["click"]);var bS=K('<p class="note error svelte-1v8pkea"> </p>'),vS=K('<p class="note svelte-1v8pkea">Nothing to preview yet, this item has no resolvable template.</p>'),ES=K('<p class="note overlay svelte-1v8pkea">Rendering…</p>'),TS=K('<iframe title="Rendered preview" sandbox="allow-same-origin allow-scripts allow-modals" class="svelte-1v8pkea"></iframe> <!>',1),_S=K('<section class="preview svelte-1v8pkea" aria-label="Preview"><header class="bar svelte-1v8pkea"><strong class="title svelte-1v8pkea">Preview</strong> <span class="dims svelte-1v8pkea" title="Current preview width"> </span> <button type="button" class="close svelte-1v8pkea" title="Close preview" aria-label="Close preview"><!></button></header> <div class="frame svelte-1v8pkea"><!></div></section>');function AS(t,e){it(e,!0);let n=J(""),r=J("loading"),s=J(""),a=J(0),i=J(void 0),o={x:0,y:0};function u(){var F;try{const G=(F=l(i))==null?void 0:F.contentWindow;G&&(o={x:G.scrollX,y:G.scrollY})}catch{}}function d(){var F,G;try{(G=(F=l(i))==null?void 0:F.contentWindow)==null||G.scrollTo(o.x,o.y)}catch{}}let h;St(()=>{const F=e.previewItem,G=e.path;if(clearTimeout(h),F===null){y(r,"loading");return}return h=setTimeout(()=>void g(G,F),350),()=>clearTimeout(h)});async function g(F,G){try{const Q=await GN(F,G);if(Q===void 0){y(r,"empty");return}u(),y(n,Q,!0),y(r,"ready")}catch(Q){y(s,Q instanceof Error?Q.message:String(Q),!0),y(r,"error")}}var f=_S(),p=S(f),b=O(S(p),2),A=S(b),T=O(b,2),E=S(T);xh(E,{size:18,"aria-hidden":"true"});var x=O(p,2),I=S(x);{var U=F=>{var G=bS(),Q=S(G);ie(()=>ue(Q,`Couldn’t render preview: ${l(s)??""}`)),j(F,G)},P=F=>{var G=vS();j(F,G)},ee=F=>{var G=TS(),Q=Je(G);sn(Q,M=>y(i,M),()=>l(i));var ne=O(Q,2);{var _=M=>{var v=ES();j(M,v)};fe(ne,M=>{l(r)==="loading"&&M(_)})}ie(()=>be(Q,"srcdoc",l(n))),Pe("load",Q,d),j(F,G)};fe(I,F=>{l(r)==="error"?F(U):l(r)==="empty"?F(P,1):F(ee,-1)})}ie(F=>ue(A,`${F??""}px`),[()=>Math.round(l(a))]),ae("click",T,function(...F){var G;(G=e.onclose)==null||G.apply(this,F)}),MT(x,"clientWidth",F=>y(a,F)),j(t,f),ot()}vt(["click"]);var bb=typeof global=="object"&&global&&global.Object===Object&&global,yS=typeof self=="object"&&self&&self.Object===Object&&self,os=bb||yS||Function("return this")(),Js=os.Symbol,vb=Object.prototype,NS=vb.hasOwnProperty,SS=vb.toString,ho=Js?Js.toStringTag:void 0;function wS(t){var e=NS.call(t,ho),n=t[ho];try{t[ho]=void 0;var r=!0}catch{}var s=SS.call(t);return r&&(e?t[ho]=n:delete t[ho]),s}var IS=Object.prototype,CS=IS.toString;function LS(t){return CS.call(t)}var OS="[object Null]",xS="[object Undefined]",vp=Js?Js.toStringTag:void 0;function eo(t){return t==null?t===void 0?xS:OS:vp&&vp in Object(t)?wS(t):LS(t)}function ys(t){return t!=null&&typeof t=="object"}var Ya=Array.isArray;function sa(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Eb(t){return t}var RS="[object AsyncFunction]",DS="[object Function]",kS="[object GeneratorFunction]",PS="[object Proxy]";function Ph(t){if(!sa(t))return!1;var e=eo(t);return e==DS||e==kS||e==RS||e==PS}var Yc=os["__core-js_shared__"],Ep=(function(){var t=/[^.]+$/.exec(Yc&&Yc.keys&&Yc.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function MS(t){return!!Ep&&Ep in t}var BS=Function.prototype,FS=BS.toString;function Za(t){if(t!=null){try{return FS.call(t)}catch{}try{return t+""}catch{}}return""}var US=/[\\^$.*+?()[\]{}|]/g,HS=/^\[object .+?Constructor\]$/,qS=Function.prototype,jS=Object.prototype,$S=qS.toString,YS=jS.hasOwnProperty,zS=RegExp("^"+$S.call(YS).replace(US,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function WS(t){if(!sa(t)||MS(t))return!1;var e=Ph(t)?zS:HS;return e.test(Za(t))}function GS(t,e){return t==null?void 0:t[e]}function Ja(t,e){var n=GS(t,e);return WS(n)?n:void 0}var ff=Ja(os,"WeakMap"),Tp=Object.create,KS=(function(){function t(){}return function(e){if(!sa(e))return{};if(Tp)return Tp(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();function VS(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function XS(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var QS=800,ZS=16,JS=Date.now;function ew(t){var e=0,n=0;return function(){var r=JS(),s=ZS-(r-n);if(n=r,s>0){if(++e>=QS)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function tw(t){return function(){return t}}var Ll=(function(){try{var t=Ja(Object,"defineProperty");return t({},"",{}),t}catch{}})(),nw=Ll?function(t,e){return Ll(t,"toString",{configurable:!0,enumerable:!1,value:tw(e),writable:!0})}:Eb,rw=ew(nw);function sw(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var aw=9007199254740991,iw=/^(?:0|[1-9]\d*)$/;function Tb(t,e){var n=typeof t;return e=e??aw,!!e&&(n=="number"||n!="symbol"&&iw.test(t))&&t>-1&&t%1==0&&t<e}function Mh(t,e,n){e=="__proto__"&&Ll?Ll(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function pu(t,e){return t===e||t!==t&&e!==e}var ow=Object.prototype,uw=ow.hasOwnProperty;function _b(t,e,n){var r=t[e];(!(uw.call(t,e)&&pu(r,n))||n===void 0&&!(e in t))&&Mh(t,e,n)}function lw(t,e,n,r){var s=!n;n||(n={});for(var a=-1,i=e.length;++a<i;){var o=e[a],u=void 0;u===void 0&&(u=t[o]),s?Mh(n,o,u):_b(n,o,u)}return n}var _p=Math.max;function cw(t,e,n){return e=_p(e===void 0?t.length-1:e,0),function(){for(var r=arguments,s=-1,a=_p(r.length-e,0),i=Array(a);++s<a;)i[s]=r[e+s];s=-1;for(var o=Array(e+1);++s<e;)o[s]=r[s];return o[e]=n(i),VS(t,this,o)}}function dw(t,e){return rw(cw(t,e,Eb),t+"")}var fw=9007199254740991;function Ab(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=fw}function nc(t){return t!=null&&Ab(t.length)&&!Ph(t)}function hw(t,e,n){if(!sa(n))return!1;var r=typeof e;return(r=="number"?nc(n)&&Tb(e,n.length):r=="string"&&e in n)?pu(n[e],t):!1}function pw(t){return dw(function(e,n){var r=-1,s=n.length,a=s>1?n[s-1]:void 0,i=s>2?n[2]:void 0;for(a=t.length>3&&typeof a=="function"?(s--,a):void 0,i&&hw(n[0],n[1],i)&&(a=s<3?void 0:a,s=1),e=Object(e);++r<s;){var o=n[r];o&&t(e,o,r,a)}return e})}var mw=Object.prototype;function Bh(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||mw;return t===n}function gw(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var bw="[object Arguments]";function Ap(t){return ys(t)&&eo(t)==bw}var yb=Object.prototype,vw=yb.hasOwnProperty,Ew=yb.propertyIsEnumerable,hf=Ap((function(){return arguments})())?Ap:function(t){return ys(t)&&vw.call(t,"callee")&&!Ew.call(t,"callee")};function Tw(){return!1}var Nb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,yp=Nb&&typeof module=="object"&&module&&!module.nodeType&&module,_w=yp&&yp.exports===Nb,Np=_w?os.Buffer:void 0,Aw=Np?Np.isBuffer:void 0,Wo=Aw||Tw,yw="[object Arguments]",Nw="[object Array]",Sw="[object Boolean]",ww="[object Date]",Iw="[object Error]",Cw="[object Function]",Lw="[object Map]",Ow="[object Number]",xw="[object Object]",Rw="[object RegExp]",Dw="[object Set]",kw="[object String]",Pw="[object WeakMap]",Mw="[object ArrayBuffer]",Bw="[object DataView]",Fw="[object Float32Array]",Uw="[object Float64Array]",Hw="[object Int8Array]",qw="[object Int16Array]",jw="[object Int32Array]",$w="[object Uint8Array]",Yw="[object Uint8ClampedArray]",zw="[object Uint16Array]",Ww="[object Uint32Array]",It={};It[Fw]=It[Uw]=It[Hw]=It[qw]=It[jw]=It[$w]=It[Yw]=It[zw]=It[Ww]=!0;It[yw]=It[Nw]=It[Mw]=It[Sw]=It[Bw]=It[ww]=It[Iw]=It[Cw]=It[Lw]=It[Ow]=It[xw]=It[Rw]=It[Dw]=It[kw]=It[Pw]=!1;function Gw(t){return ys(t)&&Ab(t.length)&&!!It[eo(t)]}function Fh(t){return function(e){return t(e)}}var Sb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,ko=Sb&&typeof module=="object"&&module&&!module.nodeType&&module,Kw=ko&&ko.exports===Sb,zc=Kw&&bb.process,Yi=(function(){try{var t=ko&&ko.require&&ko.require("util").types;return t||zc&&zc.binding&&zc.binding("util")}catch{}})(),Sp=Yi&&Yi.isTypedArray,Uh=Sp?Fh(Sp):Gw,Vw=Object.prototype,Xw=Vw.hasOwnProperty;function wb(t,e){var n=Ya(t),r=!n&&hf(t),s=!n&&!r&&Wo(t),a=!n&&!r&&!s&&Uh(t),i=n||r||s||a,o=i?gw(t.length,String):[],u=o.length;for(var d in t)(e||Xw.call(t,d))&&!(i&&(d=="length"||s&&(d=="offset"||d=="parent")||a&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Tb(d,u)))&&o.push(d);return o}function Ib(t,e){return function(n){return t(e(n))}}var Qw=Ib(Object.keys,Object),Zw=Object.prototype,Jw=Zw.hasOwnProperty;function eI(t){if(!Bh(t))return Qw(t);var e=[];for(var n in Object(t))Jw.call(t,n)&&n!="constructor"&&e.push(n);return e}function tI(t){return nc(t)?wb(t):eI(t)}function nI(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var rI=Object.prototype,sI=rI.hasOwnProperty;function aI(t){if(!sa(t))return nI(t);var e=Bh(t),n=[];for(var r in t)r=="constructor"&&(e||!sI.call(t,r))||n.push(r);return n}function Cb(t){return nc(t)?wb(t,!0):aI(t)}var Go=Ja(Object,"create");function iI(){this.__data__=Go?Go(null):{},this.size=0}function oI(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var uI="__lodash_hash_undefined__",lI=Object.prototype,cI=lI.hasOwnProperty;function dI(t){var e=this.__data__;if(Go){var n=e[t];return n===uI?void 0:n}return cI.call(e,t)?e[t]:void 0}var fI=Object.prototype,hI=fI.hasOwnProperty;function pI(t){var e=this.__data__;return Go?e[t]!==void 0:hI.call(e,t)}var mI="__lodash_hash_undefined__";function gI(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Go&&e===void 0?mI:e,this}function za(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}za.prototype.clear=iI;za.prototype.delete=oI;za.prototype.get=dI;za.prototype.has=pI;za.prototype.set=gI;function bI(){this.__data__=[],this.size=0}function rc(t,e){for(var n=t.length;n--;)if(pu(t[n][0],e))return n;return-1}var vI=Array.prototype,EI=vI.splice;function TI(t){var e=this.__data__,n=rc(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():EI.call(e,n,1),--this.size,!0}function _I(t){var e=this.__data__,n=rc(e,t);return n<0?void 0:e[n][1]}function AI(t){return rc(this.__data__,t)>-1}function yI(t,e){var n=this.__data__,r=rc(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function ws(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}ws.prototype.clear=bI;ws.prototype.delete=TI;ws.prototype.get=_I;ws.prototype.has=AI;ws.prototype.set=yI;var Ko=Ja(os,"Map");function NI(){this.size=0,this.__data__={hash:new za,map:new(Ko||ws),string:new za}}function SI(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function sc(t,e){var n=t.__data__;return SI(e)?n[typeof e=="string"?"string":"hash"]:n.map}function wI(t){var e=sc(this,t).delete(t);return this.size-=e?1:0,e}function II(t){return sc(this,t).get(t)}function CI(t){return sc(this,t).has(t)}function LI(t,e){var n=sc(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function ei(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}ei.prototype.clear=NI;ei.prototype.delete=wI;ei.prototype.get=II;ei.prototype.has=CI;ei.prototype.set=LI;function OI(t,e){for(var n=-1,r=e.length,s=t.length;++n<r;)t[s+n]=e[n];return t}var Lb=Ib(Object.getPrototypeOf,Object),xI="[object Object]",RI=Function.prototype,DI=Object.prototype,Ob=RI.toString,kI=DI.hasOwnProperty,PI=Ob.call(Object);function MI(t){if(!ys(t)||eo(t)!=xI)return!1;var e=Lb(t);if(e===null)return!0;var n=kI.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Ob.call(n)==PI}function BI(){this.__data__=new ws,this.size=0}function FI(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function UI(t){return this.__data__.get(t)}function HI(t){return this.__data__.has(t)}var qI=200;function jI(t,e){var n=this.__data__;if(n instanceof ws){var r=n.__data__;if(!Ko||r.length<qI-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new ei(r)}return n.set(t,e),this.size=n.size,this}function es(t){var e=this.__data__=new ws(t);this.size=e.size}es.prototype.clear=BI;es.prototype.delete=FI;es.prototype.get=UI;es.prototype.has=HI;es.prototype.set=jI;var xb=typeof exports=="object"&&exports&&!exports.nodeType&&exports,wp=xb&&typeof module=="object"&&module&&!module.nodeType&&module,$I=wp&&wp.exports===xb,Ip=$I?os.Buffer:void 0,Cp=Ip?Ip.allocUnsafe:void 0;function Rb(t,e){if(e)return t.slice();var n=t.length,r=Cp?Cp(n):new t.constructor(n);return t.copy(r),r}function YI(t,e){for(var n=-1,r=t==null?0:t.length,s=0,a=[];++n<r;){var i=t[n];e(i,n,t)&&(a[s++]=i)}return a}function zI(){return[]}var WI=Object.prototype,GI=WI.propertyIsEnumerable,Lp=Object.getOwnPropertySymbols,KI=Lp?function(t){return t==null?[]:(t=Object(t),YI(Lp(t),function(e){return GI.call(t,e)}))}:zI;function VI(t,e,n){var r=e(t);return Ya(t)?r:OI(r,n(t))}function pf(t){return VI(t,tI,KI)}var mf=Ja(os,"DataView"),gf=Ja(os,"Promise"),bf=Ja(os,"Set"),Op="[object Map]",XI="[object Object]",xp="[object Promise]",Rp="[object Set]",Dp="[object WeakMap]",kp="[object DataView]",QI=Za(mf),ZI=Za(Ko),JI=Za(gf),eC=Za(bf),tC=Za(ff),_r=eo;(mf&&_r(new mf(new ArrayBuffer(1)))!=kp||Ko&&_r(new Ko)!=Op||gf&&_r(gf.resolve())!=xp||bf&&_r(new bf)!=Rp||ff&&_r(new ff)!=Dp)&&(_r=function(t){var e=eo(t),n=e==XI?t.constructor:void 0,r=n?Za(n):"";if(r)switch(r){case QI:return kp;case ZI:return Op;case JI:return xp;case eC:return Rp;case tC:return Dp}return e});var nC=Object.prototype,rC=nC.hasOwnProperty;function sC(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&rC.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var Ol=os.Uint8Array;function Hh(t){var e=new t.constructor(t.byteLength);return new Ol(e).set(new Ol(t)),e}function aC(t,e){var n=Hh(t.buffer);return new t.constructor(n,t.byteOffset,t.byteLength)}var iC=/\w*$/;function oC(t){var e=new t.constructor(t.source,iC.exec(t));return e.lastIndex=t.lastIndex,e}var Pp=Js?Js.prototype:void 0,Mp=Pp?Pp.valueOf:void 0;function uC(t){return Mp?Object(Mp.call(t)):{}}function Db(t,e){var n=e?Hh(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var lC="[object Boolean]",cC="[object Date]",dC="[object Map]",fC="[object Number]",hC="[object RegExp]",pC="[object Set]",mC="[object String]",gC="[object Symbol]",bC="[object ArrayBuffer]",vC="[object DataView]",EC="[object Float32Array]",TC="[object Float64Array]",_C="[object Int8Array]",AC="[object Int16Array]",yC="[object Int32Array]",NC="[object Uint8Array]",SC="[object Uint8ClampedArray]",wC="[object Uint16Array]",IC="[object Uint32Array]";function CC(t,e,n){var r=t.constructor;switch(e){case bC:return Hh(t);case lC:case cC:return new r(+t);case vC:return aC(t);case EC:case TC:case _C:case AC:case yC:case NC:case SC:case wC:case IC:return Db(t,n);case dC:return new r;case fC:case mC:return new r(t);case hC:return oC(t);case pC:return new r;case gC:return uC(t)}}function kb(t){return typeof t.constructor=="function"&&!Bh(t)?KS(Lb(t)):{}}var LC="[object Map]";function OC(t){return ys(t)&&_r(t)==LC}var Bp=Yi&&Yi.isMap,xC=Bp?Fh(Bp):OC,RC="[object Set]";function DC(t){return ys(t)&&_r(t)==RC}var Fp=Yi&&Yi.isSet,kC=Fp?Fh(Fp):DC,PC=1,Pb="[object Arguments]",MC="[object Array]",BC="[object Boolean]",FC="[object Date]",UC="[object Error]",Mb="[object Function]",HC="[object GeneratorFunction]",qC="[object Map]",jC="[object Number]",Bb="[object Object]",$C="[object RegExp]",YC="[object Set]",zC="[object String]",WC="[object Symbol]",GC="[object WeakMap]",KC="[object ArrayBuffer]",VC="[object DataView]",XC="[object Float32Array]",QC="[object Float64Array]",ZC="[object Int8Array]",JC="[object Int16Array]",e4="[object Int32Array]",t4="[object Uint8Array]",n4="[object Uint8ClampedArray]",r4="[object Uint16Array]",s4="[object Uint32Array]",yt={};yt[Pb]=yt[MC]=yt[KC]=yt[VC]=yt[BC]=yt[FC]=yt[XC]=yt[QC]=yt[ZC]=yt[JC]=yt[e4]=yt[qC]=yt[jC]=yt[Bb]=yt[$C]=yt[YC]=yt[zC]=yt[WC]=yt[t4]=yt[n4]=yt[r4]=yt[s4]=!0;yt[UC]=yt[Mb]=yt[GC]=!1;function ol(t,e,n,r,s,a){var i,o=e&PC;if(i!==void 0)return i;if(!sa(t))return t;var u=Ya(t);if(u)i=sC(t);else{var d=_r(t),h=d==Mb||d==HC;if(Wo(t))return Rb(t,o);if(d==Bb||d==Pb||h&&!s)i=h?{}:kb(t);else{if(!yt[d])return s?t:{};i=CC(t,d,o)}}a||(a=new es);var g=a.get(t);if(g)return g;a.set(t,i),kC(t)?t.forEach(function(b){i.add(ol(b,e,n,b,t,a))}):xC(t)&&t.forEach(function(b,A){i.set(A,ol(b,e,n,A,t,a))});var f=pf,p=u?void 0:f(t);return sw(p||t,function(b,A){p&&(A=b,b=t[A]),_b(i,A,ol(b,e,n,A,t,a))}),i}var a4=1,i4=4;function yi(t){return ol(t,a4|i4)}var o4="__lodash_hash_undefined__";function u4(t){return this.__data__.set(t,o4),this}function l4(t){return this.__data__.has(t)}function xl(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new ei;++e<n;)this.add(t[e])}xl.prototype.add=xl.prototype.push=u4;xl.prototype.has=l4;function c4(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function d4(t,e){return t.has(e)}var f4=1,h4=2;function Fb(t,e,n,r,s,a){var i=n&f4,o=t.length,u=e.length;if(o!=u&&!(i&&u>o))return!1;var d=a.get(t),h=a.get(e);if(d&&h)return d==e&&h==t;var g=-1,f=!0,p=n&h4?new xl:void 0;for(a.set(t,e),a.set(e,t);++g<o;){var b=t[g],A=e[g];if(r)var T=i?r(A,b,g,e,t,a):r(b,A,g,t,e,a);if(T!==void 0){if(T)continue;f=!1;break}if(p){if(!c4(e,function(E,x){if(!d4(p,x)&&(b===E||s(b,E,n,r,a)))return p.push(x)})){f=!1;break}}else if(!(b===A||s(b,A,n,r,a))){f=!1;break}}return a.delete(t),a.delete(e),f}function p4(t){var e=-1,n=Array(t.size);return t.forEach(function(r,s){n[++e]=[s,r]}),n}function m4(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var g4=1,b4=2,v4="[object Boolean]",E4="[object Date]",T4="[object Error]",_4="[object Map]",A4="[object Number]",y4="[object RegExp]",N4="[object Set]",S4="[object String]",w4="[object Symbol]",I4="[object ArrayBuffer]",C4="[object DataView]",Up=Js?Js.prototype:void 0,Wc=Up?Up.valueOf:void 0;function L4(t,e,n,r,s,a,i){switch(n){case C4:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case I4:return!(t.byteLength!=e.byteLength||!a(new Ol(t),new Ol(e)));case v4:case E4:case A4:return pu(+t,+e);case T4:return t.name==e.name&&t.message==e.message;case y4:case S4:return t==e+"";case _4:var o=p4;case N4:var u=r&g4;if(o||(o=m4),t.size!=e.size&&!u)return!1;var d=i.get(t);if(d)return d==e;r|=b4,i.set(t,e);var h=Fb(o(t),o(e),r,s,a,i);return i.delete(t),h;case w4:if(Wc)return Wc.call(t)==Wc.call(e)}return!1}var O4=1,x4=Object.prototype,R4=x4.hasOwnProperty;function D4(t,e,n,r,s,a){var i=n&O4,o=pf(t),u=o.length,d=pf(e),h=d.length;if(u!=h&&!i)return!1;for(var g=u;g--;){var f=o[g];if(!(i?f in e:R4.call(e,f)))return!1}var p=a.get(t),b=a.get(e);if(p&&b)return p==e&&b==t;var A=!0;a.set(t,e),a.set(e,t);for(var T=i;++g<u;){f=o[g];var E=t[f],x=e[f];if(r)var I=i?r(x,E,f,e,t,a):r(E,x,f,t,e,a);if(!(I===void 0?E===x||s(E,x,n,r,a):I)){A=!1;break}T||(T=f=="constructor")}if(A&&!T){var U=t.constructor,P=e.constructor;U!=P&&"constructor"in t&&"constructor"in e&&!(typeof U=="function"&&U instanceof U&&typeof P=="function"&&P instanceof P)&&(A=!1)}return a.delete(t),a.delete(e),A}var k4=1,Hp="[object Arguments]",qp="[object Array]",Hu="[object Object]",P4=Object.prototype,jp=P4.hasOwnProperty;function M4(t,e,n,r,s,a){var i=Ya(t),o=Ya(e),u=i?qp:_r(t),d=o?qp:_r(e);u=u==Hp?Hu:u,d=d==Hp?Hu:d;var h=u==Hu,g=d==Hu,f=u==d;if(f&&Wo(t)){if(!Wo(e))return!1;i=!0,h=!1}if(f&&!h)return a||(a=new es),i||Uh(t)?Fb(t,e,n,r,s,a):L4(t,e,u,n,r,s,a);if(!(n&k4)){var p=h&&jp.call(t,"__wrapped__"),b=g&&jp.call(e,"__wrapped__");if(p||b){var A=p?t.value():t,T=b?e.value():e;return a||(a=new es),s(A,T,n,r,a)}}return f?(a||(a=new es),D4(t,e,n,r,s,a)):!1}function Ub(t,e,n,r,s){return t===e?!0:t==null||e==null||!ys(t)&&!ys(e)?t!==t&&e!==e:M4(t,e,n,r,Ub,s)}function B4(t){return function(e,n,r){for(var s=-1,a=Object(e),i=r(e),o=i.length;o--;){var u=i[++s];if(n(a[u],u,a)===!1)break}return e}}var F4=B4();function vf(t,e,n){(n!==void 0&&!pu(t[e],n)||n===void 0&&!(e in t))&&Mh(t,e,n)}function U4(t){return ys(t)&&nc(t)}function Ef(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function H4(t){return lw(t,Cb(t))}function q4(t,e,n,r,s,a,i){var o=Ef(t,n),u=Ef(e,n),d=i.get(u);if(d){vf(t,n,d);return}var h=a?a(o,u,n+"",t,e,i):void 0,g=h===void 0;if(g){var f=Ya(u),p=!f&&Wo(u),b=!f&&!p&&Uh(u);h=u,f||p||b?Ya(o)?h=o:U4(o)?h=XS(o):p?(g=!1,h=Rb(u,!0)):b?(g=!1,h=Db(u,!0)):h=[]:MI(u)||hf(u)?(h=o,hf(o)?h=H4(o):(!sa(o)||Ph(o))&&(h=kb(u))):g=!1}g&&(i.set(u,h),s(h,u,r,a,i),i.delete(u)),vf(t,n,h)}function Hb(t,e,n,r,s){t!==e&&F4(e,function(a,i){if(s||(s=new es),sa(a))q4(t,e,i,n,Hb,r,s);else{var o=r?r(Ef(t,i),a,i+"",t,e,s):void 0;o===void 0&&(o=a),vf(t,i,o)}},Cb)}function qh(t,e){return Ub(t,e)}var Qs=pw(function(t,e,n){Hb(t,e,n)}),Re=(t=>(t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY",t))(Re||{});class as{constructor(e,n,r={}){this.attrName=e,this.keyName=n;const s=Re.TYPE&Re.ATTRIBUTE;this.scope=r.scope!=null?r.scope&Re.LEVEL|s:Re.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map(n=>n.name)}add(e,n){return this.canAdd(e,n)?(e.setAttribute(this.keyName,n),!0):!1}canAdd(e,n){return this.whitelist==null?!0:typeof n=="string"?this.whitelist.indexOf(n.replace(/["']/g,""))>-1:this.whitelist.indexOf(n)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const n=e.getAttribute(this.keyName);return this.canAdd(e,n)&&n?n:""}}class Ni extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const qb=class Tf{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,n=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(n){let r=null;try{r=e.parentNode}catch{return null}return this.find(r,n)}return null}create(e,n,r){const s=this.query(n);if(s==null)throw new Ni(`Unable to create ${n} blot`);const a=s,i=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:a.create(r),o=new a(e,i,r);return Tf.blots.set(o.domNode,o),o}find(e,n=!1){return Tf.find(e,n)}query(e,n=Re.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&Re.LEVEL&Re.BLOCK?r=this.types.block:e&Re.LEVEL&Re.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(s=>(r=this.classes[s],!!r)),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&n&Re.LEVEL&r.scope&&n&Re.TYPE&r.scope?r:null}register(...e){return e.map(n=>{const r="blotName"in n,s="attrName"in n;if(!r&&!s)throw new Ni("Invalid definition");if(r&&n.blotName==="abstract")throw new Ni("Cannot register abstract class");const a=r?n.blotName:s?n.attrName:void 0;return this.types[a]=n,s?typeof n.keyName=="string"&&(this.attributes[n.keyName]=n):r&&(n.className&&(this.classes[n.className]=n),n.tagName&&(Array.isArray(n.tagName)?n.tagName=n.tagName.map(i=>i.toUpperCase()):n.tagName=n.tagName.toUpperCase(),(Array.isArray(n.tagName)?n.tagName:[n.tagName]).forEach(i=>{(this.tags[i]==null||n.className==null)&&(this.tags[i]=n)}))),n})}};qb.blots=new WeakMap;let zi=qb;function $p(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(n=>n.indexOf(`${e}-`)===0)}class j4 extends as{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(n=>n.split("-").slice(0,-1).join("-"))}add(e,n){return this.canAdd(e,n)?(this.remove(e),e.classList.add(`${this.keyName}-${n}`),!0):!1}remove(e){$p(e,this.keyName).forEach(n=>{e.classList.remove(n)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const n=($p(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,n)?n:""}}const kr=j4;function Gc(t){const e=t.split("-"),n=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+n}class $4 extends as{static keys(e){return(e.getAttribute("style")||"").split(";").map(n=>n.split(":")[0].trim())}add(e,n){return this.canAdd(e,n)?(e.style[Gc(this.keyName)]=n,!0):!1}remove(e){e.style[Gc(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const n=e.style[Gc(this.keyName)];return this.canAdd(e,n)?n:""}}const aa=$4;class Y4{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,n){n?e.add(this.domNode,n)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=zi.find(this.domNode);if(e==null)return;const n=as.keys(this.domNode),r=kr.keys(this.domNode),s=aa.keys(this.domNode);n.concat(r).concat(s).forEach(a=>{const i=e.scroll.query(a,Re.ATTRIBUTE);i instanceof as&&(this.attributes[i.attrName]=i)})}copy(e){Object.keys(this.attributes).forEach(n=>{const r=this.attributes[n].value(this.domNode);e.format(n,r)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(n=>{this.attributes[n].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,n)=>(e[n]=this.attributes[n].value(this.domNode),e),{})}}const ac=Y4,jb=class{constructor(e,n){this.scroll=e,this.domNode=n,zi.blots.set(n,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new Ni("Blot definition missing tagName");let n,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?n=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?n=document.createElement(r):n=document.createElement(this.tagName[0])):n=document.createElement(this.tagName),this.className&&n.classList.add(this.className),n}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),zi.blots.delete(this.domNode)}deleteAt(e,n){this.isolate(e,n).remove()}formatAt(e,n,r,s){const a=this.isolate(e,n);if(this.scroll.query(r,Re.BLOT)!=null&&s)a.wrap(r,s);else if(this.scroll.query(r,Re.ATTRIBUTE)!=null){const i=this.scroll.create(this.statics.scope);a.wrap(i),i.format(r,s)}}insertAt(e,n,r){const s=r==null?this.scroll.create("text",n):this.scroll.create(n,r),a=this.split(e);this.parent.insertBefore(s,a||void 0)}isolate(e,n){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(n),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,n){return e===0?this:this.next}update(e,n){}wrap(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new Ni(`Cannot wrap ${e}`);return r.appendChild(this),r}};jb.blotName="abstract";let $b=jb;const Yb=class extends $b{static value(e){return!0}index(e,n){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(n,1):-1}position(e,n){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Yb.scope=Re.INLINE_BLOT;let z4=Yb;const bn=z4;class W4{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const n=e.slice(1);this.append(...n)}}at(e){const n=this.iterator();let r=n();for(;r&&e>0;)e-=1,r=n();return r}contains(e){const n=this.iterator();let r=n();for(;r;){if(r===e)return!0;r=n()}return!1}indexOf(e){const n=this.iterator();let r=n(),s=0;for(;r;){if(r===e)return s;s+=1,r=n()}return-1}insertBefore(e,n){e!=null&&(this.remove(e),e.next=n,n!=null?(e.prev=n.prev,n.prev!=null&&(n.prev.next=e),n.prev=e,n===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let n=0,r=this.head;for(;r!=null;){if(r===e)return n;n+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const n=e;return e!=null&&(e=e.next),n}}find(e,n=!1){const r=this.iterator();let s=r();for(;s;){const a=s.length();if(e<a||n&&e===a&&(s.next==null||s.next.length()!==0))return[s,e];e-=a,s=r()}return[null,0]}forEach(e){const n=this.iterator();let r=n();for(;r;)e(r),r=n()}forEachAt(e,n,r){if(n<=0)return;const[s,a]=this.find(e);let i=e-a;const o=this.iterator(s);let u=o();for(;u&&i<e+n;){const d=u.length();e>i?r(u,e-i,Math.min(n,i+d-e)):r(u,0,Math.min(d,e+n-i)),i+=d,u=o()}}map(e){return this.reduce((n,r)=>(n.push(e(r)),n),[])}reduce(e,n){const r=this.iterator();let s=r();for(;s;)n=e(n,s),s=r();return n}}function Yp(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch{const r=e.create(Re.INLINE);return Array.from(t.childNodes).forEach(s=>{r.domNode.appendChild(s)}),t.parentNode&&t.parentNode.replaceChild(r.domNode,t),r.attach(),r}}const zb=class Ps extends $b{constructor(e,n){super(e,n),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,Ps.uiClass&&this.uiNode.classList.add(Ps.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new W4,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const n=Yp(e,this.scroll);this.insertBefore(n,this.children.head||void 0)}catch(n){if(n instanceof Ni)return;throw n}})}deleteAt(e,n){if(e===0&&n===this.length())return this.remove();this.children.forEachAt(e,n,(r,s,a)=>{r.deleteAt(s,a)})}descendant(e,n=0){const[r,s]=this.children.find(n);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,s]:r instanceof Ps?r.descendant(e,s):[null,-1]}descendants(e,n=0,r=Number.MAX_VALUE){let s=[],a=r;return this.children.forEachAt(n,r,(i,o,u)=>{(e.blotName==null&&e(i)||e.blotName!=null&&i instanceof e)&&s.push(i),i instanceof Ps&&(s=s.concat(i.descendants(e,o,a))),a-=u}),s}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(n=>{e||this.statics.allowedChildren.some(r=>n instanceof r)||(n.statics.scope===Re.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),e=!0):n instanceof Ps?n.unwrap():n.remove())})}formatAt(e,n,r,s){this.children.forEachAt(e,n,(a,i,o)=>{a.formatAt(i,o,r,s)})}insertAt(e,n,r){const[s,a]=this.children.find(e);if(s)s.insertAt(a,n,r);else{const i=r==null?this.scroll.create("text",n):this.scroll.create(n,r);this.appendChild(i)}}insertBefore(e,n){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,n||null),e.parent=this,n!=null&&(r=n.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce((e,n)=>e+n.length(),0)}moveChildren(e,n){this.children.forEach(r=>{e.insertBefore(r,n)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const n=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(n)}else this.remove()}path(e,n=!1){const[r,s]=this.children.find(e,n),a=[[this,e]];return r instanceof Ps?a.concat(r.path(s,n)):(r!=null&&a.push([r,s]),a)}removeChild(e){this.children.remove(e)}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return r instanceof Ps&&this.moveChildren(r),super.replaceWith(r)}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),(s,a,i)=>{const o=s.split(a,n);o!=null&&r.appendChild(o)}),r}splitAfter(e){const n=this.clone();for(;e.next!=null;)n.appendChild(e.next);return this.parent&&this.parent.insertBefore(n,this.next||void 0),n}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,n){const r=[],s=[];e.forEach(a=>{a.target===this.domNode&&a.type==="childList"&&(r.push(...a.addedNodes),s.push(...a.removedNodes))}),s.forEach(a=>{if(a.parentNode!=null&&a.tagName!=="IFRAME"&&document.body.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const i=this.scroll.find(a);i!=null&&(i.domNode.parentNode==null||i.domNode.parentNode===this.domNode)&&i.detach()}),r.filter(a=>a.parentNode===this.domNode&&a!==this.uiNode).sort((a,i)=>a===i?0:a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(a=>{let i=null;a.nextSibling!=null&&(i=this.scroll.find(a.nextSibling));const o=Yp(a,this.scroll);(o.next!==i||o.next==null)&&(o.parent!=null&&o.parent.removeChild(this),this.insertBefore(o,i||void 0))}),this.enforceAllowedChildren()}};zb.uiClass="";let G4=zb;const Ir=G4;function K4(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}const ci=class di extends Ir{static create(e){return super.create(e)}static formats(e,n){const r=n.query(di.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,n){super(e,n),this.attributes=new ac(this.domNode)}format(e,n){if(e===this.statics.blotName&&!n)this.children.forEach(r=>{r instanceof di||(r=r.wrap(di.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,Re.INLINE);if(r==null)return;r instanceof as?this.attributes.attribute(r,n):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n)}}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,s){this.formats()[r]!=null||this.scroll.query(r,Re.ATTRIBUTE)?this.isolate(e,n).format(r,s):super.formatAt(e,n,r,s)}optimize(e){super.optimize(e);const n=this.formats();if(Object.keys(n).length===0)return this.unwrap();const r=this.next;r instanceof di&&r.prev===this&&K4(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(e,n){const r=super.wrap(e,n);return r instanceof di&&this.attributes.move(r),r}};ci.allowedChildren=[ci,bn],ci.blotName="inline",ci.scope=Re.INLINE_BLOT,ci.tagName="SPAN";let V4=ci;const jh=V4,fi=class _f extends Ir{static create(e){return super.create(e)}static formats(e,n){const r=n.query(_f.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,n){super(e,n),this.attributes=new ac(this.domNode)}format(e,n){const r=this.scroll.query(e,Re.BLOCK);r!=null&&(r instanceof as?this.attributes.attribute(r,n):e===this.statics.blotName&&!n?this.replaceWith(_f.blotName):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n))}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,s){this.scroll.query(r,Re.BLOCK)!=null?this.format(r,s):super.formatAt(e,n,r,s)}insertAt(e,n,r){if(r==null||this.scroll.query(n,Re.INLINE)!=null)super.insertAt(e,n,r);else{const s=this.split(e);if(s!=null){const a=this.scroll.create(n,r);s.parent.insertBefore(a,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};fi.blotName="block",fi.scope=Re.BLOCK_BLOT,fi.tagName="P",fi.allowedChildren=[jh,fi,bn];let X4=fi;const Vo=X4,Af=class extends Ir{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,n){super.deleteAt(e,n),this.enforceAllowedChildren()}formatAt(e,n,r,s){super.formatAt(e,n,r,s),this.enforceAllowedChildren()}insertAt(e,n,r){super.insertAt(e,n,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};Af.blotName="container",Af.scope=Re.BLOCK_BLOT;let Q4=Af;const ic=Q4;class Z4 extends bn{static formats(e,n){}format(e,n){super.formatAt(0,this.length(),e,n)}formatAt(e,n,r,s){e===0&&n===this.length()?this.format(r,s):super.formatAt(e,n,r,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const zn=Z4,J4={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},eL=100,hi=class extends Ir{constructor(e,n){super(null,n),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,J4),this.attach()}create(e,n){return this.registry.create(this,e,n)}find(e,n=!1){const r=this.registry.find(e,n);return r?r.scroll===this?r:n?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,n=Re.ANY){return this.registry.query(e,n)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,n){this.update(),e===0&&n===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(e,n)}formatAt(e,n,r,s){this.update(),super.formatAt(e,n,r,s)}insertAt(e,n,r){this.update(),super.insertAt(e,n,r)}optimize(e=[],n={}){super.optimize(n);const r=n.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)e.push(s.pop());const a=(u,d=!0)=>{u==null||u===this||u.domNode.parentNode!=null&&(r.has(u.domNode)||r.set(u.domNode,[]),d&&a(u.parent))},i=u=>{r.has(u.domNode)&&(u instanceof Ir&&u.children.forEach(i),r.delete(u.domNode),u.optimize(n))};let o=e;for(let u=0;o.length>0;u+=1){if(u>=eL)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach(d=>{const h=this.find(d.target,!0);h!=null&&(h.domNode===d.target&&(d.type==="childList"?(a(this.find(d.previousSibling,!1)),Array.from(d.addedNodes).forEach(g=>{const f=this.find(g,!1);a(f,!1),f instanceof Ir&&f.children.forEach(p=>{a(p,!1)})})):d.type==="attributes"&&a(h.prev)),a(h))}),this.children.forEach(i),o=Array.from(this.observer.takeRecords()),s=o.slice();s.length>0;)e.push(s.pop())}}update(e,n={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(s=>{const a=this.find(s.target,!0);return a==null?null:r.has(a.domNode)?(r.get(a.domNode).push(s),null):(r.set(a.domNode,[s]),a)}).forEach(s=>{s!=null&&s!==this&&r.has(s.domNode)&&s.update(r.get(s.domNode)||[],n)}),n.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),n),this.optimize(e,n)}};hi.blotName="scroll",hi.defaultChild=Vo,hi.allowedChildren=[Vo,ic],hi.scope=Re.BLOCK_BLOT,hi.tagName="DIV";let tL=hi;const $h=tL,yf=class Wb extends bn{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,n){super(e,n),this.text=this.statics.value(this.domNode)}deleteAt(e,n){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+n)}index(e,n){return this.domNode===e?n:-1}insertAt(e,n,r){r==null?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,n,r)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof Wb&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,n=!1){return[this.domNode,e]}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,n){e.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};yf.blotName="text",yf.scope=Re.INLINE_BLOT;let nL=yf;const Rl=nL,rL=Object.freeze(Object.defineProperty({__proto__:null,Attributor:as,AttributorStore:ac,BlockBlot:Vo,ClassAttributor:kr,ContainerBlot:ic,EmbedBlot:zn,InlineBlot:jh,LeafBlot:bn,ParentBlot:Ir,Registry:zi,Scope:Re,ScrollBlot:$h,StyleAttributor:aa,TextBlot:Rl},Symbol.toStringTag,{value:"Module"}));var Ys=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var qu={exports:{}},Kc,zp;function sL(){if(zp)return Kc;zp=1;var t=-1,e=1,n=0;function r(_,M,v,C,R){if(_===M)return _?[[n,_]]:[];if(v!=null){var D=Q(_,M,v);if(D)return D}var W=o(_,M),$=_.substring(0,W);_=_.substring(W),M=M.substring(W),W=d(_,M);var B=_.substring(_.length-W);_=_.substring(0,_.length-W),M=M.substring(0,M.length-W);var Y=s(_,M);return $&&Y.unshift([n,$]),B&&Y.push([n,B]),x(Y,R),C&&g(Y),Y}function s(_,M){var v;if(!_)return[[e,M]];if(!M)return[[t,_]];var C=_.length>M.length?_:M,R=_.length>M.length?M:_,D=C.indexOf(R);if(D!==-1)return v=[[e,C.substring(0,D)],[n,R],[e,C.substring(D+R.length)]],_.length>M.length&&(v[0][0]=v[2][0]=t),v;if(R.length===1)return[[t,_],[e,M]];var W=h(_,M);if(W){var $=W[0],B=W[1],Y=W[2],V=W[3],te=W[4],de=r($,Y),ge=r(B,V);return de.concat([[n,te]],ge)}return a(_,M)}function a(_,M){for(var v=_.length,C=M.length,R=Math.ceil((v+C)/2),D=R,W=2*R,$=new Array(W),B=new Array(W),Y=0;Y<W;Y++)$[Y]=-1,B[Y]=-1;$[D+1]=0,B[D+1]=0;for(var V=v-C,te=V%2!==0,de=0,ge=0,pe=0,Ie=0,le=0;le<R;le++){for(var he=-le+de;he<=le-ge;he+=2){var Ne=D+he,ye;he===-le||he!==le&&$[Ne-1]<$[Ne+1]?ye=$[Ne+1]:ye=$[Ne-1]+1;for(var we=ye-he;ye<v&&we<C&&_.charAt(ye)===M.charAt(we);)ye++,we++;if($[Ne]=ye,ye>v)ge+=2;else if(we>C)de+=2;else if(te){var xe=D+V-he;if(xe>=0&&xe<W&&B[xe]!==-1){var Me=v-B[xe];if(ye>=Me)return i(_,M,ye,we)}}}for(var Ge=-le+pe;Ge<=le-Ie;Ge+=2){var xe=D+Ge,Me;Ge===-le||Ge!==le&&B[xe-1]<B[xe+1]?Me=B[xe+1]:Me=B[xe-1]+1;for(var We=Me-Ge;Me<v&&We<C&&_.charAt(v-Me-1)===M.charAt(C-We-1);)Me++,We++;if(B[xe]=Me,Me>v)Ie+=2;else if(We>C)pe+=2;else if(!te){var Ne=D+V-Ge;if(Ne>=0&&Ne<W&&$[Ne]!==-1){var ye=$[Ne],we=D+ye-Ne;if(Me=v-Me,ye>=Me)return i(_,M,ye,we)}}}}return[[t,_],[e,M]]}function i(_,M,v,C){var R=_.substring(0,v),D=M.substring(0,C),W=_.substring(v),$=M.substring(C),B=r(R,D),Y=r(W,$);return B.concat(Y)}function o(_,M){if(!_||!M||_.charAt(0)!==M.charAt(0))return 0;for(var v=0,C=Math.min(_.length,M.length),R=C,D=0;v<R;)_.substring(D,R)==M.substring(D,R)?(v=R,D=v):C=R,R=Math.floor((C-v)/2+v);return I(_.charCodeAt(R-1))&&R--,R}function u(_,M){var v=_.length,C=M.length;if(v==0||C==0)return 0;v>C?_=_.substring(v-C):v<C&&(M=M.substring(0,v));var R=Math.min(v,C);if(_==M)return R;for(var D=0,W=1;;){var $=_.substring(R-W),B=M.indexOf($);if(B==-1)return D;W+=B,(B==0||_.substring(R-W)==M.substring(0,W))&&(D=W,W++)}}function d(_,M){if(!_||!M||_.slice(-1)!==M.slice(-1))return 0;for(var v=0,C=Math.min(_.length,M.length),R=C,D=0;v<R;)_.substring(_.length-R,_.length-D)==M.substring(M.length-R,M.length-D)?(v=R,D=v):C=R,R=Math.floor((C-v)/2+v);return U(_.charCodeAt(_.length-R))&&R--,R}function h(_,M){var v=_.length>M.length?_:M,C=_.length>M.length?M:_;if(v.length<4||C.length*2<v.length)return null;function R(ge,pe,Ie){for(var le=ge.substring(Ie,Ie+Math.floor(ge.length/4)),he=-1,Ne="",ye,we,xe,Me;(he=pe.indexOf(le,he+1))!==-1;){var Ge=o(ge.substring(Ie),pe.substring(he)),We=d(ge.substring(0,Ie),pe.substring(0,he));Ne.length<We+Ge&&(Ne=pe.substring(he-We,he)+pe.substring(he,he+Ge),ye=ge.substring(0,Ie-We),we=ge.substring(Ie+Ge),xe=pe.substring(0,he-We),Me=pe.substring(he+Ge))}return Ne.length*2>=ge.length?[ye,we,xe,Me,Ne]:null}var D=R(v,C,Math.ceil(v.length/4)),W=R(v,C,Math.ceil(v.length/2)),$;if(!D&&!W)return null;W?D?$=D[4].length>W[4].length?D:W:$=W:$=D;var B,Y,V,te;_.length>M.length?(B=$[0],Y=$[1],V=$[2],te=$[3]):(V=$[0],te=$[1],B=$[2],Y=$[3]);var de=$[4];return[B,Y,V,te,de]}function g(_){for(var M=!1,v=[],C=0,R=null,D=0,W=0,$=0,B=0,Y=0;D<_.length;)_[D][0]==n?(v[C++]=D,W=B,$=Y,B=0,Y=0,R=_[D][1]):(_[D][0]==e?B+=_[D][1].length:Y+=_[D][1].length,R&&R.length<=Math.max(W,$)&&R.length<=Math.max(B,Y)&&(_.splice(v[C-1],0,[t,R]),_[v[C-1]+1][0]=e,C--,C--,D=C>0?v[C-1]:-1,W=0,$=0,B=0,Y=0,R=null,M=!0)),D++;for(M&&x(_),E(_),D=1;D<_.length;){if(_[D-1][0]==t&&_[D][0]==e){var V=_[D-1][1],te=_[D][1],de=u(V,te),ge=u(te,V);de>=ge?(de>=V.length/2||de>=te.length/2)&&(_.splice(D,0,[n,te.substring(0,de)]),_[D-1][1]=V.substring(0,V.length-de),_[D+1][1]=te.substring(de),D++):(ge>=V.length/2||ge>=te.length/2)&&(_.splice(D,0,[n,V.substring(0,ge)]),_[D-1][0]=e,_[D-1][1]=te.substring(0,te.length-ge),_[D+1][0]=t,_[D+1][1]=V.substring(ge),D++),D++}D++}}var f=/[^a-zA-Z0-9]/,p=/\s/,b=/[\r\n]/,A=/\n\r?\n$/,T=/^\r?\n\r?\n/;function E(_){function M(ge,pe){if(!ge||!pe)return 6;var Ie=ge.charAt(ge.length-1),le=pe.charAt(0),he=Ie.match(f),Ne=le.match(f),ye=he&&Ie.match(p),we=Ne&&le.match(p),xe=ye&&Ie.match(b),Me=we&&le.match(b),Ge=xe&&ge.match(A),We=Me&&pe.match(T);return Ge||We?5:xe||Me?4:he&&!ye&&we?3:ye||we?2:he||Ne?1:0}for(var v=1;v<_.length-1;){if(_[v-1][0]==n&&_[v+1][0]==n){var C=_[v-1][1],R=_[v][1],D=_[v+1][1],W=d(C,R);if(W){var $=R.substring(R.length-W);C=C.substring(0,C.length-W),R=$+R.substring(0,R.length-W),D=$+D}for(var B=C,Y=R,V=D,te=M(C,R)+M(R,D);R.charAt(0)===D.charAt(0);){C+=R.charAt(0),R=R.substring(1)+D.charAt(0),D=D.substring(1);var de=M(C,R)+M(R,D);de>=te&&(te=de,B=C,Y=R,V=D)}_[v-1][1]!=B&&(B?_[v-1][1]=B:(_.splice(v-1,1),v--),_[v][1]=Y,V?_[v+1][1]=V:(_.splice(v+1,1),v--))}v++}}function x(_,M){_.push([n,""]);for(var v=0,C=0,R=0,D="",W="",$;v<_.length;){if(v<_.length-1&&!_[v][1]){_.splice(v,1);continue}switch(_[v][0]){case e:R++,W+=_[v][1],v++;break;case t:C++,D+=_[v][1],v++;break;case n:var B=v-R-C-1;if(M){if(B>=0&&ee(_[B][1])){var Y=_[B][1].slice(-1);if(_[B][1]=_[B][1].slice(0,-1),D=Y+D,W=Y+W,!_[B][1]){_.splice(B,1),v--;var V=B-1;_[V]&&_[V][0]===e&&(R++,W=_[V][1]+W,V--),_[V]&&_[V][0]===t&&(C++,D=_[V][1]+D,V--),B=V}}if(P(_[v][1])){var Y=_[v][1].charAt(0);_[v][1]=_[v][1].slice(1),D+=Y,W+=Y}}if(v<_.length-1&&!_[v][1]){_.splice(v,1);break}if(D.length>0||W.length>0){D.length>0&&W.length>0&&($=o(W,D),$!==0&&(B>=0?_[B][1]+=W.substring(0,$):(_.splice(0,0,[n,W.substring(0,$)]),v++),W=W.substring($),D=D.substring($)),$=d(W,D),$!==0&&(_[v][1]=W.substring(W.length-$)+_[v][1],W=W.substring(0,W.length-$),D=D.substring(0,D.length-$)));var te=R+C;D.length===0&&W.length===0?(_.splice(v-te,te),v=v-te):D.length===0?(_.splice(v-te,te,[e,W]),v=v-te+1):W.length===0?(_.splice(v-te,te,[t,D]),v=v-te+1):(_.splice(v-te,te,[t,D],[e,W]),v=v-te+2)}v!==0&&_[v-1][0]===n?(_[v-1][1]+=_[v][1],_.splice(v,1)):v++,R=0,C=0,D="",W="";break}}_[_.length-1][1]===""&&_.pop();var de=!1;for(v=1;v<_.length-1;)_[v-1][0]===n&&_[v+1][0]===n&&(_[v][1].substring(_[v][1].length-_[v-1][1].length)===_[v-1][1]?(_[v][1]=_[v-1][1]+_[v][1].substring(0,_[v][1].length-_[v-1][1].length),_[v+1][1]=_[v-1][1]+_[v+1][1],_.splice(v-1,1),de=!0):_[v][1].substring(0,_[v+1][1].length)==_[v+1][1]&&(_[v-1][1]+=_[v+1][1],_[v][1]=_[v][1].substring(_[v+1][1].length)+_[v+1][1],_.splice(v+1,1),de=!0)),v++;de&&x(_,M)}function I(_){return _>=55296&&_<=56319}function U(_){return _>=56320&&_<=57343}function P(_){return U(_.charCodeAt(0))}function ee(_){return I(_.charCodeAt(_.length-1))}function F(_){for(var M=[],v=0;v<_.length;v++)_[v][1].length>0&&M.push(_[v]);return M}function G(_,M,v,C){return ee(_)||P(C)?null:F([[n,_],[t,M],[e,v],[n,C]])}function Q(_,M,v){var C=typeof v=="number"?{index:v,length:0}:v.oldRange,R=typeof v=="number"?null:v.newRange,D=_.length,W=M.length;if(C.length===0&&(R===null||R.length===0)){var $=C.index,B=_.slice(0,$),Y=_.slice($),V=R?R.index:null;e:{var te=$+W-D;if(V!==null&&V!==te||te<0||te>W)break e;var de=M.slice(0,te),ge=M.slice(te);if(ge!==Y)break e;var pe=Math.min($,te),Ie=B.slice(0,pe),le=de.slice(0,pe);if(Ie!==le)break e;var he=B.slice(pe),Ne=de.slice(pe);return G(Ie,he,Ne,Y)}e:{if(V!==null&&V!==$)break e;var ye=$,de=M.slice(0,ye),ge=M.slice(ye);if(de!==B)break e;var we=Math.min(D-ye,W-ye),xe=Y.slice(Y.length-we),Me=ge.slice(ge.length-we);if(xe!==Me)break e;var he=Y.slice(0,Y.length-we),Ne=ge.slice(0,ge.length-we);return G(B,he,Ne,xe)}}if(C.length>0&&R&&R.length===0)e:{var Ie=_.slice(0,C.index),xe=_.slice(C.index+C.length),pe=Ie.length,we=xe.length;if(W<pe+we)break e;var le=M.slice(0,pe),Me=M.slice(W-we);if(Ie!==le||xe!==Me)break e;var he=_.slice(pe,D-we),Ne=M.slice(pe,W-we);return G(Ie,he,Ne,xe)}return null}function ne(_,M,v,C){return r(_,M,v,C,!0)}return ne.INSERT=e,ne.DELETE=t,ne.EQUAL=n,Kc=ne,Kc}var Eo={exports:{}};Eo.exports;var Wp;function Kb(){return Wp||(Wp=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",i="[object Array]",o="[object Boolean]",u="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",f="[object Map]",p="[object Number]",b="[object Object]",A="[object Promise]",T="[object RegExp]",E="[object Set]",x="[object String]",I="[object Symbol]",U="[object WeakMap]",P="[object ArrayBuffer]",ee="[object DataView]",F="[object Float32Array]",G="[object Float64Array]",Q="[object Int8Array]",ne="[object Int16Array]",_="[object Int32Array]",M="[object Uint8Array]",v="[object Uint8ClampedArray]",C="[object Uint16Array]",R="[object Uint32Array]",D=/[\\^$.*+?()[\]{}|]/g,W=/\w*$/,$=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,Y={};Y[a]=Y[i]=Y[P]=Y[ee]=Y[o]=Y[u]=Y[F]=Y[G]=Y[Q]=Y[ne]=Y[_]=Y[f]=Y[p]=Y[b]=Y[T]=Y[E]=Y[x]=Y[I]=Y[M]=Y[v]=Y[C]=Y[R]=!0,Y[d]=Y[h]=Y[U]=!1;var V=typeof Ys=="object"&&Ys&&Ys.Object===Object&&Ys,te=typeof self=="object"&&self&&self.Object===Object&&self,de=V||te||Function("return this")(),ge=e&&!e.nodeType&&e,pe=ge&&!0&&t&&!t.nodeType&&t,Ie=pe&&pe.exports===ge;function le(m,N){return m.set(N[0],N[1]),m}function he(m,N){return m.add(N),m}function Ne(m,N){for(var H=-1,se=m?m.length:0;++H<se&&N(m[H],H,m)!==!1;);return m}function ye(m,N){for(var H=-1,se=N.length,ze=m.length;++H<se;)m[ze+H]=N[H];return m}function we(m,N,H,se){for(var ze=-1,De=m?m.length:0;++ze<De;)H=N(H,m[ze],ze,m);return H}function xe(m,N){for(var H=-1,se=Array(m);++H<m;)se[H]=N(H);return se}function Me(m,N){return m==null?void 0:m[N]}function Ge(m){var N=!1;if(m!=null&&typeof m.toString!="function")try{N=!!(m+"")}catch{}return N}function We(m){var N=-1,H=Array(m.size);return m.forEach(function(se,ze){H[++N]=[ze,se]}),H}function $t(m,N){return function(H){return m(N(H))}}function He(m){var N=-1,H=Array(m.size);return m.forEach(function(se){H[++N]=se}),H}var Yt=Array.prototype,Zt=Function.prototype,Pt=Object.prototype,Et=de["__core-js_shared__"],Tn=(function(){var m=/[^.]+$/.exec(Et&&Et.keys&&Et.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""})(),Jt=Zt.toString,zt=Pt.hasOwnProperty,Bn=Pt.toString,Wn=RegExp("^"+Jt.call(zt).replace(D,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),wt=Ie?de.Buffer:void 0,xt=de.Symbol,Wt=de.Uint8Array,gt=$t(Object.getPrototypeOf,Object),Ut=Object.create,Mt=Pt.propertyIsEnumerable,Gn=Yt.splice,Kn=Object.getOwnPropertySymbols,fn=wt?wt.isBuffer:void 0,Br=$t(Object.keys,Object),Fr=pr(de,"DataView"),fr=pr(de,"Map"),_n=pr(de,"Promise"),Ur=pr(de,"Set"),Hr=pr(de,"WeakMap"),hr=pr(Object,"create"),qr=Nn(Fr),Ee=Nn(fr),$e=Nn(_n),Ve=Nn(Ur),q=Nn(Hr),z=xt?xt.prototype:void 0,Te=z?z.valueOf:void 0;function Le(m){var N=-1,H=m?m.length:0;for(this.clear();++N<H;){var se=m[N];this.set(se[0],se[1])}}function Fe(){this.__data__=hr?hr(null):{}}function qe(m){return this.has(m)&&delete this.__data__[m]}function ut(m){var N=this.__data__;if(hr){var H=N[m];return H===r?void 0:H}return zt.call(N,m)?N[m]:void 0}function An(m){var N=this.__data__;return hr?N[m]!==void 0:zt.call(N,m)}function an(m,N){var H=this.__data__;return H[m]=hr&&N===void 0?r:N,this}Le.prototype.clear=Fe,Le.prototype.delete=qe,Le.prototype.get=ut,Le.prototype.has=An,Le.prototype.set=an;function bt(m){var N=-1,H=m?m.length:0;for(this.clear();++N<H;){var se=m[N];this.set(se[0],se[1])}}function Cs(){this.__data__=[]}function jr(m){var N=this.__data__,H=lt(N,m);if(H<0)return!1;var se=N.length-1;return H==se?N.pop():Gn.call(N,H,1),!0}function ia(m){var N=this.__data__,H=lt(N,m);return H<0?void 0:N[H][1]}function oa(m){return lt(this.__data__,m)>-1}function ua(m,N){var H=this.__data__,se=lt(H,m);return se<0?H.push([m,N]):H[se][1]=N,this}bt.prototype.clear=Cs,bt.prototype.delete=jr,bt.prototype.get=ia,bt.prototype.has=oa,bt.prototype.set=ua;function Ht(m){var N=-1,H=m?m.length:0;for(this.clear();++N<H;){var se=m[N];this.set(se[0],se[1])}}function la(){this.__data__={hash:new Le,map:new(fr||bt),string:new Le}}function Ls(m){return ma(this,m).delete(m)}function ca(m){return ma(this,m).get(m)}function da(m){return ma(this,m).has(m)}function fa(m,N){return ma(this,m).set(m,N),this}Ht.prototype.clear=la,Ht.prototype.delete=Ls,Ht.prototype.get=ca,Ht.prototype.has=da,Ht.prototype.set=fa;function en(m){this.__data__=new bt(m)}function Os(){this.__data__=new bt}function ha(m){return this.__data__.delete(m)}function pa(m){return this.__data__.get(m)}function rt(m){return this.__data__.has(m)}function Se(m,N){var H=this.__data__;if(H instanceof bt){var se=H.__data__;if(!fr||se.length<n-1)return se.push([m,N]),this;H=this.__data__=new Ht(se)}return H.set(m,N),this}en.prototype.clear=Os,en.prototype.delete=ha,en.prototype.get=pa,en.prototype.has=rt,en.prototype.set=Se;function _e(m,N){var H=no(m)||si(m)?xe(m.length,String):[],se=H.length,ze=!!se;for(var De in m)zt.call(m,De)&&!(ze&&(De=="length"||vc(De,se)))&&H.push(De);return H}function Ye(m,N,H){var se=m[N];(!(zt.call(m,N)&&Au(se,H))||H===void 0&&!(N in m))&&(m[N]=H)}function lt(m,N){for(var H=m.length;H--;)if(Au(m[H][0],N))return H;return-1}function Tt(m,N){return m&&to(N,so(N),m)}function Bt(m,N,H,se,ze,De,ct){var st;if(se&&(st=De?se(m,ze,De,ct):se(m)),st!==void 0)return st;if(!Yr(m))return m;var qt=no(m);if(qt){if(st=gc(m),!N)return hc(m,st)}else{var mt=ls(m),pn=mt==h||mt==g;if(yu(m))return pt(m,N);if(mt==b||mt==a||pn&&!De){if(Ge(m))return De?m:{};if(st=$r(pn?{}:m),!N)return pc(m,Tt(st,m))}else{if(!Y[mt])return De?m:{};st=bc(m,mt,Bt,N)}}ct||(ct=new en);var On=ct.get(m);if(On)return On;if(ct.set(m,st),!qt)var Vt=H?mc(m):so(m);return Ne(Vt||m,function(mn,on){Vt&&(on=mn,mn=m[on]),Ye(st,on,Bt(mn,N,H,se,on,m,ct))}),st}function Gt(m){return Yr(m)?Ut(m):{}}function Kt(m,N,H){var se=N(m);return no(m)?se:ye(se,H(m))}function Vn(m){return Bn.call(m)}function Lt(m){if(!Yr(m)||Tc(m))return!1;var N=ro(m)||Ge(m)?Wn:$;return N.test(Nn(m))}function hn(m){if(!Tu(m))return Br(m);var N=[];for(var H in Object(m))zt.call(m,H)&&H!="constructor"&&N.push(H);return N}function pt(m,N){if(N)return m.slice();var H=new m.constructor(m.length);return m.copy(H),H}function Rt(m){var N=new m.constructor(m.byteLength);return new Wt(N).set(new Wt(m)),N}function yn(m,N){var H=N?Rt(m.buffer):m.buffer;return new m.constructor(H,m.byteOffset,m.byteLength)}function Xn(m,N,H){var se=N?H(We(m),!0):We(m);return we(se,le,new m.constructor)}function Eu(m){var N=new m.constructor(m.source,W.exec(m));return N.lastIndex=m.lastIndex,N}function cc(m,N,H){var se=N?H(He(m),!0):He(m);return we(se,he,new m.constructor)}function dc(m){return Te?Object(Te.call(m)):{}}function fc(m,N){var H=N?Rt(m.buffer):m.buffer;return new m.constructor(H,m.byteOffset,m.length)}function hc(m,N){var H=-1,se=m.length;for(N||(N=Array(se));++H<se;)N[H]=m[H];return N}function to(m,N,H,se){H||(H={});for(var ze=-1,De=N.length;++ze<De;){var ct=N[ze],st=void 0;Ye(H,ct,st===void 0?m[ct]:st)}return H}function pc(m,N){return to(m,us(m),N)}function mc(m){return Kt(m,so,us)}function ma(m,N){var H=m.__data__;return Ec(N)?H[typeof N=="string"?"string":"hash"]:H.map}function pr(m,N){var H=Me(m,N);return Lt(H)?H:void 0}var us=Kn?$t(Kn,Object):Ac,ls=Vn;(Fr&&ls(new Fr(new ArrayBuffer(1)))!=ee||fr&&ls(new fr)!=f||_n&&ls(_n.resolve())!=A||Ur&&ls(new Ur)!=E||Hr&&ls(new Hr)!=U)&&(ls=function(m){var N=Bn.call(m),H=N==b?m.constructor:void 0,se=H?Nn(H):void 0;if(se)switch(se){case qr:return ee;case Ee:return f;case $e:return A;case Ve:return E;case q:return U}return N});function gc(m){var N=m.length,H=m.constructor(N);return N&&typeof m[0]=="string"&&zt.call(m,"index")&&(H.index=m.index,H.input=m.input),H}function $r(m){return typeof m.constructor=="function"&&!Tu(m)?Gt(gt(m)):{}}function bc(m,N,H,se){var ze=m.constructor;switch(N){case P:return Rt(m);case o:case u:return new ze(+m);case ee:return yn(m,se);case F:case G:case Q:case ne:case _:case M:case v:case C:case R:return fc(m,se);case f:return Xn(m,se,H);case p:case x:return new ze(m);case T:return Eu(m);case E:return cc(m,se,H);case I:return dc(m)}}function vc(m,N){return N=N??s,!!N&&(typeof m=="number"||B.test(m))&&m>-1&&m%1==0&&m<N}function Ec(m){var N=typeof m;return N=="string"||N=="number"||N=="symbol"||N=="boolean"?m!=="__proto__":m===null}function Tc(m){return!!Tn&&Tn in m}function Tu(m){var N=m&&m.constructor,H=typeof N=="function"&&N.prototype||Pt;return m===H}function Nn(m){if(m!=null){try{return Jt.call(m)}catch{}try{return m+""}catch{}}return""}function _u(m){return Bt(m,!0,!0)}function Au(m,N){return m===N||m!==m&&N!==N}function si(m){return _c(m)&&zt.call(m,"callee")&&(!Mt.call(m,"callee")||Bn.call(m)==a)}var no=Array.isArray;function ai(m){return m!=null&&Nu(m.length)&&!ro(m)}function _c(m){return Su(m)&&ai(m)}var yu=fn||yc;function ro(m){var N=Yr(m)?Bn.call(m):"";return N==h||N==g}function Nu(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=s}function Yr(m){var N=typeof m;return!!m&&(N=="object"||N=="function")}function Su(m){return!!m&&typeof m=="object"}function so(m){return ai(m)?_e(m):hn(m)}function Ac(){return[]}function yc(){return!1}t.exports=_u})(Eo,Eo.exports)),Eo.exports}var To={exports:{}};To.exports;var Gp;function Vb(){return Gp||(Gp=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=1,a=2,i=9007199254740991,o="[object Arguments]",u="[object Array]",d="[object AsyncFunction]",h="[object Boolean]",g="[object Date]",f="[object Error]",p="[object Function]",b="[object GeneratorFunction]",A="[object Map]",T="[object Number]",E="[object Null]",x="[object Object]",I="[object Promise]",U="[object Proxy]",P="[object RegExp]",ee="[object Set]",F="[object String]",G="[object Symbol]",Q="[object Undefined]",ne="[object WeakMap]",_="[object ArrayBuffer]",M="[object DataView]",v="[object Float32Array]",C="[object Float64Array]",R="[object Int8Array]",D="[object Int16Array]",W="[object Int32Array]",$="[object Uint8Array]",B="[object Uint8ClampedArray]",Y="[object Uint16Array]",V="[object Uint32Array]",te=/[\\^$.*+?()[\]{}|]/g,de=/^\[object .+?Constructor\]$/,ge=/^(?:0|[1-9]\d*)$/,pe={};pe[v]=pe[C]=pe[R]=pe[D]=pe[W]=pe[$]=pe[B]=pe[Y]=pe[V]=!0,pe[o]=pe[u]=pe[_]=pe[h]=pe[M]=pe[g]=pe[f]=pe[p]=pe[A]=pe[T]=pe[x]=pe[P]=pe[ee]=pe[F]=pe[ne]=!1;var Ie=typeof Ys=="object"&&Ys&&Ys.Object===Object&&Ys,le=typeof self=="object"&&self&&self.Object===Object&&self,he=Ie||le||Function("return this")(),Ne=e&&!e.nodeType&&e,ye=Ne&&!0&&t&&!t.nodeType&&t,we=ye&&ye.exports===Ne,xe=we&&Ie.process,Me=(function(){try{return xe&&xe.binding&&xe.binding("util")}catch{}})(),Ge=Me&&Me.isTypedArray;function We(m,N){for(var H=-1,se=m==null?0:m.length,ze=0,De=[];++H<se;){var ct=m[H];N(ct,H,m)&&(De[ze++]=ct)}return De}function $t(m,N){for(var H=-1,se=N.length,ze=m.length;++H<se;)m[ze+H]=N[H];return m}function He(m,N){for(var H=-1,se=m==null?0:m.length;++H<se;)if(N(m[H],H,m))return!0;return!1}function Yt(m,N){for(var H=-1,se=Array(m);++H<m;)se[H]=N(H);return se}function Zt(m){return function(N){return m(N)}}function Pt(m,N){return m.has(N)}function Et(m,N){return m==null?void 0:m[N]}function Tn(m){var N=-1,H=Array(m.size);return m.forEach(function(se,ze){H[++N]=[ze,se]}),H}function Jt(m,N){return function(H){return m(N(H))}}function zt(m){var N=-1,H=Array(m.size);return m.forEach(function(se){H[++N]=se}),H}var Bn=Array.prototype,Wn=Function.prototype,wt=Object.prototype,xt=he["__core-js_shared__"],Wt=Wn.toString,gt=wt.hasOwnProperty,Ut=(function(){var m=/[^.]+$/.exec(xt&&xt.keys&&xt.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""})(),Mt=wt.toString,Gn=RegExp("^"+Wt.call(gt).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Kn=we?he.Buffer:void 0,fn=he.Symbol,Br=he.Uint8Array,Fr=wt.propertyIsEnumerable,fr=Bn.splice,_n=fn?fn.toStringTag:void 0,Ur=Object.getOwnPropertySymbols,Hr=Kn?Kn.isBuffer:void 0,hr=Jt(Object.keys,Object),qr=us(he,"DataView"),Ee=us(he,"Map"),$e=us(he,"Promise"),Ve=us(he,"Set"),q=us(he,"WeakMap"),z=us(Object,"create"),Te=Nn(qr),Le=Nn(Ee),Fe=Nn($e),qe=Nn(Ve),ut=Nn(q),An=fn?fn.prototype:void 0,an=An?An.valueOf:void 0;function bt(m){var N=-1,H=m==null?0:m.length;for(this.clear();++N<H;){var se=m[N];this.set(se[0],se[1])}}function Cs(){this.__data__=z?z(null):{},this.size=0}function jr(m){var N=this.has(m)&&delete this.__data__[m];return this.size-=N?1:0,N}function ia(m){var N=this.__data__;if(z){var H=N[m];return H===r?void 0:H}return gt.call(N,m)?N[m]:void 0}function oa(m){var N=this.__data__;return z?N[m]!==void 0:gt.call(N,m)}function ua(m,N){var H=this.__data__;return this.size+=this.has(m)?0:1,H[m]=z&&N===void 0?r:N,this}bt.prototype.clear=Cs,bt.prototype.delete=jr,bt.prototype.get=ia,bt.prototype.has=oa,bt.prototype.set=ua;function Ht(m){var N=-1,H=m==null?0:m.length;for(this.clear();++N<H;){var se=m[N];this.set(se[0],se[1])}}function la(){this.__data__=[],this.size=0}function Ls(m){var N=this.__data__,H=pt(N,m);if(H<0)return!1;var se=N.length-1;return H==se?N.pop():fr.call(N,H,1),--this.size,!0}function ca(m){var N=this.__data__,H=pt(N,m);return H<0?void 0:N[H][1]}function da(m){return pt(this.__data__,m)>-1}function fa(m,N){var H=this.__data__,se=pt(H,m);return se<0?(++this.size,H.push([m,N])):H[se][1]=N,this}Ht.prototype.clear=la,Ht.prototype.delete=Ls,Ht.prototype.get=ca,Ht.prototype.has=da,Ht.prototype.set=fa;function en(m){var N=-1,H=m==null?0:m.length;for(this.clear();++N<H;){var se=m[N];this.set(se[0],se[1])}}function Os(){this.size=0,this.__data__={hash:new bt,map:new(Ee||Ht),string:new bt}}function ha(m){var N=pr(this,m).delete(m);return this.size-=N?1:0,N}function pa(m){return pr(this,m).get(m)}function rt(m){return pr(this,m).has(m)}function Se(m,N){var H=pr(this,m),se=H.size;return H.set(m,N),this.size+=H.size==se?0:1,this}en.prototype.clear=Os,en.prototype.delete=ha,en.prototype.get=pa,en.prototype.has=rt,en.prototype.set=Se;function _e(m){var N=-1,H=m==null?0:m.length;for(this.__data__=new en;++N<H;)this.add(m[N])}function Ye(m){return this.__data__.set(m,r),this}function lt(m){return this.__data__.has(m)}_e.prototype.add=_e.prototype.push=Ye,_e.prototype.has=lt;function Tt(m){var N=this.__data__=new Ht(m);this.size=N.size}function Bt(){this.__data__=new Ht,this.size=0}function Gt(m){var N=this.__data__,H=N.delete(m);return this.size=N.size,H}function Kt(m){return this.__data__.get(m)}function Vn(m){return this.__data__.has(m)}function Lt(m,N){var H=this.__data__;if(H instanceof Ht){var se=H.__data__;if(!Ee||se.length<n-1)return se.push([m,N]),this.size=++H.size,this;H=this.__data__=new en(se)}return H.set(m,N),this.size=H.size,this}Tt.prototype.clear=Bt,Tt.prototype.delete=Gt,Tt.prototype.get=Kt,Tt.prototype.has=Vn,Tt.prototype.set=Lt;function hn(m,N){var H=si(m),se=!H&&Au(m),ze=!H&&!se&&ai(m),De=!H&&!se&&!ze&&Su(m),ct=H||se||ze||De,st=ct?Yt(m.length,String):[],qt=st.length;for(var mt in m)gt.call(m,mt)&&!(ct&&(mt=="length"||ze&&(mt=="offset"||mt=="parent")||De&&(mt=="buffer"||mt=="byteLength"||mt=="byteOffset")||bc(mt,qt)))&&st.push(mt);return st}function pt(m,N){for(var H=m.length;H--;)if(_u(m[H][0],N))return H;return-1}function Rt(m,N,H){var se=N(m);return si(m)?se:$t(se,H(m))}function yn(m){return m==null?m===void 0?Q:E:_n&&_n in Object(m)?ls(m):Tu(m)}function Xn(m){return Yr(m)&&yn(m)==o}function Eu(m,N,H,se,ze){return m===N?!0:m==null||N==null||!Yr(m)&&!Yr(N)?m!==m&&N!==N:cc(m,N,H,se,Eu,ze)}function cc(m,N,H,se,ze,De){var ct=si(m),st=si(N),qt=ct?u:$r(m),mt=st?u:$r(N);qt=qt==o?x:qt,mt=mt==o?x:mt;var pn=qt==x,On=mt==x,Vt=qt==mt;if(Vt&&ai(m)){if(!ai(N))return!1;ct=!0,pn=!1}if(Vt&&!pn)return De||(De=new Tt),ct||Su(m)?to(m,N,H,se,ze,De):pc(m,N,qt,H,se,ze,De);if(!(H&s)){var mn=pn&&gt.call(m,"__wrapped__"),on=On&&gt.call(N,"__wrapped__");if(mn||on){var xs=mn?m.value():m,cs=on?N.value():N;return De||(De=new Tt),ze(xs,cs,H,se,De)}}return Vt?(De||(De=new Tt),mc(m,N,H,se,ze,De)):!1}function dc(m){if(!Nu(m)||Ec(m))return!1;var N=yu(m)?Gn:de;return N.test(Nn(m))}function fc(m){return Yr(m)&&ro(m.length)&&!!pe[yn(m)]}function hc(m){if(!Tc(m))return hr(m);var N=[];for(var H in Object(m))gt.call(m,H)&&H!="constructor"&&N.push(H);return N}function to(m,N,H,se,ze,De){var ct=H&s,st=m.length,qt=N.length;if(st!=qt&&!(ct&&qt>st))return!1;var mt=De.get(m);if(mt&&De.get(N))return mt==N;var pn=-1,On=!0,Vt=H&a?new _e:void 0;for(De.set(m,N),De.set(N,m);++pn<st;){var mn=m[pn],on=N[pn];if(se)var xs=ct?se(on,mn,pn,N,m,De):se(mn,on,pn,m,N,De);if(xs!==void 0){if(xs)continue;On=!1;break}if(Vt){if(!He(N,function(cs,ga){if(!Pt(Vt,ga)&&(mn===cs||ze(mn,cs,H,se,De)))return Vt.push(ga)})){On=!1;break}}else if(!(mn===on||ze(mn,on,H,se,De))){On=!1;break}}return De.delete(m),De.delete(N),On}function pc(m,N,H,se,ze,De,ct){switch(H){case M:if(m.byteLength!=N.byteLength||m.byteOffset!=N.byteOffset)return!1;m=m.buffer,N=N.buffer;case _:return!(m.byteLength!=N.byteLength||!De(new Br(m),new Br(N)));case h:case g:case T:return _u(+m,+N);case f:return m.name==N.name&&m.message==N.message;case P:case F:return m==N+"";case A:var st=Tn;case ee:var qt=se&s;if(st||(st=zt),m.size!=N.size&&!qt)return!1;var mt=ct.get(m);if(mt)return mt==N;se|=a,ct.set(m,N);var pn=to(st(m),st(N),se,ze,De,ct);return ct.delete(m),pn;case G:if(an)return an.call(m)==an.call(N)}return!1}function mc(m,N,H,se,ze,De){var ct=H&s,st=ma(m),qt=st.length,mt=ma(N),pn=mt.length;if(qt!=pn&&!ct)return!1;for(var On=qt;On--;){var Vt=st[On];if(!(ct?Vt in N:gt.call(N,Vt)))return!1}var mn=De.get(m);if(mn&&De.get(N))return mn==N;var on=!0;De.set(m,N),De.set(N,m);for(var xs=ct;++On<qt;){Vt=st[On];var cs=m[Vt],ga=N[Vt];if(se)var n0=ct?se(ga,cs,Vt,N,m,De):se(cs,ga,Vt,m,N,De);if(!(n0===void 0?cs===ga||ze(cs,ga,H,se,De):n0)){on=!1;break}xs||(xs=Vt=="constructor")}if(on&&!xs){var wu=m.constructor,Iu=N.constructor;wu!=Iu&&"constructor"in m&&"constructor"in N&&!(typeof wu=="function"&&wu instanceof wu&&typeof Iu=="function"&&Iu instanceof Iu)&&(on=!1)}return De.delete(m),De.delete(N),on}function ma(m){return Rt(m,so,gc)}function pr(m,N){var H=m.__data__;return vc(N)?H[typeof N=="string"?"string":"hash"]:H.map}function us(m,N){var H=Et(m,N);return dc(H)?H:void 0}function ls(m){var N=gt.call(m,_n),H=m[_n];try{m[_n]=void 0;var se=!0}catch{}var ze=Mt.call(m);return se&&(N?m[_n]=H:delete m[_n]),ze}var gc=Ur?function(m){return m==null?[]:(m=Object(m),We(Ur(m),function(N){return Fr.call(m,N)}))}:Ac,$r=yn;(qr&&$r(new qr(new ArrayBuffer(1)))!=M||Ee&&$r(new Ee)!=A||$e&&$r($e.resolve())!=I||Ve&&$r(new Ve)!=ee||q&&$r(new q)!=ne)&&($r=function(m){var N=yn(m),H=N==x?m.constructor:void 0,se=H?Nn(H):"";if(se)switch(se){case Te:return M;case Le:return A;case Fe:return I;case qe:return ee;case ut:return ne}return N});function bc(m,N){return N=N??i,!!N&&(typeof m=="number"||ge.test(m))&&m>-1&&m%1==0&&m<N}function vc(m){var N=typeof m;return N=="string"||N=="number"||N=="symbol"||N=="boolean"?m!=="__proto__":m===null}function Ec(m){return!!Ut&&Ut in m}function Tc(m){var N=m&&m.constructor,H=typeof N=="function"&&N.prototype||wt;return m===H}function Tu(m){return Mt.call(m)}function Nn(m){if(m!=null){try{return Wt.call(m)}catch{}try{return m+""}catch{}}return""}function _u(m,N){return m===N||m!==m&&N!==N}var Au=Xn((function(){return arguments})())?Xn:function(m){return Yr(m)&&gt.call(m,"callee")&&!Fr.call(m,"callee")},si=Array.isArray;function no(m){return m!=null&&ro(m.length)&&!yu(m)}var ai=Hr||yc;function _c(m,N){return Eu(m,N)}function yu(m){if(!Nu(m))return!1;var N=yn(m);return N==p||N==b||N==d||N==U}function ro(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=i}function Nu(m){var N=typeof m;return m!=null&&(N=="object"||N=="function")}function Yr(m){return m!=null&&typeof m=="object"}var Su=Ge?Zt(Ge):fc;function so(m){return no(m)?hn(m):hc(m)}function Ac(){return[]}function yc(){return!1}t.exports=_c})(To,To.exports)),To.exports}var ju={},Kp;function aL(){if(Kp)return ju;Kp=1,Object.defineProperty(ju,"__esModule",{value:!0});const t=Kb(),e=Vb();var n;return(function(r){function s(u={},d={},h=!1){typeof u!="object"&&(u={}),typeof d!="object"&&(d={});let g=t(d);h||(g=Object.keys(g).reduce((f,p)=>(g[p]!=null&&(f[p]=g[p]),f),{}));for(const f in u)u[f]!==void 0&&d[f]===void 0&&(g[f]=u[f]);return Object.keys(g).length>0?g:void 0}r.compose=s;function a(u={},d={}){typeof u!="object"&&(u={}),typeof d!="object"&&(d={});const h=Object.keys(u).concat(Object.keys(d)).reduce((g,f)=>(e(u[f],d[f])||(g[f]=d[f]===void 0?null:d[f]),g),{});return Object.keys(h).length>0?h:void 0}r.diff=a;function i(u={},d={}){u=u||{};const h=Object.keys(d).reduce((g,f)=>(d[f]!==u[f]&&u[f]!==void 0&&(g[f]=d[f]),g),{});return Object.keys(u).reduce((g,f)=>(u[f]!==d[f]&&d[f]===void 0&&(g[f]=null),g),h)}r.invert=i;function o(u,d,h=!1){if(typeof u!="object")return d;if(typeof d!="object")return;if(!h)return d;const g=Object.keys(d).reduce((f,p)=>(u[p]===void 0&&(f[p]=d[p]),f),{});return Object.keys(g).length>0?g:void 0}r.transform=o})(n||(n={})),ju.default=n,ju}var $u={},Vp;function Xb(){if(Vp)return $u;Vp=1,Object.defineProperty($u,"__esModule",{value:!0});var t;return(function(e){function n(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}e.length=n})(t||(t={})),$u.default=t,$u}var Yu={},Xp;function iL(){if(Xp)return Yu;Xp=1,Object.defineProperty(Yu,"__esModule",{value:!0});const t=Xb();class e{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const s=this.ops[this.index];if(s){const a=this.offset,i=t.default.length(s);if(r>=i-a?(r=i-a,this.index+=1,this.offset=0):this.offset+=r,typeof s.delete=="number")return{delete:r};{const o={};return s.attributes&&(o.attributes=s.attributes),typeof s.retain=="number"?o.retain=r:typeof s.retain=="object"&&s.retain!==null?o.retain=s.retain:typeof s.insert=="string"?o.insert=s.insert.substr(a,r):o.insert=s.insert,o}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?t.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,s=this.index,a=this.next(),i=this.ops.slice(this.index);return this.offset=r,this.index=s,[a].concat(i)}}else return[]}}return Yu.default=e,Yu}var Qp;function oL(){return Qp||(Qp=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const n=sL(),r=Kb(),s=Vb(),a=aL();e.AttributeMap=a.default;const i=Xb();e.Op=i.default;const o=iL();e.OpIterator=o.default;const u="\0",d=(g,f)=>{if(typeof g!="object"||g===null)throw new Error(`cannot retain a ${typeof g}`);if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);const p=Object.keys(g)[0];if(!p||p!==Object.keys(f)[0])throw new Error(`embed types not matched: ${p} != ${Object.keys(f)[0]}`);return[p,g[p],f[p]]};class h{constructor(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]}static registerEmbed(f,p){this.handlers[f]=p}static unregisterEmbed(f){delete this.handlers[f]}static getHandler(f){const p=this.handlers[f];if(!p)throw new Error(`no handlers for embed type "${f}"`);return p}insert(f,p){const b={};return typeof f=="string"&&f.length===0?this:(b.insert=f,p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(b.attributes=p),this.push(b))}delete(f){return f<=0?this:this.push({delete:f})}retain(f,p){if(typeof f=="number"&&f<=0)return this;const b={retain:f};return p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(b.attributes=p),this.push(b)}push(f){let p=this.ops.length,b=this.ops[p-1];if(f=r(f),typeof b=="object"){if(typeof f.delete=="number"&&typeof b.delete=="number")return this.ops[p-1]={delete:b.delete+f.delete},this;if(typeof b.delete=="number"&&f.insert!=null&&(p-=1,b=this.ops[p-1],typeof b!="object"))return this.ops.unshift(f),this;if(s(f.attributes,b.attributes)){if(typeof f.insert=="string"&&typeof b.insert=="string")return this.ops[p-1]={insert:b.insert+f.insert},typeof f.attributes=="object"&&(this.ops[p-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof b.retain=="number")return this.ops[p-1]={retain:b.retain+f.retain},typeof f.attributes=="object"&&(this.ops[p-1].attributes=f.attributes),this}}return p===this.ops.length?this.ops.push(f):this.ops.splice(p,0,f),this}chop(){const f=this.ops[this.ops.length-1];return f&&typeof f.retain=="number"&&!f.attributes&&this.ops.pop(),this}filter(f){return this.ops.filter(f)}forEach(f){this.ops.forEach(f)}map(f){return this.ops.map(f)}partition(f){const p=[],b=[];return this.forEach(A=>{(f(A)?p:b).push(A)}),[p,b]}reduce(f,p){return this.ops.reduce(f,p)}changeLength(){return this.reduce((f,p)=>p.insert?f+i.default.length(p):p.delete?f-p.delete:f,0)}length(){return this.reduce((f,p)=>f+i.default.length(p),0)}slice(f=0,p=1/0){const b=[],A=new o.default(this.ops);let T=0;for(;T<p&&A.hasNext();){let E;T<f?E=A.next(f-T):(E=A.next(p-T),b.push(E)),T+=i.default.length(E)}return new h(b)}compose(f){const p=new o.default(this.ops),b=new o.default(f.ops),A=[],T=b.peek();if(T!=null&&typeof T.retain=="number"&&T.attributes==null){let x=T.retain;for(;p.peekType()==="insert"&&p.peekLength()<=x;)x-=p.peekLength(),A.push(p.next());T.retain-x>0&&b.next(T.retain-x)}const E=new h(A);for(;p.hasNext()||b.hasNext();)if(b.peekType()==="insert")E.push(b.next());else if(p.peekType()==="delete")E.push(p.next());else{const x=Math.min(p.peekLength(),b.peekLength()),I=p.next(x),U=b.next(x);if(U.retain){const P={};if(typeof I.retain=="number")P.retain=typeof U.retain=="number"?x:U.retain;else if(typeof U.retain=="number")I.retain==null?P.insert=I.insert:P.retain=I.retain;else{const F=I.retain==null?"insert":"retain",[G,Q,ne]=d(I[F],U.retain),_=h.getHandler(G);P[F]={[G]:_.compose(Q,ne,F==="retain")}}const ee=a.default.compose(I.attributes,U.attributes,typeof I.retain=="number");if(ee&&(P.attributes=ee),E.push(P),!b.hasNext()&&s(E.ops[E.ops.length-1],P)){const F=new h(p.rest());return E.concat(F).chop()}}else typeof U.delete=="number"&&(typeof I.retain=="number"||typeof I.retain=="object"&&I.retain!==null)&&E.push(U)}return E.chop()}concat(f){const p=new h(this.ops.slice());return f.ops.length>0&&(p.push(f.ops[0]),p.ops=p.ops.concat(f.ops.slice(1))),p}diff(f,p){if(this.ops===f.ops)return new h;const b=[this,f].map(I=>I.map(U=>{if(U.insert!=null)return typeof U.insert=="string"?U.insert:u;const P=I===f?"on":"with";throw new Error("diff() called "+P+" non-document")}).join("")),A=new h,T=n(b[0],b[1],p,!0),E=new o.default(this.ops),x=new o.default(f.ops);return T.forEach(I=>{let U=I[1].length;for(;U>0;){let P=0;switch(I[0]){case n.INSERT:P=Math.min(x.peekLength(),U),A.push(x.next(P));break;case n.DELETE:P=Math.min(U,E.peekLength()),E.next(P),A.delete(P);break;case n.EQUAL:P=Math.min(E.peekLength(),x.peekLength(),U);const ee=E.next(P),F=x.next(P);s(ee.insert,F.insert)?A.retain(P,a.default.diff(ee.attributes,F.attributes)):A.push(F).delete(P);break}U-=P}}),A.chop()}eachLine(f,p=`
76
+ `){const b=new o.default(this.ops);let A=new h,T=0;for(;b.hasNext();){if(b.peekType()!=="insert")return;const E=b.peek(),x=i.default.length(E)-b.peekLength(),I=typeof E.insert=="string"?E.insert.indexOf(p,x)-x:-1;if(I<0)A.push(b.next());else if(I>0)A.push(b.next(I));else{if(f(A,b.next(1).attributes||{},T)===!1)return;T+=1,A=new h}}A.length()>0&&f(A,{},T)}invert(f){const p=new h;return this.reduce((b,A)=>{if(A.insert)p.delete(i.default.length(A));else{if(typeof A.retain=="number"&&A.attributes==null)return p.retain(A.retain),b+A.retain;if(A.delete||typeof A.retain=="number"){const T=A.delete||A.retain;return f.slice(b,b+T).forEach(x=>{A.delete?p.push(x):A.retain&&A.attributes&&p.retain(i.default.length(x),a.default.invert(A.attributes,x.attributes))}),b+T}else if(typeof A.retain=="object"&&A.retain!==null){const T=f.slice(b,b+1),E=new o.default(T.ops).next(),[x,I,U]=d(A.retain,E.insert),P=h.getHandler(x);return p.retain({[x]:P.invert(I,U)},a.default.invert(A.attributes,E.attributes)),b+1}}return b},0),p.chop()}transform(f,p=!1){if(p=!!p,typeof f=="number")return this.transformPosition(f,p);const b=f,A=new o.default(this.ops),T=new o.default(b.ops),E=new h;for(;A.hasNext()||T.hasNext();)if(A.peekType()==="insert"&&(p||T.peekType()!=="insert"))E.retain(i.default.length(A.next()));else if(T.peekType()==="insert")E.push(T.next());else{const x=Math.min(A.peekLength(),T.peekLength()),I=A.next(x),U=T.next(x);if(I.delete)continue;if(U.delete)E.push(U);else{const P=I.retain,ee=U.retain;let F=typeof ee=="object"&&ee!==null?ee:x;if(typeof P=="object"&&P!==null&&typeof ee=="object"&&ee!==null){const G=Object.keys(P)[0];if(G===Object.keys(ee)[0]){const Q=h.getHandler(G);Q&&(F={[G]:Q.transform(P[G],ee[G],p)})}}E.retain(F,a.default.transform(I.attributes,U.attributes,p))}}return E.chop()}transformPosition(f,p=!1){p=!!p;const b=new o.default(this.ops);let A=0;for(;b.hasNext()&&A<=f;){const T=b.peekLength(),E=b.peekType();if(b.next(),E==="delete"){f-=Math.min(T,f-A);continue}else E==="insert"&&(A<f||!p)&&(f+=T);A+=T}return f}}h.Op=i.default,h.OpIterator=o.default,h.AttributeMap=a.default,h.handlers={},e.default=h,t.exports=h,t.exports.default=h})(qu,qu.exports)),qu.exports}var ir=oL();const Oe=Gb(ir);class Pr extends zn{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Pr.blotName="break";Pr.tagName="BR";let Lr=class extends Rl{};const uL={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function oc(t){return t.replace(/[&<>"']/g,e=>uL[e])}const zr=class zr extends jh{static compare(e,n){const r=zr.order.indexOf(e),s=zr.order.indexOf(n);return r>=0||s>=0?r-s:e===n?0:e<n?-1:1}formatAt(e,n,r,s){if(zr.compare(this.statics.blotName,r)<0&&this.scroll.query(r,Re.BLOT)){const a=this.isolate(e,n);s&&a.wrap(r,s)}else super.formatAt(e,n,r,s)}optimize(e){if(super.optimize(e),this.parent instanceof zr&&zr.compare(this.statics.blotName,this.parent.statics.blotName)>0){const n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}};ve(zr,"allowedChildren",[zr,Pr,zn,Lr]),ve(zr,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let is=zr;const Zp=1;class cn extends Vo{constructor(){super(...arguments);ve(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=Qb(this)),this.cache.delta}deleteAt(n,r){super.deleteAt(n,r),this.cache={}}formatAt(n,r,s,a){r<=0||(this.scroll.query(s,Re.BLOCK)?n+r===this.length()&&this.format(s,a):super.formatAt(n,Math.min(r,this.length()-n-1),s,a),this.cache={})}insertAt(n,r,s){if(s!=null){super.insertAt(n,r,s),this.cache={};return}if(r.length===0)return;const a=r.split(`
77
+ `),i=a.shift();i.length>0&&(n<this.length()-1||this.children.tail==null?super.insertAt(Math.min(n,this.length()-1),i):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});let o=this;a.reduce((u,d)=>(o=o.split(u,!0),o.insertAt(0,d),d.length),n+i.length)}insertBefore(n,r){const{head:s}=this.children;super.insertBefore(n,r),s instanceof Pr&&s.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+Zp),this.cache.length}moveChildren(n,r){super.moveChildren(n,r),this.cache={}}optimize(n){super.optimize(n),this.cache={}}path(n){return super.path(n,!0)}removeChild(n){super.removeChild(n),this.cache={}}split(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(r&&(n===0||n>=this.length()-Zp)){const a=this.clone();return n===0?(this.parent.insertBefore(a,this),this):(this.parent.insertBefore(a,this.next),a)}const s=super.split(n,r);return this.cache={},s}}cn.blotName="block";cn.tagName="P";cn.defaultChild=Pr;cn.allowedChildren=[Pr,is,zn,Lr];class ar extends zn{attach(){super.attach(),this.attributes=new ac(this.domNode)}delta(){return new Oe().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,n){const r=this.scroll.query(e,Re.BLOCK_ATTRIBUTE);r!=null&&this.attributes.attribute(r,n)}formatAt(e,n,r,s){this.format(r,s)}insertAt(e,n,r){if(r!=null){super.insertAt(e,n,r);return}const s=n.split(`
78
+ `),a=s.pop(),i=s.map(u=>{const d=this.scroll.create(cn.blotName);return d.insertAt(0,u),d}),o=this.split(e);i.forEach(u=>{this.parent.insertBefore(u,o)}),a&&this.parent.insertBefore(this.scroll.create("text",a),o)}}ar.scope=Re.BLOCK_BLOT;function Qb(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t.descendants(bn).reduce((n,r)=>r.length()===0?n:n.insert(r.value(),rr(r,{},e)),new Oe).insert(`
79
+ `,rr(t))}function rr(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return t==null||("formats"in t&&typeof t.formats=="function"&&(e={...e,...t.formats()},n&&delete e["code-token"]),t.parent==null||t.parent.statics.blotName==="scroll"||t.parent.statics.scope!==t.statics.scope)?e:rr(t.parent,e,n)}const Qn=class Qn extends zn{static value(){}constructor(e,n,r){super(e,n),this.selection=r,this.textNode=document.createTextNode(Qn.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,n){if(this.savedLength!==0){super.format(e,n);return}let r=this,s=0;for(;r!=null&&r.statics.scope!==Re.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=Qn.CONTENTS.length,r.optimize(),r.formatAt(s,Qn.CONTENTS.length,e,n),this.savedLength=0)}index(e,n){return e===this.textNode?0:super.index(e,n)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const e=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const n=this.prev instanceof Lr?this.prev:null,r=n?n.length():0,s=this.next instanceof Lr?this.next:null,a=s?s.text:"",{textNode:i}=this,o=i.data.split(Qn.CONTENTS).join("");i.data=Qn.CONTENTS;let u;if(n)u=n,(o||s)&&(n.insertAt(n.length(),o+a),s&&s.remove());else if(s)u=s,s.insertAt(0,o);else{const d=document.createTextNode(o);u=this.scroll.create(d),this.parent.insertBefore(u,this)}if(this.remove(),e){const d=(f,p)=>n&&f===n.domNode?p:f===i?r+p-1:s&&f===s.domNode?r+o.length+p:null,h=d(e.start.node,e.start.offset),g=d(e.end.node,e.end.offset);if(h!==null&&g!==null)return{startNode:u.domNode,startOffset:h,endNode:u.domNode,endOffset:g}}return null}update(e,n){if(e.some(r=>r.type==="characterData"&&r.target===this.textNode)){const r=this.restore();r&&(n.range=r)}}optimize(e){super.optimize(e);let{parent:n}=this;for(;n;){if(n.domNode.tagName==="A"){this.savedLength=Qn.CONTENTS.length,n.isolate(this.offset(n),this.length()).unwrap(),this.savedLength=0;break}n=n.parent}}value(){return""}};ve(Qn,"blotName","cursor"),ve(Qn,"className","ql-cursor"),ve(Qn,"tagName","span"),ve(Qn,"CONTENTS","\uFEFF");let Wi=Qn;var Vc={exports:{}},Jp;function lL(){return Jp||(Jp=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(u,d,h){this.fn=u,this.context=d,this.once=h||!1}function a(u,d,h,g,f){if(typeof h!="function")throw new TypeError("The listener must be a function");var p=new s(h,g||u,f),b=n?n+d:d;return u._events[b]?u._events[b].fn?u._events[b]=[u._events[b],p]:u._events[b].push(p):(u._events[b]=p,u._eventsCount++),u}function i(u,d){--u._eventsCount===0?u._events=new r:delete u._events[d]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var d=[],h,g;if(this._eventsCount===0)return d;for(g in h=this._events)e.call(h,g)&&d.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(h)):d},o.prototype.listeners=function(d){var h=n?n+d:d,g=this._events[h];if(!g)return[];if(g.fn)return[g.fn];for(var f=0,p=g.length,b=new Array(p);f<p;f++)b[f]=g[f].fn;return b},o.prototype.listenerCount=function(d){var h=n?n+d:d,g=this._events[h];return g?g.fn?1:g.length:0},o.prototype.emit=function(d,h,g,f,p,b){var A=n?n+d:d;if(!this._events[A])return!1;var T=this._events[A],E=arguments.length,x,I;if(T.fn){switch(T.once&&this.removeListener(d,T.fn,void 0,!0),E){case 1:return T.fn.call(T.context),!0;case 2:return T.fn.call(T.context,h),!0;case 3:return T.fn.call(T.context,h,g),!0;case 4:return T.fn.call(T.context,h,g,f),!0;case 5:return T.fn.call(T.context,h,g,f,p),!0;case 6:return T.fn.call(T.context,h,g,f,p,b),!0}for(I=1,x=new Array(E-1);I<E;I++)x[I-1]=arguments[I];T.fn.apply(T.context,x)}else{var U=T.length,P;for(I=0;I<U;I++)switch(T[I].once&&this.removeListener(d,T[I].fn,void 0,!0),E){case 1:T[I].fn.call(T[I].context);break;case 2:T[I].fn.call(T[I].context,h);break;case 3:T[I].fn.call(T[I].context,h,g);break;case 4:T[I].fn.call(T[I].context,h,g,f);break;default:if(!x)for(P=1,x=new Array(E-1);P<E;P++)x[P-1]=arguments[P];T[I].fn.apply(T[I].context,x)}}return!0},o.prototype.on=function(d,h,g){return a(this,d,h,g,!1)},o.prototype.once=function(d,h,g){return a(this,d,h,g,!0)},o.prototype.removeListener=function(d,h,g,f){var p=n?n+d:d;if(!this._events[p])return this;if(!h)return i(this,p),this;var b=this._events[p];if(b.fn)b.fn===h&&(!f||b.once)&&(!g||b.context===g)&&i(this,p);else{for(var A=0,T=[],E=b.length;A<E;A++)(b[A].fn!==h||f&&!b[A].once||g&&b[A].context!==g)&&T.push(b[A]);T.length?this._events[p]=T.length===1?T[0]:T:i(this,p)}return this},o.prototype.removeAllListeners=function(d){var h;return d?(h=n?n+d:d,this._events[h]&&i(this,h)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,t.exports=o})(Vc)),Vc.exports}var cL=lL();const dL=Gb(cL),Nf=new WeakMap,Sf=["error","warn","log","info"];let wf="warn";function Zb(t){if(wf&&Sf.indexOf(t)<=Sf.indexOf(wf)){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];console[t](...n)}}function Is(t){return Sf.reduce((e,n)=>(e[n]=Zb.bind(console,n,t),e),{})}Is.level=t=>{wf=t};Zb.level=Is.level;const Xc=Is("quill:events"),fL=["selectionchange","mousedown","mouseup","click"];fL.forEach(t=>{document.addEventListener(t,function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach(s=>{const a=Nf.get(s);a&&a.emitter&&a.emitter.handleDOM(...n)})})});class Ce extends dL{constructor(){super(),this.domListeners={},this.on("error",Xc.error)}emit(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Xc.log.call(Xc,...n),super.emit(...n)}handleDOM(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];(this.domListeners[e.type]||[]).forEach(a=>{let{node:i,handler:o}=a;(e.target===i||i.contains(e.target))&&o(e,...r)})}listenDOM(e,n,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:n,handler:r})}}ve(Ce,"events",{EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"}),ve(Ce,"sources",{API:"api",SILENT:"silent",USER:"user"});const Qc=Is("quill:selection");class Wa{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=n}}class hL{constructor(e,n){this.emitter=n,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Wa(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,Ce.sources.USER),1)}),this.emitter.on(Ce.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(Ce.events.SCROLL_UPDATE,(s,a)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const i=a.some(o=>o.type==="characterData"||o.type==="childList"||o.type==="attributes"&&o.target===this.root);this.update(i?Ce.sources.SILENT:s)}catch{}})}),this.emitter.on(Ce.events.SCROLL_OPTIMIZE,(r,s)=>{if(s.range){const{startNode:a,startOffset:i,endNode:o,endOffset:u}=s.range;this.setNativeRange(a,i,o,u),this.update(Ce.sources.SILENT)}}),this.update(Ce.sources.SILENT)}handleComposition(){this.emitter.on(Ce.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(Ce.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout(()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(Ce.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,n){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(e,Re.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof bn){const a=s.split(r.start.offset);s.parent.insertBefore(this.cursor,a)}else s.insertBefore(this.cursor,r.start.node);this.cursor.attach()}this.cursor.format(e,n),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.scroll.length();e=Math.min(e,r-1),n=Math.min(e+n,r-1)-e;let s,[a,i]=this.scroll.leaf(e);if(a==null)return null;if(n>0&&i===a.length()){const[h]=this.scroll.leaf(e+1);if(h){const[g]=this.scroll.line(e),[f]=this.scroll.line(e+1);g===f&&(a=h,i=0)}}[s,i]=a.position(i,!0);const o=document.createRange();if(n>0)return o.setStart(s,i),[a,i]=this.scroll.leaf(e+n),a==null?null:([s,i]=a.position(i,!0),o.setEnd(s,i),o.getBoundingClientRect());let u="left",d;if(s instanceof Text){if(!s.data.length)return null;i<s.data.length?(o.setStart(s,i),o.setEnd(s,i+1)):(o.setStart(s,i-1),o.setEnd(s,i),u="right"),d=o.getBoundingClientRect()}else{if(!(a.domNode instanceof Element))return null;d=a.domNode.getBoundingClientRect(),i>0&&(u="right")}return{bottom:d.top+d.height,height:d.height,left:d[u],right:d[u],top:d.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const n=e.getRangeAt(0);if(n==null)return null;const r=this.normalizeNative(n);return Qc.info("getNativeRange",r),r}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const n=this.getNativeRange();return n==null?[null,null]:[this.normalizedToRange(n),n]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&Zc(this.root,document.activeElement)}normalizedToRange(e){const n=[[e.start.node,e.start.offset]];e.native.collapsed||n.push([e.end.node,e.end.offset]);const r=n.map(i=>{const[o,u]=i,d=this.scroll.find(o,!0),h=d.offset(this.scroll);return u===0?h:d instanceof bn?h+d.index(o,u):h+d.length()}),s=Math.min(Math.max(...r),this.scroll.length()-1),a=Math.min(s,...r);return new Wa(a,s-a)}normalizeNative(e){if(!Zc(this.root,e.startContainer)||!e.collapsed&&!Zc(this.root,e.endContainer))return null;const n={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[n.start,n.end].forEach(r=>{let{node:s,offset:a}=r;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>a)s=s.childNodes[a],a=0;else if(s.childNodes.length===a)s=s.lastChild,s instanceof Text?a=s.data.length:s.childNodes.length>0?a=s.childNodes.length:a=s.childNodes.length+1;else break;r.node=s,r.offset=a}),n}rangeToNative(e){const n=this.scroll.length(),r=(s,a)=>{s=Math.min(n-1,s);const[i,o]=this.scroll.leaf(s);return i?i.position(o,a):[null,-1]};return[...r(e.index,!1),...r(e.index+e.length,!0)]}setNativeRange(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(Qc.info("setNativeRange",e,n,r,s),e!=null&&(this.root.parentNode==null||e.parentNode==null||r.parentNode==null))return;const i=document.getSelection();if(i!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:o}=this.getNativeRange()||{};if(o==null||a||e!==o.startContainer||n!==o.startOffset||r!==o.endContainer||s!==o.endOffset){e instanceof Element&&e.tagName==="BR"&&(n=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),r instanceof Element&&r.tagName==="BR"&&(s=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const u=document.createRange();u.setStart(e,n),u.setEnd(r,s),i.removeAllRanges(),i.addRange(u)}}else i.removeAllRanges(),this.root.blur()}setRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ce.sources.API;if(typeof n=="string"&&(r=n,n=!1),Qc.info("setRange",e),e!=null){const s=this.rangeToNative(e);this.setNativeRange(...s,n)}else this.setNativeRange(null);this.update(r)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ce.sources.USER;const n=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!qh(n,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const i=this.cursor.restore();i&&this.setNativeRange(i.startNode,i.startOffset,i.endNode,i.endOffset)}const a=[Ce.events.SELECTION_CHANGE,yi(this.lastRange),yi(n),e];this.emitter.emit(Ce.events.EDITOR_CHANGE,...a),e!==Ce.sources.SILENT&&this.emitter.emit(...a)}}}function Zc(t,e){try{e.parentNode}catch{return!1}return t.contains(e)}const pL=/^[ -~]*$/;class mL{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let n=this.scroll.length();this.scroll.batchStart();const r=em(e),s=new Oe;return bL(r.ops.slice()).reduce((i,o)=>{const u=ir.Op.length(o);let d=o.attributes||{},h=!1,g=!1;if(o.insert!=null){if(s.retain(u),typeof o.insert=="string"){const b=o.insert;g=!b.endsWith(`
80
+ `)&&(n<=i||!!this.scroll.descendant(ar,i)[0]),this.scroll.insertAt(i,b);const[A,T]=this.scroll.line(i);let E=Qs({},rr(A));if(A instanceof cn){const[x]=A.descendant(bn,T);x&&(E=Qs(E,rr(x)))}d=ir.AttributeMap.diff(E,d)||{}}else if(typeof o.insert=="object"){const b=Object.keys(o.insert)[0];if(b==null)return i;const A=this.scroll.query(b,Re.INLINE)!=null;if(A)(n<=i||this.scroll.descendant(ar,i)[0])&&(g=!0);else if(i>0){const[T,E]=this.scroll.descendant(bn,i-1);T instanceof Lr?T.value()[E]!==`
81
+ `&&(h=!0):T instanceof zn&&T.statics.scope===Re.INLINE_BLOT&&(h=!0)}if(this.scroll.insertAt(i,b,o.insert[b]),A){const[T]=this.scroll.descendant(bn,i);if(T){const E=Qs({},rr(T));d=ir.AttributeMap.diff(E,d)||{}}}}n+=u}else if(s.push(o),o.retain!==null&&typeof o.retain=="object"){const b=Object.keys(o.retain)[0];if(b==null)return i;this.scroll.updateEmbedAt(i,b,o.retain[b])}Object.keys(d).forEach(b=>{this.scroll.formatAt(i,u,b,d[b])});const f=h?1:0,p=g?1:0;return n+=f+p,s.retain(f),s.delete(p),i+u+f+p},0),s.reduce((i,o)=>typeof o.delete=="number"?(this.scroll.deleteAt(i,o.delete),i):i+ir.Op.length(o),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(e,n){return this.scroll.deleteAt(e,n),this.update(new Oe().retain(e).delete(n))}formatLine(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(r).forEach(a=>{this.scroll.lines(e,Math.max(n,1)).forEach(i=>{i.format(a,r[a])})}),this.scroll.optimize();const s=new Oe().retain(e).retain(n,yi(r));return this.update(s)}formatText(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(r).forEach(a=>{this.scroll.formatAt(e,n,a,r[a])});const s=new Oe().retain(e).retain(n,yi(r));return this.update(s)}getContents(e,n){return this.delta.slice(e,e+n)}getDelta(){return this.scroll.lines().reduce((e,n)=>e.concat(n.delta()),new Oe)}getFormat(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],s=[];n===0?this.scroll.path(e).forEach(o=>{const[u]=o;u instanceof cn?r.push(u):u instanceof bn&&s.push(u)}):(r=this.scroll.lines(e,n),s=this.scroll.descendants(bn,e,n));const[a,i]=[r,s].map(o=>{const u=o.shift();if(u==null)return{};let d=rr(u);for(;Object.keys(d).length>0;){const h=o.shift();if(h==null)return d;d=gL(rr(h),d)}return d});return{...a,...i}}getHTML(e,n){const[r,s]=this.scroll.line(e);if(r){const a=r.length();return r.length()>=s+n&&!(s===0&&n===a)?Xo(r,s,n,!0):Xo(this.scroll,e,n,!0)}return""}getText(e,n){return this.getContents(e,n).filter(r=>typeof r.insert=="string").map(r=>r.insert).join("")}insertContents(e,n){const r=em(n),s=new Oe().retain(e).concat(r);return this.scroll.insertContents(e,r),this.update(s)}insertEmbed(e,n,r){return this.scroll.insertAt(e,n,r),this.update(new Oe().retain(e).insert({[n]:r}))}insertText(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return n=n.replace(/\r\n/g,`
82
+ `).replace(/\r/g,`
83
+ `),this.scroll.insertAt(e,n),Object.keys(r).forEach(s=>{this.scroll.formatAt(e,n.length,s,r[s])}),this.update(new Oe().retain(e).insert(n,yi(r)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if((e==null?void 0:e.statics.blotName)!==cn.blotName)return!1;const n=e;return n.children.length>1?!1:n.children.head instanceof Pr}removeFormat(e,n){const r=this.getText(e,n),[s,a]=this.scroll.line(e+n);let i=0,o=new Oe;s!=null&&(i=s.length()-a,o=s.delta().slice(a,a+i-1).insert(`
84
+ `));const d=this.getContents(e,n+i).diff(new Oe().insert(r).concat(o)),h=new Oe().retain(e).concat(d);return this.applyDelta(h)}update(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const s=this.delta;if(n.length===1&&n[0].type==="characterData"&&n[0].target.data.match(pL)&&this.scroll.find(n[0].target)){const a=this.scroll.find(n[0].target),i=rr(a),o=a.offset(this.scroll),u=n[0].oldValue.replace(Wi.CONTENTS,""),d=new Oe().insert(u),h=new Oe().insert(a.value()),g=r&&{oldRange:tm(r.oldRange,-o),newRange:tm(r.newRange,-o)};e=new Oe().retain(o).concat(d.diff(h,g)).reduce((p,b)=>b.insert?p.insert(b.insert,i):p.push(b),new Oe),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!qh(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function pi(t,e,n){if(t.length===0){const[p]=Jc(n.pop());return e<=0?`</li></${p}>`:`</li></${p}>${pi([],e-1,n)}`}const[{child:r,offset:s,length:a,indent:i,type:o},...u]=t,[d,h]=Jc(o);if(i>e)return n.push(o),i===e+1?`<${d}><li${h}>${Xo(r,s,a)}${pi(u,i,n)}`:`<${d}><li>${pi(t,e+1,n)}`;const g=n[n.length-1];if(i===e&&o===g)return`</li><li${h}>${Xo(r,s,a)}${pi(u,i,n)}`;const[f]=Jc(n.pop());return`</li></${f}>${pi(t,e-1,n)}`}function Xo(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in t&&typeof t.html=="function")return t.html(e,n);if(t instanceof Lr)return oc(t.value().slice(e,e+n)).replaceAll(" ","&nbsp;");if(t instanceof Ir){if(t.statics.blotName==="list-container"){const d=[];return t.children.forEachAt(e,n,(h,g,f)=>{const p="formats"in h&&typeof h.formats=="function"?h.formats():{};d.push({child:h,offset:g,length:f,indent:p.indent||0,type:p.list})}),pi(d,-1,[])}const s=[];if(t.children.forEachAt(e,n,(d,h,g)=>{s.push(Xo(d,h,g))}),r||t.statics.blotName==="list")return s.join("");const{outerHTML:a,innerHTML:i}=t.domNode,[o,u]=a.split(`>${i}<`);return o==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${u}`:`${o}>${s.join("")}<${u}`}return t.domNode instanceof Element?t.domNode.outerHTML:""}function gL(t,e){return Object.keys(e).reduce((n,r)=>{if(t[r]==null)return n;const s=e[r];return s===t[r]?n[r]=s:Array.isArray(s)?s.indexOf(t[r])<0?n[r]=s.concat([t[r]]):n[r]=s:n[r]=[s,t[r]],n},{})}function Jc(t){const e=t==="ordered"?"ol":"ul";switch(t){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function em(t){return t.reduce((e,n)=>{if(typeof n.insert=="string"){const r=n.insert.replace(/\r\n/g,`
85
+ `).replace(/\r/g,`
86
+ `);return e.insert(r,n.attributes)}return e.push(n)},new Oe)}function tm(t,e){let{index:n,length:r}=t;return new Wa(n+e,r)}function bL(t){const e=[];return t.forEach(n=>{typeof n.insert=="string"?n.insert.split(`
87
+ `).forEach((s,a)=>{a&&e.push({insert:`
88
+ `,attributes:n.attributes}),s&&e.push({insert:s,attributes:n.attributes})}):e.push(n)}),e}class Mr{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=n}}ve(Mr,"DEFAULTS",{});const zu="\uFEFF";class Yh extends zn{constructor(e,n){super(e,n),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(r=>{this.contentNode.appendChild(r)}),this.leftGuard=document.createTextNode(zu),this.rightGuard=document.createTextNode(zu),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,n){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,n)}restore(e){let n=null,r;const s=e.data.split(zu).join("");if(e===this.leftGuard)if(this.prev instanceof Lr){const a=this.prev.length();this.prev.insertAt(a,s),n={startNode:this.prev.domNode,startOffset:a+s.length}}else r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this),n={startNode:r,startOffset:s.length};else e===this.rightGuard&&(this.next instanceof Lr?(this.next.insertAt(0,s),n={startNode:this.next.domNode,startOffset:s.length}):(r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this.next),n={startNode:r,startOffset:s.length}));return e.data=zu,n}update(e,n){e.forEach(r=>{if(r.type==="characterData"&&(r.target===this.leftGuard||r.target===this.rightGuard)){const s=this.restore(r.target);s&&(n.range=s)}})}}class vL{constructor(e,n){ve(this,"isComposing",!1);this.scroll=e,this.emitter=n,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",e=>{this.isComposing||this.handleCompositionStart(e)}),this.scroll.domNode.addEventListener("compositionend",e=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(e)})})}handleCompositionStart(e){const n=e.target instanceof Node?this.scroll.find(e.target,!0):null;n&&!(n instanceof Yh)&&(this.emitter.emit(Ce.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(Ce.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(Ce.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(Ce.events.COMPOSITION_END,e),this.isComposing=!1}}const Bo=class Bo{constructor(e,n){ve(this,"modules",{});this.quill=e,this.options=n}init(){Object.keys(this.options.modules).forEach(e=>{this.modules[e]==null&&this.addModule(e)})}addModule(e){const n=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new n(this.quill,this.options.modules[e]||{}),this.modules[e]}};ve(Bo,"DEFAULTS",{modules:{}}),ve(Bo,"themes",{default:Bo});let Gi=Bo;const EL=t=>t.parentElement||t.getRootNode().host||null,TL=t=>{const e=t.getBoundingClientRect(),n="offsetWidth"in t&&Math.abs(e.width)/t.offsetWidth||1,r="offsetHeight"in t&&Math.abs(e.height)/t.offsetHeight||1;return{top:e.top,right:e.left+t.clientWidth*n,bottom:e.top+t.clientHeight*r,left:e.left}},Wu=t=>{const e=parseInt(t,10);return Number.isNaN(e)?0:e},nm=(t,e,n,r,s,a)=>t<n&&e>r?0:t<n?-(n-t+s):e>r?e-t>r-n?t+s-n:e-r+a:0,_L=(t,e)=>{var a,i,o;const n=t.ownerDocument;let r=e,s=t;for(;s;){const u=s===n.body,d=u?{top:0,right:((a=window.visualViewport)==null?void 0:a.width)??n.documentElement.clientWidth,bottom:((i=window.visualViewport)==null?void 0:i.height)??n.documentElement.clientHeight,left:0}:TL(s),h=getComputedStyle(s),g=nm(r.left,r.right,d.left,d.right,Wu(h.scrollPaddingLeft),Wu(h.scrollPaddingRight)),f=nm(r.top,r.bottom,d.top,d.bottom,Wu(h.scrollPaddingTop),Wu(h.scrollPaddingBottom));if(g||f)if(u)(o=n.defaultView)==null||o.scrollBy(g,f);else{const{scrollLeft:p,scrollTop:b}=s;f&&(s.scrollTop+=f),g&&(s.scrollLeft+=g);const A=s.scrollLeft-p,T=s.scrollTop-b;r={left:r.left-A,top:r.top-T,right:r.right-A,bottom:r.bottom-T}}s=u||h.position==="fixed"?null:EL(s)}},AL=100,yL=["block","break","cursor","inline","scroll","text"],NL=(t,e,n)=>{const r=new zi;return yL.forEach(s=>{const a=e.query(s);a&&r.register(a)}),t.forEach(s=>{let a=e.query(s);a||n.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let i=0;for(;a;)if(r.register(a),a="blotName"in a?a.requiredContainer??null:null,i+=1,i>AL){n.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),r},Si=Is("quill"),Gu=new zi;Ir.uiClass="ql-ui";const br=class br{static debug(e){e===!0&&(e="log"),Is.level(e)}static find(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Nf.get(e)||Gu.find(e,n)}static import(e){return this.imports[e]==null&&Si.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const e=arguments.length<=0?void 0:arguments[0],n=!!(!(arguments.length<=1)&&arguments[1]),r="attrName"in e?e.attrName:e.blotName;typeof r=="string"?this.register(`formats/${r}`,e,n):Object.keys(e).forEach(s=>{this.register(s,e[s],n)})}else{const e=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],r=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!r&&Si.warn(`Overwriting ${e} with`,n),this.imports[e]=n,(e.startsWith("blots/")||e.startsWith("formats/"))&&n&&typeof n!="boolean"&&n.blotName!=="abstract"&&Gu.register(n),typeof n.register=="function"&&n.register(Gu)}}constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=SL(e,n),this.container=this.options.container,this.container==null){Si.error("Invalid Quill container",e);return}this.options.debug&&br.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Nf.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new Ce;const s=$h.blotName,a=this.options.registry.query(s);if(!a||!("blotName"in a))throw new Error(`Cannot initialize Quill without "${s}" blot`);if(this.scroll=new a(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new mL(this.scroll),this.selection=new hL(this.scroll,this.emitter),this.composition=new vL(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(Ce.events.EDITOR_CHANGE,i=>{i===Ce.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(Ce.events.SCROLL_UPDATE,(i,o)=>{const u=this.selection.lastRange,[d]=this.selection.getRange(),h=u&&d?{oldRange:u,newRange:d}:void 0;mr.call(this,()=>this.editor.update(null,o,h),i)}),this.emitter.on(Ce.events.SCROLL_EMBED_UPDATE,(i,o)=>{const u=this.selection.lastRange,[d]=this.selection.getRange(),h=u&&d?{oldRange:u,newRange:d}:void 0;mr.call(this,()=>{const g=new Oe().retain(i.offset(this)).retain({[i.statics.blotName]:o});return this.editor.update(g,[],h)},br.sources.USER)}),r){const i=this.clipboard.convert({html:`${r}<p><br></p>`,text:`
89
+ `});this.setContents(i)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e=="string"){const r=e;e=document.createElement("div"),e.classList.add(r)}return this.container.insertBefore(e,n),e}blur(){this.selection.setRange(null)}deleteText(e,n,r){return[e,n,,r]=ds(e,n,r),mr.call(this,()=>this.editor.deleteText(e,n),r,e,-1*n)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const n=e();return this.allowReadOnlyEdits=!1,n}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ce.sources.API;return mr.call(this,()=>{const s=this.getSelection(!0);let a=new Oe;if(s==null)return a;if(this.scroll.query(e,Re.BLOCK))a=this.editor.formatLine(s.index,s.length,{[e]:n});else{if(s.length===0)return this.selection.format(e,n),a;a=this.editor.formatText(s.index,s.length,{[e]:n})}return this.setSelection(s,Ce.sources.SILENT),a},r)}formatLine(e,n,r,s,a){let i;return[e,n,i,a]=ds(e,n,r,s,a),mr.call(this,()=>this.editor.formatLine(e,n,i),a,e,0)}formatText(e,n,r,s,a){let i;return[e,n,i,a]=ds(e,n,r,s,a),mr.call(this,()=>this.editor.formatText(e,n,i),a,e,0)}getBounds(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=null;if(typeof e=="number"?r=this.selection.getBounds(e,n):r=this.selection.getBounds(e.index,e.length),!r)return null;const s=this.container.getBoundingClientRect();return{bottom:r.bottom-s.top,height:r.height,left:r.left-s.left,right:r.right-s.left,top:r.top-s.top,width:r.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,n]=ds(e,n),this.editor.getContents(e,n)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e=="number"?this.editor.getFormat(e,n):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e!="number"?this.scroll.lines(e.index,e.length):this.scroll.lines(e,n)}getModule(e){return this.theme.modules[e]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(n=n??this.getLength()-e),[e,n]=ds(e,n),this.editor.getHTML(e,n)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(n=n??this.getLength()-e),[e,n]=ds(e,n),this.editor.getText(e,n)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:br.sources.API;return mr.call(this,()=>this.editor.insertEmbed(e,n,r),s,e)}insertText(e,n,r,s,a){let i;return[e,,i,a]=ds(e,0,r,s,a),mr.call(this,()=>this.editor.insertText(e,n,i),a,e,n.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,n,r){return[e,n,,r]=ds(e,n,r),mr.call(this,()=>this.editor.removeFormat(e,n),r,e)}scrollRectIntoView(e){_L(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const e=this.selection.lastRange,n=e&&this.selection.getBounds(e.index,e.length);n&&this.scrollRectIntoView(n)}setContents(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce.sources.API;return mr.call(this,()=>{e=new Oe(e);const r=this.getLength(),s=this.editor.deleteText(0,r),a=this.editor.insertContents(0,e),i=this.editor.deleteText(this.getLength()-1,1);return s.compose(a).compose(i)},n)}setSelection(e,n,r){e==null?this.selection.setRange(null,n||br.sources.API):([e,n,,r]=ds(e,n,r),this.selection.setRange(new Wa(Math.max(0,e),n),r),r!==Ce.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce.sources.API;const r=new Oe().insert(e);return this.setContents(r,n)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ce.sources.USER;const n=this.scroll.update(e);return this.selection.update(e),n}updateContents(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ce.sources.API;return mr.call(this,()=>(e=new Oe(e),this.editor.applyDelta(e)),n,!0)}};ve(br,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:Gu,theme:"default"}),ve(br,"events",Ce.events),ve(br,"sources",Ce.sources),ve(br,"version","2.0.3"),ve(br,"imports",{delta:Oe,parchment:rL,"core/module":Mr,"core/theme":Gi});let oe=br;function rm(t){return typeof t=="string"?document.querySelector(t):t}function ed(t){return Object.entries(t??{}).reduce((e,n)=>{let[r,s]=n;return{...e,[r]:s===!0?{}:s}},{})}function sm(t){return Object.fromEntries(Object.entries(t).filter(e=>e[1]!==void 0))}function SL(t,e){const n=rm(t);if(!n)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===oe.DEFAULTS.theme?Gi:oe.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:a,...i}=oe.DEFAULTS,{modules:o,...u}=s.DEFAULTS;let d=ed(e.modules);d!=null&&d.toolbar&&d.toolbar.constructor!==Object&&(d={...d,toolbar:{container:d.toolbar}});const h=Qs({},ed(a),ed(o),d),g={...i,...sm(u),...sm(e)};let f=e.registry;return f?e.formats&&Si.warn('Ignoring "formats" option because "registry" is specified'):f=e.formats?NL(e.formats,g.registry,Si):g.registry,{...g,registry:f,container:n,theme:s,modules:Object.entries(h).reduce((p,b)=>{let[A,T]=b;if(!T)return p;const E=oe.import(`modules/${A}`);return E==null?(Si.error(`Cannot load ${A} module. Are you sure you registered it?`),p):{...p,[A]:Qs({},E.DEFAULTS||{},T)}},{}),bounds:rm(g.bounds)}}function mr(t,e,n,r){if(!this.isEnabled()&&e===Ce.sources.USER&&!this.allowReadOnlyEdits)return new Oe;let s=n==null?null:this.getSelection();const a=this.editor.delta,i=t();if(s!=null&&(n===!0&&(n=s.index),r==null?s=am(s,i,e):r!==0&&(s=am(s,n,r,e)),this.setSelection(s,Ce.sources.SILENT)),i.length()>0){const o=[Ce.events.TEXT_CHANGE,i,a,e];this.emitter.emit(Ce.events.EDITOR_CHANGE,...o),e!==Ce.sources.SILENT&&this.emitter.emit(...o)}return i}function ds(t,e,n,r,s){let a={};return typeof t.index=="number"&&typeof t.length=="number"?typeof e!="number"?(s=r,r=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):typeof e!="number"&&(s=r,r=n,n=e,e=0),typeof n=="object"?(a=n,s=r):typeof n=="string"&&(r!=null?a[n]=r:s=n),s=s||Ce.sources.API,[t,e,a,s]}function am(t,e,n,r){const s=typeof n=="number"?n:0;if(t==null)return null;let a,i;return e&&typeof e.transformPosition=="function"?[a,i]=[t.index,t.index+t.length].map(o=>e.transformPosition(o,r!==Ce.sources.USER)):[a,i]=[t.index,t.index+t.length].map(o=>o<e||o===e&&r===Ce.sources.USER?o:s>=0?o+s:Math.max(e,o+s)),new Wa(a,i-a)}class ti extends ic{}function im(t){return t instanceof cn||t instanceof ar}function om(t){return typeof t.updateContent=="function"}class mi extends $h{constructor(e,n,r){let{emitter:s}=r;super(e,n),this.emitter=s,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",a=>this.handleDragStart(a))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(Ce.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(Ce.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,n){this.emitter.emit(Ce.events.SCROLL_EMBED_UPDATE,e,n)}deleteAt(e,n){const[r,s]=this.line(e),[a]=this.line(e+n);if(super.deleteAt(e,n),a!=null&&r!==a&&s>0){if(r instanceof ar||a instanceof ar){this.optimize();return}const i=a.children.head instanceof Pr?null:a.children.head;r.moveChildren(a,i),r.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,n,r,s){super.formatAt(e,n,r,s),this.optimize()}insertAt(e,n,r){if(e>=this.length())if(r==null||this.scroll.query(n,Re.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),r==null&&n.endsWith(`
90
+ `)?s.insertAt(0,n.slice(0,-1),r):s.insertAt(0,n,r)}else{const s=this.scroll.create(n,r);this.appendChild(s)}else super.insertAt(e,n,r);this.optimize()}insertBefore(e,n){if(e.statics.scope===Re.INLINE_BLOT){const r=this.scroll.create(this.statics.defaultChild.blotName);r.appendChild(e),super.insertBefore(r,n)}else super.insertBefore(e,n)}insertContents(e,n){const r=this.deltaToRenderBlocks(n.concat(new Oe().insert(`
91
+ `))),s=r.pop();if(s==null)return;this.batchStart();const a=r.shift();if(a){const u=a.type==="block"&&(a.delta.length()===0||!this.descendant(ar,e)[0]&&e<this.length()),d=a.type==="block"?a.delta:new Oe().insert({[a.key]:a.value});td(this,e,d);const h=a.type==="block"?1:0,g=e+d.length()+h;u&&this.insertAt(g-1,`
92
+ `);const f=rr(this.line(e)[0]),p=ir.AttributeMap.diff(f,a.attributes)||{};Object.keys(p).forEach(b=>{this.formatAt(g-1,1,b,p[b])}),e=g}let[i,o]=this.children.find(e);if(r.length&&(i&&(i=i.split(o),o=0),r.forEach(u=>{if(u.type==="block"){const d=this.createBlock(u.attributes,i||void 0);td(d,0,u.delta)}else{const d=this.create(u.key,u.value);this.insertBefore(d,i||void 0),Object.keys(u.attributes).forEach(h=>{d.format(h,u.attributes[h])})}})),s.type==="block"&&s.delta.length()){const u=i?i.offset(i.scroll)+o:this.length();td(this,u,s.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(e){const n=this.path(e).pop();if(!n)return[null,-1];const[r,s]=n;return r instanceof bn?[r,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(im,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const r=(s,a,i)=>{let o=[],u=i;return s.children.forEachAt(a,i,(d,h,g)=>{im(d)?o.push(d):d instanceof ic&&(o=o.concat(r(d,h,u))),u-=g}),o};return r(this,e,n)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,n),e.length>0&&this.emitter.emit(Ce.events.SCROLL_OPTIMIZE,e,n))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch){Array.isArray(e)&&(this.batch=this.batch.concat(e));return}let n=Ce.sources.USER;typeof e=="string"&&(n=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter(r=>{let{target:s}=r;const a=this.find(s,!0);return a&&!om(a)}),e.length>0&&this.emitter.emit(Ce.events.SCROLL_BEFORE_UPDATE,n,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(Ce.events.SCROLL_UPDATE,n,e)}updateEmbedAt(e,n,r){const[s]=this.descendant(a=>a instanceof ar,e);s&&s.statics.blotName===n&&om(s)&&s.updateContent(r)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const n=[];let r=new Oe;return e.forEach(s=>{const a=s==null?void 0:s.insert;if(a)if(typeof a=="string"){const i=a.split(`
93
+ `);i.slice(0,-1).forEach(u=>{r.insert(u,s.attributes),n.push({type:"block",delta:r,attributes:s.attributes??{}}),r=new Oe});const o=i[i.length-1];o&&r.insert(o,s.attributes)}else{const i=Object.keys(a)[0];if(!i)return;this.query(i,Re.INLINE)?r.push(s):(r.length()&&n.push({type:"block",delta:r,attributes:{}}),r=new Oe,n.push({type:"blockEmbed",key:i,value:a[i],attributes:s.attributes??{}}))}}),r.length()&&n.push({type:"block",delta:r,attributes:{}}),n}createBlock(e,n){let r;const s={};Object.entries(e).forEach(o=>{let[u,d]=o;this.query(u,Re.BLOCK&Re.BLOT)!=null?r=u:s[u]=d});const a=this.create(r||this.statics.defaultChild.blotName,r?e[r]:void 0);this.insertBefore(a,n||void 0);const i=a.length();return Object.entries(s).forEach(o=>{let[u,d]=o;a.formatAt(0,i,u,d)}),a}}ve(mi,"blotName","scroll"),ve(mi,"className","ql-editor"),ve(mi,"tagName","DIV"),ve(mi,"defaultChild",cn),ve(mi,"allowedChildren",[cn,ar,ti]);function td(t,e,n){n.reduce((r,s)=>{const a=ir.Op.length(s);let i=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const o=s.insert;t.insertAt(r,o);const[u]=t.descendant(bn,r),d=rr(u);i=ir.AttributeMap.diff(d,i)||{}}else if(typeof s.insert=="object"){const o=Object.keys(s.insert)[0];if(o==null)return r;if(t.insertAt(r,o,s.insert[o]),t.scroll.query(o,Re.INLINE)!=null){const[d]=t.descendant(bn,r),h=rr(d);i=ir.AttributeMap.diff(h,i)||{}}}}return Object.keys(i).forEach(o=>{t.formatAt(r,a,o,i[o])}),r+a},e)}const zh={scope:Re.BLOCK,whitelist:["right","center","justify"]},wL=new as("align","align",zh),Jb=new kr("align","ql-align",zh),ev=new aa("align","text-align",zh);class tv extends aa{value(e){let n=super.value(e);return n.startsWith("rgb(")?(n=n.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${n.split(",").map(s=>`00${parseInt(s,10).toString(16)}`.slice(-2)).join("")}`):n}}const IL=new kr("color","ql-color",{scope:Re.INLINE}),Wh=new tv("color","color",{scope:Re.INLINE}),CL=new kr("background","ql-bg",{scope:Re.INLINE}),Gh=new tv("background","background-color",{scope:Re.INLINE});class ni extends ti{static create(e){const n=super.create(e);return n.setAttribute("spellcheck","false"),n}code(e,n){return this.children.map(r=>r.length()<=1?"":r.domNode.innerText).join(`
94
+ `).slice(e,e+n)}html(e,n){return`<pre>
95
+ ${oc(this.code(e,n))}
96
+ </pre>`}}class vn extends cn{static register(){oe.register(ni)}}ve(vn,"TAB"," ");class Kh extends is{}Kh.blotName="code";Kh.tagName="CODE";vn.blotName="code-block";vn.className="ql-code-block";vn.tagName="DIV";ni.blotName="code-block-container";ni.className="ql-code-block-container";ni.tagName="DIV";ni.allowedChildren=[vn];vn.allowedChildren=[Lr,Pr,Wi];vn.requiredContainer=ni;const Vh={scope:Re.BLOCK,whitelist:["rtl"]},nv=new as("direction","dir",Vh),rv=new kr("direction","ql-direction",Vh),sv=new aa("direction","direction",Vh),av={scope:Re.INLINE,whitelist:["serif","monospace"]},iv=new kr("font","ql-font",av);class LL extends aa{value(e){return super.value(e).replace(/["']/g,"")}}const ov=new LL("font","font-family",av),uv=new kr("size","ql-size",{scope:Re.INLINE,whitelist:["small","large","huge"]}),lv=new aa("size","font-size",{scope:Re.INLINE,whitelist:["10px","18px","32px"]}),OL=Is("quill:keyboard"),xL=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class uc extends Mr{static match(e,n){return["altKey","ctrlKey","metaKey","shiftKey"].some(r=>!!n[r]!==e[r]&&n[r]!==null)?!1:n.key===e.key||n.key===e.which}constructor(e,n){super(e,n),this.bindings={},Object.keys(this.options.bindings).forEach(r=>{this.options.bindings[r]&&this.addBinding(this.options.bindings[r])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=DL(e);if(s==null){OL.warn("Attempted to add invalid keyboard binding",s);return}typeof n=="function"&&(n={handler:n}),typeof r=="function"&&(r={handler:r}),(Array.isArray(s.key)?s.key:[s.key]).forEach(i=>{const o={...s,key:i,...n,...r};this.bindings[o.key]=this.bindings[o.key]||[],this.bindings[o.key].push(o)})}listen(){this.quill.root.addEventListener("keydown",e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const s=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(E=>uc.match(e,E));if(s.length===0)return;const a=oe.find(e.target,!0);if(a&&a.scroll!==this.quill.scroll)return;const i=this.quill.getSelection();if(i==null||!this.quill.hasFocus())return;const[o,u]=this.quill.getLine(i.index),[d,h]=this.quill.getLeaf(i.index),[g,f]=i.length===0?[d,h]:this.quill.getLeaf(i.index+i.length),p=d instanceof Rl?d.value().slice(0,h):"",b=g instanceof Rl?g.value().slice(f):"",A={collapsed:i.length===0,empty:i.length===0&&o.length()<=1,format:this.quill.getFormat(i),line:o,offset:u,prefix:p,suffix:b,event:e};s.some(E=>{if(E.collapsed!=null&&E.collapsed!==A.collapsed||E.empty!=null&&E.empty!==A.empty||E.offset!=null&&E.offset!==A.offset)return!1;if(Array.isArray(E.format)){if(E.format.every(x=>A.format[x]==null))return!1}else if(typeof E.format=="object"&&!Object.keys(E.format).every(x=>E.format[x]===!0?A.format[x]!=null:E.format[x]===!1?A.format[x]==null:qh(E.format[x],A.format[x])))return!1;return E.prefix!=null&&!E.prefix.test(A.prefix)||E.suffix!=null&&!E.suffix.test(A.suffix)?!1:E.handler.call(this,i,A,E)!==!0})&&e.preventDefault()})}handleBackspace(e,n){const r=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(n.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let s={};const[a]=this.quill.getLine(e.index);let i=new Oe().retain(e.index-r).delete(r);if(n.offset===0){const[o]=this.quill.getLine(e.index-1);if(o&&!(o.statics.blotName==="block"&&o.length()<=1)){const d=a.formats(),h=this.quill.getFormat(e.index-1,1);if(s=ir.AttributeMap.diff(d,h)||{},Object.keys(s).length>0){const g=new Oe().retain(e.index+a.length()-2).retain(1,s);i=i.compose(g)}}}this.quill.updateContents(i,oe.sources.USER),this.quill.focus()}handleDelete(e,n){const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(n.suffix)?2:1;if(e.index>=this.quill.getLength()-r)return;let s={};const[a]=this.quill.getLine(e.index);let i=new Oe().retain(e.index).delete(r);if(n.offset>=a.length()-1){const[o]=this.quill.getLine(e.index+1);if(o){const u=a.formats(),d=this.quill.getFormat(e.index,1);s=ir.AttributeMap.diff(u,d)||{},Object.keys(s).length>0&&(i=i.retain(o.length()-1).retain(1,s))}}this.quill.updateContents(i,oe.sources.USER),this.quill.focus()}handleDeleteRange(e){Xh({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,n){const r=Object.keys(n.format).reduce((a,i)=>(this.quill.scroll.query(i,Re.BLOCK)&&!Array.isArray(n.format[i])&&(a[i]=n.format[i]),a),{}),s=new Oe().retain(e.index).delete(e.length).insert(`
97
+ `,r);this.quill.updateContents(s,oe.sources.USER),this.quill.setSelection(e.index+1,oe.sources.SILENT),this.quill.focus()}}const RL={bindings:{bold:nd("bold"),italic:nd("italic"),underline:nd("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(t,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",oe.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(t,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","-1",oe.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(t,e){e.format.indent!=null?this.quill.format("indent","-1",oe.sources.USER):e.format.list!=null&&this.quill.format("list",!1,oe.sources.USER)}},"indent code-block":um(!0),"outdent code-block":um(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(t){this.quill.deleteText(t.index-1,1,oe.sources.USER)}},tab:{key:"Tab",handler(t,e){if(e.format.table)return!0;this.quill.history.cutoff();const n=new Oe().retain(t.index).delete(t.length).insert(" ");return this.quill.updateContents(n,oe.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,oe.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,oe.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(t,e){const n={list:!1};e.format.indent&&(n.indent=!1),this.quill.formatLine(t.index,t.length,n,oe.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(t){const[e,n]=this.quill.getLine(t.index),r={...e.formats(),list:"checked"},s=new Oe().retain(t.index).insert(`
98
+ `,r).retain(e.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,oe.sources.USER),this.quill.setSelection(t.index+1,oe.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(t,e){const[n,r]=this.quill.getLine(t.index),s=new Oe().retain(t.index).insert(`
99
+ `,e.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(s,oe.sources.USER),this.quill.setSelection(t.index+1,oe.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(t){const e=this.quill.getModule("table");if(e){const[n,r,s,a]=e.getTable(t),i=kL(n,r,s,a);if(i==null)return;let o=n.offset();if(i<0){const u=new Oe().retain(o).insert(`
100
+ `);this.quill.updateContents(u,oe.sources.USER),this.quill.setSelection(t.index+1,t.length,oe.sources.SILENT)}else if(i>0){o+=n.length();const u=new Oe().retain(o).insert(`
101
+ `);this.quill.updateContents(u,oe.sources.USER),this.quill.setSelection(o,oe.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(t,e){const{event:n,line:r}=e,s=r.offset(this.quill.scroll);n.shiftKey?this.quill.setSelection(s-1,oe.sources.USER):this.quill.setSelection(s+r.length(),oe.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(t,e){if(this.quill.scroll.query("list")==null)return!0;const{length:n}=e.prefix,[r,s]=this.quill.getLine(t.index);if(s>n)return!0;let a;switch(e.prefix.trim()){case"[]":case"[ ]":a="unchecked";break;case"[x]":a="checked";break;case"-":case"*":a="bullet";break;default:a="ordered"}this.quill.insertText(t.index," ",oe.sources.USER),this.quill.history.cutoff();const i=new Oe().retain(t.index-s).delete(n+1).retain(r.length()-2-s).retain(1,{list:a});return this.quill.updateContents(i,oe.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,oe.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(t){const[e,n]=this.quill.getLine(t.index);let r=2,s=e;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,r-=1,r<=0){const a=new Oe().retain(t.index+e.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(a,oe.sources.USER),this.quill.setSelection(t.index-1,oe.sources.SILENT),!1}return!0}},"embed left":Ku("ArrowLeft",!1),"embed left shift":Ku("ArrowLeft",!0),"embed right":Ku("ArrowRight",!1),"embed right shift":Ku("ArrowRight",!0),"table down":lm(!1),"table up":lm(!0)}};uc.DEFAULTS=RL;function um(t){return{key:"Tab",shiftKey:!t,format:{"code-block":!0},handler(e,n){let{event:r}=n;const s=this.quill.scroll.query("code-block"),{TAB:a}=s;if(e.length===0&&!r.shiftKey){this.quill.insertText(e.index,a,oe.sources.USER),this.quill.setSelection(e.index+a.length,oe.sources.SILENT);return}const i=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:o,length:u}=e;i.forEach((d,h)=>{t?(d.insertAt(0,a),h===0?o+=a.length:u+=a.length):d.domNode.textContent.startsWith(a)&&(d.deleteAt(0,a.length),h===0?o-=a.length:u-=a.length)}),this.quill.update(oe.sources.USER),this.quill.setSelection(o,u,oe.sources.SILENT)}}}function Ku(t,e){return{key:t,shiftKey:e,altKey:null,[t==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(r){let{index:s}=r;t==="ArrowRight"&&(s+=r.length+1);const[a]=this.quill.getLeaf(s);return a instanceof zn?(t==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,oe.sources.USER):this.quill.setSelection(r.index-1,oe.sources.USER):e?this.quill.setSelection(r.index,r.length+1,oe.sources.USER):this.quill.setSelection(r.index+r.length+1,oe.sources.USER),!1):!0}}}function nd(t){return{key:t[0],shortKey:!0,handler(e,n){this.quill.format(t,!n.format[t],oe.sources.USER)}}}function lm(t){return{key:t?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,n){const r=t?"prev":"next",s=n.line,a=s.parent[r];if(a!=null){if(a.statics.blotName==="table-row"){let i=a.children.head,o=s;for(;o.prev!=null;)o=o.prev,i=i.next;const u=i.offset(this.quill.scroll)+Math.min(n.offset,i.length()-1);this.quill.setSelection(u,0,oe.sources.USER)}}else{const i=s.table()[r];i!=null&&(t?this.quill.setSelection(i.offset(this.quill.scroll)+i.length()-1,0,oe.sources.USER):this.quill.setSelection(i.offset(this.quill.scroll),0,oe.sources.USER))}return!1}}}function DL(t){if(typeof t=="string"||typeof t=="number")t={key:t};else if(typeof t=="object")t=yi(t);else return null;return t.shortKey&&(t[xL]=t.shortKey,delete t.shortKey),t}function Xh(t){let{quill:e,range:n}=t;const r=e.getLines(n);let s={};if(r.length>1){const a=r[0].formats(),i=r[r.length-1].formats();s=ir.AttributeMap.diff(i,a)||{}}e.deleteText(n,oe.sources.USER),Object.keys(s).length>0&&e.formatLine(n.index,1,s,oe.sources.USER),e.setSelection(n.index,oe.sources.SILENT)}function kL(t,e,n,r){return e.prev==null&&e.next==null?n.prev==null&&n.next==null?r===0?-1:1:n.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const PL=/font-weight:\s*normal/,ML=["P","OL","UL"],cm=t=>t&&ML.includes(t.tagName),BL=t=>{Array.from(t.querySelectorAll("br")).filter(e=>cm(e.previousElementSibling)&&cm(e.nextElementSibling)).forEach(e=>{var n;(n=e.parentNode)==null||n.removeChild(e)})},FL=t=>{Array.from(t.querySelectorAll('b[style*="font-weight"]')).filter(e=>{var n;return(n=e.getAttribute("style"))==null?void 0:n.match(PL)}).forEach(e=>{var r;const n=t.createDocumentFragment();n.append(...e.childNodes),(r=e.parentNode)==null||r.replaceChild(n,e)})};function UL(t){t.querySelector('[id^="docs-internal-guid-"]')&&(FL(t),BL(t))}const HL=/\bmso-list:[^;]*ignore/i,qL=/\bmso-list:[^;]*\bl(\d+)/i,jL=/\bmso-list:[^;]*\blevel(\d+)/i,$L=(t,e)=>{const n=t.getAttribute("style"),r=n==null?void 0:n.match(qL);if(!r)return null;const s=Number(r[1]),a=n==null?void 0:n.match(jL),i=a?Number(a[1]):1,o=new RegExp(`@list l${s}:level${i}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),u=e.match(o),d=u&&u[1]==="bullet"?"bullet":"ordered";return{id:s,indent:i,type:d,element:t}},YL=t=>{var i,o;const e=Array.from(t.querySelectorAll("[style*=mso-list]")),n=[],r=[];e.forEach(u=>{(u.getAttribute("style")||"").match(HL)?n.push(u):r.push(u)}),n.forEach(u=>{var d;return(d=u.parentNode)==null?void 0:d.removeChild(u)});const s=t.documentElement.innerHTML,a=r.map(u=>$L(u,s)).filter(u=>u);for(;a.length;){const u=[];let d=a.shift();for(;d;)u.push(d),d=a.length&&((i=a[0])==null?void 0:i.element)===d.element.nextElementSibling&&a[0].id===d.id?a.shift():null;const h=document.createElement("ul");u.forEach(p=>{const b=document.createElement("li");b.setAttribute("data-list",p.type),p.indent>1&&b.setAttribute("class",`ql-indent-${p.indent-1}`),b.innerHTML=p.element.innerHTML,h.appendChild(b)});const g=(o=u[0])==null?void 0:o.element,{parentNode:f}=g??{};g&&(f==null||f.replaceChild(h,g)),u.slice(1).forEach(p=>{let{element:b}=p;f==null||f.removeChild(b)})}};function zL(t){t.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&YL(t)}const WL=[zL,UL],GL=t=>{t.documentElement&&WL.forEach(e=>{e(t)})},KL=Is("quill:clipboard"),VL=[[Node.TEXT_NODE,oO],[Node.TEXT_NODE,fm],["br",eO],[Node.ELEMENT_NODE,fm],[Node.ELEMENT_NODE,JL],[Node.ELEMENT_NODE,ZL],[Node.ELEMENT_NODE,aO],["li",rO],["ol, ul",sO],["pre",tO],["tr",iO],["b",rd("bold")],["i",rd("italic")],["strike",rd("strike")],["style",nO]],XL=[wL,nv].reduce((t,e)=>(t[e.keyName]=e,t),{}),dm=[ev,Gh,Wh,sv,ov,lv].reduce((t,e)=>(t[e.keyName]=e,t),{});class cv extends Mr{constructor(e,n){super(e,n),this.quill.root.addEventListener("copy",r=>this.onCaptureCopy(r,!1)),this.quill.root.addEventListener("cut",r=>this.onCaptureCopy(r,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],VL.concat(this.options.matchers??[]).forEach(r=>{let[s,a]=r;this.addMatcher(s,a)})}addMatcher(e,n){this.matchers.push([e,n])}convert(e){let{html:n,text:r}=e,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s[vn.blotName])return new Oe().insert(r||"",{[vn.blotName]:s[vn.blotName]});if(!n)return new Oe().insert(r||"",s);const a=this.convertHTML(n);return mu(a,`
102
+ `)&&(a.ops[a.ops.length-1].attributes==null||s.table)?a.compose(new Oe().retain(a.length()-1).delete(1)):a}normalizeHTML(e){GL(e)}convertHTML(e){const n=new DOMParser().parseFromString(e,"text/html");this.normalizeHTML(n);const r=n.body,s=new WeakMap,[a,i]=this.prepareMatching(r,s);return Qh(this.quill.scroll,r,a,i,s)}dangerouslyPasteHTML(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:oe.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,n),this.quill.setSelection(0,oe.sources.SILENT)}else{const s=this.convert({html:n,text:""});this.quill.updateContents(new Oe().retain(e).concat(s),r),this.quill.setSelection(e+s.length(),oe.sources.SILENT)}}onCaptureCopy(e){var i,o;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();const[r]=this.quill.selection.getRange();if(r==null)return;const{html:s,text:a}=this.onCopy(r,n);(i=e.clipboardData)==null||i.setData("text/plain",a),(o=e.clipboardData)==null||o.setData("text/html",s),n&&Xh({range:r,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(n=>n[0]!=="#").join(`
103
+ `)}onCapturePaste(e){var i,o,u,d,h;if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const n=this.quill.getSelection(!0);if(n==null)return;const r=(i=e.clipboardData)==null?void 0:i.getData("text/html");let s=(o=e.clipboardData)==null?void 0:o.getData("text/plain");if(!r&&!s){const g=(u=e.clipboardData)==null?void 0:u.getData("text/uri-list");g&&(s=this.normalizeURIList(g))}const a=Array.from(((d=e.clipboardData)==null?void 0:d.files)||[]);if(!r&&a.length>0){this.quill.uploader.upload(n,a);return}if(r&&a.length>0){const g=new DOMParser().parseFromString(r,"text/html");if(g.body.childElementCount===1&&((h=g.body.firstElementChild)==null?void 0:h.tagName)==="IMG"){this.quill.uploader.upload(n,a);return}}this.onPaste(n,{html:r,text:s})}onCopy(e){const n=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:n}}onPaste(e,n){let{text:r,html:s}=n;const a=this.quill.getFormat(e.index),i=this.convert({text:r,html:s},a);KL.log("onPaste",i,{text:r,html:s});const o=new Oe().retain(e.index).delete(e.length).concat(i);this.quill.updateContents(o,oe.sources.USER),this.quill.setSelection(o.length()-e.length,oe.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,n){const r=[],s=[];return this.matchers.forEach(a=>{const[i,o]=a;switch(i){case Node.TEXT_NODE:s.push(o);break;case Node.ELEMENT_NODE:r.push(o);break;default:Array.from(e.querySelectorAll(i)).forEach(u=>{if(n.has(u)){const d=n.get(u);d==null||d.push(o)}else n.set(u,[o])});break}}),[r,s]}}ve(cv,"DEFAULTS",{matchers:[]});function ri(t,e,n,r){return r.query(e)?t.reduce((s,a)=>{if(!a.insert)return s;if(a.attributes&&a.attributes[e])return s.push(a);const i=n?{[e]:n}:{};return s.insert(a.insert,{...i,...a.attributes})},new Oe):t}function mu(t,e){let n="";for(let r=t.ops.length-1;r>=0&&n.length<e.length;--r){const s=t.ops[r];if(typeof s.insert!="string")break;n=s.insert+n}return n.slice(-1*e.length)===e}function zs(t,e){if(!(t instanceof Element))return!1;const n=e.query(t);return n&&n.prototype instanceof zn?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(t.tagName.toLowerCase())}function QL(t,e){return t.previousElementSibling&&t.nextElementSibling&&!zs(t.previousElementSibling,e)&&!zs(t.nextElementSibling,e)}const Vu=new WeakMap;function dv(t){return t==null?!1:(Vu.has(t)||(t.tagName==="PRE"?Vu.set(t,!0):Vu.set(t,dv(t.parentNode))),Vu.get(t))}function Qh(t,e,n,r,s){return e.nodeType===e.TEXT_NODE?r.reduce((a,i)=>i(e,a,t),new Oe):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((a,i)=>{let o=Qh(t,i,n,r,s);return i.nodeType===e.ELEMENT_NODE&&(o=n.reduce((u,d)=>d(i,u,t),o),o=(s.get(i)||[]).reduce((u,d)=>d(i,u,t),o)),a.concat(o)},new Oe):new Oe}function rd(t){return(e,n,r)=>ri(n,t,!0,r)}function ZL(t,e,n){const r=as.keys(t),s=kr.keys(t),a=aa.keys(t),i={};return r.concat(s).concat(a).forEach(o=>{let u=n.query(o,Re.ATTRIBUTE);u!=null&&(i[u.attrName]=u.value(t),i[u.attrName])||(u=XL[o],u!=null&&(u.attrName===o||u.keyName===o)&&(i[u.attrName]=u.value(t)||void 0),u=dm[o],u!=null&&(u.attrName===o||u.keyName===o)&&(u=dm[o],i[u.attrName]=u.value(t)||void 0))}),Object.entries(i).reduce((o,u)=>{let[d,h]=u;return ri(o,d,h,n)},e)}function JL(t,e,n){const r=n.query(t);if(r==null)return e;if(r.prototype instanceof zn){const s={},a=r.value(t);if(a!=null)return s[r.blotName]=a,new Oe().insert(s,r.formats(t,n))}else if(r.prototype instanceof Vo&&!mu(e,`
104
+ `)&&e.insert(`
105
+ `),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return ri(e,r.blotName,r.formats(t,n),n);return e}function eO(t,e){return mu(e,`
106
+ `)||e.insert(`
107
+ `),e}function tO(t,e,n){const r=n.query("code-block"),s=r&&"formats"in r&&typeof r.formats=="function"?r.formats(t,n):!0;return ri(e,"code-block",s,n)}function nO(){return new Oe}function rO(t,e,n){const r=n.query(t);if(r==null||r.blotName!=="list"||!mu(e,`
108
+ `))return e;let s=-1,a=t.parentNode;for(;a!=null;)["OL","UL"].includes(a.tagName)&&(s+=1),a=a.parentNode;return s<=0?e:e.reduce((i,o)=>o.insert?o.attributes&&typeof o.attributes.indent=="number"?i.push(o):i.insert(o.insert,{indent:s,...o.attributes||{}}):i,new Oe)}function sO(t,e,n){const r=t;let s=r.tagName==="OL"?"ordered":"bullet";const a=r.getAttribute("data-checked");return a&&(s=a==="true"?"checked":"unchecked"),ri(e,"list",s,n)}function fm(t,e,n){if(!mu(e,`
109
+ `)){if(zs(t,n)&&(t.childNodes.length>0||t instanceof HTMLParagraphElement))return e.insert(`
110
+ `);if(e.length()>0&&t.nextSibling){let r=t.nextSibling;for(;r!=null;){if(zs(r,n))return e.insert(`
111
+ `);const s=n.query(r);if(s&&s.prototype instanceof ar)return e.insert(`
112
+ `);r=r.firstChild}}}return e}function aO(t,e,n){var a;const r={},s=t.style||{};return s.fontStyle==="italic"&&(r.italic=!0),s.textDecoration==="underline"&&(r.underline=!0),s.textDecoration==="line-through"&&(r.strike=!0),((a=s.fontWeight)!=null&&a.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(r.bold=!0),e=Object.entries(r).reduce((i,o)=>{let[u,d]=o;return ri(i,u,d,n)},e),parseFloat(s.textIndent||0)>0?new Oe().insert(" ").concat(e):e}function iO(t,e,n){var s,a;const r=((s=t.parentElement)==null?void 0:s.tagName)==="TABLE"?t.parentElement:(a=t.parentElement)==null?void 0:a.parentElement;if(r!=null){const o=Array.from(r.querySelectorAll("tr")).indexOf(t)+1;return ri(e,"table",o,n)}return e}function oO(t,e,n){var s;let r=t.data;if(((s=t.parentElement)==null?void 0:s.tagName)==="O:P")return e.insert(r.trim());if(!dv(t)){if(r.trim().length===0&&r.includes(`
113
+ `)&&!QL(t,n))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(t.previousSibling==null&&t.parentElement!=null&&zs(t.parentElement,n)||t.previousSibling instanceof Element&&zs(t.previousSibling,n))&&(r=r.replace(/^ /,"")),(t.nextSibling==null&&t.parentElement!=null&&zs(t.parentElement,n)||t.nextSibling instanceof Element&&zs(t.nextSibling,n))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class fv extends Mr{constructor(n,r){super(n,r);ve(this,"lastRecorded",0);ve(this,"ignoreChange",!1);ve(this,"stack",{undo:[],redo:[]});ve(this,"currentRange",null);this.quill.on(oe.events.EDITOR_CHANGE,(s,a,i,o)=>{s===oe.events.SELECTION_CHANGE?a&&o!==oe.sources.SILENT&&(this.currentRange=a):s===oe.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||o===oe.sources.USER?this.record(a,i):this.transform(a)),this.currentRange=If(this.currentRange,a))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",s=>{s.inputType==="historyUndo"?(this.undo(),s.preventDefault()):s.inputType==="historyRedo"&&(this.redo(),s.preventDefault())})}change(n,r){if(this.stack[n].length===0)return;const s=this.stack[n].pop();if(!s)return;const a=this.quill.getContents(),i=s.delta.invert(a);this.stack[r].push({delta:i,range:If(s.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(s.delta,oe.sources.USER),this.ignoreChange=!1,this.restoreSelection(s)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(n,r){if(n.ops.length===0)return;this.stack.redo=[];let s=n.invert(r),a=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const o=this.stack.undo.pop();o&&(s=s.compose(o.delta),a=o.range)}else this.lastRecorded=i;s.length()!==0&&(this.stack.undo.push({delta:s,range:a}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(n){hm(this.stack.undo,n),hm(this.stack.redo,n)}undo(){this.change("undo","redo")}restoreSelection(n){if(n.range)this.quill.setSelection(n.range,oe.sources.USER);else{const r=lO(this.quill.scroll,n.delta);this.quill.setSelection(r,oe.sources.USER)}}}ve(fv,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function hm(t,e){let n=e;for(let r=t.length-1;r>=0;r-=1){const s=t[r];t[r]={delta:n.transform(s.delta,!0),range:s.range&&If(s.range,n)},n=s.delta.transform(n),t[r].delta.length()===0&&t.splice(r,1)}}function uO(t,e){const n=e.ops[e.ops.length-1];return n==null?!1:n.insert!=null?typeof n.insert=="string"&&n.insert.endsWith(`
114
+ `):n.attributes!=null?Object.keys(n.attributes).some(r=>t.query(r,Re.BLOCK)!=null):!1}function lO(t,e){const n=e.reduce((s,a)=>s+(a.delete||0),0);let r=e.length()-n;return uO(t,e)&&(r-=1),r}function If(t,e){if(!t)return t;const n=e.transformPosition(t.index),r=e.transformPosition(t.index+t.length);return{index:n,length:r-n}}class hv extends Mr{constructor(e,n){super(e,n),e.root.addEventListener("drop",r=>{var i;r.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const o=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(o.offsetNode,o.offset),s.setEnd(o.offsetNode,o.offset)}const a=s&&e.selection.normalizeNative(s);if(a){const o=e.selection.normalizedToRange(a);(i=r.dataTransfer)!=null&&i.files&&this.upload(o,r.dataTransfer.files)}})}upload(e,n){const r=[];Array.from(n).forEach(s=>{var a;s&&((a=this.options.mimetypes)!=null&&a.includes(s.type))&&r.push(s)}),r.length>0&&this.options.handler.call(this,e,r)}}hv.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(t,e){if(!this.quill.scroll.query("image"))return;const n=e.map(r=>new Promise(s=>{const a=new FileReader;a.onload=()=>{s(a.result)},a.readAsDataURL(r)}));Promise.all(n).then(r=>{const s=r.reduce((a,i)=>a.insert({image:i}),new Oe().retain(t.index).delete(t.length));this.quill.updateContents(s,Ce.sources.USER),this.quill.setSelection(t.index+r.length,Ce.sources.SILENT)})}};const cO=["insertText","insertReplacementText"];class dO extends Mr{constructor(e,n){super(e,n),e.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||e.on(oe.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){Xh({range:e,quill:this.quill})}replaceText(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e.length===0)return!1;if(n){const r=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new Oe().retain(e.index).insert(n,r),oe.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+n.length,0,oe.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!cO.includes(e.inputType))return;const n=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!n||n.collapsed===!0)return;const r=fO(e);if(r==null)return;const s=this.quill.selection.normalizeNative(n),a=s?this.quill.selection.normalizedToRange(s):null;a&&this.replaceText(a,r)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function fO(t){var e;return typeof t.data=="string"?t.data:(e=t.dataTransfer)!=null&&e.types.includes("text/plain")?t.dataTransfer.getData("text/plain"):null}const hO=/Mac/i.test(navigator.platform),pO=100,mO=t=>!!(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="Home"||hO&&t.key==="a"&&t.ctrlKey===!0);class gO extends Mr{constructor(n,r){super(n,r);ve(this,"isListening",!1);ve(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(n,r){let{line:s,event:a}=r;if(!(s instanceof Ir)||!s.uiNode)return!0;const i=getComputedStyle(s.domNode).direction==="rtl";return i&&a.key!=="ArrowRight"||!i&&a.key!=="ArrowLeft"?!0:(this.quill.setSelection(n.index-1,n.length+(a.shiftKey?1:0),oe.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",n=>{!n.defaultPrevented&&mO(n)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+pO,this.isListening)return;this.isListening=!0;const n=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",n,{once:!0})}handleSelectionChange(){const n=document.getSelection();if(!n)return;const r=n.getRangeAt(0);if(r.collapsed!==!0||r.startOffset!==0)return;const s=this.quill.scroll.find(r.startContainer);if(!(s instanceof Ir)||!s.uiNode)return;const a=document.createRange();a.setStartAfter(s.uiNode),a.setEndAfter(s.uiNode),n.removeAllRanges(),n.addRange(a)}}oe.register({"blots/block":cn,"blots/block/embed":ar,"blots/break":Pr,"blots/container":ti,"blots/cursor":Wi,"blots/embed":Yh,"blots/inline":is,"blots/scroll":mi,"blots/text":Lr,"modules/clipboard":cv,"modules/history":fv,"modules/keyboard":uc,"modules/uploader":hv,"modules/input":dO,"modules/uiNode":gO});class bO extends kr{add(e,n){let r=0;if(n==="+1"||n==="-1"){const s=this.value(e)||0;r=n==="+1"?s+1:s-1}else typeof n=="number"&&(r=n);return r===0?(this.remove(e),!0):super.add(e,r.toString())}canAdd(e,n){return super.canAdd(e,n)||super.canAdd(e,parseInt(n,10))}value(e){return parseInt(super.value(e),10)||void 0}}const vO=new bO("indent","ql-indent",{scope:Re.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Cf extends cn{}ve(Cf,"blotName","blockquote"),ve(Cf,"tagName","blockquote");class Lf extends cn{static formats(e){return this.tagName.indexOf(e.tagName)+1}}ve(Lf,"blotName","header"),ve(Lf,"tagName",["H1","H2","H3","H4","H5","H6"]);class gu extends ti{}gu.blotName="list-container";gu.tagName="OL";class bu extends cn{static create(e){const n=super.create();return n.setAttribute("data-list",e),n}static formats(e){return e.getAttribute("data-list")||void 0}static register(){oe.register(gu)}constructor(e,n){super(e,n);const r=n.ownerDocument.createElement("span"),s=a=>{if(!e.isEnabled())return;const i=this.statics.formats(n,e);i==="checked"?(this.format("list","unchecked"),a.preventDefault()):i==="unchecked"&&(this.format("list","checked"),a.preventDefault())};r.addEventListener("mousedown",s),r.addEventListener("touchstart",s),this.attachUI(r)}format(e,n){e===this.statics.blotName&&n?this.domNode.setAttribute("data-list",n):super.format(e,n)}}bu.blotName="list";bu.tagName="LI";gu.allowedChildren=[bu];bu.requiredContainer=gu;class Qo extends is{static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}ve(Qo,"blotName","bold"),ve(Qo,"tagName",["STRONG","B"]);class Of extends Qo{}ve(Of,"blotName","italic"),ve(Of,"tagName",["EM","I"]);class Ws extends is{static create(e){const n=super.create(e);return n.setAttribute("href",this.sanitize(e)),n.setAttribute("rel","noopener noreferrer"),n.setAttribute("target","_blank"),n}static formats(e){return e.getAttribute("href")}static sanitize(e){return pv(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,n){e!==this.statics.blotName||!n?super.format(e,n):this.domNode.setAttribute("href",this.constructor.sanitize(n))}}ve(Ws,"blotName","link"),ve(Ws,"tagName","A"),ve(Ws,"SANITIZED_URL","about:blank"),ve(Ws,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function pv(t,e){const n=document.createElement("a");n.href=t;const r=n.href.slice(0,n.href.indexOf(":"));return e.indexOf(r)>-1}class xf extends is{static create(e){return e==="super"?document.createElement("sup"):e==="sub"?document.createElement("sub"):super.create(e)}static formats(e){if(e.tagName==="SUB")return"sub";if(e.tagName==="SUP")return"super"}}ve(xf,"blotName","script"),ve(xf,"tagName",["SUB","SUP"]);class Rf extends Qo{}ve(Rf,"blotName","strike"),ve(Rf,"tagName",["S","STRIKE"]);class Df extends is{}ve(Df,"blotName","underline"),ve(Df,"tagName","U");class ul extends Yh{static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const n=super.create(e);return typeof e=="string"&&(window.katex.render(e,n,{throwOnError:!1,errorColor:"#f00"}),n.setAttribute("data-value",e)),n}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`<span>${e}</span>`}}ve(ul,"blotName","formula"),ve(ul,"className","ql-formula"),ve(ul,"tagName","SPAN");const pm=["alt","height","width"];class kf extends zn{static create(e){const n=super.create(e);return typeof e=="string"&&n.setAttribute("src",this.sanitize(e)),n}static formats(e){return pm.reduce((n,r)=>(e.hasAttribute(r)&&(n[r]=e.getAttribute(r)),n),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return pv(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,n){pm.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):super.format(e,n)}}ve(kf,"blotName","image"),ve(kf,"tagName","IMG");const mm=["height","width"];class ll extends ar{static create(e){const n=super.create(e);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen","true"),n.setAttribute("src",this.sanitize(e)),n}static formats(e){return mm.reduce((n,r)=>(e.hasAttribute(r)&&(n[r]=e.getAttribute(r)),n),{})}static sanitize(e){return Ws.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,n){mm.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):super.format(e,n)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}ve(ll,"blotName","video"),ve(ll,"className","ql-video"),ve(ll,"tagName","IFRAME");const _o=new kr("code-token","hljs",{scope:Re.INLINE});class Ns extends is{static formats(e,n){for(;e!=null&&e!==n.domNode;){if(e.classList&&e.classList.contains(vn.className))return super.formats(e,n);e=e.parentNode}}constructor(e,n,r){super(e,n,r),_o.add(this.domNode,r)}format(e,n){e!==Ns.blotName?super.format(e,n):n?_o.add(this.domNode,n):(_o.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),_o.value(this.domNode)||this.unwrap()}}Ns.blotName="code-token";Ns.className="ql-token";class sr extends vn{static create(e){const n=super.create(e);return typeof e=="string"&&n.setAttribute("data-language",e),n}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,n){e===this.statics.blotName&&n?this.domNode.setAttribute("data-language",n):super.format(e,n)}replaceWith(e,n){return this.formatAt(0,this.length(),Ns.blotName,!1),super.replaceWith(e,n)}}class Po extends ni{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,n){e===sr.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(e,n)}))}formatAt(e,n,r,s){r===sr.blotName&&(this.forceNext=!0),super.formatAt(e,n,r,s)}highlight(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const s=`${Array.from(this.domNode.childNodes).filter(i=>i!==this.uiNode).map(i=>i.textContent).join(`
115
+ `)}
116
+ `,a=sr.formats(this.children.head.domNode);if(n||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const i=this.children.reduce((u,d)=>u.concat(Qb(d,!1)),new Oe),o=e(s,a);i.diff(o).reduce((u,d)=>{let{retain:h,attributes:g}=d;return h?(g&&Object.keys(g).forEach(f=>{[sr.blotName,Ns.blotName].includes(f)&&this.formatAt(u,h,f,g[f])}),u+h):u},0)}this.cachedText=s,this.forceNext=!1}}html(e,n){const[r]=this.children.find(e);return`<pre data-language="${r?sr.formats(r.domNode):"plain"}">
117
+ ${oc(this.code(e,n))}
118
+ </pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const n=sr.formats(this.children.head.domNode);n!==this.uiNode.value&&(this.uiNode.value=n)}}}Po.allowedChildren=[sr];sr.requiredContainer=Po;sr.allowedChildren=[Ns,Wi,Lr,Pr];const EO=(t,e,n)=>{if(typeof t.versionString=="string"){const r=t.versionString.split(".")[0];if(parseInt(r,10)>=11)return t.highlight(n,{language:e}).value}return t.highlight(e,n).value};class mv extends Mr{static register(){oe.register(Ns,!0),oe.register(sr,!0),oe.register(Po,!0)}constructor(e,n){if(super(e,n),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((r,s)=>{let{key:a}=s;return r[a]=!0,r},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(oe.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof Po))return;const n=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(r=>{let{key:s,label:a}=r;const i=n.ownerDocument.createElement("option");i.textContent=a,i.setAttribute("value",s),n.appendChild(i)}),n.addEventListener("change",()=>{e.format(sr.blotName,n.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(n),e.children.head&&(n.value=sr.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(oe.events.SCROLL_OPTIMIZE,()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.highlight(),e=null},this.options.interval)})}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(oe.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(Po):[e]).forEach(a=>{a.highlight(this.highlightBlot,n)}),this.quill.update(oe.sources.SILENT),r!=null&&this.quill.setSelection(r,oe.sources.SILENT)}highlightBlot(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(n=this.languages[n]?n:"plain",n==="plain")return oc(e).split(`
119
+ `).reduce((s,a,i)=>(i!==0&&s.insert(`
120
+ `,{[vn.blotName]:n}),s.insert(a)),new Oe);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(vn.className),r.innerHTML=EO(this.options.hljs,n,e),Qh(this.quill.scroll,r,[(s,a)=>{const i=_o.value(s);return i?a.compose(new Oe().retain(a.length(),{[Ns.blotName]:i})):a}],[(s,a)=>s.data.split(`
121
+ `).reduce((i,o,u)=>(u!==0&&i.insert(`
122
+ `,{[vn.blotName]:n}),i.insert(o)),a)],new WeakMap)}}mv.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};const Fo=class Fo extends cn{static create(e){const n=super.create();return e?n.setAttribute("data-row",e):n.setAttribute("data-row",Zh()),n}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,n){e===Fo.blotName&&n?this.domNode.setAttribute("data-row",n):super.format(e,n)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}};ve(Fo,"blotName","table"),ve(Fo,"tagName","TD");let Ar=Fo;class Ss extends ti{checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const e=this.children.head.formats(),n=this.children.tail.formats(),r=this.next.children.head.formats(),s=this.next.children.tail.formats();return e.table===n.table&&e.table===r.table&&e.table===s.table}return!1}optimize(e){super.optimize(e),this.children.forEach(n=>{if(n.next==null)return;const r=n.formats(),s=n.next.formats();if(r.table!==s.table){const a=this.splitAfter(n);a&&a.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}ve(Ss,"blotName","table-row"),ve(Ss,"tagName","TR");class ts extends ti{}ve(ts,"blotName","table-body"),ve(ts,"tagName","TBODY");class Ki extends ti{balanceCells(){const e=this.descendants(Ss),n=e.reduce((r,s)=>Math.max(s.children.length,r),0);e.forEach(r=>{new Array(n-r.children.length).fill(0).forEach(()=>{let s;r.children.head!=null&&(s=Ar.formats(r.children.head.domNode));const a=this.scroll.create(Ar.blotName,s);r.appendChild(a),a.optimize()})})}cells(e){return this.rows().map(n=>n.children.at(e))}deleteColumn(e){const[n]=this.descendant(ts);n==null||n.children.head==null||n.children.forEach(r=>{const s=r.children.at(e);s!=null&&s.remove()})}insertColumn(e){const[n]=this.descendant(ts);n==null||n.children.head==null||n.children.forEach(r=>{const s=r.children.at(e),a=Ar.formats(r.children.head.domNode),i=this.scroll.create(Ar.blotName,a);r.insertBefore(i,s)})}insertRow(e){const[n]=this.descendant(ts);if(n==null||n.children.head==null)return;const r=Zh(),s=this.scroll.create(Ss.blotName);n.children.head.children.forEach(()=>{const i=this.scroll.create(Ar.blotName,r);s.appendChild(i)});const a=n.children.at(e);n.insertBefore(s,a)}rows(){const e=this.children.head;return e==null?[]:e.children.map(n=>n)}}ve(Ki,"blotName","table-container"),ve(Ki,"tagName","TABLE");Ki.allowedChildren=[ts];ts.requiredContainer=Ki;ts.allowedChildren=[Ss];Ss.requiredContainer=ts;Ss.allowedChildren=[Ar];Ar.requiredContainer=Ss;function Zh(){return`row-${Math.random().toString(36).slice(2,6)}`}class TO extends Mr{static register(){oe.register(Ar),oe.register(Ss),oe.register(ts),oe.register(Ki)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Ki).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,n]=this.getTable();n!=null&&(e.deleteColumn(n.cellOffset()),this.quill.update(oe.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(oe.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const n=e.offset();e.remove(),this.quill.update(oe.sources.USER),this.quill.setSelection(n,oe.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];const[n,r]=this.quill.getLine(e.index);if(n==null||n.statics.blotName!==Ar.blotName)return[null,null,null,-1];const s=n.parent;return[s.parent.parent,s,n,r]}insertColumn(e){const n=this.quill.getSelection();if(!n)return;const[r,s,a]=this.getTable(n);if(a==null)return;const i=a.cellOffset();r.insertColumn(i+e),this.quill.update(oe.sources.USER);let o=s.rowOffset();e===0&&(o+=1),this.quill.setSelection(n.index+o,n.length,oe.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const n=this.quill.getSelection();if(!n)return;const[r,s,a]=this.getTable(n);if(a==null)return;const i=s.rowOffset();r.insertRow(i+e),this.quill.update(oe.sources.USER),e>0?this.quill.setSelection(n,oe.sources.SILENT):this.quill.setSelection(n.index+s.children.length,n.length,oe.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,n){const r=this.quill.getSelection();if(r==null)return;const s=new Array(e).fill(0).reduce(a=>{const i=new Array(n).fill(`
123
+ `).join("");return a.insert(i,{table:Zh()})},new Oe().retain(r.index));this.quill.updateContents(s,oe.sources.USER),this.quill.setSelection(r.index,oe.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(oe.events.SCROLL_OPTIMIZE,e=>{e.some(n=>["TD","TR","TBODY","TABLE"].includes(n.target.tagName)?(this.quill.once(oe.events.TEXT_CHANGE,(r,s,a)=>{a===oe.sources.USER&&this.balanceTables()}),!0):!1)})}}const gm=Is("quill:toolbar");class Jh extends Mr{constructor(e,n){var r,s;if(super(e,n),Array.isArray(this.options.container)){const a=document.createElement("div");a.setAttribute("role","toolbar"),_O(a,this.options.container),(s=(r=e.container)==null?void 0:r.parentNode)==null||s.insertBefore(a,e.container),this.container=a}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){gm.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(a=>{var o;const i=(o=this.options.handlers)==null?void 0:o[a];i&&this.addHandler(a,i)}),Array.from(this.container.querySelectorAll("button, select")).forEach(a=>{this.attach(a)}),this.quill.on(oe.events.EDITOR_CHANGE,()=>{const[a]=this.quill.selection.getRange();this.update(a)})}addHandler(e,n){this.handlers[e]=n}attach(e){let n=Array.from(e.classList).find(s=>s.indexOf("ql-")===0);if(!n)return;if(n=n.slice(3),e.tagName==="BUTTON"&&e.setAttribute("type","button"),this.handlers[n]==null&&this.quill.scroll.query(n)==null){gm.warn("ignoring attaching to nonexistent format",n,e);return}const r=e.tagName==="SELECT"?"change":"click";e.addEventListener(r,s=>{let a;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const o=e.options[e.selectedIndex];o.hasAttribute("selected")?a=!1:a=o.value||!1}else e.classList.contains("ql-active")?a=!1:a=e.value||!e.hasAttribute("value"),s.preventDefault();this.quill.focus();const[i]=this.quill.selection.getRange();if(this.handlers[n]!=null)this.handlers[n].call(this,a);else if(this.quill.scroll.query(n).prototype instanceof zn){if(a=prompt(`Enter ${n}`),!a)return;this.quill.updateContents(new Oe().retain(i.index).delete(i.length).insert({[n]:a}),oe.sources.USER)}else this.quill.format(n,a,oe.sources.USER);this.update(i)}),this.controls.push([n,e])}update(e){const n=e==null?{}:this.quill.getFormat(e);this.controls.forEach(r=>{const[s,a]=r;if(a.tagName==="SELECT"){let i=null;if(e==null)i=null;else if(n[s]==null)i=a.querySelector("option[selected]");else if(!Array.isArray(n[s])){let o=n[s];typeof o=="string"&&(o=o.replace(/"/g,'\\"')),i=a.querySelector(`option[value="${o}"]`)}i==null?(a.value="",a.selectedIndex=-1):i.selected=!0}else if(e==null)a.classList.remove("ql-active"),a.setAttribute("aria-pressed","false");else if(a.hasAttribute("value")){const i=n[s],o=i===a.getAttribute("value")||i!=null&&i.toString()===a.getAttribute("value")||i==null&&!a.getAttribute("value");a.classList.toggle("ql-active",o),a.setAttribute("aria-pressed",o.toString())}else{const i=n[s]!=null;a.classList.toggle("ql-active",i),a.setAttribute("aria-pressed",i.toString())}})}}Jh.DEFAULTS={};function bm(t,e,n){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${e}`),r.setAttribute("aria-pressed","false"),n!=null?(r.value=n,r.setAttribute("aria-label",`${e}: ${n}`)):r.setAttribute("aria-label",e),t.appendChild(r)}function _O(t,e){Array.isArray(e[0])||(e=[e]),e.forEach(n=>{const r=document.createElement("span");r.classList.add("ql-formats"),n.forEach(s=>{if(typeof s=="string")bm(r,s);else{const a=Object.keys(s)[0],i=s[a];Array.isArray(i)?AO(r,a,i):bm(r,a,i)}}),t.appendChild(r)})}function AO(t,e,n){const r=document.createElement("select");r.classList.add(`ql-${e}`),n.forEach(s=>{const a=document.createElement("option");s!==!1?a.setAttribute("value",String(s)):a.setAttribute("selected","selected"),r.appendChild(a)}),t.appendChild(r)}Jh.DEFAULTS={container:null,handlers:{clean(){const t=this.quill.getSelection();if(t!=null)if(t.length===0){const e=this.quill.getFormat();Object.keys(e).forEach(n=>{this.quill.scroll.query(n,Re.INLINE)!=null&&this.quill.format(n,!1,oe.sources.USER)})}else this.quill.removeFormat(t.index,t.length,oe.sources.USER)},direction(t){const{align:e}=this.quill.getFormat();t==="rtl"&&e==null?this.quill.format("align","right",oe.sources.USER):!t&&e==="right"&&this.quill.format("align",!1,oe.sources.USER),this.quill.format("direction",t,oe.sources.USER)},indent(t){const e=this.quill.getSelection(),n=this.quill.getFormat(e),r=parseInt(n.indent||0,10);if(t==="+1"||t==="-1"){let s=t==="+1"?1:-1;n.direction==="rtl"&&(s*=-1),this.quill.format("indent",r+s,oe.sources.USER)}},link(t){t===!0&&(t=prompt("Enter link URL:")),this.quill.format("link",t,oe.sources.USER)},list(t){const e=this.quill.getSelection(),n=this.quill.getFormat(e);t==="check"?n.list==="checked"||n.list==="unchecked"?this.quill.format("list",!1,oe.sources.USER):this.quill.format("list","unchecked",oe.sources.USER):this.quill.format("list",t,oe.sources.USER)}}};const yO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',NO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',SO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',wO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',IO='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',CO='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',LO='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',OO='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',vm='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',xO='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',RO='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',DO='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',kO='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',PO='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',MO='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',BO='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',FO='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',UO='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',HO='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',qO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',jO='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',$O='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',YO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',zO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',WO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',GO='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',KO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',VO='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',XO='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',QO='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',ZO='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',JO='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',e8='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',Zo={align:{"":yO,center:NO,right:SO,justify:wO},background:IO,blockquote:CO,bold:LO,clean:OO,code:vm,"code-block":vm,color:xO,direction:{"":RO,rtl:DO},formula:kO,header:{1:PO,2:MO,3:BO,4:FO,5:UO,6:HO},italic:qO,image:jO,indent:{"+1":$O,"-1":YO},link:zO,list:{bullet:WO,check:GO,ordered:KO},script:{sub:VO,super:XO},strike:QO,table:ZO,underline:JO,video:e8},t8='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let Em=0;function Tm(t,e){t.setAttribute(e,`${t.getAttribute(e)!=="true"}`)}class lc{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",n=>{switch(n.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),n.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),Tm(this.label,"aria-expanded"),Tm(this.options,"aria-hidden")}buildItem(e){const n=document.createElement("span");n.tabIndex="0",n.setAttribute("role","button"),n.classList.add("ql-picker-item");const r=e.getAttribute("value");return r&&n.setAttribute("data-value",r),e.textContent&&n.setAttribute("data-label",e.textContent),n.addEventListener("click",()=>{this.selectItem(n,!0)}),n.addEventListener("keydown",s=>{switch(s.key){case"Enter":this.selectItem(n,!0),s.preventDefault();break;case"Escape":this.escape(),s.preventDefault();break}}),n}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=t8,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${Em}`,Em+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(n=>{const r=this.buildItem(n);e.appendChild(r),n.selected===!0&&this.selectItem(r)}),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach(e=>{this.container.setAttribute(e.name,e.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");e!==r&&(r!=null&&r.classList.remove("ql-selected"),e!=null&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),n&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const n=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}class gv extends lc{constructor(e,n){super(e),this.label.innerHTML=n,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(r=>{r.classList.add("ql-primary")})}buildItem(e){const n=super.buildItem(e);return n.style.backgroundColor=e.getAttribute("value")||"",n}selectItem(e,n){super.selectItem(e,n);const r=this.label.querySelector(".ql-color-label"),s=e&&e.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=s:r.style.fill=s)}}class bv extends lc{constructor(e,n){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=n[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,n){super.selectItem(e,n);const r=e||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const n8=t=>{const{overflowY:e}=getComputedStyle(t,null);return e!=="visible"&&e!=="clip"};class vv{constructor(e,n){this.quill=e,this.boundsContainer=n||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,n8(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const n=e.left+e.width/2-this.root.offsetWidth/2,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${n}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),a=this.root.getBoundingClientRect();let i=0;if(a.right>s.right&&(i=s.right-a.right,this.root.style.left=`${n+i}px`),a.left<s.left&&(i=s.left-a.left,this.root.style.left=`${n+i}px`),a.bottom>s.bottom){const o=a.bottom-a.top,u=e.bottom-e.top+o;this.root.style.top=`${r-u}px`,this.root.classList.add("ql-flip")}return i}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const r8=[!1,"center","right","justify"],s8=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],a8=[!1,"serif","monospace"],i8=["1","2","3",!1],o8=["small",!1,"large","huge"];class vu extends Gi{constructor(e,n){super(e,n);const r=s=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(s.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(a=>{a.container.contains(s.target)||a.close()})};e.emitter.listenDOM("click",document.body,r)}addModule(e){const n=super.addModule(e);return e==="toolbar"&&this.extendToolbar(n),n}buildButtons(e,n){Array.from(e).forEach(r=>{(r.getAttribute("class")||"").split(/\s+/).forEach(a=>{if(a.startsWith("ql-")&&(a=a.slice(3),n[a]!=null))if(a==="direction")r.innerHTML=n[a][""]+n[a].rtl;else if(typeof n[a]=="string")r.innerHTML=n[a];else{const i=r.value||"";i!=null&&n[a][i]&&(r.innerHTML=n[a][i])}})})}buildPickers(e,n){this.pickers=Array.from(e).map(s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&po(s,r8),typeof n.align=="object"))return new bv(s,n.align);if(s.classList.contains("ql-background")||s.classList.contains("ql-color")){const a=s.classList.contains("ql-background")?"background":"color";return s.querySelector("option")==null&&po(s,s8,a==="background"?"#ffffff":"#000000"),new gv(s,n[a])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?po(s,a8):s.classList.contains("ql-header")?po(s,i8):s.classList.contains("ql-size")&&po(s,o8)),new lc(s)});const r=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(Ce.events.EDITOR_CHANGE,r)}}vu.DEFAULTS=Qs({},Gi.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let t=this.container.querySelector("input.ql-image[type=file]");t==null&&(t=document.createElement("input"),t.setAttribute("type","file"),t.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),t.classList.add("ql-image"),t.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,t.files),t.value=""}),this.container.appendChild(t)),t.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class Ev extends vv{constructor(e,n){super(e,n),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",e=>{e.key==="Enter"?(this.save(),e.preventDefault()):e.key==="Escape"&&(this.cancel(),e.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;n!=null?this.textbox.value=n:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:n}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,Ce.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,Ce.sources.USER)),this.quill.root.scrollTop=n;break}case"video":e=u8(e);case"formula":{if(!e)break;const n=this.quill.getSelection(!0);if(n!=null){const r=n.index+n.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,Ce.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",Ce.sources.USER),this.quill.setSelection(r+2,Ce.sources.USER)}break}}this.textbox.value="",this.hide()}}function u8(t){let e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:t}function po(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(r=>{const s=document.createElement("option");r===n?s.setAttribute("selected","selected"):s.setAttribute("value",String(r)),t.appendChild(s)})}const l8=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Tv extends Ev{constructor(e,n){super(e,n),this.quill.on(Ce.events.EDITOR_CHANGE,(r,s,a,i)=>{if(r===Ce.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&i===Ce.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const o=this.quill.getLines(s.index,s.length);if(o.length===1){const u=this.quill.getBounds(s);u!=null&&this.position(u)}else{const u=o[o.length-1],d=this.quill.getIndex(u),h=Math.min(u.length()-1,s.index+s.length-d),g=this.quill.getBounds(new Wa(d,h));g!=null&&this.position(g)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(Ce.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(e!=null){const n=this.quill.getBounds(e);n!=null&&this.position(n)}},1)})}cancel(){this.show()}position(e){const n=super.position(e),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",n!==0&&(r.style.marginLeft=`${-1*n-r.offsetWidth/2}px`),n}}ve(Tv,"TEMPLATE",['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""));class _v extends vu{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=l8),super(e,n),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new Tv(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),Zo),this.buildPickers(e.container.querySelectorAll("select"),Zo))}}_v.DEFAULTS=Qs({},vu.DEFAULTS,{modules:{toolbar:{handlers:{link(t){t?this.quill.theme.tooltip.edit():this.quill.format("link",!1,oe.sources.USER)}}}}});const c8=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Av extends Ev{constructor(){super(...arguments);ve(this,"preview",this.root.querySelector("a.ql-preview"))}listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",n=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),n.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",n=>{if(this.linkRange!=null){const r=this.linkRange;this.restoreFocus(),this.quill.formatText(r,"link",!1,Ce.sources.USER),delete this.linkRange}n.preventDefault(),this.hide()}),this.quill.on(Ce.events.SELECTION_CHANGE,(n,r,s)=>{if(n!=null){if(n.length===0&&s===Ce.sources.USER){const[a,i]=this.quill.scroll.descendant(Ws,n.index);if(a!=null){this.linkRange=new Wa(n.index-i,a.length());const o=Ws.formats(a.domNode);this.preview.textContent=o,this.preview.setAttribute("href",o),this.show();const u=this.quill.getBounds(this.linkRange);u!=null&&this.position(u);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}ve(Av,"TEMPLATE",['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""));class yv extends vu{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=c8),super(e,n),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),Zo),this.buildPickers(e.container.querySelectorAll("select"),Zo),this.tooltip=new Av(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(n,r)=>{e.handlers.link.call(e,!r.format.link)}))}}yv.DEFAULTS=Qs({},vu.DEFAULTS,{modules:{toolbar:{handlers:{link(t){if(t){const e=this.quill.getSelection();if(e==null||e.length===0)return;let n=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(n)&&n.indexOf("mailto:")!==0&&(n=`mailto:${n}`);const{tooltip:r}=this.quill.theme;r.edit("link",n)}else this.quill.format("link",!1,oe.sources.USER)}}}}});oe.register({"attributors/attribute/direction":nv,"attributors/class/align":Jb,"attributors/class/background":CL,"attributors/class/color":IL,"attributors/class/direction":rv,"attributors/class/font":iv,"attributors/class/size":uv,"attributors/style/align":ev,"attributors/style/background":Gh,"attributors/style/color":Wh,"attributors/style/direction":sv,"attributors/style/font":ov,"attributors/style/size":lv},!0);oe.register({"formats/align":Jb,"formats/direction":rv,"formats/indent":vO,"formats/background":Gh,"formats/color":Wh,"formats/font":iv,"formats/size":uv,"formats/blockquote":Cf,"formats/code-block":vn,"formats/header":Lf,"formats/list":bu,"formats/bold":Qo,"formats/code":Kh,"formats/italic":Of,"formats/link":Ws,"formats/script":xf,"formats/strike":Rf,"formats/underline":Df,"formats/formula":ul,"formats/image":kf,"formats/video":ll,"modules/syntax":mv,"modules/table":TO,"modules/toolbar":Jh,"themes/bubble":_v,"themes/snow":yv,"ui/icons":Zo,"ui/picker":lc,"ui/icon-picker":bv,"ui/color-picker":gv,"ui/tooltip":vv},!0);const d8="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",f8="/api/read?path=",Dl=new WeakMap;function h8(t){return typeof t=="string"&&t.includes(f8)}async function p8(t,e){try{const n=await Ke(e);if(!n.ok)return;const r=URL.createObjectURL(await n.blob()),s=Dl.get(t);s!==void 0&&URL.revokeObjectURL(s),Dl.set(t,r),t.setAttribute("src",r)}catch{}}function Nv(t){const e=Dl.get(t);e!==void 0&&(URL.revokeObjectURL(e),Dl.delete(t))}const m8=oe.import("formats/image");class e0 extends m8{static create(e){if(h8(e)){const n=super.create(d8);return n.setAttribute("data-read",e),p8(n,e),n}return super.create(e)}static value(e){return e.getAttribute("data-read")??e.getAttribute("src")??""}remove(){Nv(this.domNode),super.remove()}}e0.blotName="image";e0.tagName="IMG";oe.register(e0,!0);const _m="/api/read?path=",Sv=/src="([^"]*)"/g,g8=/&nbsp;/g,b8=/<img src="[^"]*" data-read="([^"]*)"/g,v8=/<div class="ql-code-block-container"[^>]*>((?:<div class="ql-code-block"[^>]*>[\s\S]*?<\/div>)+)<\/div>/g,E8=/<div class="ql-code-block"[^>]*>([\s\S]*?)<\/div>/g,T8=/<pre><code>([\s\S]*?)<\/code><\/pre>/g;function _8(t){return t.replace(v8,(e,n)=>{const r=[];for(const s of n.matchAll(E8))r.push(s[1]==="<br>"?"":s[1]??"");return`<pre><code>${r.join(`
124
+ `)}</code></pre>`})}function A8(t){return t.replace(T8,(e,n)=>`<div class="ql-code-block-container">${n.split(`
125
+ `).map(s=>`<div class="ql-code-block">${s}</div>`).join("")}</div>`)}function y8(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function Am(t,e){return A8(t.replace(Sv,(n,r)=>y8(r)?`src="${ec(e,r)}"`:n))}function ym(t,e){const n=`content/${e===""?"":`${e}/`}`;return _8(t).replace(b8,(r,s)=>`<img src="${s}"`).replace(Sv,(r,s)=>{const a=s.indexOf(_m);if(a===-1)return r;const i=decodeURIComponent(s.slice(a+_m.length));return i.startsWith(n)?`src="${i.slice(n.length)}"`:r}).replace(g8," ")}var N8=K('<div class="rte svelte-1afg4yo"><div></div></div>');function S8(t,e){it(e,!0);const n=oe.import("formats/link");n.PROTOCOL_WHITELIST.includes("ref")||n.PROTOCOL_WHITELIST.push("ref");let r,s;const a=[[{header:[2,3,!1]}],["bold","italic","link","image"],["blockquote","code-block"],[{list:"ordered"},{list:"bullet"}],["clean"]];Va(()=>{const p=new oe(r,{theme:"bubble",modules:{toolbar:a},...e.placeholder!==void 0&&{placeholder:e.placeholder}});e.labelledBy!==void 0&&(p.root.setAttribute("aria-labelledby",e.labelledBy),p.root.setAttribute("aria-multiline","true"));const A=p.theme.tooltip;if(A!==void 0){const U=A.position.bind(A);A.position=P=>{const ee=p.root.getBoundingClientRect();return U({...P,left:P.left+ee.left,right:P.right+ee.left,top:P.top+ee.top-p.root.scrollTop,bottom:P.bottom+ee.top-p.root.scrollTop})}}const T=p.getModule("toolbar");T.addHandler("image",()=>u(p)),T.addHandler("link",()=>o(p));const E=U=>{U.preventDefault(),setTimeout(()=>i(p),0)};p.root.addEventListener("contextmenu",E);const x=U=>{U.target instanceof HTMLImageElement&&h(p,U.target)};p.root.addEventListener("dblclick",x),e.value&&p.clipboard.dangerouslyPasteHTML(Am(e.value,e.itemDir),"silent");const I=()=>e.onchange(ym(p.root.innerHTML,e.itemDir));return p.on("text-change",I),s=p,()=>{p.off("text-change",I),p.root.removeEventListener("contextmenu",E),p.root.removeEventListener("dblclick",x);for(const U of p.root.querySelectorAll("img"))Nv(U)}});function i(p){var E;const b=p.getSelection(!0);if(b===null)return;const A=p.theme,T=p.getBounds(b.index,b.length);((E=A.tooltip)==null?void 0:E.show)!==void 0&&A.tooltip.position!==void 0&&T&&(A.tooltip.show(),A.tooltip.position(T))}function o(p){const b=p.getSelection(!0);if(b===null)return;const A=p.getFormat(b).link??"";gb(A).then(T=>{if(T!==null)if(T==="")p.formatText(b.index,b.length,"link",!1,"user");else if(b.length>0)p.formatText(b.index,b.length,"link",T,"user");else{const E=zo(T)?df(T):T;p.insertText(b.index,E,{link:T},"user")}})}function u(p){const b=document.createElement("input");b.type="file",b.accept="image/*",b.onchange=()=>{var T;const A=(T=b.files)==null?void 0:T[0];A&&d(p,A)},b.click()}async function d(p,b){try{const A=await Nh(e.itemDir,b),T=p.getSelection(!0),E=await X0("");if(E===null)return;p.insertEmbed(T.index,"image",ec(e.itemDir,A),"user"),E!==""&&p.formatText(T.index,1,"alt",E,"user"),p.setSelection(T.index+1,0)}catch(A){console.error("Inline image upload failed",A)}}function h(p,b){const A=oe.find(b);if(A===null)return;const T=p.getIndex(A);X0(b.getAttribute("alt")??"").then(E=>{E!==null&&p.formatText(T,1,"alt",E===""?!1:E,"user")})}St(()=>{const p=e.value;s&&ym(s.root.innerHTML,e.itemDir)!==p&&s.clipboard.dangerouslyPasteHTML(Am(p,e.itemDir),"silent")});var g=N8(),f=S(g);sn(f,p=>r=p,()=>r),j(t,g),ot()}var w8=K('<span class="req svelte-1bn65uv" aria-hidden="true">*</span>'),I8=K('<textarea rows="3"></textarea>'),C8=K('<input type="date" class="svelte-1bn65uv"/>'),L8=K('<input type="time" class="svelte-1bn65uv"/>'),O8=K('<input type="email" class="svelte-1bn65uv"/>'),x8=K('<input type="tel" inputmode="tel" class="svelte-1bn65uv"/>'),R8=K('<input type="text" class="svelte-1bn65uv"/>'),D8=K('<p class="hint svelte-1bn65uv"> </p>'),k8=K("<p> </p>"),P8=K('<div class="field svelte-1bn65uv"><label class="field-label svelte-1bn65uv"> <!> <span class="type svelte-1bn65uv"> </span></label> <!> <!> <!></div>'),M8=K('<button type="button" class="restore svelte-1bn65uv">Restore to last opened</button>'),B8=K('<button type="button" class="icon-btn svelte-1bn65uv" title="Edit item (template, move, rename, delete)" aria-label="Edit item settings"><!></button>'),F8=K('<p class="hint svelte-1bn65uv">Loading fields…</p>'),U8=K('<p class="hint svelte-1bn65uv">This template defines no author fields beyond the title.</p>'),H8=K(`<details class="meta-section svelte-1bn65uv"><summary class="svelte-1bn65uv">Meta &amp; SEO</summary> <p class="meta-note svelte-1bn65uv">From the document shell, these fill every page's &lt;head&gt;.</p> <!></details>`),q8=K("<!> <!>",1),j8=K('<div class="divider svelte-1bn65uv" role="separator" aria-orientation="vertical" aria-label="Resize preview" tabindex="0"><span class="grip svelte-1bn65uv"></span></div> <div class="preview-pane svelte-1bn65uv"><!></div>',1),$8=K('<div><div class="form-pane svelte-1bn65uv"><form class="form svelte-1bn65uv"><header class="form-head svelte-1bn65uv"><div class="titles svelte-1bn65uv"><input class="title-input svelte-1bn65uv" type="text" aria-label="Title" placeholder="Untitled"/> <p class="meta svelte-1bn65uv"> </p></div> <div class="head-actions svelte-1bn65uv"><div class="action-buttons svelte-1bn65uv"><!> <!> <button type="button">Preview</button> <button type="button"> </button></div> <label class="pubdate svelte-1bn65uv"><span>Publish date</span> <input type="date" class="svelte-1bn65uv"/></label></div></header> <!></form></div> <!></div> <!>',1);function Y8(t,e){it(e,!0);const n=$n(e,"templates",19,()=>[]),r={name:"title",type:"shorttext",label:"Title",required:!0,multiline:!1,help:"Names the page in the tree and fills {title} where the template uses it, it doesn’t have to appear on the page."},s={name:"published",type:"date",label:"Publish date",required:!1,multiline:!1};let a=J(!1);const i=()=>new Date().toISOString().slice(0,10);function o(){y(a,!l(a)),l(a)&&(l(E).published??"").trim()===""&&(l(E).published=i()),G()}let u=J(!1),d=J(ft([]));function h(){y(u,!0),e.onmove&&Qd().then(Ee=>y(d,Ee,!0))}async function g(Ee){var $e;Ee!==e.templateName&&(await _(),($e=e.onchangetemplate)==null||$e.call(e,Ee))}const f=Ae(()=>e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):""),p=new Set(["richtext","image","file","authors"]);function b(Ee){return p.has(Ee.type)?void 0:`f-${Ee.name}`}let A=J(ft([])),T=J(!0),E=J(ft({})),x=J(null);const I=700;let U,P=!1,ee=0;Va(()=>{F();const Ee=()=>void _();return window.addEventListener("beforeunload",Ee),()=>{window.removeEventListener("beforeunload",Ee),_()}});async function F(){y(T,!0);const[Ee,$e]=await Promise.all([TN(e.templateName),_N()]),Ve=Ee.filter(Fe=>Fe.name!=="title"&&Fe.name!=="published"),q=new Set(Ve.map(Fe=>Fe.name)),z=$e.filter(Fe=>Fe.name!=="published"&&!q.has(Fe.name)),Te=[r,s,...Ve,...z],Le={};for(const Fe of Te)Le[Fe.name]=KN(e.item,Fe.name);Le.published=(Le.published??"").slice(0,10),y(a,e.item.isPublished,!0),y(A,Te,!0),y(D,Ve,!0),y(W,z,!0),y(E,Le,!0),S6(localStorage,e.path,Le),y(x,w6(localStorage,e.path),!0),y(T,!1)}function G(){P=!0,ee+=1,clearTimeout(U),U=setTimeout(()=>void _(),I)}function Q(Ee,$e){const Ve=l(E)[Ee]??"";l(E)[Ee]=$e,G(),Ve!==""&&Ve!==$e&&ne(Ve)}async function ne(Ee){if(/^(\/|[a-z][a-z0-9+.-]*:)/i.test(Ee))return;Object.values(l(E)).some(Ve=>typeof Ve=="string"&&Ve.includes(Ee))||await CN(l(f),Ee)}async function _(){var Ve;if(clearTimeout(U),!P)return;const Ee=ee,$e=bp(e.item,l(A),l(E),l(a));Ms.saving();try{await Xg(e.path,$e),ee===Ee&&(P=!1),Ms.saved(),(Ve=e.onsaved)==null||Ve.call(e,e.path,l(E).title??e.item.title,l(a))}catch{Ms.failed(()=>void _())}}async function M(){l(x)===null||!await Cl("Restore this item to when you opened it? Edits since then will be lost.",{title:"Restore item",confirmLabel:"Restore",danger:!0})||(y(E,{...l(x)},!0),G())}const v=new Set(["text","code"]);function C(Ee,$e){return Ee.maxLength!==void 0&&Ee.minLength!==void 0?`${$e} / ${Ee.maxLength} characters (min ${Ee.minLength})`:Ee.maxLength!==void 0?`${$e} / ${Ee.maxLength} characters`:`${$e} characters (min ${Ee.minLength})`}function R(Ee,$e){return Ee.minLength!==void 0&&$e>0&&$e<Ee.minLength?!0:Ee.maxLength!==void 0&&$e>Ee.maxLength}let D=J(ft([])),W=J(ft([]));const $=Ae(()=>l(x)!==null&&JSON.stringify(l(E))!==JSON.stringify(l(x))),B="nanoesis:preview-open";let Y=J(localStorage.getItem(B)==="true");function V(Ee){y(Y,Ee,!0),localStorage.setItem(B,String(Ee))}const te=Ae(()=>{if(l(T))return null;try{return{...zl(JSON.parse(bp(e.item,l(A),l(E),l(a)))),template:e.templateName}}catch{return null}}),de="nanoesis:preview-split",ge=.2,pe=.8;function Ie(Ee){return Math.min(pe,Math.max(ge,Ee))}function le(){const Ee=Number(localStorage.getItem(de));return Number.isFinite(Ee)&&Ee>0?Ie(Ee):.5}let he=J(ft(le())),Ne=J(!1),ye;function we(Ee){Ee.preventDefault(),y(Ne,!0),Ee.currentTarget.setPointerCapture(Ee.pointerId)}function xe(Ee){if(!l(Ne))return;const $e=ye.getBoundingClientRect();y(he,Ie((Ee.clientX-$e.left)/$e.width),!0)}function Me(Ee){var $e,Ve;l(Ne)&&(y(Ne,!1),(Ve=($e=Ee.currentTarget).releasePointerCapture)==null||Ve.call($e,Ee.pointerId),localStorage.setItem(de,String(l(he))))}function Ge(Ee){const $e=Ee.key==="ArrowLeft"?-.02:Ee.key==="ArrowRight"?.02:0;$e!==0&&(Ee.preventDefault(),y(he,Ie(l(he)+$e),!0),localStorage.setItem(de,String(l(he))))}var We=$8(),$t=Je(We);let He;var Yt=S($t),Zt=S(Yt);{const Ee=(q,z=Ff)=>{var Te=P8(),Le=S(Te),Fe=S(Le),qe=O(Fe);{var ut=Se=>{var _e=w8();j(Se,_e)};fe(qe,Se=>{z().required&&Se(ut)})}var An=O(qe,2),an=S(An),bt=O(Le,2);{var Cs=Se=>{{let _e=Ae(()=>l(E)[z().name]??""),Ye=Ae(()=>`lbl-${z().name}`);S8(Se,{get value(){return l(_e)},get itemDir(){return l(f)},get labelledBy(){return l(Ye)},placeholder:"Write…",onchange:lt=>{l(E)[z().name]=lt,G()}})}},jr=Se=>{var _e=I8();let Ye;ie(()=>{be(_e,"id",`f-${z().name}`),be(_e,"maxlength",z().maxLength),be(_e,"minlength",z().minLength),Ye=Ze(_e,1,"svelte-1bn65uv",null,Ye,{mono:z().type==="code"})}),ae("input",_e,G),_t(_e,()=>l(E)[z().name],lt=>l(E)[z().name]=lt),j(Se,_e)},ia=Ae(()=>v.has(z().type)),oa=Se=>{{let _e=Ae(()=>l(E)[z().name]??""),Ye=Ae(()=>`lbl-${z().name}`);Z6(Se,{get value(){return l(_e)},get itemDir(){return l(f)},get labelledBy(){return l(Ye)},onchange:lt=>Q(z().name,lt)})}},ua=Se=>{{let _e=Ae(()=>l(E)[z().name]??""),Ye=Ae(()=>`lbl-${z().name}`);G6(Se,{get value(){return l(_e)},get itemDir(){return l(f)},get labelledBy(){return l(Ye)},onchange:lt=>{l(E)[z().name]=lt,G()}})}},Ht=Se=>{{let _e=Ae(()=>l(E)[z().name]??""),Ye=Ae(()=>`lbl-${z().name}`);F6(Se,{get value(){return l(_e)},get labelledBy(){return l(Ye)},onchange:lt=>{l(E)[z().name]=lt,G()}})}},la=Se=>{{let _e=Ae(()=>l(E)[z().name]??""),Ye=Ae(()=>`lbl-${z().name}`);gS(Se,{get value(){return l(_e)},get labelledBy(){return l(Ye)},onchange:lt=>{l(E)[z().name]=lt,G()}})}},Ls=Se=>{var _e=C8();ie(()=>be(_e,"id",`f-${z().name}`)),ae("input",_e,G),_t(_e,()=>l(E)[z().name],Ye=>l(E)[z().name]=Ye),j(Se,_e)},ca=Se=>{var _e=L8();ie(()=>be(_e,"id",`f-${z().name}`)),ae("input",_e,G),_t(_e,()=>l(E)[z().name],Ye=>l(E)[z().name]=Ye),j(Se,_e)},da=Se=>{var _e=O8();ie(()=>{be(_e,"id",`f-${z().name}`),be(_e,"maxlength",z().maxLength),be(_e,"minlength",z().minLength)}),ae("input",_e,G),_t(_e,()=>l(E)[z().name],Ye=>l(E)[z().name]=Ye),j(Se,_e)},fa=Se=>{var _e=x8();ie(()=>{be(_e,"id",`f-${z().name}`),be(_e,"maxlength",z().maxLength),be(_e,"minlength",z().minLength)}),ae("input",_e,G),_t(_e,()=>l(E)[z().name],Ye=>l(E)[z().name]=Ye),j(Se,_e)},en=Se=>{var _e=R8();ie(()=>{be(_e,"id",`f-${z().name}`),be(_e,"maxlength",z().maxLength),be(_e,"minlength",z().minLength)}),ae("input",_e,G),_t(_e,()=>l(E)[z().name],Ye=>l(E)[z().name]=Ye),j(Se,_e)};fe(bt,Se=>{z().type==="richtext"?Se(Cs):l(ia)?Se(jr,1):z().type==="image"?Se(oa,2):z().type==="file"?Se(ua,3):z().type==="authors"?Se(Ht,4):z().type==="url"?Se(la,5):z().type==="date"?Se(Ls,6):z().type==="time"?Se(ca,7):z().type==="email"?Se(da,8):z().type==="phone"?Se(fa,9):Se(en,-1)})}var Os=O(bt,2);{var ha=Se=>{var _e=D8(),Ye=S(_e);ie(()=>ue(Ye,z().help)),j(Se,_e)};fe(Os,Se=>{z().help&&Se(ha)})}var pa=O(Os,2);{var rt=Se=>{const _e=Ae(()=>(l(E)[z().name]??"").length);var Ye=k8();let lt;var Tt=S(Ye);ie((Bt,Gt)=>{lt=Ze(Ye,1,"hint count svelte-1bn65uv",null,lt,Bt),ue(Tt,Gt)},[()=>({over:R(z(),l(_e))}),()=>C(z(),l(_e))]),j(Se,Ye)};fe(pa,Se=>{(z().minLength!==void 0||z().maxLength!==void 0)&&Se(rt)})}ie(Se=>{be(Le,"id",`lbl-${z().name}`),be(Le,"for",Se),ue(Fe,`${z().label??""} `),ue(an,z().multiple?"references":z().type)},[()=>b(z())]),j(q,Te)};var Pt=S(Zt),Et=S(Pt),Tn=S(Et),Jt=O(Tn,2),zt=S(Jt),Bn=O(Et,2),Wn=S(Bn),wt=S(Wn);{var xt=q=>{var z=M8();ae("click",z,M),j(q,z)};fe(wt,q=>{l($)&&q(xt)})}var Wt=O(wt,2);{var gt=q=>{var z=B8(),Te=S(z);Oh(Te,{size:16,"aria-hidden":"true"}),ae("click",z,h),j(q,z)};fe(Wt,q=>{e.onchangetemplate&&q(gt)})}var Ut=O(Wt,2);let $e;var Mt=O(Ut,2);let Ve;var Gn=S(Mt),Kn=O(Wn,2),fn=O(S(Kn),2),Br=O(Pt,2);{var Fr=q=>{var z=F8();j(q,z)},fr=q=>{var z=U8();j(q,z)},_n=q=>{var z=q8(),Te=Je(z);Ct(Te,17,()=>l(D),qe=>qe.name,(qe,ut)=>{Ee(qe,()=>l(ut))});var Le=O(Te,2);{var Fe=qe=>{var ut=H8(),An=O(S(ut),4);Ct(An,17,()=>l(W),an=>an.name,(an,bt)=>{Ee(an,()=>l(bt))}),j(qe,ut)};fe(Le,qe=>{l(W).length>0&&qe(Fe)})}j(q,z)};fe(Br,q=>{l(T)?q(Fr):l(D).length===0&&l(W).length===0?q(fr,1):q(_n,-1)})}ie(()=>{ue(zt,e.templateName),$e=Ze(Ut,1,"preview-toggle svelte-1bn65uv",null,$e,{active:l(Y)}),be(Ut,"aria-pressed",l(Y)),Ve=Ze(Mt,1,"publish-btn svelte-1bn65uv",null,Ve,{on:l(a)}),be(Mt,"aria-pressed",l(a)),be(Mt,"title",l(a)?"This page will be published. Click to keep it off the live site.":"This page is not published. Click to publish it."),ue(Gn,l(a)?"Publish":"Don't Publish")}),ae("input",Tn,G),_t(Tn,()=>l(E).title,q=>l(E).title=q),ae("click",Ut,()=>V(!l(Y))),ae("click",Mt,o),ae("input",fn,G),_t(fn,()=>l(E).published,q=>l(E).published=q)}var Ur=O(Yt,2);{var Hr=Ee=>{var $e=j8(),Ve=Je($e),q=O(Ve,2),z=S(q);AS(z,{get path(){return e.path},get previewItem(){return l(te)},onclose:()=>V(!1)}),ie((Te,Le,Fe)=>{be(Ve,"aria-valuemin",Te),be(Ve,"aria-valuemax",Le),be(Ve,"aria-valuenow",Fe)},[()=>Math.round(ge*100),()=>Math.round(pe*100),()=>Math.round(l(he)*100)]),ae("pointerdown",Ve,we),ae("pointermove",Ve,xe),ae("pointerup",Ve,Me),Pe("pointercancel",Ve,Me),ae("keydown",Ve,Ge),j(Ee,$e)};fe(Ur,Ee=>{l(Y)&&Ee(Hr)})}sn($t,Ee=>ye=Ee,()=>ye);var hr=O($t,2);{var qr=Ee=>{{let $e=Ae(()=>e.onrename?()=>(y(u,!1),e.onrename()):void 0),Ve=Ae(()=>e.ondelete?()=>(y(u,!1),e.ondelete()):void 0),q=Ae(()=>e.onmove?z=>(y(u,!1),e.onmove(z)):void 0);uS(Ee,{get templateName(){return e.templateName},get templates(){return n()},get currentFolder(){return l(f)},get folders(){return l(d)},onchangetemplate:z=>{y(u,!1),g(z)},get onrename(){return l($e)},get ondelete(){return l(Ve)},get onmove(){return l(q)},onclose:()=>y(u,!1)})}};fe(hr,Ee=>{l(u)&&e.onchangetemplate&&Ee(qr)})}ie(()=>{He=Ze($t,1,"layout svelte-1bn65uv",null,He,{split:l(Y),dragging:l(Ne)}),Qf(Yt,l(Y)?`flex-basis:${l(he)*100}%`:void 0)}),Pe("submit",Zt,Ee=>Ee.preventDefault()),ae("focusout",Zt,()=>void _()),j(t,We),ot()}vt(["focusout","input","click","pointerdown","pointermove","pointerup","keydown"]);const wv=""+new URL("nanoesis-logo-CgieIWPg.png",import.meta.url).href,z8="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAFS2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS41LjAiPgogPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iCiAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIgogICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgZXhpZjpQaXhlbFhEaW1lbnNpb249IjUwIgogICBleGlmOlBpeGVsWURpbWVuc2lvbj0iNTAiCiAgIGV4aWY6Q29sb3JTcGFjZT0iMSIKICAgdGlmZjpJbWFnZVdpZHRoPSI1MCIKICAgdGlmZjpJbWFnZUxlbmd0aD0iNTAiCiAgIHRpZmY6UmVzb2x1dGlvblVuaXQ9IjIiCiAgIHRpZmY6WFJlc29sdXRpb249IjMwMC8xIgogICB0aWZmOllSZXNvbHV0aW9uPSIzMDAvMSIKICAgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIKICAgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIgogICB4bXA6TW9kaWZ5RGF0ZT0iMjAyNi0wMi0yNFQxMDo1Njo1MFoiCiAgIHhtcDpNZXRhZGF0YURhdGU9IjIwMjYtMDItMjRUMTA6NTY6NTBaIj4KICAgPGRjOnRpdGxlPgogICAgPHJkZjpBbHQ+CiAgICAgPHJkZjpsaSB4bWw6bGFuZz0ieC1kZWZhdWx0Ij54dHJhYmxlLWFpLWxvZ288L3JkZjpsaT4KICAgIDwvcmRmOkFsdD4KICAgPC9kYzp0aXRsZT4KICAgPHhtcE1NOkhpc3Rvcnk+CiAgICA8cmRmOlNlcT4KICAgICA8cmRmOmxpCiAgICAgIHN0RXZ0OmFjdGlvbj0icHJvZHVjZWQiCiAgICAgIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFmZmluaXR5IERlc2lnbmVyIDEuMTAuNiIKICAgICAgc3RFdnQ6d2hlbj0iMjAyNi0wMi0yNFQxMDo1Njo1MFoiLz4KICAgIDwvcmRmOlNlcT4KICAgPC94bXBNTTpIaXN0b3J5PgogIDwvcmRmOkRlc2NyaXB0aW9uPgogPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KPD94cGFja2V0IGVuZD0iciI/PtBEvDoAAAGBaUNDUHNSR0IgSUVDNjE5NjYtMi4xAAAokXWRv0tCURTHP2pRlGFQg0ODRDVplEHY0qD0C6pBDbJa9OWPwB+P95SQ1qA1KIha+jXUX1Br0BwERRFEczQWtZS8zlNBiTyXc8/nfu89h3vPBWs4rWT0piHIZPNacMrvWowsuVresOKkDR+2qKKrc6HJMA3t6wGLGe88Zq3G5/619tW4roClVXhcUbW88LTw7HpeNXlXuFtJRVeFz4XdmlxQ+N7UYxV+NTlZ4R+TtXAwANZOYVeyjmN1rKS0jLC8nL5MuqBU72O+xB7PLoQk9or3oBNkCj8uZpggwCjDjMk8igcvg7KiQf5QOX+enOQqMqsU0VgjSYo8blELUj0uMSF6XEaaotn/v33VEyPeSnW7H5pfDOOjH1p2oLRtGN/HhlE6AdszXGVr+bkj8H2Kvl3T+g7BsQkX1zUttgeXW+B8UqNatCzZxK2JBLyfQUcEum6hbbnSs+o+p48Q3pCvuoH9AxiQ846VX24uZ+lBa66dAAAACXBIWXMAAC4jAAAuIwF4pT92AAAIcElEQVRogeXZfXAU5R0H8O9ze3t73F1edrMJLyoDHSmoYxkHqrxZ0mpoaEEJiYBSBvriTAuVomBlChUpjDMqVq0F6QwWWrFFJC2UtkHiaDoooKaMQLG8TIWCRSHLbnJc9rKvv/6Ru3AJubvdS5h22u/MzXO57D35ffJ7nid3F+D/MaZNwf90DdkS8HqhaVOpYWOokqCia1lQofEESSFkw8ZA08ak0y008FoXlo7TTqJrk5DvuryQDES5aUM2LAw2bdx/5BwN65dKc8T4jEa5JoaTgYH5MDkhvSA6RxvXGTaWv3OKbu7f0q9EP0WTycAY10C5a0LOh8kKyYEoT92uN22sbzhKo/obEf8rzXINVLkmysmA7AXT6ynkASGbneMAw+59jkKjNdFiMjHZBZT0YwEAbuZ9my4EgszICfGJeHDGbexv9c00FYBaO5a91xeEspsecw3MB6BkFu8F0w1i2sT7RLxX30yzALwa70Dy2b00dekU9m6hENcABYDybgV7xHTbI6EgswwbmmmjzCciqOoo0nQ0LPoNTfQL+GSLs/jTHc74ijr2tGtgPZkod1N7g8zUHjEgZ9kz/FUQAJBj7JJh4Zhpo8wHAlrnrUhLoqH6Re+YUz9211oaXnASeOPTHc6Eijr2hA9MjIzOJvV6ag0vZ6cNG3uNToxXBLQkkO7MiFX5MYfnumutVqywVQZLQ5GTwB4fmJBr4B9clDlZIQDwhRvYYcPG5lRnvCKg6SlMEjNzIQ6Od9faGlZYKmC1Aj4xcE28JQy6stlZvt9aw1GaaNhon3Eb+9AjAloS2zUdD5SEQQBuUdexo5lzvl1Ba3gJK4MigReBoAjwEsCXAkGJwIu4zMVQPbiO239xBz0RELCIhdASEKAEBBxmIawoHsPimXPmhaRT30z3AKj3ifgluc4cR1dmxjcO+nN6rr08vcmLuIuXAJ+Y9wMC5omVTO1Zn+dXvwBYvAPMJ2K+oyuCoyu/E+qaqg5INAYAyMIMS8O7lgrYGoOlAbYG5Flm3yUT3+wN4QtSO5btUnXM1XQ4PhBwdAW2rrQ/vq+kSnWU5gMSPf5VsARZqPaBuaWijtXL09nFbPX56QiWTmGvaTrmakk4PhDqgrfVXxS3JR7VbAWqo6z2iVGcBFrz1eYLAgDrH2CvpTvjBeG0K3cVafF9qqMYmqPAJ+a0rbLK6xdw/8pXl+fN3jMjVtEsLYnJmo7FuRB2Q92HALAssGVqEVfye4mTBZGTIQZlSJy8arzKfvIGKMZ47OFFTMw4AE4HRVSOfjVw1ks9BUPSkZZRIB8iHR+Y00GRKscd8IYAClhaveQmcp3Z+RAAsM5d0HDZaavJs8w2WCp8IYB+6MjOufysPe59N73C/2i5rSt6NkRmcnWm0Dr6BDm+PDpHiTtblTbH3aN/Zc2mjgd350Ok0wvmgsTJo8arLO8J1Vu4Qp4EALRBupEx9hYIHBi4Ie7Hk6Y42/fuPEEnvDz/4Ga92ratk4NPlo1hwCUAX/56vPyTQuspGLL6T0n1qZnRDsZYFQgAA+cSaqs/hyP5MIEtU34A4GfnJ7WOMyP2c4MPiQ8v7rjz74XWAhSwtGj1wGok1IVwrHnsp2ijDdIPL8Wdp5RWG0rcgdLmWK0J574Fu9xdORDPc2UCuLIwgrJgcnJ4eJu06XxfIL5OLXppQjUi4k7EpOng+EZ6BCVsofp0WTH3mFwahFzMQS7h+NIY9/qWewP3ekDYnBye11eELwjVfyONEBARgZj0RT+YLIi5bdKm7aDaoaDak2Gas7RQiKelRftWVaNd24l2VUBCA3QNSKjp8QM4VlWOZVbzrZq7b8yJAJrC4IdLiEFEdNkx9sKzfiF5O0InfjURUWknoqKAqATERKQ6Ag+d6fjt7Tff7QMBEbF10+lJ353Jv7SEWALR0iSiEhAV4QNzeeOIERsarxuyxAcCIqKQEFu3hF72hcm6tBL7nrmdHIOKKld+QGfqx8JINKK9tRTtKtCuAe0q8iyzCi4ydihXJjRyZeFSH4jUGIWI2OyH2LTtXiC9dkQ/tHkcC0W2ME7YfblpbSUbVtsMIVaFaGmrh85sBQC2UL3oLtjbzJWFq4KyoBSA+KeI6PsFd6Tj+B9uJSu5mix9CFm6TKYeI8eYU1S5sslDZwzoWg1bdaEhc84S9TuRNmmT7hNRGUbgPICNDOxQLfvSz3NBun1kapzdPxyWfj+ANgB81zdMbLvctHYOG1bbRGfqqwA0AijtMZcBoIY9eryhx+Nokzbpqbsv+US8zsC+JoCvbqTmeBUb++tskK6lZSknKxgfuRN8pJXxkRbGD1A6x4jCQpEE44RtOZaZgZhYw763/ypEZsLgH5EQ+8wnokUAr4TAzz9IH03LCXF0NcL4yDDGRzTGR1rARxQfGANRsYbVbs2JAIAOtu2EiGilmML4QLQI4BUBfPUxOjO+t7kZALhWRxFZ+kCydJksvTw9ouvr5JXHu++Z0TASxWzk/H35EJmZTk+OlBBrEhEd5APREkqNAvg3b2AV3V6Ydm121+ooJkuv8IG5p6hypedTpWeW0MsjJUSbRMQMn4j010dKWazrn0Fdmz3Ah+Ou1XHVDyT0+sfGhNm3t8nPs2+feJH+eIeIqB1GQPGJUATwVuZ83U4tjxgLwMPROxYd7AsEAB5i084CwA76yxqfiHMh8G1ZIR4wNoDnBtw6+0hfEZlhYK8I4KcL4AMeERrHAj3myJJe9oxIlv6OMHTCx/2JSKeRmoeFwD8jgHf9InJCemAksvQzvPz5rJ+99kcO0kdDBPDfD4E3/SAAD+9HUkezw0UkPd+1/ZFjdEZOLTPdKwLoh8+1rkXO0cUiAfzoEPi4F8R/dVopISTJiDnk5r/4fyn/BmrDD+pUdvB8AAAAAElFTkSuQmCC";let Mo=J("idle"),cl=J(ft([])),dl=J(ft([])),sd=J(!1),ad;async function Nm(){y(Mo,"checking");try{const t=await yN();y(cl,[...t.errors],!0),y(dl,[...t.warnings],!0),y(Mo,"done")}catch{y(Mo,"error")}}const gn={get status(){return l(Mo)},get errors(){return l(cl)},get warnings(){return l(dl)},get count(){return l(cl).length+l(dl).length},get hasProblems(){return l(Mo)==="done"&&l(cl).length+l(dl).length>0},get panelOpen(){return l(sd)},refresh(){return clearTimeout(ad),Nm()},scheduleRefresh(t=1200){clearTimeout(ad),ad=setTimeout(()=>void Nm(),t)},openPanel(){y(sd,!0)},closePanel(){y(sd,!1)}};var W8=K('<button type="button" class="retry svelte-jz8lnl">Retry</button>'),G8=K('<button type="button" class="problems svelte-jz8lnl"> </button>'),K8=K('<footer><div class="credit svelte-jz8lnl"><img class="logo svelte-jz8lnl" alt="" width="20" height="20"/> <span>nanoesis by <a target="_blank" rel="noopener noreferrer" class="svelte-jz8lnl">xtrable ltd</a></span></div> <div aria-live="polite"><span> </span> <!></div> <!> <a class="xtrable svelte-jz8lnl" target="_blank" rel="noopener noreferrer" aria-label="xtrable ltd"><img alt="xtrable" width="24" height="24" class="svelte-jz8lnl"/></a></footer>');function V8(t,e){it(e,!0);const n=Ae(()=>Ms.state==="saving"?"Saving…":Ms.state==="error"?"Save failed":"Saved");St(()=>{vh.value,gn.scheduleRefresh()});const r=Ae(()=>gn.count),s="https://xtrable.com/";var a=K8();let i;var o=S(a),u=S(o),d=O(u,2),h=O(S(d));be(h,"href",s);var g=O(o,2);let f;var p=S(g),b=S(p),A=O(p,2);{var T=P=>{var ee=W8();ae("click",ee,()=>Ms.retry()),j(P,ee)};fe(A,P=>{Ms.canRetry&&P(T)})}var E=O(g,2);{var x=P=>{var ee=G8(),F=S(ee);ie(()=>ue(F,`${l(r)??""}
126
+ ${l(r)===1?"problem":"problems"}`)),ae("click",ee,()=>gn.openPanel()),j(P,ee)};fe(E,P=>{gn.hasProblems&&P(x)})}var I=O(E,2);be(I,"href",s);var U=S(I);ie(()=>{i=Ze(a,1,"footer svelte-jz8lnl",null,i,{"has-problems":gn.hasProblems}),be(u,"src",wv),f=Ze(g,1,"save svelte-jz8lnl",null,f,{error:Ms.state==="error"}),ue(b,l(n)),be(U,"src",z8)}),j(t,a),ot()}vt(["click"]);var X8=K("<option> </option>"),Q8=K("<option>Top level</option>"),Z8=K("<option> </option>"),J8=K('<div class="section svelte-1uvxo8j"><h3 class="svelte-1uvxo8j">Move</h3> <div class="manage svelte-1uvxo8j"><label class="grow svelte-1uvxo8j"><span class="visually-hidden svelte-1uvxo8j">Move to folder</span> <select class="svelte-1uvxo8j"><option disabled="">Move to…</option><!><!></select></label> <button type="button" class="ghost svelte-1uvxo8j">Move</button></div></div>'),ex=K(`<div class="section svelte-1uvxo8j"><h3 class="svelte-1uvxo8j">Manage folder</h3> <div class="manage svelte-1uvxo8j"><button type="button" class="ghost svelte-1uvxo8j">New subfolder…</button> <button type="button" class="ghost svelte-1uvxo8j">Change URL…</button> <button type="button" class="ghost danger svelte-1uvxo8j">Delete folder…</button></div> <p class="help svelte-1uvxo8j">“Change URL” renames this folder’s slug (its address). Its name in the tree is its section
127
+ page’s title.</p></div>`),tx=K('<p class="error svelte-1uvxo8j" role="alert"> </p>'),nx=K('<dialog aria-label="Folder settings" class="svelte-1uvxo8j"><form><h2 class="svelte-1uvxo8j">Folder settings</h2> <p class="path svelte-1uvxo8j"> </p> <label class="svelte-1uvxo8j"><span class="svelte-1uvxo8j">Default template</span> <select class="svelte-1uvxo8j"><option>(none, items must set their own)</option><!></select> <span class="help svelte-1uvxo8j">New items here inherit this template unless they pick their own. Stored in the folder’s <code>_sort.json</code>.</span></label> <!> <!> <!> <div class="actions svelte-1uvxo8j"><button type="button" class="ghost svelte-1uvxo8j">Cancel</button> <button type="submit" class="primary svelte-1uvxo8j">Save</button></div></form></dialog>');function rx(t,e){it(e,!0);const n=$n(e,"folders",19,()=>[]);let r=J(""),s=J(!0),a=J(null),i;const o=Ae(()=>e.folderPath.includes("/")?e.folderPath.slice(0,e.folderPath.lastIndexOf("/")):""),u=Ae(()=>n().filter(v=>v!==e.folderPath&&v!==l(o)&&!v.startsWith(`${e.folderPath}/`))),d=" ";let h=J(d);Va(()=>{i.showModal(),MN(e.folderPath).then(v=>{y(r,v,!0)}).finally(()=>{y(s,!1)})});async function g(v){v.preventDefault(),y(a,null);try{await BN(e.folderPath,l(r)),e.onsaved()}catch(C){y(a,C instanceof Error?C.message:String(C),!0)}}var f=nx(),p=S(f),b=O(S(p),2),A=S(b),T=O(b,2),E=O(S(T),2),x=S(E);x.value=x.__value="";var I=O(x);Ct(I,16,()=>e.templates,v=>v,(v,C)=>{var R=X8(),D=S(R),W={};ie(()=>{ue(D,C),W!==(W=C)&&(R.value=(R.__value=C)??"")}),j(v,R)});var U=O(T,2);{var P=v=>{var C=J8(),R=O(S(C),2),D=S(R),W=O(S(D),2),$=S(W);$.value=$.__value=d;var B=O($);{var Y=de=>{var ge=Q8();ge.value=ge.__value="",j(de,ge)};fe(B,de=>{l(o)!==""&&de(Y)})}var V=O(B);Ct(V,16,()=>l(u),de=>de,(de,ge)=>{var pe=Z8(),Ie=S(pe),le={};ie(()=>{ue(Ie,`${ge??""}/`),le!==(le=ge)&&(pe.value=(pe.__value=ge)??"")}),j(de,pe)});var te=O(D,2);ie(()=>te.disabled=l(h)===d),qa(W,()=>l(h),de=>y(h,de)),ae("click",te,()=>e.onmove(l(h))),j(v,C)};fe(U,v=>{e.onmove&&v(P)})}var ee=O(U,2);{var F=v=>{var C=ex(),R=O(S(C),2),D=S(R),W=O(D,2),$=O(W,2);ae("click",D,function(...B){var Y;(Y=e.onnewsubfolder)==null||Y.apply(this,B)}),ae("click",W,function(...B){var Y;(Y=e.onrenamefolder)==null||Y.apply(this,B)}),ae("click",$,function(...B){var Y;(Y=e.ondeletefolder)==null||Y.apply(this,B)}),j(v,C)};fe(ee,v=>{e.folderPath!==""&&v(F)})}var G=O(ee,2);{var Q=v=>{var C=tx(),R=S(C);ie(()=>ue(R,l(a))),j(v,C)};fe(G,v=>{l(a)&&v(Q)})}var ne=O(G,2),_=S(ne),M=O(_,2);sn(f,v=>i=v,()=>i),ie(()=>{ue(A,e.folderPath===""?"/ (root)":`${e.folderPath}/`),E.disabled=l(s),M.disabled=l(s)}),Pe("cancel",f,function(...v){var C;(C=e.oncancel)==null||C.apply(this,v)}),Pe("close",f,function(...v){var C;(C=e.oncancel)==null||C.apply(this,v)}),Pe("submit",p,g),qa(E,()=>l(r),v=>y(r,v)),ae("click",_,function(...v){var C;(C=e.oncancel)==null||C.apply(this,v)}),j(t,f),ot()}vt(["click"]);var sx=K("<option></option>"),ax=K("<option> </option>"),ix=K('<p class="error svelte-1t0ew8l" role="alert"> </p>'),ox=K('<dialog aria-label="New content item" class="svelte-1t0ew8l"><form><h2 class="svelte-1t0ew8l">New content item</h2> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Title</span> <input required="" class="svelte-1t0ew8l"/></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Slug</span> <input class="svelte-1t0ew8l"/></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Folder</span> <input list="folder-options" placeholder="/ (root), or type a new folder" class="svelte-1t0ew8l"/> <datalist id="folder-options"></datalist> <span class="help svelte-1t0ew8l">Pick an existing folder or type a new path to create it.</span></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Template</span> <select class="svelte-1t0ew8l"><option>Inherit the folder’s default</option><!></select> <span class="help svelte-1t0ew8l">A folder’s default is set in its folder settings (the gear button in the tree).</span></label> <!> <div class="actions svelte-1t0ew8l"><button type="button" class="ghost svelte-1t0ew8l">Cancel</button> <button type="submit" class="primary svelte-1t0ew8l">Create</button></div></form></dialog>');function ux(t,e){it(e,!0);const n=$n(e,"initialFolder",3,"");let r=J(""),s=J(""),a=J(""),i=J("");St(()=>{y(a,n())});let o=!1,u=J(null),d;Va(()=>d.showModal());function h(){o||y(s,bs(l(r)),!0)}async function g(v){v.preventDefault(),y(u,null);const C=bs(l(s)||l(r));if(C===""){y(u,"A title or slug is required.");return}const R=l(a).split("/").map(W=>bs(W)).filter(W=>W!=="").join("/"),D=R===""?C:`${R}/${C}`;try{await Jg(D,l(r).trim()||C,l(i)),e.oncreated(D)}catch(W){y(u,W instanceof Error?W.message:String(W),!0)}}var f=ox(),p=S(f),b=O(S(p),2),A=O(S(b),2);Ha(A,!0);var T=O(b,2),E=O(S(T),2),x=O(T,2),I=O(S(x),2),U=O(I,2);Ct(U,20,()=>e.folders,v=>v,(v,C)=>{var R=sx(),D={};ie(()=>{D!==(D=C)&&(R.value=(R.__value=C)??"")}),j(v,R)});var P=O(x,2),ee=O(S(P),2),F=S(ee);F.value=F.__value="";var G=O(F);Ct(G,16,()=>e.templates,v=>v,(v,C)=>{var R=ax(),D=S(R),W={};ie(()=>{ue(D,C),W!==(W=C)&&(R.value=(R.__value=C)??"")}),j(v,R)});var Q=O(P,2);{var ne=v=>{var C=ix(),R=S(C);ie(()=>ue(R,l(u))),j(v,C)};fe(Q,v=>{l(u)&&v(ne)})}var _=O(Q,2),M=S(_);sn(f,v=>d=v,()=>d),ie(v=>be(E,"placeholder",v),[()=>bs(l(r))||"my-item"]),Pe("cancel",f,function(...v){var C;(C=e.oncancel)==null||C.apply(this,v)}),Pe("close",f,function(...v){var C;(C=e.oncancel)==null||C.apply(this,v)}),Pe("submit",p,g),ae("input",A,h),_t(A,()=>l(r),v=>y(r,v)),ae("input",E,()=>o=!0),_t(E,()=>l(s),v=>y(s,v)),_t(I,()=>l(a),v=>y(a,v)),qa(ee,()=>l(i),v=>y(i,v)),ae("click",M,function(...v){var C;(C=e.oncancel)==null||C.apply(this,v)}),j(t,f),ot()}vt(["input","click"]);var lx=K("<option> </option>"),cx=K(`<div class="empty svelte-y9gf4p"><div class="card svelte-y9gf4p"><h1 class="svelte-y9gf4p"> </h1> <p class="svelte-y9gf4p">This section has no page yet, the page visitors see at <code class="svelte-y9gf4p"> </code>. Pick a template (a
128
+ listing template loops over this section's items) and create it.</p> <label class="svelte-y9gf4p"><span class="svelte-y9gf4p">Template</span> <select class="svelte-y9gf4p"><option>Inherit the folder’s default</option><!></select></label> <button type="button" class="primary svelte-y9gf4p"> </button></div></div>`);function dx(t,e){it(e,!0);const n=Ae(()=>e.folderPath===""?"/":`/${e.folderPath}/`);let r=J(""),s=J(!1);function a(){y(s,!0),e.oncreate(l(r))}var i=cx(),o=S(i),u=S(o),d=S(u),h=O(u,2),g=O(S(h)),f=S(g),p=O(h,2),b=O(S(p),2),A=S(b);A.value=A.__value="";var T=O(A);Ct(T,16,()=>e.templates,I=>I,(I,U)=>{var P=lx(),ee=S(P),F={};ie(()=>{ue(ee,U),F!==(F=U)&&(P.value=(P.__value=U)??"")}),j(I,P)});var E=O(p,2),x=S(E);ie(()=>{ue(d,e.name),ue(f,l(n)),b.disabled=l(s),E.disabled=l(s),ue(x,l(s)?"Creating…":"Create page")}),qa(b,()=>l(r),I=>y(r,I)),ae("click",E,a),j(t,i),ot()}vt(["click"]);const Iv="nanoesis:sidebar-width",fx=180,hx=560,px=260;function Cv(t){return Math.min(hx,Math.max(fx,Math.round(t)))}function mx(){const t=Number(localStorage.getItem(Iv));return Number.isFinite(t)&&t>0?Cv(t):px}let kl=mx();function Lv(){typeof document<"u"&&document.documentElement.style.setProperty("--tree-width",`${kl}px`)}Lv();function gx(){return kl}function bx(t){kl=Cv(t),Lv(),localStorage.setItem(Iv,String(kl))}var vx=K('<div role="separator" aria-orientation="vertical" aria-label="Resize sidebar" tabindex="0"><span class="grip svelte-1jo2gqq"></span></div>');function Ex(t,e){it(e,!0);let n=J(null);function r(u){u.preventDefault(),u.currentTarget.setPointerCapture(u.pointerId),y(n,{startX:u.clientX,startWidth:gx()},!0)}function s(u){l(n)!==null&&bx(l(n).startWidth+(u.clientX-l(n).startX))}function a(u){var d,h;l(n)!==null&&((h=(d=u.currentTarget).releasePointerCapture)==null||h.call(d,u.pointerId),y(n,null))}var i=vx();let o;ie(()=>o=Ze(i,1,"resizer svelte-1jo2gqq",null,o,{dragging:l(n)!==null})),ae("pointerdown",i,r),ae("pointermove",i,s),ae("pointerup",i,a),Pe("pointercancel",i,a),j(t,i),ot()}vt(["pointerdown","pointermove","pointerup"]);const Ov={"content-type":"application/json"};async function Tx(){const t=await Ke("/api/migrations");if(!t.ok)throw new Error(`Failed to load migrations (HTTP ${t.status}).`);return await t.json()}async function HD(t){const e=await Ke(`/api/migrations/preview?path=${encodeURIComponent(t)}`);if(!e.ok)throw new Error(`Failed to load migration preview (HTTP ${e.status}).`);return await e.json()}async function qD(t,e){const n=await Ke("/api/migrations/apply",{method:"POST",headers:Ov,body:JSON.stringify({path:t,resolution:e})});if(!n.ok){const s=await n.json().catch(()=>({}));throw new Error(s.error??`Migration failed (HTTP ${n.status}).`)}return await n.json()}async function jD(t,e){const n=await Ke("/api/templates/stamp",{method:"POST",headers:Ov,body:JSON.stringify({name:t,kind:e})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error??`Stamp failed (HTTP ${n.status}).`)}return await n.json()}function _x(){let t=J(0),e=J(null),n=J(!1),r=J(null),s=!1;async function a(){y(n,!0),y(r,null);try{const i=await Tx();y(e,i,!0),y(t,i.items.length,!0),s=!0}catch(i){y(r,i instanceof Error?i.message:String(i),!0)}finally{y(n,!1)}}return{get count(){return l(t)},get list(){return l(e)},get loading(){return l(n)},get error(){return l(r)},async ensureLoaded(){s||l(n)||await a()},refresh:a}}const Xu=_x();var Ax=K(`<small class="hint-error svelte-fna247">Doesn't match the new password above.</small>`),yx=K('<p class="error svelte-fna247" role="alert"> </p>'),Nx=K('<p class="success svelte-fna247" role="status">Password updated.</p>'),Sx=K('<dialog aria-label="Change password" class="svelte-fna247"><h2 class="svelte-fna247">Change password</h2> <p class="lede svelte-fna247">You stay signed in here. Other sessions of yours (other devices, other tabs) are signed out.</p> <form class="svelte-fna247"><label class="svelte-fna247"><span class="svelte-fna247">Current password</span> <input type="password" autocomplete="current-password" required="" class="svelte-fna247"/></label> <label class="svelte-fna247"><span class="svelte-fna247">New password</span> <input type="password" autocomplete="new-password" required="" class="svelte-fna247"/></label> <label class="svelte-fna247"><span class="svelte-fna247">Confirm new password</span> <input type="password" autocomplete="new-password" required="" class="svelte-fna247"/> <!></label> <!> <!> <div class="actions svelte-fna247"><button type="button" class="ghost svelte-fna247">Cancel</button> <button type="submit" class="primary svelte-fna247"> </button></div></form></dialog>');function wx(t,e){it(e,!0);let n=$n(e,"open",15),r=J(void 0),s=J(""),a=J(""),i=J(""),o=J(!1),u=J(null),d=J(!1);St(()=>{l(r)&&(n()&&!l(r).open?(y(s,""),y(a,""),y(i,""),y(u,null),y(d,!1),y(o,!1),l(r).showModal()):!n()&&l(r).open&&l(r).close())});let h=Ae(()=>l(a)!==""&&l(i)!==""&&l(a)!==l(i)),g=Ae(()=>!l(o)&&l(s)!==""&&l(a)!==""&&!l(h));async function f(D){if(D.preventDefault(),!l(g))return;y(o,!0),y(u,null);const W=await dt.changePassword(l(s),l(a));if(y(o,!1),!W.ok){const $=W.error??"Password change failed.";y(u,$.includes("credentials")?"Current password is incorrect.":$,!0);return}y(d,!0),setTimeout(()=>{n(!1)},900)}function p(D){D.preventDefault(),n(!1)}var b=Sx(),A=O(S(b),4),T=S(A),E=O(S(T),2),x=O(T,2),I=O(S(x),2),U=O(x,2),P=O(S(U),2),ee=O(P,2);{var F=D=>{var W=Ax();j(D,W)};fe(ee,D=>{l(h)&&D(F)})}var G=O(U,2);{var Q=D=>{var W=yx(),$=S(W);ie(()=>ue($,l(u))),j(D,W)};fe(G,D=>{l(u)&&D(Q)})}var ne=O(G,2);{var _=D=>{var W=Nx();j(D,W)};fe(ne,D=>{l(d)&&D(_)})}var M=O(ne,2),v=S(M),C=O(v,2),R=S(C);sn(b,D=>y(r,D),()=>l(r)),ie(()=>{C.disabled=!l(g),ue(R,l(o)?"Updating…":"Update password")}),Pe("cancel",b,p),Pe("submit",A,f),_t(E,()=>l(s),D=>y(s,D)),_t(I,()=>l(a),D=>y(a,D)),_t(P,()=>l(i),D=>y(i,D)),ae("click",v,()=>n(!1)),j(t,b),ot()}vt(["click"]);var Ix=K(`<label class="svelte-szf2lz"><span class="svelte-szf2lz"> </span> <textarea readonly="" rows="3" class="svelte-szf2lz"></textarea></label> <p class="warn svelte-szf2lz" role="status">Copy it now, you won't be able to see it again.</p> <div class="actions svelte-szf2lz"><button type="button" class="ghost svelte-szf2lz">Done</button> <button type="button" class="primary svelte-szf2lz"> </button></div>`,1),Cx=K('<p class="error svelte-szf2lz" role="alert"> </p>'),Lx=K('<p class="success svelte-szf2lz" role="status">All your MCP tokens were revoked.</p>'),Ox=K('<!> <!> <div class="actions svelte-szf2lz"><button type="button" class="danger svelte-szf2lz">Revoke all</button> <span class="spacer svelte-szf2lz"></span> <button type="button" class="ghost svelte-szf2lz">Cancel</button> <button type="button" class="primary svelte-szf2lz"> </button></div>',1),xx=K(`<dialog aria-label="MCP access token" class="svelte-szf2lz"><h2 class="svelte-szf2lz">MCP access token</h2> <p class="lede svelte-szf2lz">A token lets an AI client (through the MCP server) read and edit this site as you, with your
129
+ role. Paste it into your client's config as a Bearer token. It keeps working after you sign out,
130
+ so treat it like a password.</p> <!></dialog>`);function Rx(t,e){it(e,!0);let n=$n(e,"open",15),r=J(void 0),s=J(!1),a=J(null),i=J(null),o=J(null),u=J(!1),d=J(!1);St(()=>{l(r)&&(n()&&!l(r).open?(y(s,!1),y(a,null),y(i,null),y(o,null),y(u,!1),y(d,!1),l(r).showModal()):!n()&&l(r).open&&l(r).close())});let h=Ae(()=>l(o)===null?"":new Date(l(o)).toLocaleDateString());async function g(){y(s,!0),y(a,null),y(d,!1),y(u,!1);const U=await dt.createMcpToken();if(y(s,!1),!U.ok||U.token===void 0){y(a,U.error??"Could not create a token.",!0);return}y(i,U.token,!0),y(o,U.expiresAt??null,!0)}async function f(){if(l(i)!==null)try{await navigator.clipboard.writeText(l(i)),y(u,!0)}catch{y(u,!1)}}async function p(){y(s,!0),y(a,null);const U=await dt.revokeMcpTokens();if(y(s,!1),!U.ok){y(a,U.error??"Could not revoke tokens.",!0);return}y(i,null),y(o,null),y(d,!0)}function b(U){var P;(P=U.currentTarget)==null||P.select()}function A(U){U.preventDefault(),n(!1)}var T=xx(),E=O(S(T),4);{var x=U=>{var P=Ix(),ee=Je(P),F=S(ee),G=S(F),Q=O(F,2),ne=O(ee,4),_=S(ne),M=O(_,2),v=S(M);ie(()=>{ue(G,`Your new token${l(h)?` · expires ${l(h)}`:""}`),LT(Q,l(i)),ue(v,l(u)?"Copied":"Copy token")}),ae("click",Q,b),ae("click",_,()=>n(!1)),ae("click",M,f),j(U,P)},I=U=>{var P=Ox(),ee=Je(P);{var F=R=>{var D=Cx(),W=S(D);ie(()=>ue(W,l(a))),j(R,D)};fe(ee,R=>{l(a)&&R(F)})}var G=O(ee,2);{var Q=R=>{var D=Lx();j(R,D)};fe(G,R=>{l(d)&&R(Q)})}var ne=O(G,2),_=S(ne),M=O(_,4),v=O(M,2),C=S(v);ie(()=>{_.disabled=l(s),v.disabled=l(s),ue(C,l(s)?"Working…":"Create token")}),ae("click",_,p),ae("click",M,()=>n(!1)),ae("click",v,g),j(U,P)};fe(E,U=>{l(i)!==null?U(x):U(I,-1)})}sn(T,U=>y(r,U),()=>l(r)),Pe("cancel",T,A),j(t,T),ot()}vt(["click"]);var Dx=K('<details class="menu svelte-1y2gtaj"><summary aria-label="Account menu" class="svelte-1y2gtaj"><span class="label svelte-1y2gtaj"> </span> <span class="caret svelte-1y2gtaj" aria-hidden="true">▾</span></summary> <ul role="menu" class="svelte-1y2gtaj"><li class="svelte-1y2gtaj"><button type="button" role="menuitem" class="svelte-1y2gtaj">Change password…</button></li> <li class="svelte-1y2gtaj"><button type="button" role="menuitem" class="svelte-1y2gtaj">MCP access token…</button></li> <li class="svelte-1y2gtaj"><button type="button" role="menuitem" class="svelte-1y2gtaj">Log out</button></li></ul></details> <!> <!>',1);function kx(t,e){it(e,!0);let n=J(!1),r=J(!1),s=Ae(()=>{var p;return((p=dt.principal)==null?void 0:p.username)??""});function a(){l(d)&&(l(d).open=!1)}function i(){a(),y(n,!0)}function o(){a(),y(r,!0)}async function u(){a(),await dt.logout()}let d=J(void 0);St(()=>{function p(b){l(d)&&l(d).open&&!l(d).contains(b.target)&&(l(d).open=!1)}return document.addEventListener("click",p),()=>document.removeEventListener("click",p)});var h=jn(),g=Je(h);{var f=p=>{var b=Dx(),A=Je(b),T=S(A),E=S(T),x=S(E),I=O(T,2),U=S(I),P=S(U),ee=O(U,2),F=S(ee),G=O(ee,2),Q=S(G);sn(A,M=>y(d,M),()=>l(d));var ne=O(A,2);wx(ne,{get open(){return l(n)},set open(M){y(n,M,!0)}});var _=O(ne,2);Rx(_,{get open(){return l(r)},set open(M){y(r,M,!0)}}),ie(()=>ue(x,l(s))),ae("click",P,i),ae("click",F,o),ae("click",Q,u),j(p,b)};fe(g,p=>{dt.status==="authenticated"&&dt.principal!==null&&p(f)})}j(t,h),ot()}vt(["click"]);var Px=K('<p class="error svelte-1e3birj" role="alert"> </p>'),Mx=K('<p class="ok svelte-1e3birj" role="status"> </p>'),Bx=K('<img alt="Current logo" class="svelte-1e3birj"/>'),Fx=K('<span class="preview-empty svelte-1e3birj">No custom logo</span>'),Ux=K('<button type="button" class="ghost danger svelte-1e3birj">Remove</button>'),Hx=K(`<div class="panel svelte-1e3birj"><p class="lede svelte-1e3birj">Replace the editor's top-left logo and name with your own. Leave the name blank to use the
131
+ built-in brand. (The footer credit stays.)</p> <!> <!> <section class="field svelte-1e3birj"><label for="brand-name" class="svelte-1e3birj">Name</label> <div class="row svelte-1e3birj"><input id="brand-name" type="text" placeholder="nanoesis" class="svelte-1e3birj"/> <button type="button" class="primary svelte-1e3birj"> </button></div></section> <section class="field svelte-1e3birj"><span class="field-label svelte-1e3birj">Logo</span> <div class="logo-row svelte-1e3birj"><div class="preview svelte-1e3birj"><!></div> <div class="logo-actions svelte-1e3birj"><input type="file" accept="image/*" class="visually-hidden svelte-1e3birj"/> <button type="button" class="ghost svelte-1e3birj"> </button> <!></div></div> <small class="svelte-1e3birj">PNG, SVG, or any image, up to 1 MB.</small></section></div>`);function qx(t,e){it(e,!0);let n=J(ft(In.name??"")),r=J(!1),s=J(!1),a=J(null),i=J(null),o=J(void 0);function u($){y(i,$,!0),setTimeout(()=>y(i,null),1500)}async function d(){y(r,!0),y(a,null);const $=l(n).trim(),B=await qy($===""?null:$);if(y(r,!1),!B.ok){y(a,B.error,!0);return}await In.load(),u("Name saved.")}async function h($){var te;const B=$.currentTarget,Y=(te=B.files)==null?void 0:te[0];if(Y===void 0)return;y(s,!0),y(a,null);const V=await jy(Y);if(y(s,!1),B.value="",!V.ok){y(a,V.error,!0);return}await In.load(),u("Logo updated.")}async function g(){y(a,null);const $=await $y();if(!$.ok){y(a,$.error,!0);return}await In.load(),u("Logo removed.")}var f=Hx(),p=O(S(f),2);{var b=$=>{var B=Px(),Y=S(B);ie(()=>ue(Y,l(a))),j($,B)};fe(p,$=>{l(a)&&$(b)})}var A=O(p,2);{var T=$=>{var B=Mx(),Y=S(B);ie(()=>ue(Y,l(i))),j($,B)};fe(A,$=>{l(i)&&$(T)})}var E=O(A,2),x=O(S(E),2),I=S(x),U=O(I,2),P=S(U),ee=O(E,2),F=O(S(ee),2),G=S(F),Q=S(G);{var ne=$=>{var B=Bx();ie(()=>be(B,"src",In.logoUrl)),j($,B)},_=$=>{var B=Fx();j($,B)};fe(Q,$=>{In.logoUrl?$(ne):$(_,-1)})}var M=O(G,2),v=S(M);sn(v,$=>y(o,$),()=>l(o));var C=O(v,2),R=S(C),D=O(C,2);{var W=$=>{var B=Ux();ae("click",B,g),j($,B)};fe(D,$=>{In.logoUrl&&$(W)})}ie(()=>{U.disabled=l(r),ue(P,l(r)?"Saving…":"Save"),be(G,"aria-hidden",In.logoUrl===null),C.disabled=l(s),ue(R,l(s)?"Uploading…":In.logoUrl?"Replace logo…":"Upload logo…")}),_t(I,()=>l(n),$=>y(n,$)),ae("click",U,d),ae("change",v,h),ae("click",C,()=>{var $;return($=l(o))==null?void 0:$.click()}),j(t,f),ot()}vt(["click","change"]);const jx={"content-type":"application/json"};async function $x(){const t=await Ke("/api/admin/diagnostics");if(t.status===404)throw new Error("Diagnostics are not available on this host.");if(!t.ok)throw new Error(`Couldn't load diagnostics (HTTP ${t.status}).`);return(await t.json()).findings}async function Yx(t){const e=await Ke("/api/admin/diagnostics/repair",{method:"POST",headers:jx,body:JSON.stringify({id:t})});if(!e.ok){const n=await e.json().catch(()=>({}));throw new Error(n.error??`Repair failed (HTTP ${e.status}).`)}return(await e.json()).findings}var zx=K('<p class="error svelte-1iylrs" role="alert"> </p>'),Wx=K('<p class="error svelte-1iylrs" role="alert"> </p>'),Gx=K('<span class="all-good svelte-1iylrs">All checks passed.</span>'),Kx=K('<span class="chip chip-error svelte-1iylrs"> </span>'),Vx=K('<span class="chip chip-warning svelte-1iylrs"> </span>'),Xx=K('<span class="chip chip-info svelte-1iylrs"> </span>'),Qx=K("<!> <!> <!>",1),Zx=K('<div class="finding-actions svelte-1iylrs"><button type="button" class="primary svelte-1iylrs"> </button></div>'),Jx=K('<li><div class="finding-head svelte-1iylrs"><span> </span> <h3 class="svelte-1iylrs"> </h3></div> <p class="detail svelte-1iylrs"> </p> <!></li>'),e5=K('<ul class="findings svelte-1iylrs"></ul>'),t5=K(`<div class="panel svelte-1iylrs"><p class="lede svelte-1iylrs">A live check of your installation — what works, and what doesn't. Findings come from
132
+ port-agnostic probes, so they catch problems regardless of how your storage and CDN are wired. <strong>Repair</strong> fixes that the engine can apply in place; advisory findings are everything else.</p> <!> <!> <div class="actions-bar svelte-1iylrs"><div class="summary svelte-1iylrs" aria-live="polite"><!></div> <button type="button" class="svelte-1iylrs"> </button></div> <!></div>`);function n5(t,e){it(e,!0);let n=J(!0),r=J(null),s=J(ft([])),a=J(null),i=J(null);const o={error:"Error",warning:"Warning",info:"Info"},u={error:0,warning:1,info:2},d=Ae(()=>[...l(s)].sort((M,v)=>u[M.severity]-u[v.severity])),h=Ae(()=>({error:l(s).filter(M=>M.severity==="error").length,warning:l(s).filter(M=>M.severity==="warning").length,info:l(s).filter(M=>M.severity==="info").length}));async function g(){y(n,!0),y(r,null);try{y(s,await $x(),!0)}catch(M){y(r,M instanceof Error?M.message:String(M),!0)}finally{y(n,!1)}}St(()=>{g()});async function f(M){if(M.repair){y(a,M.repair.id,!0),y(i,null);try{y(s,await Yx(M.repair.id),!0)}catch(v){y(i,v instanceof Error?v.message:String(v),!0)}finally{y(a,null)}}}var p=t5(),b=O(S(p),2);{var A=M=>{var v=zx(),C=S(v);ie(()=>ue(C,l(r))),j(M,v)};fe(b,M=>{l(r)&&M(A)})}var T=O(b,2);{var E=M=>{var v=Wx(),C=S(v);ie(()=>ue(C,l(i))),j(M,v)};fe(T,M=>{l(i)&&M(E)})}var x=O(T,2),I=S(x),U=S(I);{var P=M=>{var v=bl("Running checks…");j(M,v)},ee=M=>{var v=Gx();j(M,v)},F=M=>{var v=Qx(),C=Je(v);{var R=Y=>{var V=Kx(),te=S(V);ie(()=>ue(te,`${l(h).error??""} error${l(h).error===1?"":"s"}`)),j(Y,V)};fe(C,Y=>{l(h).error>0&&Y(R)})}var D=O(C,2);{var W=Y=>{var V=Vx(),te=S(V);ie(()=>ue(te,`${l(h).warning??""} warning${l(h).warning===1?"":"s"}`)),j(Y,V)};fe(D,Y=>{l(h).warning>0&&Y(W)})}var $=O(D,2);{var B=Y=>{var V=Xx(),te=S(V);ie(()=>ue(te,`${l(h).info??""} info`)),j(Y,V)};fe($,Y=>{l(h).info>0&&Y(B)})}j(M,v)};fe(U,M=>{l(n)?M(P):l(s).length===0?M(ee,1):M(F,-1)})}var G=O(I,2),Q=S(G),ne=O(x,2);{var _=M=>{var v=e5();Ct(v,21,()=>l(d),C=>C.id,(C,R)=>{var D=Jx(),W=S(D),$=S(W),B=S($),Y=O($,2),V=S(Y),te=O(W,2),de=S(te),ge=O(te,2);{var pe=Ie=>{var le=Zx(),he=S(le),Ne=S(he);ie(()=>{he.disabled=l(a)!==null,ue(Ne,l(a)===l(R).repair.id?"Repairing…":l(R).repair.label)}),ae("click",he,()=>f(l(R))),j(Ie,le)};fe(ge,Ie=>{l(R).repair&&Ie(pe)})}ie(()=>{Ze(D,1,`finding finding-${l(R).severity??""}`,"svelte-1iylrs"),Ze($,1,`severity-tag severity-${l(R).severity??""}`,"svelte-1iylrs"),ue(B,o[l(R).severity]),ue(V,l(R).title),ue(de,l(R).detail)}),j(C,D)}),j(M,v)};fe(ne,M=>{!l(n)&&l(s).length>0&&M(_)})}ie(()=>{G.disabled=l(n),ue(Q,l(n)?"Checking…":"Re-run checks")}),ae("click",G,g),j(t,p),ot()}vt(["click"]);var r5=K('<p class="error svelte-8ydvuj" role="alert"> </p>'),s5=K('<p class="ok svelte-8ydvuj" role="status"> </p>'),a5=K(`<div class="panel svelte-8ydvuj"><p class="lede svelte-8ydvuj">The site's base URL, its public address, e.g. <code class="svelte-8ydvuj">https://example.com</code>. Setting it makes <code class="svelte-8ydvuj">publish</code> emit a <code class="svelte-8ydvuj">sitemap.xml</code> (and absolute links in the RSS feed). Leave it blank to skip the sitemap.</p> <!> <!> <section class="field svelte-8ydvuj"><label for="site-base-url" class="svelte-8ydvuj">Base URL</label> <div class="row svelte-8ydvuj"><input id="site-base-url" type="url" inputmode="url" placeholder="https://example.com" class="svelte-8ydvuj"/> <button type="button" class="primary svelte-8ydvuj"> </button></div> <small class="svelte-8ydvuj">No trailing slash needed. Used only to build absolute URLs in the sitemap and feed.</small></section></div>`);function i5(t,e){it(e,!0);let n=J(""),r=J(!0),s=J(!1),a=J(null),i=J(null);YN().then(I=>{y(n,I.baseUrl,!0),y(r,!1)});function o(I){y(i,I,!0),setTimeout(()=>y(i,null),1500)}async function u(){y(s,!0),y(a,null);try{await zN({baseUrl:l(n)}),o("Saved.")}catch(I){y(a,I instanceof Error?I.message:String(I),!0)}finally{y(s,!1)}}var d=a5(),h=O(S(d),2);{var g=I=>{var U=r5(),P=S(U);ie(()=>ue(P,l(a))),j(I,U)};fe(h,I=>{l(a)&&I(g)})}var f=O(h,2);{var p=I=>{var U=s5(),P=S(U);ie(()=>ue(P,l(i))),j(I,U)};fe(f,I=>{l(i)&&I(p)})}var b=O(f,2),A=O(S(b),2),T=S(A),E=O(T,2),x=S(E);ie(()=>{T.disabled=l(r),E.disabled=l(r)||l(s),ue(x,l(s)?"Saving…":"Save")}),_t(T,()=>l(n),I=>y(n,I)),ae("click",E,u),j(t,d),ot()}vt(["click"]);async function o5(){const t=await Ke("/api/users");if(!t.ok)throw new Error(`Couldn't load users (HTTP ${t.status}).`);return await t.json()}const t0={"content-type":"application/json"};function u5(t){return Qa("/api/users",{method:"POST",headers:t0,body:JSON.stringify(t)})}function Sm(t,e){return Qa(`/api/users/${encodeURIComponent(t)}`,{method:"PATCH",headers:t0,body:JSON.stringify(e)})}function l5(t,e){return Qa(`/api/users/${encodeURIComponent(t)}/password`,{method:"POST",headers:t0,body:JSON.stringify(e)})}function c5(t){return Qa(`/api/users/${encodeURIComponent(t)}`,{method:"DELETE"})}var d5=K('<p class="error svelte-plhp3i" role="alert"> </p>'),f5=K('<p class="muted svelte-plhp3i">Loading users…</p>'),h5=K('<p class="error svelte-plhp3i"> </p>'),p5=K('<span class="you svelte-plhp3i">(you)</span>'),m5=K('<span class="displayname svelte-plhp3i"> <!></span> <span class="username svelte-plhp3i"> </span>',1),g5=K('<span class="you svelte-plhp3i">(you)</span>'),b5=K('<span class="username svelte-plhp3i"> <!></span>'),v5=K('<span class="chip locked svelte-plhp3i">Locked</span>'),E5=K('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),T5=K('<tr><td class="svelte-plhp3i"><div class="who svelte-plhp3i"><!></div> <!></td><td class="svelte-plhp3i"><div class="roles svelte-plhp3i"></div></td><td class="row-actions svelte-plhp3i"><button type="button" class="link svelte-plhp3i">Edit name</button> <button type="button" class="link svelte-plhp3i">Reset password</button> <button type="button" class="link danger svelte-plhp3i">Delete</button></td></tr>'),_5=K('<table class="svelte-plhp3i"><thead><tr><th class="svelte-plhp3i">User</th><th class="svelte-plhp3i">Roles</th><th class="svelte-plhp3i"></th></tr></thead><tbody></tbody></table>'),A5=K('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),y5=K('<div class="panel svelte-plhp3i"><!> <section class="list"><!></section> <form class="create svelte-plhp3i"><h3 class="svelte-plhp3i">Add a user</h3> <div class="create-grid svelte-plhp3i"><label class="svelte-plhp3i"><span class="svelte-plhp3i">Username</span> <input type="text" autocomplete="off" class="svelte-plhp3i"/></label> <label class="svelte-plhp3i"><span class="svelte-plhp3i">Display name <small class="optional svelte-plhp3i">(optional)</small></span> <input type="text" autocomplete="off" placeholder="Shown on bylines; defaults to the username" class="svelte-plhp3i"/></label> <label class="svelte-plhp3i"><span class="svelte-plhp3i">Initial password</span> <input type="text" autocomplete="off" placeholder="Set a password" class="svelte-plhp3i"/></label> <fieldset class="roles-field svelte-plhp3i"><legend class="svelte-plhp3i">Roles</legend> <div class="roles svelte-plhp3i"></div></fieldset></div> <div class="create-actions svelte-plhp3i"><small class="svelte-plhp3i">Share the password with them; they can change it from their account menu.</small> <button type="submit" class="primary svelte-plhp3i"> </button></div></form></div>');function N5(t,e){it(e,!0);const n=[],r=["author","developer","admin"],s={author:"Author",developer:"Developer",admin:"Admin"};let a=J(ft([])),i=J(!0),o=J(null),u=J(null),d=J(""),h=J(""),g=J(""),f=J(ft(["author"])),p=J(!1);const b=Ae(()=>{var le;return((le=dt.principal)==null?void 0:le.userId)??null}),A=Ae(()=>!l(p)&&l(d).trim()!==""&&l(g)!==""&&l(f).length>0);async function T(){y(i,!0),y(o,null);try{y(a,await o5(),!0)}catch(le){y(o,le instanceof Error?le.message:String(le),!0)}finally{y(i,!1)}}St(()=>{T()});async function E(le){if(le.preventDefault(),!l(A))return;y(p,!0),y(u,null);const he=await u5({username:l(d).trim(),password:l(g),roles:[...l(f)],...l(h).trim()!==""&&{displayName:l(h).trim()}});if(y(p,!1),!he.ok){y(u,he.error,!0);return}y(d,""),y(h,""),y(g,""),y(f,["author"],!0),await T()}async function x(le){const he=await Ro(`Display name for “${le.username}”:`,{title:"Edit display name",confirmLabel:"Save",value:le.displayName??"",placeholder:le.username});if(he===null)return;y(u,null);const Ne=await Sm(le.id,{displayName:he});Ne.ok||y(u,Ne.error,!0),await T()}async function I(le,he){const ye=le.roles.includes(he)?le.roles.filter(xe=>xe!==he):[...le.roles,he];if(ye.length===0){y(u,"A user must keep at least one role."),await T();return}y(u,null);const we=await Sm(le.id,{roles:ye});we.ok||y(u,we.error,!0),await T()}async function U(le){const he=await Ro(`Set a new password for “${le.username}”:`,{title:"Reset password",confirmLabel:"Set password",placeholder:"New password"});if(he===null)return;y(u,null);const Ne=await l5(le.id,{newPassword:he});Ne.ok||y(u,Ne.error,!0)}async function P(le){if(!await Cl(`Delete the user “${le.username}”? This can’t be undone.`,{title:"Delete user",confirmLabel:"Delete",danger:!0}))return;y(u,null);const Ne=await c5(le.id);if(!Ne.ok){y(u,Ne.error,!0);return}await T()}var ee=y5(),F=S(ee);{var G=le=>{var he=d5(),Ne=S(he);ie(()=>ue(Ne,l(u))),j(le,he)};fe(F,le=>{l(u)&&le(G)})}var Q=O(F,2),ne=S(Q);{var _=le=>{var he=f5();j(le,he)},M=le=>{var he=h5(),Ne=S(he);ie(()=>ue(Ne,l(o))),j(le,he)},v=le=>{var he=_5(),Ne=O(S(he));Ct(Ne,21,()=>l(a),ye=>ye.id,(ye,we)=>{const xe=Ae(()=>l(we).id===l(b));var Me=T5(),Ge=S(Me),We=S(Ge),$t=S(We);{var He=wt=>{var xt=m5(),Wt=Je(xt),gt=S(Wt),Ut=O(gt);{var Mt=fn=>{var Br=p5();j(fn,Br)};fe(Ut,fn=>{l(xe)&&fn(Mt)})}var Gn=O(Wt,2),Kn=S(Gn);ie(()=>{ue(gt,l(we).displayName),ue(Kn,l(we).username)}),j(wt,xt)},Yt=wt=>{var xt=b5(),Wt=S(xt),gt=O(Wt);{var Ut=Mt=>{var Gn=g5();j(Mt,Gn)};fe(gt,Mt=>{l(xe)&&Mt(Ut)})}ie(()=>ue(Wt,l(we).username)),j(wt,xt)};fe($t,wt=>{l(we).displayName?wt(He):wt(Yt,-1)})}var Zt=O(We,2);{var Pt=wt=>{var xt=v5();j(wt,xt)};fe(Zt,wt=>{l(we).locked&&wt(Pt)})}var Et=O(Ge),Tn=S(Et);Ct(Tn,21,()=>r,Ho,(wt,xt)=>{var Wt=E5(),gt=S(Wt),Ut=O(gt);ie(Mt=>{OT(gt,Mt),gt.disabled=l(xe),ue(Ut,` ${s[l(xt)]??""}`)},[()=>l(we).roles.includes(l(xt))]),ae("change",gt,()=>I(l(we),l(xt))),j(wt,Wt)});var Jt=O(Et),zt=S(Jt),Bn=O(zt,2),Wn=O(Bn,2);ie(()=>{be(Tn,"title",l(xe)?"You can't change your own roles":void 0),Wn.disabled=l(xe),be(Wn,"title",l(xe)?"You can't delete your own account":void 0)}),ae("click",zt,()=>x(l(we))),ae("click",Bn,()=>U(l(we))),ae("click",Wn,()=>P(l(we))),j(ye,Me)}),j(le,he)};fe(ne,le=>{l(i)?le(_):l(o)?le(M,1):le(v,-1)})}var C=O(Q,2),R=O(S(C),2),D=S(R),W=O(S(D),2),$=O(D,2),B=O(S($),2),Y=O($,2),V=O(S(Y),2),te=O(Y,2),de=O(S(te),2);Ct(de,21,()=>r,Ho,(le,he)=>{var Ne=A5(),ye=S(Ne),we,xe=O(ye);ie(()=>{we!==(we=l(he))&&(ye.value=(ye.__value=l(he))??""),ue(xe,` ${s[l(he)]??""}`)}),DT(n,[],ye,()=>(l(he),l(f)),Me=>y(f,Me)),j(le,Ne)});var ge=O(R,2),pe=O(S(ge),2),Ie=S(pe);ie(()=>{pe.disabled=!l(A),ue(Ie,l(p)?"Adding…":"Add user")}),Pe("submit",C,E),_t(W,()=>l(d),le=>y(d,le)),_t(B,()=>l(h),le=>y(h,le)),_t(V,()=>l(g),le=>y(g,le)),j(t,ee),ot()}vt(["change","click"]);var S5=K('<dialog aria-label="Settings" class="svelte-1eaqpj"><header class="svelte-1eaqpj"><h2 class="svelte-1eaqpj">Settings</h2> <button type="button" class="close svelte-1eaqpj" aria-label="Close settings"><!></button></header> <div class="tabs svelte-1eaqpj" role="tablist" aria-label="Settings sections"><button type="button" role="tab">Users</button> <button type="button" role="tab">Branding</button> <button type="button" role="tab">Site</button> <button type="button" role="tab">Health</button></div> <div class="body svelte-1eaqpj"><!></div></dialog>');function w5(t,e){it(e,!0);let n=$n(e,"open",15),r=J(void 0),s=J("users");St(()=>{l(r)&&(n()&&!l(r).open?(y(s,"users"),l(r).showModal()):!n()&&l(r).open&&l(r).close())});function a(Q){Q.preventDefault(),n(!1)}var i=S5(),o=S(i),u=O(S(o),2),d=S(u);xh(d,{size:18,"aria-hidden":"true"});var h=O(o,2),g=S(h);let f;var p=O(g,2);let b;var A=O(p,2);let T;var E=O(A,2);let x;var I=O(h,2),U=S(I);{var P=Q=>{N5(Q,{})},ee=Q=>{qx(Q,{})},F=Q=>{i5(Q,{})},G=Q=>{n5(Q,{})};fe(U,Q=>{l(s)==="users"?Q(P):l(s)==="branding"?Q(ee,1):l(s)==="site"?Q(F,2):Q(G,-1)})}sn(i,Q=>y(r,Q),()=>l(r)),ie(()=>{be(g,"aria-selected",l(s)==="users"),f=Ze(g,1,"svelte-1eaqpj",null,f,{selected:l(s)==="users"}),be(p,"aria-selected",l(s)==="branding"),b=Ze(p,1,"svelte-1eaqpj",null,b,{selected:l(s)==="branding"}),be(A,"aria-selected",l(s)==="site"),T=Ze(A,1,"svelte-1eaqpj",null,T,{selected:l(s)==="site"}),be(E,"aria-selected",l(s)==="health"),x=Ze(E,1,"svelte-1eaqpj",null,x,{selected:l(s)==="health"})}),Pe("cancel",i,a),ae("click",u,()=>n(!1)),ae("click",g,()=>y(s,"users")),ae("click",p,()=>y(s,"branding")),ae("click",A,()=>y(s,"site")),ae("click",E,()=>y(s,"health")),j(t,i),ot()}vt(["click"]);const id="nanoesis-theme";function I5(t){return t==="system"||t==="light"||t==="dark"}function wm(t,e){return t==="light"||t==="dark"?t:e?"dark":"light"}function C5(){let t=J("system"),e=J(!1);const n=()=>{document.documentElement.dataset.theme=wm(l(t),l(e))};return{get choice(){return l(t)},get resolved(){return wm(l(t),l(e))},init(){const r=localStorage.getItem(id);I5(r)&&y(t,r,!0);const s=window.matchMedia("(prefers-color-scheme: dark)");y(e,s.matches,!0),s.addEventListener("change",a=>{y(e,a.matches,!0),n()}),n()},setChoice(r){y(t,r,!0),r==="system"?localStorage.removeItem(id):localStorage.setItem(id,r),n()}}}const fl=C5();var L5=K('<button type="button"> </button>'),O5=K('<div class="segmented svelte-1cmi4dh" role="group" aria-label="Theme"></div>');function x5(t,e){it(e,!1);const n=[{value:"system",label:"System"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}];D1();var r=O5();Ct(r,5,()=>n,s=>s.value,(s,a)=>{var i=L5();let o;var u=S(i);ie(()=>{o=Ze(i,1,"option svelte-1cmi4dh",null,o,{selected:fl.choice===l(a).value}),be(i,"aria-pressed",fl.choice===l(a).value),ue(u,l(a).label)}),ae("click",i,()=>fl.setChoice(l(a).value)),j(s,i)}),j(t,r),ot()}vt(["click"]);var R5=K('<span class="badge svelte-yic9pk"> </span>'),D5=K('<button type="button"> <!></button>'),k5=K('<div class="segmented svelte-yic9pk" role="group" aria-label="Editor mode"></div>'),P5=K('<span class="spacer"></span>'),M5=K('<button type="button" class="icon-button svelte-yic9pk" title="Settings" aria-label="Settings"><!></button>'),B5=K('<header class="topbar svelte-yic9pk"><div class="brand svelte-yic9pk"><img class="logo svelte-yic9pk" alt="" width="24" height="24"/> </div> <!> <div class="actions svelte-yic9pk"><!> <button class="publish svelte-yic9pk" type="button"> </button> <!> <!></div></header> <!>',1);function F5(t,e){it(e,!0);const n=Ae(()=>In.logoUrl??wv),r=Ae(()=>In.name??"nanoesis"),s=Ae(()=>dt.canAuthor&&dt.canDevelop);let a=J(!1);St(()=>{dt.canDevelop&&!dt.canAuthor?Tr.set("templates"):dt.canAuthor&&!dt.canDevelop&&Tr.set("content")});const i=[{value:"content",label:"Content"},{value:"templates",label:"Templates"},{value:"migrations",label:"Migrations"}];async function o(_){_!==Tr.mode&&await cb("Switching workspaces will close this file.")&&Tr.set(_)}Xu.ensureLoaded();let u=J(!1);async function d(){if(!l(u)){y(u,!0);try{const _=await NN();if(_.ok){const M=_.summary;if(M===void 0){const v=_.written;await Xt(`Published ${v} file${v===1?"":"s"} to the live site.`,{title:"Published"})}else if(M.published===0)await Xt(M.firstPublishWarning??"Your site has no published pages. Toggle Publish on at least one page to go live.",{title:"Nothing went live"});else{const v=M.published,C=M.drafts,R=[`Published ${v} page${v===1?"":"s"} to the live site.`];C>0&&R.push("",`${C} draft${C===1?" was":"s were"} skipped.`),await Xt(R.join(`
133
+ `),{title:"Published"})}}else await Xt(`Fix these, then publish again:
134
+
135
+ • ${_.errors.join(`
136
+ • `)}`,{title:`Publish blocked, ${_.errors.length} ${_.errors.length===1?"thing":"things"} would break`})}catch(_){await Xt(_ instanceof Error?_.message:String(_),{title:"Publish failed"})}finally{y(u,!1)}}}var h=B5(),g=Je(h),f=S(g),p=S(f),b=O(p,1,!0),A=O(f,2);{var T=_=>{var M=k5();Ct(M,21,()=>i,v=>v.value,(v,C)=>{var R=D5();let D;var W=S(R),$=O(W);{var B=Y=>{var V=R5(),te=S(V);ie(()=>{be(V,"aria-label",`${Xu.count} pending`),ue(te,Xu.count)}),j(Y,V)};fe($,Y=>{l(C).value==="migrations"&&Xu.count>0&&Y(B)})}ie(()=>{D=Ze(R,1,"option svelte-yic9pk",null,D,{selected:Tr.mode===l(C).value}),be(R,"aria-pressed",Tr.mode===l(C).value),ue(W,`${l(C).label??""} `)}),ae("click",R,()=>void o(l(C).value)),j(v,R)}),j(_,M)},E=_=>{var M=P5();j(_,M)};fe(A,_=>{l(s)?_(T):_(E,-1)})}var x=O(A,2),I=S(x);x5(I,{});var U=O(I,2),P=S(U),ee=O(U,2);{var F=_=>{var M=M5(),v=S(M);Oh(v,{size:18,"aria-hidden":"true"}),ae("click",M,()=>y(a,!0)),j(_,M)};fe(ee,_=>{dt.isAdmin&&_(F)})}var G=O(ee,2);kx(G,{});var Q=O(g,2);{var ne=_=>{w5(_,{get open(){return l(a)},set open(M){y(a,M,!0)}})};fe(Q,_=>{dt.isAdmin&&_(ne)})}ie(()=>{be(p,"src",l(n)),ue(b,l(r)),U.disabled=l(u),ue(P,l(u)?"Publishing…":"Publish")}),ae("click",U,d),j(t,h),ot()}vt(["click"]);var U5=K('<li class="hint svelte-2dodtm">Loading…</li>'),H5=K('<li class="hint svelte-2dodtm">Empty</li>'),q5=K('<p class="hint nested svelte-2dodtm">Loading…</p>'),j5=K("<div><!> <!></div>"),$5=K('<li><div draggable="true"><button type="button" class="grip svelte-2dodtm"><!></button> <button type="button" class="chevron svelte-2dodtm"><!></button> <button type="button"><span class="label svelte-2dodtm"> </span></button> <span class="actions svelte-2dodtm"><button type="button" title="Folder settings" class="svelte-2dodtm"><!></button></span></div> <!></li>'),Y5=K('<li><div draggable="true"><button type="button" class="grip svelte-2dodtm"><!></button> <button type="button"><span class="title svelte-2dodtm"> </span></button></div></li>'),z5=K("<ul><!></ul>");function xv(t,e){it(e,!0),St(()=>{tc(e.treePath)});const n=Ae(()=>bi(e.treePath)),r=Ae(()=>{var F;return((F=l(n))==null?void 0:F.defaultTemplate)??e.inheritedTemplate}),s=Ae(()=>{var F;return(((F=l(n))==null?void 0:F.entries)??[]).filter(G=>!(G.kind==="item"&&G.slug==="index"))});function a(F){return`tree-group-${F.replace(/\//g,"--")||"root"}`}function i(F){li(F)||fp(F),e.onopenDir(F)}function o(F){return F.template??l(r)}function u(F){return F.isPublished?void 0:`${F.title}, not published`}function d(F){var ne;const G=[...F],Q=(((ne=l(n))==null?void 0:ne.entries)??[]).map(_=>l(s).includes(_)?G.shift()??_.slug:_.slug);e6(e.treePath,Q),e.onreorder(e.treePath,Q)}function h(F,G){const Q=l(s).map(_=>_.slug),ne=Q.indexOf(F);ne<0||d(cf(Q,ne,ne+G))}function g(F,G){F.key==="ArrowUp"?(F.preventDefault(),h(G.slug,-1)):F.key==="ArrowDown"&&(F.preventDefault(),h(G.slug,1))}function f(F,G){A6(F,e.treePath),G.dataTransfer&&(G.dataTransfer.effectAllowed="move",G.dataTransfer.setData("text/plain",F.slug))}function p(F,G){return G.kind==="dir"&&G.path!==F.entry.path&&F.parent!==G.path&&!G.path.startsWith(`${F.entry.path}/`)}function b(F,G){return F.parent===e.treePath&&G.path!==F.entry.path}function A(F,G){const Q=vi();Q!==null&&(!p(Q,F)&&!b(Q,F)||(G.preventDefault(),G.dataTransfer&&(G.dataTransfer.dropEffect="move"),jc(F.path)))}function T(F,G){G.preventDefault();const Q=vi();if(ks(),Q===null)return;if(p(Q,F)){e.onmove(Q.entry.path,Q.entry.kind,F.path);return}if(!b(Q,F))return;const ne=l(s).map(v=>v.slug),_=ne.indexOf(Q.entry.slug),M=ne.indexOf(F.slug);_<0||M<0||d(cf(ne,_,M))}var E=z5();let x;var I=S(E);{var U=F=>{var G=U5();j(F,G)},P=F=>{var G=H5();j(F,G)},ee=F=>{var G=jn(),Q=Je(G);Ct(Q,17,()=>l(s),ne=>ne.path,(ne,_)=>{var M=jn(),v=Je(M);{var C=D=>{var W=$5(),$=S(W);let B;var Y=S($),V=S(Y);of(V,{size:16,"aria-hidden":"true"});var te=O(Y,2),de=S(te);{var ge=He=>{b6(He,{size:16,"aria-hidden":"true"})},pe=Ae(()=>li(l(_).path)),Ie=He=>{g6(He,{size:16,"aria-hidden":"true"})};fe(de,He=>{l(pe)?He(ge):He(Ie,-1)})}var le=O(te,2);let he;var Ne=S(le),ye=S(Ne),we=O(le,2),xe=S(we),Me=S(xe);Oh(Me,{size:16,"aria-hidden":"true"});var Ge=O($,2);{var We=He=>{var Yt=j5(),Zt=S(Yt);{var Pt=Jt=>{var zt=q5();j(Jt,zt)},Et=Ae(()=>XN(l(_).path)&&bi(l(_).path)===void 0);fe(Zt,Jt=>{l(Et)&&Jt(Pt)})}var Tn=O(Zt,2);{let Jt=Ae(()=>e.level+1);xv(Tn,{get treePath(){return l(_).path},get inheritedTemplate(){return l(r)},get level(){return l(Jt)},get selectedPath(){return e.selectedPath},get activeDir(){return e.activeDir},get onselect(){return e.onselect},get onopenDir(){return e.onopenDir},get onsettingsDir(){return e.onsettingsDir},get onfoldermenu(){return e.onfoldermenu},get onreorder(){return e.onreorder},get onmove(){return e.onmove}})}ie(Jt=>be(Yt,"id",Jt),[()=>a(l(_).path)]),j(He,Yt)},$t=Ae(()=>li(l(_).path));fe(Ge,He=>{l($t)&&He(We)})}ie((He,Yt,Zt,Pt)=>{B=Ze($,1,"row svelte-2dodtm",null,B,He),be(Y,"aria-label",`Reorder ${l(_).name}; arrow keys move it`),be(te,"aria-expanded",Yt),be(te,"aria-controls",Zt),be(te,"aria-label",Pt),he=Ze(le,1,"dir svelte-2dodtm",null,he,{active:l(_).path===e.activeDir}),be(le,"aria-current",l(_).path===e.activeDir),be(le,"title",`${l(_).name}, open this section's page`),ue(ye,l(_).name),be(xe,"aria-label",`Settings for ${l(_).name}`)},[()=>({active:l(_).path===e.activeDir,"drop-target":gp()===l(_).path}),()=>li(l(_).path),()=>a(l(_).path),()=>`${li(l(_).path)?"Collapse":"Expand"} ${l(_).name}`]),Pe("dragstart",$,He=>f(l(_),He)),Pe("dragover",$,He=>A(l(_),He)),Pe("dragleave",$,()=>jc(null)),Pe("drop",$,He=>T(l(_),He)),Pe("dragend",$,function(...He){ks==null||ks.apply(this,He)}),ae("contextmenu",$,He=>{He.preventDefault(),e.onfoldermenu(l(_).path,He.clientX,He.clientY)}),ae("keydown",Y,He=>g(He,l(_))),ae("click",te,()=>fp(l(_).path)),ae("click",le,()=>i(l(_).path)),ae("click",xe,()=>e.onsettingsDir(l(_).path)),j(D,W)},R=D=>{var W=Y5(),$=S(W);let B;var Y=S($),V=S(Y);of(V,{size:16,"aria-hidden":"true"});var te=O(Y,2);let de;var ge=S(te),pe=S(ge);ie((Ie,le)=>{B=Ze($,1,"row svelte-2dodtm",null,B,Ie),be(Y,"aria-label",`Reorder ${l(_).title}; arrow keys move it`),de=Ze(te,1,"item svelte-2dodtm",null,de,{selected:l(_).path===e.selectedPath,unpublished:!l(_).isPublished}),be(te,"aria-current",l(_).path===e.selectedPath),be(te,"aria-label",le),be(te,"title",l(_).title),ue(pe,l(_).title)},[()=>({"drop-target":gp()===l(_).path}),()=>u(l(_))]),Pe("dragstart",$,Ie=>f(l(_),Ie)),Pe("dragover",$,Ie=>A(l(_),Ie)),Pe("dragleave",$,()=>jc(null)),Pe("drop",$,Ie=>T(l(_),Ie)),Pe("dragend",$,function(...Ie){ks==null||ks.apply(this,Ie)}),ae("keydown",Y,Ie=>g(Ie,l(_))),ae("click",te,()=>e.onselect(l(_).path,o(l(_)))),j(D,W)};fe(v,D=>{l(_).kind==="dir"?D(C):D(R,-1)})}j(ne,M)}),j(F,G)};fe(I,F=>{l(n)===void 0?F(U):l(s).length===0?F(P,1):F(ee,-1)})}ie(()=>x=Ze(E,1,"level svelte-2dodtm",null,x,{root:e.level===1})),j(t,E),ot()}vt(["contextmenu","keydown","click"]);var W5=K('<p class="placeholder pad svelte-whg6dh">Loading editor…</p>'),G5=K('<p class="placeholder pad svelte-whg6dh">Loading migrations…</p>'),K5=K('<p class="placeholder svelte-whg6dh"> </p>'),V5=K('<p class="placeholder svelte-whg6dh"> </p>'),X5=K('<li role="option"><span class="result-title svelte-whg6dh"> </span> <span class="result-path svelte-whg6dh"> </span></li>'),Q5=K('<ul class="results svelte-whg6dh" role="listbox" id="search-results" aria-label="Search results"></ul>'),Z5=K('<span class="home-hint svelte-whg6dh">needs template</span>'),J5=K('<span class="home-hint svelte-whg6dh">draft</span>'),eR=K("<div>Move to top level</div>"),tR=K('<div class="tree-body svelte-whg6dh"><button type="button"><!> <span class="home-label">Home</span> <!></button> <!> <!></div>'),nR=K("<option> </option>"),rR=K('<button type="button" class="ghost svelte-whg6dh">Delete this page</button>'),sR=K(`<div class="work-pad svelte-whg6dh"><div class="broken-item svelte-whg6dh"><h1 class="svelte-whg6dh">This page has no template</h1> <p class="svelte-whg6dh">Pick a template to set up the form, or delete the page. This usually happens when
137
+ an item was created before its template existed (a common state after recovering a
138
+ store with reconcile).</p> <label class="svelte-whg6dh"><span class="svelte-whg6dh">Template</span> <select class="svelte-whg6dh"><option> </option><!></select></label> <!></div></div>`),aR=K(`<div class="work-pad svelte-whg6dh"><div class="welcome svelte-whg6dh"><h1 class="svelte-whg6dh">Setting up your starter site…</h1> <p class="svelte-whg6dh">Adding a home page, a template, and a stylesheet so you can get straight to
139
+ editing. This only happens once.</p></div></div>`),iR=K(`<div class="work-pad svelte-whg6dh"><div class="welcome svelte-whg6dh"><h1 class="svelte-whg6dh">nanoesis</h1> <p class="svelte-whg6dh">Pick an item from the tree to edit it. The form is generated from its template,
140
+ the template is the schema. Switch to <strong>Templates</strong> to edit those templates
141
+ and components directly.</p></div></div>`),oR=K('<div class="panes svelte-whg6dh"><aside class="tree svelte-whg6dh" aria-label="Content"><div class="tree-head svelte-whg6dh"><h2 class="tree-title svelte-whg6dh">Content</h2> <div class="tree-head-actions svelte-whg6dh"><button type="button" class="add svelte-whg6dh" title="New folder" aria-label="New folder"><!></button> <button type="button" class="add svelte-whg6dh" title="New content item" aria-label="New content item"><!></button></div></div> <div class="search svelte-whg6dh"><!> <input type="search" role="combobox" placeholder="Search titles…" aria-label="Search content by title" aria-controls="search-results" aria-autocomplete="list" class="svelte-whg6dh"/></div> <!></aside> <!> <main class="work svelte-whg6dh"><!></main></div>'),uR=K('<button type="button" class="menu-backdrop svelte-whg6dh" aria-label="Close menu"></button> <div class="context-menu svelte-whg6dh" role="menu" tabindex="-1"><button type="button" role="menuitem" class="svelte-whg6dh">Add content…</button> <button type="button" role="menuitem" class="svelte-whg6dh">Add folder…</button></div>',1),lR=K('<div class="shell svelte-whg6dh"><!> <div class="shell-body svelte-whg6dh"><!></div> <!></div> <!> <!> <!>',1);function cR(t,e){it(e,!0);let n=J(null);St(()=>{const q=uf.target;q!==null&&(uf.clear(),(async()=>await cb("Opening this item will close the open file.")&&(Tr.set("content"),await P(q)))())});let r=J(null),s=J(""),a=J(null),i=J(!1);function o(q){return q==="index"?"":q.endsWith("/index")?q.slice(0,-6):null}const u=Ae(()=>l(r)??(l(n)!==null?o(l(n).path):null)),d=Ae(()=>l(n)!==null&&o(l(n).path)!==null),h=Ae(()=>{var q;return((q=l(n))==null?void 0:q.path)==="index"});let g=J(""),f=J(ft([])),p=J(-1),b=J(void 0),A;St(()=>{const q=l(g);if(clearTimeout(A),q.trim()===""){y(f,[],!0),y(p,-1);return}return A=setTimeout(()=>{Kg(q).then(z=>{q===l(g)&&(y(f,z,!0),y(p,z.length>0?0:-1,!0))})},200),()=>clearTimeout(A)});function T(){T1().then(()=>{var q,z;return(z=(q=l(b))==null?void 0:q.children[l(p)])==null?void 0:z.scrollIntoView({block:"nearest"})})}function E(q){if(q.key==="Escape"){y(g,"");return}if(l(f).length!==0){if(q.key==="ArrowDown")q.preventDefault(),y(p,(l(p)+1)%l(f).length),T();else if(q.key==="ArrowUp")q.preventDefault(),y(p,(l(p)-1+l(f).length)%l(f).length),T();else if(q.key==="Enter"){q.preventDefault();const z=l(f)[l(p)]??l(f)[0];z!==void 0&&G(z)}}}Va(()=>{tc("").catch(Te=>{y(a,Te instanceof Error?Te.message:String(Te),!0)}),Ne();const q=Te=>{af.hasDirty&&(Te.preventDefault(),Te.returnValue="")};window.addEventListener("beforeunload",q);const z=o6({reconcileOnce:async()=>{const Te=await Ke("/api/reconcile",{method:"POST"});return Te.ok?i6(await Te.json().catch(()=>null)):{changed:!1,added:0,removed:0}},onChanged:()=>{QN(),r6()},isVisible:()=>document.visibilityState==="visible"});return z.start(),()=>{window.removeEventListener("beforeunload",q),z.stop()}});function x(q){return q.includes("/")?q.slice(0,q.lastIndexOf("/")):""}function I(q){return l(n)!==null&&(l(n).path===q||l(n).path.startsWith(`${q}/`))}async function U(q,z){try{const Te=await lp(q);y(r,null),y(n,{item:Te,path:q,templateName:z},!0)}catch(Te){await Xt(Te instanceof Error?Te.message:String(Te))}}async function P(q){try{const z=await lp(q);y(r,null),y(n,{item:z,path:q,templateName:await gN(q,z.template)},!0)}catch(z){await Xt(z instanceof Error?z.message:String(z))}}async function ee(q){const z=q===""?"index":`${q}/index`;await kN(z)?await P(z):(y(n,null),await Ne(),y(s,await Jd(q),!0),y(r,q,!0))}async function F(q){const z=l(r);if(z===null)return;const Te=z===""?"index":`${z}/index`,Le=await Jd(z);try{await Jg(Te,Le,q)}catch(Fe){await Xt(Fe instanceof Error?Fe.message:String(Fe));return}await Sn(z),await fo(Te),await P(Te)}async function G(q){y(g,""),await fo(q.path),await U(q.path,q.template)}async function Q(q,z){try{await FN(q,z)}catch(Te){await Xt(Te instanceof Error?Te.message:String(Te)),await Sn(q)}}async function ne(q,z,Te){var qe;const Le=x(q);if(Te===Le)return;let Fe;try{Fe=z==="item"?await qN(q,Te):await jN(q,Te)}catch(ut){await Xt(ut instanceof Error?ut.message:String(ut));return}z==="item"?await Mu(vr(q),vr(Fe)):await Mu(`${vr(q)}*`,`${vr(Fe)}:splat`),await Sn(Le),await Sn(Te),await fo(Fe),z==="item"&&((qe=l(n))==null?void 0:qe.path)===q?await P(Fe):z==="dir"&&I(q)&&y(n,null)}async function _(q){q.preventDefault();const z=vi();ks(),z!==null&&z.parent!==""&&await ne(z.entry.path,z.entry.kind,"")}async function M(q){l(n)!==null&&await ne(l(n).path,"item",q)}async function v(q){const z=l(Et);y(Et,null),z!==null&&await ne(z,"dir",q)}async function C(q){if(l(n)===null)return;const{path:z}=l(n);try{await cp(z,q)}catch(Te){await Xt(Te instanceof Error?Te.message:String(Te));return}await Sn(x(z)),await P(z)}const R=Ae(()=>bi("")!==void 0),D=Ae(()=>{var q;return(((q=bi(""))==null?void 0:q.entries.length)??-1)===0}),W=Ae(()=>{const q=bi(""),z=q==null?void 0:q.entries.find(Te=>Te.kind==="item"&&Te.slug==="index");return(z==null?void 0:z.kind)==="item"?z:void 0}),$=Ae(()=>{var Te;const q=l(W);return q===void 0?"missing":(q.template??((Te=bi(""))==null?void 0:Te.defaultTemplate))===void 0?"broken":q.isPublished?"published":"draft"}),B=Ae(()=>{switch(l($)){case"missing":return"Home, the site’s front page (/). No page yet — click to create.";case"broken":return"Home page exists but its template is missing — click to fix.";case"draft":return"Home, the site’s front page (/). Draft, not yet published.";case"published":return"Home, the site’s front page (/)."}});let Y=J(!1);async function V(q){if(!(l(n)===null||q==="")){y(Y,!0);try{await cp(l(n).path,q),await Sn(x(l(n).path)),await P(l(n).path)}catch(z){await Xt(z instanceof Error?z.message:String(z))}finally{y(Y,!1)}}}let te=J(!1),de=J(!1);St(()=>{!l(de)&&!l(te)&&dt.isAdmin&&l(R)&&l(D)&&(y(de,!0),ge())});async function ge(){y(te,!0);try{await SN(),l6(localStorage),await Sn(""),await Ne(),await P("index")}catch(q){if(q instanceof Error&&/already has content/i.test(q.message))return;await Xt(q instanceof Error?q.message:String(q))}finally{y(te,!1)}}let pe=J(!1),Ie=J(""),le=J(ft([])),he=J(ft([]));async function Ne(){const q=await tf("templates");y(le,q.filter(z=>z!==du&&!Od(z.split("/").pop()??z)),!0)}async function ye(q){await Ne(),y(he,await Qd(),!0),y(Ie,q,!0),y(pe,!0)}async function we(){await ye("")}async function xe(q){y(pe,!1),await Sn(x(q)),await fo(q),await P(q)}async function Me(q){const z=await Ro("New folder name:",{title:"New folder",confirmLabel:"Create"});if(z===null||z.trim()==="")return;let Te;try{Te=await PN(q,z)}catch(Le){await Xt(Le instanceof Error?Le.message:String(Le));return}await Sn(q),await fo(`${Te}/_`)}async function Ge(){const q=l(Et);y(Et,null),q!==null&&await Me(q)}let We=J(null);function $t(q,z,Te){y(We,{x:z,y:Te,path:q},!0)}function He(){y(We,null)}async function Yt(){var z;const q=((z=l(We))==null?void 0:z.path)??"";He(),await ye(q)}async function Zt(){var z;const q=(z=l(We))==null?void 0:z.path;He(),q!==void 0&&await Me(q)}function Pt(q){var Te;const z=q.getBoundingClientRect();z.right>window.innerWidth&&(q.style.left=`${window.innerWidth-z.width-8}px`),z.bottom>window.innerHeight&&(q.style.top=`${window.innerHeight-z.height-8}px`),(Te=q.querySelector("button"))==null||Te.focus()}let Et=J(null);async function Tn(q){await Ne(),y(he,await Qd(),!0),y(Et,q,!0)}async function Jt(){const q=l(Et);y(Et,null),q!==null&&await Sn(q),l(n)!==null&&await P(l(n).path)}async function zt(){const q=l(Et);y(Et,null),q!==null&&await wt(q)}async function Bn(){const q=l(Et);y(Et,null),q!==null&&await Wn(q)}async function Wn(q){const z=il(q);if(await Cl(`Delete the folder “${z}” and everything in it? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await Il(Ti(q))}catch(Le){await Xt(Le instanceof Error?Le.message:String(Le));return}I(q)&&y(n,null),await Sn(x(q))}}async function wt(q){const z=il(q),Te=await Ro("New URL for this folder (its slug, the name comes from its page title):",{title:"Change URL",value:z,confirmLabel:"Change URL"});if(Te===null)return;const Le=bs(Te);if(Le===""||Le===z)return;const Fe=ap(q,Le);try{await $a(Ti(q),Ti(Fe))}catch(qe){await Xt(qe instanceof Error?qe.message:String(qe));return}await Mu(`${vr(q)}*`,`${vr(Fe)}:splat`),I(q)&&y(n,null),await Sn(x(q))}async function xt(){if(l(n)===null)return;const{path:q,item:z}=l(n);if(await Cl(`Delete “${z.title}”? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await Il($s(q))}catch(Le){await Xt(Le instanceof Error?Le.message:String(Le));return}mp(localStorage,q),y(n,null),await Sn(x(q))}}async function Wt(){if(l(n)===null)return;const q=l(n).path,z=il(q),Te=await Ro("New URL for this page (its slug, the title is separate):",{title:"Change URL",value:z,confirmLabel:"Change URL"});if(Te===null)return;const Le=bs(Te);if(Le===""||Le===z)return;const Fe=ap(q,Le);try{await $a($s(q),$s(Fe))}catch(qe){await Xt(qe instanceof Error?qe.message:String(qe));return}mp(localStorage,q),await Mu(vr(q),vr(Fe)),await Sn(x(q)),await P(Fe)}let gt=J(null),Ut=J(null);St(()=>{Tr.mode==="templates"&&l(gt)===null&&Z0(()=>import("./TemplatesPane-Dt8Z7trK.js").then(q=>q.T),__vite__mapDeps([0,1]),import.meta.url).then(q=>{y(gt,q.default,!0)}),Tr.mode==="migrations"&&l(Ut)===null&&Z0(()=>import("./MigrationsPane-BEY3O03s.js"),__vite__mapDeps([2,3]),import.meta.url).then(q=>{y(Ut,q.default,!0)})});var Mt=lR(),Gn=Je(Mt),Kn=S(Gn);F5(Kn,{});var fn=O(Kn,2),Br=S(fn);{var Fr=q=>{var z=jn(),Te=Je(z);{var Le=qe=>{var ut=jn(),An=Je(ut);p0(An,()=>l(gt),(an,bt)=>{bt(an,{})}),j(qe,ut)},Fe=qe=>{var ut=W5();j(qe,ut)};fe(Te,qe=>{l(gt)?qe(Le):qe(Fe,-1)})}j(q,z)},fr=q=>{var z=jn(),Te=Je(z);{var Le=qe=>{var ut=jn(),An=Je(ut);p0(An,()=>l(Ut),(an,bt)=>{bt(an,{})}),j(qe,ut)},Fe=qe=>{var ut=G5();j(qe,ut)};fe(Te,qe=>{l(Ut)?qe(Le):qe(Fe,-1)})}j(q,z)},_n=q=>{var z=oR(),Te=S(z),Le=S(Te),Fe=O(S(Le),2),qe=S(Fe),ut=S(qe);_6(ut,{size:18,"aria-hidden":"true"});var An=O(qe,2),an=S(An);m6(an,{size:18,"aria-hidden":"true"});var bt=O(Le,2),Cs=S(bt);mb(Cs,{class:"search-icon",size:16,"aria-hidden":"true"});var jr=O(Cs,2),ia=O(bt,2);{var oa=rt=>{var Se=K5(),_e=S(Se);ie(()=>ue(_e,`Couldn’t load content: ${l(a)??""}`)),j(rt,Se)},ua=rt=>{var Se=jn(),_e=Je(Se);{var Ye=Tt=>{var Bt=V5(),Gt=S(Bt);ie(Kt=>ue(Gt,`No matches for “${Kt??""}”.`),[()=>l(g).trim()]),j(Tt,Bt)},lt=Tt=>{var Bt=Q5();Ct(Bt,23,()=>l(f),Gt=>Gt.path,(Gt,Kt,Vn)=>{var Lt=X5();let hn;var pt=S(Lt),Rt=S(pt),yn=O(pt,2),Xn=S(yn);ie(()=>{be(Lt,"id",`search-option-${l(Vn)}`),hn=Ze(Lt,1,"result svelte-whg6dh",null,hn,{active:l(Vn)===l(p),unpublished:!l(Kt).isPublished}),be(Lt,"aria-selected",l(Vn)===l(p)),be(Lt,"aria-label",l(Kt).isPublished?void 0:`${l(Kt).title}, not published`),ue(Rt,l(Kt).title),ue(Xn,l(Kt).path)}),ae("click",Lt,()=>G(l(Kt))),Pe("mouseenter",Lt,()=>y(p,l(Vn),!0)),j(Gt,Lt)}),sn(Bt,Gt=>y(b,Gt),()=>l(b)),j(Tt,Bt)};fe(_e,Tt=>{l(f).length===0?Tt(Ye):Tt(lt,-1)})}j(rt,Se)},Ht=Ae(()=>l(g).trim()!==""),la=rt=>{var Se=tR(),_e=S(Se);let Ye;var lt=S(_e);v6(lt,{size:16,"aria-hidden":"true"});var Tt=O(lt,4);{var Bt=pt=>{var Rt=Z5();j(pt,Rt)},Gt=pt=>{var Rt=J5();j(pt,Rt)};fe(Tt,pt=>{l($)==="broken"?pt(Bt):l($)==="draft"&&pt(Gt,1)})}var Kt=O(_e,2);{let pt=Ae(()=>{var Rt;return((Rt=l(n))==null?void 0:Rt.path)??null});xv(Kt,{treePath:"",inheritedTemplate:void 0,level:1,get selectedPath(){return l(pt)},get activeDir(){return l(u)},onselect:U,onopenDir:ee,onsettingsDir:Tn,onfoldermenu:$t,onreorder:Q,onmove:ne})}var Vn=O(Kt,2);{var Lt=pt=>{var Rt=eR();let yn;ie(Xn=>yn=Ze(Rt,1,"root-drop svelte-whg6dh",null,yn,Xn),[()=>({over:vi()!==null&&l(i)})]),Pe("dragover",Rt,Xn=>{Xn.preventDefault(),y(i,!0)}),Pe("dragleave",Rt,()=>y(i,!1)),Pe("drop",Rt,Xn=>{y(i,!1),_(Xn)}),j(pt,Rt)},hn=Ae(()=>{var pt;return vi()!==null&&((pt=vi())==null?void 0:pt.parent)!==""});fe(Vn,pt=>{l(hn)&&pt(Lt)})}ie(()=>{Ye=Ze(_e,1,"home-row svelte-whg6dh",null,Ye,{active:l(u)==="",unpublished:l($)==="draft"||l($)==="broken",broken:l($)==="broken"}),be(_e,"aria-current",l(u)===""),be(_e,"title",l(B))}),ae("click",_e,()=>ee("")),j(rt,Se)};fe(ia,rt=>{l(a)?rt(oa):l(Ht)?rt(ua,1):rt(la,-1)})}var Ls=O(Te,2);Ex(Ls,{});var ca=O(Ls,2),da=S(ca);{var fa=rt=>{var Se=jn(),_e=Je(Se);mT(_e,()=>`${l(n).path}\0${l(n).templateName}`,Ye=>{{let lt=Ae(()=>l(d)?void 0:Wt),Tt=Ae(()=>l(h)?void 0:xt);Y8(Ye,{get item(){return l(n).item},get templateName(){return l(n).templateName},get path(){return l(n).path},get templates(){return l(le)},get onrename(){return l(lt)},get ondelete(){return l(Tt)},onchangetemplate:C,onmove:M,onsaved:(Bt,Gt,Kt)=>{ZN(Bt,Gt),JN(Bt,Kt)}})}}),j(rt,Se)},en=rt=>{var Se=sR(),_e=S(Se),Ye=O(S(_e),4),lt=O(S(Ye),2),Tt=S(lt),Bt=S(Tt);Tt.value=Tt.__value="";var Gt=O(Tt);Ct(Gt,16,()=>l(le),Lt=>Lt,(Lt,hn)=>{var pt=nR(),Rt=S(pt),yn={};ie(()=>{ue(Rt,hn),yn!==(yn=hn)&&(pt.value=(pt.__value=hn)??"")}),j(Lt,pt)});var Kt=O(Ye,2);{var Vn=Lt=>{var hn=rR();ie(()=>hn.disabled=l(Y)),ae("click",hn,xt),j(Lt,hn)};fe(Kt,Lt=>{l(h)||Lt(Vn)})}ie(()=>{lt.disabled=l(Y)||l(le).length===0,ue(Bt,l(le).length===0?"No templates exist yet":"Choose…")}),ae("change",lt,Lt=>V(Lt.currentTarget.value)),j(rt,Se)},Os=rt=>{dx(rt,{get folderPath(){return l(r)},get name(){return l(s)},get templates(){return l(le)},oncreate:F})},ha=rt=>{var Se=aR();j(rt,Se)},pa=rt=>{var Se=iR();j(rt,Se)};fe(da,rt=>{l(n)&&l(n).templateName?rt(fa):l(n)?rt(en,1):l(r)!==null?rt(Os,2):dt.isAdmin&&l(R)&&l(D)?rt(ha,3):rt(pa,-1)})}ie(()=>{be(jr,"aria-expanded",l(f).length>0),be(jr,"aria-activedescendant",l(p)>=0?`search-option-${l(p)}`:void 0)}),ae("click",qe,()=>Me("")),ae("click",An,we),ae("keydown",jr,E),_t(jr,()=>l(g),rt=>y(g,rt)),j(q,z)};fe(Br,q=>{Tr.mode==="templates"?q(Fr):Tr.mode==="migrations"?q(fr,1):q(_n,-1)})}var Ur=O(fn,2);V8(Ur,{});var Hr=O(Gn,2);{var hr=q=>{ux(q,{get folders(){return l(he)},get templates(){return l(le)},get initialFolder(){return l(Ie)},oncreated:xe,oncancel:()=>y(pe,!1)})};fe(Hr,q=>{l(pe)&&q(hr)})}var qr=O(Hr,2);{var Ee=q=>{var z=uR(),Te=Je(z),Le=O(Te,2),Fe=S(Le),qe=O(Fe,2);_T(Le,ut=>Pt==null?void 0:Pt(ut)),ie(()=>Qf(Le,`left: ${l(We).x}px; top: ${l(We).y}px`)),ae("click",Te,He),ae("contextmenu",Te,ut=>{ut.preventDefault(),He()}),ae("keydown",Le,ut=>{ut.key==="Escape"&&He()}),ae("click",Fe,Yt),ae("click",qe,Zt),j(q,z)};fe(qr,q=>{l(We)!==null&&q(Ee)})}var $e=O(qr,2);{var Ve=q=>{rx(q,{get folderPath(){return l(Et)},get templates(){return l(le)},get folders(){return l(he)},onsaved:Jt,oncancel:()=>y(Et,null),onnewsubfolder:Ge,onrenamefolder:zt,ondeletefolder:Bn,onmove:v})};fe($e,q=>{l(Et)!==null&&q(Ve)})}j(t,Mt),ot()}vt(["click","keydown","change","contextmenu"]);var dR=K('<h2 class="svelte-z86ibt"> </h2>'),fR=K('<form><!> <label class="svelte-z86ibt"><span class="svelte-z86ibt"> </span> <input class="svelte-z86ibt"/></label> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt">Cancel</button> <button type="submit" class="primary svelte-z86ibt"> </button></div></form>'),hR=K('<h2 class="svelte-z86ibt"> </h2>'),pR=K("<option> </option>"),mR=K('<form><!> <label class="svelte-z86ibt"><span class="svelte-z86ibt"> </span> <select class="svelte-z86ibt"><option disabled=""> </option><!></select></label> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt">Cancel</button> <button type="submit" class="primary svelte-z86ibt"> </button></div></form>'),gR=K('<h2 class="svelte-z86ibt"> </h2>'),bR=K('<!> <p class="message svelte-z86ibt"> </p> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt"> </button> <button type="button"> </button></div>',1),vR=K('<h2 class="svelte-z86ibt"> </h2>'),ER=K('<!> <p class="message svelte-z86ibt"> </p> <div class="actions decide-actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt"> </button> <button type="button"> </button> <button type="button" class="primary svelte-z86ibt"> </button></div>',1),TR=K('<h2 class="svelte-z86ibt"> </h2>'),_R=K('<!> <p class="message svelte-z86ibt"> </p> <div class="actions svelte-z86ibt"><button type="button" class="primary svelte-z86ibt">OK</button></div>',1),AR=K('<dialog aria-label="Dialog" class="svelte-z86ibt"><!></dialog>');function yR(t,e){it(e,!0);let n,r=J(""),s=J("");St(()=>{const p=Bu.pending;p?(p.kind==="prompt"&&y(r,p.options.value??"",!0),p.kind==="select"&&y(s,""),n.open||n.showModal()):n!=null&&n.open&&n.close()});function a(){const p=Bu.pending;(p==null?void 0:p.kind)==="confirm"?Uc(!1):(p==null?void 0:p.kind)==="prompt"?Hc(null):(p==null?void 0:p.kind)==="select"?qc(null):(p==null?void 0:p.kind)==="decide"?Fu("cancel"):hp()}function i(p){p.preventDefault(),a()}function o(p){p.target===n&&a()}function u(p){p.preventDefault(),Hc(l(r))}function d(p){p.preventDefault(),l(s)!==""&&qc(l(s))}var h=AR(),g=S(h);{var f=p=>{const b=Ae(()=>Bu.pending);var A=jn(),T=Je(A);{var E=ee=>{var F=fR(),G=S(F);{var Q=$=>{var B=dR(),Y=S(B);ie(()=>ue(Y,l(b).options.title)),j($,B)};fe(G,$=>{l(b).options.title&&$(Q)})}var ne=O(G,2),_=S(ne),M=S(_),v=O(_,2);Ha(v,!0);var C=O(ne,2),R=S(C),D=O(R,2),W=S(D);ie(()=>{ue(M,l(b).message),be(v,"placeholder",l(b).options.placeholder??""),ue(W,l(b).options.confirmLabel??"OK")}),Pe("submit",F,u),_t(v,()=>l(r),$=>y(r,$)),ae("click",R,()=>Hc(null)),j(ee,F)},x=ee=>{var F=mR(),G=S(F);{var Q=V=>{var te=hR(),de=S(te);ie(()=>ue(de,l(b).options.title)),j(V,te)};fe(G,V=>{l(b).options.title&&V(Q)})}var ne=O(G,2),_=S(ne),M=S(_),v=O(_,2);Ha(v,!0);var C=S(v),R=S(C);C.value=C.__value="";var D=O(C);Ct(D,17,()=>l(b).choices,V=>V.value,(V,te)=>{var de=pR(),ge=S(de),pe={};ie(()=>{ue(ge,l(te).label),pe!==(pe=l(te).value)&&(de.value=(de.__value=l(te).value)??"")}),j(V,de)});var W=O(ne,2),$=S(W),B=O($,2),Y=S(B);ie(()=>{ue(M,l(b).message),ue(R,l(b).options.placeholder??"Choose…"),B.disabled=l(s)==="",ue(Y,l(b).options.confirmLabel??"OK")}),Pe("submit",F,d),qa(v,()=>l(s),V=>y(s,V)),ae("click",$,()=>qc(null)),j(ee,F)},I=ee=>{var F=bR(),G=Je(F);{var Q=$=>{var B=gR(),Y=S(B);ie(()=>ue(Y,l(b).options.title)),j($,B)};fe(G,$=>{l(b).options.title&&$(Q)})}var ne=O(G,2),_=S(ne),M=O(ne,2),v=S(M),C=S(v),R=O(v,2);let D;var W=S(R);ie(()=>{ue(_,l(b).message),ue(C,l(b).options.cancelLabel??"Cancel"),D=Ze(R,1,"primary svelte-z86ibt",null,D,{danger:l(b).options.danger}),ue(W,l(b).options.confirmLabel??"Confirm")}),ae("click",v,()=>Uc(!1)),ae("click",R,()=>Uc(!0)),j(ee,F)},U=ee=>{var F=ER(),G=Je(F);{var Q=Y=>{var V=vR(),te=S(V);ie(()=>ue(te,l(b).options.title)),j(Y,V)};fe(G,Y=>{l(b).options.title&&Y(Q)})}var ne=O(G,2),_=S(ne),M=O(ne,2),v=S(M),C=S(v),R=O(v,2);let D;var W=S(R),$=O(R,2),B=S($);ie(()=>{ue(_,l(b).message),ue(C,l(b).options.cancelLabel),D=Ze(R,1,"ghost svelte-z86ibt",null,D,{"danger-ghost":l(b).options.secondaryDanger}),ue(W,l(b).options.secondaryLabel),ue(B,l(b).options.primaryLabel)}),ae("click",v,()=>Fu("cancel")),ae("click",R,()=>Fu("secondary")),ae("click",$,()=>Fu("primary")),j(ee,F)},P=ee=>{var F=_R(),G=Je(F);{var Q=C=>{var R=TR(),D=S(R);ie(()=>ue(D,l(b).options.title)),j(C,R)};fe(G,C=>{l(b).options.title&&C(Q)})}var ne=O(G,2),_=S(ne),M=O(ne,2),v=S(M);ie(()=>ue(_,l(b).message)),ae("click",v,()=>hp()),j(ee,F)};fe(T,ee=>{l(b).kind==="prompt"?ee(E):l(b).kind==="select"?ee(x,1):l(b).kind==="confirm"?ee(I,2):l(b).kind==="decide"?ee(U,3):ee(P,-1)})}j(p,A)};fe(g,p=>{Bu.pending&&p(f)})}sn(h,p=>n=p,()=>n),Pe("cancel",h,i),ae("click",h,o),j(t,h),ot()}vt(["click"]);var NR=K('<li role="option"><span class="result-title svelte-o6yxmi"> </span> <span class="result-path svelte-o6yxmi"> </span></li>'),SR=K('<ul class="results svelte-o6yxmi" role="listbox" id="link-results"></ul>'),wR=K('<p class="hint svelte-o6yxmi">No matching pages.</p>'),IR=K('<p class="hint svelte-o6yxmi">Type to find a page; it links by reference, so the link follows renames.</p>'),CR=K('<div class="search svelte-o6yxmi"><!> <input type="search" role="combobox" placeholder="Search pages by title…" aria-label="Search pages by title" aria-controls="link-results" aria-autocomplete="list" class="svelte-o6yxmi"/></div> <div class="results-area svelte-o6yxmi"><!></div>',1),LR=K('<label class="url-label svelte-o6yxmi"><span class="svelte-o6yxmi">URL</span> <input type="url" placeholder="https://example.com" class="svelte-o6yxmi"/></label>'),OR=K('<button type="button" class="ghost svelte-o6yxmi">Remove link</button>'),xR=K('<button type="button" class="primary svelte-o6yxmi">Set link</button>'),RR=K('<h2 class="svelte-o6yxmi">Link</h2> <div class="tabs svelte-o6yxmi" role="tablist" aria-label="Link type"><button type="button" role="tab">Page</button> <button type="button" role="tab">External URL</button></div> <div class="body svelte-o6yxmi"><!></div> <div class="actions svelte-o6yxmi"><button type="button" class="ghost svelte-o6yxmi">Cancel</button> <!> <!></div>',1),DR=K('<dialog aria-label="Insert link" class="svelte-o6yxmi"><!></dialog>');function kR(t,e){it(e,!0);let n=J(void 0),r=J("page"),s=J(""),a=J(ft([])),i=J(-1),o=J(""),u=J(void 0);const d=Ae(()=>lS.pending);St(()=>{var I,U;if(l(d)===null){(I=l(n))==null||I.close();return}const x=l(d).current;y(r,x===""||zo(x)?"page":"url",!0),y(s,""),y(a,[],!0),y(i,-1),y(o,zo(x)?"":x,!0),(U=l(n))==null||U.showModal()});let h;St(()=>{const x=l(s);if(clearTimeout(h),l(r)!=="page"||x.trim()===""){y(a,[],!0),y(i,-1);return}return h=setTimeout(()=>{Kg(x).then(I=>{x===l(s)&&(y(a,I,!0),y(i,I.length>0?0:-1,!0))})},200),()=>clearTimeout(h)});function g(x){oi(cS(x.path))}function f(){const x=l(o).trim();x!==""&&oi(x)}function p(){var x,I;(I=(x=l(u))==null?void 0:x.children[l(i)])==null||I.scrollIntoView({block:"nearest"})}function b(x){if(l(a).length!==0){if(x.key==="ArrowDown")x.preventDefault(),y(i,(l(i)+1)%l(a).length),p();else if(x.key==="ArrowUp")x.preventDefault(),y(i,(l(i)-1+l(a).length)%l(a).length),p();else if(x.key==="Enter"){x.preventDefault();const I=l(a)[l(i)]??l(a)[0];I!==void 0&&g(I)}}}var A=DR(),T=S(A);{var E=x=>{var I=RR(),U=O(Je(I),2),P=S(U);let ee;var F=O(P,2);let G;var Q=O(U,2),ne=S(Q);{var _=B=>{var Y=CR(),V=Je(Y),te=S(V);mb(te,{class:"search-icon",size:16,"aria-hidden":"true"});var de=O(te,2);Ha(de,!0);var ge=O(V,2),pe=S(ge);{var Ie=ye=>{var we=SR();Ct(we,23,()=>l(a),xe=>xe.path,(xe,Me,Ge)=>{var We=NR();let $t;var He=S(We),Yt=S(He),Zt=O(He,2),Pt=S(Zt);ie(()=>{be(We,"id",`link-option-${l(Ge)}`),$t=Ze(We,1,"result svelte-o6yxmi",null,$t,{active:l(Ge)===l(i)}),be(We,"aria-selected",l(Ge)===l(i)),ue(Yt,l(Me).title),ue(Pt,l(Me).path)}),ae("click",We,()=>g(l(Me))),Pe("mouseenter",We,()=>y(i,l(Ge),!0)),j(xe,We)}),sn(we,xe=>y(u,xe),()=>l(u)),j(ye,we)},le=ye=>{var we=wR();j(ye,we)},he=Ae(()=>l(s).trim()!==""),Ne=ye=>{var we=IR();j(ye,we)};fe(pe,ye=>{l(a).length>0?ye(Ie):l(he)?ye(le,1):ye(Ne,-1)})}ie(()=>{be(de,"aria-expanded",l(a).length>0),be(de,"aria-activedescendant",l(i)>=0?`link-option-${l(i)}`:void 0)}),ae("keydown",de,b),_t(de,()=>l(s),ye=>y(s,ye)),j(B,Y)},M=B=>{var Y=LR(),V=O(S(Y),2);ae("keydown",V,te=>{te.key==="Enter"&&(te.preventDefault(),f())}),_t(V,()=>l(o),te=>y(o,te)),j(B,Y)};fe(ne,B=>{l(r)==="page"?B(_):B(M,-1)})}var v=O(Q,2),C=S(v),R=O(C,2);{var D=B=>{var Y=OR();ae("click",Y,()=>oi("")),j(B,Y)};fe(R,B=>{l(d).current!==""&&B(D)})}var W=O(R,2);{var $=B=>{var Y=xR();ie(V=>Y.disabled=V,[()=>l(o).trim()===""]),ae("click",Y,f),j(B,Y)};fe(W,B=>{l(r)==="url"&&B($)})}ie(()=>{ee=Ze(P,1,"tab svelte-o6yxmi",null,ee,{active:l(r)==="page"}),be(P,"aria-selected",l(r)==="page"),G=Ze(F,1,"tab svelte-o6yxmi",null,G,{active:l(r)==="url"}),be(F,"aria-selected",l(r)==="url")}),ae("click",P,()=>y(r,"page")),ae("click",F,()=>y(r,"url")),ae("click",C,()=>oi(null)),j(x,I)};fe(T,x=>{l(d)!==null&&x(E)})}sn(A,x=>y(n,x),()=>l(n)),Pe("close",A,()=>oi(null)),Pe("cancel",A,()=>oi(null)),j(t,A),ot()}vt(["click","keydown"]);var PR=K('<img class="brand-logo svelte-2jpsc9" alt="" width="40" height="40"/>'),MR=K(`<p class="lede svelte-2jpsc9">Create your admin account. The first sign-in here becomes the admin, choose a username and
142
+ password.</p>`),BR=K('<p class="lede svelte-2jpsc9">Sign in to continue.</p>'),FR=K(`<small class="hint-error svelte-2jpsc9">Passwords don't match.</small>`),UR=K('<label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Confirm password</span> <input type="password" autocomplete="new-password" required="" class="svelte-2jpsc9"/> <!></label>'),HR=K('<p class="error svelte-2jpsc9" role="alert"> </p>'),qR=K('<main class="screen svelte-2jpsc9"><section class="panel svelte-2jpsc9"><header class="svelte-2jpsc9"><!> <h1 class="svelte-2jpsc9"> </h1> <!></header> <form autocomplete="on" class="svelte-2jpsc9"><label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Username</span> <input type="text" name="username" autocomplete="username" required="" class="svelte-2jpsc9"/></label> <label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Password</span> <input type="password" name="password" required="" class="svelte-2jpsc9"/></label> <!> <!> <button type="submit" class="primary svelte-2jpsc9"><!></button></form></section></main>');function jR(t,e){it(e,!0);const n=Ae(()=>In.name??"nanoesis");let r=J(""),s=J(""),a=J(""),i=J(!1),o=J(null),u=Ae(()=>dt.firstRun&&l(a)!==""&&l(s)!==l(a)),d=Ae(()=>!l(i)&&l(r).trim()!==""&&l(s)!==""&&(!dt.firstRun||l(a)!==""&&!l(u)));async function h(B){if(B.preventDefault(),!l(d))return;y(i,!0),y(o,null);const Y=await dt.login(l(r),l(s));if(y(i,!1),!Y.ok){y(o,g(Y.error??"Sign-in failed."),!0);return}}function g(B){return B.includes("locked")?"Account temporarily locked, try again shortly.":B.includes("credentials")?"Invalid credentials. Check your username and password.":B}var f=qR(),p=S(f),b=S(p),A=S(b);{var T=B=>{var Y=PR();ie(()=>be(Y,"src",In.logoUrl)),j(B,Y)};fe(A,B=>{In.logoUrl&&B(T)})}var E=O(A,2),x=S(E),I=O(E,2);{var U=B=>{var Y=MR();j(B,Y)},P=B=>{var Y=BR();j(B,Y)};fe(I,B=>{dt.firstRun?B(U):B(P,-1)})}var ee=O(b,2),F=S(ee),G=O(S(F),2);Ha(G,!0);var Q=O(F,2),ne=O(S(Q),2),_=O(Q,2);{var M=B=>{var Y=UR(),V=O(S(Y),2),te=O(V,2);{var de=ge=>{var pe=FR();j(ge,pe)};fe(te,ge=>{l(u)&&ge(de)})}_t(V,()=>l(a),ge=>y(a,ge)),j(B,Y)};fe(_,B=>{dt.firstRun&&B(M)})}var v=O(_,2);{var C=B=>{var Y=HR(),V=S(Y);ie(()=>ue(V,l(o))),j(B,Y)};fe(v,B=>{l(o)&&B(C)})}var R=O(v,2),D=S(R);{var W=B=>{var Y=bl();ie(()=>ue(Y,dt.firstRun?"Creating…":"Signing in…")),j(B,Y)},$=B=>{var Y=bl();ie(()=>ue(Y,dt.firstRun?"Create admin account":"Sign in")),j(B,Y)};fe(D,B=>{l(i)?B(W):B($,-1)})}ie(()=>{ue(x,l(n)),be(ne,"autocomplete",dt.firstRun?"new-password":"current-password"),R.disabled=!l(d)}),Pe("submit",ee,h),_t(G,()=>l(r),B=>y(r,B)),_t(ne,()=>l(s),B=>y(s,B)),j(t,f),ot()}var $R=K('<p class="message svelte-7emrh2" aria-busy="true">Checking the whole site…</p>'),YR=K('<p class="message svelte-7emrh2">Couldn’t check the site, try Re-check.</p>'),zR=K('<p class="message ok svelte-7emrh2">No problems, the site is ready to publish.</p>'),WR=K('<button type="button" class="open svelte-7emrh2"><span class="sev svelte-7emrh2"> </span> <span class="msg svelte-7emrh2"> </span></button>'),GR=K('<span class="static svelte-7emrh2"><span class="sev svelte-7emrh2"> </span> <span class="msg svelte-7emrh2"> </span></span>'),KR=K("<li><!></li>"),VR=K('<p class="message svelte-7emrh2"> <!>. Errors block a publish.</p> <ul class="problems svelte-7emrh2"></ul>',1),XR=K('<dialog aria-label="Problems" class="svelte-7emrh2"><h2 class="svelte-7emrh2">Problems</h2> <!> <div class="actions svelte-7emrh2"><button type="button" class="ghost svelte-7emrh2">Re-check</button> <button type="button" class="primary svelte-7emrh2">Close</button></div></dialog>');function QR(t,e){it(e,!0);let n;const r=Ae(()=>gn.errors),s=Ae(()=>gn.warnings);St(()=>{gn.panelOpen?n.open||n.showModal():n!=null&&n.open&&n.close()});function a(E){uf.request(E),gn.closePanel()}function i(E){E.preventDefault(),gn.closePanel()}function o(E){E.target===n&&gn.closePanel()}var u=XR(),d=O(S(u),2);{var h=E=>{var x=$R();j(E,x)},g=E=>{var x=YR();j(E,x)},f=E=>{var x=zR();j(E,x)},p=E=>{var x=VR(),I=Je(x),U=S(I),P=O(U);{var ee=G=>{var Q=bl();ie(()=>ue(Q,`,
143
+ ${l(s).length??""}
144
+ ${l(s).length===1?"warning":"warnings"}`)),j(G,Q)};fe(P,G=>{l(s).length>0&&G(ee)})}var F=O(I,2);Ct(F,21,()=>[...l(r),...l(s)],Ho,(G,Q)=>{var ne=KR(),_=S(ne);{var M=C=>{var R=WR(),D=S(R),W=S(D),$=O(D,2),B=S($);ie(()=>{ue(W,l(Q).severity),ue(B,l(Q).message)}),ae("click",R,()=>a(l(Q).path??"")),j(C,R)},v=C=>{var R=GR(),D=S(R),W=S(D),$=O(D,2),B=S($);ie(()=>{ue(W,l(Q).severity),ue(B,l(Q).message)}),j(C,R)};fe(_,C=>{l(Q).path?C(M):C(v,-1)})}ie(()=>Ze(ne,1,I1(l(Q).severity),"svelte-7emrh2")),j(G,ne)}),ie(()=>ue(U,`${l(r).length??""}
145
+ ${l(r).length===1?"error":"errors"}`)),j(E,x)};fe(d,E=>{gn.status==="checking"?E(h):gn.status==="error"?E(g,1):l(r).length===0&&l(s).length===0?E(f,2):E(p,-1)})}var b=O(d,2),A=S(b),T=O(A,2);sn(u,E=>n=E,()=>n),ie(()=>A.disabled=gn.status==="checking"),Pe("cancel",u,i),ae("click",u,o),ae("click",A,()=>void gn.refresh()),ae("click",T,()=>gn.closePanel()),j(t,u),ot()}vt(["click"]);var ZR=K('<main class="loading svelte-1n46o8q" aria-busy="true"></main>'),JR=K("<!> <!> <!> <!> <!>",1);function eD(t,e){it(e,!1),Va(()=>{fl.init(),dt.init(),In.load()}),D1();var n=jn(),r=Je(n);{var s=o=>{var u=ZR();j(o,u)},a=o=>{jR(o,{})},i=o=>{var u=JR(),d=Je(u);cR(d,{});var h=O(d,2);yR(h,{});var g=O(h,2);kR(g,{});var f=O(g,2);Ky(f,{});var p=O(f,2);QR(p,{}),j(o,u)};fe(r,o=>{dt.status==="loading"?o(s):dt.status==="unauthenticated"?o(a,1):o(i,-1)})}j(t,n),ot()}const tD=[["autocomplete","off"],["data-lpignore","true"],["data-1p-ignore","true"],["data-bwignore","true"],["data-form-type","other"]],nD=new Set(["file","checkbox","radio","range","color","submit","button","reset"]);function Rv(t){if((t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&!(t instanceof HTMLInputElement&&nD.has(t.type)))for(const[e,n]of tD)t.setAttribute(e,n)}function Im(t){for(const e of t.querySelectorAll("input, textarea"))Rv(e)}function rD(){Im(document);const t=new MutationObserver(e=>{for(const n of e)for(const r of n.addedNodes)r instanceof Element&&(Rv(r),Im(r))});return t.observe(document.body,{childList:!0,subtree:!0}),()=>t.disconnect()}const Dv=document.getElementById("app");if(Dv===null)throw new Error("Missing #app mount point");By().then(()=>{dT(eD,{target:Dv}),rD()});export{Od as $,af as A,oD as B,b6 as C,ON as D,wD as E,ch as F,Ct as G,OD as H,Dr as I,ub as J,Pe as K,DD as L,TD as M,Je as N,K as O,m6 as P,l as Q,cb as R,mb as S,fe as T,C1 as U,ND as V,$3 as W,xh as X,yD as Y,lb as Z,Z0 as _,g6 as a,mT as a0,AD as a1,Qd as a2,cD as a3,hD as a4,fD as a5,Va as a6,Xu as a7,ot as a8,HD as a9,bs as aA,xr as aB,jD as aC,J as aD,ie as aE,bl as aF,fl as aG,T1 as aH,SD as aI,bD as aJ,Ae as aK,St as aL,_D as aa,Ro as ab,$n as ac,ft as ad,mp as ae,it as af,RN as ag,mD as ah,n6 as ai,$a as aj,WN as ak,dr as al,vD as am,Ms as an,pD as ao,kD as ap,vl as aq,y as ar,LD as as,be as at,OT as au,Ze as av,Qf as aw,ue as ax,LT as ay,O as az,ef as b,_6 as c,Ex as d,Xt as e,j as f,qD as g,iD as h,CD as i,MT as j,sn as k,_t as l,xD as m,RD as n,S as o,jn as p,lD as q,Cl as r,dD as s,uD as t,gD as u,vt as v,ae as w,Il as x,ED as y,ID as z};