firstly 0.0.14 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Page-DdKMiUZn.js","assets/Page-mK42zGEw.css"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/Page-Dh8pvAo6.js","assets/Page-mK42zGEw.css"])))=>i.map(i=>d[i]);
2
2
  (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}})();const Ln=!0;var Ze=Array.isArray,Yt=Array.prototype.indexOf,yn=Array.from,Y=Object.defineProperty,ae=Object.getOwnPropertyDescriptor,Wt=Object.getOwnPropertyDescriptors,ot=Object.prototype,Ht=Array.prototype,Xe=Object.getPrototypeOf;const Z=()=>{};function Kt(e){return typeof(e==null?void 0:e.then)=="function"}function Gt(e){return e()}function Te(e){for(var n=0;n<e.length;n++)e[n]()}const M=2,ut=4,Qe=8,bn=16,G=32,de=64,Be=128,N=256,Ue=512,P=1024,z=2048,Q=4096,W=8192,en=16384,zt=32768,En=65536,jt=1<<17,at=1<<18,Jt=1<<19,ft=1<<20,H=Symbol("$state"),ue=Symbol("$state metadata"),Zt=Symbol("legacy props"),Mi=Symbol("");function ct(e){return e===this.v}function _t(e,n){return e!=e?n==n:e!==n||e!==null&&typeof e=="object"||typeof e=="function"}function xn(e){return!_t(e,this.v)}function qi(){{const e=new Error("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");throw e.name="Svelte error",e}}function Xt(e,n,t){{const r=new Error(`component_api_changed
3
3
  ${e} called \`${n}\` on an instance of ${t}, which is no longer valid in Svelte 5
4
4
  https://svelte.dev/e/component_api_changed`);throw r.name="Svelte error",r}}function Qt(e,n){{const t=new Error(`component_api_invalid_new
@@ -39,4 +39,4 @@ ${i.map(a=>`
39
39
  ${f}in ${a}`).join("")}
40
40
  `}),Y(e,"component_stack",{value:i});const o=e.stack;if(o){const a=o.split(`
41
41
  `),d=[];for(let v=0;v<a.length;v++){const p=a[v];p.includes("svelte/src/internal")||d.push(p)}Y(e,"stack",{value:d.join(`
42
- `)})}if(Jn(e,n),Zn(n))throw e}function Nt(e,n,t=!0){var r=e.reactions;if(r!==null)for(var i=0;i<r.length;i++){var s=r[i];(s.f&M)!==0?Nt(s,n,!1):n===s&&(t?R(s,z):(s.f&P)!==0&&R(s,Q),un(s))}}function Rt(e){var d;var n=C,t=D,r=V,i=y,s=J,l=F,u=h,f=L,o=e.f;C=null,D=0,V=null,J=(o&N)!==0&&(L||!te||y===null),y=(o&(G|de))===0?e:null,F=null,Ve(e.ctx),L=!1,ze++;try{var c=(0,e.fn)(),_=e.deps;if(C!==null){var a;if(je(e,D),_!==null&&D>0)for(_.length=D+C.length,a=0;a<C.length;a++)_[D+a]=C[a];else e.deps=_=C;if(!J)for(a=D;a<_.length;a++)((d=_[a]).reactions??(d.reactions=[])).push(e)}else _!==null&&D<_.length&&(je(e,D),_.length=D);if(De()&&V!==null&&!L&&_!==null&&(e.f&(M|Q|z))===0)for(a=0;a<V.length;a++)Nt(V[a],e);return i!==null&&ze++,c}finally{C=n,D=t,V=r,y=i,J=s,F=l,Ve(u),L=f}}function zr(e,n){let t=n.reactions;if(t!==null){var r=Yt.call(t,e);if(r!==-1){var i=t.length-1;i===0?t=n.reactions=null:(t[r]=t[i],t.pop())}}t===null&&(n.f&M)!==0&&(C===null||!C.includes(n))&&(R(n,Q),(n.f&(N|Ue))===0&&(n.f^=Ue),bt(n),je(n,0))}function je(e,n){var t=e.deps;if(t!==null)for(var r=n;r<t.length;r++)zr(e,t[r])}function Ne(e){var n=e.f;if((n&en)===0){R(e,P);var t=E,r=h,i=te;E=e,te=!0;{var s=pe;Ye(e.component_function)}try{(n&bn)!==0?Wr(e):At(e),Tt(e);var l=Rt(e);e.teardown=typeof l=="function"?l:null,e.wv=Dt;var u=e.deps,f;Ln&&cr&&e.f&z,Ln&&Ge.push(e)}catch(o){on(o,e,t,r||e.ctx)}finally{te=i,E=t,Ye(s)}}}function Xn(){console.error("Last ten effects were: ",Ge.slice(-10).map(e=>e.fn)),Ge=[]}function jr(){try{ir()}catch(e){if(Y(e,"stack",{value:""}),Ke!==null)try{on(e,Ke,null,null)}catch(n){throw Xn(),n}else throw Xn(),e}}function Lt(){var e=te;try{var n=0;for(te=!0;$e.length>0;){n++>1e3&&jr();var t=$e,r=t.length;$e=[];for(var i=0;i<r;i++){var s=Zr(t[i]);Jr(s)}}}finally{He=!1,te=e,Ke=null,Ge=[],Ae.clear()}}function Jr(e){var n=e.length;if(n!==0)for(var t=0;t<n;t++){var r=e[t];if((r.f&(en|W))===0)try{re(r)&&(Ne(r),r.deps===null&&r.first===null&&r.nodes_start===null&&(r.teardown===null?Ot(r):r.fn=null))}catch(i){on(i,r,null,r.ctx)}}}function un(e){He||(He=!0,queueMicrotask(Lt));for(var n=Ke=e;n.parent!==null;){n=n.parent;var t=n.f;if((t&(de|G))!==0){if((t&P)===0)return;n.f^=P}}$e.push(n)}function Zr(e){for(var n=[],t=e;t!==null;){var r=t.f,i=(r&(G|de))!==0,s=i&&(r&P)!==0;if(!s&&(r&W)===0){if((r&ut)!==0)n.push(t);else if(i)t.f^=P;else{var l=y;try{y=t,re(t)&&Ne(t)}catch(o){on(o,t,null,t.ctx)}finally{y=l}}var u=t.first;if(u!==null){t=u;continue}}var f=t.parent;for(t=t.next;t===null&&f!==null;)t=f.next,f=f.parent}return n}function Xr(e){var n;for(Gn();$e.length>0;)He=!0,Lt(),Gn();return n}function x(e){var n=e.f,t=(n&M)!==0;if(y!==null&&!L){F!==null&&F.includes(e)&&ar();var r=y.deps;e.rv<ze&&(e.rv=ze,C===null&&r!==null&&r[D]===e?D++:C===null?C=[e]:(!J||!C.includes(e))&&C.push(e))}else if(t&&e.deps===null&&e.effects===null){var i=e,s=i.parent;s!==null&&(s.f&N)===0&&(i.f^=N)}return t&&(i=e,re(i)&&Et(i)),Ie&&Ae.has(e)?Ae.get(e):e.v}function K(e){var n=L;try{return L=!0,e()}finally{L=n}}const Qr=-7169;function R(e,n){e.f=e.f&Qr|n}function ei(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(H in e)wn(e);else if(!Array.isArray(e))for(let n in e){const t=e[n];typeof t=="object"&&t&&H in t&&wn(t)}}}function wn(e,n=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!n.has(e)){n.add(e),e instanceof Date&&e.getTime();for(let r in e)try{wn(e[r],n)}catch{}const t=Xe(e);if(t!==Object.prototype&&t!==Array.prototype&&t!==Map.prototype&&t!==Set.prototype&&t!==Date.prototype){const r=Wt(t);for(let i in r){const s=r[i].get;if(s)try{s.call(e)}catch{}}}}}function Zi(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const ni=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Xi(e){return ni.includes(e)}const ti={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Qi(e){return e=e.toLowerCase(),ti[e]??e}const ri=["touchstart","touchmove"];function ii(e){return ri.includes(e)}function In(e,n,t){return(...r)=>{const i=e(...r);var s=i.nodeType===11?i.firstChild:i;return Mt(s,n,t),i}}function si(e,n,t){e.__svelte_meta={loc:{file:n,line:t[0],column:t[1]}},t[2]&&Mt(e.firstChild,n,t[2])}function Mt(e,n,t){for(var r=0;e&&r<t.length;)e.nodeType===1&&si(e,n,t[r++]),e=e.nextSibling}function es(e,n){if(n){const t=document.body;e.autofocus=!0,Dn(()=>{document.activeElement===t&&e.focus()})}}let Qn=!1;function li(){Qn||(Qn=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var n;if(!e.defaultPrevented)for(const t of e.target.elements)(n=t.__on_r)==null||n.call(t)})},{capture:!0}))}function qt(e){var n=y,t=E;B(null),U(null);try{return e()}finally{B(n),U(t)}}function ns(e,n,t,r=t){e.addEventListener(n,()=>qt(t));const i=e.__on_r;i?e.__on_r=()=>{i(),r(!0)}:e.__on_r=()=>r(!0),li()}const Ft=new Set,gn=new Set;function oi(e,n,t,r={}){function i(s){if(r.capture||me.call(n,s),!s.cancelBubble)return qt(()=>t==null?void 0:t.call(this,s))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Dn(()=>{n.addEventListener(e,i,r)}):n.addEventListener(e,i,r),i}function ui(e,n,t,r,i){var s={capture:r,passive:i},l=oi(e,n,t,s);(n===document.body||n===window||n===document)&&Cn(()=>{n.removeEventListener(e,l,s)})}function ts(e){for(var n=0;n<e.length;n++)Ft.add(e[n]);for(var t of gn)t(e)}function me(e){var g;var n=this,t=n.ownerDocument,r=e.type,i=((g=e.composedPath)==null?void 0:g.call(e))||[],s=i[0]||e.target,l=0,u=e.__root;if(u){var f=i.indexOf(u);if(f!==-1&&(n===document||n===window)){e.__root=n;return}var o=i.indexOf(n);if(o===-1)return;f<=o&&(l=f)}if(s=i[l]||e.target,s!==n){Y(e,"currentTarget",{configurable:!0,get(){return s||t}});var c=y,_=E;B(null),U(null);try{for(var a,d=[];s!==null;){var v=s.assignedSlot||s.parentNode||s.host||null;try{var p=s["__"+r];if(p!=null&&(!s.disabled||e.target===s))if(Ze(p)){var[m,...w]=p;m.apply(s,[e,...w])}else p.call(s,e)}catch(b){a?d.push(b):a=b}if(e.cancelBubble||v===n||v===null)break;s=v}if(a){for(let b of d)queueMicrotask(()=>{throw b});throw a}}finally{e.__root=n,delete e.currentTarget,B(c),U(_)}}}function ai(e){var n=document.createElement("template");return n.innerHTML=e,n.content}function Je(e,n){var t=E;t.nodes_start===null&&(t.nodes_start=e,t.nodes_end=n)}function Nn(e,n){var t=(n&yr)!==0,r=(n&br)!==0,i,s=!e.startsWith("<!>");return()=>{i===void 0&&(i=ai(s?e:"<!>"+e),t||(i=We(i)));var l=r||kn?document.importNode(i,!0):i.cloneNode(!0);if(t){var u=We(l),f=l.lastChild;Je(u,f)}else Je(l,l);return l}}function rs(e=""){{var n=rn(e+"");return Je(n,n),n}}function fi(){var e=document.createDocumentFragment(),n=document.createComment(""),t=rn();return e.append(n,t),Je(n,t),e}function Re(e,n){e!==null&&e.before(n)}function et(e,n){var t=n==null?"":typeof n=="object"?n+"":n;t!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=t,e.nodeValue=t+"")}function ci(e,n){return _i(e,n)}const se=new Map;function _i(e,{target:n,anchor:t,props:r={},events:i,context:s,intro:l=!0}){qr();var u=new Set,f=_=>{for(var a=0;a<_.length;a++){var d=_[a];if(!u.has(d)){u.add(d);var v=ii(d);n.addEventListener(d,me,{passive:v});var p=se.get(d);p===void 0?(document.addEventListener(d,me,{passive:v}),se.set(d,1)):se.set(d,p+1)}}};f(yn(Ft)),gn.add(f);var o=void 0,c=Yr(()=>{var _=t??n.appendChild(rn());return _e(()=>{if(s){ht({});var a=h;a.c=s}i&&(r.$$events=i),o=e(_,r)||{},s&&wt()}),()=>{var v;for(var a of u){n.removeEventListener(a,me);var d=se.get(a);--d===0?(document.removeEventListener(a,me),se.delete(a)):se.set(a,d)}gn.delete(f),_!==t&&((v=_.parentNode)==null||v.removeChild(_))}});return di.set(o,c),o}let di=new WeakMap;function vi(e){e&&Qt(e[$]??"a component",e.name)}function pi(){const e=h==null?void 0:h.function;function n(t){var i;const r=((i=vt())==null?void 0:i[$])??"Something";Xt(r,t,e[$])}return{$destroy:()=>n("$destroy()"),$on:()=>n("$on(...)"),$set:()=>n("$set(...)")}}const _n=0,Le=1,dn=2;function hi(e,n,t,r,i){var s=e,l=De(),u=h,f=h==null?void 0:h.function,o=A,c,_,a,d=(l?k:ce)(void 0),v=(l?k:ce)(void 0),p=!1;function m(g,b){p=!0,b&&(U(w),B(w),Ve(u),Ye(f));try{g===Le&&r&&(_?Ce(_):_=_e(()=>r(s,d))),g!==_n&&c&&ne(c,()=>c=null),g!==Le&&_&&ne(_,()=>_=null),g!==dn&&a&&ne(a,()=>a=null)}finally{b&&(Ye(null),Ve(null),B(null),U(null),Xr())}}var w=ln(()=>{if(o!==(o=n())){if(Kt(o)){var g=o;p=!1,g.then(b=>{g===o&&(xe(d,b),m(Le,!0))},b=>{if(g===o)throw xe(v,b),m(dn,!0),v.v}),Dn(()=>{p||m(_n,!0)})}else xe(d,o),m(Le,!1);return()=>o=A}})}function nt(e,n,[t,r]=[0,0]){var i=e,s=null,l=null,u=A,f=t>0?En:0,o=!1;const c=(a,d=!0)=>{o=!0,_(d,a)},_=(a,d)=>{u!==(u=a)&&(u?(s?Ce(s):d&&(s=_e(()=>d(i))),l&&ne(l,()=>{l=null})):(l?Ce(l):d&&(l=_e(()=>d(i,[t+1,r]))),s&&ne(s,()=>{s=null})))};ln(()=>{o=!1,n(c),o||_(null,null)},f)}function wi(e,n){return n}function gi(e,n,t,r){for(var i=[],s=n.length,l=0;l<s;l++)Pn(n[l].e,i,!0);var u=s>0&&i.length===0&&t!==null;if(u){var f=t.parentNode;Fr(f),f.append(t),r.clear(),j(e,n[0].prev,n[s-1].next)}kt(i,()=>{for(var o=0;o<s;o++){var c=n[o];u||(r.delete(c.k),j(e,c.prev,c.next)),X(c.e,!u)}})}function mi(e,n,t,r,i,s=null){var l=e,u={flags:n,items:new Map,first:null};{var f=e;l=f.appendChild(rn())}var o=null,c=!1,_=Se(()=>{var a=t();return Ze(a)?a:a==null?[]:yn(a)});ln(()=>{var a=x(_),d=a.length;c&&d===0||(c=d===0,yi(a,u,l,i,n,r,t),s!==null&&(d===0?o?Ce(o):o=_e(()=>s(l)):o!==null&&ne(o,()=>{o=null})),x(_))})}function yi(e,n,t,r,i,s,l){var u=e.length,f=n.items,o=n.first,c=o,_,a=null,d=[],v=[],p,m,w,g;for(g=0;g<u;g+=1){if(p=e[g],m=s(p,g),w=f.get(m),w===void 0){var b=c?c.e.nodes_start:t;a=Ei(b,n,a,a===null?n.first:a.next,p,m,g,r,i,l),f.set(m,a),d=[],v=[],c=a.next;continue}if(bi(w,p,g),(w.e.f&W)!==0&&Ce(w.e),w!==c){if(_!==void 0&&_.has(w)){if(d.length<v.length){var O=v[0],T;a=O.prev;var we=d[0],S=d[d.length-1];for(T=0;T<d.length;T+=1)tt(d[T],O,t);for(T=0;T<v.length;T+=1)_.delete(v[T]);j(n,we.prev,S.next),j(n,a,we),j(n,S,O),c=O,a=S,g-=1,d=[],v=[]}else _.delete(w),tt(w,c,t),j(n,w.prev,w.next),j(n,w,a===null?n.first:a.next),j(n,a,w),a=w;continue}for(d=[],v=[];c!==null&&c.k!==m;)(c.e.f&W)===0&&(_??(_=new Set)).add(c),v.push(c),c=c.next;if(c===null)continue;w=c}d.push(w),a=w,c=w.next}if(c!==null||_!==void 0){for(var q=_===void 0?[]:yn(_);c!==null;)(c.e.f&W)===0&&q.push(c),c=c.next;var ge=q.length;if(ge>0){var Vt=u===0?t:null;gi(n,q,Vt,f)}}E.first=n.first&&n.first.e,E.last=a&&a.e}function bi(e,n,t,r){xe(e.v,n),e.i=t}function Ei(e,n,t,r,i,s,l,u,f,o){var c=(f&dr)!==0,_=(f&pr)===0,a=c?_?ce(i):k(i):i,d=(f&vr)===0?l:k(l);c&&(a.debug=()=>{var p=typeof d=="number"?l:d.v;o()[p]});var v={i:d,v:a,k:s,a:null,e:null,prev:t,next:r};try{return v.e=_e(()=>u(e,a,d,o),Lr),v.e.prev=t&&t.e,v.e.next=r&&r.e,t===null?n.first=v:(t.next=v,t.e.next=v.e),r!==null&&(r.prev=v,r.e.prev=v.e),v}finally{}}function tt(e,n,t){for(var r=e.next?e.next.e.nodes_start:t,i=n?n.e.nodes_start:t,s=e.e.nodes_start;s!==r;){var l=sn(s);i.before(s),s=l}}function j(e,n,t){n===null?e.first=t:(n.next=t,n.e.next=t&&t.e),t!==null&&(t.prev=n,t.e.prev=n&&n.e)}function xi(e=!1){const n=h,t=n.l.u;if(!t)return;let r=()=>ei(n.s);if(e){let i=0,s={};const l=Oe(()=>{let u=!1;const f=n.s;for(const o in f)f[o]!==s[o]&&(s[o]=f[o],u=!0);return u&&i++,i});r=()=>x(l)}t.b.length&&St(()=>{rt(n,r),Te(t.b)}),pn(()=>{const i=K(()=>t.m.map(Gt));return()=>{for(const s of i)typeof s=="function"&&s()}}),t.a.length&&pn(()=>{rt(n,r),Te(t.a)})}function rt(e,n){if(e.l.s)for(const t of e.l.s)x(t);n()}function Rn(e,n,t){if(e==null)return n(void 0),t&&t(void 0),Z;const r=K(()=>e.subscribe(n,t));return r.unsubscribe?()=>r.unsubscribe():r}const le=[];function Si(e,n){return{subscribe:$i(e,n).subscribe}}function $i(e,n=Z){let t=null;const r=new Set;function i(u){if(_t(e,u)&&(e=u,t)){const f=!le.length;for(const o of r)o[1](),le.push(o,e);if(f){for(let o=0;o<le.length;o+=2)le[o][0](le[o+1]);le.length=0}}}function s(u){i(u(e))}function l(u,f=Z){const o=[u,f];return r.add(o),r.size===1&&(t=n(i,s)||Z),u(e),()=>{r.delete(o),r.size===0&&t&&(t(),t=null)}}return{set:i,update:s,subscribe:l}}function is(e,n,t){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 s=n.length<2;return Si(t,(l,u)=>{let f=!1;const o=[];let c=0,_=Z;const a=()=>{if(c)return;_();const v=n(r?o[0]:o,l,u);s?l(v):_=typeof v=="function"?v:Z},d=i.map((v,p)=>Rn(v,m=>{o[p]=m,c&=~(1<<p),f&&a()},()=>{c|=1<<p}));return f=!0,a(),function(){Te(d),_(),f=!1}})}function Ti(e){let n;return Rn(e,t=>n=t)(),n}let Me=!1,mn=Symbol();function ss(e,n,t){const r=t[n]??(t[n]={store:null,source:ce(void 0),unsubscribe:Z});if(r.store!==e&&!(mn in t))if(r.unsubscribe(),r.store=e??null,e==null)r.source.v=void 0,r.unsubscribe=Z;else{var i=!0;r.unsubscribe=Rn(e,s=>{i?r.source.v=s:I(r.source,s)}),i=!1}return e&&mn in t?Ti(e):x(r.source)}function ls(e,n){return e.set(n),n}function os(){const e={};function n(){Cn(()=>{for(var t in e)e[t].unsubscribe();Y(e,mn,{enumerable:!1,value:!0})})}return[e,n]}function Ai(e){var n=Me;try{return Me=!1,[e(),Me]}finally{Me=n}}const Oi={get(e,n){if(!e.exclude.includes(n))return x(e.version),n in e.special?e.special[n]():e.props[n]},set(e,n,t){return n in e.special||(e.special[n]=Bt({get[n](){return e.props[n]}},n,dt)),e.special[n](t),Un(e.version),!0},getOwnPropertyDescriptor(e,n){if(!e.exclude.includes(n)&&n in e.props)return{enumerable:!0,configurable:!0,value:e.props[n]}},deleteProperty(e,n){return e.exclude.includes(n)||(e.exclude.push(n),Un(e.version)),!0},has(e,n){return e.exclude.includes(n)?!1:n in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(n=>!e.exclude.includes(n))}};function us(e,n){return new Proxy({props:e,exclude:n,special:{},version:k(0)},Oi)}function it(e){var n;return((n=e.ctx)==null?void 0:n.d)??!1}function Bt(e,n,t,r){var we;var i=(t&hr)!==0,s=!ve||(t&wr)!==0,l=(t&gr)!==0,u=(t&mr)!==0,f=!1,o;l?[o,f]=Ai(()=>e[n]):o=e[n];var c=H in e||Zt in e,_=l&&(((we=ae(e,n))==null?void 0:we.set)??(c&&n in e&&(S=>e[n]=S)))||void 0,a=r,d=!0,v=!1,p=()=>(v=!0,d&&(d=!1,u?a=K(r):a=r),a);o===void 0&&r!==void 0&&(_&&s&&sr(n),o=p(),_&&_(o));var m;if(s)m=()=>{var S=e[n];return S===void 0?p():(d=!0,v=!1,S)};else{var w=(i?Oe:Se)(()=>e[n]);w.f|=jt,m=()=>{var S=x(w);return S!==void 0&&(a=void 0),S===void 0?a:S}}if((t&dt)===0)return m;if(_){var g=e.$$legacy;return function(S,q){return arguments.length>0?((!s||!q||g||f)&&_(q?m():S),S):m()}}var b=!1,O=ce(o),T=Oe(()=>{var S=m(),q=x(O);return b?(b=!1,q):O.v=S});return l&&x(T),i||(T.equals=xn),function(S,q){if(arguments.length>0){const ge=q?x(T):s&&l?oe(S):S;if(!T.equals(ge)){if(b=!0,I(O,ge),v&&a!==void 0&&(a=ge),it(T))return S;K(()=>x(T))}return S}return it(T)?T.v:x(T)}}function ki(e,...n){return K(()=>{try{let t=!1;const r=[];for(const i of n)i&&typeof i=="object"&&H in i?(r.push($r(i,!0)),t=!0):r.push(i);t&&(Tr(e),console.log("%c[snapshot]","color: grey",...r))}catch{}}),n}{let e=function(n){if(!(n in globalThis)){let t;Object.defineProperty(globalThis,n,{configurable:!0,get:()=>{if(t!==void 0)return t;lr(n)},set:r=>{t=r}})}};e("$state"),e("$effect"),e("$derived"),e("$inspect"),e("$props"),e("$bindable")}function Ut(e){h===null&&An("onMount"),ve&&h.l!==null?Ci(h).m.push(e):pn(()=>{const n=K(e);if(typeof n=="function")return n})}function as(e){h===null&&An("onDestroy"),Ut(()=>()=>K(e))}function Ci(e){var n=e.l;return n.u??(n.u={a:[],b:[],m:[]})}const Pi="modulepreload",Di=function(e){return"/api/static/"+e},st={},vn=function(n,t,r){let i=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=Promise.allSettled(t.map(f=>{if(f=Di(f),f in st)return;st[f]=!0;const o=f.endsWith(".css"),c=o?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${c}`))return;const _=document.createElement("link");if(_.rel=o?"stylesheet":Pi,o||(_.as="script"),_.crossOrigin="",_.href=f,u&&_.setAttribute("nonce",u),document.head.appendChild(_),o)return new Promise((a,d)=>{_.addEventListener("load",a),_.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return i.then(l=>{for(const u of l||[])u.status==="rejected"&&s(u.reason);return n().catch(s)})},Ii="5";var lt;typeof window<"u"&&((lt=window.__svelte??(window.__svelte={})).v??(lt.v=new Set)).add(Ii);_r();Cr();ie[$]="src/App.svelte";var Ni=In(Nn('<button class="svelte-1vqrvep"> </button>'),ie[$],[[41,3]]),Ri=In(Nn(' <div class="debug svelte-1vqrvep"></div>',1),ie[$],[[39,1]]),Li=In(Nn("<main><!></main> <!>",1),ie[$],[[29,0]]);function ie(e,n){vi(new.target),ht(n,!1,ie);let t=Bt(n,"firstlyData",8);const r={auth:vn(()=>import("./Page-DdKMiUZn.js"),__vite__mapDeps([0,1])),admin:vn(()=>import("./Page-B0XXxe0N.js"),[]),storage:vn(()=>import("./Page-UV_hqY7I.js"),[])};let i=Nr();function s(d){I(i,r[d])}const l=()=>Object.keys(r);Ut(()=>{s(t().module)}),xi();var u=Li(),f=fn(u),o=Wn(f);{var c=d=>{var v=fi(),p=fn(v);hi(p,()=>x(i),null,(m,w)=>{var g=Se(()=>{var{default:O}=x(w);return{ModuleComponent:O}}),b=Se(()=>x(g).ModuleComponent);x(b)(m,{get firstlyData(){return t()}})}),Re(d,v)};nt(o,d=>{x(i)&&d(c)})}var _=Hn(f,2);{var a=d=>{var v=Ri(),p=fn(v),m=Hn(p);mi(m,5,l,wi,(w,g)=>{var b=Ni(),O=Wn(b);Kn(()=>et(O,`Load ${x(g)??""}`)),ui("click",b,()=>s(x(g))),Re(w,b)}),Kn(w=>et(p,`${w??""} `),[()=>console.info(...ki("info",t()))],Se),Re(d,v)};nt(_,d=>{t().debug&&d(a)})}return Re(e,u),wt({...pi()})}Pr(ie);ci(ie,{target:document.getElementById("app"),props:{firstlyData}});export{I as $,Vi as A,as as B,Yi as C,ji as D,Ji as E,xi as F,fi as G,fn as H,nt as I,Re as J,wt as K,Mi as L,pi as M,Fi as N,Cr as O,$ as P,os as Q,Pr as R,ss as S,Gi as T,ls as U,ei as V,In as W,Nn as X,us as Y,Kn as Z,ui as _,Wt as a,Wn as a0,Nr as a1,x as a2,Se as a3,et as a4,Hn as a5,zi as a6,Hi as a7,Bi as a8,Ki as a9,rs as aa,ts as b,oi as c,pe as d,$t as e,es as f,Xe as g,Xi as h,Zi as i,De as j,qi as k,ns as l,Ze as m,Qi as n,Ui as o,Ti as p,Si as q,ke as r,Ye as s,is as t,K as u,vi as v,$i as w,ht as x,Wi as y,Bt as z};
42
+ `)})}if(Jn(e,n),Zn(n))throw e}function Nt(e,n,t=!0){var r=e.reactions;if(r!==null)for(var i=0;i<r.length;i++){var s=r[i];(s.f&M)!==0?Nt(s,n,!1):n===s&&(t?R(s,z):(s.f&P)!==0&&R(s,Q),un(s))}}function Rt(e){var d;var n=C,t=D,r=V,i=y,s=J,l=F,u=h,f=L,o=e.f;C=null,D=0,V=null,J=(o&N)!==0&&(L||!te||y===null),y=(o&(G|de))===0?e:null,F=null,Ve(e.ctx),L=!1,ze++;try{var c=(0,e.fn)(),_=e.deps;if(C!==null){var a;if(je(e,D),_!==null&&D>0)for(_.length=D+C.length,a=0;a<C.length;a++)_[D+a]=C[a];else e.deps=_=C;if(!J)for(a=D;a<_.length;a++)((d=_[a]).reactions??(d.reactions=[])).push(e)}else _!==null&&D<_.length&&(je(e,D),_.length=D);if(De()&&V!==null&&!L&&_!==null&&(e.f&(M|Q|z))===0)for(a=0;a<V.length;a++)Nt(V[a],e);return i!==null&&ze++,c}finally{C=n,D=t,V=r,y=i,J=s,F=l,Ve(u),L=f}}function zr(e,n){let t=n.reactions;if(t!==null){var r=Yt.call(t,e);if(r!==-1){var i=t.length-1;i===0?t=n.reactions=null:(t[r]=t[i],t.pop())}}t===null&&(n.f&M)!==0&&(C===null||!C.includes(n))&&(R(n,Q),(n.f&(N|Ue))===0&&(n.f^=Ue),bt(n),je(n,0))}function je(e,n){var t=e.deps;if(t!==null)for(var r=n;r<t.length;r++)zr(e,t[r])}function Ne(e){var n=e.f;if((n&en)===0){R(e,P);var t=E,r=h,i=te;E=e,te=!0;{var s=pe;Ye(e.component_function)}try{(n&bn)!==0?Wr(e):At(e),Tt(e);var l=Rt(e);e.teardown=typeof l=="function"?l:null,e.wv=Dt;var u=e.deps,f;Ln&&cr&&e.f&z,Ln&&Ge.push(e)}catch(o){on(o,e,t,r||e.ctx)}finally{te=i,E=t,Ye(s)}}}function Xn(){console.error("Last ten effects were: ",Ge.slice(-10).map(e=>e.fn)),Ge=[]}function jr(){try{ir()}catch(e){if(Y(e,"stack",{value:""}),Ke!==null)try{on(e,Ke,null,null)}catch(n){throw Xn(),n}else throw Xn(),e}}function Lt(){var e=te;try{var n=0;for(te=!0;$e.length>0;){n++>1e3&&jr();var t=$e,r=t.length;$e=[];for(var i=0;i<r;i++){var s=Zr(t[i]);Jr(s)}}}finally{He=!1,te=e,Ke=null,Ge=[],Ae.clear()}}function Jr(e){var n=e.length;if(n!==0)for(var t=0;t<n;t++){var r=e[t];if((r.f&(en|W))===0)try{re(r)&&(Ne(r),r.deps===null&&r.first===null&&r.nodes_start===null&&(r.teardown===null?Ot(r):r.fn=null))}catch(i){on(i,r,null,r.ctx)}}}function un(e){He||(He=!0,queueMicrotask(Lt));for(var n=Ke=e;n.parent!==null;){n=n.parent;var t=n.f;if((t&(de|G))!==0){if((t&P)===0)return;n.f^=P}}$e.push(n)}function Zr(e){for(var n=[],t=e;t!==null;){var r=t.f,i=(r&(G|de))!==0,s=i&&(r&P)!==0;if(!s&&(r&W)===0){if((r&ut)!==0)n.push(t);else if(i)t.f^=P;else{var l=y;try{y=t,re(t)&&Ne(t)}catch(o){on(o,t,null,t.ctx)}finally{y=l}}var u=t.first;if(u!==null){t=u;continue}}var f=t.parent;for(t=t.next;t===null&&f!==null;)t=f.next,f=f.parent}return n}function Xr(e){var n;for(Gn();$e.length>0;)He=!0,Lt(),Gn();return n}function x(e){var n=e.f,t=(n&M)!==0;if(y!==null&&!L){F!==null&&F.includes(e)&&ar();var r=y.deps;e.rv<ze&&(e.rv=ze,C===null&&r!==null&&r[D]===e?D++:C===null?C=[e]:(!J||!C.includes(e))&&C.push(e))}else if(t&&e.deps===null&&e.effects===null){var i=e,s=i.parent;s!==null&&(s.f&N)===0&&(i.f^=N)}return t&&(i=e,re(i)&&Et(i)),Ie&&Ae.has(e)?Ae.get(e):e.v}function K(e){var n=L;try{return L=!0,e()}finally{L=n}}const Qr=-7169;function R(e,n){e.f=e.f&Qr|n}function ei(e){if(!(typeof e!="object"||!e||e instanceof EventTarget)){if(H in e)wn(e);else if(!Array.isArray(e))for(let n in e){const t=e[n];typeof t=="object"&&t&&H in t&&wn(t)}}}function wn(e,n=new Set){if(typeof e=="object"&&e!==null&&!(e instanceof EventTarget)&&!n.has(e)){n.add(e),e instanceof Date&&e.getTime();for(let r in e)try{wn(e[r],n)}catch{}const t=Xe(e);if(t!==Object.prototype&&t!==Array.prototype&&t!==Map.prototype&&t!==Set.prototype&&t!==Date.prototype){const r=Wt(t);for(let i in r){const s=r[i].get;if(s)try{s.call(e)}catch{}}}}}function Zi(e){return e.endsWith("capture")&&e!=="gotpointercapture"&&e!=="lostpointercapture"}const ni=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function Xi(e){return ni.includes(e)}const ti={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function Qi(e){return e=e.toLowerCase(),ti[e]??e}const ri=["touchstart","touchmove"];function ii(e){return ri.includes(e)}function In(e,n,t){return(...r)=>{const i=e(...r);var s=i.nodeType===11?i.firstChild:i;return Mt(s,n,t),i}}function si(e,n,t){e.__svelte_meta={loc:{file:n,line:t[0],column:t[1]}},t[2]&&Mt(e.firstChild,n,t[2])}function Mt(e,n,t){for(var r=0;e&&r<t.length;)e.nodeType===1&&si(e,n,t[r++]),e=e.nextSibling}function es(e,n){if(n){const t=document.body;e.autofocus=!0,Dn(()=>{document.activeElement===t&&e.focus()})}}let Qn=!1;function li(){Qn||(Qn=!0,document.addEventListener("reset",e=>{Promise.resolve().then(()=>{var n;if(!e.defaultPrevented)for(const t of e.target.elements)(n=t.__on_r)==null||n.call(t)})},{capture:!0}))}function qt(e){var n=y,t=E;B(null),U(null);try{return e()}finally{B(n),U(t)}}function ns(e,n,t,r=t){e.addEventListener(n,()=>qt(t));const i=e.__on_r;i?e.__on_r=()=>{i(),r(!0)}:e.__on_r=()=>r(!0),li()}const Ft=new Set,gn=new Set;function oi(e,n,t,r={}){function i(s){if(r.capture||me.call(n,s),!s.cancelBubble)return qt(()=>t==null?void 0:t.call(this,s))}return e.startsWith("pointer")||e.startsWith("touch")||e==="wheel"?Dn(()=>{n.addEventListener(e,i,r)}):n.addEventListener(e,i,r),i}function ui(e,n,t,r,i){var s={capture:r,passive:i},l=oi(e,n,t,s);(n===document.body||n===window||n===document)&&Cn(()=>{n.removeEventListener(e,l,s)})}function ts(e){for(var n=0;n<e.length;n++)Ft.add(e[n]);for(var t of gn)t(e)}function me(e){var g;var n=this,t=n.ownerDocument,r=e.type,i=((g=e.composedPath)==null?void 0:g.call(e))||[],s=i[0]||e.target,l=0,u=e.__root;if(u){var f=i.indexOf(u);if(f!==-1&&(n===document||n===window)){e.__root=n;return}var o=i.indexOf(n);if(o===-1)return;f<=o&&(l=f)}if(s=i[l]||e.target,s!==n){Y(e,"currentTarget",{configurable:!0,get(){return s||t}});var c=y,_=E;B(null),U(null);try{for(var a,d=[];s!==null;){var v=s.assignedSlot||s.parentNode||s.host||null;try{var p=s["__"+r];if(p!=null&&(!s.disabled||e.target===s))if(Ze(p)){var[m,...w]=p;m.apply(s,[e,...w])}else p.call(s,e)}catch(b){a?d.push(b):a=b}if(e.cancelBubble||v===n||v===null)break;s=v}if(a){for(let b of d)queueMicrotask(()=>{throw b});throw a}}finally{e.__root=n,delete e.currentTarget,B(c),U(_)}}}function ai(e){var n=document.createElement("template");return n.innerHTML=e,n.content}function Je(e,n){var t=E;t.nodes_start===null&&(t.nodes_start=e,t.nodes_end=n)}function Nn(e,n){var t=(n&yr)!==0,r=(n&br)!==0,i,s=!e.startsWith("<!>");return()=>{i===void 0&&(i=ai(s?e:"<!>"+e),t||(i=We(i)));var l=r||kn?document.importNode(i,!0):i.cloneNode(!0);if(t){var u=We(l),f=l.lastChild;Je(u,f)}else Je(l,l);return l}}function rs(e=""){{var n=rn(e+"");return Je(n,n),n}}function fi(){var e=document.createDocumentFragment(),n=document.createComment(""),t=rn();return e.append(n,t),Je(n,t),e}function Re(e,n){e!==null&&e.before(n)}function et(e,n){var t=n==null?"":typeof n=="object"?n+"":n;t!==(e.__t??(e.__t=e.nodeValue))&&(e.__t=t,e.nodeValue=t+"")}function ci(e,n){return _i(e,n)}const se=new Map;function _i(e,{target:n,anchor:t,props:r={},events:i,context:s,intro:l=!0}){qr();var u=new Set,f=_=>{for(var a=0;a<_.length;a++){var d=_[a];if(!u.has(d)){u.add(d);var v=ii(d);n.addEventListener(d,me,{passive:v});var p=se.get(d);p===void 0?(document.addEventListener(d,me,{passive:v}),se.set(d,1)):se.set(d,p+1)}}};f(yn(Ft)),gn.add(f);var o=void 0,c=Yr(()=>{var _=t??n.appendChild(rn());return _e(()=>{if(s){ht({});var a=h;a.c=s}i&&(r.$$events=i),o=e(_,r)||{},s&&wt()}),()=>{var v;for(var a of u){n.removeEventListener(a,me);var d=se.get(a);--d===0?(document.removeEventListener(a,me),se.delete(a)):se.set(a,d)}gn.delete(f),_!==t&&((v=_.parentNode)==null||v.removeChild(_))}});return di.set(o,c),o}let di=new WeakMap;function vi(e){e&&Qt(e[$]??"a component",e.name)}function pi(){const e=h==null?void 0:h.function;function n(t){var i;const r=((i=vt())==null?void 0:i[$])??"Something";Xt(r,t,e[$])}return{$destroy:()=>n("$destroy()"),$on:()=>n("$on(...)"),$set:()=>n("$set(...)")}}const _n=0,Le=1,dn=2;function hi(e,n,t,r,i){var s=e,l=De(),u=h,f=h==null?void 0:h.function,o=A,c,_,a,d=(l?k:ce)(void 0),v=(l?k:ce)(void 0),p=!1;function m(g,b){p=!0,b&&(U(w),B(w),Ve(u),Ye(f));try{g===Le&&r&&(_?Ce(_):_=_e(()=>r(s,d))),g!==_n&&c&&ne(c,()=>c=null),g!==Le&&_&&ne(_,()=>_=null),g!==dn&&a&&ne(a,()=>a=null)}finally{b&&(Ye(null),Ve(null),B(null),U(null),Xr())}}var w=ln(()=>{if(o!==(o=n())){if(Kt(o)){var g=o;p=!1,g.then(b=>{g===o&&(xe(d,b),m(Le,!0))},b=>{if(g===o)throw xe(v,b),m(dn,!0),v.v}),Dn(()=>{p||m(_n,!0)})}else xe(d,o),m(Le,!1);return()=>o=A}})}function nt(e,n,[t,r]=[0,0]){var i=e,s=null,l=null,u=A,f=t>0?En:0,o=!1;const c=(a,d=!0)=>{o=!0,_(d,a)},_=(a,d)=>{u!==(u=a)&&(u?(s?Ce(s):d&&(s=_e(()=>d(i))),l&&ne(l,()=>{l=null})):(l?Ce(l):d&&(l=_e(()=>d(i,[t+1,r]))),s&&ne(s,()=>{s=null})))};ln(()=>{o=!1,n(c),o||_(null,null)},f)}function wi(e,n){return n}function gi(e,n,t,r){for(var i=[],s=n.length,l=0;l<s;l++)Pn(n[l].e,i,!0);var u=s>0&&i.length===0&&t!==null;if(u){var f=t.parentNode;Fr(f),f.append(t),r.clear(),j(e,n[0].prev,n[s-1].next)}kt(i,()=>{for(var o=0;o<s;o++){var c=n[o];u||(r.delete(c.k),j(e,c.prev,c.next)),X(c.e,!u)}})}function mi(e,n,t,r,i,s=null){var l=e,u={flags:n,items:new Map,first:null};{var f=e;l=f.appendChild(rn())}var o=null,c=!1,_=Se(()=>{var a=t();return Ze(a)?a:a==null?[]:yn(a)});ln(()=>{var a=x(_),d=a.length;c&&d===0||(c=d===0,yi(a,u,l,i,n,r,t),s!==null&&(d===0?o?Ce(o):o=_e(()=>s(l)):o!==null&&ne(o,()=>{o=null})),x(_))})}function yi(e,n,t,r,i,s,l){var u=e.length,f=n.items,o=n.first,c=o,_,a=null,d=[],v=[],p,m,w,g;for(g=0;g<u;g+=1){if(p=e[g],m=s(p,g),w=f.get(m),w===void 0){var b=c?c.e.nodes_start:t;a=Ei(b,n,a,a===null?n.first:a.next,p,m,g,r,i,l),f.set(m,a),d=[],v=[],c=a.next;continue}if(bi(w,p,g),(w.e.f&W)!==0&&Ce(w.e),w!==c){if(_!==void 0&&_.has(w)){if(d.length<v.length){var O=v[0],T;a=O.prev;var we=d[0],S=d[d.length-1];for(T=0;T<d.length;T+=1)tt(d[T],O,t);for(T=0;T<v.length;T+=1)_.delete(v[T]);j(n,we.prev,S.next),j(n,a,we),j(n,S,O),c=O,a=S,g-=1,d=[],v=[]}else _.delete(w),tt(w,c,t),j(n,w.prev,w.next),j(n,w,a===null?n.first:a.next),j(n,a,w),a=w;continue}for(d=[],v=[];c!==null&&c.k!==m;)(c.e.f&W)===0&&(_??(_=new Set)).add(c),v.push(c),c=c.next;if(c===null)continue;w=c}d.push(w),a=w,c=w.next}if(c!==null||_!==void 0){for(var q=_===void 0?[]:yn(_);c!==null;)(c.e.f&W)===0&&q.push(c),c=c.next;var ge=q.length;if(ge>0){var Vt=u===0?t:null;gi(n,q,Vt,f)}}E.first=n.first&&n.first.e,E.last=a&&a.e}function bi(e,n,t,r){xe(e.v,n),e.i=t}function Ei(e,n,t,r,i,s,l,u,f,o){var c=(f&dr)!==0,_=(f&pr)===0,a=c?_?ce(i):k(i):i,d=(f&vr)===0?l:k(l);c&&(a.debug=()=>{var p=typeof d=="number"?l:d.v;o()[p]});var v={i:d,v:a,k:s,a:null,e:null,prev:t,next:r};try{return v.e=_e(()=>u(e,a,d,o),Lr),v.e.prev=t&&t.e,v.e.next=r&&r.e,t===null?n.first=v:(t.next=v,t.e.next=v.e),r!==null&&(r.prev=v,r.e.prev=v.e),v}finally{}}function tt(e,n,t){for(var r=e.next?e.next.e.nodes_start:t,i=n?n.e.nodes_start:t,s=e.e.nodes_start;s!==r;){var l=sn(s);i.before(s),s=l}}function j(e,n,t){n===null?e.first=t:(n.next=t,n.e.next=t&&t.e),t!==null&&(t.prev=n,t.e.prev=n&&n.e)}function xi(e=!1){const n=h,t=n.l.u;if(!t)return;let r=()=>ei(n.s);if(e){let i=0,s={};const l=Oe(()=>{let u=!1;const f=n.s;for(const o in f)f[o]!==s[o]&&(s[o]=f[o],u=!0);return u&&i++,i});r=()=>x(l)}t.b.length&&St(()=>{rt(n,r),Te(t.b)}),pn(()=>{const i=K(()=>t.m.map(Gt));return()=>{for(const s of i)typeof s=="function"&&s()}}),t.a.length&&pn(()=>{rt(n,r),Te(t.a)})}function rt(e,n){if(e.l.s)for(const t of e.l.s)x(t);n()}function Rn(e,n,t){if(e==null)return n(void 0),t&&t(void 0),Z;const r=K(()=>e.subscribe(n,t));return r.unsubscribe?()=>r.unsubscribe():r}const le=[];function Si(e,n){return{subscribe:$i(e,n).subscribe}}function $i(e,n=Z){let t=null;const r=new Set;function i(u){if(_t(e,u)&&(e=u,t)){const f=!le.length;for(const o of r)o[1](),le.push(o,e);if(f){for(let o=0;o<le.length;o+=2)le[o][0](le[o+1]);le.length=0}}}function s(u){i(u(e))}function l(u,f=Z){const o=[u,f];return r.add(o),r.size===1&&(t=n(i,s)||Z),u(e),()=>{r.delete(o),r.size===0&&t&&(t(),t=null)}}return{set:i,update:s,subscribe:l}}function is(e,n,t){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 s=n.length<2;return Si(t,(l,u)=>{let f=!1;const o=[];let c=0,_=Z;const a=()=>{if(c)return;_();const v=n(r?o[0]:o,l,u);s?l(v):_=typeof v=="function"?v:Z},d=i.map((v,p)=>Rn(v,m=>{o[p]=m,c&=~(1<<p),f&&a()},()=>{c|=1<<p}));return f=!0,a(),function(){Te(d),_(),f=!1}})}function Ti(e){let n;return Rn(e,t=>n=t)(),n}let Me=!1,mn=Symbol();function ss(e,n,t){const r=t[n]??(t[n]={store:null,source:ce(void 0),unsubscribe:Z});if(r.store!==e&&!(mn in t))if(r.unsubscribe(),r.store=e??null,e==null)r.source.v=void 0,r.unsubscribe=Z;else{var i=!0;r.unsubscribe=Rn(e,s=>{i?r.source.v=s:I(r.source,s)}),i=!1}return e&&mn in t?Ti(e):x(r.source)}function ls(e,n){return e.set(n),n}function os(){const e={};function n(){Cn(()=>{for(var t in e)e[t].unsubscribe();Y(e,mn,{enumerable:!1,value:!0})})}return[e,n]}function Ai(e){var n=Me;try{return Me=!1,[e(),Me]}finally{Me=n}}const Oi={get(e,n){if(!e.exclude.includes(n))return x(e.version),n in e.special?e.special[n]():e.props[n]},set(e,n,t){return n in e.special||(e.special[n]=Bt({get[n](){return e.props[n]}},n,dt)),e.special[n](t),Un(e.version),!0},getOwnPropertyDescriptor(e,n){if(!e.exclude.includes(n)&&n in e.props)return{enumerable:!0,configurable:!0,value:e.props[n]}},deleteProperty(e,n){return e.exclude.includes(n)||(e.exclude.push(n),Un(e.version)),!0},has(e,n){return e.exclude.includes(n)?!1:n in e.props},ownKeys(e){return Reflect.ownKeys(e.props).filter(n=>!e.exclude.includes(n))}};function us(e,n){return new Proxy({props:e,exclude:n,special:{},version:k(0)},Oi)}function it(e){var n;return((n=e.ctx)==null?void 0:n.d)??!1}function Bt(e,n,t,r){var we;var i=(t&hr)!==0,s=!ve||(t&wr)!==0,l=(t&gr)!==0,u=(t&mr)!==0,f=!1,o;l?[o,f]=Ai(()=>e[n]):o=e[n];var c=H in e||Zt in e,_=l&&(((we=ae(e,n))==null?void 0:we.set)??(c&&n in e&&(S=>e[n]=S)))||void 0,a=r,d=!0,v=!1,p=()=>(v=!0,d&&(d=!1,u?a=K(r):a=r),a);o===void 0&&r!==void 0&&(_&&s&&sr(n),o=p(),_&&_(o));var m;if(s)m=()=>{var S=e[n];return S===void 0?p():(d=!0,v=!1,S)};else{var w=(i?Oe:Se)(()=>e[n]);w.f|=jt,m=()=>{var S=x(w);return S!==void 0&&(a=void 0),S===void 0?a:S}}if((t&dt)===0)return m;if(_){var g=e.$$legacy;return function(S,q){return arguments.length>0?((!s||!q||g||f)&&_(q?m():S),S):m()}}var b=!1,O=ce(o),T=Oe(()=>{var S=m(),q=x(O);return b?(b=!1,q):O.v=S});return l&&x(T),i||(T.equals=xn),function(S,q){if(arguments.length>0){const ge=q?x(T):s&&l?oe(S):S;if(!T.equals(ge)){if(b=!0,I(O,ge),v&&a!==void 0&&(a=ge),it(T))return S;K(()=>x(T))}return S}return it(T)?T.v:x(T)}}function ki(e,...n){return K(()=>{try{let t=!1;const r=[];for(const i of n)i&&typeof i=="object"&&H in i?(r.push($r(i,!0)),t=!0):r.push(i);t&&(Tr(e),console.log("%c[snapshot]","color: grey",...r))}catch{}}),n}{let e=function(n){if(!(n in globalThis)){let t;Object.defineProperty(globalThis,n,{configurable:!0,get:()=>{if(t!==void 0)return t;lr(n)},set:r=>{t=r}})}};e("$state"),e("$effect"),e("$derived"),e("$inspect"),e("$props"),e("$bindable")}function Ut(e){h===null&&An("onMount"),ve&&h.l!==null?Ci(h).m.push(e):pn(()=>{const n=K(e);if(typeof n=="function")return n})}function as(e){h===null&&An("onDestroy"),Ut(()=>()=>K(e))}function Ci(e){var n=e.l;return n.u??(n.u={a:[],b:[],m:[]})}const Pi="modulepreload",Di=function(e){return"/api/static/"+e},st={},vn=function(n,t,r){let i=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),u=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));i=Promise.allSettled(t.map(f=>{if(f=Di(f),f in st)return;st[f]=!0;const o=f.endsWith(".css"),c=o?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${c}`))return;const _=document.createElement("link");if(_.rel=o?"stylesheet":Pi,o||(_.as="script"),_.crossOrigin="",_.href=f,u&&_.setAttribute("nonce",u),document.head.appendChild(_),o)return new Promise((a,d)=>{_.addEventListener("load",a),_.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(l){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=l,window.dispatchEvent(u),!u.defaultPrevented)throw l}return i.then(l=>{for(const u of l||[])u.status==="rejected"&&s(u.reason);return n().catch(s)})},Ii="5";var lt;typeof window<"u"&&((lt=window.__svelte??(window.__svelte={})).v??(lt.v=new Set)).add(Ii);_r();Cr();ie[$]="src/App.svelte";var Ni=In(Nn('<button class="svelte-1vqrvep"> </button>'),ie[$],[[41,3]]),Ri=In(Nn(' <div class="debug svelte-1vqrvep"></div>',1),ie[$],[[39,1]]),Li=In(Nn("<main><!></main> <!>",1),ie[$],[[29,0]]);function ie(e,n){vi(new.target),ht(n,!1,ie);let t=Bt(n,"firstlyData",8);const r={auth:vn(()=>import("./Page-Dh8pvAo6.js"),__vite__mapDeps([0,1])),admin:vn(()=>import("./Page-B1GE_oYi.js"),[]),storage:vn(()=>import("./Page-CDHFtYuN.js"),[])};let i=Nr();function s(d){I(i,r[d])}const l=()=>Object.keys(r);Ut(()=>{s(t().module)}),xi();var u=Li(),f=fn(u),o=Wn(f);{var c=d=>{var v=fi(),p=fn(v);hi(p,()=>x(i),null,(m,w)=>{var g=Se(()=>{var{default:O}=x(w);return{ModuleComponent:O}}),b=Se(()=>x(g).ModuleComponent);x(b)(m,{get firstlyData(){return t()}})}),Re(d,v)};nt(o,d=>{x(i)&&d(c)})}var _=Hn(f,2);{var a=d=>{var v=Ri(),p=fn(v),m=Hn(p);mi(m,5,l,wi,(w,g)=>{var b=Ni(),O=Wn(b);Kn(()=>et(O,`Load ${x(g)??""}`)),ui("click",b,()=>s(x(g))),Re(w,b)}),Kn(w=>et(p,`${w??""} `),[()=>console.info(...ki("info",t()))],Se),Re(d,v)};nt(_,d=>{t().debug&&d(a)})}return Re(e,u),wt({...pi()})}Pr(ie);ci(ie,{target:document.getElementById("app"),props:{firstlyData}});export{I as $,Vi as A,as as B,Yi as C,ji as D,Ji as E,xi as F,fi as G,fn as H,nt as I,Re as J,wt as K,Mi as L,pi as M,Fi as N,Cr as O,$ as P,os as Q,Pr as R,ss as S,Gi as T,ls as U,ei as V,In as W,Nn as X,us as Y,Kn as Z,ui as _,Wt as a,Wn as a0,Nr as a1,x as a2,Se as a3,et as a4,Hn as a5,zi as a6,Hi as a7,Bi as a8,Ki as a9,rs as aa,ts as b,oi as c,pe as d,$t as e,es as f,Xe as g,Xi as h,Zi as i,De as j,qi as k,ns as l,Ze as m,Qi as n,Ui as o,Ti as p,Si as q,ke as r,Ye as s,is as t,K as u,vi as v,$i as w,ht as x,Wi as y,Bt as z};
@@ -1,11 +1,11 @@
1
1
  <!doctype html>
2
- <html lang="en">
2
+ <html lang="en" data-theme='dark'>
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <link rel="icon" href="/api/static/favicon.svg" />
7
7
  <title>firstly</title>
8
- <script type="module" crossorigin src="/api/static/assets/index-C9jzxOBu.js"></script>
8
+ <script type="module" crossorigin src="/api/static/assets/index-7Nh2ct-y.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/api/static/assets/index-DKWpA6v7.css">
10
10
  </head>
11
11
  <body>
package/esm/bin/cmd.js CHANGED
@@ -49,7 +49,7 @@ function mergeAndSort(deps, depsToAdd) {
49
49
  return sorted;
50
50
  }
51
51
  pkg.devDependencies = mergeAndSort(pkg.devDependencies, {
52
- '@kitql/eslint-config': '0.5.8',
52
+ '@kitql/eslint-config': '0.6.0',
53
53
  '@kitql/helpers': '0.8.12',
54
54
  pg: '8.12.0',
55
55
  remult: versionOfRemult,
@@ -250,7 +250,7 @@ export { }
250
250
  ],
251
251
  './src/server/index.ts': [
252
252
  `import { FF_Role } from 'firstly'
253
- import { firstly, Module } from 'firstly/api'
253
+ import { firstly, Module } from 'firstly/server'
254
254
  import { auth } from 'firstly/auth/server'
255
255
  import { mail } from 'firstly/mail/server'
256
256
  import { changeLog } from 'firstly/changeLog/server'
@@ -523,7 +523,7 @@ export const load = (async (event) => {
523
523
  // Lib files
524
524
  './src/lib/index.ts': [
525
525
  `import { FF_Role } from 'firstly'
526
- import { FF_Role_Auth } from 'firstly/auth/client'
526
+ import { FF_Role_Auth } from 'firstly/auth'
527
527
  import { Log } from '@kitql/helpers'
528
528
 
529
529
  /**
@@ -544,7 +544,7 @@ export const Role = {
544
544
  './src/lib/ui/SignIn.svelte': [
545
545
  `<script lang="ts">
546
546
  import { isError } from 'firstly'
547
- import { AuthController } from 'firstly/auth/client'
547
+ import { AuthController } from 'firstly/auth'
548
548
 
549
549
  import { goto, invalidateAll } from '$app/navigation'
550
550
 
@@ -594,7 +594,7 @@ export const Role = {
594
594
  './src/lib/ui/SignOut.svelte': [
595
595
  `<script lang="ts">
596
596
  import { isError } from 'firstly'
597
- import { AuthController } from 'firstly/auth/client'
597
+ import { AuthController } from 'firstly/auth'
598
598
 
599
599
  import { invalidateAll } from '$app/navigation'
600
600
 
@@ -620,10 +620,10 @@ export const Role = {
620
620
  export const log = new Log("Custom Task Log")`,
621
621
  ],
622
622
  './src/modules/task/server/index.ts': [
623
- `import { Module } from 'firstly/api'
623
+ `import { Module } from 'firstly/server'
624
624
 
625
- import { Task } from '../client/Task'
626
- import { TaskController } from '../client/TaskController'
625
+ import { Task } from '../Task'
626
+ import { TaskController } from '../TaskController'
627
627
 
628
628
  export const task: (o: { specialInfo: string }) => Module = ({ specialInfo }) => {
629
629
  const m = new Module({
@@ -639,7 +639,7 @@ export const task: (o: { specialInfo: string }) => Module = ({ specialInfo }) =>
639
639
  }
640
640
  `,
641
641
  ],
642
- './src/modules/task/client/Task.ts': [
642
+ './src/modules/task/Task.ts': [
643
643
  `import { Allow, Entity, Field, Fields, ValueListFieldType } from 'remult'
644
644
  import { BaseEnum, LibIcon_Add, LibIcon_Delete, type BaseEnumOptions } from 'firstly'
645
645
 
@@ -683,7 +683,7 @@ export class TypeOfTaskEnum extends BaseEnum {
683
683
  }
684
684
  `,
685
685
  ],
686
- './src/modules/task/client/TaskController.ts': [
686
+ './src/modules/task/TaskController.ts': [
687
687
  `import { BackendMethod } from 'remult'
688
688
 
689
689
  import { log } from '${libAlias}'
@@ -699,11 +699,11 @@ export class TaskController {
699
699
  }
700
700
  `,
701
701
  ],
702
- './src/modules/task/ui/svelte/TaskAdd.svelte': [
702
+ './src/modules/task/ui/TaskAdd.svelte': [
703
703
  `<script lang="ts">
704
704
  import { EntityError, repo } from 'remult'
705
705
 
706
- import { Task } from '${modulesAlias}/task/client/Task'
706
+ import { Task } from '${modulesAlias}/task/Task'
707
707
 
708
708
  let task = $state(repo(Task).create())
709
709
  let error = $state<EntityError<Task> | null>(null)
@@ -732,11 +732,11 @@ export class TaskController {
732
732
  </form>
733
733
  `,
734
734
  ],
735
- './src/modules/task/ui/svelte/TaskList.svelte': [
735
+ './src/modules/task/ui/TaskList.svelte': [
736
736
  `<script lang="ts">
737
737
  import { repo } from 'remult'
738
738
 
739
- import { Task } from '${modulesAlias}/task/client/Task'
739
+ import { Task } from '${modulesAlias}/task/Task'
740
740
 
741
741
  let list: Task[] = $state([])
742
742
 
@@ -764,8 +764,8 @@ export class TaskController {
764
764
  ],
765
765
  './src/routes/demo/task/+page.svelte': [
766
766
  `<script lang="ts">
767
- import TaskAdd from '${modulesAlias}/task/ui/svelte/TaskAdd.svelte'
768
- import TaskList from '${modulesAlias}/task/ui/svelte/TaskList.svelte'
767
+ import TaskAdd from '${modulesAlias}/task/ui/TaskAdd.svelte'
768
+ import TaskList from '${modulesAlias}/task/ui/TaskList.svelte'
769
769
  </script>
770
770
 
771
771
  <h1>Task Module</h1>
@@ -1,4 +1,4 @@
1
- import { Module } from '../../api';
1
+ import { Module } from '../../server';
2
2
  /**
3
3
  * ## Default way
4
4
  * The easiest is to switch from `@Entity` to `@FF_Entity` to the entities where you want to log changes.
@@ -1,4 +1,4 @@
1
- import { Module } from '../../api';
1
+ import { Module } from '../../server';
2
2
  import { ChangeLog } from '../index';
3
3
  /**
4
4
  * ## Default way
@@ -1,5 +1,5 @@
1
1
  import { CronJob } from 'cron';
2
- import { Module } from '../../api';
2
+ import { Module } from '../../server';
3
3
  export declare const jobs: Record<string, {
4
4
  job: CronJob<null, unknown> | null;
5
5
  concurrentInProgress: number;
@@ -1,6 +1,6 @@
1
1
  import { CronJob } from 'cron';
2
2
  import { green, magenta, red, yellow } from '@kitql/helpers';
3
- import { Module } from '../../api';
3
+ import { Module } from '../../server';
4
4
  export const jobs = {};
5
5
  /**
6
6
  * Link to a nice Cheatsheet TODO
@@ -1,4 +1,4 @@
1
- import { Module } from '../../api';
1
+ import { Module } from '../../server';
2
2
  import type { FeedbackOptions } from '../types';
3
3
  export declare const feedback: (o: FeedbackOptions) => Module;
4
4
  declare module 'remult' {
@@ -1,5 +1,5 @@
1
1
  import { remult } from 'remult';
2
- import { Module } from '../../api';
2
+ import { Module } from '../../server';
3
3
  import { FeedbackController } from '../FeedbackController';
4
4
  export const feedback = (o) => {
5
5
  return new Module({
@@ -7,7 +7,7 @@ import type SMTPPool from 'nodemailer/lib/smtp-pool';
7
7
  import type SMTPTransport from 'nodemailer/lib/smtp-transport';
8
8
  import type StreamTransport from 'nodemailer/lib/stream-transport';
9
9
  import type { ComponentProps, ComponentType, SvelteComponent } from 'svelte';
10
- import { Module } from '../../api';
10
+ import { Module } from '../../server';
11
11
  import { default as DefaultMail } from '../templates/DefaultMail.svelte';
12
12
  export type TransportTypes = SMTPTransport | SMTPPool | SendmailTransport | StreamTransport | JSONTransport | SESTransport | typeNodemailer.Transport<any> | DefaultOptions;
13
13
  export type DefaultOptions = SMTPTransport.Options | SMTPPool.Options | SendmailTransport.Options | StreamTransport.Options | JSONTransport.Options | SESTransport.Options | typeNodemailer.TransportOptions;
@@ -29,7 +29,7 @@ declare module 'remult' {
29
29
  }
30
30
  }
31
31
  export type SendMail = typeof sendMail;
32
- declare const sendMail: <ComponentTemplateDefault extends SvelteComponent = DefaultMail>(
32
+ export declare const sendMail: <ComponentTemplateDefault extends SvelteComponent = DefaultMail>(
33
33
  /** usefull for logs, it has NO impact on the mail itself */
34
34
  topic: string, mailOptions: Parameters<typeof transporter.sendMail>[0] & {
35
35
  templateProps?: ComponentProps<ComponentTemplateDefault> | undefined;
@@ -2,7 +2,7 @@ import nodemailer from 'nodemailer';
2
2
  import { render } from 'svelty-email';
3
3
  import { remult } from 'remult';
4
4
  import { cyan, green, magenta, red, sleep, white } from '@kitql/helpers';
5
- import { Module } from '../../api';
5
+ import { Module } from '../../server';
6
6
  import { default as DefaultMail } from '../templates/DefaultMail.svelte';
7
7
  let transporter;
8
8
  let globalOptions;
@@ -36,7 +36,7 @@ const initMail = async (o) => {
36
36
  }
37
37
  }
38
38
  };
39
- const sendMail = async (topic, mailOptions) => {
39
+ export const sendMail = async (topic, mailOptions) => {
40
40
  // if the transporter is not ready, wait for it! (it can happen only if nothing is set...)
41
41
  for (let i = 0; i < 30; i++) {
42
42
  if (transporter !== undefined) {
@@ -79,11 +79,13 @@ const sendMail = async (topic, mailOptions) => {
79
79
  };
80
80
  const mailModule = new Module({
81
81
  name: 'mail',
82
- priority: -778,
82
+ priority: -888,
83
83
  });
84
84
  export const mail = (o) => {
85
85
  mailModule.initApi = () => {
86
86
  initMail(o);
87
+ };
88
+ mailModule.initRequest = async () => {
87
89
  remult.context.sendMail = sendMail;
88
90
  };
89
91
  return mailModule;
@@ -0,0 +1,49 @@
1
+ import type { RequestEvent } from '@sveltejs/kit';
2
+ import { type ClassType } from 'remult';
3
+ import type { RemultServerOptions } from 'remult/server';
4
+ import { Log } from '@kitql/helpers';
5
+ type ModuleInput = {
6
+ /**
7
+ * The name of the module (usefull for logging and debugging purposes)
8
+ */
9
+ name: string;
10
+ priority?: number;
11
+ entities?: ClassType<any>[];
12
+ controllers?: ClassType<any>[];
13
+ initApi?: RemultServerOptions<RequestEvent>['initApi'];
14
+ initRequest?: RemultServerOptions<RequestEvent>['initRequest'];
15
+ modules?: Module[];
16
+ };
17
+ export declare class Module {
18
+ name: string;
19
+ log: Log;
20
+ priority?: number;
21
+ entities?: ClassType<any>[];
22
+ controllers?: ClassType<any>[];
23
+ initApi?: RemultServerOptions<RequestEvent>['initApi'];
24
+ initRequest?: RemultServerOptions<RequestEvent>['initRequest'];
25
+ modules?: Module[];
26
+ constructor(input: ModuleInput);
27
+ }
28
+ type Options = RemultServerOptions<RequestEvent<Partial<Record<string, string>>, string | null>> & {
29
+ modules?: Module[] | undefined;
30
+ };
31
+ declare module 'remult' {
32
+ interface RemultContext {
33
+ request: RequestEvent;
34
+ setHeaders(headers: Record<string, string>): void;
35
+ setCookie(...args: Parameters<RequestEvent['cookies']['set']>): void;
36
+ deleteCookie(...args: Parameters<RequestEvent['cookies']['delete']>): void;
37
+ }
38
+ }
39
+ export declare let entities: ClassType<any>[];
40
+ /**
41
+ * it's basically `remultSveltekit` with the `modules` option
42
+ * @deprecated will be done directly in remult when modules will be in 😉
43
+ */
44
+ export declare const firstly: (o: Options) => import("remult/remult-sveltekit").RemultSveltekitServer;
45
+ /**
46
+ * Full flat and ordered list by index and concatenaining the modules name
47
+ */
48
+ export declare const modulesFlatAndOrdered: (modules: Module[]) => Module[];
49
+ export {};
@@ -1 +1,109 @@
1
- "use strict";
1
+ import {} from 'remult';
2
+ import { remultSveltekit } from 'remult/remult-sveltekit';
3
+ import { Log } from '@kitql/helpers';
4
+ import { building } from '$app/environment';
5
+ import { sveltekit } from '../sveltekit/server';
6
+ export class Module {
7
+ name;
8
+ log;
9
+ priority;
10
+ entities;
11
+ controllers;
12
+ initApi;
13
+ initRequest;
14
+ modules;
15
+ constructor(input) {
16
+ this.name = input.name;
17
+ this.log = new Log(`firstly | ${this.name}`);
18
+ this.priority = input.priority;
19
+ this.entities = input.entities;
20
+ this.controllers = input.controllers;
21
+ this.initApi = input.initApi;
22
+ this.initRequest = input.initRequest;
23
+ this.modules = input.modules;
24
+ }
25
+ }
26
+ export let entities = [];
27
+ /**
28
+ * it's basically `remultSveltekit` with the `modules` option
29
+ * @deprecated will be done directly in remult when modules will be in 😉
30
+ */
31
+ export const firstly = (o) => {
32
+ const modulesSorted = modulesFlatAndOrdered([
33
+ ...[...(o.modules ?? []), sveltekit()],
34
+ new Module({
35
+ name: 'default',
36
+ entities: o.entities ?? [],
37
+ controllers: o.controllers ?? [],
38
+ initRequest: o.initRequest,
39
+ initApi: o.initApi,
40
+ }),
41
+ ]);
42
+ entities = modulesSorted.flatMap((m) => m.entities ?? []);
43
+ return remultSveltekit({
44
+ // Changing the default default of remult
45
+ logApiEndPoints: false,
46
+ admin: true,
47
+ defaultGetLimit: 25,
48
+ error: o.error
49
+ ? o.error
50
+ : async (e) => {
51
+ // REMULT P2: validation error should probably be 409
52
+ // if 400 we move to 409
53
+ if (e.httpStatusCode == 400) {
54
+ e.sendError(409, e.responseBody);
55
+ }
56
+ },
57
+ // Add user configuration
58
+ ...o,
59
+ // Module part
60
+ entities,
61
+ controllers: modulesSorted.flatMap((m) => m.controllers ?? []),
62
+ initRequest: async (kitEvent, op) => {
63
+ for (let i = 0; i < modulesSorted.length; i++) {
64
+ const f = modulesSorted[i].initRequest;
65
+ if (f) {
66
+ try {
67
+ await f(kitEvent, op);
68
+ }
69
+ catch (error) {
70
+ modulesSorted[i].log.error(error);
71
+ }
72
+ }
73
+ }
74
+ },
75
+ initApi: async (r) => {
76
+ if (!building) {
77
+ for (let i = 0; i < modulesSorted.length; i++) {
78
+ const f = modulesSorted[i].initApi;
79
+ if (f) {
80
+ try {
81
+ await f(r);
82
+ }
83
+ catch (error) {
84
+ modulesSorted[i].log.error(error);
85
+ }
86
+ }
87
+ }
88
+ }
89
+ },
90
+ });
91
+ };
92
+ /**
93
+ * Full flat and ordered list by index and concatenaining the modules name
94
+ */
95
+ export const modulesFlatAndOrdered = (modules) => {
96
+ const flattenModules = (modules, parentName = '') => {
97
+ return modules.reduce((acc, module) => {
98
+ const fullName = parentName ? `${parentName}-${module.name}` : module.name;
99
+ // Create a new module object without the 'modules' property
100
+ const { modules: _, ...flatModule } = module;
101
+ const newModule = { ...flatModule, name: fullName };
102
+ const subModules = module.modules ? flattenModules(module.modules, fullName) : [];
103
+ return [...acc, newModule, ...subModules];
104
+ }, []);
105
+ };
106
+ const flatModules = flattenModules(modules);
107
+ flatModules.sort((a, b) => (a.priority || 0) - (b.priority || 0));
108
+ return flatModules;
109
+ };
@@ -1,4 +1,4 @@
1
- import { Module } from '../../api';
1
+ import { Module } from '../../server';
2
2
  /**
3
3
  * @deprecated will be done directly in remult when modules will be in 😉
4
4
  */
@@ -1,5 +1,5 @@
1
1
  import { remult } from 'remult';
2
- import { Module } from '../../api';
2
+ import { Module } from '../../server';
3
3
  /**
4
4
  * @deprecated will be done directly in remult when modules will be in 😉
5
5
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firstly",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "type": "module",
5
5
  "description": "Firstly, an opinionated Remult setup!",
6
6
  "funding": "https://github.com/sponsors/jycouet",
@@ -16,12 +16,12 @@
16
16
  },
17
17
  "peerDependencies": {
18
18
  "@sveltejs/kit": ">=1.0.0 <3.0.0",
19
- "remult": "2.7.32-next.0",
19
+ "remult": ">=2.7.32",
20
20
  "svelte": ">=5"
21
21
  },
22
22
  "dependencies": {
23
23
  "@clack/prompts": "0.10.0",
24
- "@kitql/internals": "0.10.3",
24
+ "@kitql/internals": "0.10.4",
25
25
  "@mdi/js": "7.4.47",
26
26
  "@melt-ui/svelte": "0.86.3",
27
27
  "@oslojs/crypto": "1.0.1",
@@ -39,8 +39,8 @@
39
39
  "tailwind-merge": "2.6.0",
40
40
  "tailwindcss": "3.4.4",
41
41
  "vite": "6.2.2",
42
- "vite-plugin-kit-routes": "0.8.3",
43
- "vite-plugin-stripper": "0.9.0-next.1"
42
+ "vite-plugin-kit-routes": "0.8.4",
43
+ "vite-plugin-stripper": "0.9.0"
44
44
  },
45
45
  "sideEffects": false,
46
46
  "bin": "./esm/bin/cmd.js",
@@ -50,9 +50,9 @@
50
50
  "svelte": "./esm/index.js",
51
51
  "default": "./esm/index.js"
52
52
  },
53
- "./api": {
54
- "types": "./esm/api/index.d.ts",
55
- "default": "./esm/api/index.js"
53
+ "./server": {
54
+ "types": "./esm/server/index.d.ts",
55
+ "default": "./esm/server/index.js"
56
56
  },
57
57
  "./vite": {
58
58
  "types": "./esm/vite/index.d.ts",
@@ -65,7 +65,7 @@
65
65
  "types": "./esm/formats/index.d.ts",
66
66
  "default": "./esm/formats/index.js"
67
67
  },
68
- "./auth/client": {
68
+ "./auth": {
69
69
  "types": "./esm/auth/index.d.ts",
70
70
  "default": "./esm/auth/index.js"
71
71
  },
@@ -73,7 +73,7 @@
73
73
  "types": "./esm/auth/server/index.d.ts",
74
74
  "default": "./esm/auth/server/index.js"
75
75
  },
76
- "./changeLog/client": {
76
+ "./changeLog": {
77
77
  "types": "./esm/changeLog/index.d.ts",
78
78
  "default": "./esm/changeLog/index.js"
79
79
  },
@@ -85,7 +85,7 @@
85
85
  "types": "./esm/cron/server/index.d.ts",
86
86
  "default": "./esm/cron/server/index.js"
87
87
  },
88
- "./feedback/client": {
88
+ "./feedback": {
89
89
  "types": "./esm/feedback/index.d.ts",
90
90
  "default": "./esm/feedback/index.js"
91
91
  },
@@ -93,7 +93,7 @@
93
93
  "types": "./esm/feedback/server/index.d.ts",
94
94
  "default": "./esm/feedback/server/index.js"
95
95
  },
96
- "./mail/client": {
96
+ "./mail": {
97
97
  "types": "./esm/mail/index.d.ts",
98
98
  "default": "./esm/mail/index.js"
99
99
  },
@@ -1,49 +0,0 @@
1
- import type { RequestEvent } from '@sveltejs/kit';
2
- import { type ClassType } from 'remult';
3
- import type { RemultServerOptions } from 'remult/server';
4
- import { Log } from '@kitql/helpers';
5
- type ModuleInput = {
6
- /**
7
- * The name of the module (usefull for logging and debugging purposes)
8
- */
9
- name: string;
10
- priority?: number;
11
- entities?: ClassType<any>[];
12
- controllers?: ClassType<any>[];
13
- initApi?: RemultServerOptions<RequestEvent>['initApi'];
14
- initRequest?: RemultServerOptions<RequestEvent>['initRequest'];
15
- modules?: Module[];
16
- };
17
- export declare class Module {
18
- name: string;
19
- log: Log;
20
- priority?: number;
21
- entities?: ClassType<any>[];
22
- controllers?: ClassType<any>[];
23
- initApi?: RemultServerOptions<RequestEvent>['initApi'];
24
- initRequest?: RemultServerOptions<RequestEvent>['initRequest'];
25
- modules?: Module[];
26
- constructor(input: ModuleInput);
27
- }
28
- type Options = RemultServerOptions<RequestEvent<Partial<Record<string, string>>, string | null>> & {
29
- modules?: Module[] | undefined;
30
- };
31
- declare module 'remult' {
32
- interface RemultContext {
33
- request: RequestEvent;
34
- setHeaders(headers: Record<string, string>): void;
35
- setCookie(...args: Parameters<RequestEvent['cookies']['set']>): void;
36
- deleteCookie(...args: Parameters<RequestEvent['cookies']['delete']>): void;
37
- }
38
- }
39
- export declare let entities: ClassType<any>[];
40
- /**
41
- * it's basically `remultSveltekit` with the `modules` option
42
- * @deprecated will be done directly in remult when modules will be in 😉
43
- */
44
- export declare const firstly: (o: Options) => import("remult/remult-sveltekit").RemultSveltekitServer;
45
- /**
46
- * Full flat and ordered list by index and concatenaining the modules name
47
- */
48
- export declare const modulesFlatAndOrdered: (modules: Module[]) => Module[];
49
- export {};