From cbc3eb1fd431b7f8ff74273cb20c6701391446e9 Mon Sep 17 00:00:00 2001 From: forevermatt Date: Thu, 4 Jun 2020 20:39:05 -0400 Subject: [PATCH] Rebuild JS bundle to include latest changes --- assets/bundle.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/bundle.js b/assets/bundle.js index ef63fa0..b1c1ead 100644 --- a/assets/bundle.js +++ b/assets/bundle.js @@ -1 +1 @@ -var app=function(){"use strict";function t(){}function n(t){return t()}function e(){return Object.create(null)}function r(t){t.forEach(n)}function o(t){return"function"==typeof t}function u(t,n){return t!=t?n==n:t!==n||t&&"object"==typeof t||"function"==typeof t}function i(n,...e){if(null==n)return t;const r=n.subscribe(...e);return r.unsubscribe?()=>r.unsubscribe():r}function c(t){let n;return i(t,t=>n=t)(),n}function s(t,n,e){t.$$.on_destroy.push(i(n,e))}function a(t,n){t.appendChild(n)}function l(t,n,e){t.insertBefore(n,e||null)}function f(t){t.parentNode.removeChild(t)}function d(t,n){for(let e=0;et.removeEventListener(n,e,r)}function y(t){return function(n){return n.preventDefault(),t.call(this,n)}}function b(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function v(t,n){n=""+n,t.data!==n&&(t.data=n)}function w(t,n){(null!=n||t.value)&&(t.value=n)}function x(t,n,e,r){t.style.setProperty(n,e,r?"important":"")}let E;function k(t){E=t}function _(){if(!E)throw new Error("Function called outside component initialization");return E}function A(t){_().$$.on_mount.push(t)}function C(){const t=_();return(n,e)=>{const r=t.$$.callbacks[n];if(r){const o=function(t,n){const e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,n),e}(n,e);r.slice().forEach(n=>{n.call(t,o)})}}}function O(t,n){const e=t.$$.callbacks[n.type];e&&e.slice().forEach(t=>t(n))}const j=[],N=[],S=[],L=[],D=Promise.resolve();let M=!1;function R(t){S.push(t)}let T=!1;const I=new Set;function P(){if(!T){T=!0;do{for(let t=0;t{V.delete(t),r&&(e&&t.d(1),r())}),t.o(n)}}function z(t){t&&t.c()}function U(t,e,u){const{fragment:i,on_mount:c,on_destroy:s,after_update:a}=t.$$;i&&i.m(e,u),R(()=>{const e=c.map(n).filter(o);s?s.push(...e):r(e),t.$$.on_mount=[]}),a.forEach(R)}function W(t,n){const e=t.$$;null!==e.fragment&&(r(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}function G(t,n){-1===t.$$.dirty[0]&&(j.push(t),M||(M=!0,D.then(P)),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<{const o=r.length?r[0]:e;return p.ctx&&c(p.ctx[t],p.ctx[t]=o)&&(p.bound[t]&&p.bound[t](o),g&&G(n,t)),e}):[],p.update(),g=!0,r(p.before_update),p.fragment=!!i&&i(p.ctx),o.target){if(o.hydrate){const t=function(t){return Array.from(t.childNodes)}(o.target);p.fragment&&p.fragment.l(t),t.forEach(f)}else p.fragment&&p.fragment.c();o.intro&&J(n.$$.fragment),U(n,o.target,o.anchor),P()}k(l)}class Q{$destroy(){W(this,1),this.$destroy=t}$on(t,n){const e=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return e.push(n),()=>{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(){}}const X=(t,n)=>{n.update(n=>[t,...n])},Z=Array.isArray,tt=t=>{const n=nt(t);return Z(n)?n:[]},nt=t=>{const n=localStorage.getItem(t);return JSON.parse(n)},et=(t,n)=>{localStorage.setItem(t,JSON.stringify(n))},rt=[];function ot(t,n){return{subscribe:ut(t,n).subscribe}}function ut(n,e=t){let r;const o=[];function i(t){if(u(n,t)&&(n=t,r)){const t=!rt.length;for(let t=0;t{const t=o.indexOf(s);-1!==t&&o.splice(t,1),0===o.length&&(r(),r=null)}}}}function it(n,e,u){const c=!Array.isArray(n),s=c?[n]:n,a=e.length<2;return ot(u,n=>{let u=!1;const l=[];let f=0,d=t;const p=()=>{if(f)return;d();const r=e(c?l[0]:l,n);a?n(r):d=o(r)?r:t},g=s.map((t,n)=>i(t,t=>{l[n]=t,f&=~(1<{f|=1<pt.set("");function ht(t){let n,e,r,o,u;return{c(){n=p("div"),e=p("button"),e.innerHTML='',r=h(),o=g(t[0]),b(e,"type","button"),b(e,"class","close"),b(e,"aria-label","Close"),b(n,"class","alert alert-danger keep-line-breaks svelte-byhjk5"),b(n,"role","alert")},m(t,i,c){l(t,n,i),a(n,e),a(n,r),a(n,o),c&&u(),u=$(e,"click",gt)},p(t,n){1&n&&v(o,t[0])},d(t){t&&f(n),u()}}}function mt(n){let e,r=n[0]&&ht(n);return{c(){r&&r.c(),e=m()},m(t,n){r&&r.m(t,n),l(t,e,n)},p(t,[n]){t[0]?r?r.p(t,n):(r=ht(t),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},i:t,o:t,d(t){r&&r.d(t),t&&f(e)}}}function $t(t,n,e){let r;return s(t,pt,t=>e(0,r=t)),[r]}window.onunhandledrejection=t=>{let n=t.reason;pt.set(n.message)};class yt extends Q{constructor(t){super(),K(this,t,$t,mt,u,{})}}const bt=ut([]),vt=()=>et("accounts",c(bt)),wt=ut([]),xt=(t,n)=>n.find(n=>n.uuid===t)||{},Et=()=>et("categories",c(wt)),kt=(t,n)=>{((t,n,e,r)=>{r.update(r=>{const o=r.find(e=>e[t]===n),u=Object.assign({},o,e);let i=!1;for(let e=0;e{var e=n.getFullYear(),r=n.getMonth(),o=new Date(e,r-t),u=o.getFullYear(),i=o.getMonth()+1;return u+"-"+String("0"+i).slice(-2)},At=ut({}),Ct=()=>{At.set((t=>{const n=nt(t);return null!==n?n:{}})("budget"))},Ot=(t,n)=>{c(At);(t=>c(At).hasOwnProperty(t))(t)?Nt(t,n):((t,n)=>{jt(t,{budgeted:n,remaining:n,refilled:_t(0,new Date)})})(t,n)},jt=(t,n)=>{((t,n,e)=>{e.update(e=>(e.hasOwnProperty(t)?e[t]=Object.assign(e[t],n):e[t]=n,e))})(t,n,At),et("budget",c(At))},Nt=(t,n)=>{let e=c(At)[t],r=e.budgeted,o=e.remaining;jt(t,{budgeted:n,remaining:o+(n-r)})};function St(t){let n,e;var r=t[0];if(r){var o=new r({});o.$on("routeEvent",t[10])}return{c(){o&&z(o.$$.fragment),n=m()},m(t,r){o&&U(o,t,r),l(t,n,r),e=!0},p(t,e){if(r!==(r=t[0])){if(o){F();const t=o;Y(t.$$.fragment,1,0,()=>{W(t,1)}),B()}r?((o=new r({})).$on("routeEvent",t[10]),z(o.$$.fragment),J(o.$$.fragment,1),U(o,n.parentNode,n)):o=null}},i(t){e||(o&&J(o.$$.fragment,t),e=!0)},o(t){o&&Y(o.$$.fragment,t),e=!1},d(t){t&&f(n),o&&W(o,t)}}}function Lt(t){let n,e;var r=t[0];function o(t){return{props:{params:t[1]}}}if(r){var u=new r(o(t));u.$on("routeEvent",t[9])}return{c(){u&&z(u.$$.fragment),n=m()},m(t,r){u&&U(u,t,r),l(t,n,r),e=!0},p(t,e){const i={};if(2&e&&(i.params=t[1]),r!==(r=t[0])){if(u){F();const t=u;Y(t.$$.fragment,1,0,()=>{W(t,1)}),B()}r?((u=new r(o(t))).$on("routeEvent",t[9]),z(u.$$.fragment),J(u.$$.fragment,1),U(u,n.parentNode,n)):u=null}else r&&u.$set(i)},i(t){e||(u&&J(u.$$.fragment,t),e=!0)},o(t){u&&Y(u.$$.fragment,t),e=!1},d(t){t&&f(n),u&&W(u,t)}}}function Dt(t){let n,e,r,o;const u=[Lt,St],i=[];function c(t,n){return t[1]?0:1}return n=c(t),e=i[n]=u[n](t),{c(){e.c(),r=m()},m(t,e){i[n].m(t,e),l(t,r,e),o=!0},p(t,[o]){let s=n;n=c(t),n===s?i[n].p(t,o):(F(),Y(i[s],1,1,()=>{i[s]=null}),B(),e=i[n],e||(e=i[n]=u[n](t),e.c()),J(e,1),e.m(r.parentNode,r))},i(t){o||(J(e),o=!0)},o(t){Y(e),o=!1},d(t){i[n].d(t),t&&f(r)}}}function Mt(){const t=window.location.href.indexOf("#/");let n=t>-1?window.location.href.substr(t+1):"/";const e=n.indexOf("?");let r="";return e>-1&&(r=n.substr(e+1),n=n.substr(0,e)),{location:n,querystring:r}}const Rt=ot(Mt(),(function(t){const n=()=>{t(Mt())};return window.addEventListener("hashchange",n,!1),function(){window.removeEventListener("hashchange",n,!1)}}));it(Rt,t=>t.location),it(Rt,t=>t.querystring);function Tt(t){if(!t||t.length<1||"/"!=t.charAt(0)&&0!==t.indexOf("#/"))throw Error("Invalid parameter location");return It(()=>{window.location.hash=("#"==t.charAt(0)?"":"#")+t})}function It(t){return new Promise(n=>{setTimeout(()=>{n(t())},0)})}function Pt(n,e,r){let o,u=t;s(n,Rt,t=>r(4,o=t)),n.$$.on_destroy.push(()=>u());let{routes:i={}}=e,{prefix:c=""}=e;class a{constructor(t,n){if(!n||"function"!=typeof n&&("object"!=typeof n||!0!==n._sveltesparouter))throw Error("Invalid component object");if(!t||"string"==typeof t&&(t.length<1||"/"!=t.charAt(0)&&"*"!=t.charAt(0))||"object"==typeof t&&!(t instanceof RegExp))throw Error('Invalid value for "path" argument');const{pattern:e,keys:r}=function(t,n){if(t instanceof RegExp)return{keys:!1,pattern:t};var e,r,o,u,i=[],c="",s=t.split("/");for(s[0]||s.shift();o=s.shift();)"*"===(e=o[0])?(i.push("wild"),c+="/(.*)"):":"===e?(r=o.indexOf("?",1),u=o.indexOf(".",1),i.push(o.substring(1,~r?r:~u?u:o.length)),c+=~r&&!~u?"(?:/([^/]+?))?":"/([^/]+?)",~u&&(c+=(~r?"?":"")+"\\"+o.substring(u))):c+="/"+o;return{keys:i,pattern:new RegExp("^"+c+(n?"(?=$|/)":"/?$"),"i")}}(t);this.path=t,"object"==typeof n&&!0===n._sveltesparouter?(this.component=n.route,this.conditions=n.conditions||[],this.userData=n.userData):(this.component=n,this.conditions=[],this.userData=void 0),this._pattern=e,this._keys=r}match(t){c&&t.startsWith(c)&&(t=t.substr(c.length)||"/");const n=this._pattern.exec(t);if(null===n)return null;if(!1===this._keys)return n;const e={};let r=0;for(;r{l.push(new a(n,t))}):Object.keys(i).forEach(t=>{l.push(new a(t,i[t]))});let f=null,d=null;const p=C(),g=(t,n)=>{setTimeout(()=>{p(t,n)},0)};return n.$set=t=>{"routes"in t&&r(2,i=t.routes),"prefix"in t&&r(3,c=t.prefix)},n.$$.update=()=>{if(17&n.$$.dirty){r(0,f=null);let t=0;for(;!f&&t{const n={uuid:dt(),name:t};X(n,bt),vt()})(r),Tt("/accounts")},function(){r=this.value,e(0,r)}]}function Ft(t,n,e){const r=t.slice();return r[1]=n[e],r}function Bt(t){let n,e,r=t[1].name+"";return{c(){n=p("li"),e=g(r)},m(t,r){l(t,n,r),a(n,e)},p(t,n){1&n&&r!==(r=t[1].name+"")&&v(e,r)},d(t){t&&f(n)}}}function Jt(n){let e,r,o,u,i,c,s,a=n[0],g=[];for(let t=0;tAdd new account',c=h(),s=p("p"),s.innerHTML='Budget'},m(t,n){l(t,e,n),l(t,r,n),l(t,o,n);for(let t=0;te(0,r=t)),[r]}const zt=t=>Kt(t)?"danger":"",Ut=t=>Gt(t,2),Wt=t=>Gt(t,0),Gt=(t,n)=>(null==t&&(t=0),(Number(t)/100).toFixed(n)),Kt=t=>t&&t<0;function Qt(n){let e,r,o,u;return{c(){e=p("div"),r=p("div"),b(r,"class",o="category-graph-line "+n[2](n[1],n[0])+" svelte-6b2uyp"),x(r,"width",n[3](n[1],n[0])+"%"),b(e,"class",u="category-graph "+zt(n[1])+" svelte-6b2uyp")},m(t,n){l(t,e,n),a(e,r)},p(t,[n]){3&n&&o!==(o="category-graph-line "+t[2](t[1],t[0])+" svelte-6b2uyp")&&b(r,"class",o),3&n&&x(r,"width",t[3](t[1],t[0])+"%"),2&n&&u!==(u="category-graph "+zt(t[1])+" svelte-6b2uyp")&&b(e,"class",u)},i:t,o:t,d(t){t&&f(e)}}}function Xt(t,n,e){let{budgeted:r}=n,{remaining:o}=n;return t.$set=t=>{"budgeted"in t&&e(0,r=t.budgeted),"remaining"in t&&e(1,o=t.remaining)},[r,o,(t,n)=>null==t?"":t<0?"danger":tt<0?0:0===n?t>0?100:0:t/n*100]}class Zt extends Q{constructor(t){super(),K(this,t,Xt,Qt,u,{budgeted:0,remaining:1})}}function tn(t,n,e){const r=t.slice();return r[3]=n[e].budgeted,r[4]=n[e].remaining,r[5]=n[e].name,r[6]=n[e].uuid,r}function nn(t){let n,e,r,o,u,i,c,s,d,m,$,y,w,x,E,k,_,A,C,O,j=t[5]+"",N=Ut(t[4])+"",S=Wt(t[3])+"";const L=new Zt({props:{budgeted:t[3],remaining:t[4]}});return{c(){n=p("tr"),e=p("td"),r=p("a"),o=g(j),i=h(),c=p("td"),z(L.$$.fragment),s=h(),d=p("td"),m=p("div"),$=p("sup"),$.textContent="$",y=g(N),x=h(),E=p("div"),k=p("span"),_=g("/ "),A=g(S),C=h(),b(r,"href",u="#/category/"+t[6]),b(r,"class","btn btn-outline-secondary"),b(e,"class","category-name width-10 svelte-1g8xb6x"),b(c,"class","width-80 svelte-1g8xb6x"),b($,"class","svelte-1g8xb6x"),b(m,"class",w="category-available "+zt(t[4])+" svelte-1g8xb6x"),b(E,"class","category-budgeted svelte-1g8xb6x"),b(d,"class","category-amount width-10 svelte-1g8xb6x")},m(t,u){l(t,n,u),a(n,e),a(e,r),a(r,o),a(n,i),a(n,c),U(L,c,null),a(n,s),a(n,d),a(d,m),a(m,$),a(m,y),a(d,x),a(d,E),a(E,k),a(k,_),a(k,A),a(n,C),O=!0},p(t,n){(!O||1&n)&&j!==(j=t[5]+"")&&v(o,j),(!O||1&n&&u!==(u="#/category/"+t[6]))&&b(r,"href",u);const e={};1&n&&(e.budgeted=t[3]),1&n&&(e.remaining=t[4]),L.$set(e),(!O||1&n)&&N!==(N=Ut(t[4])+"")&&v(y,N),(!O||1&n&&w!==(w="category-available "+zt(t[4])+" svelte-1g8xb6x"))&&b(m,"class",w),(!O||1&n)&&S!==(S=Wt(t[3])+"")&&v(A,S)},i(t){O||(J(L.$$.fragment,t),O=!0)},o(t){Y(L.$$.fragment,t),O=!1},d(t){t&&f(n),W(L)}}}function en(t){let n,e,r,o=t[0],u=[];for(let n=0;nY(u[t],1,1,()=>{u[t]=null});return{c(){n=p("table"),e=p("tbody");for(let t=0;te(1,r=t)),s(t,wt,t=>e(2,o=t)),t.$$.update=()=>{6&t.$$.dirty&&e(0,u=((t,n)=>{let e=[];for(var r in t)if(t.hasOwnProperty(r)){let o=xt(r,n);e.push({budgeted:t[r].budgeted,remaining:t[r].remaining,name:o.name,uuid:o.uuid})}return e.sort((t,n)=>(t.name||"").localeCompare(n.name||""))})(r,o))},[u]}class on extends Q{constructor(t){super(),K(this,t,rn,en,u,{})}}function un(n){let e,r,o,u,i,c,s;const a=new on({});return{c(){e=p("h2"),e.textContent="Budget",r=h(),z(a.$$.fragment),o=h(),u=p("p"),u.innerHTML='Add new category',i=h(),c=p("p"),c.innerHTML='Accounts'},m(t,n){l(t,e,n),l(t,r,n),U(a,t,n),l(t,o,n),l(t,u,n),l(t,i,n),l(t,c,n),s=!0},p:t,i(t){s||(J(a.$$.fragment,t),s=!0)},o(t){Y(a.$$.fragment,t),s=!1},d(t){t&&f(e),t&&f(r),W(a,t),t&&f(o),t&&f(u),t&&f(i),t&&f(c)}}}function cn(n){let e,o,u,i,c,s;return{c(){e=p("form"),o=p("div"),u=p("div"),u.innerHTML='$',i=h(),c=p("input"),b(u,"class","input-group-prepend"),b(c,"type","tel"),b(c,"aria-describedby","amount-input-currency-symbol"),b(c,"aria-label","Amount"),b(c,"class","text-right form-control"),b(o,"class","input-group input-group-lg"),e.noValidate=!0},m(t,f,d){l(t,e,f),a(e,o),a(o,u),a(o,i),a(o,c),n[9](c),d&&r(s),s=[$(c,"keydown",n[1]),$(e,"submit",y(n[2]))]},p:t,i:t,o:t,d(t){t&&f(e),n[9](null),r(s)}}}function sn(t,n,e){let{amount:r}=n;const o=C();let u,i=[],c=null;function s(t){for(var n="",r=0;r{var t;i=(t=r)?String(t).split("").filter((function(t){return"0123456789".indexOf(t)>=0})):[],s(i),a(Number(i.join(""))),u.focus()}),t.$set=t=>{"amount"in t&&e(3,r=t.amount)},[u,function(t){var n=t.which;(t=>t>=32&&t<112||t>=123&&t<127||t>=186)(n)&&t.preventDefault();var e=(t=>t>=48&&t<58?String(t-48):t>=96&&t<106?String(t-96):"")(n);e?i.push(e):(t=>8===t)(n)&&(t.preventDefault(),i.pop()),s(i),a(Number(i.join("")))},function(t){o("next",c)},r,i,c,o,s,a,function(t){N[t?"unshift":"push"](()=>{e(0,u=t)})}]}class an extends Q{constructor(t){super(),K(this,t,sn,cn,u,{amount:3})}}function ln(t){let n,e,r,o,u,i=t[0].name+"";const c=new an({props:{amount:t[1]}});return c.$on("next",t[2]),{c(){n=p("h2"),e=g("Amount for "),r=g(i),o=h(),z(c.$$.fragment)},m(t,i){l(t,n,i),a(n,e),a(n,r),l(t,o,i),U(c,t,i),u=!0},p(t,[n]){(!u||1&n)&&i!==(i=t[0].name+"")&&v(r,i);const e={};2&n&&(e.amount=t[1]),c.$set(e)},i(t){u||(J(c.$$.fragment,t),u=!0)},o(t){Y(c.$$.fragment,t),u=!1},d(t){t&&f(n),t&&f(o),W(c,t)}}}function fn(t,n,e){let r;s(t,wt,t=>e(5,r=t));let o,u,i,{params:c}=n;return t.$set=t=>{"params"in t&&e(3,c=t.params)},t.$$.update=()=>{8&t.$$.dirty&&e(4,o=c.uuid),48&t.$$.dirty&&e(0,u=r.find(t=>t.uuid===o)||{}),1&t.$$.dirty&&e(1,i=u.amount||0)},[u,i,function(t){let n=t.detail;Ot(o,n),Tt("/budget")},c]}function dn(n){let e,o,u,i,c;return{c(){e=p("h2"),e.textContent="New Category",o=h(),u=p("form"),i=p("input"),b(i,"class","form-control"),b(i,"placeholder","New category name")},m(t,s,f){l(t,e,s),l(t,o,s),l(t,u,s),a(u,i),w(i,n[0]),f&&r(c),c=[$(i,"input",n[2]),$(u,"submit",y(n[1]))]},p(t,[n]){1&n&&i.value!==t[0]&&w(i,t[0])},i:t,o:t,d(t){t&&f(e),t&&f(o),t&&f(u),r(c)}}}function pn(t,n,e){let r="";return[r,function(){Tt(`/category/${(t=>{const n=c(wt).find(n=>n.name===t);if(n)return n;{const n={uuid:dt(),name:t};return X(n,wt),Et(),n}})(r).uuid}/amount`)},function(){r=this.value,e(0,r)}]}function gn(n){let e,r,o,u,i,c,s,d,m,y,w,x,E,k=n[1].name+"",_=Ut(n[1].amount)+"";return{c(){e=p("h2"),r=p("b"),o=g(k),u=g(":"),i=h(),c=p("a"),s=p("sup"),s.textContent="$",d=h(),m=g(_),w=h(),x=p("hr"),b(r,"class","editable svelte-1uc4ts5"),b(r,"title","(Click to rename)"),b(c,"class","btn btn-default"),b(c,"href",y="#/category/"+n[0]+"/amount"),b(x,"class","small")},m(t,f,p){l(t,e,f),a(e,r),a(r,o),a(r,u),a(e,i),a(e,c),a(c,s),a(c,d),a(c,m),l(t,w,f),l(t,x,f),p&&E(),E=$(r,"click",n[2])},p(t,[n]){2&n&&k!==(k=t[1].name+"")&&v(o,k),2&n&&_!==(_=Ut(t[1].amount)+"")&&v(m,_),1&n&&y!==(y="#/category/"+t[0]+"/amount")&&b(c,"href",y)},i:t,o:t,d(t){t&&f(e),t&&f(w),t&&f(x),E()}}}function hn(t,n,e){let r;s(t,wt,t=>e(4,r=t));let{params:o={}}=n;let u,i;return t.$set=t=>{"params"in t&&e(3,o=t.params)},t.$$.update=()=>{8&t.$$.dirty&&e(0,u=o.uuid||""),17&t.$$.dirty&&e(1,i=r.find(t=>t.uuid===u)||{})},[u,i,()=>{var t=prompt("Edit category name:",i.name);null!=t&&kt(u,{name:t})},o]}function mn(t){return function(t){if(!t||t.length<1||"/"!=t.charAt(0)&&0!==t.indexOf("#/"))throw Error("Invalid parameter location");It(()=>{const n=("#"==t.charAt(0)?"":"#")+t;try{window.history.replaceState(void 0,void 0,n)}catch(t){console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))})}("/budget"),[]}const $n={"/":class extends Q{constructor(t){super(),K(this,t,mn,null,u,{})}},"/account/new":class extends Q{constructor(t){super(),K(this,t,qt,Vt,u,{})}},"/accounts":class extends Q{constructor(t){super(),K(this,t,Yt,Jt,u,{})}},"/budget":class extends Q{constructor(t){super(),K(this,t,null,un,u,{})}},"/category/new":class extends Q{constructor(t){super(),K(this,t,pn,dn,u,{})}},"/category/:uuid":class extends Q{constructor(t){super(),K(this,t,hn,gn,u,{params:3})}},"/category/:uuid/amount":class extends Q{constructor(t){super(),K(this,t,fn,ln,u,{params:3})}}};function yn(n){let e,r,o;const u=new yt({}),i=new Ht({props:{routes:$n}});return{c(){e=p("div"),z(u.$$.fragment),r=h(),z(i.$$.fragment),b(e,"class","container my-3")},m(t,n){l(t,e,n),U(u,e,null),a(e,r),U(i,e,null),o=!0},p:t,i(t){o||(J(u.$$.fragment,t),J(i.$$.fragment,t),o=!0)},o(t){Y(u.$$.fragment,t),Y(i.$$.fragment,t),o=!1},d(t){t&&f(e),W(u),W(i)}}}function bn(t){return A(async()=>{bt.set(tt("accounts")),wt.set(tt("categories")),Ct()}),[]}return new class extends Q{constructor(t){super(),K(this,t,bn,yn,u,{})}}({target:document.body})}(); +var app=function(){"use strict";function t(){}function n(t){return t()}function e(){return Object.create(null)}function r(t){t.forEach(n)}function o(t){return"function"==typeof t}function u(t,n){return t!=t?n==n:t!==n||t&&"object"==typeof t||"function"==typeof t}function i(n,...e){if(null==n)return t;const r=n.subscribe(...e);return r.unsubscribe?()=>r.unsubscribe():r}function c(t){let n;return i(t,t=>n=t)(),n}function s(t,n,e){t.$$.on_destroy.push(i(n,e))}function a(t,n){t.appendChild(n)}function l(t,n,e){t.insertBefore(n,e||null)}function f(t){t.parentNode.removeChild(t)}function d(t,n){for(let e=0;et.removeEventListener(n,e,r)}function y(t){return function(n){return n.preventDefault(),t.call(this,n)}}function b(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function v(t,n){n=""+n,t.data!==n&&(t.data=n)}function w(t,n){(null!=n||t.value)&&(t.value=n)}function x(t,n,e,r){t.style.setProperty(n,e,r?"important":"")}let E;function k(t){E=t}function _(){if(!E)throw new Error("Function called outside component initialization");return E}function A(t){_().$$.on_mount.push(t)}function C(){const t=_();return(n,e)=>{const r=t.$$.callbacks[n];if(r){const o=function(t,n){const e=document.createEvent("CustomEvent");return e.initCustomEvent(t,!1,!1,n),e}(n,e);r.slice().forEach(n=>{n.call(t,o)})}}}function O(t,n){const e=t.$$.callbacks[n.type];e&&e.slice().forEach(t=>t(n))}const j=[],N=[],S=[],L=[],D=Promise.resolve();let M=!1;function R(t){S.push(t)}let T=!1;const I=new Set;function P(){if(!T){T=!0;do{for(let t=0;t{V.delete(t),r&&(e&&t.d(1),r())}),t.o(n)}}function z(t){t&&t.c()}function U(t,e,u){const{fragment:i,on_mount:c,on_destroy:s,after_update:a}=t.$$;i&&i.m(e,u),R(()=>{const e=c.map(n).filter(o);s?s.push(...e):r(e),t.$$.on_mount=[]}),a.forEach(R)}function W(t,n){const e=t.$$;null!==e.fragment&&(r(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}function G(t,n){-1===t.$$.dirty[0]&&(j.push(t),M||(M=!0,D.then(P)),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<{const o=r.length?r[0]:e;return p.ctx&&c(p.ctx[t],p.ctx[t]=o)&&(p.bound[t]&&p.bound[t](o),g&&G(n,t)),e}):[],p.update(),g=!0,r(p.before_update),p.fragment=!!i&&i(p.ctx),o.target){if(o.hydrate){const t=function(t){return Array.from(t.childNodes)}(o.target);p.fragment&&p.fragment.l(t),t.forEach(f)}else p.fragment&&p.fragment.c();o.intro&&J(n.$$.fragment),U(n,o.target,o.anchor),P()}k(l)}class Q{$destroy(){W(this,1),this.$destroy=t}$on(t,n){const e=this.$$.callbacks[t]||(this.$$.callbacks[t]=[]);return e.push(n),()=>{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(){}}const X=(t,n)=>{n.update(n=>[t,...n])},Z=Array.isArray,tt=t=>{const n=nt(t);return Z(n)?n:[]},nt=t=>{const n=localStorage.getItem(t);return JSON.parse(n)},et=(t,n)=>{localStorage.setItem(t,JSON.stringify(n))},rt=[];function ot(t,n){return{subscribe:ut(t,n).subscribe}}function ut(n,e=t){let r;const o=[];function i(t){if(u(n,t)&&(n=t,r)){const t=!rt.length;for(let t=0;t{const t=o.indexOf(s);-1!==t&&o.splice(t,1),0===o.length&&(r(),r=null)}}}}function it(n,e,u){const c=!Array.isArray(n),s=c?[n]:n,a=e.length<2;return ot(u,n=>{let u=!1;const l=[];let f=0,d=t;const p=()=>{if(f)return;d();const r=e(c?l[0]:l,n);a?n(r):d=o(r)?r:t},g=s.map((t,n)=>i(t,t=>{l[n]=t,f&=~(1<{f|=1<pt.set("");function ht(t){let n,e,r,o,u;return{c(){n=p("div"),e=p("button"),e.innerHTML='',r=h(),o=g(t[0]),b(e,"type","button"),b(e,"class","close"),b(e,"aria-label","Close"),b(n,"class","alert alert-danger keep-line-breaks svelte-byhjk5"),b(n,"role","alert")},m(t,i,c){l(t,n,i),a(n,e),a(n,r),a(n,o),c&&u(),u=$(e,"click",gt)},p(t,n){1&n&&v(o,t[0])},d(t){t&&f(n),u()}}}function mt(n){let e,r=n[0]&&ht(n);return{c(){r&&r.c(),e=m()},m(t,n){r&&r.m(t,n),l(t,e,n)},p(t,[n]){t[0]?r?r.p(t,n):(r=ht(t),r.c(),r.m(e.parentNode,e)):r&&(r.d(1),r=null)},i:t,o:t,d(t){r&&r.d(t),t&&f(e)}}}function $t(t,n,e){let r;return s(t,pt,t=>e(0,r=t)),[r]}window.onunhandledrejection=t=>{let n=t.reason;pt.set(n.message)};class yt extends Q{constructor(t){super(),K(this,t,$t,mt,u,{})}}const bt=ut([]),vt=()=>et("accounts",c(bt)),wt=ut([]),xt=(t,n)=>n.find(n=>n.uuid===t)||{},Et=()=>et("categories",c(wt)),kt=(t,n)=>{((t,n,e,r)=>{r.update(r=>{const o=r.find(e=>e[t]===n),u=Object.assign({},o,e);let i=!1;for(let e=0;e{var e=n.getFullYear(),r=n.getMonth(),o=new Date(e,r-t),u=o.getFullYear(),i=o.getMonth()+1;return u+"-"+String("0"+i).slice(-2)},At=ut({}),Ct=t=>(c(At)[t]||{}).budgeted||0,Ot=()=>{At.set((t=>{const n=nt(t);return null!==n?n:{}})("budget"))},jt=(t,n)=>{c(At);(t=>c(At).hasOwnProperty(t))(t)?St(t,n):((t,n)=>{Nt(t,{budgeted:n,remaining:n,refilled:_t(0,new Date)})})(t,n)},Nt=(t,n)=>{((t,n,e)=>{e.update(e=>(e.hasOwnProperty(t)?e[t]=Object.assign(e[t],n):e[t]=n,e))})(t,n,At),et("budget",c(At))},St=(t,n)=>{let e=c(At)[t],r=e.budgeted,o=e.remaining;Nt(t,{budgeted:n,remaining:o+(n-r)})};function Lt(t){let n,e;var r=t[0];if(r){var o=new r({});o.$on("routeEvent",t[10])}return{c(){o&&z(o.$$.fragment),n=m()},m(t,r){o&&U(o,t,r),l(t,n,r),e=!0},p(t,e){if(r!==(r=t[0])){if(o){F();const t=o;Y(t.$$.fragment,1,0,()=>{W(t,1)}),B()}r?((o=new r({})).$on("routeEvent",t[10]),z(o.$$.fragment),J(o.$$.fragment,1),U(o,n.parentNode,n)):o=null}},i(t){e||(o&&J(o.$$.fragment,t),e=!0)},o(t){o&&Y(o.$$.fragment,t),e=!1},d(t){t&&f(n),o&&W(o,t)}}}function Dt(t){let n,e;var r=t[0];function o(t){return{props:{params:t[1]}}}if(r){var u=new r(o(t));u.$on("routeEvent",t[9])}return{c(){u&&z(u.$$.fragment),n=m()},m(t,r){u&&U(u,t,r),l(t,n,r),e=!0},p(t,e){const i={};if(2&e&&(i.params=t[1]),r!==(r=t[0])){if(u){F();const t=u;Y(t.$$.fragment,1,0,()=>{W(t,1)}),B()}r?((u=new r(o(t))).$on("routeEvent",t[9]),z(u.$$.fragment),J(u.$$.fragment,1),U(u,n.parentNode,n)):u=null}else r&&u.$set(i)},i(t){e||(u&&J(u.$$.fragment,t),e=!0)},o(t){u&&Y(u.$$.fragment,t),e=!1},d(t){t&&f(n),u&&W(u,t)}}}function Mt(t){let n,e,r,o;const u=[Dt,Lt],i=[];function c(t,n){return t[1]?0:1}return n=c(t),e=i[n]=u[n](t),{c(){e.c(),r=m()},m(t,e){i[n].m(t,e),l(t,r,e),o=!0},p(t,[o]){let s=n;n=c(t),n===s?i[n].p(t,o):(F(),Y(i[s],1,1,()=>{i[s]=null}),B(),e=i[n],e||(e=i[n]=u[n](t),e.c()),J(e,1),e.m(r.parentNode,r))},i(t){o||(J(e),o=!0)},o(t){Y(e),o=!1},d(t){i[n].d(t),t&&f(r)}}}function Rt(){const t=window.location.href.indexOf("#/");let n=t>-1?window.location.href.substr(t+1):"/";const e=n.indexOf("?");let r="";return e>-1&&(r=n.substr(e+1),n=n.substr(0,e)),{location:n,querystring:r}}const Tt=ot(Rt(),(function(t){const n=()=>{t(Rt())};return window.addEventListener("hashchange",n,!1),function(){window.removeEventListener("hashchange",n,!1)}}));it(Tt,t=>t.location),it(Tt,t=>t.querystring);function It(t){if(!t||t.length<1||"/"!=t.charAt(0)&&0!==t.indexOf("#/"))throw Error("Invalid parameter location");return Pt(()=>{window.location.hash=("#"==t.charAt(0)?"":"#")+t})}function Pt(t){return new Promise(n=>{setTimeout(()=>{n(t())},0)})}function Ht(n,e,r){let o,u=t;s(n,Tt,t=>r(4,o=t)),n.$$.on_destroy.push(()=>u());let{routes:i={}}=e,{prefix:c=""}=e;class a{constructor(t,n){if(!n||"function"!=typeof n&&("object"!=typeof n||!0!==n._sveltesparouter))throw Error("Invalid component object");if(!t||"string"==typeof t&&(t.length<1||"/"!=t.charAt(0)&&"*"!=t.charAt(0))||"object"==typeof t&&!(t instanceof RegExp))throw Error('Invalid value for "path" argument');const{pattern:e,keys:r}=function(t,n){if(t instanceof RegExp)return{keys:!1,pattern:t};var e,r,o,u,i=[],c="",s=t.split("/");for(s[0]||s.shift();o=s.shift();)"*"===(e=o[0])?(i.push("wild"),c+="/(.*)"):":"===e?(r=o.indexOf("?",1),u=o.indexOf(".",1),i.push(o.substring(1,~r?r:~u?u:o.length)),c+=~r&&!~u?"(?:/([^/]+?))?":"/([^/]+?)",~u&&(c+=(~r?"?":"")+"\\"+o.substring(u))):c+="/"+o;return{keys:i,pattern:new RegExp("^"+c+(n?"(?=$|/)":"/?$"),"i")}}(t);this.path=t,"object"==typeof n&&!0===n._sveltesparouter?(this.component=n.route,this.conditions=n.conditions||[],this.userData=n.userData):(this.component=n,this.conditions=[],this.userData=void 0),this._pattern=e,this._keys=r}match(t){c&&t.startsWith(c)&&(t=t.substr(c.length)||"/");const n=this._pattern.exec(t);if(null===n)return null;if(!1===this._keys)return n;const e={};let r=0;for(;r{l.push(new a(n,t))}):Object.keys(i).forEach(t=>{l.push(new a(t,i[t]))});let f=null,d=null;const p=C(),g=(t,n)=>{setTimeout(()=>{p(t,n)},0)};return n.$set=t=>{"routes"in t&&r(2,i=t.routes),"prefix"in t&&r(3,c=t.prefix)},n.$$.update=()=>{if(17&n.$$.dirty){r(0,f=null);let t=0;for(;!f&&t{const n={uuid:dt(),name:t};X(n,bt),vt()})(r),It("/accounts")},function(){r=this.value,e(0,r)}]}function Bt(t,n,e){const r=t.slice();return r[1]=n[e],r}function Jt(t){let n,e,r=t[1].name+"";return{c(){n=p("li"),e=g(r)},m(t,r){l(t,n,r),a(n,e)},p(t,n){1&n&&r!==(r=t[1].name+"")&&v(e,r)},d(t){t&&f(n)}}}function Yt(n){let e,r,o,u,i,c,s,a=n[0],g=[];for(let t=0;tAdd new account',c=h(),s=p("p"),s.innerHTML='Budget'},m(t,n){l(t,e,n),l(t,r,n),l(t,o,n);for(let t=0;te(0,r=t)),[r]}const Ut=t=>Qt(t)?"danger":"",Wt=t=>Kt(t,2),Gt=t=>Kt(t,0),Kt=(t,n)=>(null==t&&(t=0),(Number(t)/100).toFixed(n)),Qt=t=>t&&t<0;function Xt(n){let e,r,o,u;return{c(){e=p("div"),r=p("div"),b(r,"class",o="category-graph-line "+n[2](n[1],n[0])+" svelte-6b2uyp"),x(r,"width",n[3](n[1],n[0])+"%"),b(e,"class",u="category-graph "+Ut(n[1])+" svelte-6b2uyp")},m(t,n){l(t,e,n),a(e,r)},p(t,[n]){3&n&&o!==(o="category-graph-line "+t[2](t[1],t[0])+" svelte-6b2uyp")&&b(r,"class",o),3&n&&x(r,"width",t[3](t[1],t[0])+"%"),2&n&&u!==(u="category-graph "+Ut(t[1])+" svelte-6b2uyp")&&b(e,"class",u)},i:t,o:t,d(t){t&&f(e)}}}function Zt(t,n,e){let{budgeted:r}=n,{remaining:o}=n;return t.$set=t=>{"budgeted"in t&&e(0,r=t.budgeted),"remaining"in t&&e(1,o=t.remaining)},[r,o,(t,n)=>null==t?"":t<0?"danger":tt<0?0:0===n?t>0?100:0:t/n*100]}class tn extends Q{constructor(t){super(),K(this,t,Zt,Xt,u,{budgeted:0,remaining:1})}}function nn(t,n,e){const r=t.slice();return r[3]=n[e].budgeted,r[4]=n[e].remaining,r[5]=n[e].name,r[6]=n[e].uuid,r}function en(t){let n,e,r,o,u,i,c,s,d,m,$,y,w,x,E,k,_,A,C,O,j=t[5]+"",N=Wt(t[4])+"",S=Gt(t[3])+"";const L=new tn({props:{budgeted:t[3],remaining:t[4]}});return{c(){n=p("tr"),e=p("td"),r=p("a"),o=g(j),i=h(),c=p("td"),z(L.$$.fragment),s=h(),d=p("td"),m=p("div"),$=p("sup"),$.textContent="$",y=g(N),x=h(),E=p("div"),k=p("span"),_=g("/ "),A=g(S),C=h(),b(r,"href",u="#/category/"+t[6]),b(r,"class","btn btn-outline-secondary"),b(e,"class","category-name width-10 svelte-1g8xb6x"),b(c,"class","width-80 svelte-1g8xb6x"),b($,"class","svelte-1g8xb6x"),b(m,"class",w="category-available "+Ut(t[4])+" svelte-1g8xb6x"),b(E,"class","category-budgeted svelte-1g8xb6x"),b(d,"class","category-amount width-10 svelte-1g8xb6x")},m(t,u){l(t,n,u),a(n,e),a(e,r),a(r,o),a(n,i),a(n,c),U(L,c,null),a(n,s),a(n,d),a(d,m),a(m,$),a(m,y),a(d,x),a(d,E),a(E,k),a(k,_),a(k,A),a(n,C),O=!0},p(t,n){(!O||1&n)&&j!==(j=t[5]+"")&&v(o,j),(!O||1&n&&u!==(u="#/category/"+t[6]))&&b(r,"href",u);const e={};1&n&&(e.budgeted=t[3]),1&n&&(e.remaining=t[4]),L.$set(e),(!O||1&n)&&N!==(N=Wt(t[4])+"")&&v(y,N),(!O||1&n&&w!==(w="category-available "+Ut(t[4])+" svelte-1g8xb6x"))&&b(m,"class",w),(!O||1&n)&&S!==(S=Gt(t[3])+"")&&v(A,S)},i(t){O||(J(L.$$.fragment,t),O=!0)},o(t){Y(L.$$.fragment,t),O=!1},d(t){t&&f(n),W(L)}}}function rn(t){let n,e,r,o=t[0],u=[];for(let n=0;nY(u[t],1,1,()=>{u[t]=null});return{c(){n=p("table"),e=p("tbody");for(let t=0;te(1,r=t)),s(t,wt,t=>e(2,o=t)),t.$$.update=()=>{6&t.$$.dirty&&e(0,u=((t,n)=>{let e=[];for(var r in t)if(t.hasOwnProperty(r)){let o=xt(r,n);e.push({budgeted:t[r].budgeted,remaining:t[r].remaining,name:o.name,uuid:o.uuid})}return e.sort((t,n)=>(t.name||"").localeCompare(n.name||""))})(r,o))},[u]}class un extends Q{constructor(t){super(),K(this,t,on,rn,u,{})}}function cn(n){let e,r,o,u,i,c,s;const a=new un({});return{c(){e=p("h2"),e.textContent="Budget",r=h(),z(a.$$.fragment),o=h(),u=p("p"),u.innerHTML='Add new category',i=h(),c=p("p"),c.innerHTML='Accounts'},m(t,n){l(t,e,n),l(t,r,n),U(a,t,n),l(t,o,n),l(t,u,n),l(t,i,n),l(t,c,n),s=!0},p:t,i(t){s||(J(a.$$.fragment,t),s=!0)},o(t){Y(a.$$.fragment,t),s=!1},d(t){t&&f(e),t&&f(r),W(a,t),t&&f(o),t&&f(u),t&&f(i),t&&f(c)}}}function sn(n){let e,o,u,i,c,s;return{c(){e=p("form"),o=p("div"),u=p("div"),u.innerHTML='$',i=h(),c=p("input"),b(u,"class","input-group-prepend"),b(c,"type","tel"),b(c,"aria-describedby","amount-input-currency-symbol"),b(c,"aria-label","Amount"),b(c,"class","text-right form-control"),b(o,"class","input-group input-group-lg"),e.noValidate=!0},m(t,f,d){l(t,e,f),a(e,o),a(o,u),a(o,i),a(o,c),n[9](c),d&&r(s),s=[$(c,"keydown",n[1]),$(e,"submit",y(n[2]))]},p:t,i:t,o:t,d(t){t&&f(e),n[9](null),r(s)}}}function an(t,n,e){let{amount:r}=n;const o=C();let u,i=[],c=null;function s(t){for(var n="",r=0;r{var t;i=(t=r)?String(t).split("").filter((function(t){return"0123456789".indexOf(t)>=0})):[],s(i),a(Number(i.join(""))),u.focus()}),t.$set=t=>{"amount"in t&&e(3,r=t.amount)},[u,function(t){var n=t.which;(t=>t>=32&&t<112||t>=123&&t<127||t>=186)(n)&&t.preventDefault();var e=(t=>t>=48&&t<58?String(t-48):t>=96&&t<106?String(t-96):"")(n);e?i.push(e):(t=>8===t)(n)&&(t.preventDefault(),i.pop()),s(i),a(Number(i.join("")))},function(t){o("next",c)},r,i,c,o,s,a,function(t){N[t?"unshift":"push"](()=>{e(0,u=t)})}]}class ln extends Q{constructor(t){super(),K(this,t,an,sn,u,{amount:3})}}function fn(t){let n,e,r,o,u,i=t[0].name+"";const c=new ln({props:{amount:t[1]}});return c.$on("next",t[2]),{c(){n=p("h2"),e=g("Amount for "),r=g(i),o=h(),z(c.$$.fragment)},m(t,i){l(t,n,i),a(n,e),a(n,r),l(t,o,i),U(c,t,i),u=!0},p(t,[n]){(!u||1&n)&&i!==(i=t[0].name+"")&&v(r,i);const e={};2&n&&(e.amount=t[1]),c.$set(e)},i(t){u||(J(c.$$.fragment,t),u=!0)},o(t){Y(c.$$.fragment,t),u=!1},d(t){t&&f(n),t&&f(o),W(c,t)}}}function dn(t,n,e){let r;s(t,wt,t=>e(5,r=t));let o,u,i,{params:c}=n;return t.$set=t=>{"params"in t&&e(3,c=t.params)},t.$$.update=()=>{8&t.$$.dirty&&e(4,o=c.uuid),48&t.$$.dirty&&e(0,u=r.find(t=>t.uuid===o)||{}),16&t.$$.dirty&&e(1,i=Ct(o)||0)},[u,i,function(t){let n=t.detail;jt(o,n),It("/budget")},c]}function pn(n){let e,o,u,i,c;return{c(){e=p("h2"),e.textContent="New Category",o=h(),u=p("form"),i=p("input"),b(i,"class","form-control"),b(i,"placeholder","New category name")},m(t,s,f){l(t,e,s),l(t,o,s),l(t,u,s),a(u,i),w(i,n[0]),f&&r(c),c=[$(i,"input",n[2]),$(u,"submit",y(n[1]))]},p(t,[n]){1&n&&i.value!==t[0]&&w(i,t[0])},i:t,o:t,d(t){t&&f(e),t&&f(o),t&&f(u),r(c)}}}function gn(t,n,e){let r="";return[r,function(){It(`/category/${(t=>{const n=c(wt).find(n=>n.name===t);if(n)return n;{const n={uuid:dt(),name:t};return X(n,wt),Et(),n}})(r).uuid}/amount`)},function(){r=this.value,e(0,r)}]}function hn(n){let e,r,o,u,i,c,s,d,m,y,w,x,E,k=n[1].name+"",_=Wt(Ct(n[0]))+"";return{c(){e=p("h2"),r=p("b"),o=g(k),u=g(":"),i=h(),c=p("a"),s=p("sup"),s.textContent="$",d=h(),m=g(_),w=h(),x=p("hr"),b(r,"class","editable svelte-1uc4ts5"),b(r,"title","(Click to rename)"),b(c,"class","btn btn-default"),b(c,"href",y="#/category/"+n[0]+"/amount"),b(x,"class","small")},m(t,f,p){l(t,e,f),a(e,r),a(r,o),a(r,u),a(e,i),a(e,c),a(c,s),a(c,d),a(c,m),l(t,w,f),l(t,x,f),p&&E(),E=$(r,"click",n[2])},p(t,[n]){2&n&&k!==(k=t[1].name+"")&&v(o,k),1&n&&_!==(_=Wt(Ct(t[0]))+"")&&v(m,_),1&n&&y!==(y="#/category/"+t[0]+"/amount")&&b(c,"href",y)},i:t,o:t,d(t){t&&f(e),t&&f(w),t&&f(x),E()}}}function mn(t,n,e){let r;s(t,wt,t=>e(4,r=t));let{params:o={}}=n;let u,i;return t.$set=t=>{"params"in t&&e(3,o=t.params)},t.$$.update=()=>{8&t.$$.dirty&&e(0,u=o.uuid||""),17&t.$$.dirty&&e(1,i=r.find(t=>t.uuid===u)||{})},[u,i,()=>{var t=prompt("Edit category name:",i.name);null!=t&&kt(u,{name:t})},o]}function $n(t){return function(t){if(!t||t.length<1||"/"!=t.charAt(0)&&0!==t.indexOf("#/"))throw Error("Invalid parameter location");Pt(()=>{const n=("#"==t.charAt(0)?"":"#")+t;try{window.history.replaceState(void 0,void 0,n)}catch(t){console.warn("Caught exception while replacing the current page. If you're running this in the Svelte REPL, please note that the `replace` method might not work in this environment.")}window.dispatchEvent(new Event("hashchange"))})}("/budget"),[]}const yn={"/":class extends Q{constructor(t){super(),K(this,t,$n,null,u,{})}},"/account/new":class extends Q{constructor(t){super(),K(this,t,Ft,qt,u,{})}},"/accounts":class extends Q{constructor(t){super(),K(this,t,zt,Yt,u,{})}},"/budget":class extends Q{constructor(t){super(),K(this,t,null,cn,u,{})}},"/category/new":class extends Q{constructor(t){super(),K(this,t,gn,pn,u,{})}},"/category/:uuid":class extends Q{constructor(t){super(),K(this,t,mn,hn,u,{params:3})}},"/category/:uuid/amount":class extends Q{constructor(t){super(),K(this,t,dn,fn,u,{params:3})}}};function bn(n){let e,r,o;const u=new yt({}),i=new Vt({props:{routes:yn}});return{c(){e=p("div"),z(u.$$.fragment),r=h(),z(i.$$.fragment),b(e,"class","container my-3")},m(t,n){l(t,e,n),U(u,e,null),a(e,r),U(i,e,null),o=!0},p:t,i(t){o||(J(u.$$.fragment,t),J(i.$$.fragment,t),o=!0)},o(t){Y(u.$$.fragment,t),Y(i.$$.fragment,t),o=!1},d(t){t&&f(e),W(u),W(i)}}}function vn(t){return A(async()=>{bt.set(tt("accounts")),wt.set(tt("categories")),Ot()}),[]}return new class extends Q{constructor(t){super(),K(this,t,vn,bn,u,{})}}({target:document.body})}();