firefly-iii/public/v2/js/accounts/index.js.map
2021-07-11 09:31:10 +02:00

1 line
157 KiB
Plaintext
Executable File

{"version":3,"sources":["webpack:///./src/bootstrap.js","webpack:///./src/components/store/modules/transactions/create.js","webpack:///./src/components/store/modules/transactions/edit.js","webpack:///./src/components/store/modules/dashboard/index.js","webpack:///./src/components/store/modules/root.js","webpack:///./src/components/store/modules/accounts/index.js","webpack:///./src/components/store/index.js","webpack:///./src/i18n.js","webpack:///src/components/accounts/Index.vue","webpack:///./src/components/accounts/Index.vue?9aa9","webpack:///./src/components/accounts/Index.vue","webpack:///./src/components/accounts/Index.vue?4239","webpack:///src/components/accounts/IndexOptions.vue","webpack:///./src/components/accounts/IndexOptions.vue?c018","webpack:///./src/components/accounts/IndexOptions.vue","webpack:///./src/components/accounts/IndexOptions.vue?57f2","webpack:///./src/pages/accounts/index.js","webpack:///./src/shared/forageStore.js","webpack:///./src/shared/transactions.js","webpack:///./src/components/dashboard/Calendar.vue?78b5","webpack:///./src/components/dashboard/Calendar.vue?4aa0","webpack:///src/components/dashboard/Calendar.vue","webpack:///./src/components/dashboard/Calendar.vue?6b2f","webpack:///./src/components/dashboard/Calendar.vue?baae","webpack:///./src/components/dashboard/Calendar.vue"],"names":["window","$","jQuery","require","axios","defaults","headers","common","token","document","head","querySelector","content","console","error","localeToken","localStorage","locale","vuei18n","VueI18n","uiv","Vue","lodashClonedeep","namespaced","state","transactionType","groupTitle","transactions","customDateFields","interest_date","book_date","process_date","due_date","payment_date","invoice_date","defaultTransaction","getDefaultTransaction","defaultErrors","getDefaultErrors","getters","accountToTransaction","sourceAllowedTypes","destinationAllowedTypes","allowedOpposingTypes","actions","mutations","addTransaction","newTransaction","errors","push","resetErrors","payload","index","resetTransactions","setGroupTitle","setCustomDateFields","deleteTransaction","splice","length","setTransactionType","setAllowedOpposingTypes","setAccountToTransaction","updateField","field","value","setTransactionError","setDestinationAllowedTypes","setSourceAllowedTypes","viewRange","start","end","defaultStart","defaultEnd","initialiseStore","context","dispatch","get","then","response","data","attributes","oldViewRange","commit","restoreViewRangeDates","viewRangeStart","Date","viewRangeEnd","viewRangeDefaultStart","viewRangeDefaultEnd","restoreViewRange","getItem","setDatesFromViewRange","today","startOfDay","endOfDay","startOfWeek","weekStartsOn","endOfWeek","startOfMonth","endOfMonth","startOfQuarter","endOfQuarter","getMonth","setMonth","setDate","setStart","setItem","setEnd","setDefaultStart","setDefaultEnd","setViewRange","range","listPageSize","timezone","cacheKey","age","object","JSON","parse","now","parseInt","refreshCacheKey","Array","N","join","Math","random","toString","slice","stringify","setCacheKey","setListPageSize","number","setTimezone","orderMode","activeFilter","setOrderMode","setActiveFilter","Vuex","modules","root","root_store","create","transactions_create","edit","transactions_edit","accounts","accounts_index","dashboard","dashboard_index","strict","process","plugins","currencyPreference","setCurrencyPreference","currencyCode","code","currencyId","id","updateCurrencyPreference","currencyResponse","name","symbol","decimal_places","err","module","exports","documentElement","lang","fallbackLocale","messages","props","accountTypes","String","allAccounts","type","downloaded","loading","ready","fields","currentPage","perPage","total","sortBy","sortDesc","api","sortableOptions","disabled","chosenClass","onEnd","sortable","watch","this","getAccountList","updateFieldList","reorderAccountList","makeTableSortable","filterAccountList","computed","cardTitle","$t","created","parts","params","methods","saveAccountSort","hasOwnProperty","i","test","current","identifier","order","newOrder","put","url","newCacheKey","option","indexReady","downloadAccountList","totalPage","filterAccountListAndReturn","active","roleTranslate","role","parsePages","pagination","parseAccounts","key","acct","account_role","acct_number","iban","match","account_number","acctNr","current_balance","currency_code","liability_type","liability_direction","interest","interest_period","amount_due","current_debt","balance_diff","last_activity","getAccountBalanceDifference","getAccountLastActivity","promises","Promise","resolve","startStr","endStr","all","_vm","_h","$createElement","_c","_self","staticClass","attrs","model","callback","$$v","expression","_v","on","ref","$event","scopedSlots","_u","fn","proxy","class","item","_s","_e","parseFloat","Intl","NumberFormat","style","currency","format","$store","set","directives","rawName","domProps","isArray","_i","$$a","$$el","target","$$c","checked","$$i","concat","_q","i18n","BTable","BPagination","store","el","render","createElement","Index","beforeCreate","Calendar","IndexOptions","configureAxios","localforage","memoryDriver","forageStore","driver","setup","baseURL","cache","maxAge","readHeaders","exclude","query","debug","description","amount","source","destination","foreign_currency","foreign_amount","date","custom_dates","budget","category","bill","tags","piggy_bank","internal_reference","external_url","notes","location","transaction_journal_id","source_account_id","source_account_name","source_account_type","source_account_currency_id","source_account_currency_code","source_account_currency_symbol","destination_account_id","destination_account_name","destination_account_type","destination_account_currency_id","destination_account_currency_code","destination_account_currency_symbol","attachments","selectedAttachments","uploadTrigger","clearTrigger","source_account","name_with_balance","currency_id","currency_name","currency_decimal_places","destination_account","foreign_currency_id","budget_id","bill_id","piggy_bank_id","external_id","links","zoom_level","longitude","latitude","___CSS_LOADER_EXPORT___","defaultRange","periods","resetDate","customDate","generatePeriods","generateDaily","generateWeekly","title","generateMonthly","generateQuarterly","generateHalfYearly","setFullYear","getFullYear","half","generateYearly","getDate","datesReady","options","DateTimeFormat","year","month","day","inputValue","inputEvents","isDragging","togglePopover","placement","positionFixed","_l","period","_g"],"mappings":"oIA0BAA,OAAOC,EAAID,OAAOE,OAASC,EAAQ,MAGnCH,OAAOI,MAAQD,EAAQ,MACvBH,OAAOI,MAAMC,SAASC,QAAQC,OAAO,oBAAsB,iBAG3D,IAAIC,EAAQC,SAASC,KAAKC,cAAc,2BAEpCH,EACAR,OAAOI,MAAMC,SAASC,QAAQC,OAAO,gBAAkBC,EAAMI,QAE7DC,QAAQC,MAAM,yEAIlB,IAAIC,EAAcN,SAASC,KAAKC,cAAc,uBAG1CK,aAAaC,OADbF,EACsBA,EAAYH,QAEZ,QAI1BT,EAAQ,MACRA,EAAQ,MAERA,EAAQ,MACRA,EAAQ,MAIRH,OAAOkB,QAAUC,IACjBnB,OAAOoB,IAAMA,EACbC,QAAQH,SACRG,QAAQD,GACRpB,OAAOqB,IAAMA,K,uFC3CPC,EAAkBnB,EAAQ,MA4HhC,SACIoB,YAAY,EACZC,MAzHU,iBAAO,CACbC,gBAAiB,MAC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pU,QAAQqU,EAAYrU,QAAQwL,EAAIW,GAAG,KAAKR,EAAG,QAAQH,EAAIoJ,GAAG,CAACjI,MAAM2H,EAAa,gBAAkB,gBAAgBxI,MAAM,CAAC,KAAO,UAAU2B,SAAS,CAAC,MAAQ2G,EAAWnU,MAAMoU,EAAYpU,eAAe8L,MAAM,CAACpM,MAAO6L,EAAS,MAAEQ,SAAS,SAAUC,GAAMT,EAAI9I,MAAMuJ,GAAKC,WAAW,YAAY,KAClhD,IIMpB,EACA,KACA,WACA,M","file":"/public/js/accounts/index.js","sourcesContent":["/*\n * bootstrap.js\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 <https://www.gnu.org/licenses/>.\n */\n\n// // imports\nimport Vue from 'vue';\nimport VueI18n from 'vue-i18n'\nimport * as uiv from 'uiv';\n\n// export jquery for others scripts to use\nwindow.$ = window.jQuery = require('jquery');\n\n// axios\nwindow.axios = require('axios');\nwindow.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';\n\n// CSRF\nlet token = document.head.querySelector('meta[name=\"csrf-token\"]');\n\nif (token) {\n window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;\n} else {\n console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');\n}\n\n// locale\nlet localeToken = document.head.querySelector('meta[name=\"locale\"]');\n\nif (localeToken) {\n localStorage.locale = localeToken.content;\n} else {\n localStorage.locale = 'en_US';\n}\n\n// admin stuff\nrequire('jquery-ui');\nrequire('bootstrap'); // bootstrap CSS?\n\nrequire('admin-lte/dist/js/adminlte');\nrequire('overlayscrollbars');\n\n\n// vue\nwindow.vuei18n = VueI18n;\nwindow.uiv = uiv;\nVue.use(vuei18n);\nVue.use(uiv);\nwindow.Vue = Vue;","/*\n * create.js\n * Copyright (c) 2020 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 <https://www.gnu.org/licenses/>.\n */\n\nconst lodashClonedeep = require('lodash.clonedeep');\n\nimport {getDefaultTransaction, getDefaultErrors} from '../../../../shared/transactions';\n\n// initial state\nconst state = () => ({\n transactionType: 'any',\n groupTitle: '',\n transactions: [],\n customDateFields: {\n interest_date: false,\n book_date: false,\n process_date: false,\n due_date: false,\n payment_date: false,\n invoice_date: false,\n },\n defaultTransaction: getDefaultTransaction(),\n defaultErrors: getDefaultErrors()\n }\n)\n\n\n// getters\nconst getters = {\n transactions: state => {\n return state.transactions;\n },\n defaultErrors: state => {\n return state.defaultErrors;\n },\n groupTitle: state => {\n return state.groupTitle;\n },\n transactionType: state => {\n return state.transactionType;\n },\n accountToTransaction: state => {\n// See reference nr. 1\n // possible API point!!\n return state.accountToTransaction;\n },\n defaultTransaction: state => {\n return state.defaultTransaction;\n },\n sourceAllowedTypes: state => {\n return state.sourceAllowedTypes;\n },\n destinationAllowedTypes: state => {\n return state.destinationAllowedTypes;\n },\n allowedOpposingTypes: state => {\n return state.allowedOpposingTypes;\n },\n customDateFields: state => {\n return state.customDateFields;\n }\n // // `getters` is localized to this module's getters\n // // you can use rootGetters via 4th argument of getters\n // someGetter (state, getters, rootState, rootGetters) {\n // getters.someOtherGetter // -> 'foo/someOtherGetter'\n // rootGetters.someOtherGetter // -> 'someOtherGetter'\n // rootGetters['bar/someOtherGetter'] // -> 'bar/someOtherGetter'\n // },\n\n}\n\n// actions\nconst actions = {}\n\n// mutations\nconst mutations = {\n addTransaction(state) {\n let newTransaction = lodashClonedeep(state.defaultTransaction);\n newTransaction.errors = lodashClonedeep(state.defaultErrors);\n state.transactions.push(newTransaction);\n },\n resetErrors(state, payload) {\n //console.log('resetErrors for index ' + payload.index);\n state.transactions[payload.index].errors = lodashClonedeep(state.defaultErrors);\n },\n resetTransactions(state) {\n state.transactions = [];\n },\n setGroupTitle(state, payload) {\n state.groupTitle = payload.groupTitle;\n },\n setCustomDateFields(state, payload) {\n state.customDateFields = payload;\n },\n deleteTransaction(state, payload) {\n state.transactions.splice(payload.index, 1);\n // console.log('Deleted transaction ' + payload.index);\n // console.log(state.transactions);\n if (0 === state.transactions.length) {\n // console.log('array is empty!');\n }\n },\n setTransactionType(state, transactionType) {\n state.transactionType = transactionType;\n },\n setAllowedOpposingTypes(state, allowedOpposingTypes) {\n state.allowedOpposingTypes = allowedOpposingTypes;\n },\n setAccountToTransaction(state, payload) {\n state.accountToTransaction = payload;\n },\n updateField(state, payload) {\n state.transactions[payload.index][payload.field] = payload.value;\n },\n setTransactionError(state, payload) {\n //console.log('Will set transactions[' + payload.index + '][errors][' + payload.field + '] to ');\n //console.log(payload.errors);\n state.transactions[payload.index].errors[payload.field] = payload.errors;\n },\n setDestinationAllowedTypes(state, payload) {\n // console.log('Destination allowed types was changed!');\n state.destinationAllowedTypes = payload;\n },\n setSourceAllowedTypes(state, payload) {\n state.sourceAllowedTypes = payload;\n }\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations\n}\n","/*\n * edit.js\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 <https://www.gnu.org/licenses/>.\n */\n\n// initial state\nconst state = () => ({});\n\n\n// getters\nconst getters = {};\n\n// actions\nconst actions = {};\n\n// mutations\nconst mutations = {};\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations\n}\n","/*\n * index.js\n * Copyright (c) 2020 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 <https://www.gnu.org/licenses/>.\n */\n\n// initial state\nimport startOfDay from \"date-fns/startOfDay\";\nimport endOfDay from 'date-fns/endOfDay'\nimport startOfWeek from 'date-fns/startOfWeek'\nimport endOfWeek from 'date-fns/endOfWeek'\nimport startOfQuarter from 'date-fns/startOfQuarter';\nimport endOfQuarter from 'date-fns/endOfQuarter';\nimport endOfMonth from \"date-fns/endOfMonth\";\nimport startOfMonth from 'date-fns/startOfMonth';\n\nconst state = () => (\n {\n viewRange: 'default',\n start: null,\n end: null,\n defaultStart: null,\n defaultEnd: null,\n }\n)\n\n\n// getters\nconst getters = {\n start: state => {\n return state.start;\n },\n end: state => {\n return state.end;\n },\n defaultStart: state => {\n return state.defaultStart;\n },\n defaultEnd: state => {\n return state.defaultEnd;\n },\n viewRange: state => {\n return state.viewRange;\n }\n}\n\n// actions\nconst actions = {\n initialiseStore(context) {\n // console.log('initialiseStore for dashboard.');\n\n // restore from local storage:\n context.dispatch('restoreViewRange');\n\n axios.get('./api/v1/preferences/viewRange')\n .then(response => {\n let viewRange = response.data.data.attributes.data;\n let oldViewRange = context.getters.viewRange;\n context.commit('setViewRange', viewRange);\n if (viewRange !== oldViewRange) {\n // console.log('View range changed from \"' + oldViewRange + '\" to \"' + viewRange + '\"');\n context.dispatch('setDatesFromViewRange');\n }\n if (viewRange === oldViewRange) {\n // console.log('Restore view range dates');\n context.dispatch('restoreViewRangeDates');\n }\n }\n ).catch(() => {\n context.commit('setViewRange', '1M');\n context.dispatch('setDatesFromViewRange');\n });\n\n },\n restoreViewRangeDates: function (context) {\n // check local storage first?\n if (localStorage.viewRangeStart) {\n // console.log('view range start set from local storage.');\n context.commit('setStart', new Date(localStorage.viewRangeStart));\n }\n if (localStorage.viewRangeEnd) {\n // console.log('view range end set from local storage.');\n context.commit('setEnd', new Date(localStorage.viewRangeEnd));\n }\n // also set default:\n if (localStorage.viewRangeDefaultStart) {\n // console.log('view range default start set from local storage.');\n // console.log(localStorage.viewRangeDefaultStart);\n context.commit('setDefaultStart', new Date(localStorage.viewRangeDefaultStart));\n }\n if (localStorage.viewRangeDefaultEnd) {\n // console.log('view range default end set from local storage.');\n // console.log(localStorage.viewRangeDefaultEnd);\n context.commit('setDefaultEnd', new Date(localStorage.viewRangeDefaultEnd));\n }\n },\n restoreViewRange: function (context) {\n // console.log('restoreViewRange');\n let viewRange = localStorage.getItem('viewRange');\n if (null !== viewRange) {\n // console.log('restored restoreViewRange ' + viewRange );\n context.commit('setViewRange', viewRange);\n }\n },\n setDatesFromViewRange(context) {\n let start;\n let end;\n let viewRange = context.getters.viewRange;\n let today = new Date;\n // console.log('Will recreate view range on ' + viewRange);\n switch (viewRange) {\n case '1D':\n // today:\n start = startOfDay(today);\n end = endOfDay(today);\n break;\n case '1W':\n // this week:\n start = startOfDay(startOfWeek(today, {weekStartsOn: 1}));\n end = endOfDay(endOfWeek(today, {weekStartsOn: 1}));\n break;\n case '1M':\n // this month:\n start = startOfDay(startOfMonth(today));\n end = endOfDay(endOfMonth(today));\n break;\n case '3M':\n // this quarter\n start = startOfDay(startOfQuarter(today));\n end = endOfDay(endOfQuarter(today));\n break;\n case '6M':\n // this half-year\n if (today.getMonth() <= 5) {\n start = new Date(today);\n start.setMonth(0);\n start.setDate(1);\n start = startOfDay(start);\n end = new Date(today);\n end.setMonth(5);\n end.setDate(30);\n end = endOfDay(start);\n }\n if (today.getMonth() > 5) {\n start = new Date(today);\n start.setMonth(6);\n start.setDate(1);\n start = startOfDay(start);\n end = new Date(today);\n end.setMonth(11);\n end.setDate(31);\n end = endOfDay(start);\n }\n break;\n case '1Y':\n // this year\n start = new Date(today);\n start.setMonth(0);\n start.setDate(1);\n start = startOfDay(start);\n\n end = new Date(today);\n end.setMonth(11);\n end.setDate(31);\n end = endOfDay(end);\n break;\n }\n // console.log('Range is ' + viewRange);\n // console.log('Start is ' + start);\n // console.log('End is ' + end);\n context.commit('setStart', start);\n context.commit('setEnd', end);\n context.commit('setDefaultStart', start);\n context.commit('setDefaultEnd', end);\n }\n}\n\n// mutations\nconst mutations = {\n setStart(state, value) {\n state.start = value;\n window.localStorage.setItem('viewRangeStart', value);\n },\n setEnd(state, value) {\n state.end = value;\n window.localStorage.setItem('viewRangeEnd', value);\n },\n setDefaultStart(state, value) {\n state.defaultStart = value;\n window.localStorage.setItem('viewRangeDefaultStart', value);\n },\n setDefaultEnd(state, value) {\n state.defaultEnd = value;\n window.localStorage.setItem('viewRangeDefaultEnd', value);\n },\n setViewRange(state, range) {\n state.viewRange = range;\n window.localStorage.setItem('viewRange', range);\n }\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations\n}\n","/*\n * root.js\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 <https://www.gnu.org/licenses/>.\n */\n\n// initial state\nconst state = () => (\n {\n listPageSize: 33,\n timezone: '',\n cacheKey: {\n age: 0,\n value: 'empty',\n },\n }\n)\n\n\n// getters\nconst getters = {\n listPageSize: state => {\n return state.listPageSize;\n },\n timezone: state => {\n // console.log('Wil return ' + state.listPageSize);\n return state.timezone;\n },\n cacheKey: state => {\n return state.cacheKey.value;\n },\n}\n\n// actions\nconst actions = {\n initialiseStore(context) {\n // cache key auto refreshes every day\n // console.log('Now in initialize store.')\n if (localStorage.cacheKey) {\n // console.log('Storage has cache key: ');\n // console.log(localStorage.cacheKey);\n let object = JSON.parse(localStorage.cacheKey);\n if (Date.now() - object.age > 86400000) {\n // console.log('Key is here but is old.');\n context.commit('refreshCacheKey');\n } else {\n // console.log('Cache key from local storage: ' + object.value);\n context.commit('setCacheKey', object);\n }\n } else {\n // console.log('No key need new one.');\n context.commit('refreshCacheKey');\n }\n if (localStorage.listPageSize) {\n state.listPageSize = localStorage.listPageSize;\n context.commit('setListPageSize', {length: localStorage.listPageSize});\n }\n if (!localStorage.listPageSize) {\n axios.get('./api/v1/preferences/listPageSize')\n .then(response => {\n // console.log('from API: listPageSize is ' + parseInt(response.data.data.attributes.data));\n context.commit('setListPageSize', {length: parseInt(response.data.data.attributes.data)});\n }\n );\n }\n if (localStorage.timezone) {\n state.timezone = localStorage.timezone;\n context.commit('setTimezone', {timezone: localStorage.timezone});\n }\n if (!localStorage.timezone) {\n axios.get('./api/v1/configuration/app.timezone')\n .then(response => {\n context.commit('setTimezone', {timezone: response.data.data.value});\n }\n );\n }\n }\n}\n\n// mutations\nconst mutations = {\n refreshCacheKey(state) {\n let age = Date.now();\n let N = 8;\n let cacheKey = Array(N+1).join((Math.random().toString(36)+'00000000000000000').slice(2, 18)).slice(0, N);\n let object = {age: age, value: cacheKey};\n // console.log('Store new key in string JSON');\n // console.log(JSON.stringify(object));\n localStorage.cacheKey = JSON.stringify(object);\n state.cacheKey = {age: age, value: cacheKey};\n // console.log('Refresh: cachekey is now ' + cacheKey);\n },\n setCacheKey(state, payload) {\n // console.log('Stored cache key in localstorage.');\n // console.log(payload);\n // console.log(JSON.stringify(payload));\n localStorage.cacheKey = JSON.stringify(payload);\n state.cacheKey = payload;\n },\n setListPageSize(state, payload) {\n // console.log('Got a payload in setListPageSize');\n // console.log(payload);\n let number = parseInt(payload.length);\n if (0 !== number) {\n state.listPageSize = number;\n localStorage.listPageSize = number;\n }\n },\n setTimezone(state, payload) {\n\n if ('' !== payload.timezone) {\n state.timezone = payload.timezone;\n localStorage.timezone = payload.timezone;\n }\n },\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations\n}\n","/*\n * index.js\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 <https://www.gnu.org/licenses/>.\n */\n\n// initial state\nconst state = () => (\n {\n orderMode: false,\n activeFilter: 1\n }\n)\n\n\n// getters\nconst getters = {\n orderMode: state => {\n return state.orderMode;\n },\n activeFilter: state => {\n return state.activeFilter;\n }\n}\n\n// actions\nconst actions = {}\n\n// mutations\nconst mutations = {\n setOrderMode(state, payload) {\n state.orderMode = payload;\n },\n setActiveFilter(state, payload) {\n state.activeFilter = payload;\n }\n}\n\nexport default {\n namespaced: true,\n state,\n getters,\n actions,\n mutations\n}\n","/*\n * index.js\n * Copyright (c) 2020 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 <https://www.gnu.org/licenses/>.\n */\n\nimport Vue from 'vue'\nimport Vuex, {createLogger} from 'vuex'\nimport transactions_create from './modules/transactions/create';\nimport transactions_edit from './modules/transactions/edit';\nimport dashboard_index from './modules/dashboard/index';\nimport root_store from './modules/root';\nimport accounts_index from './modules/accounts/index';\n\nVue.use(Vuex)\nconst debug = process.env.NODE_ENV !== 'production'\n\nexport default new Vuex.Store(\n {\n namespaced: true,\n modules: {\n root: root_store,\n transactions: {\n namespaced: true,\n modules: {\n create: transactions_create,\n edit: transactions_edit\n }\n },\n accounts: {\n namespaced: true,\n modules: {\n index: accounts_index\n },\n },\n dashboard: {\n namespaced: true,\n modules: {\n index: dashboard_index\n }\n }\n },\n strict: debug,\n plugins: debug ? [createLogger()] : [],\n state: {\n currencyPreference: {},\n locale: 'en-US',\n listPageSize: 50\n },\n mutations: {\n setCurrencyPreference(state, payload) {\n state.currencyPreference = payload.payload;\n },\n initialiseStore(state) {\n // console.log('Now in initialiseStore()')\n // if locale in local storage:\n if (localStorage.locale) {\n state.locale = localStorage.locale;\n return;\n }\n\n // set locale from HTML:\n let localeToken = document.head.querySelector('meta[name=\"locale\"]');\n if (localeToken) {\n state.locale = localeToken.content;\n localStorage.locale = localeToken.content;\n }\n }\n },\n getters: {\n currencyCode: state => {\n return state.currencyPreference.code;\n },\n currencyPreference: state => {\n return state.currencyPreference;\n },\n currencyId: state => {\n return state.currencyPreference.id;\n },\n locale: state => {\n return state.locale;\n }\n },\n actions: {\n\n updateCurrencyPreference(context) {\n // console.log('Now in updateCurrencyPreference');\n if (localStorage.currencyPreference) {\n context.commit('setCurrencyPreference', {payload: JSON.parse(localStorage.currencyPreference)});\n return;\n }\n axios.get('./api/v1/currencies/default')\n .then(response => {\n let currencyResponse = {\n id: parseInt(response.data.data.id),\n name: response.data.data.attributes.name,\n symbol: response.data.data.attributes.symbol,\n code: response.data.data.attributes.code,\n decimal_places: parseInt(response.data.data.attributes.decimal_places),\n };\n localStorage.currencyPreference = JSON.stringify(currencyResponse);\n //console.log('getCurrencyPreference from server')\n //console.log(JSON.stringify(currencyResponse));\n context.commit('setCurrencyPreference', {payload: currencyResponse});\n }).catch(err => {\n // console.log('Got error response.');\n console.error(err);\n context.commit('setCurrencyPreference', {\n payload: {\n id: 1,\n name: 'Euro',\n symbol: '€',\n code: 'EUR',\n decimal_places: 2\n }\n });\n });\n\n }\n }\n }\n);","/*\n * i18n.js\n * Copyright (c) 2020 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 <https://www.gnu.org/licenses/>.\n */\n\n// Create VueI18n instance with options\nmodule.exports = new vuei18n({\n locale: document.documentElement.lang, // set locale\n fallbackLocale: 'en',\n messages: {\n 'bg': require('./locales/bg.json'),\n 'cs': require('./locales/cs.json'),\n 'de': require('./locales/de.json'),\n 'en': require('./locales/en.json'),\n 'en-us': require('./locales/en.json'),\n 'en-gb': require('./locales/en-gb.json'),\n 'es': require('./locales/es.json'),\n 'el': require('./locales/el.json'),\n 'fr': require('./locales/fr.json'),\n 'hu': require('./locales/hu.json'),\n //'id': require('./locales/id.json'),\n 'it': require('./locales/it.json'),\n 'nl': require('./locales/nl.json'),\n 'nb': require('./locales/nb.json'),\n 'pl': require('./locales/pl.json'),\n 'fi': require('./locales/fi.json'),\n 'pt-br': require('./locales/pt-br.json'),\n 'pt-pt': require('./locales/pt.json'),\n 'ro': require('./locales/ro.json'),\n 'ru': require('./locales/ru.json'),\n //'zh': require('./locales/zh.json'),\n 'zh-tw': require('./locales/zh-tw.json'),\n 'zh-cn': require('./locales/zh-cn.json'),\n 'sk': require('./locales/sk.json'),\n 'sv': require('./locales/sv.json'),\n 'vi': require('./locales/vi.json'),\n }\n});\n","<!--\n - Index.vue\n - Copyright (c) 2020 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 <https://www.gnu.org/licenses/>.\n -->\n\n<template>\n <div>\n <div class=\"row\">\n <div class=\"col-lg-8 col-md-6 col-sm-12 col-xs-12\">\n <b-pagination\n v-model=\"currentPage\"\n :total-rows=\"total\"\n :per-page=\"perPage\"\n aria-controls=\"my-table\"\n ></b-pagination>\n </div>\n <div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n <button @click=\"newCacheKey\" class=\"btn btn-sm float-right btn-info\"><span class=\"fas fa-sync\"></span></button>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-lg-12 col-md-12 col-sm-12 col-xs-12\">\n <div class=\"card\">\n <div class=\"card-body p-0\">\n <b-table id=\"my-table\" striped hover responsive=\"md\" primary-key=\"id\" :no-local-sorting=\"false\"\n :items=\"accounts\" :fields=\"fields\"\n :per-page=\"perPage\"\n sort-icon-left\n ref=\"table\"\n :current-page=\"currentPage\"\n :busy.sync=\"loading\"\n :sort-by.sync=\"sortBy\"\n :sort-desc.sync=\"sortDesc\"\n >\n <template #table-busy>\n <span class=\"fas fa-spinner fa-spin\"></span>\n </template>\n <template #cell(name)=\"data\">\n <a :class=\"false === data.item.active ? 'text-muted' : ''\" :href=\"'./accounts/show/' + data.item.id\" :title=\"data.value\">{{ data.value }}</a>\n </template>\n <template #cell(acct_number)=\"data\">\n {{ data.item.acct_number }}\n </template>\n <template #cell(last_activity)=\"data\">\n <span v-if=\"'asset' === type && 'loading' === data.item.last_activity\">\n <span class=\"fas fa-spinner fa-spin\"></span>\n </span>\n <span v-if=\"'asset' === type && 'none' === data.item.last_activity\" class=\"text-muted\">\n {{ $t('firefly.never') }}\n </span>\n <span v-if=\"'asset' === type && 'loading' !== data.item.last_activity && 'none' !== data.item.last_activity\">\n {{ data.item.last_activity }}\n </span>\n </template>\n <template #cell(amount_due)=\"data\">\n <span class=\"text-success\" v-if=\"parseFloat(data.item.amount_due) > 0\">\n {{ Intl.NumberFormat(locale, {style: 'currency', currency: data.item.currency_code}).format(data.item.amount_due) }}\n </span>\n\n <span class=\"text-danger\" v-if=\"parseFloat(data.item.amount_due) < 0\">\n {{ Intl.NumberFormat(locale, {style: 'currency', currency: data.item.currency_code}).format(data.item.amount_due) }}\n </span>\n\n <span class=\"text-muted\" v-if=\"parseFloat(data.item.amount_due) === 0.0\">\n {{ Intl.NumberFormat(locale, {style: 'currency', currency: data.item.currency_code}).format(data.item.amount_due) }}\n </span>\n\n </template>\n <template #cell(current_balance)=\"data\">\n <span class=\"text-success\" v-if=\"parseFloat(data.item.current_balance) > 0\">\n {{\n Intl.NumberFormat(locale, {\n style: 'currency', currency:\n data.item.currency_code\n }).format(data.item.current_balance)\n }}\n </span>\n <span class=\"text-danger\" v-if=\"parseFloat(data.item.current_balance) < 0\">\n {{\n Intl.NumberFormat(locale, {\n style: 'currency', currency:\n data.item.currency_code\n }).format(data.item.current_balance)\n }}\n </span>\n\n <span class=\"text-muted\" v-if=\"0 === parseFloat(data.item.current_balance)\">\n {{\n Intl.NumberFormat(locale, {\n style: 'currency', currency:\n data.item.currency_code\n }).format(data.item.current_balance)\n }}\n </span>\n <span v-if=\"'asset' === type && 'loading' === data.item.balance_diff\">\n <span class=\"fas fa-spinner fa-spin\"></span>\n </span>\n <span v-if=\"'asset' === type && 'loading' !== data.item.balance_diff\">\n (<span class=\"text-success\" v-if=\"parseFloat(data.item.balance_diff) > 0\">{{\n Intl.NumberFormat(locale, {\n style: 'currency', currency:\n data.item.currency_code\n }).format(data.item.balance_diff)\n }}</span><span class=\"text-muted\" v-if=\"0===parseFloat(data.item.balance_diff)\">{{\n Intl.NumberFormat(locale, {\n style: 'currency', currency:\n data.item.currency_code\n }).format(data.item.balance_diff)\n }}</span><span class=\"text-danger\" v-if=\"parseFloat(data.item.balance_diff) < 0\">{{\n Intl.NumberFormat(locale, {\n style: 'currency', currency:\n data.item.currency_code\n }).format(data.item.balance_diff)\n }}</span>)\n </span>\n </template>\n <template #cell(interest)=\"data\">\n {{ parseFloat(data.item.interest) }}% ({{ data.item.interest_period }})\n </template>\n <template #cell(menu)=\"data\">\n <div class=\"btn-group btn-group-sm\">\n <div class=\"dropdown\">\n <button class=\"btn btn-light btn-sm dropdown-toggle\" type=\"button\" :id=\"'dropdownMenuButton' + data.item.id\" data-toggle=\"dropdown\"\n aria-haspopup=\"true\" aria-expanded=\"false\">\n {{ $t('firefly.actions') }}\n </button>\n <div class=\"dropdown-menu\" :aria-labelledby=\"'dropdownMenuButton' + data.item.id\">\n <a class=\"dropdown-item\" :href=\"'./accounts/edit/' + data.item.id\"><span class=\"fa fas fa-pencil-alt\"></span> {{ $t('firefly.edit') }}</a>\n <a class=\"dropdown-item\" :href=\"'./accounts/delete/' + data.item.id\"><span class=\"fa far fa-trash\"></span> {{ $t('firefly.delete') }}</a>\n <a v-if=\"'asset' === type\" class=\"dropdown-item\" :href=\"'./accounts/reconcile/' + data.item.id + '/index'\"><span\n class=\"fas fa-check\"></span>\n {{ $t('firefly.reconcile_this_account') }}</a>\n </div>\n </div>\n </div>\n </template>\n </b-table>\n </div>\n <div class=\"card-footer\">\n <a :href=\"'./accounts/create/' + type\" class=\"btn btn-success\" :title=\"$t('firefly.create_new_' + type)\">{{ $t('firefly.create_new_' + type) }}</a>\n </div>\n </div>\n </div>\n </div>\n <div class=\"row\">\n <div class=\"col-lg-8 col-md-6 col-sm-12 col-xs-12\">\n <b-pagination\n v-model=\"currentPage\"\n :total-rows=\"total\"\n :per-page=\"perPage\"\n aria-controls=\"my-table\"\n ></b-pagination>\n </div>\n <div class=\"col-lg-4 col-md-6 col-sm-12 col-xs-12\">\n <button @click=\"newCacheKey\" class=\"btn btn-sm float-right btn-info\"><span class=\"fas fa-sync\"></span></button>\n </div>\n </div>\n </div>\n</template>\n\n<script>\n\nimport {mapGetters, mapMutations} from \"vuex\";\nimport Sortable from \"sortablejs\";\nimport format from \"date-fns/format\";\n// import {setup} from 'axios-cache-adapter';\n// import {cacheAdapterEnhancer} from 'axios-extensions';\nimport {configureAxios} from \"../../shared/forageStore\";\n\n\n// get all and cache, dont keep the table busy.\n\nexport default {\n name: \"Index\",\n props: {\n accountTypes: String\n },\n data() {\n return {\n accounts: [],\n allAccounts: [],\n type: 'all',\n downloaded: false,\n loading: false,\n ready: false,\n fields: [],\n currentPage: 1,\n perPage: 5,\n total: 1,\n sortBy: 'order',\n sortDesc: false,\n api: null,\n sortableOptions: {\n disabled: false,\n chosenClass: 'is-selected',\n onEnd: null\n },\n sortable: null,\n locale: 'en-US'\n }\n },\n watch: {\n start: function () {\n this.getAccountList();\n },\n end: function () {\n this.getAccountList();\n },\n orderMode: function (value) {\n // update the table headers\n this.updateFieldList();\n\n // reorder the accounts:\n this.reorderAccountList(value);\n\n // make table sortable:\n this.makeTableSortable(value);\n },\n activeFilter: function (value) {\n this.filterAccountList();\n }\n },\n computed: {\n ...mapGetters('root', ['listPageSize', 'cacheKey']),\n ...mapGetters('accounts/index', ['orderMode', 'activeFilter']),\n ...mapGetters('dashboard/index', ['start', 'end',]),\n 'indexReady': function () {\n return null !== this.start && null !== this.end && null !== this.listPageSize && this.ready;\n },\n cardTitle: function () {\n return this.$t('firefly.' + this.type + '_accounts');\n }\n },\n created() {\n this.locale = localStorage.locale ?? 'en-US';\n let pathName = window.location.pathname;\n let parts = pathName.split('/');\n this.type = parts[parts.length - 1];\n this.perPage = this.listPageSize ?? 51;\n // console.log('Per page: ' + this.perPage);\n\n let params = new URLSearchParams(window.location.search);\n this.currentPage = params.get('page') ? parseInt(params.get('page')) : 1;\n this.updateFieldList();\n this.ready = true;\n\n // make object thing:\n // let token = document.head.querySelector('meta[name=\"csrf-token\"]');\n // this.api = setup(\n // {\n // // `axios` options\n // //baseURL: './',\n // headers: {'X-CSRF-TOKEN': token.content, 'X-James': 'yes'},\n //\n // // `axios-cache-adapter` options\n // cache: {\n // maxAge: 15 * 60 * 1000,\n // readHeaders: false,\n // exclude: {\n // query: false,\n // },\n // debug: true\n // }\n // });\n },\n\n methods: {\n ...mapMutations('root', ['refreshCacheKey',]),\n // itemsProvider: function (ctx, callback) {\n // console.log('itemsProvider()');\n // console.log('ctx.currentPage = ' + ctx.currentPage);\n // console.log('this.currentPage = ' + this.currentPage);\n // if (ctx.currentPage === this.currentPage) {\n // let direction = this.sortDesc ? '-' : '+';\n // let url = 'api/v1/accounts?type=' + this.type + '&page=' + ctx.currentPage + '&sort=' + direction + this.sortBy;\n // this.api.get(url)\n // .then(async (response) => {\n // this.total = parseInt(response.data.meta.pagination.total);\n // let items = this.parseAccountsAndReturn(response.data.data);\n // items = this.filterAccountListAndReturn(items);\n // callback(items);\n // }\n // );\n // return null;\n // }\n // return [];\n // },\n\n saveAccountSort: function (event) {\n let oldIndex = parseInt(event.oldIndex);\n let newIndex = parseInt(event.newIndex);\n let identifier = parseInt(event.item.attributes.getNamedItem('data-pk').value);\n for (let i in this.accounts) {\n if (this.accounts.hasOwnProperty(i) && /^0$|^[1-9]\\d*$/.test(i) && i <= 4294967294) {\n let current = this.accounts[i];\n\n // the actual account\n if (current.id === identifier) {\n let newOrder = parseInt(current.order) + (newIndex - oldIndex);\n this.accounts[i].order = newOrder;\n let url = './api/v1/accounts/' + current.id;\n axios.put(url, {order: newOrder}).then(response => {\n// See reference nr. 8\n this.getAccountList();\n });\n }\n }\n }\n },\n reorderAccountList: function (orderMode) {\n if (orderMode) {\n this.sortBy = 'order';\n this.sortDesc = false;\n }\n },\n newCacheKey: function () {\n this.refreshCacheKey();\n this.downloaded = false;\n this.accounts = [];\n this.getAccountList();\n },\n makeTableSortable: function (orderMode) {\n this.sortableOptions.disabled = !orderMode;\n this.sortableOptions.onEnd = this.saveAccountSort;\n\n // make sortable of table:\n if (null === this.sortable) {\n this.sortable = Sortable.create(this.$refs.table.$el.querySelector('tbody'), this.sortableOptions);\n }\n this.sortable.option('disabled', this.sortableOptions.disabled);\n },\n\n updateFieldList: function () {\n this.fields = [];\n this.fields = [{key: 'name', label: this.$t('list.name'), sortable: !this.orderMode}];\n if ('asset' === this.type) {\n this.fields.push({key: 'role', label: this.$t('list.role'), sortable: !this.orderMode});\n }\n if ('liabilities' === this.type) {\n this.fields.push({key: 'liability_type', label: this.$t('list.liability_type'), sortable: !this.orderMode});\n this.fields.push({key: 'liability_direction', label: this.$t('list.liability_direction'), sortable: !this.orderMode});\n this.fields.push({key: 'interest', label: this.$t('list.interest') + ' (' + this.$t('list.interest_period') + ')', sortable: !this.orderMode});\n }\n // add the rest\n this.fields.push({key: 'acct_number', label: this.$t('list.iban'), sortable: !this.orderMode});\n this.fields.push({key: 'current_balance', label: this.$t('list.currentBalance'), sortable: !this.orderMode});\n if ('liabilities' === this.type) {\n this.fields.push({key: 'amount_due', label: this.$t('firefly.left_in_debt'), sortable: !this.orderMode});\n }\n if ('asset' === this.type || 'liabilities' === this.type) {\n this.fields.push({key: 'last_activity', label: this.$t('list.lastActivity'), sortable: !this.orderMode});\n }\n this.fields.push({key: 'menu', label: ' ', sortable: false});\n },\n getAccountList: function () {\n // console.log('getAccountList()');\n if (this.indexReady && !this.loading && !this.downloaded) {\n // console.log('Index ready, not loading and not already downloaded. Reset.');\n this.loading = true;\n this.perPage = this.listPageSize ?? 51;\n this.accounts = [];\n this.allAccounts = [];\n this.downloadAccountList(1);\n }\n if (this.indexReady && !this.loading && this.downloaded) {\n // console.log('Index ready, not loading and not downloaded.');\n this.loading = true;\n this.filterAccountList();\n }\n },\n downloadAccountList: function (page) {\n // console.log('downloadAccountList(' + page + ')');\n configureAxios().then(async (api) => {\n api.get('./api/v1/accounts?type=' + this.type + '&page=' + page + '&key=' + this.cacheKey)\n .then(response => {\n let currentPage = parseInt(response.data.meta.pagination.current_page);\n let totalPage = parseInt(response.data.meta.pagination.total_pages);\n this.total = parseInt(response.data.meta.pagination.total);\n this.parseAccounts(response.data.data);\n if (currentPage < totalPage) {\n let nextPage = currentPage + 1;\n this.downloadAccountList(nextPage);\n }\n if (currentPage >= totalPage) {\n // console.log('Looks like all downloaded.');\n this.downloaded = true;\n this.filterAccountList();\n }\n }\n );\n });\n },\n filterAccountListAndReturn: function (allAccounts) {\n // console.log('filterAccountListAndReturn()');\n let accounts = [];\n for (let i in allAccounts) {\n if (allAccounts.hasOwnProperty(i) && /^0$|^[1-9]\\d*$/.test(i) && i <= 4294967294) {\n // 1 = active only\n // 2 = inactive only\n // 3 = both\n if (1 === this.activeFilter && false === allAccounts[i].active) {\n // console.log('Skip account #' + this.allAccounts[i].id + ' because not active.');\n continue;\n }\n if (2 === this.activeFilter && true === allAccounts[i].active) {\n // console.log('Skip account #' + this.allAccounts[i].id + ' because active.');\n continue;\n }\n // console.log('Include account #' + this.allAccounts[i].id + '.');\n\n accounts.push(allAccounts[i]);\n }\n }\n return accounts;\n },\n filterAccountList: function () {\n // console.log('filterAccountList()');\n this.accounts = [];\n for (let i in this.allAccounts) {\n if (this.allAccounts.hasOwnProperty(i) && /^0$|^[1-9]\\d*$/.test(i) && i <= 4294967294) {\n // 1 = active only\n // 2 = inactive only\n // 3 = both\n if (1 === this.activeFilter && false === this.allAccounts[i].active) {\n // console.log('Skip account #' + this.allAccounts[i].id + ' because not active.');\n continue;\n }\n if (2 === this.activeFilter && true === this.allAccounts[i].active) {\n // console.log('Skip account #' + this.allAccounts[i].id + ' because active.');\n continue;\n }\n // console.log('Include account #' + this.allAccounts[i].id + '.');\n\n this.accounts.push(this.allAccounts[i]);\n }\n }\n this.total = this.accounts.length;\n this.loading = false;\n },\n roleTranslate: function (role) {\n if (null === role) {\n return '';\n }\n return this.$t('firefly.account_role_' + role);\n },\n parsePages: function (data) {\n this.total = parseInt(data.pagination.total);\n // console.log('Total is now ' + this.total);\n },\n // parseAccountsAndReturn: function (data) {\n // console.log('In parseAccountsAndReturn()');\n // let allAccounts = [];\n // for (let key in data) {\n // if (data.hasOwnProperty(key) && /^0$|^[1-9]\\d*$/.test(key) && key <= 4294967294) {\n // let current = data[key];\n // let acct = {};\n // acct.id = parseInt(current.id);\n // acct.order = current.attributes.order;\n // acct.name = current.attributes.name;\n // acct.active = current.attributes.active;\n // acct.role = this.roleTranslate(current.attributes.account_role);\n // acct.account_number = current.attributes.account_number;\n // acct.current_balance = current.attributes.current_balance;\n // acct.currency_code = current.attributes.currency_code;\n //\n // if ('liabilities' === this.type) {\n // acct.liability_type = this.$t('firefly.account_type_' + current.attributes.liability_type);\n // acct.liability_direction = this.$t('firefly.liability_direction_' + current.attributes.liability_direction + '_short');\n // acct.interest = current.attributes.interest;\n // acct.interest_period = this.$t('firefly.interest_calc_' + current.attributes.interest_period);\n // acct.amount_due = current.attributes.current_debt;\n // }\n // acct.balance_diff = 'loading';\n // acct.last_activity = 'loading';\n //\n // if (null !== current.attributes.iban) {\n // acct.iban = current.attributes.iban.match(/.{1,4}/g).join(' ');\n // }\n // if (null === current.attributes.iban) {\n // acct.iban = null;\n // }\n //\n // allAccounts.push(acct);\n // if ('asset' === this.type) {\n// See reference nr. 9\n // //this.getAccountBalanceDifference(this.allAccounts.length - 1, current);\n // //this.getAccountLastActivity(this.allAccounts.length - 1, current);\n // }\n // }\n // }\n // return allAccounts;\n // },\n parseAccounts: function (data) {\n // console.log('In parseAccounts()');\n for (let key in data) {\n if (data.hasOwnProperty(key) && /^0$|^[1-9]\\d*$/.test(key) && key <= 4294967294) {\n let current = data[key];\n let acct = {};\n acct.id = parseInt(current.id);\n acct.order = current.attributes.order;\n acct.name = current.attributes.name;\n acct.active = current.attributes.active;\n acct.role = this.roleTranslate(current.attributes.account_role);\n\n // account number in 'acct_number'\n acct.acct_number = '';\n let iban = null;\n let acctNr = null;\n acct.acct_number = '';\n if (null !== current.attributes.iban) {\n iban = current.attributes.iban.match(/.{1,4}/g).join(' ');\n }\n if (null !== current.attributes.account_number) {\n acctNr = current.attributes.account_number;\n }\n // only account nr\n if (null === iban && null !== acctNr) {\n acct.acct_number = acctNr;\n }\n // only iban\n if (null !== iban && null === acctNr) {\n acct.acct_number = iban;\n }\n // both:\n if (null !== iban && null !== acctNr) {\n acct.acct_number = iban + ' (' + acctNr + ')';\n }\n\n\n acct.current_balance = current.attributes.current_balance;\n acct.currency_code = current.attributes.currency_code;\n\n if ('liabilities' === this.type) {\n acct.liability_type = this.$t('firefly.account_type_' + current.attributes.liability_type);\n acct.liability_direction = this.$t('firefly.liability_direction_' + current.attributes.liability_direction + '_short');\n acct.interest = current.attributes.interest;\n acct.interest_period = this.$t('firefly.interest_calc_' + current.attributes.interest_period);\n acct.amount_due = current.attributes.current_debt;\n }\n acct.balance_diff = 'loading';\n acct.last_activity = 'loading';\n\n this.allAccounts.push(acct);\n if ('asset' === this.type) {\n this.getAccountBalanceDifference(this.allAccounts.length - 1, current);\n this.getAccountLastActivity(this.allAccounts.length - 1, current);\n }\n }\n }\n },\n getAccountLastActivity: function (index, acct) {\n // console.log('getAccountLastActivity(' + index + ')');\n // get single transaction for account:\n // /api/v1/accounts/1/transactions?limit=1\n configureAxios().then(async (api) => {\n api.get('./api/v1/accounts/' + acct.id + '/transactions?limit=1&key=' + this.cacheKey).then(response => {\n if (0 === response.data.data.length) {\n this.allAccounts[index].last_activity = 'none';\n return;\n }\n let date = new Date(response.data.data[0].attributes.transactions[0].date);\n this.allAccounts[index].last_activity = format(date, this.$t('config.month_and_day_fns'));\n });\n });\n },\n getAccountBalanceDifference: function (index, acct) {\n // console.log('getAccountBalanceDifference(' + index + ')');\n // get account on day 0\n let promises = [];\n\n // add meta data to promise context.\n promises.push(Promise.resolve({\n account: acct,\n index: index,\n }));\n\n let startStr = format(this.start, 'y-MM-dd');\n let endStr = format(this.end, 'y-MM-dd');\n\n configureAxios().then(api => {\n return api.get('./api/v1/accounts/' + acct.id + '?date=' + startStr + '&key=' + this.cacheKey);\n });\n\n //promises.push(axios.get('./api/v1/accounts/' + acct.id + '?date=' + startStr + '&key=' + this.cacheKey));\n promises.push(configureAxios().then(api => {\n return api.get('./api/v1/accounts/' + acct.id + '?date=' + startStr + '&key=' + this.cacheKey);\n }));\n promises.push(configureAxios().then(api => {\n return api.get('./api/v1/accounts/' + acct.id + '?date=' + endStr + '&key=' + this.cacheKey);\n }));\n\n Promise.all(promises).then(responses => {\n let index = responses[0].index;\n let startBalance = parseFloat(responses[1].data.data.attributes.current_balance);\n let endBalance = parseFloat(responses[2].data.data.attributes.current_balance);\n this.allAccounts[index].balance_diff = endBalance - startBalance;\n });\n },\n }\n}\n</script>\n","import mod from \"-!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Index.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Index.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./Index.vue?vue&type=template&id=440bbf12&\"\nimport script from \"./Index.vue?vue&type=script&lang=js&\"\nexport * from \"./Index.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col-lg-8 col-md-6 col-sm-12 col-xs-12\"},[_c('b-pagination',{attrs:{\"total-rows\":_vm.total,\"per-page\":_vm.perPage,\"aria-controls\":\"my-table\"},model:{value:(_vm.currentPage),callback:function ($$v) {_vm.currentPage=$$v},expression:\"currentPage\"}})],1),_vm._v(\" \"),_c('div',{staticClass:\"col-lg-4 col-md-6 col-sm-12 col-xs-12\"},[_c('button',{staticClass:\"btn btn-sm float-right btn-info\",on:{\"click\":_vm.newCacheKey}},[_c('span',{staticClass:\"fas fa-sync\"})])])]),_vm._v(\" \"),_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col-lg-12 col-md-12 col-sm-12 col-xs-12\"},[_c('div',{staticClass:\"card\"},[_c('div',{staticClass:\"card-body p-0\"},[_c('b-table',{ref:\"table\",attrs:{\"id\":\"my-table\",\"striped\":\"\",\"hover\":\"\",\"responsive\":\"md\",\"primary-key\":\"id\",\"no-local-sorting\":false,\"items\":_vm.accounts,\"fields\":_vm.fields,\"per-page\":_vm.perPage,\"sort-icon-left\":\"\",\"current-page\":_vm.currentPage,\"busy\":_vm.loading,\"sort-by\":_vm.sortBy,\"sort-desc\":_vm.sortDesc},on:{\"update:busy\":function($event){_vm.loading=$event},\"update:sortBy\":function($event){_vm.sortBy=$event},\"update:sort-by\":function($event){_vm.sortBy=$event},\"update:sortDesc\":function($event){_vm.sortDesc=$event},\"update:sort-desc\":function($event){_vm.sortDesc=$event}},scopedSlots:_vm._u([{key:\"table-busy\",fn:function(){return [_c('span',{staticClass:\"fas fa-spinner fa-spin\"})]},proxy:true},{key:\"cell(name)\",fn:function(data){return [_c('a',{class:false === data.item.active ? 'text-muted' : '',attrs:{\"href\":'./accounts/show/' + data.item.id,\"title\":data.value}},[_vm._v(_vm._s(data.value))])]}},{key:\"cell(acct_number)\",fn:function(data){return [_vm._v(\"\\n \"+_vm._s(data.item.acct_number)+\"\\n \")]}},{key:\"cell(last_activity)\",fn:function(data){return [('asset' === _vm.type && 'loading' === data.item.last_activity)?_c('span',[_c('span',{staticClass:\"fas fa-spinner fa-spin\"})]):_vm._e(),_vm._v(\" \"),('asset' === _vm.type && 'none' === data.item.last_activity)?_c('span',{staticClass:\"text-muted\"},[_vm._v(\"\\n \"+_vm._s(_vm.$t('firefly.never'))+\"\\n \")]):_vm._e(),_vm._v(\" \"),('asset' === _vm.type && 'loading' !== data.item.last_activity && 'none' !== data.item.last_activity)?_c('span',[_vm._v(\"\\n \"+_vm._s(data.item.last_activity)+\"\\n \")]):_vm._e()]}},{key:\"cell(amount_due)\",fn:function(data){return [(parseFloat(data.item.amount_due) > 0)?_c('span',{staticClass:\"text-success\"},[_vm._v(\"\\n \"+_vm._s(Intl.NumberFormat(_vm.locale, {style: 'currency', currency: data.item.currency_code}).format(data.item.amount_due))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(parseFloat(data.item.amount_due) < 0)?_c('span',{staticClass:\"text-danger\"},[_vm._v(\"\\n \"+_vm._s(Intl.NumberFormat(_vm.locale, {style: 'currency', currency: data.item.currency_code}).format(data.item.amount_due))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(parseFloat(data.item.amount_due) === 0.0)?_c('span',{staticClass:\"text-muted\"},[_vm._v(\"\\n \"+_vm._s(Intl.NumberFormat(_vm.locale, {style: 'currency', currency: data.item.currency_code}).format(data.item.amount_due))+\"\\n \")]):_vm._e()]}},{key:\"cell(current_balance)\",fn:function(data){return [(parseFloat(data.item.current_balance) > 0)?_c('span',{staticClass:\"text-success\"},[_vm._v(\"\\n \"+_vm._s(Intl.NumberFormat(_vm.locale, {\n style: 'currency', currency:\n data.item.currency_code\n }).format(data.item.current_balance))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(parseFloat(data.item.current_balance) < 0)?_c('span',{staticClass:\"text-danger\"},[_vm._v(\"\\n \"+_vm._s(Intl.NumberFormat(_vm.locale, {\n style: 'currency', currency:\n data.item.currency_code\n }).format(data.item.current_balance))+\"\\n \")]):_vm._e(),_vm._v(\" \"),(0 === parseFloat(data.item.current_balance))?_c('span',{staticClass:\"text-muted\"},[_vm._v(\"\\n \"+_vm._s(Intl.NumberFormat(_vm.locale, {\n style: 'currency', currency:\n data.item.currency_code\n }).format(data.item.current_balance))+\"\\n \")]):_vm._e(),_vm._v(\" \"),('asset' === _vm.type && 'loading' === data.item.balance_diff)?_c('span',[_c('span',{staticClass:\"fas fa-spinner fa-spin\"})]):_vm._e(),_vm._v(\" \"),('asset' === _vm.type && 'loading' !== data.item.balance_diff)?_c('span',[_vm._v(\"\\n (\"),(parseFloat(data.item.balance_diff) > 0)?_c('span',{staticClass:\"text-success\"},[_vm._v(_vm._s(Intl.NumberFormat(_vm.locale, {\n style: 'currency', currency:\n data.item.currency_code\n }).format(data.item.balance_diff)))]):_vm._e(),(0===parseFloat(data.item.balance_diff))?_c('span',{staticClass:\"text-muted\"},[_vm._v(_vm._s(Intl.NumberFormat(_vm.locale, {\n style: 'currency', currency:\n data.item.currency_code\n }).format(data.item.balance_diff)))]):_vm._e(),(parseFloat(data.item.balance_diff) < 0)?_c('span',{staticClass:\"text-danger\"},[_vm._v(_vm._s(Intl.NumberFormat(_vm.locale, {\n style: 'currency', currency:\n data.item.currency_code\n }).format(data.item.balance_diff)))]):_vm._e(),_vm._v(\")\\n \")]):_vm._e()]}},{key:\"cell(interest)\",fn:function(data){return [_vm._v(\"\\n \"+_vm._s(parseFloat(data.item.interest))+\"% (\"+_vm._s(data.item.interest_period)+\")\\n \")]}},{key:\"cell(menu)\",fn:function(data){return [_c('div',{staticClass:\"btn-group btn-group-sm\"},[_c('div',{staticClass:\"dropdown\"},[_c('button',{staticClass:\"btn btn-light btn-sm dropdown-toggle\",attrs:{\"type\":\"button\",\"id\":'dropdownMenuButton' + data.item.id,\"data-toggle\":\"dropdown\",\"aria-haspopup\":\"true\",\"aria-expanded\":\"false\"}},[_vm._v(\"\\n \"+_vm._s(_vm.$t('firefly.actions'))+\"\\n \")]),_vm._v(\" \"),_c('div',{staticClass:\"dropdown-menu\",attrs:{\"aria-labelledby\":'dropdownMenuButton' + data.item.id}},[_c('a',{staticClass:\"dropdown-item\",attrs:{\"href\":'./accounts/edit/' + data.item.id}},[_c('span',{staticClass:\"fa fas fa-pencil-alt\"}),_vm._v(\" \"+_vm._s(_vm.$t('firefly.edit')))]),_vm._v(\" \"),_c('a',{staticClass:\"dropdown-item\",attrs:{\"href\":'./accounts/delete/' + data.item.id}},[_c('span',{staticClass:\"fa far fa-trash\"}),_vm._v(\" \"+_vm._s(_vm.$t('firefly.delete')))]),_vm._v(\" \"),('asset' === _vm.type)?_c('a',{staticClass:\"dropdown-item\",attrs:{\"href\":'./accounts/reconcile/' + data.item.id + '/index'}},[_c('span',{staticClass:\"fas fa-check\"}),_vm._v(\"\\n \"+_vm._s(_vm.$t('firefly.reconcile_this_account')))]):_vm._e()])])])]}}])})],1),_vm._v(\" \"),_c('div',{staticClass:\"card-footer\"},[_c('a',{staticClass:\"btn btn-success\",attrs:{\"href\":'./accounts/create/' + _vm.type,\"title\":_vm.$t('firefly.create_new_' + _vm.type)}},[_vm._v(_vm._s(_vm.$t('firefly.create_new_' + _vm.type)))])])])])]),_vm._v(\" \"),_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col-lg-8 col-md-6 col-sm-12 col-xs-12\"},[_c('b-pagination',{attrs:{\"total-rows\":_vm.total,\"per-page\":_vm.perPage,\"aria-controls\":\"my-table\"},model:{value:(_vm.currentPage),callback:function ($$v) {_vm.currentPage=$$v},expression:\"currentPage\"}})],1),_vm._v(\" \"),_c('div',{staticClass:\"col-lg-4 col-md-6 col-sm-12 col-xs-12\"},[_c('button',{staticClass:\"btn btn-sm float-right btn-info\",on:{\"click\":_vm.newCacheKey}},[_c('span',{staticClass:\"fas fa-sync\"})])])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<!--\n - IndexOptions.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 <https://www.gnu.org/licenses/>.\n -->\n\n<template>\n <div>\n <div class=\"form-check\">\n <input class=\"form-check-input\" type=\"checkbox\" name=\"order_mode\" id=\"order_mode\" v-model=\"orderMode\">\n <label class=\"form-check-label\" for=\"order_mode\">\n Enable order mode\n </label>\n </div>\n <div class=\"form-check\">\n <input class=\"form-check-input\" :disabled=\"orderMode\" type=\"radio\" value=\"1\" v-model=\"activeFilter\" id=\"active_filter_1\">\n <label class=\"form-check-label\" for=\"active_filter_1\">\n Show active accounts\n </label>\n </div>\n\n <div class=\"form-check\">\n <input class=\"form-check-input\" :disabled=\"orderMode\" type=\"radio\" value=\"2\" v-model=\"activeFilter\" id=\"active_filter_2\">\n <label class=\"form-check-label\" for=\"active_filter_2\">\n Show inactive accounts\n </label>\n </div>\n\n <div class=\"form-check\">\n <input class=\"form-check-input\" :disabled=\"orderMode\" type=\"radio\" value=\"3\" v-model=\"activeFilter\" id=\"active_filter_3\">\n <label class=\"form-check-label\" for=\"active_filter_3\">\n Show both\n </label>\n </div>\n </div>\n</template>\n\n<script>\n\nexport default {\n name: \"IndexOptions\",\n data() {\n return {\n type: 'invalid'\n }\n },\n // watch orderMode, if its false then go to active in filter.\n computed: {\n orderMode: {\n get() {\n return this.$store.getters[\"accounts/index/orderMode\"];\n },\n set(value) {\n this.$store.commit('accounts/index/setOrderMode', value);\n if(true===value) {\n this.$store.commit('accounts/index/setActiveFilter', 1);\n }\n }\n },\n activeFilter: {\n get() {\n return this.$store.getters[\"accounts/index/activeFilter\"];\n },\n set(value) {\n this.$store.commit('accounts/index/setActiveFilter', parseInt(value));\n }\n },\n },\n created() {\n let pathName = window.location.pathname;\n let parts = pathName.split('/');\n this.type = parts[parts.length - 1];\n }\n}\n</script>\n\n","import mod from \"-!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./IndexOptions.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./IndexOptions.vue?vue&type=script&lang=js&\"","import { render, staticRenderFns } from \"./IndexOptions.vue?vue&type=template&id=1217d6d3&\"\nimport script from \"./IndexOptions.vue?vue&type=script&lang=js&\"\nexport * from \"./IndexOptions.vue?vue&type=script&lang=js&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:\"form-check\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.orderMode),expression:\"orderMode\"}],staticClass:\"form-check-input\",attrs:{\"type\":\"checkbox\",\"name\":\"order_mode\",\"id\":\"order_mode\"},domProps:{\"checked\":Array.isArray(_vm.orderMode)?_vm._i(_vm.orderMode,null)>-1:(_vm.orderMode)},on:{\"change\":function($event){var $$a=_vm.orderMode,$$el=$event.target,$$c=$$el.checked?(true):(false);if(Array.isArray($$a)){var $$v=null,$$i=_vm._i($$a,$$v);if($$el.checked){$$i<0&&(_vm.orderMode=$$a.concat([$$v]))}else{$$i>-1&&(_vm.orderMode=$$a.slice(0,$$i).concat($$a.slice($$i+1)))}}else{_vm.orderMode=$$c}}}}),_vm._v(\" \"),_c('label',{staticClass:\"form-check-label\",attrs:{\"for\":\"order_mode\"}},[_vm._v(\"\\n Enable order mode\\n \")])]),_vm._v(\" \"),_c('div',{staticClass:\"form-check\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.activeFilter),expression:\"activeFilter\"}],staticClass:\"form-check-input\",attrs:{\"disabled\":_vm.orderMode,\"type\":\"radio\",\"value\":\"1\",\"id\":\"active_filter_1\"},domProps:{\"checked\":_vm._q(_vm.activeFilter,\"1\")},on:{\"change\":function($event){_vm.activeFilter=\"1\"}}}),_vm._v(\" \"),_c('label',{staticClass:\"form-check-label\",attrs:{\"for\":\"active_filter_1\"}},[_vm._v(\"\\n Show active accounts\\n \")])]),_vm._v(\" \"),_c('div',{staticClass:\"form-check\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.activeFilter),expression:\"activeFilter\"}],staticClass:\"form-check-input\",attrs:{\"disabled\":_vm.orderMode,\"type\":\"radio\",\"value\":\"2\",\"id\":\"active_filter_2\"},domProps:{\"checked\":_vm._q(_vm.activeFilter,\"2\")},on:{\"change\":function($event){_vm.activeFilter=\"2\"}}}),_vm._v(\" \"),_c('label',{staticClass:\"form-check-label\",attrs:{\"for\":\"active_filter_2\"}},[_vm._v(\"\\n Show inactive accounts\\n \")])]),_vm._v(\" \"),_c('div',{staticClass:\"form-check\"},[_c('input',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.activeFilter),expression:\"activeFilter\"}],staticClass:\"form-check-input\",attrs:{\"disabled\":_vm.orderMode,\"type\":\"radio\",\"value\":\"3\",\"id\":\"active_filter_3\"},domProps:{\"checked\":_vm._q(_vm.activeFilter,\"3\")},on:{\"change\":function($event){_vm.activeFilter=\"3\"}}}),_vm._v(\" \"),_c('label',{staticClass:\"form-check-label\",attrs:{\"for\":\"active_filter_3\"}},[_vm._v(\"\\n Show both\\n \")])])])}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","/*\n * index.js\n * Copyright (c) 2020 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 <https://www.gnu.org/licenses/>.\n */\nrequire('../../bootstrap');\n\nimport Vue from \"vue\";\nimport Index from \"../../components/accounts/Index\";\nimport store from \"../../components/store\";\nimport {BPagination, BTable} from 'bootstrap-vue';\nimport Calendar from \"../../components/dashboard/Calendar\";\nimport IndexOptions from \"../../components/accounts/IndexOptions\";\n\n// i18n\nlet i18n = require('../../i18n');\nlet props = {};\n\n// See reference nr. 8\n// See reference nr. 9\n\nVue.component('b-table', BTable);\nVue.component('b-pagination', BPagination);\n//Vue.use(Vuex);\n\nconst app = new Vue({\n i18n,\n store,\n el: \"#accounts\",\n render: (createElement) => {\n return createElement(Index, {props: props});\n },\n beforeCreate() {\n// See reference nr. 10\n this.$store.commit('initialiseStore');\n this.$store.dispatch('updateCurrencyPreference');\n\n // init the new root store (dont care about results)\n this.$store.dispatch('root/initialiseStore');\n\n // also init the dashboard store.\n this.$store.dispatch('dashboard/index/initialiseStore');\n },\n });\n\nconst calendar = new Vue({\n i18n,\n store,\n el: \"#calendar\",\n render: (createElement) => {\n return createElement(Calendar, {props: props});\n },\n// See reference nr. 11\n });\n\nconst opt = new Vue({\n i18n,\n store,\n el: \"#indexOptions\",\n render: (createElement) => {\n return createElement(IndexOptions, {props: props});\n },\n// See reference nr. 12\n });","/*\n * forageStore.js\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 <https://www.gnu.org/licenses/>.\n */\n\nimport localforage from 'localforage'\nimport memoryDriver from 'localforage-memoryStorageDriver'\nimport {setup} from 'axios-cache-adapter'\n\n// `async` wrapper to configure `localforage` and instantiate `axios` with `axios-cache-adapter`\nexport async function configureAxios() {\n // Register the custom `memoryDriver` to `localforage`\n await localforage.defineDriver(memoryDriver)\n\n // Create `localforage` instance\n const forageStore = localforage.createInstance({\n // List of drivers used\n driver: [\n localforage.INDEXEDDB,\n localforage.LOCALSTORAGE,\n memoryDriver._driver\n ],\n // Prefix all storage keys to prevent conflicts\n name: 'my-cache'\n })\n\n // Create `axios` instance with pre-configured `axios-cache-adapter` using a `localforage` store\n let token = document.head.querySelector('meta[name=\"csrf-token\"]');\n return setup({\n // `axios` options\n baseURL: './',\n headers: {'X-CSRF-TOKEN': token.content, 'X-James-Rocks': 'oh yes'},\n cache: {\n // `axios-cache-adapter` options\n maxAge: 24 * 60 * 60 * 1000, // one day.\n readHeaders: false,\n exclude: {\n query: false,\n },\n debug: true,\n store: forageStore,\n }\n }\n );\n\n}","/*\n * transactions.js\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 <https://www.gnu.org/licenses/>.\n */\n\nexport function getDefaultErrors() {\n return {\n description: [],\n amount: [],\n source: [],\n destination: [],\n currency: [],\n foreign_currency: [],\n foreign_amount: [],\n date: [],\n custom_dates: [],\n budget: [],\n category: [],\n bill: [],\n tags: [],\n piggy_bank: [],\n internal_reference: [],\n external_url: [],\n notes: [],\n location: []\n };\n}\n\nexport function getDefaultTransaction() {\n return {\n // basic\n description: '',\n transaction_journal_id: 0,\n // accounts:\n source_account_id: null,\n source_account_name: null,\n source_account_type: null,\n\n source_account_currency_id: null,\n source_account_currency_code: null,\n source_account_currency_symbol: null,\n\n destination_account_id: null,\n destination_account_name: null,\n destination_account_type: null,\n\n destination_account_currency_id: null,\n destination_account_currency_code: null,\n destination_account_currency_symbol: null,\n attachments: false,\n selectedAttachments: false,\n uploadTrigger: false,\n clearTrigger: false,\n\n source_account: {\n id: 0,\n name: \"\",\n name_with_balance: \"\",\n type: \"\",\n currency_id: 0,\n currency_name: '',\n currency_code: '',\n currency_decimal_places: 2\n },\n destination_account: {\n id: 0,\n name: \"\",\n type: \"\",\n currency_id: 0,\n currency_name: '',\n currency_code: '',\n currency_decimal_places: 2\n },\n\n // amount:\n amount: '',\n currency_id: 0,\n foreign_amount: '',\n foreign_currency_id: 0,\n\n // meta data\n category: null,\n budget_id: 0,\n bill_id: 0,\n piggy_bank_id: 0,\n tags: [],\n\n // optional date fields (6x):\n interest_date: null,\n book_date: null,\n process_date: null,\n due_date: null,\n payment_date: null,\n invoice_date: null,\n\n // optional other fields:\n internal_reference: null,\n external_url: null,\n external_id: null,\n notes: null,\n\n // transaction links:\n links: [],\n // location:\n zoom_level: null,\n longitude: null,\n latitude: null,\n\n // error handling\n errors: {},\n }\n}\n\nexport function toW3CString(date) {\n // https://gist.github.com/tristanlins/6585391\n let year = date.getFullYear();\n let month = date.getMonth();\n month++;\n if (month < 10) {\n month = '0' + month;\n }\n let day = date.getDate();\n if (day < 10) {\n day = '0' + day;\n }\n let hours = date.getHours();\n if (hours < 10) {\n hours = '0' + hours;\n }\n let minutes = date.getMinutes();\n if (minutes < 10) {\n minutes = '0' + minutes;\n }\n let seconds = date.getSeconds();\n if (seconds < 10) {\n seconds = '0' + seconds;\n }\n let offset = -date.getTimezoneOffset();\n let offsetHours = Math.abs(Math.floor(offset / 60));\n let offsetMinutes = Math.abs(offset) - offsetHours * 60;\n if (offsetHours < 10) {\n offsetHours = '0' + offsetHours;\n }\n if (offsetMinutes < 10) {\n offsetMinutes = '0' + offsetMinutes;\n }\n let offsetSign = '+';\n if (offset < 0) {\n offsetSign = '-';\n }\n return year + '-' + month + '-' + day +\n 'T' + hours + ':' + minutes + ':' + seconds +\n offsetSign + offsetHours + ':' + offsetMinutes;\n}","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/cssWithMappingToString.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".dropdown-item[data-v-1ce542a2],.dropdown-item[data-v-1ce542a2]:hover{color:#212529}\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/components/dashboard/Calendar.vue\"],\"names\":[],\"mappings\":\"AAslBA,sEACA,aACA\",\"sourcesContent\":[\"<!--\\n - Calendar.vue\\n - Copyright (c) 2020 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 <https://www.gnu.org/licenses/>.\\n -->\\n\\n<template>\\n <div>\\n <div class=\\\"row\\\">\\n <div class=\\\"col\\\">Start</div>\\n <div class=\\\"col-8\\\">{{ new Intl.DateTimeFormat(locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(range.start) }}</div>\\n </div>\\n <div class=\\\"row\\\">\\n <div class=\\\"col\\\">End</div>\\n <div class=\\\"col-8\\\">{{ new Intl.DateTimeFormat(locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(range.end) }}</div>\\n </div>\\n <date-picker\\n v-model=\\\"range\\\"\\n :rows=\\\"2\\\"\\n is-range\\n mode=\\\"date\\\"\\n >\\n <template v-slot=\\\"{ inputValue, inputEvents, isDragging, togglePopover }\\\">\\n <div class=\\\"row\\\">\\n <div class=\\\"col\\\">\\n <div class=\\\"btn-group btn-group-sm d-flex\\\">\\n <button\\n :title=\\\"$t('firefly.custom_period')\\\" class=\\\"btn btn-secondary btn-sm\\\"\\n @click=\\\"togglePopover({ placement: 'auto-start', positionFixed: true })\\\"\\n ><span class=\\\"fas fa-calendar-alt\\\"></span></button>\\n <button :title=\\\"$t('firefly.reset_to_current')\\\"\\n class=\\\"btn btn-secondary\\\"\\n @click=\\\"resetDate\\\"\\n ><span class=\\\"fas fa-history\\\"></span></button>\\n <button id=\\\"dropdownMenuButton\\\" :title=\\\"$t('firefly.select_period')\\\" aria-expanded=\\\"false\\\" aria-haspopup=\\\"true\\\"\\n class=\\\"btn btn-secondary dropdown-toggle\\\"\\n data-toggle=\\\"dropdown\\\"\\n type=\\\"button\\\">\\n <span class=\\\"fas fa-list\\\"></span>\\n </button>\\n <div aria-labelledby=\\\"dropdownMenuButton\\\" class=\\\"dropdown-menu\\\">\\n <a v-for=\\\"period in periods\\\" class=\\\"dropdown-item\\\" href=\\\"#\\\" @click=\\\"customDate(period.start, period.end)\\\">{{ period.title }}</a>\\n </div>\\n\\n </div>\\n <input v-on=\\\"inputEvents.start\\\"\\n :class=\\\"isDragging ? 'text-gray-600' : 'text-gray-900'\\\"\\n :value=\\\"inputValue.start\\\"\\n type=\\\"hidden\\\"\\n />\\n <input v-on=\\\"inputEvents.end\\\"\\n :class=\\\"isDragging ? 'text-gray-600' : 'text-gray-900'\\\"\\n :value=\\\"inputValue.end\\\"\\n type=\\\"hidden\\\"\\n />\\n </div>\\n </div>\\n </template>\\n </date-picker>\\n </div>\\n</template>\\n\\n<script>\\n\\nimport {createNamespacedHelpers} from \\\"vuex\\\";\\nimport Vue from \\\"vue\\\";\\nimport DatePicker from \\\"v-calendar/lib/components/date-picker.umd\\\";\\nimport subDays from 'date-fns/subDays';\\nimport addDays from 'date-fns/addDays';\\nimport addMonths from 'date-fns/addMonths';\\nimport startOfDay from 'date-fns/startOfDay';\\nimport endOfDay from 'date-fns/endOfDay';\\nimport startOfWeek from 'date-fns/startOfWeek';\\nimport endOfWeek from 'date-fns/endOfWeek';\\nimport endOfMonth from 'date-fns/endOfMonth';\\nimport format from 'date-fns/format';\\nimport startOfQuarter from 'date-fns/startOfQuarter';\\nimport subMonths from 'date-fns/subMonths';\\nimport endOfQuarter from 'date-fns/endOfQuarter';\\nimport subQuarters from 'date-fns/subQuarters';\\nimport addQuarters from 'date-fns/addQuarters';\\nimport startOfMonth from 'date-fns/startOfMonth';\\n\\nconst {mapState, mapGetters, mapActions, mapMutations} = createNamespacedHelpers('dashboard/index')\\n\\nVue.component('date-picker', DatePicker)\\n\\nexport default {\\n name: \\\"Calendar\\\",\\n created() {\\n // console.log('Now in calendar created');\\n this.ready = true;\\n this.locale = localStorage.locale ?? 'en-US';\\n },\\n data() {\\n return {\\n locale: 'en-US',\\n ready: false,\\n range: {\\n start: null,\\n end: null,\\n },\\n defaultRange: {\\n start: null,\\n end: null,\\n },\\n periods: []\\n };\\n },\\n methods: {\\n ...mapMutations(\\n [\\n 'setEnd',\\n 'setStart',\\n ],\\n ),\\n resetDate: function () {\\n // console.log('Reset date to');\\n // console.log(this.defaultStart);\\n // console.log(this.defaultEnd);\\n this.range.start = this.defaultStart;\\n this.range.end = this.defaultEnd;\\n this.setStart(this.defaultStart);\\n this.setEnd(this.defaultEnd);\\n },\\n customDate: function (startStr, endStr) {\\n let start = new Date(startStr);\\n let end = new Date(endStr);\\n this.setStart(start);\\n this.setEnd(end);\\n this.range.start = start;\\n this.range.end = end;\\n this.generatePeriods()\\n return false;\\n },\\n generateDaily: function () {\\n let today = new Date(this.range.start);\\n // yesterday\\n this.periods.push(\\n {\\n start: startOfDay(subDays(today, 1)).toDateString(),\\n end: endOfDay(subDays(today, 1)).toDateString(),\\n title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(subDays(today, 1))\\n }\\n );\\n\\n // today\\n this.periods.push(\\n {\\n start: startOfDay(today).toDateString(),\\n end: endOfDay(today).toDateString(),\\n title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(today)\\n }\\n );\\n\\n // tomorrow:\\n this.periods.push(\\n {\\n start: startOfDay(addDays(today, 1)).toDateString(),\\n end: endOfDay(addDays(today, 1)).toDateString(),\\n title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(addDays(today, 1))\\n }\\n );\\n\\n // The Day After Tomorrow dun-dun-dun!\\n this.periods.push(\\n {\\n start: startOfDay(addDays(today, 2)).toDateString(),\\n end: endOfDay(addDays(today, 2)).toDateString(),\\n title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(addDays(today, 2))\\n }\\n );\\n },\\n\\n generateWeekly: function () {\\n //console.log('weekly');\\n let today = new Date(this.range.start);\\n //console.log('Today is ' + today);\\n let start = startOfDay(startOfWeek(subDays(today, 7), {weekStartsOn: 1}));\\n let end = endOfDay(endOfWeek(subDays(today, 7), {weekStartsOn: 1}));\\n let dateFormat = this.$t('config.week_in_year_fns');\\n //console.log('Date format: \\\"'+dateFormat+'\\\"');\\n let title = format(start, dateFormat);\\n\\n // last week\\n // console.log('Last week');\\n // console.log(start);\\n // console.log(end);\\n // console.log(title);\\n this.periods.push(\\n {\\n start: start.toDateString(),\\n end: end.toDateString(),\\n title: title\\n }\\n );\\n\\n // this week\\n start = startOfDay(startOfWeek(today, {weekStartsOn: 1}));\\n end = endOfDay(endOfWeek(today, {weekStartsOn: 1}));\\n title = format(start, dateFormat);\\n // console.log('This week');\\n // console.log(start);\\n // console.log(end);\\n // console.log(title);\\n this.periods.push(\\n {\\n start: start.toDateString(),\\n end: end.toDateString(),\\n title: title\\n }\\n );\\n\\n // next week\\n start = startOfDay(startOfWeek(addDays(today, 7), {weekStartsOn: 1}));\\n end = endOfDay(endOfWeek(addDays(today, 7), {weekStartsOn: 1}));\\n title = format(start, dateFormat);\\n // console.log('Next week');\\n // console.log(start);\\n // console.log(end);\\n // console.log(title);\\n this.periods.push(\\n {\\n start: start.toDateString(),\\n end: end.toDateString(),\\n title: title\\n }\\n );\\n },\\n generateMonthly: function () {\\n let today = new Date(this.range.start);\\n // previous month\\n let start = startOfDay(startOfMonth(subMonths(today, 1)));\\n let end = endOfDay(endOfMonth(subMonths(today, 1)));\\n this.periods.push(\\n {\\n start: start.toDateString(),\\n end: end.toDateString(),\\n title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long'}).format(start)\\n }\\n );\\n\\n // this month\\n start = startOfDay(startOfMonth(today));\\n end = endOfDay(endOfMonth(today));\\n this.periods.push(\\n {\\n start: start.toDateString(),\\n end: end.toDateString(),\\n title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long'}).format(start)\\n }\\n );\\n\\n // next month\\n start = startOfDay(startOfMonth(addMonths(today, 1)));\\n end = endOfDay(endOfMonth(addMonths(today, 1)));\\n this.periods.push(\\n {\\n start: start.toDateString(),\\n end: end.toDateString(),\\n title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long'}).format(start)\\n }\\n );\\n\\n },\\n generateQuarterly: function () {\\n let today = new Date(this.range.start);\\n\\n // last quarter\\n let start = startOfDay(startOfQuarter(subQuarters(today, 1)));\\n let end = endOfDay(endOfQuarter(subQuarters(today, 1)));\\n let dateFormat = this.$t('config.quarter_fns');\\n let title = format(start, dateFormat);\\n\\n // last week\\n this.periods.push(\\n {\\n start: start.toDateString(),\\n end: end.toDateString(),\\n title: title\\n }\\n );\\n\\n\\n // this quarter\\n start = startOfDay(startOfQuarter(today));\\n end = endOfDay(endOfQuarter(today));\\n title = format(start, dateFormat);\\n\\n this.periods.push(\\n {\\n start: start.toDateString(),\\n end: end.toDateString(),\\n title: title\\n }\\n );\\n // next quarter\\n start = startOfDay(startOfQuarter(addQuarters(today, 1)));\\n end = endOfDay(endOfQuarter(addQuarters(today, 1)));\\n title = format(start, dateFormat);\\n\\n this.periods.push(\\n {\\n start: start.toDateString(),\\n end: end.toDateString(),\\n title: title\\n }\\n );\\n },\\n generateHalfYearly: function () {\\n let today = new Date(this.range.start);\\n let start;\\n let end;\\n let title = 'tbd';\\n let half = 1;\\n\\n // its currently first half of year:\\n if (today.getMonth() <= 5) {\\n // previous year, last half:\\n start = today;\\n start.setFullYear(start.getFullYear() - 1);\\n start.setMonth(6);\\n start.setDate(1);\\n start = startOfDay(start);\\n end = start;\\n end.setMonth(11);\\n end.setDate(31);\\n end = endOfDay(end);\\n half = 2;\\n title = format(start, this.$t('config.half_year_fns', {half: half}));\\n this.periods.push(\\n {\\n start: start.toDateString(),\\n end: end.toDateString(),\\n title: title\\n }\\n );\\n\\n // this year, first half:\\n start = today;\\n start.setMonth(0);\\n start.setDate(1);\\n start = startOfDay(start);\\n end = today;\\n end.setMonth(5);\\n end.setDate(30);\\n end = endOfDay(start);\\n half = 1;\\n title = format(start, this.$t('config.half_year_fns', {half: half}));\\n this.periods.push(\\n {\\n start: start.toDateString(),\\n end: end.toDateString(),\\n title: title\\n }\\n );\\n\\n // this year, second half:\\n start = today;\\n start.setMonth(6);\\n start.setDate(1);\\n start = startOfDay(start);\\n end = start;\\n end.setMonth(11);\\n end.setDate(31);\\n end = endOfDay(end);\\n half = 2;\\n title = format(start, this.$t('config.half_year_fns', {half: half}));\\n this.periods.push(\\n {\\n start: start.toDateString(),\\n end: end.toDateString(),\\n title: title\\n }\\n );\\n return;\\n }\\n // this year, first half:\\n start = today;\\n start.setMonth(0);\\n start.setDate(1);\\n start = startOfDay(start);\\n end = start;\\n end.setMonth(5);\\n end.setDate(30);\\n end = endOfDay(end);\\n title = format(start, this.$t('config.half_year_fns', {half: half}));\\n this.periods.push(\\n {\\n start: start.toDateString(),\\n end: end.toDateString(),\\n title: title\\n }\\n );\\n\\n // this year, current (second) half:\\n start = today;\\n start.setMonth(6);\\n start.setDate(1);\\n start = startOfDay(start);\\n end = today;\\n end.setMonth(11);\\n end.setDate(31);\\n end = endOfDay(start);\\n half = 2;\\n title = format(start, this.$t('config.half_year_fns', {half: half}));\\n this.periods.push(\\n {\\n start: start.toDateString(),\\n end: end.toDateString(),\\n title: title\\n }\\n );\\n\\n // next year, first half:\\n start = today;\\n start.setMonth(0);\\n start.setDate(1);\\n start = startOfDay(start);\\n end = start;\\n end.setMonth(5);\\n end.setDate(30);\\n end = endOfDay(end);\\n half = 1;\\n title = format(start, this.$t('config.half_year_fns', {half: half}));\\n this.periods.push(\\n {\\n start: start.toDateString(),\\n end: end.toDateString(),\\n title: title\\n }\\n );\\n },\\n generateYearly: function () {\\n let today = new Date(this.range.start);\\n let start;\\n let end;\\n\\n // last year\\n start = new Date(today);\\n start.setFullYear(start.getFullYear() - 1);\\n start.setMonth(0);\\n start.setDate(1);\\n start = startOfDay(start);\\n\\n end = new Date(today);\\n end.setFullYear(end.getFullYear() - 1);\\n end.setMonth(11);\\n end.setDate(31);\\n end = endOfDay(end);\\n\\n this.periods.push(\\n {\\n start: start.toDateString(),\\n end: end.toDateString(),\\n title: start.getFullYear()\\n }\\n );\\n\\n // this year\\n start = new Date(today);\\n start.setMonth(0);\\n start.setDate(1);\\n start = startOfDay(start);\\n\\n end = new Date(today);\\n end.setMonth(11);\\n end.setDate(31);\\n end = endOfDay(end);\\n\\n this.periods.push(\\n {\\n start: start.toDateString(),\\n end: end.toDateString(),\\n title: start.getFullYear()\\n }\\n );\\n // next year\\n start = new Date(today);\\n start.setFullYear(start.getFullYear() + 1);\\n start.setMonth(0);\\n start.setDate(1);\\n start = startOfDay(start);\\n\\n end = new Date(today);\\n end.setFullYear(end.getFullYear() + 1);\\n end.setMonth(11);\\n end.setDate(31);\\n end = endOfDay(end);\\n\\n this.periods.push(\\n {\\n start: start.toDateString(),\\n end: end.toDateString(),\\n title: start.getFullYear()\\n }\\n );\\n },\\n generatePeriods: function () {\\n this.periods = [];\\n // console.log('The view range is \\\"' + this.viewRange + '\\\".');\\n switch (this.viewRange) {\\n case '1D':\\n this.generateDaily();\\n break;\\n case '1W':\\n this.generateWeekly();\\n break;\\n case '1M':\\n this.generateMonthly();\\n break;\\n case '3M':\\n this.generateQuarterly();\\n break;\\n case '6M':\\n this.generateHalfYearly();\\n break;\\n case '1Y':\\n this.generateYearly();\\n break;\\n }\\n\\n\\n // last 7 days\\n let today = new Date;\\n let end = new Date;\\n end.setDate(end.getDate() - 7);\\n this.periods.push(\\n {\\n start: end.toDateString(),\\n end: today.toDateString(),\\n title: this.$t('firefly.last_seven_days')\\n }\\n );\\n\\n // last 30 days:\\n end.setDate(end.getDate() - 23);\\n this.periods.push(\\n {\\n start: end.toDateString(),\\n end: today.toDateString(),\\n title: this.$t('firefly.last_thirty_days')\\n }\\n );\\n // last 30 days\\n // everything\\n }\\n },\\n computed: {\\n ...mapGetters([\\n 'viewRange',\\n 'start',\\n 'end',\\n 'defaultStart',\\n 'defaultEnd'\\n ]),\\n 'datesReady': function () {\\n return null !== this.start && null !== this.end && this.ready;\\n },\\n },\\n watch: {\\n datesReady: function (value) {\\n if (false === value) {\\n return;\\n }\\n this.range.start = new Date(this.start);\\n this.range.end = new Date(this.end);\\n this.generatePeriods();\\n\\n },\\n range: function (value) {\\n //console.log('User updated range');\\n this.setStart(value.start);\\n this.setEnd(value.end);\\n }\\n }\\n}\\n</script>\\n\\n<style scoped>\\n.dropdown-item {\\n color: #212529;\\n}\\n\\n.dropdown-item:hover {\\n color: #212529;\\n}\\n</style>\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col\"},[_vm._v(\"Start\")]),_vm._v(\" \"),_c('div',{staticClass:\"col-8\"},[_vm._v(_vm._s(new Intl.DateTimeFormat(_vm.locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(_vm.range.start)))])]),_vm._v(\" \"),_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col\"},[_vm._v(\"End\")]),_vm._v(\" \"),_c('div',{staticClass:\"col-8\"},[_vm._v(_vm._s(new Intl.DateTimeFormat(_vm.locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(_vm.range.end)))])]),_vm._v(\" \"),_c('date-picker',{attrs:{\"rows\":2,\"is-range\":\"\",\"mode\":\"date\"},scopedSlots:_vm._u([{key:\"default\",fn:function(ref){\nvar inputValue = ref.inputValue;\nvar inputEvents = ref.inputEvents;\nvar isDragging = ref.isDragging;\nvar togglePopover = ref.togglePopover;\nreturn [_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col\"},[_c('div',{staticClass:\"btn-group btn-group-sm d-flex\"},[_c('button',{staticClass:\"btn btn-secondary btn-sm\",attrs:{\"title\":_vm.$t('firefly.custom_period')},on:{\"click\":function($event){return togglePopover({ placement: 'auto-start', positionFixed: true })}}},[_c('span',{staticClass:\"fas fa-calendar-alt\"})]),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-secondary\",attrs:{\"title\":_vm.$t('firefly.reset_to_current')},on:{\"click\":_vm.resetDate}},[_c('span',{staticClass:\"fas fa-history\"})]),_vm._v(\" \"),_c('button',{staticClass:\"btn btn-secondary dropdown-toggle\",attrs:{\"id\":\"dropdownMenuButton\",\"title\":_vm.$t('firefly.select_period'),\"aria-expanded\":\"false\",\"aria-haspopup\":\"true\",\"data-toggle\":\"dropdown\",\"type\":\"button\"}},[_c('span',{staticClass:\"fas fa-list\"})]),_vm._v(\" \"),_c('div',{staticClass:\"dropdown-menu\",attrs:{\"aria-labelledby\":\"dropdownMenuButton\"}},_vm._l((_vm.periods),function(period){return _c('a',{staticClass:\"dropdown-item\",attrs:{\"href\":\"#\"},on:{\"click\":function($event){return _vm.customDate(period.start, period.end)}}},[_vm._v(_vm._s(period.title))])}),0)]),_vm._v(\" \"),_c('input',_vm._g({class:isDragging ? 'text-gray-600' : 'text-gray-900',attrs:{\"type\":\"hidden\"},domProps:{\"value\":inputValue.start}},inputEvents.start)),_vm._v(\" \"),_c('input',_vm._g({class:isDragging ? 'text-gray-600' : 'text-gray-900',attrs:{\"type\":\"hidden\"},domProps:{\"value\":inputValue.end}},inputEvents.end))])])]}}]),model:{value:(_vm.range),callback:function ($$v) {_vm.range=$$v},expression:\"range\"}})],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<!--\n - Calendar.vue\n - Copyright (c) 2020 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 <https://www.gnu.org/licenses/>.\n -->\n\n<template>\n <div>\n <div class=\"row\">\n <div class=\"col\">Start</div>\n <div class=\"col-8\">{{ new Intl.DateTimeFormat(locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(range.start) }}</div>\n </div>\n <div class=\"row\">\n <div class=\"col\">End</div>\n <div class=\"col-8\">{{ new Intl.DateTimeFormat(locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(range.end) }}</div>\n </div>\n <date-picker\n v-model=\"range\"\n :rows=\"2\"\n is-range\n mode=\"date\"\n >\n <template v-slot=\"{ inputValue, inputEvents, isDragging, togglePopover }\">\n <div class=\"row\">\n <div class=\"col\">\n <div class=\"btn-group btn-group-sm d-flex\">\n <button\n :title=\"$t('firefly.custom_period')\" class=\"btn btn-secondary btn-sm\"\n @click=\"togglePopover({ placement: 'auto-start', positionFixed: true })\"\n ><span class=\"fas fa-calendar-alt\"></span></button>\n <button :title=\"$t('firefly.reset_to_current')\"\n class=\"btn btn-secondary\"\n @click=\"resetDate\"\n ><span class=\"fas fa-history\"></span></button>\n <button id=\"dropdownMenuButton\" :title=\"$t('firefly.select_period')\" aria-expanded=\"false\" aria-haspopup=\"true\"\n class=\"btn btn-secondary dropdown-toggle\"\n data-toggle=\"dropdown\"\n type=\"button\">\n <span class=\"fas fa-list\"></span>\n </button>\n <div aria-labelledby=\"dropdownMenuButton\" class=\"dropdown-menu\">\n <a v-for=\"period in periods\" class=\"dropdown-item\" href=\"#\" @click=\"customDate(period.start, period.end)\">{{ period.title }}</a>\n </div>\n\n </div>\n <input v-on=\"inputEvents.start\"\n :class=\"isDragging ? 'text-gray-600' : 'text-gray-900'\"\n :value=\"inputValue.start\"\n type=\"hidden\"\n />\n <input v-on=\"inputEvents.end\"\n :class=\"isDragging ? 'text-gray-600' : 'text-gray-900'\"\n :value=\"inputValue.end\"\n type=\"hidden\"\n />\n </div>\n </div>\n </template>\n </date-picker>\n </div>\n</template>\n\n<script>\n\nimport {createNamespacedHelpers} from \"vuex\";\nimport Vue from \"vue\";\nimport DatePicker from \"v-calendar/lib/components/date-picker.umd\";\nimport subDays from 'date-fns/subDays';\nimport addDays from 'date-fns/addDays';\nimport addMonths from 'date-fns/addMonths';\nimport startOfDay from 'date-fns/startOfDay';\nimport endOfDay from 'date-fns/endOfDay';\nimport startOfWeek from 'date-fns/startOfWeek';\nimport endOfWeek from 'date-fns/endOfWeek';\nimport endOfMonth from 'date-fns/endOfMonth';\nimport format from 'date-fns/format';\nimport startOfQuarter from 'date-fns/startOfQuarter';\nimport subMonths from 'date-fns/subMonths';\nimport endOfQuarter from 'date-fns/endOfQuarter';\nimport subQuarters from 'date-fns/subQuarters';\nimport addQuarters from 'date-fns/addQuarters';\nimport startOfMonth from 'date-fns/startOfMonth';\n\nconst {mapState, mapGetters, mapActions, mapMutations} = createNamespacedHelpers('dashboard/index')\n\nVue.component('date-picker', DatePicker)\n\nexport default {\n name: \"Calendar\",\n created() {\n // console.log('Now in calendar created');\n this.ready = true;\n this.locale = localStorage.locale ?? 'en-US';\n },\n data() {\n return {\n locale: 'en-US',\n ready: false,\n range: {\n start: null,\n end: null,\n },\n defaultRange: {\n start: null,\n end: null,\n },\n periods: []\n };\n },\n methods: {\n ...mapMutations(\n [\n 'setEnd',\n 'setStart',\n ],\n ),\n resetDate: function () {\n // console.log('Reset date to');\n // console.log(this.defaultStart);\n // console.log(this.defaultEnd);\n this.range.start = this.defaultStart;\n this.range.end = this.defaultEnd;\n this.setStart(this.defaultStart);\n this.setEnd(this.defaultEnd);\n },\n customDate: function (startStr, endStr) {\n let start = new Date(startStr);\n let end = new Date(endStr);\n this.setStart(start);\n this.setEnd(end);\n this.range.start = start;\n this.range.end = end;\n this.generatePeriods()\n return false;\n },\n generateDaily: function () {\n let today = new Date(this.range.start);\n // yesterday\n this.periods.push(\n {\n start: startOfDay(subDays(today, 1)).toDateString(),\n end: endOfDay(subDays(today, 1)).toDateString(),\n title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(subDays(today, 1))\n }\n );\n\n // today\n this.periods.push(\n {\n start: startOfDay(today).toDateString(),\n end: endOfDay(today).toDateString(),\n title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(today)\n }\n );\n\n // tomorrow:\n this.periods.push(\n {\n start: startOfDay(addDays(today, 1)).toDateString(),\n end: endOfDay(addDays(today, 1)).toDateString(),\n title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(addDays(today, 1))\n }\n );\n\n // The Day After Tomorrow dun-dun-dun!\n this.periods.push(\n {\n start: startOfDay(addDays(today, 2)).toDateString(),\n end: endOfDay(addDays(today, 2)).toDateString(),\n title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long', day: 'numeric'}).format(addDays(today, 2))\n }\n );\n },\n\n generateWeekly: function () {\n //console.log('weekly');\n let today = new Date(this.range.start);\n //console.log('Today is ' + today);\n let start = startOfDay(startOfWeek(subDays(today, 7), {weekStartsOn: 1}));\n let end = endOfDay(endOfWeek(subDays(today, 7), {weekStartsOn: 1}));\n let dateFormat = this.$t('config.week_in_year_fns');\n //console.log('Date format: \"'+dateFormat+'\"');\n let title = format(start, dateFormat);\n\n // last week\n // console.log('Last week');\n // console.log(start);\n // console.log(end);\n // console.log(title);\n this.periods.push(\n {\n start: start.toDateString(),\n end: end.toDateString(),\n title: title\n }\n );\n\n // this week\n start = startOfDay(startOfWeek(today, {weekStartsOn: 1}));\n end = endOfDay(endOfWeek(today, {weekStartsOn: 1}));\n title = format(start, dateFormat);\n // console.log('This week');\n // console.log(start);\n // console.log(end);\n // console.log(title);\n this.periods.push(\n {\n start: start.toDateString(),\n end: end.toDateString(),\n title: title\n }\n );\n\n // next week\n start = startOfDay(startOfWeek(addDays(today, 7), {weekStartsOn: 1}));\n end = endOfDay(endOfWeek(addDays(today, 7), {weekStartsOn: 1}));\n title = format(start, dateFormat);\n // console.log('Next week');\n // console.log(start);\n // console.log(end);\n // console.log(title);\n this.periods.push(\n {\n start: start.toDateString(),\n end: end.toDateString(),\n title: title\n }\n );\n },\n generateMonthly: function () {\n let today = new Date(this.range.start);\n // previous month\n let start = startOfDay(startOfMonth(subMonths(today, 1)));\n let end = endOfDay(endOfMonth(subMonths(today, 1)));\n this.periods.push(\n {\n start: start.toDateString(),\n end: end.toDateString(),\n title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long'}).format(start)\n }\n );\n\n // this month\n start = startOfDay(startOfMonth(today));\n end = endOfDay(endOfMonth(today));\n this.periods.push(\n {\n start: start.toDateString(),\n end: end.toDateString(),\n title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long'}).format(start)\n }\n );\n\n // next month\n start = startOfDay(startOfMonth(addMonths(today, 1)));\n end = endOfDay(endOfMonth(addMonths(today, 1)));\n this.periods.push(\n {\n start: start.toDateString(),\n end: end.toDateString(),\n title: new Intl.DateTimeFormat(this.locale, {year: 'numeric', month: 'long'}).format(start)\n }\n );\n\n },\n generateQuarterly: function () {\n let today = new Date(this.range.start);\n\n // last quarter\n let start = startOfDay(startOfQuarter(subQuarters(today, 1)));\n let end = endOfDay(endOfQuarter(subQuarters(today, 1)));\n let dateFormat = this.$t('config.quarter_fns');\n let title = format(start, dateFormat);\n\n // last week\n this.periods.push(\n {\n start: start.toDateString(),\n end: end.toDateString(),\n title: title\n }\n );\n\n\n // this quarter\n start = startOfDay(startOfQuarter(today));\n end = endOfDay(endOfQuarter(today));\n title = format(start, dateFormat);\n\n this.periods.push(\n {\n start: start.toDateString(),\n end: end.toDateString(),\n title: title\n }\n );\n // next quarter\n start = startOfDay(startOfQuarter(addQuarters(today, 1)));\n end = endOfDay(endOfQuarter(addQuarters(today, 1)));\n title = format(start, dateFormat);\n\n this.periods.push(\n {\n start: start.toDateString(),\n end: end.toDateString(),\n title: title\n }\n );\n },\n generateHalfYearly: function () {\n let today = new Date(this.range.start);\n let start;\n let end;\n let title = 'tbd';\n let half = 1;\n\n // its currently first half of year:\n if (today.getMonth() <= 5) {\n // previous year, last half:\n start = today;\n start.setFullYear(start.getFullYear() - 1);\n start.setMonth(6);\n start.setDate(1);\n start = startOfDay(start);\n end = start;\n end.setMonth(11);\n end.setDate(31);\n end = endOfDay(end);\n half = 2;\n title = format(start, this.$t('config.half_year_fns', {half: half}));\n this.periods.push(\n {\n start: start.toDateString(),\n end: end.toDateString(),\n title: title\n }\n );\n\n // this year, first half:\n start = today;\n start.setMonth(0);\n start.setDate(1);\n start = startOfDay(start);\n end = today;\n end.setMonth(5);\n end.setDate(30);\n end = endOfDay(start);\n half = 1;\n title = format(start, this.$t('config.half_year_fns', {half: half}));\n this.periods.push(\n {\n start: start.toDateString(),\n end: end.toDateString(),\n title: title\n }\n );\n\n // this year, second half:\n start = today;\n start.setMonth(6);\n start.setDate(1);\n start = startOfDay(start);\n end = start;\n end.setMonth(11);\n end.setDate(31);\n end = endOfDay(end);\n half = 2;\n title = format(start, this.$t('config.half_year_fns', {half: half}));\n this.periods.push(\n {\n start: start.toDateString(),\n end: end.toDateString(),\n title: title\n }\n );\n return;\n }\n // this year, first half:\n start = today;\n start.setMonth(0);\n start.setDate(1);\n start = startOfDay(start);\n end = start;\n end.setMonth(5);\n end.setDate(30);\n end = endOfDay(end);\n title = format(start, this.$t('config.half_year_fns', {half: half}));\n this.periods.push(\n {\n start: start.toDateString(),\n end: end.toDateString(),\n title: title\n }\n );\n\n // this year, current (second) half:\n start = today;\n start.setMonth(6);\n start.setDate(1);\n start = startOfDay(start);\n end = today;\n end.setMonth(11);\n end.setDate(31);\n end = endOfDay(start);\n half = 2;\n title = format(start, this.$t('config.half_year_fns', {half: half}));\n this.periods.push(\n {\n start: start.toDateString(),\n end: end.toDateString(),\n title: title\n }\n );\n\n // next year, first half:\n start = today;\n start.setMonth(0);\n start.setDate(1);\n start = startOfDay(start);\n end = start;\n end.setMonth(5);\n end.setDate(30);\n end = endOfDay(end);\n half = 1;\n title = format(start, this.$t('config.half_year_fns', {half: half}));\n this.periods.push(\n {\n start: start.toDateString(),\n end: end.toDateString(),\n title: title\n }\n );\n },\n generateYearly: function () {\n let today = new Date(this.range.start);\n let start;\n let end;\n\n // last year\n start = new Date(today);\n start.setFullYear(start.getFullYear() - 1);\n start.setMonth(0);\n start.setDate(1);\n start = startOfDay(start);\n\n end = new Date(today);\n end.setFullYear(end.getFullYear() - 1);\n end.setMonth(11);\n end.setDate(31);\n end = endOfDay(end);\n\n this.periods.push(\n {\n start: start.toDateString(),\n end: end.toDateString(),\n title: start.getFullYear()\n }\n );\n\n // this year\n start = new Date(today);\n start.setMonth(0);\n start.setDate(1);\n start = startOfDay(start);\n\n end = new Date(today);\n end.setMonth(11);\n end.setDate(31);\n end = endOfDay(end);\n\n this.periods.push(\n {\n start: start.toDateString(),\n end: end.toDateString(),\n title: start.getFullYear()\n }\n );\n // next year\n start = new Date(today);\n start.setFullYear(start.getFullYear() + 1);\n start.setMonth(0);\n start.setDate(1);\n start = startOfDay(start);\n\n end = new Date(today);\n end.setFullYear(end.getFullYear() + 1);\n end.setMonth(11);\n end.setDate(31);\n end = endOfDay(end);\n\n this.periods.push(\n {\n start: start.toDateString(),\n end: end.toDateString(),\n title: start.getFullYear()\n }\n );\n },\n generatePeriods: function () {\n this.periods = [];\n // console.log('The view range is \"' + this.viewRange + '\".');\n switch (this.viewRange) {\n case '1D':\n this.generateDaily();\n break;\n case '1W':\n this.generateWeekly();\n break;\n case '1M':\n this.generateMonthly();\n break;\n case '3M':\n this.generateQuarterly();\n break;\n case '6M':\n this.generateHalfYearly();\n break;\n case '1Y':\n this.generateYearly();\n break;\n }\n\n\n // last 7 days\n let today = new Date;\n let end = new Date;\n end.setDate(end.getDate() - 7);\n this.periods.push(\n {\n start: end.toDateString(),\n end: today.toDateString(),\n title: this.$t('firefly.last_seven_days')\n }\n );\n\n // last 30 days:\n end.setDate(end.getDate() - 23);\n this.periods.push(\n {\n start: end.toDateString(),\n end: today.toDateString(),\n title: this.$t('firefly.last_thirty_days')\n }\n );\n // last 30 days\n // everything\n }\n },\n computed: {\n ...mapGetters([\n 'viewRange',\n 'start',\n 'end',\n 'defaultStart',\n 'defaultEnd'\n ]),\n 'datesReady': function () {\n return null !== this.start && null !== this.end && this.ready;\n },\n },\n watch: {\n datesReady: function (value) {\n if (false === value) {\n return;\n }\n this.range.start = new Date(this.start);\n this.range.end = new Date(this.end);\n this.generatePeriods();\n\n },\n range: function (value) {\n //console.log('User updated range');\n this.setStart(value.start);\n this.setEnd(value.end);\n }\n }\n}\n</script>\n\n<style scoped>\n.dropdown-item {\n color: #212529;\n}\n\n.dropdown-item:hover {\n color: #212529;\n}\n</style>","import mod from \"-!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Calendar.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../node_modules/babel-loader/lib/index.js??clonedRuleSet-5[0].rules[0].use[0]!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Calendar.vue?vue&type=script&lang=js&\"","import api from \"!../../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import content from \"!!../../../node_modules/css-loader/dist/cjs.js??clonedRuleSet-9[0].rules[0].use[1]!../../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../../node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-9[0].rules[0].use[2]!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Calendar.vue?vue&type=style&index=0&id=1ce542a2&scoped=true&lang=css&\";\n\nvar options = {};\n\noptions.insert = \"head\";\noptions.singleton = false;\n\nvar update = api(content, options);\n\n\n\nexport default content.locals || {};","import { render, staticRenderFns } from \"./Calendar.vue?vue&type=template&id=1ce542a2&scoped=true&\"\nimport script from \"./Calendar.vue?vue&type=script&lang=js&\"\nexport * from \"./Calendar.vue?vue&type=script&lang=js&\"\nimport style0 from \"./Calendar.vue?vue&type=style&index=0&id=1ce542a2&scoped=true&lang=css&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"1ce542a2\",\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}