2 lines
13 KiB
JavaScript
2 lines
13 KiB
JavaScript
import{s as ie,a as C,e as K,b as Z,u as ee,g as te,d as re,c as Ae,o as Je,n as ye,r as Ke}from"../chunks/DHedsUi_.js";import{S as fe,i as ce,k as I,l as v,m as p,n as A,o as q,p as B,d as k,q as X,a as le,w as Be,u as w,c as x,v as Fe,h as N,x as Le,s as Ve,b as m,r as Se,e as T,g as M,f as G,j as U,t as J,G as se,y as Y}from"../chunks/G8UKEBBn.js";import{I as xe,g as Ne,a as Ee,e as oe}from"../chunks/C1tDbyYL.js";import{p as Re}from"../chunks/CEKnDucw.js";import{g as ke}from"../chunks/6cgBTYw-.js";import{a as je,c as we,b as We}from"../chunks/DjUyxgK6.js";import{B as ze}from"../chunks/D3KWQg4I.js";import{C as Xe}from"../chunks/DIz1JgvC.js";import{T as Ye}from"../chunks/C7zepb3B.js";import{C as Ze}from"../chunks/B9ru2HtO.js";import{F as et}from"../chunks/CNY58Upt.js";import{D as tt}from"../chunks/BojKV9te.js";import{U as rt}from"../chunks/Betcpvy2.js";import{U as lt}from"../chunks/BYJWe3D5.js";import{U as nt}from"../chunks/CImgxE6m.js";const at=!1,ot=!1,Ht=Object.freeze(Object.defineProperty({__proto__:null,prerender:at,ssr:ot},Symbol.toStringTag,{value:"Module"}));function st(a){let e;const t=a[2].default,r=Z(t,a,a[3],null);return{c(){r&&r.c()},l(l){r&&r.l(l)},m(l,n){r&&r.m(l,n),e=!0},p(l,n){r&&r.p&&(!e||n&8)&&ee(r,t,l,l[3],e?re(t,l[3],n,null):te(l[3]),null)},i(l){e||(p(r,l),e=!0)},o(l){v(r,l),e=!1},d(l){r&&r.d(l)}}}function it(a){let e,t;const r=[{name:"layout-dashboard"},a[1],{iconNode:a[0]}];let l={$$slots:{default:[st]},$$scope:{ctx:a}};for(let n=0;n<r.length;n+=1)l=C(l,r[n]);return e=new xe({props:l}),{c(){B(e.$$.fragment)},l(n){q(e.$$.fragment,n)},m(n,o){A(e,n,o),t=!0},p(n,[o]){const u=o&3?Ne(r,[r[0],o&2&&Ee(n[1]),o&1&&{iconNode:n[0]}]):{};o&8&&(u.$$scope={dirty:o,ctx:n}),e.$set(u)},i(n){t||(p(e.$$.fragment,n),t=!0)},o(n){v(e.$$.fragment,n),t=!1},d(n){I(e,n)}}}function ft(a,e,t){let{$$slots:r={},$$scope:l}=e;const n=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1"}]];return a.$$set=o=>{t(1,e=C(C({},e),K(o))),"$$scope"in o&&t(3,l=o.$$scope)},e=K(e),[n,e,r,l]}class ct extends fe{constructor(e){super(),ce(this,e,ft,it,ie,{})}}function ut(a){let e;const t=a[2].default,r=Z(t,a,a[3],null);return{c(){r&&r.c()},l(l){r&&r.l(l)},m(l,n){r&&r.m(l,n),e=!0},p(l,n){r&&r.p&&(!e||n&8)&&ee(r,t,l,l[3],e?re(t,l[3],n,null):te(l[3]),null)},i(l){e||(p(r,l),e=!0)},o(l){v(r,l),e=!1},d(l){r&&r.d(l)}}}function dt(a){let e,t;const r=[{name:"log-out"},a[1],{iconNode:a[0]}];let l={$$slots:{default:[ut]},$$scope:{ctx:a}};for(let n=0;n<r.length;n+=1)l=C(l,r[n]);return e=new xe({props:l}),{c(){B(e.$$.fragment)},l(n){q(e.$$.fragment,n)},m(n,o){A(e,n,o),t=!0},p(n,[o]){const u=o&3?Ne(r,[r[0],o&2&&Ee(n[1]),o&1&&{iconNode:n[0]}]):{};o&8&&(u.$$scope={dirty:o,ctx:n}),e.$set(u)},i(n){t||(p(e.$$.fragment,n),t=!0)},o(n){v(e.$$.fragment,n),t=!1},d(n){I(e,n)}}}function ht(a,e,t){let{$$slots:r={},$$scope:l}=e;const n=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"}],["polyline",{points:"16 17 21 12 16 7"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12"}]];return a.$$set=o=>{t(1,e=C(C({},e),K(o))),"$$scope"in o&&t(3,l=o.$$scope)},e=K(e),[n,e,r,l]}class mt extends fe{constructor(e){super(),ce(this,e,ht,dt,ie,{})}}function gt(a){let e;const t=a[2].default,r=Z(t,a,a[3],null);return{c(){r&&r.c()},l(l){r&&r.l(l)},m(l,n){r&&r.m(l,n),e=!0},p(l,n){r&&r.p&&(!e||n&8)&&ee(r,t,l,l[3],e?re(t,l[3],n,null):te(l[3]),null)},i(l){e||(p(r,l),e=!0)},o(l){v(r,l),e=!1},d(l){r&&r.d(l)}}}function _t(a){let e,t;const r=[{name:"power-off"},a[1],{iconNode:a[0]}];let l={$$slots:{default:[gt]},$$scope:{ctx:a}};for(let n=0;n<r.length;n+=1)l=C(l,r[n]);return e=new xe({props:l}),{c(){B(e.$$.fragment)},l(n){q(e.$$.fragment,n)},m(n,o){A(e,n,o),t=!0},p(n,[o]){const u=o&3?Ne(r,[r[0],o&2&&Ee(n[1]),o&1&&{iconNode:n[0]}]):{};o&8&&(u.$$scope={dirty:o,ctx:n}),e.$set(u)},i(n){t||(p(e.$$.fragment,n),t=!0)},o(n){v(e.$$.fragment,n),t=!1},d(n){I(e,n)}}}function pt(a,e,t){let{$$slots:r={},$$scope:l}=e;const n=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68"}],["path",{d:"M12 2v4"}],["path",{d:"m2 2 20 20"}]];return a.$$set=o=>{t(1,e=C(C({},e),K(o))),"$$scope"in o&&t(3,l=o.$$scope)},e=K(e),[n,e,r,l]}class bt extends fe{constructor(e){super(),ce(this,e,pt,_t,ie,{})}}function He(a,e,t){const r=a.slice();return r[9]=e[t],r}function Oe(a,e,t){const r=a.slice();return r[9]=e[t],r}function $t(a){let e;const t=a[8].default,r=Z(t,a,a[7],null);return{c(){r&&r.c()},l(l){r&&r.l(l)},m(l,n){r&&r.m(l,n),e=!0},p(l,n){r&&r.p&&(!e||n&128)&&ee(r,t,l,l[7],e?re(t,l[7],n,null):te(l[7]),null)},i(l){e||(p(r,l),e=!0)},o(l){v(r,l),e=!1},d(l){r&&r.d(l)}}}function vt(a){var De,Me;let e,t,r,l='<span class="text-base font-semibold text-gray-900 dark:text-white">🏠 Mes Locations</span>',n,o,u,i,h,c,b,$=(((Me=(De=a[1].name)==null?void 0:De[0])==null?void 0:Me.toUpperCase())??"?")+"",ne,ue,F,R=a[1].name+"",ae,de,L,j,he,me,V,z,ge,_e,Q,S,pe,Te,H=oe(a[2]),g=[];for(let s=0;s<H.length;s+=1)g[s]=Pe(Oe(a,H,s));const Qe=s=>v(g[s],1,1,()=>{g[s]=null});let O=oe(a[3]),_=[];for(let s=0;s<O.length;s+=1)_[s]=qe(He(a,O,s));const Ge=s=>v(_[s],1,1,()=>{_[s]=null});j=new mt({props:{size:17}}),z=new bt({props:{size:17}});const be=a[8].default,E=Z(be,a,a[7],null);return{c(){e=N("div"),t=N("aside"),r=N("div"),r.innerHTML=l,n=U(),o=N("nav");for(let s=0;s<g.length;s+=1)g[s].c();u=U(),i=N("div");for(let s=0;s<_.length;s+=1)_[s].c();h=U(),c=N("div"),b=N("div"),ne=J($),ue=U(),F=N("span"),ae=J(R),de=U(),L=N("button"),B(j.$$.fragment),he=J(" Déconnexion"),me=U(),V=N("button"),B(z.$$.fragment),ge=J(" Quitter l'application"),_e=U(),Q=N("main"),E&&E.c(),this.h()},l(s){e=x(s,"DIV",{class:!0});var d=T(e);t=x(d,"ASIDE",{class:!0});var y=T(t);r=x(y,"DIV",{class:!0,"data-svelte-h":!0}),Fe(r)!=="svelte-ya622w"&&(r.innerHTML=l),n=M(y),o=x(y,"NAV",{class:!0});var W=T(o);for(let P=0;P<g.length;P+=1)g[P].l(W);W.forEach(k),u=M(y),i=x(y,"DIV",{class:!0});var f=T(i);for(let P=0;P<_.length;P+=1)_[P].l(f);h=M(f),c=x(f,"DIV",{class:!0});var D=T(c);b=x(D,"DIV",{class:!0});var Ue=T(b);ne=G(Ue,$),Ue.forEach(k),ue=M(D),F=x(D,"SPAN",{class:!0});var Ce=T(F);ae=G(Ce,R),Ce.forEach(k),D.forEach(k),de=M(f),L=x(f,"BUTTON",{class:!0});var $e=T(L);q(j.$$.fragment,$e),he=G($e," Déconnexion"),$e.forEach(k),me=M(f),V=x(f,"BUTTON",{class:!0});var ve=T(V);q(z.$$.fragment,ve),ge=G(ve," Quitter l'application"),ve.forEach(k),f.forEach(k),y.forEach(k),_e=M(d),Q=x(d,"MAIN",{class:!0});var Ie=T(Q);E&&E.l(Ie),Ie.forEach(k),d.forEach(k),this.h()},h(){w(r,"class","px-5 py-4 border-b border-gray-100 dark:border-gray-800"),w(o,"class","flex-1 px-3 py-3 space-y-0.5 overflow-y-auto"),w(b,"class","w-7 h-7 rounded-full bg-blue-100 dark:bg-blue-900 flex items-center justify-center text-xs font-semibold text-blue-700 dark:text-blue-300 shrink-0"),w(F,"class","text-xs text-gray-500 dark:text-gray-400 truncate flex-1"),w(c,"class","flex items-center gap-3 px-3 py-2 mt-1"),w(L,"class","flex items-center gap-3 w-full px-3 py-2 rounded-lg text-sm text-gray-500 dark:text-gray-400 hover:bg-red-50 dark:hover:bg-red-950/50 hover:text-red-600 dark:hover:text-red-400 transition-colors"),w(V,"class","flex items-center gap-3 w-full px-3 py-2 rounded-lg text-sm text-gray-500 dark:text-gray-400 hover:bg-red-50 dark:hover:bg-red-950/50 hover:text-red-600 dark:hover:text-red-400 transition-colors"),w(i,"class","px-3 py-3 border-t border-gray-100 dark:border-gray-800 space-y-0.5"),w(t,"class","hidden md:flex flex-col w-60 bg-white dark:bg-gray-900 border-r border-gray-100 dark:border-gray-800 shrink-0"),w(Q,"class","flex-1 overflow-auto"),w(e,"class","flex h-screen bg-gray-50 dark:bg-gray-950")},m(s,d){le(s,e,d),m(e,t),m(t,r),m(t,n),m(t,o);for(let y=0;y<g.length;y+=1)g[y]&&g[y].m(o,null);m(t,u),m(t,i);for(let y=0;y<_.length;y+=1)_[y]&&_[y].m(i,null);m(i,h),m(i,c),m(c,b),m(b,ne),m(c,ue),m(c,F),m(F,ae),m(i,de),m(i,L),A(j,L,null),m(L,he),m(i,me),m(i,V),A(z,V,null),m(V,ge),m(e,_e),m(e,Q),E&&E.m(Q,null),S=!0,pe||(Te=[Se(L,"click",a[4]),Se(V,"click",wt)],pe=!0)},p(s,d){var y,W;if(d&36){H=oe(s[2]);let f;for(f=0;f<H.length;f+=1){const D=Oe(s,H,f);g[f]?(g[f].p(D,d),p(g[f],1)):(g[f]=Pe(D),g[f].c(),p(g[f],1),g[f].m(o,null))}for(Y(),f=H.length;f<g.length;f+=1)Qe(f);X()}if(d&40){O=oe(s[3]);let f;for(f=0;f<O.length;f+=1){const D=He(s,O,f);_[f]?(_[f].p(D,d),p(_[f],1)):(_[f]=qe(D),_[f].c(),p(_[f],1),_[f].m(i,h))}for(Y(),f=O.length;f<_.length;f+=1)Ge(f);X()}(!S||d&2)&&$!==($=(((W=(y=s[1].name)==null?void 0:y[0])==null?void 0:W.toUpperCase())??"?")+"")&&Ve(ne,$),(!S||d&2)&&R!==(R=s[1].name+"")&&Ve(ae,R),E&&E.p&&(!S||d&128)&&ee(E,be,s,s[7],S?re(be,s[7],d,null):te(s[7]),null)},i(s){if(!S){for(let d=0;d<H.length;d+=1)p(g[d]);for(let d=0;d<O.length;d+=1)p(_[d]);p(j.$$.fragment,s),p(z.$$.fragment,s),p(E,s),S=!0}},o(s){g=g.filter(Boolean);for(let d=0;d<g.length;d+=1)v(g[d]);_=_.filter(Boolean);for(let d=0;d<_.length;d+=1)v(_[d]);v(j.$$.fragment,s),v(z.$$.fragment,s),v(E,s),S=!1},d(s){s&&k(e),Le(g,s),Le(_,s),I(j),I(z),E&&E.d(s),pe=!1,Ke(Te)}}}function yt(a){let e,t='<div class="w-6 h-6 border-2 border-blue-500 border-t-transparent rounded-full animate-spin"></div>';return{c(){e=N("div"),e.innerHTML=t,this.h()},l(r){e=x(r,"DIV",{class:!0,"data-svelte-h":!0}),Fe(e)!=="svelte-eehi9"&&(e.innerHTML=t),this.h()},h(){w(e,"class","min-h-screen bg-gray-50 dark:bg-gray-950 flex items-center justify-center")},m(r,l){le(r,e,l)},p:ye,i:ye,o:ye,d(r){r&&k(e)}}}function Pe(a){let e,t,r,l=a[9].label+"",n,o,u;var i=a[9].icon;function h(c,b){return{props:{size:17}}}return i&&(t=se(i,h())),{c(){e=N("a"),t&&B(t.$$.fragment),r=U(),n=J(l),o=U(),this.h()},l(c){e=x(c,"A",{href:!0,class:!0});var b=T(e);t&&q(t.$$.fragment,b),r=M(b),n=G(b,l),o=M(b),b.forEach(k),this.h()},h(){w(e,"href",a[9].href),w(e,"class","flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors "+(a[5](a[9].href)?"bg-blue-50 dark:bg-blue-950 text-blue-700 dark:text-blue-300 font-medium":"text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-gray-200"))},m(c,b){le(c,e,b),t&&A(t,e,null),m(e,r),m(e,n),m(e,o),u=!0},p(c,b){if(i!==(i=c[9].icon)){if(t){Y();const $=t;v($.$$.fragment,1,0,()=>{I($,1)}),X()}i?(t=se(i,h()),B(t.$$.fragment),p(t.$$.fragment,1),A(t,e,r)):t=null}},i(c){u||(t&&p(t.$$.fragment,c),u=!0)},o(c){t&&v(t.$$.fragment,c),u=!1},d(c){c&&k(e),t&&I(t)}}}function qe(a){let e,t,r,l=a[9].label+"",n,o;var u=a[9].icon;function i(h,c){return{props:{size:17}}}return u&&(t=se(u,i())),{c(){e=N("a"),t&&B(t.$$.fragment),r=U(),n=J(l),this.h()},l(h){e=x(h,"A",{href:!0,class:!0});var c=T(e);t&&q(t.$$.fragment,c),r=M(c),n=G(c,l),c.forEach(k),this.h()},h(){w(e,"href",a[9].href),w(e,"class","flex items-center gap-3 px-3 py-2 rounded-lg text-sm transition-colors "+(a[5](a[9].href)?"bg-blue-50 dark:bg-blue-950 text-blue-700 dark:text-blue-300 font-medium":"text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-gray-200"))},m(h,c){le(h,e,c),t&&A(t,e,null),m(e,r),m(e,n),o=!0},p(h,c){if(u!==(u=h[9].icon)){if(t){Y();const b=t;v(b.$$.fragment,1,0,()=>{I(b,1)}),X()}u?(t=se(u,i()),B(t.$$.fragment),p(t.$$.fragment,1),A(t,e,r)):t=null}},i(h){o||(t&&p(t.$$.fragment,h),o=!0)},o(h){t&&v(t.$$.fragment,h),o=!1},d(h){h&&k(e),t&&I(t)}}}function kt(a){let e,t,r,l;const n=[yt,vt,$t],o=[];function u(i,h){return i[0]?i[1]?1:2:0}return e=u(a),t=o[e]=n[e](a),{c(){t.c(),r=Be()},l(i){t.l(i),r=Be()},m(i,h){o[e].m(i,h),le(i,r,h),l=!0},p(i,[h]){let c=e;e=u(i),e===c?o[e].p(i,h):(Y(),v(o[c],1,1,()=>{o[c]=null}),X(),t=o[e],t?t.p(i,h):(t=o[e]=n[e](i),t.c()),p(t,1),t.m(r.parentNode,r))},i(i){l||(p(t),l=!0)},o(i){v(t),l=!1},d(i){i&&k(r),o[e].d(i)}}}async function wt(){if(confirm("Arrêter l'application ?"))try{await fetch("/api/shutdown",{method:"POST",credentials:"include"})}catch{}}function xt(a,e,t){let r,l;Ae(a,Re,$=>t(6,r=$)),Ae(a,we,$=>t(1,l=$));let{$$slots:n={},$$scope:o}=e,u=!1;const i=[{href:"/",label:"Dashboard",icon:ct},{href:"/properties",label:"Biens",icon:ze},{href:"/transactions",label:"Transactions",icon:Xe},{href:"/categories",label:"Catégories",icon:Ye},{href:"/calendar",label:"Calendrier",icon:Ze},{href:"/documents",label:"Documents",icon:et},{href:"/fiscal",label:"Export fiscal",icon:tt},{href:"/loans",label:"Prêts",icon:ze},{href:"/import",label:"Import bancaire",icon:rt}],h=[{href:"/users",label:"Utilisateurs",icon:lt},{href:"/profile",label:"Mon profil",icon:nt}];Je(async()=>{if(r.url.pathname==="/login"){t(0,u=!0);return}if(!l)try{const $=await je.auth.me();if($)we.set($);else{ke("/login");return}}catch{ke("/login");return}t(0,u=!0)});async function c(){await je.auth.logout(),we.set(null),We.set(null),ke("/login")}function b($){return r.url.pathname===$}return a.$$set=$=>{"$$scope"in $&&t(7,o=$.$$scope)},a.$$.update=()=>{a.$$.dirty&64&&r.url.pathname==="/login"&&t(0,u=!0)},[u,l,i,h,c,b,r,o,n]}class Ot extends fe{constructor(e){super(),ce(this,e,xt,kt,ie,{})}}export{Ot as component,Ht as universal};
|