photos/js/photos-src_mixins_AbortCont...

1 line
15 KiB
Plaintext

{"version":3,"file":"photos-src_mixins_AbortControllerMixin_js-src_views_Faces_vue.js?v=d8ee4fc0e909a2b5a7a5","mappings":";sKAsBA,SACCA,KAAM,uBAENC,KAAIA,KACI,CACNC,gBAAiB,IAAIC,kBAIvBC,gBACCC,KAAKH,gBAAgBI,OACtB,EAEAC,iBAAiBC,EAAMC,EAAIC,GAC1BL,KAAKH,gBAAgBI,QACrBD,KAAKH,gBAAkB,IAAIC,gBAC3BO,GACD,wECpCGC,QAA0B,GAA4B,KAE1DA,EAAwBC,KAAK,CAACC,EAAOC,GAAI,8yBAA+yB,GAAG,CAAC,QAAU,EAAE,QAAU,CAAC,mCAAmC,MAAQ,GAAG,SAAW,6TAA6T,eAAiB,CAAC,o2CAAo7C,WAAa,MAE5rF,yDCPA,2DCiEA,MCjEqK,EDiErK,CACAd,KAAA,QACAe,WAAA,CACAC,UAAA,IACAC,eAAA,KACAC,cAAA,KACAC,0BAAAA,EAAAA,GAGAC,OAAA,CACAC,EAAAA,GAGAC,SAAA,KACAC,EAAAA,EAAAA,IAAA,CACA,eAMAC,UACA,WAAAC,OAAAC,KAAA,KAAAC,OAAAC,MACA,EAEAC,eACA,OAAAJ,OAAAK,OAAA,KAAAH,OAAAI,MAAA,CAAAC,EAAAC,IACAD,EAAAE,MAAAC,SAAAF,EAAAC,MAAAC,QACAF,EAAAC,MAAAC,QAAAH,EAAAE,MAAAC,QAEA,KAAAC,WAAAH,EAAAI,WAAA,KAAAD,WAAAJ,EAAAK,UAGA,KAAAD,WAAAH,EAAAI,UAAAT,OAAA,KAAAQ,WAAAJ,EAAAK,UAAAT,OAFA,GAIA,yIEzFIU,EAAU,CAAC,EAEfA,EAAQC,kBAAoB,IAC5BD,EAAQE,cAAgB,IAElBF,EAAQG,OAAS,SAAc,KAAM,QAE3CH,EAAQI,OAAS,IACjBJ,EAAQK,mBAAqB,IAEhB,IAAI,IAASL,GAKJ,KAAW,YAAiB,WCPlD,SAXgB,cACd,GJTW,WAAkB,IAAIM,EAAIvC,KAAKwC,EAAGD,EAAIE,MAAMD,GAAG,OAAQD,EAAIG,mBAAoBF,EAAG,iBAAiB,CAACD,EAAII,GAAG,OAAOJ,EAAIK,GAAGL,EAAIM,EAAE,SAAU,sBAAsB,QAAQL,EAAG,MAAM,CAACM,YAAY,SAAS,CAAEP,EAAIQ,aAAcP,EAAG,iBAAiBD,EAAIS,KAAKT,EAAII,GAAG,KAAMJ,EAAIpB,UAAYoB,EAAIQ,aAAcP,EAAG,MAAM,CAACM,YAAY,gBAAgB,CAACN,EAAG,iBAAiB,CAACM,YAAY,kCAAkCG,YAAYV,EAAIW,GAAG,CAAC,CAACC,IAAI,OAAOC,GAAG,WAAW,MAAO,CAACZ,EAAG,6BAA6B,EAAEa,OAAM,GAAM,CAACF,IAAI,OAAOC,GAAG,WAAW,MAAO,CAACb,EAAII,GAAG,aAAaJ,EAAIK,GAAGL,EAAIM,EAAE,SAAU,2EAA2E,YAAY,EAAEQ,OAAM,IAAO,MAAK,EAAM,aAAa,CAACd,EAAII,GAAG,KAAKJ,EAAII,GAAG,WAAWJ,EAAIK,GAAGL,EAAIM,EAAE,SAAU,wCAAwC,aAAa,GAAKN,EAAIpB,QAAwOoB,EAAIS,KAAnOR,EAAG,MAAM,CAACM,YAAY,eAAeP,EAAIe,GAAIf,EAAIf,cAAc,SAAS+B,GAAM,OAAOf,EAAG,cAAc,CAACW,IAAII,EAAKvB,SAASwB,MAAM,CAAC,GAAI,UAAAC,OAAWF,EAAKvB,YAAa,CAACQ,EAAG,YAAY,CAACgB,MAAM,CAAC,YAAYD,EAAKvB,aAAa,EAAE,IAAG,IAAa,EACljC,GACsB,IIUpB,EACA,KACA,WACA,MAI8B","sources":["webpack:///photos/src/mixins/AbortControllerMixin.js","webpack:///photos/src/views/Faces.vue?vue&type=style&index=0&id=0c237cfe&prod&lang=scss&scoped=true","webpack://photos/./src/views/Faces.vue?9d13","webpack:///photos/src/views/Faces.vue","webpack:///photos/src/views/Faces.vue?vue&type=script&lang=js","webpack://photos/./src/views/Faces.vue?ef38","webpack://photos/./src/views/Faces.vue?a265"],"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\nexport default {\n\tname: 'AbortControllerMixin',\n\n\tdata() {\n\t\treturn {\n\t\t\tabortController: new AbortController(),\n\t\t}\n\t},\n\n\tbeforeDestroy() {\n\t\tthis.abortController.abort()\n\t},\n\n\tbeforeRouteLeave(from, to, next) {\n\t\tthis.abortController.abort()\n\t\tthis.abortController = new AbortController()\n\t\tnext()\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, \".faces[data-v-0c237cfe]{display:flex;flex-direction:column;height:calc(100vh - var(--header-height));padding-left:64px}@media only screen and (max-width: 1020px){.faces[data-v-0c237cfe]{padding:0}}.faces__header[data-v-0c237cfe]{display:flex;min-height:60px;align-items:center}.faces__header button[data-v-0c237cfe]{margin-right:32px}.faces__list[data-v-0c237cfe]{padding-top:24px;padding-bottom:32px;flex-grow:1;display:flex;flex-wrap:wrap;gap:32px;align-content:flex-start}.faces__empty[data-v-0c237cfe]{display:flex;flex-direction:column;align-items:center}.faces__empty__button[data-v-0c237cfe]{margin-top:32px}.empty-content-with-illustration[data-v-0c237cfe] .empty-content__icon{width:200px;height:200px}.empty-content-with-illustration[data-v-0c237cfe] .empty-content__icon svg{width:200px;height:200px}\", \"\",{\"version\":3,\"sources\":[\"webpack://./src/views/Faces.vue\"],\"names\":[],\"mappings\":\"AAEA,wBACC,YAAA,CACA,qBAAA,CACA,yCAAA,CACA,iBAAA,CAEA,2CAND,wBAOE,SAAA,CAAA,CAGD,gCACC,YAAA,CACA,eAAA,CACA,kBAAA,CAEA,uCACC,iBAAA,CAIF,8BACC,gBAAA,CACA,mBAAA,CACA,WAAA,CACA,YAAA,CACA,cAAA,CACA,QAAA,CACA,wBAAA,CAGD,+BACC,YAAA,CACA,qBAAA,CACA,kBAAA,CAEA,uCACC,eAAA,CAKH,uEACC,WAAA,CACA,YAAA,CAEA,2EACC,WAAA,CACA,YAAA\",\"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.faces {\\n\\tdisplay: flex;\\n\\tflex-direction: column;\\n\\theight: calc(100vh - var(--header-height));\\n\\tpadding-left: 64px;\\n\\n\\t@media only screen and (max-width: 1020px) {\\n\\t\\tpadding: 0;\\n\\t}\\n\\n\\t&__header {\\n\\t\\tdisplay: flex;\\n\\t\\tmin-height: 60px;\\n\\t\\talign-items: center;\\n\\n\\t\\tbutton {\\n\\t\\t\\tmargin-right: 32px;\\n\\t\\t}\\n\\t}\\n\\n\\t&__list {\\n\\t\\tpadding-top: 24px;\\n\\t\\tpadding-bottom: 32px;\\n\\t\\tflex-grow: 1;\\n\\t\\tdisplay: flex;\\n\\t\\tflex-wrap: wrap;\\n\\t\\tgap: 32px;\\n\\t\\talign-content: flex-start;\\n\\t}\\n\\n\\t&__empty {\\n\\t\\tdisplay: flex;\\n\\t\\tflex-direction: column;\\n\\t\\talign-items: center;\\n\\n\\t\\t&__button {\\n\\t\\t\\tmargin-top: 32px;\\n\\t\\t}\\n\\t}\\n}\\n\\n.empty-content-with-illustration :deep(.empty-content__icon) {\\n\\twidth: 200px;\\n\\theight: 200px;\\n\\n\\tsvg {\\n\\t\\twidth: 200px;\\n\\t\\theight: 200px;\\n\\t}\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","var render = function render(){var _vm=this,_c=_vm._self._c;return (_vm.errorFetchingFaces)?_c('NcEmptyContent',[_vm._v(\"\\n\\t\"+_vm._s(_vm.t('photos', 'An error occurred'))+\"\\n\")]):_c('div',{staticClass:\"faces\"},[(_vm.loadingFaces)?_c('NcLoadingIcon'):_vm._e(),_vm._v(\" \"),(_vm.noFaces && !_vm.loadingFaces)?_c('div',{staticClass:\"faces__empty\"},[_c('NcEmptyContent',{staticClass:\"empty-content-with-illustration\",scopedSlots:_vm._u([{key:\"icon\",fn:function(){return [_c('AccountBoxMultipleOutline')]},proxy:true},{key:\"desc\",fn:function(){return [_vm._v(\"\\n\\t\\t\\t\\t\"+_vm._s(_vm.t('photos', 'This might take some time depending on the size of your photo library.'))+\"\\n\\t\\t\\t\")]},proxy:true}],null,false,3796275108)},[_vm._v(\" \"),_vm._v(\"\\n\\t\\t\\t\"+_vm._s(_vm.t('photos', 'Recognized people will show up here'))+\"\\n\\t\\t\")])],1):(!_vm.noFaces)?_c('div',{staticClass:\"faces__list\"},_vm._l((_vm.orderedFaces),function(face){return _c('router-link',{key:face.basename,attrs:{\"to\":`/faces/${face.basename}`}},[_c('FaceCover',{attrs:{\"base-name\":face.basename}})],1)}),1):_vm._e()],1)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","<!--\n - @copyright Copyright (c) 2022 Louis Chemineau <louis@chmn.me>\n - @copyright Copyright (c) 2022 Marcel Klehr <mklehr@gmx.net>\n -\n - @author Louis Chemineau <louis@chmn.me>\n - @author Marcel Klehr <mklehr@gmx.net>\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<template>\n\t<!-- Errors handlers-->\n\t<NcEmptyContent v-if=\"errorFetchingFaces\">\n\t\t{{ t('photos', 'An error occurred') }}\n\t</NcEmptyContent>\n\n\t<!-- Face list -->\n\t<div v-else class=\"faces\">\n\t\t<NcLoadingIcon v-if=\"loadingFaces\" />\n\n\t\t<!-- No faces -->\n\t\t<div v-if=\"noFaces && !loadingFaces\" class=\"faces__empty\">\n\t\t\t<NcEmptyContent class=\"empty-content-with-illustration\">\n\t\t\t\t<template #icon>\n\t\t\t\t\t<AccountBoxMultipleOutline />\n\t\t\t\t</template>\n\t\t\t\t<template #desc>\n\t\t\t\t\t{{ t('photos', 'This might take some time depending on the size of your photo library.') }}\n\t\t\t\t</template>\n\t\t\t\t{{ t('photos', 'Recognized people will show up here') }}\n\t\t\t</NcEmptyContent>\n\t\t</div>\n\n\t\t<div v-else-if=\"!noFaces\" class=\"faces__list\">\n\t\t\t<router-link v-for=\"face in orderedFaces\"\n\t\t\t\t:key=\"face.basename\"\n\t\t\t\t:to=\"`/faces/${face.basename}`\">\n\t\t\t\t<FaceCover :base-name=\"face.basename\" />\n\t\t\t</router-link>\n\t\t</div>\n\t</div>\n</template>\n\n<script>\nimport AccountBoxMultipleOutline from 'vue-material-design-icons/AccountBoxMultipleOutline.vue'\n\nimport { NcEmptyContent, NcLoadingIcon } from '@nextcloud/vue'\n\nimport FetchFacesMixin from '../mixins/FetchFacesMixin.js'\nimport FaceCover from '../components/FaceCover.vue'\nimport { mapGetters } from 'vuex'\n\nexport default {\n\tname: 'Faces',\n\tcomponents: {\n\t\tFaceCover,\n\t\tNcEmptyContent,\n\t\tNcLoadingIcon,\n\t\tAccountBoxMultipleOutline,\n\t},\n\n\tmixins: [\n\t\tFetchFacesMixin,\n\t],\n\n\tcomputed: {\n\t\t...mapGetters([\n\t\t\t'facesFiles',\n\t\t]),\n\n\t\t/**\n\t\t * @return {boolean} Whether the list of face is empty or not.\n\t\t */\n\t\tnoFaces() {\n\t\t\treturn Object.keys(this.faces).length === 0\n\t\t},\n\n\t\torderedFaces() {\n\t\t\treturn Object.values(this.faces).sort((a, b) => {\n\t\t\t\tif (a.props.nbItems && b.props.nbItems) {\n\t\t\t\t\treturn b.props.nbItems - a.props.nbItems\n\t\t\t\t}\n\t\t\t\tif (!this.facesFiles[b.basename] || !this.facesFiles[a.basename]) {\n\t\t\t\t\treturn 0\n\t\t\t\t}\n\t\t\t\treturn this.facesFiles[b.basename].length - this.facesFiles[a.basename].length\n\t\t\t})\n\t\t},\n\t},\n}\n</script>\n<style lang=\"scss\" scoped>\n.faces {\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: calc(100vh - var(--header-height));\n\tpadding-left: 64px;\n\n\t@media only screen and (max-width: 1020px) {\n\t\tpadding: 0;\n\t}\n\n\t&__header {\n\t\tdisplay: flex;\n\t\tmin-height: 60px;\n\t\talign-items: center;\n\n\t\tbutton {\n\t\t\tmargin-right: 32px;\n\t\t}\n\t}\n\n\t&__list {\n\t\tpadding-top: 24px;\n\t\tpadding-bottom: 32px;\n\t\tflex-grow: 1;\n\t\tdisplay: flex;\n\t\tflex-wrap: wrap;\n\t\tgap: 32px;\n\t\talign-content: flex-start;\n\t}\n\n\t&__empty {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\talign-items: center;\n\n\t\t&__button {\n\t\t\tmargin-top: 32px;\n\t\t}\n\t}\n}\n\n.empty-content-with-illustration :deep(.empty-content__icon) {\n\twidth: 200px;\n\theight: 200px;\n\n\tsvg {\n\t\twidth: 200px;\n\t\theight: 200px;\n\t}\n}\n</style>\n","import mod from \"-!../../node_modules/babel-loader/lib/index.js!../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Faces.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!./Faces.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!./Faces.vue?vue&type=style&index=0&id=0c237cfe&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!./Faces.vue?vue&type=style&index=0&id=0c237cfe&prod&lang=scss&scoped=true\";\n export default content && content.locals ? content.locals : undefined;\n","import { render, staticRenderFns } from \"./Faces.vue?vue&type=template&id=0c237cfe&scoped=true\"\nimport script from \"./Faces.vue?vue&type=script&lang=js\"\nexport * from \"./Faces.vue?vue&type=script&lang=js\"\nimport style0 from \"./Faces.vue?vue&type=style&index=0&id=0c237cfe&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 \"0c237cfe\",\n null\n \n)\n\nexport default component.exports"],"names":["name","data","abortController","AbortController","beforeDestroy","this","abort","beforeRouteLeave","from","to","next","___CSS_LOADER_EXPORT___","push","module","id","components","FaceCover","NcEmptyContent","NcLoadingIcon","AccountBoxMultipleOutline","mixins","FetchFacesMixin","computed","mapGetters","noFaces","Object","keys","faces","length","orderedFaces","values","sort","a","b","props","nbItems","facesFiles","basename","options","styleTagTransform","setAttributes","insert","domAPI","insertStyleElement","_vm","_c","_self","errorFetchingFaces","_v","_s","t","staticClass","loadingFaces","_e","scopedSlots","_u","key","fn","proxy","_l","face","attrs","concat"],"sourceRoot":""}