(self.webpackChunk=self.webpackChunk||[]).push([[486],{232:(e,t,a)=>{"use strict";a.r(t);var n=a(7760),o=a.n(n),i=a(7152),r=a(4605);window.$=window.jQuery=a(9755),window.axios=a(9669),window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";var s=document.head.querySelector('meta[name="csrf-token"]');s?window.axios.defaults.headers.common["X-CSRF-TOKEN"]=s.content:console.error("CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token");var l=document.head.querySelector('meta[name="locale"]');localStorage.locale=l?l.content:"en_US",a(6891),a(3734),a(7632),a(5432),window.vuei18n=i.Z,window.uiv=r,o().use(vuei18n),o().use(r),window.Vue=o()},9899:(e,t,a)=>{"use strict";a.d(t,{Z:()=>x});var n=a(7760),o=a.n(n),i=a(629),r=a(4478),s=a(3465);const l={namespaced:!0,state:function(){return{transactionType:"any",groupTitle:"",transactions:[],customDateFields:{interest_date:!1,book_date:!1,process_date:!1,due_date:!1,payment_date:!1,invoice_date:!1},defaultTransaction:(0,r.f$)(),defaultErrors:(0,r.kQ)()}},getters:{transactions:function(e){return e.transactions},defaultErrors:function(e){return e.defaultErrors},groupTitle:function(e){return e.groupTitle},transactionType:function(e){return e.transactionType},accountToTransaction:function(e){return e.accountToTransaction},defaultTransaction:function(e){return e.defaultTransaction},sourceAllowedTypes:function(e){return e.sourceAllowedTypes},destinationAllowedTypes:function(e){return e.destinationAllowedTypes},allowedOpposingTypes:function(e){return e.allowedOpposingTypes},customDateFields:function(e){return e.customDateFields}},actions:{},mutations:{addTransaction:function(e){var t=s(e.defaultTransaction);t.errors=s(e.defaultErrors),e.transactions.push(t)},resetErrors:function(e,t){e.transactions[t.index].errors=s(e.defaultErrors)},resetTransactions:function(e){e.transactions=[]},setGroupTitle:function(e,t){e.groupTitle=t.groupTitle},setCustomDateFields:function(e,t){e.customDateFields=t},deleteTransaction:function(e,t){e.transactions.splice(t.index,1),e.transactions.length},setTransactionType:function(e,t){e.transactionType=t},setAllowedOpposingTypes:function(e,t){e.allowedOpposingTypes=t},setAccountToTransaction:function(e,t){e.accountToTransaction=t},updateField:function(e,t){e.transactions[t.index][t.field]=t.value},setTransactionError:function(e,t){e.transactions[t.index].errors[t.field]=t.errors},setDestinationAllowedTypes:function(e,t){e.destinationAllowedTypes=t},setSourceAllowedTypes:function(e,t){e.sourceAllowedTypes=t}}};const _={namespaced:!0,state:function(){return{}},getters:{},actions:{},mutations:{}};var c=a(9119),d=a(3894),u=a(584),p=a(7090),y=a(4431),g=a(8358),h=a(4135),b=a(3703);const m={namespaced:!0,state:function(){return{viewRange:"default",start:null,end:null,defaultStart:null,defaultEnd:null}},getters:{start:function(e){return e.start},end:function(e){return e.end},defaultStart:function(e){return e.defaultStart},defaultEnd:function(e){return e.defaultEnd},viewRange:function(e){return e.viewRange}},actions:{initialiseStore:function(e){e.dispatch("restoreViewRange"),axios.get("./api/v1/preferences/viewRange").then((function(t){var a=t.data.data.attributes.data,n=e.getters.viewRange;e.commit("setViewRange",a),a!==n&&e.dispatch("setDatesFromViewRange"),a===n&&e.dispatch("restoreViewRangeDates")})).catch((function(){e.commit("setViewRange","1M"),e.dispatch("setDatesFromViewRange")}))},restoreViewRangeDates:function(e){localStorage.viewRangeStart&&e.commit("setStart",new Date(localStorage.viewRangeStart)),localStorage.viewRangeEnd&&e.commit("setEnd",new Date(localStorage.viewRangeEnd)),localStorage.viewRangeDefaultStart&&e.commit("setDefaultStart",new Date(localStorage.viewRangeDefaultStart)),localStorage.viewRangeDefaultEnd&&e.commit("setDefaultEnd",new Date(localStorage.viewRangeDefaultEnd))},restoreViewRange:function(e){var t=localStorage.getItem("viewRange");null!==t&&e.commit("setViewRange",t)},setDatesFromViewRange:function(e){var t,a,n=e.getters.viewRange,o=new Date;switch(n){case"1D":t=(0,c.Z)(o),a=(0,d.Z)(o);break;case"1W":t=(0,c.Z)((0,u.Z)(o,{weekStartsOn:1})),a=(0,d.Z)((0,p.Z)(o,{weekStartsOn:1}));break;case"1M":t=(0,c.Z)((0,b.Z)(o)),a=(0,d.Z)((0,h.Z)(o));break;case"3M":t=(0,c.Z)((0,y.Z)(o)),a=(0,d.Z)((0,g.Z)(o));break;case"6M":o.getMonth()<=5&&((t=new Date(o)).setMonth(0),t.setDate(1),t=(0,c.Z)(t),(a=new Date(o)).setMonth(5),a.setDate(30),a=(0,d.Z)(t)),o.getMonth()>5&&((t=new Date(o)).setMonth(6),t.setDate(1),t=(0,c.Z)(t),(a=new Date(o)).setMonth(11),a.setDate(31),a=(0,d.Z)(t));break;case"1Y":(t=new Date(o)).setMonth(0),t.setDate(1),t=(0,c.Z)(t),(a=new Date(o)).setMonth(11),a.setDate(31),a=(0,d.Z)(a)}e.commit("setStart",t),e.commit("setEnd",a),e.commit("setDefaultStart",t),e.commit("setDefaultEnd",a)}},mutations:{setStart:function(e,t){e.start=t,window.localStorage.setItem("viewRangeStart",t)},setEnd:function(e,t){e.end=t,window.localStorage.setItem("viewRangeEnd",t)},setDefaultStart:function(e,t){e.defaultStart=t,window.localStorage.setItem("viewRangeDefaultStart",t)},setDefaultEnd:function(e,t){e.defaultEnd=t,window.localStorage.setItem("viewRangeDefaultEnd",t)},setViewRange:function(e,t){e.viewRange=t,window.localStorage.setItem("viewRange",t)}}};var k=function(){return{listPageSize:33,timezone:"",cacheKey:{age:0,value:"empty"}}},f={initialiseStore:function(e){if(localStorage.cacheKey){var t=JSON.parse(localStorage.cacheKey);Date.now()-t.age>864e5?e.commit("refreshCacheKey"):e.commit("setCacheKey",t)}else e.commit("refreshCacheKey");localStorage.listPageSize&&(k.listPageSize=localStorage.listPageSize,e.commit("setListPageSize",{length:localStorage.listPageSize})),localStorage.listPageSize||axios.get("./api/v1/preferences/listPageSize").then((function(t){e.commit("setListPageSize",{length:parseInt(t.data.data.attributes.data)})})),localStorage.timezone&&(k.timezone=localStorage.timezone,e.commit("setTimezone",{timezone:localStorage.timezone})),localStorage.timezone||axios.get("./api/v1/configuration/app.timezone").then((function(t){e.commit("setTimezone",{timezone:t.data.data.value})}))}};const v={namespaced:!0,state:k,getters:{listPageSize:function(e){return e.listPageSize},timezone:function(e){return e.timezone},cacheKey:function(e){return e.cacheKey.value}},actions:f,mutations:{refreshCacheKey:function(e){var t=Date.now(),a=Array(9).join((Math.random().toString(36)+"00000000000000000").slice(2,18)).slice(0,8),n={age:t,value:a};localStorage.cacheKey=JSON.stringify(n),e.cacheKey={age:t,value:a}},setCacheKey:function(e,t){localStorage.cacheKey=JSON.stringify(t),e.cacheKey=t},setListPageSize:function(e,t){var a=parseInt(t.length);0!==a&&(e.listPageSize=a,localStorage.listPageSize=a)},setTimezone:function(e,t){""!==t.timezone&&(e.timezone=t.timezone,localStorage.timezone=t.timezone)}}};const w={namespaced:!0,state:function(){return{orderMode:!1,activeFilter:1}},getters:{orderMode:function(e){return e.orderMode},activeFilter:function(e){return e.activeFilter}},actions:{},mutations:{setOrderMode:function(e,t){e.orderMode=t},setActiveFilter:function(e,t){e.activeFilter=t}}};o().use(i.ZP);const x=new i.ZP.Store({namespaced:!0,modules:{root:v,transactions:{namespaced:!0,modules:{create:l,edit:_}},accounts:{namespaced:!0,modules:{index:w}},dashboard:{namespaced:!0,modules:{index:m}}},strict:false,plugins:[],state:{currencyPreference:{},locale:"en-US",listPageSize:50},mutations:{setCurrencyPreference:function(e,t){e.currencyPreference=t.payload},initialiseStore:function(e){if(localStorage.locale)e.locale=localStorage.locale;else{var t=document.head.querySelector('meta[name="locale"]');t&&(e.locale=t.content,localStorage.locale=t.content)}}},getters:{currencyCode:function(e){return e.currencyPreference.code},currencyPreference:function(e){return e.currencyPreference},currencyId:function(e){return e.currencyPreference.id},locale:function(e){return e.locale}},actions:{updateCurrencyPreference:function(e){localStorage.currencyPreference?e.commit("setCurrencyPreference",{payload:JSON.parse(localStorage.currencyPreference)}):axios.get("./api/v1/currencies/default").then((function(t){var a={id:parseInt(t.data.data.id),name:t.data.data.attributes.name,symbol:t.data.data.attributes.symbol,code:t.data.data.attributes.code,decimal_places:parseInt(t.data.data.attributes.decimal_places)};localStorage.currencyPreference=JSON.stringify(a),e.commit("setCurrencyPreference",{payload:a})})).catch((function(t){console.error(t),e.commit("setCurrencyPreference",{payload:{id:1,name:"Euro",symbol:"€",code:"EUR",decimal_places:2}})}))}}})},157:(e,t,a)=>{e.exports=new vuei18n({locale:document.documentElement.lang,fallbackLocale:"en",messages:{bg:a(7154),cs:a(6407),de:a(4726),en:a(3340),"en-us":a(3340),"en-gb":a(6318),es:a(5394),el:a(3636),fr:a(2551),hu:a(995),it:a(9112),nl:a(4671),nb:a(9085),pl:a(6238),fi:a(7868),"pt-br":a(6586),"pt-pt":a(8664),ro:a(1102),ru:a(753),"zh-tw":a(1715),"zh-cn":a(4556),sk:a(7049),sv:a(7921),vi:a(1497)}})},8109:(e,t,a)=>{"use strict";var n=a(7760),o=a.n(n);const i={name:"Index"};var r=a(3379),s=a.n(r),l=a(1324),_={insert:"head",singleton:!1};s()(l.Z,_);l.Z.locals;const c=(0,a(1900).Z)(i,(function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[e._m(0),e._v(" "),a("div",{staticClass:"row"},[e._m(1),e._v(" "),a("div",{staticClass:"col-xl-10 col-lg-8 col-md-8 col-sm-8 col-6"},[a("div",{staticClass:"container-fluid",staticStyle:{overflow:"scroll"}},[a("div",{staticClass:"d-flex flex-row flex-nowrap"},e._l(5,(function(t){return a("div",{staticClass:"card card-body-budget"},[e._m(2,!0),e._v(" "),e._m(3,!0)])})),0)])])])])}),[function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("p",[a("span",{staticClass:"d-block"},[e._v("(all)")]),e._v(" "),a("span",{staticClass:"d-none d-xl-block"},[e._v("xl")]),e._v(" "),a("span",{staticClass:"d-none d-lg-block d-xl-none"},[e._v("lg")]),e._v(" "),a("span",{staticClass:"d-none d-md-block d-lg-none"},[e._v("md")]),e._v(" "),a("span",{staticClass:"d-none d-sm-block d-md-none"},[e._v("sm")]),e._v(" "),a("span",{staticClass:"d-block d-sm-none"},[e._v("xs")])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"col-xl-2 col-lg-4 col-md-4 col-sm-4 col-6"},[a("div",{staticClass:"card card-primary"},[a("div",{staticClass:"card-header"},[a("h3",{staticClass:"card-title"},[e._v("Budgets")])]),e._v(" "),a("div",{staticClass:"card-body"},[e._v("\n Budget X"),a("br"),e._v("\n Budget Y"),a("br"),e._v("\n Budget X"),a("br"),e._v("\n Budget Y"),a("br"),e._v("\n Budget X"),a("br"),e._v("\n Budget Y"),a("br"),e._v("\n Budget X"),a("br"),e._v("\n Budget Y"),a("br")])])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"card-header"},[a("h3",{staticClass:"card-title"},[e._v("Maand yXz")])])},function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"card-body"},[e._v("\n Some text"),a("br"),e._v("\n Some text"),a("br"),e._v("\n Some text"),a("br")])}],!1,null,"725966d7",null).exports;var d=a(9899);a(232);var u=a(157),p={};new(o())({i18n:u,store:d.Z,el:"#budgets",render:function(e){return e(c,{props:p})},beforeCreate:function(){this.$store.dispatch("root/initialiseStore")}})},4478:(e,t,a)=>{"use strict";function n(){return{description:[],amount:[],source:[],destination:[],currency:[],foreign_currency:[],foreign_amount:[],date:[],custom_dates:[],budget:[],category:[],bill:[],tags:[],piggy_bank:[],internal_reference:[],external_url:[],notes:[],location:[]}}function o(){return{description:"",transaction_journal_id:0,source_account_id:null,source_account_name:null,source_account_type:null,source_account_currency_id:null,source_account_currency_code:null,source_account_currency_symbol:null,destination_account_id:null,destination_account_name:null,destination_account_type:null,destination_account_currency_id:null,destination_account_currency_code:null,destination_account_currency_symbol:null,attachments:!1,selectedAttachments:!1,uploadTrigger:!1,clearTrigger:!1,source_account:{id:0,name:"",name_with_balance:"",type:"",currency_id:0,currency_name:"",currency_code:"",currency_decimal_places:2},destination_account:{id:0,name:"",type:"",currency_id:0,currency_name:"",currency_code:"",currency_decimal_places:2},amount:"",currency_id:0,foreign_amount:"",foreign_currency_id:0,category:null,budget_id:0,bill_id:0,piggy_bank_id:0,tags:[],interest_date:null,book_date:null,process_date:null,due_date:null,payment_date:null,invoice_date:null,internal_reference:null,external_url:null,external_id:null,notes:null,links:[],zoom_level:null,longitude:null,latitude:null,errors:{}}}a.d(t,{kQ:()=>n,f$:()=>o})},1324:(e,t,a)=>{"use strict";a.d(t,{Z:()=>s});var n=a(4015),o=a.n(n),i=a(3645),r=a.n(i)()(o());r.push([e.id,".card-body-budget[data-v-725966d7]{margin-right:5px;min-width:300px}.holder-titles[data-v-725966d7]{display:flex;flex-direction:column-reverse}.title-block[data-v-725966d7]{border:1px solid red}.holder-blocks[data-v-725966d7]{display:flex;flex-direction:column-reverse}.budget-block[data-v-725966d7]{border:1px solid blue}.budget-block-unused[data-v-725966d7]{border:1px solid green}.budget-block-unset[data-v-725966d7]{border:1px solid purple}","",{version:3,sources:["webpack://./src/components/budgets/Index.vue"],names:[],mappings:"AA+EA,mCAEA,gBAAA,CADA,eAEA,CAEA,gCACA,YAAA,CACA,6BACA,CAEA,8BACA,oBACA,CAEA,gCACA,YAAA,CACA,6BACA,CAEA,+BACA,qBACA,CAEA,sCACA,sBACA,CAEA,qCACA,uBACA",sourcesContent:['\x3c!--\n - Index.vue\n - Copyright (c) 2021 james@firefly-iii.org\n -\n - This file is part of Firefly III (https://github.com/firefly-iii).\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see .\n --\x3e\n\n\n\n