mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-09-19 10:53:37 +00:00
2 lines
67 KiB
JavaScript
Executable File
Vendored
2 lines
67 KiB
JavaScript
Executable File
Vendored
(window.webpackJsonp=window.webpackJsonp||[]).push([[4],{276:function(t,e,a){a(457),t.exports=a(725)},277:function(t,e,a){var s={"./af":89,"./af.js":89,"./ar":90,"./ar-dz":91,"./ar-dz.js":91,"./ar-kw":92,"./ar-kw.js":92,"./ar-ly":93,"./ar-ly.js":93,"./ar-ma":94,"./ar-ma.js":94,"./ar-sa":95,"./ar-sa.js":95,"./ar-tn":96,"./ar-tn.js":96,"./ar.js":90,"./az":97,"./az.js":97,"./be":98,"./be.js":98,"./bg":99,"./bg.js":99,"./bm":100,"./bm.js":100,"./bn":101,"./bn-bd":102,"./bn-bd.js":102,"./bn.js":101,"./bo":103,"./bo.js":103,"./br":104,"./br.js":104,"./bs":105,"./bs.js":105,"./ca":106,"./ca.js":106,"./cs":107,"./cs.js":107,"./cv":108,"./cv.js":108,"./cy":109,"./cy.js":109,"./da":110,"./da.js":110,"./de":111,"./de-at":112,"./de-at.js":112,"./de-ch":113,"./de-ch.js":113,"./de.js":111,"./dv":114,"./dv.js":114,"./el":115,"./el.js":115,"./en-au":116,"./en-au.js":116,"./en-ca":117,"./en-ca.js":117,"./en-gb":118,"./en-gb.js":118,"./en-ie":119,"./en-ie.js":119,"./en-il":120,"./en-il.js":120,"./en-in":121,"./en-in.js":121,"./en-nz":122,"./en-nz.js":122,"./en-sg":123,"./en-sg.js":123,"./eo":124,"./eo.js":124,"./es":125,"./es-do":126,"./es-do.js":126,"./es-mx":127,"./es-mx.js":127,"./es-us":128,"./es-us.js":128,"./es.js":125,"./et":129,"./et.js":129,"./eu":130,"./eu.js":130,"./fa":131,"./fa.js":131,"./fi":132,"./fi.js":132,"./fil":133,"./fil.js":133,"./fo":134,"./fo.js":134,"./fr":135,"./fr-ca":136,"./fr-ca.js":136,"./fr-ch":137,"./fr-ch.js":137,"./fr.js":135,"./fy":138,"./fy.js":138,"./ga":139,"./ga.js":139,"./gd":140,"./gd.js":140,"./gl":141,"./gl.js":141,"./gom-deva":142,"./gom-deva.js":142,"./gom-latn":143,"./gom-latn.js":143,"./gu":144,"./gu.js":144,"./he":145,"./he.js":145,"./hi":146,"./hi.js":146,"./hr":147,"./hr.js":147,"./hu":148,"./hu.js":148,"./hy-am":149,"./hy-am.js":149,"./id":150,"./id.js":150,"./is":151,"./is.js":151,"./it":152,"./it-ch":153,"./it-ch.js":153,"./it.js":152,"./ja":154,"./ja.js":154,"./jv":155,"./jv.js":155,"./ka":156,"./ka.js":156,"./kk":157,"./kk.js":157,"./km":158,"./km.js":158,"./kn":159,"./kn.js":159,"./ko":160,"./ko.js":160,"./ku":161,"./ku.js":161,"./ky":162,"./ky.js":162,"./lb":163,"./lb.js":163,"./lo":164,"./lo.js":164,"./lt":165,"./lt.js":165,"./lv":166,"./lv.js":166,"./me":167,"./me.js":167,"./mi":168,"./mi.js":168,"./mk":169,"./mk.js":169,"./ml":170,"./ml.js":170,"./mn":171,"./mn.js":171,"./mr":172,"./mr.js":172,"./ms":173,"./ms-my":174,"./ms-my.js":174,"./ms.js":173,"./mt":175,"./mt.js":175,"./my":176,"./my.js":176,"./nb":177,"./nb.js":177,"./ne":178,"./ne.js":178,"./nl":179,"./nl-be":180,"./nl-be.js":180,"./nl.js":179,"./nn":181,"./nn.js":181,"./oc-lnc":182,"./oc-lnc.js":182,"./pa-in":183,"./pa-in.js":183,"./pl":184,"./pl.js":184,"./pt":185,"./pt-br":186,"./pt-br.js":186,"./pt.js":185,"./ro":187,"./ro.js":187,"./ru":188,"./ru.js":188,"./sd":189,"./sd.js":189,"./se":190,"./se.js":190,"./si":191,"./si.js":191,"./sk":192,"./sk.js":192,"./sl":193,"./sl.js":193,"./sq":194,"./sq.js":194,"./sr":195,"./sr-cyrl":196,"./sr-cyrl.js":196,"./sr.js":195,"./ss":197,"./ss.js":197,"./sv":198,"./sv.js":198,"./sw":199,"./sw.js":199,"./ta":200,"./ta.js":200,"./te":201,"./te.js":201,"./tet":202,"./tet.js":202,"./tg":203,"./tg.js":203,"./th":204,"./th.js":204,"./tk":205,"./tk.js":205,"./tl-ph":206,"./tl-ph.js":206,"./tlh":207,"./tlh.js":207,"./tr":208,"./tr.js":208,"./tzl":209,"./tzl.js":209,"./tzm":210,"./tzm-latn":211,"./tzm-latn.js":211,"./tzm.js":210,"./ug-cn":212,"./ug-cn.js":212,"./uk":213,"./uk.js":213,"./ur":214,"./ur.js":214,"./uz":215,"./uz-latn":216,"./uz-latn.js":216,"./uz.js":215,"./vi":217,"./vi.js":217,"./x-pseudo":218,"./x-pseudo.js":218,"./yo":219,"./yo.js":219,"./zh-cn":220,"./zh-cn.js":220,"./zh-hk":221,"./zh-hk.js":221,"./zh-mo":222,"./zh-mo.js":222,"./zh-tw":223,"./zh-tw.js":223};function r(t){var e=n(t);return a(e)}function n(t){if(!a.o(s,t)){var e=new Error("Cannot find module '"+t+"'");throw e.code="MODULE_NOT_FOUND",e}return s[t]}r.keys=function(){return Object.keys(s)},r.resolve=n,t.exports=r,r.id=277},457:function(t,e,a){"use strict";a.r(e);var s={name:"Dashboard"},r=a(4),n=Object(r.a)(s,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[a("top-boxes"),t._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col"},[a("main-account")],1)]),t._v(" "),a("main-account-list"),t._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col"},[a("main-budget-list")],1)]),t._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col"},[a("main-category-list")],1)]),t._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col-lg-6 col-md-12 col-sm-12 col-xs-12"},[a("main-debit-list")],1),t._v(" "),a("div",{staticClass:"col-lg-6 col-md-12 col-sm-12 col-xs-12"},[a("main-credit-list")],1)]),t._v(" "),a("div",{staticClass:"row"},[a("div",{staticClass:"col-lg-6 col-md-12 col-sm-12 col-xs-12"},[a("main-piggy-list")],1),t._v(" "),a("div",{staticClass:"col-lg-6 col-md-12 col-sm-12 col-xs-12"},[a("main-bills-list")],1)])],1)}),[],!1,null,null,null).exports,i=a(14);function c(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,s)}return a}function o(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?c(Object(a),!0).forEach((function(e){l(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):c(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function l(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var u=Object(i.b)("dashboard/index"),d=(u.mapState,u.mapGetters),p=(u.mapActions,u.mapMutations,{name:"TopBoxes",props:{},data:function(){return{summary:[],balances:[],billsPaid:[],billsUnpaid:[],leftToSpend:[],netWorth:[],loading:!0,error:!1,ready:!1}},computed:o(o({},d(["start","end"])),{},{datesReady:function(){return null!==this.start&&null!==this.end&&this.ready},prefCurrencyBalances:function(){return this.filterOnCurrency(this.balances)},notPrefCurrencyBalances:function(){return this.filterOnNotCurrency(this.balances)},prefBillsUnpaid:function(){return this.filterOnCurrency(this.billsUnpaid)},notPrefBillsUnpaid:function(){return this.filterOnNotCurrency(this.billsUnpaid)},prefLeftToSpend:function(){return this.filterOnCurrency(this.leftToSpend)},notPrefLeftToSpend:function(){return this.filterOnNotCurrency(this.leftToSpend)},prefNetWorth:function(){return this.filterOnCurrency(this.netWorth)},notPrefNetWorth:function(){return this.filterOnNotCurrency(this.netWorth)},currencyCode:function(){return this.$store.getters.currencyCode},currencyId:function(){return this.$store.getters.currencyId}}),watch:{datesReady:function(t){!0===t&&this.prepareComponent()},start:function(){!1===this.loading&&this.prepareComponent()},end:function(){!1===this.loading&&this.prepareComponent()}},created:function(){this.ready=!0},methods:{filterOnCurrency:function(t){var e=[];for(var a in t)t.hasOwnProperty(a)&&t[a].currency_id===this.currencyId&&e.push(t[a]);return 0===e.length&&t.hasOwnProperty(0)&&e.push(t[0]),e},filterOnNotCurrency:function(t){var e=[];for(var a in t)t.hasOwnProperty(a)&&t[a].currency_id!==this.currencyId&&e.push(t[a]);return e},prepareComponent:function(){var t=this;this.error=!1,this.loading=!0,this.summary=[],this.balances=[],this.billsPaid=[],this.billsUnpaid=[],this.leftToSpend=[],this.netWorth=[];var e=this.start.toISOString().split("T")[0],a=this.end.toISOString().split("T")[0];axios.get("./api/v1/summary/basic?start="+e+"&end="+a).then((function(e){t.summary=e.data,t.buildComponent(),t.loading=!1})).catch((function(e){t.error=!0}))},buildComponent:function(){this.getBalanceEntries(),this.getBillsEntries(),this.getLeftToSpend(),this.getNetWorth()},hasCurrency:function(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].currency_id===this.currencyId)return!0;return!1},getBalanceEntries:function(){this.balances=this.getKeyedEntries("balance-in-")},getNetWorth:function(){this.netWorth=this.getKeyedEntries("net-worth-in-")},getLeftToSpend:function(){this.leftToSpend=this.getKeyedEntries("left-to-spend-in-")},getBillsEntries:function(){this.billsPaid=this.getKeyedEntries("bills-paid-in-"),this.billsUnpaid=this.getKeyedEntries("bills-unpaid-in-")},getKeyedEntries:function(t){var e=[];for(var a in this.summary)this.summary.hasOwnProperty(a)&&t===a.substr(0,t.length)&&e.push(this.summary[a]);return e}}}),f=Object(r.a)(p,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"row"},[a("div",{staticClass:"col"},[a("div",{staticClass:"info-box"},[t._m(0),t._v(" "),a("div",{staticClass:"info-box-content"},[t.loading||t.error?t._e():a("span",{staticClass:"info-box-text"},[t._v(t._s(t.$t("firefly.balance")))]),t._v(" "),t.loading&&!t.error?a("span",{staticClass:"info-box-text"},[a("i",{staticClass:"fas fa-spinner fa-spin"})]):t._e(),t._v(" "),t.error?a("span",{staticClass:"info-box-text"},[a("i",{staticClass:"fas fa-exclamation-triangle text-danger"})]):t._e(),t._v(" "),t._l(t.prefCurrencyBalances,(function(e){return a("span",{staticClass:"info-box-number",attrs:{title:e.sub_title}},[t._v(t._s(e.value_parsed))])})),t._v(" "),t._m(1),t._v(" "),a("span",{staticClass:"progress-description"},[t._l(t.notPrefCurrencyBalances,(function(e,s){return a("span",{attrs:{title:e.sub_title}},[t._v("\n "+t._s(e.value_parsed)),s+1!==t.notPrefCurrencyBalances.length?a("span",[t._v(", ")]):t._e()])})),t._v(" "),0===t.notPrefCurrencyBalances.length?a("span",[t._v(" ")]):t._e()],2)],2)])]),t._v(" "),a("div",{staticClass:"col"},[a("div",{staticClass:"info-box"},[t._m(2),t._v(" "),a("div",{staticClass:"info-box-content"},[t.loading||t.error?t._e():a("span",{staticClass:"info-box-text"},[t._v(t._s(t.$t("firefly.bills_to_pay")))]),t._v(" "),t.loading&&!t.error?a("span",{staticClass:"info-box-text"},[a("i",{staticClass:"fas fa-spinner fa-spin"})]):t._e(),t._v(" "),t.error?a("span",{staticClass:"info-box-text"},[a("i",{staticClass:"fas fa-exclamation-triangle text-danger"})]):t._e(),t._v(" "),t._l(t.prefBillsUnpaid,(function(e){return a("span",{staticClass:"info-box-number"},[t._v(t._s(e.value_parsed))])})),t._v(" "),t._m(3),t._v(" "),a("span",{staticClass:"progress-description"},[t._l(t.notPrefBillsUnpaid,(function(e,s){return a("span",[t._v("\n "+t._s(e.value_parsed)),s+1!==t.notPrefBillsUnpaid.length?a("span",[t._v(", ")]):t._e()])})),t._v(" "),0===t.notPrefBillsUnpaid.length?a("span",[t._v(" ")]):t._e()],2)],2)])]),t._v(" "),a("div",{staticClass:"col"},[a("div",{staticClass:"info-box"},[t._m(4),t._v(" "),a("div",{staticClass:"info-box-content"},[t.loading||t.error?t._e():a("span",{staticClass:"info-box-text"},[t._v(t._s(t.$t("firefly.left_to_spend")))]),t._v(" "),t.loading&&!t.error?a("span",{staticClass:"info-box-text"},[a("i",{staticClass:"fas fa-spinner fa-spin"})]):t._e(),t._v(" "),t.error?a("span",{staticClass:"info-box-text"},[a("i",{staticClass:"fas fa-exclamation-triangle text-danger"})]):t._e(),t._v(" "),t._l(t.prefLeftToSpend,(function(e){return a("span",{staticClass:"info-box-number",attrs:{title:e.sub_title}},[t._v(t._s(e.value_parsed))])})),t._v(" "),t._m(5),t._v(" "),a("span",{staticClass:"progress-description"},[t._l(t.notPrefLeftToSpend,(function(e,s){return a("span",[t._v("\n "+t._s(e.value_parsed)),s+1!==t.notPrefLeftToSpend.length?a("span",[t._v(", ")]):t._e()])})),t._v(" "),0===t.notPrefLeftToSpend.length?a("span",[t._v(" ")]):t._e()],2)],2)])]),t._v(" "),a("div",{staticClass:"col"},[a("div",{staticClass:"info-box"},[t._m(6),t._v(" "),a("div",{staticClass:"info-box-content"},[t.loading||t.error?t._e():a("span",{staticClass:"info-box-text"},[t._v(t._s(t.$t("firefly.net_worth")))]),t._v(" "),t.loading&&!t.error?a("span",{staticClass:"info-box-text"},[a("i",{staticClass:"fas fa-spinner fa-spin"})]):t._e(),t._v(" "),t.error?a("span",{staticClass:"info-box-text"},[a("i",{staticClass:"fas fa-exclamation-triangle text-danger"})]):t._e(),t._v(" "),t._l(t.prefNetWorth,(function(e){return a("span",{staticClass:"info-box-number",attrs:{title:e.sub_title}},[t._v(t._s(e.value_parsed))])})),t._v(" "),t._m(7),t._v(" "),a("span",{staticClass:"progress-description"},[t._l(t.notPrefNetWorth,(function(e,s){return a("span",[t._v("\n "+t._s(e.value_parsed)),s+1!==t.notPrefNetWorth.length?a("span",[t._v(", ")]):t._e()])})),t._v(" "),0===t.notPrefNetWorth.length?a("span",[t._v(" ")]):t._e()],2)],2)])])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("span",{staticClass:"info-box-icon"},[e("i",{staticClass:"far fa-bookmark text-info"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"progress bg-info"},[e("div",{staticClass:"progress-bar",staticStyle:{width:"0"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("span",{staticClass:"info-box-icon"},[e("i",{staticClass:"far fa-calendar-alt text-teal"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"progress bg-teal"},[e("div",{staticClass:"progress-bar",staticStyle:{width:"0"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("span",{staticClass:"info-box-icon"},[e("i",{staticClass:"fas fa-money-bill text-success"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"progress bg-success"},[e("div",{staticClass:"progress-bar",staticStyle:{width:"0"}})])},function(){var t=this.$createElement,e=this._self._c||t;return e("span",{staticClass:"info-box-icon"},[e("i",{staticClass:"fas fa-money-bill text-success"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"progress bg-success"},[e("div",{staticClass:"progress-bar",staticStyle:{width:"0"}})])}],!1,null,null,null).exports,_={name:"DataConverter",data:function(){return{dataSet:null,newDataSet:null,locale:localStorage.local}},methods:{convertChart:function(t){return this.dataSet=t,this.newDataSet={count:0,labels:[],datasets:[]},this.getLabels(),this.getDataSets(),this.newDataSet.count=this.newDataSet.datasets.length,this.newDataSet},colorizeBarData:function(t){this.dataSet=t,this.newDataSet={count:0,labels:[],datasets:[]};for(var e=[[53,124,165],[0,141,76],[219,139,11],[202,25,90],[85,82,153],[66,133,244],[219,68,55],[244,180,0],[15,157,88],[171,71,188],[0,172,193],[255,112,67],[158,157,36],[92,107,192],[240,98,146],[0,121,107],[194,24,91]],a=[],s=0;s<e.length;s++)a.push("rgba("+e[s][0]+", "+e[s][1]+", "+e[s][2]+", 0.5)");for(var r in this.newDataSet.labels=this.dataSet.labels,this.newDataSet.count=this.dataSet.count,this.dataSet.datasets)if(this.dataSet.datasets.hasOwnProperty(r)){var n=this.dataSet.datasets[r];n.fill=!1,n.backgroundColor=n.borderColor=a[r],this.newDataSet.datasets.push(n)}return this.newDataSet},colorizeLineData:function(t){this.dataSet=t,this.newDataSet={count:0,labels:[],datasets:[]};for(var e=[[53,124,165],[0,141,76],[219,139,11],[202,25,90],[85,82,153],[66,133,244],[219,68,55],[244,180,0],[15,157,88],[171,71,188],[0,172,193],[255,112,67],[158,157,36],[92,107,192],[240,98,146],[0,121,107],[194,24,91]],a=[],s=0;s<e.length;s++)a.push("rgba("+e[s][0]+", "+e[s][1]+", "+e[s][2]+", 0.5)");for(var r in this.newDataSet.labels=this.dataSet.labels,this.newDataSet.count=this.dataSet.count,this.dataSet.datasets)if(this.dataSet.datasets.hasOwnProperty(r)){var n=this.dataSet.datasets[r];n.fill=!1,n.backgroundColor=n.borderColor=a[r],this.newDataSet.datasets.push(n)}return this.newDataSet},convertLabelsToDate:function(t){for(var e in t.labels)if(t.labels.hasOwnProperty(e)){var a=Date.parse(t.labels[e]);t.labels[e]=new Intl.DateTimeFormat(this.locale).format(a)}return t},getLabels:function(){var t=this.dataSet[0];if(void 0!==t)for(var e in t.entries)t.entries.hasOwnProperty(e)&&this.newDataSet.labels.push(e)},getDataSets:function(){for(var t in this.dataSet)if(this.dataSet.hasOwnProperty(t)){var e={},a=this.dataSet[t];if(void 0!==a){for(var s in e.label=a.label,e.type=a.type,e.currency_symbol=a.currency_symbol,e.currency_code=a.currency_code,e.yAxisID=a.yAxisID,e.data=[],a.entries)a.entries.hasOwnProperty(s)&&e.data.push(a.entries[s]);this.newDataSet.datasets.push(e)}}}}},b=Object(r.a)(_,void 0,void 0,!1,null,null,null).exports,h={name:"DefaultLineOptions",data:function(){return{}},methods:{formatLabel:function(t,e){var a=[],s=(t=String(t)).split(" "),r="";return s.forEach((function(t,n){if(r.length>0){var i=r+" "+t;if(!(i.length>e))return n===s.length-1?void a.push(i):void(r=i);a.push(r),r=""}n!==s.length-1&&t.length<e?r=t:a.push(t)})),a},getDefaultOptions:function(){var t=this;return{legend:{display:!1},animation:{duration:0},responsive:!0,maintainAspectRatio:!1,elements:{line:{cubicInterpolationMode:"monotone"}},scales:{xAxes:[{gridLines:{display:!1},ticks:{callback:function(e,a,s){var r=new Date(e),n=new Intl.DateTimeFormat(localStorage.locale,{year:"numeric",month:"long",day:"numeric"}).format(r);return t.formatLabel(n,20)}}}],yAxes:[{display:!0,ticks:{callback:function(t){var e=this.chart.data.datasets[0].currency_code?this.chart.data.datasets[0].currency_code:"EUR";return new Intl.NumberFormat(localStorage.locale,{style:"currency",currency:e}).format(t)},beginAtZero:!0}}]},tooltips:{mode:"index",callbacks:{label:function(t,e){var a=e.datasets[t.datasetIndex].currency_code?e.datasets[t.datasetIndex].currency_code:"EUR",s=new Intl.NumberFormat(localStorage.locale,{style:"currency",currency:a}).format(t.yLabel);return e.datasets[t.datasetIndex].label+": "+s}}}}}}},m=Object(r.a)(h,(function(){var t=this.$createElement;return(this._self._c||t)("div")}),[],!1,null,"5f7e90aa",null).exports,g=a(88),v=g.b.reactiveProp,y={extends:g.a,mixins:[v],props:["options"],mounted:function(){this.renderChart(this.chartData,this.options)}},C=Object(r.a)(y,void 0,void 0,!1,null,null,null).exports;function j(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,s)}return a}function w(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?j(Object(a),!0).forEach((function(e){O(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):j(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function O(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var x=Object(i.b)("dashboard/index"),S=(x.mapState,x.mapGetters),P=(x.mapActions,x.mapMutations,{name:"MainAccount",components:{MainAccountChart:C},data:function(){return{loading:!0,error:!1,ready:!1,dataCollection:{},chartOptions:{}}},created:function(){this.ready=!0,this.chartOptions=m.methods.getDefaultOptions()},computed:w(w({},S(["start","end"])),{},{datesReady:function(){return null!==this.start&&null!==this.end&&this.ready}}),watch:{datesReady:function(t){!0===t&&this.initialiseChart()},start:function(){this.initialiseChart()},end:function(){this.initialiseChart()}},methods:{initialiseChart:function(){var t=this;this.loading=!0,this.error=!1;var e="./api/v1/chart/account/overview?start="+this.start.toISOString().split("T")[0]+"&end="+this.end.toISOString().split("T")[0];axios.get(e).then((function(e){var a=b.methods.convertChart(e.data);a=b.methods.colorizeLineData(a),t.dataCollection=a,t.loading=!1})).catch((function(e){t.error=!0}))}}}),L=Object(r.a)(P,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card"},[a("div",{staticClass:"card-header"},[a("h3",{staticClass:"card-title"},[t._v(t._s(t.$t("firefly.yourAccounts")))])]),t._v(" "),a("div",{staticClass:"card-body"},[t.loading?t._e():a("div",[t.loading||t.error?t._e():a("MainAccountChart",{attrs:{"chart-data":t.dataCollection,options:t.chartOptions}})],1),t._v(" "),t.loading&&!t.error?a("div",{staticClass:"text-center"},[a("i",{staticClass:"fas fa-spinner fa-spin"})]):t._e(),t._v(" "),t.error?a("div",{staticClass:"text-center"},[a("i",{staticClass:"fas fa-exclamation-triangle text-danger"})]):t._e()]),t._v(" "),a("div",{staticClass:"card-footer"},[a("a",{staticClass:"btn btn-default button-sm",attrs:{href:"./accounts/asset"}},[a("i",{staticClass:"far fa-money-bill-alt"}),t._v(" "+t._s(t.$t("firefly.go_to_asset_accounts")))])])])}),[],!1,null,null,null).exports;function $(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,s)}return a}function I(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?$(Object(a),!0).forEach((function(e){D(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):$(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function D(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var E=Object(i.b)("dashboard/index"),F=(E.mapState,E.mapGetters),k=(E.mapActions,E.mapMutations,{name:"MainAccountList",data:function(){return{loading:!0,error:!1,ready:!1,accounts:[],locale:"en-US"}},created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US",this.ready=!0},computed:I(I({},F(["start","end"])),{},{datesReady:function(){return null!==this.start&&null!==this.end&&this.ready}}),watch:{datesReady:function(t){!0===t&&this.initialiseList()},start:function(){!1===this.loading&&this.initialiseList()},end:function(){!1===this.loading&&this.initialiseList()}},methods:{initialiseList:function(){var t=this;this.loading=!0,this.accounts=[],axios.get("./api/v1/preferences/frontpageAccounts").then((function(e){t.loadAccounts(e)}))},loadAccounts:function(t){var e=t.data.data.attributes.data;for(var a in e)e.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294&&(this.accounts.push({id:e[a],title:"",url:"",current_balance:"",currency_code:"EUR",transactions:[]}),this.loadSingleAccount(a,e[a]))},loadSingleAccount:function(t,e){var a=this;axios.get("./api/v1/accounts/"+e).then((function(s){a.accounts[t].title=s.data.data.attributes.name,a.accounts[t].url="./accounts/show/"+s.data.data.id,a.accounts[t].current_balance=s.data.data.attributes.current_balance,a.accounts[t].currency_code=s.data.data.attributes.currency_code,a.loadTransactions(t,e)}))},loadTransactions:function(t,e){var a=this,s=this.start.toISOString().split("T")[0],r=this.end.toISOString().split("T")[0];axios.get("./api/v1/accounts/"+e+"/transactions?page=1&limit=10&start="+s+"&end="+r).then((function(e){a.accounts[t].transactions=e.data.data,a.loading=!1,a.error=!1}))}}}),B=Object(r.a)(k,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t.loading&&!t.error?a("div",{staticClass:"row"},[t._m(0)]):t._e(),t._v(" "),t.error?a("div",{staticClass:"row"},[t._m(1)]):t._e(),t._v(" "),t.loading||t.error?t._e():a("div",{staticClass:"row"},t._l(t.accounts,(function(e){return a("div",{class:{"col-lg-12":1===t.accounts.length,"col-lg-6":2===t.accounts.length,"col-lg-4":t.accounts.length>2}},[a("div",{staticClass:"card"},[a("div",{staticClass:"card-header"},[a("h3",{staticClass:"card-title"},[a("a",{attrs:{href:e.url}},[t._v(t._s(e.title))])]),t._v(" "),a("div",{staticClass:"card-tools"},[a("span",{class:parseFloat(e.current_balance)<0?"text-danger":"text-success"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(parseFloat(e.current_balance)))+"\n ")])])]),t._v(" "),a("div",{staticClass:"card-body table-responsive p-0"},[a("div",[1===t.accounts.length?a("transaction-list-large",{attrs:{account_id:e.id,transactions:e.transactions}}):t._e(),t._v(" "),2===t.accounts.length?a("transaction-list-medium",{attrs:{account_id:e.id,transactions:e.transactions}}):t._e(),t._v(" "),t.accounts.length>2?a("transaction-list-small",{attrs:{account_id:e.id,transactions:e.transactions}}):t._e()],1)])])])})),0)])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"col"},[e("div",{staticClass:"card"},[e("div",{staticClass:"card-body"},[e("div",{staticClass:"text-center"},[e("i",{staticClass:"fas fa-spinner fa-spin"})])])])])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"col"},[e("div",{staticClass:"card"},[e("div",{staticClass:"card-body"},[e("div",{staticClass:"text-center"},[e("i",{staticClass:"fas fa-exclamation-triangle text-danger"})])])])])}],!1,null,"5d6bb842",null).exports;function N(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,s)}return a}function T(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?N(Object(a),!0).forEach((function(e){U(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):N(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function U(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var R=Object(i.b)("dashboard/index"),A=(R.mapState,R.mapGetters),z=(R.mapActions,R.mapMutations,{name:"MainBillsList",data:function(){return{bills:[],locale:"en-US",ready:!1,loading:!0,error:!1}},computed:T(T({},A(["start","end"])),{},{datesReady:function(){return null!==this.start&&null!==this.end&&this.ready}}),watch:{datesReady:function(t){!0===t&&this.initialiseBills()},start:function(){!1===this.loading&&this.initialiseBills()},end:function(){!1===this.loading&&this.initialiseBills()}},created:function(){var t;this.ready=!0,this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US"},components:{},methods:{initialiseBills:function(){var t=this;this.loading=!0,this.bills=[];var e=this.start.toISOString().split("T")[0],a=this.end.toISOString().split("T")[0];axios.get("./api/v1/bills?start="+e+"&end="+a).then((function(e){t.loadBills(e.data.data)})).catch((function(e){t.error=!0,t.loading=!1}))},renderPaidDate:function(t){var e=new Intl.DateTimeFormat(this.locale,{year:"numeric",month:"long",day:"numeric"}).format(new Date(t.date)),a=this.$t("firefly.bill_paid_on",{date:e});return'<a href="./transactions/show/'+t.transaction_group_id+'" title="'+a+'">'+a+"</a>"},loadBills:function(t){for(var e in t)if(t.hasOwnProperty(e)&&/^0$|^[1-9]\d*$/.test(e)&&e<=4294967294){var a=t[e],s=a.attributes.active;a.attributes.pay_dates.length>0&&s&&this.bills.push(a)}this.error=!1,this.loading=!1}}}),G=Object(r.a)(z,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card"},[a("div",{staticClass:"card-header"},[a("h3",{staticClass:"card-title"},[t._v(t._s(t.$t("firefly.bills")))])]),t._v(" "),t.loading&&!t.error?a("div",{staticClass:"card-body"},[t._m(0)]):t._e(),t._v(" "),t.error?a("div",{staticClass:"card-body"},[t._m(1)]):t._e(),t._v(" "),t.loading||t.error?t._e():a("div",{staticClass:"card-body table-responsive p-0"},[a("table",{staticClass:"table table-striped"},[a("caption",{staticStyle:{display:"none"}},[t._v(t._s(t.$t("firefly.bills")))]),t._v(" "),a("thead",[a("tr",[a("th",{staticStyle:{width:"35%"},attrs:{scope:"col"}},[t._v(t._s(t.$t("list.name")))]),t._v(" "),a("th",{staticStyle:{width:"25%"},attrs:{scope:"col"}},[t._v(t._s(t.$t("list.next_expected_match")))])])]),t._v(" "),a("tbody",t._l(this.bills,(function(e){return a("tr",[a("td",[a("a",{attrs:{href:"./bills/show/"+e.id,title:e.attributes.name}},[t._v(t._s(e.attributes.name))]),t._v("\n (~ "),a("span",{staticClass:"text-danger"},[t._v(t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.attributes.currency_code}).format((parseFloat(e.attributes.amount_min)+parseFloat(e.attributes.amount_max))/-2)))]),t._v(")\n "),e.attributes.object_group_title?a("small",{staticClass:"text-muted"},[a("br"),t._v("\n "+t._s(e.attributes.object_group_title)+"\n ")]):t._e()]),t._v(" "),a("td",[t._l(e.attributes.paid_dates,(function(e){return a("span",[a("span",{domProps:{innerHTML:t._s(t.renderPaidDate(e))}}),a("br")])})),t._v(" "),t._l(e.attributes.pay_dates,(function(s){return 0===e.attributes.paid_dates.length?a("span",[t._v("\n "+t._s(new Intl.DateTimeFormat(t.locale,{year:"numeric",month:"long",day:"numeric"}).format(new Date(s)))),a("br")]):t._e()}))],2)])})),0)])]),t._v(" "),a("div",{staticClass:"card-footer"},[a("a",{staticClass:"btn btn-default button-sm",attrs:{href:"./bills"}},[a("i",{staticClass:"far fa-money-bill-alt"}),t._v(" "+t._s(t.$t("firefly.go_to_bills")))])])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fas fa-spinner fa-spin"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fas fa-exclamation-triangle text-danger"})])}],!1,null,null,null).exports,M={name:"BudgetLimitRow",created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US"},data:function(){return{locale:"en-US"}},props:{budgetLimit:{type:Object,default:function(){return{}}},budget:{type:Object,default:function(){return{}}}}},W=Object(r.a)(M,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("tr",[a("td",{staticStyle:{width:"25%"}},[a("a",{attrs:{href:"./budgets/show/"+t.budgetLimit.budget_id}},[t._v(t._s(t.budgetLimit.budget_name))])]),t._v(" "),a("td",{staticStyle:{"vertical-align":"middle"}},[a("div",{staticClass:"progress progress active"},[a("div",{staticClass:"progress-bar bg-success progress-bar-striped",style:"width: "+t.budgetLimit.pctGreen+"%;",attrs:{"aria-valuenow":t.budgetLimit.pctGreen,"aria-valuemax":"100","aria-valuemin":"0",role:"progressbar"}},[t.budgetLimit.pctGreen>35?a("span",[t._v("\n "+t._s(t.$t("firefly.spent_x_of_y",{amount:Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.spent),total:Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.amount)}))+"\n ")]):t._e()]),t._v(" "),a("div",{staticClass:"progress-bar bg-warning progress-bar-striped",style:"width: "+t.budgetLimit.pctOrange+"%;",attrs:{"aria-valuenow":t.budgetLimit.pctOrange,"aria-valuemax":"100","aria-valuemin":"0",role:"progressbar"}},[t.budgetLimit.pctRed<=50&&t.budgetLimit.pctOrange>35?a("span",[t._v("\n "+t._s(t.$t("firefly.spent_x_of_y",{amount:Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.spent),total:Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.amount)}))+"\n ")]):t._e()]),t._v(" "),a("div",{staticClass:"progress-bar bg-danger progress-bar-striped",style:"width: "+t.budgetLimit.pctRed+"%;",attrs:{"aria-valuenow":t.budgetLimit.pctRed,"aria-valuemax":"100","aria-valuemin":"0",role:"progressbar"}},[t.budgetLimit.pctOrange<=50&&t.budgetLimit.pctRed>35?a("span",{staticClass:"text-muted"},[t._v("\n "+t._s(t.$t("firefly.spent_x_of_y",{amount:Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.spent),total:Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.amount)}))+"\n ")]):t._e()]),t._v(" "),t.budgetLimit.pctGreen<=35&&0===t.budgetLimit.pctOrange&&0===t.budgetLimit.pctRed&&0!==t.budgetLimit.pctGreen?a("span",{staticStyle:{"line-height":"16px"}},[t._v("\n "+t._s(t.$t("firefly.spent_x_of_y",{amount:Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.spent),total:Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(t.budgetLimit.amount)}))+"\n ")]):t._e()]),t._v(" "),a("small",{staticClass:"d-none d-lg-block"},[t._v("\n "+t._s(new Intl.DateTimeFormat(t.locale,{year:"numeric",month:"long",day:"numeric"}).format(t.budgetLimit.start))+"\n →\n "+t._s(new Intl.DateTimeFormat(t.locale,{year:"numeric",month:"long",day:"numeric"}).format(t.budgetLimit.end))+"\n ")])]),t._v(" "),a("td",{staticClass:"align-middle d-none d-lg-table-cell",staticStyle:{width:"10%"}},[parseFloat(t.budgetLimit.amount)+parseFloat(t.budgetLimit.spent)>0?a("span",{staticClass:"text-success"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(parseFloat(t.budgetLimit.amount)+parseFloat(t.budgetLimit.spent)))+"\n ")]):t._e(),t._v(" "),0===parseFloat(t.budgetLimit.amount)+parseFloat(t.budgetLimit.spent)?a("span",{staticClass:"text-muted"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(0))+"\n ")]):t._e(),t._v(" "),parseFloat(t.budgetLimit.amount)+parseFloat(t.budgetLimit.spent)<0?a("span",{staticClass:"text-danger"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budgetLimit.currency_code}).format(parseFloat(t.budgetLimit.amount)+parseFloat(t.budgetLimit.spent)))+"\n ")]):t._e()])])}),[],!1,null,"7988ecb6",null).exports,q={name:"BudgetRow",created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US"},data:function(){return{locale:"en-US"}},props:{budget:{type:Object,default:{}}}},K={name:"BudgetListGroup",components:{BudgetLimitRow:W,BudgetRow:Object(r.a)(q,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("tr",[a("td",{staticStyle:{width:"25%"}},[a("a",{attrs:{href:"./budgets/show/"+t.budget.id}},[t._v(t._s(t.budget.name))])]),t._v(" "),a("td",{staticClass:"align-middle text-right"},[a("span",{staticClass:"text-danger"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:t.budget.currency_code}).format(parseFloat(t.budget.spent)))+"\n ")])])])}),[],!1,null,"2fc8f640",null).exports},props:{title:String,budgetLimits:Array,budgets:Array}},J=Object(r.a)(K,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card"},[a("div",{staticClass:"card-header"},[a("h3",{staticClass:"card-title"},[t._v(t._s(t.title))])]),t._v(" "),a("div",{staticClass:"card-body table-responsive p-0"},[a("table",{staticClass:"table table-sm"},[a("tbody",[t._l(t.budgetLimits,(function(t,e){return a("BudgetLimitRow",{key:e,attrs:{budgetLimit:t}})})),t._v(" "),t._l(t.budgets,(function(t,e){return a("BudgetRow",{key:e,attrs:{budget:t}})}))],2)])]),t._v(" "),a("div",{staticClass:"card-footer"},[a("a",{staticClass:"btn btn-default button-sm",attrs:{href:"./budgets"}},[a("i",{staticClass:"far fa-money-bill-alt"}),t._v(" "+t._s(t.$t("firefly.go_to_budgets")))])])])}),[],!1,null,"658dd996",null).exports;function H(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,s)}return a}function Z(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?H(Object(a),!0).forEach((function(e){Q(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):H(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function Q(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var V=Object(i.b)("dashboard/index"),X=(V.mapState,V.mapGetters),Y=(V.mapActions,V.mapMutations,{name:"MainBudgetList",components:{BudgetListGroup:J},data:function(){return{budgetList:["daily","weekly","monthly","quarterly","half_year","yearly","other"],budgetLimits:{daily:[],weekly:[],monthly:[],quarterly:[],half_year:[],yearly:[],other:[]},budgets:{},rawBudgets:[],locale:"en-US",ready:!1,loading:!0,error:!1}},created:function(){var t;this.ready=!0,this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US"},watch:{datesReady:function(t){!0===t&&this.getBudgets()},start:function(){!1===this.loading&&this.getBudgets()},end:function(){!1===this.loading&&this.getBudgets()}},computed:Z(Z({},X(["start","end"])),{},{datesReady:function(){return null!==this.start&&null!==this.end&&this.ready}}),methods:{getBudgets:function(){var t=this;this.budgets={},this.rawBudgets=[],this.budgetLimits={daily:[],weekly:[],monthly:[],quarterly:[],half_year:[],yearly:[],other:[]},this.loading=!0;var e=this.start.toISOString().split("T")[0],a=this.end.toISOString().split("T")[0];axios.get("./api/v1/budgets?start="+e+"&end="+a).then((function(e){t.parseBudgets(e.data)}))},parseBudgets:function(t){for(var e in t.data)if(t.data.hasOwnProperty(e)&&/^0$|^[1-9]\d*$/.test(e)&&e<=4294967294){var a=t.data[e];if(!1===a.attributes.active)continue;for(var s in a.attributes.spent)if(a.attributes.spent.hasOwnProperty(s)&&/^0$|^[1-9]\d*$/.test(s)&&s<=4294967294){var r=a.attributes.spent[s];this.rawBudgets.push({id:parseInt(a.id),name:a.attributes.name,currency_id:parseInt(r.currency_id),currency_code:r.currency_code,spent:r.sum}),console.log("Added budget "+a.attributes.name+" ("+r.currency_code+")")}}this.getBudgetLimits()},getBudgetLimits:function(){var t=this,e=this.start.toISOString().split("T")[0],a=this.end.toISOString().split("T")[0];axios.get("./api/v1/budget-limits?start="+e+"&end="+a).then((function(e){t.parseBudgetLimits(e.data),t.loading=!1}))},parseBudgetLimits:function(t){for(var e in t.included)if(t.included.hasOwnProperty(e)&&/^0$|^[1-9]\d*$/.test(e)&&e<=4294967294){var a=t.included[e],s=parseInt(a.id);this.budgets[s]={id:s,name:a.attributes.name},console.log("Collected meta data: budget #"+s+" is named "+a.attributes.name)}for(var r in t.data)if(t.data.hasOwnProperty(r)&&/^0$|^[1-9]\d*$/.test(r)&&r<=4294967294){var n,i=t.data[r],c=parseInt(i.id),o=parseInt(i.attributes.budget_id),l=parseInt(i.attributes.currency_id),u=parseFloat(i.attributes.spent),d=parseFloat(i.attributes.amount),p=null!==(n=i.attributes.period)&&void 0!==n?n:"other",f=0,_=0,b=0;console.log('Collected "'+p+'" budget limit #'+c+" (part of budget #"+o+")"),console.log("Spent "+u+" of "+d),this.filterBudgets(o,l),0!==u&&-1*u<d&&(f=-1*u/(100*d)),0!==u&&-1*u>d&&(b=100-(_=d/(-1*u)*100));var h={id:c,amount:i.attributes.amount,budget_id:o,budget_name:this.budgets[i.attributes.budget_id].name,currency_id:l,currency_code:i.attributes.currency_code,period:i.attributes.period,start:new Date(i.attributes.start),end:new Date(i.attributes.end),spent:i.attributes.spent,pctGreen:f,pctOrange:_,pctRed:b};this.budgetLimits[p].push(h)}},filterBudgets:function(t,e){for(var a in this.rawBudgets)this.rawBudgets.hasOwnProperty(a)&&/^0$|^[1-9]\d*$/.test(a)&&a<=4294967294&&this.rawBudgets[a].currency_id===e&&this.rawBudgets[a].id===t&&(console.log("Budget "+this.rawBudgets[a].name+" with currency "+this.rawBudgets[a].currency_code+" will be removed in favor of a budget limit."),this.rawBudgets.splice(parseInt(a),1))}}}),tt=Object(r.a)(Y,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",[t.loading?t._e():a("div",{staticClass:"row"},[t.budgetLimits.daily.length>0?a("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[a("BudgetListGroup",{attrs:{budgetLimits:t.budgetLimits.daily,title:t.$t("firefly.daily_budgets")}})],1):t._e(),t._v(" "),t.budgetLimits.weekly.length>0?a("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[a("BudgetListGroup",{attrs:{budgetLimits:t.budgetLimits.weekly,title:t.$t("firefly.weekly_budgets")}})],1):t._e(),t._v(" "),t.budgetLimits.monthly.length>0?a("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[a("BudgetListGroup",{attrs:{budgetLimits:t.budgetLimits.monthly,title:t.$t("firefly.monthly_budgets")}})],1):t._e(),t._v(" "),t.budgetLimits.quarterly.length>0?a("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[a("BudgetListGroup",{attrs:{budgetLimits:t.budgetLimits.quarterly,title:t.$t("firefly.quarterly_budgets")}})],1):t._e(),t._v(" "),t.budgetLimits.half_year.length>0?a("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[a("BudgetListGroup",{attrs:{budgetLimits:t.budgetLimits.half_year,title:t.$t("firefly.half_year_budgets")}})],1):t._e(),t._v(" "),t.budgetLimits.yearly.length>0?a("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[a("BudgetListGroup",{attrs:{budgetLimits:t.budgetLimits.yearly,title:t.$t("firefly.yearly_budgets")}})],1):t._e(),t._v(" "),t.budgetLimits.other.length>0||t.rawBudgets.length>0?a("div",{staticClass:"col-xl-6 col-lg-12 col-md-12 col-sm-12 col-xs-12"},[a("BudgetListGroup",{attrs:{budgetLimits:t.budgetLimits.other,budgets:t.rawBudgets,title:t.$t("firefly.other_budgets")}})],1):t._e()]),t._v(" "),t.loading&&!t.error?a("div",{staticClass:"row"},[t._m(0)]):t._e()])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"col"},[e("div",{staticClass:"card"},[e("div",{staticClass:"card-body"},[e("div",{staticClass:"text-center"},[e("i",{staticClass:"fas fa-spinner fa-spin"})])])])])}],!1,null,"5d7e4c93",null).exports;function et(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,s)}return a}function at(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?et(Object(a),!0).forEach((function(e){st(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):et(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function st(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var rt=Object(i.b)("dashboard/index"),nt=(rt.mapState,rt.mapGetters),it=(rt.mapActions,rt.mapMutations,{name:"MainCreditList",data:function(){return{locale:"en-US",income:[],max:0,loading:!0,error:!1}},created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US",this.ready=!0},computed:at(at({},nt(["start","end"])),{},{datesReady:function(){return null!==this.start&&null!==this.end&&this.ready}}),watch:{datesReady:function(t){!0===t&&this.getIncome()},start:function(){!1===this.loading&&this.getIncome()},end:function(){!1===this.loading&&this.getIncome()}},methods:{getIncome:function(){var t=this;this.loading=!0,this.income=[],this.error=!1;var e=this.start.toISOString().split("T")[0],a=this.end.toISOString().split("T")[0];axios.get("./api/v1/insight/income/revenue?start="+e+"&end="+a).then((function(e){t.parseIncome(e.data),t.loading=!1})).catch((function(e){t.error=!0}))},parseIncome:function(t){for(var e in t)if(t.hasOwnProperty(e)&&/^0$|^[1-9]\d*$/.test(e)&&e<=4294967294){var a=t[e];0===parseInt(e)&&(this.max=t[e].difference_float,a.pct=100),0!==parseInt(e)&&(a.pct=t[e].difference_float/this.max*100),this.income.push(a)}}}}),ct=Object(r.a)(it,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card"},[a("div",{staticClass:"card-header"},[a("h3",{staticClass:"card-title"},[t._v(t._s(t.$t("firefly.revenue_accounts")))])]),t._v(" "),t.loading&&!t.error?a("div",{staticClass:"card-body"},[t._m(0)]):t._e(),t._v(" "),t.error?a("div",{staticClass:"card-body"},[t._m(1)]):t._e(),t._v(" "),t.loading||t.error?t._e():a("div",{staticClass:"card-body table-responsive p-0"},[a("table",{staticClass:"table table-sm"},[a("tbody",t._l(t.income,(function(e){return a("tr",[a("td",{staticStyle:{width:"20%"}},[a("a",{attrs:{href:"./accounts/show/"+e.id}},[t._v(t._s(e.name))])]),t._v(" "),a("td",{staticClass:"align-middle"},[e.pct>0?a("div",{staticClass:"progress"},[a("div",{staticClass:"progress-bar progress-bar-striped bg-success",style:{width:e.pct+"%"},attrs:{"aria-valuenow":e.pct,"aria-valuemax":"100","aria-valuemin":"0",role:"progressbar"}},[e.pct>20?a("span",[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.difference_float))+"\n ")]):t._e()]),t._v(" "),e.pct<=20?a("span",{staticStyle:{"line-height":"16px"}},[t._v(" \n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.difference_float))+"\n ")]):t._e()]):t._e()])])})),0)])]),t._v(" "),a("div",{staticClass:"card-footer"},[a("a",{staticClass:"btn btn-default button-sm",attrs:{href:"./transactions/deposit"}},[a("i",{staticClass:"far fa-money-bill-alt"}),t._v(" "+t._s(t.$t("firefly.go_to_deposits")))])])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fas fa-spinner fa-spin"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fas fa-exclamation-triangle text-danger"})])}],!1,null,null,null).exports;function ot(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,s)}return a}function lt(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?ot(Object(a),!0).forEach((function(e){ut(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):ot(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function ut(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var dt=Object(i.b)("dashboard/index"),pt=(dt.mapState,dt.mapGetters),ft=(dt.mapActions,dt.mapMutations,{name:"MainDebitList",data:function(){return{locale:"en-US",expenses:[],max:0,loading:!0,error:!1}},created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US",this.ready=!0},computed:lt(lt({},pt(["start","end"])),{},{datesReady:function(){return null!==this.start&&null!==this.end&&this.ready}}),watch:{datesReady:function(t){!0===t&&this.getExpenses()},start:function(){!1===this.loading&&this.getExpenses()},end:function(){!1===this.loading&&this.getExpenses()}},methods:{getExpenses:function(){var t=this;this.loading=!0,this.error=!1,this.expenses=[];var e=this.start.toISOString().split("T")[0],a=this.end.toISOString().split("T")[0];axios.get("./api/v1/insight/expense/expense?start="+e+"&end="+a).then((function(e){t.parseExpenses(e.data),t.loading=!1})).catch((function(e){t.error=!0}))},parseExpenses:function(t){for(var e in t)if(t.hasOwnProperty(e)&&/^0$|^[1-9]\d*$/.test(e)&&e<=4294967294){var a=t[e];0===parseInt(e)&&(this.max=t[e].difference_float,a.pct=100),0!==parseInt(e)&&(a.pct=t[e].difference_float/this.max*100),this.expenses.push(a)}}}}),_t=Object(r.a)(ft,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card"},[a("div",{staticClass:"card-header"},[a("h3",{staticClass:"card-title"},[t._v(t._s(t.$t("firefly.expense_accounts")))])]),t._v(" "),t.loading&&!t.error?a("div",{staticClass:"card-body"},[t._m(0)]):t._e(),t._v(" "),t.error?a("div",{staticClass:"card-body"},[t._m(1)]):t._e(),t._v(" "),t.loading||t.error?t._e():a("div",{staticClass:"card-body table-responsive p-0"},[a("table",{staticClass:"table table-sm"},[a("tbody",t._l(t.expenses,(function(e){return a("tr",[a("td",{staticStyle:{width:"20%"}},[a("a",{attrs:{href:"./accounts/show/"+e.id}},[t._v(t._s(e.name))])]),t._v(" "),a("td",{staticClass:"align-middle"},[e.pct>0?a("div",{staticClass:"progress"},[a("div",{staticClass:"progress-bar progress-bar-striped bg-danger",style:{width:e.pct+"%"},attrs:{"aria-valuenow":e.pct,"aria-valuemax":"100","aria-valuemin":"0",role:"progressbar"}},[e.pct>20?a("span",[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.difference_float))+"\n ")]):t._e()]),t._v(" "),e.pct<=20?a("span",{staticStyle:{"line-height":"16px"}},[t._v(" \n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.difference_float))+"\n ")]):t._e()]):t._e()])])})),0)])]),t._v(" "),a("div",{staticClass:"card-footer"},[a("a",{staticClass:"btn btn-default button-sm",attrs:{href:"./transactions/withdrawal"}},[a("i",{staticClass:"far fa-money-bill-alt"}),t._v(" "+t._s(t.$t("firefly.go_to_withdrawals")))])])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fas fa-spinner fa-spin"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fas fa-exclamation-triangle text-danger"})])}],!1,null,null,null).exports,bt={name:"MainPiggyList",data:function(){return{piggy_banks:[],loading:!0,error:!1,locale:"en-US"}},created:function(){var t,e=this;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US",axios.get("./api/v1/piggy_banks").then((function(t){e.loadPiggyBanks(t.data.data),e.loading=!1})).catch((function(t){e.error=!0}))},methods:{loadPiggyBanks:function(t){for(var e in t)if(t.hasOwnProperty(e)&&/^0$|^[1-9]\d*$/.test(e)&&e<=4294967294){var a=t[e];0!==parseFloat(a.attributes.left_to_save)&&(a.attributes.pct=parseFloat(a.attributes.current_amount)/parseFloat(a.attributes.target_amount)*100,this.piggy_banks.push(a))}this.piggy_banks.sort((function(t,e){return e.attributes.pct-t.attributes.pct}))}}},ht=Object(r.a)(bt,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card"},[a("div",{staticClass:"card-header"},[a("h3",{staticClass:"card-title"},[t._v(t._s(t.$t("firefly.piggy_banks")))])]),t._v(" "),t.loading&&!t.error?a("div",{staticClass:"card-body"},[t._m(0)]):t._e(),t._v(" "),t.error?a("div",{staticClass:"card-body"},[t._m(1)]):t._e(),t._v(" "),t.loading||t.error?t._e():a("div",{staticClass:"card-body table-responsive p-0"},[a("table",{staticClass:"table table-striped"},[a("caption",{staticStyle:{display:"none"}},[t._v(t._s(t.$t("firefly.piggy_banks")))]),t._v(" "),a("thead",[a("tr",[a("th",{staticStyle:{width:"35%"},attrs:{scope:"col"}},[t._v(t._s(t.$t("list.piggy_bank")))]),t._v(" "),a("th",{staticStyle:{width:"40%"},attrs:{scope:"col"}},[t._v(t._s(t.$t("list.percentage"))+" "),a("small",[t._v("/ "+t._s(t.$t("list.amount")))])])])]),t._v(" "),a("tbody",t._l(this.piggy_banks,(function(e){return a("tr",[a("td",[a("a",{attrs:{href:"./piggy-banks/show/"+e.id,title:e.attributes.name}},[t._v(t._s(e.attributes.name))]),t._v(" "),e.attributes.object_group_title?a("small",{staticClass:"text-muted"},[a("br"),t._v("\n "+t._s(e.attributes.object_group_title)+"\n ")]):t._e()]),t._v(" "),a("td",[a("div",{staticClass:"progress-group"},[a("div",{staticClass:"progress progress-sm"},[e.attributes.pct<100?a("div",{staticClass:"progress-bar progress-bar-striped primary",style:{width:e.attributes.pct+"%"}}):t._e(),t._v(" "),100===e.attributes.pct?a("div",{staticClass:"progress-bar progress-bar-striped bg-success",style:{width:e.attributes.pct+"%"}}):t._e()])]),t._v(" "),a("span",{staticClass:"text-success"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.attributes.currency_code}).format(e.attributes.current_amount))+"\n ")]),t._v("\n of\n "),a("span",{staticClass:"text-success"},[t._v(t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.attributes.currency_code}).format(e.attributes.target_amount)))])])])})),0)])]),t._v(" "),a("div",{staticClass:"card-footer"},[a("a",{staticClass:"btn btn-default button-sm",attrs:{href:"./piggy-banks"}},[a("i",{staticClass:"far fa-money-bill-alt"}),t._v(" "+t._s(t.$t("firefly.go_to_piggies")))])])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fas fa-spinner fa-spin"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fas fa-exclamation-triangle text-danger"})])}],!1,null,"c17c9a5a",null).exports,mt={name:"TransactionListLarge",data:function(){return{locale:"en-US"}},created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US"},props:{transactions:{type:Array,default:function(){return[]}},account_id:{type:Number,default:function(){return 0}}}},gt=Object(r.a)(mt,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",{staticClass:"table table-striped table-sm"},[a("caption",{staticStyle:{display:"none"}},[t._v(t._s(t.$t("firefly.transaction_table_description")))]),t._v(" "),a("thead",[a("tr",[a("th",{staticClass:"text-left",attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.description")))]),t._v(" "),a("th",{attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.opposing_account")))]),t._v(" "),a("th",{staticClass:"text-right",attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.amount")))]),t._v(" "),a("th",{attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.category")))]),t._v(" "),a("th",{attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.budget")))])])]),t._v(" "),a("tbody",t._l(this.transactions,(function(e){return a("tr",[a("td",[a("a",{attrs:{href:"transactions/show/"+e.id,title:e.date}},[e.attributes.transactions.length>1?a("span",[t._v(t._s(e.attributes.group_title))]):t._e(),t._v(" "),1===e.attributes.transactions.length?a("span",[t._v(t._s(e.attributes.transactions[0].description))]):t._e()])]),t._v(" "),a("td",t._l(e.attributes.transactions,(function(e){return a("span",["withdrawal"===e.type?a("a",{attrs:{href:"accounts/show/"+e.destination_id}},[t._v(t._s(e.destination_name))]):t._e(),t._v(" "),"deposit"===e.type?a("a",{attrs:{href:"accounts/show/"+e.source_id}},[t._v(t._s(e.source_name))]):t._e(),t._v(" "),"transfer"===e.type&&parseInt(e.source_id)===t.account_id?a("a",{attrs:{href:"accounts/show/"+e.destination_id}},[t._v(t._s(e.destination_name))]):t._e(),t._v(" "),"transfer"===e.type&&parseInt(e.destination_id)===t.account_id?a("a",{attrs:{href:"accounts/show/"+e.source_id}},[t._v(t._s(e.source_name))]):t._e(),t._v(" "),a("br")])})),0),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},t._l(e.attributes.transactions,(function(e){return a("span",["withdrawal"===e.type?a("span",{staticClass:"text-danger"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(-1*e.amount))),a("br")]):t._e(),t._v(" "),"deposit"===e.type?a("span",{staticClass:"text-success"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.amount))),a("br")]):t._e(),t._v(" "),"transfer"===e.type&&parseInt(e.source_id)===t.account_id?a("span",{staticClass:"text-info"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(-1*e.amount))),a("br")]):t._e(),t._v(" "),"transfer"===e.type&&parseInt(e.destination_id)===t.account_id?a("span",{staticClass:"text-info"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.amount))),a("br")]):t._e()])})),0),t._v(" "),a("td",t._l(e.attributes.transactions,(function(e){return a("span",[0!==e.category_id?a("a",{attrs:{href:"categories/show/"+e.category_id}},[t._v(t._s(e.category_name))]):t._e(),a("br")])})),0),t._v(" "),a("td",t._l(e.attributes.transactions,(function(e){return a("span",[0!==e.budget_id?a("a",{attrs:{href:"budgets/show/"+e.budget_id}},[t._v(t._s(e.budget_name))]):t._e(),a("br")])})),0)])})),0)])}),[],!1,null,"6e420753",null).exports,vt={name:"TransactionListMedium",data:function(){return{locale:"en-US"}},created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US"},props:{transactions:{type:Array,default:function(){return[]}},account_id:{type:Number,default:function(){return 0}}}},yt=Object(r.a)(vt,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",{staticClass:"table table-striped table-sm"},[a("caption",{staticStyle:{display:"none"}},[t._v(t._s(t.$t("firefly.transaction_table_description")))]),t._v(" "),a("thead",[a("tr",[a("th",{staticClass:"text-left",attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.description")))]),t._v(" "),a("th",{attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.opposing_account")))]),t._v(" "),a("th",{staticClass:"text-right",attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.amount")))])])]),t._v(" "),a("tbody",t._l(this.transactions,(function(e){return a("tr",[a("td",[a("a",{attrs:{href:"transactions/show/"+e.id,title:e.date}},[e.attributes.transactions.length>1?a("span",[t._v(t._s(e.attributes.group_title))]):t._e(),t._v(" "),1===e.attributes.transactions.length?a("span",[t._v(t._s(e.attributes.transactions[0].description))]):t._e()])]),t._v(" "),a("td",t._l(e.attributes.transactions,(function(e){return a("span",["withdrawal"===e.type?a("a",{attrs:{href:"accounts/show/"+e.destination_id}},[t._v(t._s(e.destination_name))]):t._e(),t._v(" "),"deposit"===e.type?a("a",{attrs:{href:"accounts/show/"+e.source_id}},[t._v(t._s(e.source_name))]):t._e(),t._v(" "),"transfer"===e.type&&parseInt(e.source_id)===t.account_id?a("a",{attrs:{href:"accounts/show/"+e.destination_id}},[t._v(t._s(e.destination_name))]):t._e(),t._v(" "),"transfer"===e.type&&parseInt(e.destination_id)===t.account_id?a("a",{attrs:{href:"accounts/show/"+e.source_id}},[t._v(t._s(e.source_name))]):t._e(),t._v(" "),a("br")])})),0),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},t._l(e.attributes.transactions,(function(e){return a("span",["withdrawal"===e.type?a("span",{staticClass:"text-danger"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(-1*e.amount))),a("br")]):t._e(),t._v(" "),"deposit"===e.type?a("span",{staticClass:"text-success"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.amount))),a("br")]):t._e(),t._v(" "),"transfer"===e.type&&parseInt(e.source_id)===t.account_id?a("span",{staticClass:"text-info"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(-1*e.amount))),a("br")]):t._e(),t._v(" "),"transfer"===e.type&&parseInt(e.destination_id)===t.account_id?a("span",{staticClass:"text-info"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.amount))),a("br")]):t._e()])})),0)])})),0)])}),[],!1,null,"0d4f7042",null).exports,Ct={name:"TransactionListSmall",data:function(){return{locale:"en-US"}},created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US"},methods:{},props:{transactions:{type:Array,default:function(){return[]}},account_id:{type:Number,default:function(){return 0}}}},jt=Object(r.a)(Ct,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("table",{staticClass:"table table-striped table-sm"},[a("caption",{staticStyle:{display:"none"}},[t._v(t._s(t.$t("firefly.transaction_table_description")))]),t._v(" "),a("thead",[a("tr",[a("th",{staticClass:"text-left",attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.description")))]),t._v(" "),a("th",{staticClass:"text-right",attrs:{scope:"col"}},[t._v(t._s(t.$t("firefly.amount")))])])]),t._v(" "),a("tbody",t._l(this.transactions,(function(e){return a("tr",[a("td",[a("a",{attrs:{href:"transactions/show/"+e.id,title:new Intl.DateTimeFormat(t.locale,{year:"numeric",month:"long",day:"numeric"}).format(new Date(e.attributes.transactions[0].date))}},[e.attributes.transactions.length>1?a("span",[t._v(t._s(e.attributes.group_title))]):t._e(),t._v(" "),1===e.attributes.transactions.length?a("span",[t._v(t._s(e.attributes.transactions[0].description))]):t._e()])]),t._v(" "),a("td",{staticStyle:{"text-align":"right"}},t._l(e.attributes.transactions,(function(e){return a("span",["withdrawal"===e.type?a("span",{staticClass:"text-danger"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(-1*e.amount))),a("br")]):t._e(),t._v(" "),"deposit"===e.type?a("span",{staticClass:"text-success"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.amount))),a("br")]):t._e(),t._v(" "),"transfer"===e.type&&parseInt(e.source_id)===t.account_id?a("span",{staticClass:"text-info"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(-1*e.amount))),a("br")]):t._e(),t._v(" "),"transfer"===e.type&&parseInt(e.destination_id)===t.account_id?a("span",{staticClass:"text-info"},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.amount))),a("br")]):t._e()])})),0)])})),0)])}),[],!1,null,"4cd7a656",null).exports,wt=a(67);function Ot(t,e){var a=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),a.push.apply(a,s)}return a}function xt(t){for(var e=1;e<arguments.length;e++){var a=null!=arguments[e]?arguments[e]:{};e%2?Ot(Object(a),!0).forEach((function(e){St(t,e,a[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(a)):Ot(Object(a)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(a,e))}))}return t}function St(t,e,a){return e in t?Object.defineProperty(t,e,{value:a,enumerable:!0,configurable:!0,writable:!0}):t[e]=a,t}var Pt=Object(i.b)("dashboard/index"),Lt=(Pt.mapState,Pt.mapGetters),$t=(Pt.mapActions,Pt.mapMutations,{name:"MainCategoryList",created:function(){var t;this.locale=null!==(t=localStorage.locale)&&void 0!==t?t:"en-US",this.ready=!0},data:function(){return{locale:"en-US",categories:[],sortedList:[],spent:0,earned:0,loading:!0,error:!1}},computed:xt(xt({},Lt(["start","end"])),{},{datesReady:function(){return null!==this.start&&null!==this.end&&this.ready}}),watch:{datesReady:function(t){!0===t&&this.getCategories()},start:function(){!1===this.loading&&this.getCategories()},end:function(){!1===this.loading&&this.getCategories()}},methods:{getCategories:function(){var t=this;this.categories=[],this.sortedList=[],this.spent=0,this.earned=0,this.loading=!0;var e=this.start.toISOString().split("T")[0],a=this.end.toISOString().split("T")[0];axios.get("./api/v1/categories?start="+e+"&end="+a).then((function(e){t.parseCategories(e.data),t.loading=!1})).catch((function(e){t.error=!0}))},parseCategories:function(t){for(var e in t.data)if(t.data.hasOwnProperty(e)&&/^0$|^[1-9]\d*$/.test(e)&&e<=4294967294){var a=t.data[e],s=null,r=parseInt(a.id);for(var n in a.attributes.spent)if(a.attributes.spent.hasOwnProperty(n)&&/^0$|^[1-9]\d*$/.test(n)&&n<=4294967294){var i,c=a.attributes.spent[n];s=c.currency_id+"-"+a.id,this.categories[s]=null!==(i=this.categories[s])&&void 0!==i?i:{id:r,name:a.attributes.name,currency_code:c.currency_code,currency_symbol:c.currency_symbol,spent:0,earned:0,spentPct:0,earnedPct:0},this.categories[s].spent=parseFloat(c.sum),this.spent=parseFloat(c.sum)<this.spent?parseFloat(c.sum):this.spent}for(var o in a.attributes.earned)if(a.attributes.earned.hasOwnProperty(o)&&/^0$|^[1-9]\d*$/.test(o)&&o<=4294967294){var l,u=a.attributes.earned[o];s=u.currency_id+"-"+a.id,this.categories[s]=null!==(l=this.categories[s])&&void 0!==l?l:{id:r,name:a.attributes.name,currency_code:u.currency_code,currency_symbol:u.currency_symbol,spent:0,earned:0,spentPct:0,earnedPct:0},this.categories[s].earned=parseFloat(u.sum),this.earned=parseFloat(u.sum)>this.earned?parseFloat(u.sum):this.earned}}this.sortCategories()},sortCategories:function(){var t=[];for(var e in this.categories)this.categories.hasOwnProperty(e)&&t.push(this.categories[e]);for(var a in t.sort((function(t,e){return t.spent+t.earned-(e.spent+e.earned)})),t)if(t.hasOwnProperty(a)){var s=t[a];s.spentPct=s.spent/this.spent*100,s.earnedPct=s.earned/this.earned*100,this.sortedList.push(s)}}}}),It=Object(r.a)($t,(function(){var t=this,e=t.$createElement,a=t._self._c||e;return a("div",{staticClass:"card"},[a("div",{staticClass:"card-header"},[a("h3",{staticClass:"card-title"},[t._v(t._s(t.$t("firefly.categories")))])]),t._v(" "),t.loading&&!t.error?a("div",{staticClass:"card-body"},[t._m(0)]):t._e(),t._v(" "),t.error?a("div",{staticClass:"card-body"},[t._m(1)]):t._e(),t._v(" "),t.loading||t.error?t._e():a("div",{staticClass:"card-body table-responsive p-0"},[a("table",{staticClass:"table table-sm"},[a("tbody",t._l(t.sortedList,(function(e){return a("tr",[a("td",{staticStyle:{width:"20%"}},[a("a",{attrs:{href:"./categories/show/"+e.id}},[t._v(t._s(e.name))])]),t._v(" "),a("td",{staticClass:"align-middle"},[e.spentPct>0?a("div",{staticClass:"progress"},[a("div",{staticClass:"progress-bar progress-bar-striped bg-danger",style:{width:e.spentPct+"%"},attrs:{"aria-valuenow":e.spentPct,"aria-valuemax":"100","aria-valuemin":"0",role:"progressbar"}},[e.spentPct>20?a("span",[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.spent))+"\n ")]):t._e()]),t._v(" "),e.spentPct<=20?a("span",{staticClass:"progress-label",staticStyle:{"line-height":"16px"}},[t._v(" \n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.spent))+"\n ")]):t._e()]):t._e(),t._v(" "),e.earnedPct>0?a("div",{staticClass:"progress justify-content-end",attrs:{title:"hello2"}},[e.earnedPct<=20?a("span",{staticStyle:{"line-height":"16px"}},[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.earned))+"\n ")]):t._e(),t._v(" "),a("div",{staticClass:"progress-bar progress-bar-striped bg-success",style:{width:e.earnedPct+"%"},attrs:{"aria-valuenow":e.earnedPct,"aria-valuemax":"100","aria-valuemin":"0",role:"progressbar",title:"hello"}},[e.earnedPct>20?a("span",[t._v("\n "+t._s(Intl.NumberFormat(t.locale,{style:"currency",currency:e.currency_code}).format(e.earned))+"\n ")]):t._e()])]):t._e()])])})),0)])])])}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fas fa-spinner fa-spin"})])},function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"text-center"},[e("i",{staticClass:"fas fa-exclamation-triangle text-danger"})])}],!1,null,"098366f9",null).exports,Dt=a(8),Et=a.n(Dt),Ft=a(30);a(41),a(85),Et.a.component("transaction-list-large",gt),Et.a.component("transaction-list-medium",yt),Et.a.component("transaction-list-small",jt),Et.a.component("dashboard",n),Et.a.component("top-boxes",f),Et.a.component("main-account",L),Et.a.component("main-account-list",B),Et.a.component("main-bills-list",G),Et.a.component("main-budget-list",tt),Et.a.component("main-category-list",It),Et.a.component("main-debit-list",_t),Et.a.component("main-credit-list",ct),Et.a.component("main-piggy-list",ht),Et.a.use(i.c);var kt=a(43),Bt={};new Et.a({i18n:kt,store:Ft.a,el:"#dashboard",render:function(t){return t(n,{props:Bt})},beforeCreate:function(){this.$store.commit("initialiseStore"),this.$store.dispatch("updateCurrencyPreference"),this.$store.dispatch("root/initialiseStore"),this.$store.dispatch("dashboard/index/initialiseStore")}}),new Et.a({i18n:kt,store:Ft.a,el:"#calendar",render:function(t){return t(wt.a,{props:Bt})}})},725:function(t,e){}},[[276,0,1]]]);
|
||
//# sourceMappingURL=dashboard.js.map
|