snow-cms 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,47 +1,47 @@
1
- var cl=Object.defineProperty;var sl=(e,t,n)=>t in e?cl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var oe=(e,t,n)=>sl(e,typeof t!="symbol"?t+"":t,n);function b(){}function ot(e,t){for(const n in t)e[n]=t[n];return e}function ul(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Ur(e){return e()}function Bn(){return Object.create(null)}function ue(e){e.forEach(Ur)}function zt(e){return typeof e=="function"}function ie(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Nt;function jt(e,t){return e===t?!0:(Nt||(Nt=document.createElement("a")),Nt.href=t,e===Nt.href)}function fl(e){return Object.keys(e).length===0}function Cn(e,...t){if(e==null){for(const r of t)r(void 0);return b}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function Ie(e){let t;return Cn(e,n=>t=n)(),t}function W(e,t,n){e.$$.on_destroy.push(Cn(t,n))}function he(e,t,n){return e.set(n),t}function dl(e){return e&&zt(e.destroy)?e.destroy:b}const Zt=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function w(e,t){e.appendChild(t)}function N(e,t,n){e.insertBefore(t,n||null)}function H(e){e.parentNode&&e.parentNode.removeChild(e)}function un(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function k(e){return document.createElement(e)}function pl(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function ee(e){return document.createTextNode(e)}function q(){return ee(" ")}function Oe(){return ee("")}function Z(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function Ue(e){return function(t){return t.preventDefault(),e.call(this,t)}}function m(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Br(e){return e===""?null:+e}function hl(e){return Array.from(e.childNodes)}function _e(e,t){t=""+t,e.data!==t&&(e.data=t)}function ve(e,t){e.value=t??""}function Gn(e,t,n,r){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,"")}function Vt(e,t,n){e.classList.toggle(t,!!n)}function ml(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}class ze{constructor(t=!1){oe(this,"is_svg",!1);oe(this,"e");oe(this,"n");oe(this,"t");oe(this,"a");this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,r=null){this.e||(this.is_svg?this.e=pl(n.nodeName):this.e=k(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(t)),this.i(r)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(t){for(let n=0;n<this.n.length;n+=1)N(this.t,this.n[n],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(H)}}function Je(e,t){return new e(t)}let Tt;function We(e){Tt=e}function At(){if(!Tt)throw new Error("Function called outside component initialization");return Tt}function je(e){At().$$.on_mount.push(e)}function gl(e){At().$$.after_update.push(e)}function Kt(){const e=At();return(t,n,{cancelable:r=!1}={})=>{const i=e.$$.callbacks[t];if(i){const l=ml(t,n,{cancelable:r});return i.slice().forEach(o=>{o.call(e,l)}),!l.defaultPrevented}return!0}}function Sn(e,t){return At().$$.context.set(e,t),t}function xn(e){return At().$$.context.get(e)}const mt=[],at=[];let vt=[];const Wn=[],_l=Promise.resolve();let fn=!1;function wl(){fn||(fn=!0,_l.then(Ln))}function dn(e){vt.push(e)}const nn=new Set;let ft=0;function Ln(){if(ft!==0)return;const e=Tt;do{try{for(;ft<mt.length;){const t=mt[ft];ft++,We(t),bl(t.$$)}}catch(t){throw mt.length=0,ft=0,t}for(We(null),mt.length=0,ft=0;at.length;)at.pop()();for(let t=0;t<vt.length;t+=1){const n=vt[t];nn.has(n)||(nn.add(n),n())}vt.length=0}while(mt.length);for(;Wn.length;)Wn.pop()();fn=!1,nn.clear(),We(e)}function bl(e){if(e.fragment!==null){e.update(),ue(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(dn)}}function vl(e){const t=[],n=[];vt.forEach(r=>e.indexOf(r)===-1?t.push(r):n.push(r)),n.forEach(r=>r()),vt=t}const Rt=new Set;let rt;function ye(){rt={r:0,c:[],p:rt}}function ke(){rt.r||ue(rt.c),rt=rt.p}function I(e,t){e&&e.i&&(Rt.delete(e),e.i(t))}function V(e,t,n,r){if(e&&e.o){if(Rt.has(e))return;Rt.add(e),rt.c.push(()=>{Rt.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}function se(e,t){const n=t.token={};function r(i,l,o,a){if(t.token!==n)return;t.resolved=a;let c=t.ctx;o!==void 0&&(c=c.slice(),c[o]=a);const s=i&&(t.current=i)(c);let f=!1;t.block&&(t.blocks?t.blocks.forEach((u,d)=>{d!==l&&u&&(ye(),V(u,1,1,()=>{t.blocks[d]===u&&(t.blocks[d]=null)}),ke())}):t.block.d(1),s.c(),I(s,1),s.m(t.mount(),t.anchor),f=!0),t.block=s,t.blocks&&(t.blocks[l]=s),f&&Ln()}if(ul(e)){const i=At();if(e.then(l=>{We(i),r(t.then,1,t.value,l),We(null)},l=>{if(We(i),r(t.catch,2,t.error,l),We(null),!t.hasCatch)throw l}),t.current!==t.pending)return r(t.pending,0),!0}else{if(t.current!==t.then)return r(t.then,1,t.value,e),!0;t.resolved=e}}function Pe(e,t,n){const r=t.slice(),{resolved:i}=e;e.current===e.then&&(r[e.value]=i),e.current===e.catch&&(r[e.error]=i),e.block.p(r,n)}function Ee(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function Gr(e,t){e.d(1),t.delete(e.key)}function Tn(e,t){V(e,1,1,()=>{t.delete(e.key)})}function Ht(e,t,n,r,i,l,o,a,c,s,f,u){let d=e.length,p=l.length,g=d;const h={};for(;g--;)h[e[g].key]=g;const v=[],A=new Map,E=new Map,T=[];for(g=p;g--;){const F=u(i,l,g),C=n(F);let P=o.get(C);P?T.push(()=>P.p(F,t)):(P=s(C,F),P.c()),A.set(C,v[g]=P),C in h&&E.set(C,Math.abs(g-h[C]))}const j=new Set,D=new Set;function R(F){I(F,1),F.m(a,f),o.set(F.key,F),f=F.first,p--}for(;d&&p;){const F=v[p-1],C=e[d-1],P=F.key,M=C.key;F===C?(f=F.first,d--,p--):A.has(M)?!o.has(P)||j.has(P)?R(F):D.has(M)?d--:E.get(P)>E.get(M)?(D.add(P),R(F)):(j.add(M),d--):(c(C,o),d--)}for(;d--;){const F=e[d];A.has(F.key)||c(F,o)}for(;p;)R(v[p-1]);return ue(T),v}function ct(e,t){const n={},r={},i={$$scope:1};let l=e.length;for(;l--;){const o=e[l],a=t[l];if(a){for(const c in o)c in a||(r[c]=1);for(const c in a)i[c]||(n[c]=a[c],i[c]=1);e[l]=a}else for(const c in o)i[c]=1}for(const o in r)o in n||(n[o]=void 0);return n}function st(e){return typeof e=="object"&&e!==null?e:{}}function J(e){e&&e.c()}function K(e,t,n){const{fragment:r,after_update:i}=e.$$;r&&r.m(t,n),dn(()=>{const l=e.$$.on_mount.map(Ur).filter(zt);e.$$.on_destroy?e.$$.on_destroy.push(...l):ue(l),e.$$.on_mount=[]}),i.forEach(dn)}function X(e,t){const n=e.$$;n.fragment!==null&&(vl(n.after_update),ue(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function yl(e,t){e.$$.dirty[0]===-1&&(mt.push(e),wl(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function ae(e,t,n,r,i,l,o=null,a=[-1]){const c=Tt;We(e);const s=e.$$={fragment:null,ctx:[],props:l,update:b,not_equal:i,bound:Bn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(c?c.$$.context:[])),callbacks:Bn(),dirty:a,skip_bound:!1,root:t.target||c.$$.root};o&&o(s.root);let f=!1;if(s.ctx=n?n(e,t.props||{},(u,d,...p)=>{const g=p.length?p[0]:d;return s.ctx&&i(s.ctx[u],s.ctx[u]=g)&&(!s.skip_bound&&s.bound[u]&&s.bound[u](g),f&&yl(e,u)),d}):[],s.update(),f=!0,ue(s.before_update),s.fragment=r?r(s.ctx):!1,t.target){if(t.hydrate){const u=hl(t.target);s.fragment&&s.fragment.l(u),u.forEach(H)}else s.fragment&&s.fragment.c();t.intro&&I(e.$$.fragment),K(e,t.target,t.anchor),Ln()}We(c)}class ce{constructor(){oe(this,"$$");oe(this,"$$set")}$destroy(){X(this,1),this.$destroy=b}$on(t,n){if(!zt(n))return b;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!fl(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const kl="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(kl);const Al='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>text-box-multiple</title><path d="M16,15H9V13H16M19,11H9V9H19M19,7H9V5H19M21,1H7C5.89,1 5,1.89 5,3V17C5,18.11 5.9,19 7,19H21C22.11,19 23,18.11 23,17V3C23,1.89 22.1,1 21,1M3,5V21H19V23H3A2,2 0 0,1 1,21V5H3Z" /></svg>',El='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>folder-multiple-image</title><path d="M7,15L11.5,9L15,13.5L17.5,10.5L21,15M22,4H14L12,2H6A2,2 0 0,0 4,4V16A2,2 0 0,0 6,18H22A2,2 0 0,0 24,16V6A2,2 0 0,0 22,4M2,6H0V11H0V20A2,2 0 0,0 2,22H20V20H2V6Z" /></svg>',Cl='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>logout</title><path d="M16,17V14H9V10H16V7L21,12L16,17M14,2A2,2 0 0,1 16,4V6H14V4H5V20H14V18H16V20A2,2 0 0,1 14,22H5A2,2 0 0,1 3,20V4A2,2 0 0,1 5,2H14Z" /></svg>',dt=[];function Wr(e,t){return{subscribe:tt(e,t).subscribe}}function tt(e,t=b){let n;const r=new Set;function i(a){if(ie(e,a)&&(e=a,n)){const c=!dt.length;for(const s of r)s[1](),dt.push(s,e);if(c){for(let s=0;s<dt.length;s+=2)dt[s][0](dt[s+1]);dt.length=0}}}function l(a){i(a(e))}function o(a,c=b){const s=[a,c];return r.add(s),r.size===1&&(n=t(i,l)||b),a(e),()=>{r.delete(s),r.size===0&&n&&(n(),n=null)}}return{set:i,update:l,subscribe:o}}function Sl(e,t,n){const r=!Array.isArray(e),i=r?[e]:e;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const l=t.length<2;return Wr(n,(o,a)=>{let c=!1;const s=[];let f=0,u=b;const d=()=>{if(f)return;u();const g=t(r?s[0]:s,o,a);l?o(g):u=zt(g)?g:b},p=i.map((g,h)=>Cn(g,v=>{s[h]=v,f&=~(1<<h),c&&d()},()=>{f|=1<<h}));return c=!0,d(),function(){ue(p),u(),c=!1}})}/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function zr(e){return typeof e>"u"||e===null}function xl(e){return typeof e=="object"&&e!==null}function Ll(e){return Array.isArray(e)?e:zr(e)?[]:[e]}function Tl(e,t){var n,r,i,l;if(t)for(l=Object.keys(t),n=0,r=l.length;n<r;n+=1)i=l[n],e[i]=t[i];return e}function Ml(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function Ol(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Dl=zr,Fl=xl,Hl=Ll,Il=Ml,Nl=Ol,Rl=Tl,ge={isNothing:Dl,isObject:Fl,toArray:Hl,repeat:Il,isNegativeZero:Nl,extend:Rl};function Zr(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
1
+ var co=Object.defineProperty;var so=(e,t,n)=>t in e?co(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var ae=(e,t,n)=>so(e,typeof t!="symbol"?t+"":t,n);function v(){}function lt(e,t){for(const n in t)e[n]=t[n];return e}function uo(e){return!!e&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"}function Ur(e){return e()}function Bn(){return Object.create(null)}function fe(e){e.forEach(Ur)}function Zt(e){return typeof e=="function"}function oe(e,t){return e!=e?t==t:e!==t||e&&typeof e=="object"||typeof e=="function"}let Nt;function Vt(e,t){return e===t?!0:(Nt||(Nt=document.createElement("a")),Nt.href=t,e===Nt.href)}function fo(e){return Object.keys(e).length===0}function Cn(e,...t){if(e==null){for(const r of t)r(void 0);return v}const n=e.subscribe(...t);return n.unsubscribe?()=>n.unsubscribe():n}function He(e){let t;return Cn(e,n=>t=n)(),t}function z(e,t,n){e.$$.on_destroy.push(Cn(t,n))}function he(e,t,n){return e.set(n),t}function po(e){return e&&Zt(e.destroy)?e.destroy:v}const Kt=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function b(e,t){e.appendChild(t)}function I(e,t,n){e.insertBefore(t,n||null)}function F(e){e.parentNode&&e.parentNode.removeChild(e)}function un(e,t){for(let n=0;n<e.length;n+=1)e[n]&&e[n].d(t)}function E(e){return document.createElement(e)}function ho(e){return document.createElementNS("http://www.w3.org/2000/svg",e)}function te(e){return document.createTextNode(e)}function V(){return te(" ")}function Oe(){return te("")}function Z(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function Ue(e){return function(t){return t.preventDefault(),e.call(this,t)}}function h(e,t,n){n==null?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n)}function Br(e){return e===""?null:+e}function mo(e){return Array.from(e.childNodes)}function _e(e,t){t=""+t,e.data!==t&&(e.data=t)}function ve(e,t){e.value=t??""}function Gn(e,t,n,r){n==null?e.style.removeProperty(t):e.style.setProperty(t,n,"")}function qt(e,t,n){e.classList.toggle(t,!!n)}function go(e,t,{bubbles:n=!1,cancelable:r=!1}={}){return new CustomEvent(e,{detail:t,bubbles:n,cancelable:r})}class Ze{constructor(t=!1){ae(this,"is_svg",!1);ae(this,"e");ae(this,"n");ae(this,"t");ae(this,"a");this.is_svg=t,this.e=this.n=null}c(t){this.h(t)}m(t,n,r=null){this.e||(this.is_svg?this.e=ho(n.nodeName):this.e=E(n.nodeType===11?"TEMPLATE":n.nodeName),this.t=n.tagName!=="TEMPLATE"?n:n.content,this.c(t)),this.i(r)}h(t){this.e.innerHTML=t,this.n=Array.from(this.e.nodeName==="TEMPLATE"?this.e.content.childNodes:this.e.childNodes)}i(t){for(let n=0;n<this.n.length;n+=1)I(this.t,this.n[n],t)}p(t){this.d(),this.h(t),this.i(this.a)}d(){this.n.forEach(F)}}function et(e,t){return new e(t)}let Lt;function ze(e){Lt=e}function Et(){if(!Lt)throw new Error("Function called outside component initialization");return Lt}function je(e){Et().$$.on_mount.push(e)}function _o(e){Et().$$.after_update.push(e)}function Qt(){const e=Et();return(t,n,{cancelable:r=!1}={})=>{const i=e.$$.callbacks[t];if(i){const o=go(t,n,{cancelable:r});return i.slice().forEach(l=>{l.call(e,o)}),!o.defaultPrevented}return!0}}function Sn(e,t){return Et().$$.context.set(e,t),t}function xn(e){return Et().$$.context.get(e)}const gt=[],at=[];let yt=[];const Wn=[],wo=Promise.resolve();let fn=!1;function bo(){fn||(fn=!0,wo.then(Ln))}function dn(e){yt.push(e)}const nn=new Set;let dt=0;function Ln(){if(dt!==0)return;const e=Lt;do{try{for(;dt<gt.length;){const t=gt[dt];dt++,ze(t),vo(t.$$)}}catch(t){throw gt.length=0,dt=0,t}for(ze(null),gt.length=0,dt=0;at.length;)at.pop()();for(let t=0;t<yt.length;t+=1){const n=yt[t];nn.has(n)||(nn.add(n),n())}yt.length=0}while(gt.length);for(;Wn.length;)Wn.pop()();fn=!1,nn.clear(),ze(e)}function vo(e){if(e.fragment!==null){e.update(),fe(e.before_update);const t=e.dirty;e.dirty=[-1],e.fragment&&e.fragment.p(e.ctx,t),e.after_update.forEach(dn)}}function yo(e){const t=[],n=[];yt.forEach(r=>e.indexOf(r)===-1?t.push(r):n.push(r)),n.forEach(r=>r()),yt=t}const Pt=new Set;let rt;function ye(){rt={r:0,c:[],p:rt}}function ke(){rt.r||fe(rt.c),rt=rt.p}function H(e,t){e&&e.i&&(Pt.delete(e),e.i(t))}function j(e,t,n,r){if(e&&e.o){if(Pt.has(e))return;Pt.add(e),rt.c.push(()=>{Pt.delete(e),r&&(n&&e.d(1),r())}),e.o(t)}else r&&r()}function ue(e,t){const n=t.token={};function r(i,o,l,a){if(t.token!==n)return;t.resolved=a;let c=t.ctx;l!==void 0&&(c=c.slice(),c[l]=a);const s=i&&(t.current=i)(c);let u=!1;t.block&&(t.blocks?t.blocks.forEach((f,d)=>{d!==o&&f&&(ye(),j(f,1,1,()=>{t.blocks[d]===f&&(t.blocks[d]=null)}),ke())}):t.block.d(1),s.c(),H(s,1),s.m(t.mount(),t.anchor),u=!0),t.block=s,t.blocks&&(t.blocks[o]=s),u&&Ln()}if(uo(e)){const i=Et();if(e.then(o=>{ze(i),r(t.then,1,t.value,o),ze(null)},o=>{if(ze(i),r(t.catch,2,t.error,o),ze(null),!t.hasCatch)throw o}),t.current!==t.pending)return r(t.pending,0),!0}else{if(t.current!==t.then)return r(t.then,1,t.value,e),!0;t.resolved=e}}function Pe(e,t,n){const r=t.slice(),{resolved:i}=e;e.current===e.then&&(r[e.value]=i),e.current===e.catch&&(r[e.error]=i),e.block.p(r,n)}function Ee(e){return(e==null?void 0:e.length)!==void 0?e:Array.from(e)}function Gr(e,t){e.d(1),t.delete(e.key)}function Tn(e,t){j(e,1,1,()=>{t.delete(e.key)})}function Ft(e,t,n,r,i,o,l,a,c,s,u,f){let d=e.length,p=o.length,m=d;const g={};for(;m--;)g[e[m].key]=m;const _=[],k=new Map,A=new Map,S=[];for(m=p;m--;){const N=f(i,o,m),C=n(N);let R=l.get(C);R?S.push(()=>R.p(N,t)):(R=s(C,N),R.c()),k.set(C,_[m]=R),C in g&&A.set(C,Math.abs(m-g[C]))}const $=new Set,M=new Set;function P(N){H(N,1),N.m(a,u),l.set(N.key,N),u=N.first,p--}for(;d&&p;){const N=_[p-1],C=e[d-1],R=N.key,D=C.key;N===C?(u=N.first,d--,p--):k.has(D)?!l.has(R)||$.has(R)?P(N):M.has(D)?d--:A.get(R)>A.get(D)?(M.add(R),P(N)):($.add(D),d--):(c(C,l),d--)}for(;d--;){const N=e[d];k.has(N.key)||c(N,l)}for(;p;)P(_[p-1]);return fe(S),_}function ct(e,t){const n={},r={},i={$$scope:1};let o=e.length;for(;o--;){const l=e[o],a=t[o];if(a){for(const c in l)c in a||(r[c]=1);for(const c in a)i[c]||(n[c]=a[c],i[c]=1);e[o]=a}else for(const c in l)i[c]=1}for(const l in r)l in n||(n[l]=void 0);return n}function st(e){return typeof e=="object"&&e!==null?e:{}}function J(e){e&&e.c()}function Q(e,t,n){const{fragment:r,after_update:i}=e.$$;r&&r.m(t,n),dn(()=>{const o=e.$$.on_mount.map(Ur).filter(Zt);e.$$.on_destroy?e.$$.on_destroy.push(...o):fe(o),e.$$.on_mount=[]}),i.forEach(dn)}function X(e,t){const n=e.$$;n.fragment!==null&&(yo(n.after_update),fe(n.on_destroy),n.fragment&&n.fragment.d(t),n.on_destroy=n.fragment=null,n.ctx=[])}function ko(e,t){e.$$.dirty[0]===-1&&(gt.push(e),bo(),e.$$.dirty.fill(0)),e.$$.dirty[t/31|0]|=1<<t%31}function ce(e,t,n,r,i,o,l=null,a=[-1]){const c=Lt;ze(e);const s=e.$$={fragment:null,ctx:[],props:o,update:v,not_equal:i,bound:Bn(),on_mount:[],on_destroy:[],on_disconnect:[],before_update:[],after_update:[],context:new Map(t.context||(c?c.$$.context:[])),callbacks:Bn(),dirty:a,skip_bound:!1,root:t.target||c.$$.root};l&&l(s.root);let u=!1;if(s.ctx=n?n(e,t.props||{},(f,d,...p)=>{const m=p.length?p[0]:d;return s.ctx&&i(s.ctx[f],s.ctx[f]=m)&&(!s.skip_bound&&s.bound[f]&&s.bound[f](m),u&&ko(e,f)),d}):[],s.update(),u=!0,fe(s.before_update),s.fragment=r?r(s.ctx):!1,t.target){if(t.hydrate){const f=mo(t.target);s.fragment&&s.fragment.l(f),f.forEach(F)}else s.fragment&&s.fragment.c();t.intro&&H(e.$$.fragment),Q(e,t.target,t.anchor),Ln()}ze(c)}class se{constructor(){ae(this,"$$");ae(this,"$$set")}$destroy(){X(this,1),this.$destroy=v}$on(t,n){if(!Zt(n))return v;const r=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return r.push(n),()=>{const i=r.indexOf(n);i!==-1&&r.splice(i,1)}}$set(t){this.$$set&&!fo(t)&&(this.$$.skip_bound=!0,this.$$set(t),this.$$.skip_bound=!1)}}const Ao="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Ao);const Eo='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>text-box-multiple</title><path d="M16,15H9V13H16M19,11H9V9H19M19,7H9V5H19M21,1H7C5.89,1 5,1.89 5,3V17C5,18.11 5.9,19 7,19H21C22.11,19 23,18.11 23,17V3C23,1.89 22.1,1 21,1M3,5V21H19V23H3A2,2 0 0,1 1,21V5H3Z" /></svg>',Co='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>folder-multiple-image</title><path d="M7,15L11.5,9L15,13.5L17.5,10.5L21,15M22,4H14L12,2H6A2,2 0 0,0 4,4V16A2,2 0 0,0 6,18H22A2,2 0 0,0 24,16V6A2,2 0 0,0 22,4M2,6H0V11H0V20A2,2 0 0,0 2,22H20V20H2V6Z" /></svg>',So='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>logout</title><path d="M16,17V14H9V10H16V7L21,12L16,17M14,2A2,2 0 0,1 16,4V6H14V4H5V20H14V18H16V20A2,2 0 0,1 14,22H5A2,2 0 0,1 3,20V4A2,2 0 0,1 5,2H14Z" /></svg>',pt=[];function Wr(e,t){return{subscribe:nt(e,t).subscribe}}function nt(e,t=v){let n;const r=new Set;function i(a){if(oe(e,a)&&(e=a,n)){const c=!pt.length;for(const s of r)s[1](),pt.push(s,e);if(c){for(let s=0;s<pt.length;s+=2)pt[s][0](pt[s+1]);pt.length=0}}}function o(a){i(a(e))}function l(a,c=v){const s=[a,c];return r.add(s),r.size===1&&(n=t(i,o)||v),a(e),()=>{r.delete(s),r.size===0&&n&&(n(),n=null)}}return{set:i,update:o,subscribe:l}}function xo(e,t,n){const r=!Array.isArray(e),i=r?[e]:e;if(!i.every(Boolean))throw new Error("derived() expects stores as input, got a falsy value");const o=t.length<2;return Wr(n,(l,a)=>{let c=!1;const s=[];let u=0,f=v;const d=()=>{if(u)return;f();const m=t(r?s[0]:s,l,a);o?l(m):f=Zt(m)?m:v},p=i.map((m,g)=>Cn(m,_=>{s[g]=_,u&=~(1<<g),c&&d()},()=>{u|=1<<g}));return c=!0,d(),function(){fe(p),f(),c=!1}})}/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */function zr(e){return typeof e>"u"||e===null}function Lo(e){return typeof e=="object"&&e!==null}function To(e){return Array.isArray(e)?e:zr(e)?[]:[e]}function Mo(e,t){var n,r,i,o;if(t)for(o=Object.keys(t),n=0,r=o.length;n<r;n+=1)i=o[n],e[i]=t[i];return e}function Oo(e,t){var n="",r;for(r=0;r<t;r+=1)n+=e;return n}function Do(e){return e===0&&Number.NEGATIVE_INFINITY===1/e}var Fo=zr,Ho=Lo,Io=To,No=Oo,Ro=Do,Po=Mo,ge={isNothing:Fo,isObject:Ho,toArray:Io,repeat:No,isNegativeZero:Ro,extend:Po};function Zr(e,t){var n="",r=e.reason||"(unknown reason)";return e.mark?(e.mark.name&&(n+='in "'+e.mark.name+'" '),n+="("+(e.mark.line+1)+":"+(e.mark.column+1)+")",!t&&e.mark.snippet&&(n+=`
2
2
 
3
- `+e.mark.snippet),r+" "+n):r}function Mt(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Zr(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Mt.prototype=Object.create(Error.prototype);Mt.prototype.constructor=Mt;Mt.prototype.toString=function(t){return this.name+": "+Zr(this,t)};var Le=Mt;function rn(e,t,n,r,i){var l="",o="",a=Math.floor(i/2)-1;return r-t>a&&(l=" ... ",t=r-a+l.length),n-r>a&&(o=" ...",n=r+a-o.length),{str:l+e.slice(t,n).replace(/\t/g,"→")+o,pos:r-t+l.length}}function ln(e,t){return ge.repeat(" ",t-e.length)+e}function Pl(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],l,o=-1;l=n.exec(e.buffer);)i.push(l.index),r.push(l.index+l[0].length),e.position<=l.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var a="",c,s,f=Math.min(e.line+t.linesAfter,i.length).toString().length,u=t.maxLength-(t.indent+f+3);for(c=1;c<=t.linesBefore&&!(o-c<0);c++)s=rn(e.buffer,r[o-c],i[o-c],e.position-(r[o]-r[o-c]),u),a=ge.repeat(" ",t.indent)+ln((e.line-c+1).toString(),f)+" | "+s.str+`
4
- `+a;for(s=rn(e.buffer,r[o],i[o],e.position,u),a+=ge.repeat(" ",t.indent)+ln((e.line+1).toString(),f)+" | "+s.str+`
5
- `,a+=ge.repeat("-",t.indent+f+3+s.pos)+`^
6
- `,c=1;c<=t.linesAfter&&!(o+c>=i.length);c++)s=rn(e.buffer,r[o+c],i[o+c],e.position-(r[o]-r[o+c]),u),a+=ge.repeat(" ",t.indent)+ln((e.line+c+1).toString(),f)+" | "+s.str+`
7
- `;return a.replace(/\n$/,"")}var $l=Pl,jl=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],Vl=["scalar","sequence","mapping"];function ql(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function Yl(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(jl.indexOf(n)===-1)throw new Le('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=ql(t.styleAliases||null),Vl.indexOf(this.kind)===-1)throw new Le('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var be=Yl;function zn(e,t){var n=[];return e[t].forEach(function(r){var i=n.length;n.forEach(function(l,o){l.tag===r.tag&&l.kind===r.kind&&l.multi===r.multi&&(i=o)}),n[i]=r}),n}function Ul(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function pn(e){return this.extend(e)}pn.prototype.extend=function(t){var n=[],r=[];if(t instanceof be)r.push(t);else if(Array.isArray(t))r=r.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit));else throw new Le("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(l){if(!(l instanceof be))throw new Le("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(l.loadKind&&l.loadKind!=="scalar")throw new Le("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(l.multi)throw new Le("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(l){if(!(l instanceof be))throw new Le("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(pn.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=zn(i,"implicit"),i.compiledExplicit=zn(i,"explicit"),i.compiledTypeMap=Ul(i.compiledImplicit,i.compiledExplicit),i};var Kr=pn,Xr=new be("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Qr=new be("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Jr=new be("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),ei=new Kr({explicit:[Xr,Qr,Jr]});function Bl(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Gl(){return null}function Wl(e){return e===null}var ti=new be("tag:yaml.org,2002:null",{kind:"scalar",resolve:Bl,construct:Gl,predicate:Wl,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function zl(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Zl(e){return e==="true"||e==="True"||e==="TRUE"}function Kl(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var ni=new be("tag:yaml.org,2002:bool",{kind:"scalar",resolve:zl,construct:Zl,predicate:Kl,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Xl(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Ql(e){return 48<=e&&e<=55}function Jl(e){return 48<=e&&e<=57}function eo(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!Xl(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!Ql(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(!Jl(e.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function to(e){var t=e,n=1,r;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0")return 0;if(r==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function no(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ge.isNegativeZero(e)}var ri=new be("tag:yaml.org,2002:int",{kind:"scalar",resolve:eo,construct:to,predicate:no,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),ro=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function io(e){return!(e===null||!ro.test(e)||e[e.length-1]==="_")}function lo(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var oo=/^[-+]?[0-9]+e/;function ao(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ge.isNegativeZero(e))return"-0.0";return n=e.toString(10),oo.test(n)?n.replace("e",".e"):n}function co(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ge.isNegativeZero(e))}var ii=new be("tag:yaml.org,2002:float",{kind:"scalar",resolve:io,construct:lo,predicate:co,represent:ao,defaultStyle:"lowercase"}),li=ei.extend({implicit:[ti,ni,ri,ii]}),oi=li,ai=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),ci=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function so(e){return e===null?!1:ai.exec(e)!==null||ci.exec(e)!==null}function uo(e){var t,n,r,i,l,o,a,c=0,s=null,f,u,d;if(t=ai.exec(e),t===null&&(t=ci.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(l=+t[4],o=+t[5],a=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(f=+t[10],u=+(t[11]||0),s=(f*60+u)*6e4,t[9]==="-"&&(s=-s)),d=new Date(Date.UTC(n,r,i,l,o,a,c)),s&&d.setTime(d.getTime()-s),d}function fo(e){return e.toISOString()}var si=new be("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:so,construct:uo,instanceOf:Date,represent:fo});function po(e){return e==="<<"||e===null}var ui=new be("tag:yaml.org,2002:merge",{kind:"scalar",resolve:po}),Mn=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
8
- \r`;function ho(e){if(e===null)return!1;var t,n,r=0,i=e.length,l=Mn;for(n=0;n<i;n++)if(t=l.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function mo(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,l=Mn,o=0,a=[];for(t=0;t<i;t++)t%4===0&&t&&(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)),o=o<<6|l.indexOf(r.charAt(t));return n=i%4*6,n===0?(a.push(o>>16&255),a.push(o>>8&255),a.push(o&255)):n===18?(a.push(o>>10&255),a.push(o>>2&255)):n===12&&a.push(o>>4&255),new Uint8Array(a)}function go(e){var t="",n=0,r,i,l=e.length,o=Mn;for(r=0;r<l;r++)r%3===0&&r&&(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]),n=(n<<8)+e[r];return i=l%3,i===0?(t+=o[n>>18&63],t+=o[n>>12&63],t+=o[n>>6&63],t+=o[n&63]):i===2?(t+=o[n>>10&63],t+=o[n>>4&63],t+=o[n<<2&63],t+=o[64]):i===1&&(t+=o[n>>2&63],t+=o[n<<4&63],t+=o[64],t+=o[64]),t}function _o(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var fi=new be("tag:yaml.org,2002:binary",{kind:"scalar",resolve:ho,construct:mo,predicate:_o,represent:go}),wo=Object.prototype.hasOwnProperty,bo=Object.prototype.toString;function vo(e){if(e===null)return!0;var t=[],n,r,i,l,o,a=e;for(n=0,r=a.length;n<r;n+=1){if(i=a[n],o=!1,bo.call(i)!=="[object Object]")return!1;for(l in i)if(wo.call(i,l))if(!o)o=!0;else return!1;if(!o)return!1;if(t.indexOf(l)===-1)t.push(l);else return!1}return!0}function yo(e){return e!==null?e:[]}var di=new be("tag:yaml.org,2002:omap",{kind:"sequence",resolve:vo,construct:yo}),ko=Object.prototype.toString;function Ao(e){if(e===null)return!0;var t,n,r,i,l,o=e;for(l=new Array(o.length),t=0,n=o.length;t<n;t+=1){if(r=o[t],ko.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;l[t]=[i[0],r[i[0]]]}return!0}function Eo(e){if(e===null)return[];var t,n,r,i,l,o=e;for(l=new Array(o.length),t=0,n=o.length;t<n;t+=1)r=o[t],i=Object.keys(r),l[t]=[i[0],r[i[0]]];return l}var pi=new be("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Ao,construct:Eo}),Co=Object.prototype.hasOwnProperty;function So(e){if(e===null)return!0;var t,n=e;for(t in n)if(Co.call(n,t)&&n[t]!==null)return!1;return!0}function xo(e){return e!==null?e:{}}var hi=new be("tag:yaml.org,2002:set",{kind:"mapping",resolve:So,construct:xo}),On=oi.extend({implicit:[si,ui],explicit:[fi,di,pi,hi]}),et=Object.prototype.hasOwnProperty,qt=1,mi=2,gi=3,Yt=4,on=1,Lo=2,Zn=3,To=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Mo=/[\x85\u2028\u2029]/,Oo=/[,\[\]\{\}]/,_i=/^(?:!|!!|![a-z\-]+!)$/i,wi=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Kn(e){return Object.prototype.toString.call(e)}function Be(e){return e===10||e===13}function it(e){return e===9||e===32}function Me(e){return e===9||e===32||e===10||e===13}function _t(e){return e===44||e===91||e===93||e===123||e===125}function Do(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Fo(e){return e===120?2:e===117?4:e===85?8:0}function Ho(e){return 48<=e&&e<=57?e-48:-1}function Xn(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
9
- `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function Io(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var bi=new Array(256),vi=new Array(256);for(var pt=0;pt<256;pt++)bi[pt]=Xn(pt)?1:0,vi[pt]=Xn(pt);function No(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||On,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function yi(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=$l(n),new Le(t,n)}function Y(e,t){throw yi(e,t)}function Ut(e,t){e.onWarning&&e.onWarning.call(null,yi(e,t))}var Qn={YAML:function(t,n,r){var i,l,o;t.version!==null&&Y(t,"duplication of %YAML directive"),r.length!==1&&Y(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&Y(t,"ill-formed argument of the YAML directive"),l=parseInt(i[1],10),o=parseInt(i[2],10),l!==1&&Y(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=o<2,o!==1&&o!==2&&Ut(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,l;r.length!==2&&Y(t,"TAG directive accepts exactly two arguments"),i=r[0],l=r[1],_i.test(i)||Y(t,"ill-formed tag handle (first argument) of the TAG directive"),et.call(t.tagMap,i)&&Y(t,'there is a previously declared suffix for "'+i+'" tag handle'),wi.test(l)||Y(t,"ill-formed tag prefix (second argument) of the TAG directive");try{l=decodeURIComponent(l)}catch{Y(t,"tag prefix is malformed: "+l)}t.tagMap[i]=l}};function Qe(e,t,n,r){var i,l,o,a;if(t<n){if(a=e.input.slice(t,n),r)for(i=0,l=a.length;i<l;i+=1)o=a.charCodeAt(i),o===9||32<=o&&o<=1114111||Y(e,"expected valid JSON character");else To.test(a)&&Y(e,"the stream contains non-printable characters");e.result+=a}}function Jn(e,t,n,r){var i,l,o,a;for(ge.isObject(n)||Y(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),o=0,a=i.length;o<a;o+=1)l=i[o],et.call(t,l)||(t[l]=n[l],r[l]=!0)}function wt(e,t,n,r,i,l,o,a,c){var s,f;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),s=0,f=i.length;s<f;s+=1)Array.isArray(i[s])&&Y(e,"nested arrays are not supported inside keys"),typeof i=="object"&&Kn(i[s])==="[object Object]"&&(i[s]="[object Object]");if(typeof i=="object"&&Kn(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(l))for(s=0,f=l.length;s<f;s+=1)Jn(e,t,l[s],n);else Jn(e,t,l,n);else!e.json&&!et.call(n,i)&&et.call(t,i)&&(e.line=o||e.line,e.lineStart=a||e.lineStart,e.position=c||e.position,Y(e,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:l}):t[i]=l,delete n[i];return t}function Dn(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):Y(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function pe(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;it(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(Be(i))for(Dn(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&Ut(e,"deficient indentation"),r}function Xt(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||Me(n)))}function Fn(e,t){t===1?e.result+=" ":t>1&&(e.result+=ge.repeat(`
10
- `,t-1))}function Ro(e,t,n){var r,i,l,o,a,c,s,f,u=e.kind,d=e.result,p;if(p=e.input.charCodeAt(e.position),Me(p)||_t(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=e.input.charCodeAt(e.position+1),Me(i)||n&&_t(i)))return!1;for(e.kind="scalar",e.result="",l=o=e.position,a=!1;p!==0;){if(p===58){if(i=e.input.charCodeAt(e.position+1),Me(i)||n&&_t(i))break}else if(p===35){if(r=e.input.charCodeAt(e.position-1),Me(r))break}else{if(e.position===e.lineStart&&Xt(e)||n&&_t(p))break;if(Be(p))if(c=e.line,s=e.lineStart,f=e.lineIndent,pe(e,!1,-1),e.lineIndent>=t){a=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=c,e.lineStart=s,e.lineIndent=f;break}}a&&(Qe(e,l,o,!1),Fn(e,e.line-c),l=o=e.position,a=!1),it(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return Qe(e,l,o,!1),e.result?!0:(e.kind=u,e.result=d,!1)}function Po(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(Qe(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else Be(n)?(Qe(e,r,i,!0),Fn(e,pe(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Xt(e)?Y(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);Y(e,"unexpected end of the stream within a single quoted scalar")}function $o(e,t){var n,r,i,l,o,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return Qe(e,n,e.position,!0),e.position++,!0;if(a===92){if(Qe(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),Be(a))pe(e,!1,t);else if(a<256&&bi[a])e.result+=vi[a],e.position++;else if((o=Fo(a))>0){for(i=o,l=0;i>0;i--)a=e.input.charCodeAt(++e.position),(o=Do(a))>=0?l=(l<<4)+o:Y(e,"expected hexadecimal character");e.result+=Io(l),e.position++}else Y(e,"unknown escape sequence");n=r=e.position}else Be(a)?(Qe(e,n,r,!0),Fn(e,pe(e,!1,t)),n=r=e.position):e.position===e.lineStart&&Xt(e)?Y(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}Y(e,"unexpected end of the stream within a double quoted scalar")}function jo(e,t){var n=!0,r,i,l,o=e.tag,a,c=e.anchor,s,f,u,d,p,g=Object.create(null),h,v,A,E;if(E=e.input.charCodeAt(e.position),E===91)f=93,p=!1,a=[];else if(E===123)f=125,p=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),E=e.input.charCodeAt(++e.position);E!==0;){if(pe(e,!0,t),E=e.input.charCodeAt(e.position),E===f)return e.position++,e.tag=o,e.anchor=c,e.kind=p?"mapping":"sequence",e.result=a,!0;n?E===44&&Y(e,"expected the node content, but found ','"):Y(e,"missed comma between flow collection entries"),v=h=A=null,u=d=!1,E===63&&(s=e.input.charCodeAt(e.position+1),Me(s)&&(u=d=!0,e.position++,pe(e,!0,t))),r=e.line,i=e.lineStart,l=e.position,yt(e,t,qt,!1,!0),v=e.tag,h=e.result,pe(e,!0,t),E=e.input.charCodeAt(e.position),(d||e.line===r)&&E===58&&(u=!0,E=e.input.charCodeAt(++e.position),pe(e,!0,t),yt(e,t,qt,!1,!0),A=e.result),p?wt(e,a,g,v,h,A,r,i,l):u?a.push(wt(e,null,g,v,h,A,r,i,l)):a.push(h),pe(e,!0,t),E=e.input.charCodeAt(e.position),E===44?(n=!0,E=e.input.charCodeAt(++e.position)):n=!1}Y(e,"unexpected end of the stream within a flow collection")}function Vo(e,t){var n,r,i=on,l=!1,o=!1,a=t,c=0,s=!1,f,u;if(u=e.input.charCodeAt(e.position),u===124)r=!1;else if(u===62)r=!0;else return!1;for(e.kind="scalar",e.result="";u!==0;)if(u=e.input.charCodeAt(++e.position),u===43||u===45)on===i?i=u===43?Zn:Lo:Y(e,"repeat of a chomping mode identifier");else if((f=Ho(u))>=0)f===0?Y(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?Y(e,"repeat of an indentation width identifier"):(a=t+f-1,o=!0);else break;if(it(u)){do u=e.input.charCodeAt(++e.position);while(it(u));if(u===35)do u=e.input.charCodeAt(++e.position);while(!Be(u)&&u!==0)}for(;u!==0;){for(Dn(e),e.lineIndent=0,u=e.input.charCodeAt(e.position);(!o||e.lineIndent<a)&&u===32;)e.lineIndent++,u=e.input.charCodeAt(++e.position);if(!o&&e.lineIndent>a&&(a=e.lineIndent),Be(u)){c++;continue}if(e.lineIndent<a){i===Zn?e.result+=ge.repeat(`
11
- `,l?1+c:c):i===on&&l&&(e.result+=`
12
- `);break}for(r?it(u)?(s=!0,e.result+=ge.repeat(`
13
- `,l?1+c:c)):s?(s=!1,e.result+=ge.repeat(`
14
- `,c+1)):c===0?l&&(e.result+=" "):e.result+=ge.repeat(`
3
+ `+e.mark.snippet),r+" "+n):r}function Tt(e,t){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=t,this.message=Zr(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}Tt.prototype=Object.create(Error.prototype);Tt.prototype.constructor=Tt;Tt.prototype.toString=function(t){return this.name+": "+Zr(this,t)};var xe=Tt;function rn(e,t,n,r,i){var o="",l="",a=Math.floor(i/2)-1;return r-t>a&&(o=" ... ",t=r-a+o.length),n-r>a&&(l=" ...",n=r+a-l.length),{str:o+e.slice(t,n).replace(/\t/g,"→")+l,pos:r-t+o.length}}function on(e,t){return ge.repeat(" ",t-e.length)+e}function $o(e,t){if(t=Object.create(t||null),!e.buffer)return null;t.maxLength||(t.maxLength=79),typeof t.indent!="number"&&(t.indent=1),typeof t.linesBefore!="number"&&(t.linesBefore=3),typeof t.linesAfter!="number"&&(t.linesAfter=2);for(var n=/\r?\n|\r|\0/g,r=[0],i=[],o,l=-1;o=n.exec(e.buffer);)i.push(o.index),r.push(o.index+o[0].length),e.position<=o.index&&l<0&&(l=r.length-2);l<0&&(l=r.length-1);var a="",c,s,u=Math.min(e.line+t.linesAfter,i.length).toString().length,f=t.maxLength-(t.indent+u+3);for(c=1;c<=t.linesBefore&&!(l-c<0);c++)s=rn(e.buffer,r[l-c],i[l-c],e.position-(r[l]-r[l-c]),f),a=ge.repeat(" ",t.indent)+on((e.line-c+1).toString(),u)+" | "+s.str+`
4
+ `+a;for(s=rn(e.buffer,r[l],i[l],e.position,f),a+=ge.repeat(" ",t.indent)+on((e.line+1).toString(),u)+" | "+s.str+`
5
+ `,a+=ge.repeat("-",t.indent+u+3+s.pos)+`^
6
+ `,c=1;c<=t.linesAfter&&!(l+c>=i.length);c++)s=rn(e.buffer,r[l+c],i[l+c],e.position-(r[l]-r[l+c]),f),a+=ge.repeat(" ",t.indent)+on((e.line+c+1).toString(),u)+" | "+s.str+`
7
+ `;return a.replace(/\n$/,"")}var jo=$o,Vo=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],qo=["scalar","sequence","mapping"];function Yo(e){var t={};return e!==null&&Object.keys(e).forEach(function(n){e[n].forEach(function(r){t[String(r)]=n})}),t}function Uo(e,t){if(t=t||{},Object.keys(t).forEach(function(n){if(Vo.indexOf(n)===-1)throw new xe('Unknown option "'+n+'" is met in definition of "'+e+'" YAML type.')}),this.options=t,this.tag=e,this.kind=t.kind||null,this.resolve=t.resolve||function(){return!0},this.construct=t.construct||function(n){return n},this.instanceOf=t.instanceOf||null,this.predicate=t.predicate||null,this.represent=t.represent||null,this.representName=t.representName||null,this.defaultStyle=t.defaultStyle||null,this.multi=t.multi||!1,this.styleAliases=Yo(t.styleAliases||null),qo.indexOf(this.kind)===-1)throw new xe('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var be=Uo;function zn(e,t){var n=[];return e[t].forEach(function(r){var i=n.length;n.forEach(function(o,l){o.tag===r.tag&&o.kind===r.kind&&o.multi===r.multi&&(i=l)}),n[i]=r}),n}function Bo(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},t,n;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(t=0,n=arguments.length;t<n;t+=1)arguments[t].forEach(r);return e}function pn(e){return this.extend(e)}pn.prototype.extend=function(t){var n=[],r=[];if(t instanceof be)r.push(t);else if(Array.isArray(t))r=r.concat(t);else if(t&&(Array.isArray(t.implicit)||Array.isArray(t.explicit)))t.implicit&&(n=n.concat(t.implicit)),t.explicit&&(r=r.concat(t.explicit));else throw new xe("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");n.forEach(function(o){if(!(o instanceof be))throw new xe("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(o.loadKind&&o.loadKind!=="scalar")throw new xe("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(o.multi)throw new xe("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(o){if(!(o instanceof be))throw new xe("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(pn.prototype);return i.implicit=(this.implicit||[]).concat(n),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=zn(i,"implicit"),i.compiledExplicit=zn(i,"explicit"),i.compiledTypeMap=Bo(i.compiledImplicit,i.compiledExplicit),i};var Kr=pn,Qr=new be("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Xr=new be("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Jr=new be("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),ei=new Kr({explicit:[Qr,Xr,Jr]});function Go(e){if(e===null)return!0;var t=e.length;return t===1&&e==="~"||t===4&&(e==="null"||e==="Null"||e==="NULL")}function Wo(){return null}function zo(e){return e===null}var ti=new be("tag:yaml.org,2002:null",{kind:"scalar",resolve:Go,construct:Wo,predicate:zo,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Zo(e){if(e===null)return!1;var t=e.length;return t===4&&(e==="true"||e==="True"||e==="TRUE")||t===5&&(e==="false"||e==="False"||e==="FALSE")}function Ko(e){return e==="true"||e==="True"||e==="TRUE"}function Qo(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var ni=new be("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Zo,construct:Ko,predicate:Qo,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});function Xo(e){return 48<=e&&e<=57||65<=e&&e<=70||97<=e&&e<=102}function Jo(e){return 48<=e&&e<=55}function el(e){return 48<=e&&e<=57}function tl(e){if(e===null)return!1;var t=e.length,n=0,r=!1,i;if(!t)return!1;if(i=e[n],(i==="-"||i==="+")&&(i=e[++n]),i==="0"){if(n+1===t)return!0;if(i=e[++n],i==="b"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(i!=="0"&&i!=="1")return!1;r=!0}return r&&i!=="_"}if(i==="x"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!Xo(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}if(i==="o"){for(n++;n<t;n++)if(i=e[n],i!=="_"){if(!Jo(e.charCodeAt(n)))return!1;r=!0}return r&&i!=="_"}}if(i==="_")return!1;for(;n<t;n++)if(i=e[n],i!=="_"){if(!el(e.charCodeAt(n)))return!1;r=!0}return!(!r||i==="_")}function nl(e){var t=e,n=1,r;if(t.indexOf("_")!==-1&&(t=t.replace(/_/g,"")),r=t[0],(r==="-"||r==="+")&&(r==="-"&&(n=-1),t=t.slice(1),r=t[0]),t==="0")return 0;if(r==="0"){if(t[1]==="b")return n*parseInt(t.slice(2),2);if(t[1]==="x")return n*parseInt(t.slice(2),16);if(t[1]==="o")return n*parseInt(t.slice(2),8)}return n*parseInt(t,10)}function rl(e){return Object.prototype.toString.call(e)==="[object Number]"&&e%1===0&&!ge.isNegativeZero(e)}var ri=new be("tag:yaml.org,2002:int",{kind:"scalar",resolve:tl,construct:nl,predicate:rl,represent:{binary:function(e){return e>=0?"0b"+e.toString(2):"-0b"+e.toString(2).slice(1)},octal:function(e){return e>=0?"0o"+e.toString(8):"-0o"+e.toString(8).slice(1)},decimal:function(e){return e.toString(10)},hexadecimal:function(e){return e>=0?"0x"+e.toString(16).toUpperCase():"-0x"+e.toString(16).toUpperCase().slice(1)}},defaultStyle:"decimal",styleAliases:{binary:[2,"bin"],octal:[8,"oct"],decimal:[10,"dec"],hexadecimal:[16,"hex"]}}),il=new RegExp("^(?:[-+]?(?:[0-9][0-9_]*)(?:\\.[0-9_]*)?(?:[eE][-+]?[0-9]+)?|\\.[0-9_]+(?:[eE][-+]?[0-9]+)?|[-+]?\\.(?:inf|Inf|INF)|\\.(?:nan|NaN|NAN))$");function ol(e){return!(e===null||!il.test(e)||e[e.length-1]==="_")}function ll(e){var t,n;return t=e.replace(/_/g,"").toLowerCase(),n=t[0]==="-"?-1:1,"+-".indexOf(t[0])>=0&&(t=t.slice(1)),t===".inf"?n===1?Number.POSITIVE_INFINITY:Number.NEGATIVE_INFINITY:t===".nan"?NaN:n*parseFloat(t,10)}var al=/^[-+]?[0-9]+e/;function cl(e,t){var n;if(isNaN(e))switch(t){case"lowercase":return".nan";case"uppercase":return".NAN";case"camelcase":return".NaN"}else if(Number.POSITIVE_INFINITY===e)switch(t){case"lowercase":return".inf";case"uppercase":return".INF";case"camelcase":return".Inf"}else if(Number.NEGATIVE_INFINITY===e)switch(t){case"lowercase":return"-.inf";case"uppercase":return"-.INF";case"camelcase":return"-.Inf"}else if(ge.isNegativeZero(e))return"-0.0";return n=e.toString(10),al.test(n)?n.replace("e",".e"):n}function sl(e){return Object.prototype.toString.call(e)==="[object Number]"&&(e%1!==0||ge.isNegativeZero(e))}var ii=new be("tag:yaml.org,2002:float",{kind:"scalar",resolve:ol,construct:ll,predicate:sl,represent:cl,defaultStyle:"lowercase"}),oi=ei.extend({implicit:[ti,ni,ri,ii]}),li=oi,ai=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9])-([0-9][0-9])$"),ci=new RegExp("^([0-9][0-9][0-9][0-9])-([0-9][0-9]?)-([0-9][0-9]?)(?:[Tt]|[ \\t]+)([0-9][0-9]?):([0-9][0-9]):([0-9][0-9])(?:\\.([0-9]*))?(?:[ \\t]*(Z|([-+])([0-9][0-9]?)(?::([0-9][0-9]))?))?$");function ul(e){return e===null?!1:ai.exec(e)!==null||ci.exec(e)!==null}function fl(e){var t,n,r,i,o,l,a,c=0,s=null,u,f,d;if(t=ai.exec(e),t===null&&(t=ci.exec(e)),t===null)throw new Error("Date resolve error");if(n=+t[1],r=+t[2]-1,i=+t[3],!t[4])return new Date(Date.UTC(n,r,i));if(o=+t[4],l=+t[5],a=+t[6],t[7]){for(c=t[7].slice(0,3);c.length<3;)c+="0";c=+c}return t[9]&&(u=+t[10],f=+(t[11]||0),s=(u*60+f)*6e4,t[9]==="-"&&(s=-s)),d=new Date(Date.UTC(n,r,i,o,l,a,c)),s&&d.setTime(d.getTime()-s),d}function dl(e){return e.toISOString()}var si=new be("tag:yaml.org,2002:timestamp",{kind:"scalar",resolve:ul,construct:fl,instanceOf:Date,represent:dl});function pl(e){return e==="<<"||e===null}var ui=new be("tag:yaml.org,2002:merge",{kind:"scalar",resolve:pl}),Mn=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=
8
+ \r`;function hl(e){if(e===null)return!1;var t,n,r=0,i=e.length,o=Mn;for(n=0;n<i;n++)if(t=o.indexOf(e.charAt(n)),!(t>64)){if(t<0)return!1;r+=6}return r%8===0}function ml(e){var t,n,r=e.replace(/[\r\n=]/g,""),i=r.length,o=Mn,l=0,a=[];for(t=0;t<i;t++)t%4===0&&t&&(a.push(l>>16&255),a.push(l>>8&255),a.push(l&255)),l=l<<6|o.indexOf(r.charAt(t));return n=i%4*6,n===0?(a.push(l>>16&255),a.push(l>>8&255),a.push(l&255)):n===18?(a.push(l>>10&255),a.push(l>>2&255)):n===12&&a.push(l>>4&255),new Uint8Array(a)}function gl(e){var t="",n=0,r,i,o=e.length,l=Mn;for(r=0;r<o;r++)r%3===0&&r&&(t+=l[n>>18&63],t+=l[n>>12&63],t+=l[n>>6&63],t+=l[n&63]),n=(n<<8)+e[r];return i=o%3,i===0?(t+=l[n>>18&63],t+=l[n>>12&63],t+=l[n>>6&63],t+=l[n&63]):i===2?(t+=l[n>>10&63],t+=l[n>>4&63],t+=l[n<<2&63],t+=l[64]):i===1&&(t+=l[n>>2&63],t+=l[n<<4&63],t+=l[64],t+=l[64]),t}function _l(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var fi=new be("tag:yaml.org,2002:binary",{kind:"scalar",resolve:hl,construct:ml,predicate:_l,represent:gl}),wl=Object.prototype.hasOwnProperty,bl=Object.prototype.toString;function vl(e){if(e===null)return!0;var t=[],n,r,i,o,l,a=e;for(n=0,r=a.length;n<r;n+=1){if(i=a[n],l=!1,bl.call(i)!=="[object Object]")return!1;for(o in i)if(wl.call(i,o))if(!l)l=!0;else return!1;if(!l)return!1;if(t.indexOf(o)===-1)t.push(o);else return!1}return!0}function yl(e){return e!==null?e:[]}var di=new be("tag:yaml.org,2002:omap",{kind:"sequence",resolve:vl,construct:yl}),kl=Object.prototype.toString;function Al(e){if(e===null)return!0;var t,n,r,i,o,l=e;for(o=new Array(l.length),t=0,n=l.length;t<n;t+=1){if(r=l[t],kl.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;o[t]=[i[0],r[i[0]]]}return!0}function El(e){if(e===null)return[];var t,n,r,i,o,l=e;for(o=new Array(l.length),t=0,n=l.length;t<n;t+=1)r=l[t],i=Object.keys(r),o[t]=[i[0],r[i[0]]];return o}var pi=new be("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Al,construct:El}),Cl=Object.prototype.hasOwnProperty;function Sl(e){if(e===null)return!0;var t,n=e;for(t in n)if(Cl.call(n,t)&&n[t]!==null)return!1;return!0}function xl(e){return e!==null?e:{}}var hi=new be("tag:yaml.org,2002:set",{kind:"mapping",resolve:Sl,construct:xl}),On=li.extend({implicit:[si,ui],explicit:[fi,di,pi,hi]}),tt=Object.prototype.hasOwnProperty,Yt=1,mi=2,gi=3,Ut=4,ln=1,Ll=2,Zn=3,Tl=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,Ml=/[\x85\u2028\u2029]/,Ol=/[,\[\]\{\}]/,_i=/^(?:!|!!|![a-z\-]+!)$/i,wi=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function Kn(e){return Object.prototype.toString.call(e)}function Be(e){return e===10||e===13}function it(e){return e===9||e===32}function Me(e){return e===9||e===32||e===10||e===13}function wt(e){return e===44||e===91||e===93||e===123||e===125}function Dl(e){var t;return 48<=e&&e<=57?e-48:(t=e|32,97<=t&&t<=102?t-97+10:-1)}function Fl(e){return e===120?2:e===117?4:e===85?8:0}function Hl(e){return 48<=e&&e<=57?e-48:-1}function Qn(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
9
+ `:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"…":e===95?" ":e===76?"\u2028":e===80?"\u2029":""}function Il(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var bi=new Array(256),vi=new Array(256);for(var ht=0;ht<256;ht++)bi[ht]=Qn(ht)?1:0,vi[ht]=Qn(ht);function Nl(e,t){this.input=e,this.filename=t.filename||null,this.schema=t.schema||On,this.onWarning=t.onWarning||null,this.legacy=t.legacy||!1,this.json=t.json||!1,this.listener=t.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function yi(e,t){var n={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return n.snippet=jo(n),new xe(t,n)}function U(e,t){throw yi(e,t)}function Bt(e,t){e.onWarning&&e.onWarning.call(null,yi(e,t))}var Xn={YAML:function(t,n,r){var i,o,l;t.version!==null&&U(t,"duplication of %YAML directive"),r.length!==1&&U(t,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&U(t,"ill-formed argument of the YAML directive"),o=parseInt(i[1],10),l=parseInt(i[2],10),o!==1&&U(t,"unacceptable YAML version of the document"),t.version=r[0],t.checkLineBreaks=l<2,l!==1&&l!==2&&Bt(t,"unsupported YAML version of the document")},TAG:function(t,n,r){var i,o;r.length!==2&&U(t,"TAG directive accepts exactly two arguments"),i=r[0],o=r[1],_i.test(i)||U(t,"ill-formed tag handle (first argument) of the TAG directive"),tt.call(t.tagMap,i)&&U(t,'there is a previously declared suffix for "'+i+'" tag handle'),wi.test(o)||U(t,"ill-formed tag prefix (second argument) of the TAG directive");try{o=decodeURIComponent(o)}catch{U(t,"tag prefix is malformed: "+o)}t.tagMap[i]=o}};function Je(e,t,n,r){var i,o,l,a;if(t<n){if(a=e.input.slice(t,n),r)for(i=0,o=a.length;i<o;i+=1)l=a.charCodeAt(i),l===9||32<=l&&l<=1114111||U(e,"expected valid JSON character");else Tl.test(a)&&U(e,"the stream contains non-printable characters");e.result+=a}}function Jn(e,t,n,r){var i,o,l,a;for(ge.isObject(n)||U(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(n),l=0,a=i.length;l<a;l+=1)o=i[l],tt.call(t,o)||(t[o]=n[o],r[o]=!0)}function bt(e,t,n,r,i,o,l,a,c){var s,u;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),s=0,u=i.length;s<u;s+=1)Array.isArray(i[s])&&U(e,"nested arrays are not supported inside keys"),typeof i=="object"&&Kn(i[s])==="[object Object]"&&(i[s]="[object Object]");if(typeof i=="object"&&Kn(i)==="[object Object]"&&(i="[object Object]"),i=String(i),t===null&&(t={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(o))for(s=0,u=o.length;s<u;s+=1)Jn(e,t,o[s],n);else Jn(e,t,o,n);else!e.json&&!tt.call(n,i)&&tt.call(t,i)&&(e.line=l||e.line,e.lineStart=a||e.lineStart,e.position=c||e.position,U(e,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(t,i,{configurable:!0,enumerable:!0,writable:!0,value:o}):t[i]=o,delete n[i];return t}function Dn(e){var t;t=e.input.charCodeAt(e.position),t===10?e.position++:t===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):U(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function pe(e,t,n){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;it(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(t&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(Be(i))for(Dn(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return n!==-1&&r!==0&&e.lineIndent<n&&Bt(e,"deficient indentation"),r}function Xt(e){var t=e.position,n;return n=e.input.charCodeAt(t),!!((n===45||n===46)&&n===e.input.charCodeAt(t+1)&&n===e.input.charCodeAt(t+2)&&(t+=3,n=e.input.charCodeAt(t),n===0||Me(n)))}function Fn(e,t){t===1?e.result+=" ":t>1&&(e.result+=ge.repeat(`
10
+ `,t-1))}function Rl(e,t,n){var r,i,o,l,a,c,s,u,f=e.kind,d=e.result,p;if(p=e.input.charCodeAt(e.position),Me(p)||wt(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=e.input.charCodeAt(e.position+1),Me(i)||n&&wt(i)))return!1;for(e.kind="scalar",e.result="",o=l=e.position,a=!1;p!==0;){if(p===58){if(i=e.input.charCodeAt(e.position+1),Me(i)||n&&wt(i))break}else if(p===35){if(r=e.input.charCodeAt(e.position-1),Me(r))break}else{if(e.position===e.lineStart&&Xt(e)||n&&wt(p))break;if(Be(p))if(c=e.line,s=e.lineStart,u=e.lineIndent,pe(e,!1,-1),e.lineIndent>=t){a=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=l,e.line=c,e.lineStart=s,e.lineIndent=u;break}}a&&(Je(e,o,l,!1),Fn(e,e.line-c),o=l=e.position,a=!1),it(p)||(l=e.position+1),p=e.input.charCodeAt(++e.position)}return Je(e,o,l,!1),e.result?!0:(e.kind=f,e.result=d,!1)}function Pl(e,t){var n,r,i;if(n=e.input.charCodeAt(e.position),n!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(n=e.input.charCodeAt(e.position))!==0;)if(n===39)if(Je(e,r,e.position,!0),n=e.input.charCodeAt(++e.position),n===39)r=e.position,e.position++,i=e.position;else return!0;else Be(n)?(Je(e,r,i,!0),Fn(e,pe(e,!1,t)),r=i=e.position):e.position===e.lineStart&&Xt(e)?U(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);U(e,"unexpected end of the stream within a single quoted scalar")}function $l(e,t){var n,r,i,o,l,a;if(a=e.input.charCodeAt(e.position),a!==34)return!1;for(e.kind="scalar",e.result="",e.position++,n=r=e.position;(a=e.input.charCodeAt(e.position))!==0;){if(a===34)return Je(e,n,e.position,!0),e.position++,!0;if(a===92){if(Je(e,n,e.position,!0),a=e.input.charCodeAt(++e.position),Be(a))pe(e,!1,t);else if(a<256&&bi[a])e.result+=vi[a],e.position++;else if((l=Fl(a))>0){for(i=l,o=0;i>0;i--)a=e.input.charCodeAt(++e.position),(l=Dl(a))>=0?o=(o<<4)+l:U(e,"expected hexadecimal character");e.result+=Il(o),e.position++}else U(e,"unknown escape sequence");n=r=e.position}else Be(a)?(Je(e,n,r,!0),Fn(e,pe(e,!1,t)),n=r=e.position):e.position===e.lineStart&&Xt(e)?U(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}U(e,"unexpected end of the stream within a double quoted scalar")}function jl(e,t){var n=!0,r,i,o,l=e.tag,a,c=e.anchor,s,u,f,d,p,m=Object.create(null),g,_,k,A;if(A=e.input.charCodeAt(e.position),A===91)u=93,p=!1,a=[];else if(A===123)u=125,p=!0,a={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),A=e.input.charCodeAt(++e.position);A!==0;){if(pe(e,!0,t),A=e.input.charCodeAt(e.position),A===u)return e.position++,e.tag=l,e.anchor=c,e.kind=p?"mapping":"sequence",e.result=a,!0;n?A===44&&U(e,"expected the node content, but found ','"):U(e,"missed comma between flow collection entries"),_=g=k=null,f=d=!1,A===63&&(s=e.input.charCodeAt(e.position+1),Me(s)&&(f=d=!0,e.position++,pe(e,!0,t))),r=e.line,i=e.lineStart,o=e.position,kt(e,t,Yt,!1,!0),_=e.tag,g=e.result,pe(e,!0,t),A=e.input.charCodeAt(e.position),(d||e.line===r)&&A===58&&(f=!0,A=e.input.charCodeAt(++e.position),pe(e,!0,t),kt(e,t,Yt,!1,!0),k=e.result),p?bt(e,a,m,_,g,k,r,i,o):f?a.push(bt(e,null,m,_,g,k,r,i,o)):a.push(g),pe(e,!0,t),A=e.input.charCodeAt(e.position),A===44?(n=!0,A=e.input.charCodeAt(++e.position)):n=!1}U(e,"unexpected end of the stream within a flow collection")}function Vl(e,t){var n,r,i=ln,o=!1,l=!1,a=t,c=0,s=!1,u,f;if(f=e.input.charCodeAt(e.position),f===124)r=!1;else if(f===62)r=!0;else return!1;for(e.kind="scalar",e.result="";f!==0;)if(f=e.input.charCodeAt(++e.position),f===43||f===45)ln===i?i=f===43?Zn:Ll:U(e,"repeat of a chomping mode identifier");else if((u=Hl(f))>=0)u===0?U(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):l?U(e,"repeat of an indentation width identifier"):(a=t+u-1,l=!0);else break;if(it(f)){do f=e.input.charCodeAt(++e.position);while(it(f));if(f===35)do f=e.input.charCodeAt(++e.position);while(!Be(f)&&f!==0)}for(;f!==0;){for(Dn(e),e.lineIndent=0,f=e.input.charCodeAt(e.position);(!l||e.lineIndent<a)&&f===32;)e.lineIndent++,f=e.input.charCodeAt(++e.position);if(!l&&e.lineIndent>a&&(a=e.lineIndent),Be(f)){c++;continue}if(e.lineIndent<a){i===Zn?e.result+=ge.repeat(`
11
+ `,o?1+c:c):i===ln&&o&&(e.result+=`
12
+ `);break}for(r?it(f)?(s=!0,e.result+=ge.repeat(`
13
+ `,o?1+c:c)):s?(s=!1,e.result+=ge.repeat(`
14
+ `,c+1)):c===0?o&&(e.result+=" "):e.result+=ge.repeat(`
15
15
  `,c):e.result+=ge.repeat(`
16
- `,l?1+c:c),l=!0,o=!0,c=0,n=e.position;!Be(u)&&u!==0;)u=e.input.charCodeAt(++e.position);Qe(e,n,e.position,!1)}return!0}function er(e,t){var n,r=e.tag,i=e.anchor,l=[],o,a=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=l),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Y(e,"tab characters must not be used in indentation")),!(c!==45||(o=e.input.charCodeAt(e.position+1),!Me(o))));){if(a=!0,e.position++,pe(e,!0,-1)&&e.lineIndent<=t){l.push(null),c=e.input.charCodeAt(e.position);continue}if(n=e.line,yt(e,t,gi,!1,!0),l.push(e.result),pe(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&c!==0)Y(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=l,!0):!1}function qo(e,t,n){var r,i,l,o,a,c,s=e.tag,f=e.anchor,u={},d=Object.create(null),p=null,g=null,h=null,v=!1,A=!1,E;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=u),E=e.input.charCodeAt(e.position);E!==0;){if(!v&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Y(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),l=e.line,(E===63||E===58)&&Me(r))E===63?(v&&(wt(e,u,d,p,g,null,o,a,c),p=g=h=null),A=!0,v=!0,i=!0):v?(v=!1,i=!0):Y(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,E=r;else{if(o=e.line,a=e.lineStart,c=e.position,!yt(e,n,mi,!1,!0))break;if(e.line===l){for(E=e.input.charCodeAt(e.position);it(E);)E=e.input.charCodeAt(++e.position);if(E===58)E=e.input.charCodeAt(++e.position),Me(E)||Y(e,"a whitespace character is expected after the key-value separator within a block mapping"),v&&(wt(e,u,d,p,g,null,o,a,c),p=g=h=null),A=!0,v=!1,i=!1,p=e.tag,g=e.result;else if(A)Y(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=s,e.anchor=f,!0}else if(A)Y(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=s,e.anchor=f,!0}if((e.line===l||e.lineIndent>t)&&(v&&(o=e.line,a=e.lineStart,c=e.position),yt(e,t,Yt,!0,i)&&(v?g=e.result:h=e.result),v||(wt(e,u,d,p,g,h,o,a,c),p=g=h=null),pe(e,!0,-1),E=e.input.charCodeAt(e.position)),(e.line===l||e.lineIndent>t)&&E!==0)Y(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return v&&wt(e,u,d,p,g,null,o,a,c),A&&(e.tag=s,e.anchor=f,e.kind="mapping",e.result=u),A}function Yo(e){var t,n=!1,r=!1,i,l,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&Y(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(n=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i="!!",o=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(l=e.input.slice(t,e.position),o=e.input.charCodeAt(++e.position)):Y(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!Me(o);)o===33&&(r?Y(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),_i.test(i)||Y(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),o=e.input.charCodeAt(++e.position);l=e.input.slice(t,e.position),Oo.test(l)&&Y(e,"tag suffix cannot contain flow indicator characters")}l&&!wi.test(l)&&Y(e,"tag name cannot contain such characters: "+l);try{l=decodeURIComponent(l)}catch{Y(e,"tag name is malformed: "+l)}return n?e.tag=l:et.call(e.tagMap,i)?e.tag=e.tagMap[i]+l:i==="!"?e.tag="!"+l:i==="!!"?e.tag="tag:yaml.org,2002:"+l:Y(e,'undeclared tag handle "'+i+'"'),!0}function Uo(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&Y(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Me(n)&&!_t(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&Y(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Bo(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Me(r)&&!_t(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&Y(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),et.call(e.anchorMap,n)||Y(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],pe(e,!0,-1),!0}function yt(e,t,n,r,i){var l,o,a,c=1,s=!1,f=!1,u,d,p,g,h,v;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,l=o=a=Yt===n||gi===n,r&&pe(e,!0,-1)&&(s=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;Yo(e)||Uo(e);)pe(e,!0,-1)?(s=!0,a=l,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):a=!1;if(a&&(a=s||i),(c===1||Yt===n)&&(qt===n||mi===n?h=t:h=t+1,v=e.position-e.lineStart,c===1?a&&(er(e,v)||qo(e,v,h))||jo(e,h)?f=!0:(o&&Vo(e,h)||Po(e,h)||$o(e,h)?f=!0:Bo(e)?(f=!0,(e.tag!==null||e.anchor!==null)&&Y(e,"alias node should not have any properties")):Ro(e,h,qt===n)&&(f=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(f=a&&er(e,v))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&Y(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),u=0,d=e.implicitTypes.length;u<d;u+=1)if(g=e.implicitTypes[u],g.resolve(e.result)){e.result=g.construct(e.result),e.tag=g.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(et.call(e.typeMap[e.kind||"fallback"],e.tag))g=e.typeMap[e.kind||"fallback"][e.tag];else for(g=null,p=e.typeMap.multi[e.kind||"fallback"],u=0,d=p.length;u<d;u+=1)if(e.tag.slice(0,p[u].tag.length)===p[u].tag){g=p[u];break}g||Y(e,"unknown tag !<"+e.tag+">"),e.result!==null&&g.kind!==e.kind&&Y(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+g.kind+'", not "'+e.kind+'"'),g.resolve(e.result,e.tag)?(e.result=g.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):Y(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||f}function Go(e){var t=e.position,n,r,i,l=!1,o;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(o=e.input.charCodeAt(e.position))!==0&&(pe(e,!0,-1),o=e.input.charCodeAt(e.position),!(e.lineIndent>0||o!==37));){for(l=!0,o=e.input.charCodeAt(++e.position),n=e.position;o!==0&&!Me(o);)o=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&Y(e,"directive name must not be less than one character in length");o!==0;){for(;it(o);)o=e.input.charCodeAt(++e.position);if(o===35){do o=e.input.charCodeAt(++e.position);while(o!==0&&!Be(o));break}if(Be(o))break;for(n=e.position;o!==0&&!Me(o);)o=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}o!==0&&Dn(e),et.call(Qn,r)?Qn[r](e,r,i):Ut(e,'unknown document directive "'+r+'"')}if(pe(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,pe(e,!0,-1)):l&&Y(e,"directives end mark is expected"),yt(e,e.lineIndent-1,Yt,!1,!0),pe(e,!0,-1),e.checkLineBreaks&&Mo.test(e.input.slice(t,e.position))&&Ut(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Xt(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,pe(e,!0,-1));return}if(e.position<e.length-1)Y(e,"end of the stream or a document separator is expected");else return}function ki(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
17
- `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new No(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,Y(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Go(n);return n.documents}function Wo(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var r=ki(e,n);if(typeof t!="function")return r;for(var i=0,l=r.length;i<l;i+=1)t(r[i])}function zo(e,t){var n=ki(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new Le("expected a single document in the stream, but found more")}}var Zo=Wo,Ko=zo,Ai={loadAll:Zo,load:Ko},Ei=Object.prototype.toString,Ci=Object.prototype.hasOwnProperty,Hn=65279,Xo=9,Ot=10,Qo=13,Jo=32,ea=33,ta=34,hn=35,na=37,ra=38,ia=39,la=42,Si=44,oa=45,Bt=58,aa=61,ca=62,sa=63,ua=64,xi=91,Li=93,fa=96,Ti=123,da=124,Mi=125,Se={};Se[0]="\\0";Se[7]="\\a";Se[8]="\\b";Se[9]="\\t";Se[10]="\\n";Se[11]="\\v";Se[12]="\\f";Se[13]="\\r";Se[27]="\\e";Se[34]='\\"';Se[92]="\\\\";Se[133]="\\N";Se[160]="\\_";Se[8232]="\\L";Se[8233]="\\P";var pa=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],ha=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ma(e,t){var n,r,i,l,o,a,c;if(t===null)return{};for(n={},r=Object.keys(t),i=0,l=r.length;i<l;i+=1)o=r[i],a=String(t[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),c=e.compiledTypeMap.fallback[o],c&&Ci.call(c.styleAliases,a)&&(a=c.styleAliases[a]),n[o]=a;return n}function ga(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else if(e<=4294967295)n="U",r=8;else throw new Le("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+ge.repeat("0",r-t.length)+t}var _a=1,Dt=2;function wa(e){this.schema=e.schema||On,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ge.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=ma(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Dt:_a,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function tr(e,t){for(var n=ge.repeat(" ",t),r=0,i=-1,l="",o,a=e.length;r<a;)i=e.indexOf(`
18
- `,r),i===-1?(o=e.slice(r),r=a):(o=e.slice(r,i+1),r=i+1),o.length&&o!==`
19
- `&&(l+=n),l+=o;return l}function mn(e,t){return`
20
- `+ge.repeat(" ",e.indent*t)}function ba(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function Gt(e){return e===Jo||e===Xo}function Ft(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Hn||65536<=e&&e<=1114111}function nr(e){return Ft(e)&&e!==Hn&&e!==Qo&&e!==Ot}function rr(e,t,n){var r=nr(e),i=r&&!Gt(e);return(n?r:r&&e!==Si&&e!==xi&&e!==Li&&e!==Ti&&e!==Mi)&&e!==hn&&!(t===Bt&&!i)||nr(t)&&!Gt(t)&&e===hn||t===Bt&&i}function va(e){return Ft(e)&&e!==Hn&&!Gt(e)&&e!==oa&&e!==sa&&e!==Bt&&e!==Si&&e!==xi&&e!==Li&&e!==Ti&&e!==Mi&&e!==hn&&e!==ra&&e!==la&&e!==ea&&e!==da&&e!==aa&&e!==ca&&e!==ia&&e!==ta&&e!==na&&e!==ua&&e!==fa}function ya(e){return!Gt(e)&&e!==Bt}function xt(e,t){var n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function Oi(e){var t=/^\n* /;return t.test(e)}var Di=1,gn=2,Fi=3,Hi=4,gt=5;function ka(e,t,n,r,i,l,o,a){var c,s=0,f=null,u=!1,d=!1,p=r!==-1,g=-1,h=va(xt(e,0))&&ya(xt(e,e.length-1));if(t||o)for(c=0;c<e.length;s>=65536?c+=2:c++){if(s=xt(e,c),!Ft(s))return gt;h=h&&rr(s,f,a),f=s}else{for(c=0;c<e.length;s>=65536?c+=2:c++){if(s=xt(e,c),s===Ot)u=!0,p&&(d=d||c-g-1>r&&e[g+1]!==" ",g=c);else if(!Ft(s))return gt;h=h&&rr(s,f,a),f=s}d=d||p&&c-g-1>r&&e[g+1]!==" "}return!u&&!d?h&&!o&&!i(e)?Di:l===Dt?gt:gn:n>9&&Oi(e)?gt:o?l===Dt?gt:gn:d?Hi:Fi}function Aa(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===Dt?'""':"''";if(!e.noCompatMode&&(pa.indexOf(t)!==-1||ha.test(t)))return e.quotingType===Dt?'"'+t+'"':"'"+t+"'";var l=e.indent*Math.max(1,n),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-l),a=r||e.flowLevel>-1&&n>=e.flowLevel;function c(s){return ba(e,s)}switch(ka(t,a,e.indent,o,c,e.quotingType,e.forceQuotes&&!r,i)){case Di:return t;case gn:return"'"+t.replace(/'/g,"''")+"'";case Fi:return"|"+ir(t,e.indent)+lr(tr(t,l));case Hi:return">"+ir(t,e.indent)+lr(tr(Ea(t,o),l));case gt:return'"'+Ca(t)+'"';default:throw new Le("impossible error: invalid scalar style")}}()}function ir(e,t){var n=Oi(e)?String(t):"",r=e[e.length-1]===`
16
+ `,o?1+c:c),o=!0,l=!0,c=0,n=e.position;!Be(f)&&f!==0;)f=e.input.charCodeAt(++e.position);Je(e,n,e.position,!1)}return!0}function er(e,t){var n,r=e.tag,i=e.anchor,o=[],l,a=!1,c;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=o),c=e.input.charCodeAt(e.position);c!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,U(e,"tab characters must not be used in indentation")),!(c!==45||(l=e.input.charCodeAt(e.position+1),!Me(l))));){if(a=!0,e.position++,pe(e,!0,-1)&&e.lineIndent<=t){o.push(null),c=e.input.charCodeAt(e.position);continue}if(n=e.line,kt(e,t,gi,!1,!0),o.push(e.result),pe(e,!0,-1),c=e.input.charCodeAt(e.position),(e.line===n||e.lineIndent>t)&&c!==0)U(e,"bad indentation of a sequence entry");else if(e.lineIndent<t)break}return a?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=o,!0):!1}function ql(e,t,n){var r,i,o,l,a,c,s=e.tag,u=e.anchor,f={},d=Object.create(null),p=null,m=null,g=null,_=!1,k=!1,A;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=f),A=e.input.charCodeAt(e.position);A!==0;){if(!_&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,U(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),o=e.line,(A===63||A===58)&&Me(r))A===63?(_&&(bt(e,f,d,p,m,null,l,a,c),p=m=g=null),k=!0,_=!0,i=!0):_?(_=!1,i=!0):U(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,A=r;else{if(l=e.line,a=e.lineStart,c=e.position,!kt(e,n,mi,!1,!0))break;if(e.line===o){for(A=e.input.charCodeAt(e.position);it(A);)A=e.input.charCodeAt(++e.position);if(A===58)A=e.input.charCodeAt(++e.position),Me(A)||U(e,"a whitespace character is expected after the key-value separator within a block mapping"),_&&(bt(e,f,d,p,m,null,l,a,c),p=m=g=null),k=!0,_=!1,i=!1,p=e.tag,m=e.result;else if(k)U(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=s,e.anchor=u,!0}else if(k)U(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=s,e.anchor=u,!0}if((e.line===o||e.lineIndent>t)&&(_&&(l=e.line,a=e.lineStart,c=e.position),kt(e,t,Ut,!0,i)&&(_?m=e.result:g=e.result),_||(bt(e,f,d,p,m,g,l,a,c),p=m=g=null),pe(e,!0,-1),A=e.input.charCodeAt(e.position)),(e.line===o||e.lineIndent>t)&&A!==0)U(e,"bad indentation of a mapping entry");else if(e.lineIndent<t)break}return _&&bt(e,f,d,p,m,null,l,a,c),k&&(e.tag=s,e.anchor=u,e.kind="mapping",e.result=f),k}function Yl(e){var t,n=!1,r=!1,i,o,l;if(l=e.input.charCodeAt(e.position),l!==33)return!1;if(e.tag!==null&&U(e,"duplication of a tag property"),l=e.input.charCodeAt(++e.position),l===60?(n=!0,l=e.input.charCodeAt(++e.position)):l===33?(r=!0,i="!!",l=e.input.charCodeAt(++e.position)):i="!",t=e.position,n){do l=e.input.charCodeAt(++e.position);while(l!==0&&l!==62);e.position<e.length?(o=e.input.slice(t,e.position),l=e.input.charCodeAt(++e.position)):U(e,"unexpected end of the stream within a verbatim tag")}else{for(;l!==0&&!Me(l);)l===33&&(r?U(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(t-1,e.position+1),_i.test(i)||U(e,"named tag handle cannot contain such characters"),r=!0,t=e.position+1)),l=e.input.charCodeAt(++e.position);o=e.input.slice(t,e.position),Ol.test(o)&&U(e,"tag suffix cannot contain flow indicator characters")}o&&!wi.test(o)&&U(e,"tag name cannot contain such characters: "+o);try{o=decodeURIComponent(o)}catch{U(e,"tag name is malformed: "+o)}return n?e.tag=o:tt.call(e.tagMap,i)?e.tag=e.tagMap[i]+o:i==="!"?e.tag="!"+o:i==="!!"?e.tag="tag:yaml.org,2002:"+o:U(e,'undeclared tag handle "'+i+'"'),!0}function Ul(e){var t,n;if(n=e.input.charCodeAt(e.position),n!==38)return!1;for(e.anchor!==null&&U(e,"duplication of an anchor property"),n=e.input.charCodeAt(++e.position),t=e.position;n!==0&&!Me(n)&&!wt(n);)n=e.input.charCodeAt(++e.position);return e.position===t&&U(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(t,e.position),!0}function Bl(e){var t,n,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.position),t=e.position;r!==0&&!Me(r)&&!wt(r);)r=e.input.charCodeAt(++e.position);return e.position===t&&U(e,"name of an alias node must contain at least one character"),n=e.input.slice(t,e.position),tt.call(e.anchorMap,n)||U(e,'unidentified alias "'+n+'"'),e.result=e.anchorMap[n],pe(e,!0,-1),!0}function kt(e,t,n,r,i){var o,l,a,c=1,s=!1,u=!1,f,d,p,m,g,_;if(e.listener!==null&&e.listener("open",e),e.tag=null,e.anchor=null,e.kind=null,e.result=null,o=l=a=Ut===n||gi===n,r&&pe(e,!0,-1)&&(s=!0,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)),c===1)for(;Yl(e)||Ul(e);)pe(e,!0,-1)?(s=!0,a=o,e.lineIndent>t?c=1:e.lineIndent===t?c=0:e.lineIndent<t&&(c=-1)):a=!1;if(a&&(a=s||i),(c===1||Ut===n)&&(Yt===n||mi===n?g=t:g=t+1,_=e.position-e.lineStart,c===1?a&&(er(e,_)||ql(e,_,g))||jl(e,g)?u=!0:(l&&Vl(e,g)||Pl(e,g)||$l(e,g)?u=!0:Bl(e)?(u=!0,(e.tag!==null||e.anchor!==null)&&U(e,"alias node should not have any properties")):Rl(e,g,Yt===n)&&(u=!0,e.tag===null&&(e.tag="?")),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):c===0&&(u=a&&er(e,_))),e.tag===null)e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);else if(e.tag==="?"){for(e.result!==null&&e.kind!=="scalar"&&U(e,'unacceptable node kind for !<?> tag; it should be "scalar", not "'+e.kind+'"'),f=0,d=e.implicitTypes.length;f<d;f+=1)if(m=e.implicitTypes[f],m.resolve(e.result)){e.result=m.construct(e.result),e.tag=m.tag,e.anchor!==null&&(e.anchorMap[e.anchor]=e.result);break}}else if(e.tag!=="!"){if(tt.call(e.typeMap[e.kind||"fallback"],e.tag))m=e.typeMap[e.kind||"fallback"][e.tag];else for(m=null,p=e.typeMap.multi[e.kind||"fallback"],f=0,d=p.length;f<d;f+=1)if(e.tag.slice(0,p[f].tag.length)===p[f].tag){m=p[f];break}m||U(e,"unknown tag !<"+e.tag+">"),e.result!==null&&m.kind!==e.kind&&U(e,"unacceptable node kind for !<"+e.tag+'> tag; it should be "'+m.kind+'", not "'+e.kind+'"'),m.resolve(e.result,e.tag)?(e.result=m.construct(e.result,e.tag),e.anchor!==null&&(e.anchorMap[e.anchor]=e.result)):U(e,"cannot resolve a node with !<"+e.tag+"> explicit tag")}return e.listener!==null&&e.listener("close",e),e.tag!==null||e.anchor!==null||u}function Gl(e){var t=e.position,n,r,i,o=!1,l;for(e.version=null,e.checkLineBreaks=e.legacy,e.tagMap=Object.create(null),e.anchorMap=Object.create(null);(l=e.input.charCodeAt(e.position))!==0&&(pe(e,!0,-1),l=e.input.charCodeAt(e.position),!(e.lineIndent>0||l!==37));){for(o=!0,l=e.input.charCodeAt(++e.position),n=e.position;l!==0&&!Me(l);)l=e.input.charCodeAt(++e.position);for(r=e.input.slice(n,e.position),i=[],r.length<1&&U(e,"directive name must not be less than one character in length");l!==0;){for(;it(l);)l=e.input.charCodeAt(++e.position);if(l===35){do l=e.input.charCodeAt(++e.position);while(l!==0&&!Be(l));break}if(Be(l))break;for(n=e.position;l!==0&&!Me(l);)l=e.input.charCodeAt(++e.position);i.push(e.input.slice(n,e.position))}l!==0&&Dn(e),tt.call(Xn,r)?Xn[r](e,r,i):Bt(e,'unknown document directive "'+r+'"')}if(pe(e,!0,-1),e.lineIndent===0&&e.input.charCodeAt(e.position)===45&&e.input.charCodeAt(e.position+1)===45&&e.input.charCodeAt(e.position+2)===45?(e.position+=3,pe(e,!0,-1)):o&&U(e,"directives end mark is expected"),kt(e,e.lineIndent-1,Ut,!1,!0),pe(e,!0,-1),e.checkLineBreaks&&Ml.test(e.input.slice(t,e.position))&&Bt(e,"non-ASCII line breaks are interpreted as content"),e.documents.push(e.result),e.position===e.lineStart&&Xt(e)){e.input.charCodeAt(e.position)===46&&(e.position+=3,pe(e,!0,-1));return}if(e.position<e.length-1)U(e,"end of the stream or a document separator is expected");else return}function ki(e,t){e=String(e),t=t||{},e.length!==0&&(e.charCodeAt(e.length-1)!==10&&e.charCodeAt(e.length-1)!==13&&(e+=`
17
+ `),e.charCodeAt(0)===65279&&(e=e.slice(1)));var n=new Nl(e,t),r=e.indexOf("\0");for(r!==-1&&(n.position=r,U(n,"null byte is not allowed in input")),n.input+="\0";n.input.charCodeAt(n.position)===32;)n.lineIndent+=1,n.position+=1;for(;n.position<n.length-1;)Gl(n);return n.documents}function Wl(e,t,n){t!==null&&typeof t=="object"&&typeof n>"u"&&(n=t,t=null);var r=ki(e,n);if(typeof t!="function")return r;for(var i=0,o=r.length;i<o;i+=1)t(r[i])}function zl(e,t){var n=ki(e,t);if(n.length!==0){if(n.length===1)return n[0];throw new xe("expected a single document in the stream, but found more")}}var Zl=Wl,Kl=zl,Ai={loadAll:Zl,load:Kl},Ei=Object.prototype.toString,Ci=Object.prototype.hasOwnProperty,Hn=65279,Ql=9,Mt=10,Xl=13,Jl=32,ea=33,ta=34,hn=35,na=37,ra=38,ia=39,oa=42,Si=44,la=45,Gt=58,aa=61,ca=62,sa=63,ua=64,xi=91,Li=93,fa=96,Ti=123,da=124,Mi=125,Se={};Se[0]="\\0";Se[7]="\\a";Se[8]="\\b";Se[9]="\\t";Se[10]="\\n";Se[11]="\\v";Se[12]="\\f";Se[13]="\\r";Se[27]="\\e";Se[34]='\\"';Se[92]="\\\\";Se[133]="\\N";Se[160]="\\_";Se[8232]="\\L";Se[8233]="\\P";var pa=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],ha=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function ma(e,t){var n,r,i,o,l,a,c;if(t===null)return{};for(n={},r=Object.keys(t),i=0,o=r.length;i<o;i+=1)l=r[i],a=String(t[l]),l.slice(0,2)==="!!"&&(l="tag:yaml.org,2002:"+l.slice(2)),c=e.compiledTypeMap.fallback[l],c&&Ci.call(c.styleAliases,a)&&(a=c.styleAliases[a]),n[l]=a;return n}function ga(e){var t,n,r;if(t=e.toString(16).toUpperCase(),e<=255)n="x",r=2;else if(e<=65535)n="u",r=4;else if(e<=4294967295)n="U",r=8;else throw new xe("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+n+ge.repeat("0",r-t.length)+t}var _a=1,Ot=2;function wa(e){this.schema=e.schema||On,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=ge.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=ma(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?Ot:_a,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function tr(e,t){for(var n=ge.repeat(" ",t),r=0,i=-1,o="",l,a=e.length;r<a;)i=e.indexOf(`
18
+ `,r),i===-1?(l=e.slice(r),r=a):(l=e.slice(r,i+1),r=i+1),l.length&&l!==`
19
+ `&&(o+=n),o+=l;return o}function mn(e,t){return`
20
+ `+ge.repeat(" ",e.indent*t)}function ba(e,t){var n,r,i;for(n=0,r=e.implicitTypes.length;n<r;n+=1)if(i=e.implicitTypes[n],i.resolve(t))return!0;return!1}function Wt(e){return e===Jl||e===Ql}function Dt(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==Hn||65536<=e&&e<=1114111}function nr(e){return Dt(e)&&e!==Hn&&e!==Xl&&e!==Mt}function rr(e,t,n){var r=nr(e),i=r&&!Wt(e);return(n?r:r&&e!==Si&&e!==xi&&e!==Li&&e!==Ti&&e!==Mi)&&e!==hn&&!(t===Gt&&!i)||nr(t)&&!Wt(t)&&e===hn||t===Gt&&i}function va(e){return Dt(e)&&e!==Hn&&!Wt(e)&&e!==la&&e!==sa&&e!==Gt&&e!==Si&&e!==xi&&e!==Li&&e!==Ti&&e!==Mi&&e!==hn&&e!==ra&&e!==oa&&e!==ea&&e!==da&&e!==aa&&e!==ca&&e!==ia&&e!==ta&&e!==na&&e!==ua&&e!==fa}function ya(e){return!Wt(e)&&e!==Gt}function St(e,t){var n=e.charCodeAt(t),r;return n>=55296&&n<=56319&&t+1<e.length&&(r=e.charCodeAt(t+1),r>=56320&&r<=57343)?(n-55296)*1024+r-56320+65536:n}function Oi(e){var t=/^\n* /;return t.test(e)}var Di=1,gn=2,Fi=3,Hi=4,_t=5;function ka(e,t,n,r,i,o,l,a){var c,s=0,u=null,f=!1,d=!1,p=r!==-1,m=-1,g=va(St(e,0))&&ya(St(e,e.length-1));if(t||l)for(c=0;c<e.length;s>=65536?c+=2:c++){if(s=St(e,c),!Dt(s))return _t;g=g&&rr(s,u,a),u=s}else{for(c=0;c<e.length;s>=65536?c+=2:c++){if(s=St(e,c),s===Mt)f=!0,p&&(d=d||c-m-1>r&&e[m+1]!==" ",m=c);else if(!Dt(s))return _t;g=g&&rr(s,u,a),u=s}d=d||p&&c-m-1>r&&e[m+1]!==" "}return!f&&!d?g&&!l&&!i(e)?Di:o===Ot?_t:gn:n>9&&Oi(e)?_t:l?o===Ot?_t:gn:d?Hi:Fi}function Aa(e,t,n,r,i){e.dump=function(){if(t.length===0)return e.quotingType===Ot?'""':"''";if(!e.noCompatMode&&(pa.indexOf(t)!==-1||ha.test(t)))return e.quotingType===Ot?'"'+t+'"':"'"+t+"'";var o=e.indent*Math.max(1,n),l=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-o),a=r||e.flowLevel>-1&&n>=e.flowLevel;function c(s){return ba(e,s)}switch(ka(t,a,e.indent,l,c,e.quotingType,e.forceQuotes&&!r,i)){case Di:return t;case gn:return"'"+t.replace(/'/g,"''")+"'";case Fi:return"|"+ir(t,e.indent)+or(tr(t,o));case Hi:return">"+ir(t,e.indent)+or(tr(Ea(t,l),o));case _t:return'"'+Ca(t)+'"';default:throw new xe("impossible error: invalid scalar style")}}()}function ir(e,t){var n=Oi(e)?String(t):"",r=e[e.length-1]===`
21
21
  `,i=r&&(e[e.length-2]===`
22
22
  `||e===`
23
- `),l=i?"+":r?"":"-";return n+l+`
24
- `}function lr(e){return e[e.length-1]===`
23
+ `),o=i?"+":r?"":"-";return n+o+`
24
+ `}function or(e){return e[e.length-1]===`
25
25
  `?e.slice(0,-1):e}function Ea(e,t){for(var n=/(\n+)([^\n]*)/g,r=function(){var s=e.indexOf(`
26
- `);return s=s!==-1?s:e.length,n.lastIndex=s,or(e.slice(0,s),t)}(),i=e[0]===`
27
- `||e[0]===" ",l,o;o=n.exec(e);){var a=o[1],c=o[2];l=c[0]===" ",r+=a+(!i&&!l&&c!==""?`
28
- `:"")+or(c,t),i=l}return r}function or(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,r,i=0,l,o=0,a=0,c="";r=n.exec(e);)a=r.index,a-i>t&&(l=o>i?o:a,c+=`
29
- `+e.slice(i,l),i=l+1),o=a;return c+=`
30
- `,e.length-i>t&&o>i?c+=e.slice(i,o)+`
31
- `+e.slice(o+1):c+=e.slice(i),c.slice(1)}function Ca(e){for(var t="",n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=xt(e,i),r=Se[n],!r&&Ft(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||ga(n);return t}function Sa(e,t,n){var r="",i=e.tag,l,o,a;for(l=0,o=n.length;l<o;l+=1)a=n[l],e.replacer&&(a=e.replacer.call(n,String(l),a)),(Ze(e,t,a,!1,!1)||typeof a>"u"&&Ze(e,t,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function ar(e,t,n,r){var i="",l=e.tag,o,a,c;for(o=0,a=n.length;o<a;o+=1)c=n[o],e.replacer&&(c=e.replacer.call(n,String(o),c)),(Ze(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&Ze(e,t+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=mn(e,t)),e.dump&&Ot===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=l,e.dump=i||"[]"}function xa(e,t,n){var r="",i=e.tag,l=Object.keys(n),o,a,c,s,f;for(o=0,a=l.length;o<a;o+=1)f="",r!==""&&(f+=", "),e.condenseFlow&&(f+='"'),c=l[o],s=n[c],e.replacer&&(s=e.replacer.call(n,c,s)),Ze(e,t,c,!1,!1)&&(e.dump.length>1024&&(f+="? "),f+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ze(e,t,s,!1,!1)&&(f+=e.dump,r+=f));e.tag=i,e.dump="{"+r+"}"}function La(e,t,n,r){var i="",l=e.tag,o=Object.keys(n),a,c,s,f,u,d;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new Le("sortKeys must be a boolean or a function");for(a=0,c=o.length;a<c;a+=1)d="",(!r||i!=="")&&(d+=mn(e,t)),s=o[a],f=n[s],e.replacer&&(f=e.replacer.call(n,s,f)),Ze(e,t+1,s,!0,!0,!0)&&(u=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,u&&(e.dump&&Ot===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,u&&(d+=mn(e,t)),Ze(e,t+1,f,!0,u)&&(e.dump&&Ot===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,i+=d));e.tag=l,e.dump=i||"{}"}function cr(e,t,n){var r,i,l,o,a,c;for(i=n?e.explicitTypes:e.implicitTypes,l=0,o=i.length;l<o;l+=1)if(a=i[l],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(n?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(c=e.styleMap[a.tag]||a.defaultStyle,Ei.call(a.represent)==="[object Function]")r=a.represent(t,c);else if(Ci.call(a.represent,c))r=a.represent[c](t,c);else throw new Le("!<"+a.tag+'> tag resolver accepts not "'+c+'" style');e.dump=r}return!0}return!1}function Ze(e,t,n,r,i,l,o){e.tag=null,e.dump=n,cr(e,n,!1)||cr(e,n,!0);var a=Ei.call(e.dump),c=r,s;r&&(r=e.flowLevel<0||e.flowLevel>t);var f=a==="[object Object]"||a==="[object Array]",u,d;if(f&&(u=e.duplicates.indexOf(n),d=u!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&t>0)&&(i=!1),d&&e.usedDuplicates[u])e.dump="*ref_"+u;else{if(f&&d&&!e.usedDuplicates[u]&&(e.usedDuplicates[u]=!0),a==="[object Object]")r&&Object.keys(e.dump).length!==0?(La(e,t,e.dump,i),d&&(e.dump="&ref_"+u+e.dump)):(xa(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if(a==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!o&&t>0?ar(e,t-1,e.dump,i):ar(e,t,e.dump,i),d&&(e.dump="&ref_"+u+e.dump)):(Sa(e,t,e.dump),d&&(e.dump="&ref_"+u+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&Aa(e,e.dump,t,l,c);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new Le("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(s=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?s="!"+s:s.slice(0,18)==="tag:yaml.org,2002:"?s="!!"+s.slice(18):s="!<"+s+">",e.dump=s+" "+e.dump)}return!0}function Ta(e,t){var n=[],r=[],i,l;for(_n(e,n,r),i=0,l=r.length;i<l;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(l)}function _n(e,t,n){var r,i,l;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,l=e.length;i<l;i+=1)_n(e[i],t,n);else for(r=Object.keys(e),i=0,l=r.length;i<l;i+=1)_n(e[r[i]],t,n)}function Ma(e,t){t=t||{};var n=new wa(t);n.noRefs||Ta(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),Ze(n,0,r,!0,!0)?n.dump+`
32
- `:""}var Oa=Ma,Da={dump:Oa};function In(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var Fa=be,Ha=Kr,Ia=ei,Na=li,Ra=oi,Pa=On,$a=Ai.load,ja=Ai.loadAll,Va=Da.dump,qa=Le,Ya={binary:fi,float:ii,map:Jr,null:ti,pairs:pi,set:hi,timestamp:si,bool:ni,int:ri,merge:ui,omap:di,seq:Qr,str:Xr},Ua=In("safeLoad","load"),Ba=In("safeLoadAll","loadAll"),Ga=In("safeDump","dump"),Qt={Type:Fa,Schema:Ha,FAILSAFE_SCHEMA:Ia,JSON_SCHEMA:Na,CORE_SCHEMA:Ra,DEFAULT_SCHEMA:Pa,load:$a,loadAll:ja,dump:Va,YAMLException:qa,types:Ya,safeLoad:Ua,safeLoadAll:Ba,safeDump:Ga};const $e=tt(),Fe=tt(),we=tt({}),Ve=tt(),Ce=Wr(null,e=>(Wa().then(e).catch(t=>console.error("Failed to load config.",t)),()=>{})),Nn=Sl(Ce,(e,t)=>{const n=e==null?void 0:e.custom_actions;return n?(za(n).then(t).catch(r=>console.error("Failed to load cms actions.",r)),()=>{}):null});async function Wa(){const e=new URL("../../cms-config/config.yml",window.location.href).href,t=await fetch(e);if(!t.ok)throw new Error(`Unable to fetch file ${e}`);return Qt.load(await t.text())}async function za(e){const t=`../../cms-config/${e}`;return(await import(new URL(t,window.location.href).href)).default}function Za(e){let t,n,r,i,l,o,a,c,s,f,u,d,p;return{c(){t=k("nav"),n=k("ul"),r=k("li"),i=k("a"),l=q(),o=k("li"),a=k("a"),c=q(),s=k("ul"),f=k("li"),u=k("a"),m(i,"href","##posts"),m(i,"data-tooltip","Posts"),m(i,"data-placement","bottom"),m(a,"href","##media"),m(a,"data-tooltip","Media Files"),m(a,"data-placement","bottom"),m(u,"href","##exit"),m(u,"class","secondary"),m(u,"data-tooltip","Exit"),m(u,"data-placement","bottom")},m(g,h){N(g,t,h),w(t,n),w(n,r),w(r,i),i.innerHTML=Al,w(n,l),w(n,o),w(o,a),a.innerHTML=El,w(t,c),w(t,s),w(s,f),w(f,u),u.innerHTML=Cl,d||(p=[Z(i,"click",Ue(e[0])),Z(a,"click",Ue(e[0])),Z(u,"click",Ue(e[1]))],d=!0)},p:b,i:b,o:b,d(g){g&&H(t),d=!1,ue(p)}}}function Ka(e,t,n){let r,i;W(e,Ve,c=>n(2,r=c)),W(e,Nn,c=>n(3,i=c));const l=Kt();function o(c){const s=new URL(c.currentTarget.href).hash.replaceAll("#","");l("selectview",s),c.currentTarget.blur()}async function a(){i!=null&&i.onLogout&&await i.onLogout(),r!=null&&r.logout?await r.logout():history.back()}return[o,a]}class Xa extends ce{constructor(t){super(),ae(this,t,Ka,Za,ie,{})}}const Qa='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>text-box-edit</title><path d="M10 19.11L12.11 17H7V15H14V15.12L16.12 13H7V11H17V12.12L18.24 10.89C18.72 10.41 19.35 10.14 20.04 10.14C20.37 10.14 20.7 10.21 21 10.33V5C21 3.89 20.1 3 19 3H5C3.89 3 3 3.89 3 5V19C3 20.11 3.9 21 5 21H10V19.11M7 7H17V9H7V7M21.7 14.35L20.7 15.35L18.65 13.3L19.65 12.3C19.86 12.09 20.21 12.09 20.42 12.3L21.7 13.58C21.91 13.79 21.91 14.14 21.7 14.35M12 19.94L18.06 13.88L20.11 15.93L14.06 22H12V19.94Z" /></svg>';function Ja(e){let t,n,r,i,l,o;return{c(){t=k("li"),n=k("a"),r=new ze(!1),i=ee(e[0]),r.a=i,m(n,"href","##placeholder"),m(n,"class","collectionNav svelte-1r1578h"),Vt(n,"selected",e[1]),m(t,"class","svelte-1r1578h")},m(a,c){N(a,t,c),w(t,n),r.m(Qa,n),w(n,i),l||(o=Z(n,"click",Ue(e[2])),l=!0)},p(a,[c]){c&1&&_e(i,a[0]),c&2&&Vt(n,"selected",a[1])},i:b,o:b,d(a){a&&H(t),l=!1,o()}}}function ec(e,t,n){let r,i,l;W(e,Ce,s=>n(5,i=s)),W(e,$e,s=>n(4,l=s));let{name:o}=t,{label:a}=t;function c(){he($e,l=i.collections.find(s=>s.name===o),l)}return e.$$set=s=>{"name"in s&&n(3,o=s.name),"label"in s&&n(0,a=s.label)},e.$$.update=()=>{e.$$.dirty&24&&n(1,r=(l==null?void 0:l.name)===o?"selected":"")},[a,r,c,o,l]}class tc extends ce{constructor(t){super(),ae(this,t,ec,Ja,ie,{name:3,label:0})}}var Ii=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ni(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ri={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Ii,function(){var n=1e3,r=6e4,i=36e5,l="millisecond",o="second",a="minute",c="hour",s="day",f="week",u="month",d="quarter",p="year",g="date",h="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,A=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,E={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(O){var y=["th","st","nd","rd"],_=O%100;return"["+O+(y[(_-20)%10]||y[_]||y[0])+"]"}},T=function(O,y,_){var x=String(O);return!x||x.length>=y?O:""+Array(y+1-x.length).join(_)+O},j={s:T,z:function(O){var y=-O.utcOffset(),_=Math.abs(y),x=Math.floor(_/60),L=_%60;return(y<=0?"+":"-")+T(x,2,"0")+":"+T(L,2,"0")},m:function O(y,_){if(y.date()<_.date())return-O(_,y);var x=12*(_.year()-y.year())+(_.month()-y.month()),L=y.clone().add(x,u),$=_-L<0,G=y.clone().add(x+($?-1:1),u);return+(-(x+(_-L)/($?L-G:G-L))||0)},a:function(O){return O<0?Math.ceil(O)||0:Math.floor(O)},p:function(O){return{M:u,y:p,w:f,d:s,D:g,h:c,m:a,s:o,ms:l,Q:d}[O]||String(O||"").toLowerCase().replace(/s$/,"")},u:function(O){return O===void 0}},D="en",R={};R[D]=E;var F="$isDayjsObject",C=function(O){return O instanceof B||!(!O||!O[F])},P=function O(y,_,x){var L;if(!y)return D;if(typeof y=="string"){var $=y.toLowerCase();R[$]&&(L=$),_&&(R[$]=_,L=$);var G=y.split("-");if(!L&&G.length>1)return O(G[0])}else{var Q=y.name;R[Q]=y,L=Q}return!x&&L&&(D=L),L||!x&&D},M=function(O,y){if(C(O))return O.clone();var _=typeof y=="object"?y:{};return _.date=O,_.args=arguments,new B(_)},S=j;S.l=P,S.i=C,S.w=function(O,y){return M(O,{locale:y.$L,utc:y.$u,x:y.$x,$offset:y.$offset})};var B=function(){function O(_){this.$L=P(_.locale,null,!0),this.parse(_),this.$x=this.$x||_.x||{},this[F]=!0}var y=O.prototype;return y.parse=function(_){this.$d=function(x){var L=x.date,$=x.utc;if(L===null)return new Date(NaN);if(S.u(L))return new Date;if(L instanceof Date)return new Date(L);if(typeof L=="string"&&!/Z$/i.test(L)){var G=L.match(v);if(G){var Q=G[2]-1||0,ne=(G[7]||"0").substring(0,3);return $?new Date(Date.UTC(G[1],Q,G[3]||1,G[4]||0,G[5]||0,G[6]||0,ne)):new Date(G[1],Q,G[3]||1,G[4]||0,G[5]||0,G[6]||0,ne)}}return new Date(L)}(_),this.init()},y.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},y.$utils=function(){return S},y.isValid=function(){return this.$d.toString()!==h},y.isSame=function(_,x){var L=M(_);return this.startOf(x)<=L&&L<=this.endOf(x)},y.isAfter=function(_,x){return M(_)<this.startOf(x)},y.isBefore=function(_,x){return this.endOf(x)<M(_)},y.$g=function(_,x,L){return S.u(_)?this[x]:this.set(L,_)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(_,x){var L=this,$=!!S.u(x)||x,G=S.p(_),Q=function(De,de){var xe=S.w(L.$u?Date.UTC(L.$y,de,De):new Date(L.$y,de,De),L);return $?xe:xe.endOf(s)},ne=function(De,de){return S.w(L.toDate()[De].apply(L.toDate("s"),($?[0,0,0,0]:[23,59,59,999]).slice(de)),L)},le=this.$W,fe=this.$M,Ae=this.$D,qe="set"+(this.$u?"UTC":"");switch(G){case p:return $?Q(1,0):Q(31,11);case u:return $?Q(1,fe):Q(0,fe+1);case f:var He=this.$locale().weekStart||0,Ne=(le<He?le+7:le)-He;return Q($?Ae-Ne:Ae+(6-Ne),fe);case s:case g:return ne(qe+"Hours",0);case c:return ne(qe+"Minutes",1);case a:return ne(qe+"Seconds",2);case o:return ne(qe+"Milliseconds",3);default:return this.clone()}},y.endOf=function(_){return this.startOf(_,!1)},y.$set=function(_,x){var L,$=S.p(_),G="set"+(this.$u?"UTC":""),Q=(L={},L[s]=G+"Date",L[g]=G+"Date",L[u]=G+"Month",L[p]=G+"FullYear",L[c]=G+"Hours",L[a]=G+"Minutes",L[o]=G+"Seconds",L[l]=G+"Milliseconds",L)[$],ne=$===s?this.$D+(x-this.$W):x;if($===u||$===p){var le=this.clone().set(g,1);le.$d[Q](ne),le.init(),this.$d=le.set(g,Math.min(this.$D,le.daysInMonth())).$d}else Q&&this.$d[Q](ne);return this.init(),this},y.set=function(_,x){return this.clone().$set(_,x)},y.get=function(_){return this[S.p(_)]()},y.add=function(_,x){var L,$=this;_=Number(_);var G=S.p(x),Q=function(fe){var Ae=M($);return S.w(Ae.date(Ae.date()+Math.round(fe*_)),$)};if(G===u)return this.set(u,this.$M+_);if(G===p)return this.set(p,this.$y+_);if(G===s)return Q(1);if(G===f)return Q(7);var ne=(L={},L[a]=r,L[c]=i,L[o]=n,L)[G]||1,le=this.$d.getTime()+_*ne;return S.w(le,this)},y.subtract=function(_,x){return this.add(-1*_,x)},y.format=function(_){var x=this,L=this.$locale();if(!this.isValid())return L.invalidDate||h;var $=_||"YYYY-MM-DDTHH:mm:ssZ",G=S.z(this),Q=this.$H,ne=this.$m,le=this.$M,fe=L.weekdays,Ae=L.months,qe=L.meridiem,He=function(de,xe,Re,Ye){return de&&(de[xe]||de(x,$))||Re[xe].slice(0,Ye)},Ne=function(de){return S.s(Q%12||12,de,"0")},De=qe||function(de,xe,Re){var Ye=de<12?"AM":"PM";return Re?Ye.toLowerCase():Ye};return $.replace(A,function(de,xe){return xe||function(Re){switch(Re){case"YY":return String(x.$y).slice(-2);case"YYYY":return S.s(x.$y,4,"0");case"M":return le+1;case"MM":return S.s(le+1,2,"0");case"MMM":return He(L.monthsShort,le,Ae,3);case"MMMM":return He(Ae,le);case"D":return x.$D;case"DD":return S.s(x.$D,2,"0");case"d":return String(x.$W);case"dd":return He(L.weekdaysMin,x.$W,fe,2);case"ddd":return He(L.weekdaysShort,x.$W,fe,3);case"dddd":return fe[x.$W];case"H":return String(Q);case"HH":return S.s(Q,2,"0");case"h":return Ne(1);case"hh":return Ne(2);case"a":return De(Q,ne,!0);case"A":return De(Q,ne,!1);case"m":return String(ne);case"mm":return S.s(ne,2,"0");case"s":return String(x.$s);case"ss":return S.s(x.$s,2,"0");case"SSS":return S.s(x.$ms,3,"0");case"Z":return G}return null}(de)||G.replace(":","")})},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(_,x,L){var $,G=this,Q=S.p(x),ne=M(_),le=(ne.utcOffset()-this.utcOffset())*r,fe=this-ne,Ae=function(){return S.m(G,ne)};switch(Q){case p:$=Ae()/12;break;case u:$=Ae();break;case d:$=Ae()/3;break;case f:$=(fe-le)/6048e5;break;case s:$=(fe-le)/864e5;break;case c:$=fe/i;break;case a:$=fe/r;break;case o:$=fe/n;break;default:$=fe}return L?$:S.a($)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return R[this.$L]},y.locale=function(_,x){if(!_)return this.$L;var L=this.clone(),$=P(_,x,!0);return $&&(L.$L=$),L},y.clone=function(){return S.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},O}(),z=B.prototype;return M.prototype=z,[["$ms",l],["$s",o],["$m",a],["$H",c],["$W",s],["$M",u],["$y",p],["$D",g]].forEach(function(O){z[O[1]]=function(y){return this.$g(y,O[0],O[1])}}),M.extend=function(O,y){return O.$i||(O(y,B,M),O.$i=!0),M},M.locale=P,M.isDayjs=C,M.unix=function(O){return M(1e3*O)},M.en=R[D],M.Ls=R,M.p={},M})})(Ri);var nc=Ri.exports;const Te=Ni(nc);function rc(e){let t,n,r,i,l,o=e[0].fields.title+"",a,c,s,f,u,d,p;return{c(){t=k("div"),n=k("input"),r=q(),i=k("a"),l=k("div"),a=ee(o),c=q(),s=k("div"),s.textContent=`${e[2]}`,f=q(),u=k("div"),u.textContent=`${e[3]}`,m(n,"type","checkbox"),m(n,"name","entry-select"),m(l,"class","entry-name svelte-fj87yn"),m(s,"class","entry-status svelte-fj87yn"),m(u,"class","entry-date svelte-fj87yn"),m(i,"href","#/editor"),m(i,"class","entry-info svelte-fj87yn"),m(t,"class","item svelte-fj87yn")},m(g,h){N(g,t,h),w(t,n),w(t,r),w(t,i),w(i,l),w(l,a),w(i,c),w(i,s),w(i,f),w(i,u),d||(p=[Z(n,"change",e[4]),Z(i,"click",e[5])],d=!0)},p(g,[h]){h&1&&o!==(o=g[0].fields.title+"")&&_e(a,o)},i:b,o:b,d(g){g&&H(t),d=!1,ue(p)}}}function ic(e,t,n){let r,i,l;W(e,Fe,d=>n(6,r=d)),W(e,we,d=>n(7,i=d));const o=xn("selectedEntries");W(e,o,d=>n(8,l=d));let{entry:a}=t,c=a.fields.draft?"draft":"published",s=Te(a.fields.date).format("MM/DD/YY");function f(d){d.target.checked?he(o,l=[...l,a],l):he(o,l=l.filter(p=>p!==a),l)}function u(d){he(we,i={},i),he(Fe,r=a,r)}return e.$$set=d=>{"entry"in d&&n(0,a=d.entry)},[a,o,c,s,f,u]}class lc extends ce{constructor(t){super(),ae(this,t,ic,rc,ie,{entry:0})}}function sr(e){let t,n;return{c(){t=k("div"),n=ee(e[0])},m(r,i){N(r,t,i),w(t,n)},p(r,i){i&1&&_e(n,r[0])},d(r){r&&H(t)}}}function oc(e){let t,n,r,i=e[0]&&sr(e);return{c(){t=k("div"),n=k("div"),r=q(),i&&i.c(),m(n,"aria-busy","true"),m(t,"class","toast")},m(l,o){N(l,t,o),w(t,n),w(t,r),i&&i.m(t,null)},p(l,[o]){l[0]?i?i.p(l,o):(i=sr(l),i.c(),i.m(t,null)):i&&(i.d(1),i=null)},i:b,o:b,d(l){l&&H(t),i&&i.d()}}}function ac(e,t,n){let{msg:r=null}=t;return e.$$set=i=>{"msg"in i&&n(0,r=i.msg)},[r]}class Jt extends ce{constructor(t){super(),ae(this,t,ac,oc,ie,{msg:0})}}const cc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>alert</title><path d="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z" /></svg>';function sc(e){let t,n,r,i,l,o,a,c;return{c(){t=k("div"),n=new ze(!1),r=q(),i=k("details"),l=k("summary"),o=ee(e[0]),a=q(),c=ee(e[1]),n.a=r,m(i,"class","svelte-1pbztc4"),m(t,"class","toast warning")},m(s,f){N(s,t,f),n.m(cc,t),w(t,r),w(t,i),w(i,l),w(l,o),w(i,a),w(i,c)},p(s,[f]){f&1&&_e(o,s[0]),f&2&&_e(c,s[1])},i:b,o:b,d(s){s&&H(t)}}}function uc(e,t,n){let{msg:r}=t,{details:i}=t;return e.$$set=l=>{"msg"in l&&n(0,r=l.msg),"details"in l&&n(1,i=l.details)},[r,i]}class Ke extends ce{constructor(t){super(),ae(this,t,uc,sc,ie,{msg:0,details:1})}}const Pi='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>trash-can-outline</title><path d="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" /></svg>',$i='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>pencil</title><path d="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z" /></svg>';function ur(e,t,n){const r=e.slice();return r[14]=t[n],r}function fc(e){let t,n=[],r=new Map,i,l=Ee(e[3]);const o=a=>a[14].name;for(let a=0;a<l.length;a+=1){let c=ur(e,l,a),s=o(c);r.set(s,n[a]=fr(s,c))}return{c(){t=k("div");for(let a=0;a<n.length;a+=1)n[a].c();m(t,"id","items"),m(t,"class","svelte-14m9h86")},m(a,c){N(a,t,c);for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(t,null);i=!0},p(a,c){c&8&&(l=Ee(a[3]),ye(),n=Ht(n,c,o,1,a,l,r,t,Tn,fr,null,ur),ke())},i(a){if(!i){for(let c=0;c<l.length;c+=1)I(n[c]);i=!0}},o(a){for(let c=0;c<n.length;c+=1)V(n[c]);i=!1},d(a){a&&H(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function dc(e){let t,n,r,i,l,o,a,c;return{c(){t=k("div"),n=k("p"),n.textContent="This collection has no entries.",r=q(),i=k("button"),l=new ze(!1),o=ee("Create New Entry"),l.a=o,m(i,"class","svelte-14m9h86"),m(t,"id","empty"),m(t,"class","svelte-14m9h86")},m(s,f){N(s,t,f),w(t,n),w(t,r),w(t,i),l.m($i,i),w(i,o),a||(c=Z(i,"click",e[6]),a=!0)},p:b,i:b,o:b,d(s){s&&H(t),a=!1,c()}}}function fr(e,t){let n,r,i;return r=new lc({props:{entry:t[14]}}),{key:e,first:null,c(){n=Oe(),J(r.$$.fragment),this.first=n},m(l,o){N(l,n,o),K(r,l,o),i=!0},p(l,o){t=l;const a={};o&8&&(a.entry=t[14]),r.$set(a)},i(l){i||(I(r.$$.fragment,l),i=!0)},o(l){V(r.$$.fragment,l),i=!1},d(l){l&&H(n),X(r,l)}}}function pc(e){let t,n;return t=new Ke({props:{msg:"Error getting entries",details:e[13].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&2&&(l.details=r[13].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function hc(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function mc(e){let t,n;return t=new Jt({props:{msg:"Loading"}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:b,i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function gc(e){let t,n;return t=new Ke({props:{msg:"'On delete' event action failed",details:e[13].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&4&&(l.details=r[13].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function _c(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function wc(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function bc(e){var O;let t,n,r=(((O=e[0])==null?void 0:O.label)||"")+"",i,l,o,a,c,s,f,u,d,p,g,h,v,A,E,T,j,D,R,F,C;const P=[dc,fc],M=[];function S(y,_){return y[3].length===0?0:1}v=S(e),A=M[v]=P[v](e);let B={ctx:e,current:null,token:null,hasCatch:!0,pending:mc,then:hc,catch:pc,error:13,blocks:[,,,]};se(T=e[1],B);let z={ctx:e,current:null,token:null,hasCatch:!0,pending:wc,then:_c,catch:gc,error:13,blocks:[,,,]};return se(D=e[2],z),{c(){t=k("main"),n=k("header"),i=ee(r),l=q(),o=k("div"),a=k("button"),c=new ze(!1),s=ee("Delete"),u=q(),d=k("button"),p=new ze(!1),g=ee("New"),h=q(),A.c(),E=q(),B.block.c(),j=q(),z.block.c(),c.a=s,m(a,"class","outline svelte-14m9h86"),a.disabled=f=e[4].length===0,p.a=g,m(d,"class","svelte-14m9h86"),m(o,"id","listActions"),m(o,"class","svelte-14m9h86"),m(n,"class","svelte-14m9h86"),m(t,"class","svelte-14m9h86")},m(y,_){N(y,t,_),w(t,n),w(n,i),w(n,l),w(n,o),w(o,a),c.m(Pi,a),w(a,s),w(o,u),w(o,d),p.m($i,d),w(d,g),w(t,h),M[v].m(t,null),w(t,E),B.block.m(t,B.anchor=null),B.mount=()=>t,B.anchor=j,w(t,j),z.block.m(t,z.anchor=null),z.mount=()=>t,z.anchor=null,R=!0,F||(C=[Z(a,"click",e[7]),Z(d,"click",e[6])],F=!0)},p(y,[_]){var L;e=y,(!R||_&1)&&r!==(r=(((L=e[0])==null?void 0:L.label)||"")+"")&&_e(i,r),(!R||_&16&&f!==(f=e[4].length===0))&&(a.disabled=f);let x=v;v=S(e),v===x?M[v].p(e,_):(ye(),V(M[x],1,1,()=>{M[x]=null}),ke(),A=M[v],A?A.p(e,_):(A=M[v]=P[v](e),A.c()),I(A,1),A.m(t,E)),B.ctx=e,_&2&&T!==(T=e[1])&&se(T,B)||Pe(B,e,_),z.ctx=e,_&4&&D!==(D=e[2])&&se(D,z)||Pe(z,e,_)},i(y){R||(I(A),I(B.block),I(z.block),R=!0)},o(y){V(A);for(let _=0;_<3;_+=1){const x=B.blocks[_];V(x)}for(let _=0;_<3;_+=1){const x=z.blocks[_];V(x)}R=!1},d(y){y&&H(t),M[v].d(),B.block.d(),B.token=null,B=null,z.block.d(),z.token=null,z=null,F=!1,ue(C)}}}function vc(e,t,n){let r,i,l,o,a,c;W(e,Nn,v=>n(9,i=v)),W(e,Ve,v=>n(8,l=v)),W(e,we,v=>n(10,o=v)),W(e,Fe,v=>n(11,a=v)),W(e,$e,v=>n(0,c=v));const s=tt([]);W(e,s,v=>n(4,r=v)),Sn("selectedEntries",s);let f,u,d=[];async function p(v){try{n(1,f=l==null?void 0:l.getFiles(c==null?void 0:c.name)),n(3,d=await f||[])}catch{}}function g(){he(Fe,a=null,a),he(we,o={},o),window.location.hash="#/editor"}async function h(){try{await l.deleteFiles(r),i!=null&&i.onDelete&&(n(2,u=i.onDelete(r)),await u),he(s,r=[],r),p()}catch(v){console.error("Error deleting files",v)}}return e.$$.update=()=>{e.$$.dirty&257&&p()},[c,f,u,d,r,s,g,h,l]}class yc extends ce{constructor(t){super(),ae(this,t,vc,bc,ie,{})}}function kc(e){let t,n,r,i,l,o,a,c,s=e[0].name+"",f,u,d;return{c(){t=k("div"),n=k("input"),r=q(),i=k("img"),a=q(),c=k("small"),f=ee(s),m(n,"type","checkbox"),m(n,"name","media-select"),m(n,"class","svelte-9g6man"),jt(i.src,l=e[0].url_preview)||m(i,"src",l),m(i,"alt",o=e[0].alt),m(i,"loading","lazy"),m(i,"crossorigin","use-credentials"),m(i,"class","svelte-9g6man"),m(c,"class","svelte-9g6man"),m(t,"class","svelte-9g6man")},m(p,g){N(p,t,g),w(t,n),w(t,r),w(t,i),w(t,a),w(t,c),w(c,f),u||(d=Z(n,"change",e[2]),u=!0)},p(p,[g]){g&1&&!jt(i.src,l=p[0].url_preview)&&m(i,"src",l),g&1&&o!==(o=p[0].alt)&&m(i,"alt",o),g&1&&s!==(s=p[0].name+"")&&_e(f,s)},i:b,o:b,d(p){p&&H(t),u=!1,d()}}}function Ac(e,t,n){let r;const i=xn("selectedMediaFiles");W(e,i,a=>n(3,r=a));let{media:l}=t;function o(a){a.target.checked?he(i,r=[...r,l],r):he(i,r=r.filter(c=>c!==l),r)}return e.$$set=a=>{"media"in a&&n(0,l=a.media)},[l,i,o]}class Ec extends ce{constructor(t){super(),ae(this,t,Ac,kc,ie,{media:0})}}const ji='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>file-upload</title><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M13.5,16V19H10.5V16H8L12,12L16,16H13.5M13,9V3.5L18.5,9H13Z" /></svg>';function dr(e,t,n){const r=e.slice();return r[9]=t[n],r}function Cc(e){let t,n=[],r=new Map,i,l=Ee(e[1]);const o=a=>a[9].name;for(let a=0;a<l.length;a+=1){let c=dr(e,l,a),s=o(c);r.set(s,n[a]=pr(s,c))}return{c(){t=k("div");for(let a=0;a<n.length;a+=1)n[a].c();m(t,"id","items"),m(t,"class","svelte-12p8acg")},m(a,c){N(a,t,c);for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(t,null);i=!0},p(a,c){c&2&&(l=Ee(a[1]),ye(),n=Ht(n,c,o,1,a,l,r,t,Tn,pr,null,dr),ke())},i(a){if(!i){for(let c=0;c<l.length;c+=1)I(n[c]);i=!0}},o(a){for(let c=0;c<n.length;c+=1)V(n[c]);i=!1},d(a){a&&H(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function Sc(e){let t,n,r,i,l,o,a,c;return{c(){t=k("div"),n=k("p"),n.textContent="No files found.",r=q(),i=k("button"),l=new ze(!1),o=ee("Upload a File"),l.a=o,m(i,"class","svelte-12p8acg"),m(t,"id","empty"),m(t,"class","svelte-12p8acg")},m(s,f){N(s,t,f),w(t,n),w(t,r),w(t,i),l.m(ji,i),w(i,o),a||(c=Z(i,"click",e[4]),a=!0)},p:b,i:b,o:b,d(s){s&&H(t),a=!1,c()}}}function pr(e,t){let n,r,i;return r=new Ec({props:{media:t[9]}}),{key:e,first:null,c(){n=Oe(),J(r.$$.fragment),this.first=n},m(l,o){N(l,n,o),K(r,l,o),i=!0},p(l,o){t=l;const a={};o&2&&(a.media=t[9]),r.$set(a)},i(l){i||(I(r.$$.fragment,l),i=!0)},o(l){V(r.$$.fragment,l),i=!1},d(l){l&&H(n),X(r,l)}}}function xc(e){let t,n;return t=new Ke({props:{msg:"Error getting entries",details:e[8].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&1&&(l.details=r[8].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Lc(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Tc(e){let t,n;return t=new Jt({props:{msg:"Loading"}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:b,i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Mc(e){let t,n,r,i,l,o,a,c,s,f,u,d,p,g,h,v,A,E,T,j;const D=[Sc,Cc],R=[];function F(P,M){return P[1].length===0?0:1}g=F(e),h=R[g]=D[g](e);let C={ctx:e,current:null,token:null,hasCatch:!0,pending:Tc,then:Lc,catch:xc,error:8,blocks:[,,,]};return se(A=e[0],C),{c(){t=k("main"),n=k("header"),r=ee(`Media Files
33
- `),i=k("div"),l=k("button"),o=new ze(!1),a=ee("Delete"),s=q(),f=k("button"),u=new ze(!1),d=ee("Upload"),p=q(),h.c(),v=q(),C.block.c(),o.a=a,m(l,"class","outline svelte-12p8acg"),l.disabled=c=e[2].length===0,u.a=d,m(f,"class","svelte-12p8acg"),m(i,"id","listActions"),m(i,"class","svelte-12p8acg"),m(n,"class","svelte-12p8acg"),m(t,"class","svelte-12p8acg")},m(P,M){N(P,t,M),w(t,n),w(n,r),w(n,i),w(i,l),o.m(Pi,l),w(l,a),w(i,s),w(i,f),u.m(ji,f),w(f,d),w(t,p),R[g].m(t,null),w(t,v),C.block.m(t,C.anchor=null),C.mount=()=>t,C.anchor=null,E=!0,T||(j=[Z(l,"click",e[5]),Z(f,"click",e[4])],T=!0)},p(P,[M]){e=P,(!E||M&4&&c!==(c=e[2].length===0))&&(l.disabled=c);let S=g;g=F(e),g===S?R[g].p(e,M):(ye(),V(R[S],1,1,()=>{R[S]=null}),ke(),h=R[g],h?h.p(e,M):(h=R[g]=D[g](e),h.c()),I(h,1),h.m(t,v)),C.ctx=e,M&1&&A!==(A=e[0])&&se(A,C)||Pe(C,e,M)},i(P){E||(I(h),I(C.block),E=!0)},o(P){V(h);for(let M=0;M<3;M+=1){const S=C.blocks[M];V(S)}E=!1},d(P){P&&H(t),R[g].d(),C.block.d(),C.token=null,C=null,T=!1,ue(j)}}}function Oc(e,t,n){let r,i;W(e,Ve,u=>n(6,i=u));const l=tt([]);W(e,l,u=>n(2,r=u)),Sn("selectedMediaFiles",l);let o,a=[];async function c(u){try{n(0,o=i==null?void 0:i.getMediaFiles()),n(1,a=await o||[])}catch{}}async function s(){await i.uploadMediaFile(),c()}async function f(){try{await i.deleteFiles(r),he(l,r=[],r),c()}catch(u){console.error("Error deleting files",u)}}return e.$$.update=()=>{e.$$.dirty&64&&c()},[o,a,r,l,s,f,i]}class Dc extends ce{constructor(t){super(),ae(this,t,Oc,Mc,ie,{})}}function hr(e,t,n){const r=e.slice();return r[5]=t[n],r}function Fc(e){let t,n;return t=new Dc({}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:b,i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Hc(e){let t,n,r,i,l,o=e[0]&&mr(e);return i=new yc({}),{c(){t=k("aside"),n=k("ul"),o&&o.c(),r=q(),J(i.$$.fragment),m(n,"class","svelte-17x5uzj"),m(t,"class","svelte-17x5uzj")},m(a,c){N(a,t,c),w(t,n),o&&o.m(n,null),N(a,r,c),K(i,a,c),l=!0},p(a,c){a[0]?o?(o.p(a,c),c&1&&I(o,1)):(o=mr(a),o.c(),I(o,1),o.m(n,null)):o&&(ye(),V(o,1,1,()=>{o=null}),ke())},i(a){l||(I(o),I(i.$$.fragment,a),l=!0)},o(a){V(o),V(i.$$.fragment,a),l=!1},d(a){a&&(H(t),H(r)),o&&o.d(),X(i,a)}}}function mr(e){let t,n,r=Ee(e[0]),i=[];for(let o=0;o<r.length;o+=1)i[o]=gr(hr(e,r,o));const l=o=>V(i[o],1,1,()=>{i[o]=null});return{c(){for(let o=0;o<i.length;o+=1)i[o].c();t=Oe()},m(o,a){for(let c=0;c<i.length;c+=1)i[c]&&i[c].m(o,a);N(o,t,a),n=!0},p(o,a){if(a&1){r=Ee(o[0]);let c;for(c=0;c<r.length;c+=1){const s=hr(o,r,c);i[c]?(i[c].p(s,a),I(i[c],1)):(i[c]=gr(s),i[c].c(),I(i[c],1),i[c].m(t.parentNode,t))}for(ye(),c=r.length;c<i.length;c+=1)l(c);ke()}},i(o){if(!n){for(let a=0;a<r.length;a+=1)I(i[a]);n=!0}},o(o){i=i.filter(Boolean);for(let a=0;a<i.length;a+=1)V(i[a]);n=!1},d(o){o&&H(t),un(i,o)}}}function gr(e){let t,n;const r=[e[5]];let i={};for(let l=0;l<r.length;l+=1)i=ot(i,r[l]);return t=new tc({props:i}),{c(){J(t.$$.fragment)},m(l,o){K(t,l,o),n=!0},p(l,o){const a=o&1?ct(r,[st(l[5])]):{};t.$set(a)},i(l){n||(I(t.$$.fragment,l),n=!0)},o(l){V(t.$$.fragment,l),n=!1},d(l){X(t,l)}}}function Ic(e){let t,n,r,i,l,o;t=new Xa({}),t.$on("selectview",e[2]);const a=[Hc,Fc],c=[];function s(f,u){return f[1]==="posts"?0:f[1]==="media"?1:-1}return~(i=s(e))&&(l=c[i]=a[i](e)),{c(){J(t.$$.fragment),n=q(),r=k("div"),l&&l.c(),m(r,"id","dash"),m(r,"class","page svelte-17x5uzj")},m(f,u){K(t,f,u),N(f,n,u),N(f,r,u),~i&&c[i].m(r,null),o=!0},p(f,[u]){let d=i;i=s(f),i===d?~i&&c[i].p(f,u):(l&&(ye(),V(c[d],1,1,()=>{c[d]=null}),ke()),~i?(l=c[i],l?l.p(f,u):(l=c[i]=a[i](f),l.c()),I(l,1),l.m(r,null)):l=null)},i(f){o||(I(t.$$.fragment,f),I(l),o=!0)},o(f){V(t.$$.fragment,f),V(l),o=!1},d(f){f&&(H(n),H(r)),X(t,f),~i&&c[i].d()}}}function Nc(e,t,n){let r,i,l;W(e,$e,c=>n(3,i=c)),W(e,Ce,c=>n(4,l=c));let o="posts";function a(c){n(1,o=c.detail)}return e.$$.update=()=>{e.$$.dirty&16&&n(0,r=l==null?void 0:l.collections),e.$$.dirty&9&&(i||he($e,i=r==null?void 0:r[0],i))},[r,o,a,i,l]}class Rc extends ce{constructor(t){super(),ae(this,t,Nc,Ic,ie,{})}}const Pc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>arrow-left</title><path d="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" /></svg>',Rn=(()=>{if(typeof self>"u")return!1;if("top"in self&&self!==top)try{top.window.document._=0}catch{return!1}return"showOpenFilePicker"in self})(),$c=Rn?Promise.resolve().then(function(){return Bc}):Promise.resolve().then(function(){return Xc});async function Pn(...e){return(await $c).default(...e)}const jc=Rn?Promise.resolve().then(function(){return Wc}):Promise.resolve().then(function(){return Jc});async function Vc(...e){return(await jc).default(...e)}const qc=Rn?Promise.resolve().then(function(){return Zc}):Promise.resolve().then(function(){return ts});async function wn(...e){return(await qc).default(...e)}const Yc=async e=>{const t=await e.getFile();return t.handle=e,t};var Uc=async(e=[{}])=>{Array.isArray(e)||(e=[e]);const t=[];e.forEach((i,l)=>{t[l]={description:i.description||"Files",accept:{}},i.mimeTypes?i.mimeTypes.map(o=>{t[l].accept[o]=i.extensions||[]}):t[l].accept["*/*"]=i.extensions||[]});const n=await window.showOpenFilePicker({id:e[0].id,startIn:e[0].startIn,types:t,multiple:e[0].multiple||!1,excludeAcceptAllOption:e[0].excludeAcceptAllOption||!1}),r=await Promise.all(n.map(Yc));return e[0].multiple?r:r[0]},Bc={__proto__:null,default:Uc};function Pt(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(i){return{value:i,done:r}})}return Pt=function(n){this.s=n,this.n=n.next},Pt.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(n){var r=this.s.return;return r===void 0?Promise.resolve({value:n,done:!0}):t(r.apply(this.s,arguments))},throw:function(n){var r=this.s.return;return r===void 0?Promise.reject(n):t(r.apply(this.s,arguments))}},new Pt(e)}const Vi=async(e,t,n=e.name,r)=>{const i=[],l=[];var o,a=!1,c=!1;try{for(var s,f=function(u){var d,p,g,h=2;for(typeof Symbol<"u"&&(p=Symbol.asyncIterator,g=Symbol.iterator);h--;){if(p&&(d=u[p])!=null)return d.call(u);if(g&&(d=u[g])!=null)return new Pt(d.call(u));p="@@asyncIterator",g="@@iterator"}throw new TypeError("Object is not async iterable")}(e.values());a=!(s=await f.next()).done;a=!1){const u=s.value,d=`${n}/${u.name}`;u.kind==="file"?l.push(u.getFile().then(p=>(p.directoryHandle=e,p.handle=u,Object.defineProperty(p,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>d})))):u.kind!=="directory"||!t||r&&r(u)||i.push(Vi(u,t,d,r))}}catch(u){c=!0,o=u}finally{try{a&&f.return!=null&&await f.return()}finally{if(c)throw o}}return[...(await Promise.all(i)).flat(),...await Promise.all(l)]};var Gc=async(e={})=>{e.recursive=e.recursive||!1,e.mode=e.mode||"read";const t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn,mode:e.mode});return(await(await t.values()).next()).done?[t]:Vi(t,e.recursive,void 0,e.skipDirectory)},Wc={__proto__:null,default:Gc},zc=async(e,t=[{}],n=null,r=!1,i=null)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";const l=[];let o=null;if(e instanceof Blob&&e.type?o=e.type:e.headers&&e.headers.get("content-type")&&(o=e.headers.get("content-type")),t.forEach((s,f)=>{l[f]={description:s.description||"Files",accept:{}},s.mimeTypes?(f===0&&o&&s.mimeTypes.push(o),s.mimeTypes.map(u=>{l[f].accept[u]=s.extensions||[]})):o?l[f].accept[o]=s.extensions||[]:l[f].accept["*/*"]=s.extensions||[]}),n)try{await n.getFile()}catch(s){if(n=null,r)throw s}const a=n||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:l,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1});!n&&i&&i(a);const c=await a.createWritable();return"stream"in e?(await e.stream().pipeTo(c),a):"body"in e?(await e.body.pipeTo(c),a):(await c.write(await e),await c.close(),a)},Zc={__proto__:null,default:zc},Kc=async(e=[{}])=>(Array.isArray(e)||(e=[e]),new Promise((t,n)=>{const r=document.createElement("input");r.type="file";const i=[...e.map(c=>c.mimeTypes||[]),...e.map(c=>c.extensions||[])].join();r.multiple=e[0].multiple||!1,r.accept=i||"",r.style.display="none",document.body.append(r);const l=c=>{typeof o=="function"&&o(),t(c)},o=e[0].legacySetup&&e[0].legacySetup(l,()=>o(n),r),a=()=>{window.removeEventListener("focus",a),r.remove()};r.addEventListener("click",()=>{window.addEventListener("focus",a)}),r.addEventListener("change",()=>{window.removeEventListener("focus",a),r.remove(),l(r.multiple?Array.from(r.files):r.files[0])}),"showPicker"in HTMLInputElement.prototype?r.showPicker():r.click()})),Xc={__proto__:null,default:Kc},Qc=async(e=[{}])=>(Array.isArray(e)||(e=[e]),e[0].recursive=e[0].recursive||!1,new Promise((t,n)=>{const r=document.createElement("input");r.type="file",r.webkitdirectory=!0;const i=o=>{typeof l=="function"&&l(),t(o)},l=e[0].legacySetup&&e[0].legacySetup(i,()=>l(n),r);r.addEventListener("change",()=>{let o=Array.from(r.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(o=o.filter(a=>a.webkitRelativePath.split("/").every(c=>!e[0].skipDirectory({name:c,kind:"directory"})))):o=o.filter(a=>a.webkitRelativePath.split("/").length===2),i(o)}),"showPicker"in HTMLInputElement.prototype?r.showPicker():r.click()})),Jc={__proto__:null,default:Qc},es=async(e,t={})=>{Array.isArray(t)&&(t=t[0]);const n=document.createElement("a");let r=e;"body"in e&&(r=await async function(o,a){const c=o.getReader(),s=new ReadableStream({start:d=>async function p(){return c.read().then(({done:g,value:h})=>{if(!g)return d.enqueue(h),p();d.close()})}()}),f=new Response(s),u=await f.blob();return c.releaseLock(),new Blob([u],{type:a})}(e.body,e.headers.get("content-type"))),n.download=t.fileName||"Untitled",n.href=URL.createObjectURL(await r);const i=()=>{typeof l=="function"&&l()},l=t.legacySetup&&t.legacySetup(i,()=>l(),n);return n.addEventListener("click",()=>{setTimeout(()=>URL.revokeObjectURL(n.href),3e4),i()}),n.click(),null},ts={__proto__:null,default:es},qi={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Ii,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d\d/,l=/\d\d?/,o=/\d*[^-_:/,()\s\d]+/,a={},c=function(h){return(h=+h)+(h>68?1900:2e3)},s=function(h){return function(v){this[h]=+v}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(h){(this.zone||(this.zone={})).offset=function(v){if(!v||v==="Z")return 0;var A=v.match(/([+-]|\d\d)/g),E=60*A[1]+(+A[2]||0);return E===0?0:A[0]==="+"?-E:E}(h)}],u=function(h){var v=a[h];return v&&(v.indexOf?v:v.s.concat(v.f))},d=function(h,v){var A,E=a.meridiem;if(E){for(var T=1;T<=24;T+=1)if(h.indexOf(E(T,0,v))>-1){A=T>12;break}}else A=h===(v?"pm":"PM");return A},p={A:[o,function(h){this.afternoon=d(h,!1)}],a:[o,function(h){this.afternoon=d(h,!0)}],S:[/\d/,function(h){this.milliseconds=100*+h}],SS:[i,function(h){this.milliseconds=10*+h}],SSS:[/\d{3}/,function(h){this.milliseconds=+h}],s:[l,s("seconds")],ss:[l,s("seconds")],m:[l,s("minutes")],mm:[l,s("minutes")],H:[l,s("hours")],h:[l,s("hours")],HH:[l,s("hours")],hh:[l,s("hours")],D:[l,s("day")],DD:[i,s("day")],Do:[o,function(h){var v=a.ordinal,A=h.match(/\d+/);if(this.day=A[0],v)for(var E=1;E<=31;E+=1)v(E).replace(/\[|\]/g,"")===h&&(this.day=E)}],M:[l,s("month")],MM:[i,s("month")],MMM:[o,function(h){var v=u("months"),A=(u("monthsShort")||v.map(function(E){return E.slice(0,3)})).indexOf(h)+1;if(A<1)throw new Error;this.month=A%12||A}],MMMM:[o,function(h){var v=u("months").indexOf(h)+1;if(v<1)throw new Error;this.month=v%12||v}],Y:[/[+-]?\d+/,s("year")],YY:[i,function(h){this.year=c(h)}],YYYY:[/\d{4}/,s("year")],Z:f,ZZ:f};function g(h){var v,A;v=h,A=a&&a.formats;for(var E=(h=v.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(P,M,S){var B=S&&S.toUpperCase();return M||A[S]||n[S]||A[B].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(z,O,y){return O||y.slice(1)})})).match(r),T=E.length,j=0;j<T;j+=1){var D=E[j],R=p[D],F=R&&R[0],C=R&&R[1];E[j]=C?{regex:F,parser:C}:D.replace(/^\[|\]$/g,"")}return function(P){for(var M={},S=0,B=0;S<T;S+=1){var z=E[S];if(typeof z=="string")B+=z.length;else{var O=z.regex,y=z.parser,_=P.slice(B),x=O.exec(_)[0];y.call(M,x),P=P.replace(x,"")}}return function(L){var $=L.afternoon;if($!==void 0){var G=L.hours;$?G<12&&(L.hours+=12):G===12&&(L.hours=0),delete L.afternoon}}(M),M}}return function(h,v,A){A.p.customParseFormat=!0,h&&h.parseTwoDigitYear&&(c=h.parseTwoDigitYear);var E=v.prototype,T=E.parse;E.parse=function(j){var D=j.date,R=j.utc,F=j.args;this.$u=R;var C=F[1];if(typeof C=="string"){var P=F[2]===!0,M=F[3]===!0,S=P||M,B=F[2];M&&(B=F[2]),a=this.$locale(),!P&&B&&(a=A.Ls[B]),this.$d=function(_,x,L){try{if(["x","X"].indexOf(x)>-1)return new Date((x==="X"?1e3:1)*_);var $=g(x)(_),G=$.year,Q=$.month,ne=$.day,le=$.hours,fe=$.minutes,Ae=$.seconds,qe=$.milliseconds,He=$.zone,Ne=new Date,De=ne||(G||Q?1:Ne.getDate()),de=G||Ne.getFullYear(),xe=0;G&&!Q||(xe=Q>0?Q-1:Ne.getMonth());var Re=le||0,Ye=fe||0,Et=Ae||0,U=qe||0;return He?new Date(Date.UTC(de,xe,De,Re,Ye,Et,U+60*He.offset*1e3)):L?new Date(Date.UTC(de,xe,De,Re,Ye,Et,U)):new Date(de,xe,De,Re,Ye,Et,U)}catch{return new Date("")}}(D,C,R),this.init(),B&&B!==!0&&(this.$L=this.locale(B).$L),S&&D!=this.format(C)&&(this.$d=new Date("")),a={}}else if(C instanceof Array)for(var z=C.length,O=1;O<=z;O+=1){F[1]=C[O-1];var y=A.apply(this,F);if(y.isValid()){this.$d=y.$d,this.$L=y.$L,this.init();break}O===z&&(this.$d=new Date(""))}else T.call(this,j)}}})})(qi);var ns=qi.exports;const Yi=Ni(ns);Te.extend(Yi);const $n="../../cms-config/",_r=`Unable to parse markdown entry. Backend must implement 'replacePreviewLinks()'
34
- and return a valid string.`;function Wt(e,t){let n=Te(t),r="";switch(e){case"datetime-local":r=n.format("YYYY-MM-DDTHH:mm");break;case"date":r=n.format("YYYY-MM-DD");break;case"time":r=n.format("HH:mm");break}return r}function rs(e,t){var i;const n=(i=e==null?void 0:e.previews.styles.find(l=>l.name===t))==null?void 0:i.files;if(!n)return;const r=[];return n.forEach(l=>{const o=`${$n}${l}`;r.push(new URL(o,window.location.href).href)}),r.map(l=>`<link rel="stylesheet" href="${l}">`).join(`
35
- `)}async function is(e,t){var i;const n=(i=e==null?void 0:e.previews.templates.find(l=>l.name===t))==null?void 0:i.template;if(!n)return;const r=new URL(`${$n}${n}`,window.location.href).href;try{const l=await fetch(r);if(!l.ok)throw new Error(`Unable to fetch file ${r}`);return await l.text()}catch(l){console.error(l);return}}function ls(e,t){return e==null?void 0:e.replace("{{styles}}",t).replaceAll("{{",'<span data-tag="').replaceAll("}}",'"></span>')}async function Ui(e,t,n){let r;switch(e.widget){case"markdown":if(!(n!=null&&n.replacePreviewLinks))throw new Error(_r);if(r=await(n==null?void 0:n.replacePreviewLinks(t)),r==null)throw new Error(_r);break;case"datetime":let i;switch(e.type){case"time":i=Te(t.toString(),"hh:mm").toISOString();break;case"date":i=Te(t.toString(),"YYYY-MM-DD").toISOString();break;default:i=Te(t.toString(),"YYYY-MM-DDThh:mm").toISOString();break}r=new Date(i);break;case"boolean":r=t==="true";break;case"number":r=Number(t);break;case"hidden":switch(e.type){case"datetime-local":r=new Date(Te(t.toString(),"YYYY-MM-DDThh:mm").toISOString());break;case"time":r=new Date(Te(t.toString(),"hh:mm").toISOString());break;case"date":r=new Date(Te(t.toString(),"YYYY-MM-DD").toISOString());break;case"boolean":r=t==="true";break;case"number":r=Number(t);break;default:r=t;break}break;default:r=t;break}return r}function os(e,t){const{slug:n,extension:r}=e,{title:i,date:l}=t,o=i.toLowerCase().replaceAll(/\W+/g,"-"),a=Te(l);return`${n.replaceAll("{{slug}}",o).replaceAll("{{year}}",a.format("YYYY")).replaceAll("{{month}}",a.format("MM")).replaceAll("{{day}}",a.format("DD")).replaceAll("{{hour}}",a.format("HH")).replaceAll("{{minute}}",a.format("mm")).replaceAll("{{second}}",a.format("ss"))}.${r}`}function as(e,t){const n={...t},{date:r,body:i}={...n.fields};delete n.fields.body;const l=Qt.dump(n.fields,{quotingType:'"',forceQuotes:!0});return n.date=r,n.body=i,n.collection=e.name,n.name||(n.name=os(e,n.fields)),n.raw=`---
36
- ${l}---
26
+ `);return s=s!==-1?s:e.length,n.lastIndex=s,lr(e.slice(0,s),t)}(),i=e[0]===`
27
+ `||e[0]===" ",o,l;l=n.exec(e);){var a=l[1],c=l[2];o=c[0]===" ",r+=a+(!i&&!o&&c!==""?`
28
+ `:"")+lr(c,t),i=o}return r}function lr(e,t){if(e===""||e[0]===" ")return e;for(var n=/ [^ ]/g,r,i=0,o,l=0,a=0,c="";r=n.exec(e);)a=r.index,a-i>t&&(o=l>i?l:a,c+=`
29
+ `+e.slice(i,o),i=o+1),l=a;return c+=`
30
+ `,e.length-i>t&&l>i?c+=e.slice(i,l)+`
31
+ `+e.slice(l+1):c+=e.slice(i),c.slice(1)}function Ca(e){for(var t="",n=0,r,i=0;i<e.length;n>=65536?i+=2:i++)n=St(e,i),r=Se[n],!r&&Dt(n)?(t+=e[i],n>=65536&&(t+=e[i+1])):t+=r||ga(n);return t}function Sa(e,t,n){var r="",i=e.tag,o,l,a;for(o=0,l=n.length;o<l;o+=1)a=n[o],e.replacer&&(a=e.replacer.call(n,String(o),a)),(Ke(e,t,a,!1,!1)||typeof a>"u"&&Ke(e,t,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function ar(e,t,n,r){var i="",o=e.tag,l,a,c;for(l=0,a=n.length;l<a;l+=1)c=n[l],e.replacer&&(c=e.replacer.call(n,String(l),c)),(Ke(e,t+1,c,!0,!0,!1,!0)||typeof c>"u"&&Ke(e,t+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=mn(e,t)),e.dump&&Mt===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=o,e.dump=i||"[]"}function xa(e,t,n){var r="",i=e.tag,o=Object.keys(n),l,a,c,s,u;for(l=0,a=o.length;l<a;l+=1)u="",r!==""&&(u+=", "),e.condenseFlow&&(u+='"'),c=o[l],s=n[c],e.replacer&&(s=e.replacer.call(n,c,s)),Ke(e,t,c,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ke(e,t,s,!1,!1)&&(u+=e.dump,r+=u));e.tag=i,e.dump="{"+r+"}"}function La(e,t,n,r){var i="",o=e.tag,l=Object.keys(n),a,c,s,u,f,d;if(e.sortKeys===!0)l.sort();else if(typeof e.sortKeys=="function")l.sort(e.sortKeys);else if(e.sortKeys)throw new xe("sortKeys must be a boolean or a function");for(a=0,c=l.length;a<c;a+=1)d="",(!r||i!=="")&&(d+=mn(e,t)),s=l[a],u=n[s],e.replacer&&(u=e.replacer.call(n,s,u)),Ke(e,t+1,s,!0,!0,!0)&&(f=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,f&&(e.dump&&Mt===e.dump.charCodeAt(0)?d+="?":d+="? "),d+=e.dump,f&&(d+=mn(e,t)),Ke(e,t+1,u,!0,f)&&(e.dump&&Mt===e.dump.charCodeAt(0)?d+=":":d+=": ",d+=e.dump,i+=d));e.tag=o,e.dump=i||"{}"}function cr(e,t,n){var r,i,o,l,a,c;for(i=n?e.explicitTypes:e.implicitTypes,o=0,l=i.length;o<l;o+=1)if(a=i[o],(a.instanceOf||a.predicate)&&(!a.instanceOf||typeof t=="object"&&t instanceof a.instanceOf)&&(!a.predicate||a.predicate(t))){if(n?a.multi&&a.representName?e.tag=a.representName(t):e.tag=a.tag:e.tag="?",a.represent){if(c=e.styleMap[a.tag]||a.defaultStyle,Ei.call(a.represent)==="[object Function]")r=a.represent(t,c);else if(Ci.call(a.represent,c))r=a.represent[c](t,c);else throw new xe("!<"+a.tag+'> tag resolver accepts not "'+c+'" style');e.dump=r}return!0}return!1}function Ke(e,t,n,r,i,o,l){e.tag=null,e.dump=n,cr(e,n,!1)||cr(e,n,!0);var a=Ei.call(e.dump),c=r,s;r&&(r=e.flowLevel<0||e.flowLevel>t);var u=a==="[object Object]"||a==="[object Array]",f,d;if(u&&(f=e.duplicates.indexOf(n),d=f!==-1),(e.tag!==null&&e.tag!=="?"||d||e.indent!==2&&t>0)&&(i=!1),d&&e.usedDuplicates[f])e.dump="*ref_"+f;else{if(u&&d&&!e.usedDuplicates[f]&&(e.usedDuplicates[f]=!0),a==="[object Object]")r&&Object.keys(e.dump).length!==0?(La(e,t,e.dump,i),d&&(e.dump="&ref_"+f+e.dump)):(xa(e,t,e.dump),d&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!l&&t>0?ar(e,t-1,e.dump,i):ar(e,t,e.dump,i),d&&(e.dump="&ref_"+f+e.dump)):(Sa(e,t,e.dump),d&&(e.dump="&ref_"+f+" "+e.dump));else if(a==="[object String]")e.tag!=="?"&&Aa(e,e.dump,t,o,c);else{if(a==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new xe("unacceptable kind of an object to dump "+a)}e.tag!==null&&e.tag!=="?"&&(s=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?s="!"+s:s.slice(0,18)==="tag:yaml.org,2002:"?s="!!"+s.slice(18):s="!<"+s+">",e.dump=s+" "+e.dump)}return!0}function Ta(e,t){var n=[],r=[],i,o;for(_n(e,n,r),i=0,o=r.length;i<o;i+=1)t.duplicates.push(n[r[i]]);t.usedDuplicates=new Array(o)}function _n(e,t,n){var r,i,o;if(e!==null&&typeof e=="object")if(i=t.indexOf(e),i!==-1)n.indexOf(i)===-1&&n.push(i);else if(t.push(e),Array.isArray(e))for(i=0,o=e.length;i<o;i+=1)_n(e[i],t,n);else for(r=Object.keys(e),i=0,o=r.length;i<o;i+=1)_n(e[r[i]],t,n)}function Ma(e,t){t=t||{};var n=new wa(t);n.noRefs||Ta(e,n);var r=e;return n.replacer&&(r=n.replacer.call({"":r},"",r)),Ke(n,0,r,!0,!0)?n.dump+`
32
+ `:""}var Oa=Ma,Da={dump:Oa};function In(e,t){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+t+" instead, which is now safe by default.")}}var Fa=be,Ha=Kr,Ia=ei,Na=oi,Ra=li,Pa=On,$a=Ai.load,ja=Ai.loadAll,Va=Da.dump,qa=xe,Ya={binary:fi,float:ii,map:Jr,null:ti,pairs:pi,set:hi,timestamp:si,bool:ni,int:ri,merge:ui,omap:di,seq:Xr,str:Qr},Ua=In("safeLoad","load"),Ba=In("safeLoadAll","loadAll"),Ga=In("safeDump","dump"),Jt={Type:Fa,Schema:Ha,FAILSAFE_SCHEMA:Ia,JSON_SCHEMA:Na,CORE_SCHEMA:Ra,DEFAULT_SCHEMA:Pa,load:$a,loadAll:ja,dump:Va,YAMLException:qa,types:Ya,safeLoad:Ua,safeLoadAll:Ba,safeDump:Ga};const $e=nt(),De=nt(),we=nt({}),Ve=nt(),Ce=Wr(null,e=>(Wa().then(e).catch(t=>console.error("Failed to load config.",t)),()=>{})),Nn=xo(Ce,(e,t)=>{const n=e==null?void 0:e.custom_actions;return n?(za(n).then(t).catch(r=>console.error("Failed to load cms actions.",r)),()=>{}):null});async function Wa(){const e=new URL("../../cms-config/config.yml",window.location.href).href,t=await fetch(e);if(!t.ok)throw new Error(`Unable to fetch file ${e}`);return Jt.load(await t.text())}async function za(e){const t=`../../cms-config/${e}`;return(await import(new URL(t,window.location.href).href)).default}function Za(e){let t,n,r,i,o,l,a,c,s,u,f,d,p;return{c(){t=E("nav"),n=E("ul"),r=E("li"),i=E("a"),o=V(),l=E("li"),a=E("a"),c=V(),s=E("ul"),u=E("li"),f=E("a"),h(i,"href","##posts"),h(i,"data-tooltip","Posts"),h(i,"data-placement","bottom"),h(a,"href","##media"),h(a,"data-tooltip","Media Files"),h(a,"data-placement","bottom"),h(f,"href","##exit"),h(f,"class","secondary"),h(f,"data-tooltip","Exit"),h(f,"data-placement","bottom")},m(m,g){I(m,t,g),b(t,n),b(n,r),b(r,i),i.innerHTML=Eo,b(n,o),b(n,l),b(l,a),a.innerHTML=Co,b(t,c),b(t,s),b(s,u),b(u,f),f.innerHTML=So,d||(p=[Z(i,"click",Ue(e[0])),Z(a,"click",Ue(e[0])),Z(f,"click",Ue(e[1]))],d=!0)},p:v,i:v,o:v,d(m){m&&F(t),d=!1,fe(p)}}}function Ka(e,t,n){let r,i;z(e,Ve,c=>n(2,r=c)),z(e,Nn,c=>n(3,i=c));const o=Qt();function l(c){const s=new URL(c.currentTarget.href).hash.replaceAll("#","");o("selectview",s),c.currentTarget.blur()}async function a(){i!=null&&i.onLogout&&await i.onLogout(),r!=null&&r.logout?await r.logout():history.back()}return[l,a]}class Qa extends se{constructor(t){super(),ce(this,t,Ka,Za,oe,{})}}const Xa='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>text-box-edit</title><path d="M10 19.11L12.11 17H7V15H14V15.12L16.12 13H7V11H17V12.12L18.24 10.89C18.72 10.41 19.35 10.14 20.04 10.14C20.37 10.14 20.7 10.21 21 10.33V5C21 3.89 20.1 3 19 3H5C3.89 3 3 3.89 3 5V19C3 20.11 3.9 21 5 21H10V19.11M7 7H17V9H7V7M21.7 14.35L20.7 15.35L18.65 13.3L19.65 12.3C19.86 12.09 20.21 12.09 20.42 12.3L21.7 13.58C21.91 13.79 21.91 14.14 21.7 14.35M12 19.94L18.06 13.88L20.11 15.93L14.06 22H12V19.94Z" /></svg>';function Ja(e){let t,n,r,i,o,l;return{c(){t=E("li"),n=E("a"),r=new Ze(!1),i=te(e[0]),r.a=i,h(n,"href","##select"),h(n,"class","collectionNav svelte-1r1578h"),qt(n,"selected",e[1]),h(t,"class","svelte-1r1578h")},m(a,c){I(a,t,c),b(t,n),r.m(Xa,n),b(n,i),o||(l=Z(n,"click",Ue(e[2])),o=!0)},p(a,[c]){c&1&&_e(i,a[0]),c&2&&qt(n,"selected",a[1])},i:v,o:v,d(a){a&&F(t),o=!1,l()}}}function ec(e,t,n){let r,i,o;z(e,Ce,s=>n(5,i=s)),z(e,$e,s=>n(4,o=s));let{name:l}=t,{label:a}=t;function c(){he($e,o=i.collections.find(s=>s.name===l),o)}return e.$$set=s=>{"name"in s&&n(3,l=s.name),"label"in s&&n(0,a=s.label)},e.$$.update=()=>{e.$$.dirty&24&&n(1,r=(o==null?void 0:o.name)===l?"selected":"")},[a,r,c,l,o]}class tc extends se{constructor(t){super(),ce(this,t,ec,Ja,oe,{name:3,label:0})}}var Ii=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ni(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ri={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Ii,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",l="second",a="minute",c="hour",s="day",u="week",f="month",d="quarter",p="year",m="date",g="Invalid Date",_=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,k=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,A={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(O){var y=["th","st","nd","rd"],w=O%100;return"["+O+(y[(w-20)%10]||y[w]||y[0])+"]"}},S=function(O,y,w){var L=String(O);return!L||L.length>=y?O:""+Array(y+1-L.length).join(w)+O},$={s:S,z:function(O){var y=-O.utcOffset(),w=Math.abs(y),L=Math.floor(w/60),T=w%60;return(y<=0?"+":"-")+S(L,2,"0")+":"+S(T,2,"0")},m:function O(y,w){if(y.date()<w.date())return-O(w,y);var L=12*(w.year()-y.year())+(w.month()-y.month()),T=y.clone().add(L,f),q=w-T<0,G=y.clone().add(L+(q?-1:1),f);return+(-(L+(w-T)/(q?T-G:G-T))||0)},a:function(O){return O<0?Math.ceil(O)||0:Math.floor(O)},p:function(O){return{M:f,y:p,w:u,d:s,D:m,h:c,m:a,s:l,ms:o,Q:d}[O]||String(O||"").toLowerCase().replace(/s$/,"")},u:function(O){return O===void 0}},M="en",P={};P[M]=A;var N="$isDayjsObject",C=function(O){return O instanceof B||!(!O||!O[N])},R=function O(y,w,L){var T;if(!y)return M;if(typeof y=="string"){var q=y.toLowerCase();P[q]&&(T=q),w&&(P[q]=w,T=q);var G=y.split("-");if(!T&&G.length>1)return O(G[0])}else{var K=y.name;P[K]=y,T=K}return!L&&T&&(M=T),T||!L&&M},D=function(O,y){if(C(O))return O.clone();var w=typeof y=="object"?y:{};return w.date=O,w.args=arguments,new B(w)},x=$;x.l=R,x.i=C,x.w=function(O,y){return D(O,{locale:y.$L,utc:y.$u,x:y.$x,$offset:y.$offset})};var B=function(){function O(w){this.$L=R(w.locale,null,!0),this.parse(w),this.$x=this.$x||w.x||{},this[N]=!0}var y=O.prototype;return y.parse=function(w){this.$d=function(L){var T=L.date,q=L.utc;if(T===null)return new Date(NaN);if(x.u(T))return new Date;if(T instanceof Date)return new Date(T);if(typeof T=="string"&&!/Z$/i.test(T)){var G=T.match(_);if(G){var K=G[2]-1||0,re=(G[7]||"0").substring(0,3);return q?new Date(Date.UTC(G[1],K,G[3]||1,G[4]||0,G[5]||0,G[6]||0,re)):new Date(G[1],K,G[3]||1,G[4]||0,G[5]||0,G[6]||0,re)}}return new Date(T)}(w),this.init()},y.init=function(){var w=this.$d;this.$y=w.getFullYear(),this.$M=w.getMonth(),this.$D=w.getDate(),this.$W=w.getDay(),this.$H=w.getHours(),this.$m=w.getMinutes(),this.$s=w.getSeconds(),this.$ms=w.getMilliseconds()},y.$utils=function(){return x},y.isValid=function(){return this.$d.toString()!==g},y.isSame=function(w,L){var T=D(w);return this.startOf(L)<=T&&T<=this.endOf(L)},y.isAfter=function(w,L){return D(w)<this.startOf(L)},y.isBefore=function(w,L){return this.endOf(L)<D(w)},y.$g=function(w,L,T){return x.u(w)?this[L]:this.set(T,w)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(w,L){var T=this,q=!!x.u(L)||L,G=x.p(w),K=function(Fe,me){var Le=x.w(T.$u?Date.UTC(T.$y,me,Fe):new Date(T.$y,me,Fe),T);return q?Le:Le.endOf(s)},re=function(Fe,me){return x.w(T.toDate()[Fe].apply(T.toDate("s"),(q?[0,0,0,0]:[23,59,59,999]).slice(me)),T)},ie=this.$W,de=this.$M,Ae=this.$D,qe="set"+(this.$u?"UTC":"");switch(G){case p:return q?K(1,0):K(31,11);case f:return q?K(1,de):K(0,de+1);case u:var Ie=this.$locale().weekStart||0,We=(ie<Ie?ie+7:ie)-Ie;return K(q?Ae-We:Ae+(6-We),de);case s:case m:return re(qe+"Hours",0);case c:return re(qe+"Minutes",1);case a:return re(qe+"Seconds",2);case l:return re(qe+"Milliseconds",3);default:return this.clone()}},y.endOf=function(w){return this.startOf(w,!1)},y.$set=function(w,L){var T,q=x.p(w),G="set"+(this.$u?"UTC":""),K=(T={},T[s]=G+"Date",T[m]=G+"Date",T[f]=G+"Month",T[p]=G+"FullYear",T[c]=G+"Hours",T[a]=G+"Minutes",T[l]=G+"Seconds",T[o]=G+"Milliseconds",T)[q],re=q===s?this.$D+(L-this.$W):L;if(q===f||q===p){var ie=this.clone().set(m,1);ie.$d[K](re),ie.init(),this.$d=ie.set(m,Math.min(this.$D,ie.daysInMonth())).$d}else K&&this.$d[K](re);return this.init(),this},y.set=function(w,L){return this.clone().$set(w,L)},y.get=function(w){return this[x.p(w)]()},y.add=function(w,L){var T,q=this;w=Number(w);var G=x.p(L),K=function(de){var Ae=D(q);return x.w(Ae.date(Ae.date()+Math.round(de*w)),q)};if(G===f)return this.set(f,this.$M+w);if(G===p)return this.set(p,this.$y+w);if(G===s)return K(1);if(G===u)return K(7);var re=(T={},T[a]=r,T[c]=i,T[l]=n,T)[G]||1,ie=this.$d.getTime()+w*re;return x.w(ie,this)},y.subtract=function(w,L){return this.add(-1*w,L)},y.format=function(w){var L=this,T=this.$locale();if(!this.isValid())return T.invalidDate||g;var q=w||"YYYY-MM-DDTHH:mm:ssZ",G=x.z(this),K=this.$H,re=this.$m,ie=this.$M,de=T.weekdays,Ae=T.months,qe=T.meridiem,Ie=function(me,Le,Ne,Ye){return me&&(me[Le]||me(L,q))||Ne[Le].slice(0,Ye)},We=function(me){return x.s(K%12||12,me,"0")},Fe=qe||function(me,Le,Ne){var Ye=me<12?"AM":"PM";return Ne?Ye.toLowerCase():Ye};return q.replace(k,function(me,Le){return Le||function(Ne){switch(Ne){case"YY":return String(L.$y).slice(-2);case"YYYY":return x.s(L.$y,4,"0");case"M":return ie+1;case"MM":return x.s(ie+1,2,"0");case"MMM":return Ie(T.monthsShort,ie,Ae,3);case"MMMM":return Ie(Ae,ie);case"D":return L.$D;case"DD":return x.s(L.$D,2,"0");case"d":return String(L.$W);case"dd":return Ie(T.weekdaysMin,L.$W,de,2);case"ddd":return Ie(T.weekdaysShort,L.$W,de,3);case"dddd":return de[L.$W];case"H":return String(K);case"HH":return x.s(K,2,"0");case"h":return We(1);case"hh":return We(2);case"a":return Fe(K,re,!0);case"A":return Fe(K,re,!1);case"m":return String(re);case"mm":return x.s(re,2,"0");case"s":return String(L.$s);case"ss":return x.s(L.$s,2,"0");case"SSS":return x.s(L.$ms,3,"0");case"Z":return G}return null}(me)||G.replace(":","")})},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(w,L,T){var q,G=this,K=x.p(L),re=D(w),ie=(re.utcOffset()-this.utcOffset())*r,de=this-re,Ae=function(){return x.m(G,re)};switch(K){case p:q=Ae()/12;break;case f:q=Ae();break;case d:q=Ae()/3;break;case u:q=(de-ie)/6048e5;break;case s:q=(de-ie)/864e5;break;case c:q=de/i;break;case a:q=de/r;break;case l:q=de/n;break;default:q=de}return T?q:x.a(q)},y.daysInMonth=function(){return this.endOf(f).$D},y.$locale=function(){return P[this.$L]},y.locale=function(w,L){if(!w)return this.$L;var T=this.clone(),q=R(w,L,!0);return q&&(T.$L=q),T},y.clone=function(){return x.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},O}(),W=B.prototype;return D.prototype=W,[["$ms",o],["$s",l],["$m",a],["$H",c],["$W",s],["$M",f],["$y",p],["$D",m]].forEach(function(O){W[O[1]]=function(y){return this.$g(y,O[0],O[1])}}),D.extend=function(O,y){return O.$i||(O(y,B,D),O.$i=!0),D},D.locale=R,D.isDayjs=C,D.unix=function(O){return D(1e3*O)},D.en=P[M],D.Ls=P,D.p={},D})})(Ri);var nc=Ri.exports;const Te=Ni(nc);function rc(e){let t,n,r,i,o,l=e[0].fields.title+"",a,c,s,u,f,d,p;return{c(){t=E("div"),n=E("input"),r=V(),i=E("a"),o=E("div"),a=te(l),c=V(),s=E("div"),s.textContent=`${e[2]}`,u=V(),f=E("div"),f.textContent=`${e[3]}`,h(n,"type","checkbox"),h(n,"name","entry-select"),h(o,"class","entry-name svelte-fj87yn"),h(s,"class","entry-status svelte-fj87yn"),h(f,"class","entry-date svelte-fj87yn"),h(i,"href","#/editor"),h(i,"class","entry-info svelte-fj87yn"),h(t,"class","item svelte-fj87yn")},m(m,g){I(m,t,g),b(t,n),b(t,r),b(t,i),b(i,o),b(o,a),b(i,c),b(i,s),b(i,u),b(i,f),d||(p=[Z(n,"change",e[4]),Z(i,"click",e[5])],d=!0)},p(m,[g]){g&1&&l!==(l=m[0].fields.title+"")&&_e(a,l)},i:v,o:v,d(m){m&&F(t),d=!1,fe(p)}}}function ic(e,t,n){let r,i,o;z(e,De,d=>n(6,r=d)),z(e,we,d=>n(7,i=d));const l=xn("selectedEntries");z(e,l,d=>n(8,o=d));let{entry:a}=t,c=a.fields.draft?"draft":"published",s=Te(a.fields.date).format("MM/DD/YY");function u(d){d.target.checked?he(l,o=[...o,a],o):he(l,o=o.filter(p=>p!==a),o)}function f(d){he(we,i={},i),he(De,r=a,r)}return e.$$set=d=>{"entry"in d&&n(0,a=d.entry)},[a,l,c,s,u,f]}class oc extends se{constructor(t){super(),ce(this,t,ic,rc,oe,{entry:0})}}function sr(e){let t,n;return{c(){t=E("div"),n=te(e[0])},m(r,i){I(r,t,i),b(t,n)},p(r,i){i&1&&_e(n,r[0])},d(r){r&&F(t)}}}function lc(e){let t,n,r,i=e[0]&&sr(e);return{c(){t=E("div"),n=E("div"),r=V(),i&&i.c(),h(n,"aria-busy","true"),h(t,"class","toast")},m(o,l){I(o,t,l),b(t,n),b(t,r),i&&i.m(t,null)},p(o,[l]){o[0]?i?i.p(o,l):(i=sr(o),i.c(),i.m(t,null)):i&&(i.d(1),i=null)},i:v,o:v,d(o){o&&F(t),i&&i.d()}}}function ac(e,t,n){let{msg:r=null}=t;return e.$$set=i=>{"msg"in i&&n(0,r=i.msg)},[r]}class en extends se{constructor(t){super(),ce(this,t,ac,lc,oe,{msg:0})}}const cc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>alert</title><path d="M13 14H11V9H13M13 18H11V16H13M1 21H23L12 2L1 21Z" /></svg>';function sc(e){let t,n,r,i,o,l,a,c;return{c(){t=E("div"),n=new Ze(!1),r=V(),i=E("details"),o=E("summary"),l=te(e[0]),a=V(),c=te(e[1]),n.a=r,h(i,"class","svelte-1pbztc4"),h(t,"class","toast warning")},m(s,u){I(s,t,u),n.m(cc,t),b(t,r),b(t,i),b(i,o),b(o,l),b(i,a),b(i,c)},p(s,[u]){u&1&&_e(l,s[0]),u&2&&_e(c,s[1])},i:v,o:v,d(s){s&&F(t)}}}function uc(e,t,n){let{msg:r}=t,{details:i}=t;return e.$$set=o=>{"msg"in o&&n(0,r=o.msg),"details"in o&&n(1,i=o.details)},[r,i]}class Qe extends se{constructor(t){super(),ce(this,t,uc,sc,oe,{msg:0,details:1})}}const Pi='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>trash-can-outline</title><path d="M9,3V4H4V6H5V19A2,2 0 0,0 7,21H17A2,2 0 0,0 19,19V6H20V4H15V3H9M7,6H17V19H7V6M9,8V17H11V8H9M13,8V17H15V8H13Z" /></svg>',$i='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>pencil</title><path d="M20.71,7.04C21.1,6.65 21.1,6 20.71,5.63L18.37,3.29C18,2.9 17.35,2.9 16.96,3.29L15.12,5.12L18.87,8.87M3,17.25V21H6.75L17.81,9.93L14.06,6.18L3,17.25Z" /></svg>';function ur(e,t,n){const r=e.slice();return r[14]=t[n],r}function fc(e){let t,n=[],r=new Map,i,o=Ee(e[3]);const l=a=>a[14].name;for(let a=0;a<o.length;a+=1){let c=ur(e,o,a),s=l(c);r.set(s,n[a]=fr(s,c))}return{c(){t=E("div");for(let a=0;a<n.length;a+=1)n[a].c();h(t,"id","items"),h(t,"class","svelte-14m9h86")},m(a,c){I(a,t,c);for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(t,null);i=!0},p(a,c){c&8&&(o=Ee(a[3]),ye(),n=Ft(n,c,l,1,a,o,r,t,Tn,fr,null,ur),ke())},i(a){if(!i){for(let c=0;c<o.length;c+=1)H(n[c]);i=!0}},o(a){for(let c=0;c<n.length;c+=1)j(n[c]);i=!1},d(a){a&&F(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function dc(e){let t,n,r,i,o,l,a,c;return{c(){t=E("div"),n=E("p"),n.textContent="This collection has no entries.",r=V(),i=E("button"),o=new Ze(!1),l=te("Create New Entry"),o.a=l,h(i,"class","svelte-14m9h86"),h(t,"id","empty"),h(t,"class","svelte-14m9h86")},m(s,u){I(s,t,u),b(t,n),b(t,r),b(t,i),o.m($i,i),b(i,l),a||(c=Z(i,"click",e[6]),a=!0)},p:v,i:v,o:v,d(s){s&&F(t),a=!1,c()}}}function fr(e,t){let n,r,i;return r=new oc({props:{entry:t[14]}}),{key:e,first:null,c(){n=Oe(),J(r.$$.fragment),this.first=n},m(o,l){I(o,n,l),Q(r,o,l),i=!0},p(o,l){t=o;const a={};l&8&&(a.entry=t[14]),r.$set(a)},i(o){i||(H(r.$$.fragment,o),i=!0)},o(o){j(r.$$.fragment,o),i=!1},d(o){o&&F(n),X(r,o)}}}function pc(e){let t,n;return t=new Qe({props:{msg:"Error getting entries",details:e[13].message}}),{c(){J(t.$$.fragment)},m(r,i){Q(t,r,i),n=!0},p(r,i){const o={};i&2&&(o.details=r[13].message),t.$set(o)},i(r){n||(H(t.$$.fragment,r),n=!0)},o(r){j(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function hc(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function mc(e){let t,n;return t=new en({props:{msg:"Loading"}}),{c(){J(t.$$.fragment)},m(r,i){Q(t,r,i),n=!0},p:v,i(r){n||(H(t.$$.fragment,r),n=!0)},o(r){j(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function gc(e){let t,n;return t=new Qe({props:{msg:"'On delete' event action failed",details:e[13].message}}),{c(){J(t.$$.fragment)},m(r,i){Q(t,r,i),n=!0},p(r,i){const o={};i&4&&(o.details=r[13].message),t.$set(o)},i(r){n||(H(t.$$.fragment,r),n=!0)},o(r){j(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function _c(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function wc(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function bc(e){var O;let t,n,r=(((O=e[0])==null?void 0:O.label)||"")+"",i,o,l,a,c,s,u,f,d,p,m,g,_,k,A,S,$,M,P,N,C;const R=[dc,fc],D=[];function x(y,w){return y[3].length===0?0:1}_=x(e),k=D[_]=R[_](e);let B={ctx:e,current:null,token:null,hasCatch:!0,pending:mc,then:hc,catch:pc,error:13,blocks:[,,,]};ue(S=e[1],B);let W={ctx:e,current:null,token:null,hasCatch:!0,pending:wc,then:_c,catch:gc,error:13,blocks:[,,,]};return ue(M=e[2],W),{c(){t=E("main"),n=E("header"),i=te(r),o=V(),l=E("div"),a=E("button"),c=new Ze(!1),s=te("Delete"),f=V(),d=E("button"),p=new Ze(!1),m=te("New"),g=V(),k.c(),A=V(),B.block.c(),$=V(),W.block.c(),c.a=s,h(a,"class","outline svelte-14m9h86"),a.disabled=u=e[4].length===0,p.a=m,h(d,"class","svelte-14m9h86"),h(l,"id","listActions"),h(l,"class","svelte-14m9h86"),h(n,"class","svelte-14m9h86"),h(t,"class","svelte-14m9h86")},m(y,w){I(y,t,w),b(t,n),b(n,i),b(n,o),b(n,l),b(l,a),c.m(Pi,a),b(a,s),b(l,f),b(l,d),p.m($i,d),b(d,m),b(t,g),D[_].m(t,null),b(t,A),B.block.m(t,B.anchor=null),B.mount=()=>t,B.anchor=$,b(t,$),W.block.m(t,W.anchor=null),W.mount=()=>t,W.anchor=null,P=!0,N||(C=[Z(a,"click",e[7]),Z(d,"click",e[6])],N=!0)},p(y,[w]){var T;e=y,(!P||w&1)&&r!==(r=(((T=e[0])==null?void 0:T.label)||"")+"")&&_e(i,r),(!P||w&16&&u!==(u=e[4].length===0))&&(a.disabled=u);let L=_;_=x(e),_===L?D[_].p(e,w):(ye(),j(D[L],1,1,()=>{D[L]=null}),ke(),k=D[_],k?k.p(e,w):(k=D[_]=R[_](e),k.c()),H(k,1),k.m(t,A)),B.ctx=e,w&2&&S!==(S=e[1])&&ue(S,B)||Pe(B,e,w),W.ctx=e,w&4&&M!==(M=e[2])&&ue(M,W)||Pe(W,e,w)},i(y){P||(H(k),H(B.block),H(W.block),P=!0)},o(y){j(k);for(let w=0;w<3;w+=1){const L=B.blocks[w];j(L)}for(let w=0;w<3;w+=1){const L=W.blocks[w];j(L)}P=!1},d(y){y&&F(t),D[_].d(),B.block.d(),B.token=null,B=null,W.block.d(),W.token=null,W=null,N=!1,fe(C)}}}function vc(e,t,n){let r,i,o,l,a,c;z(e,Nn,_=>n(9,i=_)),z(e,Ve,_=>n(8,o=_)),z(e,we,_=>n(10,l=_)),z(e,De,_=>n(11,a=_)),z(e,$e,_=>n(0,c=_));const s=nt([]);z(e,s,_=>n(4,r=_)),Sn("selectedEntries",s);let u,f,d=[];async function p(){try{n(1,u=o==null?void 0:o.getFiles(c==null?void 0:c.name)),n(3,d=await u||[])}catch{}}function m(){he(De,a=null,a),he(we,l={},l),window.location.hash="#/editor"}async function g(){try{await o.deleteFiles(r),i!=null&&i.onDelete&&(n(2,f=i.onDelete(r)),await f),he(s,r=[],r),p()}catch(_){console.error("Error deleting files",_)}}return e.$$.update=()=>{e.$$.dirty&257&&(o||c)&&p()},[c,u,f,d,r,s,m,g,o]}class yc extends se{constructor(t){super(),ce(this,t,vc,bc,oe,{})}}function kc(e){let t,n,r,i,o,l,a,c,s=e[0].name+"",u,f,d;return{c(){t=E("div"),n=E("input"),r=V(),i=E("img"),a=V(),c=E("small"),u=te(s),h(n,"type","checkbox"),h(n,"name","media-select"),h(n,"class","svelte-9g6man"),Vt(i.src,o=e[0].url_preview)||h(i,"src",o),h(i,"alt",l=e[0].alt),h(i,"loading","lazy"),h(i,"crossorigin","use-credentials"),h(i,"class","svelte-9g6man"),h(c,"class","svelte-9g6man"),h(t,"class","svelte-9g6man")},m(p,m){I(p,t,m),b(t,n),b(t,r),b(t,i),b(t,a),b(t,c),b(c,u),f||(d=Z(n,"change",e[2]),f=!0)},p(p,[m]){m&1&&!Vt(i.src,o=p[0].url_preview)&&h(i,"src",o),m&1&&l!==(l=p[0].alt)&&h(i,"alt",l),m&1&&s!==(s=p[0].name+"")&&_e(u,s)},i:v,o:v,d(p){p&&F(t),f=!1,d()}}}function Ac(e,t,n){let r;const i=xn("selectedMediaFiles");z(e,i,a=>n(3,r=a));let{media:o}=t;function l(a){a.target.checked?he(i,r=[...r,o],r):he(i,r=r.filter(c=>c!==o),r)}return e.$$set=a=>{"media"in a&&n(0,o=a.media)},[o,i,l]}class Ec extends se{constructor(t){super(),ce(this,t,Ac,kc,oe,{media:0})}}const ji='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>file-upload</title><path d="M14,2H6A2,2 0 0,0 4,4V20A2,2 0 0,0 6,22H18A2,2 0 0,0 20,20V8L14,2M13.5,16V19H10.5V16H8L12,12L16,16H13.5M13,9V3.5L18.5,9H13Z" /></svg>';function dr(e,t,n){const r=e.slice();return r[9]=t[n],r}function Cc(e){let t,n=[],r=new Map,i,o=Ee(e[1]);const l=a=>a[9].name;for(let a=0;a<o.length;a+=1){let c=dr(e,o,a),s=l(c);r.set(s,n[a]=pr(s,c))}return{c(){t=E("div");for(let a=0;a<n.length;a+=1)n[a].c();h(t,"id","items"),h(t,"class","svelte-12p8acg")},m(a,c){I(a,t,c);for(let s=0;s<n.length;s+=1)n[s]&&n[s].m(t,null);i=!0},p(a,c){c&2&&(o=Ee(a[1]),ye(),n=Ft(n,c,l,1,a,o,r,t,Tn,pr,null,dr),ke())},i(a){if(!i){for(let c=0;c<o.length;c+=1)H(n[c]);i=!0}},o(a){for(let c=0;c<n.length;c+=1)j(n[c]);i=!1},d(a){a&&F(t);for(let c=0;c<n.length;c+=1)n[c].d()}}}function Sc(e){let t,n,r,i,o,l,a,c;return{c(){t=E("div"),n=E("p"),n.textContent="No files found.",r=V(),i=E("button"),o=new Ze(!1),l=te("Upload a File"),o.a=l,h(i,"class","svelte-12p8acg"),h(t,"id","empty"),h(t,"class","svelte-12p8acg")},m(s,u){I(s,t,u),b(t,n),b(t,r),b(t,i),o.m(ji,i),b(i,l),a||(c=Z(i,"click",e[4]),a=!0)},p:v,i:v,o:v,d(s){s&&F(t),a=!1,c()}}}function pr(e,t){let n,r,i;return r=new Ec({props:{media:t[9]}}),{key:e,first:null,c(){n=Oe(),J(r.$$.fragment),this.first=n},m(o,l){I(o,n,l),Q(r,o,l),i=!0},p(o,l){t=o;const a={};l&2&&(a.media=t[9]),r.$set(a)},i(o){i||(H(r.$$.fragment,o),i=!0)},o(o){j(r.$$.fragment,o),i=!1},d(o){o&&F(n),X(r,o)}}}function xc(e){let t,n;return t=new Qe({props:{msg:"Error getting entries",details:e[8].message}}),{c(){J(t.$$.fragment)},m(r,i){Q(t,r,i),n=!0},p(r,i){const o={};i&1&&(o.details=r[8].message),t.$set(o)},i(r){n||(H(t.$$.fragment,r),n=!0)},o(r){j(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Lc(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Tc(e){let t,n;return t=new en({props:{msg:"Loading"}}),{c(){J(t.$$.fragment)},m(r,i){Q(t,r,i),n=!0},p:v,i(r){n||(H(t.$$.fragment,r),n=!0)},o(r){j(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Mc(e){let t,n,r,i,o,l,a,c,s,u,f,d,p,m,g,_,k,A,S,$;const M=[Sc,Cc],P=[];function N(R,D){return R[1].length===0?0:1}m=N(e),g=P[m]=M[m](e);let C={ctx:e,current:null,token:null,hasCatch:!0,pending:Tc,then:Lc,catch:xc,error:8,blocks:[,,,]};return ue(k=e[0],C),{c(){t=E("main"),n=E("header"),r=te(`Media Files
33
+ `),i=E("div"),o=E("button"),l=new Ze(!1),a=te("Delete"),s=V(),u=E("button"),f=new Ze(!1),d=te("Upload"),p=V(),g.c(),_=V(),C.block.c(),l.a=a,h(o,"class","outline svelte-12p8acg"),o.disabled=c=e[2].length===0,f.a=d,h(u,"class","svelte-12p8acg"),h(i,"id","listActions"),h(i,"class","svelte-12p8acg"),h(n,"class","svelte-12p8acg"),h(t,"class","svelte-12p8acg")},m(R,D){I(R,t,D),b(t,n),b(n,r),b(n,i),b(i,o),l.m(Pi,o),b(o,a),b(i,s),b(i,u),f.m(ji,u),b(u,d),b(t,p),P[m].m(t,null),b(t,_),C.block.m(t,C.anchor=null),C.mount=()=>t,C.anchor=null,A=!0,S||($=[Z(o,"click",e[5]),Z(u,"click",e[4])],S=!0)},p(R,[D]){e=R,(!A||D&4&&c!==(c=e[2].length===0))&&(o.disabled=c);let x=m;m=N(e),m===x?P[m].p(e,D):(ye(),j(P[x],1,1,()=>{P[x]=null}),ke(),g=P[m],g?g.p(e,D):(g=P[m]=M[m](e),g.c()),H(g,1),g.m(t,_)),C.ctx=e,D&1&&k!==(k=e[0])&&ue(k,C)||Pe(C,e,D)},i(R){A||(H(g),H(C.block),A=!0)},o(R){j(g);for(let D=0;D<3;D+=1){const x=C.blocks[D];j(x)}A=!1},d(R){R&&F(t),P[m].d(),C.block.d(),C.token=null,C=null,S=!1,fe($)}}}function Oc(e,t,n){let r,i;z(e,Ve,f=>n(6,i=f));const o=nt([]);z(e,o,f=>n(2,r=f)),Sn("selectedMediaFiles",o);let l,a=[];async function c(){try{n(0,l=i==null?void 0:i.getMediaFiles()),n(1,a=await l||[])}catch{}}async function s(){await i.uploadMediaFile(),c()}async function u(){try{await i.deleteFiles(r),he(o,r=[],r),c()}catch(f){console.error("Error deleting files",f)}}return e.$$.update=()=>{e.$$.dirty&64&&i&&c()},[l,a,r,o,s,u,i]}class Dc extends se{constructor(t){super(),ce(this,t,Oc,Mc,oe,{})}}function hr(e,t,n){const r=e.slice();return r[5]=t[n],r}function Fc(e){let t,n;return t=new Dc({}),{c(){J(t.$$.fragment)},m(r,i){Q(t,r,i),n=!0},p:v,i(r){n||(H(t.$$.fragment,r),n=!0)},o(r){j(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Hc(e){let t,n,r,i,o,l=e[0]&&mr(e);return i=new yc({}),{c(){t=E("aside"),n=E("ul"),l&&l.c(),r=V(),J(i.$$.fragment),h(n,"class","svelte-17x5uzj"),h(t,"class","svelte-17x5uzj")},m(a,c){I(a,t,c),b(t,n),l&&l.m(n,null),I(a,r,c),Q(i,a,c),o=!0},p(a,c){a[0]?l?(l.p(a,c),c&1&&H(l,1)):(l=mr(a),l.c(),H(l,1),l.m(n,null)):l&&(ye(),j(l,1,1,()=>{l=null}),ke())},i(a){o||(H(l),H(i.$$.fragment,a),o=!0)},o(a){j(l),j(i.$$.fragment,a),o=!1},d(a){a&&(F(t),F(r)),l&&l.d(),X(i,a)}}}function mr(e){let t,n,r=Ee(e[0]),i=[];for(let l=0;l<r.length;l+=1)i[l]=gr(hr(e,r,l));const o=l=>j(i[l],1,1,()=>{i[l]=null});return{c(){for(let l=0;l<i.length;l+=1)i[l].c();t=Oe()},m(l,a){for(let c=0;c<i.length;c+=1)i[c]&&i[c].m(l,a);I(l,t,a),n=!0},p(l,a){if(a&1){r=Ee(l[0]);let c;for(c=0;c<r.length;c+=1){const s=hr(l,r,c);i[c]?(i[c].p(s,a),H(i[c],1)):(i[c]=gr(s),i[c].c(),H(i[c],1),i[c].m(t.parentNode,t))}for(ye(),c=r.length;c<i.length;c+=1)o(c);ke()}},i(l){if(!n){for(let a=0;a<r.length;a+=1)H(i[a]);n=!0}},o(l){i=i.filter(Boolean);for(let a=0;a<i.length;a+=1)j(i[a]);n=!1},d(l){l&&F(t),un(i,l)}}}function gr(e){let t,n;const r=[e[5]];let i={};for(let o=0;o<r.length;o+=1)i=lt(i,r[o]);return t=new tc({props:i}),{c(){J(t.$$.fragment)},m(o,l){Q(t,o,l),n=!0},p(o,l){const a=l&1?ct(r,[st(o[5])]):{};t.$set(a)},i(o){n||(H(t.$$.fragment,o),n=!0)},o(o){j(t.$$.fragment,o),n=!1},d(o){X(t,o)}}}function Ic(e){let t,n,r,i,o,l;t=new Qa({}),t.$on("selectview",e[2]);const a=[Hc,Fc],c=[];function s(u,f){return u[1]==="posts"?0:u[1]==="media"?1:-1}return~(i=s(e))&&(o=c[i]=a[i](e)),{c(){J(t.$$.fragment),n=V(),r=E("div"),o&&o.c(),h(r,"id","dash"),h(r,"class","page svelte-17x5uzj")},m(u,f){Q(t,u,f),I(u,n,f),I(u,r,f),~i&&c[i].m(r,null),l=!0},p(u,[f]){let d=i;i=s(u),i===d?~i&&c[i].p(u,f):(o&&(ye(),j(c[d],1,1,()=>{c[d]=null}),ke()),~i?(o=c[i],o?o.p(u,f):(o=c[i]=a[i](u),o.c()),H(o,1),o.m(r,null)):o=null)},i(u){l||(H(t.$$.fragment,u),H(o),l=!0)},o(u){j(t.$$.fragment,u),j(o),l=!1},d(u){u&&(F(n),F(r)),X(t,u),~i&&c[i].d()}}}function Nc(e,t,n){let r,i,o;z(e,$e,c=>n(3,i=c)),z(e,Ce,c=>n(4,o=c));let l="posts";function a(c){n(1,l=c.detail)}return e.$$.update=()=>{e.$$.dirty&16&&n(0,r=o==null?void 0:o.collections),e.$$.dirty&9&&(i||he($e,i=r==null?void 0:r[0],i))},[r,l,a,i,o]}class Rc extends se{constructor(t){super(),ce(this,t,Nc,Ic,oe,{})}}const Pc='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>arrow-left</title><path d="M20,11V13H8L13.5,18.5L12.08,19.92L4.16,12L12.08,4.08L13.5,5.5L8,11H20Z" /></svg>',Rn=(()=>{if(typeof self>"u")return!1;if("top"in self&&self!==top)try{top.window.document._=0}catch{return!1}return"showOpenFilePicker"in self})(),$c=Rn?Promise.resolve().then(function(){return Bc}):Promise.resolve().then(function(){return Qc});async function Pn(...e){return(await $c).default(...e)}const jc=Rn?Promise.resolve().then(function(){return Wc}):Promise.resolve().then(function(){return Jc});async function Vc(...e){return(await jc).default(...e)}const qc=Rn?Promise.resolve().then(function(){return Zc}):Promise.resolve().then(function(){return ts});async function wn(...e){return(await qc).default(...e)}const Yc=async e=>{const t=await e.getFile();return t.handle=e,t};var Uc=async(e=[{}])=>{Array.isArray(e)||(e=[e]);const t=[];e.forEach((i,o)=>{t[o]={description:i.description||"Files",accept:{}},i.mimeTypes?i.mimeTypes.map(l=>{t[o].accept[l]=i.extensions||[]}):t[o].accept["*/*"]=i.extensions||[]});const n=await window.showOpenFilePicker({id:e[0].id,startIn:e[0].startIn,types:t,multiple:e[0].multiple||!1,excludeAcceptAllOption:e[0].excludeAcceptAllOption||!1}),r=await Promise.all(n.map(Yc));return e[0].multiple?r:r[0]},Bc={__proto__:null,default:Uc};function $t(e){function t(n){if(Object(n)!==n)return Promise.reject(new TypeError(n+" is not an object."));var r=n.done;return Promise.resolve(n.value).then(function(i){return{value:i,done:r}})}return $t=function(n){this.s=n,this.n=n.next},$t.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(n){var r=this.s.return;return r===void 0?Promise.resolve({value:n,done:!0}):t(r.apply(this.s,arguments))},throw:function(n){var r=this.s.return;return r===void 0?Promise.reject(n):t(r.apply(this.s,arguments))}},new $t(e)}const Vi=async(e,t,n=e.name,r)=>{const i=[],o=[];var l,a=!1,c=!1;try{for(var s,u=function(f){var d,p,m,g=2;for(typeof Symbol<"u"&&(p=Symbol.asyncIterator,m=Symbol.iterator);g--;){if(p&&(d=f[p])!=null)return d.call(f);if(m&&(d=f[m])!=null)return new $t(d.call(f));p="@@asyncIterator",m="@@iterator"}throw new TypeError("Object is not async iterable")}(e.values());a=!(s=await u.next()).done;a=!1){const f=s.value,d=`${n}/${f.name}`;f.kind==="file"?o.push(f.getFile().then(p=>(p.directoryHandle=e,p.handle=f,Object.defineProperty(p,"webkitRelativePath",{configurable:!0,enumerable:!0,get:()=>d})))):f.kind!=="directory"||!t||r&&r(f)||i.push(Vi(f,t,d,r))}}catch(f){c=!0,l=f}finally{try{a&&u.return!=null&&await u.return()}finally{if(c)throw l}}return[...(await Promise.all(i)).flat(),...await Promise.all(o)]};var Gc=async(e={})=>{e.recursive=e.recursive||!1,e.mode=e.mode||"read";const t=await window.showDirectoryPicker({id:e.id,startIn:e.startIn,mode:e.mode});return(await(await t.values()).next()).done?[t]:Vi(t,e.recursive,void 0,e.skipDirectory)},Wc={__proto__:null,default:Gc},zc=async(e,t=[{}],n=null,r=!1,i=null)=>{Array.isArray(t)||(t=[t]),t[0].fileName=t[0].fileName||"Untitled";const o=[];let l=null;if(e instanceof Blob&&e.type?l=e.type:e.headers&&e.headers.get("content-type")&&(l=e.headers.get("content-type")),t.forEach((s,u)=>{o[u]={description:s.description||"Files",accept:{}},s.mimeTypes?(u===0&&l&&s.mimeTypes.push(l),s.mimeTypes.map(f=>{o[u].accept[f]=s.extensions||[]})):l?o[u].accept[l]=s.extensions||[]:o[u].accept["*/*"]=s.extensions||[]}),n)try{await n.getFile()}catch(s){if(n=null,r)throw s}const a=n||await window.showSaveFilePicker({suggestedName:t[0].fileName,id:t[0].id,startIn:t[0].startIn,types:o,excludeAcceptAllOption:t[0].excludeAcceptAllOption||!1});!n&&i&&i(a);const c=await a.createWritable();return"stream"in e?(await e.stream().pipeTo(c),a):"body"in e?(await e.body.pipeTo(c),a):(await c.write(await e),await c.close(),a)},Zc={__proto__:null,default:zc},Kc=async(e=[{}])=>(Array.isArray(e)||(e=[e]),new Promise((t,n)=>{const r=document.createElement("input");r.type="file";const i=[...e.map(c=>c.mimeTypes||[]),...e.map(c=>c.extensions||[])].join();r.multiple=e[0].multiple||!1,r.accept=i||"",r.style.display="none",document.body.append(r);const o=c=>{typeof l=="function"&&l(),t(c)},l=e[0].legacySetup&&e[0].legacySetup(o,()=>l(n),r),a=()=>{window.removeEventListener("focus",a),r.remove()};r.addEventListener("click",()=>{window.addEventListener("focus",a)}),r.addEventListener("change",()=>{window.removeEventListener("focus",a),r.remove(),o(r.multiple?Array.from(r.files):r.files[0])}),"showPicker"in HTMLInputElement.prototype?r.showPicker():r.click()})),Qc={__proto__:null,default:Kc},Xc=async(e=[{}])=>(Array.isArray(e)||(e=[e]),e[0].recursive=e[0].recursive||!1,new Promise((t,n)=>{const r=document.createElement("input");r.type="file",r.webkitdirectory=!0;const i=l=>{typeof o=="function"&&o(),t(l)},o=e[0].legacySetup&&e[0].legacySetup(i,()=>o(n),r);r.addEventListener("change",()=>{let l=Array.from(r.files);e[0].recursive?e[0].recursive&&e[0].skipDirectory&&(l=l.filter(a=>a.webkitRelativePath.split("/").every(c=>!e[0].skipDirectory({name:c,kind:"directory"})))):l=l.filter(a=>a.webkitRelativePath.split("/").length===2),i(l)}),"showPicker"in HTMLInputElement.prototype?r.showPicker():r.click()})),Jc={__proto__:null,default:Xc},es=async(e,t={})=>{Array.isArray(t)&&(t=t[0]);const n=document.createElement("a");let r=e;"body"in e&&(r=await async function(l,a){const c=l.getReader(),s=new ReadableStream({start:d=>async function p(){return c.read().then(({done:m,value:g})=>{if(!m)return d.enqueue(g),p();d.close()})}()}),u=new Response(s),f=await u.blob();return c.releaseLock(),new Blob([f],{type:a})}(e.body,e.headers.get("content-type"))),n.download=t.fileName||"Untitled",n.href=URL.createObjectURL(await r);const i=()=>{typeof o=="function"&&o()},o=t.legacySetup&&t.legacySetup(i,()=>o(),n);return n.addEventListener("click",()=>{setTimeout(()=>URL.revokeObjectURL(n.href),3e4),i()}),n.click(),null},ts={__proto__:null,default:es},qi={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Ii,function(){var n={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,o=/\d\d/,l=/\d\d?/,a=/\d*[^-_:/,()\s\d]+/,c={},s=function(_){return(_=+_)+(_>68?1900:2e3)},u=function(_){return function(k){this[_]=+k}},f=[/[+-]\d\d:?(\d\d)?|Z/,function(_){(this.zone||(this.zone={})).offset=function(k){if(!k||k==="Z")return 0;var A=k.match(/([+-]|\d\d)/g),S=60*A[1]+(+A[2]||0);return S===0?0:A[0]==="+"?-S:S}(_)}],d=function(_){var k=c[_];return k&&(k.indexOf?k:k.s.concat(k.f))},p=function(_,k){var A,S=c.meridiem;if(S){for(var $=1;$<=24;$+=1)if(_.indexOf(S($,0,k))>-1){A=$>12;break}}else A=_===(k?"pm":"PM");return A},m={A:[a,function(_){this.afternoon=p(_,!1)}],a:[a,function(_){this.afternoon=p(_,!0)}],Q:[i,function(_){this.month=3*(_-1)+1}],S:[i,function(_){this.milliseconds=100*+_}],SS:[o,function(_){this.milliseconds=10*+_}],SSS:[/\d{3}/,function(_){this.milliseconds=+_}],s:[l,u("seconds")],ss:[l,u("seconds")],m:[l,u("minutes")],mm:[l,u("minutes")],H:[l,u("hours")],h:[l,u("hours")],HH:[l,u("hours")],hh:[l,u("hours")],D:[l,u("day")],DD:[o,u("day")],Do:[a,function(_){var k=c.ordinal,A=_.match(/\d+/);if(this.day=A[0],k)for(var S=1;S<=31;S+=1)k(S).replace(/\[|\]/g,"")===_&&(this.day=S)}],w:[l,u("week")],ww:[o,u("week")],M:[l,u("month")],MM:[o,u("month")],MMM:[a,function(_){var k=d("months"),A=(d("monthsShort")||k.map(function(S){return S.slice(0,3)})).indexOf(_)+1;if(A<1)throw new Error;this.month=A%12||A}],MMMM:[a,function(_){var k=d("months").indexOf(_)+1;if(k<1)throw new Error;this.month=k%12||k}],Y:[/[+-]?\d+/,u("year")],YY:[o,function(_){this.year=s(_)}],YYYY:[/\d{4}/,u("year")],Z:f,ZZ:f};function g(_){var k,A;k=_,A=c&&c.formats;for(var S=(_=k.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(D,x,B){var W=B&&B.toUpperCase();return x||A[B]||n[B]||A[W].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(O,y,w){return y||w.slice(1)})})).match(r),$=S.length,M=0;M<$;M+=1){var P=S[M],N=m[P],C=N&&N[0],R=N&&N[1];S[M]=R?{regex:C,parser:R}:P.replace(/^\[|\]$/g,"")}return function(D){for(var x={},B=0,W=0;B<$;B+=1){var O=S[B];if(typeof O=="string")W+=O.length;else{var y=O.regex,w=O.parser,L=D.slice(W),T=y.exec(L)[0];w.call(x,T),D=D.replace(T,"")}}return function(q){var G=q.afternoon;if(G!==void 0){var K=q.hours;G?K<12&&(q.hours+=12):K===12&&(q.hours=0),delete q.afternoon}}(x),x}}return function(_,k,A){A.p.customParseFormat=!0,_&&_.parseTwoDigitYear&&(s=_.parseTwoDigitYear);var S=k.prototype,$=S.parse;S.parse=function(M){var P=M.date,N=M.utc,C=M.args;this.$u=N;var R=C[1];if(typeof R=="string"){var D=C[2]===!0,x=C[3]===!0,B=D||x,W=C[2];x&&(W=C[2]),c=this.$locale(),!D&&W&&(c=A.Ls[W]),this.$d=function(L,T,q,G){try{if(["x","X"].indexOf(T)>-1)return new Date((T==="X"?1e3:1)*L);var K=g(T)(L),re=K.year,ie=K.month,de=K.day,Ae=K.hours,qe=K.minutes,Ie=K.seconds,We=K.milliseconds,Fe=K.zone,me=K.week,Le=new Date,Ne=de||(re||ie?1:Le.getDate()),Ye=re||Le.getFullYear(),ft=0;re&&!ie||(ft=ie>0?ie-1:Le.getMonth());var Y,ee=Ae||0,ne=qe||0,le=Ie||0,Re=We||0;return Fe?new Date(Date.UTC(Ye,ft,Ne,ee,ne,le,Re+60*Fe.offset*1e3)):q?new Date(Date.UTC(Ye,ft,Ne,ee,ne,le,Re)):(Y=new Date(Ye,ft,Ne,ee,ne,le,Re),me&&(Y=G(Y).week(me).toDate()),Y)}catch{return new Date("")}}(P,R,N,A),this.init(),W&&W!==!0&&(this.$L=this.locale(W).$L),B&&P!=this.format(R)&&(this.$d=new Date("")),c={}}else if(R instanceof Array)for(var O=R.length,y=1;y<=O;y+=1){C[1]=R[y-1];var w=A.apply(this,C);if(w.isValid()){this.$d=w.$d,this.$L=w.$L,this.init();break}y===O&&(this.$d=new Date(""))}else $.call(this,M)}}})})(qi);var ns=qi.exports;const Yi=Ni(ns);Te.extend(Yi);const $n="../../cms-config/",_r=`Unable to parse markdown entry. Backend must implement 'replacePreviewLinks()'
34
+ and return a valid string.`;function zt(e,t){let n=Te(t),r="";switch(e){case"datetime-local":r=n.format("YYYY-MM-DDTHH:mm");break;case"date":r=n.format("YYYY-MM-DD");break;case"time":r=n.format("HH:mm");break}return r}function rs(e,t){var i;const n=(i=e==null?void 0:e.previews.styles.find(o=>o.name===t))==null?void 0:i.files;if(!n)return;const r=[];return n.forEach(o=>{const l=`${$n}${o}`;r.push(new URL(l,window.location.href).href)}),r.map(o=>`<link rel="stylesheet" href="${o}">`).join(`
35
+ `)}async function is(e,t){var i;const n=(i=e==null?void 0:e.previews.templates.find(o=>o.name===t))==null?void 0:i.template;if(!n)return;const r=new URL(`${$n}${n}`,window.location.href).href;try{const o=await fetch(r);if(!o.ok)throw new Error(`Unable to fetch file ${r}`);return await o.text()}catch(o){console.error(o);return}}function os(e,t){return e==null?void 0:e.replace("{{styles}}",t).replaceAll("{{",'<span data-tag="').replaceAll("}}",'"></span>')}async function Ui(e,t,n){let r;switch(e.widget){case"markdown":if(!(n!=null&&n.replacePreviewLinks))throw new Error(_r);if(r=await(n==null?void 0:n.replacePreviewLinks(t)),r==null)throw new Error(_r);break;case"datetime":let i;switch(e.type){case"time":i=Te(t.toString(),"hh:mm").toISOString();break;case"date":i=Te(t.toString(),"YYYY-MM-DD").toISOString();break;default:i=Te(t.toString(),"YYYY-MM-DDThh:mm").toISOString();break}r=new Date(i);break;case"boolean":r=t==="true";break;case"number":r=Number(t);break;case"hidden":switch(e.type){case"datetime-local":r=new Date(Te(t.toString(),"YYYY-MM-DDThh:mm").toISOString());break;case"time":r=new Date(Te(t.toString(),"hh:mm").toISOString());break;case"date":r=new Date(Te(t.toString(),"YYYY-MM-DD").toISOString());break;case"boolean":r=t==="true";break;case"number":r=Number(t);break;default:r=t;break}break;default:r=t;break}return r}function ls(e,t){const{slug:n,extension:r}=e,{title:i,date:o}=t,l=i.toLowerCase().replaceAll(/\W+/g,"-"),a=Te(o);return`${n.replaceAll("{{slug}}",l).replaceAll("{{year}}",a.format("YYYY")).replaceAll("{{month}}",a.format("MM")).replaceAll("{{day}}",a.format("DD")).replaceAll("{{hour}}",a.format("HH")).replaceAll("{{minute}}",a.format("mm")).replaceAll("{{second}}",a.format("ss"))}.${r}`}function as(e,t){const n={...t},{date:r,body:i}={...n.fields};delete n.fields.body;const o=Jt.dump(n.fields,{quotingType:'"',forceQuotes:!0});return n.date=r,n.body=i,n.collection=e.name,n.name||(n.name=ls(e,n.fields)),n.raw=`---
36
+ ${o}---
37
37
 
38
- ${n.body}`,n}function jn(e){if(!/^---(\r?\n)/.test(e.trim()))return["date: 0001-01-01T12:00:00-00:00",e.trim()];const t="---",n="{#{br}#}";return e.trim().replace(t,n).replace(t,n).split(n).filter(l=>l.length>0).map(l=>l.trim())}function cs(e){switch(e){case".md":case".markdown":return"text/markdown";default:return"text/plain"}}function It(e){var l;const t=/!?\[.+\]\(.+\)/g,n=/!?\[.+\]\(/,r=/\)/;return((l=e.match(t))==null?void 0:l.map(o=>o.replace(n,"").replace(r,"")))||[]}async function ss(e,t){const{file:n}=Ie(e).backend;if(!n)return;const i=await import(new URL(`${$n}${n}`,window.location.href).href),l={configStore:e,backendStore:t,getStoreValueFunc:Ie,getContentsFunc:jn,parseLinksFunc:It,fileOpenFunc:Pn};return i.default.init(l)}function us(e){let t,n,r;return{c(){t=k("button"),n=ee("Save"),m(t,"form","entry-data"),t.disabled=r=!e[1]},m(i,l){N(i,t,l),w(t,n)},p(i,l){l&2&&r!==(r=!i[1])&&(t.disabled=r)},d(i){i&&H(t)}}}function fs(e){let t,n,r;return{c(){t=k("button"),n=ee("Save"),m(t,"form","entry-data"),t.disabled=r=!e[1]},m(i,l){N(i,t,l),w(t,n)},p(i,l){l&2&&r!==(r=!i[1])&&(t.disabled=r)},d(i){i&&H(t)}}}function ds(e){let t;return{c(){t=k("button"),t.textContent="Save",m(t,"form","entry-data"),t.disabled=!0},m(n,r){N(n,t,r)},p:b,d(n){n&&H(t)}}}function ps(e){var R,F;let t,n,r,i,l,o,a,c=((R=e[2])==null?void 0:R.label)+"",s,f,u,d,p=(((F=e[0])==null?void 0:F.fields.title)||"New File")+"",g,h,v,A,E,T,j,D={ctx:e,current:null,token:null,hasCatch:!0,pending:ds,then:fs,catch:us,value:10,error:11};return se(E=e[3],D),{c(){t=k("nav"),n=k("ul"),r=k("li"),i=k("a"),l=q(),o=k("ul"),a=k("li"),s=ee(c),f=q(),u=k("span"),u.textContent="/",d=q(),g=ee(p),h=q(),v=k("ul"),A=k("li"),D.block.c(),m(i,"href","##placeholder"),m(i,"class","svelte-1gmahua"),m(u,"class","svelte-1gmahua"),m(a,"class","svelte-1gmahua")},m(C,P){N(C,t,P),w(t,n),w(n,r),w(r,i),i.innerHTML=Pc,w(t,l),w(t,o),w(o,a),w(a,s),w(a,f),w(a,u),w(a,d),w(a,g),w(t,h),w(t,v),w(v,A),D.block.m(A,D.anchor=null),D.mount=()=>A,D.anchor=null,T||(j=Z(i,"click",Ue(hs)),T=!0)},p(C,[P]){var M,S;e=C,P&4&&c!==(c=((M=e[2])==null?void 0:M.label)+"")&&_e(s,c),P&1&&p!==(p=(((S=e[0])==null?void 0:S.fields.title)||"New File")+"")&&_e(g,p),D.ctx=e,P&8&&E!==(E=e[3])&&se(E,D)||Pe(D,e,P)},i:b,o:b,d(C){C&&H(t),D.block.d(),D.token=null,D=null,T=!1,j()}}}function hs(){history.back()}function ms(e,t,n){let r,i,l,o,a;W(e,Ve,p=>n(7,r=p)),W(e,Fe,p=>n(0,i=p)),W(e,$e,p=>n(2,l=p)),W(e,we,p=>n(5,o=p));let c,s=!1;const f=xn("submitted");W(e,f,p=>n(3,a=p));async function u(p){c&&n(1,s=!await d())}async function d(){if(!i)return!1;const p=new FormData(c);for(const[g,h]of p){const v=l.fields.find(D=>D.name===g),A=(i==null?void 0:i.fields[v.name])??i[v.name],E=await Ui(v,h,r);let T,j;switch(v.widget){case"datetime":T=new Date(A).getTime(),j=E.getTime();break;case"markdown":T=A.trim().replaceAll(`\r
38
+ ${n.body}`,n}function jn(e){if(!/^---(\r?\n)/.test(e.trim()))return["date: 0001-01-01T12:00:00-00:00",e.trim()];const t="---",n="{#{br}#}";return e.trim().replace(t,n).replace(t,n).split(n).filter(o=>o.length>0).map(o=>o.trim())}function cs(e){switch(e){case".md":case".markdown":return"text/markdown";default:return"text/plain"}}function Ht(e){var o;const t=/!?\[.+\]\(.+\)/g,n=/!?\[.+\]\(/,r=/\)/;return((o=e.match(t))==null?void 0:o.map(l=>l.replace(n,"").replace(r,"")))||[]}async function ss(e,t){const{file:n}=He(e).backend;if(!n)return;const i=await import(new URL(`${$n}${n}`,window.location.href).href),o={configStore:e,backendStore:t,getStoreValueFunc:He,getContentsFunc:jn,parseLinksFunc:Ht,fileOpenFunc:Pn};return i.default.init(o)}function us(e){let t,n,r;return{c(){t=E("button"),n=te("Save"),h(t,"form","entry-data"),t.disabled=r=!e[1]},m(i,o){I(i,t,o),b(t,n)},p(i,o){o&2&&r!==(r=!i[1])&&(t.disabled=r)},d(i){i&&F(t)}}}function fs(e){let t,n,r;return{c(){t=E("button"),n=te("Save"),h(t,"form","entry-data"),t.disabled=r=!e[1]},m(i,o){I(i,t,o),b(t,n)},p(i,o){o&2&&r!==(r=!i[1])&&(t.disabled=r)},d(i){i&&F(t)}}}function ds(e){let t;return{c(){t=E("button"),t.textContent="Save",h(t,"form","entry-data"),t.disabled=!0},m(n,r){I(n,t,r)},p:v,d(n){n&&F(t)}}}function ps(e){var P,N;let t,n,r,i,o,l,a,c=((P=e[2])==null?void 0:P.label)+"",s,u,f,d,p=(((N=e[0])==null?void 0:N.fields.title)||"New File")+"",m,g,_,k,A,S,$,M={ctx:e,current:null,token:null,hasCatch:!0,pending:ds,then:fs,catch:us,value:10,error:11};return ue(A=e[3],M),{c(){t=E("nav"),n=E("ul"),r=E("li"),i=E("a"),o=V(),l=E("ul"),a=E("li"),s=te(c),u=V(),f=E("span"),f.textContent="/",d=V(),m=te(p),g=V(),_=E("ul"),k=E("li"),M.block.c(),h(i,"href","##back"),h(i,"class","svelte-1gmahua"),h(f,"class","svelte-1gmahua"),h(a,"class","svelte-1gmahua")},m(C,R){I(C,t,R),b(t,n),b(n,r),b(r,i),i.innerHTML=Pc,b(t,o),b(t,l),b(l,a),b(a,s),b(a,u),b(a,f),b(a,d),b(a,m),b(t,g),b(t,_),b(_,k),M.block.m(k,M.anchor=null),M.mount=()=>k,M.anchor=null,S||($=Z(i,"click",Ue(hs)),S=!0)},p(C,[R]){var D,x;e=C,R&4&&c!==(c=((D=e[2])==null?void 0:D.label)+"")&&_e(s,c),R&1&&p!==(p=(((x=e[0])==null?void 0:x.fields.title)||"New File")+"")&&_e(m,p),M.ctx=e,R&8&&A!==(A=e[3])&&ue(A,M)||Pe(M,e,R)},i:v,o:v,d(C){C&&F(t),M.block.d(),M.token=null,M=null,S=!1,$()}}}function hs(){history.back()}function ms(e,t,n){let r,i,o,l,a;z(e,Ve,p=>n(7,r=p)),z(e,De,p=>n(0,i=p)),z(e,$e,p=>n(2,o=p)),z(e,we,p=>n(5,l=p));let c,s=!1;const u=xn("submitted");z(e,u,p=>n(3,a=p));async function f(){c&&n(1,s=!await d())}async function d(){if(!i)return!1;const p=new FormData(c);for(const[m,g]of p){const _=o.fields.find(M=>M.name===m),k=(i==null?void 0:i.fields[_.name])??i[_.name],A=await Ui(_,g,r);let S,$;switch(_.widget){case"datetime":S=new Date(k).getTime(),$=A.getTime();break;case"markdown":S=k.trim().replaceAll(`\r
39
39
  `,`
40
- `),j=E.trim().replaceAll(`\r
40
+ `),$=A.trim().replaceAll(`\r
41
41
  `,`
42
- `);break;case"hidden":switch(v.type){case"datetime-local":case"date":case"time":T=new Date(A).getTime(),j=E.getTime();break;default:T=A,j=E;break}break;default:T=A,j=E;break}if(T!==j)return!1}return!0}return je(()=>{c=document.querySelector("#entry-data")}),e.$$.update=()=>{e.$$.dirty&33&&u()},[i,s,l,a,f,o]}class gs extends ce{constructor(t){super(),ae(this,t,ms,ps,ie,{})}}function _s(e){let t,n,r,i,l,o,a,c;return{c(){t=k("label"),n=ee(e[2]),r=q(),i=k("input"),l=q(),o=k("input"),m(i,"type","checkbox"),m(i,"role","switch"),m(i,"id",e[1]),m(i,"name",e[1]),m(i,"form","ignore"),i.required=e[3],m(o,"type","hidden"),m(o,"id",e[1]),m(o,"name",e[1]),o.value=e[0],o.required=e[3],m(t,"class","editorInput"),m(t,"for",e[1])},m(s,f){N(s,t,f),w(t,n),w(t,r),w(t,i),i.checked=e[0],w(t,l),w(t,o),a||(c=[Z(i,"change",e[5]),Z(i,"change",e[4])],a=!0)},p(s,[f]){f&4&&_e(n,s[2]),f&2&&m(i,"id",s[1]),f&2&&m(i,"name",s[1]),f&8&&(i.required=s[3]),f&1&&(i.checked=s[0]),f&2&&m(o,"id",s[1]),f&2&&m(o,"name",s[1]),f&1&&(o.value=s[0]),f&8&&(o.required=s[3]),f&2&&m(t,"for",s[1])},i:b,o:b,d(s){s&&H(t),a=!1,ue(c)}}}function ws(e,t,n){let r,i,l;W(e,Fe,p=>n(6,r=p)),W(e,we,p=>n(7,i=p)),W(e,$e,p=>n(8,l=p));let{name:o}=t,{label:a}=t,{checked:c=!1}=t,{required:s=!0}=t;function f(){const p={...i};c==null?p[o]=l==null?void 0:l.fields.find(g=>g.name===o).default:p[o]=c,he(we,i=p,i)}async function u(){r&&n(0,c=r.fields[o]),f()}je(()=>{u()});function d(){c=this.checked,n(0,c)}return e.$$set=p=>{"name"in p&&n(1,o=p.name),"label"in p&&n(2,a=p.label),"checked"in p&&n(0,c=p.checked),"required"in p&&n(3,s=p.required)},[c,o,a,s,f,d]}class bs extends ce{constructor(t){super(),ae(this,t,ws,_s,ie,{name:1,label:2,checked:0,required:3})}}function vs(e){let t,n,r;return{c(){t=k("input"),m(t,"type","datetime-local"),m(t,"id",e[1]),m(t,"name",e[1]),t.required=e[4]},m(i,l){N(i,t,l),ve(t,e[0]),n||(r=[Z(t,"input",e[8]),Z(t,"input",e[5])],n=!0)},p(i,l){l&2&&m(t,"id",i[1]),l&2&&m(t,"name",i[1]),l&16&&(t.required=i[4]),l&1&&ve(t,i[0])},d(i){i&&H(t),n=!1,ue(r)}}}function ys(e){let t,n,r;return{c(){t=k("input"),m(t,"type","date"),m(t,"id",e[1]),m(t,"name",e[1]),t.required=e[4]},m(i,l){N(i,t,l),ve(t,e[0]),n||(r=[Z(t,"input",e[7]),Z(t,"input",e[5])],n=!0)},p(i,l){l&2&&m(t,"id",i[1]),l&2&&m(t,"name",i[1]),l&16&&(t.required=i[4]),l&1&&ve(t,i[0])},d(i){i&&H(t),n=!1,ue(r)}}}function ks(e){let t,n,r;return{c(){t=k("input"),m(t,"type","time"),m(t,"id",e[1]),m(t,"name",e[1]),t.required=e[4]},m(i,l){N(i,t,l),ve(t,e[0]),n||(r=[Z(t,"input",e[6]),Z(t,"input",e[5])],n=!0)},p(i,l){l&2&&m(t,"id",i[1]),l&2&&m(t,"name",i[1]),l&16&&(t.required=i[4]),l&1&&ve(t,i[0])},d(i){i&&H(t),n=!1,ue(r)}}}function As(e){let t,n,r;function i(a,c){return a[3]==="time"?ks:a[3]==="date"?ys:vs}let l=i(e),o=l(e);return{c(){t=k("label"),n=ee(e[2]),r=q(),o.c(),m(t,"class","editorInput"),m(t,"for",e[1])},m(a,c){N(a,t,c),w(t,n),w(t,r),o.m(t,null)},p(a,[c]){c&4&&_e(n,a[2]),l===(l=i(a))&&o?o.p(a,c):(o.d(1),o=l(a),o&&(o.c(),o.m(t,null))),c&2&&m(t,"for",a[1])},i:b,o:b,d(a){a&&H(t),o.d()}}}function Es(e,t,n){let r,i;W(e,Fe,h=>n(9,r=h)),W(e,we,h=>n(10,i=h));let{name:l}=t,{label:o}=t,{type:a="datetime-local"}=t,{value:c=Wt(a,new Date)}=t,{required:s=!0}=t;function f(){const h={...i};h[l]=c,he(we,i=h,i)}async function u(){if(r){const h=r.fields;n(0,c=Wt(a,new Date(h[l])))}f()}je(()=>{u()});function d(){c=this.value,n(0,c)}function p(){c=this.value,n(0,c)}function g(){c=this.value,n(0,c)}return e.$$set=h=>{"name"in h&&n(1,l=h.name),"label"in h&&n(2,o=h.label),"type"in h&&n(3,a=h.type),"value"in h&&n(0,c=h.value),"required"in h&&n(4,s=h.required)},[c,l,o,a,s,f,d,p,g]}class Cs extends ce{constructor(t){super(),ae(this,t,Es,As,ie,{name:1,label:2,type:3,value:0,required:4})}}function Ss(e){let t,n,r;return{c(){t=k("textarea"),m(t,"id",e[1]),m(t,"name",e[1]),t.required=e[4]},m(i,l){N(i,t,l),ve(t,e[0]),n||(r=[Z(t,"input",e[7]),Z(t,"input",e[5])],n=!0)},p(i,l){l&2&&m(t,"id",i[1]),l&2&&m(t,"name",i[1]),l&16&&(t.required=i[4]),l&1&&ve(t,i[0])},d(i){i&&H(t),n=!1,ue(r)}}}function xs(e){let t,n,r;return{c(){t=k("input"),m(t,"type","text"),m(t,"id",e[1]),m(t,"name",e[1]),t.required=e[4]},m(i,l){N(i,t,l),ve(t,e[0]),n||(r=[Z(t,"input",e[6]),Z(t,"input",e[5])],n=!0)},p(i,l){l&2&&m(t,"id",i[1]),l&2&&m(t,"name",i[1]),l&16&&(t.required=i[4]),l&1&&t.value!==i[0]&&ve(t,i[0])},d(i){i&&H(t),n=!1,ue(r)}}}function Ls(e){let t,n,r;function i(a,c){return a[3]?Ss:xs}let l=i(e),o=l(e);return{c(){t=k("label"),n=ee(e[2]),r=q(),o.c(),m(t,"class","editorInput"),m(t,"for",e[1])},m(a,c){N(a,t,c),w(t,n),w(t,r),o.m(t,null)},p(a,[c]){c&4&&_e(n,a[2]),l===(l=i(a))&&o?o.p(a,c):(o.d(1),o=l(a),o&&(o.c(),o.m(t,null))),c&2&&m(t,"for",a[1])},i:b,o:b,d(a){a&&H(t),o.d()}}}function Ts(e,t,n){let r,i,l;W(e,Fe,h=>n(8,r=h)),W(e,we,h=>n(9,i=h)),W(e,$e,h=>n(10,l=h));let{name:o}=t,{label:a}=t,{multiline:c=!1}=t,{required:s=!0}=t,{value:f=""}=t;function u(){const h={...i};f?h[o]=f:h[o]=l==null?void 0:l.fields.find(v=>v.name===o).label,he(we,i=h,i)}async function d(){r&&n(0,f=o==="body"?r.body:r.fields[o]),u()}je(()=>{d()});function p(){f=this.value,n(0,f)}function g(){f=this.value,n(0,f)}return e.$$set=h=>{"name"in h&&n(1,o=h.name),"label"in h&&n(2,a=h.label),"multiline"in h&&n(3,c=h.multiline),"required"in h&&n(4,s=h.required),"value"in h&&n(0,f=h.value)},[f,o,a,c,s,u,p,g]}class wr extends ce{constructor(t){super(),ae(this,t,Ts,Ls,ie,{name:1,label:2,multiline:3,required:4,value:0})}}function Ms(e){let t,n,r,i,l,o;return{c(){t=k("label"),n=ee(e[2]),r=q(),i=k("input"),m(i,"type","number"),m(i,"id",e[1]),m(i,"name",e[1]),m(i,"step",e[3]),m(i,"min",e[4]),m(i,"max",e[5]),i.required=e[6],m(t,"class","editorInput"),m(t,"for",e[1])},m(a,c){N(a,t,c),w(t,n),w(t,r),w(t,i),ve(i,e[0]),l||(o=[Z(i,"input",e[8]),Z(i,"input",e[7])],l=!0)},p(a,[c]){c&4&&_e(n,a[2]),c&2&&m(i,"id",a[1]),c&2&&m(i,"name",a[1]),c&8&&m(i,"step",a[3]),c&16&&m(i,"min",a[4]),c&32&&m(i,"max",a[5]),c&64&&(i.required=a[6]),c&1&&Br(i.value)!==a[0]&&ve(i,a[0]),c&2&&m(t,"for",a[1])},i:b,o:b,d(a){a&&H(t),l=!1,ue(o)}}}function Os(e,t,n){let r,i;W(e,Fe,h=>n(9,r=h)),W(e,we,h=>n(10,i=h));let{name:l}=t,{label:o}=t,{value:a}=t,{step:c}=t,{min:s}=t,{max:f}=t,{required:u=!0}=t;function d(){const h={...i};h[l]=a,he(we,i=h,i)}async function p(){r&&n(0,a=r.fields[l]),d()}je(()=>{p()});function g(){a=Br(this.value),n(0,a)}return e.$$set=h=>{"name"in h&&n(1,l=h.name),"label"in h&&n(2,o=h.label),"value"in h&&n(0,a=h.value),"step"in h&&n(3,c=h.step),"min"in h&&n(4,s=h.min),"max"in h&&n(5,f=h.max),"required"in h&&n(6,u=h.required)},[a,l,o,c,s,f,u,d,g]}class Ds extends ce{constructor(t){super(),ae(this,t,Os,Ms,ie,{name:1,label:2,value:0,step:3,min:4,max:5,required:6})}}const Fs=function(){const t=typeof document<"u"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"}(),Hs=function(e,t){return new URL(e,t).href},br={},Xe=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){const l=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));i=Promise.all(n.map(c=>{if(c=Hs(c,r),c in br)return;br[c]=!0;const s=c.endsWith(".css"),f=s?'[rel="stylesheet"]':"";if(!!r)for(let p=l.length-1;p>=0;p--){const g=l[p];if(g.href===c&&(!s||g.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${f}`))return;const d=document.createElement("link");if(d.rel=s?"stylesheet":Fs,s||(d.as="script",d.crossOrigin=""),d.href=c,a&&d.setAttribute("nonce",a),document.head.appendChild(d),s)return new Promise((p,g)=>{d.addEventListener("load",p),d.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${c}`)))})}))}return i.then(()=>t()).catch(l=>{const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l})},Is='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-bold</title><path d="M13.5,15.5H10V12.5H13.5A1.5,1.5 0 0,1 15,14A1.5,1.5 0 0,1 13.5,15.5M10,6.5H13A1.5,1.5 0 0,1 14.5,8A1.5,1.5 0 0,1 13,9.5H10M15.6,10.79C16.57,10.11 17.25,9 17.25,8C17.25,5.74 15.5,4 13.25,4H7V18H14.04C16.14,18 17.75,16.3 17.75,14.21C17.75,12.69 16.89,11.39 15.6,10.79Z" /></svg>',Ns='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-italic</title><path d="M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z" /></svg>',Rs='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-list-bulleted</title><path d="M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z" /></svg>',Ps='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-list-numbered</title><path d="M7,13V11H21V13H7M7,19V17H21V19H7M7,7V5H21V7H7M3,8V5H2V4H4V8H3M2,17V16H5V20H2V19H4V18.5H3V17.5H4V17H2M4.25,10A0.75,0.75 0 0,1 5,10.75C5,10.95 4.92,11.14 4.79,11.27L3.12,13H5V14H2V13.08L4,11H2V10H4.25Z" /></svg>',$s='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>horizontal-rule</title><path d="M19,13H5V11H19V13Z" /></svg>',js='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-quote-close</title><path d="M14,17H17L19,13V7H13V13H16M6,17H9L11,13V7H5V13H8L6,17Z" /></svg>',Vs='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>link</title><path d="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z" /></svg>',qs='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>image</title><path d="M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z" /></svg>',{document:Ys}=Zt;function vr(e,t,n){const r=e.slice();return r[9]=t[n],r}function yr(e,t,n){const r=e.slice();return r[12]=t[n],r}function kr(e){let t,n=e[12].title+"",r;return{c(){t=k("option"),r=ee(n),t.__value=e[12].value,ve(t,t.__value),m(t,"class","svelte-niyo7g")},m(i,l){N(i,t,l),w(t,r)},p:b,d(i){i&&H(t)}}}function Ar(e){let t,n,r=e[9].icon+"",i,l,o;return{c(){t=k("button"),n=new ze(!1),i=q(),n.a=i,m(t,"class","secondary svelte-niyo7g"),m(t,"data-action",e[9].name)},m(a,c){N(a,t,c),n.m(r,t),w(t,i),l||(o=Z(t,"click",Ue(e[3])),l=!0)},p:b,d(a){a&&H(t),l=!1,o()}}}function Us(e){let t,n,r,i,l,o,a=Ee(e[1]),c=[];for(let u=0;u<a.length;u+=1)c[u]=kr(yr(e,a,u));let s=Ee(e[2]),f=[];for(let u=0;u<s.length;u+=1)f[u]=Ar(vr(e,s,u));return{c(){t=q(),n=k("div"),r=k("select");for(let u=0;u<c.length;u+=1)c[u].c();i=q();for(let u=0;u<f.length;u+=1)f[u].c();m(r,"name","text-type"),m(r,"form","ignore"),m(r,"class","svelte-niyo7g"),m(n,"class","editor-menu svelte-niyo7g")},m(u,d){N(u,t,d),N(u,n,d),w(n,r);for(let p=0;p<c.length;p+=1)c[p]&&c[p].m(r,null);e[6](r),w(n,i);for(let p=0;p<f.length;p+=1)f[p]&&f[p].m(n,null);l||(o=[Z(Ys,"selectionchange",e[5]),Z(r,"change",e[4])],l=!0)},p(u,[d]){if(d&2){a=Ee(u[1]);let p;for(p=0;p<a.length;p+=1){const g=yr(u,a,p);c[p]?c[p].p(g,d):(c[p]=kr(g),c[p].c(),c[p].m(r,null))}for(;p<c.length;p+=1)c[p].d(1);c.length=a.length}if(d&12){s=Ee(u[2]);let p;for(p=0;p<s.length;p+=1){const g=vr(u,s,p);f[p]?f[p].p(g,d):(f[p]=Ar(g),f[p].c(),f[p].m(n,null))}for(;p<f.length;p+=1)f[p].d(1);f.length=s.length}},i:b,o:b,d(u){u&&(H(t),H(n)),un(c,u),e[6](null),un(f,u),l=!1,ue(o)}}}function Bs(){const e=[];for(let t=0;t<=6;t++){let n;t===0?n={title:"Normal",value:"p"}:n={title:`Heading ${t}`,value:t},e.push(n)}return e}function Gs(e,t,n){const r=Kt();let i,l;const o=Bs(),a=[{name:"bold",icon:Is},{name:"italic",icon:Ns},{name:"listBulleted",icon:Rs},{name:"listNumbered",icon:Ps},{name:"quote",icon:js},{name:"horizontalRule",icon:$s},{name:"link",icon:Vs},{name:"image",icon:qs}];function c(d){const{action:p}=d.currentTarget.dataset;r("menuaction",p)}function s(d){const p=d.currentTarget.value;r("menutexttype",p)}function f(){var h;const p=(h=document.getSelection().focusNode)==null?void 0:h.parentElement;if(!l.contains(p))return;const{localName:g}=p;switch(g){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":n(0,i.value=parseInt(g.split("").at(-1)),i);break;default:n(0,i.value="p",i);break}}je(()=>{l=document.querySelector("#md-editor")});function u(d){at[d?"unshift":"push"](()=>{i=d,n(0,i),n(1,o)})}return[i,o,a,c,s,f,u]}class Ws extends ce{constructor(t){super(),ae(this,t,Gs,Us,ie,{})}}const{document:zs}=Zt;function Zs(e){let t,n,r,i,l,o,a,c,s,f;return{c(){t=q(),n=k("div"),r=k("div"),i=k("div"),i.textContent="Enter link:",l=q(),o=k("input"),a=q(),c=k("button"),c.textContent="Save",m(i,"class","svelte-1vifg91"),m(o,"form","md-link-editor"),m(o,"type","url"),m(o,"name","url"),m(o,"placeholder","https://example.com"),o.required=!0,m(o,"class","svelte-1vifg91"),m(c,"class","secondary svelte-1vifg91"),m(c,"form","md-link-editor"),m(c,"type","submit"),m(r,"id","link-editor"),m(r,"class","svelte-1vifg91"),m(n,"id","link-editor-container"),m(n,"class","svelte-1vifg91"),Gn(n,"visibility",e[0]?"visible":"hidden")},m(u,d){N(u,t,d),N(u,n,d),w(n,r),w(r,i),w(r,l),w(r,o),e[5](o),w(r,a),w(r,c),e[6](r),s||(f=Z(zs,"selectionchange",e[3]),s=!0)},p(u,[d]){d&1&&Gn(n,"visibility",u[0]?"visible":"hidden")},i:b,o:b,d(u){u&&(H(t),H(n)),e[5](null),e[6](null),s=!1,f()}}}function Ks(e,t,n){const r=Kt();let i=!1,l,o;function a(){const d=document.getSelection();if(d.focusNode.parentElement.localName==="a"){r("saveurl",{});return}else if(i)n(0,i=!i),n(2,o.value="",o);else{const{startOffset:p,endOffset:g}=d.getRangeAt(0);n(0,i=p!==g)}}function c(d){d.preventDefault();const p=o.value;n(2,o.value="",o),n(0,i=!1),r("saveurl",{href:p})}function s(){if(!i)return;const p=document.getSelection().focusNode;l.contains(p)||(n(0,i=!1),n(2,o.value="",o),r("saveurl",null))}je(()=>{const d=document.querySelector("#md-link-editor");return d.addEventListener("submit",c),()=>{d.removeEventListener("submit",c)}}),gl(()=>{i&&o.focus()});function f(d){at[d?"unshift":"push"](()=>{o=d,n(2,o)})}function u(d){at[d?"unshift":"push"](()=>{l=d,n(1,l)})}return[i,l,o,s,a,f,u]}class Xs extends ce{constructor(t){super(),ae(this,t,Ks,Zs,ie,{toggleEditor:4})}get toggleEditor(){return this.$$.ctx[4]}}function Er(e,t,n){const r=e.slice();return r[9]=t[n],r}function Cr(e,t){let n,r,i,l,o,a=t[9].name+"",c,s,f,u;function d(){return t[6](t[9])}return{key:e,first:null,c(){n=k("div"),r=k("img"),l=q(),o=k("small"),c=ee(a),s=q(),jt(r.src,i=t[9].url_preview)||m(r,"src",i),m(r,"alt",""),m(r,"loading","lazy"),m(r,"crossorigin","use-credentials"),m(r,"class","svelte-157z34i"),m(o,"class","svelte-157z34i"),m(n,"class","img-container svelte-157z34i"),Vt(n,"selected",t[1]===t[9]),this.first=n},m(p,g){N(p,n,g),w(n,r),w(n,l),w(n,o),w(o,c),w(n,s),f||(u=Z(n,"click",d),f=!0)},p(p,g){t=p,g&1&&!jt(r.src,i=t[9].url_preview)&&m(r,"src",i),g&1&&a!==(a=t[9].name+"")&&_e(c,a),g&3&&Vt(n,"selected",t[1]===t[9])},d(p){p&&H(n),f=!1,u()}}}function Qs(e){let t,n,r,i,l,o=[],a=new Map,c,s,f,u,d,p,g,h,v,A=Ee(e[0]);const E=T=>T[9].name;for(let T=0;T<A.length;T+=1){let j=Er(e,A,T),D=E(j);a.set(D,o[T]=Cr(D,j))}return{c(){t=k("dialog"),n=k("article"),r=k("header"),r.textContent="Select Image",i=q(),l=k("div");for(let T=0;T<o.length;T+=1)o[T].c();c=q(),s=k("footer"),f=k("button"),f.textContent="Cancel",u=q(),d=k("button"),p=ee("Select"),m(l,"class","images svelte-157z34i"),m(f,"class","secondary svelte-157z34i"),d.disabled=g=!e[1],m(d,"class","svelte-157z34i"),m(s,"class","svelte-157z34i"),t.open=!0},m(T,j){N(T,t,j),w(t,n),w(n,r),w(n,i),w(n,l);for(let D=0;D<o.length;D+=1)o[D]&&o[D].m(l,null);w(n,c),w(n,s),w(s,f),w(s,u),w(s,d),w(d,p),h||(v=[Z(f,"click",Ue(e[4])),Z(d,"click",Ue(e[3])),Z(t,"click",e[4])],h=!0)},p(T,[j]){j&7&&(A=Ee(T[0]),o=Ht(o,j,E,1,T,A,a,l,Gr,Cr,null,Er)),j&2&&g!==(g=!T[1])&&(d.disabled=g)},i:b,o:b,d(T){T&&H(t);for(let j=0;j<o.length;j+=1)o[j].d();h=!1,ue(v)}}}function Js(e,t,n){let r;W(e,Ve,d=>n(5,r=d));const i=Kt();let l=[],o;async function a(d){const p=await(r==null?void 0:r.getMediaFiles());n(0,l=p||[])}function c(d){n(1,o=d)}function s(){i("selectimg",{img:o})}function f(d){d.currentTarget===d.target&&i("selectimg",{})}je(()=>{const{body:d}=document;return d.classList.add("contain-scroll"),()=>{d.classList.remove("contain-scroll")}});const u=d=>c(d);return e.$$.update=()=>{e.$$.dirty&32&&a()},[l,o,c,s,f,r,u]}class eu extends ce{constructor(t){super(),ae(this,t,Js,Qs,ie,{})}}const{document:tu}=Zt;function nu(e){let t,n;return t=new Ke({props:{msg:"Unable to load",details:e[48].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i[0]&16&&(l.details=r[48].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function ru(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function iu(e){let t,n;return t=new Jt({props:{msg:"Loading"}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:b,i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Sr(e){let t,n;return t=new eu({}),t.$on("selectimg",e[7]),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:b,i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function lu(e){let t,n,r,i,l,o,a,c,s,f,u,d,p,g,h,v,A,E,T;o=new Ws({}),o.$on("menutexttype",e[9]),o.$on("menuaction",e[10]);let j={};f=new Xs({props:j}),e[13](f),f.$on("saveurl",e[8]);let D={ctx:e,current:null,token:null,hasCatch:!0,pending:iu,then:ru,catch:nu,error:48,blocks:[,,,]};se(g=e[4],D);let R=e[5]&&Sr(e);return{c(){t=q(),n=k("label"),r=ee(e[2]),i=q(),l=k("div"),J(o.$$.fragment),a=q(),c=k("div"),s=q(),J(f.$$.fragment),u=q(),d=k("input"),p=q(),D.block.c(),h=q(),R&&R.c(),v=Oe(),m(l,"id","md-editor"),m(l,"class","svelte-1rfhu7q"),m(d,"type","hidden"),m(d,"id",e[1]),m(d,"name",e[1]),d.required=e[3],m(d,"class","svelte-1rfhu7q"),m(n,"class","editorInput"),m(n,"for",e[1])},m(F,C){N(F,t,C),N(F,n,C),w(n,r),w(n,i),w(n,l),K(o,l,null),w(l,a),w(l,c),w(l,s),K(f,l,null),w(n,u),w(n,d),ve(d,e[0]),N(F,p,C),D.block.m(F,D.anchor=C),D.mount=()=>h.parentNode,D.anchor=h,N(F,h,C),R&&R.m(F,C),N(F,v,C),A=!0,E||(T=[Z(tu,"selectionchange",e[11]),dl(e[12].call(null,c)),Z(d,"input",e[14])],E=!0)},p(F,C){e=F,(!A||C[0]&4)&&_e(r,e[2]);const P={};f.$set(P),(!A||C[0]&2)&&m(d,"id",e[1]),(!A||C[0]&2)&&m(d,"name",e[1]),(!A||C[0]&8)&&(d.required=e[3]),C[0]&1&&ve(d,e[0]),(!A||C[0]&2)&&m(n,"for",e[1]),D.ctx=e,C[0]&16&&g!==(g=e[4])&&se(g,D)||Pe(D,e,C),e[5]?R?(R.p(e,C),C[0]&32&&I(R,1)):(R=Sr(e),R.c(),I(R,1),R.m(v.parentNode,v)):R&&(ye(),V(R,1,1,()=>{R=null}),ke())},i(F){A||(I(o.$$.fragment,F),I(f.$$.fragment,F),I(D.block),I(R),A=!0)},o(F){V(o.$$.fragment,F),V(f.$$.fragment,F);for(let C=0;C<3;C+=1){const P=D.blocks[C];V(P)}V(R),A=!1},d(F){F&&(H(t),H(n),H(p),H(h),H(v)),X(o),e[13](null),X(f),D.block.d(F),D.token=null,D=null,R&&R.d(F),E=!1,ue(T)}}}function ou(e,t,n){let r,i,l,o;W(e,Ve,U=>n(38,r=U)),W(e,Fe,U=>n(39,i=U)),W(e,we,U=>n(40,l=U)),W(e,$e,U=>n(41,o=U));let{name:a}=t,{label:c}=t,{value:s=""}=t,{required:f=!0}=t,u,d,p,g,h,v,A,E,T,j,D,R,F,C,P,M,S,B,z,O,y,_=!1,x,L,$,G;async function Q(){const U=await Xe(()=>import("./index.es.js").then(tn=>tn.a5),[],import.meta.url),te=await Xe(()=>import("./index.es2.js"),[],import.meta.url),re=await Xe(()=>import("./index.es3.js"),[],import.meta.url),me=await Xe(()=>import("./index.es4.js"),[],import.meta.url),nt=await Xe(()=>import("./index.es5.js"),[],import.meta.url);u=U.Editor,d=U.rootCtx,p=U.defaultValueCtx,g=U.commandsCtx,h=te.listener,v=te.listenerCtx,A=re.commonmark,E=re.turnIntoTextCommand,T=re.wrapInHeadingCommand,j=re.toggleStrongCommand,D=re.toggleEmphasisCommand,R=re.wrapInBulletListCommand,F=re.wrapInOrderedListCommand,C=re.wrapInBlockquoteCommand,P=re.insertHrCommand,M=re.toggleLinkCommand,S=re.insertImageCommand,B=me.nord,z=nt.getHTML,O=nt.replaceAll}function ne(U){const te={...l};U?$&&(te[a]=z()($.ctx).replaceAll("<img ",'<img crossorigin="use-credentials" ')):te[a]=o==null?void 0:o.fields.find(re=>re.name===a).label,he(we,l=te,l)}function le(){if(!x)return;const U=document.getSelection();U.removeAllRanges();const te=document.createRange(),{startOffset:re,endOffset:me}=x.range;te.setStart(x.node,re),te.setEnd(x.node,me),U.addRange(te)}function fe(U){n(5,_=!1),le();const{img:te}=U.detail;te&&$.action(re=>{const me=re.get(g),nt={alt:te.name,src:te.url_preview};me.call(S.key,nt)})}function Ae(U){if(le(),!U.detail)return;const{href:te}=U.detail,re=document.getSelection(),{textContent:me}=re.focusNode,{startOffset:nt,endOffset:tn}=re.getRangeAt(0),il=me.substring(nt,tn);$.action(ll=>{const ol=ll.get(g),al={title:il,href:te};ol.call(M.key,al)})}function qe(U){const te=U.detail;$.action(re=>{const me=re.get(g);te==="p"?me.call(E.key):me.call(T.key,te)})}function He(U){const te=U.detail;$.action(re=>{const me=re.get(g);switch(te){case"bold":me.call(j.key);break;case"italic":me.call(D.key);break;case"listBulleted":me.call(R.key);break;case"listNumbered":me.call(F.key);break;case"quote":me.call(C.key);break;case"horizontalRule":me.call(P.key);break;case"link":L.toggleEditor();break;case"image":x&&n(5,_=!0);break}})}function Ne(){const U=document.getSelection(),te=U.focusNode;G.contains(te)&&(x={node:U.focusNode,range:U.getRangeAt(0)})}function De(U){$=U,G=document.querySelector(".milkdown .editor"),O(s)($.ctx),ne(s)}async function de(U){await Q(),u.make().config(te=>{te.set(d,U),te.set(p,s),te.get(v).markdownUpdated((re,me,nt)=>{n(0,s=me)})}).config(B).use(A).use(h).create().then(De)}function xe(U){de(U)}async function Re(){if(i)try{const U=a==="body"?i.body:i.fields[a];n(4,y=r.replacePublicLinks(U)),n(0,s=await y),$&&O(s)($.ctx)}catch{}}je(()=>{Re()});function Ye(U){at[U?"unshift":"push"](()=>{L=U,n(6,L)})}function Et(){s=this.value,n(0,s)}return e.$$set=U=>{"name"in U&&n(1,a=U.name),"label"in U&&n(2,c=U.label),"value"in U&&n(0,s=U.value),"required"in U&&n(3,f=U.required)},e.$$.update=()=>{e.$$.dirty[0]&1&&ne(s)},[s,a,c,f,y,_,L,fe,Ae,qe,He,Ne,xe,Ye,Et]}class au extends ce{constructor(t){super(),ae(this,t,ou,lu,ie,{name:1,label:2,value:0,required:3},null,[-1,-1])}}function cu(e){let t,n,r;return{c(){t=k("input"),m(t,"type","hidden"),m(t,"id",e[1]),m(t,"name",e[1])},m(i,l){N(i,t,l),ve(t,e[0]),n||(r=Z(t,"input",e[3]),n=!0)},p(i,[l]){l&2&&m(t,"id",i[1]),l&2&&m(t,"name",i[1]),l&1&&ve(t,i[0])},i:b,o:b,d(i){i&&H(t),n=!1,r()}}}function su(e,t,n){let r,i;W(e,Fe,u=>n(4,r=u)),W(e,we,u=>n(5,i=u));let{name:l}=t,{type:o="text"}=t,{value:a}=t;function c(){const u={...i};u[l]=a,he(we,i=u,i)}async function s(){if(r!=null&&r.fields[l])switch(o){case"datetime-local":case"date":case"time":n(0,a=Wt(o,new Date(r.fields[l])));break;default:n(0,a=r.fields[l]);break}else if(!a)switch(o){case"datetime-local":case"date":case"time":n(0,a=Wt(o,new Date));break;case"boolean":n(0,a="false");break}c()}je(()=>{s()});function f(){a=this.value,n(0,a)}return e.$$set=u=>{"name"in u&&n(1,l=u.name),"type"in u&&n(2,o=u.type),"value"in u&&n(0,a=u.value)},[a,l,o,f]}class uu extends ce{constructor(t){super(),ae(this,t,su,cu,ie,{name:1,type:2,value:0})}}function fu(e){let t,n,r;return{c(){t=k("iframe"),m(t,"title","Preview"),m(t,"sandbox","allow-same-origin"),m(t,"srcdoc",e[1]),m(t,"class","svelte-1sw5k8j")},m(i,l){N(i,t,l),e[9](t),n||(r=Z(t,"load",e[2]),n=!0)},p(i,[l]){l&2&&m(t,"srcdoc",i[1])},i:b,o:b,d(i){i&&H(t),e[9](null),n=!1,r()}}}function du(e,t,n){let r,i,l,o,a,c;W(e,we,g=>n(6,o=g)),W(e,$e,g=>n(7,a=g)),W(e,Ce,g=>n(8,c=g)),Te.extend(Yi);let s,f;function u(){d()}function d(g){if(f!=null&&f.contentDocument)for(const h in o){const v=a==null?void 0:a.fields.find(T=>T.name===h);let A=o[h];if(v.name==="date")switch(v==null?void 0:v.type){case"time":A=Te(o[h],"hh:mm").format(v.time_format);break;case"date":A=Te(o[h],"YYYY-MM-DD").format(v.date_format);break;default:A=Te(o[h],"YYYY-MM-DDThh:mm").format(v.datetime_format)}f.contentDocument.querySelectorAll(`[data-tag="${h}"]`).forEach(T=>{T.innerHTML!==A&&(T.innerHTML=A)})}}function p(g){at[g?"unshift":"push"](()=>{f=g,n(0,f)})}return e.$$.update=()=>{e.$$.dirty&384&&n(5,r=(a==null?void 0:a.preview)||(c==null?void 0:c.previews.default)),e.$$.dirty&288&&n(4,i=rs(c,r)),e.$$.dirty&288&&(async()=>n(3,s=await is(c,r)))(),e.$$.dirty&24&&n(1,l=ls(s,i)),e.$$.dirty&192&&d()},[f,l,u,s,i,r,o,a,c,p]}class pu extends ce{constructor(t){super(),ae(this,t,du,fu,ie,{})}}function xr(e,t,n){var o;const r=e.slice();r[11]=t[n];const i=r[5][r[11].widget];r[12]=i;const l=(o=r[11])==null?void 0:o.default;return r[13]=l,r}function Lr(e){let t=[],n=new Map,r,i,l=Ee(e[3].fields);const o=a=>a[11].name;for(let a=0;a<l.length;a+=1){let c=xr(e,l,a),s=o(c);n.set(s,t[a]=Tr(s,c))}return{c(){for(let a=0;a<t.length;a+=1)t[a].c();r=Oe()},m(a,c){for(let s=0;s<t.length;s+=1)t[s]&&t[s].m(a,c);N(a,r,c),i=!0},p(a,c){c&40&&(l=Ee(a[3].fields),ye(),t=Ht(t,c,o,1,a,l,n,r.parentNode,Tn,Tr,r,xr),ke())},i(a){if(!i){for(let c=0;c<l.length;c+=1)I(t[c]);i=!0}},o(a){for(let c=0;c<t.length;c+=1)V(t[c]);i=!1},d(a){a&&H(r);for(let c=0;c<t.length;c+=1)t[c].d(a)}}}function hu(e){let t,n,r;const i=[e[11],{value:e[13]}];var l=e[12];function o(a,c){let s={};for(let f=0;f<i.length;f+=1)s=ot(s,i[f]);return c!==void 0&&c&8&&(s=ot(s,ct(i,[st(a[11]),{value:a[13]}]))),{props:s}}return l&&(t=Je(l,o(e))),{c(){t&&J(t.$$.fragment),n=Oe()},m(a,c){t&&K(t,a,c),N(a,n,c),r=!0},p(a,c){if(c&8&&l!==(l=a[12])){if(t){ye();const s=t;V(s.$$.fragment,1,0,()=>{X(s,1)}),ke()}l?(t=Je(l,o(a,c)),J(t.$$.fragment),I(t.$$.fragment,1),K(t,n.parentNode,n)):t=null}else if(l){const s=c&8?ct(i,[st(a[11]),{value:a[13]}]):{};t.$set(s)}},i(a){r||(t&&I(t.$$.fragment,a),r=!0)},o(a){t&&V(t.$$.fragment,a),r=!1},d(a){a&&H(n),t&&X(t,a)}}}function mu(e){let t,n,r;const i=[e[11],{value:e[13]},{multiline:!0}];var l=e[12];function o(a,c){let s={};for(let f=0;f<i.length;f+=1)s=ot(s,i[f]);return c!==void 0&&c&8&&(s=ot(s,ct(i,[st(a[11]),{value:a[13]},i[2]]))),{props:s}}return l&&(t=Je(l,o(e))),{c(){t&&J(t.$$.fragment),n=Oe()},m(a,c){t&&K(t,a,c),N(a,n,c),r=!0},p(a,c){if(c&8&&l!==(l=a[12])){if(t){ye();const s=t;V(s.$$.fragment,1,0,()=>{X(s,1)}),ke()}l?(t=Je(l,o(a,c)),J(t.$$.fragment),I(t.$$.fragment,1),K(t,n.parentNode,n)):t=null}else if(l){const s=c&8?ct(i,[st(a[11]),{value:a[13]},i[2]]):{};t.$set(s)}},i(a){r||(t&&I(t.$$.fragment,a),r=!0)},o(a){t&&V(t.$$.fragment,a),r=!1},d(a){a&&H(n),t&&X(t,a)}}}function gu(e){let t,n,r;const i=[e[11],{checked:e[13]}];var l=e[12];function o(a,c){let s={};for(let f=0;f<i.length;f+=1)s=ot(s,i[f]);return c!==void 0&&c&8&&(s=ot(s,ct(i,[st(a[11]),{checked:a[13]}]))),{props:s}}return l&&(t=Je(l,o(e))),{c(){t&&J(t.$$.fragment),n=Oe()},m(a,c){t&&K(t,a,c),N(a,n,c),r=!0},p(a,c){if(c&8&&l!==(l=a[12])){if(t){ye();const s=t;V(s.$$.fragment,1,0,()=>{X(s,1)}),ke()}l?(t=Je(l,o(a,c)),J(t.$$.fragment),I(t.$$.fragment,1),K(t,n.parentNode,n)):t=null}else if(l){const s=c&8?ct(i,[st(a[11]),{checked:a[13]}]):{};t.$set(s)}},i(a){r||(t&&I(t.$$.fragment,a),r=!0)},o(a){t&&V(t.$$.fragment,a),r=!1},d(a){a&&H(n),t&&X(t,a)}}}function Tr(e,t){let n,r,i,l,o;const a=[gu,mu,hu],c=[];function s(f,u){return f[11].widget==="boolean"?0:f[11].widget==="text"?1:2}return r=s(t),i=c[r]=a[r](t),{key:e,first:null,c(){n=Oe(),i.c(),l=Oe(),this.first=n},m(f,u){N(f,n,u),c[r].m(f,u),N(f,l,u),o=!0},p(f,u){t=f;let d=r;r=s(t),r===d?c[r].p(t,u):(ye(),V(c[d],1,1,()=>{c[d]=null}),ke(),i=c[r],i?i.p(t,u):(i=c[r]=a[r](t),i.c()),I(i,1),i.m(l.parentNode,l))},i(f){o||(I(i),o=!0)},o(f){V(i),o=!1},d(f){f&&(H(n),H(l)),c[r].d(f)}}}function _u(e){let t,n;return t=new Ke({props:{msg:"Unable to save",details:e[10].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&1&&(l.details=r[10].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function wu(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function bu(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function vu(e){let t,n;return t=new Ke({props:{msg:"Unable to save",details:e[10].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&4&&(l.details=r[10].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function yu(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function ku(e){let t,n;return t=new Jt({props:{msg:"Saving"}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p:b,i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Au(e){let t,n;return t=new Ke({props:{msg:"'On save' event action failed",details:e[10].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&2&&(l.details=r[10].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Eu(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Cu(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Su(e){let t,n,r,i,l,o,a,c,s,f,u,d,p,g,h,v,A,E,T,j,D,R,F,C,P,M;t=new gs({});let S=e[3]&&Lr(e);v=new pu({});let B={ctx:e,current:null,token:null,hasCatch:!0,pending:bu,then:wu,catch:_u,error:10,blocks:[,,,]};se(E=e[0],B);let z={ctx:e,current:null,token:null,hasCatch:!0,pending:ku,then:yu,catch:vu,error:10,blocks:[,,,]};se(j=e[2],z);let O={ctx:e,current:null,token:null,hasCatch:!0,pending:Cu,then:Eu,catch:Au,error:10,blocks:[,,,]};return se(F=e[1],O),{c(){J(t.$$.fragment),n=q(),r=k("div"),i=k("section"),l=k("header"),l.textContent="Edit",o=q(),a=k("form"),S&&S.c(),c=q(),s=k("form"),f=q(),u=k("form"),d=q(),p=k("section"),g=k("header"),g.textContent="Preview",h=q(),J(v.$$.fragment),A=q(),B.block.c(),T=q(),z.block.c(),D=q(),R=Oe(),O.block.c(),m(l,"class","svelte-14qwct"),m(a,"id","entry-data"),m(a,"class","svelte-14qwct"),m(s,"id","md-link-editor"),m(s,"class","svelte-14qwct"),m(u,"id","ignore"),m(u,"class","svelte-14qwct"),m(i,"id","inputArea"),m(i,"class","svelte-14qwct"),m(g,"class","svelte-14qwct"),m(p,"id","previewArea"),m(p,"class","svelte-14qwct"),m(r,"class","page svelte-14qwct")},m(y,_){K(t,y,_),N(y,n,_),N(y,r,_),w(r,i),w(i,l),w(i,o),w(i,a),S&&S.m(a,null),w(i,c),w(i,s),w(i,f),w(i,u),w(r,d),w(r,p),w(p,g),w(p,h),K(v,p,null),N(y,A,_),B.block.m(y,B.anchor=_),B.mount=()=>T.parentNode,B.anchor=T,N(y,T,_),z.block.m(y,z.anchor=_),z.mount=()=>D.parentNode,z.anchor=D,N(y,D,_),N(y,R,_),O.block.m(y,O.anchor=_),O.mount=()=>R.parentNode,O.anchor=R,C=!0,P||(M=Z(a,"submit",Ue(e[6])),P=!0)},p(y,[_]){e=y,e[3]?S?(S.p(e,_),_&8&&I(S,1)):(S=Lr(e),S.c(),I(S,1),S.m(a,null)):S&&(ye(),V(S,1,1,()=>{S=null}),ke()),B.ctx=e,_&1&&E!==(E=e[0])&&se(E,B)||Pe(B,e,_),z.ctx=e,_&4&&j!==(j=e[2])&&se(j,z)||Pe(z,e,_),O.ctx=e,_&2&&F!==(F=e[1])&&se(F,O)||Pe(O,e,_)},i(y){C||(I(t.$$.fragment,y),I(S),I(v.$$.fragment,y),I(B.block),I(z.block),I(O.block),C=!0)},o(y){V(t.$$.fragment,y),V(S),V(v.$$.fragment,y);for(let _=0;_<3;_+=1){const x=B.blocks[_];V(x)}for(let _=0;_<3;_+=1){const x=z.blocks[_];V(x)}for(let _=0;_<3;_+=1){const x=O.blocks[_];V(x)}C=!1},d(y){y&&(H(n),H(r),H(A),H(T),H(D),H(R)),X(t,y),S&&S.d(),X(v),B.block.d(y),B.token=null,B=null,z.block.d(y),z.token=null,z=null,O.block.d(y),O.token=null,O=null,P=!1,M()}}}function xu(e,t,n){let r,i,l,o,a;W(e,Fe,p=>n(7,r=p)),W(e,Nn,p=>n(8,i=p)),W(e,$e,p=>n(3,o=p)),W(e,Ve,p=>n(9,a=p));const c=tt();W(e,c,p=>n(2,l=p)),Sn("submitted",c);let s,f;const u={string:wr,text:wr,datetime:Cs,boolean:bs,number:Ds,markdown:au,hidden:uu};async function d(p){const g=r?{...r}:{fields:{}},h=new FormData(p.target);for(const[A,E]of h.entries()){const T=o.fields.find(j=>j.name===A);try{n(0,s=Ui(T,E,a)),g.fields[A]=await s}catch(j){console.error("Error parsing form entry.",j);return}}const v=as(o,g);he(c,l=a.saveFile(o,v),l);try{he(Fe,r=await l,r),i!=null&&i.onSave&&(n(1,f=i.onSave(r)),await f)}catch(A){console.warn("Issue saving post.",A)}}return[s,f,l,o,c,u,d]}class Lu extends ce{constructor(t){super(),ae(this,t,xu,Su,ie,{})}}async function Tu(e,t){let n;try{n=await t.text()}catch(a){console.error("Error constructing doc",a);return}const[r,i]=jn(n),l=Qt.load(r);return{_id:t.webkitRelativePath,name:t.name,collection:e,date:l.date,raw:n,fields:l,body:i,handle:t.handle,directoryHandle:t.directoryHandle}}function Bi(e,t){const n=t.lastModifiedDate,r=`${e.public_folder}/${t.name}`;return{_id:t.webkitRelativePath,name:t.name,date:n,asset:t.type,url:r,url_preview:r,handle:t.handle,directoryHandle:t.directoryHandle}}let $t,Gi,Wi,lt,Ge,Lt;async function Mu(){if(lt=Ie(Ce).repo_folder,!lt){console.error("Missing 'repo_folder' config");return}return await Ou(),$t.plugin(Gi),$t.plugin(Wi),Ge=new $t(`${lt}-local`,{adapter:"idb"}),[["name","collection"],["date","collection"],["asset"],["url"],["url_preview"]].map(t=>({index:{fields:t},ddoc:t.join("-")})).forEach(t=>Fu(t)),console.log("Using local CMS backend"),Vn}async function Ou(){$t=(await Xe(async()=>{const{default:e}=await import("./index.es6.js");return{default:e}},[],import.meta.url)).default,Gi=(await Xe(async()=>{const{default:e}=await import("./index.es7.js");return{default:e}},[],import.meta.url)).default,Wi=(await Xe(async()=>{const{default:e}=await import("./index-browser.es.js");return{default:e}},[],import.meta.url)).default}async function Du(){return{title:"Local Backend Enabled",message:"Select the local project directory to continue.",button:"Select Project Directory",action:Iu}}async function Fu(e){try{const t=await Ge.createIndex(e);console.log("Create index",e,t)}catch(t){console.error("Create index error",t)}}async function Hu(e){try{const t=await Ge.get(e._id);e._rev=t._rev}catch(t){console.warn("Existing doc error",t)}}async function Iu(){if(!lt)return;const e=[],t=Ie(Ce);t.collections.forEach(s=>{const d=`\\/?${s.folder.split("/").join("\\/")}\\/[^_][\\w-]+\\.\\w+`;e.push({name:s.name,regex:new RegExp(d,"i")})});const l=`\\/?${t.media_folder.split("/").join("\\/")}\\/[^_][\\w-]+\\.\\w+`,o=new RegExp(l,"i"),a=["node_modules"],c={recursive:!0,id:`snow-cms-${lt}`,skipDirectory:s=>s.name.startsWith(".")||a.includes(s.name)};try{const s=await Vc(c),f=[],u=[];s.forEach(h=>{var E;if(!Lt&&((E=h.directoryHandle)==null?void 0:E.name)===lt&&(Lt=h.directoryHandle),o.test(h.webkitRelativePath)){f.push(Bi(t,h));return}const A=e.find(({name:T,regex:j})=>j.test(h.webkitRelativePath));A&&u.push(Tu(A.name,h))});const d=await Promise.all(u);d.push(...f);const p=[];d.forEach(h=>p.push(Hu(h))),await Promise.all(p);const g=await Ge.bulkDocs(d);Ve.set(Vn)}catch(s){console.error("Open directory error",s)}}async function Nu(e){try{return(await Ge.find({selector:{collection:e,date:{$gte:null}},sort:[{date:"desc"}],limit:200})).docs}catch(t){throw console.error("Error finding docs",t),t}}async function Ru(e,t){const n=Ie(Ce).repo_folder;t._id||(t._id=[n,e.folder,t.name].join("/"));try{const r=`.${e.extension}`,i=`snow-cms-save-${n}-${e.folder.split(/[\/\\]/).at(-1)}`.substring(0,32),l={fileName:t.name,extensions:[r],id:i},o=new Blob([t.raw],{type:cs(r)});if(t.handle)await wn(o,l,t.handle,!0);else{let c=await wn(o,l);t.handle=c}const a=await Ge.put(t);return console.log(a),t._rev=a.rev,t}catch(r){throw console.error("Save file error",r),r}}async function Pu(e){try{e.forEach(r=>r._deleted=!0);const t=await Ge.bulkDocs(e);console.log(t);const n=[];e.forEach(r=>{r.handle&&n.push(r.handle.remove())}),await Promise.all(n)}catch(t){throw console.error("Delete files error",t),t}}async function $u(){try{return(await Ge.find({selector:{asset:{$gt:""}},limit:200})).docs}catch(e){return console.error("Error finding docs",e),null}}async function ju(){try{const t=await Pn({mimeTypes:["image/*"],description:"Image Files"}),n="."+t.name.split(".").at(-1),r={fileName:t.name,extensions:[n],id:`snow-cms-upload-${lt}`},i=await wn(t,r);if(!Lt){console.warn("File not saved to db: No root dir handle found.");return}const l=await Lt.resolve(i);l.unshift(Lt.name);const o={name:i.name,lastModifiedDate:new Date,type:t.type,webkitRelativePath:l.join("/"),handle:i},a=Bi(Ie(Ce),o),c=await Ge.put(a);console.log(c)}catch(e){console.error("Upload file error",e)}}async function zi(e,t){const n=[];t.forEach(l=>{const o={limit:200};e==="public"?o.selector={url:l}:o.selector={url_preview:l};const a=Ge.find(o);n.push(a)});const r=await Promise.all(n),i=[];return r.forEach(l=>i.push(...l.docs)),i}async function Vu(e){let t=e;try{const n=It(t);return n.length===0?e:((await zi("public",n)).forEach(i=>{t=t.replaceAll(i.url,i.url_preview)}),t)}catch(n){throw console.error("Error processing public links",n),n}}async function qu(e){let t=e;try{const n=It(t);return n.length===0?e:((await zi("preview",n)).forEach(i=>{t=t.replaceAll(i.url_preview,i.url)}),t)}catch(n){throw console.error("Error processing preview links",n),n}}const Vn={init:Mu,getLoginConfig:Du,getFiles:Nu,saveFile:Ru,deleteFiles:Pu,getMediaFiles:$u,uploadMediaFile:ju,replacePublicLinks:Vu,replacePreviewLinks:qu};function en(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:"<environment undetectable>"}function qn(e,t,n,r){if(typeof n!="function")throw new Error("method for before hook must be a function");return r||(r={}),Array.isArray(t)?t.reverse().reduce((i,l)=>qn.bind(null,e,l,i,r),n)():Promise.resolve().then(()=>e.registry[t]?e.registry[t].reduce((i,l)=>l.hook.bind(null,i,r),n)():n(r))}function Yu(e,t,n,r){const i=r;e.registry[n]||(e.registry[n]=[]),t==="before"&&(r=(l,o)=>Promise.resolve().then(i.bind(null,o)).then(l.bind(null,o))),t==="after"&&(r=(l,o)=>{let a;return Promise.resolve().then(l.bind(null,o)).then(c=>(a=c,i(a,o))).then(()=>a)}),t==="error"&&(r=(l,o)=>Promise.resolve().then(l.bind(null,o)).catch(a=>i(a,o))),e.registry[n].push({hook:r,orig:i})}function Uu(e,t,n){if(!e.registry[t])return;const r=e.registry[t].map(i=>i.orig).indexOf(n);r!==-1&&e.registry[t].splice(r,1)}const Mr=Function.bind,Or=Mr.bind(Mr);function Zi(e,t,n){const r=Or(Uu,null).apply(null,n?[t,n]:[t]);e.api={remove:r},e.remove=r,["before","error","after","wrap"].forEach(i=>{const l=n?[t,i,n]:[t,i];e[i]=e.api[i]=Or(Yu,null).apply(null,l)})}function Bu(){const e=Symbol("Singular"),t={registry:{}},n=qn.bind(null,t,e);return Zi(n,t,e),n}function Gu(){const e={registry:{}},t=qn.bind(null,e);return Zi(t,e),t}const Wu={Singular:Bu,Collection:Gu};var zu="0.0.0-development",Zu=`octokit-endpoint.js/${zu} ${en()}`,Ku={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":Zu},mediaType:{format:""}};function Xu(e){return e?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}}function Qu(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(e)}function Ki(e,t){const n=Object.assign({},e);return Object.keys(t).forEach(r=>{Qu(t[r])?r in e?n[r]=Ki(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}function Dr(e){for(const t in e)e[t]===void 0&&delete e[t];return e}function bn(e,t,n){var i;if(typeof t=="string"){let[l,o]=t.split(" ");n=Object.assign(o?{method:l,url:o}:{url:l},n)}else n=Object.assign({},t);n.headers=Xu(n.headers),Dr(n),Dr(n.headers);const r=Ki(e||{},n);return n.url==="/graphql"&&(e&&((i=e.mediaType.previews)!=null&&i.length)&&(r.mediaType.previews=e.mediaType.previews.filter(l=>!r.mediaType.previews.includes(l)).concat(r.mediaType.previews)),r.mediaType.previews=(r.mediaType.previews||[]).map(l=>l.replace(/-preview/,""))),r}function Ju(e,t){const n=/\?/.test(e)?"&":"?",r=Object.keys(t);return r.length===0?e:e+n+r.map(i=>i==="q"?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${i}=${encodeURIComponent(t[i])}`).join("&")}var ef=/\{[^}]+\}/g;function tf(e){return e.replace(/^\W+|\W+$/g,"").split(/,/)}function nf(e){const t=e.match(ef);return t?t.map(tf).reduce((n,r)=>n.concat(r),[]):[]}function Fr(e,t){const n={__proto__:null};for(const r of Object.keys(e))t.indexOf(r)===-1&&(n[r]=e[r]);return n}function Xi(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t).replace(/%5B/g,"[").replace(/%5D/g,"]")),t}).join("")}function bt(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function Ct(e,t,n){return t=e==="+"||e==="#"?Xi(t):bt(t),n?bt(n)+"="+t:t}function ht(e){return e!=null}function an(e){return e===";"||e==="&"||e==="?"}function rf(e,t,n,r){var i=e[n],l=[];if(ht(i)&&i!=="")if(typeof i=="string"||typeof i=="number"||typeof i=="boolean")i=i.toString(),r&&r!=="*"&&(i=i.substring(0,parseInt(r,10))),l.push(Ct(t,i,an(t)?n:""));else if(r==="*")Array.isArray(i)?i.filter(ht).forEach(function(o){l.push(Ct(t,o,an(t)?n:""))}):Object.keys(i).forEach(function(o){ht(i[o])&&l.push(Ct(t,i[o],o))});else{const o=[];Array.isArray(i)?i.filter(ht).forEach(function(a){o.push(Ct(t,a))}):Object.keys(i).forEach(function(a){ht(i[a])&&(o.push(bt(a)),o.push(Ct(t,i[a].toString())))}),an(t)?l.push(bt(n)+"="+o.join(",")):o.length!==0&&l.push(o.join(","))}else t===";"?ht(i)&&l.push(bt(n)):i===""&&(t==="&"||t==="?")?l.push(bt(n)+"="):i===""&&l.push("");return l}function lf(e){return{expand:of.bind(null,e)}}function of(e,t){var n=["+","#",".","/",";","?","&"];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(r,i,l){if(i){let a="";const c=[];if(n.indexOf(i.charAt(0))!==-1&&(a=i.charAt(0),i=i.substr(1)),i.split(/,/g).forEach(function(s){var f=/([^:\*]*)(?::(\d+)|(\*))?/.exec(s);c.push(rf(t,a,f[1],f[2]||f[3]))}),a&&a!=="+"){var o=",";return a==="?"?o="&":a!=="#"&&(o=a),(c.length!==0?a:"")+c.join(o)}else return c.join(",")}else return Xi(l)}),e==="/"?e:e.replace(/\/$/,"")}function Qi(e){var f;let t=e.method.toUpperCase(),n=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),r=Object.assign({},e.headers),i,l=Fr(e,["method","baseUrl","url","headers","request","mediaType"]);const o=nf(n);n=lf(n).expand(l),/^http/.test(n)||(n=e.baseUrl+n);const a=Object.keys(e).filter(u=>o.includes(u)).concat("baseUrl"),c=Fr(l,a);if(!/application\/octet-stream/i.test(r.accept)&&(e.mediaType.format&&(r.accept=r.accept.split(/,/).map(u=>u.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")),n.endsWith("/graphql")&&(f=e.mediaType.previews)!=null&&f.length)){const u=r.accept.match(/[\w-]+(?=-preview)/g)||[];r.accept=u.concat(e.mediaType.previews).map(d=>{const p=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${d}-preview${p}`}).join(",")}return["GET","HEAD"].includes(t)?n=Ju(n,c):"data"in c?i=c.data:Object.keys(c).length&&(i=c),!r["content-type"]&&typeof i<"u"&&(r["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(t)&&typeof i>"u"&&(i=""),Object.assign({method:t,url:n,headers:r},typeof i<"u"?{body:i}:null,e.request?{request:e.request}:null)}function af(e,t,n){return Qi(bn(e,t,n))}function Ji(e,t){const n=bn(e,t),r=af.bind(null,n);return Object.assign(r,{DEFAULTS:n,defaults:Ji.bind(null,n),merge:bn.bind(null,n),parse:Qi})}var cf=Ji(null,Ku);class St extends Error{constructor(n,r,i){super(n);oe(this,"name");oe(this,"status");oe(this,"request");oe(this,"response");Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor),this.name="HttpError",this.status=r,"response"in i&&(this.response=i.response);const l=Object.assign({},i.request);i.request.headers.authorization&&(l.headers=Object.assign({},i.request.headers,{authorization:i.request.headers.authorization.replace(/ .*$/," [REDACTED]")})),l.url=l.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=l}}var sf="0.0.0-development";function uf(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(e)}function ff(e){return e.arrayBuffer()}function Hr(e){var a,c,s,f;const t=e.request&&e.request.log?e.request.log:console,n=((a=e.request)==null?void 0:a.parseSuccessResponseBody)!==!1;(uf(e.body)||Array.isArray(e.body))&&(e.body=JSON.stringify(e.body));let r={},i,l,{fetch:o}=globalThis;if((c=e.request)!=null&&c.fetch&&(o=e.request.fetch),!o)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");return o(e.url,{method:e.method,body:e.body,redirect:(s=e.request)==null?void 0:s.redirect,headers:Object.fromEntries(Object.entries(e.headers).map(([u,d])=>[u,String(d)])),signal:(f=e.request)==null?void 0:f.signal,...e.body&&{duplex:"half"}}).then(async u=>{l=u.url,i=u.status;for(const d of u.headers)r[d[0]]=d[1];if("deprecation"in r){const d=r.link&&r.link.match(/<([^>]+)>; rel="deprecation"/),p=d&&d.pop();t.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${r.sunset}${p?`. See ${p}`:""}`)}if(!(i===204||i===205)){if(e.method==="HEAD"){if(i<400)return;throw new St(u.statusText,i,{response:{url:l,status:i,headers:r,data:void 0},request:e})}if(i===304)throw new St("Not modified",i,{response:{url:l,status:i,headers:r,data:await cn(u)},request:e});if(i>=400){const d=await cn(u);throw new St(df(d),i,{response:{url:l,status:i,headers:r,data:d},request:e})}return n?await cn(u):u.body}}).then(u=>({status:i,url:l,headers:r,data:u})).catch(u=>{if(u instanceof St)throw u;if(u.name==="AbortError")throw u;let d=u.message;throw u.name==="TypeError"&&"cause"in u&&(u.cause instanceof Error?d=u.cause.message:typeof u.cause=="string"&&(d=u.cause)),new St(d,500,{request:e})})}async function cn(e){const t=e.headers.get("content-type");return/application\/json/.test(t)?e.json().catch(()=>e.text()).catch(()=>""):!t||/^text\/|charset=utf-8$/.test(t)?e.text():ff(e)}function df(e){if(typeof e=="string")return e;let t;return"documentation_url"in e?t=` - ${e.documentation_url}`:t="","message"in e?Array.isArray(e.errors)?`${e.message}: ${e.errors.map(JSON.stringify).join(", ")}${t}`:`${e.message}${t}`:`Unknown error: ${JSON.stringify(e)}`}function vn(e,t){const n=e.defaults(t);return Object.assign(function(i,l){const o=n.merge(i,l);if(!o.request||!o.request.hook)return Hr(n.parse(o));const a=(c,s)=>Hr(n.parse(n.merge(c,s)));return Object.assign(a,{endpoint:n,defaults:vn.bind(null,n)}),o.request.hook(a,o)},{endpoint:n,defaults:vn.bind(null,n)})}var yn=vn(cf,{headers:{"user-agent":`octokit-request.js/${sf} ${en()}`}}),pf="0.0.0-development";function hf(e){return`Request failed due to following response errors:
42
+ `);break;case"hidden":switch(_.type){case"datetime-local":case"date":case"time":S=new Date(k).getTime(),$=A.getTime();break;default:S=k,$=A;break}break;default:S=k,$=A;break}if(S!==$)return!1}return!0}return je(()=>{c=document.querySelector("#entry-data")}),e.$$.update=()=>{e.$$.dirty&33&&(i||l)&&f()},[i,s,o,a,u,l]}class gs extends se{constructor(t){super(),ce(this,t,ms,ps,oe,{})}}function _s(e){let t,n,r,i,o,l,a,c;return{c(){t=E("label"),n=te(e[2]),r=V(),i=E("input"),o=V(),l=E("input"),h(i,"type","checkbox"),h(i,"role","switch"),h(i,"id",e[1]),h(i,"name",e[1]),h(i,"form","ignore"),i.required=e[3],h(l,"type","hidden"),h(l,"id",e[1]),h(l,"name",e[1]),l.value=e[0],l.required=e[3],h(t,"class","editorInput"),h(t,"for",e[1])},m(s,u){I(s,t,u),b(t,n),b(t,r),b(t,i),i.checked=e[0],b(t,o),b(t,l),a||(c=[Z(i,"change",e[5]),Z(i,"change",e[4])],a=!0)},p(s,[u]){u&4&&_e(n,s[2]),u&2&&h(i,"id",s[1]),u&2&&h(i,"name",s[1]),u&8&&(i.required=s[3]),u&1&&(i.checked=s[0]),u&2&&h(l,"id",s[1]),u&2&&h(l,"name",s[1]),u&1&&(l.value=s[0]),u&8&&(l.required=s[3]),u&2&&h(t,"for",s[1])},i:v,o:v,d(s){s&&F(t),a=!1,fe(c)}}}function ws(e,t,n){let r,i,o;z(e,De,p=>n(6,r=p)),z(e,we,p=>n(7,i=p)),z(e,$e,p=>n(8,o=p));let{name:l}=t,{label:a}=t,{checked:c=!1}=t,{required:s=!0}=t;function u(){const p={...i};c==null?p[l]=o==null?void 0:o.fields.find(m=>m.name===l).default:p[l]=c,he(we,i=p,i)}async function f(){r&&n(0,c=r.fields[l]),u()}je(()=>{f()});function d(){c=this.checked,n(0,c)}return e.$$set=p=>{"name"in p&&n(1,l=p.name),"label"in p&&n(2,a=p.label),"checked"in p&&n(0,c=p.checked),"required"in p&&n(3,s=p.required)},[c,l,a,s,u,d]}class bs extends se{constructor(t){super(),ce(this,t,ws,_s,oe,{name:1,label:2,checked:0,required:3})}}function vs(e){let t,n,r;return{c(){t=E("input"),h(t,"type","datetime-local"),h(t,"id",e[1]),h(t,"name",e[1]),t.required=e[4]},m(i,o){I(i,t,o),ve(t,e[0]),n||(r=[Z(t,"input",e[8]),Z(t,"input",e[5])],n=!0)},p(i,o){o&2&&h(t,"id",i[1]),o&2&&h(t,"name",i[1]),o&16&&(t.required=i[4]),o&1&&ve(t,i[0])},d(i){i&&F(t),n=!1,fe(r)}}}function ys(e){let t,n,r;return{c(){t=E("input"),h(t,"type","date"),h(t,"id",e[1]),h(t,"name",e[1]),t.required=e[4]},m(i,o){I(i,t,o),ve(t,e[0]),n||(r=[Z(t,"input",e[7]),Z(t,"input",e[5])],n=!0)},p(i,o){o&2&&h(t,"id",i[1]),o&2&&h(t,"name",i[1]),o&16&&(t.required=i[4]),o&1&&ve(t,i[0])},d(i){i&&F(t),n=!1,fe(r)}}}function ks(e){let t,n,r;return{c(){t=E("input"),h(t,"type","time"),h(t,"id",e[1]),h(t,"name",e[1]),t.required=e[4]},m(i,o){I(i,t,o),ve(t,e[0]),n||(r=[Z(t,"input",e[6]),Z(t,"input",e[5])],n=!0)},p(i,o){o&2&&h(t,"id",i[1]),o&2&&h(t,"name",i[1]),o&16&&(t.required=i[4]),o&1&&ve(t,i[0])},d(i){i&&F(t),n=!1,fe(r)}}}function As(e){let t,n,r;function i(a,c){return a[3]==="time"?ks:a[3]==="date"?ys:vs}let o=i(e),l=o(e);return{c(){t=E("label"),n=te(e[2]),r=V(),l.c(),h(t,"class","editorInput"),h(t,"for",e[1])},m(a,c){I(a,t,c),b(t,n),b(t,r),l.m(t,null)},p(a,[c]){c&4&&_e(n,a[2]),o===(o=i(a))&&l?l.p(a,c):(l.d(1),l=o(a),l&&(l.c(),l.m(t,null))),c&2&&h(t,"for",a[1])},i:v,o:v,d(a){a&&F(t),l.d()}}}function Es(e,t,n){let r,i;z(e,De,g=>n(9,r=g)),z(e,we,g=>n(10,i=g));let{name:o}=t,{label:l}=t,{type:a="datetime-local"}=t,{value:c=zt(a,new Date)}=t,{required:s=!0}=t;function u(){const g={...i};g[o]=c,he(we,i=g,i)}async function f(){if(r){const g=r.fields;n(0,c=zt(a,new Date(g[o])))}u()}je(()=>{f()});function d(){c=this.value,n(0,c)}function p(){c=this.value,n(0,c)}function m(){c=this.value,n(0,c)}return e.$$set=g=>{"name"in g&&n(1,o=g.name),"label"in g&&n(2,l=g.label),"type"in g&&n(3,a=g.type),"value"in g&&n(0,c=g.value),"required"in g&&n(4,s=g.required)},[c,o,l,a,s,u,d,p,m]}class Cs extends se{constructor(t){super(),ce(this,t,Es,As,oe,{name:1,label:2,type:3,value:0,required:4})}}function Ss(e){let t,n,r;return{c(){t=E("textarea"),h(t,"id",e[1]),h(t,"name",e[1]),t.required=e[4]},m(i,o){I(i,t,o),ve(t,e[0]),n||(r=[Z(t,"input",e[7]),Z(t,"input",e[5])],n=!0)},p(i,o){o&2&&h(t,"id",i[1]),o&2&&h(t,"name",i[1]),o&16&&(t.required=i[4]),o&1&&ve(t,i[0])},d(i){i&&F(t),n=!1,fe(r)}}}function xs(e){let t,n,r;return{c(){t=E("input"),h(t,"type","text"),h(t,"id",e[1]),h(t,"name",e[1]),t.required=e[4]},m(i,o){I(i,t,o),ve(t,e[0]),n||(r=[Z(t,"input",e[6]),Z(t,"input",e[5])],n=!0)},p(i,o){o&2&&h(t,"id",i[1]),o&2&&h(t,"name",i[1]),o&16&&(t.required=i[4]),o&1&&t.value!==i[0]&&ve(t,i[0])},d(i){i&&F(t),n=!1,fe(r)}}}function Ls(e){let t,n,r;function i(a,c){return a[3]?Ss:xs}let o=i(e),l=o(e);return{c(){t=E("label"),n=te(e[2]),r=V(),l.c(),h(t,"class","editorInput"),h(t,"for",e[1])},m(a,c){I(a,t,c),b(t,n),b(t,r),l.m(t,null)},p(a,[c]){c&4&&_e(n,a[2]),o===(o=i(a))&&l?l.p(a,c):(l.d(1),l=o(a),l&&(l.c(),l.m(t,null))),c&2&&h(t,"for",a[1])},i:v,o:v,d(a){a&&F(t),l.d()}}}function Ts(e,t,n){let r,i,o;z(e,De,g=>n(8,r=g)),z(e,we,g=>n(9,i=g)),z(e,$e,g=>n(10,o=g));let{name:l}=t,{label:a}=t,{multiline:c=!1}=t,{required:s=!0}=t,{value:u=""}=t;function f(){const g={...i};u?g[l]=u:g[l]=o==null?void 0:o.fields.find(_=>_.name===l).label,he(we,i=g,i)}async function d(){r&&n(0,u=l==="body"?r.body:r.fields[l]),f()}je(()=>{d()});function p(){u=this.value,n(0,u)}function m(){u=this.value,n(0,u)}return e.$$set=g=>{"name"in g&&n(1,l=g.name),"label"in g&&n(2,a=g.label),"multiline"in g&&n(3,c=g.multiline),"required"in g&&n(4,s=g.required),"value"in g&&n(0,u=g.value)},[u,l,a,c,s,f,p,m]}class wr extends se{constructor(t){super(),ce(this,t,Ts,Ls,oe,{name:1,label:2,multiline:3,required:4,value:0})}}function Ms(e){let t,n,r,i,o,l;return{c(){t=E("label"),n=te(e[2]),r=V(),i=E("input"),h(i,"type","number"),h(i,"id",e[1]),h(i,"name",e[1]),h(i,"step",e[3]),h(i,"min",e[4]),h(i,"max",e[5]),i.required=e[6],h(t,"class","editorInput"),h(t,"for",e[1])},m(a,c){I(a,t,c),b(t,n),b(t,r),b(t,i),ve(i,e[0]),o||(l=[Z(i,"input",e[8]),Z(i,"input",e[7])],o=!0)},p(a,[c]){c&4&&_e(n,a[2]),c&2&&h(i,"id",a[1]),c&2&&h(i,"name",a[1]),c&8&&h(i,"step",a[3]),c&16&&h(i,"min",a[4]),c&32&&h(i,"max",a[5]),c&64&&(i.required=a[6]),c&1&&Br(i.value)!==a[0]&&ve(i,a[0]),c&2&&h(t,"for",a[1])},i:v,o:v,d(a){a&&F(t),o=!1,fe(l)}}}function Os(e,t,n){let r,i;z(e,De,g=>n(9,r=g)),z(e,we,g=>n(10,i=g));let{name:o}=t,{label:l}=t,{value:a}=t,{step:c}=t,{min:s}=t,{max:u}=t,{required:f=!0}=t;function d(){const g={...i};g[o]=a,he(we,i=g,i)}async function p(){r&&n(0,a=r.fields[o]),d()}je(()=>{p()});function m(){a=Br(this.value),n(0,a)}return e.$$set=g=>{"name"in g&&n(1,o=g.name),"label"in g&&n(2,l=g.label),"value"in g&&n(0,a=g.value),"step"in g&&n(3,c=g.step),"min"in g&&n(4,s=g.min),"max"in g&&n(5,u=g.max),"required"in g&&n(6,f=g.required)},[a,o,l,c,s,u,f,d,m]}class Ds extends se{constructor(t){super(),ce(this,t,Os,Ms,oe,{name:1,label:2,value:0,step:3,min:4,max:5,required:6})}}const Fs=function(){const t=typeof document<"u"&&document.createElement("link").relList;return t&&t.supports&&t.supports("modulepreload")?"modulepreload":"preload"}(),Hs=function(e,t){return new URL(e,t).href},br={},Xe=function(t,n,r){let i=Promise.resolve();if(n&&n.length>0){const o=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),a=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=Promise.allSettled(n.map(c=>{if(c=Hs(c,r),c in br)return;br[c]=!0;const s=c.endsWith(".css"),u=s?'[rel="stylesheet"]':"";if(!!r)for(let p=o.length-1;p>=0;p--){const m=o[p];if(m.href===c&&(!s||m.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${c}"]${u}`))return;const d=document.createElement("link");if(d.rel=s?"stylesheet":Fs,s||(d.as="script"),d.crossOrigin="",d.href=c,a&&d.setAttribute("nonce",a),document.head.appendChild(d),s)return new Promise((p,m)=>{d.addEventListener("load",p),d.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}return i.then(o=>{for(const l of o||[]){if(l.status!=="rejected")continue;const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=l.reason,window.dispatchEvent(a),!a.defaultPrevented)throw l.reason}return t()})},Is='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-bold</title><path d="M13.5,15.5H10V12.5H13.5A1.5,1.5 0 0,1 15,14A1.5,1.5 0 0,1 13.5,15.5M10,6.5H13A1.5,1.5 0 0,1 14.5,8A1.5,1.5 0 0,1 13,9.5H10M15.6,10.79C16.57,10.11 17.25,9 17.25,8C17.25,5.74 15.5,4 13.25,4H7V18H14.04C16.14,18 17.75,16.3 17.75,14.21C17.75,12.69 16.89,11.39 15.6,10.79Z" /></svg>',Ns='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-italic</title><path d="M10,4V7H12.21L8.79,15H6V18H14V15H11.79L15.21,7H18V4H10Z" /></svg>',Rs='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-list-bulleted</title><path d="M7,5H21V7H7V5M7,13V11H21V13H7M4,4.5A1.5,1.5 0 0,1 5.5,6A1.5,1.5 0 0,1 4,7.5A1.5,1.5 0 0,1 2.5,6A1.5,1.5 0 0,1 4,4.5M4,10.5A1.5,1.5 0 0,1 5.5,12A1.5,1.5 0 0,1 4,13.5A1.5,1.5 0 0,1 2.5,12A1.5,1.5 0 0,1 4,10.5M7,19V17H21V19H7M4,16.5A1.5,1.5 0 0,1 5.5,18A1.5,1.5 0 0,1 4,19.5A1.5,1.5 0 0,1 2.5,18A1.5,1.5 0 0,1 4,16.5Z" /></svg>',Ps='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-list-numbered</title><path d="M7,13V11H21V13H7M7,19V17H21V19H7M7,7V5H21V7H7M3,8V5H2V4H4V8H3M2,17V16H5V20H2V19H4V18.5H3V17.5H4V17H2M4.25,10A0.75,0.75 0 0,1 5,10.75C5,10.95 4.92,11.14 4.79,11.27L3.12,13H5V14H2V13.08L4,11H2V10H4.25Z" /></svg>',$s='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>horizontal-rule</title><path d="M19,13H5V11H19V13Z" /></svg>',js='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>format-quote-close</title><path d="M14,17H17L19,13V7H13V13H16M6,17H9L11,13V7H5V13H8L6,17Z" /></svg>',Vs='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>link</title><path d="M3.9,12C3.9,10.29 5.29,8.9 7,8.9H11V7H7A5,5 0 0,0 2,12A5,5 0 0,0 7,17H11V15.1H7C5.29,15.1 3.9,13.71 3.9,12M8,13H16V11H8V13M17,7H13V8.9H17C18.71,8.9 20.1,10.29 20.1,12C20.1,13.71 18.71,15.1 17,15.1H13V17H17A5,5 0 0,0 22,12A5,5 0 0,0 17,7Z" /></svg>',qs='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><title>image</title><path d="M8.5,13.5L11,16.5L14.5,12L19,18H5M21,19V5C21,3.89 20.1,3 19,3H5A2,2 0 0,0 3,5V19A2,2 0 0,0 5,21H19A2,2 0 0,0 21,19Z" /></svg>',{document:Ys}=Kt;function vr(e,t,n){const r=e.slice();return r[9]=t[n],r}function yr(e,t,n){const r=e.slice();return r[12]=t[n],r}function kr(e){let t,n=e[12].title+"",r;return{c(){t=E("option"),r=te(n),t.__value=e[12].value,ve(t,t.__value),h(t,"class","svelte-niyo7g")},m(i,o){I(i,t,o),b(t,r)},p:v,d(i){i&&F(t)}}}function Ar(e){let t,n,r=e[9].icon+"",i,o,l;return{c(){t=E("button"),n=new Ze(!1),i=V(),n.a=i,h(t,"class","secondary svelte-niyo7g"),h(t,"data-action",e[9].name)},m(a,c){I(a,t,c),n.m(r,t),b(t,i),o||(l=Z(t,"click",Ue(e[3])),o=!0)},p:v,d(a){a&&F(t),o=!1,l()}}}function Us(e){let t,n,r,i,o,l,a=Ee(e[1]),c=[];for(let f=0;f<a.length;f+=1)c[f]=kr(yr(e,a,f));let s=Ee(e[2]),u=[];for(let f=0;f<s.length;f+=1)u[f]=Ar(vr(e,s,f));return{c(){t=V(),n=E("div"),r=E("select");for(let f=0;f<c.length;f+=1)c[f].c();i=V();for(let f=0;f<u.length;f+=1)u[f].c();h(r,"name","text-type"),h(r,"form","ignore"),h(r,"class","svelte-niyo7g"),h(n,"class","editor-menu svelte-niyo7g")},m(f,d){I(f,t,d),I(f,n,d),b(n,r);for(let p=0;p<c.length;p+=1)c[p]&&c[p].m(r,null);e[6](r),b(n,i);for(let p=0;p<u.length;p+=1)u[p]&&u[p].m(n,null);o||(l=[Z(Ys,"selectionchange",e[5]),Z(r,"change",e[4])],o=!0)},p(f,[d]){if(d&2){a=Ee(f[1]);let p;for(p=0;p<a.length;p+=1){const m=yr(f,a,p);c[p]?c[p].p(m,d):(c[p]=kr(m),c[p].c(),c[p].m(r,null))}for(;p<c.length;p+=1)c[p].d(1);c.length=a.length}if(d&12){s=Ee(f[2]);let p;for(p=0;p<s.length;p+=1){const m=vr(f,s,p);u[p]?u[p].p(m,d):(u[p]=Ar(m),u[p].c(),u[p].m(n,null))}for(;p<u.length;p+=1)u[p].d(1);u.length=s.length}},i:v,o:v,d(f){f&&(F(t),F(n)),un(c,f),e[6](null),un(u,f),o=!1,fe(l)}}}function Bs(){const e=[];for(let t=0;t<=6;t++){let n;t===0?n={title:"Normal",value:"p"}:n={title:`Heading ${t}`,value:t},e.push(n)}return e}function Gs(e,t,n){const r=Qt();let i,o;const l=Bs(),a=[{name:"bold",icon:Is},{name:"italic",icon:Ns},{name:"listBulleted",icon:Rs},{name:"listNumbered",icon:Ps},{name:"quote",icon:js},{name:"horizontalRule",icon:$s},{name:"link",icon:Vs},{name:"image",icon:qs}];function c(d){const{action:p}=d.currentTarget.dataset;r("menuaction",p)}function s(d){const p=d.currentTarget.value;r("menutexttype",p)}function u(){var g;const p=(g=document.getSelection().focusNode)==null?void 0:g.parentElement;if(!o.contains(p))return;const{localName:m}=p;switch(m){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":n(0,i.value=parseInt(m.split("").at(-1)),i);break;default:n(0,i.value="p",i);break}}je(()=>{o=document.querySelector("#md-editor")});function f(d){at[d?"unshift":"push"](()=>{i=d,n(0,i),n(1,l)})}return[i,l,a,c,s,u,f]}class Ws extends se{constructor(t){super(),ce(this,t,Gs,Us,oe,{})}}const{document:zs}=Kt;function Zs(e){let t,n,r,i,o,l,a,c,s,u;return{c(){t=V(),n=E("div"),r=E("div"),i=E("div"),i.textContent="Enter link:",o=V(),l=E("input"),a=V(),c=E("button"),c.textContent="Save",h(i,"class","svelte-1vifg91"),h(l,"form","md-link-editor"),h(l,"type","url"),h(l,"name","url"),h(l,"placeholder","https://example.com"),l.required=!0,h(l,"class","svelte-1vifg91"),h(c,"class","secondary svelte-1vifg91"),h(c,"form","md-link-editor"),h(c,"type","submit"),h(r,"id","link-editor"),h(r,"class","svelte-1vifg91"),h(n,"id","link-editor-container"),h(n,"class","svelte-1vifg91"),Gn(n,"visibility",e[0]?"visible":"hidden")},m(f,d){I(f,t,d),I(f,n,d),b(n,r),b(r,i),b(r,o),b(r,l),e[5](l),b(r,a),b(r,c),e[6](r),s||(u=Z(zs,"selectionchange",e[3]),s=!0)},p(f,[d]){d&1&&Gn(n,"visibility",f[0]?"visible":"hidden")},i:v,o:v,d(f){f&&(F(t),F(n)),e[5](null),e[6](null),s=!1,u()}}}function Ks(e,t,n){const r=Qt();let i=!1,o,l;function a(){const d=document.getSelection();if(d.focusNode.parentElement.localName==="a"){r("saveurl",{});return}else if(i)n(0,i=!i),n(2,l.value="",l);else{const{startOffset:p,endOffset:m}=d.getRangeAt(0);n(0,i=p!==m)}}function c(d){d.preventDefault();const p=l.value;n(2,l.value="",l),n(0,i=!1),r("saveurl",{href:p})}function s(){if(!i)return;const p=document.getSelection().focusNode;o.contains(p)||(n(0,i=!1),n(2,l.value="",l),r("saveurl",null))}je(()=>{const d=document.querySelector("#md-link-editor");return d.addEventListener("submit",c),()=>{d.removeEventListener("submit",c)}}),_o(()=>{i&&l.focus()});function u(d){at[d?"unshift":"push"](()=>{l=d,n(2,l)})}function f(d){at[d?"unshift":"push"](()=>{o=d,n(1,o)})}return[i,o,l,s,a,u,f]}class Qs extends se{constructor(t){super(),ce(this,t,Ks,Zs,oe,{toggleEditor:4})}get toggleEditor(){return this.$$.ctx[4]}}function Er(e,t,n){const r=e.slice();return r[9]=t[n],r}function Cr(e,t){let n,r,i,o,l,a=t[9].name+"",c,s,u,f;function d(){return t[6](t[9])}return{key:e,first:null,c(){n=E("div"),r=E("img"),o=V(),l=E("small"),c=te(a),s=V(),Vt(r.src,i=t[9].url_preview)||h(r,"src",i),h(r,"alt",""),h(r,"loading","lazy"),h(r,"crossorigin","use-credentials"),h(r,"class","svelte-157z34i"),h(l,"class","svelte-157z34i"),h(n,"class","img-container svelte-157z34i"),qt(n,"selected",t[1]===t[9]),this.first=n},m(p,m){I(p,n,m),b(n,r),b(n,o),b(n,l),b(l,c),b(n,s),u||(f=Z(n,"click",d),u=!0)},p(p,m){t=p,m&1&&!Vt(r.src,i=t[9].url_preview)&&h(r,"src",i),m&1&&a!==(a=t[9].name+"")&&_e(c,a),m&3&&qt(n,"selected",t[1]===t[9])},d(p){p&&F(n),u=!1,f()}}}function Xs(e){let t,n,r,i,o,l=[],a=new Map,c,s,u,f,d,p,m,g,_,k=Ee(e[0]);const A=S=>S[9].name;for(let S=0;S<k.length;S+=1){let $=Er(e,k,S),M=A($);a.set(M,l[S]=Cr(M,$))}return{c(){t=E("dialog"),n=E("article"),r=E("header"),r.textContent="Select Image",i=V(),o=E("div");for(let S=0;S<l.length;S+=1)l[S].c();c=V(),s=E("footer"),u=E("button"),u.textContent="Cancel",f=V(),d=E("button"),p=te("Select"),h(o,"class","images svelte-157z34i"),h(u,"class","secondary svelte-157z34i"),d.disabled=m=!e[1],h(d,"class","svelte-157z34i"),h(s,"class","svelte-157z34i"),t.open=!0},m(S,$){I(S,t,$),b(t,n),b(n,r),b(n,i),b(n,o);for(let M=0;M<l.length;M+=1)l[M]&&l[M].m(o,null);b(n,c),b(n,s),b(s,u),b(s,f),b(s,d),b(d,p),g||(_=[Z(u,"click",Ue(e[4])),Z(d,"click",Ue(e[3])),Z(t,"click",e[4])],g=!0)},p(S,[$]){$&7&&(k=Ee(S[0]),l=Ft(l,$,A,1,S,k,a,o,Gr,Cr,null,Er)),$&2&&m!==(m=!S[1])&&(d.disabled=m)},i:v,o:v,d(S){S&&F(t);for(let $=0;$<l.length;$+=1)l[$].d();g=!1,fe(_)}}}function Js(e,t,n){let r;z(e,Ve,d=>n(5,r=d));const i=Qt();let o=[],l;async function a(){const d=await(r==null?void 0:r.getMediaFiles());n(0,o=d||[])}function c(d){n(1,l=d)}function s(){i("selectimg",{img:l})}function u(d){d.currentTarget===d.target&&i("selectimg",{})}je(()=>{const{body:d}=document;return d.classList.add("contain-scroll"),()=>{d.classList.remove("contain-scroll")}});const f=d=>c(d);return e.$$.update=()=>{e.$$.dirty&32&&r&&a()},[o,l,c,s,u,r,f]}class eu extends se{constructor(t){super(),ce(this,t,Js,Xs,oe,{})}}const{document:tu}=Kt;function nu(e){let t,n;return t=new Qe({props:{msg:"Unable to load",details:e[48].message}}),{c(){J(t.$$.fragment)},m(r,i){Q(t,r,i),n=!0},p(r,i){const o={};i[0]&16&&(o.details=r[48].message),t.$set(o)},i(r){n||(H(t.$$.fragment,r),n=!0)},o(r){j(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function ru(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function iu(e){let t,n;return t=new en({props:{msg:"Loading"}}),{c(){J(t.$$.fragment)},m(r,i){Q(t,r,i),n=!0},p:v,i(r){n||(H(t.$$.fragment,r),n=!0)},o(r){j(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Sr(e){let t,n;return t=new eu({}),t.$on("selectimg",e[7]),{c(){J(t.$$.fragment)},m(r,i){Q(t,r,i),n=!0},p:v,i(r){n||(H(t.$$.fragment,r),n=!0)},o(r){j(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function ou(e){let t,n,r,i,o,l,a,c,s,u,f,d,p,m,g,_,k,A,S;l=new Ws({}),l.$on("menutexttype",e[9]),l.$on("menuaction",e[10]);let $={};u=new Qs({props:$}),e[13](u),u.$on("saveurl",e[8]);let M={ctx:e,current:null,token:null,hasCatch:!0,pending:iu,then:ru,catch:nu,error:48,blocks:[,,,]};ue(m=e[4],M);let P=e[5]&&Sr(e);return{c(){t=V(),n=E("label"),r=te(e[2]),i=V(),o=E("div"),J(l.$$.fragment),a=V(),c=E("div"),s=V(),J(u.$$.fragment),f=V(),d=E("input"),p=V(),M.block.c(),g=V(),P&&P.c(),_=Oe(),h(o,"id","md-editor"),h(o,"class","svelte-1rfhu7q"),h(d,"type","hidden"),h(d,"id",e[1]),h(d,"name",e[1]),d.required=e[3],h(d,"class","svelte-1rfhu7q"),h(n,"class","editorInput"),h(n,"for",e[1])},m(N,C){I(N,t,C),I(N,n,C),b(n,r),b(n,i),b(n,o),Q(l,o,null),b(o,a),b(o,c),b(o,s),Q(u,o,null),b(n,f),b(n,d),ve(d,e[0]),I(N,p,C),M.block.m(N,M.anchor=C),M.mount=()=>g.parentNode,M.anchor=g,I(N,g,C),P&&P.m(N,C),I(N,_,C),k=!0,A||(S=[Z(tu,"selectionchange",e[11]),po(e[12].call(null,c)),Z(d,"input",e[14])],A=!0)},p(N,C){e=N,(!k||C[0]&4)&&_e(r,e[2]);const R={};u.$set(R),(!k||C[0]&2)&&h(d,"id",e[1]),(!k||C[0]&2)&&h(d,"name",e[1]),(!k||C[0]&8)&&(d.required=e[3]),C[0]&1&&ve(d,e[0]),(!k||C[0]&2)&&h(n,"for",e[1]),M.ctx=e,C[0]&16&&m!==(m=e[4])&&ue(m,M)||Pe(M,e,C),e[5]?P?(P.p(e,C),C[0]&32&&H(P,1)):(P=Sr(e),P.c(),H(P,1),P.m(_.parentNode,_)):P&&(ye(),j(P,1,1,()=>{P=null}),ke())},i(N){k||(H(l.$$.fragment,N),H(u.$$.fragment,N),H(M.block),H(P),k=!0)},o(N){j(l.$$.fragment,N),j(u.$$.fragment,N);for(let C=0;C<3;C+=1){const R=M.blocks[C];j(R)}j(P),k=!1},d(N){N&&(F(t),F(n),F(p),F(g),F(_)),X(l),e[13](null),X(u),M.block.d(N),M.token=null,M=null,P&&P.d(N),A=!1,fe(S)}}}function lu(e,t,n){let r,i,o,l;z(e,Ve,Y=>n(38,r=Y)),z(e,De,Y=>n(39,i=Y)),z(e,we,Y=>n(40,o=Y)),z(e,$e,Y=>n(41,l=Y));let{name:a}=t,{label:c}=t,{value:s=""}=t,{required:u=!0}=t,f,d,p,m,g,_,k,A,S,$,M,P,N,C,R,D,x,B,W,O,y,w=!1,L,T,q,G;async function K(){const Y=await Xe(()=>import("./index.es.js").then(It=>It.a5),[],import.meta.url),ee=await Xe(()=>import("./index.es2.js"),[],import.meta.url),ne=await Xe(()=>import("./index.es3.js"),[],import.meta.url),le=await Xe(()=>import("./index.es4.js"),[],import.meta.url),Re=await Xe(()=>import("./index.es5.js"),[],import.meta.url);f=Y.Editor,d=Y.rootCtx,p=Y.defaultValueCtx,m=Y.commandsCtx,g=ee.listener,_=ee.listenerCtx,k=ne.commonmark,A=ne.turnIntoTextCommand,S=ne.wrapInHeadingCommand,$=ne.toggleStrongCommand,M=ne.toggleEmphasisCommand,P=ne.wrapInBulletListCommand,N=ne.wrapInOrderedListCommand,C=ne.wrapInBlockquoteCommand,R=ne.insertHrCommand,D=ne.toggleLinkCommand,x=ne.insertImageCommand,B=le.nord,W=Re.getHTML,O=Re.replaceAll}function re(Y){const ee={...o};Y?q&&(ee[a]=W()(q.ctx).replaceAll("<img ",'<img crossorigin="use-credentials" ')):ee[a]=l==null?void 0:l.fields.find(ne=>ne.name===a).label,he(we,o=ee,o)}function ie(){if(!L)return;const Y=document.getSelection();Y.removeAllRanges();const ee=document.createRange(),{startOffset:ne,endOffset:le}=L.range;ee.setStart(L.node,ne),ee.setEnd(L.node,le),Y.addRange(ee)}function de(Y){n(5,w=!1),ie();const{img:ee}=Y.detail;ee&&q.action(ne=>{const le=ne.get(m),Re={alt:ee.name,src:ee.url_preview};le.call(x.key,Re)})}function Ae(Y){if(ie(),!Y.detail)return;const{href:ee}=Y.detail,ne=document.getSelection(),{textContent:le}=ne.focusNode,{startOffset:Re,endOffset:It}=ne.getRangeAt(0),io=le.substring(Re,It);q.action(oo=>{const lo=oo.get(m),ao={title:io,href:ee};lo.call(D.key,ao)})}function qe(Y){const ee=Y.detail;q.action(ne=>{const le=ne.get(m);ee==="p"?le.call(A.key):le.call(S.key,ee)})}function Ie(Y){const ee=Y.detail;q.action(ne=>{const le=ne.get(m);switch(ee){case"bold":le.call($.key);break;case"italic":le.call(M.key);break;case"listBulleted":le.call(P.key);break;case"listNumbered":le.call(N.key);break;case"quote":le.call(C.key);break;case"horizontalRule":le.call(R.key);break;case"link":T.toggleEditor();break;case"image":L&&n(5,w=!0);break}})}function We(){const Y=document.getSelection(),ee=Y.focusNode;G!=null&&G.contains(ee)&&(L={node:Y.focusNode,range:Y.getRangeAt(0)})}function Fe(Y){q=Y,G=document.querySelector(".milkdown .ProseMirror"),O(s)(q.ctx),re(s)}async function me(Y){await K(),f.make().config(ee=>{ee.set(d,Y),ee.set(p,s),ee.get(_).markdownUpdated((ne,le,Re)=>{n(0,s=le)})}).config(B).use(k).use(g).create().then(Fe)}function Le(Y){me(Y)}async function Ne(){if(i)try{const Y=a==="body"?i.body:i.fields[a];n(4,y=r.replacePublicLinks(Y)),n(0,s=await y),q&&O(s)(q.ctx)}catch{}}je(()=>{Ne()});function Ye(Y){at[Y?"unshift":"push"](()=>{T=Y,n(6,T)})}function ft(){s=this.value,n(0,s)}return e.$$set=Y=>{"name"in Y&&n(1,a=Y.name),"label"in Y&&n(2,c=Y.label),"value"in Y&&n(0,s=Y.value),"required"in Y&&n(3,u=Y.required)},e.$$.update=()=>{e.$$.dirty[0]&1&&re(s)},[s,a,c,u,y,w,T,de,Ae,qe,Ie,We,Le,Ye,ft]}class au extends se{constructor(t){super(),ce(this,t,lu,ou,oe,{name:1,label:2,value:0,required:3},null,[-1,-1])}}function cu(e){let t,n,r;return{c(){t=E("input"),h(t,"type","hidden"),h(t,"id",e[1]),h(t,"name",e[1])},m(i,o){I(i,t,o),ve(t,e[0]),n||(r=Z(t,"input",e[3]),n=!0)},p(i,[o]){o&2&&h(t,"id",i[1]),o&2&&h(t,"name",i[1]),o&1&&ve(t,i[0])},i:v,o:v,d(i){i&&F(t),n=!1,r()}}}function su(e,t,n){let r,i;z(e,De,f=>n(4,r=f)),z(e,we,f=>n(5,i=f));let{name:o}=t,{type:l="text"}=t,{value:a}=t;function c(){const f={...i};f[o]=a,he(we,i=f,i)}async function s(){if(r!=null&&r.fields[o])switch(l){case"datetime-local":case"date":case"time":n(0,a=zt(l,new Date(r.fields[o])));break;default:n(0,a=r.fields[o]);break}else if(!a)switch(l){case"datetime-local":case"date":case"time":n(0,a=zt(l,new Date));break;case"boolean":n(0,a="false");break}c()}je(()=>{s()});function u(){a=this.value,n(0,a)}return e.$$set=f=>{"name"in f&&n(1,o=f.name),"type"in f&&n(2,l=f.type),"value"in f&&n(0,a=f.value)},[a,o,l,u]}class uu extends se{constructor(t){super(),ce(this,t,su,cu,oe,{name:1,type:2,value:0})}}function fu(e){let t,n,r;return{c(){t=E("iframe"),h(t,"title","Preview"),h(t,"sandbox","allow-same-origin"),h(t,"srcdoc",e[1]),h(t,"class","svelte-1sw5k8j")},m(i,o){I(i,t,o),e[9](t),n||(r=Z(t,"load",e[2]),n=!0)},p(i,[o]){o&2&&h(t,"srcdoc",i[1])},i:v,o:v,d(i){i&&F(t),e[9](null),n=!1,r()}}}function du(e,t,n){let r,i,o,l,a,c;z(e,we,m=>n(6,l=m)),z(e,$e,m=>n(7,a=m)),z(e,Ce,m=>n(8,c=m)),Te.extend(Yi);let s,u;function f(){d()}function d(){if(u!=null&&u.contentDocument)for(const m in l){const g=a==null?void 0:a.fields.find(A=>A.name===m);let _=l[m];if(g.name==="date")switch(g==null?void 0:g.type){case"time":_=Te(l[m],"hh:mm").format(g.time_format);break;case"date":_=Te(l[m],"YYYY-MM-DD").format(g.date_format);break;default:_=Te(l[m],"YYYY-MM-DDThh:mm").format(g.datetime_format)}u.contentDocument.querySelectorAll(`[data-tag="${m}"]`).forEach(A=>{A.innerHTML!==_&&(A.innerHTML=_)})}}function p(m){at[m?"unshift":"push"](()=>{u=m,n(0,u)})}return e.$$.update=()=>{e.$$.dirty&384&&n(5,r=(a==null?void 0:a.preview)||(c==null?void 0:c.previews.default)),e.$$.dirty&288&&n(4,i=rs(c,r)),e.$$.dirty&288&&(async()=>n(3,s=await is(c,r)))(),e.$$.dirty&24&&n(1,o=os(s,i)),e.$$.dirty&192&&(a||l)&&d()},[u,o,f,s,i,r,l,a,c,p]}class pu extends se{constructor(t){super(),ce(this,t,du,fu,oe,{})}}function xr(e,t,n){var l;const r=e.slice();r[11]=t[n];const i=r[5][r[11].widget];r[12]=i;const o=(l=r[11])==null?void 0:l.default;return r[13]=o,r}function Lr(e){let t=[],n=new Map,r,i,o=Ee(e[3].fields);const l=a=>a[11].name;for(let a=0;a<o.length;a+=1){let c=xr(e,o,a),s=l(c);n.set(s,t[a]=Tr(s,c))}return{c(){for(let a=0;a<t.length;a+=1)t[a].c();r=Oe()},m(a,c){for(let s=0;s<t.length;s+=1)t[s]&&t[s].m(a,c);I(a,r,c),i=!0},p(a,c){c&40&&(o=Ee(a[3].fields),ye(),t=Ft(t,c,l,1,a,o,n,r.parentNode,Tn,Tr,r,xr),ke())},i(a){if(!i){for(let c=0;c<o.length;c+=1)H(t[c]);i=!0}},o(a){for(let c=0;c<t.length;c+=1)j(t[c]);i=!1},d(a){a&&F(r);for(let c=0;c<t.length;c+=1)t[c].d(a)}}}function hu(e){let t,n,r;const i=[e[11],{value:e[13]}];var o=e[12];function l(a,c){let s={};for(let u=0;u<i.length;u+=1)s=lt(s,i[u]);return c!==void 0&&c&8&&(s=lt(s,ct(i,[st(a[11]),{value:a[13]}]))),{props:s}}return o&&(t=et(o,l(e))),{c(){t&&J(t.$$.fragment),n=Oe()},m(a,c){t&&Q(t,a,c),I(a,n,c),r=!0},p(a,c){if(c&8&&o!==(o=a[12])){if(t){ye();const s=t;j(s.$$.fragment,1,0,()=>{X(s,1)}),ke()}o?(t=et(o,l(a,c)),J(t.$$.fragment),H(t.$$.fragment,1),Q(t,n.parentNode,n)):t=null}else if(o){const s=c&8?ct(i,[st(a[11]),{value:a[13]}]):{};t.$set(s)}},i(a){r||(t&&H(t.$$.fragment,a),r=!0)},o(a){t&&j(t.$$.fragment,a),r=!1},d(a){a&&F(n),t&&X(t,a)}}}function mu(e){let t,n,r;const i=[e[11],{value:e[13]},{multiline:!0}];var o=e[12];function l(a,c){let s={};for(let u=0;u<i.length;u+=1)s=lt(s,i[u]);return c!==void 0&&c&8&&(s=lt(s,ct(i,[st(a[11]),{value:a[13]},i[2]]))),{props:s}}return o&&(t=et(o,l(e))),{c(){t&&J(t.$$.fragment),n=Oe()},m(a,c){t&&Q(t,a,c),I(a,n,c),r=!0},p(a,c){if(c&8&&o!==(o=a[12])){if(t){ye();const s=t;j(s.$$.fragment,1,0,()=>{X(s,1)}),ke()}o?(t=et(o,l(a,c)),J(t.$$.fragment),H(t.$$.fragment,1),Q(t,n.parentNode,n)):t=null}else if(o){const s=c&8?ct(i,[st(a[11]),{value:a[13]},i[2]]):{};t.$set(s)}},i(a){r||(t&&H(t.$$.fragment,a),r=!0)},o(a){t&&j(t.$$.fragment,a),r=!1},d(a){a&&F(n),t&&X(t,a)}}}function gu(e){let t,n,r;const i=[e[11],{checked:e[13]}];var o=e[12];function l(a,c){let s={};for(let u=0;u<i.length;u+=1)s=lt(s,i[u]);return c!==void 0&&c&8&&(s=lt(s,ct(i,[st(a[11]),{checked:a[13]}]))),{props:s}}return o&&(t=et(o,l(e))),{c(){t&&J(t.$$.fragment),n=Oe()},m(a,c){t&&Q(t,a,c),I(a,n,c),r=!0},p(a,c){if(c&8&&o!==(o=a[12])){if(t){ye();const s=t;j(s.$$.fragment,1,0,()=>{X(s,1)}),ke()}o?(t=et(o,l(a,c)),J(t.$$.fragment),H(t.$$.fragment,1),Q(t,n.parentNode,n)):t=null}else if(o){const s=c&8?ct(i,[st(a[11]),{checked:a[13]}]):{};t.$set(s)}},i(a){r||(t&&H(t.$$.fragment,a),r=!0)},o(a){t&&j(t.$$.fragment,a),r=!1},d(a){a&&F(n),t&&X(t,a)}}}function Tr(e,t){let n,r,i,o,l;const a=[gu,mu,hu],c=[];function s(u,f){return u[11].widget==="boolean"?0:u[11].widget==="text"?1:2}return r=s(t),i=c[r]=a[r](t),{key:e,first:null,c(){n=Oe(),i.c(),o=Oe(),this.first=n},m(u,f){I(u,n,f),c[r].m(u,f),I(u,o,f),l=!0},p(u,f){t=u;let d=r;r=s(t),r===d?c[r].p(t,f):(ye(),j(c[d],1,1,()=>{c[d]=null}),ke(),i=c[r],i?i.p(t,f):(i=c[r]=a[r](t),i.c()),H(i,1),i.m(o.parentNode,o))},i(u){l||(H(i),l=!0)},o(u){j(i),l=!1},d(u){u&&(F(n),F(o)),c[r].d(u)}}}function _u(e){let t,n;return t=new Qe({props:{msg:"Unable to save",details:e[10].message}}),{c(){J(t.$$.fragment)},m(r,i){Q(t,r,i),n=!0},p(r,i){const o={};i&1&&(o.details=r[10].message),t.$set(o)},i(r){n||(H(t.$$.fragment,r),n=!0)},o(r){j(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function wu(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function bu(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function vu(e){let t,n;return t=new Qe({props:{msg:"Unable to save",details:e[10].message}}),{c(){J(t.$$.fragment)},m(r,i){Q(t,r,i),n=!0},p(r,i){const o={};i&4&&(o.details=r[10].message),t.$set(o)},i(r){n||(H(t.$$.fragment,r),n=!0)},o(r){j(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function yu(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function ku(e){let t,n;return t=new en({props:{msg:"Saving"}}),{c(){J(t.$$.fragment)},m(r,i){Q(t,r,i),n=!0},p:v,i(r){n||(H(t.$$.fragment,r),n=!0)},o(r){j(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Au(e){let t,n;return t=new Qe({props:{msg:"'On save' event action failed",details:e[10].message}}),{c(){J(t.$$.fragment)},m(r,i){Q(t,r,i),n=!0},p(r,i){const o={};i&2&&(o.details=r[10].message),t.$set(o)},i(r){n||(H(t.$$.fragment,r),n=!0)},o(r){j(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Eu(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Cu(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Su(e){let t,n,r,i,o,l,a,c,s,u,f,d,p,m,g,_,k,A,S,$,M,P,N,C,R,D;t=new gs({});let x=e[3]&&Lr(e);_=new pu({});let B={ctx:e,current:null,token:null,hasCatch:!0,pending:bu,then:wu,catch:_u,error:10,blocks:[,,,]};ue(A=e[0],B);let W={ctx:e,current:null,token:null,hasCatch:!0,pending:ku,then:yu,catch:vu,error:10,blocks:[,,,]};ue($=e[2],W);let O={ctx:e,current:null,token:null,hasCatch:!0,pending:Cu,then:Eu,catch:Au,error:10,blocks:[,,,]};return ue(N=e[1],O),{c(){J(t.$$.fragment),n=V(),r=E("div"),i=E("section"),o=E("header"),o.textContent="Edit",l=V(),a=E("form"),x&&x.c(),c=V(),s=E("form"),u=V(),f=E("form"),d=V(),p=E("section"),m=E("header"),m.textContent="Preview",g=V(),J(_.$$.fragment),k=V(),B.block.c(),S=V(),W.block.c(),M=V(),P=Oe(),O.block.c(),h(o,"class","svelte-14qwct"),h(a,"id","entry-data"),h(a,"class","svelte-14qwct"),h(s,"id","md-link-editor"),h(s,"class","svelte-14qwct"),h(f,"id","ignore"),h(f,"class","svelte-14qwct"),h(i,"id","inputArea"),h(i,"class","svelte-14qwct"),h(m,"class","svelte-14qwct"),h(p,"id","previewArea"),h(p,"class","svelte-14qwct"),h(r,"class","page svelte-14qwct")},m(y,w){Q(t,y,w),I(y,n,w),I(y,r,w),b(r,i),b(i,o),b(i,l),b(i,a),x&&x.m(a,null),b(i,c),b(i,s),b(i,u),b(i,f),b(r,d),b(r,p),b(p,m),b(p,g),Q(_,p,null),I(y,k,w),B.block.m(y,B.anchor=w),B.mount=()=>S.parentNode,B.anchor=S,I(y,S,w),W.block.m(y,W.anchor=w),W.mount=()=>M.parentNode,W.anchor=M,I(y,M,w),I(y,P,w),O.block.m(y,O.anchor=w),O.mount=()=>P.parentNode,O.anchor=P,C=!0,R||(D=Z(a,"submit",Ue(e[6])),R=!0)},p(y,[w]){e=y,e[3]?x?(x.p(e,w),w&8&&H(x,1)):(x=Lr(e),x.c(),H(x,1),x.m(a,null)):x&&(ye(),j(x,1,1,()=>{x=null}),ke()),B.ctx=e,w&1&&A!==(A=e[0])&&ue(A,B)||Pe(B,e,w),W.ctx=e,w&4&&$!==($=e[2])&&ue($,W)||Pe(W,e,w),O.ctx=e,w&2&&N!==(N=e[1])&&ue(N,O)||Pe(O,e,w)},i(y){C||(H(t.$$.fragment,y),H(x),H(_.$$.fragment,y),H(B.block),H(W.block),H(O.block),C=!0)},o(y){j(t.$$.fragment,y),j(x),j(_.$$.fragment,y);for(let w=0;w<3;w+=1){const L=B.blocks[w];j(L)}for(let w=0;w<3;w+=1){const L=W.blocks[w];j(L)}for(let w=0;w<3;w+=1){const L=O.blocks[w];j(L)}C=!1},d(y){y&&(F(n),F(r),F(k),F(S),F(M),F(P)),X(t,y),x&&x.d(),X(_),B.block.d(y),B.token=null,B=null,W.block.d(y),W.token=null,W=null,O.block.d(y),O.token=null,O=null,R=!1,D()}}}function xu(e,t,n){let r,i,o,l,a;z(e,De,p=>n(7,r=p)),z(e,Nn,p=>n(8,i=p)),z(e,$e,p=>n(3,l=p)),z(e,Ve,p=>n(9,a=p));const c=nt();z(e,c,p=>n(2,o=p)),Sn("submitted",c);let s,u;const f={string:wr,text:wr,datetime:Cs,boolean:bs,number:Ds,markdown:au,hidden:uu};async function d(p){const m=r?{...r}:{fields:{}},g=new FormData(p.target);for(const[k,A]of g.entries()){const S=l.fields.find($=>$.name===k);try{n(0,s=Ui(S,A,a)),m.fields[k]=await s}catch($){console.error("Error parsing form entry.",$);return}}const _=as(l,m);he(c,o=a.saveFile(l,_),o);try{he(De,r=await o,r),i!=null&&i.onSave&&(n(1,u=i.onSave(r)),await u)}catch(k){console.warn("Issue saving post.",k)}}return[s,u,o,l,c,f,d]}class Lu extends se{constructor(t){super(),ce(this,t,xu,Su,oe,{})}}async function Tu(e,t){let n;try{n=await t.text()}catch(a){console.error("Error constructing doc",a);return}const[r,i]=jn(n),o=Jt.load(r);return{_id:t.webkitRelativePath,name:t.name,collection:e,date:o.date,raw:n,fields:o,body:i,handle:t.handle,directoryHandle:t.directoryHandle}}function Bi(e,t){const n=t.lastModifiedDate,r=`${e.public_folder}/${t.name}`;return{_id:t.webkitRelativePath,name:t.name,date:n,asset:t.type,url:r,url_preview:r,handle:t.handle,directoryHandle:t.directoryHandle}}let jt,Gi,Wi,ot,Ge,xt;async function Mu(){if(ot=He(Ce).repo_folder,!ot){console.error("Missing 'repo_folder' config");return}return await Ou(),jt.plugin(Gi),jt.plugin(Wi),Ge=new jt(`${ot}-local`,{adapter:"idb"}),[["name","collection"],["date","collection"],["asset"],["url"],["url_preview"]].map(t=>({index:{fields:t},ddoc:t.join("-")})).forEach(t=>Fu(t)),console.log("Using local CMS backend"),Vn}async function Ou(){jt=(await Xe(async()=>{const{default:e}=await import("./index.es6.js");return{default:e}},[],import.meta.url)).default,Gi=(await Xe(async()=>{const{default:e}=await import("./index.es7.js");return{default:e}},[],import.meta.url)).default,Wi=(await Xe(async()=>{const{default:e}=await import("./index-browser.es.js");return{default:e}},[],import.meta.url)).default}async function Du(){return{title:"Local Backend Enabled",message:"Select the local project directory to continue.",button:"Select Project Directory",action:Iu}}async function Fu(e){try{const t=await Ge.createIndex(e);console.log("Create index",e,t)}catch(t){console.error("Create index error",t)}}async function Hu(e){try{const t=await Ge.get(e._id);e._rev=t._rev}catch(t){console.warn("Existing doc error",t)}}async function Iu(){if(!ot)return;const e=[],t=He(Ce);t.collections.forEach(s=>{const d=`\\/?${s.folder.split("/").join("\\/")}\\/[^_][\\w-]+\\.\\w+`;e.push({name:s.name,regex:new RegExp(d,"i")})});const o=`\\/?${t.media_folder.split("/").join("\\/")}\\/[^_][\\w-]+\\.\\w+`,l=new RegExp(o,"i"),a=["node_modules"],c={recursive:!0,id:`snow-cms-${ot}`,skipDirectory:s=>s.name.startsWith(".")||a.includes(s.name)};try{const s=await Vc(c),u=[],f=[];s.forEach(g=>{var A;if(!xt&&((A=g.directoryHandle)==null?void 0:A.name)===ot&&(xt=g.directoryHandle),l.test(g.webkitRelativePath)){u.push(Bi(t,g));return}const k=e.find(({name:S,regex:$})=>$.test(g.webkitRelativePath));k&&f.push(Tu(k.name,g))});const d=await Promise.all(f);d.push(...u);const p=[];d.forEach(g=>p.push(Hu(g))),await Promise.all(p);const m=await Ge.bulkDocs(d);Ve.set(Vn)}catch(s){console.error("Open directory error",s)}}async function Nu(e){try{return(await Ge.find({selector:{collection:e,date:{$gte:null}},sort:[{date:"desc"}],limit:200})).docs}catch(t){throw console.error("Error finding docs",t),t}}async function Ru(e,t){const n=He(Ce).repo_folder;t._id||(t._id=[n,e.folder,t.name].join("/"));try{const r=`.${e.extension}`,i=`snow-cms-save-${n}-${e.folder.split(/[\/\\]/).at(-1)}`.substring(0,32),o={fileName:t.name,extensions:[r],id:i},l=new Blob([t.raw],{type:cs(r)});if(t.handle)await wn(l,o,t.handle,!0);else{let c=await wn(l,o);t.handle=c}const a=await Ge.put(t);return console.log(a),t._rev=a.rev,t}catch(r){throw console.error("Save file error",r),r}}async function Pu(e){try{e.forEach(r=>r._deleted=!0);const t=await Ge.bulkDocs(e);console.log(t);const n=[];e.forEach(r=>{r.handle&&n.push(r.handle.remove())}),await Promise.all(n)}catch(t){throw console.error("Delete files error",t),t}}async function $u(){try{return(await Ge.find({selector:{asset:{$gt:""}},limit:200})).docs}catch(e){return console.error("Error finding docs",e),null}}async function ju(){try{const t=await Pn({mimeTypes:["image/*"],description:"Image Files"}),n="."+t.name.split(".").at(-1),r={fileName:t.name,extensions:[n],id:`snow-cms-upload-${ot}`},i=await wn(t,r);if(!xt){console.warn("File not saved to db: No root dir handle found.");return}const o=await xt.resolve(i);o.unshift(xt.name);const l={name:i.name,lastModifiedDate:new Date,type:t.type,webkitRelativePath:o.join("/"),handle:i},a=Bi(He(Ce),l),c=await Ge.put(a);console.log(c)}catch(e){console.error("Upload file error",e)}}async function zi(e,t){const n=[];t.forEach(o=>{const l={limit:200};e==="public"?l.selector={url:o}:l.selector={url_preview:o};const a=Ge.find(l);n.push(a)});const r=await Promise.all(n),i=[];return r.forEach(o=>i.push(...o.docs)),i}async function Vu(e){let t=e;try{const n=Ht(t);return n.length===0?e:((await zi("public",n)).forEach(i=>{t=t.replaceAll(i.url,i.url_preview)}),t)}catch(n){throw console.error("Error processing public links",n),n}}async function qu(e){let t=e;try{const n=Ht(t);return n.length===0?e:((await zi("preview",n)).forEach(i=>{t=t.replaceAll(i.url_preview,i.url)}),t)}catch(n){throw console.error("Error processing preview links",n),n}}const Vn={init:Mu,getLoginConfig:Du,getFiles:Nu,saveFile:Ru,deleteFiles:Pu,getMediaFiles:$u,uploadMediaFile:ju,replacePublicLinks:Vu,replacePreviewLinks:qu};function tn(){return typeof navigator=="object"&&"userAgent"in navigator?navigator.userAgent:typeof process=="object"&&process.version!==void 0?`Node.js/${process.version.substr(1)} (${process.platform}; ${process.arch})`:"<environment undetectable>"}function qn(e,t,n,r){if(typeof n!="function")throw new Error("method for before hook must be a function");return r||(r={}),Array.isArray(t)?t.reverse().reduce((i,o)=>qn.bind(null,e,o,i,r),n)():Promise.resolve().then(()=>e.registry[t]?e.registry[t].reduce((i,o)=>o.hook.bind(null,i,r),n)():n(r))}function Yu(e,t,n,r){const i=r;e.registry[n]||(e.registry[n]=[]),t==="before"&&(r=(o,l)=>Promise.resolve().then(i.bind(null,l)).then(o.bind(null,l))),t==="after"&&(r=(o,l)=>{let a;return Promise.resolve().then(o.bind(null,l)).then(c=>(a=c,i(a,l))).then(()=>a)}),t==="error"&&(r=(o,l)=>Promise.resolve().then(o.bind(null,l)).catch(a=>i(a,l))),e.registry[n].push({hook:r,orig:i})}function Uu(e,t,n){if(!e.registry[t])return;const r=e.registry[t].map(i=>i.orig).indexOf(n);r!==-1&&e.registry[t].splice(r,1)}const Mr=Function.bind,Or=Mr.bind(Mr);function Zi(e,t,n){const r=Or(Uu,null).apply(null,n?[t,n]:[t]);e.api={remove:r},e.remove=r,["before","error","after","wrap"].forEach(i=>{const o=n?[t,i,n]:[t,i];e[i]=e.api[i]=Or(Yu,null).apply(null,o)})}function Bu(){const e=Symbol("Singular"),t={registry:{}},n=qn.bind(null,t,e);return Zi(n,t,e),n}function Gu(){const e={registry:{}},t=qn.bind(null,e);return Zi(t,e),t}const Wu={Singular:Bu,Collection:Gu};var zu="0.0.0-development",Zu=`octokit-endpoint.js/${zu} ${tn()}`,Ku={method:"GET",baseUrl:"https://api.github.com",headers:{accept:"application/vnd.github.v3+json","user-agent":Zu},mediaType:{format:""}};function Qu(e){return e?Object.keys(e).reduce((t,n)=>(t[n.toLowerCase()]=e[n],t),{}):{}}function Xu(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(e)}function Ki(e,t){const n=Object.assign({},e);return Object.keys(t).forEach(r=>{Xu(t[r])?r in e?n[r]=Ki(e[r],t[r]):Object.assign(n,{[r]:t[r]}):Object.assign(n,{[r]:t[r]})}),n}function Dr(e){for(const t in e)e[t]===void 0&&delete e[t];return e}function bn(e,t,n){var i;if(typeof t=="string"){let[o,l]=t.split(" ");n=Object.assign(l?{method:o,url:l}:{url:o},n)}else n=Object.assign({},t);n.headers=Qu(n.headers),Dr(n),Dr(n.headers);const r=Ki(e||{},n);return n.url==="/graphql"&&(e&&((i=e.mediaType.previews)!=null&&i.length)&&(r.mediaType.previews=e.mediaType.previews.filter(o=>!r.mediaType.previews.includes(o)).concat(r.mediaType.previews)),r.mediaType.previews=(r.mediaType.previews||[]).map(o=>o.replace(/-preview/,""))),r}function Ju(e,t){const n=/\?/.test(e)?"&":"?",r=Object.keys(t);return r.length===0?e:e+n+r.map(i=>i==="q"?"q="+t.q.split("+").map(encodeURIComponent).join("+"):`${i}=${encodeURIComponent(t[i])}`).join("&")}var ef=/\{[^}]+\}/g;function tf(e){return e.replace(/^\W+|\W+$/g,"").split(/,/)}function nf(e){const t=e.match(ef);return t?t.map(tf).reduce((n,r)=>n.concat(r),[]):[]}function Fr(e,t){const n={__proto__:null};for(const r of Object.keys(e))t.indexOf(r)===-1&&(n[r]=e[r]);return n}function Qi(e){return e.split(/(%[0-9A-Fa-f]{2})/g).map(function(t){return/%[0-9A-Fa-f]/.test(t)||(t=encodeURI(t).replace(/%5B/g,"[").replace(/%5D/g,"]")),t}).join("")}function vt(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(t){return"%"+t.charCodeAt(0).toString(16).toUpperCase()})}function Ct(e,t,n){return t=e==="+"||e==="#"?Qi(t):vt(t),n?vt(n)+"="+t:t}function mt(e){return e!=null}function an(e){return e===";"||e==="&"||e==="?"}function rf(e,t,n,r){var i=e[n],o=[];if(mt(i)&&i!=="")if(typeof i=="string"||typeof i=="number"||typeof i=="boolean")i=i.toString(),r&&r!=="*"&&(i=i.substring(0,parseInt(r,10))),o.push(Ct(t,i,an(t)?n:""));else if(r==="*")Array.isArray(i)?i.filter(mt).forEach(function(l){o.push(Ct(t,l,an(t)?n:""))}):Object.keys(i).forEach(function(l){mt(i[l])&&o.push(Ct(t,i[l],l))});else{const l=[];Array.isArray(i)?i.filter(mt).forEach(function(a){l.push(Ct(t,a))}):Object.keys(i).forEach(function(a){mt(i[a])&&(l.push(vt(a)),l.push(Ct(t,i[a].toString())))}),an(t)?o.push(vt(n)+"="+l.join(",")):l.length!==0&&o.push(l.join(","))}else t===";"?mt(i)&&o.push(vt(n)):i===""&&(t==="&"||t==="?")?o.push(vt(n)+"="):i===""&&o.push("");return o}function of(e){return{expand:lf.bind(null,e)}}function lf(e,t){var n=["+","#",".","/",";","?","&"];return e=e.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g,function(r,i,o){if(i){let a="";const c=[];if(n.indexOf(i.charAt(0))!==-1&&(a=i.charAt(0),i=i.substr(1)),i.split(/,/g).forEach(function(s){var u=/([^:\*]*)(?::(\d+)|(\*))?/.exec(s);c.push(rf(t,a,u[1],u[2]||u[3]))}),a&&a!=="+"){var l=",";return a==="?"?l="&":a!=="#"&&(l=a),(c.length!==0?a:"")+c.join(l)}else return c.join(",")}else return Qi(o)}),e==="/"?e:e.replace(/\/$/,"")}function Xi(e){var u;let t=e.method.toUpperCase(),n=(e.url||"/").replace(/:([a-z]\w+)/g,"{$1}"),r=Object.assign({},e.headers),i,o=Fr(e,["method","baseUrl","url","headers","request","mediaType"]);const l=nf(n);n=of(n).expand(o),/^http/.test(n)||(n=e.baseUrl+n);const a=Object.keys(e).filter(f=>l.includes(f)).concat("baseUrl"),c=Fr(o,a);if(!/application\/octet-stream/i.test(r.accept)&&(e.mediaType.format&&(r.accept=r.accept.split(/,/).map(f=>f.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/,`application/vnd$1$2.${e.mediaType.format}`)).join(",")),n.endsWith("/graphql")&&(u=e.mediaType.previews)!=null&&u.length)){const f=r.accept.match(/[\w-]+(?=-preview)/g)||[];r.accept=f.concat(e.mediaType.previews).map(d=>{const p=e.mediaType.format?`.${e.mediaType.format}`:"+json";return`application/vnd.github.${d}-preview${p}`}).join(",")}return["GET","HEAD"].includes(t)?n=Ju(n,c):"data"in c?i=c.data:Object.keys(c).length&&(i=c),!r["content-type"]&&typeof i<"u"&&(r["content-type"]="application/json; charset=utf-8"),["PATCH","PUT"].includes(t)&&typeof i>"u"&&(i=""),Object.assign({method:t,url:n,headers:r},typeof i<"u"?{body:i}:null,e.request?{request:e.request}:null)}function af(e,t,n){return Xi(bn(e,t,n))}function Ji(e,t){const n=bn(e,t),r=af.bind(null,n);return Object.assign(r,{DEFAULTS:n,defaults:Ji.bind(null,n),merge:bn.bind(null,n),parse:Xi})}var cf=Ji(null,Ku);class Rt extends Error{constructor(n,r,i){super(n);ae(this,"name");ae(this,"status");ae(this,"request");ae(this,"response");this.name="HttpError",this.status=Number.parseInt(r),Number.isNaN(this.status)&&(this.status=0),"response"in i&&(this.response=i.response);const o=Object.assign({},i.request);i.request.headers.authorization&&(o.headers=Object.assign({},i.request.headers,{authorization:i.request.headers.authorization.replace(/ .*$/," [REDACTED]")})),o.url=o.url.replace(/\bclient_secret=\w+/g,"client_secret=[REDACTED]").replace(/\baccess_token=\w+/g,"access_token=[REDACTED]"),this.request=o}}var sf="0.0.0-development",uf={headers:{"user-agent":`octokit-request.js/${sf} ${tn()}`}};function ff(e){if(typeof e!="object"||e===null||Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=Object.prototype.hasOwnProperty.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&Function.prototype.call(n)===Function.prototype.call(e)}async function Hr(e){var f,d,p,m,g;const t=((f=e.request)==null?void 0:f.fetch)||globalThis.fetch;if(!t)throw new Error("fetch is not set. Please pass a fetch implementation as new Octokit({ request: { fetch }}). Learn more at https://github.com/octokit/octokit.js/#fetch-missing");const n=((d=e.request)==null?void 0:d.log)||console,r=((p=e.request)==null?void 0:p.parseSuccessResponseBody)!==!1,i=ff(e.body)||Array.isArray(e.body)?JSON.stringify(e.body):e.body,o=Object.fromEntries(Object.entries(e.headers).map(([_,k])=>[_,String(k)]));let l;try{l=await t(e.url,{method:e.method,body:i,redirect:(m=e.request)==null?void 0:m.redirect,headers:o,signal:(g=e.request)==null?void 0:g.signal,...e.body&&{duplex:"half"}})}catch(_){let k="Unknown Error";if(_ instanceof Error){if(_.name==="AbortError")throw _.status=500,_;k=_.message,_.name==="TypeError"&&"cause"in _&&(_.cause instanceof Error?k=_.cause.message:typeof _.cause=="string"&&(k=_.cause))}const A=new Rt(k,500,{request:e});throw A.cause=_,A}const a=l.status,c=l.url,s={};for(const[_,k]of l.headers)s[_]=k;const u={url:c,status:a,headers:s,data:""};if("deprecation"in s){const _=s.link&&s.link.match(/<([^>]+)>; rel="deprecation"/),k=_&&_.pop();n.warn(`[@octokit/request] "${e.method} ${e.url}" is deprecated. It is scheduled to be removed on ${s.sunset}${k?`. See ${k}`:""}`)}if(a===204||a===205)return u;if(e.method==="HEAD"){if(a<400)return u;throw new Rt(l.statusText,a,{response:u,request:e})}if(a===304)throw u.data=await cn(l),new Rt("Not modified",a,{response:u,request:e});if(a>=400)throw u.data=await cn(l),new Rt(df(u.data),a,{response:u,request:e});return u.data=r?await cn(l):l.body,u}async function cn(e){const t=e.headers.get("content-type");return/application\/json/.test(t)?e.json().catch(()=>e.text()).catch(()=>""):!t||/^text\/|charset=utf-8$/.test(t)?e.text():e.arrayBuffer()}function df(e){if(typeof e=="string")return e;if(e instanceof ArrayBuffer)return"Unknown error";if("message"in e){const t="documentation_url"in e?` - ${e.documentation_url}`:"";return Array.isArray(e.errors)?`${e.message}: ${e.errors.map(n=>JSON.stringify(n)).join(", ")}${t}`:`${e.message}${t}`}return`Unknown error: ${JSON.stringify(e)}`}function vn(e,t){const n=e.defaults(t);return Object.assign(function(i,o){const l=n.merge(i,o);if(!l.request||!l.request.hook)return Hr(n.parse(l));const a=(c,s)=>Hr(n.parse(n.merge(c,s)));return Object.assign(a,{endpoint:n,defaults:vn.bind(null,n)}),l.request.hook(a,l)},{endpoint:n,defaults:vn.bind(null,n)})}var yn=vn(cf,uf),pf="0.0.0-development";function hf(e){return`Request failed due to following response errors:
43
43
  `+e.errors.map(t=>` - ${t.message}`).join(`
44
- `)}var mf=class extends Error{constructor(t,n,r){super(hf(r));oe(this,"name","GraphqlResponseError");oe(this,"errors");oe(this,"data");this.request=t,this.headers=n,this.response=r,this.errors=r.errors,this.data=r.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},gf=["method","baseUrl","url","headers","request","query","mediaType"],_f=["query","method","url"],Ir=/\/api\/v3\/?$/;function wf(e,t,n){if(n){if(typeof t=="string"&&"query"in n)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(const o in n)if(_f.includes(o))return Promise.reject(new Error(`[@octokit/graphql] "${o}" cannot be used as variable name`))}const r=typeof t=="string"?Object.assign({query:t},n):t,i=Object.keys(r).reduce((o,a)=>gf.includes(a)?(o[a]=r[a],o):(o.variables||(o.variables={}),o.variables[a]=r[a],o),{}),l=r.baseUrl||e.endpoint.DEFAULTS.baseUrl;return Ir.test(l)&&(i.url=l.replace(Ir,"/api/graphql")),e(i).then(o=>{if(o.data.errors){const a={};for(const c of Object.keys(o.headers))a[c]=o.headers[c];throw new mf(i,a,o.data)}return o.data.data})}function Yn(e,t){const n=e.defaults(t);return Object.assign((i,l)=>wf(n,i,l),{defaults:Yn.bind(null,n),endpoint:n.endpoint})}Yn(yn,{headers:{"user-agent":`octokit-graphql.js/${pf} ${en()}`},method:"POST",url:"/graphql"});function bf(e){return Yn(e,{method:"POST",url:"/graphql"})}var vf=/^v1\./,yf=/^ghs_/,kf=/^ghu_/;async function Af(e){const t=e.split(/\./).length===3,n=vf.test(e)||yf.test(e),r=kf.test(e);return{type:"token",token:e,tokenType:t?"app":n?"installation":r?"user-to-server":"oauth"}}function Ef(e){return e.split(/\./).length===3?`bearer ${e}`:`token ${e}`}async function Cf(e,t,n,r){const i=t.endpoint.merge(n,r);return i.headers.authorization=Ef(e),t(i)}var Sf=function(t){if(!t)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof t!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return t=t.replace(/^(token|bearer) +/i,""),Object.assign(Af.bind(null,t),{hook:Cf.bind(null,t)})};const el="6.1.2",Nr=()=>{},xf=console.warn.bind(console),Lf=console.error.bind(console),Rr=`octokit-core.js/${el} ${en()}`;class kn{constructor(t={}){oe(this,"request");oe(this,"graphql");oe(this,"log");oe(this,"hook");oe(this,"auth");const n=new Wu.Collection,r={baseUrl:yn.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},t.request,{hook:n.bind(null,"request")}),mediaType:{previews:[],format:""}};if(r.headers["user-agent"]=t.userAgent?`${t.userAgent} ${Rr}`:Rr,t.baseUrl&&(r.baseUrl=t.baseUrl),t.previews&&(r.mediaType.previews=t.previews),t.timeZone&&(r.headers["time-zone"]=t.timeZone),this.request=yn.defaults(r),this.graphql=bf(this.request).defaults(r),this.log=Object.assign({debug:Nr,info:Nr,warn:xf,error:Lf},t.log),this.hook=n,t.authStrategy){const{authStrategy:l,...o}=t,a=l(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:o},t.auth));n.wrap("request",a.hook),this.auth=a}else if(!t.auth)this.auth=async()=>({type:"unauthenticated"});else{const l=Sf(t.auth);n.wrap("request",l.hook),this.auth=l}const i=this.constructor;for(let l=0;l<i.plugins.length;++l)Object.assign(this,i.plugins[l](this,t))}static defaults(t){return class extends this{constructor(...r){const i=r[0]||{};if(typeof t=="function"){super(t(i));return}super(Object.assign({},t,i,i.userAgent&&t.userAgent?{userAgent:`${i.userAgent} ${t.userAgent}`}:null))}}}static plugin(...t){var i;const n=this.plugins;return i=class extends this{},oe(i,"plugins",n.concat(t.filter(l=>!n.includes(l)))),i}}oe(kn,"VERSION",el),oe(kn,"plugins",[]);function tl(e,t,n,r){return e.graphql(`
44
+ `)}var mf=class extends Error{constructor(t,n,r){super(hf(r));ae(this,"name","GraphqlResponseError");ae(this,"errors");ae(this,"data");this.request=t,this.headers=n,this.response=r,this.errors=r.errors,this.data=r.data,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}},gf=["method","baseUrl","url","headers","request","query","mediaType"],_f=["query","method","url"],Ir=/\/api\/v3\/?$/;function wf(e,t,n){if(n){if(typeof t=="string"&&"query"in n)return Promise.reject(new Error('[@octokit/graphql] "query" cannot be used as variable name'));for(const l in n)if(_f.includes(l))return Promise.reject(new Error(`[@octokit/graphql] "${l}" cannot be used as variable name`))}const r=typeof t=="string"?Object.assign({query:t},n):t,i=Object.keys(r).reduce((l,a)=>gf.includes(a)?(l[a]=r[a],l):(l.variables||(l.variables={}),l.variables[a]=r[a],l),{}),o=r.baseUrl||e.endpoint.DEFAULTS.baseUrl;return Ir.test(o)&&(i.url=o.replace(Ir,"/api/graphql")),e(i).then(l=>{if(l.data.errors){const a={};for(const c of Object.keys(l.headers))a[c]=l.headers[c];throw new mf(i,a,l.data)}return l.data.data})}function Yn(e,t){const n=e.defaults(t);return Object.assign((i,o)=>wf(n,i,o),{defaults:Yn.bind(null,n),endpoint:n.endpoint})}Yn(yn,{headers:{"user-agent":`octokit-graphql.js/${pf} ${tn()}`},method:"POST",url:"/graphql"});function bf(e){return Yn(e,{method:"POST",url:"/graphql"})}var vf=/^v1\./,yf=/^ghs_/,kf=/^ghu_/;async function Af(e){const t=e.split(/\./).length===3,n=vf.test(e)||yf.test(e),r=kf.test(e);return{type:"token",token:e,tokenType:t?"app":n?"installation":r?"user-to-server":"oauth"}}function Ef(e){return e.split(/\./).length===3?`bearer ${e}`:`token ${e}`}async function Cf(e,t,n,r){const i=t.endpoint.merge(n,r);return i.headers.authorization=Ef(e),t(i)}var Sf=function(t){if(!t)throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");if(typeof t!="string")throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");return t=t.replace(/^(token|bearer) +/i,""),Object.assign(Af.bind(null,t),{hook:Cf.bind(null,t)})};const eo="6.1.2",Nr=()=>{},xf=console.warn.bind(console),Lf=console.error.bind(console),Rr=`octokit-core.js/${eo} ${tn()}`;class kn{constructor(t={}){ae(this,"request");ae(this,"graphql");ae(this,"log");ae(this,"hook");ae(this,"auth");const n=new Wu.Collection,r={baseUrl:yn.endpoint.DEFAULTS.baseUrl,headers:{},request:Object.assign({},t.request,{hook:n.bind(null,"request")}),mediaType:{previews:[],format:""}};if(r.headers["user-agent"]=t.userAgent?`${t.userAgent} ${Rr}`:Rr,t.baseUrl&&(r.baseUrl=t.baseUrl),t.previews&&(r.mediaType.previews=t.previews),t.timeZone&&(r.headers["time-zone"]=t.timeZone),this.request=yn.defaults(r),this.graphql=bf(this.request).defaults(r),this.log=Object.assign({debug:Nr,info:Nr,warn:xf,error:Lf},t.log),this.hook=n,t.authStrategy){const{authStrategy:o,...l}=t,a=o(Object.assign({request:this.request,log:this.log,octokit:this,octokitOptions:l},t.auth));n.wrap("request",a.hook),this.auth=a}else if(!t.auth)this.auth=async()=>({type:"unauthenticated"});else{const o=Sf(t.auth);n.wrap("request",o.hook),this.auth=o}const i=this.constructor;for(let o=0;o<i.plugins.length;++o)Object.assign(this,i.plugins[o](this,t))}static defaults(t){return class extends this{constructor(...r){const i=r[0]||{};if(typeof t=="function"){super(t(i));return}super(Object.assign({},t,i,i.userAgent&&t.userAgent?{userAgent:`${i.userAgent} ${t.userAgent}`}:null))}}}static plugin(...t){var i;const n=this.plugins;return i=class extends this{},ae(i,"plugins",n.concat(t.filter(o=>!n.includes(o)))),i}}ae(kn,"VERSION",eo),ae(kn,"plugins",[]);function to(e,t,n,r){return e.graphql(`
45
45
  query GetRepoPath($repoOwner: String!, $repoName: String!, $path: String!) {
46
46
  repository(owner: $repoOwner, name: $repoName) {
47
47
  object(expression: $path) {
@@ -73,7 +73,7 @@ ${n.body}`,n}function jn(e){if(!/^---(\r?\n)/.test(e.trim()))return["date: 0001-
73
73
  }
74
74
  }
75
75
  }
76
- `,{name:n,owner:t,refName:r})}function Of(e,t,n,r,i,l){return e.graphql(`
76
+ `,{name:n,owner:t,refName:r})}function Of(e,t,n,r,i,o){return e.graphql(`
77
77
  mutation CreateCommit($branchName: String!, $repoNameWithOwner: String!, $expectedHeadOid: GitObjectID!, $headline: String!, $changes: FileChanges!) {
78
78
  createCommitOnBranch(input: {
79
79
  branch: {repositoryNameWithOwner: $repoNameWithOwner, branchName: $branchName},
@@ -84,4 +84,4 @@ ${n.body}`,n}function jn(e){if(!/^---(\r?\n)/.test(e.trim()))return["date: 0001-
84
84
  clientMutationId
85
85
  }
86
86
  }
87
- `,{repoNameWithOwner:t,branchName:n,headline:r,expectedHeadOid:i,changes:l})}async function Df(e,t,n){return(await fetch(`data:${e};${t},${n}`)).blob()}function Ff(e,t=!1){return new Promise((n,r)=>{const i=new FileReader;i.onerror=l=>r(l),i.onload=()=>{const{result:l}=i,o=t?l.replace(/^data:.+\/.+;base64,/,""):l;n(o)},i.readAsDataURL(e)})}function Hf(e){const t=e.replace("^.","");let n;switch(t){case"apng":case"avif":case"bmp":case"gif":case"jpeg":case"png":case"tiff":case"webp":n=`image/${t}`;break;case"ico":n="image/vnd.microsoft.icon";break;case"jpg":n="image/jpeg";break;case"svg":n="image/svg+xml";break;case"tif":n="image/tiff";break;default:n="application/octet-stream"}return n}function If(e,t,n){const{id:r,text:i}=n.object,[l,o]=jn(i),a=Qt.load(l);return{_id:r,name:n.name,collection:e,path:t,date:a.date,raw:i,fields:a,body:o}}async function Nf(e,t,n,r,i){const[l,o]=t.backend.repo.split("/"),{id:a,oid:c}=i.object,s=await Tf(e,l,o,c),f=`${r}/${i.name}`;let u=f;if(s.status===200)try{const{content:p,encoding:g}=s.data,h=Hf(i.extension),v=await Df(h,g,p);u=URL.createObjectURL(v)}catch(p){console.error("Error creating preview url.",p)}return{_id:a,name:i.name,path:n,url:f,url_preview:u}}let kt=[];const nl=`${window.location.origin}${window.location.pathname}`,Rf="SNOW_CMS:",An={state:`${Rf}:GH_AUTH:STATE`};let ut;async function Pf(){const e=Ie(Ce).backend;if(!e.repo)throw new Error("Missing backend 'repo' config.");if(!e.app_name)throw new Error("Missing backend 'app_name' config.");const t=new URLSearchParams(window.location.search),n=t.get("setup_action"),r=t.get("code"),i=t.get("state"),l=localStorage.getItem(An.state);if(n){rl();return}if(r&&l)if(i===l){console.log("Valid auth state"),history.replaceState({},"",nl);const o=e.api_root??window.location.origin,a=e.auth_endpoint??"/api/github/oauth/token",c=`${o}${a}`,f={method:"post",headers:{"content-type":"application/json"},body:JSON.stringify({code:r})},u=await fetch(c,f),d=await u.json();if(!u.ok)throw new Error(d.error??"Token error");const{authentication:p}=d;ut=new kn({auth:p.token});const{data:{total_count:g,installations:h}}=await ut.request("GET /user/installations",{headers:{"X-GitHub-Api-Version":"2022-11-28"}}),v=e.app_name.replaceAll(" ","-").toLowerCase();if(g<=0){await Pr(c,p.token),$r(v);return}if(!h.find(E=>E.app_slug===v)){await Pr(c,p.token),$r(v);return}Ve.set(En)}else throw localStorage.removeItem(An.state),new Error("Invalid auth state");return console.log("Using GitHub CMS backend"),En}async function Pr(e,t){const n={method:"delete",headers:{Authorization:`token ${t}`}};if(!(await fetch(e,n)).ok)throw new Error("Delete token error")}function $r(e){const t=new URL(`https://github.com/apps/${e}/installations/new`);window.location.assign(t.href)}async function $f(){return{title:"GitHub Log in",button:"Log in with GitHub",action:rl}}async function rl(e){const t=new URL("https://github.com/login/oauth/authorize"),n=Math.random().toString(36).substring(2),r=t.searchParams;r.set("client_id",Ie(Ce).backend.client_id),r.set("redirect_uri",nl),r.set("state",n),localStorage.setItem(An.state,n),window.location.assign(t.href)}async function jf(e){var t;try{const n=Ie(Ce),r=n.collections.find(u=>u.name===e),{repo:i,branch:l}=n.backend,[o,a]=i.split("/"),c=`${l}:${r.folder}`,{repository:s}=await tl(ut,o,a,c);if(!s)throw new Error("Error getting repo path");const f=[];return(t=s.object)==null||t.entries.forEach(u=>{/^[\._]/.test(u.name)||f.push(If(e,r.folder,u))}),f.sort((u,d)=>d.date.getTime()-u.date.getTime()),f}catch(n){throw console.error("Error fetching files",n),n}}async function Vf(e,t){try{const n=`Update ${t.name}`,r={additions:[{path:`${e.folder}/${t.name}`,contents:btoa(t.raw)}]};return await Un(n,r),t}catch(n){throw console.error("Error saving file.",n),n}}async function qf(e){try{const t=`Delete ${e.length} file(s)`,n={deletions:e.map(r=>({path:`${r.path}/${r.name}`}))};await Un(t,n),e.forEach(r=>{r.url_preview&&URL.revokeObjectURL(r.url_preview)}),kt=[...kt.filter(r=>e.every(i=>r.id!==i.id))]}catch(t){throw console.error("Error deleting files.",t),t}}async function Yf(){var e;try{const t=Ie(Ce),{media_folder:n,public_folder:r}=t,{repo:i,branch:l}=t.backend,[o,a]=i.split("/"),c=`${l}:${t.media_folder}`,{repository:s}=await tl(ut,o,a,c);if(!s)throw new Error("Error getting repo path");const f=[];(e=s.object)==null||e.entries.forEach(d=>{if(/^[\._]/.test(d.name))return;const p=Nf(ut,t,n,r,d);f.push(p)});const u=await Promise.all(f);return kt.forEach(d=>{d.url_preview&&URL.revokeObjectURL(d.url_preview)}),kt=u,u}catch(t){throw console.error("Error getting media files",t),t}}async function Uf(){try{const e=Ie(Ce).media_folder,n=await Pn({mimeTypes:["image/*"],description:"Image Files"}),r=await Ff(n,!0),i=`Update ${n.name}`,l={additions:[{path:`${e}/${n.name}`,contents:r}]};await Un(i,l)}catch(e){console.error("Upload file error",e)}}async function Bf(e){let t=e;try{const n=It(t);return n.length===0?e:(kt.filter(i=>i.url&&n.includes(i.url)).forEach(i=>{t=t.replaceAll(i.url,i.url_preview)}),t)}catch(n){throw console.error("Error processing public links",n),n}}async function Gf(e){let t=e;try{const n=It(t);return n.length===0?e:(kt.filter(i=>i.url_preview&&n.includes(i.url_preview)).forEach(i=>{t=t.replaceAll(i.url_preview,i.url)}),t)}catch(n){throw console.error("Error processing preview links",n),n}}async function Un(e,t){const n=Ie(Ce),{repo:r,branch:i}=n.backend,[l,o]=r.split("/"),a=i,{repository:c}=await Mf(ut,l,o,a);if(!c)throw new Error("Error getting oid");const{oid:s}=c.ref.target,f=await Of(ut,r,i,e,s,t);if(!(f!=null&&f.createCommitOnBranch))throw new Error("Error creating commit")}const En={init:Pf,getLoginConfig:$f,getFiles:jf,saveFile:Vf,deleteFiles:qf,getMediaFiles:Yf,uploadMediaFile:Uf,replacePublicLinks:Bf,replacePreviewLinks:Gf};function jr(e,t,n){const r=e.slice();r[12]=t[n];const i=r[12];return r[13]=i[0],r[14]=i[1],r}function sn(e){const t=e.slice(),n=Object.entries(t[1].fields);return t[11]=n,t}function Vr(e){let t=[],n=new Map,r,i=Ee(e[11]);const l=o=>o[12][0];for(let o=0;o<i.length;o+=1){let a=jr(e,i,o),c=l(a);n.set(c,t[o]=qr(c,a))}return{c(){for(let o=0;o<t.length;o+=1)t[o].c();r=Oe()},m(o,a){for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(o,a);N(o,r,a)},p(o,a){a&2&&(i=Ee(o[11]),t=Ht(t,a,l,1,o,i,n,r.parentNode,Gr,qr,r,jr))},d(o){o&&H(r);for(let a=0;a<t.length;a+=1)t[a].d(o)}}}function qr(e,t){let n,r,i,l;return{key:e,first:null,c(){n=k("input"),m(n,"type",r=t[14]),m(n,"name",i=t[13]),m(n,"placeholder",l=t[13]),m(n,"autocomplete","on"),n.required=!0,this.first=n},m(o,a){N(o,n,a)},p(o,a){t=o,a&2&&r!==(r=t[14])&&m(n,"type",r),a&2&&i!==(i=t[13])&&m(n,"name",i),a&2&&l!==(l=t[13])&&m(n,"placeholder",l)},d(o){o&&H(n)}}}function Wf(e){return{c:b,m:b,p:b,d:b}}function zf(e){var i;let t,n=(((i=e[1])==null?void 0:i.button)??"Log in")+"",r;return{c(){t=k("button"),r=ee(n),m(t,"form","login")},m(l,o){N(l,t,o),w(t,r)},p(l,o){var a;o&2&&n!==(n=(((a=l[1])==null?void 0:a.button)??"Log in")+"")&&_e(r,n)},d(l){l&&H(t)}}}function Zf(e){let t;return{c(){t=k("div"),m(t,"aria-busy","true")},m(n,r){N(n,t,r)},p:b,d(n){n&&H(t)}}}function Kf(e){let t,n;return t=new Ke({props:{msg:"Error initializing backend.",details:e[9].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&1&&(l.details=r[9].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Xf(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Qf(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function Jf(e){let t,n;return t=new Ke({props:{msg:"Error logging in.",details:e[9].message}}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},p(r,i){const l={};i&4&&(l.details=r[9].message),t.$set(l)},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function ed(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function td(e){return{c:b,m:b,p:b,i:b,o:b,d:b}}function nd(e){var B,z,O;let t,n,r,i,l=(((B=e[1])==null?void 0:B.title)??"Log in")+"",o,a,c,s=(((z=e[1])==null?void 0:z.message)??"Log in to continue.")+"",f,u,d,p,g,h,v,A,E,T,j,D,R,F,C=((O=e[1])==null?void 0:O.fields)&&Vr(sn(e)),P={ctx:e,current:null,token:null,hasCatch:!1,pending:Zf,then:zf,catch:Wf,value:10};se(h=e[2],P);let M={ctx:e,current:null,token:null,hasCatch:!0,pending:Qf,then:Xf,catch:Kf,error:9,blocks:[,,,]};se(A=e[0],M);let S={ctx:e,current:null,token:null,hasCatch:!0,pending:td,then:ed,catch:Jf,error:9,blocks:[,,,]};return se(j=e[2],S),{c(){t=k("dialog"),n=k("article"),r=k("header"),i=k("h3"),o=ee(l),a=q(),c=k("p"),f=ee(s),u=q(),d=k("form"),C&&C.c(),p=q(),g=k("footer"),P.block.c(),v=q(),M.block.c(),E=q(),T=Oe(),S.block.c(),m(d,"id","login"),t.open=!0},m(y,_){N(y,t,_),w(t,n),w(n,r),w(r,i),w(i,o),w(n,a),w(n,c),w(c,f),w(n,u),w(n,d),C&&C.m(d,null),w(n,p),w(n,g),P.block.m(g,P.anchor=null),P.mount=()=>g,P.anchor=null,N(y,v,_),M.block.m(y,M.anchor=_),M.mount=()=>E.parentNode,M.anchor=E,N(y,E,_),N(y,T,_),S.block.m(y,S.anchor=_),S.mount=()=>T.parentNode,S.anchor=T,D=!0,R||(F=Z(d,"submit",Ue(e[3])),R=!0)},p(y,[_]){var x,L,$;e=y,(!D||_&2)&&l!==(l=(((x=e[1])==null?void 0:x.title)??"Log in")+"")&&_e(o,l),(!D||_&2)&&s!==(s=(((L=e[1])==null?void 0:L.message)??"Log in to continue.")+"")&&_e(f,s),($=e[1])!=null&&$.fields?C?C.p(sn(e),_):(C=Vr(sn(e)),C.c(),C.m(d,null)):C&&(C.d(1),C=null),P.ctx=e,_&4&&h!==(h=e[2])&&se(h,P)||Pe(P,e,_),M.ctx=e,_&1&&A!==(A=e[0])&&se(A,M)||Pe(M,e,_),S.ctx=e,_&4&&j!==(j=e[2])&&se(j,S)||Pe(S,e,_)},i(y){D||(I(M.block),I(S.block),D=!0)},o(y){for(let _=0;_<3;_+=1){const x=M.blocks[_];V(x)}for(let _=0;_<3;_+=1){const x=S.blocks[_];V(x)}D=!1},d(y){y&&(H(t),H(v),H(E),H(T)),C&&C.d(),P.block.d(),P.token=null,P=null,M.block.d(y),M.token=null,M=null,S.block.d(y),S.token=null,S=null,R=!1,F()}}}function rd(e,t,n){let r,i;W(e,Ce,d=>n(4,i=d));let l,o,a,c,s=2;async function f(d){try{const p=new FormData(d.target);n(2,c=a.action(p))}catch(p){console.error("Error logging in.",p)}}async function u(){try{if(s<=0)return;if(!r)throw new Error("Missing backend name");switch(r){case"local":n(0,l=Vn.init());break;case"github":n(0,l=En.init());break;case"custom":n(0,l=ss(Ce,Ve));break;default:throw new Error(`Unsupported backend: ${r}`)}o=await l,o.getLoginConfig&&n(1,a=await o.getLoginConfig())}catch(d){console.error("Error initializing backend.",d),s--,console.log("Re-trying init. Attempts left ",s),u()}}return e.$$.update=()=>{var d;e.$$.dirty&16&&(r=i!=null&&i.local_backend?"local":(d=i==null?void 0:i.backend)==null?void 0:d.name),e.$$.dirty&16&&i&&u()},[l,a,c,f,i]}class id extends ce{constructor(t){super(),ae(this,t,rd,nd,ie,{})}}const{window:ld}=Zt;function Yr(e){let t,n;return t=new id({}),{c(){J(t.$$.fragment)},m(r,i){K(t,r,i),n=!0},i(r){n||(I(t.$$.fragment,r),n=!0)},o(r){V(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function od(e){let t,n,r,i,l,o;var a=e[0];function c(f,u){return{}}a&&(t=Je(a,c()));let s=!e[1]&&Yr();return{c(){t&&J(t.$$.fragment),n=q(),s&&s.c(),r=Oe()},m(f,u){t&&K(t,f,u),N(f,n,u),s&&s.m(f,u),N(f,r,u),i=!0,l||(o=Z(ld,"hashchange",e[2]),l=!0)},p(f,[u]){if(u&1&&a!==(a=f[0])){if(t){ye();const d=t;V(d.$$.fragment,1,0,()=>{X(d,1)}),ke()}a?(t=Je(a,c()),J(t.$$.fragment),I(t.$$.fragment,1),K(t,n.parentNode,n)):t=null}f[1]?s&&(ye(),V(s,1,1,()=>{s=null}),ke()):s?u&2&&I(s,1):(s=Yr(),s.c(),I(s,1),s.m(r.parentNode,r))},i(f){i||(t&&I(t.$$.fragment,f),I(s),i=!0)},o(f){t&&V(t.$$.fragment,f),V(s),i=!1},d(f){f&&(H(n),H(r)),t&&X(t,f),s&&s.d(f),l=!1,o()}}}function ad(e,t,n){let r;W(e,Ve,a=>n(1,r=a));const i={"":Rc,editor:Lu};let l;function o(){const a=window.location.hash.replace(/#\/?/,""),c=i[a];c?n(0,l=c):(console.warn(`Page not found: ${a}`),window.location.hash="")}return je(()=>{o()}),[l,r,o]}class cd extends ce{constructor(t){super(),ae(this,t,ad,od,ie,{})}}function sd(){const e=document.getElementById("app");e.childElementCount>0||new cd({target:e})}sd();export{Ii as c,Ni as g};
87
+ `,{repoNameWithOwner:t,branchName:n,headline:r,expectedHeadOid:i,changes:o})}async function Df(e,t,n){return(await fetch(`data:${e};${t},${n}`)).blob()}function Ff(e,t=!1){return new Promise((n,r)=>{const i=new FileReader;i.onerror=o=>r(o),i.onload=()=>{const{result:o}=i,l=t?o.replace(/^data:.+\/.+;base64,/,""):o;n(l)},i.readAsDataURL(e)})}function Hf(e){const t=e.replace("^.","");let n;switch(t){case"apng":case"avif":case"bmp":case"gif":case"jpeg":case"png":case"tiff":case"webp":n=`image/${t}`;break;case"ico":n="image/vnd.microsoft.icon";break;case"jpg":n="image/jpeg";break;case"svg":n="image/svg+xml";break;case"tif":n="image/tiff";break;default:n="application/octet-stream"}return n}function If(e,t,n){const{id:r,text:i}=n.object,[o,l]=jn(i),a=Jt.load(o);return{_id:r,name:n.name,collection:e,path:t,date:a.date,raw:i,fields:a,body:l}}async function Nf(e,t,n,r,i){const[o,l]=t.backend.repo.split("/"),{id:a,oid:c}=i.object,s=await Tf(e,o,l,c),u=`${r}/${i.name}`;let f=u;if(s.status===200)try{const{content:p,encoding:m}=s.data,g=Hf(i.extension),_=await Df(g,m,p);f=URL.createObjectURL(_)}catch(p){console.error("Error creating preview url.",p)}return{_id:a,name:i.name,path:n,url:u,url_preview:f}}let At=[];const no=`${window.location.origin}${window.location.pathname}`,Rf="SNOW_CMS:",An={state:`${Rf}:GH_AUTH:STATE`};let ut;async function Pf(){const e=He(Ce).backend;if(!e.repo)throw new Error("Missing backend 'repo' config.");if(!e.app_name)throw new Error("Missing backend 'app_name' config.");const t=new URLSearchParams(window.location.search),n=t.get("setup_action"),r=t.get("code"),i=t.get("state"),o=localStorage.getItem(An.state);if(n){ro();return}if(r&&o)if(i===o){console.log("Valid auth state"),history.replaceState({},"",no);const l=e.api_root??window.location.origin,a=e.auth_endpoint??"/api/github/oauth/token",c=`${l}${a}`,u={method:"post",headers:{"content-type":"application/json"},body:JSON.stringify({code:r})},f=await fetch(c,u),d=await f.json();if(!f.ok)throw new Error(d.error??"Token error");const{authentication:p}=d;ut=new kn({auth:p.token});const{data:{total_count:m,installations:g}}=await ut.request("GET /user/installations",{headers:{"X-GitHub-Api-Version":"2022-11-28"}}),_=e.app_name.replaceAll(" ","-").toLowerCase();if(m<=0){await Pr(c,p.token),$r(_);return}if(!g.find(A=>A.app_slug===_)){await Pr(c,p.token),$r(_);return}Ve.set(En)}else throw localStorage.removeItem(An.state),new Error("Invalid auth state");return console.log("Using GitHub CMS backend"),En}async function Pr(e,t){const n={method:"delete",headers:{Authorization:`token ${t}`}};if(!(await fetch(e,n)).ok)throw new Error("Delete token error")}function $r(e){const t=new URL(`https://github.com/apps/${e}/installations/new`);window.location.assign(t.href)}async function $f(){return{title:"GitHub Log in",button:"Log in with GitHub",action:ro}}async function ro(e){const t=new URL("https://github.com/login/oauth/authorize"),n=Math.random().toString(36).substring(2),r=t.searchParams;r.set("client_id",He(Ce).backend.client_id),r.set("redirect_uri",no),r.set("state",n),localStorage.setItem(An.state,n),window.location.assign(t.href)}async function jf(e){var t;try{const n=He(Ce),r=n.collections.find(f=>f.name===e),{repo:i,branch:o}=n.backend,[l,a]=i.split("/"),c=`${o}:${r.folder}`,{repository:s}=await to(ut,l,a,c);if(!s)throw new Error("Error getting repo path");const u=[];return(t=s.object)==null||t.entries.forEach(f=>{/^[\._]/.test(f.name)||u.push(If(e,r.folder,f))}),u.sort((f,d)=>d.date.getTime()-f.date.getTime()),u}catch(n){throw console.error("Error fetching files",n),n}}async function Vf(e,t){try{const n=`Update ${t.name}`,r={additions:[{path:`${e.folder}/${t.name}`,contents:btoa(t.raw)}]};return await Un(n,r),t}catch(n){throw console.error("Error saving file.",n),n}}async function qf(e){try{const t=`Delete ${e.length} file(s)`,n={deletions:e.map(r=>({path:`${r.path}/${r.name}`}))};await Un(t,n),e.forEach(r=>{r.url_preview&&URL.revokeObjectURL(r.url_preview)}),At=[...At.filter(r=>e.every(i=>r.id!==i.id))]}catch(t){throw console.error("Error deleting files.",t),t}}async function Yf(){var e;try{const t=He(Ce),{media_folder:n,public_folder:r}=t,{repo:i,branch:o}=t.backend,[l,a]=i.split("/"),c=`${o}:${t.media_folder}`,{repository:s}=await to(ut,l,a,c);if(!s)throw new Error("Error getting repo path");const u=[];(e=s.object)==null||e.entries.forEach(d=>{if(/^[\._]/.test(d.name))return;const p=Nf(ut,t,n,r,d);u.push(p)});const f=await Promise.all(u);return At.forEach(d=>{d.url_preview&&URL.revokeObjectURL(d.url_preview)}),At=f,f}catch(t){throw console.error("Error getting media files",t),t}}async function Uf(){try{const e=He(Ce).media_folder,n=await Pn({mimeTypes:["image/*"],description:"Image Files"}),r=await Ff(n,!0),i=`Update ${n.name}`,o={additions:[{path:`${e}/${n.name}`,contents:r}]};await Un(i,o)}catch(e){console.error("Upload file error",e)}}async function Bf(e){let t=e;try{const n=Ht(t);return n.length===0?e:(At.filter(i=>i.url&&n.includes(i.url)).forEach(i=>{t=t.replaceAll(i.url,i.url_preview)}),t)}catch(n){throw console.error("Error processing public links",n),n}}async function Gf(e){let t=e;try{const n=Ht(t);return n.length===0?e:(At.filter(i=>i.url_preview&&n.includes(i.url_preview)).forEach(i=>{t=t.replaceAll(i.url_preview,i.url)}),t)}catch(n){throw console.error("Error processing preview links",n),n}}async function Un(e,t){const n=He(Ce),{repo:r,branch:i}=n.backend,[o,l]=r.split("/"),a=i,{repository:c}=await Mf(ut,o,l,a);if(!c)throw new Error("Error getting oid");const{oid:s}=c.ref.target,u=await Of(ut,r,i,e,s,t);if(!(u!=null&&u.createCommitOnBranch))throw new Error("Error creating commit")}const En={init:Pf,getLoginConfig:$f,getFiles:jf,saveFile:Vf,deleteFiles:qf,getMediaFiles:Yf,uploadMediaFile:Uf,replacePublicLinks:Bf,replacePreviewLinks:Gf};function jr(e,t,n){const r=e.slice();r[12]=t[n];const i=r[12];return r[13]=i[0],r[14]=i[1],r}function sn(e){const t=e.slice(),n=Object.entries(t[1].fields);return t[11]=n,t}function Vr(e){let t=[],n=new Map,r,i=Ee(e[11]);const o=l=>l[12][0];for(let l=0;l<i.length;l+=1){let a=jr(e,i,l),c=o(a);n.set(c,t[l]=qr(c,a))}return{c(){for(let l=0;l<t.length;l+=1)t[l].c();r=Oe()},m(l,a){for(let c=0;c<t.length;c+=1)t[c]&&t[c].m(l,a);I(l,r,a)},p(l,a){a&2&&(i=Ee(l[11]),t=Ft(t,a,o,1,l,i,n,r.parentNode,Gr,qr,r,jr))},d(l){l&&F(r);for(let a=0;a<t.length;a+=1)t[a].d(l)}}}function qr(e,t){let n,r,i,o;return{key:e,first:null,c(){n=E("input"),h(n,"type",r=t[14]),h(n,"name",i=t[13]),h(n,"placeholder",o=t[13]),h(n,"autocomplete","on"),n.required=!0,this.first=n},m(l,a){I(l,n,a)},p(l,a){t=l,a&2&&r!==(r=t[14])&&h(n,"type",r),a&2&&i!==(i=t[13])&&h(n,"name",i),a&2&&o!==(o=t[13])&&h(n,"placeholder",o)},d(l){l&&F(n)}}}function Wf(e){return{c:v,m:v,p:v,d:v}}function zf(e){var i;let t,n=(((i=e[1])==null?void 0:i.button)??"Log in")+"",r;return{c(){t=E("button"),r=te(n),h(t,"form","login")},m(o,l){I(o,t,l),b(t,r)},p(o,l){var a;l&2&&n!==(n=(((a=o[1])==null?void 0:a.button)??"Log in")+"")&&_e(r,n)},d(o){o&&F(t)}}}function Zf(e){let t;return{c(){t=E("div"),h(t,"aria-busy","true")},m(n,r){I(n,t,r)},p:v,d(n){n&&F(t)}}}function Kf(e){let t,n;return t=new Qe({props:{msg:"Error initializing backend.",details:e[9].message}}),{c(){J(t.$$.fragment)},m(r,i){Q(t,r,i),n=!0},p(r,i){const o={};i&1&&(o.details=r[9].message),t.$set(o)},i(r){n||(H(t.$$.fragment,r),n=!0)},o(r){j(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function Qf(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Xf(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function Jf(e){let t,n;return t=new Qe({props:{msg:"Error logging in.",details:e[9].message}}),{c(){J(t.$$.fragment)},m(r,i){Q(t,r,i),n=!0},p(r,i){const o={};i&4&&(o.details=r[9].message),t.$set(o)},i(r){n||(H(t.$$.fragment,r),n=!0)},o(r){j(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function ed(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function td(e){return{c:v,m:v,p:v,i:v,o:v,d:v}}function nd(e){var B,W,O;let t,n,r,i,o=(((B=e[1])==null?void 0:B.title)??"Log in")+"",l,a,c,s=(((W=e[1])==null?void 0:W.message)??"Log in to continue.")+"",u,f,d,p,m,g,_,k,A,S,$,M,P,N,C=((O=e[1])==null?void 0:O.fields)&&Vr(sn(e)),R={ctx:e,current:null,token:null,hasCatch:!1,pending:Zf,then:zf,catch:Wf,value:10};ue(g=e[2],R);let D={ctx:e,current:null,token:null,hasCatch:!0,pending:Xf,then:Qf,catch:Kf,error:9,blocks:[,,,]};ue(k=e[0],D);let x={ctx:e,current:null,token:null,hasCatch:!0,pending:td,then:ed,catch:Jf,error:9,blocks:[,,,]};return ue($=e[2],x),{c(){t=E("dialog"),n=E("article"),r=E("header"),i=E("h3"),l=te(o),a=V(),c=E("p"),u=te(s),f=V(),d=E("form"),C&&C.c(),p=V(),m=E("footer"),R.block.c(),_=V(),D.block.c(),A=V(),S=Oe(),x.block.c(),h(d,"id","login"),t.open=!0},m(y,w){I(y,t,w),b(t,n),b(n,r),b(r,i),b(i,l),b(n,a),b(n,c),b(c,u),b(n,f),b(n,d),C&&C.m(d,null),b(n,p),b(n,m),R.block.m(m,R.anchor=null),R.mount=()=>m,R.anchor=null,I(y,_,w),D.block.m(y,D.anchor=w),D.mount=()=>A.parentNode,D.anchor=A,I(y,A,w),I(y,S,w),x.block.m(y,x.anchor=w),x.mount=()=>S.parentNode,x.anchor=S,M=!0,P||(N=Z(d,"submit",Ue(e[3])),P=!0)},p(y,[w]){var L,T,q;e=y,(!M||w&2)&&o!==(o=(((L=e[1])==null?void 0:L.title)??"Log in")+"")&&_e(l,o),(!M||w&2)&&s!==(s=(((T=e[1])==null?void 0:T.message)??"Log in to continue.")+"")&&_e(u,s),(q=e[1])!=null&&q.fields?C?C.p(sn(e),w):(C=Vr(sn(e)),C.c(),C.m(d,null)):C&&(C.d(1),C=null),R.ctx=e,w&4&&g!==(g=e[2])&&ue(g,R)||Pe(R,e,w),D.ctx=e,w&1&&k!==(k=e[0])&&ue(k,D)||Pe(D,e,w),x.ctx=e,w&4&&$!==($=e[2])&&ue($,x)||Pe(x,e,w)},i(y){M||(H(D.block),H(x.block),M=!0)},o(y){for(let w=0;w<3;w+=1){const L=D.blocks[w];j(L)}for(let w=0;w<3;w+=1){const L=x.blocks[w];j(L)}M=!1},d(y){y&&(F(t),F(_),F(A),F(S)),C&&C.d(),R.block.d(),R.token=null,R=null,D.block.d(y),D.token=null,D=null,x.block.d(y),x.token=null,x=null,P=!1,N()}}}function rd(e,t,n){let r,i;z(e,Ce,d=>n(4,i=d));let o,l,a,c,s=2;async function u(d){try{const p=new FormData(d.target);n(2,c=a.action(p))}catch(p){console.error("Error logging in.",p)}}async function f(){try{if(s<=0)return;if(!r)throw new Error("Missing backend name");switch(r){case"local":n(0,o=Vn.init());break;case"github":n(0,o=En.init());break;case"custom":n(0,o=ss(Ce,Ve));break;default:throw new Error(`Unsupported backend: ${r}`)}l=await o,l.getLoginConfig&&n(1,a=await l.getLoginConfig())}catch(d){console.error("Error initializing backend.",d),s--,console.log("Re-trying init. Attempts left ",s),f()}}return e.$$.update=()=>{var d;e.$$.dirty&16&&(r=i!=null&&i.local_backend?"local":(d=i==null?void 0:i.backend)==null?void 0:d.name),e.$$.dirty&16&&i&&f()},[o,a,c,u,i]}class id extends se{constructor(t){super(),ce(this,t,rd,nd,oe,{})}}const{window:od}=Kt;function Yr(e){let t,n;return t=new id({}),{c(){J(t.$$.fragment)},m(r,i){Q(t,r,i),n=!0},i(r){n||(H(t.$$.fragment,r),n=!0)},o(r){j(t.$$.fragment,r),n=!1},d(r){X(t,r)}}}function ld(e){let t,n,r,i,o,l;var a=e[0];function c(u,f){return{}}a&&(t=et(a,c()));let s=!e[1]&&Yr();return{c(){t&&J(t.$$.fragment),n=V(),s&&s.c(),r=Oe()},m(u,f){t&&Q(t,u,f),I(u,n,f),s&&s.m(u,f),I(u,r,f),i=!0,o||(l=Z(od,"hashchange",e[2]),o=!0)},p(u,[f]){if(f&1&&a!==(a=u[0])){if(t){ye();const d=t;j(d.$$.fragment,1,0,()=>{X(d,1)}),ke()}a?(t=et(a,c()),J(t.$$.fragment),H(t.$$.fragment,1),Q(t,n.parentNode,n)):t=null}u[1]?s&&(ye(),j(s,1,1,()=>{s=null}),ke()):s?f&2&&H(s,1):(s=Yr(),s.c(),H(s,1),s.m(r.parentNode,r))},i(u){i||(t&&H(t.$$.fragment,u),H(s),i=!0)},o(u){t&&j(t.$$.fragment,u),j(s),i=!1},d(u){u&&(F(n),F(r)),t&&X(t,u),s&&s.d(u),o=!1,l()}}}function ad(e,t,n){let r;z(e,Ve,a=>n(1,r=a));const i={"":Rc,editor:Lu};let o;function l(){const a=window.location.hash.replace(/#\/?/,""),c=i[a];c?n(0,o=c):(console.warn(`Page not found: ${a}`),window.location.hash="")}return je(()=>{l()}),[o,r,l]}class cd extends se{constructor(t){super(),ce(this,t,ad,ld,oe,{})}}function sd(){const e=document.getElementById("app");e.childElementCount>0||new cd({target:e})}sd();export{Ii as c,Ni as g};