photos/js/photos-src_services_collect...

1 line
29 KiB
XML

{"version":3,"file":"photos-src_services_collectionFetcher_js-src_components_HeaderNavigation_vue.js?v=22ac83219184132552b5","mappings":";4QAwDA,SAASA,IACR,MAAO,sSAAPC,QAD0CC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,IAS5BG,KAAK,IAAG,2CAG1B,CAMA,SAASC,IACR,MAAO,0pBAAPL,QAD+CC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,IAoBjCG,KAAK,IAAG,2CAG1B,CASOE,eAAeC,EAAgBC,EAAMC,GAAkD,IAAzCC,EAAUT,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,GAAIU,EAAMV,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAGW,EAAAA,GAC9E,IACC,MAAMC,QAAiBF,EAAOG,KAAKN,EAAM,CACxCO,KAAMhB,EAAwBW,GAC9BM,SAAS,KACNP,IAKJ,OAFAQ,EAAAA,EAAAA,MAAa,uCAAwC,CAAEF,KAAMF,EAASE,OAE/DG,EAAiBL,EAASE,KAClC,CAAE,MAAOI,GACR,GAAmB,iBAAfA,EAAMC,KACT,OAAO,KAGR,MAAMD,CACP,CACD,CAUOb,eAAee,EAAiBb,EAAMC,GAAkD,IAAzCC,EAAUT,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,GAAIU,EAAMV,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAGW,EAAAA,GAC/E,IACC,MAAMC,QAAiBF,EAAOW,qBAAqBd,EAAM,CACxDO,KAAMhB,EAAwBW,GAC9BM,SAAS,KACNP,IAKJ,OAFAQ,EAAAA,EAAAA,MAAa,yBAADjB,OAA0Ba,EAASE,KAAKb,OAAM,kBAAkB,CAAEa,KAAMF,EAASE,OAEtFF,EAASE,KACdQ,QAAOC,GAAcA,EAAWC,WAAajB,IAC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AAM,CAACE,YAAY,4BAA4B,CAACF,EAAG,KAAK,CAACE,YAAY,iCAAiCI,GAAG,CAAC,MAAQR,EAAIb,UAAU,CAACa,EAAIc,GAAG,WAAWd,EAAIe,GAAGf,EAAIlD,MAAM,YAAYkD,EAAIc,GAAG,KAAKZ,EAAG,MAAM,CAACE,YAAY,kCAAkCJ,EAAIc,GAAG,KAAKd,EAAIgB,GAAG,aAAa,GAAGhB,EAAIc,GAAG,KAAMd,EAAIiB,OAAO1D,QAAS2C,EAAG,MAAM,CAACE,YAAY,8BAA8B,CAACJ,EAAIgB,GAAG,YAAY,GAAGhB,EAAIO,KAAKP,EAAIc,GAAG,KAAKZ,EAAG,gBAAgB,CAACgB,WAAW,CAAC,CAACpE,KAAK,OAAOqE,QAAQ,SAASC,MAAOpB,EAAI5C,QAASiE,WAAW,YAAYjB,YAAY,8BAA8BJ,EAAIc,GAAG,KAAKZ,EAAG,MAAM,CAACE,YAAY,oCAAoC,CAACJ,EAAIgB,GAAG,UAAU,IAAI,EACtnC,GACsB,IIUpB,EACA,KACA,WACA,MAI8B","sources":["webpack:///photos/src/services/collectionFetcher.js","webpack:///photos/src/components/HeaderNavigation.vue?vue&type=style&index=0&id=45a640d1&prod&lang=scss&scoped=true","webpack://photos/./src/components/HeaderNavigation.vue?6d2b","webpack:///photos/src/components/HeaderNavigation.vue","webpack:///photos/src/components/HeaderNavigation.vue?vue&type=script&lang=js","webpack://photos/./src/components/HeaderNavigation.vue?defe","webpack://photos/./src/components/HeaderNavigation.vue?6702"],"sourcesContent":["/**\n * @copyright Copyright (c) 2022 Louis Chemineau <louis@chmn.me>\n *\n * @author Louis Chemineau <louis@chmn.me>\n *\n * @license AGPL-3.0-or-later\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n *\n */\n\nimport moment from '@nextcloud/moment'\nimport { translate as t } from '@nextcloud/l10n'\n\nimport defaultClient from './DavClient.js'\nimport logger from './logger.js'\nimport { genFileInfo } from '../utils/fileUtils.js'\n\n/**\n * @typedef {object} Collection\n * @property {string} basename - The name of the collection (ex: \"Athens\").\n * @property {string} filename - The filename of the collection (ex: \"/photos/admin/places/Athens\").\n * @property {string} source - The full source of the collection (ex: \"https://nextcloud_server1.test/remote.php/dav//photos/admin/places/Athens\").\n * @property {number} nbItems - The number of item in the collection.\n * @property {number} lastPhoto - The file id for the cover of the collection.\n */\n\n/**\n * @typedef {object} CollectionFile\n * @property {string} fileid - The id of the file.\n * @property {string} basename - The name of the file (ex: \"790-IMG_20180906_085724.jpg\").\n * @property {string} filename - The file name of the file (ex: \"/photos/admin/places/Athens/790-IMG_20180906_085724.jpg\").\n * @property {string} source - The full source of the collection (ex: \"https://nextcloud_server1.test/remote.php/dav//photos/admin/places/Athens/790-IMG_20180906_085724.jpg\").\n * @property {object} metadataPhotosSize - The metadata of the file.\n * @property {number} metadataPhotosSize.width - The width of the file.\n * @property {number} metadataPhotosSize.height - The height of the file.\n */\n\n/** @typedef {Object<string, Collection>} IndexedCollections */\n/** @typedef {Object<string, CollectionFile>} IndexedCollectionFiles */\n\n/**\n * @param {string[]} extraProps - Extra properties to add to the DAV request.\n * @return {string}\n */\nfunction getCollectionDavRequest(extraProps = []) {\n\treturn `<?xml version=\"1.0\"?>\n\t\t\t<d:propfind xmlns:d=\"DAV:\"\n\t\t\t\txmlns:oc=\"http://owncloud.org/ns\"\n\t\t\t\txmlns:nc=\"http://nextcloud.org/ns\"\n\t\t\t\txmlns:ocs=\"http://open-collaboration-services.org/ns\">\n\t\t\t\t<d:prop>\n\t\t\t\t\t<nc:last-photo />\n\t\t\t\t\t<nc:nbItems />\n\t\t\t\t\t${extraProps.join('')}\n\t\t\t\t</d:prop>\n\t\t\t</d:propfind>`\n}\n\n/**\n * @param {string[]} extraProps - Extra properties to add to the DAV request.\n * @return {string}\n */\nfunction getCollectionFilesDavRequest(extraProps = []) {\n\treturn `<?xml version=\"1.0\"?>\n\t\t\t<d:propfind xmlns:d=\"DAV:\"\n\t\t\t\txmlns:oc=\"http://owncloud.org/ns\"\n\t\t\t\txmlns:nc=\"http://nextcloud.org/ns\"\n\t\t\t\txmlns:ocs=\"http://open-collaboration-services.org/ns\">\n\t\t\t\t<d:prop>\n\t\t\t\t\t<d:getcontentlength />\n\t\t\t\t\t<d:getcontenttype />\n\t\t\t\t\t<d:getetag />\n\t\t\t\t\t<d:getlastmodified />\n\t\t\t\t\t<d:resourcetype />\n\t\t\t\t\t<nc:metadata-photos-size />\n\t\t\t\t\t<nc:metadata-photos-original_date_time />\n\t\t\t\t\t<nc:metadata-files-live-photo />\n\t\t\t\t\t<nc:has-preview />\n\t\t\t\t\t<nc:hidden />\n\t\t\t\t\t<oc:favorite />\n\t\t\t\t\t<oc:fileid />\n\t\t\t\t\t<oc:permissions />\n\t\t\t\t\t${extraProps.join('')}\n\t\t\t\t</d:prop>\n\t\t\t</d:propfind>`\n}\n\n/**\n * @param {string} path - Collections' root path.\n * @param {import('webdav').StatOptions} options - Options to forward to the webdav client.\n * @param {string[]} extraProps - Extra properties to add to the DAV request.\n * @param {import('webdav').WebDAVClient} client - The DAV client to use.\n * @return {Promise<Collection|null>}\n */\nexport async function fetchCollection(path, options, extraProps = [], client = defaultClient) {\n\ttry {\n\t\tconst response = await client.stat(path, {\n\t\t\tdata: getCollectionDavRequest(extraProps),\n\t\t\tdetails: true,\n\t\t\t...options,\n\t\t})\n\n\t\tlogger.debug('[Collections] Fetched a collection: ', { data: response.data })\n\n\t\treturn formatCollection(response.data)\n\t} catch (error) {\n\t\tif (error.code === 'ERR_CANCELED') {\n\t\t\treturn null\n\t\t}\n\n\t\tthrow error\n\t}\n}\n\n/**\n *\n * @param {string} path - Collections' root path.\n * @param {import('webdav').StatOptions} options - Options to forward to the webdav client.\n * @param {string[]} extraProps - Extra properties to add to the DAV request.\n * @param {import('webdav').WebDAVClient} client - The DAV client to use.\n * @return {Promise<Collection[]>}\n */\nexport async function fetchCollections(path, options, extraProps = [], client = defaultClient) {\n\ttry {\n\t\tconst response = await client.getDirectoryContents(path, {\n\t\t\tdata: getCollectionDavRequest(extraProps),\n\t\t\tdetails: true,\n\t\t\t...options,\n\t\t})\n\n\t\tlogger.debug(`[Collections] Fetched ${response.data.length} collections: `, { data: response.data })\n\n\t\treturn response.data\n\t\t\t.filter(collection => collection.filename !== path)\n\t\t\t.map(formatCollection)\n\t} catch (error) {\n\t\tif (error.code === 'ERR_CANCELED') {\n\t\t\treturn []\n\t\t}\n\n\t\tthrow error\n\t}\n}\n\n/**\n *\n * @param {object} rawCollection - An collection received from a webdav request.\n * @return {Collection}\n */\nfunction formatCollection(rawCollection) {\n\t// Ensure that we have a proper collaborators array.\n\tif (rawCollection.props.collaborators === undefined || rawCollection.props.collaborators === '') {\n\t\trawCollection.props.collaborators = []\n\t} else if (typeof rawCollection.props.collaborators.collaborator === 'object') {\n\t\tif (Array.isArray(rawCollection.props.collaborators.collaborator)) {\n\t\t\trawCollection.props.collaborators = rawCollection.props.collaborators.collaborator\n\t\t} else {\n\t\t\trawCollection.props.collaborators = [rawCollection.props.collaborators.collaborator]\n\t\t}\n\t}\n\n\t// Extract custom props.\n\trawCollection = genFileInfo(rawCollection)\n\n\t// Compute date range label.\n\tconst dateRange = JSON.parse(rawCollection.dateRange?.replace(/&quot;/g, '\"') ?? '{}')\n\tif (dateRange.start === null) {\n\t\tdateRange.start = moment().unix()\n\t\tdateRange.end = moment().unix()\n\t}\n\tconst dateRangeFormatted = {\n\t\tstartDate: moment.unix(dateRange.start).format('MMMM YYYY'),\n\t\tendDate: moment.unix(dateRange.end).format('MMMM YYYY'),\n\t}\n\tif (dateRangeFormatted.startDate === dateRangeFormatted.endDate) {\n\t\trawCollection.date = dateRangeFormatted.startDate\n\t} else {\n\t\trawCollection.date = t('photos', '{startDate} to {endDate}', dateRangeFormatted)\n\t}\n\n\treturn rawCollection\n}\n\n/**\n *\n * @param {string} path - Collections' root path.\n * @param {import('webdav').StatOptions} options - Options to forward to the webdav client.\n * @param {string[]} extraProps - Extra properties to add to the DAV request.\n * @param {import('webdav').WebDAVClient} client - The DAV client to use.\n * @return {Promise<CollectionFile[]>}\n */\nexport async function fetchCollectionFiles(path, options, extraProps = [], client = defaultClient) {\n\ttry {\n\t\tconst response = await client.getDirectoryContents(path, {\n\t\t\tdata: getCollectionFilesDavRequest(extraProps),\n\t\t\tdetails: true,\n\t\t\t...options,\n\t\t})\n\n\t\tconst fetchedFiles = response.data\n\t\t\t.map(file => genFileInfo(file))\n\t\t\t.filter(file => file.fileid)\n\n\t\tlogger.debug(`[Collections] Fetched ${fetchedFiles.length} new files: `, fetchedFiles)\n\n\t\treturn fetchedFiles\n\t} catch (error) {\n\t\tif (error.code === 'ERR_CANCELED') {\n\t\t\treturn []\n\t\t}\n\n\t\tlogger.error('Error fetching collection files', { error })\n\t\tconsole.error(error)\n\n\t\tthrow error\n\t}\n}\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".photos-navigation[data-v-45a640d1]{position:-webkit-sticky;position:sticky;z-index:20;top:0;display:flex;flex-wrap:wrap;gap:calc(2*var(--app-navigation-padding));align-items:center;justify-content:flex-start;width:100%;padding-inline:calc(var(--default-clickable-area) + 2*var(--app-navigation-padding)) var(--app-navigation-padding);padding-block:var(--app-navigation-padding);background:var(--color-main-background)}.photos-navigation__back[data-v-45a640d1]{position:absolute !important;left:var(--app-navigation-padding)}.photos-navigation__title[data-v-45a640d1]{max-width:45%;display:flex;flex-direction:column}.photos-navigation__title__main[data-v-45a640d1]{cursor:pointer;font-weight:700;font-size:20px;line-height:44px}.photos-navigation__title__main[data-v-45a640d1],.photos-navigation__title__sub[data-v-45a640d1]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.photos-navigation__loader[data-v-45a640d1]{-webkit-margin-start:32px;margin-inline-start:32px}.photos-navigation__content-right[data-v-45a640d1]{display:flex;align-items:center;justify-content:center;-webkit-margin-start:auto;margin-inline-start:auto}\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/components/HeaderNavigation.vue\"],\"names\":[],\"mappings\":\"AAEA,oCACC,uBAAA,CAAA,eAAA,CACA,UAAA,CACA,KAAA,CACA,YAAA,CAEA,cAAA,CACA,yCAAA,CACA,kBAAA,CACA,0BAAA,CACA,UAAA,CAEA,kHAAA,CAEA,2CAAA,CACA,uCAAA,CAEA,0CAEC,4BAAA,CACA,kCAAA,CAGD,2CACC,aAAA,CACA,YAAA,CACA,qBAAA,CAEA,iDACC,cAAA,CACA,eAAA,CACA,cAAA,CACA,gBAAA,CAGD,iGACC,eAAA,CACA,kBAAA,CACA,sBAAA,CAIF,4CACC,yBAAA,CAAA,wBAAA,CAGD,mDACC,YAAA,CACA,kBAAA,CACA,sBAAA,CACA,yBAAA,CAAA,wBAAA\",\"sourcesContent\":[\"$sizes: (\\\"400\\\": (\\\"count\\\": 3, \\\"marginTop\\\": 66, \\\"marginW\\\": 8), \\\"700\\\": (\\\"count\\\": 4, \\\"marginTop\\\": 66, \\\"marginW\\\": 8), \\\"1024\\\": (\\\"count\\\": 5, \\\"marginTop\\\": 66, \\\"marginW\\\": 44), \\\"1280\\\": (\\\"count\\\": 4, \\\"marginTop\\\": 66, \\\"marginW\\\": 44), \\\"1440\\\": (\\\"count\\\": 5, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"1600\\\": (\\\"count\\\": 6, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"2048\\\": (\\\"count\\\": 7, \\\"marginTop\\\": 88, \\\"marginW\\\": 66), \\\"2560\\\": (\\\"count\\\": 8, \\\"marginTop\\\": 88, \\\"marginW\\\": 88), \\\"3440\\\": (\\\"count\\\": 9, \\\"marginTop\\\": 88, \\\"marginW\\\": 88), \\\"max\\\": (\\\"count\\\": 10, \\\"marginTop\\\": 88, \\\"marginW\\\": 88));\\n\\n.photos-navigation {\\n\\tposition: sticky;\\n\\tz-index: 20;\\n\\ttop: 0;\\n\\tdisplay: flex;\\n\\t// We need to wrap on small devices for accessibility\\n\\tflex-wrap: wrap;\\n\\tgap: calc(2 * var(--app-navigation-padding));\\n\\talign-items: center;\\n\\tjustify-content: flex-start;\\n\\twidth: 100%;\\n\\t// Ensure to not overlap with app navigation toggle\\n\\tpadding-inline: calc(var(--default-clickable-area) + 2 * var(--app-navigation-padding)) var(--app-navigation-padding);\\n\\t// Align with app navigation toggle\\n\\tpadding-block: var(--app-navigation-padding);\\n\\tbackground: var(--color-main-background);\\n\\n\\t&__back {\\n\\t\\t// Replaces the app navigation button\\n\\t\\tposition: absolute !important;\\n\\t\\tleft: var(--app-navigation-padding);\\n\\t}\\n\\n\\t&__title {\\n\\t\\tmax-width: 45%;\\n\\t\\tdisplay: flex;\\n\\t\\tflex-direction: column;\\n\\n\\t\\t&__main {\\n\\t\\t\\tcursor: pointer;\\n\\t\\t\\tfont-weight: 700;\\n\\t\\t\\tfont-size: 20px;\\n\\t\\t\\tline-height: 44px;\\n\\t\\t}\\n\\n\\t\\t&__main, &__sub {\\n\\t\\t\\toverflow: hidden;\\n\\t\\t\\twhite-space: nowrap;\\n\\t\\t\\ttext-overflow: ellipsis;\\n\\t\\t}\\n\\t}\\n\\n\\t&__loader {\\n\\t\\tmargin-inline-start: 32px;\\n\\t}\\n\\n\\t&__content-right {\\n\\t\\tdisplay: flex;\\n\\t\\talign-items: center;\\n\\t\\tjustify-content: center;\\n\\t\\tmargin-inline-start: auto;\\n\\t}\\n}\\n\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('div',{staticClass:\"photos-navigation\",class:{'photos-navigation--root': _vm.isRoot},attrs:{\"role\":\"toolbar\"}},[(!_vm.isRoot)?_c('NcButton',{staticClass:\"photos-navigation__back\",attrs:{\"aria-label\":_vm.t('photos', 'Go back'),\"type\":\"tertiary\"},on:{\"click\":_vm.folderUp},scopedSlots:_vm._u([{key:\"icon\",fn:function(){return [_c('ArrowLeft',{attrs:{\"size\":20}})]},proxy:true}],null,false,1821202730)}):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"photos-navigation__title\"},[_c('h1',{staticClass:\"photos-navigation__title__main\",on:{\"click\":_vm.refresh}},[_vm._v(\"\\n\\t\\t\\t\"+_vm._s(_vm.name)+\"\\n\\t\\t\")]),_vm._v(\" \"),_c('div',{staticClass:\"photos-navigation__title__sub\"}),_vm._v(\" \"),_vm._t(\"subtitle\")],2),_vm._v(\" \"),(_vm.$slots.default)?_c('div',{staticClass:\"photos-navigation__content\"},[_vm._t(\"default\")],2):_vm._e(),_vm._v(\" \"),_c('NcLoadingIcon',{directives:[{name:\"show\",rawName:\"v-show\",value:(_vm.loading),expression:\"loading\"}],staticClass:\"photos-navigation__loader\"}),_vm._v(\" \"),_c('div',{staticClass:\"photos-navigation__content-right\"},[_vm._t(\"right\")],2)],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<!--\n - @copyright Copyright (c) 2019 John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @author John Molakvoæ <skjnldsv@protonmail.com>\n -\n - @license AGPL-3.0-or-later\n -\n - This program is free software: you can redistribute it and/or modify\n - it under the terms of the GNU Affero General Public License as\n - published by the Free Software Foundation, either version 3 of the\n - License, or (at your option) any later version.\n -\n - This program is distributed in the hope that it will be useful,\n - but WITHOUT ANY WARRANTY; without even the implied warranty of\n - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n - GNU Affero General Public License for more details.\n -\n - You should have received a copy of the GNU Affero General Public License\n - along with this program. If not, see <http://www.gnu.org/licenses/>.\n -\n -->\n\n<template>\n\t<div :class=\"{'photos-navigation--root': isRoot}\" class=\"photos-navigation\" role=\"toolbar\">\n\t\t<!-- Back navigation button -->\n\t\t<NcButton v-if=\"!isRoot\"\n\t\t\tclass=\"photos-navigation__back\"\n\t\t\t:aria-label=\"t('photos', 'Go back')\"\n\t\t\ttype=\"tertiary\"\n\t\t\t@click=\"folderUp\">\n\t\t\t<template #icon>\n\t\t\t\t<ArrowLeft :size=\"20\" />\n\t\t\t</template>\n\t\t</NcButton>\n\n\t\t<!-- Main Navigation title -->\n\t\t<div class=\"photos-navigation__title\">\n\t\t\t<h1 class=\"photos-navigation__title__main\" @click=\"refresh\">\n\t\t\t\t{{ name }}\n\t\t\t</h1>\n\t\t\t<div class=\"photos-navigation__title__sub\" />\n\t\t\t<slot name=\"subtitle\" />\n\t\t</div>\n\n\t\t<!-- Main slot -->\n\t\t<div v-if=\"$slots.default\" class=\"photos-navigation__content\">\n\t\t\t<slot />\n\t\t</div>\n\n\t\t<NcLoadingIcon v-show=\"loading\" class=\"photos-navigation__loader\" />\n\n\t\t<div class=\"photos-navigation__content-right\">\n\t\t\t<slot name=\"right\" />\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport ArrowLeft from 'vue-material-design-icons/ArrowLeft.vue'\n\nimport { NcButton, NcLoadingIcon } from '@nextcloud/vue'\n\nexport default {\n\tname: 'HeaderNavigation',\n\n\tcomponents: {\n\t\tArrowLeft,\n\t\tNcButton,\n\t\tNcLoadingIcon,\n\t},\n\n\tinheritAttrs: false,\n\n\tprops: {\n\t\tloading: {\n\t\t\ttype: Boolean,\n\t\t\tdefault: false,\n\t\t},\n\t\tpath: {\n\t\t\ttype: String,\n\t\t\tdefault: '/',\n\t\t},\n\t\ttitle: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t},\n\t\trootTitle: {\n\t\t\ttype: String,\n\t\t\tdefault: t('photos', 'Photos'),\n\t\t},\n\t\t// The route params\n\t\tparams: {\n\t\t\ttype: Object,\n\t\t\tdefault: null,\n\t\t},\n\t},\n\n\tcomputed: {\n\t\tisRoot() {\n\t\t\tconst isRoot = this.path === '/'\n\t\t\tthis.toggleNavigationButton(!isRoot)\n\t\t\treturn isRoot\n\t\t},\n\n\t\tname() {\n\t\t\tif (this.isRoot) {\n\t\t\t\treturn this.rootTitle\n\t\t\t}\n\t\t\treturn this.title\n\t\t},\n\n\t\tparentPath() {\n\t\t\tconst path = this.path.split('/')\n\t\t\tpath.pop()\n\t\t\tconst parent = path.join('/')\n\t\t\treturn this.isRoot || parent.trim() === ''\n\t\t\t\t? '/'\n\t\t\t\t: path.join('/')\n\t\t},\n\n\t\tparentName() {\n\t\t\treturn this.parentPath && this.parentPath.split('/').pop()\n\t\t},\n\n\t\tbackToText() {\n\t\t\tif (this.parentPath === '/') {\n\t\t\t\treturn t('photos', 'Back to {folder}', { folder: this.rootTitle })\n\t\t\t}\n\t\t\treturn t('photos', 'Back to {folder}', { folder: this.parentName })\n\t\t},\n\n\t\t/**\n\t\t * We do not want encoded slashes when browsing by folder\n\t\t * so we generate a new valid route object, get the final url back\n\t\t * decode it and use it as a direct string, which vue-router\n\t\t * does not encode afterwards\n\t\t *\n\t\t * @return {string|object}\n\t\t */\n\t\tto() {\n\t\t\t// always remove first slash, the router\n\t\t\t// manage it automatically\n\t\t\tconst regex = /^\\/?(.*)/i\n\t\t\tconst path = regex.exec(this.parentPath)[1]\n\n\t\t\t// apply to current route\n\t\t\tconst { name, params } = Object.assign({}, this.$route, {\n\t\t\t\tparams: this.params || { path },\n\t\t\t})\n\n\t\t\t// return the full object as we don't care about\n\t\t\t// an empty path if this is route\n\t\t\tif (path === '') {\n\t\t\t\treturn { name }\n\t\t\t}\n\n\t\t\t// returning a string prevent vue-router to encode it again\n\t\t\treturn decodeURIComponent(this.$router.resolve({ name, params }).resolved.path)\n\t\t},\n\t},\n\n\tmethods: {\n\t\tfolderUp() {\n\t\t\tthis.$router.push(this.to)\n\t\t},\n\n\t\trefresh() {\n\t\t\tthis.$emit('refresh')\n\t\t},\n\n\t\ttoggleNavigationButton(hide) {\n\t\t\t// Hide the navigation toggle if the back button is shown\n\t\t\tconst navigationToggle = document.querySelector('button.app-navigation-toggle')\n\t\t\tif (navigationToggle !== null) {\n\t\t\t\tnavigationToggle.style.display = hide ? 'none' : null\n\t\t\t}\n\t\t},\n\t},\n}\n</script>\n\n<style lang=\"scss\" scoped>\n.photos-navigation {\n\tposition: sticky;\n\tz-index: 20;\n\ttop: 0;\n\tdisplay: flex;\n\t// We need to wrap on small devices for accessibility\n\tflex-wrap: wrap;\n\tgap: calc(2 * var(--app-navigation-padding));\n\talign-items: center;\n\tjustify-content: flex-start;\n\twidth: 100%;\n\t// Ensure to not overlap with app navigation toggle\n\tpadding-inline: calc(var(--default-clickable-area) + 2 * var(--app-navigation-padding)) var(--app-navigation-padding);\n\t// Align with app navigation toggle\n\tpadding-block: var(--app-navigation-padding);\n\tbackground: var(--color-main-background);\n\n\t&__back {\n\t\t// Replaces the app navigation button\n\t\tposition: absolute !important;\n\t\tleft: var(--app-navigation-padding);\n\t}\n\n\t&__title {\n\t\tmax-width: 45%;\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\n\t\t&__main {\n\t\t\tcursor: pointer;\n\t\t\tfont-weight: 700;\n\t\t\tfont-size: 20px;\n\t\t\tline-height: 44px;\n\t\t}\n\n\t\t&__main, &__sub {\n\t\t\toverflow: hidden;\n\t\t\twhite-space: nowrap;\n\t\t\ttext-overflow: ellipsis;\n\t\t}\n\t}\n\n\t&__loader {\n\t\tmargin-inline-start: 32px;\n\t}\n\n\t&__content-right {\n\t\tdisplay: flex;\n\t\talign-items: center;\n\t\tjustify-content: center;\n\t\tmargin-inline-start: auto;\n\t}\n}\n\n</style>\n","import mod from \"-!../../node_modules/babel-loader/lib/index.js!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HeaderNavigation.vue?vue&type=script&lang=js\"; export default mod; export * from \"-!../../node_modules/babel-loader/lib/index.js!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HeaderNavigation.vue?vue&type=script&lang=js\"","\n import API from \"!../../node_modules/style-loader/dist/runtime/injectStylesIntoStyleTag.js\";\n import domAPI from \"!../../node_modules/style-loader/dist/runtime/styleDomAPI.js\";\n import insertFn from \"!../../node_modules/style-loader/dist/runtime/insertBySelector.js\";\n import setAttributes from \"!../../node_modules/style-loader/dist/runtime/setAttributesWithoutAttributes.js\";\n import insertStyleElement from \"!../../node_modules/style-loader/dist/runtime/insertStyleElement.js\";\n import styleTagTransformFn from \"!../../node_modules/style-loader/dist/runtime/styleTagTransform.js\";\n import content, * as namedExport from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[3]!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HeaderNavigation.vue?vue&type=style&index=0&id=45a640d1&prod&lang=scss&scoped=true\";\n \n \n\nvar options = {};\n\noptions.styleTagTransform = styleTagTransformFn;\noptions.setAttributes = setAttributes;\n\n options.insert = insertFn.bind(null, \"head\");\n \noptions.domAPI = domAPI;\noptions.insertStyleElement = insertStyleElement;\n\nvar update = API(content, options);\n\n\n\nexport * from \"!!../../node_modules/css-loader/dist/cjs.js!../../node_modules/vue-loader/lib/loaders/stylePostLoader.js!../../node_modules/postcss-loader/dist/cjs.js!../../node_modules/sass-loader/dist/cjs.js??clonedRuleSet-2.use[3]!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./HeaderNavigation.vue?vue&type=style&index=0&id=45a640d1&prod&lang=scss&scoped=true\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./HeaderNavigation.vue?vue&type=template&id=45a640d1&scoped=true\"\nimport script from \"./HeaderNavigation.vue?vue&type=script&lang=js\"\nexport * from \"./HeaderNavigation.vue?vue&type=script&lang=js\"\nimport style0 from \"./HeaderNavigation.vue?vue&type=style&index=0&id=45a640d1&prod&lang=scss&scoped=true\"\n\n\n/* normalize component */\nimport normalizer from \"!../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"45a640d1\",\n null\n \n)\n\nexport default component.exports"],"names":["getCollectionDavRequest","concat","arguments","length","undefined","join","getCollectionFilesDavRequest","async","fetchCollection","path","options","extraProps","client","defaultClient","response","stat","data","details","logger","formatCollection","error","code","fetchCollections","getDirectoryContents","filter","collection","filename","map","rawCollection","_rawCollection$dateRa","_rawCollection$dateRa2","props","collaborators","collaborator","Array","isArray","genFileInfo","dateRange","JSON","parse","replace","start","moment","unix","end","dateRangeFormatted","startDate","format","endDate","date","t","fetchCollectionFiles","fetchedFiles","file","fileid","console","___CSS_LOADER_EXPORT___","push","module","id","name","components","ArrowLeft","NcButton","NcLoadingIcon","inheritAttrs","loading","type","Boolean","default","String","title","required","rootTitle","params","Object","computed","isRoot","toggleNavigationButton","parentPath","split","pop","parent","trim","parentName","backToText","folder","to","exec","assign","$route","decodeURIComponent","$router","resolve","resolved","methods","folderUp","refresh","$emit","hide","navigationToggle","document","querySelector","style","display","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","_vm","this","_c","_self","staticClass","class","attrs","_e","on","scopedSlots","_u","key","fn","proxy","_v","_s","_t","$slots","directives","rawName","value","expression"],"sourceRoot":""}