diff --git a/README.md b/README.md index 434e085..d743a70 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,15 @@ https://forevermatt.github.io/svelte-budget/ - [x] Add a category - [x] Edit a category - [x] Add a financial account +- [x] Add nicer buttons (with icons) - [ ] Edit a financial account - [ ] Record an expense - [ ] Create separate repo to document data structure versions - [ ] ... + +## Development + +### Icons + +The list of icons available in the library I'm using can be found here: +https://fontawesome.com/icons?d=gallery diff --git a/assets/bundle.css b/assets/bundle.css index 35ff56e..e20d764 100644 --- a/assets/bundle.css +++ b/assets/bundle.css @@ -1,4 +1,7 @@ +.fa-svelte.svelte-1d15yci{width:1em;height:1em;overflow:visible;display:inline-block} .category-amount.svelte-1g8xb6x.svelte-1g8xb6x{white-space:nowrap;text-align:right}.category-available.danger.svelte-1g8xb6x.svelte-1g8xb6x{color:red}.category-available.svelte-1g8xb6x>sup.svelte-1g8xb6x{margin-left:0.5ex;margin-right:0.25ex}.category-budgeted.svelte-1g8xb6x.svelte-1g8xb6x{color:#999;font-size:0.8rem;vertical-align:bottom}.category-list.svelte-1g8xb6x td.svelte-1g8xb6x{border:none;vertical-align:middle}.category-name.svelte-1g8xb6x.svelte-1g8xb6x{white-space:nowrap}.width-10.svelte-1g8xb6x.svelte-1g8xb6x{width:10%}.width-80.svelte-1g8xb6x.svelte-1g8xb6x{width:80%} +a.svelte-2b5sup.svelte-2b5sup{color:#337ab7;font-weight:bold}a.svelte-2b5sup.svelte-2b5sup:focus,a.svelte-2b5sup.svelte-2b5sup:hover{color:#111}a.svelte-2b5sup:focus .button-circle.svelte-2b5sup,a.svelte-2b5sup:hover .button-circle.svelte-2b5sup{background-color:#111}.button-circle.svelte-2b5sup.svelte-2b5sup{border-radius:3rem;background-color:#337ab7;color:#fff;display:inline-block;font-size:2rem;height:4rem;line-height:1rem;padding:1rem;overflow:hidden;text-align:center;width:4rem} +#button-row.svelte-17rvsyv{bottom:10px;left:10px;position:fixed;right:10px;text-align:right}#button-row-spacer.svelte-17rvsyv{height:100px} .category-graph.svelte-6b2uyp.svelte-6b2uyp{box-shadow:0px 0px 1px 0px rgba(0, 0, 0, 0.75)}.category-graph.danger.svelte-6b2uyp.svelte-6b2uyp{box-shadow:0px 0px 0px 1px rgba(255, 0, 0, 0.75)}.category-graph.svelte-6b2uyp.svelte-6b2uyp,.category-graph-line.svelte-6b2uyp.svelte-6b2uyp{border-radius:4px}.category-graph.svelte-6b2uyp .danger.svelte-6b2uyp{background-color:red}.category-graph.svelte-6b2uyp .success.svelte-6b2uyp{background-color:green}.category-graph.svelte-6b2uyp .warning.svelte-6b2uyp{background-color:orange}.category-graph-line.svelte-6b2uyp.svelte-6b2uyp{height:6px;margin:auto 0} -.keep-line-breaks.svelte-byhjk5{white-space:pre-line} +.keep-line-breaks.svelte-1anyckn{white-space:pre-line} .editable.svelte-1uc4ts5{cursor:pointer} diff --git a/assets/bundle.js b/assets/bundle.js index b1c1ead..c6296d6 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=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})}(); +var app=function(){"use strict";function t(){}function n(t,n){for(const e in n)t[e]=n[e];return t}function e(t){return t()}function r(){return Object.create(null)}function o(t){t.forEach(e)}function c(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 s(t){let n;return i(t,t=>n=t)(),n}function a(t,n,e){t.$$.on_destroy.push(i(n,e))}function l(t,e,r,o){return t[1]&&o?n(r.ctx.slice(),t[1](o(e))):r.ctx}function f(t,n,e,r,o,c,u){const i=function(t,n,e,r){if(t[2]&&r){const o=t[2](r(e));if(void 0===n.dirty)return o;if("object"==typeof o){const t=[],e=Math.max(n.dirty.length,o.length);for(let r=0;rt.removeEventListener(n,e,r)}function k(t){return function(n){return n.preventDefault(),t.call(this,n)}}function _(t,n,e){null==e?t.removeAttribute(n):t.getAttribute(n)!==e&&t.setAttribute(n,e)}function A(t,n){n=""+n,t.data!==n&&(t.data=n)}function C(t,n){t.value=null==n?"":n}function j(t,n,e,r){t.style.setProperty(n,e,r?"important":"")}function N(t,n,e){t.classList[e?"add":"remove"](n)}let O;function L(t){O=t}function S(){if(!O)throw new Error("Function called outside component initialization");return O}function M(t){S().$$.on_mount.push(t)}function V(){const t=S();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 D(t,n){const e=t.$$.callbacks[n.type];e&&e.slice().forEach(t=>t(n))}const z=[],R=[],H=[],I=[],P=Promise.resolve();let q=!1;function B(){q||(q=!0,P.then(U))}function F(){return B(),P}function T(t){H.push(t)}let J=!1;const Y=new Set;function U(){if(!J){J=!0;do{for(let t=0;t{G.delete(t),r&&(e&&t.d(1),r())}),t.o(n)}}function nt(t){t&&t.c()}function et(t,n,r){const{fragment:u,on_mount:i,on_destroy:s,after_update:a}=t.$$;u&&u.m(n,r),T(()=>{const n=i.map(e).filter(c);s?s.push(...n):o(n),t.$$.on_mount=[]}),a.forEach(T)}function rt(t,n){const e=t.$$;null!==e.fragment&&(o(e.on_destroy),e.fragment&&e.fragment.d(n),e.on_destroy=e.fragment=null,e.ctx=[])}function ot(n,e,c,u,i,s,a=[-1]){const l=O;L(n);const f=e.props||{},d=n.$$={fragment:null,ctx:null,props:s,update:t,not_equal:i,bound:r(),on_mount:[],on_destroy:[],before_update:[],after_update:[],context:new Map(l?l.$$.context:[]),callbacks:r(),dirty:a};let p=!1;if(d.ctx=c?c(n,f,(t,e,...r)=>{const o=r.length?r[0]:e;return d.ctx&&i(d.ctx[t],d.ctx[t]=o)&&(d.bound[t]&&d.bound[t](o),p&&function(t,n){-1===t.$$.dirty[0]&&(z.push(t),B(),t.$$.dirty.fill(0)),t.$$.dirty[n/31|0]|=1<{const t=e.indexOf(n);-1!==t&&e.splice(t,1)}}$set(){}}const ut=(t,n)=>{n.update(n=>[t,...n])},it=Array.isArray,st=t=>{const n=at(t);return it(n)?n:[]},at=t=>{const n=localStorage.getItem(t);return JSON.parse(n)},lt=(t,n)=>{localStorage.setItem(t,JSON.stringify(n))},ft=[];function dt(t,n){return{subscribe:pt(t,n).subscribe}}function pt(n,e=t){let r;const o=[];function c(t){if(u(n,t)&&(n=t,r)){const t=!ft.length;for(let t=0;t{const t=o.indexOf(s);-1!==t&&o.splice(t,1),0===o.length&&(r(),r=null)}}}}function gt(n,e,r){const u=!Array.isArray(n),s=u?[n]:n,a=e.length<2;return dt(r,n=>{let r=!1;const l=[];let f=0,d=t;const p=()=>{if(f)return;d();const r=e(u?l[0]:l,n);a?n(r):d=c(r)?r:t},g=s.map((t,n)=>i(t,t=>{l[n]=t,f&=~(1<{f|=1<wt.set("");function Et(t){let n,e,r,o,c,u;return{c(){n=y("div"),e=y("button"),e.innerHTML='',r=w(),o=v(t[0]),_(e,"type","button"),_(e,"class","close"),_(e,"aria-label","Close"),_(n,"class","alert alert-danger keep-line-breaks svelte-1anyckn"),_(n,"role","alert")},m(t,i){m(t,n,i),g(n,e),g(n,r),g(n,o),c||(u=E(e,"click",xt),c=!0)},p(t,n){1&n&&A(o,t[0])},d(t){t&&h(n),c=!1,u()}}}function kt(n){let e,r=n[0]&&Et(n);return{c(){r&&r.c(),e=x()},m(t,n){r&&r.m(t,n),m(t,e,n)},p(t,[n]){t[0]?r?r.p(t,n):(r=Et(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&&h(e)}}}function _t(t,n,e){let r;return a(t,wt,t=>e(0,r=t)),[r]}window.onunhandledrejection=t=>{let n=t.reason;wt.set(n.message)};class At extends ct{constructor(t){super(),ot(this,t,_t,kt,u,{})}}const Ct=pt([]),jt=()=>lt("accounts",s(Ct)),Nt=pt([]),Ot=(t,n)=>n.find(n=>n.uuid===t)||{},Lt=()=>lt("categories",s(Nt)),St=(t,n)=>{((t,n,e,r)=>{r.update(r=>{const o=r.find(e=>e[t]===n),c=Object.assign({},o,e);let u=!1;for(let e=0;e{var e=n.getFullYear(),r=n.getMonth(),o=new Date(e,r-t),c=o.getFullYear(),u=o.getMonth()+1;return c+"-"+String("0"+u).slice(-2)},Vt=pt({}),Dt=t=>(s(Vt)[t]||{}).budgeted||0,zt=()=>{Vt.set((t=>{const n=at(t);return null!==n?n:{}})("budget"))},Rt=(t,n)=>{s(Vt);(t=>s(Vt).hasOwnProperty(t))(t)?It(t,n):((t,n)=>{Ht(t,{budgeted:n,remaining:n,refilled:Mt(0,new Date)})})(t,n)},Ht=(t,n)=>{((t,n,e)=>{e.update(e=>(e.hasOwnProperty(t)?e[t]=Object.assign(e[t],n):e[t]=n,e))})(t,n,Vt),lt("budget",s(Vt))},It=(t,n)=>{let e=s(Vt)[t],r=e.budgeted,o=e.remaining;Ht(t,{budgeted:n,remaining:o+(n-r)})};function Pt(t){let n,e,r;var o=t[0];return o&&(n=new o({}),n.$on("routeEvent",t[5])),{c(){n&&nt(n.$$.fragment),e=x()},m(t,o){n&&et(n,t,o),m(t,e,o),r=!0},p(t,r){if(o!==(o=t[0])){if(n){Q();const t=n;tt(t.$$.fragment,1,0,()=>{rt(t,1)}),X()}o?(n=new o({}),n.$on("routeEvent",t[5]),nt(n.$$.fragment),Z(n.$$.fragment,1),et(n,e.parentNode,e)):n=null}},i(t){r||(n&&Z(n.$$.fragment,t),r=!0)},o(t){n&&tt(n.$$.fragment,t),r=!1},d(t){t&&h(e),n&&rt(n,t)}}}function qt(t){let n,e,r;var o=t[0];function c(t){return{props:{params:t[1]}}}return o&&(n=new o(c(t)),n.$on("routeEvent",t[4])),{c(){n&&nt(n.$$.fragment),e=x()},m(t,o){n&&et(n,t,o),m(t,e,o),r=!0},p(t,r){const u={};if(2&r&&(u.params=t[1]),o!==(o=t[0])){if(n){Q();const t=n;tt(t.$$.fragment,1,0,()=>{rt(t,1)}),X()}o?(n=new o(c(t)),n.$on("routeEvent",t[4]),nt(n.$$.fragment),Z(n.$$.fragment,1),et(n,e.parentNode,e)):n=null}else o&&n.$set(u)},i(t){r||(n&&Z(n.$$.fragment,t),r=!0)},o(t){n&&tt(n.$$.fragment,t),r=!1},d(t){t&&h(e),n&&rt(n,t)}}}function Bt(t){let n,e,r,o;const c=[qt,Pt],u=[];function i(t,n){return t[1]?0:1}return n=i(t),e=u[n]=c[n](t),{c(){e.c(),r=x()},m(t,e){u[n].m(t,e),m(t,r,e),o=!0},p(t,[o]){let s=n;n=i(t),n===s?u[n].p(t,o):(Q(),tt(u[s],1,1,()=>{u[s]=null}),X(),e=u[n],e||(e=u[n]=c[n](t),e.c()),Z(e,1),e.m(r.parentNode,r))},i(t){o||(Z(e),o=!0)},o(t){tt(e),o=!1},d(t){u[n].d(t),t&&h(r)}}}function Ft(){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=dt(null,(function(t){t(Ft());const n=()=>{t(Ft())};return window.addEventListener("hashchange",n,!1),function(){window.removeEventListener("hashchange",n,!1)}}));gt(Tt,t=>t.location),gt(Tt,t=>t.querystring);function Jt(t){if(!t||t.length<1||"/"!=t.charAt(0)&&0!==t.indexOf("#/"))throw Error("Invalid parameter location");return F().then(()=>{window.location.hash=("#"==t.charAt(0)?"":"#")+t})}function Yt(n,e,r){let o,c=t;a(n,Tt,t=>r(6,o=t)),n.$$.on_destroy.push(()=>c());let{routes:u={}}=e,{prefix:i=""}=e;class s{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,c,u=[],i="",s=t.split("/");for(s[0]||s.shift();o=s.shift();)"*"===(e=o[0])?(u.push("wild"),i+="/(.*)"):":"===e?(r=o.indexOf("?",1),c=o.indexOf(".",1),u.push(o.substring(1,~r?r:~c?c:o.length)),i+=~r&&!~c?"(?:/([^/]+?))?":"/([^/]+?)",~c&&(i+=(~r?"?":"")+"\\"+o.substring(c))):i+="/"+o;return{keys:u,pattern:new RegExp("^"+i+(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){i&&t.startsWith(i)&&(t=t.substr(i.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 s(n,t))}):Object.keys(u).forEach(t=>{l.push(new s(t,u[t]))});let f=null,d=null;const p=V(),g=(t,n)=>{F().then(()=>{p(t,n)})};return n.$set=t=>{"routes"in t&&r(2,u=t.routes),"prefix"in t&&r(3,i=t.prefix)},n.$$.update=()=>{if(65&n.$$.dirty){r(0,f=null);let t=0;for(;!f&&t{const n={uuid:vt(),name:t};ut(n,Ct),jt()})(r),Jt("/accounts")},function(){r=this.value,e(0,r)}]}function Kt(n){let e,r,o;return{c(){e=b("svg"),r=b("path"),_(r,"fill","currentColor"),_(r,"d",n[0]),_(e,"aria-hidden","true"),_(e,"class",o=p(n[1])+" svelte-1d15yci"),_(e,"role","img"),_(e,"xmlns","http://www.w3.org/2000/svg"),_(e,"viewBox",n[2])},m(t,n){m(t,e,n),g(e,r)},p(t,[n]){1&n&&_(r,"d",t[0]),2&n&&o!==(o=p(t[1])+" svelte-1d15yci")&&_(e,"class",o),4&n&&_(e,"viewBox",t[2])},i:t,o:t,d(t){t&&h(e)}}}function Qt(t,e,r){let{icon:o}=e,c=[],u="",i="";return t.$set=t=>{r(4,e=n(n({},e),d(t))),"icon"in t&&r(3,o=t.icon)},t.$$.update=()=>{8&t.$$.dirty&&r(2,i="0 0 "+o.icon[0]+" "+o.icon[1]),r(1,u="fa-svelte "+(e.class?e.class:"")),8&t.$$.dirty&&r(0,c=o.icon[4])},e=d(e),[c,u,i,o]}class Xt extends ct{constructor(t){super(),ot(this,t,Qt,Kt,u,{icon:3})}}function Zt(t){let n,e,r;return n=new Xt({props:{icon:t[0]}}),{c(){nt(n.$$.fragment),e=w()},m(t,o){et(n,t,o),m(t,e,o),r=!0},p(t,e){const r={};1&e&&(r.icon=t[0]),n.$set(r)},i(t){r||(Z(n.$$.fragment,t),r=!0)},o(t){tt(n.$$.fragment,t),r=!1},d(t){rt(n,t),t&&h(e)}}}function tn(t){let n,e,r,o,c,u,i,s,a,l,f=t[0]&&Zt(t);return{c(){n=y("a"),e=y("span"),f&&f.c(),r=y("br"),o=w(),c=y("br"),u=w(),i=v(t[1]),_(e,"class","button-circle svelte-2b5sup"),_(n,"id",s="button-"+t[1]),_(n,"class","btn svelte-2b5sup"),_(n,"href",a=t[3]||"javascript:void(0)"),_(n,"role","button"),N(n,"float-left",t[2])},m(t,s){m(t,n,s),g(n,e),f&&f.m(e,null),g(e,r),g(e,o),g(n,c),g(n,u),g(n,i),l=!0},p(t,[o]){t[0]?f?(f.p(t,o),1&o&&Z(f,1)):(f=Zt(t),f.c(),Z(f,1),f.m(e,r)):f&&(Q(),tt(f,1,1,()=>{f=null}),X()),(!l||2&o)&&A(i,t[1]),(!l||2&o&&s!==(s="button-"+t[1]))&&_(n,"id",s),(!l||8&o&&a!==(a=t[3]||"javascript:void(0)"))&&_(n,"href",a),4&o&&N(n,"float-left",t[2])},i(t){l||(Z(f),l=!0)},o(t){tt(f),l=!1},d(t){t&&h(n),f&&f.d()}}}function nn(t,n,e){let{icon:r}=n,{name:o}=n,{left:c=!1}=n,{url:u=""}=n;return t.$set=t=>{"icon"in t&&e(0,r=t.icon),"name"in t&&e(1,o=t.name),"left"in t&&e(2,c=t.left),"url"in t&&e(3,u=t.url)},[r,o,c,u]}class en extends ct{constructor(t){super(),ot(this,t,nn,tn,u,{icon:0,name:1,left:2,url:3})}}function rn(t){let n,e,r,o,c,u;const i=t[1].default,s=function(t,n,e,r){if(t){const o=l(t,n,e,r);return t[0](o)}}(i,t,t[0],null);return{c(){n=y("div"),e=w(),r=y("div"),s&&s.c(),o=w(),c=y("div"),_(n,"id","button-row-spacer"),_(n,"class","svelte-17rvsyv"),_(c,"class","clearfix"),_(r,"id","button-row"),_(r,"class","svelte-17rvsyv")},m(t,i){m(t,n,i),m(t,e,i),m(t,r,i),s&&s.m(r,null),g(r,o),g(r,c),u=!0},p(t,[n]){s&&s.p&&1&n&&f(s,i,t,t[0],n,null,null)},i(t){u||(Z(s,t),u=!0)},o(t){tt(s,t),u=!1},d(t){t&&h(n),t&&h(e),t&&h(r),s&&s.d(t)}}}function on(t,n,e){let{$$slots:r={},$$scope:o}=n;return t.$set=t=>{"$$scope"in t&&e(0,o=t.$$scope)},[o,r]}class cn extends ct{constructor(t){super(),ot(this,t,on,rn,u,{})}}var un={prefix:"fas",iconName:"home",icon:[576,512,[],"f015","M280.37 148.26L96 300.11V464a16 16 0 0 0 16 16l112.06-.29a16 16 0 0 0 15.92-16V368a16 16 0 0 1 16-16h64a16 16 0 0 1 16 16v95.64a16 16 0 0 0 16 16.05L464 480a16 16 0 0 0 16-16V300L295.67 148.26a12.19 12.19 0 0 0-15.3 0zM571.6 251.47L488 182.56V44.05a12 12 0 0 0-12-12h-56a12 12 0 0 0-12 12v72.61L318.47 43a48 48 0 0 0-61 0L4.34 251.47a12 12 0 0 0-1.6 16.9l25.5 31A12 12 0 0 0 45.15 301l235.22-193.74a12.19 12.19 0 0 1 15.3 0L530.9 301a12 12 0 0 0 16.9-1.6l25.5-31a12 12 0 0 0-1.7-16.93z"]},sn={prefix:"fas",iconName:"list-ul",icon:[512,512,[],"f0ca","M48 48a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0 160a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm0 160a48 48 0 1 0 48 48 48 48 0 0 0-48-48zm448 16H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16zm0-320H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16V80a16 16 0 0 0-16-16zm0 160H176a16 16 0 0 0-16 16v32a16 16 0 0 0 16 16h320a16 16 0 0 0 16-16v-32a16 16 0 0 0-16-16z"]};function an(t,n,e){const r=t.slice();return r[1]=n[e],r}function ln(t){let n,e,r=t[1].name+"";return{c(){n=y("li"),e=v(r)},m(t,r){m(t,n,r),g(n,e)},p(t,n){1&n&&r!==(r=t[1].name+"")&&A(e,r)},d(t){t&&h(n)}}}function fn(n){let e,r;return e=new en({props:{icon:un,name:"budget",url:"#/budget",left:!0}}),{c(){nt(e.$$.fragment)},m(t,n){et(e,t,n),r=!0},p:t,i(t){r||(Z(e.$$.fragment,t),r=!0)},o(t){tt(e.$$.fragment,t),r=!1},d(t){rt(e,t)}}}function dn(t){let n,e,r,o,c,u,i,s,a=t[0],l=[];for(let n=0;nAdd new account',u=w(),nt(i.$$.fragment)},m(t,a){m(t,n,a),m(t,e,a),m(t,r,a);for(let t=0;te(0,r=t)),[r]}const gn=t=>yn(t)?"danger":"",mn=t=>$n(t,2),hn=t=>$n(t,0),$n=(t,n)=>(null==t&&(t=0),(Number(t)/100).toFixed(n)),yn=t=>t&&t<0;function bn(n){let e,r,o,c;return{c(){e=y("div"),r=y("div"),_(r,"class",o="category-graph-line "+n[2](n[1],n[0])+" svelte-6b2uyp"),j(r,"width",n[3](n[1],n[0])+"%"),_(e,"class",c="category-graph "+gn(n[1])+" svelte-6b2uyp")},m(t,n){m(t,e,n),g(e,r)},p(t,[n]){3&n&&o!==(o="category-graph-line "+t[2](t[1],t[0])+" svelte-6b2uyp")&&_(r,"class",o),3&n&&j(r,"width",t[3](t[1],t[0])+"%"),2&n&&c!==(c="category-graph "+gn(t[1])+" svelte-6b2uyp")&&_(e,"class",c)},i:t,o:t,d(t){t&&h(e)}}}function vn(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 wn extends ct{constructor(t){super(),ot(this,t,vn,bn,u,{budgeted:0,remaining:1})}}function xn(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,c,u,i,s,a,l,f,d,p,$,b,x,E,k,C,j,N,O=t[5]+"",L=mn(t[4])+"",S=hn(t[3])+"";return s=new wn({props:{budgeted:t[3],remaining:t[4]}}),{c(){n=y("tr"),e=y("td"),r=y("a"),o=v(O),u=w(),i=y("td"),nt(s.$$.fragment),a=w(),l=y("td"),f=y("div"),d=y("sup"),d.textContent="$",p=v(L),b=w(),x=y("div"),E=y("span"),k=v("/ "),C=v(S),j=w(),_(r,"href",c="#/category/"+t[6]),_(r,"class","btn btn-outline-secondary"),_(e,"class","category-name width-10 svelte-1g8xb6x"),_(i,"class","width-80 svelte-1g8xb6x"),_(d,"class","svelte-1g8xb6x"),_(f,"class",$="category-available "+gn(t[4])+" svelte-1g8xb6x"),_(x,"class","category-budgeted svelte-1g8xb6x"),_(l,"class","category-amount width-10 svelte-1g8xb6x")},m(t,c){m(t,n,c),g(n,e),g(e,r),g(r,o),g(n,u),g(n,i),et(s,i,null),g(n,a),g(n,l),g(l,f),g(f,d),g(f,p),g(l,b),g(l,x),g(x,E),g(E,k),g(E,C),g(n,j),N=!0},p(t,n){(!N||1&n)&&O!==(O=t[5]+"")&&A(o,O),(!N||1&n&&c!==(c="#/category/"+t[6]))&&_(r,"href",c);const e={};1&n&&(e.budgeted=t[3]),1&n&&(e.remaining=t[4]),s.$set(e),(!N||1&n)&&L!==(L=mn(t[4])+"")&&A(p,L),(!N||1&n&&$!==($="category-available "+gn(t[4])+" svelte-1g8xb6x"))&&_(f,"class",$),(!N||1&n)&&S!==(S=hn(t[3])+"")&&A(C,S)},i(t){N||(Z(s.$$.fragment,t),N=!0)},o(t){tt(s.$$.fragment,t),N=!1},d(t){t&&h(n),rt(s)}}}function kn(t){let n,e,r,o=t[0],c=[];for(let n=0;ntt(c[t],1,1,()=>{c[t]=null});return{c(){n=y("table"),e=y("tbody");for(let t=0;te(1,r=t)),a(t,Nt,t=>e(2,o=t)),t.$$.update=()=>{6&t.$$.dirty&&e(0,c=((t,n)=>{let e=[];for(var r in t)if(t.hasOwnProperty(r)){let o=Ot(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))},[c]}class An extends ct{constructor(t){super(),ot(this,t,_n,kn,u,{})}}function Cn(n){let e,r;return e=new en({props:{icon:sn,name:"accounts",url:"#/accounts",left:!0}}),{c(){nt(e.$$.fragment)},m(t,n){et(e,t,n),r=!0},p:t,i(t){r||(Z(e.$$.fragment,t),r=!0)},o(t){tt(e.$$.fragment,t),r=!1},d(t){rt(e,t)}}}function jn(t){let n,e,r,o,c,u,i,s;return r=new An({}),i=new cn({props:{$$slots:{default:[Cn]},$$scope:{ctx:t}}}),{c(){n=y("h2"),n.textContent="Budget",e=w(),nt(r.$$.fragment),o=w(),c=y("p"),c.innerHTML='Add new category',u=w(),nt(i.$$.fragment)},m(t,a){m(t,n,a),m(t,e,a),et(r,t,a),m(t,o,a),m(t,c,a),m(t,u,a),et(i,t,a),s=!0},p(t,[n]){const e={};1&n&&(e.$$scope={dirty:n,ctx:t}),i.$set(e)},i(t){s||(Z(r.$$.fragment,t),Z(i.$$.fragment,t),s=!0)},o(t){tt(r.$$.fragment,t),tt(i.$$.fragment,t),s=!1},d(t){t&&h(n),t&&h(e),rt(r,t),t&&h(o),t&&h(c),t&&h(u),rt(i,t)}}}function Nn(n){let e,r,c,u,i,s,a;return{c(){e=y("form"),r=y("div"),c=y("div"),c.innerHTML='$',u=w(),i=y("input"),_(c,"class","input-group-prepend"),_(i,"type","tel"),_(i,"aria-describedby","amount-input-currency-symbol"),_(i,"aria-label","Amount"),_(i,"class","text-right form-control"),_(r,"class","input-group input-group-lg"),e.noValidate=!0},m(t,o){m(t,e,o),g(e,r),g(r,c),g(r,u),g(r,i),n[4](i),s||(a=[E(i,"keydown",n[1]),E(e,"submit",k(n[2]))],s=!0)},p:t,i:t,o:t,d(t){t&&h(e),n[4](null),s=!1,o(a)}}}function On(t,n,e){let{amount:r}=n;const o=V();let c,u=[],i=null;function s(t){for(var n="",r=0;r{var t;u=(t=r)?String(t).split("").filter((function(t){return"0123456789".indexOf(t)>=0})):[],s(u),a(Number(u.join(""))),c.focus()}),t.$set=t=>{"amount"in t&&e(3,r=t.amount)},[c,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?u.push(e):(t=>8===t)(n)&&(t.preventDefault(),u.pop()),s(u),a(Number(u.join("")))},function(t){o("next",i)},r,function(t){R[t?"unshift":"push"](()=>{c=t,e(0,c)})}]}class Ln extends ct{constructor(t){super(),ot(this,t,On,Nn,u,{amount:3})}}function Sn(t){let n,e,r,o,c,u,i=t[0].name+"";return c=new Ln({props:{amount:t[1]}}),c.$on("next",t[2]),{c(){n=y("h2"),e=v("Amount for "),r=v(i),o=w(),nt(c.$$.fragment)},m(t,i){m(t,n,i),g(n,e),g(n,r),m(t,o,i),et(c,t,i),u=!0},p(t,[n]){(!u||1&n)&&i!==(i=t[0].name+"")&&A(r,i);const e={};2&n&&(e.amount=t[1]),c.$set(e)},i(t){u||(Z(c.$$.fragment,t),u=!0)},o(t){tt(c.$$.fragment,t),u=!1},d(t){t&&h(n),t&&h(o),rt(c,t)}}}function Mn(t,n,e){let r;a(t,Nt,t=>e(5,r=t));let o,c,u,{params:i}=n;return t.$set=t=>{"params"in t&&e(3,i=t.params)},t.$$.update=()=>{8&t.$$.dirty&&e(4,o=i.uuid),48&t.$$.dirty&&e(0,c=r.find(t=>t.uuid===o)||{}),16&t.$$.dirty&&e(1,u=Dt(o)||0)},[c,u,function(t){let n=t.detail;Rt(o,n),Jt("/budget")},i]}function Vn(n){let e,r,c,u,i,s;return{c(){e=y("h2"),e.textContent="New Category",r=w(),c=y("form"),u=y("input"),_(u,"class","form-control"),_(u,"placeholder","New category name")},m(t,o){m(t,e,o),m(t,r,o),m(t,c,o),g(c,u),C(u,n[0]),i||(s=[E(u,"input",n[2]),E(c,"submit",k(n[1]))],i=!0)},p(t,[n]){1&n&&u.value!==t[0]&&C(u,t[0])},i:t,o:t,d(t){t&&h(e),t&&h(r),t&&h(c),i=!1,o(s)}}}function Dn(t,n,e){let r="";return[r,function(){Jt(`/category/${(t=>{const n=s(Nt).find(n=>n.name===t);if(n)return n;{const n={uuid:vt(),name:t};return ut(n,Nt),Lt(),n}})(r).uuid}/amount`)},function(){r=this.value,e(0,r)}]}function zn(n){let e,r,o,c,u,i,s,a,l,f,d,p,$,b,x=n[1].name+"",k=mn(Dt(n[0]))+"";return{c(){e=y("h2"),r=y("b"),o=v(x),c=v(":"),u=w(),i=y("a"),s=y("sup"),s.textContent="$",a=w(),l=v(k),d=w(),p=y("hr"),_(r,"class","editable svelte-1uc4ts5"),_(r,"title","(Click to rename)"),_(i,"class","btn btn-default"),_(i,"href",f="#/category/"+n[0]+"/amount"),_(p,"class","small")},m(t,f){m(t,e,f),g(e,r),g(r,o),g(r,c),g(e,u),g(e,i),g(i,s),g(i,a),g(i,l),m(t,d,f),m(t,p,f),$||(b=E(r,"click",n[2]),$=!0)},p(t,[n]){2&n&&x!==(x=t[1].name+"")&&A(o,x),1&n&&k!==(k=mn(Dt(t[0]))+"")&&A(l,k),1&n&&f!==(f="#/category/"+t[0]+"/amount")&&_(i,"href",f)},i:t,o:t,d(t){t&&h(e),t&&h(d),t&&h(p),$=!1,b()}}}function Rn(t,n,e){let r;a(t,Nt,t=>e(4,r=t));let{params:o={}}=n;let c,u;return t.$set=t=>{"params"in t&&e(3,o=t.params)},t.$$.update=()=>{8&t.$$.dirty&&e(0,c=o.uuid||""),17&t.$$.dirty&&e(1,u=r.find(t=>t.uuid===c)||{})},[c,u,()=>{var t=prompt("Edit category name:",u.name);null!=t&&St(c,{name:t})},o]}function Hn(t){return function(t){if(!t||t.length<1||"/"!=t.charAt(0)&&0!==t.indexOf("#/"))throw Error("Invalid parameter location");F().then(()=>{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 In={"/":class extends ct{constructor(t){super(),ot(this,t,Hn,null,u,{})}},"/account/new":class extends ct{constructor(t){super(),ot(this,t,Gt,Wt,u,{})}},"/accounts":class extends ct{constructor(t){super(),ot(this,t,pn,dn,u,{})}},"/budget":class extends ct{constructor(t){super(),ot(this,t,null,jn,u,{})}},"/category/new":class extends ct{constructor(t){super(),ot(this,t,Dn,Vn,u,{})}},"/category/:uuid":class extends ct{constructor(t){super(),ot(this,t,Rn,zn,u,{params:3})}},"/category/:uuid/amount":class extends ct{constructor(t){super(),ot(this,t,Mn,Sn,u,{params:3})}}};function Pn(n){let e,r,o,c,u;return r=new At({}),c=new Ut({props:{routes:In}}),{c(){e=y("div"),nt(r.$$.fragment),o=w(),nt(c.$$.fragment),_(e,"class","container-xl my-3")},m(t,n){m(t,e,n),et(r,e,null),g(e,o),et(c,e,null),u=!0},p:t,i(t){u||(Z(r.$$.fragment,t),Z(c.$$.fragment,t),u=!0)},o(t){tt(r.$$.fragment,t),tt(c.$$.fragment,t),u=!1},d(t){t&&h(e),rt(r),rt(c)}}}function qn(t){return M(async()=>{Ct.set(st("accounts")),Nt.set(st("categories")),zt()}),[]}return new class extends ct{constructor(t){super(),ot(this,t,qn,Pn,u,{})}}({target:document.body})}(); diff --git a/package-lock.json b/package-lock.json index 8095949..12e59bf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,6 +30,21 @@ "js-tokens": "^4.0.0" } }, + "@fortawesome/fontawesome-common-types": { + "version": "0.2.28", + "resolved": "https://registry.npmjs.org/@fortawesome/fontawesome-common-types/-/fontawesome-common-types-0.2.28.tgz", + "integrity": "sha512-gtis2/5yLdfI6n0ia0jH7NJs5i/Z/8M/ZbQL6jXQhCthEOe5Cr5NcQPhgTvFxNOtURE03/ZqUcEskdn2M+QaBg==", + "dev": true + }, + "@fortawesome/free-solid-svg-icons": { + "version": "5.13.0", + "resolved": "https://registry.npmjs.org/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.13.0.tgz", + "integrity": "sha512-IHUgDJdomv6YtG4p3zl1B5wWf9ffinHIvebqQOmV3U+3SLw4fC+LUCCgwfETkbTtjy5/Qws2VoVf6z/ETQpFpg==", + "dev": true, + "requires": { + "@fortawesome/fontawesome-common-types": "^0.2.28" + } + }, "@polka/url": { "version": "0.5.0", "resolved": "https://registry.npmjs.org/@polka/url/-/url-0.5.0.tgz", @@ -163,9 +178,9 @@ } }, "chokidar": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.3.1.tgz", - "integrity": "sha512-4QYCEWOcK3OJrxwvyyAOxFuhpvOVCYkr33LPfFNBjAD/w3sEzWsp2BUOkI4l9bHvWioAd0rc6NlHUOEaWkTeqg==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.0.tgz", + "integrity": "sha512-aXAaho2VJtisB/1fg1+3nlLJqGOuewTzQpd/Tz0yTg2R0e4IGtshYvtjowyEumcBv2z+y4+kc75Mz7j5xJskcQ==", "dev": true, "requires": { "anymatch": "~3.1.1", @@ -175,7 +190,7 @@ "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.3.0" + "readdirp": "~3.4.0" } }, "color-convert": { @@ -216,6 +231,12 @@ "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", "dev": true }, + "fa-svelte": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/fa-svelte/-/fa-svelte-3.1.0.tgz", + "integrity": "sha512-RqBOWwt7sc+ta9GFjbu5GOwKFRzn3rMPPSqvSGpIwsfVnpMjiI5ttv84lwNsCMEYI6/lu/iH21HUcE3TLz8RGQ==", + "dev": true + }, "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -226,9 +247,9 @@ } }, "fsevents": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.2.tgz", - "integrity": "sha512-R4wDiBwZ0KzpgOWetKDug1FZcYhqYnUYKtfZYt4mD5SBz76q0KR4Q9o7GIPamsVPGmW3EYPPJ0dOOjvx32ldZA==", + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.3.tgz", + "integrity": "sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==", "dev": true, "optional": true }, @@ -342,9 +363,9 @@ } }, "livereload-js": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/livereload-js/-/livereload-js-3.2.2.tgz", - "integrity": "sha512-xhScbNeC687ZINjEf/bD+BMiPx4s4q0mehcLb3zCc8+mykOtmaBR4vqzyIV9rIGdG9JjHaT0LiFdscvivCjX1Q==", + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/livereload-js/-/livereload-js-3.2.3.tgz", + "integrity": "sha512-dXL/WgTGI2K3oeYX/z1lngFXSKtjCB2j7n9WSSluoU6/6+N4LWNoMiCBFNgn8dh3luBn4JBajVSvM5I7Xn6SLA==", "dev": true }, "local-access": { @@ -378,9 +399,9 @@ } }, "mime": { - "version": "2.4.4", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.4.tgz", - "integrity": "sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA==" + "version": "2.4.6", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz", + "integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==" }, "mri": { "version": "1.1.5", @@ -412,12 +433,12 @@ "dev": true }, "readdirp": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.3.0.tgz", - "integrity": "sha512-zz0pAkSPOXXm1viEwygWIPSPkcBYjW1xU5j/JBh5t9bGCJwa6f9+BJa6VaB2g+b55yVrmXzqkyLf4xaWYM0IkQ==", + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", + "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", "dev": true, "requires": { - "picomatch": "^2.0.7" + "picomatch": "^2.2.1" } }, "regexparam": { @@ -453,18 +474,18 @@ } }, "rollup-plugin-livereload": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/rollup-plugin-livereload/-/rollup-plugin-livereload-1.2.0.tgz", - "integrity": "sha512-zKcS4D8ElSFj9Mv6OAM1kGB3o5LkCtEClewO8CDPEacj6p4DSvTOm6WlKSc8/WtsD0d3Q33Y96c5Jqzyaxo/8g==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/rollup-plugin-livereload/-/rollup-plugin-livereload-1.3.0.tgz", + "integrity": "sha512-abyqXaB21+nFHo+vJULBqfzNx6zXABC19UyvqgDfdoxR/8pFAd041GO+GIUe8ZYC2DbuMUmioh1Lvbk14YLZgw==", "dev": true, "requires": { "livereload": "^0.9.1" } }, "rollup-plugin-svelte": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-5.2.1.tgz", - "integrity": "sha512-wc93cN66sRpX6uFljVFqvWT6NU3V5ab/uLXKt2UiARuexFU/ctolzkmdXM7WM5iKdTX9scToS9sabJTJV4DUMA==", + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/rollup-plugin-svelte/-/rollup-plugin-svelte-5.2.2.tgz", + "integrity": "sha512-I+TJ2T+VLKGbKQcpeMJ4AR2ciROqTZNjxbiMiH4Cn1yByaB9OEuy3CnrgHHuWatQcPuF3yIViyKX7OlETWDKOQ==", "dev": true, "requires": { "require-relative": "^0.8.7", @@ -517,25 +538,25 @@ "dev": true }, "sirv": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/sirv/-/sirv-0.4.2.tgz", - "integrity": "sha512-dQbZnsMaIiTQPZmbGmktz+c74zt/hyrJEB4tdp2Jj0RNv9J6B/OWR5RyrZEvIn9fyh9Zlg2OlE2XzKz6wMKGAw==", + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/sirv/-/sirv-0.4.6.tgz", + "integrity": "sha512-rYpOXlNbpHiY4nVXxuDf4mXPvKz1reZGap/LkWp9TvcZ84qD/nPBjjH/6GZsgIjVMbOslnY8YYULAyP8jMn1GQ==", "requires": { "@polka/url": "^0.5.0", "mime": "^2.3.1" } }, "sirv-cli": { - "version": "0.4.5", - "resolved": "https://registry.npmjs.org/sirv-cli/-/sirv-cli-0.4.5.tgz", - "integrity": "sha512-Fl6icSm0EwPrXSGid2xphMp//WNTSX2yENRAGnJuuZNmdc8LvE/BtdZD3MPn28ifAfDqTMwbB3dpcZojAIOiBg==", + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/sirv-cli/-/sirv-cli-0.4.6.tgz", + "integrity": "sha512-/Vj85/kBvPL+n9ibgX6FicLE8VjidC1BhlX67PYPBfbBAphzR6i0k0HtU5c2arejfU3uzq8l3SYPCwl1x7z6Ww==", "requires": { "console-clear": "^1.1.0", "get-port": "^3.2.0", "kleur": "^3.0.0", "local-access": "^1.0.1", "sade": "^1.4.0", - "sirv": "^0.4.2", + "sirv": "^0.4.6", "tinydate": "^1.0.0" } }, @@ -571,15 +592,15 @@ } }, "svelte": { - "version": "3.20.1", - "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.20.1.tgz", - "integrity": "sha512-m/dw52BZf+p6KYnyKLErIcGalu4pwJrQbUM7VZriRw6ZlJj1qMAZsLcIWzEB3I0hhdJwkKb7LrrvUIeqmbO92Q==", + "version": "3.23.2", + "resolved": "https://registry.npmjs.org/svelte/-/svelte-3.23.2.tgz", + "integrity": "sha512-hE8GeTM83YVR4GY6/6PeDEcGct4JS5aCi+IYbCAa76oaPSfuF7L85DQYULQxlTK/KPWzw3L1GRGmC3oPG/PQoA==", "dev": true }, "svelte-spa-router": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/svelte-spa-router/-/svelte-spa-router-2.1.0.tgz", - "integrity": "sha512-9bcQPTQ6A+Z92Z+NirVVusa/Sw6nqzKwZAKfu1Cl6+XjStf12hfIcPoMfTutEBoX0Ik+z7gJbJ934PKk94BvCg==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/svelte-spa-router/-/svelte-spa-router-2.2.0.tgz", + "integrity": "sha512-S3KpmiBszjdjkU1QA9FyNgrSdQORbXWp4wl8R147Gl7KoNof/0SfFJ23+9E47jLiNz+lCw1uaCfeHJi2I60bVg==", "dev": true, "requires": { "regexparam": "1.3.0" diff --git a/package.json b/package.json index 75b381a..4aa49f5 100644 --- a/package.json +++ b/package.json @@ -18,17 +18,19 @@ }, "homepage": "https://github.com/forevermatt/svelte-budget#readme", "devDependencies": { + "@fortawesome/free-solid-svg-icons": "^5.13.0", "@rollup/plugin-commonjs": "11.0.2", "@rollup/plugin-node-resolve": "^7.0.0", + "fa-svelte": "^3.1.0", "rollup": "^1.20.0", - "rollup-plugin-livereload": "^1.0.0", - "rollup-plugin-svelte": "^5.0.3", + "rollup-plugin-livereload": "^1.3.0", + "rollup-plugin-svelte": "^5.2.2", "rollup-plugin-terser": "^5.1.2", - "svelte": "^3.0.0", - "svelte-spa-router": "^2.1.0" + "svelte": "^3.23.2", + "svelte-spa-router": "^2.2.0" }, "dependencies": { - "sirv-cli": "^0.4.4", + "sirv-cli": "^0.4.6", "uuid": "^7.0.3" } } diff --git a/src/App.svelte b/src/App.svelte index 03dc9c5..6752116 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -14,7 +14,7 @@ onMount(async () => { }) -
+
diff --git a/src/components/Button.svelte b/src/components/Button.svelte new file mode 100644 index 0000000..b9b18ce --- /dev/null +++ b/src/components/Button.svelte @@ -0,0 +1,49 @@ + + + + + + + {#if icon } + + {/if}
+

+ { name } +
diff --git a/src/components/ButtonRow.svelte b/src/components/ButtonRow.svelte new file mode 100644 index 0000000..a3193a2 --- /dev/null +++ b/src/components/ButtonRow.svelte @@ -0,0 +1,18 @@ + + +
+
+ +
+
diff --git a/src/views/Accounts.svelte b/src/views/Accounts.svelte index c1746fa..c95ff53 100644 --- a/src/views/Accounts.svelte +++ b/src/views/Accounts.svelte @@ -1,5 +1,8 @@

Accounts

@@ -12,4 +15,6 @@ import { accounts } from '../data/accounts'

Add new account

-

Budget

+ +