From 662ad8fbfa6ad406fde8ca08afb7a5a7980a29c3 Mon Sep 17 00:00:00 2001 From: Sam Date: Wed, 28 Jun 2023 09:06:31 +0200 Subject: [PATCH 1/2] Client - update documentation link --- fittrackee_client/src/components/About.vue | 17 ++++++++++++++++- fittrackee_client/src/locales/fr/common.json | 2 +- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/fittrackee_client/src/components/About.vue b/fittrackee_client/src/components/About.vue index a3c263eb..402810c7 100644 --- a/fittrackee_client/src/components/About.vue +++ b/fittrackee_client/src/components/About.vue @@ -5,7 +5,8 @@

@@ -72,6 +73,12 @@ const weather_provider: ComputedRef> = computed(() => get_weather_provider() ) + const language: ComputedRef = computed( + () => store.getters[ROOT_STORE.GETTERS.LANGUAGE] + ) + const documentationLink: ComputedRef = computed(() => + get_documentation_link() + ) function get_weather_provider() { const weather_provider: Record = {} @@ -81,6 +88,14 @@ } return weather_provider } + + function get_documentation_link() { + let link = 'https://samr1.github.io/FitTrackee/' + if (language.value === 'fr') { + link += 'fr/' + } + return link + } \n","import { render } from \"./Loader.vue?vue&type=template&id=4c9921ee&scoped=true\"\nconst script = {}\n\nimport \"./Loader.vue?vue&type=style&index=0&id=4c9921ee&scoped=true&lang=scss\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-4c9921ee\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5aa8db48\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { id: \"modal\" }\nconst _hoisted_2 = { class: \"custom-modal\" }\nconst _hoisted_3 = {\n key: 0,\n class: \"modal-message\"\n}\nconst _hoisted_4 = {\n key: 1,\n class: \"modal-message\"\n}\nconst _hoisted_5 = { class: \"modal-buttons\" }\n\nimport { ComputedRef, computed, toRefs, withDefaults, onUnmounted } from 'vue'\n\n import { ROOT_STORE } from '@/store/constants'\n import { useStore } from '@/use/useStore'\n\n interface Props {\n title: string\n message: string\n strongMessage?: string | null\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'Modal',\n props: {\n title: null,\n message: null,\n strongMessage: { default: () => null }\n },\n emits: ['cancelAction', 'confirmAction'],\n setup(__props: any, { emit }) {\n\nconst props = __props as { title: string, message: string, strongMessage: string | null };\n\n \n\n \n\n const store = useStore()\n\n const { title, message, strongMessage } = toRefs(props)\n const errorMessages: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.ERROR_MESSAGES]\n )\n onUnmounted(() => store.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES))\n\nreturn (_ctx: any,_cache: any) => {\n const _component_i18n_t = _resolveComponent(\"i18n-t\")!\n const _component_ErrorMessage = _resolveComponent(\"ErrorMessage\")!\n const _component_Card = _resolveComponent(\"Card\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(_component_Card, null, {\n title: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(title)), 1)\n ]),\n content: _withCtx(() => [\n (_unref(strongMessage))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_3, [\n _createVNode(_component_i18n_t, { keypath: _unref(message) }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", null, _toDisplayString(_unref(strongMessage)), 1)\n ]),\n _: 1\n }, 8, [\"keypath\"])\n ]))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_4, _toDisplayString(_unref(message)), 1)),\n (_unref(errorMessages))\n ? (_openBlock(), _createBlock(_component_ErrorMessage, {\n key: 2,\n message: _unref(errorMessages)\n }, null, 8, [\"message\"]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_5, [\n (!_unref(errorMessages))\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 0,\n class: \"confirm\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (emit('confirmAction')))\n }, _toDisplayString(_ctx.$t('buttons.YES')), 1))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"button\", {\n class: \"cancel\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (emit('cancelAction')))\n }, _toDisplayString(_ctx.$t(`buttons.${_unref(errorMessages) ? 'CANCEL' : 'NO'}`)), 1)\n ])\n ]),\n _: 1\n })\n ])\n ]))\n}\n}\n\n})","import script from \"./Modal.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./Modal.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./Modal.vue?vue&type=style&index=0&id=5aa8db48&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5aa8db48\"]])\n\nexport default __exports__","import AlertMessage from '@/components/Common/AlertMessage.vue'\nimport Card from '@/components/Common/Card.vue'\nimport CustomTextArea from '@/components/Common/CustomTextArea.vue'\nimport Distance from '@/components/Common/Distance.vue'\nimport Dropdown from '@/components/Common/Dropdown.vue'\nimport ErrorMessage from '@/components/Common/ErrorMessage.vue'\nimport SportImage from '@/components/Common/Images/SportImage/index.vue'\nimport Loader from '@/components/Common/Loader.vue'\nimport Modal from '@/components/Common/Modal.vue'\n\nexport const customComponents = [\n { target: AlertMessage, name: 'AlertMessage' },\n { target: Card, name: 'Card' },\n { target: CustomTextArea, name: 'CustomTextArea' },\n { target: Distance, name: 'Distance' },\n { target: Dropdown, name: 'Dropdown' },\n { target: ErrorMessage, name: 'ErrorMessage' },\n { target: Loader, name: 'Loader' },\n { target: Modal, name: 'Modal' },\n { target: SportImage, name: 'SportImage' },\n]\n","import { Directive, DirectiveBinding } from 'vue'\n\ninterface ClickOutsideHTMLElement extends HTMLElement {\n clickOutsideEvent?: (event: MouseEvent | TouchEvent) => void\n}\n\nexport const clickOutsideDirective: Directive = {\n mounted: (\n element: ClickOutsideHTMLElement,\n binding: DirectiveBinding\n ): void => {\n element.clickOutsideEvent = function (event) {\n if (!(element === event.target || element.contains(event.target))) {\n binding.value(event)\n }\n }\n document.body.addEventListener('click', element.clickOutsideEvent)\n document.body.addEventListener('touchstart', element.clickOutsideEvent)\n },\n unmounted: function (element: ClickOutsideHTMLElement): void {\n if (element.clickOutsideEvent) {\n document.body.removeEventListener('click', element.clickOutsideEvent)\n document.body.removeEventListener('touchstart', element.clickOutsideEvent)\n element.clickOutsideEvent = undefined\n }\n },\n}\n","import {\n Chart,\n BarElement,\n LineElement,\n PointElement,\n Legend,\n Title,\n Tooltip,\n Filler,\n BarController,\n CategoryScale,\n LineController,\n LinearScale,\n} from 'chart.js'\nimport ChartDataLabels from 'chartjs-plugin-datalabels'\nimport { createApp } from 'vue'\nimport VueFullscreen from 'vue-fullscreen'\n\nimport './registerServiceWorker'\nimport App from './App.vue'\nimport i18n from './i18n'\nimport router from './router'\nimport store from './store'\n\nimport { customComponents } from '@/custom-components'\nimport { clickOutsideDirective } from '@/directives'\nimport { sportColors } from '@/utils/sports'\n\nChart.register(\n BarElement,\n LineElement,\n PointElement,\n Legend,\n Title,\n Tooltip,\n Filler,\n BarController,\n CategoryScale,\n LineController,\n LinearScale,\n ChartDataLabels\n)\n\nconst app = createApp(App)\n .provide('sportColors', sportColors)\n .use(i18n)\n .use(store)\n .use(router)\n .use(VueFullscreen, { name: 'VFullscreen' })\n .directive('click-outside', clickOutsideDirective)\n\ncustomComponents.forEach((component) => {\n app.component(component.name, component.target)\n})\n\napp.mount('#app')\n","import { defineComponent as _defineComponent } from 'vue'\nimport { toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, unref as _unref, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, vModelText as _vModelText, withDirectives as _withDirectives, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createBlock as _createBlock, withModifiers as _withModifiers, withCtx as _withCtx, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-80b4a9e6\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n id: \"admin-app\",\n class: \"admin-card\"\n}\nconst _hoisted_2 = [\"onSubmit\"]\nconst _hoisted_3 = { for: \"admin_contact\" }\nconst _hoisted_4 = [\"value\"]\nconst _hoisted_5 = [\"disabled\"]\nconst _hoisted_6 = { for: \"max_users\" }\nconst _hoisted_7 = [\"disabled\"]\nconst _hoisted_8 = { class: \"user-limit-help\" }\nconst _hoisted_9 = { class: \"info-box\" }\nconst _hoisted_10 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-info-circle\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_11 = { for: \"max_single_file_size\" }\nconst _hoisted_12 = [\"disabled\"]\nconst _hoisted_13 = { for: \"max_zip_file_size\" }\nconst _hoisted_14 = [\"disabled\"]\nconst _hoisted_15 = { for: \"gpx_limit_import\" }\nconst _hoisted_16 = [\"disabled\"]\nconst _hoisted_17 = {\n class: \"about-label\",\n for: \"about\"\n}\nconst _hoisted_18 = { class: \"textarea-description\" }\nconst _hoisted_19 = [\"innerHTML\"]\nconst _hoisted_20 = {\n class: \"privacy-policy-label\",\n for: \"privacy_policy\"\n}\nconst _hoisted_21 = { class: \"textarea-description\" }\nconst _hoisted_22 = [\"innerHTML\"]\nconst _hoisted_23 = {\n key: 5,\n class: \"form-buttons\"\n}\nconst _hoisted_24 = {\n class: \"confirm\",\n type: \"submit\"\n}\nconst _hoisted_25 = [\"onClick\"]\nconst _hoisted_26 = {\n key: 6,\n class: \"form-buttons\"\n}\n\nimport snarkdown from 'snarkdown'\n import {\n ComputedRef,\n capitalize,\n computed,\n reactive,\n withDefaults,\n onBeforeMount,\n toRefs,\n } from 'vue'\n import { useRouter } from 'vue-router'\n\n import { ROOT_STORE } from '@/store/constants'\n import { TAppConfig, TAppConfigForm } from '@/types/application'\n import { useStore } from '@/use/useStore'\n import { getFileSizeInMB } from '@/utils/files'\n import { linkifyAndClean } from '@/utils/inputs'\n\n interface Props {\n appConfig: TAppConfig\n edition?: boolean\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'AdminApplication',\n props: {\n appConfig: null,\n edition: { type: Boolean, default: false }\n },\n setup(__props: any) {\n\nconst props = __props as { appConfig: TAppConfig, edition: boolean };\n\n \n const { edition } = toRefs(props)\n\n const store = useStore()\n const router = useRouter()\n\n const appData: TAppConfigForm = reactive({\n admin_contact: '',\n max_users: 0,\n max_single_file_size: 0,\n max_zip_file_size: 0,\n gpx_limit_import: 0,\n about: '',\n privacy_policy: '',\n })\n const errorMessages: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.ERROR_MESSAGES]\n )\n\n onBeforeMount(() => {\n if (props.appConfig) {\n updateForm(props.appConfig)\n }\n })\n\n function updateForm(appConfig: TAppConfig) {\n Object.keys(appData).map((key) => {\n ['max_single_file_size', 'max_zip_file_size'].includes(key)\n ? // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n (appData[key] = getFileSizeInMB(appConfig[key]))\n : ['about', 'privacy_policy'].includes(key)\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n ? appData[key] = appConfig[key]!== null\n ? appConfig[key]\n : ''\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n : (appData[key] = appConfig[key])\n })\n }\n function onCancel() {\n updateForm(props.appConfig)\n store.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n router.push('/admin/application')\n }\n function onSubmit() {\n const formData: TAppConfigForm = Object.assign({}, appData)\n formData.max_single_file_size *= 1048576\n formData.max_zip_file_size *= 1048576\n store.dispatch(ROOT_STORE.ACTIONS.UPDATE_APPLICATION_CONFIG, formData)\n }\n\nreturn (_ctx: any,_cache: any) => {\n const _component_ErrorMessage = _resolveComponent(\"ErrorMessage\")!\n const _component_Card = _resolveComponent(\"Card\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_Card, null, {\n title: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('admin.APP_CONFIG.TITLE')), 1)\n ]),\n content: _withCtx(() => [\n _createElementVNode(\"form\", {\n class: \"admin-form\",\n onSubmit: _withModifiers(onSubmit, [\"prevent\"])\n }, [\n _createElementVNode(\"label\", _hoisted_3, [\n _createTextVNode(_toDisplayString(_ctx.$t('admin.APP_CONFIG.ADMIN_CONTACT')) + \": \", 1),\n (!_unref(edition) && !appData.admin_contact)\n ? (_openBlock(), _createElementBlock(\"input\", {\n key: 0,\n class: \"no-contact\",\n value: _ctx.$t('admin.APP_CONFIG.NO_CONTACT_EMAIL'),\n disabled: \"\"\n }, null, 8, _hoisted_4))\n : _withDirectives((_openBlock(), _createElementBlock(\"input\", {\n key: 1,\n id: \"admin_contact\",\n name: \"admin_contact\",\n type: \"email\",\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((appData.admin_contact) = $event)),\n disabled: !_unref(edition)\n }, null, 8, _hoisted_5)), [\n [_vModelText, appData.admin_contact]\n ])\n ]),\n _createElementVNode(\"label\", _hoisted_6, [\n _createTextVNode(_toDisplayString(_ctx.$t('admin.APP_CONFIG.MAX_USERS_LABEL')) + \": \", 1),\n _withDirectives(_createElementVNode(\"input\", {\n id: \"max_users\",\n name: \"max_users\",\n type: \"number\",\n min: \"0\",\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => ((appData.max_users) = $event)),\n disabled: !_unref(edition)\n }, null, 8, _hoisted_7), [\n [_vModelText, appData.max_users]\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _createElementVNode(\"span\", _hoisted_9, [\n _hoisted_10,\n _createTextVNode(\" \" + _toDisplayString(_ctx.$t('admin.APP_CONFIG.MAX_USERS_HELP')), 1)\n ])\n ]),\n _createElementVNode(\"label\", _hoisted_11, [\n _createTextVNode(_toDisplayString(_ctx.$t('admin.APP_CONFIG.SINGLE_UPLOAD_MAX_SIZE_LABEL')) + \": \", 1),\n _withDirectives(_createElementVNode(\"input\", {\n id: \"max_single_file_size\",\n name: \"max_single_file_size\",\n type: \"number\",\n step: \"0.1\",\n min: \"0\",\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = ($event: any) => ((appData.max_single_file_size) = $event)),\n disabled: !_unref(edition)\n }, null, 8, _hoisted_12), [\n [_vModelText, appData.max_single_file_size]\n ])\n ]),\n _createElementVNode(\"label\", _hoisted_13, [\n _createTextVNode(_toDisplayString(_ctx.$t('admin.APP_CONFIG.ZIP_UPLOAD_MAX_SIZE_LABEL')) + \": \", 1),\n _withDirectives(_createElementVNode(\"input\", {\n id: \"max_zip_file_size\",\n name: \"max_zip_file_size\",\n type: \"number\",\n step: \"0.1\",\n min: \"0\",\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = ($event: any) => ((appData.max_zip_file_size) = $event)),\n disabled: !_unref(edition)\n }, null, 8, _hoisted_14), [\n [_vModelText, appData.max_zip_file_size]\n ])\n ]),\n _createElementVNode(\"label\", _hoisted_15, [\n _createTextVNode(_toDisplayString(_ctx.$t('admin.APP_CONFIG.MAX_FILES_IN_ZIP_LABEL')) + \": \", 1),\n _withDirectives(_createElementVNode(\"input\", {\n id: \"gpx_limit_import\",\n name: \"gpx_limit_import\",\n type: \"number\",\n min: \"0\",\n \"onUpdate:modelValue\": _cache[4] || (_cache[4] = ($event: any) => ((appData.gpx_limit_import) = $event)),\n disabled: !_unref(edition)\n }, null, 8, _hoisted_16), [\n [_vModelText, appData.gpx_limit_import]\n ])\n ]),\n _createElementVNode(\"label\", _hoisted_17, _toDisplayString(_ctx.$t('admin.ABOUT.TEXT')) + \": \", 1),\n _createElementVNode(\"span\", _hoisted_18, _toDisplayString(_ctx.$t('admin.ABOUT.DESCRIPTION')), 1),\n (_unref(edition))\n ? _withDirectives((_openBlock(), _createElementBlock(\"textarea\", {\n key: 0,\n id: \"about\",\n name: \"about\",\n rows: \"10\",\n \"onUpdate:modelValue\": _cache[5] || (_cache[5] = ($event: any) => ((appData.about) = $event))\n }, null, 512)), [\n [_vModelText, appData.about]\n ])\n : (_openBlock(), _createElementBlock(\"div\", {\n key: 1,\n innerHTML: _unref(snarkdown)(_unref(linkifyAndClean)(appData.about ? appData.about : _ctx.$t('admin.NO_TEXT_ENTERED'))),\n class: \"textarea-content\"\n }, null, 8, _hoisted_19)),\n _createElementVNode(\"label\", _hoisted_20, _toDisplayString(capitalize(_ctx.$t('privacy_policy.TITLE'))) + \": \", 1),\n _createElementVNode(\"span\", _hoisted_21, _toDisplayString(_ctx.$t('admin.PRIVACY_POLICY_DESCRIPTION')), 1),\n (_unref(edition))\n ? _withDirectives((_openBlock(), _createElementBlock(\"textarea\", {\n key: 2,\n id: \"privacy_policy\",\n name: \"privacy_policy\",\n rows: \"20\",\n \"onUpdate:modelValue\": _cache[6] || (_cache[6] = ($event: any) => ((appData.privacy_policy) = $event))\n }, null, 512)), [\n [_vModelText, appData.privacy_policy]\n ])\n : (_openBlock(), _createElementBlock(\"div\", {\n key: 3,\n innerHTML: _unref(snarkdown)(_unref(linkifyAndClean)(appData.privacy_policy ? appData.privacy_policy : _ctx.$t('admin.NO_TEXT_ENTERED'))),\n class: \"textarea-content\"\n }, null, 8, _hoisted_22)),\n (_unref(errorMessages))\n ? (_openBlock(), _createBlock(_component_ErrorMessage, {\n key: 4,\n message: _unref(errorMessages)\n }, null, 8, [\"message\"]))\n : _createCommentVNode(\"\", true),\n (_unref(edition))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_23, [\n _createElementVNode(\"button\", _hoisted_24, _toDisplayString(_ctx.$t('buttons.SUBMIT')), 1),\n _createElementVNode(\"button\", {\n class: \"cancel\",\n onClick: _withModifiers(onCancel, [\"prevent\"])\n }, _toDisplayString(_ctx.$t('buttons.CANCEL')), 9, _hoisted_25)\n ]))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_26, [\n _createElementVNode(\"button\", {\n class: \"confirm\",\n onClick: _cache[7] || (_cache[7] = _withModifiers(($event: any) => (_ctx.$router.push('/admin/application/edit')), [\"prevent\"]))\n }, _toDisplayString(_ctx.$t('buttons.EDIT')), 1),\n _createElementVNode(\"button\", {\n class: \"cancel\",\n onClick: _cache[8] || (_cache[8] = _withModifiers(($event: any) => (_ctx.$router.push('/admin')), [\"prevent\"]))\n }, _toDisplayString(_ctx.$t('admin.BACK_TO_ADMIN')), 1)\n ]))\n ], 40, _hoisted_2)\n ]),\n _: 1\n })\n ]))\n}\n}\n\n})","import script from \"./AdminApplication.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./AdminApplication.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./AdminApplication.vue?vue&type=style&index=0&id=80b4a9e6&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-80b4a9e6\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"stat-card\" }\nconst _hoisted_2 = { class: \"stat-content box\" }\nconst _hoisted_3 = { class: \"stat-icon\" }\nconst _hoisted_4 = { class: \"stat-details\" }\nconst _hoisted_5 = { class: \"stat-huge\" }\nconst _hoisted_6 = { class: \"stat\" }\n\nimport { toRefs } from 'vue'\n\n interface Props {\n icon: string\n text: string\n value: string | number\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'StatCard',\n props: {\n icon: null,\n text: null,\n value: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n icon: string\n text: string\n value: string | number\n };\n\n \n const { icon, text, value } = toRefs(props)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"i\", {\n class: _normalizeClass([\"fa\", `fa-${_unref(icon)}`])\n }, null, 2)\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"div\", _hoisted_5, _toDisplayString(_unref(value)), 1),\n _createElementVNode(\"div\", _hoisted_6, _toDisplayString(_unref(text)), 1)\n ])\n ])\n ]))\n}\n}\n\n})","import script from \"./StatCard.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./StatCard.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./StatCard.vue?vue&type=style&index=0&id=6cbb3351&lang=scss\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { id: \"user-stats\" }\n\nimport { computed, toRefs } from 'vue'\n\n import StatCard from '@/components/Common/StatCard.vue'\n import { IAppStatistics } from '@/types/application'\n import { getReadableFileSize } from '@/utils/files'\n\n interface Props {\n appStatistics: IAppStatistics\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'AppStatsCards',\n props: {\n appStatistics: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n appStatistics: IAppStatistics\n };\n\n \n\n const { appStatistics } = toRefs(props)\n const uploadDirSize = computed(() =>\n getReadableFileSize(appStatistics.value.uploads_dir_size, false)\n )\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(StatCard, {\n icon: \"users\",\n value: _unref(appStatistics).users,\n text: _ctx.$t('admin.USER', _unref(appStatistics).users)\n }, null, 8, [\"value\", \"text\"]),\n _createVNode(StatCard, {\n icon: \"tags\",\n value: _unref(appStatistics).sports,\n text: _ctx.$t('workouts.SPORT', _unref(appStatistics).sports)\n }, null, 8, [\"value\", \"text\"]),\n _createVNode(StatCard, {\n icon: \"calendar\",\n value: _unref(appStatistics).workouts,\n text: _ctx.$t('workouts.WORKOUT', _unref(appStatistics).workouts)\n }, null, 8, [\"value\", \"text\"]),\n _createVNode(StatCard, {\n icon: \"folder-open\",\n value: _unref(uploadDirSize).size,\n text: _unref(uploadDirSize).suffix\n }, null, 8, [\"value\", \"text\"])\n ]))\n}\n}\n\n})","import script from \"./AppStatsCards.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./AppStatsCards.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./AppStatsCards.vue?vue&type=style&index=0&id=61c5053e&lang=scss\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, unref as _unref, createVNode as _createVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-0dd66f89\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n id: \"admin-menu\",\n class: \"center-card\"\n}\nconst _hoisted_2 = { class: \"admin-menu description-list\" }\nconst _hoisted_3 = { class: \"application-config-details\" }\nconst _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"br\", null, null, -1))\nconst _hoisted_5 = { class: \"registration-status\" }\nconst _hoisted_6 = {\n key: 0,\n class: \"email-sending-status\"\n}\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-exclamation-triangle\",\n \"aria-hidden\": \"true\"\n}, null, -1))\n\nimport { capitalize, toRefs, withDefaults } from 'vue'\n\n import AppStatsCards from '@/components/Administration/AppStatsCards.vue'\n import Card from '@/components/Common/Card.vue'\n import { IAppStatistics, TAppConfig } from '@/types/application'\n\n interface Props {\n appConfig: TAppConfig\n appStatistics?: IAppStatistics\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'AdminMenu',\n props: {\n appConfig: null,\n appStatistics: { default: () => ({} as IAppStatistics) }\n },\n setup(__props: any) {\n\nconst props = __props as { appConfig: TAppConfig, appStatistics: IAppStatistics };\n\n \n\n const { appConfig, appStatistics } = toRefs(props)\n\nreturn (_ctx: any,_cache: any) => {\n const _component_router_link = _resolveComponent(\"router-link\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(Card, null, {\n title: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('admin.ADMINISTRATION')), 1)\n ]),\n content: _withCtx(() => [\n _createVNode(AppStatsCards, { appStatistics: _unref(appStatistics) }, null, 8, [\"appStatistics\"]),\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"dl\", null, [\n _createElementVNode(\"dt\", null, [\n _createVNode(_component_router_link, { to: \"/admin/application\" }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('admin.APPLICATION')), 1)\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"dd\", _hoisted_3, [\n _createTextVNode(_toDisplayString(_ctx.$t('admin.UPDATE_APPLICATION_DESCRIPTION')), 1),\n _hoisted_4,\n _createElementVNode(\"span\", _hoisted_5, _toDisplayString(_ctx.$t(\n `admin.REGISTRATION_${\n _unref(appConfig).is_registration_enabled ? 'ENABLED' : 'DISABLED'\n }`\n )), 1),\n (!_unref(appConfig).is_email_sending_enabled)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_6, [\n _hoisted_7,\n _createTextVNode(\" \" + _toDisplayString(_ctx.$t('admin.EMAIL_SENDING_DISABLED')), 1)\n ]))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"dt\", null, [\n _createVNode(_component_router_link, { to: \"/admin/sports\" }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(capitalize(_ctx.$t('workouts.SPORT', 0))), 1)\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"dd\", null, _toDisplayString(_ctx.$t('admin.ENABLE_DISABLE_SPORTS')), 1),\n _createElementVNode(\"dt\", null, [\n _createVNode(_component_router_link, { to: \"/admin/users\" }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(capitalize(_ctx.$t('admin.USER', 0))), 1)\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"dd\", null, _toDisplayString(_ctx.$t('admin.ADMIN_RIGHTS_DELETE_USER_ACCOUNT')), 1)\n ])\n ])\n ]),\n _: 1\n })\n ]))\n}\n}\n\n})","import script from \"./AdminMenu.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./AdminMenu.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./AdminMenu.vue?vue&type=style&index=0&id=0dd66f89&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-0dd66f89\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withModifiers as _withModifiers, createElementVNode as _createElementVNode, unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, createVNode as _createVNode, normalizeClass as _normalizeClass, createCommentVNode as _createCommentVNode, createBlock as _createBlock, withCtx as _withCtx, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-6d62af67\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n id: \"admin-sports\",\n class: \"admin-card\"\n}\nconst _hoisted_2 = { class: \"responsive-table\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"th\", null, \"#\", -1))\nconst _hoisted_4 = { class: \"text-left\" }\nconst _hoisted_5 = { class: \"text-left sport-action\" }\nconst _hoisted_6 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"th\", null, null, -1))\nconst _hoisted_7 = { class: \"text-center\" }\nconst _hoisted_8 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"cell-heading\" }, \"id\", -1))\nconst _hoisted_9 = { class: \"cell-heading\" }\nconst _hoisted_10 = { class: \"sport-label\" }\nconst _hoisted_11 = { class: \"cell-heading\" }\nconst _hoisted_12 = { class: \"text-center\" }\nconst _hoisted_13 = { class: \"cell-heading\" }\nconst _hoisted_14 = { class: \"sport-action\" }\nconst _hoisted_15 = { class: \"cell-heading\" }\nconst _hoisted_16 = { class: \"action-button\" }\nconst _hoisted_17 = [\"onClick\"]\nconst _hoisted_18 = {\n key: 0,\n class: \"has-workouts\"\n}\nconst _hoisted_19 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-warning\",\n \"aria-hidden\": \"true\"\n}, null, -1))\n\nimport { ComputedRef, computed } from 'vue'\n import { useI18n } from 'vue-i18n'\n\n import { ROOT_STORE, SPORTS_STORE } from '@/store/constants'\n import { ITranslatedSport } from '@/types/sports'\n import { useStore } from '@/use/useStore'\n import { translateSports } from '@/utils/sports'\n\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'AdminSports',\n setup(__props) {\n\n const { t } = useI18n()\n const store = useStore()\n\n const translatedSports: ComputedRef = computed(() =>\n translateSports(store.getters[SPORTS_STORE.GETTERS.SPORTS], t)\n )\n const errorMessages: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.ERROR_MESSAGES]\n )\n\n function updateSportStatus(id: number, isActive: boolean) {\n store.dispatch(SPORTS_STORE.ACTIONS.UPDATE_SPORTS, {\n id,\n isActive,\n })\n }\n\nreturn (_ctx: any,_cache: any) => {\n const _component_SportImage = _resolveComponent(\"SportImage\")!\n const _component_ErrorMessage = _resolveComponent(\"ErrorMessage\")!\n const _component_Card = _resolveComponent(\"Card\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_Card, null, {\n title: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('admin.SPORTS.TITLE')), 1)\n ]),\n content: _withCtx(() => [\n _createElementVNode(\"button\", {\n class: \"top-button\",\n onClick: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (_ctx.$router.push('/admin')), [\"prevent\"]))\n }, _toDisplayString(_ctx.$t('admin.BACK_TO_ADMIN')), 1),\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"table\", null, [\n _createElementVNode(\"thead\", null, [\n _createElementVNode(\"tr\", null, [\n _hoisted_3,\n _createElementVNode(\"th\", null, _toDisplayString(_ctx.$t('admin.SPORTS.TABLE.IMAGE')), 1),\n _createElementVNode(\"th\", _hoisted_4, _toDisplayString(_ctx.$t('admin.SPORTS.TABLE.LABEL')), 1),\n _createElementVNode(\"th\", null, _toDisplayString(_ctx.$t('admin.SPORTS.TABLE.ACTIVE')), 1),\n _createElementVNode(\"th\", _hoisted_5, _toDisplayString(_ctx.$t('admin.ACTION')), 1),\n _hoisted_6\n ])\n ]),\n _createElementVNode(\"tbody\", null, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(translatedSports), (sport) => {\n return (_openBlock(), _createElementBlock(\"tr\", {\n key: sport.id\n }, [\n _createElementVNode(\"td\", _hoisted_7, [\n _hoisted_8,\n _createTextVNode(\" \" + _toDisplayString(sport.id), 1)\n ]),\n _createElementVNode(\"td\", null, [\n _createElementVNode(\"span\", _hoisted_9, _toDisplayString(_ctx.$t('admin.SPORTS.TABLE.IMAGE')), 1),\n _createVNode(_component_SportImage, {\n title: sport.translatedLabel,\n \"sport-label\": sport.label,\n color: sport.color\n }, null, 8, [\"title\", \"sport-label\", \"color\"])\n ]),\n _createElementVNode(\"td\", _hoisted_10, [\n _createElementVNode(\"span\", _hoisted_11, _toDisplayString(_ctx.$t('admin.SPORTS.TABLE.LABEL')), 1),\n _createTextVNode(\" \" + _toDisplayString(sport.translatedLabel), 1)\n ]),\n _createElementVNode(\"td\", _hoisted_12, [\n _createElementVNode(\"span\", _hoisted_13, _toDisplayString(_ctx.$t('admin.SPORTS.TABLE.ACTIVE')), 1),\n _createElementVNode(\"i\", {\n class: _normalizeClass(`fa fa${sport.is_active ? '-check' : ''}`),\n \"aria-hidden\": \"true\"\n }, null, 2)\n ]),\n _createElementVNode(\"td\", _hoisted_14, [\n _createElementVNode(\"span\", _hoisted_15, _toDisplayString(_ctx.$t('admin.ACTION')), 1),\n _createElementVNode(\"div\", _hoisted_16, [\n _createElementVNode(\"button\", {\n class: _normalizeClass({ danger: sport.is_active }),\n onClick: ($event: any) => (updateSportStatus(sport.id, !sport.is_active))\n }, _toDisplayString(_ctx.$t(`buttons.${sport.is_active ? 'DIS' : 'EN'}ABLE`)), 11, _hoisted_17),\n (sport.has_workouts)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_18, [\n _hoisted_19,\n _createTextVNode(\" \" + _toDisplayString(_ctx.$t('admin.SPORTS.TABLE.HAS_WORKOUTS')), 1)\n ]))\n : _createCommentVNode(\"\", true)\n ])\n ])\n ]))\n }), 128))\n ])\n ]),\n (_unref(errorMessages))\n ? (_openBlock(), _createBlock(_component_ErrorMessage, {\n key: 0,\n message: _unref(errorMessages)\n }, null, 8, [\"message\"]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"button\", {\n onClick: _cache[1] || (_cache[1] = _withModifiers(($event: any) => (_ctx.$router.push('/admin')), [\"prevent\"]))\n }, _toDisplayString(_ctx.$t('admin.BACK_TO_ADMIN')), 1)\n ])\n ]),\n _: 1\n })\n ]))\n}\n}\n\n})","import script from \"./AdminSports.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./AdminSports.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./AdminSports.vue?vue&type=style&index=0&id=6d62af67&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-6d62af67\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { vModelText as _vModelText, withKeys as _withKeys, createElementVNode as _createElementVNode, withDirectives as _withDirectives, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-627a8e91\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"users-filters\" }\nconst _hoisted_2 = { class: \"search-username\" }\nconst _hoisted_3 = [\"onKeyup\", \"placeholder\"]\n\nimport { ref } from 'vue'\n import { useRoute } from 'vue-router'\n\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'UsersNameFilter',\n emits: ['filterOnUsername'],\n setup(__props, { emit }) {\n\n const route = useRoute()\n const username = ref(route.query.q ? route.query.q : '')\n\n \n function searchUsers() {\n if (username.value !== '') {\n emit('filterOnUsername', username)\n }\n }\n function resetFilter() {\n username.value = ''\n emit('filterOnUsername', username.value)\n }\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _withDirectives(_createElementVNode(\"input\", {\n id: \"username\",\n name: \"username\",\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((username).value = $event)),\n onKeyup: _withKeys(searchUsers, [\"enter\"]),\n placeholder: _ctx.$t('user.FILTER_ON_USERNAME')\n }, null, 40, _hoisted_3), [\n [\n _vModelText,\n username.value,\n void 0,\n { trim: true }\n ]\n ]),\n (username.value !== '')\n ? (_openBlock(), _createElementBlock(\"i\", {\n key: 0,\n class: \"fa fa-times\",\n \"aria-hidden\": \"true\",\n onClick: resetFilter\n }))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"i\", {\n class: _normalizeClass([\"fa fa-search\", { 'fa-disabled': username.value === '' }]),\n \"aria-hidden\": \"true\",\n onClick: searchUsers\n }, null, 2)\n ]))\n}\n}\n\n})","import script from \"./UsersNameFilter.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./UsersNameFilter.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./UsersNameFilter.vue?vue&type=style&index=0&id=627a8e91&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-627a8e91\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withModifiers as _withModifiers, createElementVNode as _createElementVNode, createVNode as _createVNode, unref as _unref, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, resolveComponent as _resolveComponent, withCtx as _withCtx, normalizeClass as _normalizeClass, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-dc12ff78\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n id: \"admin-users\",\n class: \"admin-card\"\n}\nconst _hoisted_2 = {\n key: 0,\n class: \"no-users\"\n}\nconst _hoisted_3 = {\n key: 1,\n class: \"responsive-table\"\n}\nconst _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"th\", null, \"#\", -1))\nconst _hoisted_5 = { class: \"left-text\" }\nconst _hoisted_6 = { class: \"left-text\" }\nconst _hoisted_7 = { class: \"left-text\" }\nconst _hoisted_8 = { class: \"cell-heading\" }\nconst _hoisted_9 = { class: \"cell-heading\" }\nconst _hoisted_10 = { class: \"cell-heading\" }\nconst _hoisted_11 = { class: \"cell-heading\" }\nconst _hoisted_12 = { class: \"text-center\" }\nconst _hoisted_13 = { class: \"cell-heading\" }\nconst _hoisted_14 = { class: \"text-center\" }\nconst _hoisted_15 = { class: \"cell-heading\" }\nconst _hoisted_16 = { class: \"text-center\" }\nconst _hoisted_17 = { class: \"cell-heading\" }\nconst _hoisted_18 = { class: \"text-center\" }\nconst _hoisted_19 = { class: \"cell-heading\" }\nconst _hoisted_20 = [\"disabled\", \"onClick\"]\n\nimport {\n ComputedRef,\n Ref,\n computed,\n reactive,\n watch,\n capitalize,\n onBeforeMount,\n onUnmounted,\n } from 'vue'\n import { LocationQuery, useRoute, useRouter } from 'vue-router'\n\n import FilterSelects from '@/components/Common/FilterSelects.vue'\n import Pagination from '@/components/Common/Pagination.vue'\n import UserPicture from '@/components/User/UserPicture.vue'\n import UsersNameFilter from '@/components/Users/UsersNameFilter.vue'\n import { AUTH_USER_STORE, ROOT_STORE, USERS_STORE } from '@/store/constants'\n import { IPagination, TPaginationPayload } from '@/types/api'\n import { IAuthUserProfile, IUserProfile } from '@/types/user'\n import { useStore } from '@/use/useStore'\n import { getQuery, sortList } from '@/utils/api'\n import { formatDate } from '@/utils/dates'\n\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'AdminUsers',\n setup(__props) {\n\n const store = useStore()\n const route = useRoute()\n const router = useRouter()\n\n const orderByList: string[] = [\n 'is_active',\n 'admin',\n 'created_at',\n 'username',\n 'workouts_count',\n ]\n const defaultOrderBy = 'created_at'\n let query: TPaginationPayload = reactive(\n getQuery(route.query, orderByList, defaultOrderBy)\n )\n const authUser: ComputedRef = computed(\n () => store.getters[AUTH_USER_STORE.GETTERS.AUTH_USER_PROFILE]\n )\n const users: ComputedRef = computed(\n () => store.getters[USERS_STORE.GETTERS.USERS]\n )\n const pagination: ComputedRef = computed(\n () => store.getters[USERS_STORE.GETTERS.USERS_PAGINATION]\n )\n const errorMessages: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.ERROR_MESSAGES]\n )\n\n onBeforeMount(() => loadUsers(query))\n\n function loadUsers(queryParams: TPaginationPayload) {\n store.dispatch(USERS_STORE.ACTIONS.GET_USERS, queryParams)\n }\n function searchUsers(username: Ref) {\n reloadUsers('q', username.value)\n }\n\n function updateUser(username: string, admin: boolean) {\n store.dispatch(USERS_STORE.ACTIONS.UPDATE_USER, {\n username,\n admin,\n })\n }\n function reloadUsers(queryParam: string, queryValue: string) {\n query[queryParam] = queryValue\n if (queryParam === 'per_page') {\n query.page = 1\n }\n router.push({ path: '/admin/users', query })\n }\n\n onUnmounted(() => {\n store.dispatch(USERS_STORE.ACTIONS.EMPTY_USERS)\n })\n\n watch(\n () => route.query,\n (newQuery: LocationQuery) => {\n query = getQuery(newQuery, orderByList, defaultOrderBy, { query })\n loadUsers(query)\n }\n )\n\nreturn (_ctx: any,_cache: any) => {\n const _component_router_link = _resolveComponent(\"router-link\")!\n const _component_ErrorMessage = _resolveComponent(\"ErrorMessage\")!\n const _component_Card = _resolveComponent(\"Card\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_Card, null, {\n title: _withCtx(() => [\n _createTextVNode(_toDisplayString(capitalize(_ctx.$t('admin.USER', 0))), 1)\n ]),\n content: _withCtx(() => [\n _createElementVNode(\"button\", {\n class: \"top-button\",\n onClick: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (_ctx.$router.push('/admin')), [\"prevent\"]))\n }, _toDisplayString(_ctx.$t('admin.BACK_TO_ADMIN')), 1),\n _createVNode(UsersNameFilter, { onFilterOnUsername: searchUsers }),\n _createVNode(FilterSelects, {\n sort: _unref(sortList),\n order_by: orderByList,\n query: _unref(query),\n message: \"admin.USERS.SELECTS.ORDER_BY\",\n onUpdateSelect: reloadUsers\n }, null, 8, [\"sort\", \"query\"]),\n (_unref(users).length === 0)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, _toDisplayString(_ctx.$t('user.NO_USERS_FOUND')), 1))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_3, [\n _createElementVNode(\"table\", null, [\n _createElementVNode(\"thead\", null, [\n _createElementVNode(\"tr\", null, [\n _hoisted_4,\n _createElementVNode(\"th\", _hoisted_5, _toDisplayString(_ctx.$t('user.USERNAME')), 1),\n _createElementVNode(\"th\", _hoisted_6, _toDisplayString(_ctx.$t('user.EMAIL')), 1),\n _createElementVNode(\"th\", _hoisted_7, _toDisplayString(_ctx.$t('user.PROFILE.REGISTRATION_DATE')), 1),\n _createElementVNode(\"th\", null, _toDisplayString(capitalize(_ctx.$t('workouts.WORKOUT', 0))), 1),\n _createElementVNode(\"th\", null, _toDisplayString(_ctx.$t('admin.ACTIVE')), 1),\n _createElementVNode(\"th\", null, _toDisplayString(_ctx.$t('user.ADMIN')), 1),\n _createElementVNode(\"th\", null, _toDisplayString(_ctx.$t('admin.ACTION')), 1)\n ])\n ]),\n _createElementVNode(\"tbody\", null, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(users), (user) => {\n return (_openBlock(), _createElementBlock(\"tr\", {\n key: user.username\n }, [\n _createElementVNode(\"td\", null, [\n _createElementVNode(\"span\", _hoisted_8, _toDisplayString(_ctx.$t('user.PROFILE.PICTURE')), 1),\n _createVNode(UserPicture, { user: user }, null, 8, [\"user\"])\n ]),\n _createElementVNode(\"td\", null, [\n _createElementVNode(\"span\", _hoisted_9, _toDisplayString(_ctx.$t('user.USERNAME')), 1),\n _createVNode(_component_router_link, {\n to: `/admin/users/${user.username}`\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(user.username), 1)\n ]),\n _: 2\n }, 1032, [\"to\"])\n ]),\n _createElementVNode(\"td\", null, [\n _createElementVNode(\"span\", _hoisted_10, _toDisplayString(_ctx.$t('user.EMAIL')), 1),\n _createTextVNode(\" \" + _toDisplayString(user.email), 1)\n ]),\n _createElementVNode(\"td\", null, [\n _createElementVNode(\"span\", _hoisted_11, _toDisplayString(_ctx.$t('user.PROFILE.REGISTRATION_DATE')), 1),\n _createTextVNode(\" \" + _toDisplayString(_unref(formatDate)(\n user.created_at,\n _unref(authUser).timezone,\n _unref(authUser).date_format\n )), 1)\n ]),\n _createElementVNode(\"td\", _hoisted_12, [\n _createElementVNode(\"span\", _hoisted_13, _toDisplayString(capitalize(_ctx.$t('workouts.WORKOUT', 0))), 1),\n _createTextVNode(\" \" + _toDisplayString(user.nb_workouts), 1)\n ]),\n _createElementVNode(\"td\", _hoisted_14, [\n _createElementVNode(\"span\", _hoisted_15, _toDisplayString(_ctx.$t('admin.ACTIVE')), 1),\n _createElementVNode(\"i\", {\n class: _normalizeClass(`fa fa${user.is_active ? '-check' : ''}-square-o`),\n \"aria-hidden\": \"true\"\n }, null, 2)\n ]),\n _createElementVNode(\"td\", _hoisted_16, [\n _createElementVNode(\"span\", _hoisted_17, _toDisplayString(_ctx.$t('user.ADMIN')), 1),\n _createElementVNode(\"i\", {\n class: _normalizeClass(`fa fa${user.admin ? '-check' : ''}-square-o`),\n \"aria-hidden\": \"true\"\n }, null, 2)\n ]),\n _createElementVNode(\"td\", _hoisted_18, [\n _createElementVNode(\"span\", _hoisted_19, _toDisplayString(_ctx.$t('admin.ACTION')), 1),\n _createElementVNode(\"button\", {\n class: _normalizeClass({ danger: user.admin }),\n disabled: user.username === _unref(authUser).username,\n onClick: ($event: any) => (updateUser(user.username, !user.admin))\n }, _toDisplayString(_ctx.$t(\n `admin.USERS.TABLE.${\n user.admin ? 'REMOVE' : 'ADD'\n }_ADMIN_RIGHTS`\n )), 11, _hoisted_20)\n ])\n ]))\n }), 128))\n ])\n ]),\n (_unref(pagination).page)\n ? (_openBlock(), _createBlock(Pagination, {\n key: 0,\n path: \"/admin/users\",\n pagination: _unref(pagination),\n query: _unref(query)\n }, null, 8, [\"pagination\", \"query\"]))\n : _createCommentVNode(\"\", true),\n (_unref(errorMessages))\n ? (_openBlock(), _createBlock(_component_ErrorMessage, {\n key: 1,\n message: _unref(errorMessages)\n }, null, 8, [\"message\"]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"button\", {\n onClick: _cache[1] || (_cache[1] = _withModifiers(($event: any) => (_ctx.$router.push('/admin')), [\"prevent\"]))\n }, _toDisplayString(_ctx.$t('admin.BACK_TO_ADMIN')), 1)\n ]))\n ]),\n _: 1\n })\n ]))\n}\n}\n\n})","import script from \"./AdminUsers.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./AdminUsers.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./AdminUsers.vue?vue&type=style&index=0&id=dc12ff78&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-dc12ff78\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString } from \"vue\"\n\nconst _hoisted_1 = { class: \"profile-tabs custom-checkboxes-group\" }\nconst _hoisted_2 = { class: \"profile-tabs-checkboxes custom-checkboxes\" }\nconst _hoisted_3 = [\"id\", \"name\", \"checked\", \"disabled\", \"onInput\"]\n\nimport { toRefs, withDefaults } from 'vue'\n\n interface Props {\n tabs: string[]\n selectedTab: string\n edition: boolean\n disabled?: boolean\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'UserProfileTabs',\n props: {\n tabs: null,\n selectedTab: null,\n edition: { type: Boolean },\n disabled: { type: Boolean, default: false }\n },\n setup(__props: any) {\n\nconst props = __props as { tabs: string[], selectedTab: string, edition: boolean, disabled: boolean };\n\n \n\n const { tabs, selectedTab, disabled } = toRefs(props)\n\n function getPath(tab: string) {\n switch (tab) {\n case 'ACCOUNT':\n case 'PICTURE':\n case 'PRIVACY-POLICY':\n return `/profile/edit/${tab.toLocaleLowerCase()}`\n case 'APPS':\n case 'PREFERENCES':\n case 'SPORTS':\n return `/profile${\n props.edition ? '/edit' : ''\n }/${tab.toLocaleLowerCase()}`\n default:\n case 'PROFILE':\n return `/profile${props.edition ? '/edit' : ''}`\n }\n }\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(tabs), (tab) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"profile-tab custom-checkbox\",\n key: tab\n }, [\n _createElementVNode(\"label\", null, [\n _createElementVNode(\"input\", {\n type: \"radio\",\n id: tab,\n name: tab,\n checked: _unref(selectedTab).split('/')[0] === tab,\n disabled: _unref(disabled),\n onInput: ($event: any) => (_ctx.$router.push(getPath(tab)))\n }, null, 40, _hoisted_3),\n _createElementVNode(\"span\", null, _toDisplayString(_ctx.$t(`user.PROFILE.TABS.${tab}`)), 1)\n ])\n ]))\n }), 128))\n ])\n ]))\n}\n}\n\n})","import script from \"./UserProfileTabs.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./UserProfileTabs.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./UserProfileTabs.vue?vue&type=style&index=0&id=205359d6&lang=scss\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, resolveComponent as _resolveComponent, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-9729cba4\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { id: \"user-profile\" }\nconst _hoisted_2 = { class: \"box\" }\n\nimport { toRefs } from 'vue'\n\n import UserHeader from '@/components/User/ProfileDisplay/UserHeader.vue'\n import UserProfileTabs from '@/components/User/UserProfileTabs.vue'\n import { IUserProfile } from '@/types/user'\n\n interface Props {\n user: IUserProfile\n tab: string\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n user: null,\n tab: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n user: IUserProfile\n tab: string\n };\n\n \n\n const { user, tab } = toRefs(props)\n const tabs = ['PROFILE', 'PREFERENCES', 'SPORTS', 'APPS']\n\nreturn (_ctx: any,_cache: any) => {\n const _component_router_view = _resolveComponent(\"router-view\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(UserHeader, { user: _unref(user) }, null, 8, [\"user\"]),\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(UserProfileTabs, {\n tabs: tabs,\n selectedTab: _unref(tab),\n edition: false\n }, null, 8, [\"selectedTab\"]),\n _createVNode(_component_router_view, { user: _unref(user) }, null, 8, [\"user\"])\n ])\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./index.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./index.vue?vue&type=style&index=0&id=9729cba4&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-9729cba4\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, unref as _unref, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n id: \"user-preferences\",\n class: \"description-list\"\n}\nconst _hoisted_2 = { class: \"info-box raw-speed-help\" }\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-info-circle\",\n \"aria-hidden\": \"true\"\n}, null, -1)\nconst _hoisted_4 = { class: \"profile-buttons\" }\n\nimport { computed, ComputedRef } from 'vue'\n\n import { ROOT_STORE } from '@/store/constants'\n import { IAuthUserProfile } from '@/types/user'\n import { useStore } from '@/use/useStore'\n import { getDateFormat } from '@/utils/dates'\n import { languageLabels } from '@/utils/locales'\n\n interface Props {\n user: IAuthUserProfile\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'UserPreferences',\n props: {\n user: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n user: IAuthUserProfile\n };\n\n \n\n const store = useStore()\n\n const appLanguage: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.LANGUAGE]\n )\n const userLanguage = computed(() =>\n props.user.language\n ? languageLabels[props.user.language]\n : languageLabels['en']\n )\n const fistDayOfWeek = computed(() => (props.user.weekm ? 'MONDAY' : 'SUNDAY'))\n const timezone = computed(() =>\n props.user.timezone ? props.user.timezone : 'Europe/Paris'\n )\n const date_format = computed(() =>\n props.user.date_format ? props.user.date_format : 'MM/dd/yyyy'\n )\n const display_ascent = computed(() =>\n props.user.display_ascent ? 'DISPLAYED' : 'HIDDEN'\n )\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"dl\", null, [\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('user.PROFILE.LANGUAGE')) + \":\", 1),\n _createElementVNode(\"dd\", null, _toDisplayString(_unref(userLanguage)), 1),\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('user.PROFILE.TIMEZONE')) + \":\", 1),\n _createElementVNode(\"dd\", null, _toDisplayString(_unref(timezone)), 1),\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('user.PROFILE.DATE_FORMAT')) + \":\", 1),\n _createElementVNode(\"dd\", null, _toDisplayString(_unref(getDateFormat)(_unref(date_format), _unref(appLanguage))), 1),\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('user.PROFILE.FIRST_DAY_OF_WEEK')) + \":\", 1),\n _createElementVNode(\"dd\", null, _toDisplayString(_ctx.$t(`user.PROFILE.${_unref(fistDayOfWeek)}`)), 1),\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('user.PROFILE.UNITS.LABEL')) + \":\", 1),\n _createElementVNode(\"dd\", null, _toDisplayString(_ctx.$t(\n `user.PROFILE.UNITS.${__props.user.imperial_units ? 'IMPERIAL' : 'METRIC'}`\n )), 1),\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('user.PROFILE.ASCENT_DATA')) + \":\", 1),\n _createElementVNode(\"dd\", null, _toDisplayString(_ctx.$t(`common.${_unref(display_ascent)}`)), 1),\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('user.PROFILE.ELEVATION_CHART_START.LABEL')) + \":\", 1),\n _createElementVNode(\"dd\", null, _toDisplayString(_ctx.$t(\n `user.PROFILE.ELEVATION_CHART_START.${\n __props.user.start_elevation_at_zero ? 'ZERO' : 'MIN_ALT'\n }`\n )), 1),\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('user.PROFILE.USE_RAW_GPX_SPEED.LABEL')) + \":\", 1),\n _createElementVNode(\"dd\", null, _toDisplayString(_ctx.$t(\n `user.PROFILE.USE_RAW_GPX_SPEED.${\n __props.user.use_raw_gpx_speed ? 'RAW_SPEED' : 'FILTERED_SPEED'\n }`\n )), 1),\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"span\", null, [\n _hoisted_3,\n _createTextVNode(\" \" + _toDisplayString(_ctx.$t('user.PROFILE.USE_RAW_GPX_SPEED.HELP')), 1)\n ])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"button\", {\n onClick: _cache[0] || (_cache[0] = ($event: any) => (_ctx.$router.push('/profile/edit/preferences')))\n }, _toDisplayString(_ctx.$t('user.PROFILE.EDIT_PREFERENCES')), 1),\n _createElementVNode(\"button\", {\n onClick: _cache[1] || (_cache[1] = ($event: any) => (_ctx.$router.push('/')))\n }, _toDisplayString(_ctx.$t('common.HOME')), 1)\n ])\n ]))\n}\n}\n\n})","import script from \"./UserPreferences.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./UserPreferences.vue?vue&type=script&setup=true&lang=ts\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createVNode as _createVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n id: \"user-profile-edition\",\n class: \"center-card\"\n}\n\nimport { computed, toRefs } from 'vue'\n\n import UserProfileTabs from '@/components/User/UserProfileTabs.vue'\n import { AUTH_USER_STORE } from '@/store/constants'\n import { IUserProfile } from '@/types/user'\n import { useStore } from '@/use/useStore'\n\n interface Props {\n user: IUserProfile\n tab: string\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n user: null,\n tab: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n user: IUserProfile\n tab: string\n };\n\n \n\n const store = useStore()\n\n const { user, tab } = toRefs(props)\n const tabs = ['PROFILE', 'ACCOUNT', 'PICTURE', 'PREFERENCES', 'SPORTS', 'PRIVACY-POLICY']\n const loading = computed(\n () => store.getters[AUTH_USER_STORE.GETTERS.USER_LOADING]\n )\n\nreturn (_ctx: any,_cache: any) => {\n const _component_router_view = _resolveComponent(\"router-view\")!\n const _component_Card = _resolveComponent(\"Card\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_Card, null, {\n title: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t(`user.PROFILE.${_unref(tab)}_EDITION`)), 1)\n ]),\n content: _withCtx(() => [\n _createVNode(UserProfileTabs, {\n tabs: tabs,\n selectedTab: _unref(tab),\n edition: true,\n disabled: _unref(loading)\n }, null, 8, [\"selectedTab\", \"disabled\"]),\n _createVNode(_component_router_view, { user: _unref(user) }, null, 8, [\"user\"])\n ]),\n _: 1\n })\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./index.vue?vue&type=script&setup=true&lang=ts\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementBlock as _createElementBlock, vModelText as _vModelText, createElementVNode as _createElementVNode, withDirectives as _withDirectives, createTextVNode as _createTextVNode, createVNode as _createVNode, withModifiers as _withModifiers, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-6e11106c\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { id: \"user-infos-edition\" }\nconst _hoisted_2 = { class: \"profile-form form-box\" }\nconst _hoisted_3 = {\n key: 1,\n class: \"info-box success-message\"\n}\nconst _hoisted_4 = [\"onSubmit\"]\nconst _hoisted_5 = {\n class: \"form-items\",\n for: \"email\"\n}\nconst _hoisted_6 = [\"disabled\"]\nconst _hoisted_7 = {\n class: \"form-items\",\n for: \"password-field\"\n}\nconst _hoisted_8 = {\n class: \"form-items\",\n for: \"new-password-field\"\n}\nconst _hoisted_9 = { class: \"form-buttons\" }\nconst _hoisted_10 = {\n class: \"confirm\",\n type: \"submit\"\n}\nconst _hoisted_11 = [\"onClick\"]\nconst _hoisted_12 = { class: \"data-export\" }\nconst _hoisted_13 = { class: \"info-box\" }\nconst _hoisted_14 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-info-circle\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_15 = {\n key: 0,\n class: \"data-export-archive\"\n}\nconst _hoisted_16 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-download\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_17 = { key: 1 }\nconst _hoisted_18 = { key: 2 }\nconst _hoisted_19 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-spinner fa-pulse\",\n \"aria-hidden\": \"true\"\n}, null, -1))\n\nimport { isBefore, subDays } from 'date-fns'\n import {\n ComputedRef,\n Ref,\n computed,\n reactive,\n ref,\n toRefs,\n onMounted,\n watch,\n onUnmounted,\n } from 'vue'\n\n import authApi from \"@/api/authApi\";\n import PasswordInput from '@/components/Common/PasswordInput.vue'\n import { AUTH_USER_STORE, ROOT_STORE } from '@/store/constants'\n import { TAppConfig } from '@/types/application'\n import {IAuthUserProfile, IUserAccountPayload, IExportRequest} from '@/types/user'\n import { useStore } from '@/use/useStore'\n import { formatDate } from '@/utils/dates'\n import { getReadableFileSize } from '@/utils/files'\n\n interface Props {\n user: IAuthUserProfile\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'UserAccountEdition',\n props: {\n user: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n user: IAuthUserProfile\n };\n\n \n const { user } = toRefs(props)\n\n const store = useStore()\n const userForm: IUserAccountPayload = reactive({\n email: '',\n password: '',\n new_password: '',\n })\n const loading = computed(\n () => store.getters[AUTH_USER_STORE.GETTERS.USER_LOADING]\n )\n const appConfig: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.APP_CONFIG]\n )\n const isSuccess: ComputedRef = computed(\n () => store.getters[AUTH_USER_STORE.GETTERS.IS_SUCCESS]\n )\n const emailUpdate = ref(false)\n const errorMessages: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.ERROR_MESSAGES]\n )\n const formErrors = ref(false)\n const displayModal: Ref = ref(false)\n const exportRequest: ComputedRef = computed(\n () => store.getters[AUTH_USER_STORE.GETTERS.EXPORT_REQUEST]\n )\n const exportRequestDate: ComputedRef = computed(\n () => getExportRequestDate()\n )\n const generatingLink: Ref = ref(false)\n\n onMounted(() => {\n if (props.user) {\n store.dispatch(AUTH_USER_STORE.ACTIONS.GET_REQUEST_DATA_EXPORT)\n updateUserForm(props.user)\n }\n })\n\n function invalidateForm() {\n formErrors.value = true\n }\n function updateUserForm(user: IAuthUserProfile) {\n userForm.email = user.email\n }\n function updatePassword(password: string) {\n userForm.password = password\n }\n function updateNewPassword(new_password: string) {\n userForm.new_password = new_password\n }\n function getExportRequestDate() {\n return exportRequest.value ? formatDate(\n exportRequest.value.created_at,\n user.value.timezone,\n user.value.date_format,\n true,\n null, true\n ) : null\n }\n\n function canRequestExport() {\n return exportRequestDate.value\n ? isBefore(new Date(exportRequestDate.value), subDays(new Date(), 1))\n : true\n }\n function updateProfile() {\n const payload: IUserAccountPayload = {\n email: userForm.email,\n password: userForm.password,\n }\n if (userForm.new_password) {\n payload.new_password = userForm.new_password\n }\n emailUpdate.value = userForm.email !== user.value.email\n store.dispatch(AUTH_USER_STORE.ACTIONS.UPDATE_USER_ACCOUNT, payload)\n }\n function updateDisplayModal(value: boolean) {\n displayModal.value = value\n }\n function deleteAccount(username: string) {\n store.dispatch(AUTH_USER_STORE.ACTIONS.DELETE_ACCOUNT, { username })\n }\n function requestExport() {\n store.dispatch(AUTH_USER_STORE.ACTIONS.REQUEST_DATA_EXPORT)\n }\n async function downloadArchive(filename: string) {\n generatingLink.value = true\n await authApi\n .get(`/auth/account/export/${filename}`, {\n responseType: 'blob',\n })\n .then((response) => {\n const archiveFileUrl = window.URL.createObjectURL(\n new Blob([response.data], { type: 'application/zip' })\n )\n const archive_link = document.createElement('a')\n archive_link.href = archiveFileUrl\n archive_link.setAttribute('download', filename)\n document.body.appendChild(archive_link)\n archive_link.click()\n })\n .finally(() => generatingLink.value = false)\n }\n\n onUnmounted(() => {\n store.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_IS_SUCCESS, false)\n store.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n })\n\n watch(\n () => isSuccess.value,\n async (isSuccessValue) => {\n if (isSuccessValue) {\n updatePassword('')\n updateNewPassword('')\n updateUserForm(user.value)\n formErrors.value = false\n }\n }\n )\n watch(\n () => user.value.email,\n async () => {\n updateUserForm(user.value)\n }\n )\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Modal = _resolveComponent(\"Modal\")!\n const _component_ErrorMessage = _resolveComponent(\"ErrorMessage\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (displayModal.value)\n ? (_openBlock(), _createBlock(_component_Modal, {\n key: 0,\n title: _ctx.$t('common.CONFIRMATION'),\n message: _ctx.$t('user.CONFIRM_ACCOUNT_DELETION'),\n onConfirmAction: _cache[0] || (_cache[0] = ($event: any) => (deleteAccount(_unref(user).username))),\n onCancelAction: _cache[1] || (_cache[1] = ($event: any) => (updateDisplayModal(false)))\n }, null, 8, [\"title\", \"message\"]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_2, [\n (_unref(errorMessages))\n ? (_openBlock(), _createBlock(_component_ErrorMessage, {\n key: 0,\n message: _unref(errorMessages)\n }, null, 8, [\"message\"]))\n : _createCommentVNode(\"\", true),\n (_unref(isSuccess))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_3, _toDisplayString(_ctx.$t(\n `user.PROFILE.SUCCESSFUL_${\n emailUpdate.value && _unref(appConfig).is_email_sending_enabled ? 'EMAIL_' : ''\n }UPDATE`\n )), 1))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"form\", {\n class: _normalizeClass({ errors: formErrors.value }),\n onSubmit: _withModifiers(updateProfile, [\"prevent\"])\n }, [\n _createElementVNode(\"label\", _hoisted_5, [\n _createTextVNode(_toDisplayString(_ctx.$t('user.EMAIL')) + \"* \", 1),\n _withDirectives(_createElementVNode(\"input\", {\n id: \"email\",\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = ($event: any) => ((userForm.email) = $event)),\n disabled: _unref(loading),\n required: true,\n onInvalid: invalidateForm\n }, null, 40, _hoisted_6), [\n [_vModelText, userForm.email]\n ])\n ]),\n _createElementVNode(\"label\", _hoisted_7, [\n _createTextVNode(_toDisplayString(_ctx.$t('user.CURRENT_PASSWORD')) + \"* \", 1),\n _createVNode(PasswordInput, {\n id: \"password-field\",\n disabled: _unref(loading),\n password: userForm.password,\n required: true,\n onUpdatePassword: updatePassword,\n onPasswordError: invalidateForm\n }, null, 8, [\"disabled\", \"password\"])\n ]),\n _createElementVNode(\"label\", _hoisted_8, [\n _createTextVNode(_toDisplayString(_ctx.$t('user.NEW_PASSWORD')) + \" \", 1),\n _createVNode(PasswordInput, {\n id: \"new-password-field\",\n disabled: _unref(loading),\n checkStrength: true,\n password: userForm.new_password,\n isSuccess: false,\n onUpdatePassword: updateNewPassword,\n onPasswordError: invalidateForm\n }, null, 8, [\"disabled\", \"password\"])\n ]),\n _createElementVNode(\"div\", _hoisted_9, [\n _createElementVNode(\"button\", _hoisted_10, _toDisplayString(_ctx.$t('buttons.SUBMIT')), 1),\n _createElementVNode(\"button\", {\n class: \"cancel\",\n onClick: _cache[3] || (_cache[3] = _withModifiers(($event: any) => (_ctx.$router.push('/profile')), [\"prevent\"]))\n }, _toDisplayString(_ctx.$t('buttons.CANCEL')), 1),\n _createElementVNode(\"button\", {\n class: \"danger\",\n onClick: _cache[4] || (_cache[4] = _withModifiers(($event: any) => (updateDisplayModal(true)), [\"prevent\"]))\n }, _toDisplayString(_ctx.$t('buttons.DELETE_MY_ACCOUNT')), 1),\n (canRequestExport())\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 0,\n class: \"confirm\",\n onClick: _withModifiers(requestExport, [\"prevent\"])\n }, _toDisplayString(_ctx.$t('buttons.REQUEST_DATA_EXPORT')), 9, _hoisted_11))\n : _createCommentVNode(\"\", true)\n ])\n ], 42, _hoisted_4),\n _createElementVNode(\"div\", _hoisted_12, [\n _createElementVNode(\"span\", _hoisted_13, [\n _hoisted_14,\n _createTextVNode(\" \" + _toDisplayString(_ctx.$t('user.EXPORT_REQUEST.ONLY_ONE_EXPORT_PER_DAY')), 1)\n ]),\n (_unref(exportRequest))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_15, [\n _createTextVNode(_toDisplayString(_ctx.$t('user.EXPORT_REQUEST.DATA_EXPORT')) + \" (\" + _toDisplayString(_unref(exportRequestDate)) + \"): \", 1),\n (_unref(exportRequest).status=== 'successful')\n ? (_openBlock(), _createElementBlock(\"span\", {\n key: 0,\n class: \"archive-link\",\n onClick: _cache[5] || (_cache[5] = _withModifiers(($event: any) => (downloadArchive(_unref(exportRequest).file_name)), [\"prevent\"]))\n }, [\n _hoisted_16,\n _createTextVNode(\" \" + _toDisplayString(_ctx.$t(\"user.EXPORT_REQUEST.DOWNLOAD_ARCHIVE\")) + \" (\" + _toDisplayString(_unref(getReadableFileSize)(_unref(exportRequest).file_size)) + \") \", 1)\n ]))\n : (_openBlock(), _createElementBlock(\"span\", _hoisted_17, _toDisplayString(_ctx.$t(`user.EXPORT_REQUEST.STATUS.${_unref(exportRequest).status}`)), 1)),\n (generatingLink.value)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_18, [\n _createTextVNode(_toDisplayString(_ctx.$t(`user.EXPORT_REQUEST.GENERATING_LINK`)) + \" \", 1),\n _hoisted_19\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n : _createCommentVNode(\"\", true)\n ])\n ])\n ]))\n}\n}\n\n})","import script from \"./UserAccountEdition.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./UserAccountEdition.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./UserAccountEdition.vue?vue&type=style&index=0&id=6e11106c&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-6e11106c\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, vModelText as _vModelText, withDirectives as _withDirectives, createVNode as _createVNode, withModifiers as _withModifiers, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5e5a4552\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { id: \"user-infos-edition\" }\nconst _hoisted_2 = { class: \"profile-form form-box\" }\nconst _hoisted_3 = [\"onSubmit\"]\nconst _hoisted_4 = {\n class: \"form-items\",\n for: \"registrationDate\"\n}\nconst _hoisted_5 = [\"value\"]\nconst _hoisted_6 = {\n class: \"form-items\",\n for: \"first_name\"\n}\nconst _hoisted_7 = [\"disabled\"]\nconst _hoisted_8 = {\n class: \"form-items\",\n for: \"last_name\"\n}\nconst _hoisted_9 = {\n class: \"form-items\",\n for: \"birth_date\"\n}\nconst _hoisted_10 = [\"disabled\"]\nconst _hoisted_11 = {\n class: \"form-items\",\n for: \"location\"\n}\nconst _hoisted_12 = [\"disabled\"]\nconst _hoisted_13 = { class: \"form-items\" }\nconst _hoisted_14 = { class: \"form-buttons\" }\nconst _hoisted_15 = {\n class: \"confirm\",\n type: \"submit\"\n}\n\nimport { format } from 'date-fns'\n import { ComputedRef, computed, reactive, onMounted, onUnmounted } from 'vue'\n\n import { AUTH_USER_STORE, ROOT_STORE } from '@/store/constants'\n import { IUserProfile, IUserPayload, IAuthUserProfile } from '@/types/user'\n import { useStore } from '@/use/useStore'\n import { formatDate } from '@/utils/dates'\n\n interface Props {\n user: IAuthUserProfile\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'UserInfosEdition',\n props: {\n user: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n user: IAuthUserProfile\n };\n\n \n\n const store = useStore()\n\n const userForm: IUserPayload = reactive({\n first_name: '',\n last_name: '',\n birth_date: '',\n location: '',\n bio: '',\n })\n const registrationDate = computed(() =>\n props.user.created_at\n ? formatDate(\n props.user.created_at,\n props.user.timezone,\n props.user.date_format\n )\n : ''\n )\n const loading = computed(\n () => store.getters[AUTH_USER_STORE.GETTERS.USER_LOADING]\n )\n const errorMessages: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.ERROR_MESSAGES]\n )\n\n onMounted(() => {\n if (props.user) {\n updateUserForm(props.user)\n }\n })\n\n function updateUserForm(user: IUserProfile) {\n userForm.first_name = user.first_name ? user.first_name : ''\n userForm.last_name = user.last_name ? user.last_name : ''\n userForm.birth_date = user.birth_date\n ? format(new Date(user.birth_date), 'yyyy-MM-dd')\n : ''\n userForm.location = user.location ? user.location : ''\n userForm.bio = user.bio ? user.bio : ''\n }\n function updateBio(value: string) {\n userForm.bio = value\n }\n function updateProfile() {\n store.dispatch(AUTH_USER_STORE.ACTIONS.UPDATE_USER_PROFILE, userForm)\n }\n\n onUnmounted(() => {\n store.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n })\n\nreturn (_ctx: any,_cache: any) => {\n const _component_ErrorMessage = _resolveComponent(\"ErrorMessage\")!\n const _component_CustomTextArea = _resolveComponent(\"CustomTextArea\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_unref(errorMessages))\n ? (_openBlock(), _createBlock(_component_ErrorMessage, {\n key: 0,\n message: _unref(errorMessages)\n }, null, 8, [\"message\"]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"form\", {\n onSubmit: _withModifiers(updateProfile, [\"prevent\"])\n }, [\n _createElementVNode(\"label\", _hoisted_4, [\n _createTextVNode(_toDisplayString(_ctx.$t('user.PROFILE.REGISTRATION_DATE')) + \" \", 1),\n _createElementVNode(\"input\", {\n id: \"registrationDate\",\n value: _unref(registrationDate),\n disabled: \"\"\n }, null, 8, _hoisted_5)\n ]),\n _createElementVNode(\"label\", _hoisted_6, [\n _createTextVNode(_toDisplayString(_ctx.$t('user.PROFILE.FIRST_NAME')) + \" \", 1),\n _withDirectives(_createElementVNode(\"input\", {\n id: \"first_name\",\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((userForm.first_name) = $event)),\n disabled: _unref(loading)\n }, null, 8, _hoisted_7), [\n [_vModelText, userForm.first_name]\n ])\n ]),\n _createElementVNode(\"label\", _hoisted_8, [\n _createTextVNode(_toDisplayString(_ctx.$t('user.PROFILE.LAST_NAME')) + \" \", 1),\n _withDirectives(_createElementVNode(\"input\", {\n id: \"last_name\",\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => ((userForm.last_name) = $event))\n }, null, 512), [\n [_vModelText, userForm.last_name]\n ])\n ]),\n _createElementVNode(\"label\", _hoisted_9, [\n _createTextVNode(_toDisplayString(_ctx.$t('user.PROFILE.BIRTH_DATE')) + \" \", 1),\n _withDirectives(_createElementVNode(\"input\", {\n id: \"birth_date\",\n type: \"date\",\n class: \"birth-date\",\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = ($event: any) => ((userForm.birth_date) = $event)),\n disabled: _unref(loading)\n }, null, 8, _hoisted_10), [\n [_vModelText, userForm.birth_date]\n ])\n ]),\n _createElementVNode(\"label\", _hoisted_11, [\n _createTextVNode(_toDisplayString(_ctx.$t('user.PROFILE.LOCATION')) + \" \", 1),\n _withDirectives(_createElementVNode(\"input\", {\n id: \"location\",\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = ($event: any) => ((userForm.location) = $event)),\n disabled: _unref(loading)\n }, null, 8, _hoisted_12), [\n [_vModelText, userForm.location]\n ])\n ]),\n _createElementVNode(\"label\", _hoisted_13, [\n _createTextVNode(_toDisplayString(_ctx.$t('user.PROFILE.BIO')) + \" \", 1),\n _createVNode(_component_CustomTextArea, {\n name: \"bio\",\n charLimit: 200,\n input: userForm.bio,\n disabled: _unref(loading),\n onUpdateValue: updateBio\n }, null, 8, [\"input\", \"disabled\"])\n ]),\n _createElementVNode(\"div\", _hoisted_14, [\n _createElementVNode(\"button\", _hoisted_15, _toDisplayString(_ctx.$t('buttons.SUBMIT')), 1),\n _createElementVNode(\"button\", {\n class: \"cancel\",\n onClick: _cache[4] || (_cache[4] = _withModifiers(($event: any) => (_ctx.$router.push('/profile')), [\"prevent\"]))\n }, _toDisplayString(_ctx.$t('buttons.CANCEL')), 1)\n ])\n ], 40, _hoisted_3)\n ])\n ]))\n}\n}\n\n})","import script from \"./UserInfosEdition.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./UserInfosEdition.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./UserInfosEdition.vue?vue&type=style&index=0&id=5e5a4552&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5e5a4552\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createElementBlock as _createElementBlock, withModifiers as _withModifiers, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-687e9604\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { id: \"user-picture-edition\" }\nconst _hoisted_2 = { class: \"user-picture-form\" }\nconst _hoisted_3 = [\"onSubmit\"]\nconst _hoisted_4 = { class: \"picture-help\" }\nconst _hoisted_5 = { class: \"info-box\" }\nconst _hoisted_6 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-info-circle\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_7 = { class: \"picture-buttons\" }\nconst _hoisted_8 = [\"disabled\"]\n\nimport { ComputedRef, Ref, computed, ref, toRefs, onUnmounted } from 'vue'\n\n import UserPicture from '@/components/User/UserPicture.vue'\n import { AUTH_USER_STORE, ROOT_STORE } from '@/store/constants'\n import { TAppConfig } from '@/types/application'\n import { IUserProfile } from '@/types/user'\n import { useStore } from '@/use/useStore'\n import { getReadableFileSize } from '@/utils/files'\n\n interface Props {\n user: IUserProfile\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'UserPictureEdition',\n props: {\n user: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n user: IUserProfile\n };\n\n \n\n const store = useStore()\n\n const { user } = toRefs(props)\n const errorMessages: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.ERROR_MESSAGES]\n )\n const appConfig: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.APP_CONFIG]\n )\n const fileSizeLimit = appConfig.value.max_single_file_size\n ? getReadableFileSize(appConfig.value.max_single_file_size)\n : ''\n const pictureFile: Ref = ref(null)\n\n function deleteUserPicture() {\n store.dispatch(AUTH_USER_STORE.ACTIONS.DELETE_PICTURE)\n }\n function updatePictureFile(event: Event & { target: HTMLInputElement }) {\n if (event.target.files) {\n pictureFile.value = event.target.files[0]\n }\n }\n function updateUserPicture() {\n if (pictureFile.value) {\n store.dispatch(AUTH_USER_STORE.ACTIONS.UPDATE_USER_PICTURE, {\n picture: pictureFile.value,\n })\n }\n }\n\n onUnmounted(() => {\n store.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n })\n\nreturn (_ctx: any,_cache: any) => {\n const _component_ErrorMessage = _resolveComponent(\"ErrorMessage\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_unref(errorMessages))\n ? (_openBlock(), _createBlock(_component_ErrorMessage, {\n key: 0,\n message: _unref(errorMessages)\n }, null, 8, [\"message\"]))\n : _createCommentVNode(\"\", true),\n _createVNode(UserPicture, { user: _unref(user) }, null, 8, [\"user\"]),\n _createElementVNode(\"form\", {\n onSubmit: _withModifiers(updateUserPicture, [\"prevent\"])\n }, [\n _createElementVNode(\"input\", {\n type: \"file\",\n name: \"picture\",\n accept: \".png,.jpg,.gif\",\n onInput: updatePictureFile\n }, null, 32),\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"span\", _hoisted_5, [\n _hoisted_6,\n _createTextVNode(\" \" + _toDisplayString(_ctx.$t('workouts.MAX_SIZE')) + \": \" + _toDisplayString(_unref(fileSizeLimit)), 1)\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_7, [\n _createElementVNode(\"button\", {\n type: \"submit\",\n disabled: !pictureFile.value\n }, _toDisplayString(_ctx.$t('user.PROFILE.PICTURE_UPDATE')), 9, _hoisted_8),\n (_unref(user).picture)\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 0,\n class: \"danger\",\n onClick: deleteUserPicture\n }, _toDisplayString(_ctx.$t('user.PROFILE.PICTURE_REMOVE')), 1))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"button\", {\n class: \"cancel\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (_ctx.$router.push('/profile')))\n }, _toDisplayString(_ctx.$t('user.PROFILE.BACK_TO_PROFILE')), 1)\n ])\n ], 40, _hoisted_3)\n ])\n ]))\n}\n}\n\n})","import script from \"./UserPictureEdition.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./UserPictureEdition.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./UserPictureEdition.vue?vue&type=style&index=0&id=687e9604&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-687e9604\"]])\n\nexport default __exports__","export const timeZones = [\n 'Africa/Abidjan',\n 'Africa/Accra',\n 'Africa/Algiers',\n 'Africa/Bissau',\n 'Africa/Cairo',\n 'Africa/Casablanca',\n 'Africa/Ceuta',\n 'Africa/El_Aaiun',\n 'Africa/Johannesburg',\n 'Africa/Juba',\n 'Africa/Khartoum',\n 'Africa/Lagos',\n 'Africa/Maputo',\n 'Africa/Monrovia',\n 'Africa/Nairobi',\n 'Africa/Ndjamena',\n 'Africa/Sao_Tome',\n 'Africa/Tripoli',\n 'Africa/Tunis',\n 'Africa/Windhoek',\n 'America/Adak',\n 'America/Anchorage',\n 'America/Araguaina',\n 'America/Argentina/Buenos_Aires',\n 'America/Argentina/Catamarca',\n 'America/Argentina/Cordoba',\n 'America/Argentina/Jujuy',\n 'America/Argentina/La_Rioja',\n 'America/Argentina/Mendoza',\n 'America/Argentina/Rio_Gallegos',\n 'America/Argentina/Salta',\n 'America/Argentina/San_Juan',\n 'America/Argentina/San_Luis',\n 'America/Argentina/Tucuman',\n 'America/Argentina/Ushuaia',\n 'America/Asuncion',\n 'America/Atikokan',\n 'America/Bahia',\n 'America/Bahia_Banderas',\n 'America/Barbados',\n 'America/Belem',\n 'America/Belize',\n 'America/Blanc-Sablon',\n 'America/Boa_Vista',\n 'America/Bogota',\n 'America/Boise',\n 'America/Cambridge_Bay',\n 'America/Campo_Grande',\n 'America/Cancun',\n 'America/Caracas',\n 'America/Cayenne',\n 'America/Chicago',\n 'America/Chihuahua',\n 'America/Costa_Rica',\n 'America/Creston',\n 'America/Cuiaba',\n 'America/Curacao',\n 'America/Danmarkshavn',\n 'America/Dawson',\n 'America/Dawson_Creek',\n 'America/Denver',\n 'America/Detroit',\n 'America/Edmonton',\n 'America/Eirunepe',\n 'America/El_Salvador',\n 'America/Fortaleza',\n 'America/Fort_Nelson',\n 'America/Glace_Bay',\n 'America/Godthab',\n 'America/Goose_Bay',\n 'America/Grand_Turk',\n 'America/Guatemala',\n 'America/Guayaquil',\n 'America/Guyana',\n 'America/Halifax',\n 'America/Havana',\n 'America/Hermosillo',\n 'America/Indiana/Indianapolis',\n 'America/Indiana/Knox',\n 'America/Indiana/Marengo',\n 'America/Indiana/Petersburg',\n 'America/Indiana/Tell_City',\n 'America/Indiana/Vevay',\n 'America/Indiana/Vincennes',\n 'America/Indiana/Winamac',\n 'America/Inuvik',\n 'America/Iqaluit',\n 'America/Jamaica',\n 'America/Juneau',\n 'America/Kentucky/Louisville',\n 'America/Kentucky/Monticello',\n 'America/La_Paz',\n 'America/Lima',\n 'America/Los_Angeles',\n 'America/Maceio',\n 'America/Managua',\n 'America/Manaus',\n 'America/Martinique',\n 'America/Matamoros',\n 'America/Mazatlan',\n 'America/Menominee',\n 'America/Merida',\n 'America/Metlakatla',\n 'America/Mexico_City',\n 'America/Miquelon',\n 'America/Moncton',\n 'America/Monterrey',\n 'America/Montevideo',\n 'America/Nassau',\n 'America/New_York',\n 'America/Nipigon',\n 'America/Nome',\n 'America/Noronha',\n 'America/North_Dakota/Beulah',\n 'America/North_Dakota/Center',\n 'America/North_Dakota/New_Salem',\n 'America/Ojinaga',\n 'America/Panama',\n 'America/Pangnirtung',\n 'America/Paramaribo',\n 'America/Phoenix',\n 'America/Port-au-Prince',\n 'America/Port_of_Spain',\n 'America/Porto_Velho',\n 'America/Puerto_Rico',\n 'America/Punta_Arenas',\n 'America/Rainy_River',\n 'America/Rankin_Inlet',\n 'America/Recife',\n 'America/Regina',\n 'America/Resolute',\n 'America/Rio_Branco',\n 'America/Santarem',\n 'America/Santiago',\n 'America/Santo_Domingo',\n 'America/Sao_Paulo',\n 'America/Scoresbysund',\n 'America/Sitka',\n 'America/St_Johns',\n 'America/Swift_Current',\n 'America/Tegucigalpa',\n 'America/Thule',\n 'America/Thunder_Bay',\n 'America/Tijuana',\n 'America/Toronto',\n 'America/Vancouver',\n 'America/Whitehorse',\n 'America/Winnipeg',\n 'America/Yakutat',\n 'America/Yellowknife',\n 'Antarctica/Casey',\n 'Antarctica/Davis',\n 'Antarctica/DumontDUrville',\n 'Antarctica/Macquarie',\n 'Antarctica/Mawson',\n 'Antarctica/Palmer',\n 'Antarctica/Rothera',\n 'Antarctica/Syowa',\n 'Antarctica/Troll',\n 'Antarctica/Vostok',\n 'Asia/Almaty',\n 'Asia/Amman',\n 'Asia/Anadyr',\n 'Asia/Aqtau',\n 'Asia/Aqtobe',\n 'Asia/Ashgabat',\n 'Asia/Atyrau',\n 'Asia/Baghdad',\n 'Asia/Baku',\n 'Asia/Bangkok',\n 'Asia/Barnaul',\n 'Asia/Beirut',\n 'Asia/Bishkek',\n 'Asia/Brunei',\n 'Asia/Chita',\n 'Asia/Choibalsan',\n 'Asia/Colombo',\n 'Asia/Damascus',\n 'Asia/Dhaka',\n 'Asia/Dili',\n 'Asia/Dubai',\n 'Asia/Dushanbe',\n 'Asia/Famagusta',\n 'Asia/Gaza',\n 'Asia/Hebron',\n 'Asia/Ho_Chi_Minh',\n 'Asia/Hong_Kong',\n 'Asia/Hovd',\n 'Asia/Irkutsk',\n 'Asia/Jakarta',\n 'Asia/Jayapura',\n 'Asia/Jerusalem',\n 'Asia/Kabul',\n 'Asia/Kamchatka',\n 'Asia/Karachi',\n 'Asia/Kathmandu',\n 'Asia/Khandyga',\n 'Asia/Kolkata',\n 'Asia/Krasnoyarsk',\n 'Asia/Kuala_Lumpur',\n 'Asia/Kuching',\n 'Asia/Macau',\n 'Asia/Magadan',\n 'Asia/Makassar',\n 'Asia/Manila',\n 'Asia/Nicosia',\n 'Asia/Novokuznetsk',\n 'Asia/Novosibirsk',\n 'Asia/Omsk',\n 'Asia/Oral',\n 'Asia/Pontianak',\n 'Asia/Pyongyang',\n 'Asia/Qatar',\n 'Asia/Qostanay',\n 'Asia/Qyzylorda',\n 'Asia/Riyadh',\n 'Asia/Sakhalin',\n 'Asia/Samarkand',\n 'Asia/Seoul',\n 'Asia/Shanghai',\n 'Asia/Singapore',\n 'Asia/Srednekolymsk',\n 'Asia/Taipei',\n 'Asia/Tashkent',\n 'Asia/Tbilisi',\n 'Asia/Tehran',\n 'Asia/Thimphu',\n 'Asia/Tokyo',\n 'Asia/Tomsk',\n 'Asia/Ulaanbaatar',\n 'Asia/Urumqi',\n 'Asia/Ust-Nera',\n 'Asia/Vladivostok',\n 'Asia/Yakutsk',\n 'Asia/Yangon',\n 'Asia/Yekaterinburg',\n 'Asia/Yerevan',\n 'Atlantic/Azores',\n 'Atlantic/Bermuda',\n 'Atlantic/Canary',\n 'Atlantic/Cape_Verde',\n 'Atlantic/Faroe',\n 'Atlantic/Madeira',\n 'Atlantic/Reykjavik',\n 'Atlantic/South_Georgia',\n 'Atlantic/Stanley',\n 'Australia/Adelaide',\n 'Australia/Brisbane',\n 'Australia/Broken_Hill',\n 'Australia/Currie',\n 'Australia/Darwin',\n 'Australia/Eucla',\n 'Australia/Hobart',\n 'Australia/Lindeman',\n 'Australia/Lord_Howe',\n 'Australia/Melbourne',\n 'Australia/Perth',\n 'Australia/Sydney',\n 'Europe/Amsterdam',\n 'Europe/Andorra',\n 'Europe/Astrakhan',\n 'Europe/Athens',\n 'Europe/Belgrade',\n 'Europe/Berlin',\n 'Europe/Brussels',\n 'Europe/Bucharest',\n 'Europe/Budapest',\n 'Europe/Chisinau',\n 'Europe/Copenhagen',\n 'Europe/Dublin',\n 'Europe/Gibraltar',\n 'Europe/Helsinki',\n 'Europe/Istanbul',\n 'Europe/Kaliningrad',\n 'Europe/Kiev',\n 'Europe/Kirov',\n 'Europe/Lisbon',\n 'Europe/London',\n 'Europe/Luxembourg',\n 'Europe/Madrid',\n 'Europe/Malta',\n 'Europe/Minsk',\n 'Europe/Monaco',\n 'Europe/Moscow',\n 'Europe/Oslo',\n 'Europe/Paris',\n 'Europe/Prague',\n 'Europe/Riga',\n 'Europe/Rome',\n 'Europe/Samara',\n 'Europe/Saratov',\n 'Europe/Simferopol',\n 'Europe/Sofia',\n 'Europe/Stockholm',\n 'Europe/Tallinn',\n 'Europe/Tirane',\n 'Europe/Ulyanovsk',\n 'Europe/Uzhgorod',\n 'Europe/Vienna',\n 'Europe/Vilnius',\n 'Europe/Volgograd',\n 'Europe/Warsaw',\n 'Europe/Zaporozhye',\n 'Europe/Zurich',\n 'Indian/Chagos',\n 'Indian/Christmas',\n 'Indian/Cocos',\n 'Indian/Kerguelen',\n 'Indian/Mahe',\n 'Indian/Maldives',\n 'Indian/Mauritius',\n 'Indian/Reunion',\n 'Pacific/Apia',\n 'Pacific/Auckland',\n 'Pacific/Bougainville',\n 'Pacific/Chatham',\n 'Pacific/Chuuk',\n 'Pacific/Easter',\n 'Pacific/Efate',\n 'Pacific/Enderbury',\n 'Pacific/Fakaofo',\n 'Pacific/Fiji',\n 'Pacific/Funafuti',\n 'Pacific/Galapagos',\n 'Pacific/Gambier',\n 'Pacific/Guadalcanal',\n 'Pacific/Guam',\n 'Pacific/Honolulu',\n 'Pacific/Kiritimati',\n 'Pacific/Kosrae',\n 'Pacific/Kwajalein',\n 'Pacific/Majuro',\n 'Pacific/Marquesas',\n 'Pacific/Nauru',\n 'Pacific/Niue',\n 'Pacific/Norfolk',\n 'Pacific/Noumea',\n 'Pacific/Pago_Pago',\n 'Pacific/Palau',\n 'Pacific/Pitcairn',\n 'Pacific/Pohnpei',\n 'Pacific/Port_Moresby',\n 'Pacific/Rarotonga',\n 'Pacific/Tahiti',\n 'Pacific/Tarawa',\n 'Pacific/Tongatapu',\n 'Pacific/Wake',\n 'Pacific/Wallis',\n]\n","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, withKeys as _withKeys, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-47ea2903\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { id: \"tz-dropdown\" }\nconst _hoisted_2 = [\"value\", \"disabled\", \"onKeydown\"]\nconst _hoisted_3 = [\"onClick\", \"onMouseover\", \"autofocus\"]\n\nimport { Ref, ref, toRefs, watch, withDefaults } from 'vue'\n\n import { timeZones } from '@/utils/timezone'\n\n interface Props {\n input: string\n disabled?: boolean\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'TimezoneDropdown',\n props: {\n input: null,\n disabled: { type: Boolean, default: false }\n },\n emits: ['updateTimezone'],\n setup(__props: any, { emit }) {\n\nconst props = __props as { input: string, disabled: boolean };\n\n \n\n \n\n const { input, disabled } = toRefs(props)\n const timezone: Ref = ref(props.input)\n const isOpen: Ref = ref(false)\n const tzList: Ref = ref(null)\n const focusItemIndex: Ref = ref(0)\n\n function matchTimezone(t: string): RegExpMatchArray | null {\n return t.toLowerCase().match(timezone.value.toLowerCase())\n }\n function onMouseOver(index: number) {\n focusItemIndex.value = index\n }\n function onUpdateTimezone(value: string) {\n timezone.value = value\n isOpen.value = false\n emit('updateTimezone', value)\n }\n function onEnter(event: Event & { target: HTMLInputElement }) {\n event.preventDefault()\n if (tzList.value?.firstElementChild?.innerHTML) {\n onUpdateTimezone(tzList.value?.firstElementChild?.innerHTML)\n }\n }\n function openDropdown(event: Event & { target: HTMLInputElement }) {\n event.preventDefault()\n isOpen.value = true\n timezone.value = event.target.value.trim()\n }\n\n watch(\n () => props.input,\n (value) => {\n timezone.value = value\n }\n )\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"input\", {\n class: \"tz-dropdown-input\",\n id: \"timezone\",\n name: \"timezone\",\n value: timezone.value,\n disabled: _unref(disabled),\n required: \"\",\n onKeydown: [\n _cache[0] || (_cache[0] = _withKeys(($event: any) => (onUpdateTimezone(_unref(input))), [\"esc\"])),\n _withKeys(onEnter, [\"enter\"])\n ],\n onInput: openDropdown\n }, null, 40, _hoisted_2),\n (isOpen.value)\n ? (_openBlock(), _createElementBlock(\"ul\", {\n key: 0,\n class: \"tz-dropdown-list\",\n ref_key: \"tzList\",\n ref: tzList\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(timeZones).filter((t) => matchTimezone(t)), (tz, index) => {\n return (_openBlock(), _createElementBlock(\"li\", {\n key: tz,\n class: _normalizeClass([\"tz-dropdown-item\", { focus: index === focusItemIndex.value }]),\n onClick: ($event: any) => (onUpdateTimezone(tz)),\n onMouseover: ($event: any) => (onMouseOver(index)),\n autofocus: index === focusItemIndex.value\n }, _toDisplayString(tz), 43, _hoisted_3))\n }), 128))\n ], 512))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./TimezoneDropdown.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./TimezoneDropdown.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./TimezoneDropdown.vue?vue&type=style&index=0&id=47ea2903&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-47ea2903\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, renderList as _renderList, Fragment as _Fragment, createElementBlock as _createElementBlock, vModelSelect as _vModelSelect, createElementVNode as _createElementVNode, withDirectives as _withDirectives, createTextVNode as _createTextVNode, createVNode as _createVNode, withModifiers as _withModifiers, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-7d35cb46\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { id: \"user-preferences-edition\" }\nconst _hoisted_2 = { class: \"profile-form form-box\" }\nconst _hoisted_3 = [\"onSubmit\"]\nconst _hoisted_4 = { class: \"form-items\" }\nconst _hoisted_5 = [\"disabled\"]\nconst _hoisted_6 = [\"value\"]\nconst _hoisted_7 = { class: \"form-items\" }\nconst _hoisted_8 = { class: \"form-items\" }\nconst _hoisted_9 = [\"disabled\"]\nconst _hoisted_10 = [\"value\"]\nconst _hoisted_11 = { class: \"form-items form-checkboxes\" }\nconst _hoisted_12 = { class: \"checkboxes-label\" }\nconst _hoisted_13 = { class: \"checkboxes\" }\nconst _hoisted_14 = [\"id\", \"name\", \"checked\", \"disabled\", \"onInput\"]\nconst _hoisted_15 = { class: \"checkbox-label\" }\nconst _hoisted_16 = { class: \"form-items form-checkboxes\" }\nconst _hoisted_17 = { class: \"checkboxes-label\" }\nconst _hoisted_18 = { class: \"checkboxes\" }\nconst _hoisted_19 = [\"id\", \"name\", \"checked\", \"disabled\", \"onInput\"]\nconst _hoisted_20 = { class: \"checkbox-label\" }\nconst _hoisted_21 = { class: \"form-items form-checkboxes\" }\nconst _hoisted_22 = { class: \"checkboxes-label\" }\nconst _hoisted_23 = { class: \"checkboxes\" }\nconst _hoisted_24 = [\"id\", \"name\", \"checked\", \"disabled\", \"onInput\"]\nconst _hoisted_25 = { class: \"checkbox-label\" }\nconst _hoisted_26 = { class: \"form-items form-checkboxes\" }\nconst _hoisted_27 = { class: \"checkboxes-label\" }\nconst _hoisted_28 = { class: \"checkboxes\" }\nconst _hoisted_29 = [\"id\", \"name\", \"checked\", \"disabled\", \"onInput\"]\nconst _hoisted_30 = { class: \"checkbox-label\" }\nconst _hoisted_31 = { class: \"form-items form-checkboxes\" }\nconst _hoisted_32 = { class: \"checkboxes-label\" }\nconst _hoisted_33 = { class: \"checkboxes\" }\nconst _hoisted_34 = [\"id\", \"name\", \"checked\", \"disabled\", \"onInput\"]\nconst _hoisted_35 = { class: \"checkbox-label\" }\nconst _hoisted_36 = { class: \"info-box raw-speed-help\" }\nconst _hoisted_37 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-info-circle\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_38 = { class: \"form-buttons\" }\nconst _hoisted_39 = {\n class: \"confirm\",\n type: \"submit\"\n}\n\nimport { ComputedRef, computed, reactive, onMounted, onUnmounted } from 'vue'\n\n import TimezoneDropdown from '@/components/User/ProfileEdition/TimezoneDropdown.vue'\n import { AUTH_USER_STORE, ROOT_STORE } from '@/store/constants'\n import { IUserPreferencesPayload, IAuthUserProfile } from '@/types/user'\n import { useStore } from '@/use/useStore'\n import { availableDateFormatOptions } from '@/utils/dates'\n import { availableLanguages } from '@/utils/locales'\n\n interface Props {\n user: IAuthUserProfile\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'UserPreferencesEdition',\n props: {\n user: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n user: IAuthUserProfile\n };\n\n \n\n const store = useStore()\n\n const userForm: IUserPreferencesPayload = reactive({\n display_ascent: true,\n imperial_units: false,\n language: '',\n timezone: 'Europe/Paris',\n date_format: 'dd/MM/yyyy',\n weekm: false,\n })\n const weekStart = [\n {\n label: 'SUNDAY',\n value: false,\n },\n {\n label: 'MONDAY',\n value: true,\n },\n ]\n const imperialUnits = [\n {\n label: 'METRIC',\n value: false,\n },\n {\n label: 'IMPERIAL',\n value: true,\n },\n ]\n const ascentData = [\n {\n label: 'DISPLAYED',\n value: true,\n },\n {\n label: 'HIDDEN',\n value: false,\n },\n ]\n const startElevationAtZeroData = [\n {\n label: 'ZERO',\n value: true,\n },\n {\n label: 'MIN_ALT',\n value: false,\n },\n ]\n const useRawGpxSpeed = [\n {\n label: 'FILTERED_SPEED',\n value: false,\n },\n {\n label: 'RAW_SPEED',\n value: true,\n },\n ]\n const loading = computed(\n () => store.getters[AUTH_USER_STORE.GETTERS.USER_LOADING]\n )\n const errorMessages: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.ERROR_MESSAGES]\n )\n const dateFormatOptions = computed(() =>\n availableDateFormatOptions(\n new Date().toUTCString(),\n props.user.timezone,\n userForm.language\n )\n )\n\n onMounted(() => {\n if (props.user) {\n updateUserForm(props.user)\n }\n })\n\n function updateUserForm(user: IAuthUserProfile) {\n userForm.display_ascent = user.display_ascent\n userForm.start_elevation_at_zero = user.start_elevation_at_zero\n ? user.start_elevation_at_zero\n : false\n userForm.use_raw_gpx_speed = user.use_raw_gpx_speed\n ? user.use_raw_gpx_speed\n : false\n userForm.imperial_units = user.imperial_units ? user.imperial_units : false\n userForm.language = user.language ? user.language : 'en'\n userForm.timezone = user.timezone ? user.timezone : 'Europe/Paris'\n userForm.date_format = user.date_format ? user.date_format : 'dd/MM/yyyy'\n userForm.weekm = user.weekm ? user.weekm : false\n }\n function updateProfile() {\n store.dispatch(AUTH_USER_STORE.ACTIONS.UPDATE_USER_PREFERENCES, userForm)\n }\n function updateTZ(value: string) {\n userForm.timezone = value\n }\n function updateStartElevationAtZero(value: boolean) {\n userForm.start_elevation_at_zero = value\n }\n function updateUseRawGpxSpeed(value: boolean) {\n userForm.use_raw_gpx_speed = value\n }\n function updateAscentDisplay(value: boolean) {\n userForm.display_ascent = value\n }\n function updateImperialUnit(value: boolean) {\n userForm.imperial_units = value\n }\n function updateWeekM(value: boolean) {\n userForm.weekm = value\n }\n\n onUnmounted(() => {\n store.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n })\n\nreturn (_ctx: any,_cache: any) => {\n const _component_ErrorMessage = _resolveComponent(\"ErrorMessage\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_unref(errorMessages))\n ? (_openBlock(), _createBlock(_component_ErrorMessage, {\n key: 0,\n message: _unref(errorMessages)\n }, null, 8, [\"message\"]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"form\", {\n onSubmit: _withModifiers(updateProfile, [\"prevent\"])\n }, [\n _createElementVNode(\"label\", _hoisted_4, [\n _createTextVNode(_toDisplayString(_ctx.$t('user.PROFILE.LANGUAGE')) + \" \", 1),\n _withDirectives(_createElementVNode(\"select\", {\n id: \"language\",\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((userForm.language) = $event)),\n disabled: _unref(loading)\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(availableLanguages), (lang) => {\n return (_openBlock(), _createElementBlock(\"option\", {\n value: lang.value,\n key: lang.value\n }, _toDisplayString(lang.label), 9, _hoisted_6))\n }), 128))\n ], 8, _hoisted_5), [\n [_vModelSelect, userForm.language]\n ])\n ]),\n _createElementVNode(\"label\", _hoisted_7, [\n _createTextVNode(_toDisplayString(_ctx.$t('user.PROFILE.TIMEZONE')) + \" \", 1),\n _createVNode(TimezoneDropdown, {\n input: userForm.timezone,\n disabled: _unref(loading),\n onUpdateTimezone: updateTZ\n }, null, 8, [\"input\", \"disabled\"])\n ]),\n _createElementVNode(\"label\", _hoisted_8, [\n _createTextVNode(_toDisplayString(_ctx.$t('user.PROFILE.DATE_FORMAT')) + \" \", 1),\n _withDirectives(_createElementVNode(\"select\", {\n id: \"date_format\",\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => ((userForm.date_format) = $event)),\n disabled: _unref(loading)\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(dateFormatOptions), (dateFormat) => {\n return (_openBlock(), _createElementBlock(\"option\", {\n value: dateFormat.value,\n key: dateFormat.value\n }, _toDisplayString(dateFormat.label), 9, _hoisted_10))\n }), 128))\n ], 8, _hoisted_9), [\n [_vModelSelect, userForm.date_format]\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_11, [\n _createElementVNode(\"span\", _hoisted_12, _toDisplayString(_ctx.$t('user.PROFILE.FIRST_DAY_OF_WEEK')), 1),\n _createElementVNode(\"div\", _hoisted_13, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(weekStart, (start) => {\n return _createElementVNode(\"label\", {\n key: start.label\n }, [\n _createElementVNode(\"input\", {\n type: \"radio\",\n id: start.label,\n name: start.label,\n checked: start.value === userForm.weekm,\n disabled: _unref(loading),\n onInput: ($event: any) => (updateWeekM(start.value))\n }, null, 40, _hoisted_14),\n _createElementVNode(\"span\", _hoisted_15, _toDisplayString(_ctx.$t(`user.PROFILE.${start.label}`)), 1)\n ])\n }), 64))\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_16, [\n _createElementVNode(\"span\", _hoisted_17, _toDisplayString(_ctx.$t('user.PROFILE.UNITS.LABEL')), 1),\n _createElementVNode(\"div\", _hoisted_18, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(imperialUnits, (unit) => {\n return _createElementVNode(\"label\", {\n key: unit.label\n }, [\n _createElementVNode(\"input\", {\n type: \"radio\",\n id: unit.label,\n name: unit.label,\n checked: unit.value === userForm.imperial_units,\n disabled: _unref(loading),\n onInput: ($event: any) => (updateImperialUnit(unit.value))\n }, null, 40, _hoisted_19),\n _createElementVNode(\"span\", _hoisted_20, _toDisplayString(_ctx.$t(`user.PROFILE.UNITS.${unit.label}`)), 1)\n ])\n }), 64))\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_21, [\n _createElementVNode(\"span\", _hoisted_22, _toDisplayString(_ctx.$t('user.PROFILE.ASCENT_DATA')), 1),\n _createElementVNode(\"div\", _hoisted_23, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(ascentData, (status) => {\n return _createElementVNode(\"label\", {\n key: status.label\n }, [\n _createElementVNode(\"input\", {\n type: \"radio\",\n id: status.label,\n name: status.label,\n checked: status.value === userForm.display_ascent,\n disabled: _unref(loading),\n onInput: ($event: any) => (updateAscentDisplay(status.value))\n }, null, 40, _hoisted_24),\n _createElementVNode(\"span\", _hoisted_25, _toDisplayString(_ctx.$t(`common.${status.label}`)), 1)\n ])\n }), 64))\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_26, [\n _createElementVNode(\"span\", _hoisted_27, _toDisplayString(_ctx.$t('user.PROFILE.ELEVATION_CHART_START.LABEL')), 1),\n _createElementVNode(\"div\", _hoisted_28, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(startElevationAtZeroData, (status) => {\n return _createElementVNode(\"label\", {\n key: status.label\n }, [\n _createElementVNode(\"input\", {\n type: \"radio\",\n id: status.label,\n name: status.label,\n checked: status.value === userForm.start_elevation_at_zero,\n disabled: _unref(loading),\n onInput: ($event: any) => (updateStartElevationAtZero(status.value))\n }, null, 40, _hoisted_29),\n _createElementVNode(\"span\", _hoisted_30, _toDisplayString(_ctx.$t(`user.PROFILE.ELEVATION_CHART_START.${status.label}`)), 1)\n ])\n }), 64))\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_31, [\n _createElementVNode(\"span\", _hoisted_32, _toDisplayString(_ctx.$t('user.PROFILE.USE_RAW_GPX_SPEED.LABEL')), 1),\n _createElementVNode(\"div\", _hoisted_33, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(useRawGpxSpeed, (status) => {\n return _createElementVNode(\"label\", {\n key: status.label\n }, [\n _createElementVNode(\"input\", {\n type: \"radio\",\n id: status.label,\n name: status.label,\n checked: status.value === userForm.use_raw_gpx_speed,\n disabled: _unref(loading),\n onInput: ($event: any) => (updateUseRawGpxSpeed(status.value))\n }, null, 40, _hoisted_34),\n _createElementVNode(\"span\", _hoisted_35, _toDisplayString(_ctx.$t(`user.PROFILE.USE_RAW_GPX_SPEED.${status.label}`)), 1)\n ])\n }), 64))\n ]),\n _createElementVNode(\"div\", _hoisted_36, [\n _createElementVNode(\"span\", null, [\n _hoisted_37,\n _createTextVNode(\" \" + _toDisplayString(_ctx.$t('user.PROFILE.USE_RAW_GPX_SPEED.HELP')), 1)\n ])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_38, [\n _createElementVNode(\"button\", _hoisted_39, _toDisplayString(_ctx.$t('buttons.SUBMIT')), 1),\n _createElementVNode(\"button\", {\n class: \"cancel\",\n onClick: _cache[2] || (_cache[2] = _withModifiers(($event: any) => (_ctx.$router.push('/profile/preferences')), [\"prevent\"]))\n }, _toDisplayString(_ctx.$t('buttons.CANCEL')), 1)\n ])\n ], 40, _hoisted_3)\n ])\n ]))\n}\n}\n\n})","import script from \"./UserPreferencesEdition.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./UserPreferencesEdition.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./UserPreferencesEdition.vue?vue&type=style&index=0&id=7d35cb46&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-7d35cb46\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, unref as _unref, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-0c1693aa\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"privacy-policy-text\" }\nconst _hoisted_2 = { class: \"last-update\" }\nconst _hoisted_3 = [\"innerHTML\"]\nconst _hoisted_4 = [\"innerHTML\"]\n\nimport snarkdown from 'snarkdown'\n import { ComputedRef, capitalize, computed } from 'vue'\n\n import { AUTH_USER_STORE, ROOT_STORE } from '@/store/constants'\n import { TAppConfig } from '@/types/application'\n import { IAuthUserProfile } from '@/types/user'\n import { useStore } from '@/use/useStore'\n import { dateStringFormats, formatDate } from '@/utils/dates'\n import { linkifyAndClean } from '@/utils/inputs'\n\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'PrivacyPolicy',\n setup(__props) {\n\n const store = useStore()\n const fittrackee_private_policy_date = 'Sun, 26 Feb 2023 17:00:00 GMT'\n const appConfig: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.APP_CONFIG]\n )\n const language: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.LANGUAGE]\n )\n const authUser: ComputedRef = computed(\n () => store.getters[AUTH_USER_STORE.GETTERS.AUTH_USER_PROFILE]\n )\n const dateFormat = computed(() => getDateFormat())\n const timezone = computed(() => getTimezone())\n const private_policy_date = computed(() => getPolicyDate())\n const paragraphs = [\n 'DATA_COLLECTED', 'INFORMATION_USAGE', 'INFORMATION_PROTECTION',\n 'INFORMATION_DISCLOSURE', 'SITE_USAGE_BY_CHILDREN', 'YOUR_CONSENT',\n 'ACCOUNT_DELETION', 'CHANGES_TO_OUR_PRIVACY_POLICY'\n ]\n\n function getTimezone() {\n return authUser.value.timezone\n ? authUser.value.timezone\n : Intl.DateTimeFormat().resolvedOptions().timeZone\n ? Intl.DateTimeFormat().resolvedOptions().timeZone\n : 'Europe/Paris'\n }\n function getDateFormat() {\n return dateStringFormats[language.value]\n }\n function getPolicyDate() {\n return formatDate(\n appConfig.value.privacy_policy && appConfig.value.privacy_policy_date\n ? `${appConfig.value.privacy_policy_date}`\n : fittrackee_private_policy_date,\n timezone.value,\n dateFormat.value,\n false,\n )\n }\n\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"h1\", null, _toDisplayString(capitalize(_ctx.$t('privacy_policy.TITLE'))), 1),\n _createElementVNode(\"p\", _hoisted_2, _toDisplayString(_ctx.$t('privacy_policy.LAST_UPDATE')) + \": \" + _toDisplayString(_unref(private_policy_date)), 1),\n (_unref(appConfig).privacy_policy)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n innerHTML: _unref(snarkdown)(_unref(linkifyAndClean)(_unref(appConfig).privacy_policy))\n }, null, 8, _hoisted_3))\n : (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, _renderList(paragraphs, (paragraph) => {\n return (_openBlock(), _createElementBlock(_Fragment, { key: paragraph }, [\n _createElementVNode(\"h2\", null, _toDisplayString(_ctx.$t(`privacy_policy.CONTENT.${paragraph}.TITLE`)), 1),\n _createElementVNode(\"p\", {\n innerHTML: _unref(snarkdown)(_ctx.$t(`privacy_policy.CONTENT.${paragraph}.CONTENT`))\n }, null, 8, _hoisted_4)\n ], 64))\n }), 64))\n ]))\n}\n}\n\n})","import script from \"./PrivacyPolicy.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./PrivacyPolicy.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./PrivacyPolicy.vue?vue&type=style&index=0&id=0c1693aa&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-0c1693aa\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, withCtx as _withCtx, createVNode as _createVNode, createElementVNode as _createElementVNode, createElementBlock as _createElementBlock, vModelCheckbox as _vModelCheckbox, withDirectives as _withDirectives, withModifiers as _withModifiers, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-c77e04be\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { id: \"user-privacy-policy\" }\nconst _hoisted_2 = { key: 1 }\nconst _hoisted_3 = { class: \"policy-content\" }\nconst _hoisted_4 = {\n for: \"accepted_policy\",\n class: \"accepted_policy\"\n}\nconst _hoisted_5 = { class: \"form-buttons\" }\nconst _hoisted_6 = {\n class: \"confirm\",\n type: \"submit\"\n}\n\nimport { ComputedRef, computed, ref, onUnmounted, toRefs } from 'vue'\n\n import PrivacyPolicy from '@/components/PrivacyPolicy.vue'\n import {AUTH_USER_STORE, ROOT_STORE} from '@/store/constants'\n import { IAuthUserProfile } from '@/types/user'\n import { useStore } from '@/use/useStore'\n\n interface Props {\n user: IAuthUserProfile\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'UserPrivacyPolicyValidation',\n props: {\n user: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n user: IAuthUserProfile\n };\n\n \n const { user } = toRefs(props)\n\n const store = useStore()\n\n const errorMessages: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.ERROR_MESSAGES]\n )\n const acceptedPolicy= ref(false)\n\n function onSubmit() {\n store.dispatch(\n AUTH_USER_STORE.ACTIONS.ACCEPT_PRIVACY_POLICY, acceptedPolicy.value\n )\n }\n\n onUnmounted(() => {\n store.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n })\n\nreturn (_ctx: any,_cache: any) => {\n const _component_ErrorMessage = _resolveComponent(\"ErrorMessage\")!\n const _component_router_link = _resolveComponent(\"router-link\")!\n const _component_i18n_t = _resolveComponent(\"i18n-t\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_unref(errorMessages))\n ? (_openBlock(), _createBlock(_component_ErrorMessage, {\n key: 0,\n message: _unref(errorMessages)\n }, null, 8, [\"message\"]))\n : _createCommentVNode(\"\", true),\n (_unref(user).accepted_privacy_policy)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, [\n _createElementVNode(\"p\", null, [\n _createVNode(_component_i18n_t, { keypath: \"user.YOU_HAVE_ACCEPTED_PRIVACY_POLICY\" }, {\n default: _withCtx(() => [\n _createVNode(_component_router_link, { to: \"/privacy-policy\" }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('privacy_policy.TITLE')), 1)\n ]),\n _: 1\n })\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"button\", {\n class: \"cancel\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (_ctx.$router.push('/profile')))\n }, _toDisplayString(_ctx.$t('user.PROFILE.BACK_TO_PROFILE')), 1)\n ]))\n : (_openBlock(), _createElementBlock(\"form\", {\n key: 2,\n onSubmit: _cache[3] || (_cache[3] = _withModifiers(($event: any) => (onSubmit()), [\"prevent\"]))\n }, [\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(PrivacyPolicy)\n ]),\n _createElementVNode(\"label\", _hoisted_4, [\n _withDirectives(_createElementVNode(\"input\", {\n type: \"checkbox\",\n id: \"accepted_policy\",\n required: \"\",\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => ((acceptedPolicy).value = $event))\n }, null, 512), [\n [_vModelCheckbox, acceptedPolicy.value]\n ]),\n _createElementVNode(\"span\", null, [\n _createVNode(_component_i18n_t, { keypath: \"user.READ_AND_ACCEPT_PRIVACY_POLICY\" }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('privacy_policy.TITLE')), 1)\n ]),\n _: 1\n })\n ])\n ]),\n _createVNode(_component_router_link, { to: \"/profile/edit/account\" }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('user.I_WANT_TO_DELETE_MY_ACCOUNT')), 1)\n ]),\n _: 1\n }),\n _createElementVNode(\"div\", _hoisted_5, [\n _createElementVNode(\"button\", _hoisted_6, _toDisplayString(_ctx.$t('buttons.SUBMIT')), 1),\n _createElementVNode(\"button\", {\n class: \"cancel\",\n onClick: _cache[2] || (_cache[2] = ($event: any) => (_ctx.$router.push('/profile')))\n }, _toDisplayString(_ctx.$t('user.PROFILE.BACK_TO_PROFILE')), 1)\n ])\n ], 32))\n ]))\n}\n}\n\n})","import script from \"./UserPrivacyPolicyValidation.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./UserPrivacyPolicyValidation.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./UserPrivacyPolicyValidation.vue?vue&type=style&index=0&id=c77e04be&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-c77e04be\"]])\n\nexport default __exports__","export const oauth2_scopes = [\n 'profile:read',\n 'profile:write',\n 'users:read',\n 'users:write',\n 'workouts:read',\n 'workouts:write',\n]\n\nexport const admin_oauth2_scopes = ['application:write']\n","import { defineComponent as _defineComponent } from 'vue'\nimport { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, vModelText as _vModelText, withDirectives as _withDirectives, resolveComponent as _resolveComponent, createVNode as _createVNode, unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, withModifiers as _withModifiers, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-0657ee77\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { id: \"new-oauth2-app\" }\nconst _hoisted_2 = { id: \"new-oauth2-title\" }\nconst _hoisted_3 = { id: \"apps-form\" }\nconst _hoisted_4 = [\"onSubmit\"]\nconst _hoisted_5 = { class: \"form-items\" }\nconst _hoisted_6 = { class: \"form-item\" }\nconst _hoisted_7 = { for: \"app-name\" }\nconst _hoisted_8 = { class: \"form-item\" }\nconst _hoisted_9 = { for: \"app-description\" }\nconst _hoisted_10 = { class: \"form-item\" }\nconst _hoisted_11 = { for: \"app-url\" }\nconst _hoisted_12 = { class: \"form-item\" }\nconst _hoisted_13 = { for: \"app-redirect-uri\" }\nconst _hoisted_14 = { class: \"form-item-scope\" }\nconst _hoisted_15 = { class: \"form-item-scope-label\" }\nconst _hoisted_16 = { class: \"scope-label\" }\nconst _hoisted_17 = [\"name\", \"checked\", \"onChange\"]\nconst _hoisted_18 = [\"innerHTML\"]\nconst _hoisted_19 = { class: \"form-buttons\" }\nconst _hoisted_20 = [\"disabled\"]\n\nimport { computed, reactive } from 'vue'\n\n import { OAUTH2_STORE } from '@/store/constants'\n import { IOAuth2ClientPayload } from '@/types/oauth'\n import { IAuthUserProfile } from '@/types/user'\n import { useStore } from '@/use/useStore'\n import { admin_oauth2_scopes, oauth2_scopes } from '@/utils/oauth'\n\n interface Props {\n authUser: IAuthUserProfile\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'AddUserApp',\n props: {\n authUser: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n authUser: IAuthUserProfile\n };\n\n \n\n const store = useStore()\n const appForm = reactive({\n client_name: '',\n client_uri: '',\n client_description: '',\n redirect_uri: '',\n })\n const scopes: string[] = reactive([])\n const filtered_scopes = computed(() =>\n getScopes(props.authUser, admin_oauth2_scopes, oauth2_scopes)\n )\n\n function createApp() {\n const payload: IOAuth2ClientPayload = {\n client_name: appForm.client_name,\n client_description: appForm.client_description,\n client_uri: appForm.client_uri,\n redirect_uris: [appForm.redirect_uri],\n scope: scopes.sort().join(' '),\n }\n store.dispatch(OAUTH2_STORE.ACTIONS.CREATE_CLIENT, payload)\n }\n function updateDescription(value: string) {\n appForm.client_description = value\n }\n function updateScopes(scope: string) {\n const index = scopes.indexOf(scope)\n if (index > -1) {\n scopes.splice(index, 1)\n } else {\n scopes.push(scope)\n }\n }\n function getScopes(\n authUser: IAuthUserProfile,\n admin_scopes: string[],\n scopes: string[]\n ) {\n const filtered_scopes = [...scopes]\n if (authUser.admin) {\n filtered_scopes.push(...admin_scopes)\n }\n return filtered_scopes.sort()\n }\n\nreturn (_ctx: any,_cache: any) => {\n const _component_CustomTextArea = _resolveComponent(\"CustomTextArea\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"h1\", _hoisted_2, _toDisplayString(_ctx.$t('oauth2.ADD_A_NEW_APP')), 1),\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"form\", {\n onSubmit: _withModifiers(createApp, [\"prevent\"])\n }, [\n _createElementVNode(\"div\", _hoisted_5, [\n _createElementVNode(\"div\", _hoisted_6, [\n _createElementVNode(\"label\", _hoisted_7, _toDisplayString(_ctx.$t('oauth2.APP.NAME')) + \"*\", 1),\n _withDirectives(_createElementVNode(\"input\", {\n id: \"app-name\",\n type: \"text\",\n required: \"\",\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((appForm.client_name) = $event))\n }, null, 512), [\n [_vModelText, appForm.client_name]\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _createElementVNode(\"label\", _hoisted_9, _toDisplayString(_ctx.$t('oauth2.APP.DESCRIPTION')), 1),\n _createVNode(_component_CustomTextArea, {\n name: \"app-description\",\n charLimit: 200,\n input: appForm.description,\n onUpdateValue: updateDescription\n }, null, 8, [\"input\"])\n ]),\n _createElementVNode(\"div\", _hoisted_10, [\n _createElementVNode(\"label\", _hoisted_11, _toDisplayString(_ctx.$t('oauth2.APP.URL')) + \"*\", 1),\n _withDirectives(_createElementVNode(\"input\", {\n id: \"app-url\",\n type: \"text\",\n required: \"\",\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => ((appForm.client_uri) = $event))\n }, null, 512), [\n [_vModelText, appForm.client_uri]\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_12, [\n _createElementVNode(\"label\", _hoisted_13, _toDisplayString(_ctx.$t('oauth2.APP.REDIRECT_URL')) + \"* \", 1),\n _withDirectives(_createElementVNode(\"input\", {\n id: \"app-redirect-uri\",\n type: \"text\",\n required: \"\",\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = ($event: any) => ((appForm.redirect_uri) = $event))\n }, null, 512), [\n [_vModelText, appForm.redirect_uri]\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_14, [\n _createElementVNode(\"div\", _hoisted_15, _toDisplayString(_ctx.$t('oauth2.APP.SCOPE.LABEL')) + \"* \", 1),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(filtered_scopes), (scope) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"form-item-scope-checkboxes\",\n key: scope\n }, [\n _createElementVNode(\"label\", _hoisted_16, [\n _createElementVNode(\"input\", {\n type: \"checkbox\",\n name: scope,\n checked: scopes.includes(scope),\n onChange: ($event: any) => (updateScopes(scope))\n }, null, 40, _hoisted_17),\n _createElementVNode(\"code\", null, _toDisplayString(scope), 1)\n ]),\n _createElementVNode(\"p\", {\n class: \"scope-description\",\n innerHTML: _ctx.$t(`oauth2.APP.SCOPE.${scope}_DESCRIPTION`)\n }, null, 8, _hoisted_18)\n ]))\n }), 128))\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_19, [\n _createElementVNode(\"button\", {\n class: \"confirm\",\n type: \"submit\",\n disabled: scopes.length === 0\n }, _toDisplayString(_ctx.$t('buttons.SUBMIT')), 9, _hoisted_20),\n _createElementVNode(\"button\", {\n class: \"cancel\",\n onClick: _cache[3] || (_cache[3] = _withModifiers(() => _ctx.$router.push('/profile/apps'), [\"prevent\"]))\n }, _toDisplayString(_ctx.$t('buttons.CANCEL')), 1)\n ])\n ], 40, _hoisted_4)\n ])\n ]))\n}\n}\n\n})","import script from \"./AddUserApp.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./AddUserApp.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./AddUserApp.vue?vue&type=style&index=0&id=0657ee77&scoped=true&lang=scss\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-0657ee77\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-3b2fe9ed\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { id: \"authorize-oauth2-app\" }\nconst _hoisted_2 = { key: 0 }\nconst _hoisted_3 = { id: \"authorize-oauth2-title\" }\nconst _hoisted_4 = { class: \"oauth2-access description-list\" }\nconst _hoisted_5 = { class: \"client-scope\" }\nconst _hoisted_6 = [\"innerHTML\"]\nconst _hoisted_7 = { class: \"authorize-oauth2-buttons\" }\nconst _hoisted_8 = { key: 1 }\nconst _hoisted_9 = { class: \"no-app\" }\n\nimport { computed, ComputedRef, onBeforeMount } from 'vue'\n import { useRoute } from 'vue-router'\n\n import { OAUTH2_STORE, ROOT_STORE } from '@/store/constants'\n import { IOAuth2Client } from '@/types/oauth'\n import { useStore } from '@/use/useStore'\n\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'AuthorizeUserApp',\n setup(__props) {\n\n const route = useRoute()\n const store = useStore()\n\n const client: ComputedRef = computed(\n () => store.getters[OAUTH2_STORE.GETTERS.CLIENT]\n )\n const errorMessages: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.ERROR_MESSAGES]\n )\n\n onBeforeMount(() => loadApp())\n\n function loadApp() {\n if (route.query.client_id && typeof route.query.client_id === 'string') {\n store.dispatch(\n OAUTH2_STORE.ACTIONS.GET_CLIENT_BY_CLIENT_ID,\n route.query.client_id\n )\n }\n }\n\n function authorizeApp() {\n store.dispatch(OAUTH2_STORE.ACTIONS.AUTHORIZE_CLIENT, {\n client_id: `${route.query.client_id}`,\n redirect_uri: `${route.query.redirect_uri}`,\n response_type: `${route.query.response_type}`,\n scope: `${route.query.scope}`,\n state: `${route.query.state ? route.query.state : ''}`,\n code_challenge: `${\n route.query.code_challenge ? route.query.code_challenge : ''\n }`,\n code_challenge_method: `${\n route.query.code_challenge_method\n ? route.query.code_challenge_method\n : ''\n }`,\n })\n }\n\nreturn (_ctx: any,_cache: any) => {\n const _component_router_link = _resolveComponent(\"router-link\")!\n const _component_i18n_t = _resolveComponent(\"i18n-t\")!\n const _component_ErrorMessage = _resolveComponent(\"ErrorMessage\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_unref(client).client_id)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, [\n _createElementVNode(\"h1\", _hoisted_3, [\n _createVNode(_component_i18n_t, { keypath: \"oauth2.AUTHORIZE_APP\" }, {\n default: _withCtx(() => [\n _createVNode(_component_router_link, {\n to: { name: 'UserApp', params: { id: _unref(client).id } }\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(client).name), 1)\n ]),\n _: 1\n }, 8, [\"to\"])\n ]),\n _: 1\n })\n ]),\n (_unref(errorMessages))\n ? (_openBlock(), _createBlock(_component_ErrorMessage, {\n key: 0,\n message: _unref(errorMessages)\n }, null, 8, [\"message\"]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"p\", null, _toDisplayString(_ctx.$t('oauth2.APP_REQUESTING_ACCESS')), 1),\n _createElementVNode(\"dl\", null, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(client).scope.split(' '), (scope) => {\n return (_openBlock(), _createElementBlock(_Fragment, { key: scope }, [\n _createElementVNode(\"dt\", _hoisted_5, [\n _createElementVNode(\"code\", null, _toDisplayString(scope), 1)\n ]),\n _createElementVNode(\"dd\", {\n innerHTML: _ctx.$t(`oauth2.APP.SCOPE.${scope}_DESCRIPTION`)\n }, null, 8, _hoisted_6)\n ], 64))\n }), 128))\n ]),\n _createElementVNode(\"div\", _hoisted_7, [\n _createElementVNode(\"button\", {\n class: \"danger\",\n onClick: authorizeApp\n }, _toDisplayString(_ctx.$t('buttons.AUTHORIZE')), 1),\n _createElementVNode(\"button\", {\n class: \"cancel\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (_ctx.$router.push('/profile/apps')))\n }, _toDisplayString(_ctx.$t('buttons.CANCEL')), 1)\n ])\n ])\n ]))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_8, [\n _createElementVNode(\"p\", _hoisted_9, _toDisplayString(_ctx.$t('oauth2.NO_APP')), 1),\n _createElementVNode(\"button\", {\n onClick: _cache[1] || (_cache[1] = ($event: any) => (_ctx.$router.push('/profile/apps')))\n }, _toDisplayString(_ctx.$t('buttons.BACK')), 1)\n ]))\n ]))\n}\n}\n\n})","import script from \"./AuthorizeUserApp.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./AuthorizeUserApp.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./AuthorizeUserApp.vue?vue&type=style&index=0&id=3b2fe9ed&scoped=true&lang=scss\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-3b2fe9ed\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { id: \"oauth2-apps\" }\n\nimport { onUnmounted, toRefs } from 'vue'\n\n import { OAUTH2_STORE, ROOT_STORE } from '@/store/constants'\n import { IAuthUserProfile } from '@/types/user'\n import { useStore } from '@/use/useStore'\n\n interface Props {\n user: IAuthUserProfile\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n user: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n user: IAuthUserProfile\n };\n\n \n\n const store = useStore()\n\n const { user } = toRefs(props)\n\n onUnmounted(() => {\n store.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n store.commit(OAUTH2_STORE.MUTATIONS.SET_CLIENTS, [])\n })\n\nreturn (_ctx: any,_cache: any) => {\n const _component_router_view = _resolveComponent(\"router-view\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_router_view, { authUser: _unref(user) }, null, 8, [\"authUser\"])\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./index.vue?vue&type=script&setup=true&lang=ts\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementBlock as _createElementBlock, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, createTextVNode as _createTextVNode, renderList as _renderList, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-3a844fa2\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n id: \"oauth2-app\",\n class: \"description-list\"\n}\nconst _hoisted_2 = { key: 1 }\nconst _hoisted_3 = {\n key: 0,\n class: \"info-box success-message\"\n}\nconst _hoisted_4 = [\"title\"]\nconst _hoisted_5 = { key: 0 }\nconst _hoisted_6 = {\n key: 1,\n class: \"app-secret\"\n}\nconst _hoisted_7 = [\"title\"]\nconst _hoisted_8 = { class: \"client-scopes\" }\nconst _hoisted_9 = { class: \"app-buttons\" }\nconst _hoisted_10 = { key: 2 }\nconst _hoisted_11 = { class: \"no-app\" }\n\nimport {\n ComputedRef,\n Ref,\n capitalize,\n computed,\n onBeforeMount,\n toRefs,\n ref,\n onUnmounted,\n withDefaults,\n watch,\n } from 'vue'\n import { useRoute } from 'vue-router'\n\n import { OAUTH2_STORE, ROOT_STORE } from '@/store/constants'\n import { IOAuth2Client } from '@/types/oauth'\n import { IAuthUserProfile } from '@/types/user'\n import { useStore } from '@/use/useStore'\n import { formatDate } from '@/utils/dates'\n\n interface Props {\n authUser: IAuthUserProfile\n afterCreation?: boolean\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'UserApp',\n props: {\n authUser: null,\n afterCreation: { type: Boolean, default: false }\n },\n setup(__props: any) {\n\nconst props = __props as { authUser: IAuthUserProfile, afterCreation: boolean };\n\n \n const route = useRoute()\n const store = useStore()\n\n const { afterCreation, authUser } = toRefs(props)\n const client: ComputedRef = computed(\n () => store.getters[OAUTH2_STORE.GETTERS.CLIENT]\n )\n const revocationSuccessful: ComputedRef = computed(\n () => store.getters[OAUTH2_STORE.GETTERS.REVOCATION_SUCCESSFUL]\n )\n const displayModal: Ref = ref(false)\n const messageToDisplay: Ref = ref(null)\n const idCopied: Ref = ref(false)\n const secretCopied: Ref = ref(false)\n const clipboardSupport: Ref = ref(false)\n\n onBeforeMount(() => {\n loadClient()\n if (navigator.clipboard) {\n clipboardSupport.value = true\n }\n })\n\n function loadClient() {\n // after creation, client is already in store\n if (\n !afterCreation.value &&\n route.params.id &&\n typeof route.params.id === 'string'\n ) {\n store.dispatch(OAUTH2_STORE.ACTIONS.GET_CLIENT_BY_ID, +route.params.id)\n }\n }\n function updateMessageToDisplay(forDelete: boolean) {\n messageToDisplay.value = forDelete\n ? 'oauth2.APP_DELETION_CONFIRMATION'\n : 'oauth2.TOKENS_REVOCATION_CONFIRMATION'\n updateDisplayModal(true)\n }\n function updateDisplayModal(value: boolean) {\n displayModal.value = value\n if (!value) {\n messageToDisplay.value = null\n }\n }\n function confirmAction(clientId: number) {\n if (messageToDisplay.value === 'oauth2.APP_DELETION_CONFIRMATION') {\n store.dispatch(OAUTH2_STORE.ACTIONS.DELETE_CLIENT, clientId)\n } else {\n store.dispatch(OAUTH2_STORE.ACTIONS.REVOKE_ALL_TOKENS, clientId)\n }\n }\n function copyIdToClipboard() {\n navigator.clipboard.writeText(client.value.client_id)\n idCopied.value = true\n secretCopied.value = false\n setTimeout(() => {\n idCopied.value = false\n }, 3000)\n }\n function copySecretToClipboard() {\n if (client.value.client_secret) {\n navigator.clipboard.writeText(client.value.client_secret)\n secretCopied.value = true\n idCopied.value = false\n setTimeout(() => {\n secretCopied.value = false\n }, 3000)\n }\n }\n onUnmounted(() => {\n store.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n store.commit(OAUTH2_STORE.MUTATIONS.EMPTY_CLIENT)\n store.commit(OAUTH2_STORE.MUTATIONS.SET_REVOCATION_SUCCESSFUL, false)\n })\n\n watch(\n () => revocationSuccessful.value,\n (newValue) => {\n if (newValue) {\n updateDisplayModal(false)\n }\n }\n )\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Modal = _resolveComponent(\"Modal\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (displayModal.value)\n ? (_openBlock(), _createBlock(_component_Modal, {\n key: 0,\n title: _ctx.$t('common.CONFIRMATION'),\n message: _ctx.$t(messageToDisplay.value),\n onConfirmAction: _cache[0] || (_cache[0] = ($event: any) => (confirmAction(_unref(client).id))),\n onCancelAction: _cache[1] || (_cache[1] = ($event: any) => (updateDisplayModal(false)))\n }, null, 8, [\"title\", \"message\"]))\n : _createCommentVNode(\"\", true),\n (_unref(client) && _unref(client).client_id)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, [\n (_unref(afterCreation) || _unref(revocationSuccessful))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_3, _toDisplayString(_ctx.$t(\n _unref(afterCreation)\n ? 'oauth2.APP_CREATED_SUCCESSFULLY'\n : 'oauth2.TOKENS_REVOKED'\n )), 1))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"dl\", null, [\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('oauth2.APP.CLIENT_ID')) + \":\", 1),\n _createElementVNode(\"dd\", null, [\n _createTextVNode(_toDisplayString(_unref(client).client_id) + \" \", 1),\n (_unref(afterCreation) && clipboardSupport.value)\n ? (_openBlock(), _createElementBlock(\"i\", {\n key: 0,\n class: _normalizeClass(`fa fa-${idCopied.value ? 'check' : 'copy'}`),\n \"aria-hidden\": \"true\",\n title: _ctx.$t('oauth2.COPY_TO_CLIPBOARD'),\n onClick: copyIdToClipboard\n }, null, 10, _hoisted_4))\n : _createCommentVNode(\"\", true)\n ]),\n (_unref(afterCreation) && _unref(client).client_secret)\n ? (_openBlock(), _createElementBlock(\"dt\", _hoisted_5, _toDisplayString(_ctx.$t('oauth2.APP.CLIENT_SECRET')) + \": \", 1))\n : _createCommentVNode(\"\", true),\n (_unref(afterCreation) && _unref(client).client_secret)\n ? (_openBlock(), _createElementBlock(\"dd\", _hoisted_6, [\n _createTextVNode(_toDisplayString(_unref(client).client_secret) + \" \", 1),\n (clipboardSupport.value)\n ? (_openBlock(), _createElementBlock(\"i\", {\n key: 0,\n class: _normalizeClass(`fa fa-${secretCopied.value ? 'check' : 'copy'}`),\n \"aria-hidden\": \"true\",\n title: _ctx.$t('oauth2.COPY_TO_CLIPBOARD'),\n onClick: copySecretToClipboard\n }, null, 10, _hoisted_7))\n : _createCommentVNode(\"\", true)\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"dt\", null, _toDisplayString(capitalize(_ctx.$t('oauth2.APP.ISSUE_AT'))) + \":\", 1),\n _createElementVNode(\"dd\", null, _toDisplayString(_unref(formatDate)(\n _unref(client).issued_at,\n _unref(authUser).timezone,\n _unref(authUser).date_format\n )), 1),\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('oauth2.APP.NAME')) + \":\", 1),\n _createElementVNode(\"dd\", null, _toDisplayString(_unref(client).name), 1),\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('oauth2.APP.DESCRIPTION')) + \":\", 1),\n _createElementVNode(\"dd\", {\n class: _normalizeClass({ 'no-description': !_unref(client).client_description })\n }, _toDisplayString(_unref(client).client_description\n ? _unref(client).client_description\n : _ctx.$t('oauth2.NO_DESCRIPTION')), 3),\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('oauth2.APP.URL')) + \":\", 1),\n _createElementVNode(\"dd\", null, _toDisplayString(_unref(client).website), 1),\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('oauth2.APP.REDIRECT_URL')) + \":\", 1),\n _createElementVNode(\"dd\", null, _toDisplayString(_unref(client).redirect_uris.length > 0 ? _unref(client).redirect_uris[0] : ''), 1),\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('oauth2.APP.SCOPE.LABEL')) + \":\", 1),\n _createElementVNode(\"dd\", _hoisted_8, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(client).scope.split(' '), (scope) => {\n return (_openBlock(), _createElementBlock(\"span\", {\n class: \"client-scope\",\n key: scope\n }, [\n _createElementVNode(\"code\", null, _toDisplayString(scope), 1)\n ]))\n }), 128))\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_9, [\n _createElementVNode(\"button\", {\n class: \"danger\",\n onClick: _cache[2] || (_cache[2] = ($event: any) => (updateMessageToDisplay(false)))\n }, _toDisplayString(_ctx.$t('oauth2.REVOKE_ALL_TOKENS')), 1),\n _createElementVNode(\"button\", {\n class: \"danger\",\n onClick: _cache[3] || (_cache[3] = ($event: any) => (updateMessageToDisplay(true)))\n }, _toDisplayString(_ctx.$t('oauth2.DELETE_APP')), 1),\n _createElementVNode(\"button\", {\n onClick: _cache[4] || (_cache[4] = ($event: any) => (_ctx.$router.push('/profile/apps')))\n }, _toDisplayString(_ctx.$t('buttons.BACK')), 1)\n ])\n ]))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_10, [\n _createElementVNode(\"p\", _hoisted_11, _toDisplayString(_ctx.$t('oauth2.NO_APP')), 1),\n _createElementVNode(\"button\", {\n onClick: _cache[5] || (_cache[5] = ($event: any) => (_ctx.$router.push('/profile/apps')))\n }, _toDisplayString(_ctx.$t('buttons.BACK')), 1)\n ]))\n ]))\n}\n}\n\n})","import script from \"./UserApp.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./UserApp.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./UserApp.vue?vue&type=style&index=0&id=3a844fa2&scoped=true&lang=scss\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-3a844fa2\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, createCommentVNode as _createCommentVNode, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-efa45ea0\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { id: \"oauth2-apps-list\" }\nconst _hoisted_2 = { class: \"apps-list\" }\nconst _hoisted_3 = { key: 0 }\nconst _hoisted_4 = { class: \"app-issued-at\" }\nconst _hoisted_5 = {\n key: 1,\n class: \"no-apps\"\n}\nconst _hoisted_6 = { class: \"app-list-buttons\" }\n\nimport { ComputedRef, computed, onBeforeMount, toRefs, watch } from 'vue'\n import { LocationQuery, useRoute } from 'vue-router'\n\n import Pagination from '@/components/Common/Pagination.vue'\n import { OAUTH2_STORE } from '@/store/constants'\n import { IPagination } from '@/types/api'\n import { IOAuth2Client, IOauth2ClientsPayload } from '@/types/oauth'\n import { IAuthUserProfile } from '@/types/user'\n import { useStore } from '@/use/useStore'\n import { defaultPage, getNumberQueryValue } from '@/utils/api'\n import { formatDate } from '@/utils/dates'\n\n interface Props {\n authUser: IAuthUserProfile\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'UserAppsList',\n props: {\n authUser: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n authUser: IAuthUserProfile\n };\n\n \n\n const store = useStore()\n const route = useRoute()\n\n const { authUser } = toRefs(props)\n const clients: ComputedRef = computed(\n () => store.getters[OAUTH2_STORE.GETTERS.CLIENTS]\n )\n\n const pagination: ComputedRef = computed(\n () => store.getters[OAUTH2_STORE.GETTERS.CLIENTS_PAGINATION]\n )\n let query: IOauth2ClientsPayload = getClientsQuery(route.query)\n\n onBeforeMount(() => {\n loadClients(query)\n })\n\n function getClientsQuery(newQuery: LocationQuery): IOauth2ClientsPayload {\n const clientsQuery: IOauth2ClientsPayload = {}\n if (newQuery.page) {\n clientsQuery.page = getNumberQueryValue(newQuery.page, defaultPage)\n }\n return clientsQuery\n }\n function loadClients(payload: IOauth2ClientsPayload) {\n store.dispatch(OAUTH2_STORE.ACTIONS.GET_CLIENTS, payload)\n }\n\n watch(\n () => route.query,\n async (newQuery) => {\n query = getClientsQuery(newQuery)\n loadClients(query)\n }\n )\n\nreturn (_ctx: any,_cache: any) => {\n const _component_router_link = _resolveComponent(\"router-link\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"p\", _hoisted_2, _toDisplayString(_ctx.$t('oauth2.APPS_LIST')), 1),\n (_unref(clients).length > 0)\n ? (_openBlock(), _createElementBlock(\"ul\", _hoisted_3, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(clients), (client) => {\n return (_openBlock(), _createElementBlock(\"li\", {\n key: client.client_id\n }, [\n _createVNode(_component_router_link, {\n to: { name: 'UserApp', params: { id: client.id } }\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(client.name), 1)\n ]),\n _: 2\n }, 1032, [\"to\"]),\n _createElementVNode(\"span\", _hoisted_4, _toDisplayString(_ctx.$t('oauth2.APP.ISSUE_AT')) + \" \" + _toDisplayString(_unref(formatDate)(\n client.issued_at,\n _unref(authUser).timezone,\n _unref(authUser).date_format\n )), 1)\n ]))\n }), 128))\n ]))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_5, _toDisplayString(_ctx.$t('oauth2.NO_APPS')), 1)),\n (_unref(clients).length > 0)\n ? (_openBlock(), _createBlock(Pagination, {\n key: 2,\n pagination: _unref(pagination),\n path: \"/profile/apps\",\n query: _unref(query)\n }, null, 8, [\"pagination\", \"query\"]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_6, [\n _createElementVNode(\"button\", {\n onClick: _cache[0] || (_cache[0] = ($event: any) => (_ctx.$router.push('/profile/apps/new')))\n }, _toDisplayString(_ctx.$t('oauth2.NEW_APP')), 1),\n _createElementVNode(\"button\", {\n onClick: _cache[1] || (_cache[1] = ($event: any) => (_ctx.$router.push('/')))\n }, _toDisplayString(_ctx.$t('common.HOME')), 1)\n ])\n ]))\n}\n}\n\n})","import script from \"./UserAppsList.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./UserAppsList.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./UserAppsList.vue?vue&type=style&index=0&id=efa45ea0&scoped=true&lang=scss\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-efa45ea0\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, toDisplayString as _toDisplayString, withModifiers as _withModifiers, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, resolveComponent as _resolveComponent, createBlock as _createBlock, createTextVNode as _createTextVNode, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-74e52489\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { id: \"user-sport-preferences\" }\nconst _hoisted_2 = {\n key: 0,\n class: \"responsive-table\"\n}\nconst _hoisted_3 = { class: \"mobile-display\" }\nconst _hoisted_4 = {\n key: 0,\n class: \"profile-buttons mobile-display\"\n}\nconst _hoisted_5 = {\n key: 1,\n class: \"profile-buttons\"\n}\nconst _hoisted_6 = { class: \"text-left\" }\nconst _hoisted_7 = { key: 0 }\nconst _hoisted_8 = { class: \"cell-heading\" }\nconst _hoisted_9 = [\"value\"]\nconst _hoisted_10 = { class: \"cell-heading\" }\nconst _hoisted_11 = {\n key: 0,\n class: \"disabled-message\"\n}\nconst _hoisted_12 = {\n key: 1,\n class: \"fa fa-refresh fa-spin fa-fw\"\n}\nconst _hoisted_13 = { class: \"cell-heading\" }\nconst _hoisted_14 = { class: \"cell-heading\" }\nconst _hoisted_15 = [\"checked\"]\nconst _hoisted_16 = { class: \"cell-heading\" }\nconst _hoisted_17 = [\"value\"]\nconst _hoisted_18 = { key: 1 }\nconst _hoisted_19 = {\n key: 0,\n class: \"action-buttons\"\n}\nconst _hoisted_20 = { class: \"cell-heading\" }\nconst _hoisted_21 = [\"onClick\"]\nconst _hoisted_22 = {\n key: 1,\n class: \"edition-buttons\"\n}\nconst _hoisted_23 = [\"disabled\"]\nconst _hoisted_24 = [\"disabled\", \"onClick\"]\nconst _hoisted_25 = [\"disabled\"]\nconst _hoisted_26 = {\n key: 0,\n class: \"profile-buttons\"\n}\nconst _hoisted_27 = {\n key: 1,\n class: \"profile-buttons\"\n}\n\nimport { ComputedRef, computed, inject, reactive, toRefs, watch } from 'vue'\n import { useI18n } from 'vue-i18n'\n\n import { AUTH_USER_STORE, ROOT_STORE, SPORTS_STORE } from '@/store/constants'\n import { ISport, ITranslatedSport } from '@/types/sports'\n import { IUserProfile, IUserSportPreferencesPayload } from '@/types/user'\n import { useStore } from '@/use/useStore'\n import { translateSports } from '@/utils/sports'\n\n interface Props {\n user: IUserProfile\n isEdition: boolean\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'UserSportPreferences',\n props: {\n user: null,\n isEdition: { type: Boolean }\n },\n setup(__props: any) {\n\nconst props = __props as {\n user: IUserProfile\n isEdition: boolean\n };\n\n \n\n const store = useStore()\n const { t } = useI18n()\n\n const { isEdition, user } = toRefs(props)\n const defaultColor = '#838383'\n const sportColors: Record | undefined = inject('sportColors')\n const sports: ComputedRef = computed(\n () => store.getters[SPORTS_STORE.GETTERS.SPORTS]\n )\n const translatedSports: ComputedRef = computed(() =>\n translateSports(sports.value, t, 'is_active', user.value.sports_list)\n )\n const loading = computed(\n () => store.getters[AUTH_USER_STORE.GETTERS.USER_LOADING]\n )\n const errorMessages: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.ERROR_MESSAGES]\n )\n const sportPayload: IUserSportPreferencesPayload = reactive({\n sport_id: 0,\n color: null,\n is_active: true,\n stopped_speed_threshold: 1,\n })\n\n function updateSportInEdition(sport: ISport | null) {\n if (sport !== null) {\n sportPayload.sport_id = sport.id\n sportPayload.color = sport.color\n ? sport.color\n : sportColors\n ? sportColors[sport.label]\n : defaultColor\n sportPayload.is_active = sport.is_active_for_user\n sportPayload.stopped_speed_threshold = sport.stopped_speed_threshold\n } else {\n resetSportPayload()\n }\n }\n function isSportInEdition(sportId: number) {\n return sportPayload.sport_id === sportId\n }\n function updateColor(event: Event & { target: HTMLInputElement }) {\n sportPayload.color = event.target.value\n }\n function updateThreshold(event: Event & { target: HTMLInputElement }) {\n sportPayload.stopped_speed_threshold = parseFloat(event.target.value)\n }\n function updateIsActive(event: Event & { target: HTMLInputElement }) {\n sportPayload.is_active = event.target.checked\n }\n function resetSportPayload() {\n sportPayload.sport_id = 0\n sportPayload.color = null\n sportPayload.is_active = true\n sportPayload.stopped_speed_threshold = 1\n store.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n }\n function updateSport(event: Event) {\n event.preventDefault()\n store.dispatch(\n AUTH_USER_STORE.ACTIONS.UPDATE_USER_SPORT_PREFERENCES,\n sportPayload\n )\n }\n function resetSport(event: Event, sportId: number) {\n event.preventDefault()\n store.dispatch(\n AUTH_USER_STORE.ACTIONS.RESET_USER_SPORT_PREFERENCES,\n sportId\n )\n }\n\n watch(\n () => loading.value,\n (newIsLoading) => {\n if (!newIsLoading && !errorMessages.value) {\n resetSportPayload()\n }\n }\n )\n\nreturn (_ctx: any,_cache: any) => {\n const _component_SportImage = _resolveComponent(\"SportImage\")!\n const _component_ErrorMessage = _resolveComponent(\"ErrorMessage\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_unref(sports).length > 0)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n (_unref(isEdition))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_4, [\n _createElementVNode(\"button\", {\n class: \"cancel\",\n onClick: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (_ctx.$router.push('/profile/sports')), [\"prevent\"]))\n }, _toDisplayString(_ctx.$t('buttons.BACK')), 1)\n ]))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_5, [\n _createElementVNode(\"button\", {\n onClick: _cache[1] || (_cache[1] = ($event: any) => (_ctx.$router.push('/profile/edit/sports')))\n }, _toDisplayString(_ctx.$t('user.PROFILE.EDIT_SPORTS_PREFERENCES')), 1),\n _createElementVNode(\"button\", {\n onClick: _cache[2] || (_cache[2] = ($event: any) => (_ctx.$router.push('/')))\n }, _toDisplayString(_ctx.$t('common.HOME')), 1)\n ]))\n ]),\n _createElementVNode(\"table\", null, [\n _createElementVNode(\"thead\", null, [\n _createElementVNode(\"tr\", null, [\n _createElementVNode(\"th\", null, _toDisplayString(_ctx.$t('user.PROFILE.SPORT.COLOR')), 1),\n _createElementVNode(\"th\", _hoisted_6, _toDisplayString(_ctx.$t('workouts.SPORT', 0)), 1),\n _createElementVNode(\"th\", null, _toDisplayString(_ctx.$t('workouts.WORKOUT', 0)), 1),\n _createElementVNode(\"th\", null, _toDisplayString(_ctx.$t('user.PROFILE.SPORT.IS_ACTIVE')), 1),\n _createElementVNode(\"th\", null, _toDisplayString(_ctx.$t('user.PROFILE.SPORT.STOPPED_SPEED_THRESHOLD')), 1),\n (_unref(isEdition))\n ? (_openBlock(), _createElementBlock(\"th\", _hoisted_7, _toDisplayString(_ctx.$t('user.PROFILE.SPORT.ACTION')), 1))\n : _createCommentVNode(\"\", true)\n ])\n ]),\n _createElementVNode(\"tbody\", null, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(translatedSports), (sport) => {\n return (_openBlock(), _createElementBlock(\"tr\", {\n key: sport.id\n }, [\n _createElementVNode(\"td\", null, [\n _createElementVNode(\"span\", _hoisted_8, _toDisplayString(_ctx.$t('user.PROFILE.SPORT.COLOR')), 1),\n (isSportInEdition(sport.id))\n ? (_openBlock(), _createElementBlock(\"input\", {\n key: 0,\n class: \"sport-color\",\n type: \"color\",\n value: sportPayload.color,\n onInput: updateColor\n }, null, 40, _hoisted_9))\n : (_openBlock(), _createBlock(_component_SportImage, {\n key: 1,\n title: sport.translatedLabel,\n \"sport-label\": sport.label,\n color: sport.color ? sport.color : _unref(sportColors)[sport.label]\n }, null, 8, [\"title\", \"sport-label\", \"color\"]))\n ]),\n _createElementVNode(\"td\", {\n class: _normalizeClass([\"sport-label\", { 'disabled-sport': !sport.is_active }])\n }, [\n _createElementVNode(\"span\", _hoisted_10, _toDisplayString(_ctx.$t('user.PROFILE.SPORT.LABEL')), 1),\n _createTextVNode(\" \" + _toDisplayString(sport.translatedLabel) + \" \", 1),\n (!sport.is_active)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_11, \" (\" + _toDisplayString(_ctx.$t('user.PROFILE.SPORT.DISABLED_BY_ADMIN')) + \") \", 1))\n : _createCommentVNode(\"\", true),\n (_unref(loading) && isSportInEdition(sport.id))\n ? (_openBlock(), _createElementBlock(\"i\", _hoisted_12))\n : _createCommentVNode(\"\", true),\n (_unref(errorMessages) && sportPayload.sport_id === sport.id)\n ? (_openBlock(), _createBlock(_component_ErrorMessage, {\n key: 2,\n message: _unref(errorMessages)\n }, null, 8, [\"message\"]))\n : _createCommentVNode(\"\", true)\n ], 2),\n _createElementVNode(\"td\", {\n class: _normalizeClass([\"text-center\", { 'disabled-sport': !sport.is_active }])\n }, [\n _createElementVNode(\"span\", _hoisted_13, _toDisplayString(_ctx.$t('workouts.WORKOUT', 0)), 1),\n _createElementVNode(\"i\", {\n class: _normalizeClass(`fa fa${\n _unref(user).sports_list.includes(sport.id) ? '-check' : ''\n }`),\n \"aria-hidden\": \"true\"\n }, null, 2)\n ], 2),\n _createElementVNode(\"td\", {\n class: _normalizeClass([\"text-center\", { 'disabled-sport': !sport.is_active }])\n }, [\n _createElementVNode(\"span\", _hoisted_14, _toDisplayString(_ctx.$t('user.PROFILE.SPORT.IS_ACTIVE')), 1),\n (isSportInEdition(sport.id) && sport.is_active)\n ? (_openBlock(), _createElementBlock(\"input\", {\n key: 0,\n type: \"checkbox\",\n checked: sport.is_active_for_user,\n onChange: updateIsActive\n }, null, 40, _hoisted_15))\n : (_openBlock(), _createElementBlock(\"i\", {\n key: 1,\n class: _normalizeClass(`fa fa${sport.is_active_for_user ? '-check' : ''}`),\n \"aria-hidden\": \"true\"\n }, null, 2))\n ], 2),\n _createElementVNode(\"td\", {\n class: _normalizeClass([\"text-center\", { 'disabled-sport': !sport.is_active }])\n }, [\n _createElementVNode(\"span\", _hoisted_16, _toDisplayString(_ctx.$t('user.PROFILE.SPORT.STOPPED_SPEED_THRESHOLD')), 1),\n (isSportInEdition(sport.id) && sport.is_active)\n ? (_openBlock(), _createElementBlock(\"input\", {\n key: 0,\n class: \"threshold-input\",\n type: \"number\",\n min: \"0\",\n step: \"0.1\",\n value: sportPayload.stopped_speed_threshold,\n onInput: updateThreshold\n }, null, 40, _hoisted_17))\n : (_openBlock(), _createElementBlock(\"span\", _hoisted_18, _toDisplayString(sport.stopped_speed_threshold), 1))\n ], 2),\n (_unref(isEdition))\n ? (_openBlock(), _createElementBlock(\"td\", _hoisted_19, [\n _createElementVNode(\"span\", _hoisted_20, _toDisplayString(_ctx.$t('user.PROFILE.SPORT.ACTION')), 1),\n (sportPayload.sport_id === 0)\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 0,\n onClick: ($event: any) => (updateSportInEdition(sport))\n }, _toDisplayString(_ctx.$t('buttons.EDIT')), 9, _hoisted_21))\n : _createCommentVNode(\"\", true),\n (isSportInEdition(sport.id))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_22, [\n _createElementVNode(\"button\", {\n disabled: _unref(loading),\n onClick: updateSport\n }, _toDisplayString(_ctx.$t('buttons.SUBMIT')), 9, _hoisted_23),\n _createElementVNode(\"button\", {\n disabled: _unref(loading),\n onClick: (e) => resetSport(e, sport.id)\n }, _toDisplayString(_ctx.$t('buttons.RESET')), 9, _hoisted_24),\n _createElementVNode(\"button\", {\n disabled: _unref(loading),\n onClick: _cache[3] || (_cache[3] = ($event: any) => (updateSportInEdition(null)))\n }, _toDisplayString(_ctx.$t('buttons.CANCEL')), 9, _hoisted_25)\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n }), 128))\n ])\n ]),\n (_unref(isEdition))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_26, [\n _createElementVNode(\"button\", {\n class: \"cancel\",\n onClick: _cache[4] || (_cache[4] = _withModifiers(($event: any) => (_ctx.$router.push('/profile/sports')), [\"prevent\"]))\n }, _toDisplayString(_ctx.$t('buttons.BACK')), 1)\n ]))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_27, [\n _createElementVNode(\"button\", {\n onClick: _cache[5] || (_cache[5] = ($event: any) => (_ctx.$router.push('/profile/edit/sports')))\n }, _toDisplayString(_ctx.$t('user.PROFILE.EDIT_SPORTS_PREFERENCES')), 1),\n _createElementVNode(\"button\", {\n onClick: _cache[6] || (_cache[6] = ($event: any) => (_ctx.$router.push('/')))\n }, _toDisplayString(_ctx.$t('common.HOME')), 1)\n ]))\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./UserSportPreferences.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./UserSportPreferences.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./UserSportPreferences.vue?vue&type=style&index=0&id=74e52489&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-74e52489\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, unref as _unref, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-7b2a3a04\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"about-text\" }\nconst _hoisted_2 = [\"innerHTML\"]\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-book fa-padding\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_4 = {\n href: \"https://samr1.github.io/FitTrackee/\",\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n}\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-github fa-padding\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_6 = {\n href: \"https://github.com/SamR1/FitTrackee\",\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n}\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-balance-scale fa-padding\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_8 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"a\", {\n href: \"https://choosealicense.com/licenses/agpl-3.0/\",\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n}, \" AGPLv3 \", -1))\nconst _hoisted_9 = { key: 0 }\nconst _hoisted_10 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-envelope-o fa-padding\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_11 = [\"href\"]\nconst _hoisted_12 = { key: 1 }\nconst _hoisted_13 = [\"href\"]\nconst _hoisted_14 = { class: \"about-instance\" }\nconst _hoisted_15 = [\"innerHTML\"]\n\nimport snarkdown from 'snarkdown'\n import { ComputedRef, computed, capitalize } from 'vue'\n\n import { ROOT_STORE } from '@/store/constants'\n import { TAppConfig } from '@/types/application'\n import { useStore } from '@/use/useStore'\n import { linkifyAndClean } from '@/utils/inputs'\n\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'About',\n setup(__props) {\n\n const store = useStore()\n const appConfig: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.APP_CONFIG]\n )\n const weather_provider: ComputedRef> = computed(() =>\n get_weather_provider()\n )\n\n function get_weather_provider() {\n const weather_provider: Record = {}\n if (appConfig.value.weather_provider === 'visualcrossing') {\n weather_provider['name'] = 'Visual Crossing'\n weather_provider['url'] = 'https://www.visualcrossing.com'\n }\n return weather_provider\n }\n\nreturn (_ctx: any,_cache: any) => {\n const _component_i18n_t = _resolveComponent(\"i18n-t\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", null, [\n _createElementVNode(\"p\", {\n class: \"error-message\",\n innerHTML: _ctx.$t('about.FITTRACKEE_DESCRIPTION')\n }, null, 8, _hoisted_2),\n _createElementVNode(\"p\", null, [\n _hoisted_3,\n _createElementVNode(\"a\", _hoisted_4, _toDisplayString(capitalize(_ctx.$t('common.DOCUMENTATION'))), 1)\n ]),\n _createElementVNode(\"p\", null, [\n _hoisted_5,\n _createElementVNode(\"a\", _hoisted_6, _toDisplayString(_ctx.$t('about.SOURCE_CODE')), 1)\n ]),\n _createElementVNode(\"p\", null, [\n _hoisted_7,\n _createVNode(_component_i18n_t, { keypath: \"about.FITTRACKEE_LICENSE\" }, {\n default: _withCtx(() => [\n _hoisted_8\n ]),\n _: 1\n })\n ]),\n (_unref(appConfig).admin_contact)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_9, [\n _hoisted_10,\n _createElementVNode(\"a\", {\n href: `mailto:${_unref(appConfig).admin_contact}`\n }, _toDisplayString(_ctx.$t('about.CONTACT_ADMIN')), 9, _hoisted_11)\n ]))\n : _createCommentVNode(\"\", true),\n (_unref(weather_provider) && _unref(weather_provider).name)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_12, [\n _createTextVNode(_toDisplayString(_ctx.$t('about.WEATHER_DATA_FROM')) + \" \", 1),\n _createElementVNode(\"a\", {\n href: _unref(weather_provider).url,\n target: \"_blank\",\n rel: \"nofollow noopener\"\n }, _toDisplayString(_unref(weather_provider).name), 9, _hoisted_13)\n ]))\n : _createCommentVNode(\"\", true),\n (_unref(appConfig).about)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 2 }, [\n _createElementVNode(\"p\", _hoisted_14, _toDisplayString(_ctx.$t('about.ABOUT_THIS_INSTANCE')), 1),\n _createElementVNode(\"div\", {\n innerHTML: _unref(snarkdown)(_unref(linkifyAndClean)(_unref(appConfig).about))\n }, null, 8, _hoisted_15)\n ], 64))\n : _createCommentVNode(\"\", true)\n ])\n ]))\n}\n}\n\n})","import script from \"./About.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./About.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./About.vue?vue&type=style&index=0&id=7b2a3a04&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-7b2a3a04\"]])\n\nexport default __exports__","\n\n\n","import { render } from \"./BikePic.vue?vue&type=template&id=795f7f5f&scoped=true\"\nconst script = {}\n\nimport \"./BikePic.vue?vue&type=style&index=0&id=795f7f5f&scoped=true&lang=scss\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-795f7f5f\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-bffb50d0\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n id: \"about\",\n class: \"view\"\n}\nconst _hoisted_2 = { class: \"container\" }\nconst _hoisted_3 = { class: \"container-sub\" }\nconst _hoisted_4 = { class: \"container-sub about-details\" }\n\nimport About from '@/components/About.vue'\n import BikePic from '@/components/BikePic.vue'\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'AboutView',\n setup(__props) {\n\n \nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(BikePic)\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n _createVNode(About)\n ])\n ])\n ]))\n}\n}\n\n})","import script from \"./AboutView.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./AboutView.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./AboutView.vue?vue&type=style&index=0&id=bffb50d0&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-bffb50d0\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-645a9e33\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"timeline-workout\" }\nconst _hoisted_2 = { class: \"box\" }\nconst _hoisted_3 = { class: \"workout-user-date\" }\nconst _hoisted_4 = { class: \"workout-user\" }\nconst _hoisted_5 = [\"title\"]\nconst _hoisted_6 = { key: 0 }\nconst _hoisted_7 = {\n key: 1,\n class: \"no-map\"\n}\nconst _hoisted_8 = { class: \"img\" }\nconst _hoisted_9 = { class: \"data\" }\nconst _hoisted_10 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-clock-o\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_11 = { key: 0 }\nconst _hoisted_12 = { class: \"data\" }\nconst _hoisted_13 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-road\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_14 = {\n key: 0,\n class: \"data elevation\"\n}\nconst _hoisted_15 = [\"alt\"]\nconst _hoisted_16 = { class: \"data-values\" }\nconst _hoisted_17 = {\n key: 1,\n class: \"data altitude\"\n}\nconst _hoisted_18 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-location-arrow\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_19 = { class: \"data-values\" }\n\nimport { Locale, formatDistance } from 'date-fns'\n import { ComputedRef, computed, toRefs, withDefaults } from 'vue'\n\n import StaticMap from '@/components/Common/StaticMap.vue'\n import UserPicture from '@/components/User/UserPicture.vue'\n import { ROOT_STORE } from '@/store/constants'\n import { ISport } from '@/types/sports'\n import { IUserProfile } from '@/types/user'\n import { IWorkout } from '@/types/workouts'\n import { useStore } from '@/use/useStore'\n import { formatDate } from '@/utils/dates'\n\n interface Props {\n user: IUserProfile\n useImperialUnits: boolean\n workout?: IWorkout\n sport?: ISport\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'WorkoutCard',\n props: {\n user: null,\n useImperialUnits: { type: Boolean },\n workout: { default: () => ({} as IWorkout) },\n sport: { default: () => ({} as ISport) }\n },\n setup(__props: any) {\n\nconst props = __props as { user: IUserProfile, useImperialUnits: boolean, workout: IWorkout, sport: ISport };\n\n \n\n const store = useStore()\n\n const { user, workout, sport, useImperialUnits } = toRefs(props)\n const locale: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.LOCALE]\n )\n\n function hasElevation(workout: IWorkout): boolean {\n return workout && workout.ascent !== null && workout.descent !== null\n }\n\nreturn (_ctx: any,_cache: any) => {\n const _component_router_link = _resolveComponent(\"router-link\")!\n const _component_SportImage = _resolveComponent(\"SportImage\")!\n const _component_Distance = _resolveComponent(\"Distance\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, [\n _createVNode(UserPicture, { user: _unref(user) }, null, 8, [\"user\"]),\n (_unref(user).username)\n ? (_openBlock(), _createBlock(_component_router_link, {\n key: 0,\n class: \"workout-user-name\",\n to: {\n name: 'User',\n params: { username: _unref(user).username },\n }\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(user).username), 1)\n ]),\n _: 1\n }, 8, [\"to\"]))\n : _createCommentVNode(\"\", true)\n ]),\n (_unref(workout).id)\n ? (_openBlock(), _createBlock(_component_router_link, {\n key: 0,\n class: \"workout-title\",\n to: {\n name: 'Workout',\n params: { workoutId: _unref(workout).id },\n }\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(workout).title), 1)\n ]),\n _: 1\n }, 8, [\"to\"]))\n : _createCommentVNode(\"\", true),\n (_unref(workout).workout_date && _unref(user))\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 1,\n class: \"workout-date\",\n title: \n _unref(formatDate)(_unref(workout).workout_date, _unref(user).timezone, _unref(user).date_format)\n \n }, _toDisplayString(_unref(formatDistance)(new Date(_unref(workout).workout_date), new Date(), {\n addSuffix: true,\n locale: _unref(locale),\n })), 9, _hoisted_5))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"workout-map\", { 'no-cursor': !_unref(workout) }]),\n onClick: _cache[0] || (_cache[0] = ($event: any) => (\n _unref(workout).id\n ? _ctx.$router.push({\n name: 'Workout',\n params: { workoutId: _unref(workout).id },\n })\n : null\n ))\n }, [\n (_unref(workout))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_6, [\n (_unref(workout).with_gpx)\n ? (_openBlock(), _createBlock(StaticMap, {\n key: 0,\n workout: _unref(workout)\n }, null, 8, [\"workout\"]))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_7, _toDisplayString(_ctx.$t('workouts.NO_MAP')), 1))\n ]))\n : _createCommentVNode(\"\", true)\n ], 2),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"workout-data\", { 'without-gpx': _unref(workout) && !_unref(workout).with_gpx }]),\n onClick: _cache[1] || (_cache[1] = ($event: any) => (\n _unref(workout).id\n ? _ctx.$router.push({\n name: 'Workout',\n params: { workoutId: _unref(workout).id },\n })\n : null\n ))\n }, [\n _createElementVNode(\"div\", _hoisted_8, [\n (_unref(sport).label)\n ? (_openBlock(), _createBlock(_component_SportImage, {\n key: 0,\n \"sport-label\": _unref(sport).label,\n color: _unref(sport).color\n }, null, 8, [\"sport-label\", \"color\"]))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"div\", _hoisted_9, [\n _hoisted_10,\n (_unref(workout))\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_11, _toDisplayString(_unref(workout).moving), 1))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"div\", _hoisted_12, [\n _hoisted_13,\n (_unref(workout).id)\n ? (_openBlock(), _createBlock(_component_Distance, {\n key: 0,\n distance: _unref(workout).distance,\n digits: 3,\n unitFrom: \"km\",\n useImperialUnits: _unref(useImperialUnits)\n }, null, 8, [\"distance\", \"useImperialUnits\"]))\n : _createCommentVNode(\"\", true)\n ]),\n (_unref(workout) && _unref(workout).with_gpx)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_14, [\n _createElementVNode(\"img\", {\n class: \"mountains\",\n src: \"/img/workouts/mountains.svg\",\n alt: _ctx.$t('workouts.ELEVATION')\n }, null, 8, _hoisted_15),\n _createElementVNode(\"div\", _hoisted_16, [\n (_unref(workout).id)\n ? (_openBlock(), _createBlock(_component_Distance, {\n key: 0,\n distance: _unref(workout).min_alt,\n unitFrom: \"m\",\n displayUnit: false,\n useImperialUnits: _unref(useImperialUnits)\n }, null, 8, [\"distance\", \"useImperialUnits\"]))\n : _createCommentVNode(\"\", true),\n _createTextVNode(\"/ \"),\n (_unref(workout).id)\n ? (_openBlock(), _createBlock(_component_Distance, {\n key: 1,\n distance: _unref(workout).max_alt,\n unitFrom: \"m\",\n useImperialUnits: _unref(useImperialUnits)\n }, null, 8, [\"distance\", \"useImperialUnits\"]))\n : _createCommentVNode(\"\", true)\n ])\n ]))\n : _createCommentVNode(\"\", true),\n (hasElevation(_unref(workout)))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_17, [\n _hoisted_18,\n _createElementVNode(\"div\", _hoisted_19, [\n _createTextVNode(\" +\"),\n (_unref(workout).id)\n ? (_openBlock(), _createBlock(_component_Distance, {\n key: 0,\n distance: _unref(workout).ascent,\n unitFrom: \"m\",\n displayUnit: false,\n useImperialUnits: _unref(useImperialUnits)\n }, null, 8, [\"distance\", \"useImperialUnits\"]))\n : _createCommentVNode(\"\", true),\n _createTextVNode(\"/- \"),\n (_unref(workout).id)\n ? (_openBlock(), _createBlock(_component_Distance, {\n key: 1,\n distance: _unref(workout).descent,\n unitFrom: \"m\",\n useImperialUnits: _unref(useImperialUnits)\n }, null, 8, [\"distance\", \"useImperialUnits\"]))\n : _createCommentVNode(\"\", true)\n ])\n ]))\n : _createCommentVNode(\"\", true)\n ], 2)\n ])\n ]))\n}\n}\n\n})","import script from \"./WorkoutCard.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./WorkoutCard.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./WorkoutCard.vue?vue&type=style&index=0&id=645a9e33&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-645a9e33\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-35567bf2\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { id: \"timeline\" }\nconst _hoisted_2 = { class: \"section-title\" }\nconst _hoisted_3 = { key: 0 }\nconst _hoisted_4 = { key: 1 }\nconst _hoisted_5 = {\n key: 1,\n class: \"more-workouts\"\n}\n\nimport { ComputedRef, computed, ref, onBeforeMount, toRefs } from 'vue'\n\n import WorkoutCard from '@/components/Workout/WorkoutCard.vue'\n import NoWorkouts from '@/components/Workouts/NoWorkouts.vue'\n import { WORKOUTS_STORE } from '@/store/constants'\n import { ISport } from '@/types/sports'\n import { IUserProfile } from '@/types/user'\n import { IWorkout } from '@/types/workouts'\n import { useStore } from '@/use/useStore'\n import { defaultOrder } from '@/utils/workouts'\n\n interface Props {\n sports: ISport[]\n user: IUserProfile\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'Timeline',\n props: {\n sports: null,\n user: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n sports: ISport[]\n user: IUserProfile\n };\n\n \n\n const store = useStore()\n\n const { sports, user } = toRefs(props)\n const page = ref(1)\n const per_page = 5\n const initWorkoutsCount =\n props.user.nb_workouts >= per_page ? per_page : props.user.nb_workouts\n onBeforeMount(() => loadWorkouts())\n const workouts: ComputedRef = computed(\n () => store.getters[WORKOUTS_STORE.GETTERS.TIMELINE_WORKOUTS]\n )\n const moreWorkoutsExist: ComputedRef = computed(() =>\n workouts.value.length > 0\n ? workouts.value[workouts.value.length - 1].previous_workout !== null\n : false\n )\n\n function loadWorkouts() {\n store.dispatch(WORKOUTS_STORE.ACTIONS.GET_TIMELINE_WORKOUTS, {\n page: page.value,\n per_page,\n ...defaultOrder,\n })\n }\n function loadMoreWorkouts() {\n page.value += 1\n store.dispatch(WORKOUTS_STORE.ACTIONS.GET_MORE_TIMELINE_WORKOUTS, {\n page: page.value,\n per_page,\n ...defaultOrder,\n })\n }\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, _toDisplayString(_ctx.$t('workouts.LATEST_WORKOUTS')), 1),\n (_unref(user).nb_workouts > 0 && _unref(workouts).length === 0)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_3, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList([...Array(_unref(initWorkoutsCount)).keys()], (index) => {\n return (_openBlock(), _createBlock(WorkoutCard, {\n user: _unref(user),\n useImperialUnits: _unref(user).imperial_units,\n key: index\n }, null, 8, [\"user\", \"useImperialUnits\"]))\n }), 128))\n ]))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_4, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(workouts), (workout) => {\n return (_openBlock(), _createBlock(WorkoutCard, {\n workout: workout,\n sport: \n _unref(workouts).length > 0\n ? _unref(sports).filter((s) => s.id === workout.sport_id)[0]\n : null\n ,\n user: _unref(user),\n useImperialUnits: _unref(user).imperial_units,\n key: workout.id\n }, null, 8, [\"workout\", \"sport\", \"user\", \"useImperialUnits\"]))\n }), 128)),\n (_unref(workouts).length === 0)\n ? (_openBlock(), _createBlock(NoWorkouts, { key: 0 }))\n : _createCommentVNode(\"\", true),\n (_unref(moreWorkoutsExist))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_5, [\n _createElementVNode(\"button\", { onClick: loadMoreWorkouts }, _toDisplayString(_ctx.$t('workouts.LOAD_MORE_WORKOUT')), 1)\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n ]))\n}\n}\n\n})","import script from \"./Timeline.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./Timeline.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./Timeline.vue?vue&type=style&index=0&id=35567bf2&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-35567bf2\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode } from \"vue\"\n\nconst _hoisted_1 = [\"title\"]\n\nimport { toRefs } from 'vue'\n\n import { IWorkout } from '@/types/workouts'\n interface Props {\n displayHARecord: boolean\n workout: IWorkout\n sportLabel: string\n sportColor: string | null\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'CalendarWorkout',\n props: {\n displayHARecord: { type: Boolean },\n workout: null,\n sportLabel: null,\n sportColor: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n displayHARecord: boolean\n workout: IWorkout\n sportLabel: string\n sportColor: string | null\n };\n\n \n\n const { displayHARecord, workout, sportLabel, sportColor } = toRefs(props)\n\nreturn (_ctx: any,_cache: any) => {\n const _component_SportImage = _resolveComponent(\"SportImage\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"calendar-workout\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (\n _ctx.$router.push({ name: 'Workout', params: { workoutId: _unref(workout).id } })\n ))\n }, [\n _createVNode(_component_SportImage, {\n \"sport-label\": _unref(sportLabel),\n title: _unref(workout).title,\n color: _unref(sportColor)\n }, null, 8, [\"sport-label\", \"title\", \"color\"]),\n _createElementVNode(\"sup\", null, [\n (_unref(workout).records.length > 0)\n ? (_openBlock(), _createElementBlock(\"i\", {\n key: 0,\n class: \"fa fa-trophy custom-fa-small\",\n \"aria-hidden\": \"true\",\n title: \n _unref(workout).records\n .filter((record) =>\n _unref(displayHARecord) ? true : record.record_type !== 'HA'\n )\n .map((record) => ` ${_ctx.$t(`workouts.RECORD_${record.record_type}`)}`)\n \n }, null, 8, _hoisted_1))\n : _createCommentVNode(\"\", true)\n ])\n ]))\n}\n}\n\n})","import script from \"./CalendarWorkout.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./CalendarWorkout.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./CalendarWorkout.vue?vue&type=style&index=0&id=331e1c8b&lang=scss\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createElementVNode as _createElementVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"donut-chart\" }\nconst _hoisted_2 = {\n height: \"34\",\n width: \"34\",\n viewBox: \"0 0 34 34\"\n}\nconst _hoisted_3 = [\"stroke\", \"stroke-dashoffset\", \"transform\"]\n\nimport { toRefs } from 'vue'\n\n interface Props {\n colors: Record\n datasets: Record>\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'DonutChart',\n props: {\n colors: null,\n datasets: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n colors: Record\n datasets: Record>\n };\n\n \n\n const { colors, datasets } = toRefs(props)\n let angleOffset = -90\n const cx = 16\n const cy = 16\n const radius = 14\n const circumference = 2 * Math.PI * radius\n\n function calculateStrokeDashOffset(\n percentage: number,\n circumference: number\n ): number {\n return circumference - percentage * circumference\n }\n function returnCircleTransformValue(\n index: number,\n percentage: number\n ): string {\n const rotation = `rotate(${angleOffset}, ${cx}, ${cy})`\n angleOffset = percentage * 360 + angleOffset\n return rotation\n }\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(), _createElementBlock(\"svg\", _hoisted_2, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(Object.entries(_unref(datasets)), (data, index) => {\n return (_openBlock(), _createElementBlock(\"g\", { key: index }, [\n _createElementVNode(\"circle\", {\n cx: cx,\n cy: cy,\n r: radius,\n fill: \"transparent\",\n stroke: _unref(colors)[+data[0]],\n \"stroke-dashoffset\": \n calculateStrokeDashOffset(data[1].percentage, circumference)\n ,\n \"stroke-dasharray\": circumference,\n \"stroke-width\": \"3\",\n \"stroke-opacity\": \"0.8\",\n transform: returnCircleTransformValue(index, data[1].percentage)\n }, null, 8, _hoisted_3)\n ]))\n }), 128))\n ]))\n ]))\n}\n}\n\n})","import script from \"./DonutChart.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./DonutChart.vue?vue&type=script&setup=true&lang=ts\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createVNode as _createVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createBlock as _createBlock, resolveDirective as _resolveDirective, withDirectives as _withDirectives, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-52d4310a\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"calendar-workouts-chart\" }\nconst _hoisted_2 = { class: \"workouts-count\" }\nconst _hoisted_3 = {\n key: 0,\n class: \"workouts-pane\"\n}\nconst _hoisted_4 = { class: \"more-workouts\" }\n\nimport { ref, toRefs } from 'vue'\n\n import CalendarWorkout from '@/components/Dashboard/UserCalendar/CalendarWorkout.vue'\n import DonutChart from '@/components/Dashboard/UserCalendar/DonutChart.vue'\n import { ISport } from '@/types/sports'\n import { IWorkout } from '@/types/workouts'\n import { getSportColor, getSportLabel } from '@/utils/sports'\n\n interface Props {\n colors: Record\n datasets: Record>\n sports: ISport[]\n workouts: IWorkout[]\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'CalendarWorkoutsChart',\n props: {\n colors: null,\n datasets: null,\n sports: null,\n workouts: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n colors: Record\n datasets: Record>\n sports: ISport[]\n workouts: IWorkout[]\n };\n\n \n\n const { colors, datasets, sports, workouts } = toRefs(props)\n const isHidden = ref(true)\n\n function togglePane(event: Event & { target: HTMLElement }) {\n event.stopPropagation()\n isHidden.value = !isHidden.value\n }\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_click_outside = _resolveDirective(\"click-outside\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", {\n class: \"workouts-chart\",\n onClick: togglePane\n }, [\n _createElementVNode(\"div\", _hoisted_2, _toDisplayString(_unref(workouts).length), 1),\n _createVNode(DonutChart, {\n datasets: _unref(datasets),\n colors: _unref(colors)\n }, null, 8, [\"datasets\", \"colors\"])\n ]),\n (!isHidden.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_3, [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", _hoisted_4, [\n _createElementVNode(\"i\", {\n class: \"fa fa-times calendar-more\",\n \"aria-hidden\": \"true\",\n onClick: togglePane\n }),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(workouts), (workout, index) => {\n return (_openBlock(), _createBlock(CalendarWorkout, {\n key: index,\n workout: workout,\n sportLabel: _unref(getSportLabel)(workout, _unref(sports)),\n sportColor: _unref(getSportColor)(workout, _unref(sports))\n }, null, 8, [\"workout\", \"sportLabel\", \"sportColor\"]))\n }), 128))\n ])), [\n [_directive_click_outside, togglePane]\n ])\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./CalendarWorkoutsChart.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./CalendarWorkoutsChart.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./CalendarWorkoutsChart.vue?vue&type=style&index=0&id=52d4310a&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-52d4310a\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, createElementVNode as _createElementVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"calendar-workouts\" }\nconst _hoisted_2 = { class: \"desktop-display\" }\nconst _hoisted_3 = {\n key: 0,\n class: \"workouts-display\"\n}\nconst _hoisted_4 = {\n key: 1,\n class: \"donut-display\"\n}\nconst _hoisted_5 = { class: \"mobile-display\" }\nconst _hoisted_6 = {\n key: 0,\n class: \"donut-display\"\n}\n\nimport { computed, toRefs } from 'vue'\n\n import CalendarWorkout from '@/components/Dashboard/UserCalendar/CalendarWorkout.vue'\n import CalendarWorkoutsChart from '@/components/Dashboard/UserCalendar/CalendarWorkoutsChart.vue'\n import { ISport } from '@/types/sports'\n import { IWorkout } from '@/types/workouts'\n import { getSportColor, getSportLabel, sportIdColors } from '@/utils/sports'\n import { getDonutDatasets } from '@/utils/workouts'\n\n interface Props {\n displayHARecord: boolean\n workouts: IWorkout[]\n sports: ISport[]\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'CalendarWorkouts',\n props: {\n displayHARecord: { type: Boolean },\n workouts: null,\n sports: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n displayHARecord: boolean\n workouts: IWorkout[]\n sports: ISport[]\n };\n\n \n\n const { displayHARecord, workouts, sports } = toRefs(props)\n const chartDatasets = computed(() => getDonutDatasets(props.workouts))\n const colors = computed(() => sportIdColors(props.sports))\n const displayedWorkoutCount = 6\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_unref(workouts).length <= displayedWorkoutCount)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_3, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(workouts).slice(0, displayedWorkoutCount), (workout, index) => {\n return (_openBlock(), _createBlock(CalendarWorkout, {\n key: index,\n displayHARecord: _unref(displayHARecord),\n workout: workout,\n sportLabel: _unref(getSportLabel)(workout, _unref(sports)),\n sportColor: _unref(getSportColor)(workout, _unref(sports))\n }, null, 8, [\"displayHARecord\", \"workout\", \"sportLabel\", \"sportColor\"]))\n }), 128))\n ]))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_4, [\n _createVNode(CalendarWorkoutsChart, {\n workouts: _unref(workouts),\n sports: _unref(sports),\n datasets: _unref(chartDatasets),\n colors: _unref(colors)\n }, null, 8, [\"workouts\", \"sports\", \"datasets\", \"colors\"])\n ]))\n ]),\n _createElementVNode(\"div\", _hoisted_5, [\n (_unref(workouts).length > 0)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_6, [\n _createVNode(CalendarWorkoutsChart, {\n workouts: _unref(workouts),\n sports: _unref(sports),\n datasets: _unref(chartDatasets),\n colors: _unref(colors)\n }, null, 8, [\"workouts\", \"sports\", \"datasets\", \"colors\"])\n ]))\n : _createCommentVNode(\"\", true)\n ])\n ]))\n}\n}\n\n})","import script from \"./CalendarWorkouts.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./CalendarWorkouts.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./CalendarWorkouts.vue?vue&type=style&index=0&id=5aab7455&lang=scss\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, unref as _unref, createVNode as _createVNode, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass } from \"vue\"\n\nconst _hoisted_1 = { class: \"calendar-cells\" }\nconst _hoisted_2 = { class: \"calendar-cell-day\" }\n\nimport { addDays, format, isSameDay, isSameMonth, isToday } from 'date-fns'\n import { Ref, ref, toRefs, watch, onMounted } from 'vue'\n\n import CalendarWorkouts from '@/components/Dashboard/UserCalendar/CalendarWorkouts.vue'\n import { ISport } from '@/types/sports'\n import { IWorkout } from '@/types/workouts'\n import { getDateWithTZ } from '@/utils/dates'\n\n interface Props {\n currentDay: Date\n displayHARecord: boolean\n endDate: Date\n sports: ISport[]\n startDate: Date\n timezone: string\n weekStartingMonday: boolean\n workouts: IWorkout[]\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'CalendarCells',\n props: {\n currentDay: null,\n displayHARecord: { type: Boolean },\n endDate: null,\n sports: null,\n startDate: null,\n timezone: null,\n weekStartingMonday: { type: Boolean },\n workouts: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n currentDay: Date\n displayHARecord: boolean\n endDate: Date\n sports: ISport[]\n startDate: Date\n timezone: string\n weekStartingMonday: boolean\n workouts: IWorkout[]\n };\n\n \n\n const {\n currentDay,\n displayHARecord,\n endDate,\n sports,\n startDate,\n timezone,\n weekStartingMonday,\n workouts,\n } = toRefs(props)\n const rows: Ref = ref([])\n\n onMounted(() => getDays())\n\n function getDays() {\n rows.value = []\n let day = startDate.value\n while (day <= endDate.value) {\n const days: Date[] = []\n for (let i = 0; i < 7; i++) {\n days.push(day)\n day = addDays(day, 1)\n }\n rows.value.push(days)\n }\n }\n function isWeekEnd(day: number): boolean {\n return weekStartingMonday.value\n ? [5, 6].includes(day)\n : [0, 6].includes(day)\n }\n function filterWorkouts(day: Date, workouts: IWorkout[]) {\n if (workouts) {\n return workouts\n .filter((workout) =>\n isSameDay(getDateWithTZ(workout.workout_date, timezone.value), day)\n )\n .reverse()\n }\n return []\n }\n\n watch(\n () => props.currentDay,\n () => getDays()\n )\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(rows.value, (row, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"calendar-row\",\n key: index\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(row, (day, i) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"calendar-cell\", {\n 'disabled-cell': !_unref(isSameMonth)(day, _unref(currentDay)),\n 'week-end': isWeekEnd(i),\n today: _unref(isToday)(day),\n }]),\n key: i\n }, [\n _createVNode(CalendarWorkouts, {\n workouts: filterWorkouts(day, _unref(workouts)),\n sports: _unref(sports),\n displayHARecord: _unref(displayHARecord)\n }, null, 8, [\"workouts\", \"sports\", \"displayHARecord\"]),\n _createElementVNode(\"div\", _hoisted_2, _toDisplayString(_unref(format)(day, 'd')), 1)\n ], 2))\n }), 128))\n ]))\n }), 128))\n ]))\n}\n}\n\n})","import script from \"./CalendarCells.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./CalendarCells.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./CalendarCells.vue?vue&type=style&index=0&id=34b99f0e&lang=scss\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, unref as _unref, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"calendar-days\" }\n\nimport { Locale, format, addDays } from 'date-fns'\n\n interface Props {\n startDate: Date\n localeOptions: Locale\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'CalendarDays',\n props: {\n startDate: null,\n localeOptions: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n startDate: Date\n localeOptions: Locale\n };\n\n \n\n const days = []\n for (let i = 0; i < 7; i++) {\n days.push(addDays(props.startDate, i))\n }\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(days, (day, index) => {\n return _createElementVNode(\"div\", {\n class: \"calendar-day\",\n key: index\n }, _toDisplayString(_unref(format)(day, 'EEE', { locale: __props.localeOptions })), 1)\n }), 64))\n ]))\n}\n}\n\n})","import script from \"./CalendarDays.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./CalendarDays.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./CalendarDays.vue?vue&type=style&index=0&id=4f3dc99e&lang=scss\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, unref as _unref, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"calendar-header\" }\nconst _hoisted_2 = /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-chevron-left\",\n \"aria-hidden\": \"true\"\n}, null, -1)\nconst _hoisted_3 = [\n _hoisted_2\n]\nconst _hoisted_4 = { class: \"calendar-month\" }\nconst _hoisted_5 = /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-chevron-right\",\n \"aria-hidden\": \"true\"\n}, null, -1)\nconst _hoisted_6 = [\n _hoisted_5\n]\n\nimport { Locale, format } from 'date-fns'\n import { toRefs } from 'vue'\n\n interface Props {\n day: Date\n localeOptions: Locale\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'CalendarHeader',\n props: {\n day: null,\n localeOptions: null\n },\n emits: ['displayNextMonth', 'displayPreviousMonth'],\n setup(__props: any, { emit }) {\n\nconst props = __props as {\n day: Date\n localeOptions: Locale\n };\n\n \n\n \n\n const { day, localeOptions } = toRefs(props)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", {\n class: \"calendar-arrow calendar-arrow-left\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (emit('displayPreviousMonth')))\n }, _hoisted_3),\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"span\", null, _toDisplayString(_unref(format)(_unref(day), 'MMM yyyy', { locale: _unref(localeOptions) })), 1)\n ]),\n _createElementVNode(\"div\", {\n class: \"calendar-arrow calendar-arrow-right\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (emit('displayNextMonth')))\n }, _hoisted_6)\n ]))\n}\n}\n\n})","import script from \"./CalendarHeader.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./CalendarHeader.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./CalendarHeader.vue?vue&type=style&index=0&id=79a65a70&lang=scss\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { id: \"user-calendar\" }\nconst _hoisted_2 = { class: \"calendar-card box\" }\n\nimport { Locale, addMonths, format, subMonths } from 'date-fns'\n import { ComputedRef, computed, ref, toRefs, onBeforeMount } from 'vue'\n\n import CalendarCells from '@/components/Dashboard/UserCalendar/CalendarCells.vue'\n import CalendarDays from '@/components/Dashboard/UserCalendar/CalendarDays.vue'\n import CalendarHeader from '@/components/Dashboard/UserCalendar/CalendarHeader.vue'\n import { ROOT_STORE, WORKOUTS_STORE } from '@/store/constants'\n import { ISport } from '@/types/sports'\n import { IAuthUserProfile } from '@/types/user'\n import { IWorkout, TWorkoutsPayload } from '@/types/workouts'\n import { useStore } from '@/use/useStore'\n import { getCalendarStartAndEnd } from '@/utils/dates'\n import { defaultOrder } from '@/utils/workouts'\n\n interface Props {\n sports: ISport[]\n user: IAuthUserProfile\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n sports: null,\n user: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n sports: ISport[]\n user: IAuthUserProfile\n };\n\n \n\n const store = useStore()\n\n const { sports, user } = toRefs(props)\n const dateFormat = 'yyyy-MM-dd'\n const day = ref(new Date())\n const calendarDates = ref(getCalendarStartAndEnd(day.value, props.user.weekm))\n const calendarWorkouts: ComputedRef = computed(\n () => store.getters[WORKOUTS_STORE.GETTERS.CALENDAR_WORKOUTS]\n )\n const localeOptions: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.LOCALE]\n )\n\n onBeforeMount(() => getCalendarWorkouts())\n\n function getCalendarWorkouts() {\n calendarDates.value = getCalendarStartAndEnd(day.value, props.user.weekm)\n const apiParams: TWorkoutsPayload = {\n from: format(calendarDates.value.start, dateFormat),\n to: format(calendarDates.value.end, dateFormat),\n page: 1,\n per_page: 100,\n ...defaultOrder,\n }\n store.dispatch(WORKOUTS_STORE.ACTIONS.GET_CALENDAR_WORKOUTS, apiParams)\n }\n function displayNextMonth() {\n day.value = addMonths(day.value, 1)\n getCalendarWorkouts()\n }\n function displayPreviousMonth() {\n day.value = subMonths(day.value, 1)\n getCalendarWorkouts()\n }\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(CalendarHeader, {\n day: day.value,\n \"locale-options\": _unref(localeOptions),\n onDisplayNextMonth: displayNextMonth,\n onDisplayPreviousMonth: displayPreviousMonth\n }, null, 8, [\"day\", \"locale-options\"]),\n _createVNode(CalendarDays, {\n \"start-date\": calendarDates.value.start,\n \"locale-options\": _unref(localeOptions)\n }, null, 8, [\"start-date\", \"locale-options\"]),\n _createVNode(CalendarCells, {\n currentDay: day.value,\n displayHARecord: _unref(user).display_ascent,\n \"end-date\": calendarDates.value.end,\n sports: _unref(sports),\n \"start-date\": calendarDates.value.start,\n timezone: _unref(user).timezone,\n workouts: _unref(calendarWorkouts),\n weekStartingMonday: _unref(user).weekm\n }, null, 8, [\"currentDay\", \"displayHARecord\", \"end-date\", \"sports\", \"start-date\", \"timezone\", \"workouts\", \"weekStartingMonday\"])\n ])\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./index.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./index.vue?vue&type=style&index=0&id=3e7444d9&lang=scss\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, unref as _unref, createVNode as _createVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-1bcddc12\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"user-month-stats\" }\n\nimport { endOfMonth, startOfMonth } from 'date-fns'\n import { toRefs } from 'vue'\n\n import StatChart from '@/components/Common/StatsChart/index.vue'\n import { ISport } from '@/types/sports'\n import { IUserProfile } from '@/types/user'\n\n interface Props {\n sports: ISport[]\n user: IUserProfile\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'UserMonthStats',\n props: {\n sports: null,\n user: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n sports: ISport[]\n user: IUserProfile\n };\n\n \n\n const { sports, user } = toRefs(props)\n const date = new Date()\n const chartParams = {\n duration: 'week',\n start: startOfMonth(date),\n end: endOfMonth(date),\n }\n const selectedSportIds = props.sports.map((sport) => sport.id)\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Card = _resolveComponent(\"Card\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_Card, null, {\n title: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('dashboard.THIS_MONTH')), 1)\n ]),\n content: _withCtx(() => [\n _createVNode(StatChart, {\n sports: _unref(sports),\n user: _unref(user),\n \"chart-params\": chartParams,\n \"displayed-sport-ids\": _unref(selectedSportIds),\n \"hide-chart-if-no-data\": true\n }, null, 8, [\"sports\", \"user\", \"displayed-sport-ids\"])\n ]),\n _: 1\n })\n ]))\n}\n}\n\n})","import script from \"./UserMonthStats.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./UserMonthStats.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./UserMonthStats.vue?vue&type=style&index=0&id=1bcddc12&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-1bcddc12\"]])\n\nexport default __exports__","import createI18n from '@/i18n'\nimport { ITranslatedSport } from '@/types/sports'\nimport { TUnit } from '@/types/units'\nimport { ICardRecord, IRecord, IRecordsBySports } from '@/types/workouts'\nimport { formatDate, getDateFormat } from '@/utils/dates'\nimport { convertDistance, units } from '@/utils/units'\n\nconst { locale } = createI18n.global\n\nexport const formatRecord = (\n record: IRecord,\n tz: string,\n useImperialUnits: boolean,\n date_format: string\n): Record => {\n const distanceUnitFrom: TUnit = 'km'\n const distanceUnitTo: TUnit = useImperialUnits\n ? units[distanceUnitFrom].defaultTarget\n : distanceUnitFrom\n const ascentUnitFrom: TUnit = 'm'\n const ascentUnitTo: TUnit = useImperialUnits\n ? units[ascentUnitFrom].defaultTarget\n : ascentUnitFrom\n let value\n switch (record.record_type) {\n case 'AS':\n case 'MS':\n value = `${convertDistance(\n +record.value,\n distanceUnitFrom,\n distanceUnitTo,\n 2\n )} ${distanceUnitTo}/h`\n break\n case 'FD':\n value = `${convertDistance(\n +record.value,\n distanceUnitFrom,\n distanceUnitTo,\n 3\n )} ${distanceUnitTo}`\n break\n case 'HA':\n value = `${convertDistance(\n +record.value,\n ascentUnitFrom,\n ascentUnitTo,\n 2\n )} ${ascentUnitTo}`\n break\n case 'LD':\n value = record.value\n break\n default:\n throw new Error(\n `Invalid record type, expected: \"AS\", \"FD\", \"HA\", \"LD\", \"MD\", got: \"${record.record_type}\"`\n )\n }\n return {\n workout_date: formatDate(record.workout_date, tz, date_format, false),\n workout_id: record.workout_id,\n id: record.id,\n record_type: record.record_type,\n value: value,\n }\n}\n\nexport const sortRecords = (a: ICardRecord, b: ICardRecord): number => {\n const recordALabel = a.label.toLowerCase()\n const recordBLabel = b.label.toLowerCase()\n return recordALabel > recordBLabel ? 1 : recordALabel < recordBLabel ? -1 : 0\n}\n\nexport const getRecordsBySports = (\n records: IRecord[],\n translatedSports: ITranslatedSport[],\n tz: string,\n useImperialUnits: boolean,\n display_ascent: boolean,\n date_format: string\n): IRecordsBySports => {\n date_format = getDateFormat(date_format, locale.value)\n return records\n .filter((r) => (display_ascent ? true : r.record_type !== 'HA'))\n .reduce((sportList: IRecordsBySports, record) => {\n const sport = translatedSports.find((s) => s.id === record.sport_id)\n if (sport && sport.label) {\n if (sportList[sport.translatedLabel] === void 0) {\n sportList[sport.translatedLabel] = {\n label: sport.label,\n color: sport.color,\n records: [],\n }\n }\n sportList[sport.translatedLabel].records.push(\n formatRecord(record, tz, useImperialUnits, date_format)\n )\n }\n return sportList\n }, {})\n}\n","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, createVNode as _createVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createElementVNode as _createElementVNode, withCtx as _withCtx, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-8d17c606\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"records-card\" }\nconst _hoisted_2 = { class: \"record-type\" }\nconst _hoisted_3 = { class: \"record-value\" }\nconst _hoisted_4 = { class: \"record-date\" }\n\nimport { toRefs } from 'vue'\n import { useI18n } from 'vue-i18n'\n\n import { ICardRecord, IRecord, IRecordsBySports } from '@/types/workouts'\n import { sortRecords } from '@/utils/records'\n\n interface Props {\n records: IRecordsBySports\n sportTranslatedLabel: string\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'RecordsCard',\n props: {\n records: null,\n sportTranslatedLabel: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n records: IRecordsBySports\n sportTranslatedLabel: string\n };\n\n \n\n const { records, sportTranslatedLabel } = toRefs(props)\n\n const { t } = useI18n()\n\n function getTranslatedRecords(records: IRecord[]): ICardRecord[] {\n const translatedRecords: ICardRecord[] = []\n records.map((record) => {\n translatedRecords.push({\n ...record,\n label: t(`workouts.RECORD_${record.record_type}`),\n })\n })\n return translatedRecords.sort(sortRecords)\n }\n\nreturn (_ctx: any,_cache: any) => {\n const _component_SportImage = _resolveComponent(\"SportImage\")!\n const _component_router_link = _resolveComponent(\"router-link\")!\n const _component_Card = _resolveComponent(\"Card\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_Card, null, {\n title: _withCtx(() => [\n _createVNode(_component_SportImage, {\n \"sport-label\": _unref(records).label,\n color: _unref(records).color\n }, null, 8, [\"sport-label\", \"color\"]),\n _createTextVNode(\" \" + _toDisplayString(_unref(sportTranslatedLabel)), 1)\n ]),\n content: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(getTranslatedRecords(_unref(records).records), (record) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"record\",\n key: record.id\n }, [\n _createElementVNode(\"span\", _hoisted_2, _toDisplayString(record.label), 1),\n _createElementVNode(\"span\", _hoisted_3, _toDisplayString(record.value), 1),\n _createElementVNode(\"span\", _hoisted_4, [\n _createVNode(_component_router_link, {\n to: {\n name: 'Workout',\n params: { workoutId: record.workout_id },\n }\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(record.workout_date), 1)\n ]),\n _: 2\n }, 1032, [\"to\"])\n ])\n ]))\n }), 128))\n ]),\n _: 1\n })\n ]))\n}\n}\n\n})","import script from \"./RecordsCard.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./RecordsCard.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./RecordsCard.vue?vue&type=style&index=0&id=8d17c606&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-8d17c606\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, unref as _unref, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-f0c85cb8\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"user-records-section\" }\nconst _hoisted_2 = { class: \"section-title\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-trophy custom-fa-small\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_4 = { class: \"user-records\" }\nconst _hoisted_5 = {\n key: 0,\n class: \"no-records\"\n}\n\nimport { computed } from 'vue'\n import { useI18n } from 'vue-i18n'\n\n import RecordsCard from '@/components/Dashboard/UserRecords/RecordsCard.vue'\n import { ISport } from '@/types/sports'\n import { IAuthUserProfile } from '@/types/user'\n import { getRecordsBySports } from '@/utils/records'\n import { translateSports } from '@/utils/sports'\n\n interface Props {\n sports: ISport[]\n user: IAuthUserProfile\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n sports: null,\n user: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n sports: ISport[]\n user: IAuthUserProfile\n };\n\n \n\n const { t } = useI18n()\n\n const recordsBySport = computed(() =>\n getRecordsBySports(\n props.user.records,\n translateSports(props.sports, t),\n props.user.timezone,\n props.user.imperial_units,\n props.user.display_ascent,\n props.user.date_format\n )\n )\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _hoisted_3,\n _createTextVNode(\" \" + _toDisplayString(_ctx.$t('workouts.RECORD', 2)), 1)\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n (Object.keys(_unref(recordsBySport)).length === 0)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_5, _toDisplayString(_ctx.$t('workouts.NO_RECORDS')), 1))\n : _createCommentVNode(\"\", true),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(Object.keys(_unref(recordsBySport)).sort(), (sportTranslatedLabel) => {\n return (_openBlock(), _createBlock(RecordsCard, {\n sportTranslatedLabel: sportTranslatedLabel,\n records: _unref(recordsBySport)[sportTranslatedLabel],\n key: sportTranslatedLabel,\n useImperialUnits: __props.user.imperial_units\n }, null, 8, [\"sportTranslatedLabel\", \"records\", \"useImperialUnits\"]))\n }), 128))\n ])\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./index.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./index.vue?vue&type=style&index=0&id=f0c85cb8&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-f0c85cb8\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { id: \"user-stats\" }\n\nimport { ComputedRef, computed, toRefs } from 'vue'\n import { useI18n } from 'vue-i18n'\n\n import StatCard from '@/components/Common/StatCard.vue'\n import { TUnit } from '@/types/units'\n import { IAuthUserProfile } from '@/types/user'\n import { convertDistance, units } from '@/utils/units'\n interface Props {\n user: IAuthUserProfile\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n user: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n user: IAuthUserProfile\n };\n\n \n\n const { t } = useI18n()\n\n const { user } = toRefs(props)\n const userTotalDuration: ComputedRef = computed(\n () => props.user.total_duration\n )\n const totalDuration = computed(() => get_duration(userTotalDuration))\n const distanceUnitFrom: TUnit = 'km'\n const distanceUnitTo: TUnit = user.value.imperial_units\n ? units[distanceUnitFrom].defaultTarget\n : distanceUnitFrom\n const totalDistance: ComputedRef = computed(() =>\n user.value.imperial_units\n ? convertDistance(user.value.total_distance, distanceUnitFrom, distanceUnitTo, 2)\n : parseFloat(user.value.total_distance.toFixed(2)))\n const ascentUnitFrom: TUnit = 'm'\n const ascentUnitTo: TUnit = user.value.imperial_units\n ? units[ascentUnitFrom].defaultTarget\n : ascentUnitFrom\n const totalAscent: ComputedRef = computed(() =>\n user.value.imperial_units\n ? convertDistance(user.value.total_ascent, ascentUnitFrom, ascentUnitTo, 2)\n : parseFloat(user.value.total_ascent.toFixed(2)))\n\n\n function get_duration(total_duration: ComputedRef) {\n const duration = total_duration.value.match(/day/g)\n ? total_duration.value.split(', ')[1]\n : total_duration.value\n return {\n days: total_duration.value.match(/day/g)\n ? `${total_duration.value.split(' ')[0]} ${\n total_duration.value.match(/days/g)\n ? t('common.DAY', 2)\n : t('common.DAY', 1)\n }`\n : `0 ${t('common.DAY', 2)},`,\n duration: `${duration.split(':')[0]}h ${duration.split(':')[1]}min`,\n }\n }\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(StatCard, {\n icon: \"calendar\",\n value: _unref(user).nb_workouts,\n text: _ctx.$t('workouts.WORKOUT', _unref(user).nb_workouts)\n }, null, 8, [\"value\", \"text\"]),\n _createVNode(StatCard, {\n icon: \"road\",\n value: _unref(totalDistance),\n text: _unref(distanceUnitTo) === 'mi' ? 'miles' : _unref(distanceUnitTo)\n }, null, 8, [\"value\", \"text\"]),\n (_unref(user).display_ascent)\n ? (_openBlock(), _createBlock(StatCard, {\n key: 0,\n icon: \"location-arrow\",\n value: _unref(totalAscent),\n text: _unref(ascentUnitTo) === 'ft' ? 'feet' : _unref(ascentUnitTo)\n }, null, 8, [\"value\", \"text\"]))\n : _createCommentVNode(\"\", true),\n _createVNode(StatCard, {\n icon: \"clock-o\",\n value: _unref(totalDuration).days,\n text: _unref(totalDuration).duration\n }, null, 8, [\"value\", \"text\"]),\n (!_unref(user).display_ascent)\n ? (_openBlock(), _createBlock(StatCard, {\n key: 1,\n icon: \"tags\",\n value: _unref(user).nb_sports,\n text: _ctx.$t('workouts.SPORT', _unref(user).nb_sports)\n }, null, 8, [\"value\", \"text\"]))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./index.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./index.vue?vue&type=style&index=0&id=22dcb990&lang=scss\"\n\nconst __exports__ = script;\n\nexport default __exports__","\n\n\n\n\n","import { render } from \"./PrivacyPolicyToAccept.vue?vue&type=template&id=05532ad6&scoped=true\"\nconst script = {}\n\nimport \"./PrivacyPolicyToAccept.vue?vue&type=style&index=0&id=05532ad6&scoped=true&lang=scss\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-05532ad6\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-40886688\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n key: 0,\n id: \"dashboard\",\n class: \"view\"\n}\nconst _hoisted_2 = { class: \"container mobile-menu\" }\nconst _hoisted_3 = { class: \"box\" }\nconst _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-calendar\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_5 = [\n _hoisted_4\n]\nconst _hoisted_6 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-bar-chart\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_7 = [\n _hoisted_6\n]\nconst _hoisted_8 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-map-o\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_9 = [\n _hoisted_8\n]\nconst _hoisted_10 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-trophy\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_11 = [\n _hoisted_10\n]\nconst _hoisted_12 = {\n key: 0,\n class: \"container privacy-policy-message\"\n}\nconst _hoisted_13 = { class: \"container\" }\nconst _hoisted_14 = { class: \"container dashboard-container\" }\nconst _hoisted_15 = { class: \"left-container dashboard-sub-container\" }\nconst _hoisted_16 = { class: \"right-container dashboard-sub-container\" }\nconst _hoisted_17 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { id: \"bottom\" }, null, -1))\nconst _hoisted_18 = {\n key: 1,\n class: \"app-loading\"\n}\n\nimport { ComputedRef, Ref, computed, onBeforeMount, ref } from 'vue'\n\n import Timeline from '@/components/Dashboard/Timeline.vue'\n import UserCalendar from '@/components/Dashboard/UserCalendar/index.vue'\n import UserMonthStats from '@/components/Dashboard/UserMonthStats.vue'\n import UserRecords from '@/components/Dashboard/UserRecords/index.vue'\n import UserStatsCards from '@/components/Dashboard/UserStatsCards/index.vue'\n import PrivacyPolicyToAccept from '@/components/PrivacyPolicyToAccept.vue'\n import { AUTH_USER_STORE, SPORTS_STORE } from '@/store/constants'\n import { ISport } from '@/types/sports'\n import { IAuthUserProfile } from '@/types/user'\n import { useStore } from '@/use/useStore'\n\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'Dashboard',\n setup(__props) {\n\n const store = useStore()\n\n const authUser: ComputedRef = computed(\n () => store.getters[AUTH_USER_STORE.GETTERS.AUTH_USER_PROFILE]\n )\n const sports: ComputedRef = computed(\n () => store.getters[SPORTS_STORE.GETTERS.SPORTS]\n )\n const isSelected: Ref = ref('calendar')\n\n onBeforeMount(() => store.dispatch(AUTH_USER_STORE.ACTIONS.GET_USER_PROFILE))\n\n function updateDisplayColumn(target: string) {\n isSelected.value = target\n }\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Loader = _resolveComponent(\"Loader\")!\n\n return (_unref(authUser).username && _unref(sports).length > 0)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"mobile-menu-item\", { 'is-selected': isSelected.value === 'calendar' }]),\n onClick: _cache[0] || (_cache[0] = ($event: any) => (updateDisplayColumn('calendar')))\n }, _hoisted_5, 2),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"mobile-menu-item\", { 'is-selected': isSelected.value === 'chart' }]),\n onClick: _cache[1] || (_cache[1] = ($event: any) => (updateDisplayColumn('chart')))\n }, _hoisted_7, 2),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"mobile-menu-item\", { 'is-selected': isSelected.value === 'timeline' }]),\n onClick: _cache[2] || (_cache[2] = ($event: any) => (updateDisplayColumn('timeline')))\n }, _hoisted_9, 2),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"mobile-menu-item\", { 'is-selected': isSelected.value === 'records' }]),\n onClick: _cache[3] || (_cache[3] = ($event: any) => (updateDisplayColumn('records')))\n }, _hoisted_11, 2)\n ])\n ]),\n (!_unref(authUser).accepted_privacy_policy)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_12, [\n _createVNode(PrivacyPolicyToAccept)\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_13, [\n _createVNode(UserStatsCards, { user: _unref(authUser) }, null, 8, [\"user\"])\n ]),\n _createElementVNode(\"div\", _hoisted_14, [\n _createElementVNode(\"div\", _hoisted_15, [\n _createVNode(UserMonthStats, {\n sports: _unref(sports),\n user: _unref(authUser),\n class: _normalizeClass({ 'is-hidden': !(isSelected.value === 'chart') })\n }, null, 8, [\"sports\", \"user\", \"class\"]),\n _createVNode(UserRecords, {\n sports: _unref(sports),\n user: _unref(authUser),\n class: _normalizeClass({ 'is-hidden': !(isSelected.value === 'records') })\n }, null, 8, [\"sports\", \"user\", \"class\"])\n ]),\n _createElementVNode(\"div\", _hoisted_16, [\n _createVNode(UserCalendar, {\n sports: _unref(sports),\n user: _unref(authUser),\n class: _normalizeClass({ 'is-hidden': !(isSelected.value === 'calendar') })\n }, null, 8, [\"sports\", \"user\", \"class\"]),\n _createVNode(Timeline, {\n sports: _unref(sports),\n user: _unref(authUser),\n class: _normalizeClass({ 'is-hidden': !(isSelected.value === 'timeline') })\n }, null, 8, [\"sports\", \"user\", \"class\"])\n ])\n ]),\n _hoisted_17\n ]))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_18, [\n _createVNode(_component_Loader)\n ]))\n}\n}\n\n})","import script from \"./Dashboard.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./Dashboard.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./Dashboard.vue?vue&type=style&index=0&id=40886688&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-40886688\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"not-found view\" }\n\nimport NotFound from '@/components/Common/NotFound.vue'\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'NotFoundView',\n setup(__props) {\n\n \nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(NotFound)\n ]))\n}\n}\n\n})","import script from \"./NotFoundView.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./NotFoundView.vue?vue&type=script&setup=true&lang=ts\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = {\n id: \"privacy-policy\",\n class: \"view\"\n}\nconst _hoisted_2 = { class: \"container\" }\nconst _hoisted_3 = /*#__PURE__*/_createElementVNode(\"div\", { id: \"bottom\" }, null, -1)\n\nimport { onBeforeMount } from 'vue'\n\n import PrivacyPolicy from '@/components/PrivacyPolicy.vue'\n import { ROOT_STORE } from '@/store/constants'\n import { useStore } from '@/use/useStore'\n\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'PrivacyPolicyView',\n setup(__props) {\n\n const store = useStore()\n\n onBeforeMount(() => {\n store.dispatch(ROOT_STORE.ACTIONS.GET_APPLICATION_PRIVACY_POLICY)\n })\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(PrivacyPolicy)\n ]),\n _hoisted_3\n ]))\n}\n}\n\n})","import script from \"./PrivacyPolicyView.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./PrivacyPolicyView.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, createElementVNode as _createElementVNode, unref as _unref, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-58043acb\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n id: \"loginOrRegister\",\n class: \"view\"\n}\nconst _hoisted_2 = { class: \"container\" }\nconst _hoisted_3 = { class: \"container-sub\" }\nconst _hoisted_4 = { class: \"container-sub\" }\n\nimport { toRefs } from 'vue'\n\n import BikePic from '@/components/BikePic.vue'\n import LoginOrRegisterForm from '@/components/User/UserAuthForm.vue'\n\n interface Props {\n action: string\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'LoginOrRegister',\n props: {\n action: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n action: string\n };\n\n \n\n const { action } = toRefs(props)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(BikePic)\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n _createVNode(LoginOrRegisterForm, { action: _unref(action) }, null, 8, [\"action\"])\n ])\n ])\n ]))\n}\n}\n\n})","import script from \"./LoginOrRegister.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./LoginOrRegister.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./LoginOrRegister.vue?vue&type=style&index=0&id=58043acb&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-58043acb\"]])\n\nexport default __exports__","import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'\n\nimport AdminApplication from '@/components/Administration/AdminApplication.vue'\nimport AdminMenu from '@/components/Administration/AdminMenu.vue'\nimport AdminSports from '@/components/Administration/AdminSports.vue'\nimport AdminUsers from '@/components/Administration/AdminUsers.vue'\nimport Profile from '@/components/User/ProfileDisplay/index.vue'\nimport UserInfos from '@/components/User/ProfileDisplay/UserInfos.vue'\nimport UserPreferences from '@/components/User/ProfileDisplay/UserPreferences.vue'\nimport ProfileEdition from '@/components/User/ProfileEdition/index.vue'\nimport UserAccountEdition from '@/components/User/ProfileEdition/UserAccountEdition.vue'\nimport UserInfosEdition from '@/components/User/ProfileEdition/UserInfosEdition.vue'\nimport UserPictureEdition from '@/components/User/ProfileEdition/UserPictureEdition.vue'\nimport UserPreferencesEdition from '@/components/User/ProfileEdition/UserPreferencesEdition.vue'\nimport UserPrivacyPolicyValidation from '@/components/User/ProfileEdition/UserPrivacyPolicyValidation.vue'\nimport AddUserApp from '@/components/User/UserApps/AddUserApp.vue'\nimport AuthorizeUserApp from '@/components/User/UserApps/AuthorizeUserApp.vue'\nimport UserApps from '@/components/User/UserApps/index.vue'\nimport UserApp from '@/components/User/UserApps/UserApp.vue'\nimport UserAppsList from '@/components/User/UserApps/UserAppsList.vue'\nimport UserSportPreferences from '@/components/User/UserSportPreferences.vue'\nimport store from '@/store'\nimport { AUTH_USER_STORE } from '@/store/constants'\nimport AboutView from '@/views/AboutView.vue'\nimport Dashboard from '@/views/Dashboard.vue'\nimport NotFoundView from '@/views/NotFoundView.vue'\nimport PrivacyPolicyView from '@/views/PrivacyPolicyView.vue'\nimport LoginOrRegister from '@/views/user/LoginOrRegister.vue'\n\nconst getTabFromPath = (path: string): string => {\n const regex = /(\\/profile)(\\/edit)*(\\/*)/\n const tag = path.replace(regex, '').toUpperCase()\n return tag === '' ? 'PROFILE' : tag.toUpperCase()\n}\n\nconst routes: Array = [\n {\n path: '/',\n name: 'Dashboard',\n component: Dashboard,\n },\n {\n path: '/login',\n name: 'Login',\n component: LoginOrRegister,\n props: { action: 'login' },\n },\n {\n path: '/register',\n name: 'Register',\n component: LoginOrRegister,\n props: { action: 'register' },\n },\n {\n path: '/account-confirmation',\n name: 'AccountConfirmation',\n component: () =>\n import(\n /* webpackChunkName: 'profile' */ '@/views/user/AccountConfirmationView.vue'\n ),\n },\n {\n path: '/account-confirmation/resend',\n name: 'AccountConfirmationResend',\n component: () =>\n import(\n /* webpackChunkName: 'reset' */ '@/views/user/AccountConfirmationResendView.vue'\n ),\n props: { action: 'account-confirmation-resend' },\n },\n {\n path: '/account-confirmation/email-sent',\n name: 'AccountConfirmationEmailSend',\n component: () =>\n import(\n /* webpackChunkName: 'reset' */ '@/views/user/AccountConfirmationResendView.vue'\n ),\n props: { action: 'email-sent' },\n },\n {\n path: '/password-reset/sent',\n name: 'PasswordEmailSent',\n component: () =>\n import(\n /* webpackChunkName: 'reset' */ '@/views/user/PasswordResetView.vue'\n ),\n props: { action: 'request-sent' },\n },\n {\n path: '/password-reset/request',\n name: 'PasswordResetRequest',\n component: () =>\n import(\n /* webpackChunkName: 'reset' */ '@/views/user/PasswordResetView.vue'\n ),\n props: { action: 'reset-request' },\n },\n {\n path: '/password-reset/password-updated',\n name: 'PasswordUpdated',\n component: () =>\n import(\n /* webpackChunkName: 'reset' */ '@/views/user/PasswordResetView.vue'\n ),\n props: { action: 'password-updated' },\n },\n {\n path: '/password-reset',\n name: 'PasswordReset',\n component: () =>\n import(\n /* webpackChunkName: 'reset' */ '@/views/user/PasswordResetView.vue'\n ),\n props: { action: 'reset' },\n },\n {\n path: '/email-update',\n name: 'EmailUpdate',\n component: () =>\n import(\n /* webpackChunkName: 'profile' */ '@/views/user/EmailUpdateView.vue'\n ),\n },\n {\n path: '/profile',\n name: 'Profile',\n component: () =>\n import(/* webpackChunkName: 'profile' */ '@/views/user/ProfileView.vue'),\n children: [\n {\n path: '',\n name: 'UserProfile',\n component: Profile,\n props: (route) => ({\n tab: getTabFromPath(route.path),\n }),\n children: [\n {\n path: '',\n name: 'UserInfos',\n component: UserInfos,\n },\n {\n path: 'preferences',\n name: 'UserPreferences',\n component: UserPreferences,\n },\n {\n path: 'sports',\n name: 'UserSportPreferences',\n component: UserSportPreferences,\n props: { isEdition: false },\n },\n {\n path: 'apps',\n name: 'UserApps',\n component: UserApps,\n children: [\n {\n path: '',\n name: 'UserAppsList',\n component: UserAppsList,\n },\n {\n path: ':id',\n name: 'UserApp',\n component: UserApp,\n },\n {\n path: ':id/created',\n name: 'CreatedUserApp',\n component: UserApp,\n props: { afterCreation: true },\n },\n {\n path: 'new',\n name: 'AddUserApp',\n component: AddUserApp,\n },\n {\n path: 'authorize',\n name: 'AuthorizeUserApp',\n component: AuthorizeUserApp,\n },\n ],\n },\n ],\n },\n {\n path: 'edit',\n name: 'UserProfileEdition',\n component: ProfileEdition,\n props: (route) => ({\n tab: getTabFromPath(route.path),\n }),\n children: [\n {\n path: '',\n name: 'UserInfosEdition',\n component: UserInfosEdition,\n },\n {\n path: 'account',\n name: 'UserAccountEdition',\n component: UserAccountEdition,\n },\n {\n path: 'picture',\n name: 'UserPictureEdition',\n component: UserPictureEdition,\n },\n {\n path: 'preferences',\n name: 'UserPreferencesEdition',\n component: UserPreferencesEdition,\n },\n {\n path: 'sports',\n name: 'UserSportPreferencesEdition',\n component: UserSportPreferences,\n props: { isEdition: true },\n },\n {\n path: 'privacy-policy',\n name: 'UserPrivacyPolicy',\n component: UserPrivacyPolicyValidation,\n },\n ],\n },\n ],\n },\n {\n path: '/statistics',\n name: 'Statistics',\n component: () =>\n import(/* webpackChunkName: 'statistics' */ '@/views/StatisticsView.vue'),\n },\n {\n path: '/users/:username',\n name: 'User',\n component: () =>\n import(/* webpackChunkName: 'profile' */ '@/views/user/UserView.vue'),\n },\n {\n path: '/workouts',\n name: 'Workouts',\n component: () =>\n import(\n /* webpackChunkName: 'workouts' */ '@/views/workouts/WorkoutsView.vue'\n ),\n },\n {\n path: '/workouts/:workoutId',\n name: 'Workout',\n component: () =>\n import(/* webpackChunkName: 'workouts' */ '@/views/workouts/Workout.vue'),\n props: { displaySegment: false },\n },\n {\n path: '/workouts/:workoutId/edit',\n name: 'EditWorkout',\n component: () =>\n import(\n /* webpackChunkName: 'workouts' */ '@/views/workouts/EditWorkout.vue'\n ),\n },\n {\n path: '/workouts/:workoutId/segment/:segmentId',\n name: 'WorkoutSegment',\n component: () =>\n import(/* webpackChunkName: 'workouts' */ '@/views/workouts/Workout.vue'),\n props: { displaySegment: true },\n },\n {\n path: '/workouts/add',\n name: 'AddWorkout',\n component: () =>\n import(\n /* webpackChunkName: 'workouts' */ '@/views/workouts/AddWorkout.vue'\n ),\n },\n {\n path: '/admin',\n name: 'Administration',\n component: () =>\n import(/* webpackChunkName: 'admin' */ '@/views/AdminView.vue'),\n children: [\n {\n path: '',\n name: 'AdministrationMenu',\n component: AdminMenu,\n },\n {\n path: 'application',\n name: 'ApplicationAdministration',\n component: AdminApplication,\n },\n {\n path: 'application/edit',\n name: 'ApplicationAdministrationEdition',\n component: AdminApplication,\n props: { edition: true },\n },\n {\n path: 'sports',\n name: 'SportsAdministration',\n component: AdminSports,\n },\n {\n path: 'users/:username',\n name: 'UserFromAdmin',\n component: () =>\n import(/* webpackChunkName: 'profile' */ '@/views/user/UserView.vue'),\n props: { fromAdmin: true },\n },\n {\n path: 'users',\n name: 'UsersAdministration',\n component: AdminUsers,\n },\n ],\n },\n {\n path: '/about',\n name: 'About',\n component: AboutView,\n },\n {\n path: '/privacy-policy',\n name: 'PrivacyPolicy',\n component: PrivacyPolicyView,\n },\n {\n path: '/:pathMatch(.*)*',\n name: 'not-found',\n component: NotFoundView,\n },\n]\n\nconst router = createRouter({\n history: createWebHistory(process.env.BASE_URL),\n routes,\n})\n\nconst pathsWithoutAuthentication = [\n '/login',\n '/password-reset',\n '/password-reset/password-updated',\n '/password-reset/request',\n '/password-reset/sent',\n '/register',\n '/account-confirmation',\n '/account-confirmation/resend',\n '/account-confirmation/email-sent',\n]\n\nconst pathsWithoutChecks = ['/email-update', '/about', '/privacy-policy']\n\nrouter.beforeEach((to, from, next) => {\n store\n .dispatch(AUTH_USER_STORE.ACTIONS.CHECK_AUTH_USER)\n .then(() => {\n if (pathsWithoutChecks.includes(to.path)) {\n return next()\n }\n if (\n store.getters[AUTH_USER_STORE.GETTERS.IS_AUTHENTICATED] &&\n pathsWithoutAuthentication.includes(to.path)\n ) {\n return next('/')\n }\n if (\n !store.getters[AUTH_USER_STORE.GETTERS.IS_AUTHENTICATED] &&\n !pathsWithoutAuthentication.includes(to.path)\n ) {\n const path =\n to.path === '/'\n ? { path: '/login' }\n : { path: '/login', query: { from: to.fullPath } }\n next(path)\n } else {\n next()\n }\n })\n .catch((error) => {\n console.error(error)\n next()\n })\n})\n\nexport default router\n","export enum AuthUserActions {\n ACCEPT_PRIVACY_POLICY = 'ACCEPT_PRIVACY_POLICY',\n CHECK_AUTH_USER = 'CHECK_AUTH_USER',\n CONFIRM_ACCOUNT = 'CONFIRM_ACCOUNT',\n CONFIRM_EMAIL = 'CONFIRM_EMAIL',\n DELETE_ACCOUNT = 'DELETE_ACCOUNT',\n DELETE_PICTURE = 'DELETE_PICTURE',\n GET_REQUEST_DATA_EXPORT = 'GET_REQUEST_DATA_EXPORT',\n GET_USER_PROFILE = 'GET_USER_PROFILE',\n LOGIN_OR_REGISTER = 'LOGIN_OR_REGISTER',\n LOGOUT = 'LOGOUT',\n REQUEST_DATA_EXPORT = 'REQUEST_DATA_EXPORT',\n RESEND_ACCOUNT_CONFIRMATION_EMAIL = 'RESEND_ACCOUNT_CONFIRMATION_EMAIL',\n RESET_USER_PASSWORD = 'RESET_USER_PASSWORD',\n RESET_USER_SPORT_PREFERENCES = 'RESET_USER_SPORT_PREFERENCES',\n SEND_PASSWORD_RESET_REQUEST = 'SEND_PASSWORD_RESET_REQUEST',\n UPDATE_USER_ACCOUNT = 'UPDATE_USER_ACCOUNT',\n UPDATE_USER_PICTURE = 'UPDATE_USER_PICTURE',\n UPDATE_USER_PROFILE = 'UPDATE_USER_PROFILE',\n UPDATE_USER_PREFERENCES = 'UPDATE_USER_PREFERENCES',\n UPDATE_USER_SPORT_PREFERENCES = 'UPDATE_USER_SPORT_PREFERENCES',\n}\n\nexport enum AuthUserGetters {\n AUTH_TOKEN = 'AUTH_TOKEN',\n AUTH_USER_PROFILE = 'AUTH_USER_PROFILE',\n IS_ADMIN = 'IS_ADMIN',\n IS_AUTHENTICATED = 'IS_AUTHENTICATED',\n IS_SUCCESS = 'IS_SUCCESS',\n IS_REGISTRATION_SUCCESS = 'IS_REGISTRATION_SUCCESS',\n USER_LOADING = 'USER_LOADING',\n EXPORT_REQUEST = 'EXPORT_REQUEST',\n}\n\nexport enum AuthUserMutations {\n CLEAR_AUTH_USER_TOKEN = 'CLEAR_AUTH_USER_TOKEN',\n UPDATE_AUTH_TOKEN = 'UPDATE_AUTH_TOKEN',\n UPDATE_AUTH_USER_PROFILE = 'UPDATE_AUTH_USER_PROFILE',\n UPDATE_IS_SUCCESS = 'UPDATE_USER_IS_SUCCESS',\n UPDATE_IS_REGISTRATION_SUCCESS = 'UPDATE_IS_REGISTRATION_SUCCESS',\n UPDATE_USER_LOADING = 'UPDATE_USER_LOADING',\n SET_EXPORT_REQUEST = 'SET_EXPORT_REQUEST',\n}\n","export enum OAuth2Actions {\n AUTHORIZE_CLIENT = 'AUTHORIZE_CLIENT',\n CREATE_CLIENT = 'CREATE_CLIENT',\n DELETE_CLIENT = 'DELETE_CLIENT',\n GET_CLIENTS = 'GET_CLIENTS',\n GET_CLIENT_BY_CLIENT_ID = 'GET_CLIENT_BY_CLIENT_ID',\n GET_CLIENT_BY_ID = 'GET_CLIENT_BY_ID',\n REVOKE_ALL_TOKENS = 'REVOKE_ALL_TOKENS',\n}\n\nexport enum OAuth2Getters {\n CLIENT = 'CLIENT',\n CLIENTS = 'CLIENTS',\n CLIENTS_PAGINATION = 'CLIENTS_PAGINATION',\n REVOCATION_SUCCESSFUL = 'REVOCATION_SUCCESSFUL',\n}\n\nexport enum OAuth2Mutations {\n EMPTY_CLIENT = 'EMPTY_CLIENT',\n SET_CLIENT = 'SET_CLIENT',\n SET_CLIENTS = 'SET_CLIENTS',\n SET_CLIENTS_PAGINATION = 'SET_CLIENTS_PAGINATION',\n SET_REVOCATION_SUCCESSFUL = 'SET_REVOCATION_SUCCESSFUL',\n}\n","export enum RootActions {\n GET_APPLICATION_CONFIG = 'GET_APPLICATION_CONFIG',\n GET_APPLICATION_PRIVACY_POLICY = 'GET_APPLICATION_PRIVACY_POLICY',\n GET_APPLICATION_STATS = 'GET_APPLICATION_STATS',\n UPDATE_APPLICATION_CONFIG = 'UPDATE_APPLICATION_CONFIG',\n UPDATE_APPLICATION_LANGUAGE = 'UPDATE_APPLICATION_LANGUAGE',\n}\n\nexport enum RootGetters {\n APP_CONFIG = 'APP_CONFIG',\n APP_LOADING = 'APP_LOADING',\n APP_STATS = 'APP_STATS',\n ERROR_MESSAGES = 'ERROR_MESSAGES',\n LANGUAGE = 'LANGUAGE',\n LOCALE = 'LOCALE', // date-fns\n}\n\nexport enum RootMutations {\n EMPTY_ERROR_MESSAGES = 'EMPTY_ERROR_MESSAGES',\n SET_ERROR_MESSAGES = 'SET_ERROR_MESSAGES',\n UPDATE_APPLICATION_CONFIG = 'UPDATE_APPLICATION_CONFIG',\n UPDATE_APPLICATION_LOADING = 'UPDATE_APPLICATION_LOADING',\n UPDATE_APPLICATION_PRIVACY_POLICY = 'UPDATE_APPLICATION_PRIVACY_POLICY',\n UPDATE_APPLICATION_STATS = 'UPDATE_APPLICATION_STATS',\n UPDATE_LANG = 'UPDATE_LANG',\n}\n","export enum SportsActions {\n GET_SPORTS = 'GET_SPORTS',\n UPDATE_SPORTS = 'UPDATE_SPORTS',\n}\n\nexport enum SportsGetters {\n SPORTS = 'SPORTS',\n}\n\nexport enum SportsMutation {\n SET_SPORTS = 'SET_SPORTS',\n}\n","export enum StatisticsActions {\n GET_USER_STATS = 'GET_USER_STATS',\n}\n\nexport enum StatisticsGetters {\n USER_STATS = 'USER_STATS',\n}\n\nexport enum StatisticsMutations {\n EMPTY_USER_STATS = 'EMPTY_USER_STATS',\n UPDATE_USER_STATS = 'UPDATE_USER_STATS',\n}\n","export enum UsersActions {\n EMPTY_USER = 'EMPTY_USER',\n EMPTY_USERS = 'EMPTY_USERS',\n GET_USER = 'GET_USER',\n GET_USERS = 'GET_USERS',\n UPDATE_USER = 'UPDATE_USER',\n DELETE_USER_ACCOUNT = 'DELETE_USER_ACCOUNT',\n}\n\nexport enum UsersGetters {\n USER = 'USER',\n USERS = 'USERS',\n USERS_IS_SUCCESS = 'USERS_IS_SUCCESS',\n USERS_LOADING = 'USERS_LOADING',\n USERS_PAGINATION = 'USERS_PAGINATION',\n}\n\nexport enum UsersMutations {\n UPDATE_USER = 'UPDATE_USER',\n UPDATE_USER_IN_USERS = 'UPDATE_USER_IN_USERS',\n UPDATE_USERS = 'UPDATE_USERS',\n UPDATE_USERS_LOADING = 'UPDATE_USERS_LOADING',\n UPDATE_USERS_PAGINATION = 'UPDATE_USERS_PAGINATION',\n UPDATE_IS_SUCCESS = 'UPDATE_IS_SUCCESS',\n}\n","import {\n AuthUserActions,\n AuthUserGetters,\n AuthUserMutations,\n} from '@/store/modules/authUser/enums'\nimport {\n OAuth2Actions,\n OAuth2Getters,\n OAuth2Mutations,\n} from '@/store/modules/oauth2/enums'\nimport {\n RootActions,\n RootGetters,\n RootMutations,\n} from '@/store/modules/root/enums'\nimport {\n SportsActions,\n SportsGetters,\n SportsMutation,\n} from '@/store/modules/sports/enums'\nimport {\n StatisticsActions,\n StatisticsGetters,\n StatisticsMutations,\n} from '@/store/modules/statistics/enums'\nimport {\n UsersActions,\n UsersGetters,\n UsersMutations,\n} from '@/store/modules/users/enums'\nimport {\n WorkoutsActions,\n WorkoutsGetters,\n WorkoutsMutations,\n} from '@/store/modules/workouts/enums'\n\nexport const ROOT_STORE = {\n ACTIONS: RootActions,\n GETTERS: RootGetters,\n MUTATIONS: RootMutations,\n}\n\nexport const SPORTS_STORE = {\n ACTIONS: SportsActions,\n GETTERS: SportsGetters,\n MUTATIONS: SportsMutation,\n}\n\nexport const STATS_STORE = {\n ACTIONS: StatisticsActions,\n GETTERS: StatisticsGetters,\n MUTATIONS: StatisticsMutations,\n}\n\nexport const AUTH_USER_STORE = {\n ACTIONS: AuthUserActions,\n GETTERS: AuthUserGetters,\n MUTATIONS: AuthUserMutations,\n}\nexport const OAUTH2_STORE = {\n ACTIONS: OAuth2Actions,\n GETTERS: OAuth2Getters,\n MUTATIONS: OAuth2Mutations,\n}\n\nexport const USERS_STORE = {\n ACTIONS: UsersActions,\n GETTERS: UsersGetters,\n MUTATIONS: UsersMutations,\n}\n\nexport const WORKOUTS_STORE = {\n ACTIONS: WorkoutsActions,\n GETTERS: WorkoutsGetters,\n MUTATIONS: WorkoutsMutations,\n}\n","import axios from 'axios'\n\nimport { pendingRequests, removeRequestIfPending } from '@/api/pending'\nimport { getApiUrl } from '@/utils'\n\nconst api = axios.create({\n baseURL: getApiUrl(),\n})\n\napi.interceptors.request.use(\n (config) => {\n const controller = new AbortController()\n config.signal = controller.signal\n const requestKey = removeRequestIfPending(config)\n pendingRequests.set(requestKey, controller)\n return config\n },\n (error) => Promise.reject(error)\n)\n\napi.interceptors.response.use(\n (response) => {\n removeRequestIfPending(response.config)\n return response\n },\n (error) => {\n if (error.message !== 'canceled' && error.response) {\n removeRequestIfPending(error.response.config)\n }\n return Promise.reject(error)\n }\n)\n\nexport default api\n","import { ActionContext, ActionTree } from 'vuex'\n\nimport authApi from '@/api/authApi'\nimport router from '@/router'\nimport { AUTH_USER_STORE, ROOT_STORE, USERS_STORE } from '@/store/constants'\nimport { IAuthUserState } from '@/store/modules/authUser/types'\nimport { IRootState } from '@/store/modules/root/types'\nimport { IUsersActions, IUsersState } from '@/store/modules/users/types'\nimport { TPaginationPayload } from '@/types/api'\nimport { IAdminUserPayload, IUserDeletionPayload } from '@/types/user'\nimport { handleError } from '@/utils'\n\nexport const deleteUserAccount = (\n context:\n | ActionContext\n | ActionContext,\n payload: IUserDeletionPayload\n): void => {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n authApi\n .delete(`users/${payload.username}`)\n .then((res) => {\n if (res.status === 204) {\n if (payload.fromAdmin) {\n router.push('/admin/users')\n } else {\n context\n .dispatch(AUTH_USER_STORE.ACTIONS.LOGOUT)\n .then(() => router.push('/'))\n }\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n}\n\nexport const actions: ActionTree & IUsersActions = {\n [USERS_STORE.ACTIONS.EMPTY_USER](\n context: ActionContext\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(USERS_STORE.MUTATIONS.UPDATE_USER, {})\n },\n [USERS_STORE.ACTIONS.EMPTY_USERS](\n context: ActionContext\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(USERS_STORE.MUTATIONS.UPDATE_USERS, [])\n context.commit(USERS_STORE.MUTATIONS.UPDATE_USERS_PAGINATION, {})\n },\n [USERS_STORE.ACTIONS.GET_USER](\n context: ActionContext,\n username: string\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(USERS_STORE.MUTATIONS.UPDATE_USERS_LOADING, true)\n authApi\n .get(`users/${username}`)\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(\n USERS_STORE.MUTATIONS.UPDATE_USER,\n res.data.data.users[0]\n )\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n .finally(() =>\n context.commit(USERS_STORE.MUTATIONS.UPDATE_USERS_LOADING, false)\n )\n },\n [USERS_STORE.ACTIONS.GET_USERS](\n context: ActionContext,\n payload: TPaginationPayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(USERS_STORE.MUTATIONS.UPDATE_USERS_LOADING, true)\n authApi\n .get('users', { params: payload })\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(\n USERS_STORE.MUTATIONS.UPDATE_USERS,\n res.data.data.users\n )\n context.commit(\n USERS_STORE.MUTATIONS.UPDATE_USERS_PAGINATION,\n res.data.pagination\n )\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n .finally(() =>\n context.commit(USERS_STORE.MUTATIONS.UPDATE_USERS_LOADING, false)\n )\n },\n [USERS_STORE.ACTIONS.UPDATE_USER](\n context: ActionContext,\n payload: IAdminUserPayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(USERS_STORE.MUTATIONS.UPDATE_IS_SUCCESS, false)\n const data: Record = {}\n if (payload.admin !== undefined) {\n data.admin = payload.admin\n }\n if (payload.resetPassword) {\n data.reset_password = payload.resetPassword\n }\n if (payload.activate) {\n data.activate = payload.activate\n }\n if (payload.new_email !== undefined) {\n data.new_email = payload.new_email\n }\n authApi\n .patch(`users/${payload.username}`, data)\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(\n USERS_STORE.MUTATIONS.UPDATE_USER_IN_USERS,\n res.data.data.users[0]\n )\n if (payload.resetPassword || payload.new_email) {\n context.commit(USERS_STORE.MUTATIONS.UPDATE_IS_SUCCESS, true)\n }\n if (payload.activate || payload.new_email) {\n context.commit(\n USERS_STORE.MUTATIONS.UPDATE_USER,\n res.data.data.users[0]\n )\n }\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n .finally(() =>\n context.commit(USERS_STORE.MUTATIONS.UPDATE_USERS_LOADING, false)\n )\n },\n [USERS_STORE.ACTIONS.DELETE_USER_ACCOUNT](\n context: ActionContext,\n payload: IUserDeletionPayload\n ): void {\n deleteUserAccount(context, {\n username: payload.username,\n fromAdmin: true,\n })\n },\n}\n","import { ActionContext, ActionTree } from 'vuex'\n\nimport authApi from '@/api/authApi'\nimport api from '@/api/defaultApi'\nimport router from '@/router'\nimport {\n AUTH_USER_STORE,\n ROOT_STORE,\n SPORTS_STORE,\n STATS_STORE,\n USERS_STORE,\n WORKOUTS_STORE,\n} from '@/store/constants'\nimport {\n IAuthUserActions,\n IAuthUserState,\n} from '@/store/modules/authUser/types'\nimport { IRootState } from '@/store/modules/root/types'\nimport { deleteUserAccount } from '@/store/modules/users/actions'\nimport {\n ILoginOrRegisterData,\n IUserAccountPayload,\n IUserDeletionPayload,\n IUserAccountUpdatePayload,\n IUserEmailPayload,\n IUserPasswordResetPayload,\n IUserPayload,\n IUserPicturePayload,\n IUserPreferencesPayload,\n IUserSportPreferencesPayload,\n} from '@/types/user'\nimport { handleError } from '@/utils'\n\nconst removeAuthUserData = (\n context: ActionContext\n) => {\n localStorage.removeItem('authToken')\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(STATS_STORE.MUTATIONS.EMPTY_USER_STATS)\n context.commit(AUTH_USER_STORE.MUTATIONS.CLEAR_AUTH_USER_TOKEN)\n context.commit(USERS_STORE.MUTATIONS.UPDATE_USERS, [])\n context.commit(WORKOUTS_STORE.MUTATIONS.EMPTY_WORKOUTS)\n context.commit(WORKOUTS_STORE.MUTATIONS.EMPTY_WORKOUT)\n router.push('/login')\n}\n\nexport const actions: ActionTree &\n IAuthUserActions = {\n [AUTH_USER_STORE.ACTIONS.CHECK_AUTH_USER](\n context: ActionContext\n ): void {\n if (\n window.localStorage.authToken &&\n !context.getters[AUTH_USER_STORE.GETTERS.IS_AUTHENTICATED]\n ) {\n context.commit(\n AUTH_USER_STORE.MUTATIONS.UPDATE_AUTH_TOKEN,\n window.localStorage.authToken\n )\n context.dispatch(AUTH_USER_STORE.ACTIONS.GET_USER_PROFILE)\n }\n // after logout in another tab\n if (\n !window.localStorage.authToken &&\n context.getters[AUTH_USER_STORE.GETTERS.IS_AUTHENTICATED]\n ) {\n removeAuthUserData(context)\n }\n },\n [AUTH_USER_STORE.ACTIONS.CONFIRM_ACCOUNT](\n context: ActionContext,\n payload: IUserAccountUpdatePayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n api\n .post('auth/account/confirm', { token: payload.token })\n .then((res) => {\n if (res.data.status === 'success') {\n const token = res.data.auth_token\n window.localStorage.setItem('authToken', token)\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_AUTH_TOKEN, token)\n context\n .dispatch(AUTH_USER_STORE.ACTIONS.GET_USER_PROFILE)\n .then(() => router.push('/'))\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => {\n handleError(context, error)\n })\n },\n [AUTH_USER_STORE.ACTIONS.CONFIRM_EMAIL](\n context: ActionContext,\n payload: IUserAccountUpdatePayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_IS_SUCCESS, false)\n api\n .post('/auth/email/update', { token: payload.token })\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_IS_SUCCESS, true)\n if (payload.refreshUser) {\n context\n .dispatch(AUTH_USER_STORE.ACTIONS.GET_USER_PROFILE)\n .then(() => {\n return router.push('/profile/edit/account')\n })\n }\n router.push('/profile/edit/account')\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => {\n handleError(context, error)\n })\n },\n [AUTH_USER_STORE.ACTIONS.GET_USER_PROFILE](\n context: ActionContext\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n authApi\n .get('auth/profile')\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(\n AUTH_USER_STORE.MUTATIONS.UPDATE_AUTH_USER_PROFILE,\n res.data.data\n )\n if (!res.data.data.accepted_privacy_policy) {\n // refresh privacy policy\n context.dispatch(ROOT_STORE.ACTIONS.GET_APPLICATION_PRIVACY_POLICY)\n }\n if (res.data.data.language) {\n context.dispatch(\n ROOT_STORE.ACTIONS.UPDATE_APPLICATION_LANGUAGE,\n res.data.data.language\n )\n }\n context.dispatch(SPORTS_STORE.ACTIONS.GET_SPORTS)\n } else {\n handleError(context, null)\n removeAuthUserData(context)\n }\n })\n .catch((error) => {\n if (error.message !== 'canceled') {\n handleError(context, error)\n removeAuthUserData(context)\n }\n })\n },\n [AUTH_USER_STORE.ACTIONS.LOGIN_OR_REGISTER](\n context: ActionContext,\n data: ILoginOrRegisterData\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(\n AUTH_USER_STORE.MUTATIONS.UPDATE_IS_REGISTRATION_SUCCESS,\n false\n )\n api\n .post(`/auth/${data.actionType}`, data.formData)\n .then((res) => {\n if (res.data.status === 'success') {\n if (data.actionType === 'login') {\n const token = res.data.auth_token\n window.localStorage.setItem('authToken', token)\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_AUTH_TOKEN, token)\n context\n .dispatch(AUTH_USER_STORE.ACTIONS.GET_USER_PROFILE)\n .then(() =>\n router.push(\n typeof data.redirectUrl === 'string' ? data.redirectUrl : '/'\n )\n )\n } else {\n router\n .push('/login')\n .then(() =>\n context.commit(\n AUTH_USER_STORE.MUTATIONS.UPDATE_IS_REGISTRATION_SUCCESS,\n true\n )\n )\n }\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n },\n [AUTH_USER_STORE.ACTIONS.LOGOUT](\n context: ActionContext\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n authApi\n .post('auth/logout')\n .then((res) => {\n if (res.data.status === 'success') {\n removeAuthUserData(context)\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n },\n [AUTH_USER_STORE.ACTIONS.UPDATE_USER_PROFILE](\n context: ActionContext,\n payload: IUserPayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_USER_LOADING, true)\n authApi\n .post('auth/profile/edit', payload)\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(\n AUTH_USER_STORE.MUTATIONS.UPDATE_AUTH_USER_PROFILE,\n res.data.data\n )\n router.push('/profile')\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n .finally(() =>\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_USER_LOADING, false)\n )\n },\n [AUTH_USER_STORE.ACTIONS.UPDATE_USER_ACCOUNT](\n context: ActionContext,\n payload: IUserAccountPayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_USER_LOADING, true)\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_IS_SUCCESS, false)\n authApi\n .patch('auth/profile/edit/account', payload)\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(\n AUTH_USER_STORE.MUTATIONS.UPDATE_AUTH_USER_PROFILE,\n res.data.data\n )\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_IS_SUCCESS, true)\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n .finally(() =>\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_USER_LOADING, false)\n )\n },\n [AUTH_USER_STORE.ACTIONS.UPDATE_USER_PREFERENCES](\n context: ActionContext,\n payload: IUserPreferencesPayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_USER_LOADING, true)\n authApi\n .post('auth/profile/edit/preferences', payload)\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(\n AUTH_USER_STORE.MUTATIONS.UPDATE_AUTH_USER_PROFILE,\n res.data.data\n )\n context\n .dispatch(\n ROOT_STORE.ACTIONS.UPDATE_APPLICATION_LANGUAGE,\n res.data.data.language\n )\n .then(() => router.push('/profile/preferences'))\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n .finally(() =>\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_USER_LOADING, false)\n )\n },\n [AUTH_USER_STORE.ACTIONS.RESET_USER_SPORT_PREFERENCES](\n context: ActionContext,\n sportId: number\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_USER_LOADING, true)\n authApi\n .delete(`auth/profile/reset/sports/${sportId}`)\n .then((res) => {\n if (res.status === 204) {\n context.dispatch(SPORTS_STORE.ACTIONS.GET_SPORTS)\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => {\n handleError(context, error)\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_USER_LOADING, false)\n })\n },\n [AUTH_USER_STORE.ACTIONS.UPDATE_USER_SPORT_PREFERENCES](\n context: ActionContext,\n payload: IUserSportPreferencesPayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_USER_LOADING, true)\n authApi\n .post('auth/profile/edit/sports', payload)\n .then((res) => {\n if (res.data.status === 'success') {\n context.dispatch(SPORTS_STORE.ACTIONS.GET_SPORTS)\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => {\n handleError(context, error)\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_USER_LOADING, false)\n })\n },\n [AUTH_USER_STORE.ACTIONS.UPDATE_USER_PICTURE](\n context: ActionContext,\n payload: IUserPicturePayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_USER_LOADING, true)\n if (!payload.picture) {\n throw new Error('No file part')\n }\n const form = new FormData()\n form.append('file', payload.picture)\n authApi\n .post('auth/picture', form, {\n headers: {\n 'content-type': 'multipart/form-data',\n },\n })\n .then((res) => {\n if (res.data.status === 'success') {\n context\n .dispatch(AUTH_USER_STORE.ACTIONS.GET_USER_PROFILE)\n .then(() => router.push('/profile'))\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n .finally(() =>\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_USER_LOADING, false)\n )\n },\n [AUTH_USER_STORE.ACTIONS.DELETE_ACCOUNT](\n context: ActionContext,\n payload: IUserDeletionPayload\n ): void {\n deleteUserAccount(context, payload)\n },\n [AUTH_USER_STORE.ACTIONS.DELETE_PICTURE](\n context: ActionContext\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_USER_LOADING, true)\n authApi\n .delete(`auth/picture`)\n .then((res) => {\n if (res.status === 204) {\n context\n .dispatch(AUTH_USER_STORE.ACTIONS.GET_USER_PROFILE)\n .then(() => router.push('/profile'))\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n .finally(() =>\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_USER_LOADING, false)\n )\n },\n [AUTH_USER_STORE.ACTIONS.SEND_PASSWORD_RESET_REQUEST](\n context: ActionContext,\n payload: IUserEmailPayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n api\n .post('auth/password/reset-request', payload)\n .then((res) => {\n if (res.data.status === 'success') {\n router.push('/password-reset/sent')\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n },\n [AUTH_USER_STORE.ACTIONS.RESEND_ACCOUNT_CONFIRMATION_EMAIL](\n context: ActionContext,\n payload: IUserEmailPayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n api\n .post('auth/account/resend-confirmation', payload)\n .then((res) => {\n if (res.data.status === 'success') {\n router.push('/account-confirmation/email-sent')\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n },\n [AUTH_USER_STORE.ACTIONS.RESET_USER_PASSWORD](\n context: ActionContext,\n payload: IUserPasswordResetPayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n api\n .post('auth/password/update', payload)\n .then((res) => {\n if (res.data.status === 'success') {\n router.push('/password-reset/password-updated')\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n },\n [AUTH_USER_STORE.ACTIONS.ACCEPT_PRIVACY_POLICY](\n context: ActionContext,\n acceptedPolicy: boolean\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n authApi\n .post('auth/account/privacy-policy', {\n accepted_policy: acceptedPolicy,\n })\n .then((res) => {\n if (res.data.status === 'success') {\n context\n .dispatch(AUTH_USER_STORE.ACTIONS.GET_USER_PROFILE)\n .then(() => router.push('/profile'))\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n },\n [AUTH_USER_STORE.ACTIONS.REQUEST_DATA_EXPORT](\n context: ActionContext\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n authApi\n .post('auth/account/export/request')\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(\n AUTH_USER_STORE.MUTATIONS.SET_EXPORT_REQUEST,\n res.data.request\n )\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n },\n [AUTH_USER_STORE.ACTIONS.GET_REQUEST_DATA_EXPORT](\n context: ActionContext\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n authApi\n .get('auth/account/export')\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(\n AUTH_USER_STORE.MUTATIONS.SET_EXPORT_REQUEST,\n res.data.request\n )\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n },\n}\n","import { GetterTree } from 'vuex'\n\nimport { AUTH_USER_STORE } from '@/store/constants'\nimport {\n IAuthUserGetters,\n IAuthUserState,\n} from '@/store/modules/authUser/types'\nimport { IRootState } from '@/store/modules/root/types'\n\nexport const getters: GetterTree &\n IAuthUserGetters = {\n [AUTH_USER_STORE.GETTERS.AUTH_TOKEN]: (state: IAuthUserState) => {\n return state.authToken\n },\n [AUTH_USER_STORE.GETTERS.AUTH_USER_PROFILE]: (state: IAuthUserState) => {\n return state.authUserProfile\n },\n [AUTH_USER_STORE.GETTERS.EXPORT_REQUEST]: (state: IAuthUserState) => {\n return state.exportRequest\n },\n [AUTH_USER_STORE.GETTERS.IS_AUTHENTICATED]: (state: IAuthUserState) => {\n return state.authToken !== null\n },\n [AUTH_USER_STORE.GETTERS.IS_ADMIN]: (state: IAuthUserState) => {\n return state.authUserProfile && state.authUserProfile.admin\n },\n [AUTH_USER_STORE.GETTERS.IS_REGISTRATION_SUCCESS]: (\n state: IAuthUserState\n ) => {\n return state.isRegistrationSuccess\n },\n [AUTH_USER_STORE.GETTERS.IS_SUCCESS]: (state: IAuthUserState) => {\n return state.isSuccess\n },\n [AUTH_USER_STORE.GETTERS.USER_LOADING]: (state: IAuthUserState) => {\n return state.loading\n },\n}\n","import { MutationTree } from 'vuex'\n\nimport { AUTH_USER_STORE } from '@/store/constants'\nimport {\n IAuthUserState,\n TAuthUserMutations,\n} from '@/store/modules/authUser/types'\nimport { IAuthUserProfile, IExportRequest } from '@/types/user'\n\nexport const mutations: MutationTree & TAuthUserMutations = {\n [AUTH_USER_STORE.MUTATIONS.CLEAR_AUTH_USER_TOKEN](state: IAuthUserState) {\n state.authToken = null\n state.authUserProfile = {}\n },\n [AUTH_USER_STORE.MUTATIONS.UPDATE_AUTH_TOKEN](\n state: IAuthUserState,\n authToken: string\n ) {\n state.authToken = authToken\n },\n [AUTH_USER_STORE.MUTATIONS.UPDATE_AUTH_USER_PROFILE](\n state: IAuthUserState,\n authUserProfile: IAuthUserProfile\n ) {\n state.authUserProfile = authUserProfile\n },\n [AUTH_USER_STORE.MUTATIONS.UPDATE_IS_REGISTRATION_SUCCESS](\n state: IAuthUserState,\n isRegistrationSuccess: boolean\n ) {\n state.isRegistrationSuccess = isRegistrationSuccess\n },\n [AUTH_USER_STORE.MUTATIONS.UPDATE_IS_SUCCESS](\n state: IAuthUserState,\n isSuccess: boolean\n ) {\n state.isSuccess = isSuccess\n },\n [AUTH_USER_STORE.MUTATIONS.UPDATE_USER_LOADING](\n state: IAuthUserState,\n loading: boolean\n ) {\n state.loading = loading\n },\n [AUTH_USER_STORE.MUTATIONS.SET_EXPORT_REQUEST](\n state: IAuthUserState,\n exportRequest: IExportRequest\n ) {\n state.exportRequest = exportRequest\n },\n}\n","import { IAuthUserState } from '@/store/modules/authUser/types'\nimport { IAuthUserProfile } from '@/types/user'\n\nexport const authUserState: IAuthUserState = {\n authToken: null,\n authUserProfile: {},\n isSuccess: false,\n isRegistrationSuccess: false,\n loading: false,\n exportRequest: null,\n}\n","import { Module } from 'vuex'\n\nimport { actions } from '@/store/modules/authUser/actions'\nimport { getters } from '@/store/modules/authUser/getters'\nimport { mutations } from '@/store/modules/authUser/mutations'\nimport { authUserState } from '@/store/modules/authUser/state'\nimport { IAuthUserState } from '@/store/modules/authUser/types'\nimport { IRootState } from '@/store/modules/root/types'\n\nconst authUser: Module = {\n state: authUserState,\n actions,\n getters,\n mutations,\n}\n\nexport default authUser\n","import { ActionContext, ActionTree } from 'vuex'\n\nimport authApi from '@/api/authApi'\nimport router from '@/router'\nimport { OAUTH2_STORE, ROOT_STORE } from '@/store/constants'\nimport { IOAuth2Actions, IOAuth2State } from '@/store/modules/oauth2/types'\nimport { IRootState } from '@/store/modules/root/types'\nimport {\n IOauth2ClientsPayload,\n IOAuth2ClientPayload,\n IOAuth2ClientAuthorizePayload,\n} from '@/types/oauth'\nimport { handleError } from '@/utils'\n\nconst get_client = (\n context: ActionContext,\n url: string\n) => {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n authApi\n .get(url)\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(OAUTH2_STORE.MUTATIONS.SET_CLIENT, res.data.data.client)\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n}\n\nexport const actions: ActionTree & IOAuth2Actions = {\n [OAUTH2_STORE.ACTIONS.AUTHORIZE_CLIENT](\n context: ActionContext,\n payload: IOAuth2ClientAuthorizePayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n const form = new FormData()\n form.set('client_id', payload.client_id)\n form.set('response_type', payload.response_type)\n form.set('scope', payload.scope)\n form.set('confirm', 'true')\n if (payload.state) {\n form.set('state', payload.state)\n }\n if (payload.code_challenge) {\n form.set('code_challenge', payload.code_challenge)\n }\n if (payload.code_challenge_method) {\n form.set('code_challenge_method', payload.code_challenge_method)\n }\n\n authApi\n .post('oauth/authorize', form, {\n headers: {\n 'Content-Type': 'multipart/form-data',\n },\n })\n .then((res) => {\n if (res.status == 200 && res.data.redirect_url) {\n window.location.href = res.data.redirect_url\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n },\n [OAUTH2_STORE.ACTIONS.CREATE_CLIENT](\n context: ActionContext,\n payload: IOAuth2ClientPayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n authApi\n .post('oauth/apps', payload)\n .then((res) => {\n if (res.data.status === 'created') {\n context.commit(\n OAUTH2_STORE.MUTATIONS.SET_CLIENT,\n res.data.data.client\n )\n router.push(`/profile/apps/${res.data.data.client.id}/created`)\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n },\n [OAUTH2_STORE.ACTIONS.DELETE_CLIENT](\n context: ActionContext,\n id: number\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n authApi\n .delete(`oauth/apps/${id}`)\n .then((res) => {\n if (res.status === 204) {\n context\n .dispatch(OAUTH2_STORE.ACTIONS.GET_CLIENTS)\n .then(() => router.push('/profile/apps'))\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n },\n [OAUTH2_STORE.ACTIONS.GET_CLIENT_BY_CLIENT_ID](\n context: ActionContext,\n client_id: string\n ): void {\n get_client(context, `oauth/apps/${client_id}`)\n },\n [OAUTH2_STORE.ACTIONS.GET_CLIENT_BY_ID](\n context: ActionContext,\n id: number\n ): void {\n get_client(context, `oauth/apps/${id}/by_id`)\n },\n [OAUTH2_STORE.ACTIONS.GET_CLIENTS](\n context: ActionContext,\n payload: IOauth2ClientsPayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n authApi\n .get('oauth/apps', {\n params: payload,\n })\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(\n OAUTH2_STORE.MUTATIONS.SET_CLIENTS,\n res.data.data.clients\n )\n context.commit(\n OAUTH2_STORE.MUTATIONS.SET_CLIENTS_PAGINATION,\n res.data.pagination\n )\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n },\n [OAUTH2_STORE.ACTIONS.REVOKE_ALL_TOKENS](\n context: ActionContext,\n id: number\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(OAUTH2_STORE.MUTATIONS.SET_REVOCATION_SUCCESSFUL, false)\n authApi\n .post(`oauth/apps/${id}/revoke`)\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(OAUTH2_STORE.MUTATIONS.SET_REVOCATION_SUCCESSFUL, true)\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n },\n}\n","import { GetterTree } from 'vuex'\n\nimport { OAUTH2_STORE } from '@/store/constants'\nimport { IOAuth2Getters, IOAuth2State } from '@/store/modules/oauth2/types'\nimport { IRootState } from '@/store/modules/root/types'\n\nexport const getters: GetterTree & IOAuth2Getters = {\n [OAUTH2_STORE.GETTERS.CLIENT]: (state: IOAuth2State) => state.client,\n [OAUTH2_STORE.GETTERS.CLIENTS]: (state: IOAuth2State) => state.clients,\n [OAUTH2_STORE.GETTERS.CLIENTS_PAGINATION]: (state: IOAuth2State) =>\n state.pagination,\n [OAUTH2_STORE.GETTERS.REVOCATION_SUCCESSFUL]: (state: IOAuth2State) =>\n state.revocationSuccessful,\n}\n","import { MutationTree } from 'vuex'\n\nimport { OAUTH2_STORE } from '@/store/constants'\nimport { IOAuth2State, TOAuth2Mutations } from '@/store/modules/oauth2/types'\nimport { IPagination } from '@/types/api'\nimport { IOAuth2Client } from '@/types/oauth'\n\nexport const mutations: MutationTree & TOAuth2Mutations = {\n [OAUTH2_STORE.MUTATIONS.SET_CLIENT](\n state: IOAuth2State,\n client: IOAuth2Client\n ) {\n state.client = client\n },\n [OAUTH2_STORE.MUTATIONS.EMPTY_CLIENT](state: IOAuth2State) {\n state.client = {}\n },\n [OAUTH2_STORE.MUTATIONS.SET_CLIENTS](\n state: IOAuth2State,\n clients: IOAuth2Client[]\n ) {\n state.clients = clients\n },\n [OAUTH2_STORE.MUTATIONS.SET_CLIENTS_PAGINATION](\n state: IOAuth2State,\n pagination: IPagination\n ) {\n state.pagination = pagination\n },\n [OAUTH2_STORE.MUTATIONS.SET_REVOCATION_SUCCESSFUL](\n state: IOAuth2State,\n revocationSuccessful: boolean\n ) {\n state.revocationSuccessful = revocationSuccessful\n },\n}\n","import { IOAuth2State } from '@/store/modules/oauth2/types'\nimport { IPagination } from '@/types/api'\nimport { IOAuth2Client } from '@/types/oauth'\n\nexport const oAuth2State: IOAuth2State = {\n client: {},\n clients: [],\n pagination: {},\n revocationSuccessful: false,\n}\n","import { Module } from 'vuex'\n\nimport { actions } from '@/store/modules/oauth2/actions'\nimport { getters } from '@/store/modules/oauth2/getters'\nimport { mutations } from '@/store/modules/oauth2/mutations'\nimport { oAuth2State } from '@/store/modules/oauth2/state'\nimport { IOAuth2State } from '@/store/modules/oauth2/types'\nimport { IRootState } from '@/store/modules/root/types'\n\nconst oauth2: Module = {\n state: oAuth2State,\n actions,\n getters,\n mutations,\n}\n\nexport default oauth2\n","import { ActionContext, ActionTree } from 'vuex'\n\nimport authApi from '@/api/authApi'\nimport createI18n from '@/i18n'\nimport router from '@/router'\nimport { ROOT_STORE } from '@/store/constants'\nimport { IRootActions, IRootState } from '@/store/modules/root/types'\nimport { TAppConfigForm } from '@/types/application'\nimport { handleError } from '@/utils'\n\nconst { locale } = createI18n.global\n\nexport const actions: ActionTree & IRootActions = {\n [ROOT_STORE.ACTIONS.GET_APPLICATION_CONFIG](\n context: ActionContext\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(ROOT_STORE.MUTATIONS.UPDATE_APPLICATION_LOADING, true)\n authApi\n .get('config')\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(\n ROOT_STORE.MUTATIONS.UPDATE_APPLICATION_CONFIG,\n res.data.data\n )\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n .finally(() =>\n context.commit(ROOT_STORE.MUTATIONS.UPDATE_APPLICATION_LOADING, false)\n )\n },\n [ROOT_STORE.ACTIONS.GET_APPLICATION_STATS](\n context: ActionContext\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n authApi\n .get('stats/all')\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(\n ROOT_STORE.MUTATIONS.UPDATE_APPLICATION_STATS,\n res.data.data\n )\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n },\n [ROOT_STORE.ACTIONS.GET_APPLICATION_PRIVACY_POLICY](\n context: ActionContext\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n authApi\n .get('config')\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(\n ROOT_STORE.MUTATIONS.UPDATE_APPLICATION_PRIVACY_POLICY,\n res.data.data\n )\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n },\n [ROOT_STORE.ACTIONS.UPDATE_APPLICATION_CONFIG](\n context: ActionContext,\n payload: TAppConfigForm\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n authApi\n .patch('config', payload)\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(\n ROOT_STORE.MUTATIONS.UPDATE_APPLICATION_CONFIG,\n res.data.data\n )\n router.push('/admin/application')\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n },\n [ROOT_STORE.ACTIONS.UPDATE_APPLICATION_LANGUAGE](\n context: ActionContext,\n language: string\n ): void {\n document.querySelector('html')?.setAttribute('lang', language)\n context.commit(ROOT_STORE.MUTATIONS.UPDATE_LANG, language)\n locale.value = language\n },\n}\n","import { GetterTree } from 'vuex'\n\nimport { ROOT_STORE } from '@/store/constants'\nimport { IRootGetters, IRootState } from '@/store/modules/root/types'\n\nexport const getters: GetterTree & IRootGetters = {\n [ROOT_STORE.GETTERS.APP_CONFIG]: (state: IRootState) => {\n return state.application.config\n },\n [ROOT_STORE.GETTERS.APP_LOADING]: (state: IRootState) => {\n return state.appLoading\n },\n [ROOT_STORE.GETTERS.APP_STATS]: (state: IRootState) => {\n return state.application.statistics\n },\n [ROOT_STORE.GETTERS.ERROR_MESSAGES]: (state: IRootState) => {\n return state.errorMessages\n },\n [ROOT_STORE.GETTERS.LANGUAGE]: (state: IRootState) => {\n return state.language\n },\n [ROOT_STORE.GETTERS.LOCALE]: (state: IRootState) => {\n return state.locale\n },\n}\n","import { MutationTree } from 'vuex'\n\nimport { ROOT_STORE } from '@/store/constants'\nimport { IRootState, TRootMutations } from '@/store/modules/root/types'\nimport { TAppConfig, IAppStatistics } from '@/types/application'\nimport { localeFromLanguage } from '@/utils/locales'\n\nexport const mutations: MutationTree & TRootMutations = {\n [ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES](state: IRootState) {\n state.errorMessages = null\n },\n [ROOT_STORE.MUTATIONS.SET_ERROR_MESSAGES](\n state: IRootState,\n errorMessages: string | string[]\n ) {\n state.errorMessages = errorMessages\n },\n [ROOT_STORE.MUTATIONS.UPDATE_APPLICATION_CONFIG](\n state: IRootState,\n config: TAppConfig\n ) {\n state.application.config = config\n },\n [ROOT_STORE.MUTATIONS.UPDATE_APPLICATION_LOADING](\n state: IRootState,\n loading: boolean\n ) {\n state.appLoading = loading\n },\n [ROOT_STORE.MUTATIONS.UPDATE_APPLICATION_PRIVACY_POLICY](\n state: IRootState,\n appConfig: TAppConfig\n ) {\n state.application.config.privacy_policy = appConfig.privacy_policy\n state.application.config.privacy_policy_date = appConfig.privacy_policy_date\n },\n [ROOT_STORE.MUTATIONS.UPDATE_APPLICATION_STATS](\n state: IRootState,\n statistics: IAppStatistics\n ) {\n state.application.statistics = statistics\n },\n [ROOT_STORE.MUTATIONS.UPDATE_LANG](state: IRootState, language: string) {\n state.language = language\n state.locale = localeFromLanguage[language]\n },\n}\n","import { enUS } from 'date-fns/locale'\n\nimport { IRootState } from '@/store/modules/root/types'\nimport { IApplication } from '@/types/application'\n\nexport const state: IRootState = {\n root: true,\n language: 'en',\n locale: enUS,\n errorMessages: null,\n application: {\n statistics: {\n sports: 0,\n uploads_dir_size: 0,\n users: 0,\n workouts: 0,\n },\n },\n appLoading: false,\n}\n","import { ActionContext, ActionTree } from 'vuex'\n\nimport authApi from '@/api/authApi'\nimport { AUTH_USER_STORE, ROOT_STORE, SPORTS_STORE } from '@/store/constants'\nimport { IRootState } from '@/store/modules/root/types'\nimport { ISportsActions, ISportsState } from '@/store/modules/sports/types'\nimport { ISportPayload } from '@/types/sports'\nimport { handleError } from '@/utils'\n\nexport const actions: ActionTree & ISportsActions = {\n [SPORTS_STORE.ACTIONS.GET_SPORTS](\n context: ActionContext\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n authApi\n .get('sports')\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(\n SPORTS_STORE.MUTATIONS.SET_SPORTS,\n res.data.data.sports\n )\n context.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_USER_LOADING, false)\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n },\n [SPORTS_STORE.ACTIONS.UPDATE_SPORTS](\n context: ActionContext,\n payload: ISportPayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n authApi\n .patch(`sports/${payload.id}`, { is_active: payload.isActive })\n .then((res) => {\n if (res.data.status === 'success') {\n context.dispatch(SPORTS_STORE.ACTIONS.GET_SPORTS)\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n },\n}\n","import { GetterTree } from 'vuex'\n\nimport { SPORTS_STORE } from '@/store/constants'\nimport { IRootState } from '@/store/modules/root/types'\nimport { ISportsGetters, ISportsState } from '@/store/modules/sports/types'\n\nexport const getters: GetterTree & ISportsGetters = {\n [SPORTS_STORE.GETTERS.SPORTS]: (state: ISportsState) => state.sports,\n}\n","import { MutationTree } from 'vuex'\n\nimport { SPORTS_STORE } from '@/store/constants'\nimport { ISportsState, TSportsMutations } from '@/store/modules/sports/types'\nimport { ISport } from '@/types/sports'\n\nexport const mutations: MutationTree & TSportsMutations = {\n [SPORTS_STORE.MUTATIONS.SET_SPORTS](state: ISportsState, sports: ISport[]) {\n state.sports = sports\n },\n}\n","import { ISportsState } from '@/store/modules/sports/types'\n\nexport const sportsState: ISportsState = {\n sports: [],\n}\n","import { Module } from 'vuex'\n\nimport { IRootState } from '@/store/modules/root/types'\nimport { actions } from '@/store/modules/sports/actions'\nimport { getters } from '@/store/modules/sports/getters'\nimport { mutations } from '@/store/modules/sports/mutations'\nimport { sportsState } from '@/store/modules/sports/state'\nimport { ISportsState } from '@/store/modules/sports/types'\n\nconst sports: Module = {\n state: sportsState,\n actions,\n getters,\n mutations,\n}\n\nexport default sports\n","import { ActionContext, ActionTree } from 'vuex'\n\nimport authApi from '@/api/authApi'\nimport { STATS_STORE, ROOT_STORE } from '@/store/constants'\nimport { IRootState } from '@/store/modules/root/types'\nimport {\n IStatisticsActions,\n IStatisticsState,\n} from '@/store/modules/statistics/types'\nimport { IUserStatisticsPayload } from '@/types/statistics'\nimport { handleError } from '@/utils'\n\nexport const actions: ActionTree &\n IStatisticsActions = {\n [STATS_STORE.ACTIONS.GET_USER_STATS](\n context: ActionContext,\n payload: IUserStatisticsPayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n authApi\n .get(`stats/${payload.username}/${payload.filterType}`, {\n params: payload.params,\n })\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(\n STATS_STORE.MUTATIONS.UPDATE_USER_STATS,\n res.data.data.statistics\n )\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n },\n}\n","import { GetterTree } from 'vuex'\n\nimport { STATS_STORE } from '@/store/constants'\nimport { IRootState } from '@/store/modules/root/types'\nimport {\n IStatisticsGetters,\n IStatisticsState,\n} from '@/store/modules/statistics/types'\n\nexport const getters: GetterTree &\n IStatisticsGetters = {\n [STATS_STORE.GETTERS.USER_STATS]: (state: IStatisticsState) => {\n return state.statistics\n },\n}\n","import { MutationTree } from 'vuex'\n\nimport { STATS_STORE } from '@/store/constants'\nimport {\n IStatisticsState,\n TStatisticsMutations,\n} from '@/store/modules/statistics/types'\nimport { TStatisticsFromApi } from '@/types/statistics'\n\nexport const mutations: MutationTree & TStatisticsMutations =\n {\n [STATS_STORE.MUTATIONS.UPDATE_USER_STATS](\n state: IStatisticsState,\n statistics: TStatisticsFromApi\n ) {\n state.statistics = statistics\n },\n [STATS_STORE.MUTATIONS.EMPTY_USER_STATS](state: IStatisticsState) {\n state.statistics = {}\n },\n }\n","import { IStatisticsState } from '@/store/modules/statistics/types'\nimport { TStatisticsFromApi } from '@/types/statistics'\n\nexport const statisticsState: IStatisticsState = {\n statistics: {},\n}\n","import { Module } from 'vuex'\n\nimport { IRootState } from '@/store/modules/root/types'\nimport { actions } from '@/store/modules/statistics/actions'\nimport { getters } from '@/store/modules/statistics/getters'\nimport { mutations } from '@/store/modules/statistics/mutations'\nimport { statisticsState } from '@/store/modules/statistics/state'\nimport { IStatisticsState } from '@/store/modules/statistics/types'\n\nconst statistics: Module = {\n state: statisticsState,\n actions,\n getters,\n mutations,\n}\n\nexport default statistics\n","import { GetterTree } from 'vuex'\n\nimport { USERS_STORE } from '@/store/constants'\nimport { IRootState } from '@/store/modules/root/types'\nimport { IUsersGetters, IUsersState } from '@/store/modules/users/types'\n\nexport const getters: GetterTree & IUsersGetters = {\n [USERS_STORE.GETTERS.USER]: (state: IUsersState) => {\n return state.user\n },\n [USERS_STORE.GETTERS.USERS]: (state: IUsersState) => {\n return state.users\n },\n [USERS_STORE.GETTERS.USERS_IS_SUCCESS]: (state: IUsersState) => {\n return state.isSuccess\n },\n [USERS_STORE.GETTERS.USERS_LOADING]: (state: IUsersState) => {\n return state.loading\n },\n [USERS_STORE.GETTERS.USERS_PAGINATION]: (state: IUsersState) => {\n return state.pagination\n },\n}\n","import { MutationTree } from 'vuex'\n\nimport { USERS_STORE } from '@/store/constants'\nimport { IUsersState, TUsersMutations } from '@/store/modules/users/types'\nimport { IPagination } from '@/types/api'\nimport { IUserProfile } from '@/types/user'\n\nexport const mutations: MutationTree & TUsersMutations = {\n [USERS_STORE.MUTATIONS.UPDATE_USER](state: IUsersState, user: IUserProfile) {\n state.user = user\n },\n [USERS_STORE.MUTATIONS.UPDATE_USER_IN_USERS](\n state: IUsersState,\n updatedUser: IUserProfile\n ) {\n state.users = state.users.map((user) => {\n if (user.username === updatedUser.username) {\n return updatedUser\n }\n return user\n })\n },\n [USERS_STORE.MUTATIONS.UPDATE_USERS](\n state: IUsersState,\n users: IUserProfile[]\n ) {\n state.users = users\n },\n [USERS_STORE.MUTATIONS.UPDATE_USERS_LOADING](\n state: IUsersState,\n loading: boolean\n ) {\n state.loading = loading\n },\n [USERS_STORE.MUTATIONS.UPDATE_USERS_PAGINATION](\n state: IUsersState,\n pagination: IPagination\n ) {\n state.pagination = pagination\n },\n [USERS_STORE.MUTATIONS.UPDATE_IS_SUCCESS](\n state: IUsersState,\n isSuccess: boolean\n ) {\n state.isSuccess = isSuccess\n },\n}\n","import { IUsersState } from '@/store/modules/users/types'\nimport { IPagination } from '@/types/api'\nimport { IUserProfile } from '@/types/user'\n\nexport const usersState: IUsersState = {\n user: {},\n users: [],\n loading: false,\n isSuccess: false,\n pagination: {},\n}\n","import { Module } from 'vuex'\n\nimport { IRootState } from '@/store/modules/root/types'\nimport { actions } from '@/store/modules/users/actions'\nimport { getters } from '@/store/modules/users/getters'\nimport { mutations } from '@/store/modules/users/mutations'\nimport { usersState } from '@/store/modules/users/state'\nimport { IUsersState } from '@/store/modules/users/types'\n\nconst users: Module = {\n state: usersState,\n actions,\n getters,\n mutations,\n}\n\nexport default users\n","import { ActionContext, ActionTree } from 'vuex'\n\nimport authApi from '@/api/authApi'\nimport router from '@/router'\nimport { ROOT_STORE, AUTH_USER_STORE, WORKOUTS_STORE } from '@/store/constants'\nimport { IRootState } from '@/store/modules/root/types'\nimport { WorkoutsMutations } from '@/store/modules/workouts/enums'\nimport {\n IWorkoutsActions,\n IWorkoutsState,\n} from '@/store/modules/workouts/types'\nimport {\n IWorkout,\n IWorkoutForm,\n IWorkoutPayload,\n TWorkoutsPayload,\n} from '@/types/workouts'\nimport { handleError } from '@/utils'\n\nconst getWorkouts = (\n context: ActionContext,\n payload: TWorkoutsPayload,\n target: WorkoutsMutations\n): void => {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n authApi\n .get('workouts', {\n params: payload,\n })\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(WORKOUTS_STORE.MUTATIONS[target], res.data.data.workouts)\n if (target === WorkoutsMutations['SET_USER_WORKOUTS']) {\n context.commit(\n WORKOUTS_STORE.MUTATIONS.SET_WORKOUTS_PAGINATION,\n res.data.pagination\n )\n }\n } else {\n handleError(context, null)\n }\n })\n .catch((error) => handleError(context, error))\n}\n\nexport const actions: ActionTree &\n IWorkoutsActions = {\n [WORKOUTS_STORE.ACTIONS.GET_CALENDAR_WORKOUTS](\n context: ActionContext,\n payload: TWorkoutsPayload\n ): void {\n context.commit(WORKOUTS_STORE.MUTATIONS.EMPTY_CALENDAR_WORKOUTS)\n getWorkouts(context, payload, WorkoutsMutations['SET_CALENDAR_WORKOUTS'])\n },\n [WORKOUTS_STORE.ACTIONS.GET_USER_WORKOUTS](\n context: ActionContext,\n payload: TWorkoutsPayload\n ): void {\n getWorkouts(context, payload, WorkoutsMutations['SET_USER_WORKOUTS'])\n },\n [WORKOUTS_STORE.ACTIONS.GET_TIMELINE_WORKOUTS](\n context: ActionContext,\n payload: TWorkoutsPayload\n ): void {\n getWorkouts(context, payload, WorkoutsMutations['SET_TIMELINE_WORKOUTS'])\n },\n [WORKOUTS_STORE.ACTIONS.GET_MORE_TIMELINE_WORKOUTS](\n context: ActionContext,\n payload: TWorkoutsPayload\n ): void {\n getWorkouts(context, payload, WorkoutsMutations['ADD_TIMELINE_WORKOUTS'])\n },\n [WORKOUTS_STORE.ACTIONS.GET_WORKOUT_DATA](\n context: ActionContext,\n payload: IWorkoutPayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(WORKOUTS_STORE.MUTATIONS.SET_WORKOUT_LOADING, true)\n const segmentUrl = payload.segmentId ? `/segment/${payload.segmentId}` : ''\n authApi\n .get(`workouts/${payload.workoutId}`)\n .then((res) => {\n const workout: IWorkout = res.data.data.workouts[0]\n if (res.data.status === 'success') {\n if (\n payload.segmentId &&\n (workout.segments.length === 0 ||\n !workout.segments[+payload.segmentId - 1])\n ) {\n throw new Error('WORKOUT_NOT_FOUND')\n }\n context.commit(\n WORKOUTS_STORE.MUTATIONS.SET_WORKOUT,\n res.data.data.workouts[0]\n )\n if (res.data.data.workouts[0].with_gpx) {\n authApi\n .get(`workouts/${payload.workoutId}/chart_data${segmentUrl}`)\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(\n WORKOUTS_STORE.MUTATIONS.SET_WORKOUT_CHART_DATA,\n res.data.data.chart_data\n )\n }\n })\n authApi\n .get(`workouts/${payload.workoutId}/gpx${segmentUrl}`)\n .then((res) => {\n if (res.data.status === 'success') {\n context.commit(\n WORKOUTS_STORE.MUTATIONS.SET_WORKOUT_GPX,\n res.data.data.gpx\n )\n }\n })\n }\n } else {\n context.commit(WORKOUTS_STORE.MUTATIONS.EMPTY_WORKOUT)\n handleError(context, null)\n }\n })\n .catch((error) => {\n context.commit(WORKOUTS_STORE.MUTATIONS.EMPTY_WORKOUT)\n handleError(context, error)\n })\n .finally(() =>\n context.commit(WORKOUTS_STORE.MUTATIONS.SET_WORKOUT_LOADING, false)\n )\n },\n [WORKOUTS_STORE.ACTIONS.DELETE_WORKOUT](\n context: ActionContext,\n payload: IWorkoutPayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(WORKOUTS_STORE.MUTATIONS.SET_WORKOUT_LOADING, true)\n authApi\n .delete(`workouts/${payload.workoutId}`)\n .then(() => {\n context.commit(WORKOUTS_STORE.MUTATIONS.EMPTY_WORKOUT)\n context.dispatch(AUTH_USER_STORE.ACTIONS.GET_USER_PROFILE)\n router.push('/')\n })\n .catch((error) => {\n handleError(context, error)\n })\n .finally(() =>\n context.commit(WORKOUTS_STORE.MUTATIONS.SET_WORKOUT_LOADING, false)\n )\n },\n [WORKOUTS_STORE.ACTIONS.EDIT_WORKOUT](\n context: ActionContext,\n payload: IWorkoutPayload\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(WORKOUTS_STORE.MUTATIONS.SET_WORKOUT_LOADING, true)\n authApi\n .patch(`workouts/${payload.workoutId}`, payload.data)\n .then(() => {\n context.dispatch(AUTH_USER_STORE.ACTIONS.GET_USER_PROFILE)\n context\n .dispatch(WORKOUTS_STORE.ACTIONS.GET_WORKOUT_DATA, {\n workoutId: payload.workoutId,\n })\n .then(() => {\n router.push({\n name: 'Workout',\n params: { workoutId: payload.workoutId },\n })\n })\n })\n .catch((error) => {\n handleError(context, error)\n })\n .finally(() =>\n context.commit(WORKOUTS_STORE.MUTATIONS.SET_WORKOUT_LOADING, false)\n )\n },\n [WORKOUTS_STORE.ACTIONS.ADD_WORKOUT](\n context: ActionContext,\n payload: IWorkoutForm\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(WORKOUTS_STORE.MUTATIONS.SET_WORKOUT_LOADING, true)\n if (!payload.file) {\n throw new Error('No file part')\n }\n const notes = payload.notes.replace(/\"/g, '\\\\\"')\n const form = new FormData()\n form.append('file', payload.file)\n form.append(\n 'data',\n `{\"sport_id\": ${payload.sport_id}, \"notes\": \"${notes}\"}`\n )\n authApi\n .post('workouts', form, {\n headers: {\n 'content-type': 'multipart/form-data',\n },\n })\n .then((res) => {\n if (res.data.status === 'created') {\n context.dispatch(AUTH_USER_STORE.ACTIONS.GET_USER_PROFILE)\n const workout: IWorkout = res.data.data.workouts[0]\n router.push(\n res.data.data.workouts.length === 1\n ? `/workouts/${workout.id}`\n : '/'\n )\n }\n })\n .catch((error) => {\n handleError(context, error)\n })\n .finally(() =>\n context.commit(WORKOUTS_STORE.MUTATIONS.SET_WORKOUT_LOADING, false)\n )\n },\n [WORKOUTS_STORE.ACTIONS.ADD_WORKOUT_WITHOUT_GPX](\n context: ActionContext,\n payload: IWorkoutForm\n ): void {\n context.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n context.commit(WORKOUTS_STORE.MUTATIONS.SET_WORKOUT_LOADING, true)\n authApi\n .post('workouts/no_gpx', payload)\n .then((res) => {\n if (res.data.status === 'created') {\n context.dispatch(AUTH_USER_STORE.ACTIONS.GET_USER_PROFILE)\n const workout: IWorkout = res.data.data.workouts[0]\n router.push(`/workouts/${workout.id}`)\n }\n })\n .catch((error) => {\n handleError(context, error)\n })\n .finally(() =>\n context.commit(WORKOUTS_STORE.MUTATIONS.SET_WORKOUT_LOADING, false)\n )\n },\n}\n","import { GetterTree } from 'vuex'\n\nimport { WORKOUTS_STORE } from '@/store/constants'\nimport { IRootState } from '@/store/modules/root/types'\nimport {\n IWorkoutsGetters,\n IWorkoutsState,\n} from '@/store/modules/workouts/types'\n\nexport const getters: GetterTree &\n IWorkoutsGetters = {\n [WORKOUTS_STORE.GETTERS.CALENDAR_WORKOUTS]: (state: IWorkoutsState) => {\n return state.calendar_workouts\n },\n [WORKOUTS_STORE.GETTERS.TIMELINE_WORKOUTS]: (state: IWorkoutsState) => {\n return state.timeline_workouts\n },\n [WORKOUTS_STORE.GETTERS.USER_WORKOUTS]: (state: IWorkoutsState) => {\n return state.user_workouts\n },\n [WORKOUTS_STORE.GETTERS.WORKOUT_DATA]: (state: IWorkoutsState) => {\n return state.workoutData\n },\n [WORKOUTS_STORE.GETTERS.WORKOUTS_PAGINATION]: (state: IWorkoutsState) => {\n return state.pagination\n },\n}\n","import { MutationTree } from 'vuex'\n\nimport { WORKOUTS_STORE } from '@/store/constants'\nimport {\n IWorkoutsState,\n TWorkoutsMutations,\n} from '@/store/modules/workouts/types'\nimport { IPagination } from '@/types/api'\nimport { IWorkout, IWorkoutApiChartData } from '@/types/workouts'\n\nexport const mutations: MutationTree & TWorkoutsMutations = {\n [WORKOUTS_STORE.MUTATIONS.ADD_TIMELINE_WORKOUTS](\n state: IWorkoutsState,\n workouts: IWorkout[]\n ) {\n state.timeline_workouts = state.timeline_workouts.concat(workouts)\n },\n [WORKOUTS_STORE.MUTATIONS.SET_CALENDAR_WORKOUTS](\n state: IWorkoutsState,\n workouts: IWorkout[]\n ) {\n state.calendar_workouts = workouts\n },\n [WORKOUTS_STORE.MUTATIONS.SET_TIMELINE_WORKOUTS](\n state: IWorkoutsState,\n workouts: IWorkout[]\n ) {\n state.timeline_workouts = workouts\n },\n [WORKOUTS_STORE.MUTATIONS.SET_USER_WORKOUTS](\n state: IWorkoutsState,\n workouts: IWorkout[]\n ) {\n state.user_workouts = workouts\n },\n [WORKOUTS_STORE.MUTATIONS.SET_WORKOUTS_PAGINATION](\n state: IWorkoutsState,\n pagination: IPagination\n ) {\n state.pagination = pagination\n },\n [WORKOUTS_STORE.MUTATIONS.SET_WORKOUT](\n state: IWorkoutsState,\n workout: IWorkout\n ) {\n state.workoutData.workout = workout\n },\n [WORKOUTS_STORE.MUTATIONS.SET_WORKOUT_CHART_DATA](\n state: IWorkoutsState,\n chartData: IWorkoutApiChartData[]\n ) {\n state.workoutData.chartData = chartData\n },\n [WORKOUTS_STORE.MUTATIONS.SET_WORKOUT_GPX](\n state: IWorkoutsState,\n gpx: string\n ) {\n state.workoutData.gpx = gpx\n },\n [WORKOUTS_STORE.MUTATIONS.SET_WORKOUT_LOADING](\n state: IWorkoutsState,\n loading: boolean\n ) {\n state.workoutData.loading = loading\n },\n [WORKOUTS_STORE.MUTATIONS.EMPTY_CALENDAR_WORKOUTS](state: IWorkoutsState) {\n state.calendar_workouts = []\n },\n [WORKOUTS_STORE.MUTATIONS.EMPTY_WORKOUTS](state: IWorkoutsState) {\n state.calendar_workouts = []\n state.user_workouts = []\n state.timeline_workouts = []\n },\n [WORKOUTS_STORE.MUTATIONS.EMPTY_WORKOUT](state: IWorkoutsState) {\n state.workoutData = {\n gpx: '',\n loading: false,\n workout: {},\n chartData: [],\n }\n },\n}\n","import { IWorkoutsState } from '@/store/modules/workouts/types'\nimport { IPagination } from '@/types/api'\nimport { IWorkout } from '@/types/workouts'\n\nexport const workoutsState: IWorkoutsState = {\n calendar_workouts: [],\n timeline_workouts: [],\n pagination: {},\n user_workouts: [],\n workoutData: {\n gpx: '',\n loading: false,\n workout: {},\n chartData: [],\n },\n}\n","import { Module } from 'vuex'\n\nimport { IRootState } from '@/store/modules/root/types'\nimport { actions } from '@/store/modules/workouts/actions'\nimport { getters } from '@/store/modules/workouts/getters'\nimport { mutations } from '@/store/modules/workouts/mutations'\nimport { workoutsState } from '@/store/modules/workouts/state'\nimport { IWorkoutsState } from '@/store/modules/workouts/types'\n\nconst workouts: Module = {\n state: workoutsState,\n actions,\n getters,\n mutations,\n}\n\nexport default workouts\n","import { Module, ModuleTree } from 'vuex'\n\nimport authUserModule from '@/store/modules/authUser'\nimport oAuthModule from '@/store/modules/oauth2'\nimport { actions } from '@/store/modules/root/actions'\nimport { getters } from '@/store/modules/root/getters'\nimport { mutations } from '@/store/modules/root/mutations'\nimport { state } from '@/store/modules/root/state'\nimport { IRootState } from '@/store/modules/root/types'\nimport sportsModule from '@/store/modules/sports'\nimport statsModule from '@/store/modules/statistics'\nimport usersModule from '@/store/modules/users'\nimport workoutsModule from '@/store/modules/workouts'\n\nconst modules: ModuleTree = {\n authUserModule,\n oAuthModule,\n sportsModule,\n statsModule,\n usersModule,\n workoutsModule,\n}\n\nconst root: Module = {\n state,\n actions,\n getters,\n mutations,\n modules,\n}\n\nexport default root\n","import { createStore } from 'vuex'\n\nimport root from '@/store/modules/root'\nimport { IRootState } from '@/store/modules/root/types'\n\nconst store = createStore(root)\n\nexport default store\n","export enum WorkoutsActions {\n ADD_WORKOUT = 'ADD_WORKOUT',\n ADD_WORKOUT_WITHOUT_GPX = 'ADD_WORKOUT_WITHOUT_GPX',\n DELETE_WORKOUT = 'DELETE_WORKOUT',\n EDIT_WORKOUT = 'EDIT_WORKOUT',\n GET_CALENDAR_WORKOUTS = 'GET_CALENDAR_WORKOUTS',\n GET_USER_WORKOUTS = 'GET_USER_WORKOUTS',\n GET_TIMELINE_WORKOUTS = 'GET_TIMELINE_WORKOUTS',\n GET_MORE_TIMELINE_WORKOUTS = 'GET_MORE_TIMELINE_WORKOUTS',\n GET_WORKOUT_DATA = 'GET_WORKOUT_DATA',\n}\n\nexport enum WorkoutsGetters {\n CALENDAR_WORKOUTS = 'CALENDAR_WORKOUTS',\n TIMELINE_WORKOUTS = 'TIMELINE_WORKOUTS',\n USER_WORKOUTS = 'USER_WORKOUTS',\n WORKOUT_DATA = 'WORKOUT_DATA',\n WORKOUTS_PAGINATION = 'WORKOUTS_PAGINATION',\n}\n\nexport enum WorkoutsMutations {\n ADD_TIMELINE_WORKOUTS = 'ADD_TIMELINE_WORKOUTS',\n EMPTY_WORKOUTS = 'EMPTY_WORKOUTS',\n EMPTY_CALENDAR_WORKOUTS = 'EMPTY_CALENDAR_WORKOUTS',\n EMPTY_WORKOUT = 'EMPTY_WORKOUT',\n SET_CALENDAR_WORKOUTS = 'SET_CALENDAR_WORKOUTS',\n SET_TIMELINE_WORKOUTS = 'SET_TIMELINE_WORKOUTS',\n SET_USER_WORKOUTS = 'SET_USER_WORKOUTS',\n SET_WORKOUT = 'SET_WORKOUT',\n SET_WORKOUT_GPX = 'SET_WORKOUT_GPX',\n SET_WORKOUT_CHART_DATA = 'SET_WORKOUT_CHART_DATA',\n SET_WORKOUT_LOADING = 'SET_WORKOUT_LOADING',\n SET_WORKOUTS_PAGINATION = 'SET_WORKOUTS_PAGINATION',\n}\n","import { useStore as VuexStore } from 'vuex'\n\nimport { Store } from '@/store/types'\n\nexport function useStore(): Store {\n return VuexStore() as Store\n}\n","import { LocationQuery } from 'vue-router'\n\nimport { IQueryOptions, TPaginationPayload } from '@/types/api'\n\nexport const sortList: string[] = ['asc', 'desc']\nexport const defaultPage = 1\nexport const defaultPerPage = 10\n\nexport const getNumberQueryValue = (\n queryValue: string | (string | null)[] | null,\n defaultValue: number\n): number => {\n return queryValue && typeof queryValue === 'string' && +queryValue > 0\n ? +queryValue\n : defaultValue\n}\n\nexport const getStringQueryValue = (\n queryValue: string | (string | null)[] | null,\n availableValues: string[],\n defaultValue: string\n): string => {\n return queryValue &&\n typeof queryValue === 'string' &&\n availableValues.includes(queryValue)\n ? queryValue\n : defaultValue\n}\n\nexport const getQuery = (\n locationQuery: LocationQuery,\n orderByList: string[],\n defaultOrderBy: string,\n options?: IQueryOptions\n): TPaginationPayload => {\n const queryOptions = options || {}\n const defaultSort = queryOptions.defaultSort || 'asc'\n const query = {}\n\n query.page = getNumberQueryValue(locationQuery.page, defaultPage)\n query.per_page = getNumberQueryValue(locationQuery.per_page, defaultPerPage)\n query.order = getStringQueryValue(locationQuery.order, sortList, defaultSort)\n query.order_by = getStringQueryValue(\n locationQuery.order_by,\n orderByList,\n defaultOrderBy\n )\n if (typeof locationQuery.q === 'string') {\n query.q = locationQuery.q\n } else {\n delete query.q\n }\n\n return query\n}\n\nexport const workoutsPayloadKeys = [\n 'from',\n 'to',\n 'ave_speed_from',\n 'ave_speed_to',\n 'max_speed_from',\n 'max_speed_to',\n 'distance_from',\n 'distance_to',\n 'duration_from',\n 'duration_to',\n 'sport_id',\n 'title'\n]\n\nconst getRange = (stop: number, start = 1): number[] => {\n return Array.from({ length: stop - start + 1 }, (_, i) => start + i)\n}\n\nexport const rangePagination = (\n pages: number,\n currentPage: number\n): (string | number)[] => {\n if (pages < 0) {\n return []\n }\n\n if (pages < 9) {\n return getRange(pages)\n }\n\n let pagination: (string | number)[] = [1, 2]\n if (currentPage < 4) {\n pagination = pagination.concat([3, 4, 5])\n } else if (currentPage < 6) {\n pagination = pagination.concat(getRange(currentPage + 2, 3))\n } else {\n pagination = pagination.concat(['...'])\n if (currentPage < pages - 2) {\n pagination = pagination.concat(getRange(currentPage + 2, currentPage - 2))\n }\n }\n if (currentPage + 2 <= pages - 2) {\n pagination = pagination.concat(['...'])\n pagination = pagination.concat(getRange(pages, pages - 1))\n } else {\n if (\n pagination[pagination.length - 1] !== '...' &&\n +pagination[pagination.length - 1] >= pages - 2 &&\n +pagination[pagination.length - 1] < pages\n ) {\n pagination = pagination.concat(\n getRange(pages, +pagination[pagination.length - 1] + 1)\n )\n } else {\n pagination = pagination.concat(\n getRange(\n pages,\n currentPage < pages - 3 ? currentPage + 3 : currentPage - 5\n )\n )\n }\n }\n\n return pagination\n}\n","import {\n addDays,\n addMonths,\n addYears,\n endOfMonth,\n endOfWeek,\n format,\n startOfMonth,\n startOfWeek,\n startOfYear,\n} from 'date-fns'\nimport { utcToZonedTime } from 'date-fns-tz'\n\nimport createI18n from '@/i18n'\nimport { localeFromLanguage } from '@/utils/locales'\n\nconst { locale } = createI18n.global\n\nexport const getStartDate = (\n duration: string,\n day: Date,\n weekStartingMonday: boolean\n): Date => {\n switch (duration) {\n case 'week':\n return startOfWeek(day, { weekStartsOn: weekStartingMonday ? 1 : 0 })\n case 'year':\n return startOfYear(day)\n case 'month':\n return startOfMonth(day)\n default:\n throw new Error(\n `Invalid duration, expected: \"week\", \"month\", \"year\", got: \"${duration}\"`\n )\n }\n}\n\nexport const incrementDate = (duration: string, day: Date): Date => {\n switch (duration) {\n case 'week':\n return addDays(day, 7)\n case 'year':\n return addYears(day, 1)\n case 'month':\n return addMonths(day, 1)\n default:\n throw new Error(\n `Invalid duration, expected: \"week\", \"month\", \"year\", got: \"${duration}\"`\n )\n }\n}\n\nexport const getDateWithTZ = (dateInUTC: string, tz: string): Date => {\n return utcToZonedTime(new Date(dateInUTC), tz)\n}\n\nexport const getCalendarStartAndEnd = (\n date: Date,\n weekStartingMonday: boolean\n): Record => {\n const monthStart = startOfMonth(date)\n const monthEnd = endOfMonth(date)\n const weekStartsOn = weekStartingMonday ? 1 : 0\n return {\n start: startOfWeek(monthStart, { weekStartsOn }),\n end: endOfWeek(monthEnd, { weekStartsOn }),\n }\n}\n\nexport const formatWorkoutDate = (\n dateTime: Date,\n dateFormat: string | null = null,\n timeFormat: string | null = null\n): Record => {\n if (!dateFormat) {\n dateFormat = 'yyyy/MM/dd'\n }\n dateFormat = getDateFormat(dateFormat, locale.value)\n if (!timeFormat) {\n timeFormat = 'HH:mm'\n }\n return {\n workout_date: format(dateTime, dateFormat, {\n locale: localeFromLanguage[locale.value],\n }),\n workout_time: format(dateTime, timeFormat),\n }\n}\n\nconst availableDateFormats = [\n 'MM/dd/yyyy',\n 'dd/MM/yyyy',\n 'yyyy-MM-dd',\n 'date_string',\n]\nexport const dateStringFormats: Record = {\n de: 'do MMM yyyy',\n en: 'MMM. do, yyyy',\n es: 'd MMM yyyy',\n fr: 'd MMM yyyy',\n gl: 'd MMM yyyy',\n it: 'd MMM yyyy',\n pl: 'd MMM yyyy',\n nb: 'do MMM yyyy',\n nl: 'd MMM yyyy',\n}\n\nexport const getDateFormat = (dateFormat: string, language: string): string => {\n return dateFormat === 'date_string' ? dateStringFormats[language] : dateFormat\n}\n\nexport const formatDate = (\n dateString: string,\n timezone: string,\n dateFormat: string,\n withTime = true,\n language: string | null = null,\n withSeconds = false\n): string => {\n if (!language) {\n language = locale.value\n }\n const timeFormat = withTime ? (withSeconds ? ' HH:mm:ss' : ' HH:mm') : ''\n return format(\n getDateWithTZ(dateString, timezone),\n `${getDateFormat(dateFormat, language)}${timeFormat}`,\n { locale: localeFromLanguage[language] }\n )\n}\n\nexport const availableDateFormatOptions = (\n inputDate: string,\n timezone: string,\n language: string | null = null\n) => {\n const l: string = language ? language : locale.value\n const options: Record[] = []\n availableDateFormats.map((df) => {\n const dateFormat = getDateFormat(df, l)\n options.push({\n label: `${dateFormat} - ${formatDate(\n inputDate,\n timezone,\n dateFormat,\n false,\n l\n )}`,\n value: df,\n })\n })\n return options\n}\n","const suffixes = ['bytes', 'KB', 'MB', 'GB', 'TB']\n\nexport const getReadableFileSize = (\n fileSize: number,\n asText = true\n): string | Record => {\n const i = Math.floor(Math.log(fileSize) / Math.log(1024))\n if (!fileSize) {\n return asText ? '0 bytes' : { size: '0', suffix: 'bytes' }\n }\n const size = (fileSize / Math.pow(1024, i)).toFixed(1)\n const suffix = suffixes[i]\n return asText ? `${size}${suffix}` : { size, suffix }\n}\n\nexport const getFileSizeInMB = (fileSize: number): number => {\n const value = fileSize / 1048576\n return (!fileSize && 0) || +value.toFixed(2)\n}\n","import { AxiosError } from 'axios'\nimport { ActionContext } from 'vuex'\n\nimport { AUTH_USER_STORE, ROOT_STORE } from '@/store/constants'\nimport { IAuthUserState } from '@/store/modules/authUser/types'\nimport { IOAuth2State } from '@/store/modules/oauth2/types'\nimport { IRootState } from '@/store/modules/root/types'\nimport { ISportsState } from '@/store/modules/sports/types'\nimport { IStatisticsState } from '@/store/modules/statistics/types'\nimport { IUsersState } from '@/store/modules/users/types'\nimport { IWorkoutsState } from '@/store/modules/workouts/types'\nimport { IApiErrorMessage } from '@/types/api'\n\nexport const getApiUrl = (): string => {\n return process.env.NODE_ENV === 'production'\n ? '/api/'\n : `${process.env.VUE_APP_API_URL}/api/`\n}\n\nexport const handleError = (\n context:\n | ActionContext\n | ActionContext\n | ActionContext\n | ActionContext\n | ActionContext\n | ActionContext\n | ActionContext,\n error: AxiosError | null,\n msg = 'UNKNOWN'\n): void => {\n // if request is cancelled, no error to display\n if (error && error.message === 'canceled') {\n return\n }\n\n const errorInfo: IApiErrorMessage | null =\n error?.response && error.response.data ? error.response.data : null\n\n // if stored token is blacklisted, disconnect user\n if (error?.response?.status === 401 && errorInfo?.error === 'invalid_token') {\n localStorage.removeItem('authToken')\n context.dispatch(AUTH_USER_STORE.ACTIONS.CHECK_AUTH_USER)\n return\n }\n\n const errorMessages = !error\n ? msg\n : error.response\n ? error.response.status === 413\n ? 'file size is greater than the allowed size'\n : errorInfo?.message\n ? errorInfo.message\n : msg\n : error.message\n ? error.message\n : msg\n context.commit(\n ROOT_STORE.MUTATIONS.SET_ERROR_MESSAGES,\n errorMessages.includes('\\n')\n ? errorMessages\n .split('\\n')\n .filter((m: string) => m !== '')\n .map((m: string) => `api.ERROR.${m}`)\n : `api.ERROR.${errorMessages}`\n )\n}\n","import linkifyHtml from 'linkify-html'\nimport sanitizeHtml from 'sanitize-html'\n\nexport const linkifyAndClean = (input: string): string => {\n return sanitizeHtml(linkifyHtml(input, { target: '_blank' }), {\n allowedTags: ['a'],\n disallowedTagsMode: 'escape',\n })\n}\n","/* eslint-disable import/no-duplicates */\nimport { Locale } from 'date-fns'\nimport { de, enUS, es, fr, gl, it, nb, nl, pl } from 'date-fns/locale'\n\nimport createI18n from '@/i18n'\n\nexport const localeFromLanguage: Record = {\n de: de,\n en: enUS,\n es: es,\n fr: fr,\n gl: gl,\n it: it,\n pl: pl,\n nb: nb,\n nl: nl,\n}\n\nexport const languageLabels: Record = {\n de: 'Deutsch',\n en: 'English',\n es: 'Español',\n fr: 'Français',\n gl: 'Galego',\n it: 'Italiano (87%)',\n nb: 'Norsk bokmål (36%)',\n nl: 'Nederlands',\n pl: 'Polski (43%)',\n}\n\nconst { availableLocales } = createI18n.global\nexport const availableLanguages = availableLocales.map((l) => {\n return { label: languageLabels[l], value: l }\n})\n","import { ISport, ITranslatedSport, TActiveStatus } from '@/types/sports'\nimport { IWorkout } from '@/types/workouts'\n\nexport const sportColors: Record = {\n 'Cycling (Sport)': '#4c9792',\n 'Cycling (Transport)': '#88af98',\n 'Cycling (Virtual)': '#64a360',\n Hiking: '#bb757c',\n 'Mountain Biking': '#d4b371',\n 'Mountain Biking (Electric)': '#fc9d6f',\n Mountaineering: '#48b3b7',\n Rowing: '#fcce72',\n Running: '#835b83',\n 'Skiing (Alpine)': '#67a4bd',\n 'Skiing (Cross Country)': '#9498d0',\n Snowshoes: '#5780a8',\n Trail: '#09a98a',\n Walking: '#838383',\n}\n\nexport const sportIdColors = (sports: ISport[]): Record => {\n const colors: Record = {}\n sports.map(\n (sport) =>\n (colors[sport.id] = sport.color ? sport.color : sportColors[sport.label])\n )\n return colors\n}\n\nconst sortSports = (a: ITranslatedSport, b: ITranslatedSport): number => {\n const sportATranslatedLabel = a.translatedLabel.toLowerCase()\n const sportBTranslatedLabel = b.translatedLabel.toLowerCase()\n return sportATranslatedLabel > sportBTranslatedLabel\n ? 1\n : sportATranslatedLabel < sportBTranslatedLabel\n ? -1\n : 0\n}\n\nexport const translateSports = (\n sports: ISport[],\n t: CallableFunction,\n activeStatus: TActiveStatus = 'all',\n sportsToInclude: number[] = []\n): ITranslatedSport[] =>\n sports\n .filter((sport) =>\n activeStatus === 'all'\n ? true\n : sportsToInclude.includes(sport.id) || sport[activeStatus]\n )\n .map((sport) => ({\n ...sport,\n translatedLabel: t(`sports.${sport.label}.LABEL`),\n }))\n .sort(sortSports)\n\nexport const getSportLabel = (workout: IWorkout, sports: ISport[]): string => {\n return sports\n .filter((sport) => sport.id === workout.sport_id)\n .map((sport) => sport.label)[0]\n}\n\nexport const getSportColor = (\n workout: IWorkout,\n sports: ISport[]\n): string | null => {\n return sports\n .filter((sport) => sport.id === workout.sport_id)\n .map((sport) => sport.color)[0]\n}\n","import {\n addMonths,\n addWeeks,\n addYears,\n endOfMonth,\n endOfWeek,\n endOfYear,\n format,\n startOfMonth,\n startOfWeek,\n startOfYear,\n subMonths,\n subWeeks,\n subYears,\n} from 'date-fns'\n\nimport createI18n from '@/i18n'\nimport { IChartDataset } from '@/types/chart'\nimport { ISport } from '@/types/sports'\nimport {\n IStatisticsChartData,\n IStatisticsDateParams,\n TStatisticsDatasetKeys,\n TStatisticsDatasets,\n TStatisticsFromApi,\n} from '@/types/statistics'\nimport { incrementDate, getStartDate, getDateFormat } from '@/utils/dates'\nimport { localeFromLanguage } from '@/utils/locales'\nimport { sportColors } from '@/utils/sports'\nimport { convertStatsDistance } from '@/utils/units'\n\nconst { locale } = createI18n.global\n\nconst dateFormats: Record> = {\n week: {\n api: 'yyyy-MM-dd',\n chart: 'MM/dd/yyyy',\n },\n month: {\n api: 'yyyy-MM',\n chart: 'MM/yyyy',\n },\n year: {\n api: 'yyyy',\n chart: 'yyyy',\n },\n}\n\nexport const datasetKeys: TStatisticsDatasetKeys[] = [\n 'average_speed',\n 'nb_workouts',\n 'total_duration',\n 'total_distance',\n 'total_ascent',\n 'total_descent',\n]\n\nexport const getDateKeys = (\n params: IStatisticsDateParams,\n weekStartingMonday: boolean\n): Date[] => {\n const days = []\n for (\n let day = getStartDate(params.duration, params.start, weekStartingMonday);\n day <= params.end;\n day = incrementDate(params.duration, day)\n ) {\n days.push(day)\n }\n return days\n}\n\nconst getStatisticsChartDataset = (\n sportLabel: string,\n color: string,\n isLineChart = false\n): IChartDataset => {\n const dataset: IChartDataset = {\n label: sportLabel,\n backgroundColor: [color],\n data: [],\n }\n if (isLineChart) {\n dataset.type = 'line'\n dataset.borderColor = [color]\n dataset.spanGaps = true\n }\n return dataset\n}\n\nexport const getDatasets = (displayedSports: ISport[]): TStatisticsDatasets => {\n const datasets: TStatisticsDatasets = {\n average_speed: [],\n nb_workouts: [],\n total_distance: [],\n total_duration: [],\n total_ascent: [],\n total_descent: [],\n }\n displayedSports.map((sport) => {\n const color = sport.color ? sport.color : sportColors[sport.label]\n datasets.average_speed.push(\n getStatisticsChartDataset(sport.label, color, true)\n )\n datasets.nb_workouts.push(getStatisticsChartDataset(sport.label, color))\n datasets.total_distance.push(getStatisticsChartDataset(sport.label, color))\n datasets.total_duration.push(getStatisticsChartDataset(sport.label, color))\n datasets.total_ascent.push(getStatisticsChartDataset(sport.label, color))\n datasets.total_descent.push(getStatisticsChartDataset(sport.label, color))\n })\n return datasets\n}\n\nexport const convertStatsValue = (\n datasetKey: TStatisticsDatasetKeys,\n value: number,\n useImperialUnits: boolean\n): number => {\n switch (datasetKey) {\n case 'average_speed':\n case 'total_distance':\n case 'total_ascent':\n case 'total_descent':\n return convertStatsDistance(\n ['average_speed', 'total_distance'].includes(datasetKey) ? 'km' : 'm',\n value,\n useImperialUnits\n )\n default:\n case 'nb_workouts':\n case 'total_duration':\n return value\n }\n}\n\nexport const formatStats = (\n params: IStatisticsDateParams,\n weekStartingMonday: boolean,\n sports: ISport[],\n displayedSportsId: number[],\n apiStats: TStatisticsFromApi,\n useImperialUnits: boolean,\n userDateFormat: string\n): IStatisticsChartData => {\n const dayKeys = getDateKeys(params, weekStartingMonday)\n const dateFormat = dateFormats[params.duration]\n const displayedSports = sports.filter((sport) =>\n displayedSportsId.includes(sport.id)\n )\n const labels: string[] = []\n const datasets = getDatasets(displayedSports)\n const sportsId: Record = {}\n displayedSports.map(\n (displayedSport) => (sportsId[displayedSport.label] = displayedSport.id)\n )\n\n dayKeys.map((key) => {\n const date: string = format(key, dateFormat.api)\n const label: string = format(\n key,\n params.duration === 'week'\n ? getDateFormat(userDateFormat, locale.value)\n : dateFormat.chart,\n { locale: localeFromLanguage[locale.value] }\n )\n labels.push(label)\n datasetKeys.map((datasetKey) => {\n datasets[datasetKey].map((dataset) => {\n dataset.data.push(\n date in apiStats && sportsId[dataset.label] in apiStats[date]\n ? convertStatsValue(\n datasetKey,\n apiStats[date][sportsId[dataset.label]][datasetKey],\n useImperialUnits\n )\n : datasetKey === 'average_speed'\n ? null\n : 0\n )\n })\n })\n })\n return {\n labels,\n datasets,\n }\n}\n\nexport const getStatsDateParams = (\n date: Date,\n timeFrame: string,\n weekStartingMonday: boolean\n): IStatisticsDateParams => {\n const weekStartsOn = weekStartingMonday ? 1 : 0\n const start =\n timeFrame === 'year'\n ? startOfYear(subYears(date, 9))\n : timeFrame === 'week'\n ? startOfWeek(subMonths(date, 2), { weekStartsOn })\n : startOfMonth(subMonths(date, 11)) // month\n const end =\n timeFrame === 'year'\n ? endOfYear(date)\n : timeFrame === 'week'\n ? endOfWeek(date, { weekStartsOn })\n : endOfMonth(date) // month\n return {\n duration: timeFrame,\n end,\n start,\n }\n}\n\nexport const updateChartParams = (\n chartParams: IStatisticsDateParams,\n backward: boolean,\n weekStartingMonday: boolean\n): IStatisticsDateParams => {\n const { duration, start, end } = chartParams\n const weekStartsOn = weekStartingMonday ? 1 : 0\n return {\n duration,\n end:\n duration === 'year'\n ? endOfYear(backward ? subYears(end, 1) : addYears(end, 1))\n : duration === 'week'\n ? endOfWeek(backward ? subWeeks(end, 1) : addWeeks(end, 1), {\n weekStartsOn,\n })\n : endOfMonth(backward ? subMonths(end, 1) : addMonths(end, 1)),\n start:\n duration === 'year'\n ? startOfYear(backward ? subYears(start, 1) : addYears(start, 1))\n : duration === 'week'\n ? startOfWeek(backward ? subWeeks(start, 1) : addWeeks(start, 1), {\n weekStartsOn,\n })\n : startOfMonth(backward ? subMonths(start, 1) : addMonths(start, 1)),\n }\n}\n","import { IUnit, TFactor, TUnit } from '@/types/units'\n\nexport const units: Record = {\n ft: {\n unit: 'ft',\n system: 'imperial',\n multiplier: 1,\n defaultTarget: 'm',\n },\n mi: {\n unit: 'mi',\n system: 'imperial',\n multiplier: 5280,\n defaultTarget: 'km',\n },\n m: {\n unit: 'm',\n system: 'metric',\n multiplier: 1,\n defaultTarget: 'ft',\n },\n km: {\n unit: 'm',\n system: 'metric',\n multiplier: 1000,\n defaultTarget: 'mi',\n },\n}\n\nconst factors: TFactor = {\n metric: {\n imperial: 3.280839895,\n metric: 1,\n },\n imperial: {\n metric: 1 / 3.280839895,\n imperial: 1,\n },\n}\n\nexport const convertDistance = (\n distance: number,\n from: TUnit,\n to: TUnit,\n digits: number | null = 3\n): number => {\n const unitFrom = units[from]\n const unitTo = units[to]\n const convertedDistance =\n (distance * unitFrom.multiplier * factors[unitFrom.system][unitTo.system]) /\n unitTo.multiplier\n if (digits !== null) {\n return parseFloat(convertedDistance.toFixed(digits))\n }\n return convertedDistance\n}\n\nexport const convertStatsDistance = (\n unitFrom: TUnit,\n value: number,\n useImperialUnits: boolean\n): number => {\n const unitTo = useImperialUnits ? units[unitFrom].defaultTarget : unitFrom\n return useImperialUnits ? convertDistance(value, unitFrom, unitTo, 2) : value\n}\n\nexport const getTemperature = (\n temperatureInCelsius: number,\n useImperialUnits: boolean\n): string => {\n const temperature = useImperialUnits\n ? temperatureInCelsius * 1.8 + 32\n : temperatureInCelsius\n const unit = useImperialUnits ? ' °F' : '°C'\n return `${temperature === 0 ? 0 : Number(temperature).toFixed(1)}${unit}`\n}\n\nexport const getWindSpeed = (\n windSpeedInMS: number,\n useImperialUnits: boolean\n): string => {\n const windSpeed = useImperialUnits ? windSpeedInMS * 2.2369363 : windSpeedInMS\n const unit = useImperialUnits ? ' mph' : 'm/s'\n return `${windSpeed === 0 ? 0 : Number(windSpeed).toFixed(1)}${unit}`\n}\n","import {\n IWorkout,\n IWorkoutApiChartData,\n IWorkoutChartData,\n TCoordinates,\n TWorkoutDatasets,\n} from '@/types/workouts'\nimport { convertStatsDistance } from '@/utils/units'\n\nexport const getDatasets = (\n chartData: IWorkoutApiChartData[],\n t: CallableFunction,\n useImperialUnits: boolean\n): IWorkoutChartData => {\n const datasets: TWorkoutDatasets = {\n speed: {\n label: t('workouts.SPEED'),\n backgroundColor: ['#FFFFFF'],\n borderColor: ['#8884d8'],\n borderWidth: 2,\n data: [],\n yAxisID: 'ySpeed',\n },\n elevation: {\n label: t('workouts.ELEVATION'),\n backgroundColor: ['#e5e5e5'],\n borderColor: ['#cccccc'],\n borderWidth: 1,\n fill: true,\n data: [],\n yAxisID: 'yElevation',\n },\n }\n const distance_labels: unknown[] = []\n const duration_labels: unknown[] = []\n const coordinates: TCoordinates[] = []\n\n chartData.map((data) => {\n distance_labels.push(\n convertStatsDistance('km', data.distance, useImperialUnits)\n )\n duration_labels.push(data.duration)\n datasets.speed.data.push(\n convertStatsDistance('km', data.speed, useImperialUnits)\n )\n datasets.elevation.data.push(\n convertStatsDistance('m', data.elevation, useImperialUnits)\n )\n coordinates.push({ latitude: data.latitude, longitude: data.longitude })\n })\n\n return { distance_labels, duration_labels, datasets, coordinates }\n}\n\nexport const getDonutDatasets = (\n workouts: IWorkout[]\n): Record> => {\n const total = workouts.length\n if (total === 0) {\n return {}\n }\n\n const datasets: Record> = {}\n workouts.map((workout) => {\n if (!datasets[workout.sport_id]) {\n datasets[workout.sport_id] = {\n count: 0,\n percentage: 0,\n }\n }\n datasets[workout.sport_id].count += 1\n datasets[workout.sport_id].percentage =\n datasets[workout.sport_id].count / total\n })\n\n return datasets\n}\n\nexport const defaultOrder = {\n order: 'desc',\n order_by: 'workout_date',\n}\n","\n\n\n","import { render } from \"./Card.vue?vue&type=template&id=ad374c24\"\nconst script = {}\n\nimport \"./Card.vue?vue&type=style&index=0&id=ad374c24&lang=scss\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { toDisplayString as _toDisplayString, unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-72463173\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"table-selects\" }\nconst _hoisted_2 = [\"value\"]\nconst _hoisted_3 = [\"value\"]\nconst _hoisted_4 = [\"value\"]\nconst _hoisted_5 = [\"value\"]\nconst _hoisted_6 = [\"value\"]\nconst _hoisted_7 = [\"value\"]\n\nimport { toRefs } from 'vue'\n\n import { TPaginationPayload } from '@/types/api'\n\n interface Props {\n order_by: string[]\n query: TPaginationPayload\n sort: string[]\n message: string\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'FilterSelects',\n props: {\n order_by: null,\n query: null,\n sort: null,\n message: null\n },\n emits: ['updateSelect'],\n setup(__props: any, { emit }) {\n\nconst props = __props as {\n order_by: string[]\n query: TPaginationPayload\n sort: string[]\n message: string\n };\n\n \n\n \n\n const { order_by, query, sort, message } = toRefs(props)\n const perPage = [10, 25, 50, 100]\n\n function onSelectUpdate(event: Event & { target: HTMLInputElement }) {\n emit('updateSelect', event.target.id, event.target.value)\n }\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"label\", null, [\n _createTextVNode(_toDisplayString(_ctx.$t('common.SELECTS.ORDER_BY.LABEL')) + \": \", 1),\n _createElementVNode(\"select\", {\n name: \"order_by\",\n id: \"order_by\",\n value: _unref(query).order_by,\n onChange: onSelectUpdate\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(order_by), (order) => {\n return (_openBlock(), _createElementBlock(\"option\", {\n value: order,\n key: order\n }, _toDisplayString(_ctx.$t(`${_unref(message)}.${order.toUpperCase()}`)), 9, _hoisted_3))\n }), 128))\n ], 40, _hoisted_2)\n ]),\n _createElementVNode(\"label\", null, [\n _createTextVNode(_toDisplayString(_ctx.$t('common.SELECTS.ORDER.LABEL')) + \": \", 1),\n _createElementVNode(\"select\", {\n name: \"order\",\n id: \"order\",\n value: _unref(query).order,\n onChange: onSelectUpdate\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(sort), (order) => {\n return (_openBlock(), _createElementBlock(\"option\", {\n value: order,\n key: order\n }, _toDisplayString(_ctx.$t(`common.SELECTS.ORDER.${order.toUpperCase()}`)), 9, _hoisted_5))\n }), 128))\n ], 40, _hoisted_4)\n ]),\n _createElementVNode(\"label\", null, [\n _createTextVNode(_toDisplayString(_ctx.$t('common.SELECTS.PER_PAGE.LABEL')) + \": \", 1),\n _createElementVNode(\"select\", {\n name: \"per_page\",\n id: \"per_page\",\n value: _unref(query).per_page,\n onChange: onSelectUpdate\n }, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(perPage, (nb) => {\n return _createElementVNode(\"option\", {\n value: nb,\n key: nb\n }, _toDisplayString(nb), 9, _hoisted_7)\n }), 64))\n ], 40, _hoisted_6)\n ])\n ]))\n}\n}\n\n})","import script from \"./FilterSelects.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./FilterSelects.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./FilterSelects.vue?vue&type=style&index=0&id=72463173&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-72463173\"]])\n\nexport default __exports__","\n\n\n","import { render } from \"./ErrorImg.vue?vue&type=template&id=e620aed4\"\nimport script from \"./ErrorImg.vue?vue&type=script&lang=js\"\nexport * from \"./ErrorImg.vue?vue&type=script&lang=js\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-b60bfa80\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { id: \"error\" }\nconst _hoisted_2 = { class: \"error-content\" }\n\nimport { toRefs, withDefaults } from 'vue'\n\n interface Props {\n title: string\n message: string\n buttonText: string\n path?: string\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'Error',\n props: {\n title: null,\n message: null,\n buttonText: null,\n path: { default: '/' }\n },\n setup(__props: any) {\n\nconst props = __props as { title: string, message: string, buttonText: string, path: string };\n\n \n const { buttonText, title, message, path } = toRefs(props)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"h1\", null, _toDisplayString(_unref(title)), 1),\n _createElementVNode(\"p\", null, _toDisplayString(_unref(message)), 1),\n (_unref(buttonText))\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 0,\n onClick: _cache[0] || (_cache[0] = ($event: any) => (_ctx.$router.push(_unref(path)))),\n class: \"upper\"\n }, _toDisplayString(_unref(buttonText)), 1))\n : _createCommentVNode(\"\", true)\n ])\n ]))\n}\n}\n\n})","import script from \"./Error.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./Error.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./Error.vue?vue&type=style&index=0&id=b60bfa80&scoped=true&lang=scss\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-b60bfa80\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode } from \"vue\"\n\nimport { Ref, onMounted, ref, toRefs, withDefaults, onUnmounted } from 'vue'\n\n import Error from '@/components/Common/Error.vue'\n interface Props {\n target?: string\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'NotFound',\n props: {\n target: { default: 'PAGE' }\n },\n setup(__props: any) {\n\nconst props = __props as { target: string };\n\n \n const { target } = toRefs(props)\n const timer = ref()\n const errorDisplayed: Ref = ref(false)\n\n onMounted(() => displayError())\n\n function displayError() {\n timer.value = setTimeout(() => {\n errorDisplayed.value = true\n }, 500)\n }\n\n onUnmounted(() => {\n if (timer.value) {\n clearTimeout(timer.value)\n }\n })\n\nreturn (_ctx: any,_cache: any) => {\n return (errorDisplayed.value)\n ? (_openBlock(), _createBlock(Error, {\n key: 0,\n title: \"404\",\n message: _ctx.$t(`error.NOT_FOUND.${_unref(target)}`),\n \"button-text\": _ctx.$t('common.HOME')\n }, null, 8, [\"message\", \"button-text\"]))\n : _createCommentVNode(\"\", true)\n}\n}\n\n})","import script from \"./NotFound.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./NotFound.vue?vue&type=script&setup=true&lang=ts\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderSlot as _renderSlot, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, normalizeClass as _normalizeClass, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-3a9a4a65\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n class: \"pagination-center\",\n \"aria-label\": \"navigation\"\n}\nconst _hoisted_2 = { class: \"pagination\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-chevron-left\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_4 = { key: 0 }\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-chevron-right\",\n \"aria-hidden\": \"true\"\n}, null, -1))\n\nimport { toRefs } from 'vue'\n\n import { IPagination, TPaginationPayload } from '@/types/api'\n import { IOauth2ClientsPayload } from '@/types/oauth'\n import { TWorkoutsPayload } from '@/types/workouts'\n import { rangePagination } from '@/utils/api'\n\n interface Props {\n pagination: IPagination\n path: string\n query: TWorkoutsPayload | TPaginationPayload | IOauth2ClientsPayload\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'Pagination',\n props: {\n pagination: null,\n path: null,\n query: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n pagination: IPagination\n path: string\n query: TWorkoutsPayload | TPaginationPayload | IOauth2ClientsPayload\n };\n\n \n\n const { pagination, path, query } = toRefs(props)\n\n function getQuery(\n page: number,\n cursor?: number\n ): TPaginationPayload | IOauth2ClientsPayload {\n const newQuery = Object.assign({}, query.value)\n newQuery.page = cursor ? page + cursor : page\n return newQuery\n }\n\nreturn (_ctx: any,_cache: any) => {\n const _component_router_link = _resolveComponent(\"router-link\")!\n\n return (_openBlock(), _createElementBlock(\"nav\", _hoisted_1, [\n _createElementVNode(\"ul\", _hoisted_2, [\n _createElementVNode(\"li\", {\n class: _normalizeClass([\"page-prev\", { disabled: !_unref(pagination).has_prev }])\n }, [\n _createVNode(_component_router_link, {\n class: \"page-link\",\n to: { path: _unref(path), query: getQuery(_unref(pagination).page, -1) },\n disabled: !_unref(pagination).has_prev\n }, {\n default: _withCtx(({ navigate }) => [\n _renderSlot(_ctx.$slots, \"default\", {\n onClick: ($event: any) => (_unref(pagination).has_next ? navigate : null)\n }, () => [\n _createTextVNode(_toDisplayString(_ctx.$t('api.PAGINATION.PREVIOUS')) + \" \", 1),\n _hoisted_3\n ])\n ]),\n _: 3\n }, 8, [\"to\", \"disabled\"])\n ], 2),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(rangePagination)(_unref(pagination).pages, _unref(pagination).page), (page) => {\n return (_openBlock(), _createElementBlock(\"li\", {\n key: page,\n class: _normalizeClass([\"page\", { active: page === _unref(pagination).page }])\n }, [\n (page === '...')\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_4, \" ... \"))\n : (_openBlock(), _createBlock(_component_router_link, {\n key: 1,\n class: \"page-link\",\n to: { path: _unref(path), query: getQuery(+page) }\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(page), 1)\n ]),\n _: 2\n }, 1032, [\"to\"]))\n ], 2))\n }), 128)),\n _createElementVNode(\"li\", {\n class: _normalizeClass([\"page-next\", { disabled: !_unref(pagination).has_next }])\n }, [\n _createVNode(_component_router_link, {\n class: \"page-link\",\n to: { path: _unref(path), query: getQuery(_unref(pagination).page, 1) },\n disabled: !_unref(pagination).has_next\n }, {\n default: _withCtx(({ navigate }) => [\n _renderSlot(_ctx.$slots, \"default\", {\n onClick: ($event: any) => (_unref(pagination).has_next ? navigate : null)\n }, () => [\n _createTextVNode(_toDisplayString(_ctx.$t('api.PAGINATION.NEXT')) + \" \", 1),\n _hoisted_5\n ])\n ]),\n _: 3\n }, 8, [\"to\", \"disabled\"])\n ], 2)\n ])\n ]))\n}\n}\n\n})","import script from \"./Pagination.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./Pagination.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./Pagination.vue?vue&type=style&index=0&id=3a9a4a65&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-3a9a4a65\"]])\n\nexport default __exports__","import { zxcvbnOptions } from '@zxcvbn-ts/core'\n\nexport const loadLanguagePackage = async (language: string) => {\n // no package available for\n // - Dutch (Nederlands)\n // - Galician\n // - Norwegian bokmal\n // fallback to english\n switch (language) {\n case 'fr':\n return await import(\n /* webpackChunkName: \"password.fr\" */ '@zxcvbn-ts/language-fr'\n )\n case 'de':\n return await import(\n /* webpackChunkName: \"password.de\" */ '@zxcvbn-ts/language-de'\n )\n case 'it':\n return await import(\n /* webpackChunkName: \"password.it\" */ '@zxcvbn-ts/language-it'\n )\n case 'es':\n return await import(\n /* webpackChunkName: \"password.es\" */ '@zxcvbn-ts/language-es-es'\n )\n case 'pl':\n return await import(\n /* webpackChunkName: \"password.pl\" */ '@zxcvbn-ts/language-pl'\n )\n default:\n return await import(\n /* webpackChunkName: \"password.en\" */ '@zxcvbn-ts/language-en'\n )\n }\n}\n\nexport const setZxcvbnOptions = async (language: string) => {\n const zxcvbnCommonPackage = await import(\n /* webpackChunkName: \"password\" */ '@zxcvbn-ts/language-common'\n )\n const zxcvbnLanguagePackage = await loadLanguagePackage(language)\n const options = {\n graphs: zxcvbnCommonPackage.adjacencyGraphs,\n dictionary: {\n ...zxcvbnCommonPackage.dictionary,\n ...zxcvbnLanguagePackage.dictionary,\n },\n }\n zxcvbnOptions.setOptions(options)\n}\n\nexport const getPasswordStrength = (strength: number): string => {\n switch (strength) {\n case 2:\n return 'AVERAGE'\n case 3:\n return 'GOOD'\n case 4:\n return 'STRONG'\n default:\n return 'WEAK'\n }\n}\n","import { defineComponent as _defineComponent } from 'vue'\nimport { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-74e71df5\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"password-strength\" }\nconst _hoisted_2 = [\"value\"]\nconst _hoisted_3 = {\n key: 0,\n class: \"password-strength-details\"\n}\nconst _hoisted_4 = { class: \"password-strength-value\" }\nconst _hoisted_5 = {\n key: 0,\n class: \"info-box\"\n}\nconst _hoisted_6 = { class: \"password-feedback\" }\n\nimport { zxcvbn } from '@zxcvbn-ts/core'\n import {\n ComputedRef,\n Ref,\n computed,\n ref,\n onBeforeMount,\n toRefs,\n watch,\n } from 'vue'\n\n import { AUTH_USER_STORE, ROOT_STORE } from '@/store/constants'\n import { useStore } from '@/use/useStore'\n import { getPasswordStrength, setZxcvbnOptions } from '@/utils/password'\n\n interface Props {\n password: string\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'PasswordStength',\n props: {\n password: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n password: string\n };\n\n \n const { password } = toRefs(props)\n\n const store = useStore()\n const language: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.LANGUAGE]\n )\n const isSuccess: ComputedRef = computed(\n () => store.getters[AUTH_USER_STORE.GETTERS.IS_SUCCESS]\n )\n const passwordScore: Ref = ref(0)\n const passwordStrength: Ref = ref('')\n const passwordSuggestions: Ref = ref([])\n const backgroundSize = ref('0% 100%')\n\n onBeforeMount(async () => await setZxcvbnOptions(language.value))\n\n function calculatePasswordStrength(password: string) {\n const zxcvbnResult = zxcvbn(password)\n passwordScore.value = zxcvbnResult.score\n passwordStrength.value = getPasswordStrength(passwordScore.value)\n passwordSuggestions.value = zxcvbnResult.feedback.suggestions\n backgroundSize.value = (passwordScore.value * 100) / 4 + '% 100%'\n }\n\n watch(\n () => language.value,\n async (newLanguageValue) => {\n await setZxcvbnOptions(newLanguageValue)\n }\n )\n watch(\n () => password.value,\n async (newPassword) => {\n if (isSuccess.value) {\n passwordStrength.value = ''\n } else {\n calculatePasswordStrength(newPassword)\n }\n }\n )\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"input\", {\n class: _normalizeClass([\"password-slider\", `strength-${passwordScore.value}`]),\n style: _normalizeStyle({ backgroundSize: backgroundSize.value }),\n type: \"range\",\n value: passwordScore.value,\n min: \"0\",\n max: \"4\",\n step: \"1\"\n }, null, 14, _hoisted_2),\n (passwordStrength.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_3, [\n _createElementVNode(\"span\", _hoisted_4, _toDisplayString(_ctx.$t('user.PASSWORD_STRENGTH.LABEL')) + \": \" + _toDisplayString(_ctx.$t(`user.PASSWORD_STRENGTH.${passwordStrength.value}`)), 1),\n (passwordSuggestions.value.length > 0)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_5, [\n _createElementVNode(\"ul\", _hoisted_6, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(passwordSuggestions.value, (suggestion) => {\n return (_openBlock(), _createElementBlock(\"li\", { key: suggestion }, _toDisplayString(_ctx.$t(`user.PASSWORD_STRENGTH.SUGGESTIONS.${suggestion}`)), 1))\n }), 128))\n ])\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./PasswordStength.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./PasswordStength.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./PasswordStength.vue?vue&type=style&index=0&id=74e71df5&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-74e71df5\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, vModelDynamic as _vModelDynamic, createElementVNode as _createElementVNode, withDirectives as _withDirectives, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5a126514\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"password-input\" }\nconst _hoisted_2 = [\"id\", \"disabled\", \"placeholder\", \"required\", \"type\"]\nconst _hoisted_3 = {\n key: 0,\n class: \"form-info\"\n}\nconst _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-info-circle\",\n \"aria-hidden\": \"true\"\n}, null, -1))\n\nimport { Ref, ref, toRefs, watch, withDefaults } from 'vue'\n\n import PasswordStrength from '@/components/Common/PasswordStength.vue'\n\n interface Props {\n checkStrength?: boolean\n disabled?: boolean\n id?: string\n password?: string\n placeholder?: string\n required?: boolean\n }\n\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'PasswordInput',\n props: {\n checkStrength: { type: Boolean, default: false },\n disabled: { type: Boolean, default: false },\n id: { default: 'password' },\n password: { default: '' },\n placeholder: null,\n required: { type: Boolean, default: false }\n },\n emits: ['updatePassword', 'passwordError'],\n setup(__props: any, { emit }) {\n\nconst props = __props as { checkStrength: boolean, disabled: boolean, id: string, password: string, placeholder?: string, required: boolean };\n\n \n const { checkStrength, disabled, id, password, placeholder, required } =\n toRefs(props)\n\n const showPassword: Ref = ref(false)\n const passwordValue: Ref = ref('')\n\n \n\n function togglePassword() {\n showPassword.value = !showPassword.value\n }\n function updatePassword(event: Event & { target: HTMLInputElement }) {\n emit('updatePassword', event.target.value)\n }\n function invalidPassword() {\n emit('passwordError')\n }\n\n watch(\n () => password.value,\n (newPassword) => {\n if (newPassword === '') {\n passwordValue.value = ''\n }\n }\n )\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _withDirectives(_createElementVNode(\"input\", {\n id: _unref(id),\n disabled: _unref(disabled),\n placeholder: _unref(placeholder),\n required: _unref(required),\n type: showPassword.value ? 'text' : 'password',\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((passwordValue).value = $event)),\n minlength: \"8\",\n onInput: updatePassword,\n onInvalid: invalidPassword\n }, null, 40, _hoisted_2), [\n [_vModelDynamic, passwordValue.value]\n ]),\n _createElementVNode(\"div\", {\n class: \"show-password\",\n onClick: togglePassword\n }, [\n _createTextVNode(_toDisplayString(_ctx.$t(`user.${showPassword.value ? 'HIDE' : 'SHOW'}_PASSWORD`)) + \" \", 1),\n _createElementVNode(\"i\", {\n class: _normalizeClass([\"fa\", `fa-eye${showPassword.value ? '-slash' : ''}`]),\n \"aria-hidden\": \"true\"\n }, null, 2)\n ]),\n (_unref(checkStrength))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_3, [\n _hoisted_4,\n _createTextVNode(\" \" + _toDisplayString(_ctx.$t('user.PASSWORD_INFO')), 1)\n ]))\n : _createCommentVNode(\"\", true),\n (_unref(checkStrength))\n ? (_openBlock(), _createBlock(PasswordStrength, {\n key: 1,\n password: passwordValue.value\n }, null, 8, [\"password\"]))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./PasswordInput.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./PasswordInput.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./PasswordInput.vue?vue&type=style&index=0&id=5a126514&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5a126514\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass } from \"vue\"\n\nconst _hoisted_1 = /*#__PURE__*/_createElementVNode(\"div\", { class: \"map-attribution\" }, [\n /*#__PURE__*/_createElementVNode(\"span\", { class: \"map-attribution-text\" }, \"©\"),\n /*#__PURE__*/_createElementVNode(\"a\", {\n class: \"map-attribution-text\",\n href: \"https://www.openstreetmap.org/copyright\",\n target: \"_blank\",\n rel: \"noopener noreferrer\"\n }, \" OpenStreetMap \")\n], -1)\n\nimport { toRefs, withDefaults } from 'vue'\n\n import { IWorkout } from '@/types/workouts'\n import { getApiUrl } from '@/utils'\n\n interface Props {\n workout: IWorkout\n displayHover?: boolean\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'StaticMap',\n props: {\n workout: null,\n displayHover: { type: Boolean, default: false }\n },\n setup(__props: any) {\n\nconst props = __props as { workout: IWorkout, displayHover: boolean };\n\n \n const { displayHover } = toRefs(props)\n const imageUrl = `${getApiUrl()}workouts/map/${props.workout.map}`\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"static-map\", { 'display-hover': _unref(displayHover) }])\n }, [\n (_unref(displayHover))\n ? (_openBlock(), _createElementBlock(\"img\", {\n key: 0,\n src: imageUrl,\n alt: \"\"\n }))\n : (_openBlock(), _createElementBlock(\"div\", {\n key: 1,\n class: \"bg-map-image\",\n style: _normalizeStyle({\n backgroundImage: `url(${imageUrl})`,\n })\n }, null, 4)),\n _hoisted_1\n ], 2))\n}\n}\n\n})","import script from \"./StaticMap.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./StaticMap.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./StaticMap.vue?vue&type=style&index=0&id=6b7e4baf&lang=scss\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-d5e9b348\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"start-chart\" }\nconst _hoisted_2 = { key: 0 }\nconst _hoisted_3 = { key: 1 }\nconst _hoisted_4 = { class: \"chart-radio\" }\nconst _hoisted_5 = [\"checked\"]\nconst _hoisted_6 = [\"checked\"]\nconst _hoisted_7 = [\"checked\"]\nconst _hoisted_8 = { key: 0 }\nconst _hoisted_9 = [\"checked\"]\nconst _hoisted_10 = { key: 1 }\nconst _hoisted_11 = [\"checked\"]\nconst _hoisted_12 = { key: 2 }\nconst _hoisted_13 = [\"checked\"]\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_Chart = _resolveComponent(\"Chart\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_ctx.hideChartIfNoData && _ctx.emptyStats)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, _toDisplayString(_ctx.$t('workouts.NO_WORKOUTS')), 1))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"label\", null, [\n _createElementVNode(\"input\", {\n type: \"radio\",\n name: \"total_distance\",\n checked: _ctx.displayedData === 'total_distance',\n onClick: _cache[0] || (_cache[0] = \n//@ts-ignore\n(...args) => (_ctx.updateDisplayData && _ctx.updateDisplayData(...args)))\n }, null, 8, _hoisted_5),\n _createTextVNode(\" \" + _toDisplayString(_ctx.$t('workouts.DISTANCE')), 1)\n ]),\n _createElementVNode(\"label\", null, [\n _createElementVNode(\"input\", {\n type: \"radio\",\n name: \"total_duration\",\n checked: _ctx.displayedData === 'total_duration',\n onClick: _cache[1] || (_cache[1] = \n//@ts-ignore\n(...args) => (_ctx.updateDisplayData && _ctx.updateDisplayData(...args)))\n }, null, 8, _hoisted_6),\n _createTextVNode(\" \" + _toDisplayString(_ctx.$t('workouts.DURATION')), 1)\n ]),\n _createElementVNode(\"label\", null, [\n _createElementVNode(\"input\", {\n type: \"radio\",\n name: \"nb_workouts\",\n checked: _ctx.displayedData === 'nb_workouts',\n onClick: _cache[2] || (_cache[2] = \n//@ts-ignore\n(...args) => (_ctx.updateDisplayData && _ctx.updateDisplayData(...args)))\n }, null, 8, _hoisted_7),\n _createTextVNode(\" \" + _toDisplayString(_ctx.$t('workouts.WORKOUT', 2)), 1)\n ]),\n (_ctx.fullStats)\n ? (_openBlock(), _createElementBlock(\"label\", _hoisted_8, [\n _createElementVNode(\"input\", {\n type: \"radio\",\n name: \"average_speed\",\n checked: _ctx.displayedData === 'average_speed',\n onClick: _cache[3] || (_cache[3] = \n//@ts-ignore\n(...args) => (_ctx.updateDisplayData && _ctx.updateDisplayData(...args)))\n }, null, 8, _hoisted_9),\n _createTextVNode(\" \" + _toDisplayString(_ctx.$t('workouts.AVERAGE_SPEED')), 1)\n ]))\n : _createCommentVNode(\"\", true),\n (_ctx.fullStats)\n ? (_openBlock(), _createElementBlock(\"label\", _hoisted_10, [\n _createElementVNode(\"input\", {\n type: \"radio\",\n name: \"total_ascent\",\n checked: _ctx.displayedData === 'total_ascent',\n onClick: _cache[4] || (_cache[4] = \n//@ts-ignore\n(...args) => (_ctx.updateDisplayData && _ctx.updateDisplayData(...args)))\n }, null, 8, _hoisted_11),\n _createTextVNode(\" \" + _toDisplayString(_ctx.$t('workouts.ASCENT')), 1)\n ]))\n : _createCommentVNode(\"\", true),\n (_ctx.fullStats)\n ? (_openBlock(), _createElementBlock(\"label\", _hoisted_12, [\n _createElementVNode(\"input\", {\n type: \"radio\",\n name: \"total_descent\",\n checked: _ctx.displayedData === 'total_descent',\n onClick: _cache[5] || (_cache[5] = \n//@ts-ignore\n(...args) => (_ctx.updateDisplayData && _ctx.updateDisplayData(...args)))\n }, null, 8, _hoisted_13),\n _createTextVNode(\" \" + _toDisplayString(_ctx.$t('workouts.DESCENT')), 1)\n ]))\n : _createCommentVNode(\"\", true)\n ]),\n (_ctx.labels.length > 0)\n ? (_openBlock(), _createBlock(_component_Chart, {\n key: 0,\n datasets: _ctx.datasets,\n labels: _ctx.labels,\n displayedData: _ctx.displayedData,\n displayedSportIds: _ctx.displayedSportIds,\n fullStats: _ctx.fullStats,\n useImperialUnits: _ctx.user.imperial_units\n }, null, 8, [\"datasets\", \"labels\", \"displayedData\", \"displayedSportIds\", \"fullStats\", \"useImperialUnits\"]))\n : _createCommentVNode(\"\", true)\n ]))\n ]))\n}","import { resolveComponent as _resolveComponent, mergeProps as _mergeProps, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"chart\" }\n\nexport function render(_ctx: any,_cache: any,$props: any,$setup: any,$data: any,$options: any) {\n const _component_BarChart = _resolveComponent(\"BarChart\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_BarChart, _mergeProps(_ctx.barChartProps, { class: \"bar-chart\" }), null, 16)\n ]))\n}","export const formatDuration = (\n totalSeconds: number,\n formatWithUnits = false\n): string => {\n let days = '0'\n if (formatWithUnits) {\n days = String(Math.floor(totalSeconds / 86400))\n totalSeconds %= 86400\n }\n const hours = String(Math.floor(totalSeconds / 3600)).padStart(2, '0')\n totalSeconds %= 3600\n const minutes = String(Math.floor(totalSeconds / 60)).padStart(2, '0')\n const seconds = String(totalSeconds % 60).padStart(2, '0')\n if (formatWithUnits) {\n return `${days === '0' ? '' : `${days}d `}${\n hours === '00' ? '' : `${hours}h `\n }${minutes}m ${seconds}s`\n }\n return `${hours === '00' ? '' : `${hours}:`}${minutes}:${seconds}`\n}\n","import { TStatisticsDatasetKeys } from '@/types/statistics'\nimport { formatDuration } from '@/utils/duration'\nimport { units } from '@/utils/units'\n\nexport const formatTooltipValue = (\n displayedData: TStatisticsDatasetKeys,\n value: number,\n useImperialUnits: boolean,\n formatWithUnits = true,\n unitFrom = 'km'\n): string => {\n const unitTo = useImperialUnits ? units[unitFrom].defaultTarget : unitFrom\n switch (displayedData) {\n case 'average_speed':\n return `${value.toFixed(2)} ${unitTo}/h`\n case 'total_duration':\n return formatDuration(value, formatWithUnits)\n case 'total_distance':\n case 'total_ascent':\n case 'total_descent':\n return `${value.toFixed(2)} ${unitTo}`\n default:\n return value.toString()\n }\n}\n","\n import { ChartOptions, LayoutItem } from 'chart.js'\n import { PropType, computed, defineComponent } from 'vue'\n import { BarChart, useBarChart } from 'vue-chart-3'\n import { useI18n } from 'vue-i18n'\n\n import { IChartDataset } from '@/types/chart'\n import { TStatisticsDatasetKeys } from '@/types/statistics'\n import { formatTooltipValue } from '@/utils/tooltip'\n\n export default defineComponent({\n name: 'Chart',\n components: {\n BarChart,\n },\n props: {\n datasets: {\n type: Object as PropType,\n required: true,\n },\n labels: {\n type: Object as PropType,\n required: true,\n },\n displayedData: {\n type: String as PropType,\n required: true,\n },\n displayedSportIds: {\n type: Array as PropType,\n required: true,\n },\n fullStats: {\n type: Boolean,\n required: true,\n },\n useImperialUnits: {\n type: Boolean,\n required: true,\n },\n },\n setup(props) {\n const { t } = useI18n()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function getNumber(value: any): number {\n return isNaN(value) ? 0 : +value\n }\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n function getSum(total: any, value: any): number {\n return getNumber(total) + getNumber(value)\n }\n function getUnit(displayedData: string) {\n return ['total_ascent', 'total_descent'].includes(displayedData)\n ? 'm'\n : 'km'\n }\n const chartData = computed(() => ({\n labels: props.labels,\n // workaround to avoid dataset modification\n datasets: JSON.parse(JSON.stringify(props.datasets)),\n }))\n const options = computed>(() => ({\n responsive: true,\n maintainAspectRatio: true,\n animation: false,\n layout: {\n padding: {\n top: props.fullStats ? 40 : 22,\n },\n },\n scales: {\n x: {\n stacked: true,\n grid: {\n drawOnChartArea: false,\n },\n },\n y: {\n stacked: props.displayedData !== 'average_speed',\n grid: {\n drawOnChartArea: false,\n },\n ticks: {\n maxTicksLimit: 6,\n callback: function (value) {\n return formatTooltipValue(\n props.displayedData,\n +value,\n props.useImperialUnits,\n false,\n getUnit(props.displayedData)\n )\n },\n },\n afterFit: function (scale: LayoutItem) {\n scale.width = props.fullStats ? 90 : 60\n },\n },\n },\n plugins: {\n datalabels: {\n anchor: 'end',\n align: 'end',\n color: function (context) {\n return props.displayedData === 'average_speed' &&\n context.dataset.backgroundColor\n ? // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n context.dataset.backgroundColor[0]\n : '#666666'\n },\n rotation: function (context) {\n return props.fullStats && context.chart.chartArea.width < 580\n ? 310\n : 0\n },\n display: function (context) {\n return props.fullStats && context.chart.chartArea.width < 300\n ? false\n : props.displayedData === 'average_speed'\n ? props.displayedSportIds.length == 1\n ? 'auto'\n : false\n : true\n },\n formatter: function (value, context) {\n if (props.displayedData === 'average_speed') {\n return formatTooltipValue(\n props.displayedData,\n value,\n props.useImperialUnits,\n false\n )\n } else {\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n const total: number = context.chart.data.datasets\n .map((d) => d.data[context.dataIndex])\n .reduce((total, value) => getSum(total, value), 0)\n return context.datasetIndex ===\n props.displayedSportIds.length - 1 && total > 0\n ? formatTooltipValue(\n props.displayedData,\n total,\n props.useImperialUnits,\n false,\n getUnit(props.displayedData)\n )\n : null\n }\n },\n },\n legend: {\n display: false,\n },\n tooltip: {\n interaction: {\n intersect: true,\n mode: 'index',\n position:\n props.displayedData === 'average_speed' ? 'nearest' : 'average',\n },\n filter: function (tooltipItem) {\n return tooltipItem.formattedValue !== '0'\n },\n callbacks: {\n label: function (context) {\n let label = t(`sports.${context.dataset.label}.LABEL`) || ''\n if (label) {\n label += ': '\n }\n if (context.parsed.y !== null) {\n label += formatTooltipValue(\n props.displayedData,\n context.parsed.y,\n props.useImperialUnits,\n true,\n getUnit(props.displayedData)\n )\n }\n return label\n },\n footer: function (tooltipItems) {\n if (props.displayedData === 'average_speed') {\n return ''\n }\n let sum = 0\n tooltipItems.map((tooltipItem) => {\n sum += tooltipItem.parsed.y\n })\n return (\n `${t('common.TOTAL')}: ` +\n formatTooltipValue(\n props.displayedData,\n sum,\n props.useImperialUnits,\n true,\n getUnit(props.displayedData)\n )\n )\n },\n },\n },\n },\n }))\n const { barChartProps } = useBarChart({\n chartData,\n options,\n })\n return { barChartProps }\n },\n })\n","import { render } from \"./Chart.vue?vue&type=template&id=1d43a4a8&ts=true\"\nimport script from \"./Chart.vue?vue&type=script&lang=ts\"\nexport * from \"./Chart.vue?vue&type=script&lang=ts\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render]])\n\nexport default __exports__","\n import { format } from 'date-fns'\n import {\n ComputedRef,\n PropType,\n Ref,\n computed,\n defineComponent,\n ref,\n watch,\n onBeforeMount,\n } from 'vue'\n\n import Chart from '@/components/Common/StatsChart/Chart.vue'\n import { STATS_STORE } from '@/store/constants'\n import { ISport } from '@/types/sports'\n import {\n IStatisticsChartData,\n TStatisticsDatasetKeys,\n IStatisticsDateParams,\n TStatisticsFromApi,\n IStatisticsParams,\n } from '@/types/statistics'\n import { IAuthUserProfile } from '@/types/user'\n import { useStore } from '@/use/useStore'\n import { formatStats } from '@/utils/statistics'\n\n export default defineComponent({\n name: 'UserMonthStats',\n components: {\n Chart,\n },\n props: {\n sports: {\n type: Object as PropType,\n required: true,\n },\n user: {\n type: Object as PropType,\n required: true,\n },\n chartParams: {\n type: Object as PropType,\n required: true,\n },\n displayedSportIds: {\n type: Array as PropType,\n default: () => [],\n },\n fullStats: {\n type: Boolean,\n default: false,\n },\n hideChartIfNoData: {\n type: Boolean,\n default: false,\n },\n },\n setup(props) {\n const store = useStore()\n\n const displayedData: Ref = ref('total_distance')\n const statistics: ComputedRef = computed(\n () => store.getters[STATS_STORE.GETTERS.USER_STATS]\n )\n const formattedStats: ComputedRef = computed(() =>\n formatStats(\n props.chartParams,\n props.user.weekm,\n props.sports,\n props.displayedSportIds,\n statistics.value,\n props.user.imperial_units,\n props.user.date_format\n )\n )\n\n onBeforeMount(() =>\n getStatistics(getApiParams(props.chartParams, props.user))\n )\n\n function getStatistics(apiParams: IStatisticsParams) {\n store.dispatch(STATS_STORE.ACTIONS.GET_USER_STATS, {\n username: props.user.username,\n filterType: 'by_time',\n params: apiParams,\n })\n }\n function updateDisplayData(\n event: Event & {\n target: HTMLInputElement & { name: TStatisticsDatasetKeys }\n }\n ) {\n displayedData.value = event.target.name\n }\n function getApiParams(\n chartParams: IStatisticsDateParams,\n user: IAuthUserProfile\n ): IStatisticsParams {\n return {\n from: format(chartParams.start, 'yyyy-MM-dd'),\n to: format(chartParams.end, 'yyyy-MM-dd'),\n time:\n chartParams.duration === 'week'\n ? `week${user.weekm ? 'm' : ''}`\n : chartParams.duration,\n }\n }\n\n watch(\n () => props.chartParams,\n async (newParams) => {\n getStatistics(getApiParams(newParams, props.user))\n }\n )\n\n return {\n datasets: computed(\n () => formattedStats.value.datasets[displayedData.value]\n ),\n labels: computed(() => formattedStats.value.labels),\n emptyStats: computed(() => Object.keys(statistics.value).length === 0),\n displayedData,\n updateDisplayData,\n }\n },\n })\n","import { render } from \"./index.vue?vue&type=template&id=d5e9b348&scoped=true&ts=true\"\nimport script from \"./index.vue?vue&type=script&lang=ts\"\nexport * from \"./index.vue?vue&type=script&lang=ts\"\n\nimport \"./index.vue?vue&type=style&index=0&id=d5e9b348&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-d5e9b348\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-20291951\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"box user-header\" }\nconst _hoisted_2 = { class: \"user-details\" }\nconst _hoisted_3 = { class: \"user-name\" }\nconst _hoisted_4 = { class: \"user-stats\" }\nconst _hoisted_5 = { class: \"user-stat\" }\nconst _hoisted_6 = { class: \"stat-number\" }\nconst _hoisted_7 = { class: \"stat-label\" }\nconst _hoisted_8 = { class: \"user-stat\" }\nconst _hoisted_9 = { class: \"stat-label\" }\nconst _hoisted_10 = { class: \"user-stat hide-small\" }\nconst _hoisted_11 = { class: \"stat-number\" }\nconst _hoisted_12 = { class: \"stat-label\" }\n\nimport { computed, ComputedRef, toRefs } from 'vue'\n\n import UserPicture from '@/components/User/UserPicture.vue'\n import { AUTH_USER_STORE } from '@/store/constants'\n import { IAuthUserProfile, IUserProfile } from '@/types/user'\n import { useStore } from '@/use/useStore'\n\n interface Props {\n user: IUserProfile\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'UserHeader',\n props: {\n user: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n user: IUserProfile\n };\n\n \n\n const { user } = toRefs(props)\n\n const store = useStore()\n\n const authUser: ComputedRef = computed(\n () => store.getters[AUTH_USER_STORE.GETTERS.AUTH_USER_PROFILE]\n )\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Distance = _resolveComponent(\"Distance\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(UserPicture, { user: _unref(user) }, null, 8, [\"user\"]),\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, _toDisplayString(_unref(user).username), 1),\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"div\", _hoisted_5, [\n _createElementVNode(\"span\", _hoisted_6, _toDisplayString(_unref(user).nb_workouts), 1),\n _createElementVNode(\"span\", _hoisted_7, _toDisplayString(_ctx.$t('workouts.WORKOUT', _unref(user).nb_workouts)), 1)\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _createVNode(_component_Distance, {\n distance: _unref(user).total_distance,\n unitFrom: \"km\",\n digits: 0,\n displayUnit: false,\n useImperialUnits: _unref(authUser).imperial_units\n }, null, 8, [\"distance\", \"useImperialUnits\"]),\n _createElementVNode(\"span\", _hoisted_9, _toDisplayString(_unref(authUser).imperial_units ? 'miles' : 'km'), 1)\n ]),\n _createElementVNode(\"div\", _hoisted_10, [\n _createElementVNode(\"span\", _hoisted_11, _toDisplayString(_unref(user).nb_sports), 1),\n _createElementVNode(\"span\", _hoisted_12, _toDisplayString(_ctx.$t('workouts.SPORT', _unref(user).nb_sports)), 1)\n ])\n ])\n ])\n ]))\n}\n}\n\n})","import script from \"./UserHeader.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./UserHeader.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./UserHeader.vue?vue&type=style&index=0&id=20291951&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-20291951\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementBlock as _createElementBlock, vModelText as _vModelText, createElementVNode as _createElementVNode, withDirectives as _withDirectives, createTextVNode as _createTextVNode, withModifiers as _withModifiers, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-217519af\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n id: \"user-infos\",\n class: \"description-list\"\n}\nconst _hoisted_2 = {\n key: 1,\n class: \"info-box success-message\"\n}\nconst _hoisted_3 = {\n key: 4,\n class: \"email-form form-box\"\n}\nconst _hoisted_4 = {\n class: \"form-items\",\n for: \"email\"\n}\nconst _hoisted_5 = {\n class: \"form-items\",\n for: \"email\"\n}\nconst _hoisted_6 = { class: \"form-buttons\" }\nconst _hoisted_7 = {\n class: \"confirm\",\n type: \"submit\"\n}\nconst _hoisted_8 = [\"onClick\"]\nconst _hoisted_9 = { key: 5 }\nconst _hoisted_10 = { class: \"user-bio\" }\nconst _hoisted_11 = {\n key: 0,\n class: \"profile-buttons\"\n}\nconst _hoisted_12 = [\"onClick\"]\nconst _hoisted_13 = {\n key: 1,\n class: \"profile-buttons\"\n}\n\nimport { format } from 'date-fns'\n import {\n ComputedRef,\n Ref,\n computed,\n ref,\n toRefs,\n withDefaults,\n watch,\n onUnmounted,\n } from 'vue'\n\n import { AUTH_USER_STORE, ROOT_STORE, USERS_STORE } from '@/store/constants'\n import { TAppConfig } from '@/types/application'\n import { IAuthUserProfile, IUserProfile } from '@/types/user'\n import { useStore } from '@/use/useStore'\n import { formatDate, getDateFormat } from '@/utils/dates'\n import { localeFromLanguage } from '@/utils/locales'\n\n interface Props {\n user: IUserProfile\n fromAdmin?: boolean\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'UserInfos',\n props: {\n user: null,\n fromAdmin: { type: Boolean, default: false }\n },\n setup(__props: any) {\n\nconst props = __props as { user: IUserProfile, fromAdmin: boolean };\n\n \n\n const store = useStore()\n\n const { user, fromAdmin } = toRefs(props)\n const language: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.LANGUAGE]\n )\n const authUser: ComputedRef = computed(\n () => store.getters[AUTH_USER_STORE.GETTERS.AUTH_USER_PROFILE]\n )\n const registrationDate = computed(() =>\n props.user.created_at\n ? formatDate(\n props.user.created_at,\n authUser.value.timezone,\n authUser.value.date_format\n )\n : ''\n )\n const birthDate = computed(() =>\n props.user.birth_date\n ? format(\n new Date(props.user.birth_date),\n `${getDateFormat(authUser.value.date_format, language.value)}`,\n { locale: localeFromLanguage[language.value] }\n )\n : ''\n )\n const isSuccess = computed(\n () => store.getters[USERS_STORE.GETTERS.USERS_IS_SUCCESS]\n )\n const errorMessages: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.ERROR_MESSAGES]\n )\n const appConfig: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.APP_CONFIG]\n )\n const displayModal: Ref = ref('')\n const formErrors = ref(false)\n const displayUserEmailForm: Ref = ref(false)\n const newUserEmail: Ref = ref('')\n const currentAction: Ref = ref('')\n\n function updateDisplayModal(value: string) {\n displayModal.value = value\n if (value !== '') {\n store.commit(USERS_STORE.MUTATIONS.UPDATE_IS_SUCCESS, false)\n }\n }\n function deleteUserAccount(username: string) {\n store.dispatch(USERS_STORE.ACTIONS.DELETE_USER_ACCOUNT, { username })\n }\n function resetUserPassword(username: string) {\n currentAction.value = 'password-reset'\n store.dispatch(USERS_STORE.ACTIONS.UPDATE_USER, {\n username,\n resetPassword: true,\n })\n }\n function confirmUserAccount(username: string) {\n store.dispatch(USERS_STORE.ACTIONS.UPDATE_USER, {\n username,\n activate: true,\n })\n }\n function displayEmailForm() {\n resetErrorsAndSuccess()\n newUserEmail.value = user.value.email_to_confirm\n ? user.value.email_to_confirm\n : ''\n displayUserEmailForm.value = true\n currentAction.value = 'email-update'\n }\n function hideEmailForm() {\n newUserEmail.value = ''\n displayUserEmailForm.value = false\n }\n function updateUserEmail(username: string) {\n store.dispatch(USERS_STORE.ACTIONS.UPDATE_USER, {\n username,\n new_email: newUserEmail.value,\n })\n }\n function resetErrorsAndSuccess() {\n store.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n store.commit(USERS_STORE.MUTATIONS.UPDATE_IS_SUCCESS, false)\n currentAction.value = ''\n }\n\n onUnmounted(() => resetErrorsAndSuccess())\n\n watch(\n () => isSuccess.value,\n (newIsSuccess) => {\n if (newIsSuccess) {\n updateDisplayModal('')\n hideEmailForm()\n }\n }\n )\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Modal = _resolveComponent(\"Modal\")!\n const _component_AlertMessage = _resolveComponent(\"AlertMessage\")!\n const _component_ErrorMessage = _resolveComponent(\"ErrorMessage\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (displayModal.value)\n ? (_openBlock(), _createBlock(_component_Modal, {\n key: 0,\n title: _ctx.$t('common.CONFIRMATION'),\n message: \n displayModal.value === 'delete'\n ? 'admin.CONFIRM_USER_ACCOUNT_DELETION'\n : 'admin.CONFIRM_USER_PASSWORD_RESET'\n ,\n strongMessage: _unref(user).username,\n onConfirmAction: _cache[0] || (_cache[0] = ($event: any) => (\n displayModal.value === 'delete'\n ? deleteUserAccount(_unref(user).username)\n : resetUserPassword(_unref(user).username)\n )),\n onCancelAction: _cache[1] || (_cache[1] = ($event: any) => (updateDisplayModal('')))\n }, null, 8, [\"title\", \"message\", \"strongMessage\"]))\n : _createCommentVNode(\"\", true),\n (_unref(isSuccess))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, _toDisplayString(_ctx.$t(\n `admin.${\n currentAction.value === 'password-reset'\n ? 'PASSWORD_RESET'\n : 'USER_EMAIL_UPDATE'\n }_SUCCESSFUL`\n )), 1))\n : _createCommentVNode(\"\", true),\n (!_unref(user).is_active)\n ? (_openBlock(), _createBlock(_component_AlertMessage, {\n key: 2,\n message: \"user.THIS_USER_ACCOUNT_IS_INACTIVE\"\n }))\n : _createCommentVNode(\"\", true),\n (_unref(errorMessages))\n ? (_openBlock(), _createBlock(_component_ErrorMessage, {\n key: 3,\n message: _unref(errorMessages)\n }, null, 8, [\"message\"]))\n : _createCommentVNode(\"\", true),\n (displayUserEmailForm.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_3, [\n _createElementVNode(\"form\", {\n class: _normalizeClass({ errors: formErrors.value }),\n onSubmit: _cache[4] || (_cache[4] = _withModifiers(($event: any) => (updateUserEmail(_unref(user).username)), [\"prevent\"]))\n }, [\n _createElementVNode(\"label\", _hoisted_4, [\n _createTextVNode(_toDisplayString(_ctx.$t('admin.CURRENT_EMAIL')) + \" \", 1),\n _withDirectives(_createElementVNode(\"input\", {\n id: \"email\",\n type: \"email\",\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = ($event: any) => ((_unref(user).email) = $event)),\n disabled: \"\"\n }, null, 512), [\n [_vModelText, _unref(user).email]\n ])\n ]),\n _createElementVNode(\"label\", _hoisted_5, [\n _createTextVNode(_toDisplayString(_ctx.$t('admin.NEW_EMAIL')) + \"* \", 1),\n _withDirectives(_createElementVNode(\"input\", {\n id: \"new-email\",\n type: \"email\",\n required: \"\",\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = ($event: any) => ((newUserEmail).value = $event))\n }, null, 512), [\n [_vModelText, newUserEmail.value]\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_6, [\n _createElementVNode(\"button\", _hoisted_7, _toDisplayString(_ctx.$t('buttons.SUBMIT')), 1),\n _createElementVNode(\"button\", {\n class: \"cancel\",\n onClick: _withModifiers(hideEmailForm, [\"prevent\"])\n }, _toDisplayString(_ctx.$t('buttons.CANCEL')), 9, _hoisted_8)\n ])\n ], 34)\n ]))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_9, [\n _createElementVNode(\"dl\", null, [\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('user.PROFILE.REGISTRATION_DATE')) + \":\", 1),\n _createElementVNode(\"dd\", null, _toDisplayString(_unref(registrationDate)), 1),\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('user.PROFILE.FIRST_NAME')) + \":\", 1),\n _createElementVNode(\"dd\", null, _toDisplayString(_unref(user).first_name), 1),\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('user.PROFILE.LAST_NAME')) + \":\", 1),\n _createElementVNode(\"dd\", null, _toDisplayString(_unref(user).last_name), 1),\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('user.PROFILE.BIRTH_DATE')) + \":\", 1),\n _createElementVNode(\"dd\", null, _toDisplayString(_unref(birthDate)), 1),\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('user.PROFILE.LOCATION')) + \":\", 1),\n _createElementVNode(\"dd\", null, _toDisplayString(_unref(user).location), 1),\n _createElementVNode(\"dt\", null, _toDisplayString(_ctx.$t('user.PROFILE.BIO')) + \":\", 1),\n _createElementVNode(\"dd\", _hoisted_10, _toDisplayString(_unref(user).bio), 1)\n ]),\n (_unref(fromAdmin))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_11, [\n (_unref(authUser).username !== _unref(user).username)\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 0,\n class: \"danger\",\n onClick: _cache[5] || (_cache[5] = _withModifiers(($event: any) => (updateDisplayModal('delete')), [\"prevent\"]))\n }, _toDisplayString(_ctx.$t('admin.DELETE_USER')), 1))\n : _createCommentVNode(\"\", true),\n (!_unref(user).is_active)\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 1,\n onClick: _cache[6] || (_cache[6] = _withModifiers(($event: any) => (confirmUserAccount(_unref(user).username)), [\"prevent\"]))\n }, _toDisplayString(_ctx.$t('admin.ACTIVATE_USER_ACCOUNT')), 1))\n : _createCommentVNode(\"\", true),\n (_unref(authUser).username !== _unref(user).username)\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 2,\n onClick: _withModifiers(displayEmailForm, [\"prevent\"])\n }, _toDisplayString(_ctx.$t('admin.UPDATE_USER_EMAIL')), 9, _hoisted_12))\n : _createCommentVNode(\"\", true),\n (\n _unref(authUser).username !== _unref(user).username &&\n _unref(appConfig).is_email_sending_enabled\n )\n ? (_openBlock(), _createElementBlock(\"button\", {\n key: 3,\n onClick: _cache[7] || (_cache[7] = _withModifiers(($event: any) => (updateDisplayModal('reset')), [\"prevent\"]))\n }, _toDisplayString(_ctx.$t('admin.RESET_USER_PASSWORD')), 1))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"button\", {\n onClick: _cache[8] || (_cache[8] = ($event: any) => (_ctx.$router.go(-1)))\n }, _toDisplayString(_ctx.$t('buttons.BACK')), 1)\n ]))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_13, [\n _createElementVNode(\"button\", {\n onClick: _cache[9] || (_cache[9] = ($event: any) => (_ctx.$router.push('/profile/edit')))\n }, _toDisplayString(_ctx.$t('user.PROFILE.EDIT')), 1),\n _createElementVNode(\"button\", {\n onClick: _cache[10] || (_cache[10] = ($event: any) => (_ctx.$router.push('/')))\n }, _toDisplayString(_ctx.$t('common.HOME')), 1)\n ]))\n ]))\n ]))\n}\n}\n\n})","import script from \"./UserInfos.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./UserInfos.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./UserInfos.vue?vue&type=style&index=0&id=217519af&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-217519af\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, createElementBlock as _createElementBlock, vModelText as _vModelText, withDirectives as _withDirectives, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, vModelCheckbox as _vModelCheckbox, withCtx as _withCtx, createVNode as _createVNode, withModifiers as _withModifiers, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-4f112f24\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { id: \"user-form\" }\nconst _hoisted_2 = {\n key: 2,\n class: \"info-box success-message\"\n}\nconst _hoisted_3 = { class: \"form-items\" }\nconst _hoisted_4 = [\"disabled\", \"placeholder\"]\nconst _hoisted_5 = {\n key: 1,\n class: \"form-info\"\n}\nconst _hoisted_6 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-info-circle\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_7 = [\"disabled\", \"placeholder\"]\nconst _hoisted_8 = {\n key: 3,\n class: \"form-info\"\n}\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-info-circle\",\n \"aria-hidden\": \"true\"\n}, null, -1))\nconst _hoisted_10 = {\n key: 5,\n for: \"accepted_policy\",\n class: \"accepted_policy\"\n}\nconst _hoisted_11 = [\"disabled\"]\nconst _hoisted_12 = [\"disabled\"]\nconst _hoisted_13 = { key: 3 }\nconst _hoisted_14 = { key: 0 }\nconst _hoisted_15 = { key: 4 }\nconst _hoisted_16 = { class: \"account\" }\nconst _hoisted_17 = { key: 5 }\n\nimport {\n ComputedRef,\n computed,\n onUnmounted,\n reactive,\n ref,\n toRefs,\n watch,\n withDefaults,\n } from 'vue'\n import { useRoute } from 'vue-router'\n\n import PasswordInput from '@/components/Common/PasswordInput.vue'\n import { AUTH_USER_STORE, ROOT_STORE } from '@/store/constants'\n import { TAppConfig } from '@/types/application'\n import { ILoginRegisterFormData } from '@/types/user'\n import { useStore } from '@/use/useStore'\n\n interface Props {\n action: string\n token?: string\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'UserAuthForm',\n props: {\n action: null,\n token: { default: '' }\n },\n setup(__props: any) {\n\nconst props = __props as { action: string, token: string };\n\n \n\n const route = useRoute()\n const store = useStore()\n\n const { action } = toRefs(props)\n const formData: ILoginRegisterFormData = reactive({\n username: '',\n email: '',\n password: '',\n accepted_policy: false\n })\n const buttonText: ComputedRef = computed(() =>\n getButtonText(props.action)\n )\n const errorMessages: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.ERROR_MESSAGES]\n )\n const isRegistrationSuccess: ComputedRef = computed(\n () => store.getters[AUTH_USER_STORE.GETTERS.IS_REGISTRATION_SUCCESS]\n )\n const isSuccess: ComputedRef = computed(\n () => store.getters[AUTH_USER_STORE.GETTERS.IS_SUCCESS]\n )\n const appConfig: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.APP_CONFIG]\n )\n const language: ComputedRef = computed(\n () => store.getters[ROOT_STORE.GETTERS.LANGUAGE]\n )\n const registration_disabled: ComputedRef = computed(\n () =>\n props.action === 'register' && !appConfig.value.is_registration_enabled\n )\n const sendingEmailDisabled: ComputedRef = computed(\n () =>\n ['reset-request', 'account-confirmation-resend'].includes(props.action) &&\n !appConfig.value.is_email_sending_enabled\n )\n const formErrors = ref(false)\n\n function getButtonText(action: string): string {\n switch (action) {\n case 'reset-request':\n case 'reset':\n return 'buttons.SUBMIT'\n default:\n return `buttons.${props.action.toUpperCase()}`\n }\n }\n function invalidateForm() {\n formErrors.value = true\n }\n function updatePassword(password: string) {\n formData.password = password\n }\n function onSubmit(actionType: string) {\n switch (actionType) {\n case 'reset':\n if (!props.token) {\n return store.commit(\n ROOT_STORE.MUTATIONS.SET_ERROR_MESSAGES,\n 'user.INVALID_TOKEN'\n )\n }\n return store.dispatch(AUTH_USER_STORE.ACTIONS.RESET_USER_PASSWORD, {\n password: formData.password,\n token: props.token,\n })\n case 'reset-request':\n return store.dispatch(\n AUTH_USER_STORE.ACTIONS.SEND_PASSWORD_RESET_REQUEST,\n {\n email: formData.email,\n }\n )\n case 'account-confirmation-resend':\n return store.dispatch(\n AUTH_USER_STORE.ACTIONS.RESEND_ACCOUNT_CONFIRMATION_EMAIL,\n {\n email: formData.email,\n }\n )\n default:\n formData['language'] = language.value\n store.dispatch(AUTH_USER_STORE.ACTIONS.LOGIN_OR_REGISTER, {\n actionType,\n formData,\n redirectUrl: route.query.from,\n })\n }\n }\n function resetFormData() {\n formData.username = ''\n formData.email = ''\n formData.password = ''\n formData.accepted_policy = false\n }\n\n onUnmounted(() => store.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES))\n\n watch(\n () => route.path,\n async () => {\n store.commit(ROOT_STORE.MUTATIONS.EMPTY_ERROR_MESSAGES)\n store.commit(AUTH_USER_STORE.MUTATIONS.UPDATE_IS_SUCCESS, false)\n store.commit(\n AUTH_USER_STORE.MUTATIONS.UPDATE_IS_REGISTRATION_SUCCESS,\n false\n )\n formErrors.value = false\n resetFormData()\n }\n )\n\nreturn (_ctx: any,_cache: any) => {\n const _component_AlertMessage = _resolveComponent(\"AlertMessage\")!\n const _component_router_link = _resolveComponent(\"router-link\")!\n const _component_i18n_t = _resolveComponent(\"i18n-t\")!\n const _component_ErrorMessage = _resolveComponent(\"ErrorMessage\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n id: \"user-auth-form\",\n class: _normalizeClass(`${\n ['reset', 'reset-request'].includes(_unref(action)) ? _unref(action) : 'user-form'\n }`)\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"form-box\", {\n disabled: _unref(registration_disabled),\n }])\n }, [\n (_unref(registration_disabled))\n ? (_openBlock(), _createBlock(_component_AlertMessage, {\n key: 0,\n message: \"user.REGISTER_DISABLED\"\n }))\n : _createCommentVNode(\"\", true),\n (_unref(sendingEmailDisabled))\n ? (_openBlock(), _createBlock(_component_AlertMessage, {\n key: 1,\n message: \"admin.EMAIL_SENDING_DISABLED\"\n }))\n : _createCommentVNode(\"\", true),\n (_unref(isSuccess) || _unref(isRegistrationSuccess))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, _toDisplayString(_ctx.$t(\n `user.PROFILE.SUCCESSFUL_${\n _unref(isRegistrationSuccess)\n ? `REGISTRATION${\n _unref(appConfig).is_email_sending_enabled ? '_WITH_EMAIL' : ''\n }`\n : 'UPDATE'\n }`\n )), 1))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"form\", {\n class: _normalizeClass({ errors: formErrors.value }),\n onSubmit: _cache[3] || (_cache[3] = _withModifiers(($event: any) => (onSubmit(_unref(action))), [\"prevent\"]))\n }, [\n _createElementVNode(\"div\", _hoisted_3, [\n (_unref(action) === 'register')\n ? _withDirectives((_openBlock(), _createElementBlock(\"input\", {\n key: 0,\n id: \"username\",\n disabled: _unref(registration_disabled),\n required: \"\",\n pattern: \"[a-zA-Z0-9_]+\",\n minlength: \"3\",\n maxlength: \"30\",\n onInvalid: invalidateForm,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = ($event: any) => ((formData.username) = $event)),\n placeholder: _ctx.$t('user.USERNAME')\n }, null, 40, _hoisted_4)), [\n [_vModelText, formData.username]\n ])\n : _createCommentVNode(\"\", true),\n (_unref(action) === 'register')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_5, [\n _hoisted_6,\n _createTextVNode(\" \" + _toDisplayString(_ctx.$t('user.USERNAME_INFO')), 1)\n ]))\n : _createCommentVNode(\"\", true),\n (_unref(action) !== 'reset')\n ? _withDirectives((_openBlock(), _createElementBlock(\"input\", {\n key: 2,\n id: \"email\",\n disabled: _unref(registration_disabled) || _unref(sendingEmailDisabled),\n required: \"\",\n onInvalid: invalidateForm,\n type: \"email\",\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = ($event: any) => ((formData.email) = $event)),\n placeholder: _ctx.$t('user.EMAIL')\n }, null, 40, _hoisted_7)), [\n [_vModelText, formData.email]\n ])\n : _createCommentVNode(\"\", true),\n (\n [\n 'reset-request',\n 'register',\n 'account-confirmation-resend',\n ].includes(_unref(action))\n )\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_8, [\n _hoisted_9,\n _createTextVNode(\" \" + _toDisplayString(_ctx.$t('user.EMAIL_INFO')), 1)\n ]))\n : _createCommentVNode(\"\", true),\n (\n !['account-confirmation-resend', 'reset-request'].includes(\n _unref(action)\n )\n )\n ? (_openBlock(), _createBlock(PasswordInput, {\n key: 4,\n disabled: _unref(registration_disabled),\n required: true,\n placeholder: \n _unref(action) === 'reset'\n ? _ctx.$t('user.ENTER_PASSWORD')\n : _ctx.$t('user.PASSWORD')\n ,\n password: formData.password,\n checkStrength: ['reset', 'register'].includes(_unref(action)),\n onUpdatePassword: updatePassword,\n onPasswordError: invalidateForm\n }, null, 8, [\"disabled\", \"placeholder\", \"password\", \"checkStrength\"]))\n : _createCommentVNode(\"\", true),\n (_unref(action) === 'register')\n ? (_openBlock(), _createElementBlock(\"label\", _hoisted_10, [\n _withDirectives(_createElementVNode(\"input\", {\n type: \"checkbox\",\n id: \"accepted_policy\",\n disabled: _unref(registration_disabled),\n required: \"\",\n onInvalid: invalidateForm,\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = ($event: any) => ((formData.accepted_policy) = $event))\n }, null, 40, _hoisted_11), [\n [_vModelCheckbox, formData.accepted_policy]\n ]),\n _createElementVNode(\"span\", null, [\n _createVNode(_component_i18n_t, { keypath: \"user.READ_AND_ACCEPT_PRIVACY_POLICY\" }, {\n default: _withCtx(() => [\n _createVNode(_component_router_link, {\n to: \"/privacy-policy\",\n target: \"_blank\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('privacy_policy.TITLE')), 1)\n ]),\n _: 1\n })\n ]),\n _: 1\n })\n ])\n ]))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"button\", {\n type: \"submit\",\n disabled: _unref(registration_disabled) || _unref(sendingEmailDisabled)\n }, _toDisplayString(_ctx.$t(_unref(buttonText))), 9, _hoisted_12)\n ], 34),\n (_unref(action) === 'login')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_13, [\n _createVNode(_component_router_link, {\n class: \"links\",\n to: \"/register\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('user.REGISTER')), 1)\n ]),\n _: 1\n }),\n (_unref(appConfig).is_email_sending_enabled)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_14, \"-\"))\n : _createCommentVNode(\"\", true),\n (_unref(appConfig).is_email_sending_enabled)\n ? (_openBlock(), _createBlock(_component_router_link, {\n key: 1,\n class: \"links\",\n to: \"/password-reset/request\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('user.PASSWORD_FORGOTTEN')), 1)\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true)\n ]))\n : _createCommentVNode(\"\", true),\n (_unref(action) === 'register')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_15, [\n _createElementVNode(\"span\", _hoisted_16, _toDisplayString(_ctx.$t('user.ALREADY_HAVE_ACCOUNT')), 1),\n _createVNode(_component_router_link, {\n class: \"links\",\n to: \"/login\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('user.LOGIN')), 1)\n ]),\n _: 1\n })\n ]))\n : _createCommentVNode(\"\", true),\n (\n ['login', 'register'].includes(_unref(action)) &&\n _unref(appConfig).is_email_sending_enabled\n )\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_17, [\n _createVNode(_component_router_link, {\n class: \"links\",\n to: \"/account-confirmation/resend\"\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_ctx.$t('user.ACCOUNT_CONFIRMATION_NOT_RECEIVED')), 1)\n ]),\n _: 1\n })\n ]))\n : _createCommentVNode(\"\", true),\n (_unref(errorMessages))\n ? (_openBlock(), _createBlock(_component_ErrorMessage, {\n key: 6,\n message: _unref(errorMessages)\n }, null, 8, [\"message\"]))\n : _createCommentVNode(\"\", true)\n ], 2)\n ])\n ], 2))\n}\n}\n\n})","import script from \"./UserAuthForm.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./UserAuthForm.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./UserAuthForm.vue?vue&type=style&index=0&id=4f112f24&scoped=true&lang=scss\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-4f112f24\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"user-picture\" }\nconst _hoisted_2 = [\"alt\", \"src\"]\nconst _hoisted_3 = {\n key: 1,\n class: \"no-picture\"\n}\nconst _hoisted_4 = /*#__PURE__*/_createElementVNode(\"i\", {\n class: \"fa fa-user-circle-o\",\n \"aria-hidden\": \"true\"\n}, null, -1)\nconst _hoisted_5 = [\n _hoisted_4\n]\n\nimport { computed } from 'vue'\n\n import { IUserProfile } from '@/types/user'\n import { getApiUrl } from '@/utils'\n\n interface Props {\n user: IUserProfile\n }\n \nexport default /*#__PURE__*/_defineComponent({\n __name: 'UserPicture',\n props: {\n user: null\n },\n setup(__props: any) {\n\nconst props = __props as {\n user: IUserProfile\n };\n\n \n\n const authUserPictureUrl = computed(() =>\n props.user.picture\n ? `${getApiUrl()}users/${props.user.username}/picture?${Date.now()}`\n : ''\n )\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_unref(authUserPictureUrl) !== '')\n ? (_openBlock(), _createElementBlock(\"img\", {\n key: 0,\n class: \"profile-user-img\",\n alt: _ctx.$t('user.USER_PICTURE'),\n src: _unref(authUserPictureUrl)\n }, null, 8, _hoisted_2))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_3, _hoisted_5))\n ]))\n}\n}\n\n})","import script from \"./UserPicture.vue?vue&type=script&setup=true&lang=ts\"\nexport * from \"./UserPicture.vue?vue&type=script&setup=true&lang=ts\"\n\nimport \"./UserPicture.vue?vue&type=style&index=0&id=26bea286&lang=scss\"\n\nconst __exports__ = script;\n\nexport default __exports__","\n\n\n","import { render } from \"./NoWorkouts.vue?vue&type=template&id=4b4d15fb&scoped=true\"\nconst script = {}\n\nimport \"./NoWorkouts.vue?vue&type=style&index=0&id=4b4d15fb&lang=scss&scoped=true\"\n\nimport exportComponent from \"/mnt/data-lnx/Devs/00_Perso/FitTrackee/fittrackee_client/node_modules/vue-loader/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-4b4d15fb\"]])\n\nexport default __exports__","var map = {\n\t\"./de/de.ts\": 3010,\n\t\"./en/en.ts\": 2709,\n\t\"./es/es.ts\": 3429,\n\t\"./fr/fr.ts\": 5479,\n\t\"./gl/gl.ts\": 6338,\n\t\"./it/it.ts\": 6013,\n\t\"./nb/nb.ts\": 1901,\n\t\"./nl/nl.ts\": 3726,\n\t\"./pl/pl.ts\": 5381\n};\n\n\nfunction webpackContext(req) {\n\tvar id = webpackContextResolve(req);\n\treturn __webpack_require__(id);\n}\nfunction webpackContextResolve(req) {\n\tif(!__webpack_require__.o(map, req)) {\n\t\tvar e = new Error(\"Cannot find module '\" + req + \"'\");\n\t\te.code = 'MODULE_NOT_FOUND';\n\t\tthrow e;\n\t}\n\treturn map[req];\n}\nwebpackContext.keys = function webpackContextKeys() {\n\treturn Object.keys(map);\n};\nwebpackContext.resolve = webpackContextResolve;\nmodule.exports = webpackContext;\nwebpackContext.id = 4612;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = function(module) {\n\tvar getter = module && module.__esModule ?\n\t\tfunction() { return module['default']; } :\n\t\tfunction() { return module; };\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","var getProto = Object.getPrototypeOf ? function(obj) { return Object.getPrototypeOf(obj); } : function(obj) { return obj.__proto__; };\nvar leafPrototypes;\n// create a fake namespace object\n// mode & 1: value is a module id, require it\n// mode & 2: merge all properties of value into the ns\n// mode & 4: return value when already ns object\n// mode & 16: return value when it's Promise-like\n// mode & 8|1: behave like require\n__webpack_require__.t = function(value, mode) {\n\tif(mode & 1) value = this(value);\n\tif(mode & 8) return value;\n\tif(typeof value === 'object' && value) {\n\t\tif((mode & 4) && value.__esModule) return value;\n\t\tif((mode & 16) && typeof value.then === 'function') return value;\n\t}\n\tvar ns = Object.create(null);\n\t__webpack_require__.r(ns);\n\tvar def = {};\n\tleafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];\n\tfor(var current = mode & 2 && value; typeof current == 'object' && !~leafPrototypes.indexOf(current); current = getProto(current)) {\n\t\tObject.getOwnPropertyNames(current).forEach(function(key) { def[key] = function() { return value[key]; }; });\n\t}\n\tdef['default'] = function() { return value; };\n\t__webpack_require__.d(ns, def);\n\treturn ns;\n};","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.f = {};\n// This file contains only the entry chunk.\n// The chunk loading function for additional chunks\n__webpack_require__.e = function(chunkId) {\n\treturn Promise.all(Object.keys(__webpack_require__.f).reduce(function(promises, key) {\n\t\t__webpack_require__.f[key](chunkId, promises);\n\t\treturn promises;\n\t}, []));\n};","// This function allow to reference async chunks\n__webpack_require__.u = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"static/js/\" + ({\"24\":\"reset\",\"193\":\"statistics\",\"222\":\"password.fr\",\"261\":\"password.en\",\"328\":\"admin\",\"394\":\"password.es\",\"401\":\"workouts\",\"802\":\"password.it\",\"845\":\"profile\",\"881\":\"password\",\"940\":\"password.de\",\"946\":\"password.pl\"}[chunkId] || chunkId) + \".\" + {\"24\":\"f26118ce\",\"93\":\"df2db3a3\",\"193\":\"ec64386f\",\"222\":\"eca0ec1d\",\"243\":\"03fdd6a3\",\"261\":\"4b788215\",\"328\":\"757bc8af\",\"394\":\"0fdfd7ae\",\"401\":\"c27c44d2\",\"431\":\"e117da19\",\"633\":\"3c920340\",\"802\":\"9fae932a\",\"845\":\"d4857496\",\"858\":\"8fd585ad\",\"881\":\"b8efc50f\",\"940\":\"d164c0cb\",\"946\":\"d10f76b2\"}[chunkId] + \".js\";\n};","// This function allow to reference async chunks\n__webpack_require__.miniCssF = function(chunkId) {\n\t// return url for filenames based on template\n\treturn \"static/css/\" + {\"24\":\"reset\",\"193\":\"statistics\",\"328\":\"admin\",\"401\":\"workouts\",\"845\":\"profile\"}[chunkId] + \".\" + {\"24\":\"e2527ec6\",\"193\":\"40e24e75\",\"328\":\"73df498d\",\"401\":\"66742279\",\"845\":\"567acd35\"}[chunkId] + \".css\";\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","var inProgress = {};\nvar dataWebpackPrefix = \"fittrackee_client:\";\n// loadScript function to load a script via script tag\n__webpack_require__.l = function(url, done, key, chunkId) {\n\tif(inProgress[url]) { inProgress[url].push(done); return; }\n\tvar script, needAttach;\n\tif(key !== undefined) {\n\t\tvar scripts = document.getElementsByTagName(\"script\");\n\t\tfor(var i = 0; i < scripts.length; i++) {\n\t\t\tvar s = scripts[i];\n\t\t\tif(s.getAttribute(\"src\") == url || s.getAttribute(\"data-webpack\") == dataWebpackPrefix + key) { script = s; break; }\n\t\t}\n\t}\n\tif(!script) {\n\t\tneedAttach = true;\n\t\tscript = document.createElement('script');\n\n\t\tscript.charset = 'utf-8';\n\t\tscript.timeout = 120;\n\t\tif (__webpack_require__.nc) {\n\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n\t\t}\n\t\tscript.setAttribute(\"data-webpack\", dataWebpackPrefix + key);\n\t\tscript.src = url;\n\t}\n\tinProgress[url] = [done];\n\tvar onScriptComplete = function(prev, event) {\n\t\t// avoid mem leaks in IE.\n\t\tscript.onerror = script.onload = null;\n\t\tclearTimeout(timeout);\n\t\tvar doneFns = inProgress[url];\n\t\tdelete inProgress[url];\n\t\tscript.parentNode && script.parentNode.removeChild(script);\n\t\tdoneFns && doneFns.forEach(function(fn) { return fn(event); });\n\t\tif(prev) return prev(event);\n\t}\n\tvar timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);\n\tscript.onerror = onScriptComplete.bind(null, script.onerror);\n\tscript.onload = onScriptComplete.bind(null, script.onload);\n\tneedAttach && document.head.appendChild(script);\n};","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","__webpack_require__.p = \"/\";","if (typeof document === \"undefined\") return;\nvar createStylesheet = function(chunkId, fullhref, oldTag, resolve, reject) {\n\tvar linkTag = document.createElement(\"link\");\n\n\tlinkTag.rel = \"stylesheet\";\n\tlinkTag.type = \"text/css\";\n\tvar onLinkComplete = function(event) {\n\t\t// avoid mem leaks.\n\t\tlinkTag.onerror = linkTag.onload = null;\n\t\tif (event.type === 'load') {\n\t\t\tresolve();\n\t\t} else {\n\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\tvar realHref = event && event.target && event.target.href || fullhref;\n\t\t\tvar err = new Error(\"Loading CSS chunk \" + chunkId + \" failed.\\n(\" + realHref + \")\");\n\t\t\terr.code = \"CSS_CHUNK_LOAD_FAILED\";\n\t\t\terr.type = errorType;\n\t\t\terr.request = realHref;\n\t\t\tif (linkTag.parentNode) linkTag.parentNode.removeChild(linkTag)\n\t\t\treject(err);\n\t\t}\n\t}\n\tlinkTag.onerror = linkTag.onload = onLinkComplete;\n\tlinkTag.href = fullhref;\n\n\tif (oldTag) {\n\t\toldTag.parentNode.insertBefore(linkTag, oldTag.nextSibling);\n\t} else {\n\t\tdocument.head.appendChild(linkTag);\n\t}\n\treturn linkTag;\n};\nvar findStylesheet = function(href, fullhref) {\n\tvar existingLinkTags = document.getElementsByTagName(\"link\");\n\tfor(var i = 0; i < existingLinkTags.length; i++) {\n\t\tvar tag = existingLinkTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\") || tag.getAttribute(\"href\");\n\t\tif(tag.rel === \"stylesheet\" && (dataHref === href || dataHref === fullhref)) return tag;\n\t}\n\tvar existingStyleTags = document.getElementsByTagName(\"style\");\n\tfor(var i = 0; i < existingStyleTags.length; i++) {\n\t\tvar tag = existingStyleTags[i];\n\t\tvar dataHref = tag.getAttribute(\"data-href\");\n\t\tif(dataHref === href || dataHref === fullhref) return tag;\n\t}\n};\nvar loadStylesheet = function(chunkId) {\n\treturn new Promise(function(resolve, reject) {\n\t\tvar href = __webpack_require__.miniCssF(chunkId);\n\t\tvar fullhref = __webpack_require__.p + href;\n\t\tif(findStylesheet(href, fullhref)) return resolve();\n\t\tcreateStylesheet(chunkId, fullhref, null, resolve, reject);\n\t});\n}\n// object to store loaded CSS chunks\nvar installedCssChunks = {\n\t143: 0\n};\n\n__webpack_require__.f.miniCss = function(chunkId, promises) {\n\tvar cssChunks = {\"24\":1,\"193\":1,\"328\":1,\"401\":1,\"845\":1};\n\tif(installedCssChunks[chunkId]) promises.push(installedCssChunks[chunkId]);\n\telse if(installedCssChunks[chunkId] !== 0 && cssChunks[chunkId]) {\n\t\tpromises.push(installedCssChunks[chunkId] = loadStylesheet(chunkId).then(function() {\n\t\t\tinstalledCssChunks[chunkId] = 0;\n\t\t}, function(e) {\n\t\t\tdelete installedCssChunks[chunkId];\n\t\t\tthrow e;\n\t\t}));\n\t}\n};\n\n// no hmr","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t143: 0\n};\n\n__webpack_require__.f.j = function(chunkId, promises) {\n\t\t// JSONP chunk loading for javascript\n\t\tvar installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;\n\t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n\t\t\t// a Promise means \"currently loading\".\n\t\t\tif(installedChunkData) {\n\t\t\t\tpromises.push(installedChunkData[2]);\n\t\t\t} else {\n\t\t\t\tif(true) { // all chunks have JS\n\t\t\t\t\t// setup Promise in chunk cache\n\t\t\t\t\tvar promise = new Promise(function(resolve, reject) { installedChunkData = installedChunks[chunkId] = [resolve, reject]; });\n\t\t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n\t\t\t\t\t// start chunk loading\n\t\t\t\t\tvar url = __webpack_require__.p + __webpack_require__.u(chunkId);\n\t\t\t\t\t// create error before stack unwound to get useful stacktrace later\n\t\t\t\t\tvar error = new Error();\n\t\t\t\t\tvar loadingEnded = function(event) {\n\t\t\t\t\t\tif(__webpack_require__.o(installedChunks, chunkId)) {\n\t\t\t\t\t\t\tinstalledChunkData = installedChunks[chunkId];\n\t\t\t\t\t\t\tif(installedChunkData !== 0) installedChunks[chunkId] = undefined;\n\t\t\t\t\t\t\tif(installedChunkData) {\n\t\t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n\t\t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n\t\t\t\t\t\t\t\terror.message = 'Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')';\n\t\t\t\t\t\t\t\terror.name = 'ChunkLoadError';\n\t\t\t\t\t\t\t\terror.type = errorType;\n\t\t\t\t\t\t\t\terror.request = realSrc;\n\t\t\t\t\t\t\t\tinstalledChunkData[1](error);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t\t__webpack_require__.l(url, loadingEnded, \"chunk-\" + chunkId, chunkId);\n\t\t\t\t} else installedChunks[chunkId] = 0;\n\t\t\t}\n\t\t}\n};\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkfittrackee_client\"] = self[\"webpackChunkfittrackee_client\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [998], function() { return __webpack_require__(2339); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["authApi","axios","baseURL","getApiUrl","interceptors","request","use","config","controller","AbortController","signal","requestKey","removeRequestIfPending","pendingRequests","authToken","store","AUTH_USER_STORE","auth","headers","Authorization","error","Promise","reject","response","message","Map","generateRequestKey","method","url","params","data","JSON","stringify","join","has","get","abort","delete","loadLocaleMessages","locales","require","messages","keys","forEach","key","matched","match","length","locale","default","createI18n","legacy","fallbackLocale","globalInjection","ctx","normalize","_normalize","interpolate","_interpolate","list","_list","plural","_plural","about","AboutTranslations","admin","AdministrationTranslations","api","ApiTranslations","buttons","ButtonsTranslations","common","CommonTranslations","dashboard","DashboardTranslations","ErrorTranslations","oauth2","OAuth2Translations","privacy_policy","PrivacyPolicyTranslations","sports","SportsTranslations","statistics","StatisticsTranslations","user","UserTranslations","workouts","WorkoutsTranslations","register","ready","console","log","registered","cached","updatefound","updated","offline","_withScopeId","n","_pushScopeId","_popScopeId","_hoisted_1","id","_hoisted_2","class","_hoisted_3","_hoisted_4","_createElementVNode","_hoisted_5","_hoisted_6","_hoisted_7","_hoisted_8","_hoisted_9","_hoisted_10","_hoisted_11","_defineComponent","__name","props","version","adminContact","setup","__props","toRefs","_ctx","_cache","_component_router_link","_resolveComponent","_openBlock","_createElementBlock","_createTextVNode","_toDisplayString","_unref","_createVNode","to","_withCtx","$t","_","_createCommentVNode","href","__exports__","_hoisted_12","emits","emit","useStore","authUser","computed","getters","isAuthenticated","language","ROOT_STORE","isMenuOpen","ref","openMenu","value","closeMenu","updateLanguage","option","dispatch","toString","logout","_component_Dropdown","onClick","$event","$router","push","_normalizeClass","capitalize","_createBlock","UserPicture","username","availableLanguages","options","selected","onSelected","ErrorImg","innerHTML","appConfig","appLoading","hideScrollBar","displayScrollButton","updateHideScrollBar","isScrolledToBottom","element","getBoundingClientRect","top","window","innerHeight","bottom","scroll","onscroll","document","querySelector","scrollToTop","scrollTo","behavior","setTimeout","initLanguage","navigatorLanguage","navigator","split","localeFromLanguage","e","onBeforeMount","onMounted","_component_Loader","_component_router_view","_Fragment","NavBar","onMenuInteraction","NoConfig","Footer","admin_contact","name","charLimit","disabled","type","Boolean","input","text","updateText","event","target","watch","_withDirectives","maxLength","onInput","_vModelText","distance","unitFrom","useImperialUnits","digits","displayUnit","speed","strong","unitTo","units","defaultTarget","convertedDistance","convertDistance","parseFloat","toFixed","route","useRoute","isOpen","dropdownOptions","map","toggleDropdown","updateSelected","path","_renderSlot","$slots","_renderList","index","label","Array","isArray","subMessage","xmlns","x","y","viewBox","style","d","render","_hoisted_20","cx","cy","r","sportLabel","color","title","sportColors","inject","_normalizeStyle","fill","CyclingSport","CyclingTransport","CyclingVirtual","Hiking","MountainBiking","MountainBikingElectric","Mountaineering","Rowing","Running","SkiingAlpine","SkiingCrossCountry","Snowshoes","Trail","Walking","script","strongMessage","errorMessages","onUnmounted","commit","_component_i18n_t","_component_ErrorMessage","_component_Card","content","keypath","customComponents","AlertMessage","Card","CustomTextArea","Distance","Dropdown","ErrorMessage","Loader","Modal","SportImage","clickOutsideDirective","mounted","binding","clickOutsideEvent","contains","body","addEventListener","unmounted","removeEventListener","undefined","Chart","BarElement","LineElement","PointElement","Legend","Title","Tooltip","Filler","BarController","CategoryScale","LineController","LinearScale","ChartDataLabels","app","createApp","App","provide","i18n","router","VueFullscreen","directive","component","mount","for","_hoisted_13","_hoisted_14","_hoisted_15","_hoisted_16","_hoisted_17","_hoisted_18","_hoisted_19","_hoisted_21","_hoisted_22","_hoisted_23","_hoisted_24","_hoisted_25","_hoisted_26","edition","useRouter","appData","reactive","max_users","max_single_file_size","max_zip_file_size","gpx_limit_import","updateForm","Object","includes","getFileSizeInMB","onCancel","onSubmit","formData","assign","_withModifiers","min","step","rows","snarkdown","linkifyAndClean","icon","appStatistics","uploadDirSize","getReadableFileSize","uploads_dir_size","StatCard","users","size","suffix","AppStatsCards","is_registration_enabled","is_email_sending_enabled","t","useI18n","translatedSports","translateSports","SPORTS_STORE","updateSportStatus","isActive","_component_SportImage","sport","translatedLabel","is_active","danger","has_workouts","query","q","searchUsers","resetFilter","onKeyup","_withKeys","placeholder","trim","orderByList","defaultOrderBy","getQuery","USERS_STORE","pagination","loadUsers","queryParams","reloadUsers","updateUser","queryParam","queryValue","page","newQuery","UsersNameFilter","onFilterOnUsername","FilterSelects","sort","sortList","order_by","onUpdateSelect","email","formatDate","created_at","timezone","date_format","nb_workouts","Pagination","tabs","selectedTab","getPath","tab","toLocaleLowerCase","checked","UserHeader","UserProfileTabs","appLanguage","userLanguage","languageLabels","fistDayOfWeek","weekm","display_ascent","getDateFormat","imperial_units","start_elevation_at_zero","use_raw_gpx_speed","loading","userForm","password","new_password","isSuccess","emailUpdate","formErrors","displayModal","exportRequest","exportRequestDate","getExportRequestDate","generatingLink","invalidateForm","updateUserForm","updatePassword","updateNewPassword","canRequestExport","isBefore","Date","subDays","updateProfile","payload","updateDisplayModal","deleteAccount","requestExport","async","downloadArchive","filename","responseType","then","archiveFileUrl","URL","createObjectURL","Blob","archive_link","createElement","setAttribute","appendChild","click","finally","isSuccessValue","_component_Modal","onConfirmAction","onCancelAction","errors","required","onInvalid","PasswordInput","onUpdatePassword","onPasswordError","checkStrength","status","file_name","file_size","first_name","last_name","birth_date","location","bio","registrationDate","format","updateBio","_component_CustomTextArea","onUpdateValue","fileSizeLimit","pictureFile","deleteUserPicture","updatePictureFile","files","updateUserPicture","picture","accept","timeZones","tzList","focusItemIndex","matchTimezone","toLowerCase","onMouseOver","onUpdateTimezone","onEnter","preventDefault","firstElementChild","openDropdown","onKeydown","ref_key","filter","tz","focus","onMouseover","autofocus","_hoisted_27","_hoisted_28","_hoisted_29","_hoisted_30","_hoisted_31","_hoisted_32","_hoisted_33","_hoisted_34","_hoisted_35","_hoisted_36","_hoisted_37","_hoisted_38","_hoisted_39","weekStart","imperialUnits","ascentData","startElevationAtZeroData","useRawGpxSpeed","dateFormatOptions","availableDateFormatOptions","toUTCString","updateTZ","updateStartElevationAtZero","updateUseRawGpxSpeed","updateAscentDisplay","updateImperialUnit","updateWeekM","lang","_vModelSelect","TimezoneDropdown","dateFormat","start","unit","fittrackee_private_policy_date","getTimezone","private_policy_date","getPolicyDate","paragraphs","Intl","DateTimeFormat","resolvedOptions","timeZone","dateStringFormats","privacy_policy_date","paragraph","acceptedPolicy","accepted_privacy_policy","PrivacyPolicy","_vModelCheckbox","oauth2_scopes","admin_oauth2_scopes","appForm","client_name","client_uri","client_description","redirect_uri","scopes","filtered_scopes","getScopes","redirect_uris","scope","OAUTH2_STORE","updateDescription","updateScopes","indexOf","splice","admin_scopes","description","onChange","client","loadApp","client_id","authorizeApp","response_type","state","code_challenge","code_challenge_method","afterCreation","revocationSuccessful","messageToDisplay","idCopied","secretCopied","clipboardSupport","loadClient","updateMessageToDisplay","forDelete","confirmAction","clientId","copyIdToClipboard","clipboard","writeText","copySecretToClipboard","client_secret","newValue","issued_at","website","clients","getClientsQuery","clientsQuery","getNumberQueryValue","defaultPage","loadClients","isEdition","defaultColor","sports_list","sportPayload","sport_id","stopped_speed_threshold","updateSportInEdition","is_active_for_user","resetSportPayload","isSportInEdition","sportId","updateColor","updateThreshold","updateIsActive","updateSport","resetSport","newIsLoading","rel","weather_provider","get_weather_provider","src","alt","BikePic","About","workout","hasElevation","ascent","descent","_component_Distance","workoutId","workout_date","formatDistance","addSuffix","with_gpx","StaticMap","moving","min_alt","max_alt","per_page","initWorkoutsCount","loadWorkouts","WORKOUTS_STORE","moreWorkoutsExist","previous_workout","defaultOrder","loadMoreWorkouts","WorkoutCard","s","NoWorkouts","displayHARecord","sportColor","records","record","record_type","height","width","colors","datasets","angleOffset","radius","circumference","Math","PI","calculateStrokeDashOffset","percentage","returnCircleTransformValue","rotation","entries","stroke","transform","isHidden","togglePane","stopPropagation","_directive_click_outside","_resolveDirective","DonutChart","CalendarWorkout","getSportLabel","getSportColor","chartDatasets","getDonutDatasets","sportIdColors","displayedWorkoutCount","slice","CalendarWorkoutsChart","currentDay","endDate","startDate","weekStartingMonday","getDays","day","days","i","addDays","isWeekEnd","filterWorkouts","isSameDay","getDateWithTZ","reverse","row","isSameMonth","today","isToday","CalendarWorkouts","localeOptions","calendarDates","getCalendarStartAndEnd","calendarWorkouts","getCalendarWorkouts","apiParams","from","end","displayNextMonth","addMonths","displayPreviousMonth","subMonths","CalendarHeader","onDisplayNextMonth","onDisplayPreviousMonth","CalendarDays","CalendarCells","date","chartParams","duration","startOfMonth","endOfMonth","selectedSportIds","StatChart","formatRecord","distanceUnitFrom","distanceUnitTo","ascentUnitFrom","ascentUnitTo","Error","workout_id","sortRecords","a","b","recordALabel","recordBLabel","getRecordsBySports","reduce","sportList","find","sportTranslatedLabel","getTranslatedRecords","translatedRecords","recordsBySport","RecordsCard","userTotalDuration","total_duration","totalDuration","get_duration","totalDistance","total_distance","totalAscent","total_ascent","nb_sports","isSelected","updateDisplayColumn","PrivacyPolicyToAccept","UserStatsCards","UserMonthStats","UserRecords","UserCalendar","Timeline","NotFound","action","LoginOrRegisterForm","getTabFromPath","regex","tag","replace","toUpperCase","routes","Dashboard","LoginOrRegister","children","Profile","UserInfos","UserPreferences","UserSportPreferences","UserApps","UserAppsList","UserApp","AddUserApp","AuthorizeUserApp","ProfileEdition","UserInfosEdition","UserAccountEdition","UserPictureEdition","UserPreferencesEdition","UserPrivacyPolicyValidation","displaySegment","AdminMenu","AdminApplication","AdminSports","fromAdmin","AdminUsers","AboutView","PrivacyPolicyView","NotFoundView","createRouter","history","createWebHistory","process","pathsWithoutAuthentication","pathsWithoutChecks","beforeEach","next","fullPath","catch","AuthUserActions","AuthUserGetters","AuthUserMutations","OAuth2Actions","OAuth2Getters","OAuth2Mutations","RootActions","RootGetters","RootMutations","SportsActions","SportsGetters","SportsMutation","StatisticsActions","StatisticsGetters","StatisticsMutations","UsersActions","UsersGetters","UsersMutations","ACTIONS","GETTERS","MUTATIONS","STATS_STORE","WorkoutsActions","WorkoutsGetters","WorkoutsMutations","deleteUserAccount","context","res","handleError","actions","resetPassword","reset_password","activate","new_email","removeAuthUserData","localStorage","removeItem","token","auth_token","setItem","refreshUser","actionType","redirectUrl","form","FormData","append","accepted_policy","authUserProfile","isRegistrationSuccess","mutations","authUserState","get_client","set","redirect_url","oAuth2State","application","root","enUS","sportsState","filterType","statisticsState","updatedUser","usersState","getWorkouts","segmentUrl","segmentId","segments","chart_data","gpx","file","notes","calendar_workouts","timeline_workouts","user_workouts","workoutData","concat","chartData","workoutsState","modules","authUserModule","oAuthModule","sportsModule","statsModule","usersModule","workoutsModule","createStore","VuexStore","defaultPerPage","defaultValue","getStringQueryValue","availableValues","locationQuery","queryOptions","defaultSort","order","workoutsPayloadKeys","getRange","stop","rangePagination","pages","currentPage","getStartDate","startOfWeek","weekStartsOn","startOfYear","incrementDate","addYears","dateInUTC","utcToZonedTime","monthStart","monthEnd","endOfWeek","formatWorkoutDate","dateTime","timeFormat","workout_time","availableDateFormats","de","en","es","fr","gl","it","pl","nb","nl","dateString","withTime","withSeconds","inputDate","l","df","suffixes","fileSize","asText","floor","pow","msg","errorInfo","m","sanitizeHtml","linkifyHtml","allowedTags","disallowedTagsMode","availableLocales","sortSports","sportATranslatedLabel","sportBTranslatedLabel","activeStatus","sportsToInclude","dateFormats","week","chart","month","year","datasetKeys","getDateKeys","getStatisticsChartDataset","isLineChart","dataset","backgroundColor","borderColor","spanGaps","getDatasets","displayedSports","average_speed","total_descent","convertStatsValue","datasetKey","convertStatsDistance","formatStats","displayedSportsId","apiStats","userDateFormat","dayKeys","labels","sportsId","displayedSport","getStatsDateParams","timeFrame","subYears","endOfYear","updateChartParams","backward","subWeeks","addWeeks","ft","system","multiplier","mi","km","factors","metric","imperial","getTemperature","temperatureInCelsius","temperature","Number","getWindSpeed","windSpeedInMS","windSpeed","borderWidth","yAxisID","elevation","distance_labels","duration_labels","coordinates","latitude","longitude","total","count","perPage","onSelectUpdate","buttonText","timer","errorDisplayed","displayError","clearTimeout","cursor","has_prev","navigate","has_next","active","loadLanguagePackage","setZxcvbnOptions","zxcvbnCommonPackage","zxcvbnLanguagePackage","graphs","adjacencyGraphs","dictionary","zxcvbnOptions","getPasswordStrength","strength","passwordScore","passwordStrength","passwordSuggestions","backgroundSize","calculatePasswordStrength","zxcvbnResult","zxcvbn","score","feedback","suggestions","newLanguageValue","newPassword","max","suggestion","showPassword","passwordValue","togglePassword","invalidPassword","minlength","_vModelDynamic","PasswordStrength","displayHover","imageUrl","backgroundImage","$props","$setup","$data","$options","_component_Chart","hideChartIfNoData","emptyStats","displayedData","args","updateDisplayData","fullStats","displayedSportIds","_component_BarChart","_mergeProps","barChartProps","formatDuration","totalSeconds","formatWithUnits","String","hours","padStart","minutes","seconds","formatTooltipValue","defineComponent","components","BarChart","getNumber","isNaN","getSum","getUnit","parse","responsive","maintainAspectRatio","animation","layout","padding","scales","stacked","grid","drawOnChartArea","ticks","maxTicksLimit","callback","afterFit","scale","plugins","datalabels","anchor","align","chartArea","display","formatter","dataIndex","datasetIndex","legend","tooltip","interaction","intersect","mode","position","tooltipItem","formattedValue","callbacks","parsed","footer","tooltipItems","sum","useBarChart","formattedStats","getStatistics","getApiParams","time","newParams","birthDate","displayUserEmailForm","newUserEmail","currentAction","resetUserPassword","confirmUserAccount","displayEmailForm","resetErrorsAndSuccess","email_to_confirm","hideEmailForm","updateUserEmail","newIsSuccess","_component_AlertMessage","go","getButtonText","registration_disabled","sendingEmailDisabled","resetFormData","pattern","maxlength","authUserPictureUrl","now","webpackContext","req","webpackContextResolve","__webpack_require__","o","code","resolve","module","exports","__webpack_module_cache__","moduleId","cachedModule","__webpack_modules__","call","deferred","O","result","chunkIds","fn","priority","notFulfilled","Infinity","fulfilled","j","every","getter","__esModule","leafPrototypes","getProto","getPrototypeOf","obj","__proto__","this","ns","create","def","current","getOwnPropertyNames","definition","defineProperty","enumerable","f","chunkId","all","promises","u","miniCssF","g","globalThis","Function","prop","prototype","hasOwnProperty","inProgress","dataWebpackPrefix","done","needAttach","scripts","getElementsByTagName","getAttribute","charset","timeout","nc","onScriptComplete","prev","onerror","onload","doneFns","parentNode","removeChild","bind","head","Symbol","toStringTag","p","createStylesheet","fullhref","oldTag","linkTag","onLinkComplete","errorType","realHref","err","insertBefore","nextSibling","findStylesheet","existingLinkTags","dataHref","existingStyleTags","loadStylesheet","installedCssChunks","miniCss","cssChunks","installedChunks","installedChunkData","promise","loadingEnded","realSrc","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","some","chunkLoadingGlobal","self","__webpack_exports__"],"sourceRoot":""} \ No newline at end of file diff --git a/fittrackee/dist/static/js/app.b65cb444.js b/fittrackee/dist/static/js/app.b65cb444.js new file mode 100644 index 00000000..37501401 --- /dev/null +++ b/fittrackee/dist/static/js/app.b65cb444.js @@ -0,0 +1,2 @@ +(function(){var e={5167:function(e,n,r){"use strict";var t=r(6154),o=r(8566),a=r(2894),i=r(5801),s=r(2024);const l=t.Z.create({baseURL:(0,s.k)()});l.interceptors.request.use((e=>{const n=new AbortController;e.signal=n.signal;const r=(0,o.a)(e);o.j.set(r,n);const t=a.Z.getters[i.YN.GETTERS.AUTH_TOKEN];if(t){const n=`Bearer ${t}`;e.headers&&e.headers.Authorization!==n&&(e.headers.Authorization=`Bearer ${t}`)}return e}),(e=>Promise.reject(e))),l.interceptors.response.use((e=>((0,o.a)(e.config),e)),(e=>("canceled"!==e.message&&e.response&&(0,o.a)(e.response.config),Promise.reject(e)))),n["Z"]=l},8566:function(e,n,r){"use strict";r.d(n,{a:function(){return a},j:function(){return t}});const t=new Map,o=e=>{const{method:n,url:r,params:t={},data:o={}}=e;return[n,r,JSON.stringify(t),JSON.stringify(o)].join("")},a=e=>{const n=o(e);if(t.has(n)){const e=t.get(n)||{};e?.abort(),t.delete(n)}return n}},2540:function(e,n,r){"use strict";var t=r(9150);function o(){const e=r(4612),n={};return e.keys().forEach((r=>{const t=r.match(/([A-Za-z0-9-_]+)\./i);if(t&&t.length>1){const o=t[1];n[o]=e(r).default}})),n}n["Z"]=(0,t.o)({legacy:!1,locale:"en",fallbackLocale:"en",globalInjection:!0,messages:o()})},3010:function(e,n,r){"use strict";r.r(n),r.d(n,{default:function(){return S}});var t={ABOUT_THIS_INSTANCE:e=>{const{normalize:n}=e;return n(["Über diese Instanz"])},CONTACT_ADMIN:e=>{const{normalize:n}=e;return n(["Kontaktiere den Administrator"])},FITTRACKEE_DESCRIPTION:e=>{const{normalize:n}=e;return n(["FitTrackee ist ein selbst-gehosteter Outdoor-Aktivitäts-Tracker."])},FITTRACKEE_LICENSE:e=>{const{normalize:n,interpolate:r,list:t}=e;return n(["unter ",r(t(0))," Lizenz "])},SOURCE_CODE:e=>{const{normalize:n}=e;return n(["Quellcode"])},WEATHER_DATA_FROM:e=>{const{normalize:n}=e;return n(["Wetterdaten von:"])}},o={ABOUT:{DESCRIPTION:e=>{const{normalize:n}=e;return n(["Zusätzliche Informationen, die für deine Nutzer nützlich sein könnten. Markdown-Syntax wird unterstützt."])},TEXT:e=>{const{normalize:n}=e;return n(["Detaillierte Instanz-Informationen"])}},ACTION:e=>{const{normalize:n}=e;return n(["Aktion"])},ACTIVATE_USER_ACCOUNT:e=>{const{normalize:n}=e;return n(["Aktiviere Konto"])},ACTIVE:e=>{const{normalize:n}=e;return n(["Aktiv"])},ADMIN:e=>{const{normalize:n}=e;return n(["Admin"])},ADMINISTRATION:e=>{const{normalize:n}=e;return n(["Administration"])},ADMIN_RIGHTS_DELETE_USER_ACCOUNT:e=>{const{normalize:n}=e;return n(["Hinzufügen/Entfernen von Administratorrechten, Lösche Nutzerkonto."])},APPLICATION:e=>{const{normalize:n}=e;return n(["Anwendung"])},APP_CONFIG:{ADMIN_CONTACT:e=>{const{normalize:n}=e;return n(["Kontakt-E-Mail des Administrators"])},MAX_FILES_IN_ZIP_LABEL:e=>{const{normalize:n}=e;return n(["Max. Dateianzahl im zip Archiv"])},MAX_USERS_HELP:e=>{const{normalize:n}=e;return n(["Wenn 0, gibt es keine Registrierungslimitierung.."])},MAX_USERS_LABEL:e=>{const{normalize:n}=e;return n(["Max. Anzahl aktiver Nutzer"])},NO_CONTACT_EMAIL:e=>{const{normalize:n}=e;return n(["keine Kontakt-E-Mail"])},SINGLE_UPLOAD_MAX_SIZE_LABEL:e=>{const{normalize:n}=e;return n(["Max. Größe der hochgeladenen Dateien (in Mb)"])},TITLE:e=>{const{normalize:n}=e;return n(["Anwendungskonfiguration"])},ZIP_UPLOAD_MAX_SIZE_LABEL:e=>{const{normalize:n}=e;return n(["Max. Größe des zip Archives (in Mb)"])}},BACK_TO_ADMIN:e=>{const{normalize:n}=e;return n(["Zurück zu Admin"])},CONFIRM_USER_ACCOUNT_DELETION:e=>{const{normalize:n,interpolate:r,list:t}=e;return n(["Möchtest du wirklich das ",r(t(0))," Konto löschen? Alle Daten werden gelöscht. Dieser Vorgang kann nicht rückgängig gemacht werden."])},CONFIRM_USER_PASSWORD_RESET:e=>{const{normalize:n,interpolate:r,list:t}=e;return n(["Möchtest du wirklich das ",r(t(0))," Passwort zurücksetzen?"])},CURRENT_EMAIL:e=>{const{normalize:n}=e;return n(["Aktuelle E-Mail"])},DELETE_USER:e=>{const{normalize:n}=e;return n(["Lösche Nutzer"])},EMAIL_SENDING_DISABLED:e=>{const{normalize:n}=e;return n(["E-Mail-Versand ist deaktiviert."])},ENABLE_DISABLE_SPORTS:e=>{const{normalize:n}=e;return n(["Aktivieren/Deaktivieren von Sportarten."])},NEW_EMAIL:e=>{const{normalize:n}=e;return n(["Neue E-Mail"])},NO_TEXT_ENTERED:e=>{const{normalize:n}=e;return n(["Kein Text eingegeben"])},PASSWORD_RESET_SUCCESSFUL:e=>{const{normalize:n}=e;return n(["Das wasswort wurde zurückgesetzt."])},PRIVACY_POLICY_DESCRIPTION:e=>{const{normalize:n}=e;return n(["Füge deine eigene Datenschutzrichtlinie hinzu oder leer lassen, um die standardmäßige zu verwenden. Markdown-Syntax wird unterstützt."])},REGISTRATION_DISABLED:e=>{const{normalize:n}=e;return n(["Registrierung ist derzeit deaktiviert."])},REGISTRATION_ENABLED:e=>{const{normalize:n}=e;return n(["Registrierung ist derzeit aktiviert."])},RESET_USER_PASSWORD:e=>{const{normalize:n}=e;return n(["Passwort zurücksetzen"])},SPORTS:{TABLE:{ACTIVE:e=>{const{normalize:n}=e;return n(["Aktiv"])},HAS_WORKOUTS:e=>{const{normalize:n}=e;return n(["Trainings existieren"])},IMAGE:e=>{const{normalize:n}=e;return n(["Bild"])},LABEL:e=>{const{normalize:n}=e;return n(["Titel"])}},TITLE:e=>{const{normalize:n}=e;return n(["Sportarten Administration"])}},UPDATE_APPLICATION_DESCRIPTION:e=>{const{normalize:n}=e;return n(["Aktualisiere Anwemdungskonfiguration."])},UPDATE_USER_EMAIL:e=>{const{normalize:n}=e;return n(["Aktualisiere E-Mail"])},USER:e=>{const{normalize:n}=e;return n(["Nutzer"])},USERS:{SELECTS:{ORDER_BY:{ADMIN:e=>{const{normalize:n}=e;return n(["Adminstatus"])},CREATED_AT:e=>{const{normalize:n}=e;return n(["Registrierungsdatum"])},IS_ACTIVE:e=>{const{normalize:n}=e;return n(["Accountstatus"])},USERNAME:e=>{const{normalize:n}=e;return n(["Nutzername"])},WORKOUTS_COUNT:e=>{const{normalize:n}=e;return n(["Trainingsanzahl"])}}},TABLE:{ADD_ADMIN_RIGHTS:e=>{const{normalize:n}=e;return n(["Administratorrechte hinzufügen"])},REMOVE_ADMIN_RIGHTS:e=>{const{normalize:n}=e;return n(["Administratorrechte entfernen"])}}},USER_EMAIL_UPDATE_SUCCESSFUL:e=>{const{normalize:n}=e;return n(["Die E-Mail Adresse wurde aktualisiert."])}},a={ERROR:{"',6),Rr=[Ir];function Nr(e,n,r,t,o,a){return(0,l.wg)(),(0,l.iD)("svg",Or,Rr)}var gr={name:"Snowshoes"};const Ur=(0,g.Z)(gr,[["render",Nr]]);var Cr=Ur;const Dr={version:"1.1",id:"Capa_1",xmlns:"http://www.w3.org/2000/svg","xmlns:xlink":"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 535.876 535.876",style:{"enable-background":"new 0 0 535.876 535.876"},"xml:space":"preserve"},hr=(0,l._)("desc",{id:"trailDescription"},"silhouette of a person running (trail)",-1),vr=(0,l._)("g",null,[(0,l._)("g",null,[(0,l._)("path",{d:"M505.204,326.949c-5.805-10.892-15.176-10.862-20.923,0.067l-7.114,13.512c-5.757,10.92-20.416,19.775-32.752,19.775\n\t\t\th-16.753c-12.346,0-29.645,6.847-38.643,15.29l-32.35,30.342l-1.233-105.388c0.822-18.446-10.596-24.634-10.596-24.634\n\t\t\tl-56.543-25.972l33.67-67.645l38.527,22.912c0,0,15.472,9.715,26.727-9.324l37.026-63.093c1.625-3.519,2.094-7.564,1.052-11.609\n\t\t\tc-2.381-9.256-11.81-14.86-21.095-12.479c-4.083,1.042-7.459,3.49-9.754,6.713l-30.772,51.962l-62.777-37.102\n\t\t\tc-4.733-2.716-10.519-3.691-16.257-2.209l-78.345,20.12c-5.03,1.291-8.96,4.762-11.017,9.142l-38.097,76.165\n\t\t\tc-2.591,3.854-3.624,8.73-2.371,13.607c2.285,8.941,11.456,14.363,20.435,12.059c5.04-1.291,8.951-4.743,10.997-9.161\n\t\t\tl35.314-70.858l28.936-7.296l-76.203,149.921l-65.981,16.734c-1.759,0.393-3.48,1.023-5.163,1.836\n\t\t\tc-10.596,5.412-14.679,18.179-9.267,28.803c4.733,9.266,15.252,13.636,24.901,10.978l78.067-20.187\n\t\t\tc18.6-4.093,23.313-14.449,23.313-14.449l30.581-58.79l62.28,35.678l0.593,86.216c0.01,1.08,0.259,2.161,0.421,3.241l-11.6-4.188\n\t\t\tc-11.608-4.188-30.57-4.608-42.361-0.956l-26.135,8.128c-11.79,3.663-30.791,3.338-42.447-0.717l-19.221-6.694\n\t\t\tc-11.657-4.054-28.831-0.984-38.374,6.838L109.9,433.954c-9.544,7.822-26.67,10.72-38.25,6.483L40.84,429.135\n\t\t\tc-11.58-4.256-25.608,1.157-31.336,12.097l-7.21,13.789c-5.728,10.93-0.354,19.794,11.982,19.794H500.27\n\t\t\tc12.336,0,24.309-9.802,26.728-21.907l8.004-39.981c2.409-12.097-0.325-30.733-6.14-41.616L505.204,326.949z"}),(0,l._)("path",{d:"M326.395,126.625c17.806-4.562,28.563-22.721,23.983-40.526c-4.581-17.844-22.74-28.554-40.555-23.983\n\t\t\tc-17.796,4.581-28.535,22.711-23.964,40.535C290.439,120.476,308.599,131.205,326.395,126.625z"})])],-1),Pr=[hr,vr];function fr(e,n,r,t,o,a){return(0,l.wg)(),(0,l.iD)("svg",Dr,Pr)}var Lr={name:"Trail"};const wr=(0,g.Z)(Lr,[["render",fr]]);var kr=wr;const br={version:"1.1",id:"Capa_1",x:"0px",y:"0px",viewBox:"0 0 494.49 494.49",style:{"enable-background":"new 0 0 494.49 494.49"},"xml:space":"preserve",xmlns:"http://www.w3.org/2000/svg","xmlns:svg":"http://www.w3.org/2000/svg"},Mr=(0,l.uE)('silhouette of a walking person',3),yr=[Mr];function Gr(e,n,r,t,o,a){return(0,l.wg)(),(0,l.iD)("svg",br,yr)}var Fr={name:"Walking"};const Wr=(0,g.Z)(Fr,[["render",Gr]]);var Br=Wr;const Yr=["title"];var xr=(0,l.aZ)({__name:"index",props:{sportLabel:null,color:null,title:{default:""}},setup(e){const n=e,{color:r,sportLabel:t,title:o}=(0,c.BK)(n),a=(0,l.f3)("sportColors");return(e,n)=>((0,l.wg)(),(0,l.iD)("div",{class:"sport-img",style:(0,u.j5)({fill:(0,c.SU)(r)?(0,c.SU)(r):(0,c.SU)(a)[(0,c.SU)(t)]}),title:(0,c.SU)(o)?(0,c.SU)(o):e.$t(`sports.${(0,c.SU)(t)}.LABEL`)},["Cycling (Sport)"===(0,c.SU)(t)?((0,l.wg)(),(0,l.j4)(qe,{key:0})):(0,l.kq)("",!0),"Cycling (Transport)"===(0,c.SU)(t)?((0,l.wg)(),(0,l.j4)(tn,{key:1})):(0,l.kq)("",!0),"Cycling (Virtual)"===(0,c.SU)(t)?((0,l.wg)(),(0,l.j4)(mn,{key:2})):(0,l.kq)("",!0),"Hiking"===(0,c.SU)(t)?((0,l.wg)(),(0,l.j4)(zn,{key:3})):(0,l.kq)("",!0),"Mountain Biking"===(0,c.SU)(t)?((0,l.wg)(),(0,l.j4)(Dn,{key:4})):(0,l.kq)("",!0),"Mountain Biking (Electric)"===(0,c.SU)(t)?((0,l.wg)(),(0,l.j4)(kn,{key:5})):(0,l.kq)("",!0),"Mountaineering"===(0,c.SU)(t)?((0,l.wg)(),(0,l.j4)(Bn,{key:6})):(0,l.kq)("",!0),"Rowing"===(0,c.SU)(t)?((0,l.wg)(),(0,l.j4)(qn,{key:7})):(0,l.kq)("",!0),"Running"===(0,c.SU)(t)?((0,l.wg)(),(0,l.j4)(tr,{key:8})):(0,l.kq)("",!0),"Skiing (Alpine)"===(0,c.SU)(t)?((0,l.wg)(),(0,l.j4)(mr,{key:9})):(0,l.kq)("",!0),"Skiing (Cross Country)"===(0,c.SU)(t)?((0,l.wg)(),(0,l.j4)(zr,{key:10})):(0,l.kq)("",!0),"Snowshoes"===(0,c.SU)(t)?((0,l.wg)(),(0,l.j4)(Cr,{key:11})):(0,l.kq)("",!0),"Trail"===(0,c.SU)(t)?((0,l.wg)(),(0,l.j4)(kr,{key:12})):(0,l.kq)("",!0),"Walking"===(0,c.SU)(t)?((0,l.wg)(),(0,l.j4)(Br,{key:13})):(0,l.kq)("",!0)],12,Yr))}});const Kr=xr;var Hr=Kr;const Vr={class:"loader"};function Zr(e,n){return(0,l.wg)(),(0,l.iD)("div",Vr)}const $r={},qr=(0,g.Z)($r,[["render",Zr],["__scopeId","data-v-4c9921ee"]]);var jr=qr;const Xr={id:"modal"},Qr={class:"custom-modal"},Jr={key:0,class:"modal-message"},et={key:1,class:"modal-message"},nt={class:"modal-buttons"};var rt=(0,l.aZ)({__name:"Modal",props:{title:null,message:null,strongMessage:{default:()=>null}},emits:["cancelAction","confirmAction"],setup(e,{emit:n}){const r=e,t=(0,v.o)(),{title:o,message:a,strongMessage:i}=(0,c.BK)(r),s=(0,l.Fl)((()=>t.getters[h.SY.GETTERS.ERROR_MESSAGES]));return(0,l.Ah)((()=>t.commit(h.SY.MUTATIONS.EMPTY_ERROR_MESSAGES))),(e,r)=>{const t=(0,l.up)("i18n-t"),m=(0,l.up)("ErrorMessage"),d=(0,l.up)("Card");return(0,l.wg)(),(0,l.iD)("div",Xr,[(0,l._)("div",Qr,[(0,l.Wm)(d,null,{title:(0,l.w5)((()=>[(0,l.Uk)((0,u.zw)((0,c.SU)(o)),1)])),content:(0,l.w5)((()=>[(0,c.SU)(i)?((0,l.wg)(),(0,l.iD)("div",Jr,[(0,l.Wm)(t,{keypath:(0,c.SU)(a)},{default:(0,l.w5)((()=>[(0,l._)("span",null,(0,u.zw)((0,c.SU)(i)),1)])),_:1},8,["keypath"])])):((0,l.wg)(),(0,l.iD)("div",et,(0,u.zw)((0,c.SU)(a)),1)),(0,c.SU)(s)?((0,l.wg)(),(0,l.j4)(m,{key:2,message:(0,c.SU)(s)},null,8,["message"])):(0,l.kq)("",!0),(0,l._)("div",nt,[(0,c.SU)(s)?(0,l.kq)("",!0):((0,l.wg)(),(0,l.iD)("button",{key:0,class:"confirm",onClick:r[0]||(r[0]=e=>n("confirmAction"))},(0,u.zw)(e.$t("buttons.YES")),1)),(0,l._)("button",{class:"cancel",onClick:r[1]||(r[1]=e=>n("cancelAction"))},(0,u.zw)(e.$t("buttons."+((0,c.SU)(s)?"CANCEL":"NO"))),1)])])),_:1})])])}}});const tt=(0,g.Z)(rt,[["__scopeId","data-v-5aa8db48"]]);var ot=tt;const at=[{target:pe,name:"AlertMessage"},{target:Ae.Z,name:"Card"},{target:ge,name:"CustomTextArea"},{target:he,name:"Distance"},{target:be,name:"Dropdown"},{target:Be,name:"ErrorMessage"},{target:jr,name:"Loader"},{target:ot,name:"Modal"},{target:Hr,name:"SportImage"}],it={mounted:(e,n)=>{e.clickOutsideEvent=function(r){e===r.target||e.contains(r.target)||n.value(r)},document.body.addEventListener("click",e.clickOutsideEvent),document.body.addEventListener("touchstart",e.clickOutsideEvent)},unmounted:function(e){e.clickOutsideEvent&&(document.body.removeEventListener("click",e.clickOutsideEvent),document.body.removeEventListener("touchstart",e.clickOutsideEvent),e.clickOutsideEvent=void 0)}};var st=r(631);t.kL.register(t.ZL,t.jn,t.od,t.De,t.Dx,t.u,t.Gu,t.vn,t.uw,t.ST,t.f$,o.Z);const lt=(0,a.ri)(ce).provide("sportColors",st.Zo).use(ue.Z).use(de.Z).use(me.Z).use(i.ZP,{name:"VFullscreen"}).directive("click-outside",it);at.forEach((e=>{lt.component(e.name,e.target)})),lt.mount("#app")},858:function(e,n,r){"use strict";r.d(n,{Z:function(){return Bc}});var t=r(2201),o=(r(7658),r(6252)),a=r(3577),i=r(9963),s=r(2262),l=r(9252),c=r(5801),u=r(9917),m=r(8966),d=r(2335);const E=e=>((0,o.dD)("data-v-80b4a9e6"),e=e(),(0,o.Cn)(),e),_={id:"admin-app",class:"admin-card"},T=["onSubmit"],S={for:"admin_contact"},p=["value"],A=["disabled"],z={for:"max_users"},O=["disabled"],I={class:"user-limit-help"},R={class:"info-box"},N=E((()=>(0,o._)("i",{class:"fa fa-info-circle","aria-hidden":"true"},null,-1))),g={for:"max_single_file_size"},U=["disabled"],C={for:"max_zip_file_size"},D=["disabled"],h={for:"gpx_limit_import"},v=["disabled"],P={class:"about-label",for:"about"},f={class:"textarea-description"},L=["innerHTML"],w={class:"privacy-policy-label",for:"privacy_policy"},k={class:"textarea-description"},b=["innerHTML"],M={key:5,class:"form-buttons"},y={class:"confirm",type:"submit"},G=["onClick"],F={key:6,class:"form-buttons"};var W=(0,o.aZ)({__name:"AdminApplication",props:{appConfig:null,edition:{type:Boolean,default:!1}},setup(e){const n=e,{edition:r}=(0,s.BK)(n),E=(0,u.o)(),W=(0,t.tv)(),B=(0,s.qj)({admin_contact:"",max_users:0,max_single_file_size:0,max_zip_file_size:0,gpx_limit_import:0,about:"",privacy_policy:""}),Y=(0,o.Fl)((()=>E.getters[c.SY.GETTERS.ERROR_MESSAGES]));function x(e){Object.keys(B).map((n=>{["max_single_file_size","max_zip_file_size"].includes(n)?B[n]=(0,m.j)(e[n]):["about","privacy_policy"].includes(n)?B[n]=null!==e[n]?e[n]:"":B[n]=e[n]}))}function K(){x(n.appConfig),E.commit(c.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),W.push("/admin/application")}function H(){const e=Object.assign({},B);e.max_single_file_size*=1048576,e.max_zip_file_size*=1048576,E.dispatch(c.SY.ACTIONS.UPDATE_APPLICATION_CONFIG,e)}return(0,o.wF)((()=>{n.appConfig&&x(n.appConfig)})),(e,n)=>{const t=(0,o.up)("ErrorMessage"),c=(0,o.up)("Card");return(0,o.wg)(),(0,o.iD)("div",_,[(0,o.Wm)(c,null,{title:(0,o.w5)((()=>[(0,o.Uk)((0,a.zw)(e.$t("admin.APP_CONFIG.TITLE")),1)])),content:(0,o.w5)((()=>[(0,o._)("form",{class:"admin-form",onSubmit:(0,i.iM)(H,["prevent"])},[(0,o._)("label",S,[(0,o.Uk)((0,a.zw)(e.$t("admin.APP_CONFIG.ADMIN_CONTACT"))+": ",1),(0,s.SU)(r)||B.admin_contact?(0,o.wy)(((0,o.wg)(),(0,o.iD)("input",{key:1,id:"admin_contact",name:"admin_contact",type:"email","onUpdate:modelValue":n[0]||(n[0]=e=>B.admin_contact=e),disabled:!(0,s.SU)(r)},null,8,A)),[[i.nr,B.admin_contact]]):((0,o.wg)(),(0,o.iD)("input",{key:0,class:"no-contact",value:e.$t("admin.APP_CONFIG.NO_CONTACT_EMAIL"),disabled:""},null,8,p))]),(0,o._)("label",z,[(0,o.Uk)((0,a.zw)(e.$t("admin.APP_CONFIG.MAX_USERS_LABEL"))+": ",1),(0,o.wy)((0,o._)("input",{id:"max_users",name:"max_users",type:"number",min:"0","onUpdate:modelValue":n[1]||(n[1]=e=>B.max_users=e),disabled:!(0,s.SU)(r)},null,8,O),[[i.nr,B.max_users]])]),(0,o._)("div",I,[(0,o._)("span",R,[N,(0,o.Uk)(" "+(0,a.zw)(e.$t("admin.APP_CONFIG.MAX_USERS_HELP")),1)])]),(0,o._)("label",g,[(0,o.Uk)((0,a.zw)(e.$t("admin.APP_CONFIG.SINGLE_UPLOAD_MAX_SIZE_LABEL"))+": ",1),(0,o.wy)((0,o._)("input",{id:"max_single_file_size",name:"max_single_file_size",type:"number",step:"0.1",min:"0","onUpdate:modelValue":n[2]||(n[2]=e=>B.max_single_file_size=e),disabled:!(0,s.SU)(r)},null,8,U),[[i.nr,B.max_single_file_size]])]),(0,o._)("label",C,[(0,o.Uk)((0,a.zw)(e.$t("admin.APP_CONFIG.ZIP_UPLOAD_MAX_SIZE_LABEL"))+": ",1),(0,o.wy)((0,o._)("input",{id:"max_zip_file_size",name:"max_zip_file_size",type:"number",step:"0.1",min:"0","onUpdate:modelValue":n[3]||(n[3]=e=>B.max_zip_file_size=e),disabled:!(0,s.SU)(r)},null,8,D),[[i.nr,B.max_zip_file_size]])]),(0,o._)("label",h,[(0,o.Uk)((0,a.zw)(e.$t("admin.APP_CONFIG.MAX_FILES_IN_ZIP_LABEL"))+": ",1),(0,o.wy)((0,o._)("input",{id:"gpx_limit_import",name:"gpx_limit_import",type:"number",min:"0","onUpdate:modelValue":n[4]||(n[4]=e=>B.gpx_limit_import=e),disabled:!(0,s.SU)(r)},null,8,v),[[i.nr,B.gpx_limit_import]])]),(0,o._)("label",P,(0,a.zw)(e.$t("admin.ABOUT.TEXT"))+": ",1),(0,o._)("span",f,(0,a.zw)(e.$t("admin.ABOUT.DESCRIPTION")),1),(0,s.SU)(r)?(0,o.wy)(((0,o.wg)(),(0,o.iD)("textarea",{key:0,id:"about",name:"about",rows:"10","onUpdate:modelValue":n[5]||(n[5]=e=>B.about=e)},null,512)),[[i.nr,B.about]]):((0,o.wg)(),(0,o.iD)("div",{key:1,innerHTML:(0,s.SU)(l.Z)((0,s.SU)(d.O)(B.about?B.about:e.$t("admin.NO_TEXT_ENTERED"))),class:"textarea-content"},null,8,L)),(0,o._)("label",w,(0,a.zw)((0,a.kC)(e.$t("privacy_policy.TITLE")))+": ",1),(0,o._)("span",k,(0,a.zw)(e.$t("admin.PRIVACY_POLICY_DESCRIPTION")),1),(0,s.SU)(r)?(0,o.wy)(((0,o.wg)(),(0,o.iD)("textarea",{key:2,id:"privacy_policy",name:"privacy_policy",rows:"20","onUpdate:modelValue":n[6]||(n[6]=e=>B.privacy_policy=e)},null,512)),[[i.nr,B.privacy_policy]]):((0,o.wg)(),(0,o.iD)("div",{key:3,innerHTML:(0,s.SU)(l.Z)((0,s.SU)(d.O)(B.privacy_policy?B.privacy_policy:e.$t("admin.NO_TEXT_ENTERED"))),class:"textarea-content"},null,8,b)),(0,s.SU)(Y)?((0,o.wg)(),(0,o.j4)(t,{key:4,message:(0,s.SU)(Y)},null,8,["message"])):(0,o.kq)("",!0),(0,s.SU)(r)?((0,o.wg)(),(0,o.iD)("div",M,[(0,o._)("button",y,(0,a.zw)(e.$t("buttons.SUBMIT")),1),(0,o._)("button",{class:"cancel",onClick:(0,i.iM)(K,["prevent"])},(0,a.zw)(e.$t("buttons.CANCEL")),9,G)])):((0,o.wg)(),(0,o.iD)("div",F,[(0,o._)("button",{class:"confirm",onClick:n[7]||(n[7]=(0,i.iM)((n=>e.$router.push("/admin/application/edit")),["prevent"]))},(0,a.zw)(e.$t("buttons.EDIT")),1),(0,o._)("button",{class:"cancel",onClick:n[8]||(n[8]=(0,i.iM)((n=>e.$router.push("/admin")),["prevent"]))},(0,a.zw)(e.$t("admin.BACK_TO_ADMIN")),1)]))],40,T)])),_:1})])}}}),B=r(3744);const Y=(0,B.Z)(W,[["__scopeId","data-v-80b4a9e6"]]);var x=Y;const K={class:"stat-card"},H={class:"stat-content box"},V={class:"stat-icon"},Z={class:"stat-details"},$={class:"stat-huge"},q={class:"stat"};var j=(0,o.aZ)({__name:"StatCard",props:{icon:null,text:null,value:null},setup(e){const n=e,{icon:r,text:t,value:i}=(0,s.BK)(n);return(e,n)=>((0,o.wg)(),(0,o.iD)("div",K,[(0,o._)("div",H,[(0,o._)("div",V,[(0,o._)("i",{class:(0,a.C_)(["fa",`fa-${(0,s.SU)(r)}`])},null,2)]),(0,o._)("div",Z,[(0,o._)("div",$,(0,a.zw)((0,s.SU)(i)),1),(0,o._)("div",q,(0,a.zw)((0,s.SU)(t)),1)])])]))}});const X=j;var Q=X;const J={id:"user-stats"};var ee=(0,o.aZ)({__name:"AppStatsCards",props:{appStatistics:null},setup(e){const n=e,{appStatistics:r}=(0,s.BK)(n),t=(0,o.Fl)((()=>(0,m.Z)(r.value.uploads_dir_size,!1)));return(e,n)=>((0,o.wg)(),(0,o.iD)("div",J,[(0,o.Wm)(Q,{icon:"users",value:(0,s.SU)(r).users,text:e.$t("admin.USER",(0,s.SU)(r).users)},null,8,["value","text"]),(0,o.Wm)(Q,{icon:"tags",value:(0,s.SU)(r).sports,text:e.$t("workouts.SPORT",(0,s.SU)(r).sports)},null,8,["value","text"]),(0,o.Wm)(Q,{icon:"calendar",value:(0,s.SU)(r).workouts,text:e.$t("workouts.WORKOUT",(0,s.SU)(r).workouts)},null,8,["value","text"]),(0,o.Wm)(Q,{icon:"folder-open",value:(0,s.SU)(t).size,text:(0,s.SU)(t).suffix},null,8,["value","text"])]))}});const ne=ee;var re=ne,te=r(2531);const oe=e=>((0,o.dD)("data-v-0dd66f89"),e=e(),(0,o.Cn)(),e),ae={id:"admin-menu",class:"center-card"},ie={class:"admin-menu description-list"},se={class:"application-config-details"},le=oe((()=>(0,o._)("br",null,null,-1))),ce={class:"registration-status"},ue={key:0,class:"email-sending-status"},me=oe((()=>(0,o._)("i",{class:"fa fa-exclamation-triangle","aria-hidden":"true"},null,-1)));var de=(0,o.aZ)({__name:"AdminMenu",props:{appConfig:null,appStatistics:{default:()=>({})}},setup(e){const n=e,{appConfig:r,appStatistics:t}=(0,s.BK)(n);return(e,n)=>{const i=(0,o.up)("router-link");return(0,o.wg)(),(0,o.iD)("div",ae,[(0,o.Wm)(te.Z,null,{title:(0,o.w5)((()=>[(0,o.Uk)((0,a.zw)(e.$t("admin.ADMINISTRATION")),1)])),content:(0,o.w5)((()=>[(0,o.Wm)(re,{appStatistics:(0,s.SU)(t)},null,8,["appStatistics"]),(0,o._)("div",ie,[(0,o._)("dl",null,[(0,o._)("dt",null,[(0,o.Wm)(i,{to:"/admin/application"},{default:(0,o.w5)((()=>[(0,o.Uk)((0,a.zw)(e.$t("admin.APPLICATION")),1)])),_:1})]),(0,o._)("dd",se,[(0,o.Uk)((0,a.zw)(e.$t("admin.UPDATE_APPLICATION_DESCRIPTION")),1),le,(0,o._)("span",ce,(0,a.zw)(e.$t("admin.REGISTRATION_"+((0,s.SU)(r).is_registration_enabled?"ENABLED":"DISABLED"))),1),(0,s.SU)(r).is_email_sending_enabled?(0,o.kq)("",!0):((0,o.wg)(),(0,o.iD)("span",ue,[me,(0,o.Uk)(" "+(0,a.zw)(e.$t("admin.EMAIL_SENDING_DISABLED")),1)]))]),(0,o._)("dt",null,[(0,o.Wm)(i,{to:"/admin/sports"},{default:(0,o.w5)((()=>[(0,o.Uk)((0,a.zw)((0,a.kC)(e.$t("workouts.SPORT",0))),1)])),_:1})]),(0,o._)("dd",null,(0,a.zw)(e.$t("admin.ENABLE_DISABLE_SPORTS")),1),(0,o._)("dt",null,[(0,o.Wm)(i,{to:"/admin/users"},{default:(0,o.w5)((()=>[(0,o.Uk)((0,a.zw)((0,a.kC)(e.$t("admin.USER",0))),1)])),_:1})]),(0,o._)("dd",null,(0,a.zw)(e.$t("admin.ADMIN_RIGHTS_DELETE_USER_ACCOUNT")),1)])])])),_:1})])}}});const Ee=(0,B.Z)(de,[["__scopeId","data-v-0dd66f89"]]);var _e=Ee,Te=r(9150),Se=r(631);const pe=e=>((0,o.dD)("data-v-6d62af67"),e=e(),(0,o.Cn)(),e),Ae={id:"admin-sports",class:"admin-card"},ze={class:"responsive-table"},Oe=pe((()=>(0,o._)("th",null,"#",-1))),Ie={class:"text-left"},Re={class:"text-left sport-action"},Ne=pe((()=>(0,o._)("th",null,null,-1))),ge={class:"text-center"},Ue=pe((()=>(0,o._)("span",{class:"cell-heading"},"id",-1))),Ce={class:"cell-heading"},De={class:"sport-label"},he={class:"cell-heading"},ve={class:"text-center"},Pe={class:"cell-heading"},fe={class:"sport-action"},Le={class:"cell-heading"},we={class:"action-button"},ke=["onClick"],be={key:0,class:"has-workouts"},Me=pe((()=>(0,o._)("i",{class:"fa fa-warning","aria-hidden":"true"},null,-1)));var ye=(0,o.aZ)({__name:"AdminSports",setup(e){const{t:n}=(0,Te.QT)(),r=(0,u.o)(),t=(0,o.Fl)((()=>(0,Se.xH)(r.getters[c.O8.GETTERS.SPORTS],n))),l=(0,o.Fl)((()=>r.getters[c.SY.GETTERS.ERROR_MESSAGES]));function m(e,n){r.dispatch(c.O8.ACTIONS.UPDATE_SPORTS,{id:e,isActive:n})}return(e,n)=>{const r=(0,o.up)("SportImage"),c=(0,o.up)("ErrorMessage"),u=(0,o.up)("Card");return(0,o.wg)(),(0,o.iD)("div",Ae,[(0,o.Wm)(u,null,{title:(0,o.w5)((()=>[(0,o.Uk)((0,a.zw)(e.$t("admin.SPORTS.TITLE")),1)])),content:(0,o.w5)((()=>[(0,o._)("button",{class:"top-button",onClick:n[0]||(n[0]=(0,i.iM)((n=>e.$router.push("/admin")),["prevent"]))},(0,a.zw)(e.$t("admin.BACK_TO_ADMIN")),1),(0,o._)("div",ze,[(0,o._)("table",null,[(0,o._)("thead",null,[(0,o._)("tr",null,[Oe,(0,o._)("th",null,(0,a.zw)(e.$t("admin.SPORTS.TABLE.IMAGE")),1),(0,o._)("th",Ie,(0,a.zw)(e.$t("admin.SPORTS.TABLE.LABEL")),1),(0,o._)("th",null,(0,a.zw)(e.$t("admin.SPORTS.TABLE.ACTIVE")),1),(0,o._)("th",Re,(0,a.zw)(e.$t("admin.ACTION")),1),Ne])]),(0,o._)("tbody",null,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)((0,s.SU)(t),(n=>((0,o.wg)(),(0,o.iD)("tr",{key:n.id},[(0,o._)("td",ge,[Ue,(0,o.Uk)(" "+(0,a.zw)(n.id),1)]),(0,o._)("td",null,[(0,o._)("span",Ce,(0,a.zw)(e.$t("admin.SPORTS.TABLE.IMAGE")),1),(0,o.Wm)(r,{title:n.translatedLabel,"sport-label":n.label,color:n.color},null,8,["title","sport-label","color"])]),(0,o._)("td",De,[(0,o._)("span",he,(0,a.zw)(e.$t("admin.SPORTS.TABLE.LABEL")),1),(0,o.Uk)(" "+(0,a.zw)(n.translatedLabel),1)]),(0,o._)("td",ve,[(0,o._)("span",Pe,(0,a.zw)(e.$t("admin.SPORTS.TABLE.ACTIVE")),1),(0,o._)("i",{class:(0,a.C_)("fa fa"+(n.is_active?"-check":"")),"aria-hidden":"true"},null,2)]),(0,o._)("td",fe,[(0,o._)("span",Le,(0,a.zw)(e.$t("admin.ACTION")),1),(0,o._)("div",we,[(0,o._)("button",{class:(0,a.C_)({danger:n.is_active}),onClick:e=>m(n.id,!n.is_active)},(0,a.zw)(e.$t(`buttons.${n.is_active?"DIS":"EN"}ABLE`)),11,ke),n.has_workouts?((0,o.wg)(),(0,o.iD)("span",be,[Me,(0,o.Uk)(" "+(0,a.zw)(e.$t("admin.SPORTS.TABLE.HAS_WORKOUTS")),1)])):(0,o.kq)("",!0)])])])))),128))])]),(0,s.SU)(l)?((0,o.wg)(),(0,o.j4)(c,{key:0,message:(0,s.SU)(l)},null,8,["message"])):(0,o.kq)("",!0),(0,o._)("button",{onClick:n[1]||(n[1]=(0,i.iM)((n=>e.$router.push("/admin")),["prevent"]))},(0,a.zw)(e.$t("admin.BACK_TO_ADMIN")),1)])])),_:1})])}}});const Ge=(0,B.Z)(ye,[["__scopeId","data-v-6d62af67"]]);var Fe=Ge,We=r(8626),Be=r(5020),Ye=r(6595);const xe={class:"users-filters"},Ke={class:"search-username"},He=["onKeyup","placeholder"];var Ve=(0,o.aZ)({__name:"UsersNameFilter",emits:["filterOnUsername"],setup(e,{emit:n}){const r=(0,t.yj)(),l=(0,s.iH)(r.query.q?r.query.q:"");function c(){""!==l.value&&n("filterOnUsername",l)}function u(){l.value="",n("filterOnUsername",l.value)}return(e,n)=>((0,o.wg)(),(0,o.iD)("div",xe,[(0,o._)("div",Ke,[(0,o.wy)((0,o._)("input",{id:"username",name:"username","onUpdate:modelValue":n[0]||(n[0]=e=>l.value=e),onKeyup:(0,i.D2)(c,["enter"]),placeholder:e.$t("user.FILTER_ON_USERNAME")},null,40,He),[[i.nr,l.value,void 0,{trim:!0}]]),""!==l.value?((0,o.wg)(),(0,o.iD)("i",{key:0,class:"fa fa-times","aria-hidden":"true",onClick:u})):(0,o.kq)("",!0)]),(0,o._)("i",{class:(0,a.C_)(["fa fa-search",{"fa-disabled":""===l.value}]),"aria-hidden":"true",onClick:c},null,2)]))}});const Ze=(0,B.Z)(Ve,[["__scopeId","data-v-627a8e91"]]);var $e=Ze,qe=r(2766),je=r(6558);const Xe=e=>((0,o.dD)("data-v-dc12ff78"),e=e(),(0,o.Cn)(),e),Qe={id:"admin-users",class:"admin-card"},Je={key:0,class:"no-users"},en={key:1,class:"responsive-table"},nn=Xe((()=>(0,o._)("th",null,"#",-1))),rn={class:"left-text"},tn={class:"left-text"},on={class:"left-text"},an={class:"cell-heading"},sn={class:"cell-heading"},ln={class:"cell-heading"},cn={class:"cell-heading"},un={class:"text-center"},mn={class:"cell-heading"},dn={class:"text-center"},En={class:"cell-heading"},_n={class:"text-center"},Tn={class:"cell-heading"},Sn={class:"text-center"},pn={class:"cell-heading"},An=["disabled","onClick"];var zn=(0,o.aZ)({__name:"AdminUsers",setup(e){const n=(0,u.o)(),r=(0,t.yj)(),l=(0,t.tv)(),m=["is_active","admin","created_at","username","workouts_count"],d="created_at";let E=(0,s.qj)((0,qe.pm)(r.query,m,d));const _=(0,o.Fl)((()=>n.getters[c.YN.GETTERS.AUTH_USER_PROFILE])),T=(0,o.Fl)((()=>n.getters[c.RT.GETTERS.USERS])),S=(0,o.Fl)((()=>n.getters[c.RT.GETTERS.USERS_PAGINATION])),p=(0,o.Fl)((()=>n.getters[c.SY.GETTERS.ERROR_MESSAGES]));function A(e){n.dispatch(c.RT.ACTIONS.GET_USERS,e)}function z(e){I("q",e.value)}function O(e,r){n.dispatch(c.RT.ACTIONS.UPDATE_USER,{username:e,admin:r})}function I(e,n){E[e]=n,"per_page"===e&&(E.page=1),l.push({path:"/admin/users",query:E})}return(0,o.wF)((()=>A(E))),(0,o.Ah)((()=>{n.dispatch(c.RT.ACTIONS.EMPTY_USERS)})),(0,o.YP)((()=>r.query),(e=>{E=(0,qe.pm)(e,m,d,{query:E}),A(E)})),(e,n)=>{const r=(0,o.up)("router-link"),t=(0,o.up)("ErrorMessage"),l=(0,o.up)("Card");return(0,o.wg)(),(0,o.iD)("div",Qe,[(0,o.Wm)(l,null,{title:(0,o.w5)((()=>[(0,o.Uk)((0,a.zw)((0,a.kC)(e.$t("admin.USER",0))),1)])),content:(0,o.w5)((()=>[(0,o._)("button",{class:"top-button",onClick:n[0]||(n[0]=(0,i.iM)((n=>e.$router.push("/admin")),["prevent"]))},(0,a.zw)(e.$t("admin.BACK_TO_ADMIN")),1),(0,o.Wm)($e,{onFilterOnUsername:z}),(0,o.Wm)(We.Z,{sort:(0,s.SU)(qe.fS),order_by:m,query:(0,s.SU)(E),message:"admin.USERS.SELECTS.ORDER_BY",onUpdateSelect:I},null,8,["sort","query"]),0===(0,s.SU)(T).length?((0,o.wg)(),(0,o.iD)("div",Je,(0,a.zw)(e.$t("user.NO_USERS_FOUND")),1)):((0,o.wg)(),(0,o.iD)("div",en,[(0,o._)("table",null,[(0,o._)("thead",null,[(0,o._)("tr",null,[nn,(0,o._)("th",rn,(0,a.zw)(e.$t("user.USERNAME")),1),(0,o._)("th",tn,(0,a.zw)(e.$t("user.EMAIL")),1),(0,o._)("th",on,(0,a.zw)(e.$t("user.PROFILE.REGISTRATION_DATE")),1),(0,o._)("th",null,(0,a.zw)((0,a.kC)(e.$t("workouts.WORKOUT",0))),1),(0,o._)("th",null,(0,a.zw)(e.$t("admin.ACTIVE")),1),(0,o._)("th",null,(0,a.zw)(e.$t("user.ADMIN")),1),(0,o._)("th",null,(0,a.zw)(e.$t("admin.ACTION")),1)])]),(0,o._)("tbody",null,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)((0,s.SU)(T),(n=>((0,o.wg)(),(0,o.iD)("tr",{key:n.username},[(0,o._)("td",null,[(0,o._)("span",an,(0,a.zw)(e.$t("user.PROFILE.PICTURE")),1),(0,o.Wm)(Ye.Z,{user:n},null,8,["user"])]),(0,o._)("td",null,[(0,o._)("span",sn,(0,a.zw)(e.$t("user.USERNAME")),1),(0,o.Wm)(r,{to:`/admin/users/${n.username}`},{default:(0,o.w5)((()=>[(0,o.Uk)((0,a.zw)(n.username),1)])),_:2},1032,["to"])]),(0,o._)("td",null,[(0,o._)("span",ln,(0,a.zw)(e.$t("user.EMAIL")),1),(0,o.Uk)(" "+(0,a.zw)(n.email),1)]),(0,o._)("td",null,[(0,o._)("span",cn,(0,a.zw)(e.$t("user.PROFILE.REGISTRATION_DATE")),1),(0,o.Uk)(" "+(0,a.zw)((0,s.SU)(je.p6)(n.created_at,(0,s.SU)(_).timezone,(0,s.SU)(_).date_format)),1)]),(0,o._)("td",un,[(0,o._)("span",mn,(0,a.zw)((0,a.kC)(e.$t("workouts.WORKOUT",0))),1),(0,o.Uk)(" "+(0,a.zw)(n.nb_workouts),1)]),(0,o._)("td",dn,[(0,o._)("span",En,(0,a.zw)(e.$t("admin.ACTIVE")),1),(0,o._)("i",{class:(0,a.C_)(`fa fa${n.is_active?"-check":""}-square-o`),"aria-hidden":"true"},null,2)]),(0,o._)("td",_n,[(0,o._)("span",Tn,(0,a.zw)(e.$t("user.ADMIN")),1),(0,o._)("i",{class:(0,a.C_)(`fa fa${n.admin?"-check":""}-square-o`),"aria-hidden":"true"},null,2)]),(0,o._)("td",Sn,[(0,o._)("span",pn,(0,a.zw)(e.$t("admin.ACTION")),1),(0,o._)("button",{class:(0,a.C_)({danger:n.admin}),disabled:n.username===(0,s.SU)(_).username,onClick:e=>O(n.username,!n.admin)},(0,a.zw)(e.$t(`admin.USERS.TABLE.${n.admin?"REMOVE":"ADD"}_ADMIN_RIGHTS`)),11,An)])])))),128))])]),(0,s.SU)(S).page?((0,o.wg)(),(0,o.j4)(Be.Z,{key:0,path:"/admin/users",pagination:(0,s.SU)(S),query:(0,s.SU)(E)},null,8,["pagination","query"])):(0,o.kq)("",!0),(0,s.SU)(p)?((0,o.wg)(),(0,o.j4)(t,{key:1,message:(0,s.SU)(p)},null,8,["message"])):(0,o.kq)("",!0),(0,o._)("button",{onClick:n[1]||(n[1]=(0,i.iM)((n=>e.$router.push("/admin")),["prevent"]))},(0,a.zw)(e.$t("admin.BACK_TO_ADMIN")),1)]))])),_:1})])}}});const On=(0,B.Z)(zn,[["__scopeId","data-v-dc12ff78"]]);var In=On,Rn=r(2179);const Nn={class:"profile-tabs custom-checkboxes-group"},gn={class:"profile-tabs-checkboxes custom-checkboxes"},Un=["id","name","checked","disabled","onInput"];var Cn=(0,o.aZ)({__name:"UserProfileTabs",props:{tabs:null,selectedTab:null,edition:{type:Boolean},disabled:{type:Boolean,default:!1}},setup(e){const n=e,{tabs:r,selectedTab:t,disabled:i}=(0,s.BK)(n);function l(e){switch(e){case"ACCOUNT":case"PICTURE":case"PRIVACY-POLICY":return`/profile/edit/${e.toLocaleLowerCase()}`;case"APPS":case"PREFERENCES":case"SPORTS":return`/profile${n.edition?"/edit":""}/${e.toLocaleLowerCase()}`;default:case"PROFILE":return"/profile"+(n.edition?"/edit":"")}}return(e,n)=>((0,o.wg)(),(0,o.iD)("div",Nn,[(0,o._)("div",gn,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)((0,s.SU)(r),(n=>((0,o.wg)(),(0,o.iD)("div",{class:"profile-tab custom-checkbox",key:n},[(0,o._)("label",null,[(0,o._)("input",{type:"radio",id:n,name:n,checked:(0,s.SU)(t).split("/")[0]===n,disabled:(0,s.SU)(i),onInput:r=>e.$router.push(l(n))},null,40,Un),(0,o._)("span",null,(0,a.zw)(e.$t(`user.PROFILE.TABS.${n}`)),1)])])))),128))])]))}});const Dn=Cn;var hn=Dn;const vn={id:"user-profile"},Pn={class:"box"};var fn=(0,o.aZ)({__name:"index",props:{user:null,tab:null},setup(e){const n=e,{user:r,tab:t}=(0,s.BK)(n),a=["PROFILE","PREFERENCES","SPORTS","APPS"];return(e,n)=>{const i=(0,o.up)("router-view");return(0,o.wg)(),(0,o.iD)("div",vn,[(0,o.Wm)(Rn.Z,{user:(0,s.SU)(r)},null,8,["user"]),(0,o._)("div",Pn,[(0,o.Wm)(hn,{tabs:a,selectedTab:(0,s.SU)(t),edition:!1},null,8,["selectedTab"]),(0,o.Wm)(i,{user:(0,s.SU)(r)},null,8,["user"])])])}}});const Ln=(0,B.Z)(fn,[["__scopeId","data-v-9729cba4"]]);var wn=Ln,kn=r(1585),bn=r(6287);const Mn={id:"user-preferences",class:"description-list"},yn={class:"info-box raw-speed-help"},Gn=(0,o._)("i",{class:"fa fa-info-circle","aria-hidden":"true"},null,-1),Fn={class:"profile-buttons"};var Wn=(0,o.aZ)({__name:"UserPreferences",props:{user:null},setup(e){const n=e,r=(0,u.o)(),t=(0,o.Fl)((()=>r.getters[c.SY.GETTERS.LANGUAGE])),i=(0,o.Fl)((()=>n.user.language?bn.zK[n.user.language]:bn.zK.en)),l=(0,o.Fl)((()=>n.user.weekm?"MONDAY":"SUNDAY")),m=(0,o.Fl)((()=>n.user.timezone?n.user.timezone:"Europe/Paris")),d=(0,o.Fl)((()=>n.user.date_format?n.user.date_format:"MM/dd/yyyy")),E=(0,o.Fl)((()=>n.user.display_ascent?"DISPLAYED":"HIDDEN"));return(n,r)=>((0,o.wg)(),(0,o.iD)("div",Mn,[(0,o._)("dl",null,[(0,o._)("dt",null,(0,a.zw)(n.$t("user.PROFILE.LANGUAGE"))+":",1),(0,o._)("dd",null,(0,a.zw)((0,s.SU)(i)),1),(0,o._)("dt",null,(0,a.zw)(n.$t("user.PROFILE.TIMEZONE"))+":",1),(0,o._)("dd",null,(0,a.zw)((0,s.SU)(m)),1),(0,o._)("dt",null,(0,a.zw)(n.$t("user.PROFILE.DATE_FORMAT"))+":",1),(0,o._)("dd",null,(0,a.zw)((0,s.SU)(je.mh)((0,s.SU)(d),(0,s.SU)(t))),1),(0,o._)("dt",null,(0,a.zw)(n.$t("user.PROFILE.FIRST_DAY_OF_WEEK"))+":",1),(0,o._)("dd",null,(0,a.zw)(n.$t(`user.PROFILE.${(0,s.SU)(l)}`)),1),(0,o._)("dt",null,(0,a.zw)(n.$t("user.PROFILE.UNITS.LABEL"))+":",1),(0,o._)("dd",null,(0,a.zw)(n.$t("user.PROFILE.UNITS."+(e.user.imperial_units?"IMPERIAL":"METRIC"))),1),(0,o._)("dt",null,(0,a.zw)(n.$t("user.PROFILE.ASCENT_DATA"))+":",1),(0,o._)("dd",null,(0,a.zw)(n.$t(`common.${(0,s.SU)(E)}`)),1),(0,o._)("dt",null,(0,a.zw)(n.$t("user.PROFILE.ELEVATION_CHART_START.LABEL"))+":",1),(0,o._)("dd",null,(0,a.zw)(n.$t("user.PROFILE.ELEVATION_CHART_START."+(e.user.start_elevation_at_zero?"ZERO":"MIN_ALT"))),1),(0,o._)("dt",null,(0,a.zw)(n.$t("user.PROFILE.USE_RAW_GPX_SPEED.LABEL"))+":",1),(0,o._)("dd",null,(0,a.zw)(n.$t("user.PROFILE.USE_RAW_GPX_SPEED."+(e.user.use_raw_gpx_speed?"RAW_SPEED":"FILTERED_SPEED"))),1),(0,o._)("div",yn,[(0,o._)("span",null,[Gn,(0,o.Uk)(" "+(0,a.zw)(n.$t("user.PROFILE.USE_RAW_GPX_SPEED.HELP")),1)])])]),(0,o._)("div",Fn,[(0,o._)("button",{onClick:r[0]||(r[0]=e=>n.$router.push("/profile/edit/preferences"))},(0,a.zw)(n.$t("user.PROFILE.EDIT_PREFERENCES")),1),(0,o._)("button",{onClick:r[1]||(r[1]=e=>n.$router.push("/"))},(0,a.zw)(n.$t("common.HOME")),1)])]))}});const Bn=Wn;var Yn=Bn;const xn={id:"user-profile-edition",class:"center-card"};var Kn=(0,o.aZ)({__name:"index",props:{user:null,tab:null},setup(e){const n=e,r=(0,u.o)(),{user:t,tab:i}=(0,s.BK)(n),l=["PROFILE","ACCOUNT","PICTURE","PREFERENCES","SPORTS","PRIVACY-POLICY"],m=(0,o.Fl)((()=>r.getters[c.YN.GETTERS.USER_LOADING]));return(e,n)=>{const r=(0,o.up)("router-view"),c=(0,o.up)("Card");return(0,o.wg)(),(0,o.iD)("div",xn,[(0,o.Wm)(c,null,{title:(0,o.w5)((()=>[(0,o.Uk)((0,a.zw)(e.$t(`user.PROFILE.${(0,s.SU)(i)}_EDITION`)),1)])),content:(0,o.w5)((()=>[(0,o.Wm)(hn,{tabs:l,selectedTab:(0,s.SU)(i),edition:!0,disabled:(0,s.SU)(m)},null,8,["selectedTab","disabled"]),(0,o.Wm)(r,{user:(0,s.SU)(t)},null,8,["user"])])),_:1})])}}});const Hn=Kn;var Vn=Hn,Zn=r(313),$n=r(7069),qn=r(5167),jn=r(8403);const Xn=e=>((0,o.dD)("data-v-6e11106c"),e=e(),(0,o.Cn)(),e),Qn={id:"user-infos-edition"},Jn={class:"profile-form form-box"},er={key:1,class:"info-box success-message"},nr=["onSubmit"],rr={class:"form-items",for:"email"},tr=["disabled"],or={class:"form-items",for:"password-field"},ar={class:"form-items",for:"new-password-field"},ir={class:"form-buttons"},sr={class:"confirm",type:"submit"},lr=["onClick"],cr={class:"data-export"},ur={class:"info-box"},mr=Xn((()=>(0,o._)("i",{class:"fa fa-info-circle","aria-hidden":"true"},null,-1))),dr={key:0,class:"data-export-archive"},Er=Xn((()=>(0,o._)("i",{class:"fa fa-download","aria-hidden":"true"},null,-1))),_r={key:1},Tr={key:2},Sr=Xn((()=>(0,o._)("i",{class:"fa fa-spinner fa-pulse","aria-hidden":"true"},null,-1)));var pr=(0,o.aZ)({__name:"UserAccountEdition",props:{user:null},setup(e){const n=e,{user:r}=(0,s.BK)(n),t=(0,u.o)(),l=(0,s.qj)({email:"",password:"",new_password:""}),d=(0,o.Fl)((()=>t.getters[c.YN.GETTERS.USER_LOADING])),E=(0,o.Fl)((()=>t.getters[c.SY.GETTERS.APP_CONFIG])),_=(0,o.Fl)((()=>t.getters[c.YN.GETTERS.IS_SUCCESS])),T=(0,s.iH)(!1),S=(0,o.Fl)((()=>t.getters[c.SY.GETTERS.ERROR_MESSAGES])),p=(0,s.iH)(!1),A=(0,s.iH)(!1),z=(0,o.Fl)((()=>t.getters[c.YN.GETTERS.EXPORT_REQUEST])),O=(0,o.Fl)((()=>C())),I=(0,s.iH)(!1);function R(){p.value=!0}function N(e){l.email=e.email}function g(e){l.password=e}function U(e){l.new_password=e}function C(){return z.value?(0,je.p6)(z.value.created_at,r.value.timezone,r.value.date_format,!0,null,!0):null}function D(){return!O.value||(0,Zn.Z)(new Date(O.value),(0,$n.Z)(new Date,1))}function h(){const e={email:l.email,password:l.password};l.new_password&&(e.new_password=l.new_password),T.value=l.email!==r.value.email,t.dispatch(c.YN.ACTIONS.UPDATE_USER_ACCOUNT,e)}function v(e){A.value=e}function P(e){t.dispatch(c.YN.ACTIONS.DELETE_ACCOUNT,{username:e})}function f(){t.dispatch(c.YN.ACTIONS.REQUEST_DATA_EXPORT)}async function L(e){I.value=!0,await qn.Z.get(`/auth/account/export/${e}`,{responseType:"blob"}).then((n=>{const r=window.URL.createObjectURL(new Blob([n.data],{type:"application/zip"})),t=document.createElement("a");t.href=r,t.setAttribute("download",e),document.body.appendChild(t),t.click()})).finally((()=>I.value=!1))}return(0,o.bv)((()=>{n.user&&(t.dispatch(c.YN.ACTIONS.GET_REQUEST_DATA_EXPORT),N(n.user))})),(0,o.Ah)((()=>{t.commit(c.YN.MUTATIONS.UPDATE_IS_SUCCESS,!1),t.commit(c.SY.MUTATIONS.EMPTY_ERROR_MESSAGES)})),(0,o.YP)((()=>_.value),(async e=>{e&&(g(""),U(""),N(r.value),p.value=!1)})),(0,o.YP)((()=>r.value.email),(async()=>{N(r.value)})),(e,n)=>{const t=(0,o.up)("Modal"),c=(0,o.up)("ErrorMessage");return(0,o.wg)(),(0,o.iD)("div",Qn,[A.value?((0,o.wg)(),(0,o.j4)(t,{key:0,title:e.$t("common.CONFIRMATION"),message:e.$t("user.CONFIRM_ACCOUNT_DELETION"),onConfirmAction:n[0]||(n[0]=e=>P((0,s.SU)(r).username)),onCancelAction:n[1]||(n[1]=e=>v(!1))},null,8,["title","message"])):(0,o.kq)("",!0),(0,o._)("div",Jn,[(0,s.SU)(S)?((0,o.wg)(),(0,o.j4)(c,{key:0,message:(0,s.SU)(S)},null,8,["message"])):(0,o.kq)("",!0),(0,s.SU)(_)?((0,o.wg)(),(0,o.iD)("div",er,(0,a.zw)(e.$t(`user.PROFILE.SUCCESSFUL_${T.value&&(0,s.SU)(E).is_email_sending_enabled?"EMAIL_":""}UPDATE`)),1)):(0,o.kq)("",!0),(0,o._)("form",{class:(0,a.C_)({errors:p.value}),onSubmit:(0,i.iM)(h,["prevent"])},[(0,o._)("label",rr,[(0,o.Uk)((0,a.zw)(e.$t("user.EMAIL"))+"* ",1),(0,o.wy)((0,o._)("input",{id:"email","onUpdate:modelValue":n[2]||(n[2]=e=>l.email=e),disabled:(0,s.SU)(d),required:!0,onInvalid:R},null,40,tr),[[i.nr,l.email]])]),(0,o._)("label",or,[(0,o.Uk)((0,a.zw)(e.$t("user.CURRENT_PASSWORD"))+"* ",1),(0,o.Wm)(jn.Z,{id:"password-field",disabled:(0,s.SU)(d),password:l.password,required:!0,onUpdatePassword:g,onPasswordError:R},null,8,["disabled","password"])]),(0,o._)("label",ar,[(0,o.Uk)((0,a.zw)(e.$t("user.NEW_PASSWORD"))+" ",1),(0,o.Wm)(jn.Z,{id:"new-password-field",disabled:(0,s.SU)(d),checkStrength:!0,password:l.new_password,isSuccess:!1,onUpdatePassword:U,onPasswordError:R},null,8,["disabled","password"])]),(0,o._)("div",ir,[(0,o._)("button",sr,(0,a.zw)(e.$t("buttons.SUBMIT")),1),(0,o._)("button",{class:"cancel",onClick:n[3]||(n[3]=(0,i.iM)((n=>e.$router.push("/profile")),["prevent"]))},(0,a.zw)(e.$t("buttons.CANCEL")),1),(0,o._)("button",{class:"danger",onClick:n[4]||(n[4]=(0,i.iM)((e=>v(!0)),["prevent"]))},(0,a.zw)(e.$t("buttons.DELETE_MY_ACCOUNT")),1),D()?((0,o.wg)(),(0,o.iD)("button",{key:0,class:"confirm",onClick:(0,i.iM)(f,["prevent"])},(0,a.zw)(e.$t("buttons.REQUEST_DATA_EXPORT")),9,lr)):(0,o.kq)("",!0)])],42,nr),(0,o._)("div",cr,[(0,o._)("span",ur,[mr,(0,o.Uk)(" "+(0,a.zw)(e.$t("user.EXPORT_REQUEST.ONLY_ONE_EXPORT_PER_DAY")),1)]),(0,s.SU)(z)?((0,o.wg)(),(0,o.iD)("div",dr,[(0,o.Uk)((0,a.zw)(e.$t("user.EXPORT_REQUEST.DATA_EXPORT"))+" ("+(0,a.zw)((0,s.SU)(O))+"): ",1),"successful"===(0,s.SU)(z).status?((0,o.wg)(),(0,o.iD)("span",{key:0,class:"archive-link",onClick:n[5]||(n[5]=(0,i.iM)((e=>L((0,s.SU)(z).file_name)),["prevent"]))},[Er,(0,o.Uk)(" "+(0,a.zw)(e.$t("user.EXPORT_REQUEST.DOWNLOAD_ARCHIVE"))+" ("+(0,a.zw)((0,s.SU)(m.Z)((0,s.SU)(z).file_size))+") ",1)])):((0,o.wg)(),(0,o.iD)("span",_r,(0,a.zw)(e.$t(`user.EXPORT_REQUEST.STATUS.${(0,s.SU)(z).status}`)),1)),I.value?((0,o.wg)(),(0,o.iD)("span",Tr,[(0,o.Uk)((0,a.zw)(e.$t("user.EXPORT_REQUEST.GENERATING_LINK"))+" ",1),Sr])):(0,o.kq)("",!0)])):(0,o.kq)("",!0)])])])}}});const Ar=(0,B.Z)(pr,[["__scopeId","data-v-6e11106c"]]);var zr=Ar,Or=r(6761);const Ir={id:"user-infos-edition"},Rr={class:"profile-form form-box"},Nr=["onSubmit"],gr={class:"form-items",for:"registrationDate"},Ur=["value"],Cr={class:"form-items",for:"first_name"},Dr=["disabled"],hr={class:"form-items",for:"last_name"},vr={class:"form-items",for:"birth_date"},Pr=["disabled"],fr={class:"form-items",for:"location"},Lr=["disabled"],wr={class:"form-items"},kr={class:"form-buttons"},br={class:"confirm",type:"submit"};var Mr=(0,o.aZ)({__name:"UserInfosEdition",props:{user:null},setup(e){const n=e,r=(0,u.o)(),t=(0,s.qj)({first_name:"",last_name:"",birth_date:"",location:"",bio:""}),l=(0,o.Fl)((()=>n.user.created_at?(0,je.p6)(n.user.created_at,n.user.timezone,n.user.date_format):"")),m=(0,o.Fl)((()=>r.getters[c.YN.GETTERS.USER_LOADING])),d=(0,o.Fl)((()=>r.getters[c.SY.GETTERS.ERROR_MESSAGES]));function E(e){t.first_name=e.first_name?e.first_name:"",t.last_name=e.last_name?e.last_name:"",t.birth_date=e.birth_date?(0,Or.Z)(new Date(e.birth_date),"yyyy-MM-dd"):"",t.location=e.location?e.location:"",t.bio=e.bio?e.bio:""}function _(e){t.bio=e}function T(){r.dispatch(c.YN.ACTIONS.UPDATE_USER_PROFILE,t)}return(0,o.bv)((()=>{n.user&&E(n.user)})),(0,o.Ah)((()=>{r.commit(c.SY.MUTATIONS.EMPTY_ERROR_MESSAGES)})),(e,n)=>{const r=(0,o.up)("ErrorMessage"),c=(0,o.up)("CustomTextArea");return(0,o.wg)(),(0,o.iD)("div",Ir,[(0,o._)("div",Rr,[(0,s.SU)(d)?((0,o.wg)(),(0,o.j4)(r,{key:0,message:(0,s.SU)(d)},null,8,["message"])):(0,o.kq)("",!0),(0,o._)("form",{onSubmit:(0,i.iM)(T,["prevent"])},[(0,o._)("label",gr,[(0,o.Uk)((0,a.zw)(e.$t("user.PROFILE.REGISTRATION_DATE"))+" ",1),(0,o._)("input",{id:"registrationDate",value:(0,s.SU)(l),disabled:""},null,8,Ur)]),(0,o._)("label",Cr,[(0,o.Uk)((0,a.zw)(e.$t("user.PROFILE.FIRST_NAME"))+" ",1),(0,o.wy)((0,o._)("input",{id:"first_name","onUpdate:modelValue":n[0]||(n[0]=e=>t.first_name=e),disabled:(0,s.SU)(m)},null,8,Dr),[[i.nr,t.first_name]])]),(0,o._)("label",hr,[(0,o.Uk)((0,a.zw)(e.$t("user.PROFILE.LAST_NAME"))+" ",1),(0,o.wy)((0,o._)("input",{id:"last_name","onUpdate:modelValue":n[1]||(n[1]=e=>t.last_name=e)},null,512),[[i.nr,t.last_name]])]),(0,o._)("label",vr,[(0,o.Uk)((0,a.zw)(e.$t("user.PROFILE.BIRTH_DATE"))+" ",1),(0,o.wy)((0,o._)("input",{id:"birth_date",type:"date",class:"birth-date","onUpdate:modelValue":n[2]||(n[2]=e=>t.birth_date=e),disabled:(0,s.SU)(m)},null,8,Pr),[[i.nr,t.birth_date]])]),(0,o._)("label",fr,[(0,o.Uk)((0,a.zw)(e.$t("user.PROFILE.LOCATION"))+" ",1),(0,o.wy)((0,o._)("input",{id:"location","onUpdate:modelValue":n[3]||(n[3]=e=>t.location=e),disabled:(0,s.SU)(m)},null,8,Lr),[[i.nr,t.location]])]),(0,o._)("label",wr,[(0,o.Uk)((0,a.zw)(e.$t("user.PROFILE.BIO"))+" ",1),(0,o.Wm)(c,{name:"bio",charLimit:200,input:t.bio,disabled:(0,s.SU)(m),onUpdateValue:_},null,8,["input","disabled"])]),(0,o._)("div",kr,[(0,o._)("button",br,(0,a.zw)(e.$t("buttons.SUBMIT")),1),(0,o._)("button",{class:"cancel",onClick:n[4]||(n[4]=(0,i.iM)((n=>e.$router.push("/profile")),["prevent"]))},(0,a.zw)(e.$t("buttons.CANCEL")),1)])],40,Nr)])])}}});const yr=(0,B.Z)(Mr,[["__scopeId","data-v-5e5a4552"]]);var Gr=yr;const Fr=e=>((0,o.dD)("data-v-687e9604"),e=e(),(0,o.Cn)(),e),Wr={id:"user-picture-edition"},Br={class:"user-picture-form"},Yr=["onSubmit"],xr={class:"picture-help"},Kr={class:"info-box"},Hr=Fr((()=>(0,o._)("i",{class:"fa fa-info-circle","aria-hidden":"true"},null,-1))),Vr={class:"picture-buttons"},Zr=["disabled"];var $r=(0,o.aZ)({__name:"UserPictureEdition",props:{user:null},setup(e){const n=e,r=(0,u.o)(),{user:t}=(0,s.BK)(n),l=(0,o.Fl)((()=>r.getters[c.SY.GETTERS.ERROR_MESSAGES])),d=(0,o.Fl)((()=>r.getters[c.SY.GETTERS.APP_CONFIG])),E=d.value.max_single_file_size?(0,m.Z)(d.value.max_single_file_size):"",_=(0,s.iH)(null);function T(){r.dispatch(c.YN.ACTIONS.DELETE_PICTURE)}function S(e){e.target.files&&(_.value=e.target.files[0])}function p(){_.value&&r.dispatch(c.YN.ACTIONS.UPDATE_USER_PICTURE,{picture:_.value})}return(0,o.Ah)((()=>{r.commit(c.SY.MUTATIONS.EMPTY_ERROR_MESSAGES)})),(e,n)=>{const r=(0,o.up)("ErrorMessage");return(0,o.wg)(),(0,o.iD)("div",Wr,[(0,o._)("div",Br,[(0,s.SU)(l)?((0,o.wg)(),(0,o.j4)(r,{key:0,message:(0,s.SU)(l)},null,8,["message"])):(0,o.kq)("",!0),(0,o.Wm)(Ye.Z,{user:(0,s.SU)(t)},null,8,["user"]),(0,o._)("form",{onSubmit:(0,i.iM)(p,["prevent"])},[(0,o._)("input",{type:"file",name:"picture",accept:".png,.jpg,.gif",onInput:S},null,32),(0,o._)("div",xr,[(0,o._)("span",Kr,[Hr,(0,o.Uk)(" "+(0,a.zw)(e.$t("workouts.MAX_SIZE"))+": "+(0,a.zw)((0,s.SU)(E)),1)])]),(0,o._)("div",Vr,[(0,o._)("button",{type:"submit",disabled:!_.value},(0,a.zw)(e.$t("user.PROFILE.PICTURE_UPDATE")),9,Zr),(0,s.SU)(t).picture?((0,o.wg)(),(0,o.iD)("button",{key:0,class:"danger",onClick:T},(0,a.zw)(e.$t("user.PROFILE.PICTURE_REMOVE")),1)):(0,o.kq)("",!0),(0,o._)("button",{class:"cancel",onClick:n[0]||(n[0]=n=>e.$router.push("/profile"))},(0,a.zw)(e.$t("user.PROFILE.BACK_TO_PROFILE")),1)])],40,Yr)])])}}});const qr=(0,B.Z)($r,[["__scopeId","data-v-687e9604"]]);var jr=qr;const Xr=["Africa/Abidjan","Africa/Accra","Africa/Algiers","Africa/Bissau","Africa/Cairo","Africa/Casablanca","Africa/Ceuta","Africa/El_Aaiun","Africa/Johannesburg","Africa/Juba","Africa/Khartoum","Africa/Lagos","Africa/Maputo","Africa/Monrovia","Africa/Nairobi","Africa/Ndjamena","Africa/Sao_Tome","Africa/Tripoli","Africa/Tunis","Africa/Windhoek","America/Adak","America/Anchorage","America/Araguaina","America/Argentina/Buenos_Aires","America/Argentina/Catamarca","America/Argentina/Cordoba","America/Argentina/Jujuy","America/Argentina/La_Rioja","America/Argentina/Mendoza","America/Argentina/Rio_Gallegos","America/Argentina/Salta","America/Argentina/San_Juan","America/Argentina/San_Luis","America/Argentina/Tucuman","America/Argentina/Ushuaia","America/Asuncion","America/Atikokan","America/Bahia","America/Bahia_Banderas","America/Barbados","America/Belem","America/Belize","America/Blanc-Sablon","America/Boa_Vista","America/Bogota","America/Boise","America/Cambridge_Bay","America/Campo_Grande","America/Cancun","America/Caracas","America/Cayenne","America/Chicago","America/Chihuahua","America/Costa_Rica","America/Creston","America/Cuiaba","America/Curacao","America/Danmarkshavn","America/Dawson","America/Dawson_Creek","America/Denver","America/Detroit","America/Edmonton","America/Eirunepe","America/El_Salvador","America/Fortaleza","America/Fort_Nelson","America/Glace_Bay","America/Godthab","America/Goose_Bay","America/Grand_Turk","America/Guatemala","America/Guayaquil","America/Guyana","America/Halifax","America/Havana","America/Hermosillo","America/Indiana/Indianapolis","America/Indiana/Knox","America/Indiana/Marengo","America/Indiana/Petersburg","America/Indiana/Tell_City","America/Indiana/Vevay","America/Indiana/Vincennes","America/Indiana/Winamac","America/Inuvik","America/Iqaluit","America/Jamaica","America/Juneau","America/Kentucky/Louisville","America/Kentucky/Monticello","America/La_Paz","America/Lima","America/Los_Angeles","America/Maceio","America/Managua","America/Manaus","America/Martinique","America/Matamoros","America/Mazatlan","America/Menominee","America/Merida","America/Metlakatla","America/Mexico_City","America/Miquelon","America/Moncton","America/Monterrey","America/Montevideo","America/Nassau","America/New_York","America/Nipigon","America/Nome","America/Noronha","America/North_Dakota/Beulah","America/North_Dakota/Center","America/North_Dakota/New_Salem","America/Ojinaga","America/Panama","America/Pangnirtung","America/Paramaribo","America/Phoenix","America/Port-au-Prince","America/Port_of_Spain","America/Porto_Velho","America/Puerto_Rico","America/Punta_Arenas","America/Rainy_River","America/Rankin_Inlet","America/Recife","America/Regina","America/Resolute","America/Rio_Branco","America/Santarem","America/Santiago","America/Santo_Domingo","America/Sao_Paulo","America/Scoresbysund","America/Sitka","America/St_Johns","America/Swift_Current","America/Tegucigalpa","America/Thule","America/Thunder_Bay","America/Tijuana","America/Toronto","America/Vancouver","America/Whitehorse","America/Winnipeg","America/Yakutat","America/Yellowknife","Antarctica/Casey","Antarctica/Davis","Antarctica/DumontDUrville","Antarctica/Macquarie","Antarctica/Mawson","Antarctica/Palmer","Antarctica/Rothera","Antarctica/Syowa","Antarctica/Troll","Antarctica/Vostok","Asia/Almaty","Asia/Amman","Asia/Anadyr","Asia/Aqtau","Asia/Aqtobe","Asia/Ashgabat","Asia/Atyrau","Asia/Baghdad","Asia/Baku","Asia/Bangkok","Asia/Barnaul","Asia/Beirut","Asia/Bishkek","Asia/Brunei","Asia/Chita","Asia/Choibalsan","Asia/Colombo","Asia/Damascus","Asia/Dhaka","Asia/Dili","Asia/Dubai","Asia/Dushanbe","Asia/Famagusta","Asia/Gaza","Asia/Hebron","Asia/Ho_Chi_Minh","Asia/Hong_Kong","Asia/Hovd","Asia/Irkutsk","Asia/Jakarta","Asia/Jayapura","Asia/Jerusalem","Asia/Kabul","Asia/Kamchatka","Asia/Karachi","Asia/Kathmandu","Asia/Khandyga","Asia/Kolkata","Asia/Krasnoyarsk","Asia/Kuala_Lumpur","Asia/Kuching","Asia/Macau","Asia/Magadan","Asia/Makassar","Asia/Manila","Asia/Nicosia","Asia/Novokuznetsk","Asia/Novosibirsk","Asia/Omsk","Asia/Oral","Asia/Pontianak","Asia/Pyongyang","Asia/Qatar","Asia/Qostanay","Asia/Qyzylorda","Asia/Riyadh","Asia/Sakhalin","Asia/Samarkand","Asia/Seoul","Asia/Shanghai","Asia/Singapore","Asia/Srednekolymsk","Asia/Taipei","Asia/Tashkent","Asia/Tbilisi","Asia/Tehran","Asia/Thimphu","Asia/Tokyo","Asia/Tomsk","Asia/Ulaanbaatar","Asia/Urumqi","Asia/Ust-Nera","Asia/Vladivostok","Asia/Yakutsk","Asia/Yangon","Asia/Yekaterinburg","Asia/Yerevan","Atlantic/Azores","Atlantic/Bermuda","Atlantic/Canary","Atlantic/Cape_Verde","Atlantic/Faroe","Atlantic/Madeira","Atlantic/Reykjavik","Atlantic/South_Georgia","Atlantic/Stanley","Australia/Adelaide","Australia/Brisbane","Australia/Broken_Hill","Australia/Currie","Australia/Darwin","Australia/Eucla","Australia/Hobart","Australia/Lindeman","Australia/Lord_Howe","Australia/Melbourne","Australia/Perth","Australia/Sydney","Europe/Amsterdam","Europe/Andorra","Europe/Astrakhan","Europe/Athens","Europe/Belgrade","Europe/Berlin","Europe/Brussels","Europe/Bucharest","Europe/Budapest","Europe/Chisinau","Europe/Copenhagen","Europe/Dublin","Europe/Gibraltar","Europe/Helsinki","Europe/Istanbul","Europe/Kaliningrad","Europe/Kiev","Europe/Kirov","Europe/Lisbon","Europe/London","Europe/Luxembourg","Europe/Madrid","Europe/Malta","Europe/Minsk","Europe/Monaco","Europe/Moscow","Europe/Oslo","Europe/Paris","Europe/Prague","Europe/Riga","Europe/Rome","Europe/Samara","Europe/Saratov","Europe/Simferopol","Europe/Sofia","Europe/Stockholm","Europe/Tallinn","Europe/Tirane","Europe/Ulyanovsk","Europe/Uzhgorod","Europe/Vienna","Europe/Vilnius","Europe/Volgograd","Europe/Warsaw","Europe/Zaporozhye","Europe/Zurich","Indian/Chagos","Indian/Christmas","Indian/Cocos","Indian/Kerguelen","Indian/Mahe","Indian/Maldives","Indian/Mauritius","Indian/Reunion","Pacific/Apia","Pacific/Auckland","Pacific/Bougainville","Pacific/Chatham","Pacific/Chuuk","Pacific/Easter","Pacific/Efate","Pacific/Enderbury","Pacific/Fakaofo","Pacific/Fiji","Pacific/Funafuti","Pacific/Galapagos","Pacific/Gambier","Pacific/Guadalcanal","Pacific/Guam","Pacific/Honolulu","Pacific/Kiritimati","Pacific/Kosrae","Pacific/Kwajalein","Pacific/Majuro","Pacific/Marquesas","Pacific/Nauru","Pacific/Niue","Pacific/Norfolk","Pacific/Noumea","Pacific/Pago_Pago","Pacific/Palau","Pacific/Pitcairn","Pacific/Pohnpei","Pacific/Port_Moresby","Pacific/Rarotonga","Pacific/Tahiti","Pacific/Tarawa","Pacific/Tongatapu","Pacific/Wake","Pacific/Wallis"],Qr={id:"tz-dropdown"},Jr=["value","disabled","onKeydown"],et=["onClick","onMouseover","autofocus"];var nt=(0,o.aZ)({__name:"TimezoneDropdown",props:{input:null,disabled:{type:Boolean,default:!1}},emits:["updateTimezone"],setup(e,{emit:n}){const r=e,{input:t,disabled:l}=(0,s.BK)(r),c=(0,s.iH)(r.input),u=(0,s.iH)(!1),m=(0,s.iH)(null),d=(0,s.iH)(0);function E(e){return e.toLowerCase().match(c.value.toLowerCase())}function _(e){d.value=e}function T(e){c.value=e,u.value=!1,n("updateTimezone",e)}function S(e){e.preventDefault(),m.value?.firstElementChild?.innerHTML&&T(m.value?.firstElementChild?.innerHTML)}function p(e){e.preventDefault(),u.value=!0,c.value=e.target.value.trim()}return(0,o.YP)((()=>r.input),(e=>{c.value=e})),(e,n)=>((0,o.wg)(),(0,o.iD)("div",Qr,[(0,o._)("input",{class:"tz-dropdown-input",id:"timezone",name:"timezone",value:c.value,disabled:(0,s.SU)(l),required:"",onKeydown:[n[0]||(n[0]=(0,i.D2)((e=>T((0,s.SU)(t))),["esc"])),(0,i.D2)(S,["enter"])],onInput:p},null,40,Jr),u.value?((0,o.wg)(),(0,o.iD)("ul",{key:0,class:"tz-dropdown-list",ref_key:"tzList",ref:m},[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)((0,s.SU)(Xr).filter((e=>E(e))),((e,n)=>((0,o.wg)(),(0,o.iD)("li",{key:e,class:(0,a.C_)(["tz-dropdown-item",{focus:n===d.value}]),onClick:n=>T(e),onMouseover:e=>_(n),autofocus:n===d.value},(0,a.zw)(e),43,et)))),128))],512)):(0,o.kq)("",!0)]))}});const rt=(0,B.Z)(nt,[["__scopeId","data-v-47ea2903"]]);var tt=rt;const ot=e=>((0,o.dD)("data-v-7d35cb46"),e=e(),(0,o.Cn)(),e),at={id:"user-preferences-edition"},it={class:"profile-form form-box"},st=["onSubmit"],lt={class:"form-items"},ct=["disabled"],ut=["value"],mt={class:"form-items"},dt={class:"form-items"},Et=["disabled"],_t=["value"],Tt={class:"form-items form-checkboxes"},St={class:"checkboxes-label"},pt={class:"checkboxes"},At=["id","name","checked","disabled","onInput"],zt={class:"checkbox-label"},Ot={class:"form-items form-checkboxes"},It={class:"checkboxes-label"},Rt={class:"checkboxes"},Nt=["id","name","checked","disabled","onInput"],gt={class:"checkbox-label"},Ut={class:"form-items form-checkboxes"},Ct={class:"checkboxes-label"},Dt={class:"checkboxes"},ht=["id","name","checked","disabled","onInput"],vt={class:"checkbox-label"},Pt={class:"form-items form-checkboxes"},ft={class:"checkboxes-label"},Lt={class:"checkboxes"},wt=["id","name","checked","disabled","onInput"],kt={class:"checkbox-label"},bt={class:"form-items form-checkboxes"},Mt={class:"checkboxes-label"},yt={class:"checkboxes"},Gt=["id","name","checked","disabled","onInput"],Ft={class:"checkbox-label"},Wt={class:"info-box raw-speed-help"},Bt=ot((()=>(0,o._)("i",{class:"fa fa-info-circle","aria-hidden":"true"},null,-1))),Yt={class:"form-buttons"},xt={class:"confirm",type:"submit"};var Kt=(0,o.aZ)({__name:"UserPreferencesEdition",props:{user:null},setup(e){const n=e,r=(0,u.o)(),t=(0,s.qj)({display_ascent:!0,imperial_units:!1,language:"",timezone:"Europe/Paris",date_format:"dd/MM/yyyy",weekm:!1}),l=[{label:"SUNDAY",value:!1},{label:"MONDAY",value:!0}],m=[{label:"METRIC",value:!1},{label:"IMPERIAL",value:!0}],d=[{label:"DISPLAYED",value:!0},{label:"HIDDEN",value:!1}],E=[{label:"ZERO",value:!0},{label:"MIN_ALT",value:!1}],_=[{label:"FILTERED_SPEED",value:!1},{label:"RAW_SPEED",value:!0}],T=(0,o.Fl)((()=>r.getters[c.YN.GETTERS.USER_LOADING])),S=(0,o.Fl)((()=>r.getters[c.SY.GETTERS.ERROR_MESSAGES])),p=(0,o.Fl)((()=>(0,je.d2)((new Date).toUTCString(),n.user.timezone,t.language)));function A(e){t.display_ascent=e.display_ascent,t.start_elevation_at_zero=!!e.start_elevation_at_zero&&e.start_elevation_at_zero,t.use_raw_gpx_speed=!!e.use_raw_gpx_speed&&e.use_raw_gpx_speed,t.imperial_units=!!e.imperial_units&&e.imperial_units,t.language=e.language?e.language:"en",t.timezone=e.timezone?e.timezone:"Europe/Paris",t.date_format=e.date_format?e.date_format:"dd/MM/yyyy",t.weekm=!!e.weekm&&e.weekm}function z(){r.dispatch(c.YN.ACTIONS.UPDATE_USER_PREFERENCES,t)}function O(e){t.timezone=e}function I(e){t.start_elevation_at_zero=e}function R(e){t.use_raw_gpx_speed=e}function N(e){t.display_ascent=e}function g(e){t.imperial_units=e}function U(e){t.weekm=e}return(0,o.bv)((()=>{n.user&&A(n.user)})),(0,o.Ah)((()=>{r.commit(c.SY.MUTATIONS.EMPTY_ERROR_MESSAGES)})),(e,n)=>{const r=(0,o.up)("ErrorMessage");return(0,o.wg)(),(0,o.iD)("div",at,[(0,o._)("div",it,[(0,s.SU)(S)?((0,o.wg)(),(0,o.j4)(r,{key:0,message:(0,s.SU)(S)},null,8,["message"])):(0,o.kq)("",!0),(0,o._)("form",{onSubmit:(0,i.iM)(z,["prevent"])},[(0,o._)("label",lt,[(0,o.Uk)((0,a.zw)(e.$t("user.PROFILE.LANGUAGE"))+" ",1),(0,o.wy)((0,o._)("select",{id:"language","onUpdate:modelValue":n[0]||(n[0]=e=>t.language=e),disabled:(0,s.SU)(T)},[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)((0,s.SU)(bn.mT),(e=>((0,o.wg)(),(0,o.iD)("option",{value:e.value,key:e.value},(0,a.zw)(e.label),9,ut)))),128))],8,ct),[[i.bM,t.language]])]),(0,o._)("label",mt,[(0,o.Uk)((0,a.zw)(e.$t("user.PROFILE.TIMEZONE"))+" ",1),(0,o.Wm)(tt,{input:t.timezone,disabled:(0,s.SU)(T),onUpdateTimezone:O},null,8,["input","disabled"])]),(0,o._)("label",dt,[(0,o.Uk)((0,a.zw)(e.$t("user.PROFILE.DATE_FORMAT"))+" ",1),(0,o.wy)((0,o._)("select",{id:"date_format","onUpdate:modelValue":n[1]||(n[1]=e=>t.date_format=e),disabled:(0,s.SU)(T)},[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)((0,s.SU)(p),(e=>((0,o.wg)(),(0,o.iD)("option",{value:e.value,key:e.value},(0,a.zw)(e.label),9,_t)))),128))],8,Et),[[i.bM,t.date_format]])]),(0,o._)("div",Tt,[(0,o._)("span",St,(0,a.zw)(e.$t("user.PROFILE.FIRST_DAY_OF_WEEK")),1),(0,o._)("div",pt,[((0,o.wg)(),(0,o.iD)(o.HY,null,(0,o.Ko)(l,(n=>(0,o._)("label",{key:n.label},[(0,o._)("input",{type:"radio",id:n.label,name:n.label,checked:n.value===t.weekm,disabled:(0,s.SU)(T),onInput:e=>U(n.value)},null,40,At),(0,o._)("span",zt,(0,a.zw)(e.$t(`user.PROFILE.${n.label}`)),1)]))),64))])]),(0,o._)("div",Ot,[(0,o._)("span",It,(0,a.zw)(e.$t("user.PROFILE.UNITS.LABEL")),1),(0,o._)("div",Rt,[((0,o.wg)(),(0,o.iD)(o.HY,null,(0,o.Ko)(m,(n=>(0,o._)("label",{key:n.label},[(0,o._)("input",{type:"radio",id:n.label,name:n.label,checked:n.value===t.imperial_units,disabled:(0,s.SU)(T),onInput:e=>g(n.value)},null,40,Nt),(0,o._)("span",gt,(0,a.zw)(e.$t(`user.PROFILE.UNITS.${n.label}`)),1)]))),64))])]),(0,o._)("div",Ut,[(0,o._)("span",Ct,(0,a.zw)(e.$t("user.PROFILE.ASCENT_DATA")),1),(0,o._)("div",Dt,[((0,o.wg)(),(0,o.iD)(o.HY,null,(0,o.Ko)(d,(n=>(0,o._)("label",{key:n.label},[(0,o._)("input",{type:"radio",id:n.label,name:n.label,checked:n.value===t.display_ascent,disabled:(0,s.SU)(T),onInput:e=>N(n.value)},null,40,ht),(0,o._)("span",vt,(0,a.zw)(e.$t(`common.${n.label}`)),1)]))),64))])]),(0,o._)("div",Pt,[(0,o._)("span",ft,(0,a.zw)(e.$t("user.PROFILE.ELEVATION_CHART_START.LABEL")),1),(0,o._)("div",Lt,[((0,o.wg)(),(0,o.iD)(o.HY,null,(0,o.Ko)(E,(n=>(0,o._)("label",{key:n.label},[(0,o._)("input",{type:"radio",id:n.label,name:n.label,checked:n.value===t.start_elevation_at_zero,disabled:(0,s.SU)(T),onInput:e=>I(n.value)},null,40,wt),(0,o._)("span",kt,(0,a.zw)(e.$t(`user.PROFILE.ELEVATION_CHART_START.${n.label}`)),1)]))),64))])]),(0,o._)("div",bt,[(0,o._)("span",Mt,(0,a.zw)(e.$t("user.PROFILE.USE_RAW_GPX_SPEED.LABEL")),1),(0,o._)("div",yt,[((0,o.wg)(),(0,o.iD)(o.HY,null,(0,o.Ko)(_,(n=>(0,o._)("label",{key:n.label},[(0,o._)("input",{type:"radio",id:n.label,name:n.label,checked:n.value===t.use_raw_gpx_speed,disabled:(0,s.SU)(T),onInput:e=>R(n.value)},null,40,Gt),(0,o._)("span",Ft,(0,a.zw)(e.$t(`user.PROFILE.USE_RAW_GPX_SPEED.${n.label}`)),1)]))),64))]),(0,o._)("div",Wt,[(0,o._)("span",null,[Bt,(0,o.Uk)(" "+(0,a.zw)(e.$t("user.PROFILE.USE_RAW_GPX_SPEED.HELP")),1)])])]),(0,o._)("div",Yt,[(0,o._)("button",xt,(0,a.zw)(e.$t("buttons.SUBMIT")),1),(0,o._)("button",{class:"cancel",onClick:n[2]||(n[2]=(0,i.iM)((n=>e.$router.push("/profile/preferences")),["prevent"]))},(0,a.zw)(e.$t("buttons.CANCEL")),1)])],40,st)])])}}});const Ht=(0,B.Z)(Kt,[["__scopeId","data-v-7d35cb46"]]);var Vt=Ht;const Zt={class:"privacy-policy-text"},$t={class:"last-update"},qt=["innerHTML"],jt=["innerHTML"];var Xt=(0,o.aZ)({__name:"PrivacyPolicy",setup(e){const n=(0,u.o)(),r="Sun, 26 Feb 2023 17:00:00 GMT",t=(0,o.Fl)((()=>n.getters[c.SY.GETTERS.APP_CONFIG])),i=(0,o.Fl)((()=>n.getters[c.SY.GETTERS.LANGUAGE])),m=(0,o.Fl)((()=>n.getters[c.YN.GETTERS.AUTH_USER_PROFILE])),E=(0,o.Fl)((()=>A())),_=(0,o.Fl)((()=>p())),T=(0,o.Fl)((()=>z())),S=["DATA_COLLECTED","INFORMATION_USAGE","INFORMATION_PROTECTION","INFORMATION_DISCLOSURE","SITE_USAGE_BY_CHILDREN","YOUR_CONSENT","ACCOUNT_DELETION","CHANGES_TO_OUR_PRIVACY_POLICY"];function p(){return m.value.timezone?m.value.timezone:Intl.DateTimeFormat().resolvedOptions().timeZone?Intl.DateTimeFormat().resolvedOptions().timeZone:"Europe/Paris"}function A(){return je.KD[i.value]}function z(){return(0,je.p6)(t.value.privacy_policy&&t.value.privacy_policy_date?`${t.value.privacy_policy_date}`:r,_.value,E.value,!1)}return(e,n)=>((0,o.wg)(),(0,o.iD)("div",Zt,[(0,o._)("h1",null,(0,a.zw)((0,a.kC)(e.$t("privacy_policy.TITLE"))),1),(0,o._)("p",$t,(0,a.zw)(e.$t("privacy_policy.LAST_UPDATE"))+": "+(0,a.zw)((0,s.SU)(T)),1),(0,s.SU)(t).privacy_policy?((0,o.wg)(),(0,o.iD)("div",{key:0,innerHTML:(0,s.SU)(l.Z)((0,s.SU)(d.O)((0,s.SU)(t).privacy_policy))},null,8,qt)):((0,o.wg)(),(0,o.iD)(o.HY,{key:1},(0,o.Ko)(S,(n=>((0,o.wg)(),(0,o.iD)(o.HY,{key:n},[(0,o._)("h2",null,(0,a.zw)(e.$t(`privacy_policy.CONTENT.${n}.TITLE`)),1),(0,o._)("p",{innerHTML:(0,s.SU)(l.Z)(e.$t(`privacy_policy.CONTENT.${n}.CONTENT`))},null,8,jt)],64)))),64))]))}});const Qt=(0,B.Z)(Xt,[["__scopeId","data-v-0c1693aa"]]);var Jt=Qt;const eo={id:"user-privacy-policy"},no={key:1},ro={class:"policy-content"},to={for:"accepted_policy",class:"accepted_policy"},oo={class:"form-buttons"},ao={class:"confirm",type:"submit"};var io=(0,o.aZ)({__name:"UserPrivacyPolicyValidation",props:{user:null},setup(e){const n=e,{user:r}=(0,s.BK)(n),t=(0,u.o)(),l=(0,o.Fl)((()=>t.getters[c.SY.GETTERS.ERROR_MESSAGES])),m=(0,s.iH)(!1);function d(){t.dispatch(c.YN.ACTIONS.ACCEPT_PRIVACY_POLICY,m.value)}return(0,o.Ah)((()=>{t.commit(c.SY.MUTATIONS.EMPTY_ERROR_MESSAGES)})),(e,n)=>{const t=(0,o.up)("ErrorMessage"),c=(0,o.up)("router-link"),u=(0,o.up)("i18n-t");return(0,o.wg)(),(0,o.iD)("div",eo,[(0,s.SU)(l)?((0,o.wg)(),(0,o.j4)(t,{key:0,message:(0,s.SU)(l)},null,8,["message"])):(0,o.kq)("",!0),(0,s.SU)(r).accepted_privacy_policy?((0,o.wg)(),(0,o.iD)("div",no,[(0,o._)("p",null,[(0,o.Wm)(u,{keypath:"user.YOU_HAVE_ACCEPTED_PRIVACY_POLICY"},{default:(0,o.w5)((()=>[(0,o.Wm)(c,{to:"/privacy-policy"},{default:(0,o.w5)((()=>[(0,o.Uk)((0,a.zw)(e.$t("privacy_policy.TITLE")),1)])),_:1})])),_:1})]),(0,o._)("button",{class:"cancel",onClick:n[0]||(n[0]=n=>e.$router.push("/profile"))},(0,a.zw)(e.$t("user.PROFILE.BACK_TO_PROFILE")),1)])):((0,o.wg)(),(0,o.iD)("form",{key:2,onSubmit:n[3]||(n[3]=(0,i.iM)((e=>d()),["prevent"]))},[(0,o._)("div",ro,[(0,o.Wm)(Jt)]),(0,o._)("label",to,[(0,o.wy)((0,o._)("input",{type:"checkbox",id:"accepted_policy",required:"","onUpdate:modelValue":n[1]||(n[1]=e=>m.value=e)},null,512),[[i.e8,m.value]]),(0,o._)("span",null,[(0,o.Wm)(u,{keypath:"user.READ_AND_ACCEPT_PRIVACY_POLICY"},{default:(0,o.w5)((()=>[(0,o.Uk)((0,a.zw)(e.$t("privacy_policy.TITLE")),1)])),_:1})])]),(0,o.Wm)(c,{to:"/profile/edit/account"},{default:(0,o.w5)((()=>[(0,o.Uk)((0,a.zw)(e.$t("user.I_WANT_TO_DELETE_MY_ACCOUNT")),1)])),_:1}),(0,o._)("div",oo,[(0,o._)("button",ao,(0,a.zw)(e.$t("buttons.SUBMIT")),1),(0,o._)("button",{class:"cancel",onClick:n[2]||(n[2]=n=>e.$router.push("/profile"))},(0,a.zw)(e.$t("user.PROFILE.BACK_TO_PROFILE")),1)])],32))])}}});const so=(0,B.Z)(io,[["__scopeId","data-v-c77e04be"]]);var lo=so;const co=["profile:read","profile:write","users:read","users:write","workouts:read","workouts:write"],uo=["application:write"],mo={id:"new-oauth2-app"},Eo={id:"new-oauth2-title"},_o={id:"apps-form"},To=["onSubmit"],So={class:"form-items"},po={class:"form-item"},Ao={for:"app-name"},zo={class:"form-item"},Oo={for:"app-description"},Io={class:"form-item"},Ro={for:"app-url"},No={class:"form-item"},go={for:"app-redirect-uri"},Uo={class:"form-item-scope"},Co={class:"form-item-scope-label"},Do={class:"scope-label"},ho=["name","checked","onChange"],vo=["innerHTML"],Po={class:"form-buttons"},fo=["disabled"];var Lo=(0,o.aZ)({__name:"AddUserApp",props:{authUser:null},setup(e){const n=e,r=(0,u.o)(),t=(0,s.qj)({client_name:"",client_uri:"",client_description:"",redirect_uri:""}),l=(0,s.qj)([]),m=(0,o.Fl)((()=>T(n.authUser,uo,co)));function d(){const e={client_name:t.client_name,client_description:t.client_description,client_uri:t.client_uri,redirect_uris:[t.redirect_uri],scope:l.sort().join(" ")};r.dispatch(c.Km.ACTIONS.CREATE_CLIENT,e)}function E(e){t.client_description=e}function _(e){const n=l.indexOf(e);n>-1?l.splice(n,1):l.push(e)}function T(e,n,r){const t=[...r];return e.admin&&t.push(...n),t.sort()}return(e,n)=>{const r=(0,o.up)("CustomTextArea");return(0,o.wg)(),(0,o.iD)("div",mo,[(0,o._)("h1",Eo,(0,a.zw)(e.$t("oauth2.ADD_A_NEW_APP")),1),(0,o._)("div",_o,[(0,o._)("form",{onSubmit:(0,i.iM)(d,["prevent"])},[(0,o._)("div",So,[(0,o._)("div",po,[(0,o._)("label",Ao,(0,a.zw)(e.$t("oauth2.APP.NAME"))+"*",1),(0,o.wy)((0,o._)("input",{id:"app-name",type:"text",required:"","onUpdate:modelValue":n[0]||(n[0]=e=>t.client_name=e)},null,512),[[i.nr,t.client_name]])]),(0,o._)("div",zo,[(0,o._)("label",Oo,(0,a.zw)(e.$t("oauth2.APP.DESCRIPTION")),1),(0,o.Wm)(r,{name:"app-description",charLimit:200,input:t.description,onUpdateValue:E},null,8,["input"])]),(0,o._)("div",Io,[(0,o._)("label",Ro,(0,a.zw)(e.$t("oauth2.APP.URL"))+"*",1),(0,o.wy)((0,o._)("input",{id:"app-url",type:"text",required:"","onUpdate:modelValue":n[1]||(n[1]=e=>t.client_uri=e)},null,512),[[i.nr,t.client_uri]])]),(0,o._)("div",No,[(0,o._)("label",go,(0,a.zw)(e.$t("oauth2.APP.REDIRECT_URL"))+"* ",1),(0,o.wy)((0,o._)("input",{id:"app-redirect-uri",type:"text",required:"","onUpdate:modelValue":n[2]||(n[2]=e=>t.redirect_uri=e)},null,512),[[i.nr,t.redirect_uri]])]),(0,o._)("div",Uo,[(0,o._)("div",Co,(0,a.zw)(e.$t("oauth2.APP.SCOPE.LABEL"))+"* ",1),((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)((0,s.SU)(m),(n=>((0,o.wg)(),(0,o.iD)("div",{class:"form-item-scope-checkboxes",key:n},[(0,o._)("label",Do,[(0,o._)("input",{type:"checkbox",name:n,checked:l.includes(n),onChange:e=>_(n)},null,40,ho),(0,o._)("code",null,(0,a.zw)(n),1)]),(0,o._)("p",{class:"scope-description",innerHTML:e.$t(`oauth2.APP.SCOPE.${n}_DESCRIPTION`)},null,8,vo)])))),128))])]),(0,o._)("div",Po,[(0,o._)("button",{class:"confirm",type:"submit",disabled:0===l.length},(0,a.zw)(e.$t("buttons.SUBMIT")),9,fo),(0,o._)("button",{class:"cancel",onClick:n[3]||(n[3]=(0,i.iM)((()=>e.$router.push("/profile/apps")),["prevent"]))},(0,a.zw)(e.$t("buttons.CANCEL")),1)])],40,To)])])}}});const wo=(0,B.Z)(Lo,[["__scopeId","data-v-0657ee77"]]);var ko=wo;const bo={id:"authorize-oauth2-app"},Mo={key:0},yo={id:"authorize-oauth2-title"},Go={class:"oauth2-access description-list"},Fo={class:"client-scope"},Wo=["innerHTML"],Bo={class:"authorize-oauth2-buttons"},Yo={key:1},xo={class:"no-app"};var Ko=(0,o.aZ)({__name:"AuthorizeUserApp",setup(e){const n=(0,t.yj)(),r=(0,u.o)(),i=(0,o.Fl)((()=>r.getters[c.Km.GETTERS.CLIENT])),l=(0,o.Fl)((()=>r.getters[c.SY.GETTERS.ERROR_MESSAGES]));function m(){n.query.client_id&&"string"===typeof n.query.client_id&&r.dispatch(c.Km.ACTIONS.GET_CLIENT_BY_CLIENT_ID,n.query.client_id)}function d(){r.dispatch(c.Km.ACTIONS.AUTHORIZE_CLIENT,{client_id:`${n.query.client_id}`,redirect_uri:`${n.query.redirect_uri}`,response_type:`${n.query.response_type}`,scope:`${n.query.scope}`,state:`${n.query.state?n.query.state:""}`,code_challenge:`${n.query.code_challenge?n.query.code_challenge:""}`,code_challenge_method:`${n.query.code_challenge_method?n.query.code_challenge_method:""}`})}return(0,o.wF)((()=>m())),(e,n)=>{const r=(0,o.up)("router-link"),t=(0,o.up)("i18n-t"),c=(0,o.up)("ErrorMessage");return(0,o.wg)(),(0,o.iD)("div",bo,[(0,s.SU)(i).client_id?((0,o.wg)(),(0,o.iD)("div",Mo,[(0,o._)("h1",yo,[(0,o.Wm)(t,{keypath:"oauth2.AUTHORIZE_APP"},{default:(0,o.w5)((()=>[(0,o.Wm)(r,{to:{name:"UserApp",params:{id:(0,s.SU)(i).id}}},{default:(0,o.w5)((()=>[(0,o.Uk)((0,a.zw)((0,s.SU)(i).name),1)])),_:1},8,["to"])])),_:1})]),(0,s.SU)(l)?((0,o.wg)(),(0,o.j4)(c,{key:0,message:(0,s.SU)(l)},null,8,["message"])):(0,o.kq)("",!0),(0,o._)("div",Go,[(0,o._)("p",null,(0,a.zw)(e.$t("oauth2.APP_REQUESTING_ACCESS")),1),(0,o._)("dl",null,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)((0,s.SU)(i).scope.split(" "),(n=>((0,o.wg)(),(0,o.iD)(o.HY,{key:n},[(0,o._)("dt",Fo,[(0,o._)("code",null,(0,a.zw)(n),1)]),(0,o._)("dd",{innerHTML:e.$t(`oauth2.APP.SCOPE.${n}_DESCRIPTION`)},null,8,Wo)],64)))),128))]),(0,o._)("div",Bo,[(0,o._)("button",{class:"danger",onClick:d},(0,a.zw)(e.$t("buttons.AUTHORIZE")),1),(0,o._)("button",{class:"cancel",onClick:n[0]||(n[0]=n=>e.$router.push("/profile/apps"))},(0,a.zw)(e.$t("buttons.CANCEL")),1)])])])):((0,o.wg)(),(0,o.iD)("div",Yo,[(0,o._)("p",xo,(0,a.zw)(e.$t("oauth2.NO_APP")),1),(0,o._)("button",{onClick:n[1]||(n[1]=n=>e.$router.push("/profile/apps"))},(0,a.zw)(e.$t("buttons.BACK")),1)]))])}}});const Ho=(0,B.Z)(Ko,[["__scopeId","data-v-3b2fe9ed"]]);var Vo=Ho;const Zo={id:"oauth2-apps"};var $o=(0,o.aZ)({__name:"index",props:{user:null},setup(e){const n=e,r=(0,u.o)(),{user:t}=(0,s.BK)(n);return(0,o.Ah)((()=>{r.commit(c.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),r.commit(c.Km.MUTATIONS.SET_CLIENTS,[])})),(e,n)=>{const r=(0,o.up)("router-view");return(0,o.wg)(),(0,o.iD)("div",Zo,[(0,o.Wm)(r,{authUser:(0,s.SU)(t)},null,8,["authUser"])])}}});const qo=$o;var jo=qo;const Xo={id:"oauth2-app",class:"description-list"},Qo={key:1},Jo={key:0,class:"info-box success-message"},ea=["title"],na={key:0},ra={key:1,class:"app-secret"},ta=["title"],oa={class:"client-scopes"},aa={class:"app-buttons"},ia={key:2},sa={class:"no-app"};var la=(0,o.aZ)({__name:"UserApp",props:{authUser:null,afterCreation:{type:Boolean,default:!1}},setup(e){const n=e,r=(0,t.yj)(),i=(0,u.o)(),{afterCreation:l,authUser:m}=(0,s.BK)(n),d=(0,o.Fl)((()=>i.getters[c.Km.GETTERS.CLIENT])),E=(0,o.Fl)((()=>i.getters[c.Km.GETTERS.REVOCATION_SUCCESSFUL])),_=(0,s.iH)(!1),T=(0,s.iH)(null),S=(0,s.iH)(!1),p=(0,s.iH)(!1),A=(0,s.iH)(!1);function z(){!l.value&&r.params.id&&"string"===typeof r.params.id&&i.dispatch(c.Km.ACTIONS.GET_CLIENT_BY_ID,+r.params.id)}function O(e){T.value=e?"oauth2.APP_DELETION_CONFIRMATION":"oauth2.TOKENS_REVOCATION_CONFIRMATION",I(!0)}function I(e){_.value=e,e||(T.value=null)}function R(e){"oauth2.APP_DELETION_CONFIRMATION"===T.value?i.dispatch(c.Km.ACTIONS.DELETE_CLIENT,e):i.dispatch(c.Km.ACTIONS.REVOKE_ALL_TOKENS,e)}function N(){navigator.clipboard.writeText(d.value.client_id),S.value=!0,p.value=!1,setTimeout((()=>{S.value=!1}),3e3)}function g(){d.value.client_secret&&(navigator.clipboard.writeText(d.value.client_secret),p.value=!0,S.value=!1,setTimeout((()=>{p.value=!1}),3e3))}return(0,o.wF)((()=>{z(),navigator.clipboard&&(A.value=!0)})),(0,o.Ah)((()=>{i.commit(c.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),i.commit(c.Km.MUTATIONS.EMPTY_CLIENT),i.commit(c.Km.MUTATIONS.SET_REVOCATION_SUCCESSFUL,!1)})),(0,o.YP)((()=>E.value),(e=>{e&&I(!1)})),(e,n)=>{const r=(0,o.up)("Modal");return(0,o.wg)(),(0,o.iD)("div",Xo,[_.value?((0,o.wg)(),(0,o.j4)(r,{key:0,title:e.$t("common.CONFIRMATION"),message:e.$t(T.value),onConfirmAction:n[0]||(n[0]=e=>R((0,s.SU)(d).id)),onCancelAction:n[1]||(n[1]=e=>I(!1))},null,8,["title","message"])):(0,o.kq)("",!0),(0,s.SU)(d)&&(0,s.SU)(d).client_id?((0,o.wg)(),(0,o.iD)("div",Qo,[(0,s.SU)(l)||(0,s.SU)(E)?((0,o.wg)(),(0,o.iD)("div",Jo,(0,a.zw)(e.$t((0,s.SU)(l)?"oauth2.APP_CREATED_SUCCESSFULLY":"oauth2.TOKENS_REVOKED")),1)):(0,o.kq)("",!0),(0,o._)("dl",null,[(0,o._)("dt",null,(0,a.zw)(e.$t("oauth2.APP.CLIENT_ID"))+":",1),(0,o._)("dd",null,[(0,o.Uk)((0,a.zw)((0,s.SU)(d).client_id)+" ",1),(0,s.SU)(l)&&A.value?((0,o.wg)(),(0,o.iD)("i",{key:0,class:(0,a.C_)("fa fa-"+(S.value?"check":"copy")),"aria-hidden":"true",title:e.$t("oauth2.COPY_TO_CLIPBOARD"),onClick:N},null,10,ea)):(0,o.kq)("",!0)]),(0,s.SU)(l)&&(0,s.SU)(d).client_secret?((0,o.wg)(),(0,o.iD)("dt",na,(0,a.zw)(e.$t("oauth2.APP.CLIENT_SECRET"))+": ",1)):(0,o.kq)("",!0),(0,s.SU)(l)&&(0,s.SU)(d).client_secret?((0,o.wg)(),(0,o.iD)("dd",ra,[(0,o.Uk)((0,a.zw)((0,s.SU)(d).client_secret)+" ",1),A.value?((0,o.wg)(),(0,o.iD)("i",{key:0,class:(0,a.C_)("fa fa-"+(p.value?"check":"copy")),"aria-hidden":"true",title:e.$t("oauth2.COPY_TO_CLIPBOARD"),onClick:g},null,10,ta)):(0,o.kq)("",!0)])):(0,o.kq)("",!0),(0,o._)("dt",null,(0,a.zw)((0,a.kC)(e.$t("oauth2.APP.ISSUE_AT")))+":",1),(0,o._)("dd",null,(0,a.zw)((0,s.SU)(je.p6)((0,s.SU)(d).issued_at,(0,s.SU)(m).timezone,(0,s.SU)(m).date_format)),1),(0,o._)("dt",null,(0,a.zw)(e.$t("oauth2.APP.NAME"))+":",1),(0,o._)("dd",null,(0,a.zw)((0,s.SU)(d).name),1),(0,o._)("dt",null,(0,a.zw)(e.$t("oauth2.APP.DESCRIPTION"))+":",1),(0,o._)("dd",{class:(0,a.C_)({"no-description":!(0,s.SU)(d).client_description})},(0,a.zw)((0,s.SU)(d).client_description?(0,s.SU)(d).client_description:e.$t("oauth2.NO_DESCRIPTION")),3),(0,o._)("dt",null,(0,a.zw)(e.$t("oauth2.APP.URL"))+":",1),(0,o._)("dd",null,(0,a.zw)((0,s.SU)(d).website),1),(0,o._)("dt",null,(0,a.zw)(e.$t("oauth2.APP.REDIRECT_URL"))+":",1),(0,o._)("dd",null,(0,a.zw)((0,s.SU)(d).redirect_uris.length>0?(0,s.SU)(d).redirect_uris[0]:""),1),(0,o._)("dt",null,(0,a.zw)(e.$t("oauth2.APP.SCOPE.LABEL"))+":",1),(0,o._)("dd",oa,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)((0,s.SU)(d).scope.split(" "),(e=>((0,o.wg)(),(0,o.iD)("span",{class:"client-scope",key:e},[(0,o._)("code",null,(0,a.zw)(e),1)])))),128))])]),(0,o._)("div",aa,[(0,o._)("button",{class:"danger",onClick:n[2]||(n[2]=e=>O(!1))},(0,a.zw)(e.$t("oauth2.REVOKE_ALL_TOKENS")),1),(0,o._)("button",{class:"danger",onClick:n[3]||(n[3]=e=>O(!0))},(0,a.zw)(e.$t("oauth2.DELETE_APP")),1),(0,o._)("button",{onClick:n[4]||(n[4]=n=>e.$router.push("/profile/apps"))},(0,a.zw)(e.$t("buttons.BACK")),1)])])):((0,o.wg)(),(0,o.iD)("div",ia,[(0,o._)("p",sa,(0,a.zw)(e.$t("oauth2.NO_APP")),1),(0,o._)("button",{onClick:n[5]||(n[5]=n=>e.$router.push("/profile/apps"))},(0,a.zw)(e.$t("buttons.BACK")),1)]))])}}});const ca=(0,B.Z)(la,[["__scopeId","data-v-3a844fa2"]]);var ua=ca;const ma={id:"oauth2-apps-list"},da={class:"apps-list"},Ea={key:0},_a={class:"app-issued-at"},Ta={key:1,class:"no-apps"},Sa={class:"app-list-buttons"};var pa=(0,o.aZ)({__name:"UserAppsList",props:{authUser:null},setup(e){const n=e,r=(0,u.o)(),i=(0,t.yj)(),{authUser:l}=(0,s.BK)(n),m=(0,o.Fl)((()=>r.getters[c.Km.GETTERS.CLIENTS])),d=(0,o.Fl)((()=>r.getters[c.Km.GETTERS.CLIENTS_PAGINATION]));let E=_(i.query);function _(e){const n={};return e.page&&(n.page=(0,qe.z_)(e.page,qe.Hf)),n}function T(e){r.dispatch(c.Km.ACTIONS.GET_CLIENTS,e)}return(0,o.wF)((()=>{T(E)})),(0,o.YP)((()=>i.query),(async e=>{E=_(e),T(E)})),(e,n)=>{const r=(0,o.up)("router-link");return(0,o.wg)(),(0,o.iD)("div",ma,[(0,o._)("p",da,(0,a.zw)(e.$t("oauth2.APPS_LIST")),1),(0,s.SU)(m).length>0?((0,o.wg)(),(0,o.iD)("ul",Ea,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)((0,s.SU)(m),(n=>((0,o.wg)(),(0,o.iD)("li",{key:n.client_id},[(0,o.Wm)(r,{to:{name:"UserApp",params:{id:n.id}}},{default:(0,o.w5)((()=>[(0,o.Uk)((0,a.zw)(n.name),1)])),_:2},1032,["to"]),(0,o._)("span",_a,(0,a.zw)(e.$t("oauth2.APP.ISSUE_AT"))+" "+(0,a.zw)((0,s.SU)(je.p6)(n.issued_at,(0,s.SU)(l).timezone,(0,s.SU)(l).date_format)),1)])))),128))])):((0,o.wg)(),(0,o.iD)("div",Ta,(0,a.zw)(e.$t("oauth2.NO_APPS")),1)),(0,s.SU)(m).length>0?((0,o.wg)(),(0,o.j4)(Be.Z,{key:2,pagination:(0,s.SU)(d),path:"/profile/apps",query:(0,s.SU)(E)},null,8,["pagination","query"])):(0,o.kq)("",!0),(0,o._)("div",Sa,[(0,o._)("button",{onClick:n[0]||(n[0]=n=>e.$router.push("/profile/apps/new"))},(0,a.zw)(e.$t("oauth2.NEW_APP")),1),(0,o._)("button",{onClick:n[1]||(n[1]=n=>e.$router.push("/"))},(0,a.zw)(e.$t("common.HOME")),1)])])}}});const Aa=(0,B.Z)(pa,[["__scopeId","data-v-efa45ea0"]]);var za=Aa;const Oa={id:"user-sport-preferences"},Ia={key:0,class:"responsive-table"},Ra={class:"mobile-display"},Na={key:0,class:"profile-buttons mobile-display"},ga={key:1,class:"profile-buttons"},Ua={class:"text-left"},Ca={key:0},Da={class:"cell-heading"},ha=["value"],va={class:"cell-heading"},Pa={key:0,class:"disabled-message"},fa={key:1,class:"fa fa-refresh fa-spin fa-fw"},La={class:"cell-heading"},wa={class:"cell-heading"},ka=["checked"],ba={class:"cell-heading"},Ma=["value"],ya={key:1},Ga={key:0,class:"action-buttons"},Fa={class:"cell-heading"},Wa=["onClick"],Ba={key:1,class:"edition-buttons"},Ya=["disabled"],xa=["disabled","onClick"],Ka=["disabled"],Ha={key:0,class:"profile-buttons"},Va={key:1,class:"profile-buttons"};var Za=(0,o.aZ)({__name:"UserSportPreferences",props:{user:null,isEdition:{type:Boolean}},setup(e){const n=e,r=(0,u.o)(),{t:t}=(0,Te.QT)(),{isEdition:l,user:m}=(0,s.BK)(n),d="#838383",E=(0,o.f3)("sportColors"),_=(0,o.Fl)((()=>r.getters[c.O8.GETTERS.SPORTS])),T=(0,o.Fl)((()=>(0,Se.xH)(_.value,t,"is_active",m.value.sports_list))),S=(0,o.Fl)((()=>r.getters[c.YN.GETTERS.USER_LOADING])),p=(0,o.Fl)((()=>r.getters[c.SY.GETTERS.ERROR_MESSAGES])),A=(0,s.qj)({sport_id:0,color:null,is_active:!0,stopped_speed_threshold:1});function z(e){null!==e?(A.sport_id=e.id,A.color=e.color?e.color:E?E[e.label]:d,A.is_active=e.is_active_for_user,A.stopped_speed_threshold=e.stopped_speed_threshold):g()}function O(e){return A.sport_id===e}function I(e){A.color=e.target.value}function R(e){A.stopped_speed_threshold=parseFloat(e.target.value)}function N(e){A.is_active=e.target.checked}function g(){A.sport_id=0,A.color=null,A.is_active=!0,A.stopped_speed_threshold=1,r.commit(c.SY.MUTATIONS.EMPTY_ERROR_MESSAGES)}function U(e){e.preventDefault(),r.dispatch(c.YN.ACTIONS.UPDATE_USER_SPORT_PREFERENCES,A)}function C(e,n){e.preventDefault(),r.dispatch(c.YN.ACTIONS.RESET_USER_SPORT_PREFERENCES,n)}return(0,o.YP)((()=>S.value),(e=>{e||p.value||g()})),(e,n)=>{const r=(0,o.up)("SportImage"),t=(0,o.up)("ErrorMessage");return(0,o.wg)(),(0,o.iD)("div",Oa,[(0,s.SU)(_).length>0?((0,o.wg)(),(0,o.iD)("div",Ia,[(0,o._)("div",Ra,[(0,s.SU)(l)?((0,o.wg)(),(0,o.iD)("div",Na,[(0,o._)("button",{class:"cancel",onClick:n[0]||(n[0]=(0,i.iM)((n=>e.$router.push("/profile/sports")),["prevent"]))},(0,a.zw)(e.$t("buttons.BACK")),1)])):((0,o.wg)(),(0,o.iD)("div",ga,[(0,o._)("button",{onClick:n[1]||(n[1]=n=>e.$router.push("/profile/edit/sports"))},(0,a.zw)(e.$t("user.PROFILE.EDIT_SPORTS_PREFERENCES")),1),(0,o._)("button",{onClick:n[2]||(n[2]=n=>e.$router.push("/"))},(0,a.zw)(e.$t("common.HOME")),1)]))]),(0,o._)("table",null,[(0,o._)("thead",null,[(0,o._)("tr",null,[(0,o._)("th",null,(0,a.zw)(e.$t("user.PROFILE.SPORT.COLOR")),1),(0,o._)("th",Ua,(0,a.zw)(e.$t("workouts.SPORT",0)),1),(0,o._)("th",null,(0,a.zw)(e.$t("workouts.WORKOUT",0)),1),(0,o._)("th",null,(0,a.zw)(e.$t("user.PROFILE.SPORT.IS_ACTIVE")),1),(0,o._)("th",null,(0,a.zw)(e.$t("user.PROFILE.SPORT.STOPPED_SPEED_THRESHOLD")),1),(0,s.SU)(l)?((0,o.wg)(),(0,o.iD)("th",Ca,(0,a.zw)(e.$t("user.PROFILE.SPORT.ACTION")),1)):(0,o.kq)("",!0)])]),(0,o._)("tbody",null,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)((0,s.SU)(T),(i=>((0,o.wg)(),(0,o.iD)("tr",{key:i.id},[(0,o._)("td",null,[(0,o._)("span",Da,(0,a.zw)(e.$t("user.PROFILE.SPORT.COLOR")),1),O(i.id)?((0,o.wg)(),(0,o.iD)("input",{key:0,class:"sport-color",type:"color",value:A.color,onInput:I},null,40,ha)):((0,o.wg)(),(0,o.j4)(r,{key:1,title:i.translatedLabel,"sport-label":i.label,color:i.color?i.color:(0,s.SU)(E)[i.label]},null,8,["title","sport-label","color"]))]),(0,o._)("td",{class:(0,a.C_)(["sport-label",{"disabled-sport":!i.is_active}])},[(0,o._)("span",va,(0,a.zw)(e.$t("user.PROFILE.SPORT.LABEL")),1),(0,o.Uk)(" "+(0,a.zw)(i.translatedLabel)+" ",1),i.is_active?(0,o.kq)("",!0):((0,o.wg)(),(0,o.iD)("span",Pa," ("+(0,a.zw)(e.$t("user.PROFILE.SPORT.DISABLED_BY_ADMIN"))+") ",1)),(0,s.SU)(S)&&O(i.id)?((0,o.wg)(),(0,o.iD)("i",fa)):(0,o.kq)("",!0),(0,s.SU)(p)&&A.sport_id===i.id?((0,o.wg)(),(0,o.j4)(t,{key:2,message:(0,s.SU)(p)},null,8,["message"])):(0,o.kq)("",!0)],2),(0,o._)("td",{class:(0,a.C_)(["text-center",{"disabled-sport":!i.is_active}])},[(0,o._)("span",La,(0,a.zw)(e.$t("workouts.WORKOUT",0)),1),(0,o._)("i",{class:(0,a.C_)("fa fa"+((0,s.SU)(m).sports_list.includes(i.id)?"-check":"")),"aria-hidden":"true"},null,2)],2),(0,o._)("td",{class:(0,a.C_)(["text-center",{"disabled-sport":!i.is_active}])},[(0,o._)("span",wa,(0,a.zw)(e.$t("user.PROFILE.SPORT.IS_ACTIVE")),1),O(i.id)&&i.is_active?((0,o.wg)(),(0,o.iD)("input",{key:0,type:"checkbox",checked:i.is_active_for_user,onChange:N},null,40,ka)):((0,o.wg)(),(0,o.iD)("i",{key:1,class:(0,a.C_)("fa fa"+(i.is_active_for_user?"-check":"")),"aria-hidden":"true"},null,2))],2),(0,o._)("td",{class:(0,a.C_)(["text-center",{"disabled-sport":!i.is_active}])},[(0,o._)("span",ba,(0,a.zw)(e.$t("user.PROFILE.SPORT.STOPPED_SPEED_THRESHOLD")),1),O(i.id)&&i.is_active?((0,o.wg)(),(0,o.iD)("input",{key:0,class:"threshold-input",type:"number",min:"0",step:"0.1",value:A.stopped_speed_threshold,onInput:R},null,40,Ma)):((0,o.wg)(),(0,o.iD)("span",ya,(0,a.zw)(i.stopped_speed_threshold),1))],2),(0,s.SU)(l)?((0,o.wg)(),(0,o.iD)("td",Ga,[(0,o._)("span",Fa,(0,a.zw)(e.$t("user.PROFILE.SPORT.ACTION")),1),0===A.sport_id?((0,o.wg)(),(0,o.iD)("button",{key:0,onClick:e=>z(i)},(0,a.zw)(e.$t("buttons.EDIT")),9,Wa)):(0,o.kq)("",!0),O(i.id)?((0,o.wg)(),(0,o.iD)("div",Ba,[(0,o._)("button",{disabled:(0,s.SU)(S),onClick:U},(0,a.zw)(e.$t("buttons.SUBMIT")),9,Ya),(0,o._)("button",{disabled:(0,s.SU)(S),onClick:e=>C(e,i.id)},(0,a.zw)(e.$t("buttons.RESET")),9,xa),(0,o._)("button",{disabled:(0,s.SU)(S),onClick:n[3]||(n[3]=e=>z(null))},(0,a.zw)(e.$t("buttons.CANCEL")),9,Ka)])):(0,o.kq)("",!0)])):(0,o.kq)("",!0)])))),128))])]),(0,s.SU)(l)?((0,o.wg)(),(0,o.iD)("div",Ha,[(0,o._)("button",{class:"cancel",onClick:n[4]||(n[4]=(0,i.iM)((n=>e.$router.push("/profile/sports")),["prevent"]))},(0,a.zw)(e.$t("buttons.BACK")),1)])):((0,o.wg)(),(0,o.iD)("div",Va,[(0,o._)("button",{onClick:n[5]||(n[5]=n=>e.$router.push("/profile/edit/sports"))},(0,a.zw)(e.$t("user.PROFILE.EDIT_SPORTS_PREFERENCES")),1),(0,o._)("button",{onClick:n[6]||(n[6]=n=>e.$router.push("/"))},(0,a.zw)(e.$t("common.HOME")),1)]))])):(0,o.kq)("",!0)])}}});const $a=(0,B.Z)(Za,[["__scopeId","data-v-74e52489"]]);var qa=$a,ja=r(2894);const Xa=e=>((0,o.dD)("data-v-f6c2b27c"),e=e(),(0,o.Cn)(),e),Qa={class:"about-text"},Ja=["innerHTML"],ei=Xa((()=>(0,o._)("i",{class:"fa fa-book fa-padding","aria-hidden":"true"},null,-1))),ni=["href"],ri=Xa((()=>(0,o._)("i",{class:"fa fa-github fa-padding","aria-hidden":"true"},null,-1))),ti={href:"https://github.com/SamR1/FitTrackee",target:"_blank",rel:"noopener noreferrer"},oi=Xa((()=>(0,o._)("i",{class:"fa fa-balance-scale fa-padding","aria-hidden":"true"},null,-1))),ai=Xa((()=>(0,o._)("a",{href:"https://choosealicense.com/licenses/agpl-3.0/",target:"_blank",rel:"noopener noreferrer"}," AGPLv3 ",-1))),ii={key:0},si=Xa((()=>(0,o._)("i",{class:"fa fa-envelope-o fa-padding","aria-hidden":"true"},null,-1))),li=["href"],ci={key:1},ui=["href"],mi={class:"about-instance"},di=["innerHTML"];var Ei=(0,o.aZ)({__name:"About",setup(e){const n=(0,u.o)(),r=(0,o.Fl)((()=>n.getters[c.SY.GETTERS.APP_CONFIG])),t=(0,o.Fl)((()=>E())),i=(0,o.Fl)((()=>n.getters[c.SY.GETTERS.LANGUAGE])),m=(0,o.Fl)((()=>_()));function E(){const e={};return"visualcrossing"===r.value.weather_provider&&(e["name"]="Visual Crossing",e["url"]="https://www.visualcrossing.com"),e}function _(){let e="https://samr1.github.io/FitTrackee/";return"fr"===i.value&&(e+="fr/"),e}return(e,n)=>{const i=(0,o.up)("i18n-t");return(0,o.wg)(),(0,o.iD)("div",Qa,[(0,o._)("div",null,[(0,o._)("p",{class:"error-message",innerHTML:e.$t("about.FITTRACKEE_DESCRIPTION")},null,8,Ja),(0,o._)("p",null,[ei,(0,o._)("a",{class:"documentation-link",href:(0,s.SU)(m),target:"_blank",rel:"noopener noreferrer"},(0,a.zw)((0,a.kC)(e.$t("common.DOCUMENTATION"))),9,ni)]),(0,o._)("p",null,[ri,(0,o._)("a",ti,(0,a.zw)(e.$t("about.SOURCE_CODE")),1)]),(0,o._)("p",null,[oi,(0,o.Wm)(i,{keypath:"about.FITTRACKEE_LICENSE"},{default:(0,o.w5)((()=>[ai])),_:1})]),(0,s.SU)(r).admin_contact?((0,o.wg)(),(0,o.iD)("div",ii,[si,(0,o._)("a",{href:`mailto:${(0,s.SU)(r).admin_contact}`},(0,a.zw)(e.$t("about.CONTACT_ADMIN")),9,li)])):(0,o.kq)("",!0),(0,s.SU)(t)&&(0,s.SU)(t).name?((0,o.wg)(),(0,o.iD)("div",ci,[(0,o.Uk)((0,a.zw)(e.$t("about.WEATHER_DATA_FROM"))+" ",1),(0,o._)("a",{href:(0,s.SU)(t).url,target:"_blank",rel:"nofollow noopener"},(0,a.zw)((0,s.SU)(t).name),9,ui)])):(0,o.kq)("",!0),(0,s.SU)(r).about?((0,o.wg)(),(0,o.iD)(o.HY,{key:2},[(0,o._)("p",mi,(0,a.zw)(e.$t("about.ABOUT_THIS_INSTANCE")),1),(0,o._)("div",{innerHTML:(0,s.SU)(l.Z)((0,s.SU)(d.O)((0,s.SU)(r).about))},null,8,di)],64)):(0,o.kq)("",!0)])])}}});const _i=(0,B.Z)(Ei,[["__scopeId","data-v-f6c2b27c"]]);var Ti=_i;const Si={id:"bike"},pi=["src"];function Ai(e,n){return(0,o.wg)(),(0,o.iD)("div",Si,[(0,o._)("img",{class:"bike-img",src:"/img/bike.svg",alt:"mountain bike"},null,8,pi)])}const zi={},Oi=(0,B.Z)(zi,[["render",Ai],["__scopeId","data-v-795f7f5f"]]);var Ii=Oi;const Ri={id:"about",class:"view"},Ni={class:"container"},gi={class:"container-sub"},Ui={class:"container-sub about-details"};var Ci=(0,o.aZ)({__name:"AboutView",setup(e){return(e,n)=>((0,o.wg)(),(0,o.iD)("div",Ri,[(0,o._)("div",Ni,[(0,o._)("div",gi,[(0,o.Wm)(Ii)]),(0,o._)("div",Ui,[(0,o.Wm)(Ti)])])]))}});const Di=(0,B.Z)(Ci,[["__scopeId","data-v-bffb50d0"]]);var hi=Di,vi=r(1818),Pi=r(2056);const fi=e=>((0,o.dD)("data-v-645a9e33"),e=e(),(0,o.Cn)(),e),Li={class:"timeline-workout"},wi={class:"box"},ki={class:"workout-user-date"},bi={class:"workout-user"},Mi=["title"],yi={key:0},Gi={key:1,class:"no-map"},Fi={class:"img"},Wi={class:"data"},Bi=fi((()=>(0,o._)("i",{class:"fa fa-clock-o","aria-hidden":"true"},null,-1))),Yi={key:0},xi={class:"data"},Ki=fi((()=>(0,o._)("i",{class:"fa fa-road","aria-hidden":"true"},null,-1))),Hi={key:0,class:"data elevation"},Vi=["alt"],Zi={class:"data-values"},$i={key:1,class:"data altitude"},qi=fi((()=>(0,o._)("i",{class:"fa fa-location-arrow","aria-hidden":"true"},null,-1))),ji={class:"data-values"};var Xi=(0,o.aZ)({__name:"WorkoutCard",props:{user:null,useImperialUnits:{type:Boolean},workout:{default:()=>({})},sport:{default:()=>({})}},setup(e){const n=e,r=(0,u.o)(),{user:t,workout:i,sport:l,useImperialUnits:m}=(0,s.BK)(n),d=(0,o.Fl)((()=>r.getters[c.SY.GETTERS.LOCALE]));function E(e){return e&&null!==e.ascent&&null!==e.descent}return(e,n)=>{const r=(0,o.up)("router-link"),c=(0,o.up)("SportImage"),u=(0,o.up)("Distance");return(0,o.wg)(),(0,o.iD)("div",Li,[(0,o._)("div",wi,[(0,o._)("div",ki,[(0,o._)("div",bi,[(0,o.Wm)(Ye.Z,{user:(0,s.SU)(t)},null,8,["user"]),(0,s.SU)(t).username?((0,o.wg)(),(0,o.j4)(r,{key:0,class:"workout-user-name",to:{name:"User",params:{username:(0,s.SU)(t).username}}},{default:(0,o.w5)((()=>[(0,o.Uk)((0,a.zw)((0,s.SU)(t).username),1)])),_:1},8,["to"])):(0,o.kq)("",!0)]),(0,s.SU)(i).id?((0,o.wg)(),(0,o.j4)(r,{key:0,class:"workout-title",to:{name:"Workout",params:{workoutId:(0,s.SU)(i).id}}},{default:(0,o.w5)((()=>[(0,o.Uk)((0,a.zw)((0,s.SU)(i).title),1)])),_:1},8,["to"])):(0,o.kq)("",!0),(0,s.SU)(i).workout_date&&(0,s.SU)(t)?((0,o.wg)(),(0,o.iD)("div",{key:1,class:"workout-date",title:(0,s.SU)(je.p6)((0,s.SU)(i).workout_date,(0,s.SU)(t).timezone,(0,s.SU)(t).date_format)},(0,a.zw)((0,s.SU)(vi.Z)(new Date((0,s.SU)(i).workout_date),new Date,{addSuffix:!0,locale:(0,s.SU)(d)})),9,Mi)):(0,o.kq)("",!0)]),(0,o._)("div",{class:(0,a.C_)(["workout-map",{"no-cursor":!(0,s.SU)(i)}]),onClick:n[0]||(n[0]=n=>(0,s.SU)(i).id?e.$router.push({name:"Workout",params:{workoutId:(0,s.SU)(i).id}}):null)},[(0,s.SU)(i)?((0,o.wg)(),(0,o.iD)("div",yi,[(0,s.SU)(i).with_gpx?((0,o.wg)(),(0,o.j4)(Pi.Z,{key:0,workout:(0,s.SU)(i)},null,8,["workout"])):((0,o.wg)(),(0,o.iD)("div",Gi,(0,a.zw)(e.$t("workouts.NO_MAP")),1))])):(0,o.kq)("",!0)],2),(0,o._)("div",{class:(0,a.C_)(["workout-data",{"without-gpx":(0,s.SU)(i)&&!(0,s.SU)(i).with_gpx}]),onClick:n[1]||(n[1]=n=>(0,s.SU)(i).id?e.$router.push({name:"Workout",params:{workoutId:(0,s.SU)(i).id}}):null)},[(0,o._)("div",Fi,[(0,s.SU)(l).label?((0,o.wg)(),(0,o.j4)(c,{key:0,"sport-label":(0,s.SU)(l).label,color:(0,s.SU)(l).color},null,8,["sport-label","color"])):(0,o.kq)("",!0)]),(0,o._)("div",Wi,[Bi,(0,s.SU)(i)?((0,o.wg)(),(0,o.iD)("span",Yi,(0,a.zw)((0,s.SU)(i).moving),1)):(0,o.kq)("",!0)]),(0,o._)("div",xi,[Ki,(0,s.SU)(i).id?((0,o.wg)(),(0,o.j4)(u,{key:0,distance:(0,s.SU)(i).distance,digits:3,unitFrom:"km",useImperialUnits:(0,s.SU)(m)},null,8,["distance","useImperialUnits"])):(0,o.kq)("",!0)]),(0,s.SU)(i)&&(0,s.SU)(i).with_gpx?((0,o.wg)(),(0,o.iD)("div",Hi,[(0,o._)("img",{class:"mountains",src:"/img/workouts/mountains.svg",alt:e.$t("workouts.ELEVATION")},null,8,Vi),(0,o._)("div",Zi,[(0,s.SU)(i).id?((0,o.wg)(),(0,o.j4)(u,{key:0,distance:(0,s.SU)(i).min_alt,unitFrom:"m",displayUnit:!1,useImperialUnits:(0,s.SU)(m)},null,8,["distance","useImperialUnits"])):(0,o.kq)("",!0),(0,o.Uk)("/ "),(0,s.SU)(i).id?((0,o.wg)(),(0,o.j4)(u,{key:1,distance:(0,s.SU)(i).max_alt,unitFrom:"m",useImperialUnits:(0,s.SU)(m)},null,8,["distance","useImperialUnits"])):(0,o.kq)("",!0)])])):(0,o.kq)("",!0),E((0,s.SU)(i))?((0,o.wg)(),(0,o.iD)("div",$i,[qi,(0,o._)("div",ji,[(0,o.Uk)(" +"),(0,s.SU)(i).id?((0,o.wg)(),(0,o.j4)(u,{key:0,distance:(0,s.SU)(i).ascent,unitFrom:"m",displayUnit:!1,useImperialUnits:(0,s.SU)(m)},null,8,["distance","useImperialUnits"])):(0,o.kq)("",!0),(0,o.Uk)("/- "),(0,s.SU)(i).id?((0,o.wg)(),(0,o.j4)(u,{key:1,distance:(0,s.SU)(i).descent,unitFrom:"m",useImperialUnits:(0,s.SU)(m)},null,8,["distance","useImperialUnits"])):(0,o.kq)("",!0)])])):(0,o.kq)("",!0)],2)])])}}});const Qi=(0,B.Z)(Xi,[["__scopeId","data-v-645a9e33"]]);var Ji=Qi,es=r(5630),ns=r(3768);const rs={id:"timeline"},ts={class:"section-title"},os={key:0},as={key:1},is={key:1,class:"more-workouts"};var ss=(0,o.aZ)({__name:"Timeline",props:{sports:null,user:null},setup(e){const n=e,r=(0,u.o)(),{sports:t,user:i}=(0,s.BK)(n),l=(0,s.iH)(1),m=5,d=n.user.nb_workouts>=m?m:n.user.nb_workouts;(0,o.wF)((()=>T()));const E=(0,o.Fl)((()=>r.getters[c.aX.GETTERS.TIMELINE_WORKOUTS])),_=(0,o.Fl)((()=>E.value.length>0&&null!==E.value[E.value.length-1].previous_workout));function T(){r.dispatch(c.aX.ACTIONS.GET_TIMELINE_WORKOUTS,{page:l.value,per_page:m,...ns.eR})}function S(){l.value+=1,r.dispatch(c.aX.ACTIONS.GET_MORE_TIMELINE_WORKOUTS,{page:l.value,per_page:m,...ns.eR})}return(e,n)=>((0,o.wg)(),(0,o.iD)("div",rs,[(0,o._)("div",ts,(0,a.zw)(e.$t("workouts.LATEST_WORKOUTS")),1),(0,s.SU)(i).nb_workouts>0&&0===(0,s.SU)(E).length?((0,o.wg)(),(0,o.iD)("div",os,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)([...Array((0,s.SU)(d)).keys()],(e=>((0,o.wg)(),(0,o.j4)(Ji,{user:(0,s.SU)(i),useImperialUnits:(0,s.SU)(i).imperial_units,key:e},null,8,["user","useImperialUnits"])))),128))])):((0,o.wg)(),(0,o.iD)("div",as,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)((0,s.SU)(E),(e=>((0,o.wg)(),(0,o.j4)(Ji,{workout:e,sport:(0,s.SU)(E).length>0?(0,s.SU)(t).filter((n=>n.id===e.sport_id))[0]:null,user:(0,s.SU)(i),useImperialUnits:(0,s.SU)(i).imperial_units,key:e.id},null,8,["workout","sport","user","useImperialUnits"])))),128)),0===(0,s.SU)(E).length?((0,o.wg)(),(0,o.j4)(es.Z,{key:0})):(0,o.kq)("",!0),(0,s.SU)(_)?((0,o.wg)(),(0,o.iD)("div",is,[(0,o._)("button",{onClick:S},(0,a.zw)(e.$t("workouts.LOAD_MORE_WORKOUT")),1)])):(0,o.kq)("",!0)]))]))}});const ls=(0,B.Z)(ss,[["__scopeId","data-v-35567bf2"]]);var cs=ls,us=r(1640),ms=r(4559),ds=r(7349),Es=r(1743),_s=r(9160),Ts=r(1085);const Ss=["title"];var ps=(0,o.aZ)({__name:"CalendarWorkout",props:{displayHARecord:{type:Boolean},workout:null,sportLabel:null,sportColor:null},setup(e){const n=e,{displayHARecord:r,workout:t,sportLabel:a,sportColor:i}=(0,s.BK)(n);return(e,n)=>{const l=(0,o.up)("SportImage");return(0,o.wg)(),(0,o.iD)("div",{class:"calendar-workout",onClick:n[0]||(n[0]=n=>e.$router.push({name:"Workout",params:{workoutId:(0,s.SU)(t).id}}))},[(0,o.Wm)(l,{"sport-label":(0,s.SU)(a),title:(0,s.SU)(t).title,color:(0,s.SU)(i)},null,8,["sport-label","title","color"]),(0,o._)("sup",null,[(0,s.SU)(t).records.length>0?((0,o.wg)(),(0,o.iD)("i",{key:0,class:"fa fa-trophy custom-fa-small","aria-hidden":"true",title:(0,s.SU)(t).records.filter((e=>!!(0,s.SU)(r)||"HA"!==e.record_type)).map((n=>` ${e.$t(`workouts.RECORD_${n.record_type}`)}`))},null,8,Ss)):(0,o.kq)("",!0)])])}}});const As=ps;var zs=As;const Os={class:"donut-chart"},Is={height:"34",width:"34",viewBox:"0 0 34 34"},Rs=["stroke","stroke-dashoffset","transform"];var Ns=(0,o.aZ)({__name:"DonutChart",props:{colors:null,datasets:null},setup(e){const n=e,{colors:r,datasets:t}=(0,s.BK)(n);let a=-90;const i=16,l=16,c=14,u=2*Math.PI*c;function m(e,n){return n-e*n}function d(e,n){const r=`rotate(${a}, ${i}, ${l})`;return a=360*n+a,r}return(e,n)=>((0,o.wg)(),(0,o.iD)("div",Os,[((0,o.wg)(),(0,o.iD)("svg",Is,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(Object.entries((0,s.SU)(t)),((e,n)=>((0,o.wg)(),(0,o.iD)("g",{key:n},[(0,o._)("circle",{cx:i,cy:l,r:c,fill:"transparent",stroke:(0,s.SU)(r)[+e[0]],"stroke-dashoffset":m(e[1].percentage,u),"stroke-dasharray":u,"stroke-width":"3","stroke-opacity":"0.8",transform:d(n,e[1].percentage)},null,8,Rs)])))),128))]))]))}});const gs=Ns;var Us=gs;const Cs={class:"calendar-workouts-chart"},Ds={class:"workouts-count"},hs={key:0,class:"workouts-pane"},vs={class:"more-workouts"};var Ps=(0,o.aZ)({__name:"CalendarWorkoutsChart",props:{colors:null,datasets:null,sports:null,workouts:null},setup(e){const n=e,{colors:r,datasets:t,sports:i,workouts:l}=(0,s.BK)(n),c=(0,s.iH)(!0);function u(e){e.stopPropagation(),c.value=!c.value}return(e,n)=>{const m=(0,o.Q2)("click-outside");return(0,o.wg)(),(0,o.iD)("div",Cs,[(0,o._)("div",{class:"workouts-chart",onClick:u},[(0,o._)("div",Ds,(0,a.zw)((0,s.SU)(l).length),1),(0,o.Wm)(Us,{datasets:(0,s.SU)(t),colors:(0,s.SU)(r)},null,8,["datasets","colors"])]),c.value?(0,o.kq)("",!0):((0,o.wg)(),(0,o.iD)("div",hs,[(0,o.wy)(((0,o.wg)(),(0,o.iD)("div",vs,[(0,o._)("i",{class:"fa fa-times calendar-more","aria-hidden":"true",onClick:u}),((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)((0,s.SU)(l),((e,n)=>((0,o.wg)(),(0,o.j4)(zs,{key:n,workout:e,sportLabel:(0,s.SU)(Se.PA)(e,(0,s.SU)(i)),sportColor:(0,s.SU)(Se.CM)(e,(0,s.SU)(i))},null,8,["workout","sportLabel","sportColor"])))),128))])),[[m,u]])]))])}}});const fs=(0,B.Z)(Ps,[["__scopeId","data-v-52d4310a"]]);var Ls=fs;const ws={class:"calendar-workouts"},ks={class:"desktop-display"},bs={key:0,class:"workouts-display"},Ms={key:1,class:"donut-display"},ys={class:"mobile-display"},Gs={key:0,class:"donut-display"};var Fs=(0,o.aZ)({__name:"CalendarWorkouts",props:{displayHARecord:{type:Boolean},workouts:null,sports:null},setup(e){const n=e,{displayHARecord:r,workouts:t,sports:a}=(0,s.BK)(n),i=(0,o.Fl)((()=>(0,ns.BN)(n.workouts))),l=(0,o.Fl)((()=>(0,Se.Yx)(n.sports))),c=6;return(e,n)=>((0,o.wg)(),(0,o.iD)("div",ws,[(0,o._)("div",ks,[(0,s.SU)(t).length<=c?((0,o.wg)(),(0,o.iD)("div",bs,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)((0,s.SU)(t).slice(0,c),((e,n)=>((0,o.wg)(),(0,o.j4)(zs,{key:n,displayHARecord:(0,s.SU)(r),workout:e,sportLabel:(0,s.SU)(Se.PA)(e,(0,s.SU)(a)),sportColor:(0,s.SU)(Se.CM)(e,(0,s.SU)(a))},null,8,["displayHARecord","workout","sportLabel","sportColor"])))),128))])):((0,o.wg)(),(0,o.iD)("div",Ms,[(0,o.Wm)(Ls,{workouts:(0,s.SU)(t),sports:(0,s.SU)(a),datasets:(0,s.SU)(i),colors:(0,s.SU)(l)},null,8,["workouts","sports","datasets","colors"])]))]),(0,o._)("div",ys,[(0,s.SU)(t).length>0?((0,o.wg)(),(0,o.iD)("div",Gs,[(0,o.Wm)(Ls,{workouts:(0,s.SU)(t),sports:(0,s.SU)(a),datasets:(0,s.SU)(i),colors:(0,s.SU)(l)},null,8,["workouts","sports","datasets","colors"])])):(0,o.kq)("",!0)])]))}});const Ws=Fs;var Bs=Ws;const Ys={class:"calendar-cells"},xs={class:"calendar-cell-day"};var Ks=(0,o.aZ)({__name:"CalendarCells",props:{currentDay:null,displayHARecord:{type:Boolean},endDate:null,sports:null,startDate:null,timezone:null,weekStartingMonday:{type:Boolean},workouts:null},setup(e){const n=e,{currentDay:r,displayHARecord:t,endDate:i,sports:l,startDate:c,timezone:u,weekStartingMonday:m,workouts:d}=(0,s.BK)(n),E=(0,s.iH)([]);function _(){E.value=[];let e=c.value;while(e<=i.value){const n=[];for(let r=0;r<7;r++)n.push(e),e=(0,ds.Z)(e,1);E.value.push(n)}}function T(e){return m.value?[5,6].includes(e):[0,6].includes(e)}function S(e,n){return n?n.filter((n=>(0,Es.Z)((0,je.eB)(n.workout_date,u.value),e))).reverse():[]}return(0,o.bv)((()=>_())),(0,o.YP)((()=>n.currentDay),(()=>_())),(e,n)=>((0,o.wg)(),(0,o.iD)("div",Ys,[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(E.value,((e,n)=>((0,o.wg)(),(0,o.iD)("div",{class:"calendar-row",key:n},[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(e,((e,n)=>((0,o.wg)(),(0,o.iD)("div",{class:(0,a.C_)(["calendar-cell",{"disabled-cell":!(0,s.SU)(_s.Z)(e,(0,s.SU)(r)),"week-end":T(n),today:(0,s.SU)(Ts.Z)(e)}]),key:n},[(0,o.Wm)(Bs,{workouts:S(e,(0,s.SU)(d)),sports:(0,s.SU)(l),displayHARecord:(0,s.SU)(t)},null,8,["workouts","sports","displayHARecord"]),(0,o._)("div",xs,(0,a.zw)((0,s.SU)(Or.Z)(e,"d")),1)],2)))),128))])))),128))]))}});const Hs=Ks;var Vs=Hs;const Zs={class:"calendar-days"};var $s=(0,o.aZ)({__name:"CalendarDays",props:{startDate:null,localeOptions:null},setup(e){const n=e,r=[];for(let t=0;t<7;t++)r.push((0,ds.Z)(n.startDate,t));return(n,t)=>((0,o.wg)(),(0,o.iD)("div",Zs,[((0,o.wg)(),(0,o.iD)(o.HY,null,(0,o.Ko)(r,((n,r)=>(0,o._)("div",{class:"calendar-day",key:r},(0,a.zw)((0,s.SU)(Or.Z)(n,"EEE",{locale:e.localeOptions})),1))),64))]))}});const qs=$s;var js=qs;const Xs={class:"calendar-header"},Qs=(0,o._)("i",{class:"fa fa-chevron-left","aria-hidden":"true"},null,-1),Js=[Qs],el={class:"calendar-month"},nl=(0,o._)("i",{class:"fa fa-chevron-right","aria-hidden":"true"},null,-1),rl=[nl];var tl=(0,o.aZ)({__name:"CalendarHeader",props:{day:null,localeOptions:null},emits:["displayNextMonth","displayPreviousMonth"],setup(e,{emit:n}){const r=e,{day:t,localeOptions:i}=(0,s.BK)(r);return(e,r)=>((0,o.wg)(),(0,o.iD)("div",Xs,[(0,o._)("div",{class:"calendar-arrow calendar-arrow-left",onClick:r[0]||(r[0]=e=>n("displayPreviousMonth"))},Js),(0,o._)("div",el,[(0,o._)("span",null,(0,a.zw)((0,s.SU)(Or.Z)((0,s.SU)(t),"MMM yyyy",{locale:(0,s.SU)(i)})),1)]),(0,o._)("div",{class:"calendar-arrow calendar-arrow-right",onClick:r[1]||(r[1]=e=>n("displayNextMonth"))},rl)]))}});const ol=tl;var al=ol;const il={id:"user-calendar"},sl={class:"calendar-card box"};var ll=(0,o.aZ)({__name:"index",props:{sports:null,user:null},setup(e){const n=e,r=(0,u.o)(),{sports:t,user:a}=(0,s.BK)(n),i="yyyy-MM-dd",l=(0,s.iH)(new Date),m=(0,s.iH)((0,je.yx)(l.value,n.user.weekm)),d=(0,o.Fl)((()=>r.getters[c.aX.GETTERS.CALENDAR_WORKOUTS])),E=(0,o.Fl)((()=>r.getters[c.SY.GETTERS.LOCALE]));function _(){m.value=(0,je.yx)(l.value,n.user.weekm);const e={from:(0,Or.Z)(m.value.start,i),to:(0,Or.Z)(m.value.end,i),page:1,per_page:100,...ns.eR};r.dispatch(c.aX.ACTIONS.GET_CALENDAR_WORKOUTS,e)}function T(){l.value=(0,us.Z)(l.value,1),_()}function S(){l.value=(0,ms.Z)(l.value,1),_()}return(0,o.wF)((()=>_())),(e,n)=>((0,o.wg)(),(0,o.iD)("div",il,[(0,o._)("div",sl,[(0,o.Wm)(al,{day:l.value,"locale-options":(0,s.SU)(E),onDisplayNextMonth:T,onDisplayPreviousMonth:S},null,8,["day","locale-options"]),(0,o.Wm)(js,{"start-date":m.value.start,"locale-options":(0,s.SU)(E)},null,8,["start-date","locale-options"]),(0,o.Wm)(Vs,{currentDay:l.value,displayHARecord:(0,s.SU)(a).display_ascent,"end-date":m.value.end,sports:(0,s.SU)(t),"start-date":m.value.start,timezone:(0,s.SU)(a).timezone,workouts:(0,s.SU)(d),weekStartingMonday:(0,s.SU)(a).weekm},null,8,["currentDay","displayHARecord","end-date","sports","start-date","timezone","workouts","weekStartingMonday"])])]))}});const cl=ll;var ul=cl,ml=r(3703),dl=r(4135),El=r(436);const _l={class:"user-month-stats"};var Tl=(0,o.aZ)({__name:"UserMonthStats",props:{sports:null,user:null},setup(e){const n=e,{sports:r,user:t}=(0,s.BK)(n),i=new Date,l={duration:"week",start:(0,ml.Z)(i),end:(0,dl.Z)(i)},c=n.sports.map((e=>e.id));return(e,n)=>{const i=(0,o.up)("Card");return(0,o.wg)(),(0,o.iD)("div",_l,[(0,o.Wm)(i,null,{title:(0,o.w5)((()=>[(0,o.Uk)((0,a.zw)(e.$t("dashboard.THIS_MONTH")),1)])),content:(0,o.w5)((()=>[(0,o.Wm)(El.Z,{sports:(0,s.SU)(r),user:(0,s.SU)(t),"chart-params":l,"displayed-sport-ids":(0,s.SU)(c),"hide-chart-if-no-data":!0},null,8,["sports","user","displayed-sport-ids"])])),_:1})])}}});const Sl=(0,B.Z)(Tl,[["__scopeId","data-v-1bcddc12"]]);var pl=Sl,Al=r(2540),zl=r(3649);const{locale:Ol}=Al.Z.global,Il=(e,n,r,t)=>{const o="km",a=r?zl.Dl[o].defaultTarget:o,i="m",s=r?zl.Dl[i].defaultTarget:i;let l;switch(e.record_type){case"AS":case"MS":l=`${(0,zl.sC)(+e.value,o,a,2)} ${a}/h`;break;case"FD":l=`${(0,zl.sC)(+e.value,o,a,3)} ${a}`;break;case"HA":l=`${(0,zl.sC)(+e.value,i,s,2)} ${s}`;break;case"LD":l=e.value;break;default:throw new Error(`Invalid record type, expected: "AS", "FD", "HA", "LD", "MD", got: "${e.record_type}"`)}return{workout_date:(0,je.p6)(e.workout_date,n,t,!1),workout_id:e.workout_id,id:e.id,record_type:e.record_type,value:l}},Rl=(e,n)=>{const r=e.label.toLowerCase(),t=n.label.toLowerCase();return r>t?1:r(a=(0,je.mh)(a,Ol.value),e.filter((e=>!!o||"HA"!==e.record_type)).reduce(((e,o)=>{const i=n.find((e=>e.id===o.sport_id));return i&&i.label&&(void 0===e[i.translatedLabel]&&(e[i.translatedLabel]={label:i.label,color:i.color,records:[]}),e[i.translatedLabel].records.push(Il(o,r,t,a))),e}),{})),gl={class:"records-card"},Ul={class:"record-type"},Cl={class:"record-value"},Dl={class:"record-date"};var hl=(0,o.aZ)({__name:"RecordsCard",props:{records:null,sportTranslatedLabel:null},setup(e){const n=e,{records:r,sportTranslatedLabel:t}=(0,s.BK)(n),{t:i}=(0,Te.QT)();function l(e){const n=[];return e.map((e=>{n.push({...e,label:i(`workouts.RECORD_${e.record_type}`)})})),n.sort(Rl)}return(e,n)=>{const i=(0,o.up)("SportImage"),c=(0,o.up)("router-link"),u=(0,o.up)("Card");return(0,o.wg)(),(0,o.iD)("div",gl,[(0,o.Wm)(u,null,{title:(0,o.w5)((()=>[(0,o.Wm)(i,{"sport-label":(0,s.SU)(r).label,color:(0,s.SU)(r).color},null,8,["sport-label","color"]),(0,o.Uk)(" "+(0,a.zw)((0,s.SU)(t)),1)])),content:(0,o.w5)((()=>[((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(l((0,s.SU)(r).records),(e=>((0,o.wg)(),(0,o.iD)("div",{class:"record",key:e.id},[(0,o._)("span",Ul,(0,a.zw)(e.label),1),(0,o._)("span",Cl,(0,a.zw)(e.value),1),(0,o._)("span",Dl,[(0,o.Wm)(c,{to:{name:"Workout",params:{workoutId:e.workout_id}}},{default:(0,o.w5)((()=>[(0,o.Uk)((0,a.zw)(e.workout_date),1)])),_:2},1032,["to"])])])))),128))])),_:1})])}}});const vl=(0,B.Z)(hl,[["__scopeId","data-v-8d17c606"]]);var Pl=vl;const fl=e=>((0,o.dD)("data-v-f0c85cb8"),e=e(),(0,o.Cn)(),e),Ll={class:"user-records-section"},wl={class:"section-title"},kl=fl((()=>(0,o._)("i",{class:"fa fa-trophy custom-fa-small","aria-hidden":"true"},null,-1))),bl={class:"user-records"},Ml={key:0,class:"no-records"};var yl=(0,o.aZ)({__name:"index",props:{sports:null,user:null},setup(e){const n=e,{t:r}=(0,Te.QT)(),t=(0,o.Fl)((()=>Nl(n.user.records,(0,Se.xH)(n.sports,r),n.user.timezone,n.user.imperial_units,n.user.display_ascent,n.user.date_format)));return(n,r)=>((0,o.wg)(),(0,o.iD)("div",Ll,[(0,o._)("div",wl,[kl,(0,o.Uk)(" "+(0,a.zw)(n.$t("workouts.RECORD",2)),1)]),(0,o._)("div",bl,[0===Object.keys((0,s.SU)(t)).length?((0,o.wg)(),(0,o.iD)("div",Ml,(0,a.zw)(n.$t("workouts.NO_RECORDS")),1)):(0,o.kq)("",!0),((0,o.wg)(!0),(0,o.iD)(o.HY,null,(0,o.Ko)(Object.keys((0,s.SU)(t)).sort(),(n=>((0,o.wg)(),(0,o.j4)(Pl,{sportTranslatedLabel:n,records:(0,s.SU)(t)[n],key:n,useImperialUnits:e.user.imperial_units},null,8,["sportTranslatedLabel","records","useImperialUnits"])))),128))])]))}});const Gl=(0,B.Z)(yl,[["__scopeId","data-v-f0c85cb8"]]);var Fl=Gl;const Wl={id:"user-stats"};var Bl=(0,o.aZ)({__name:"index",props:{user:null},setup(e){const n=e,{t:r}=(0,Te.QT)(),{user:t}=(0,s.BK)(n),a=(0,o.Fl)((()=>n.user.total_duration)),i=(0,o.Fl)((()=>_(a))),l="km",c=t.value.imperial_units?zl.Dl[l].defaultTarget:l,u=(0,o.Fl)((()=>t.value.imperial_units?(0,zl.sC)(t.value.total_distance,l,c,2):parseFloat(t.value.total_distance.toFixed(2)))),m="m",d=t.value.imperial_units?zl.Dl[m].defaultTarget:m,E=(0,o.Fl)((()=>t.value.imperial_units?(0,zl.sC)(t.value.total_ascent,m,d,2):parseFloat(t.value.total_ascent.toFixed(2))));function _(e){const n=e.value.match(/day/g)?e.value.split(", ")[1]:e.value;return{days:e.value.match(/day/g)?`${e.value.split(" ")[0]} ${e.value.match(/days/g)?r("common.DAY",2):r("common.DAY",1)}`:`0 ${r("common.DAY",2)},`,duration:`${n.split(":")[0]}h ${n.split(":")[1]}min`}}return(e,n)=>((0,o.wg)(),(0,o.iD)("div",Wl,[(0,o.Wm)(Q,{icon:"calendar",value:(0,s.SU)(t).nb_workouts,text:e.$t("workouts.WORKOUT",(0,s.SU)(t).nb_workouts)},null,8,["value","text"]),(0,o.Wm)(Q,{icon:"road",value:(0,s.SU)(u),text:"mi"===(0,s.SU)(c)?"miles":(0,s.SU)(c)},null,8,["value","text"]),(0,s.SU)(t).display_ascent?((0,o.wg)(),(0,o.j4)(Q,{key:0,icon:"location-arrow",value:(0,s.SU)(E),text:"ft"===(0,s.SU)(d)?"feet":(0,s.SU)(d)},null,8,["value","text"])):(0,o.kq)("",!0),(0,o.Wm)(Q,{icon:"clock-o",value:(0,s.SU)(i).days,text:(0,s.SU)(i).duration},null,8,["value","text"]),(0,s.SU)(t).display_ascent?(0,o.kq)("",!0):((0,o.wg)(),(0,o.j4)(Q,{key:1,icon:"tags",value:(0,s.SU)(t).nb_sports,text:e.$t("workouts.SPORT",(0,s.SU)(t).nb_sports)},null,8,["value","text"]))]))}});const Yl=Bl;var xl=Yl;const Kl={class:"privacy-policy-message"};function Hl(e,n){const r=(0,o.up)("router-link"),t=(0,o.up)("i18n-t");return(0,o.wg)(),(0,o.iD)("div",Kl,[(0,o._)("span",null,[(0,o.Wm)(t,{keypath:"user.LAST_PRIVACY_POLICY_TO_VALIDATE"},{default:(0,o.w5)((()=>[(0,o.Wm)(r,{to:"/profile/edit/privacy-policy"},{default:(0,o.w5)((()=>[(0,o.Uk)((0,a.zw)(e.$t("user.REVIEW")),1)])),_:1})])),_:1})])])}const Vl={},Zl=(0,B.Z)(Vl,[["render",Hl],["__scopeId","data-v-05532ad6"]]);var $l=Zl;const ql=e=>((0,o.dD)("data-v-40886688"),e=e(),(0,o.Cn)(),e),jl={key:0,id:"dashboard",class:"view"},Xl={class:"container mobile-menu"},Ql={class:"box"},Jl=ql((()=>(0,o._)("i",{class:"fa fa-calendar","aria-hidden":"true"},null,-1))),ec=[Jl],nc=ql((()=>(0,o._)("i",{class:"fa fa-bar-chart","aria-hidden":"true"},null,-1))),rc=[nc],tc=ql((()=>(0,o._)("i",{class:"fa fa-map-o","aria-hidden":"true"},null,-1))),oc=[tc],ac=ql((()=>(0,o._)("i",{class:"fa fa-trophy","aria-hidden":"true"},null,-1))),ic=[ac],sc={key:0,class:"container privacy-policy-message"},lc={class:"container"},cc={class:"container dashboard-container"},uc={class:"left-container dashboard-sub-container"},mc={class:"right-container dashboard-sub-container"},dc=ql((()=>(0,o._)("div",{id:"bottom"},null,-1))),Ec={key:1,class:"app-loading"};var _c=(0,o.aZ)({__name:"Dashboard",setup(e){const n=(0,u.o)(),r=(0,o.Fl)((()=>n.getters[c.YN.GETTERS.AUTH_USER_PROFILE])),t=(0,o.Fl)((()=>n.getters[c.O8.GETTERS.SPORTS])),i=(0,s.iH)("calendar");function l(e){i.value=e}return(0,o.wF)((()=>n.dispatch(c.YN.ACTIONS.GET_USER_PROFILE))),(e,n)=>{const c=(0,o.up)("Loader");return(0,s.SU)(r).username&&(0,s.SU)(t).length>0?((0,o.wg)(),(0,o.iD)("div",jl,[(0,o._)("div",Xl,[(0,o._)("div",Ql,[(0,o._)("div",{class:(0,a.C_)(["mobile-menu-item",{"is-selected":"calendar"===i.value}]),onClick:n[0]||(n[0]=e=>l("calendar"))},ec,2),(0,o._)("div",{class:(0,a.C_)(["mobile-menu-item",{"is-selected":"chart"===i.value}]),onClick:n[1]||(n[1]=e=>l("chart"))},rc,2),(0,o._)("div",{class:(0,a.C_)(["mobile-menu-item",{"is-selected":"timeline"===i.value}]),onClick:n[2]||(n[2]=e=>l("timeline"))},oc,2),(0,o._)("div",{class:(0,a.C_)(["mobile-menu-item",{"is-selected":"records"===i.value}]),onClick:n[3]||(n[3]=e=>l("records"))},ic,2)])]),(0,s.SU)(r).accepted_privacy_policy?(0,o.kq)("",!0):((0,o.wg)(),(0,o.iD)("div",sc,[(0,o.Wm)($l)])),(0,o._)("div",lc,[(0,o.Wm)(xl,{user:(0,s.SU)(r)},null,8,["user"])]),(0,o._)("div",cc,[(0,o._)("div",uc,[(0,o.Wm)(pl,{sports:(0,s.SU)(t),user:(0,s.SU)(r),class:(0,a.C_)({"is-hidden":!("chart"===i.value)})},null,8,["sports","user","class"]),(0,o.Wm)(Fl,{sports:(0,s.SU)(t),user:(0,s.SU)(r),class:(0,a.C_)({"is-hidden":!("records"===i.value)})},null,8,["sports","user","class"])]),(0,o._)("div",mc,[(0,o.Wm)(ul,{sports:(0,s.SU)(t),user:(0,s.SU)(r),class:(0,a.C_)({"is-hidden":!("calendar"===i.value)})},null,8,["sports","user","class"]),(0,o.Wm)(cs,{sports:(0,s.SU)(t),user:(0,s.SU)(r),class:(0,a.C_)({"is-hidden":!("timeline"===i.value)})},null,8,["sports","user","class"])])]),dc])):((0,o.wg)(),(0,o.iD)("div",Ec,[(0,o.Wm)(c)]))}}});const Tc=(0,B.Z)(_c,[["__scopeId","data-v-40886688"]]);var Sc=Tc,pc=r(8273);const Ac={class:"not-found view"};var zc=(0,o.aZ)({__name:"NotFoundView",setup(e){return(e,n)=>((0,o.wg)(),(0,o.iD)("div",Ac,[(0,o.Wm)(pc.Z)]))}});const Oc=zc;var Ic=Oc;const Rc={id:"privacy-policy",class:"view"},Nc={class:"container"},gc=(0,o._)("div",{id:"bottom"},null,-1);var Uc=(0,o.aZ)({__name:"PrivacyPolicyView",setup(e){const n=(0,u.o)();return(0,o.wF)((()=>{n.dispatch(c.SY.ACTIONS.GET_APPLICATION_PRIVACY_POLICY)})),(e,n)=>((0,o.wg)(),(0,o.iD)("div",Rc,[(0,o._)("div",Nc,[(0,o.Wm)(Jt)]),gc]))}});const Cc=Uc;var Dc=Cc,hc=r(776);const vc={id:"loginOrRegister",class:"view"},Pc={class:"container"},fc={class:"container-sub"},Lc={class:"container-sub"};var wc=(0,o.aZ)({__name:"LoginOrRegister",props:{action:null},setup(e){const n=e,{action:r}=(0,s.BK)(n);return(e,n)=>((0,o.wg)(),(0,o.iD)("div",vc,[(0,o._)("div",Pc,[(0,o._)("div",fc,[(0,o.Wm)(Ii)]),(0,o._)("div",Lc,[(0,o.Wm)(hc.Z,{action:(0,s.SU)(r)},null,8,["action"])])])]))}});const kc=(0,B.Z)(wc,[["__scopeId","data-v-58043acb"]]);var bc=kc;const Mc=e=>{const n=/(\/profile)(\/edit)*(\/*)/,r=e.replace(n,"").toUpperCase();return""===r?"PROFILE":r.toUpperCase()},yc=[{path:"/",name:"Dashboard",component:Sc},{path:"/login",name:"Login",component:bc,props:{action:"login"}},{path:"/register",name:"Register",component:bc,props:{action:"register"}},{path:"/account-confirmation",name:"AccountConfirmation",component:()=>r.e(845).then(r.bind(r,4264))},{path:"/account-confirmation/resend",name:"AccountConfirmationResend",component:()=>r.e(24).then(r.bind(r,5639)),props:{action:"account-confirmation-resend"}},{path:"/account-confirmation/email-sent",name:"AccountConfirmationEmailSend",component:()=>r.e(24).then(r.bind(r,5639)),props:{action:"email-sent"}},{path:"/password-reset/sent",name:"PasswordEmailSent",component:()=>r.e(24).then(r.bind(r,1627)),props:{action:"request-sent"}},{path:"/password-reset/request",name:"PasswordResetRequest",component:()=>r.e(24).then(r.bind(r,1627)),props:{action:"reset-request"}},{path:"/password-reset/password-updated",name:"PasswordUpdated",component:()=>r.e(24).then(r.bind(r,1627)),props:{action:"password-updated"}},{path:"/password-reset",name:"PasswordReset",component:()=>r.e(24).then(r.bind(r,1627)),props:{action:"reset"}},{path:"/email-update",name:"EmailUpdate",component:()=>r.e(845).then(r.bind(r,8160))},{path:"/profile",name:"Profile",component:()=>r.e(845).then(r.bind(r,3537)),children:[{path:"",name:"UserProfile",component:wn,props:e=>({tab:Mc(e.path)}),children:[{path:"",name:"UserInfos",component:kn.Z},{path:"preferences",name:"UserPreferences",component:Yn},{path:"sports",name:"UserSportPreferences",component:qa,props:{isEdition:!1}},{path:"apps",name:"UserApps",component:jo,children:[{path:"",name:"UserAppsList",component:za},{path:":id",name:"UserApp",component:ua},{path:":id/created",name:"CreatedUserApp",component:ua,props:{afterCreation:!0}},{path:"new",name:"AddUserApp",component:ko},{path:"authorize",name:"AuthorizeUserApp",component:Vo}]}]},{path:"edit",name:"UserProfileEdition",component:Vn,props:e=>({tab:Mc(e.path)}),children:[{path:"",name:"UserInfosEdition",component:Gr},{path:"account",name:"UserAccountEdition",component:zr},{path:"picture",name:"UserPictureEdition",component:jr},{path:"preferences",name:"UserPreferencesEdition",component:Vt},{path:"sports",name:"UserSportPreferencesEdition",component:qa,props:{isEdition:!0}},{path:"privacy-policy",name:"UserPrivacyPolicy",component:lo}]}]},{path:"/statistics",name:"Statistics",component:()=>r.e(193).then(r.bind(r,7885))},{path:"/users/:username",name:"User",component:()=>r.e(845).then(r.bind(r,9453))},{path:"/workouts",name:"Workouts",component:()=>r.e(401).then(r.bind(r,344))},{path:"/workouts/:workoutId",name:"Workout",component:()=>r.e(401).then(r.bind(r,1211)),props:{displaySegment:!1}},{path:"/workouts/:workoutId/edit",name:"EditWorkout",component:()=>r.e(401).then(r.bind(r,8237))},{path:"/workouts/:workoutId/segment/:segmentId",name:"WorkoutSegment",component:()=>r.e(401).then(r.bind(r,1211)),props:{displaySegment:!0}},{path:"/workouts/add",name:"AddWorkout",component:()=>r.e(401).then(r.bind(r,4189))},{path:"/admin",name:"Administration",component:()=>r.e(328).then(r.bind(r,6e3)),children:[{path:"",name:"AdministrationMenu",component:_e},{path:"application",name:"ApplicationAdministration",component:x},{path:"application/edit",name:"ApplicationAdministrationEdition",component:x,props:{edition:!0}},{path:"sports",name:"SportsAdministration",component:Fe},{path:"users/:username",name:"UserFromAdmin",component:()=>r.e(845).then(r.bind(r,9453)),props:{fromAdmin:!0}},{path:"users",name:"UsersAdministration",component:In}]},{path:"/about",name:"About",component:hi},{path:"/privacy-policy",name:"PrivacyPolicy",component:Dc},{path:"/:pathMatch(.*)*",name:"not-found",component:Ic}],Gc=(0,t.p7)({history:(0,t.PO)("/"),routes:yc}),Fc=["/login","/password-reset","/password-reset/password-updated","/password-reset/request","/password-reset/sent","/register","/account-confirmation","/account-confirmation/resend","/account-confirmation/email-sent"],Wc=["/email-update","/about","/privacy-policy"];Gc.beforeEach(((e,n,r)=>{ja.Z.dispatch(c.YN.ACTIONS.CHECK_AUTH_USER).then((()=>{if(Wc.includes(e.path))return r();if(ja.Z.getters[c.YN.GETTERS.IS_AUTHENTICATED]&&Fc.includes(e.path))return r("/");if(ja.Z.getters[c.YN.GETTERS.IS_AUTHENTICATED]||Fc.includes(e.path))r();else{const n="/"===e.path?{path:"/login"}:{path:"/login",query:{from:e.fullPath}};r(n)}})).catch((e=>{console.error(e),r()}))}));var Bc=Gc},5801:function(e,n,r){"use strict";var t,o,a,i,s,l,c,u,m,d,E,_,T,S,p,A,z,O;r.d(n,{YN:function(){return U},Km:function(){return C},SY:function(){return R},O8:function(){return N},gu:function(){return g},RT:function(){return D},aX:function(){return h}}),function(e){e["ACCEPT_PRIVACY_POLICY"]="ACCEPT_PRIVACY_POLICY",e["CHECK_AUTH_USER"]="CHECK_AUTH_USER",e["CONFIRM_ACCOUNT"]="CONFIRM_ACCOUNT",e["CONFIRM_EMAIL"]="CONFIRM_EMAIL",e["DELETE_ACCOUNT"]="DELETE_ACCOUNT",e["DELETE_PICTURE"]="DELETE_PICTURE",e["GET_REQUEST_DATA_EXPORT"]="GET_REQUEST_DATA_EXPORT",e["GET_USER_PROFILE"]="GET_USER_PROFILE",e["LOGIN_OR_REGISTER"]="LOGIN_OR_REGISTER",e["LOGOUT"]="LOGOUT",e["REQUEST_DATA_EXPORT"]="REQUEST_DATA_EXPORT",e["RESEND_ACCOUNT_CONFIRMATION_EMAIL"]="RESEND_ACCOUNT_CONFIRMATION_EMAIL",e["RESET_USER_PASSWORD"]="RESET_USER_PASSWORD",e["RESET_USER_SPORT_PREFERENCES"]="RESET_USER_SPORT_PREFERENCES",e["SEND_PASSWORD_RESET_REQUEST"]="SEND_PASSWORD_RESET_REQUEST",e["UPDATE_USER_ACCOUNT"]="UPDATE_USER_ACCOUNT",e["UPDATE_USER_PICTURE"]="UPDATE_USER_PICTURE",e["UPDATE_USER_PROFILE"]="UPDATE_USER_PROFILE",e["UPDATE_USER_PREFERENCES"]="UPDATE_USER_PREFERENCES",e["UPDATE_USER_SPORT_PREFERENCES"]="UPDATE_USER_SPORT_PREFERENCES"}(t||(t={})),function(e){e["AUTH_TOKEN"]="AUTH_TOKEN",e["AUTH_USER_PROFILE"]="AUTH_USER_PROFILE",e["IS_ADMIN"]="IS_ADMIN",e["IS_AUTHENTICATED"]="IS_AUTHENTICATED",e["IS_SUCCESS"]="IS_SUCCESS",e["IS_REGISTRATION_SUCCESS"]="IS_REGISTRATION_SUCCESS",e["USER_LOADING"]="USER_LOADING",e["EXPORT_REQUEST"]="EXPORT_REQUEST"}(o||(o={})),function(e){e["CLEAR_AUTH_USER_TOKEN"]="CLEAR_AUTH_USER_TOKEN",e["UPDATE_AUTH_TOKEN"]="UPDATE_AUTH_TOKEN",e["UPDATE_AUTH_USER_PROFILE"]="UPDATE_AUTH_USER_PROFILE",e["UPDATE_IS_SUCCESS"]="UPDATE_USER_IS_SUCCESS",e["UPDATE_IS_REGISTRATION_SUCCESS"]="UPDATE_IS_REGISTRATION_SUCCESS",e["UPDATE_USER_LOADING"]="UPDATE_USER_LOADING",e["SET_EXPORT_REQUEST"]="SET_EXPORT_REQUEST"}(a||(a={})),function(e){e["AUTHORIZE_CLIENT"]="AUTHORIZE_CLIENT",e["CREATE_CLIENT"]="CREATE_CLIENT",e["DELETE_CLIENT"]="DELETE_CLIENT",e["GET_CLIENTS"]="GET_CLIENTS",e["GET_CLIENT_BY_CLIENT_ID"]="GET_CLIENT_BY_CLIENT_ID",e["GET_CLIENT_BY_ID"]="GET_CLIENT_BY_ID",e["REVOKE_ALL_TOKENS"]="REVOKE_ALL_TOKENS"}(i||(i={})),function(e){e["CLIENT"]="CLIENT",e["CLIENTS"]="CLIENTS",e["CLIENTS_PAGINATION"]="CLIENTS_PAGINATION",e["REVOCATION_SUCCESSFUL"]="REVOCATION_SUCCESSFUL"}(s||(s={})),function(e){e["EMPTY_CLIENT"]="EMPTY_CLIENT",e["SET_CLIENT"]="SET_CLIENT",e["SET_CLIENTS"]="SET_CLIENTS",e["SET_CLIENTS_PAGINATION"]="SET_CLIENTS_PAGINATION",e["SET_REVOCATION_SUCCESSFUL"]="SET_REVOCATION_SUCCESSFUL"}(l||(l={})),function(e){e["GET_APPLICATION_CONFIG"]="GET_APPLICATION_CONFIG",e["GET_APPLICATION_PRIVACY_POLICY"]="GET_APPLICATION_PRIVACY_POLICY",e["GET_APPLICATION_STATS"]="GET_APPLICATION_STATS",e["UPDATE_APPLICATION_CONFIG"]="UPDATE_APPLICATION_CONFIG",e["UPDATE_APPLICATION_LANGUAGE"]="UPDATE_APPLICATION_LANGUAGE"}(c||(c={})),function(e){e["APP_CONFIG"]="APP_CONFIG",e["APP_LOADING"]="APP_LOADING",e["APP_STATS"]="APP_STATS",e["ERROR_MESSAGES"]="ERROR_MESSAGES",e["LANGUAGE"]="LANGUAGE",e["LOCALE"]="LOCALE"}(u||(u={})),function(e){e["EMPTY_ERROR_MESSAGES"]="EMPTY_ERROR_MESSAGES",e["SET_ERROR_MESSAGES"]="SET_ERROR_MESSAGES",e["UPDATE_APPLICATION_CONFIG"]="UPDATE_APPLICATION_CONFIG",e["UPDATE_APPLICATION_LOADING"]="UPDATE_APPLICATION_LOADING",e["UPDATE_APPLICATION_PRIVACY_POLICY"]="UPDATE_APPLICATION_PRIVACY_POLICY",e["UPDATE_APPLICATION_STATS"]="UPDATE_APPLICATION_STATS",e["UPDATE_LANG"]="UPDATE_LANG"}(m||(m={})),function(e){e["GET_SPORTS"]="GET_SPORTS",e["UPDATE_SPORTS"]="UPDATE_SPORTS"}(d||(d={})),function(e){e["SPORTS"]="SPORTS"}(E||(E={})),function(e){e["SET_SPORTS"]="SET_SPORTS"}(_||(_={})),function(e){e["GET_USER_STATS"]="GET_USER_STATS"}(T||(T={})),function(e){e["USER_STATS"]="USER_STATS"}(S||(S={})),function(e){e["EMPTY_USER_STATS"]="EMPTY_USER_STATS",e["UPDATE_USER_STATS"]="UPDATE_USER_STATS"}(p||(p={})),function(e){e["EMPTY_USER"]="EMPTY_USER",e["EMPTY_USERS"]="EMPTY_USERS",e["GET_USER"]="GET_USER",e["GET_USERS"]="GET_USERS",e["UPDATE_USER"]="UPDATE_USER",e["DELETE_USER_ACCOUNT"]="DELETE_USER_ACCOUNT"}(A||(A={})),function(e){e["USER"]="USER",e["USERS"]="USERS",e["USERS_IS_SUCCESS"]="USERS_IS_SUCCESS",e["USERS_LOADING"]="USERS_LOADING",e["USERS_PAGINATION"]="USERS_PAGINATION"}(z||(z={})),function(e){e["UPDATE_USER"]="UPDATE_USER",e["UPDATE_USER_IN_USERS"]="UPDATE_USER_IN_USERS",e["UPDATE_USERS"]="UPDATE_USERS",e["UPDATE_USERS_LOADING"]="UPDATE_USERS_LOADING",e["UPDATE_USERS_PAGINATION"]="UPDATE_USERS_PAGINATION",e["UPDATE_IS_SUCCESS"]="UPDATE_IS_SUCCESS"}(O||(O={}));var I=r(52);const R={ACTIONS:c,GETTERS:u,MUTATIONS:m},N={ACTIONS:d,GETTERS:E,MUTATIONS:_},g={ACTIONS:T,GETTERS:S,MUTATIONS:p},U={ACTIONS:t,GETTERS:o,MUTATIONS:a},C={ACTIONS:i,GETTERS:s,MUTATIONS:l},D={ACTIONS:A,GETTERS:z,MUTATIONS:O},h={ACTIONS:I.tW,GETTERS:I.JP,MUTATIONS:I.CW}},2894:function(e,n,r){"use strict";r.d(n,{Z:function(){return me}});var t=r(3907),o=(r(7658),r(5167)),a=r(6154),i=r(8566),s=r(2024);const l=a.Z.create({baseURL:(0,s.k)()});l.interceptors.request.use((e=>{const n=new AbortController;e.signal=n.signal;const r=(0,i.a)(e);return i.j.set(r,n),e}),(e=>Promise.reject(e))),l.interceptors.response.use((e=>((0,i.a)(e.config),e)),(e=>("canceled"!==e.message&&e.response&&(0,i.a)(e.response.config),Promise.reject(e))));var c=l,u=r(858),m=r(5801);const d=(e,n)=>{e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),o.Z["delete"](`users/${n.username}`).then((r=>{204===r.status?n.fromAdmin?u.Z.push("/admin/users"):e.dispatch(m.YN.ACTIONS.LOGOUT).then((()=>u.Z.push("/"))):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))},E={[m.RT.ACTIONS.EMPTY_USER](e){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.RT.MUTATIONS.UPDATE_USER,{})},[m.RT.ACTIONS.EMPTY_USERS](e){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.RT.MUTATIONS.UPDATE_USERS,[]),e.commit(m.RT.MUTATIONS.UPDATE_USERS_PAGINATION,{})},[m.RT.ACTIONS.GET_USER](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.RT.MUTATIONS.UPDATE_USERS_LOADING,!0),o.Z.get(`users/${n}`).then((n=>{"success"===n.data.status?e.commit(m.RT.MUTATIONS.UPDATE_USER,n.data.data.users[0]):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n))).finally((()=>e.commit(m.RT.MUTATIONS.UPDATE_USERS_LOADING,!1)))},[m.RT.ACTIONS.GET_USERS](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.RT.MUTATIONS.UPDATE_USERS_LOADING,!0),o.Z.get("users",{params:n}).then((n=>{"success"===n.data.status?(e.commit(m.RT.MUTATIONS.UPDATE_USERS,n.data.data.users),e.commit(m.RT.MUTATIONS.UPDATE_USERS_PAGINATION,n.data.pagination)):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n))).finally((()=>e.commit(m.RT.MUTATIONS.UPDATE_USERS_LOADING,!1)))},[m.RT.ACTIONS.UPDATE_USER](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.RT.MUTATIONS.UPDATE_IS_SUCCESS,!1);const r={};void 0!==n.admin&&(r.admin=n.admin),n.resetPassword&&(r.reset_password=n.resetPassword),n.activate&&(r.activate=n.activate),void 0!==n.new_email&&(r.new_email=n.new_email),o.Z.patch(`users/${n.username}`,r).then((r=>{"success"===r.data.status?(e.commit(m.RT.MUTATIONS.UPDATE_USER_IN_USERS,r.data.data.users[0]),(n.resetPassword||n.new_email)&&e.commit(m.RT.MUTATIONS.UPDATE_IS_SUCCESS,!0),(n.activate||n.new_email)&&e.commit(m.RT.MUTATIONS.UPDATE_USER,r.data.data.users[0])):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n))).finally((()=>e.commit(m.RT.MUTATIONS.UPDATE_USERS_LOADING,!1)))},[m.RT.ACTIONS.DELETE_USER_ACCOUNT](e,n){d(e,{username:n.username,fromAdmin:!0})}},_=e=>{localStorage.removeItem("authToken"),e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.gu.MUTATIONS.EMPTY_USER_STATS),e.commit(m.YN.MUTATIONS.CLEAR_AUTH_USER_TOKEN),e.commit(m.RT.MUTATIONS.UPDATE_USERS,[]),e.commit(m.aX.MUTATIONS.EMPTY_WORKOUTS),e.commit(m.aX.MUTATIONS.EMPTY_WORKOUT),u.Z.push("/login")},T={[m.YN.ACTIONS.CHECK_AUTH_USER](e){window.localStorage.authToken&&!e.getters[m.YN.GETTERS.IS_AUTHENTICATED]&&(e.commit(m.YN.MUTATIONS.UPDATE_AUTH_TOKEN,window.localStorage.authToken),e.dispatch(m.YN.ACTIONS.GET_USER_PROFILE)),!window.localStorage.authToken&&e.getters[m.YN.GETTERS.IS_AUTHENTICATED]&&_(e)},[m.YN.ACTIONS.CONFIRM_ACCOUNT](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),c.post("auth/account/confirm",{token:n.token}).then((n=>{if("success"===n.data.status){const r=n.data.auth_token;window.localStorage.setItem("authToken",r),e.commit(m.YN.MUTATIONS.UPDATE_AUTH_TOKEN,r),e.dispatch(m.YN.ACTIONS.GET_USER_PROFILE).then((()=>u.Z.push("/")))}else(0,s.S)(e,null)})).catch((n=>{(0,s.S)(e,n)}))},[m.YN.ACTIONS.CONFIRM_EMAIL](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.YN.MUTATIONS.UPDATE_IS_SUCCESS,!1),c.post("/auth/email/update",{token:n.token}).then((r=>{"success"===r.data.status?(e.commit(m.YN.MUTATIONS.UPDATE_IS_SUCCESS,!0),n.refreshUser&&e.dispatch(m.YN.ACTIONS.GET_USER_PROFILE).then((()=>u.Z.push("/profile/edit/account"))),u.Z.push("/profile/edit/account")):(0,s.S)(e,null)})).catch((n=>{(0,s.S)(e,n)}))},[m.YN.ACTIONS.GET_USER_PROFILE](e){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),o.Z.get("auth/profile").then((n=>{"success"===n.data.status?(e.commit(m.YN.MUTATIONS.UPDATE_AUTH_USER_PROFILE,n.data.data),n.data.data.accepted_privacy_policy||e.dispatch(m.SY.ACTIONS.GET_APPLICATION_PRIVACY_POLICY),n.data.data.language&&e.dispatch(m.SY.ACTIONS.UPDATE_APPLICATION_LANGUAGE,n.data.data.language),e.dispatch(m.O8.ACTIONS.GET_SPORTS)):((0,s.S)(e,null),_(e))})).catch((n=>{"canceled"!==n.message&&((0,s.S)(e,n),_(e))}))},[m.YN.ACTIONS.LOGIN_OR_REGISTER](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.YN.MUTATIONS.UPDATE_IS_REGISTRATION_SUCCESS,!1),c.post(`/auth/${n.actionType}`,n.formData).then((r=>{if("success"===r.data.status)if("login"===n.actionType){const t=r.data.auth_token;window.localStorage.setItem("authToken",t),e.commit(m.YN.MUTATIONS.UPDATE_AUTH_TOKEN,t),e.dispatch(m.YN.ACTIONS.GET_USER_PROFILE).then((()=>u.Z.push("string"===typeof n.redirectUrl?n.redirectUrl:"/")))}else u.Z.push("/login").then((()=>e.commit(m.YN.MUTATIONS.UPDATE_IS_REGISTRATION_SUCCESS,!0)));else(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))},[m.YN.ACTIONS.LOGOUT](e){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),o.Z.post("auth/logout").then((n=>{"success"===n.data.status?_(e):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))},[m.YN.ACTIONS.UPDATE_USER_PROFILE](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.YN.MUTATIONS.UPDATE_USER_LOADING,!0),o.Z.post("auth/profile/edit",n).then((n=>{"success"===n.data.status?(e.commit(m.YN.MUTATIONS.UPDATE_AUTH_USER_PROFILE,n.data.data),u.Z.push("/profile")):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n))).finally((()=>e.commit(m.YN.MUTATIONS.UPDATE_USER_LOADING,!1)))},[m.YN.ACTIONS.UPDATE_USER_ACCOUNT](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.YN.MUTATIONS.UPDATE_USER_LOADING,!0),e.commit(m.YN.MUTATIONS.UPDATE_IS_SUCCESS,!1),o.Z.patch("auth/profile/edit/account",n).then((n=>{"success"===n.data.status?(e.commit(m.YN.MUTATIONS.UPDATE_AUTH_USER_PROFILE,n.data.data),e.commit(m.YN.MUTATIONS.UPDATE_IS_SUCCESS,!0)):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n))).finally((()=>e.commit(m.YN.MUTATIONS.UPDATE_USER_LOADING,!1)))},[m.YN.ACTIONS.UPDATE_USER_PREFERENCES](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.YN.MUTATIONS.UPDATE_USER_LOADING,!0),o.Z.post("auth/profile/edit/preferences",n).then((n=>{"success"===n.data.status?(e.commit(m.YN.MUTATIONS.UPDATE_AUTH_USER_PROFILE,n.data.data),e.dispatch(m.SY.ACTIONS.UPDATE_APPLICATION_LANGUAGE,n.data.data.language).then((()=>u.Z.push("/profile/preferences")))):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n))).finally((()=>e.commit(m.YN.MUTATIONS.UPDATE_USER_LOADING,!1)))},[m.YN.ACTIONS.RESET_USER_SPORT_PREFERENCES](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.YN.MUTATIONS.UPDATE_USER_LOADING,!0),o.Z["delete"](`auth/profile/reset/sports/${n}`).then((n=>{204===n.status?e.dispatch(m.O8.ACTIONS.GET_SPORTS):(0,s.S)(e,null)})).catch((n=>{(0,s.S)(e,n),e.commit(m.YN.MUTATIONS.UPDATE_USER_LOADING,!1)}))},[m.YN.ACTIONS.UPDATE_USER_SPORT_PREFERENCES](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.YN.MUTATIONS.UPDATE_USER_LOADING,!0),o.Z.post("auth/profile/edit/sports",n).then((n=>{"success"===n.data.status?e.dispatch(m.O8.ACTIONS.GET_SPORTS):(0,s.S)(e,null)})).catch((n=>{(0,s.S)(e,n),e.commit(m.YN.MUTATIONS.UPDATE_USER_LOADING,!1)}))},[m.YN.ACTIONS.UPDATE_USER_PICTURE](e,n){if(e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.YN.MUTATIONS.UPDATE_USER_LOADING,!0),!n.picture)throw new Error("No file part");const r=new FormData;r.append("file",n.picture),o.Z.post("auth/picture",r,{headers:{"content-type":"multipart/form-data"}}).then((n=>{"success"===n.data.status?e.dispatch(m.YN.ACTIONS.GET_USER_PROFILE).then((()=>u.Z.push("/profile"))):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n))).finally((()=>e.commit(m.YN.MUTATIONS.UPDATE_USER_LOADING,!1)))},[m.YN.ACTIONS.DELETE_ACCOUNT](e,n){d(e,n)},[m.YN.ACTIONS.DELETE_PICTURE](e){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.YN.MUTATIONS.UPDATE_USER_LOADING,!0),o.Z["delete"]("auth/picture").then((n=>{204===n.status?e.dispatch(m.YN.ACTIONS.GET_USER_PROFILE).then((()=>u.Z.push("/profile"))):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n))).finally((()=>e.commit(m.YN.MUTATIONS.UPDATE_USER_LOADING,!1)))},[m.YN.ACTIONS.SEND_PASSWORD_RESET_REQUEST](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),c.post("auth/password/reset-request",n).then((n=>{"success"===n.data.status?u.Z.push("/password-reset/sent"):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))},[m.YN.ACTIONS.RESEND_ACCOUNT_CONFIRMATION_EMAIL](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),c.post("auth/account/resend-confirmation",n).then((n=>{"success"===n.data.status?u.Z.push("/account-confirmation/email-sent"):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))},[m.YN.ACTIONS.RESET_USER_PASSWORD](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),c.post("auth/password/update",n).then((n=>{"success"===n.data.status?u.Z.push("/password-reset/password-updated"):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))},[m.YN.ACTIONS.ACCEPT_PRIVACY_POLICY](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),o.Z.post("auth/account/privacy-policy",{accepted_policy:n}).then((n=>{"success"===n.data.status?e.dispatch(m.YN.ACTIONS.GET_USER_PROFILE).then((()=>u.Z.push("/profile"))):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))},[m.YN.ACTIONS.REQUEST_DATA_EXPORT](e){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),o.Z.post("auth/account/export/request").then((n=>{"success"===n.data.status?e.commit(m.YN.MUTATIONS.SET_EXPORT_REQUEST,n.data.request):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))},[m.YN.ACTIONS.GET_REQUEST_DATA_EXPORT](e){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),o.Z.get("auth/account/export").then((n=>{"success"===n.data.status?e.commit(m.YN.MUTATIONS.SET_EXPORT_REQUEST,n.data.request):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))}},S={[m.YN.GETTERS.AUTH_TOKEN]:e=>e.authToken,[m.YN.GETTERS.AUTH_USER_PROFILE]:e=>e.authUserProfile,[m.YN.GETTERS.EXPORT_REQUEST]:e=>e.exportRequest,[m.YN.GETTERS.IS_AUTHENTICATED]:e=>null!==e.authToken,[m.YN.GETTERS.IS_ADMIN]:e=>e.authUserProfile&&e.authUserProfile.admin,[m.YN.GETTERS.IS_REGISTRATION_SUCCESS]:e=>e.isRegistrationSuccess,[m.YN.GETTERS.IS_SUCCESS]:e=>e.isSuccess,[m.YN.GETTERS.USER_LOADING]:e=>e.loading},p={[m.YN.MUTATIONS.CLEAR_AUTH_USER_TOKEN](e){e.authToken=null,e.authUserProfile={}},[m.YN.MUTATIONS.UPDATE_AUTH_TOKEN](e,n){e.authToken=n},[m.YN.MUTATIONS.UPDATE_AUTH_USER_PROFILE](e,n){e.authUserProfile=n},[m.YN.MUTATIONS.UPDATE_IS_REGISTRATION_SUCCESS](e,n){e.isRegistrationSuccess=n},[m.YN.MUTATIONS.UPDATE_IS_SUCCESS](e,n){e.isSuccess=n},[m.YN.MUTATIONS.UPDATE_USER_LOADING](e,n){e.loading=n},[m.YN.MUTATIONS.SET_EXPORT_REQUEST](e,n){e.exportRequest=n}},A={authToken:null,authUserProfile:{},isSuccess:!1,isRegistrationSuccess:!1,loading:!1,exportRequest:null},z={state:A,actions:T,getters:S,mutations:p};var O=z;const I=(e,n)=>{e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),o.Z.get(n).then((n=>{"success"===n.data.status?e.commit(m.Km.MUTATIONS.SET_CLIENT,n.data.data.client):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))},R={[m.Km.ACTIONS.AUTHORIZE_CLIENT](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES);const r=new FormData;r.set("client_id",n.client_id),r.set("response_type",n.response_type),r.set("scope",n.scope),r.set("confirm","true"),n.state&&r.set("state",n.state),n.code_challenge&&r.set("code_challenge",n.code_challenge),n.code_challenge_method&&r.set("code_challenge_method",n.code_challenge_method),o.Z.post("oauth/authorize",r,{headers:{"Content-Type":"multipart/form-data"}}).then((n=>{200==n.status&&n.data.redirect_url?window.location.href=n.data.redirect_url:(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))},[m.Km.ACTIONS.CREATE_CLIENT](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),o.Z.post("oauth/apps",n).then((n=>{"created"===n.data.status?(e.commit(m.Km.MUTATIONS.SET_CLIENT,n.data.data.client),u.Z.push(`/profile/apps/${n.data.data.client.id}/created`)):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))},[m.Km.ACTIONS.DELETE_CLIENT](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),o.Z["delete"](`oauth/apps/${n}`).then((n=>{204===n.status?e.dispatch(m.Km.ACTIONS.GET_CLIENTS).then((()=>u.Z.push("/profile/apps"))):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))},[m.Km.ACTIONS.GET_CLIENT_BY_CLIENT_ID](e,n){I(e,`oauth/apps/${n}`)},[m.Km.ACTIONS.GET_CLIENT_BY_ID](e,n){I(e,`oauth/apps/${n}/by_id`)},[m.Km.ACTIONS.GET_CLIENTS](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),o.Z.get("oauth/apps",{params:n}).then((n=>{"success"===n.data.status?(e.commit(m.Km.MUTATIONS.SET_CLIENTS,n.data.data.clients),e.commit(m.Km.MUTATIONS.SET_CLIENTS_PAGINATION,n.data.pagination)):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))},[m.Km.ACTIONS.REVOKE_ALL_TOKENS](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.Km.MUTATIONS.SET_REVOCATION_SUCCESSFUL,!1),o.Z.post(`oauth/apps/${n}/revoke`).then((n=>{"success"===n.data.status?e.commit(m.Km.MUTATIONS.SET_REVOCATION_SUCCESSFUL,!0):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))}},N={[m.Km.GETTERS.CLIENT]:e=>e.client,[m.Km.GETTERS.CLIENTS]:e=>e.clients,[m.Km.GETTERS.CLIENTS_PAGINATION]:e=>e.pagination,[m.Km.GETTERS.REVOCATION_SUCCESSFUL]:e=>e.revocationSuccessful},g={[m.Km.MUTATIONS.SET_CLIENT](e,n){e.client=n},[m.Km.MUTATIONS.EMPTY_CLIENT](e){e.client={}},[m.Km.MUTATIONS.SET_CLIENTS](e,n){e.clients=n},[m.Km.MUTATIONS.SET_CLIENTS_PAGINATION](e,n){e.pagination=n},[m.Km.MUTATIONS.SET_REVOCATION_SUCCESSFUL](e,n){e.revocationSuccessful=n}},U={client:{},clients:[],pagination:{},revocationSuccessful:!1},C={state:U,actions:R,getters:N,mutations:g};var D=C,h=r(2540);const{locale:v}=h.Z.global,P={[m.SY.ACTIONS.GET_APPLICATION_CONFIG](e){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.SY.MUTATIONS.UPDATE_APPLICATION_LOADING,!0),o.Z.get("config").then((n=>{"success"===n.data.status?e.commit(m.SY.MUTATIONS.UPDATE_APPLICATION_CONFIG,n.data.data):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n))).finally((()=>e.commit(m.SY.MUTATIONS.UPDATE_APPLICATION_LOADING,!1)))},[m.SY.ACTIONS.GET_APPLICATION_STATS](e){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),o.Z.get("stats/all").then((n=>{"success"===n.data.status?e.commit(m.SY.MUTATIONS.UPDATE_APPLICATION_STATS,n.data.data):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))},[m.SY.ACTIONS.GET_APPLICATION_PRIVACY_POLICY](e){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),o.Z.get("config").then((n=>{"success"===n.data.status?e.commit(m.SY.MUTATIONS.UPDATE_APPLICATION_PRIVACY_POLICY,n.data.data):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))},[m.SY.ACTIONS.UPDATE_APPLICATION_CONFIG](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),o.Z.patch("config",n).then((n=>{"success"===n.data.status?(e.commit(m.SY.MUTATIONS.UPDATE_APPLICATION_CONFIG,n.data.data),u.Z.push("/admin/application")):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))},[m.SY.ACTIONS.UPDATE_APPLICATION_LANGUAGE](e,n){document.querySelector("html")?.setAttribute("lang",n),e.commit(m.SY.MUTATIONS.UPDATE_LANG,n),v.value=n}},f={[m.SY.GETTERS.APP_CONFIG]:e=>e.application.config,[m.SY.GETTERS.APP_LOADING]:e=>e.appLoading,[m.SY.GETTERS.APP_STATS]:e=>e.application.statistics,[m.SY.GETTERS.ERROR_MESSAGES]:e=>e.errorMessages,[m.SY.GETTERS.LANGUAGE]:e=>e.language,[m.SY.GETTERS.LOCALE]:e=>e.locale};var L=r(6287);const w={[m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES](e){e.errorMessages=null},[m.SY.MUTATIONS.SET_ERROR_MESSAGES](e,n){e.errorMessages=n},[m.SY.MUTATIONS.UPDATE_APPLICATION_CONFIG](e,n){e.application.config=n},[m.SY.MUTATIONS.UPDATE_APPLICATION_LOADING](e,n){e.appLoading=n},[m.SY.MUTATIONS.UPDATE_APPLICATION_PRIVACY_POLICY](e,n){e.application.config.privacy_policy=n.privacy_policy,e.application.config.privacy_policy_date=n.privacy_policy_date},[m.SY.MUTATIONS.UPDATE_APPLICATION_STATS](e,n){e.application.statistics=n},[m.SY.MUTATIONS.UPDATE_LANG](e,n){e.language=n,e.locale=L.v1[n]}};var k=r(5826);const b={root:!0,language:"en",locale:k.Z,errorMessages:null,application:{statistics:{sports:0,uploads_dir_size:0,users:0,workouts:0}},appLoading:!1},M={[m.O8.ACTIONS.GET_SPORTS](e){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),o.Z.get("sports").then((n=>{"success"===n.data.status?(e.commit(m.O8.MUTATIONS.SET_SPORTS,n.data.data.sports),e.commit(m.YN.MUTATIONS.UPDATE_USER_LOADING,!1)):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))},[m.O8.ACTIONS.UPDATE_SPORTS](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),o.Z.patch(`sports/${n.id}`,{is_active:n.isActive}).then((n=>{"success"===n.data.status?e.dispatch(m.O8.ACTIONS.GET_SPORTS):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))}},y={[m.O8.GETTERS.SPORTS]:e=>e.sports},G={[m.O8.MUTATIONS.SET_SPORTS](e,n){e.sports=n}},F={sports:[]},W={state:F,actions:M,getters:y,mutations:G};var B=W;const Y={[m.gu.ACTIONS.GET_USER_STATS](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),o.Z.get(`stats/${n.username}/${n.filterType}`,{params:n.params}).then((n=>{"success"===n.data.status?e.commit(m.gu.MUTATIONS.UPDATE_USER_STATS,n.data.data.statistics):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))}},x={[m.gu.GETTERS.USER_STATS]:e=>e.statistics},K={[m.gu.MUTATIONS.UPDATE_USER_STATS](e,n){e.statistics=n},[m.gu.MUTATIONS.EMPTY_USER_STATS](e){e.statistics={}}},H={statistics:{}},V={state:H,actions:Y,getters:x,mutations:K};var Z=V;const $={[m.RT.GETTERS.USER]:e=>e.user,[m.RT.GETTERS.USERS]:e=>e.users,[m.RT.GETTERS.USERS_IS_SUCCESS]:e=>e.isSuccess,[m.RT.GETTERS.USERS_LOADING]:e=>e.loading,[m.RT.GETTERS.USERS_PAGINATION]:e=>e.pagination},q={[m.RT.MUTATIONS.UPDATE_USER](e,n){e.user=n},[m.RT.MUTATIONS.UPDATE_USER_IN_USERS](e,n){e.users=e.users.map((e=>e.username===n.username?n:e))},[m.RT.MUTATIONS.UPDATE_USERS](e,n){e.users=n},[m.RT.MUTATIONS.UPDATE_USERS_LOADING](e,n){e.loading=n},[m.RT.MUTATIONS.UPDATE_USERS_PAGINATION](e,n){e.pagination=n},[m.RT.MUTATIONS.UPDATE_IS_SUCCESS](e,n){e.isSuccess=n}},j={user:{},users:[],loading:!1,isSuccess:!1,pagination:{}},X={state:j,actions:E,getters:$,mutations:q};var Q=X,J=r(52);const ee=(e,n,r)=>{e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),o.Z.get("workouts",{params:n}).then((n=>{"success"===n.data.status?(e.commit(m.aX.MUTATIONS[r],n.data.data.workouts),r===J.CW.SET_USER_WORKOUTS&&e.commit(m.aX.MUTATIONS.SET_WORKOUTS_PAGINATION,n.data.pagination)):(0,s.S)(e,null)})).catch((n=>(0,s.S)(e,n)))},ne={[m.aX.ACTIONS.GET_CALENDAR_WORKOUTS](e,n){e.commit(m.aX.MUTATIONS.EMPTY_CALENDAR_WORKOUTS),ee(e,n,J.CW.SET_CALENDAR_WORKOUTS)},[m.aX.ACTIONS.GET_USER_WORKOUTS](e,n){ee(e,n,J.CW.SET_USER_WORKOUTS)},[m.aX.ACTIONS.GET_TIMELINE_WORKOUTS](e,n){ee(e,n,J.CW.SET_TIMELINE_WORKOUTS)},[m.aX.ACTIONS.GET_MORE_TIMELINE_WORKOUTS](e,n){ee(e,n,J.CW.ADD_TIMELINE_WORKOUTS)},[m.aX.ACTIONS.GET_WORKOUT_DATA](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.aX.MUTATIONS.SET_WORKOUT_LOADING,!0);const r=n.segmentId?`/segment/${n.segmentId}`:"";o.Z.get(`workouts/${n.workoutId}`).then((t=>{const a=t.data.data.workouts[0];if("success"===t.data.status){if(n.segmentId&&(0===a.segments.length||!a.segments[+n.segmentId-1]))throw new Error("WORKOUT_NOT_FOUND");e.commit(m.aX.MUTATIONS.SET_WORKOUT,t.data.data.workouts[0]),t.data.data.workouts[0].with_gpx&&(o.Z.get(`workouts/${n.workoutId}/chart_data${r}`).then((n=>{"success"===n.data.status&&e.commit(m.aX.MUTATIONS.SET_WORKOUT_CHART_DATA,n.data.data.chart_data)})),o.Z.get(`workouts/${n.workoutId}/gpx${r}`).then((n=>{"success"===n.data.status&&e.commit(m.aX.MUTATIONS.SET_WORKOUT_GPX,n.data.data.gpx)})))}else e.commit(m.aX.MUTATIONS.EMPTY_WORKOUT),(0,s.S)(e,null)})).catch((n=>{e.commit(m.aX.MUTATIONS.EMPTY_WORKOUT),(0,s.S)(e,n)})).finally((()=>e.commit(m.aX.MUTATIONS.SET_WORKOUT_LOADING,!1)))},[m.aX.ACTIONS.DELETE_WORKOUT](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.aX.MUTATIONS.SET_WORKOUT_LOADING,!0),o.Z["delete"](`workouts/${n.workoutId}`).then((()=>{e.commit(m.aX.MUTATIONS.EMPTY_WORKOUT),e.dispatch(m.YN.ACTIONS.GET_USER_PROFILE),u.Z.push("/")})).catch((n=>{(0,s.S)(e,n)})).finally((()=>e.commit(m.aX.MUTATIONS.SET_WORKOUT_LOADING,!1)))},[m.aX.ACTIONS.EDIT_WORKOUT](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.aX.MUTATIONS.SET_WORKOUT_LOADING,!0),o.Z.patch(`workouts/${n.workoutId}`,n.data).then((()=>{e.dispatch(m.YN.ACTIONS.GET_USER_PROFILE),e.dispatch(m.aX.ACTIONS.GET_WORKOUT_DATA,{workoutId:n.workoutId}).then((()=>{u.Z.push({name:"Workout",params:{workoutId:n.workoutId}})}))})).catch((n=>{(0,s.S)(e,n)})).finally((()=>e.commit(m.aX.MUTATIONS.SET_WORKOUT_LOADING,!1)))},[m.aX.ACTIONS.ADD_WORKOUT](e,n){if(e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.aX.MUTATIONS.SET_WORKOUT_LOADING,!0),!n.file)throw new Error("No file part");const r=n.notes.replace(/"/g,'\\"'),t=new FormData;t.append("file",n.file),t.append("data",`{"sport_id": ${n.sport_id}, "notes": "${r}"}`),o.Z.post("workouts",t,{headers:{"content-type":"multipart/form-data"}}).then((n=>{if("created"===n.data.status){e.dispatch(m.YN.ACTIONS.GET_USER_PROFILE);const r=n.data.data.workouts[0];u.Z.push(1===n.data.data.workouts.length?`/workouts/${r.id}`:"/")}})).catch((n=>{(0,s.S)(e,n)})).finally((()=>e.commit(m.aX.MUTATIONS.SET_WORKOUT_LOADING,!1)))},[m.aX.ACTIONS.ADD_WORKOUT_WITHOUT_GPX](e,n){e.commit(m.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),e.commit(m.aX.MUTATIONS.SET_WORKOUT_LOADING,!0),o.Z.post("workouts/no_gpx",n).then((n=>{if("created"===n.data.status){e.dispatch(m.YN.ACTIONS.GET_USER_PROFILE);const r=n.data.data.workouts[0];u.Z.push(`/workouts/${r.id}`)}})).catch((n=>{(0,s.S)(e,n)})).finally((()=>e.commit(m.aX.MUTATIONS.SET_WORKOUT_LOADING,!1)))}},re={[m.aX.GETTERS.CALENDAR_WORKOUTS]:e=>e.calendar_workouts,[m.aX.GETTERS.TIMELINE_WORKOUTS]:e=>e.timeline_workouts,[m.aX.GETTERS.USER_WORKOUTS]:e=>e.user_workouts,[m.aX.GETTERS.WORKOUT_DATA]:e=>e.workoutData,[m.aX.GETTERS.WORKOUTS_PAGINATION]:e=>e.pagination},te={[m.aX.MUTATIONS.ADD_TIMELINE_WORKOUTS](e,n){e.timeline_workouts=e.timeline_workouts.concat(n)},[m.aX.MUTATIONS.SET_CALENDAR_WORKOUTS](e,n){e.calendar_workouts=n},[m.aX.MUTATIONS.SET_TIMELINE_WORKOUTS](e,n){e.timeline_workouts=n},[m.aX.MUTATIONS.SET_USER_WORKOUTS](e,n){e.user_workouts=n},[m.aX.MUTATIONS.SET_WORKOUTS_PAGINATION](e,n){e.pagination=n},[m.aX.MUTATIONS.SET_WORKOUT](e,n){e.workoutData.workout=n},[m.aX.MUTATIONS.SET_WORKOUT_CHART_DATA](e,n){e.workoutData.chartData=n},[m.aX.MUTATIONS.SET_WORKOUT_GPX](e,n){e.workoutData.gpx=n},[m.aX.MUTATIONS.SET_WORKOUT_LOADING](e,n){e.workoutData.loading=n},[m.aX.MUTATIONS.EMPTY_CALENDAR_WORKOUTS](e){e.calendar_workouts=[]},[m.aX.MUTATIONS.EMPTY_WORKOUTS](e){e.calendar_workouts=[],e.user_workouts=[],e.timeline_workouts=[]},[m.aX.MUTATIONS.EMPTY_WORKOUT](e){e.workoutData={gpx:"",loading:!1,workout:{},chartData:[]}}},oe={calendar_workouts:[],timeline_workouts:[],pagination:{},user_workouts:[],workoutData:{gpx:"",loading:!1,workout:{},chartData:[]}},ae={state:oe,actions:ne,getters:re,mutations:te};var ie=ae;const se={authUserModule:O,oAuthModule:D,sportsModule:B,statsModule:Z,usersModule:Q,workoutsModule:ie},le={state:b,actions:P,getters:f,mutations:w,modules:se};var ce=le;const ue=(0,t.MT)(ce);var me=ue},52:function(e,n,r){"use strict";var t,o,a;r.d(n,{CW:function(){return a},JP:function(){return o},tW:function(){return t}}),function(e){e["ADD_WORKOUT"]="ADD_WORKOUT",e["ADD_WORKOUT_WITHOUT_GPX"]="ADD_WORKOUT_WITHOUT_GPX",e["DELETE_WORKOUT"]="DELETE_WORKOUT",e["EDIT_WORKOUT"]="EDIT_WORKOUT",e["GET_CALENDAR_WORKOUTS"]="GET_CALENDAR_WORKOUTS",e["GET_USER_WORKOUTS"]="GET_USER_WORKOUTS",e["GET_TIMELINE_WORKOUTS"]="GET_TIMELINE_WORKOUTS",e["GET_MORE_TIMELINE_WORKOUTS"]="GET_MORE_TIMELINE_WORKOUTS",e["GET_WORKOUT_DATA"]="GET_WORKOUT_DATA"}(t||(t={})),function(e){e["CALENDAR_WORKOUTS"]="CALENDAR_WORKOUTS",e["TIMELINE_WORKOUTS"]="TIMELINE_WORKOUTS",e["USER_WORKOUTS"]="USER_WORKOUTS",e["WORKOUT_DATA"]="WORKOUT_DATA",e["WORKOUTS_PAGINATION"]="WORKOUTS_PAGINATION"}(o||(o={})),function(e){e["ADD_TIMELINE_WORKOUTS"]="ADD_TIMELINE_WORKOUTS",e["EMPTY_WORKOUTS"]="EMPTY_WORKOUTS",e["EMPTY_CALENDAR_WORKOUTS"]="EMPTY_CALENDAR_WORKOUTS",e["EMPTY_WORKOUT"]="EMPTY_WORKOUT",e["SET_CALENDAR_WORKOUTS"]="SET_CALENDAR_WORKOUTS",e["SET_TIMELINE_WORKOUTS"]="SET_TIMELINE_WORKOUTS",e["SET_USER_WORKOUTS"]="SET_USER_WORKOUTS",e["SET_WORKOUT"]="SET_WORKOUT",e["SET_WORKOUT_GPX"]="SET_WORKOUT_GPX",e["SET_WORKOUT_CHART_DATA"]="SET_WORKOUT_CHART_DATA",e["SET_WORKOUT_LOADING"]="SET_WORKOUT_LOADING",e["SET_WORKOUTS_PAGINATION"]="SET_WORKOUTS_PAGINATION"}(a||(a={}))},9917:function(e,n,r){"use strict";r.d(n,{o:function(){return o}});var t=r(3907);function o(){return(0,t.oR)()}},2766:function(e,n,r){"use strict";r.d(n,{Hf:function(){return o},Ne:function(){return c},fS:function(){return t},lM:function(){return m},pm:function(){return l},z_:function(){return i}});const t=["asc","desc"],o=1,a=10,i=(e,n)=>e&&"string"===typeof e&&+e>0?+e:n,s=(e,n,r)=>e&&"string"===typeof e&&n.includes(e)?e:r,l=(e,n,r,l)=>{const c=l||{},u=c.defaultSort||"asc",m={};return m.page=i(e.page,o),m.per_page=i(e.per_page,a),m.order=s(e.order,t,u),m.order_by=s(e.order_by,n,r),"string"===typeof e.q?m.q=e.q:delete m.q,m},c=["from","to","ave_speed_from","ave_speed_to","max_speed_from","max_speed_to","distance_from","distance_to","duration_from","duration_to","sport_id","title"],u=(e,n=1)=>Array.from({length:e-n+1},((e,r)=>n+r)),m=(e,n)=>{if(e<0)return[];if(e<9)return u(e);let r=[1,2];return n<4?r=r.concat([3,4,5]):n<6?r=r.concat(u(n+2,3)):(r=r.concat(["..."]),n=e-2&&+r[r.length-1]{switch(e){case"week":return(0,t.Z)(n,{weekStartsOn:r?1:0});case"year":return(0,o.Z)(n);case"month":return(0,a.Z)(n);default:throw new Error(`Invalid duration, expected: "week", "month", "year", got: "${e}"`)}},p=(e,n)=>{switch(e){case"week":return(0,i.Z)(n,7);case"year":return(0,s.Z)(n,1);case"month":return(0,l.Z)(n,1);default:throw new Error(`Invalid duration, expected: "week", "month", "year", got: "${e}"`)}},A=(e,n)=>(0,d.Z)(new Date(e),n),z=(e,n)=>{const r=(0,a.Z)(e),o=(0,c.Z)(e),i=n?1:0;return{start:(0,t.Z)(r,{weekStartsOn:i}),end:(0,u.Z)(o,{weekStartsOn:i})}},O=(e,n=null,r=null)=>(n||(n="yyyy/MM/dd"),n=N(n,T.value),r||(r="HH:mm"),{workout_date:(0,m.Z)(e,n,{locale:_.v1[T.value]}),workout_time:(0,m.Z)(e,r)}),I=["MM/dd/yyyy","dd/MM/yyyy","yyyy-MM-dd","date_string"],R={de:"do MMM yyyy",en:"MMM. do, yyyy",es:"d MMM yyyy",fr:"d MMM yyyy",gl:"d MMM yyyy",it:"d MMM yyyy",pl:"d MMM yyyy",nb:"do MMM yyyy",nl:"d MMM yyyy"},N=(e,n)=>"date_string"===e?R[n]:e,g=(e,n,r,t=!0,o=null,a=!1)=>{o||(o=T.value);const i=t?a?" HH:mm:ss":" HH:mm":"";return(0,m.Z)(A(e,n),`${N(r,o)}${i}`,{locale:_.v1[o]})},U=(e,n,r=null)=>{const t=r||T.value,o=[];return I.map((r=>{const a=N(r,t);o.push({label:`${a} - ${g(e,n,a,!1,t)}`,value:r})})),o}},8966:function(e,n,r){"use strict";r.d(n,{Z:function(){return o},j:function(){return a}});const t=["bytes","KB","MB","GB","TB"],o=(e,n=!0)=>{const r=Math.floor(Math.log(e)/Math.log(1024));if(!e)return n?"0 bytes":{size:"0",suffix:"bytes"};const o=(e/Math.pow(1024,r)).toFixed(1),a=t[r];return n?`${o}${a}`:{size:o,suffix:a}},a=e=>{const n=e/1048576;return+n.toFixed(2)}},2024:function(e,n,r){"use strict";r.d(n,{S:function(){return a},k:function(){return o}});var t=r(5801);const o=()=>"/api/",a=(e,n,r="UNKNOWN")=>{if(n&&"canceled"===n.message)return;const o=n?.response&&n.response.data?n.response.data:null;if(401===n?.response?.status&&"invalid_token"===o?.error)return localStorage.removeItem("authToken"),void e.dispatch(t.YN.ACTIONS.CHECK_AUTH_USER);const a=n?n.response?413===n.response.status?"file size is greater than the allowed size":o?.message?o.message:r:n.message?n.message:r:r;e.commit(t.SY.MUTATIONS.SET_ERROR_MESSAGES,a.includes("\n")?a.split("\n").filter((e=>""!==e)).map((e=>`api.ERROR.${e}`)):`api.ERROR.${a}`)}},2335:function(e,n,r){"use strict";r.d(n,{O:function(){return i}});var t=r(9597),o=r(1036),a=r.n(o);const i=e=>a()((0,t.Z)(e,{target:"_blank"}),{allowedTags:["a"],disallowedTagsMode:"escape"})},6287:function(e,n,r){"use strict";r.d(n,{mT:function(){return S},v1:function(){return E},zK:function(){return _}});var t=r(879),o=r(5826),a=r(3345),i=r(5830),s=r(1229),l=r(4962),c=r(3020),u=r(3304),m=r(4638),d=r(2540);const E={de:t.Z,en:o.Z,es:a.Z,fr:i.Z,gl:s.Z,it:l.Z,pl:c.Z,nb:u.Z,nl:m.Z},_={de:"Deutsch",en:"English",es:"Español",fr:"Français",gl:"Galego",it:"Italiano (87%)",nb:"Norsk bokmål (36%)",nl:"Nederlands",pl:"Polski (43%)"},{availableLocales:T}=d.Z.global,S=T.map((e=>({label:_[e],value:e})))},631:function(e,n,r){"use strict";r.d(n,{CM:function(){return l},PA:function(){return s},Yx:function(){return o},Zo:function(){return t},xH:function(){return i}});const t={"Cycling (Sport)":"#4c9792","Cycling (Transport)":"#88af98","Cycling (Virtual)":"#64a360",Hiking:"#bb757c","Mountain Biking":"#d4b371","Mountain Biking (Electric)":"#fc9d6f",Mountaineering:"#48b3b7",Rowing:"#fcce72",Running:"#835b83","Skiing (Alpine)":"#67a4bd","Skiing (Cross Country)":"#9498d0",Snowshoes:"#5780a8",Trail:"#09a98a",Walking:"#838383"},o=e=>{const n={};return e.map((e=>n[e.id]=e.color?e.color:t[e.label])),n},a=(e,n)=>{const r=e.translatedLabel.toLowerCase(),t=n.translatedLabel.toLowerCase();return r>t?1:re.filter((e=>"all"===r||(t.includes(e.id)||e[r]))).map((e=>({...e,translatedLabel:n(`sports.${e.label}.LABEL`)}))).sort(a),s=(e,n)=>n.filter((n=>n.id===e.sport_id)).map((e=>e.label))[0],l=(e,n)=>n.filter((n=>n.id===e.sport_id)).map((e=>e.color))[0]},9318:function(e,n,r){"use strict";r.d(n,{FN:function(){return P},aZ:function(){return v},v1:function(){return h}});r(7658);var t=r(6761),o=r(8148),a=r(9319),i=r(584),s=r(4559),l=r(3703),c=r(876),u=r(7090),m=r(4135),d=r(1593),E=r(7982),_=r(3500),T=r(1640),S=r(2540),p=r(6558),A=r(6287),z=r(631),O=r(3649);const{locale:I}=S.Z.global,R={week:{api:"yyyy-MM-dd",chart:"MM/dd/yyyy"},month:{api:"yyyy-MM",chart:"MM/yyyy"},year:{api:"yyyy",chart:"yyyy"}},N=["average_speed","nb_workouts","total_duration","total_distance","total_ascent","total_descent"],g=(e,n)=>{const r=[];for(let t=(0,p.Nh)(e.duration,e.start,n);t<=e.end;t=(0,p.xA)(e.duration,t))r.push(t);return r},U=(e,n,r=!1)=>{const t={label:e,backgroundColor:[n],data:[]};return r&&(t.type="line",t.borderColor=[n],t.spanGaps=!0),t},C=e=>{const n={average_speed:[],nb_workouts:[],total_distance:[],total_duration:[],total_ascent:[],total_descent:[]};return e.map((e=>{const r=e.color?e.color:z.Zo[e.label];n.average_speed.push(U(e.label,r,!0)),n.nb_workouts.push(U(e.label,r)),n.total_distance.push(U(e.label,r)),n.total_duration.push(U(e.label,r)),n.total_ascent.push(U(e.label,r)),n.total_descent.push(U(e.label,r))})),n},D=(e,n,r)=>{switch(e){case"average_speed":case"total_distance":case"total_ascent":case"total_descent":return(0,O.f3)(["average_speed","total_distance"].includes(e)?"km":"m",n,r);default:case"nb_workouts":case"total_duration":return n}},h=(e,n,r,o,a,i,s)=>{const l=g(e,n),c=R[e.duration],u=r.filter((e=>o.includes(e.id))),m=[],d=C(u),E={};return u.map((e=>E[e.label]=e.id)),l.map((n=>{const r=(0,t.Z)(n,c.api),o=(0,t.Z)(n,"week"===e.duration?(0,p.mh)(s,I.value):c.chart,{locale:A.v1[I.value]});m.push(o),N.map((e=>{d[e].map((n=>{n.data.push(r in a&&E[n.label]in a[r]?D(e,a[r][E[n.label]][e],i):"average_speed"===e?null:0)}))}))})),{labels:m,datasets:d}},v=(e,n,r)=>{const t=r?1:0,d="year"===n?(0,o.Z)((0,a.Z)(e,9)):"week"===n?(0,i.Z)((0,s.Z)(e,2),{weekStartsOn:t}):(0,l.Z)((0,s.Z)(e,11)),E="year"===n?(0,c.Z)(e):"week"===n?(0,u.Z)(e,{weekStartsOn:t}):(0,m.Z)(e);return{duration:n,end:E,start:d}},P=(e,n,r)=>{const{duration:t,start:S,end:p}=e,A=r?1:0;return{duration:t,end:"year"===t?(0,c.Z)(n?(0,a.Z)(p,1):(0,d.Z)(p,1)):"week"===t?(0,u.Z)(n?(0,E.Z)(p,1):(0,_.Z)(p,1),{weekStartsOn:A}):(0,m.Z)(n?(0,s.Z)(p,1):(0,T.Z)(p,1)),start:"year"===t?(0,o.Z)(n?(0,a.Z)(S,1):(0,d.Z)(S,1)):"week"===t?(0,i.Z)(n?(0,E.Z)(S,1):(0,_.Z)(S,1),{weekStartsOn:A}):(0,l.Z)(n?(0,s.Z)(S,1):(0,T.Z)(S,1))}}},3649:function(e,n,r){"use strict";r.d(n,{Dl:function(){return t},Y2:function(){return l},f3:function(){return i},sC:function(){return a},x$:function(){return s}});const t={ft:{unit:"ft",system:"imperial",multiplier:1,defaultTarget:"m"},mi:{unit:"mi",system:"imperial",multiplier:5280,defaultTarget:"km"},m:{unit:"m",system:"metric",multiplier:1,defaultTarget:"ft"},km:{unit:"m",system:"metric",multiplier:1e3,defaultTarget:"mi"}},o={metric:{imperial:3.280839895,metric:1},imperial:{metric:1/3.280839895,imperial:1}},a=(e,n,r,a=3)=>{const i=t[n],s=t[r],l=e*i.multiplier*o[i.system][s.system]/s.multiplier;return null!==a?parseFloat(l.toFixed(a)):l},i=(e,n,r)=>{const o=r?t[e].defaultTarget:e;return r?a(n,e,o,2):n},s=(e,n)=>{const r=n?1.8*e+32:e,t=n?" °F":"°C";return`${0===r?0:Number(r).toFixed(1)}${t}`},l=(e,n)=>{const r=n?2.2369363*e:e,t=n?" mph":"m/s";return`${0===r?0:Number(r).toFixed(1)}${t}`}},3768:function(e,n,r){"use strict";r.d(n,{BN:function(){return a},EX:function(){return o},eR:function(){return i}});r(7658);var t=r(3649);const o=(e,n,r)=>{const o={speed:{label:n("workouts.SPEED"),backgroundColor:["#FFFFFF"],borderColor:["#8884d8"],borderWidth:2,data:[],yAxisID:"ySpeed"},elevation:{label:n("workouts.ELEVATION"),backgroundColor:["#e5e5e5"],borderColor:["#cccccc"],borderWidth:1,fill:!0,data:[],yAxisID:"yElevation"}},a=[],i=[],s=[];return e.map((e=>{a.push((0,t.f3)("km",e.distance,r)),i.push(e.duration),o.speed.data.push((0,t.f3)("km",e.speed,r)),o.elevation.data.push((0,t.f3)("m",e.elevation,r)),s.push({latitude:e.latitude,longitude:e.longitude})})),{distance_labels:a,duration_labels:i,datasets:o,coordinates:s}},a=e=>{const n=e.length;if(0===n)return{};const r={};return e.map((e=>{r[e.sport_id]||(r[e.sport_id]={count:0,percentage:0}),r[e.sport_id].count+=1,r[e.sport_id].percentage=r[e.sport_id].count/n})),r},i={order:"desc",order_by:"workout_date"}},2531:function(e,n,r){"use strict";r.d(n,{Z:function(){return m}});var t=r(6252);const o={class:"card"},a={class:"card-title"},i={class:"card-content"};function s(e,n){return(0,t.wg)(),(0,t.iD)("div",o,[(0,t._)("div",a,[(0,t.WI)(e.$slots,"title")]),(0,t._)("div",i,[(0,t.WI)(e.$slots,"content")])])}var l=r(3744);const c={},u=(0,l.Z)(c,[["render",s]]);var m=u},8626:function(e,n,r){"use strict";r.d(n,{Z:function(){return S}});var t=r(6252),o=r(3577),a=r(2262);const i={class:"table-selects"},s=["value"],l=["value"],c=["value"],u=["value"],m=["value"],d=["value"];var E=(0,t.aZ)({__name:"FilterSelects",props:{order_by:null,query:null,sort:null,message:null},emits:["updateSelect"],setup(e,{emit:n}){const r=e,{order_by:E,query:_,sort:T,message:S}=(0,a.BK)(r),p=[10,25,50,100];function A(e){n("updateSelect",e.target.id,e.target.value)}return(e,n)=>((0,t.wg)(),(0,t.iD)("div",i,[(0,t._)("label",null,[(0,t.Uk)((0,o.zw)(e.$t("common.SELECTS.ORDER_BY.LABEL"))+": ",1),(0,t._)("select",{name:"order_by",id:"order_by",value:(0,a.SU)(_).order_by,onChange:A},[((0,t.wg)(!0),(0,t.iD)(t.HY,null,(0,t.Ko)((0,a.SU)(E),(n=>((0,t.wg)(),(0,t.iD)("option",{value:n,key:n},(0,o.zw)(e.$t(`${(0,a.SU)(S)}.${n.toUpperCase()}`)),9,l)))),128))],40,s)]),(0,t._)("label",null,[(0,t.Uk)((0,o.zw)(e.$t("common.SELECTS.ORDER.LABEL"))+": ",1),(0,t._)("select",{name:"order",id:"order",value:(0,a.SU)(_).order,onChange:A},[((0,t.wg)(!0),(0,t.iD)(t.HY,null,(0,t.Ko)((0,a.SU)(T),(n=>((0,t.wg)(),(0,t.iD)("option",{value:n,key:n},(0,o.zw)(e.$t(`common.SELECTS.ORDER.${n.toUpperCase()}`)),9,u)))),128))],40,c)]),(0,t._)("label",null,[(0,t.Uk)((0,o.zw)(e.$t("common.SELECTS.PER_PAGE.LABEL"))+": ",1),(0,t._)("select",{name:"per_page",id:"per_page",value:(0,a.SU)(_).per_page,onChange:A},[((0,t.wg)(),(0,t.iD)(t.HY,null,(0,t.Ko)(p,(e=>(0,t._)("option",{value:e,key:e},(0,o.zw)(e),9,d))),64))],40,m)])]))}}),_=r(3744);const T=(0,_.Z)(E,[["__scopeId","data-v-72463173"]]);var S=T},7167:function(e,n,r){"use strict";r.d(n,{Z:function(){return m}});var t=r(6252);const o={xmlns:"http://www.w3.org/2000/svg",viewBox:"0 -51 512 512"},a=(0,t.uE)('',1),i=[a];function s(e,n,r,a,s,l){return(0,t.wg)(),(0,t.iD)("svg",o,i)}var l={name:"ErrorImg"},c=r(3744);const u=(0,c.Z)(l,[["render",s]]);var m=u},8273:function(e,n,r){"use strict";r.d(n,{Z:function(){return _}});var t=r(6252),o=r(2262),a=(r(7658),r(3577));const i={id:"error"},s={class:"error-content"};var l=(0,t.aZ)({__name:"Error",props:{title:null,message:null,buttonText:null,path:{default:"/"}},setup(e){const n=e,{buttonText:r,title:l,message:c,path:u}=(0,o.BK)(n);return(e,n)=>((0,t.wg)(),(0,t.iD)("div",i,[(0,t._)("div",s,[(0,t._)("h1",null,(0,a.zw)((0,o.SU)(l)),1),(0,t._)("p",null,(0,a.zw)((0,o.SU)(c)),1),(0,o.SU)(r)?((0,t.wg)(),(0,t.iD)("button",{key:0,onClick:n[0]||(n[0]=n=>e.$router.push((0,o.SU)(u))),class:"upper"},(0,a.zw)((0,o.SU)(r)),1)):(0,t.kq)("",!0)])]))}}),c=r(3744);const u=(0,c.Z)(l,[["__scopeId","data-v-b60bfa80"]]);var m=u,d=(0,t.aZ)({__name:"NotFound",props:{target:{default:"PAGE"}},setup(e){const n=e,{target:r}=(0,o.BK)(n),a=(0,o.iH)(),i=(0,o.iH)(!1);function s(){a.value=setTimeout((()=>{i.value=!0}),500)}return(0,t.bv)((()=>s())),(0,t.Ah)((()=>{a.value&&clearTimeout(a.value)})),(e,n)=>i.value?((0,t.wg)(),(0,t.j4)(m,{key:0,title:"404",message:e.$t(`error.NOT_FOUND.${(0,o.SU)(r)}`),"button-text":e.$t("common.HOME")},null,8,["message","button-text"])):(0,t.kq)("",!0)}});const E=d;var _=E},5020:function(e,n,r){"use strict";r.d(n,{Z:function(){return S}});var t=r(6252),o=r(3577),a=r(2262),i=r(2766);const s=e=>((0,t.dD)("data-v-3a9a4a65"),e=e(),(0,t.Cn)(),e),l={class:"pagination-center","aria-label":"navigation"},c={class:"pagination"},u=s((()=>(0,t._)("i",{class:"fa fa-chevron-left","aria-hidden":"true"},null,-1))),m={key:0},d=s((()=>(0,t._)("i",{class:"fa fa-chevron-right","aria-hidden":"true"},null,-1)));var E=(0,t.aZ)({__name:"Pagination",props:{pagination:null,path:null,query:null},setup(e){const n=e,{pagination:r,path:s,query:E}=(0,a.BK)(n);function _(e,n){const r=Object.assign({},E.value);return r.page=n?e+n:e,r}return(e,n)=>{const E=(0,t.up)("router-link");return(0,t.wg)(),(0,t.iD)("nav",l,[(0,t._)("ul",c,[(0,t._)("li",{class:(0,o.C_)(["page-prev",{disabled:!(0,a.SU)(r).has_prev}])},[(0,t.Wm)(E,{class:"page-link",to:{path:(0,a.SU)(s),query:_((0,a.SU)(r).page,-1)},disabled:!(0,a.SU)(r).has_prev},{default:(0,t.w5)((({navigate:n})=>[(0,t.WI)(e.$slots,"default",{onClick:e=>(0,a.SU)(r).has_next?n:null},(()=>[(0,t.Uk)((0,o.zw)(e.$t("api.PAGINATION.PREVIOUS"))+" ",1),u]))])),_:3},8,["to","disabled"])],2),((0,t.wg)(!0),(0,t.iD)(t.HY,null,(0,t.Ko)((0,a.SU)(i.lM)((0,a.SU)(r).pages,(0,a.SU)(r).page),(e=>((0,t.wg)(),(0,t.iD)("li",{key:e,class:(0,o.C_)(["page",{active:e===(0,a.SU)(r).page}])},["..."===e?((0,t.wg)(),(0,t.iD)("span",m," ... ")):((0,t.wg)(),(0,t.j4)(E,{key:1,class:"page-link",to:{path:(0,a.SU)(s),query:_(+e)}},{default:(0,t.w5)((()=>[(0,t.Uk)((0,o.zw)(e),1)])),_:2},1032,["to"]))],2)))),128)),(0,t._)("li",{class:(0,o.C_)(["page-next",{disabled:!(0,a.SU)(r).has_next}])},[(0,t.Wm)(E,{class:"page-link",to:{path:(0,a.SU)(s),query:_((0,a.SU)(r).page,1)},disabled:!(0,a.SU)(r).has_next},{default:(0,t.w5)((({navigate:n})=>[(0,t.WI)(e.$slots,"default",{onClick:e=>(0,a.SU)(r).has_next?n:null},(()=>[(0,t.Uk)((0,o.zw)(e.$t("api.PAGINATION.NEXT"))+" ",1),d]))])),_:3},8,["to","disabled"])],2)])])}}}),_=r(3744);const T=(0,_.Z)(E,[["__scopeId","data-v-3a9a4a65"]]);var S=T},8403:function(e,n,r){"use strict";r.d(n,{Z:function(){return P}});var t=r(6252),o=r(2262),a=r(9963),i=r(3577),s=r(5275),l=r(5801),c=r(9917);const u=async e=>{switch(e){case"fr":return await r.e(222).then(r.bind(r,6886));case"de":return await r.e(940).then(r.bind(r,5767));case"it":return await r.e(802).then(r.bind(r,8060));case"es":return await r.e(394).then(r.bind(r,9975));case"pl":return await r.e(946).then(r.bind(r,6515));default:return await r.e(261).then(r.bind(r,8638))}},m=async e=>{const n=await r.e(881).then(r.bind(r,268)),t=await u(e),o={graphs:n.adjacencyGraphs,dictionary:{...n.dictionary,...t.dictionary}};s.Mu.setOptions(o)},d=e=>{switch(e){case 2:return"AVERAGE";case 3:return"GOOD";case 4:return"STRONG";default:return"WEAK"}},E={class:"password-strength"},_=["value"],T={key:0,class:"password-strength-details"},S={class:"password-strength-value"},p={key:0,class:"info-box"},A={class:"password-feedback"};var z=(0,t.aZ)({__name:"PasswordStength",props:{password:null},setup(e){const n=e,{password:r}=(0,o.BK)(n),a=(0,c.o)(),u=(0,t.Fl)((()=>a.getters[l.SY.GETTERS.LANGUAGE])),z=(0,t.Fl)((()=>a.getters[l.YN.GETTERS.IS_SUCCESS])),O=(0,o.iH)(0),I=(0,o.iH)(""),R=(0,o.iH)([]),N=(0,o.iH)("0% 100%");function g(e){const n=(0,s.tu)(e);O.value=n.score,I.value=d(O.value),R.value=n.feedback.suggestions,N.value=100*O.value/4+"% 100%"}return(0,t.wF)((async()=>await m(u.value))),(0,t.YP)((()=>u.value),(async e=>{await m(e)})),(0,t.YP)((()=>r.value),(async e=>{z.value?I.value="":g(e)})),(e,n)=>((0,t.wg)(),(0,t.iD)("div",E,[(0,t._)("input",{class:(0,i.C_)(["password-slider",`strength-${O.value}`]),style:(0,i.j5)({backgroundSize:N.value}),type:"range",value:O.value,min:"0",max:"4",step:"1"},null,14,_),I.value?((0,t.wg)(),(0,t.iD)("div",T,[(0,t._)("span",S,(0,i.zw)(e.$t("user.PASSWORD_STRENGTH.LABEL"))+": "+(0,i.zw)(e.$t(`user.PASSWORD_STRENGTH.${I.value}`)),1),R.value.length>0?((0,t.wg)(),(0,t.iD)("div",p,[(0,t._)("ul",A,[((0,t.wg)(!0),(0,t.iD)(t.HY,null,(0,t.Ko)(R.value,(n=>((0,t.wg)(),(0,t.iD)("li",{key:n},(0,i.zw)(e.$t(`user.PASSWORD_STRENGTH.SUGGESTIONS.${n}`)),1)))),128))])])):(0,t.kq)("",!0)])):(0,t.kq)("",!0)]))}}),O=r(3744);const I=(0,O.Z)(z,[["__scopeId","data-v-74e71df5"]]);var R=I;const N=e=>((0,t.dD)("data-v-5a126514"),e=e(),(0,t.Cn)(),e),g={class:"password-input"},U=["id","disabled","placeholder","required","type"],C={key:0,class:"form-info"},D=N((()=>(0,t._)("i",{class:"fa fa-info-circle","aria-hidden":"true"},null,-1)));var h=(0,t.aZ)({__name:"PasswordInput",props:{checkStrength:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},id:{default:"password"},password:{default:""},placeholder:null,required:{type:Boolean,default:!1}},emits:["updatePassword","passwordError"],setup(e,{emit:n}){const r=e,{checkStrength:s,disabled:l,id:c,password:u,placeholder:m,required:d}=(0,o.BK)(r),E=(0,o.iH)(!1),_=(0,o.iH)("");function T(){E.value=!E.value}function S(e){n("updatePassword",e.target.value)}function p(){n("passwordError")}return(0,t.YP)((()=>u.value),(e=>{""===e&&(_.value="")})),(e,n)=>((0,t.wg)(),(0,t.iD)("div",g,[(0,t.wy)((0,t._)("input",{id:(0,o.SU)(c),disabled:(0,o.SU)(l),placeholder:(0,o.SU)(m),required:(0,o.SU)(d),type:E.value?"text":"password","onUpdate:modelValue":n[0]||(n[0]=e=>_.value=e),minlength:"8",onInput:S,onInvalid:p},null,40,U),[[a.YZ,_.value]]),(0,t._)("div",{class:"show-password",onClick:T},[(0,t.Uk)((0,i.zw)(e.$t(`user.${E.value?"HIDE":"SHOW"}_PASSWORD`))+" ",1),(0,t._)("i",{class:(0,i.C_)(["fa","fa-eye"+(E.value?"-slash":"")]),"aria-hidden":"true"},null,2)]),(0,o.SU)(s)?((0,t.wg)(),(0,t.iD)("div",C,[D,(0,t.Uk)(" "+(0,i.zw)(e.$t("user.PASSWORD_INFO")),1)])):(0,t.kq)("",!0),(0,o.SU)(s)?((0,t.wg)(),(0,t.j4)(R,{key:1,password:_.value},null,8,["password"])):(0,t.kq)("",!0)]))}});const v=(0,O.Z)(h,[["__scopeId","data-v-5a126514"]]);var P=v},2056:function(e,n,r){"use strict";r.d(n,{Z:function(){return u}});var t=r(6252),o=r(3577),a=r(2262),i=r(2024);const s=(0,t._)("div",{class:"map-attribution"},[(0,t._)("span",{class:"map-attribution-text"},"©"),(0,t._)("a",{class:"map-attribution-text",href:"https://www.openstreetmap.org/copyright",target:"_blank",rel:"noopener noreferrer"}," OpenStreetMap ")],-1);var l=(0,t.aZ)({__name:"StaticMap",props:{workout:null,displayHover:{type:Boolean,default:!1}},setup(e){const n=e,{displayHover:r}=(0,a.BK)(n),l=`${(0,i.k)()}workouts/map/${n.workout.map}`;return(e,n)=>((0,t.wg)(),(0,t.iD)("div",{class:(0,o.C_)(["static-map",{"display-hover":(0,a.SU)(r)}])},[(0,a.SU)(r)?((0,t.wg)(),(0,t.iD)("img",{key:0,src:l,alt:""})):((0,t.wg)(),(0,t.iD)("div",{key:1,class:"bg-map-image",style:(0,o.j5)({backgroundImage:`url(${l})`})},null,4)),s],2))}});const c=l;var u=c},436:function(e,n,r){"use strict";r.d(n,{Z:function(){return y}});var t=r(6252),o=r(3577);const a={class:"start-chart"},i={key:0},s={key:1},l={class:"chart-radio"},c=["checked"],u=["checked"],m=["checked"],d={key:0},E=["checked"],_={key:1},T=["checked"],S={key:2},p=["checked"];function A(e,n,r,A,z,O){const I=(0,t.up)("Chart");return(0,t.wg)(),(0,t.iD)("div",a,[e.hideChartIfNoData&&e.emptyStats?((0,t.wg)(),(0,t.iD)("div",i,(0,o.zw)(e.$t("workouts.NO_WORKOUTS")),1)):((0,t.wg)(),(0,t.iD)("div",s,[(0,t._)("div",l,[(0,t._)("label",null,[(0,t._)("input",{type:"radio",name:"total_distance",checked:"total_distance"===e.displayedData,onClick:n[0]||(n[0]=(...n)=>e.updateDisplayData&&e.updateDisplayData(...n))},null,8,c),(0,t.Uk)(" "+(0,o.zw)(e.$t("workouts.DISTANCE")),1)]),(0,t._)("label",null,[(0,t._)("input",{type:"radio",name:"total_duration",checked:"total_duration"===e.displayedData,onClick:n[1]||(n[1]=(...n)=>e.updateDisplayData&&e.updateDisplayData(...n))},null,8,u),(0,t.Uk)(" "+(0,o.zw)(e.$t("workouts.DURATION")),1)]),(0,t._)("label",null,[(0,t._)("input",{type:"radio",name:"nb_workouts",checked:"nb_workouts"===e.displayedData,onClick:n[2]||(n[2]=(...n)=>e.updateDisplayData&&e.updateDisplayData(...n))},null,8,m),(0,t.Uk)(" "+(0,o.zw)(e.$t("workouts.WORKOUT",2)),1)]),e.fullStats?((0,t.wg)(),(0,t.iD)("label",d,[(0,t._)("input",{type:"radio",name:"average_speed",checked:"average_speed"===e.displayedData,onClick:n[3]||(n[3]=(...n)=>e.updateDisplayData&&e.updateDisplayData(...n))},null,8,E),(0,t.Uk)(" "+(0,o.zw)(e.$t("workouts.AVERAGE_SPEED")),1)])):(0,t.kq)("",!0),e.fullStats?((0,t.wg)(),(0,t.iD)("label",_,[(0,t._)("input",{type:"radio",name:"total_ascent",checked:"total_ascent"===e.displayedData,onClick:n[4]||(n[4]=(...n)=>e.updateDisplayData&&e.updateDisplayData(...n))},null,8,T),(0,t.Uk)(" "+(0,o.zw)(e.$t("workouts.ASCENT")),1)])):(0,t.kq)("",!0),e.fullStats?((0,t.wg)(),(0,t.iD)("label",S,[(0,t._)("input",{type:"radio",name:"total_descent",checked:"total_descent"===e.displayedData,onClick:n[5]||(n[5]=(...n)=>e.updateDisplayData&&e.updateDisplayData(...n))},null,8,p),(0,t.Uk)(" "+(0,o.zw)(e.$t("workouts.DESCENT")),1)])):(0,t.kq)("",!0)]),e.labels.length>0?((0,t.wg)(),(0,t.j4)(I,{key:0,datasets:e.datasets,labels:e.labels,displayedData:e.displayedData,displayedSportIds:e.displayedSportIds,fullStats:e.fullStats,useImperialUnits:e.user.imperial_units},null,8,["datasets","labels","displayedData","displayedSportIds","fullStats","useImperialUnits"])):(0,t.kq)("",!0)]))])}var z=r(6761),O=r(2262);const I={class:"chart"};function R(e,n,r,o,a,i){const s=(0,t.up)("BarChart");return(0,t.wg)(),(0,t.iD)("div",I,[(0,t.Wm)(s,(0,t.dG)(e.barChartProps,{class:"bar-chart"}),null,16)])}var N=r(6518),g=r(9150);const U=(e,n=!1)=>{let r="0";n&&(r=String(Math.floor(e/86400)),e%=86400);const t=String(Math.floor(e/3600)).padStart(2,"0");e%=3600;const o=String(Math.floor(e/60)).padStart(2,"0"),a=String(e%60).padStart(2,"0");return n?`${"0"===r?"":`${r}d `}${"00"===t?"":`${t}h `}${o}m ${a}s`:`${"00"===t?"":`${t}:`}${o}:${a}`};var C=r(3649);const D=(e,n,r,t=!0,o="km")=>{const a=r?C.Dl[o].defaultTarget:o;switch(e){case"average_speed":return`${n.toFixed(2)} ${a}/h`;case"total_duration":return U(n,t);case"total_distance":case"total_ascent":case"total_descent":return`${n.toFixed(2)} ${a}`;default:return n.toString()}};var h=(0,t.aZ)({name:"Chart",components:{BarChart:N.vz},props:{datasets:{type:Object,required:!0},labels:{type:Object,required:!0},displayedData:{type:String,required:!0},displayedSportIds:{type:Array,required:!0},fullStats:{type:Boolean,required:!0},useImperialUnits:{type:Boolean,required:!0}},setup(e){const{t:n}=(0,g.QT)();function r(e){return isNaN(e)?0:+e}function o(e,n){return r(e)+r(n)}function a(e){return["total_ascent","total_descent"].includes(e)?"m":"km"}const i=(0,t.Fl)((()=>({labels:e.labels,datasets:JSON.parse(JSON.stringify(e.datasets))}))),s=(0,t.Fl)((()=>({responsive:!0,maintainAspectRatio:!0,animation:!1,layout:{padding:{top:e.fullStats?40:22}},scales:{x:{stacked:!0,grid:{drawOnChartArea:!1}},y:{stacked:"average_speed"!==e.displayedData,grid:{drawOnChartArea:!1},ticks:{maxTicksLimit:6,callback:function(n){return D(e.displayedData,+n,e.useImperialUnits,!1,a(e.displayedData))}},afterFit:function(n){n.width=e.fullStats?90:60}}},plugins:{datalabels:{anchor:"end",align:"end",color:function(n){return"average_speed"===e.displayedData&&n.dataset.backgroundColor?n.dataset.backgroundColor[0]:"#666666"},rotation:function(n){return e.fullStats&&n.chart.chartArea.width<580?310:0},display:function(n){return!(e.fullStats&&n.chart.chartArea.width<300)&&("average_speed"!==e.displayedData||1==e.displayedSportIds.length&&"auto")},formatter:function(n,r){if("average_speed"===e.displayedData)return D(e.displayedData,n,e.useImperialUnits,!1);{const n=r.chart.data.datasets.map((e=>e.data[r.dataIndex])).reduce(((e,n)=>o(e,n)),0);return r.datasetIndex===e.displayedSportIds.length-1&&n>0?D(e.displayedData,n,e.useImperialUnits,!1,a(e.displayedData)):null}}},legend:{display:!1},tooltip:{interaction:{intersect:!0,mode:"index",position:"average_speed"===e.displayedData?"nearest":"average"},filter:function(e){return"0"!==e.formattedValue},callbacks:{label:function(r){let t=n(`sports.${r.dataset.label}.LABEL`)||"";return t&&(t+=": "),null!==r.parsed.y&&(t+=D(e.displayedData,r.parsed.y,e.useImperialUnits,!0,a(e.displayedData))),t},footer:function(r){if("average_speed"===e.displayedData)return"";let t=0;return r.map((e=>{t+=e.parsed.y})),`${n("common.TOTAL")}: `+D(e.displayedData,t,e.useImperialUnits,!0,a(e.displayedData))}}}}}))),{barChartProps:l}=(0,N.xZ)({chartData:i,options:s});return{barChartProps:l}}}),v=r(3744);const P=(0,v.Z)(h,[["render",R]]);var f=P,L=r(5801),w=r(9917),k=r(9318),b=(0,t.aZ)({name:"UserMonthStats",components:{Chart:f},props:{sports:{type:Object,required:!0},user:{type:Object,required:!0},chartParams:{type:Object,required:!0},displayedSportIds:{type:Array,default:()=>[]},fullStats:{type:Boolean,default:!1},hideChartIfNoData:{type:Boolean,default:!1}},setup(e){const n=(0,w.o)(),r=(0,O.iH)("total_distance"),o=(0,t.Fl)((()=>n.getters[L.gu.GETTERS.USER_STATS])),a=(0,t.Fl)((()=>(0,k.v1)(e.chartParams,e.user.weekm,e.sports,e.displayedSportIds,o.value,e.user.imperial_units,e.user.date_format)));function i(r){n.dispatch(L.gu.ACTIONS.GET_USER_STATS,{username:e.user.username,filterType:"by_time",params:r})}function s(e){r.value=e.target.name}function l(e,n){return{from:(0,z.Z)(e.start,"yyyy-MM-dd"),to:(0,z.Z)(e.end,"yyyy-MM-dd"),time:"week"===e.duration?"week"+(n.weekm?"m":""):e.duration}}return(0,t.wF)((()=>i(l(e.chartParams,e.user)))),(0,t.YP)((()=>e.chartParams),(async n=>{i(l(n,e.user))})),{datasets:(0,t.Fl)((()=>a.value.datasets[r.value])),labels:(0,t.Fl)((()=>a.value.labels)),emptyStats:(0,t.Fl)((()=>0===Object.keys(o.value).length)),displayedData:r,updateDisplayData:s}}});const M=(0,v.Z)(b,[["render",A],["__scopeId","data-v-d5e9b348"]]);var y=M},2179:function(e,n,r){"use strict";r.d(n,{Z:function(){return g}});var t=r(6252),o=r(2262),a=r(3577),i=r(6595),s=r(5801),l=r(9917);const c={class:"box user-header"},u={class:"user-details"},m={class:"user-name"},d={class:"user-stats"},E={class:"user-stat"},_={class:"stat-number"},T={class:"stat-label"},S={class:"user-stat"},p={class:"stat-label"},A={class:"user-stat hide-small"},z={class:"stat-number"},O={class:"stat-label"};var I=(0,t.aZ)({__name:"UserHeader",props:{user:null},setup(e){const n=e,{user:r}=(0,o.BK)(n),I=(0,l.o)(),R=(0,t.Fl)((()=>I.getters[s.YN.GETTERS.AUTH_USER_PROFILE]));return(e,n)=>{const s=(0,t.up)("Distance");return(0,t.wg)(),(0,t.iD)("div",c,[(0,t.Wm)(i.Z,{user:(0,o.SU)(r)},null,8,["user"]),(0,t._)("div",u,[(0,t._)("div",m,(0,a.zw)((0,o.SU)(r).username),1),(0,t._)("div",d,[(0,t._)("div",E,[(0,t._)("span",_,(0,a.zw)((0,o.SU)(r).nb_workouts),1),(0,t._)("span",T,(0,a.zw)(e.$t("workouts.WORKOUT",(0,o.SU)(r).nb_workouts)),1)]),(0,t._)("div",S,[(0,t.Wm)(s,{distance:(0,o.SU)(r).total_distance,unitFrom:"km",digits:0,displayUnit:!1,useImperialUnits:(0,o.SU)(R).imperial_units},null,8,["distance","useImperialUnits"]),(0,t._)("span",p,(0,a.zw)((0,o.SU)(R).imperial_units?"miles":"km"),1)]),(0,t._)("div",A,[(0,t._)("span",z,(0,a.zw)((0,o.SU)(r).nb_sports),1),(0,t._)("span",O,(0,a.zw)(e.$t("workouts.SPORT",(0,o.SU)(r).nb_sports)),1)])])])])}}}),R=r(3744);const N=(0,R.Z)(I,[["__scopeId","data-v-20291951"]]);var g=N},1585:function(e,n,r){"use strict";r.d(n,{Z:function(){return h}});r(7658);var t=r(6252),o=r(2262),a=r(3577),i=r(9963),s=r(6761),l=r(5801),c=r(9917),u=r(6558),m=r(6287);const d={id:"user-infos",class:"description-list"},E={key:1,class:"info-box success-message"},_={key:4,class:"email-form form-box"},T={class:"form-items",for:"email"},S={class:"form-items",for:"email"},p={class:"form-buttons"},A={class:"confirm",type:"submit"},z=["onClick"],O={key:5},I={class:"user-bio"},R={key:0,class:"profile-buttons"},N=["onClick"],g={key:1,class:"profile-buttons"};var U=(0,t.aZ)({__name:"UserInfos",props:{user:null,fromAdmin:{type:Boolean,default:!1}},setup(e){const n=e,r=(0,c.o)(),{user:U,fromAdmin:C}=(0,o.BK)(n),D=(0,t.Fl)((()=>r.getters[l.SY.GETTERS.LANGUAGE])),h=(0,t.Fl)((()=>r.getters[l.YN.GETTERS.AUTH_USER_PROFILE])),v=(0,t.Fl)((()=>n.user.created_at?(0,u.p6)(n.user.created_at,h.value.timezone,h.value.date_format):"")),P=(0,t.Fl)((()=>n.user.birth_date?(0,s.Z)(new Date(n.user.birth_date),`${(0,u.mh)(h.value.date_format,D.value)}`,{locale:m.v1[D.value]}):"")),f=(0,t.Fl)((()=>r.getters[l.RT.GETTERS.USERS_IS_SUCCESS])),L=(0,t.Fl)((()=>r.getters[l.SY.GETTERS.ERROR_MESSAGES])),w=(0,t.Fl)((()=>r.getters[l.SY.GETTERS.APP_CONFIG])),k=(0,o.iH)(""),b=(0,o.iH)(!1),M=(0,o.iH)(!1),y=(0,o.iH)(""),G=(0,o.iH)("");function F(e){k.value=e,""!==e&&r.commit(l.RT.MUTATIONS.UPDATE_IS_SUCCESS,!1)}function W(e){r.dispatch(l.RT.ACTIONS.DELETE_USER_ACCOUNT,{username:e})}function B(e){G.value="password-reset",r.dispatch(l.RT.ACTIONS.UPDATE_USER,{username:e,resetPassword:!0})}function Y(e){r.dispatch(l.RT.ACTIONS.UPDATE_USER,{username:e,activate:!0})}function x(){V(),y.value=U.value.email_to_confirm?U.value.email_to_confirm:"",M.value=!0,G.value="email-update"}function K(){y.value="",M.value=!1}function H(e){r.dispatch(l.RT.ACTIONS.UPDATE_USER,{username:e,new_email:y.value})}function V(){r.commit(l.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),r.commit(l.RT.MUTATIONS.UPDATE_IS_SUCCESS,!1),G.value=""}return(0,t.Ah)((()=>V())),(0,t.YP)((()=>f.value),(e=>{e&&(F(""),K())})),(e,n)=>{const r=(0,t.up)("Modal"),s=(0,t.up)("AlertMessage"),l=(0,t.up)("ErrorMessage");return(0,t.wg)(),(0,t.iD)("div",d,[k.value?((0,t.wg)(),(0,t.j4)(r,{key:0,title:e.$t("common.CONFIRMATION"),message:"delete"===k.value?"admin.CONFIRM_USER_ACCOUNT_DELETION":"admin.CONFIRM_USER_PASSWORD_RESET",strongMessage:(0,o.SU)(U).username,onConfirmAction:n[0]||(n[0]=e=>"delete"===k.value?W((0,o.SU)(U).username):B((0,o.SU)(U).username)),onCancelAction:n[1]||(n[1]=e=>F(""))},null,8,["title","message","strongMessage"])):(0,t.kq)("",!0),(0,o.SU)(f)?((0,t.wg)(),(0,t.iD)("div",E,(0,a.zw)(e.$t(`admin.${"password-reset"===G.value?"PASSWORD_RESET":"USER_EMAIL_UPDATE"}_SUCCESSFUL`)),1)):(0,t.kq)("",!0),(0,o.SU)(U).is_active?(0,t.kq)("",!0):((0,t.wg)(),(0,t.j4)(s,{key:2,message:"user.THIS_USER_ACCOUNT_IS_INACTIVE"})),(0,o.SU)(L)?((0,t.wg)(),(0,t.j4)(l,{key:3,message:(0,o.SU)(L)},null,8,["message"])):(0,t.kq)("",!0),M.value?((0,t.wg)(),(0,t.iD)("div",_,[(0,t._)("form",{class:(0,a.C_)({errors:b.value}),onSubmit:n[4]||(n[4]=(0,i.iM)((e=>H((0,o.SU)(U).username)),["prevent"]))},[(0,t._)("label",T,[(0,t.Uk)((0,a.zw)(e.$t("admin.CURRENT_EMAIL"))+" ",1),(0,t.wy)((0,t._)("input",{id:"email",type:"email","onUpdate:modelValue":n[2]||(n[2]=e=>(0,o.SU)(U).email=e),disabled:""},null,512),[[i.nr,(0,o.SU)(U).email]])]),(0,t._)("label",S,[(0,t.Uk)((0,a.zw)(e.$t("admin.NEW_EMAIL"))+"* ",1),(0,t.wy)((0,t._)("input",{id:"new-email",type:"email",required:"","onUpdate:modelValue":n[3]||(n[3]=e=>y.value=e)},null,512),[[i.nr,y.value]])]),(0,t._)("div",p,[(0,t._)("button",A,(0,a.zw)(e.$t("buttons.SUBMIT")),1),(0,t._)("button",{class:"cancel",onClick:(0,i.iM)(K,["prevent"])},(0,a.zw)(e.$t("buttons.CANCEL")),9,z)])],34)])):((0,t.wg)(),(0,t.iD)("div",O,[(0,t._)("dl",null,[(0,t._)("dt",null,(0,a.zw)(e.$t("user.PROFILE.REGISTRATION_DATE"))+":",1),(0,t._)("dd",null,(0,a.zw)((0,o.SU)(v)),1),(0,t._)("dt",null,(0,a.zw)(e.$t("user.PROFILE.FIRST_NAME"))+":",1),(0,t._)("dd",null,(0,a.zw)((0,o.SU)(U).first_name),1),(0,t._)("dt",null,(0,a.zw)(e.$t("user.PROFILE.LAST_NAME"))+":",1),(0,t._)("dd",null,(0,a.zw)((0,o.SU)(U).last_name),1),(0,t._)("dt",null,(0,a.zw)(e.$t("user.PROFILE.BIRTH_DATE"))+":",1),(0,t._)("dd",null,(0,a.zw)((0,o.SU)(P)),1),(0,t._)("dt",null,(0,a.zw)(e.$t("user.PROFILE.LOCATION"))+":",1),(0,t._)("dd",null,(0,a.zw)((0,o.SU)(U).location),1),(0,t._)("dt",null,(0,a.zw)(e.$t("user.PROFILE.BIO"))+":",1),(0,t._)("dd",I,(0,a.zw)((0,o.SU)(U).bio),1)]),(0,o.SU)(C)?((0,t.wg)(),(0,t.iD)("div",R,[(0,o.SU)(h).username!==(0,o.SU)(U).username?((0,t.wg)(),(0,t.iD)("button",{key:0,class:"danger",onClick:n[5]||(n[5]=(0,i.iM)((e=>F("delete")),["prevent"]))},(0,a.zw)(e.$t("admin.DELETE_USER")),1)):(0,t.kq)("",!0),(0,o.SU)(U).is_active?(0,t.kq)("",!0):((0,t.wg)(),(0,t.iD)("button",{key:1,onClick:n[6]||(n[6]=(0,i.iM)((e=>Y((0,o.SU)(U).username)),["prevent"]))},(0,a.zw)(e.$t("admin.ACTIVATE_USER_ACCOUNT")),1)),(0,o.SU)(h).username!==(0,o.SU)(U).username?((0,t.wg)(),(0,t.iD)("button",{key:2,onClick:(0,i.iM)(x,["prevent"])},(0,a.zw)(e.$t("admin.UPDATE_USER_EMAIL")),9,N)):(0,t.kq)("",!0),(0,o.SU)(h).username!==(0,o.SU)(U).username&&(0,o.SU)(w).is_email_sending_enabled?((0,t.wg)(),(0,t.iD)("button",{key:3,onClick:n[7]||(n[7]=(0,i.iM)((e=>F("reset")),["prevent"]))},(0,a.zw)(e.$t("admin.RESET_USER_PASSWORD")),1)):(0,t.kq)("",!0),(0,t._)("button",{onClick:n[8]||(n[8]=n=>e.$router.go(-1))},(0,a.zw)(e.$t("buttons.BACK")),1)])):((0,t.wg)(),(0,t.iD)("div",g,[(0,t._)("button",{onClick:n[9]||(n[9]=n=>e.$router.push("/profile/edit"))},(0,a.zw)(e.$t("user.PROFILE.EDIT")),1),(0,t._)("button",{onClick:n[10]||(n[10]=n=>e.$router.push("/"))},(0,a.zw)(e.$t("common.HOME")),1)]))]))])}}}),C=r(3744);const D=(0,C.Z)(U,[["__scopeId","data-v-217519af"]]);var h=D},776:function(e,n,r){"use strict";r.d(n,{Z:function(){return L}});var t=r(6252),o=r(3577),a=r(2262),i=r(9963),s=r(2201),l=r(8403),c=r(5801),u=r(9917);const m=e=>((0,t.dD)("data-v-4f112f24"),e=e(),(0,t.Cn)(),e),d={id:"user-form"},E={key:2,class:"info-box success-message"},_={class:"form-items"},T=["disabled","placeholder"],S={key:1,class:"form-info"},p=m((()=>(0,t._)("i",{class:"fa fa-info-circle","aria-hidden":"true"},null,-1))),A=["disabled","placeholder"],z={key:3,class:"form-info"},O=m((()=>(0,t._)("i",{class:"fa fa-info-circle","aria-hidden":"true"},null,-1))),I={key:5,for:"accepted_policy",class:"accepted_policy"},R=["disabled"],N=["disabled"],g={key:3},U={key:0},C={key:4},D={class:"account"},h={key:5};var v=(0,t.aZ)({__name:"UserAuthForm",props:{action:null,token:{default:""}},setup(e){const n=e,r=(0,s.yj)(),m=(0,u.o)(),{action:v}=(0,a.BK)(n),P=(0,a.qj)({username:"",email:"",password:"",accepted_policy:!1}),f=(0,t.Fl)((()=>W(n.action))),L=(0,t.Fl)((()=>m.getters[c.SY.GETTERS.ERROR_MESSAGES])),w=(0,t.Fl)((()=>m.getters[c.YN.GETTERS.IS_REGISTRATION_SUCCESS])),k=(0,t.Fl)((()=>m.getters[c.YN.GETTERS.IS_SUCCESS])),b=(0,t.Fl)((()=>m.getters[c.SY.GETTERS.APP_CONFIG])),M=(0,t.Fl)((()=>m.getters[c.SY.GETTERS.LANGUAGE])),y=(0,t.Fl)((()=>"register"===n.action&&!b.value.is_registration_enabled)),G=(0,t.Fl)((()=>["reset-request","account-confirmation-resend"].includes(n.action)&&!b.value.is_email_sending_enabled)),F=(0,a.iH)(!1);function W(e){switch(e){case"reset-request":case"reset":return"buttons.SUBMIT";default:return`buttons.${n.action.toUpperCase()}`}}function B(){F.value=!0}function Y(e){P.password=e}function x(e){switch(e){case"reset":return n.token?m.dispatch(c.YN.ACTIONS.RESET_USER_PASSWORD,{password:P.password,token:n.token}):m.commit(c.SY.MUTATIONS.SET_ERROR_MESSAGES,"user.INVALID_TOKEN");case"reset-request":return m.dispatch(c.YN.ACTIONS.SEND_PASSWORD_RESET_REQUEST,{email:P.email});case"account-confirmation-resend":return m.dispatch(c.YN.ACTIONS.RESEND_ACCOUNT_CONFIRMATION_EMAIL,{email:P.email});default:P["language"]=M.value,m.dispatch(c.YN.ACTIONS.LOGIN_OR_REGISTER,{actionType:e,formData:P,redirectUrl:r.query.from})}}function K(){P.username="",P.email="",P.password="",P.accepted_policy=!1}return(0,t.Ah)((()=>m.commit(c.SY.MUTATIONS.EMPTY_ERROR_MESSAGES))),(0,t.YP)((()=>r.path),(async()=>{m.commit(c.SY.MUTATIONS.EMPTY_ERROR_MESSAGES),m.commit(c.YN.MUTATIONS.UPDATE_IS_SUCCESS,!1),m.commit(c.YN.MUTATIONS.UPDATE_IS_REGISTRATION_SUCCESS,!1),F.value=!1,K()})),(e,n)=>{const r=(0,t.up)("AlertMessage"),s=(0,t.up)("router-link"),c=(0,t.up)("i18n-t"),u=(0,t.up)("ErrorMessage");return(0,t.wg)(),(0,t.iD)("div",{id:"user-auth-form",class:(0,o.C_)(`${["reset","reset-request"].includes((0,a.SU)(v))?(0,a.SU)(v):"user-form"}`)},[(0,t._)("div",d,[(0,t._)("div",{class:(0,o.C_)(["form-box",{disabled:(0,a.SU)(y)}])},[(0,a.SU)(y)?((0,t.wg)(),(0,t.j4)(r,{key:0,message:"user.REGISTER_DISABLED"})):(0,t.kq)("",!0),(0,a.SU)(G)?((0,t.wg)(),(0,t.j4)(r,{key:1,message:"admin.EMAIL_SENDING_DISABLED"})):(0,t.kq)("",!0),(0,a.SU)(k)||(0,a.SU)(w)?((0,t.wg)(),(0,t.iD)("div",E,(0,o.zw)(e.$t("user.PROFILE.SUCCESSFUL_"+((0,a.SU)(w)?"REGISTRATION"+((0,a.SU)(b).is_email_sending_enabled?"_WITH_EMAIL":""):"UPDATE"))),1)):(0,t.kq)("",!0),(0,t._)("form",{class:(0,o.C_)({errors:F.value}),onSubmit:n[3]||(n[3]=(0,i.iM)((e=>x((0,a.SU)(v))),["prevent"]))},[(0,t._)("div",_,["register"===(0,a.SU)(v)?(0,t.wy)(((0,t.wg)(),(0,t.iD)("input",{key:0,id:"username",disabled:(0,a.SU)(y),required:"",pattern:"[a-zA-Z0-9_]+",minlength:"3",maxlength:"30",onInvalid:B,"onUpdate:modelValue":n[0]||(n[0]=e=>P.username=e),placeholder:e.$t("user.USERNAME")},null,40,T)),[[i.nr,P.username]]):(0,t.kq)("",!0),"register"===(0,a.SU)(v)?((0,t.wg)(),(0,t.iD)("div",S,[p,(0,t.Uk)(" "+(0,o.zw)(e.$t("user.USERNAME_INFO")),1)])):(0,t.kq)("",!0),"reset"!==(0,a.SU)(v)?(0,t.wy)(((0,t.wg)(),(0,t.iD)("input",{key:2,id:"email",disabled:(0,a.SU)(y)||(0,a.SU)(G),required:"",onInvalid:B,type:"email","onUpdate:modelValue":n[1]||(n[1]=e=>P.email=e),placeholder:e.$t("user.EMAIL")},null,40,A)),[[i.nr,P.email]]):(0,t.kq)("",!0),["reset-request","register","account-confirmation-resend"].includes((0,a.SU)(v))?((0,t.wg)(),(0,t.iD)("div",z,[O,(0,t.Uk)(" "+(0,o.zw)(e.$t("user.EMAIL_INFO")),1)])):(0,t.kq)("",!0),["account-confirmation-resend","reset-request"].includes((0,a.SU)(v))?(0,t.kq)("",!0):((0,t.wg)(),(0,t.j4)(l.Z,{key:4,disabled:(0,a.SU)(y),required:!0,placeholder:"reset"===(0,a.SU)(v)?e.$t("user.ENTER_PASSWORD"):e.$t("user.PASSWORD"),password:P.password,checkStrength:["reset","register"].includes((0,a.SU)(v)),onUpdatePassword:Y,onPasswordError:B},null,8,["disabled","placeholder","password","checkStrength"])),"register"===(0,a.SU)(v)?((0,t.wg)(),(0,t.iD)("label",I,[(0,t.wy)((0,t._)("input",{type:"checkbox",id:"accepted_policy",disabled:(0,a.SU)(y),required:"",onInvalid:B,"onUpdate:modelValue":n[2]||(n[2]=e=>P.accepted_policy=e)},null,40,R),[[i.e8,P.accepted_policy]]),(0,t._)("span",null,[(0,t.Wm)(c,{keypath:"user.READ_AND_ACCEPT_PRIVACY_POLICY"},{default:(0,t.w5)((()=>[(0,t.Wm)(s,{to:"/privacy-policy",target:"_blank"},{default:(0,t.w5)((()=>[(0,t.Uk)((0,o.zw)(e.$t("privacy_policy.TITLE")),1)])),_:1})])),_:1})])])):(0,t.kq)("",!0)]),(0,t._)("button",{type:"submit",disabled:(0,a.SU)(y)||(0,a.SU)(G)},(0,o.zw)(e.$t((0,a.SU)(f))),9,N)],34),"login"===(0,a.SU)(v)?((0,t.wg)(),(0,t.iD)("div",g,[(0,t.Wm)(s,{class:"links",to:"/register"},{default:(0,t.w5)((()=>[(0,t.Uk)((0,o.zw)(e.$t("user.REGISTER")),1)])),_:1}),(0,a.SU)(b).is_email_sending_enabled?((0,t.wg)(),(0,t.iD)("span",U,"-")):(0,t.kq)("",!0),(0,a.SU)(b).is_email_sending_enabled?((0,t.wg)(),(0,t.j4)(s,{key:1,class:"links",to:"/password-reset/request"},{default:(0,t.w5)((()=>[(0,t.Uk)((0,o.zw)(e.$t("user.PASSWORD_FORGOTTEN")),1)])),_:1})):(0,t.kq)("",!0)])):(0,t.kq)("",!0),"register"===(0,a.SU)(v)?((0,t.wg)(),(0,t.iD)("div",C,[(0,t._)("span",D,(0,o.zw)(e.$t("user.ALREADY_HAVE_ACCOUNT")),1),(0,t.Wm)(s,{class:"links",to:"/login"},{default:(0,t.w5)((()=>[(0,t.Uk)((0,o.zw)(e.$t("user.LOGIN")),1)])),_:1})])):(0,t.kq)("",!0),["login","register"].includes((0,a.SU)(v))&&(0,a.SU)(b).is_email_sending_enabled?((0,t.wg)(),(0,t.iD)("div",h,[(0,t.Wm)(s,{class:"links",to:"/account-confirmation/resend"},{default:(0,t.w5)((()=>[(0,t.Uk)((0,o.zw)(e.$t("user.ACCOUNT_CONFIRMATION_NOT_RECEIVED")),1)])),_:1})])):(0,t.kq)("",!0),(0,a.SU)(L)?((0,t.wg)(),(0,t.j4)(u,{key:6,message:(0,a.SU)(L)},null,8,["message"])):(0,t.kq)("",!0)],2)])],2)}}}),P=r(3744);const f=(0,P.Z)(v,[["__scopeId","data-v-4f112f24"]]);var L=f},6595:function(e,n,r){"use strict";r.d(n,{Z:function(){return E}});var t=r(6252),o=r(2262),a=r(2024);const i={class:"user-picture"},s=["alt","src"],l={key:1,class:"no-picture"},c=(0,t._)("i",{class:"fa fa-user-circle-o","aria-hidden":"true"},null,-1),u=[c];var m=(0,t.aZ)({__name:"UserPicture",props:{user:null},setup(e){const n=e,r=(0,t.Fl)((()=>n.user.picture?`${(0,a.k)()}users/${n.user.username}/picture?${Date.now()}`:""));return(e,n)=>((0,t.wg)(),(0,t.iD)("div",i,[""!==(0,o.SU)(r)?((0,t.wg)(),(0,t.iD)("img",{key:0,class:"profile-user-img",alt:e.$t("user.USER_PICTURE"),src:(0,o.SU)(r)},null,8,s)):((0,t.wg)(),(0,t.iD)("div",l,u))]))}});const d=m;var E=d},5630:function(e,n,r){"use strict";r.d(n,{Z:function(){return u}});var t=r(6252),o=r(3577);const a={class:"no-workouts box"};function i(e,n){const r=(0,t.up)("router-link");return(0,t.wg)(),(0,t.iD)("div",a,[(0,t._)("div",null,[(0,t.Uk)((0,o.zw)(e.$t("workouts.NO_WORKOUTS"))+" ",1),(0,t.Wm)(r,{to:"/workouts/add"},{default:(0,t.w5)((()=>[(0,t.Uk)((0,o.zw)(e.$t("workouts.UPLOAD_FIRST_WORKOUT")),1)])),_:1})])])}var s=r(3744);const l={},c=(0,s.Z)(l,[["render",i],["__scopeId","data-v-4b4d15fb"]]);var u=c},4612:function(e,n,r){var t={"./de/de.ts":3010,"./en/en.ts":2709,"./es/es.ts":3429,"./fr/fr.ts":5479,"./gl/gl.ts":6338,"./it/it.ts":6013,"./nb/nb.ts":1901,"./nl/nl.ts":3726,"./pl/pl.ts":5381};function o(e){var n=a(e);return r(n)}function a(e){if(!r.o(t,e)){var n=new Error("Cannot find module '"+e+"'");throw n.code="MODULE_NOT_FOUND",n}return t[e]}o.keys=function(){return Object.keys(t)},o.resolve=a,e.exports=o,o.id=4612},5347:function(){},1777:function(){},4017:function(){},9905:function(){},4604:function(){}},n={};function r(t){var o=n[t];if(void 0!==o)return o.exports;var a=n[t]={exports:{}};return e[t].call(a.exports,a,a.exports,r),a.exports}r.m=e,function(){var e=[];r.O=function(n,t,o,a){if(!t){var i=1/0;for(u=0;u=a)&&Object.keys(r.O).every((function(e){return r.O[e](t[l])}))?t.splice(l--,1):(s=!1,a0&&e[u-1][2]>a;u--)e[u]=e[u-1];e[u]=[t,o,a]}}(),function(){r.n=function(e){var n=e&&e.__esModule?function(){return e["default"]}:function(){return e};return r.d(n,{a:n}),n}}(),function(){var e,n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__};r.t=function(t,o){if(1&o&&(t=this(t)),8&o)return t;if("object"===typeof t&&t){if(4&o&&t.__esModule)return t;if(16&o&&"function"===typeof t.then)return t}var a=Object.create(null);r.r(a);var i={};e=e||[null,n({}),n([]),n(n)];for(var s=2&o&&t;"object"==typeof s&&!~e.indexOf(s);s=n(s))Object.getOwnPropertyNames(s).forEach((function(e){i[e]=function(){return t[e]}}));return i["default"]=function(){return t},r.d(a,i),a}}(),function(){r.d=function(e,n){for(var t in n)r.o(n,t)&&!r.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:n[t]})}}(),function(){r.f={},r.e=function(e){return Promise.all(Object.keys(r.f).reduce((function(n,t){return r.f[t](e,n),n}),[]))}}(),function(){r.u=function(e){return"static/js/"+({24:"reset",193:"statistics",222:"password.fr",261:"password.en",328:"admin",394:"password.es",401:"workouts",802:"password.it",845:"profile",881:"password",940:"password.de",946:"password.pl"}[e]||e)+"."+{24:"a3db17a0",93:"df2db3a3",193:"ec64386f",222:"eca0ec1d",243:"03fdd6a3",261:"4b788215",328:"757bc8af",394:"0fdfd7ae",401:"edf44ecf",431:"e117da19",633:"3c920340",802:"9fae932a",845:"d4857496",858:"8fd585ad",881:"b8efc50f",940:"d164c0cb",946:"d10f76b2"}[e]+".js"}}(),function(){r.miniCssF=function(e){return"static/css/"+{24:"reset",193:"statistics",328:"admin",401:"workouts",845:"profile"}[e]+"."+{24:"e2527ec6",193:"40e24e75",328:"73df498d",401:"66742279",845:"567acd35"}[e]+".css"}}(),function(){r.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}()}(),function(){r.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)}}(),function(){var e={},n="fittrackee_client:";r.l=function(t,o,a,i){if(e[t])e[t].push(o);else{var s,l;if(void 0!==a)for(var c=document.getElementsByTagName("script"),u=0;u {\n const controller = new AbortController()\n config.signal = controller.signal\n const requestKey = removeRequestIfPending(config)\n pendingRequests.set(requestKey, controller)\n\n const authToken = store.getters[AUTH_USER_STORE.GETTERS.AUTH_TOKEN]\n if (authToken) {\n const auth = `Bearer ${authToken}`\n if (config.headers && config.headers.Authorization !== auth) {\n config.headers.Authorization = `Bearer ${authToken}`\n }\n }\n return config\n },\n (error) => Promise.reject(error)\n)\n\nauthApi.interceptors.response.use(\n (response) => {\n removeRequestIfPending(response.config)\n return response\n },\n (error) => {\n if (error.message !== 'canceled' && error.response) {\n removeRequestIfPending(error.response.config)\n }\n return Promise.reject(error)\n }\n)\n\nexport default authApi\n","import { AxiosRequestConfig } from 'axios'\n\nexport const pendingRequests = new Map()\n\nconst generateRequestKey = (config: AxiosRequestConfig): string => {\n const { method, url, params = {}, data = {} } = config\n return [method, url, JSON.stringify(params), JSON.stringify(data)].join('')\n}\n\nexport const removeRequestIfPending = (config: AxiosRequestConfig): string => {\n const requestKey = generateRequestKey(config)\n if (pendingRequests.has(requestKey)) {\n const controller = pendingRequests.get(requestKey) || {}\n controller?.abort()\n pendingRequests.delete(requestKey)\n }\n return requestKey\n}\n","import { createI18n, LocaleMessages, VueMessageType } from 'vue-i18n'\n\n/**\n * Load locale messages\n *\n * The loaded `JSON` locale messages is pre-compiled by `@intlify/vue-i18n-loader`, which is integrated into `vue-cli-plugin-i18n`.\n * See: https://github.com/intlify/vue-i18n-loader#rocket-i18n-resource-pre-compilation\n */\n\nfunction loadLocaleMessages(): Record> {\n const locales = require.context('./locales', true, /[A-Za-z0-9-_,\\s]+\\.ts$/i)\n const messages: Record> = {}\n locales.keys().forEach((key) => {\n const matched = key.match(/([A-Za-z0-9-_]+)\\./i)\n if (matched && matched.length > 1) {\n const locale = matched[1]\n messages[locale] = locales(key).default\n }\n })\n return messages\n}\n\nexport default createI18n({\n legacy: false,\n locale: 'en',\n fallbackLocale: 'en',\n globalInjection: true,\n messages: loadLocaleMessages(),\n})\n","export default {\n \"ABOUT_THIS_INSTANCE\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Über diese Instanz\"])},\n \"CONTACT_ADMIN\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Kontaktiere den Administrator\"])},\n \"FITTRACKEE_DESCRIPTION\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"FitTrackee ist ein selbst-gehosteter Outdoor-Aktivitäts-Tracker.\"])},\n \"FITTRACKEE_LICENSE\": (ctx) => {const { normalize: _normalize, interpolate: _interpolate, list: _list } = ctx;return _normalize([\"unter \", _interpolate(_list(0)), \" Lizenz \"])},\n \"SOURCE_CODE\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Quellcode\"])},\n \"WEATHER_DATA_FROM\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Wetterdaten von:\"])}\n}","export default {\n \"ABOUT\": {\n \"DESCRIPTION\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Zusätzliche Informationen, die für deine Nutzer nützlich sein könnten. Markdown-Syntax wird unterstützt.\"])},\n \"TEXT\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Detaillierte Instanz-Informationen\"])}\n },\n \"ACTION\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Aktion\"])},\n \"ACTIVATE_USER_ACCOUNT\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Aktiviere Konto\"])},\n \"ACTIVE\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Aktiv\"])},\n \"ADMIN\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Admin\"])},\n \"ADMINISTRATION\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Administration\"])},\n \"ADMIN_RIGHTS_DELETE_USER_ACCOUNT\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Hinzufügen/Entfernen von Administratorrechten, Lösche Nutzerkonto.\"])},\n \"APPLICATION\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Anwendung\"])},\n \"APP_CONFIG\": {\n \"ADMIN_CONTACT\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Kontakt-E-Mail des Administrators\"])},\n \"MAX_FILES_IN_ZIP_LABEL\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Max. Dateianzahl im zip Archiv\"])},\n \"MAX_USERS_HELP\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Wenn 0, gibt es keine Registrierungslimitierung..\"])},\n \"MAX_USERS_LABEL\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Max. Anzahl aktiver Nutzer\"])},\n \"NO_CONTACT_EMAIL\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"keine Kontakt-E-Mail\"])},\n \"SINGLE_UPLOAD_MAX_SIZE_LABEL\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Max. Größe der hochgeladenen Dateien (in Mb)\"])},\n \"TITLE\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Anwendungskonfiguration\"])},\n \"ZIP_UPLOAD_MAX_SIZE_LABEL\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Max. Größe des zip Archives (in Mb)\"])}\n },\n \"BACK_TO_ADMIN\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Zurück zu Admin\"])},\n \"CONFIRM_USER_ACCOUNT_DELETION\": (ctx) => {const { normalize: _normalize, interpolate: _interpolate, list: _list } = ctx;return _normalize([\"Möchtest du wirklich das \", _interpolate(_list(0)), \" Konto löschen? Alle Daten werden gelöscht. Dieser Vorgang kann nicht rückgängig gemacht werden.\"])},\n \"CONFIRM_USER_PASSWORD_RESET\": (ctx) => {const { normalize: _normalize, interpolate: _interpolate, list: _list } = ctx;return _normalize([\"Möchtest du wirklich das \", _interpolate(_list(0)), \" Passwort zurücksetzen?\"])},\n \"CURRENT_EMAIL\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Aktuelle E-Mail\"])},\n \"DELETE_USER\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Lösche Nutzer\"])},\n \"EMAIL_SENDING_DISABLED\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"E-Mail-Versand ist deaktiviert.\"])},\n \"ENABLE_DISABLE_SPORTS\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Aktivieren/Deaktivieren von Sportarten.\"])},\n \"NEW_EMAIL\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Neue E-Mail\"])},\n \"NO_TEXT_ENTERED\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Kein Text eingegeben\"])},\n \"PASSWORD_RESET_SUCCESSFUL\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Das wasswort wurde zurückgesetzt.\"])},\n \"PRIVACY_POLICY_DESCRIPTION\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Füge deine eigene Datenschutzrichtlinie hinzu oder leer lassen, um die standardmäßige zu verwenden. Markdown-Syntax wird unterstützt.\"])},\n \"REGISTRATION_DISABLED\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Registrierung ist derzeit deaktiviert.\"])},\n \"REGISTRATION_ENABLED\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Registrierung ist derzeit aktiviert.\"])},\n \"RESET_USER_PASSWORD\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Passwort zurücksetzen\"])},\n \"SPORTS\": {\n \"TABLE\": {\n \"ACTIVE\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Aktiv\"])},\n \"HAS_WORKOUTS\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Trainings existieren\"])},\n \"IMAGE\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Bild\"])},\n \"LABEL\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Titel\"])}\n },\n \"TITLE\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Sportarten Administration\"])}\n },\n \"UPDATE_APPLICATION_DESCRIPTION\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Aktualisiere Anwemdungskonfiguration.\"])},\n \"UPDATE_USER_EMAIL\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Aktualisiere E-Mail\"])},\n \"USER\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Nutzer\"])},\n \"USERS\": {\n \"SELECTS\": {\n \"ORDER_BY\": {\n \"ADMIN\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Adminstatus\"])},\n \"CREATED_AT\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Registrierungsdatum\"])},\n \"IS_ACTIVE\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Accountstatus\"])},\n \"USERNAME\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Nutzername\"])},\n \"WORKOUTS_COUNT\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Trainingsanzahl\"])}\n }\n },\n \"TABLE\": {\n \"ADD_ADMIN_RIGHTS\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Administratorrechte hinzufügen\"])},\n \"REMOVE_ADMIN_RIGHTS\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Administratorrechte entfernen\"])}\n }\n },\n \"USER_EMAIL_UPDATE_SUCCESSFUL\": (ctx) => {const { normalize: _normalize } = ctx;return _normalize([\"Die E-Mail Adresse wurde aktualisiert.\"])}\n}","export default {\n \"ERROR\": {\n \"