-
-
Notifications
You must be signed in to change notification settings - Fork 84
Expand file tree
/
Copy pathphotos-src_views_FaceContent_vue.js
More file actions
3 lines (3 loc) · 29.5 KB
/
photos-src_views_FaceContent_vue.js
File metadata and controls
3 lines (3 loc) · 29.5 KB
1
2
3
/*! For license information please see photos-src_views_FaceContent_vue.js.LICENSE.txt */
"use strict";(self.webpackChunkphotos=self.webpackChunkphotos||[]).push([["src_views_FaceContent_vue"],{46116:(n,e,t)=>{t.d(e,{Z:()=>l});var r=t(20629),a=t(86492),o=t.n(a);function i(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.push.apply(t,r)}return t}function c(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?i(Object(t),!0).forEach((function(e){s(n,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):i(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}function s(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}const l={name:"FaceCoverMixin",computed:c({},(0,r.Se)(["faces","facesFiles","files"])),methods:{getFaceCover:function(n){var e=this;return(this.facesFiles[n]||[]).slice(0,25).map((function(n){return e.files[n]})).map((function(n){return c(c({},n),{},{faceDetections:JSON.parse(o().decode(n.faceDetections))})})).sort((function(e,t){return t.faceDetections.find((function(e){return e.title===n})).width-e.faceDetections.find((function(e){return e.title===n})).width})).sort((function(n,e){return n.faceDetections.length-e.faceDetections.length}))[0]},getCoverStyle:function(n){var e=this.getFaceCover(n);if(!e)return{};var t=e.faceDetections.find((function(e){return e.title===n})),r=Math.max(1,1/t.width*.4),a=100*(t.x+t.width/2),o=100*(t.y+t.height/2);return{width:"100%",transform:"translate(calc( var(--photos-face-width)/2 - ".concat(a,"% ), calc( var(--photos-face-width)/2 - ").concat(o,"% )) scale(").concat(r,")"),transformOrigin:"".concat(a,"% ").concat(o,"%")}}}}},99751:(n,e,r)=>{r.d(e,{Z:()=>g});var a=r(20629),o=r(82880),i=r(29541),c=r(81067),s=r(59537),l=r(4615),u=r(2161),f=r(94236);function d(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.push.apply(t,r)}return t}function p(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?d(Object(t),!0).forEach((function(e){A(n,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}function A(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function m(n,e,t,r,a,o,i){try{var c=n[o](i),s=c.value}catch(n){return void t(n)}c.done?e(s):Promise.resolve(s).then(r,a)}function h(n){return function(){var e=this,t=arguments;return new Promise((function(r,a){var o=n.apply(e,t);function i(n){m(o,r,a,i,c,"next",n)}function c(n){m(o,r,a,i,c,"throw",n)}i(void 0)}))}}const g={name:"FetchFacesMixin",data:function(){return{errorFetchingFaces:null,loadingFaces:!1,errorFetchingFiles:null,loadingFiles:!1,cancelFacesRequest:function(){},cancelFilesRequest:function(){}}},beforeMount:function(){var n=this;return h(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n.fetchFaces();case 1:case"end":return e.stop()}}),e)})))()},beforeDestroy:function(){this.cancelFacesRequest("Changed view"),this.cancelFilesRequest("Changed view")},computed:p({},(0,a.Se)(["faces"])),methods:p(p({},(0,a.nv)(["appendFiles"])),{},{fetchFaces:function(){var n=this;return h(regeneratorRuntime.mark((function e(){var r,a,u,f,d;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!n.loadingFaces){e.next=2;break}return e.abrupt("return");case 2:if(!Object.keys(n.faces).length){e.next=4;break}return e.abrupt("return");case 4:return e.prev=4,n.loadingFaces=!0,n.errorFetchingFaces=null,a=(0,l.Z)(c.Z.getDirectoryContents),u=a.request,f=a.cancel,n.cancelFacesRequest=f,e.next=11,u("/recognize/".concat(null===(r=(0,i.ts)())||void 0===r?void 0:r.uid,"/faces/"));case 11:d=e.sent,n.$store.dispatch("addFaces",{faces:d}),s.Z.debug("[FetchFacesMixin] Fetched ".concat(d.length," new faces: "),d),e.next=21;break;case 16:e.prev=16,e.t0=e.catch(4),e.t0.response&&e.t0.response.status&&(404===e.t0.response.status?n.errorFetchingFaces=404:n.errorFetchingFaces=e.t0),s.Z.error(t("photos","Failed to fetch faces list."),e.t0),(0,o.x2)(t("photos","Failed to fetch faces list."));case 21:return e.prev=21,n.cancelFacesRequest=function(){},n.loadingFaces=!1,e.finish(21);case 25:case"end":return e.stop()}}),e,null,[[4,16,21,25]])})))()},fetchFaceContent:function(n,e){var t=this;return h(regeneratorRuntime.mark((function r(){var a,o,d,A,m,h,g;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!t.loadingFiles){r.next=2;break}return r.abrupt("return");case 2:if(e||!t.facesFiles[n]||!t.facesFiles[n].length){r.next=4;break}return r.abrupt("return");case 4:return r.prev=4,t.errorFetchingFiles=null,t.loadingFiles=!0,o=(0,l.Z)(c.Z.getDirectoryContents),d=o.request,A=o.cancel,t.cancelFilesRequest=A,r.next=11,d("/recognize/".concat(null===(a=(0,i.ts)())||void 0===a?void 0:a.uid,"/faces/").concat(n),{data:u.Z,details:!0});case 11:if(m=r.sent,h=(h=m.data).map((function(n){return(0,f.AX)(n)})).map((function(n){return p(p({},n),{},{filename:n.realpath.replace("/".concat((0,i.ts)().uid,"/files"),"")})})),g=h.map((function(n){return""+n.fileid})),t.appendFiles(h),!(h.length>0)){r.next=19;break}return r.next=19,t.$store.commit("addFilesToFace",{faceName:n,fileIdsToAdd:g});case 19:s.Z.debug("[FetchFacesMixin] Fetched ".concat(g.length," new files: "),g),r.next=26;break;case 22:r.prev=22,r.t0=r.catch(4),r.t0.response&&r.t0.response.status&&(404===r.t0.response.status?t.errorFetchingFiles=404:t.errorFetchingFiles=r.t0),s.Z.error("Error fetching face files",r.t0);case 26:return r.prev=26,t.loadingFiles=!1,t.cancelFilesRequest=function(){},r.finish(26);case 30:case"end":return r.stop()}}),r,null,[[4,22,26,30]])})))()}})}},30689:(n,e,t)=>{t.d(e,{Z:()=>c});var r=t(87537),a=t.n(r),o=t(23645),i=t.n(o)()(a());i.push([n.id,".face-list[data-v-6af87af4]{display:flex;flex-direction:row;height:350px;flex-wrap:wrap;padding:12px}.face-list__item[data-v-6af87af4]{display:flex;flex-direction:column;padding:10px;border-radius:var(--border-radius);align-items:center;cursor:pointer;width:120px}.face-list__item *[data-v-6af87af4]{cursor:pointer}.face-list__item__crop-container[data-v-6af87af4]{overflow:hidden;width:60px;height:60px;border-radius:60px;position:relative;background:var(--color-background-darker);--photos-face-width: 60px}.face-list__item[data-v-6af87af4]:hover,.face-list__item[data-v-6af87af4]:focus{background:var(--color-background-hover)}.face-list__item__details[data-v-6af87af4]{padding:10px;height:1em;overflow:hidden;text-overflow:ellipsis;width:100%;text-align:center}.loader[data-v-6af87af4]{margin-top:25%}","",{version:3,sources:["webpack://./src/components/FaceMergeForm.vue"],names:[],mappings:"AAyGA,4BACC,YAAA,CACA,kBAAA,CACA,YAAA,CACA,cAAA,CACA,YAAA,CAEA,kCACC,YAAA,CACA,qBAAA,CACA,YAAA,CACA,kCAAA,CACA,kBAAA,CACA,cAAA,CACA,WAAA,CAEA,oCACC,cAAA,CAGD,kDACC,eAAA,CACA,UAAA,CACA,WAAA,CACA,kBAAA,CACA,iBAAA,CACA,yCAAA,CACA,yBAAA,CAGD,gFACC,wCAAA,CAGD,2CACC,YAAA,CACA,UAAA,CACA,eAAA,CACA,sBAAA,CACA,UAAA,CACA,iBAAA,CAKH,yBACC,cAAA",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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.face-list {\n\tdisplay: flex;\n\tflex-direction: row;\n\theight: 350px;\n\tflex-wrap: wrap;\n\tpadding: 12px;\n\n\t&__item {\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\t\tpadding: 10px;\n\t\tborder-radius: var(--border-radius);\n\t\talign-items: center;\n\t\tcursor: pointer;\n\t\twidth: 120px;\n\n\t\t* {\n\t\t\tcursor: pointer;\n\t\t}\n\n\t\t&__crop-container {\n\t\t\toverflow: hidden;\n\t\t\twidth: 60px;\n\t\t\theight: 60px;\n\t\t\tborder-radius: 60px;\n\t\t\tposition: relative;\n\t\t\tbackground: var(--color-background-darker);\n\t\t\t--photos-face-width: 60px;\n\t\t}\n\n\t\t&:hover, &:focus {\n\t\t\tbackground: var(--color-background-hover);\n\t\t}\n\n\t\t&__details {\n\t\t\tpadding: 10px;\n\t\t\theight: 1em;\n\t\t\toverflow: hidden;\n\t\t\ttext-overflow: ellipsis;\n\t\t\twidth: 100%;\n\t\t\ttext-align: center;\n\t\t}\n\t}\n}\n\n.loader {\n\tmargin-top: 25%;\n}\n'],sourceRoot:""}]);const c=i},9744:(n,e,t)=>{t.d(e,{Z:()=>c});var r=t(87537),a=t.n(r),o=t(23645),i=t.n(o)()(a());i.push([n.id,".face[data-v-bbffc378]{display:flex;flex-direction:column}.face__empty[data-v-bbffc378]{display:flex;flex-direction:column;align-items:center}.face__empty__button[data-v-bbffc378]{margin-top:32px}.face__header[data-v-bbffc378]{display:flex;min-height:60px;align-items:center;justify-content:space-between;position:-webkit-sticky;position:sticky;top:var(--header-height);z-index:3;background:var(--color-main-background);padding:0 64px}@media only screen and (max-width: 1020px){.face__header[data-v-bbffc378]{padding:0;padding-left:64px}}.face__header__left[data-v-bbffc378]{height:100%;display:flex;align-items:center}.face__header__title[data-v-bbffc378]{margin-left:10px}.face__header__title h2[data-v-bbffc378]{margin-bottom:0}.face__header__loader[data-v-bbffc378]{margin-left:32px}.face__header__actions[data-v-bbffc378]{display:flex;align-items:center}.face__header__actions button[data-v-bbffc378]{margin-left:16px}.face__photos[data-v-bbffc378]{margin-top:16px;height:100%;min-height:0;padding:0 64px}@media only screen and (max-width: 1020px){.face__photos[data-v-bbffc378]{padding:0}}.empty-content-with-illustration[data-v-bbffc378] .empty-content__icon{width:200px;height:200px}.empty-content-with-illustration[data-v-bbffc378] .empty-content__icon svg{width:200px;height:200px}.rename-form[data-v-bbffc378]{display:flex;flex-direction:row;align-items:center;height:70px;padding:16px}.rename-form input[data-v-bbffc378]{width:80%}","",{version:3,sources:["webpack://./src/views/FaceContent.vue"],names:[],mappings:"AAmYA,uBACC,YAAA,CACA,qBAAA,CAEA,8BACC,YAAA,CACA,qBAAA,CACA,kBAAA,CAEA,sCACC,eAAA,CAKF,+BACC,YAAA,CACA,eAAA,CACA,kBAAA,CACA,6BAAA,CACA,uBAAA,CAAA,eAAA,CACA,wBAAA,CACA,SAAA,CACA,uCAAA,CACA,cAAA,CAEA,2CAXD,+BAYE,SAAA,CACA,iBAAA,CAAA,CAGD,qCACC,WAAA,CACA,YAAA,CACA,kBAAA,CAGD,sCACC,gBAAA,CACA,yCACC,eAAA,CAIF,uCACC,gBAAA,CAGD,wCACC,YAAA,CACA,kBAAA,CAEA,+CACC,gBAAA,CAKH,+BACC,eAAA,CACA,WAAA,CACA,YAAA,CACA,cAAA,CAEA,2CAND,+BAOE,SAAA,CAAA,CAKH,wEACC,WAAA,CACA,YAAA,CAEA,4EACC,WAAA,CACA,YAAA,CAIF,8BACC,YAAA,CACA,kBAAA,CACA,kBAAA,CACA,WAAA,CACA,YAAA,CAEA,oCACC,SAAA",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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n.face {\n\tdisplay: flex;\n\tflex-direction: column;\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\n\t}\n\n\t&__header {\n\t\tdisplay: flex;\n\t\tmin-height: 60px;\n\t\talign-items: center;\n\t\tjustify-content: space-between;\n\t\tposition: sticky;\n\t\ttop: var(--header-height);\n\t\tz-index: 3;\n\t\tbackground: var(--color-main-background);\n\t\tpadding: 0 64px;\n\n\t\t@media only screen and (max-width: 1020px) {\n\t\t\tpadding: 0;\n\t\t\tpadding-left: 64px;\n\t\t}\n\n\t\t&__left {\n\t\t\theight: 100%;\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\t\t}\n\n\t\t&__title {\n\t\t\tmargin-left: 10px;\n\t\t\th2 {\n\t\t\t\tmargin-bottom: 0;\n\t\t\t}\n\t\t}\n\n\t\t&__loader {\n\t\t\tmargin-left: 32px;\n\t\t}\n\n\t\t&__actions {\n\t\t\tdisplay: flex;\n\t\t\talign-items: center;\n\n\t\t\tbutton {\n\t\t\t\tmargin-left: 16px;\n\t\t\t}\n\t\t}\n\t}\n\n\t&__photos {\n\t\tmargin-top: 16px;\n\t\theight: 100%;\n\t\tmin-height: 0; // Prevent it from overflowing in a flex context.\n\t\tpadding: 0 64px;\n\n\t\t@media only screen and (max-width: 1020px) {\n\t\t\tpadding: 0;\n\t\t}\n\t}\n}\n\n.empty-content-with-illustration ::v-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\n.rename-form {\n\tdisplay: flex;\n\tflex-direction: row;\n\talign-items: center;\n\theight: 70px;\n\tpadding: 16px;\n\n\tinput {\n\t\twidth: 80%;\n\t}\n}\n'],sourceRoot:""}]);const c=i},12990:(n,e,t)=>{t.d(e,{Z:()=>a});const r={name:"AlertCircleIcon",props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};const a=(0,t(51900).Z)(r,(function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("span",n._b({staticClass:"material-design-icon alert-circle-icon",attrs:{"aria-hidden":!n.title,"aria-label":n.title,role:"img"},on:{click:function(e){return n.$emit("click",e)}}},"span",n.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:n.fillColor,width:n.size,height:n.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M13,13H11V7H13M13,17H11V15H13M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2Z"}},[n.title?t("title",[n._v(n._s(n.title))]):n._e()])])])}),[],!1,null,null,null).exports},24198:(n,e,t)=>{t.r(e),t.d(e,{default:()=>J});var r=t(20629),a=t(59466),o=t(78039),i=t(12990),c=t(46405),s=t(84796),l=t(75017);const u={name:"MergeIcon",props:{title:{type:String},fillColor:{type:String,default:"currentColor"},size:{type:Number,default:24}}};var f=t(51900);const d=(0,f.Z)(u,(function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("span",n._b({staticClass:"material-design-icon merge-icon",attrs:{"aria-hidden":!n.title,"aria-label":n.title,role:"img"},on:{click:function(e){return n.$emit("click",e)}}},"span",n.$attrs,!1),[t("svg",{staticClass:"material-design-icon__svg",attrs:{fill:n.fillColor,width:n.size,height:n.size,viewBox:"0 0 24 24"}},[t("path",{attrs:{d:"M8 17L12 13H15.2C15.6 14.2 16.7 15 18 15C19.7 15 21 13.7 21 12S19.7 9 18 9C16.7 9 15.6 9.8 15.2 11H12L8 7V3H3V8H6L10.2 12L6 16H3V21H8V17Z"}},[n.title?t("title",[n._v(n._s(n.title))]):n._e()])])])}),[],!1,null,null,null).exports;var p=t(41465),A=t(50335),m=t(33476),h=t(66951),g=t(98171),v=t(42408),C=t(53932),b=t(8702),_=t(59537),x=t(99751),F=t(20144),w=t(46116),y=t(79753);function k(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.push.apply(t,r)}return t}function O(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?k(Object(t),!0).forEach((function(e){S(n,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):k(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}function S(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}const j={name:"FaceMergeForm",components:{Loader:b.Z},mixins:[w.Z,x.Z],props:{firstFace:{type:String,required:!0}},data:function(){return{loading:!1}},computed:O(O({},(0,r.Se)(["files","faces","facesFiles"])),{},{filteredFaces:function(){var n=this;return Object.values(this.faces).filter((function(e){return e.basename!==n.firstFace})).sort((function(e,t){return n.facesFiles[t.basename]&&n.facesFiles[e.basename]?n.facesFiles[t.basename].length-n.facesFiles[e.basename].length:0}))}}),methods:{getCoverUrl:function(n){var e=this.getFaceCover(n);return e?(0,y.generateUrl)("/core/preview?fileId=".concat(e.fileid,"&x=",512,"&y=",512,"&forceIcon=0&a=1")):(this.fetchFaceContent(n),"")},handleSelect:function(n){this.$emit("select",n),this.loading=!0}}};var R=t(93379),B=t.n(R),Z=t(7795),M=t.n(Z),P=t(90569),D=t.n(P),E=t(3565),T=t.n(E),I=t(19216),N=t.n(I),W=t(44589),$=t.n(W),Y=t(30689),q={};q.styleTagTransform=$(),q.setAttributes=T(),q.insert=D().bind(null,"head"),q.domAPI=M(),q.insertStyleElement=N();B()(Y.Z,q);Y.Z&&Y.Z.locals&&Y.Z.locals;function L(n,e,t,r,a,o,i){try{var c=n[o](i),s=c.value}catch(n){return void t(n)}c.done?e(s):Promise.resolve(s).then(r,a)}function H(n){return function(){var e=this,t=arguments;return new Promise((function(r,a){var o=n.apply(e,t);function i(n){L(o,r,a,i,c,"next",n)}function c(n){L(o,r,a,i,c,"throw",n)}i(void 0)}))}}function z(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),t.push.apply(t,r)}return t}function V(n){for(var e=1;e<arguments.length;e++){var t=null!=arguments[e]?arguments[e]:{};e%2?z(Object(t),!0).forEach((function(e){G(n,e,t[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):z(Object(t)).forEach((function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(t,e))}))}return n}function G(n,e,t){return e in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}const U={name:"FaceContent",components:{FaceMergeForm:(0,f.Z)(j,(function(){var n=this,e=n.$createElement,t=n._self._c||e;return t("div",{staticClass:"merge-form face-list"},[n.loading?[t("Loader",{staticClass:"loader"})]:n._l(n.filteredFaces,(function(e){return t("div",{key:e.basename,staticClass:"face-list__item",on:{click:function(t){return n.handleSelect(e.basename)}}},[t("div",{staticClass:"face-list__item__crop-container"},[t("img",{staticClass:"face-list__item__image",style:n.getCoverStyle(e.basename),attrs:{src:n.getCoverUrl(e.basename)}})]),n._v(" "),t("div",{staticClass:"face-list__item__details"},[t("span",{class:{"hidden-visually":e.basename.match(/^[0-9]+$/)}},[n._v(n._s(e.basename))])])])}))],2)}),[],!1,null,"6af87af4",null).exports,Pencil:a.default,Star:c.default,Download:s.Z,Close:o.default,AlertCircle:i.Z,FilesListViewer:v.Z,File:C.Z,EmptyContent:m.EmptyContent,Loader:b.Z,Actions:m.Actions,ActionButton:m.ActionButton,Modal:m.Modal,Send:l.Z,Button:m.Button,Merge:d,ArrowLeft:p.default,AccountBoxMultipleOutline:A.Z},directives:{focus:function(n){F.ZP.nextTick((function(){return n.focus()}))}},mixins:[x.Z,h.Z,g.Z],props:{faceName:{type:String,default:"/"}},data:function(){return{showMergeModal:!1,showRenameModal:!1,loadingCount:0}},computed:V(V({},(0,r.Se)(["files","facesFiles"])),{},{face:function(){return this.faces[this.faceName]},faceFileIds:function(){return this.facesFiles[this.faceName]||[]},shouldFavoriteSelection:function(){var n=this;return this.selectedFileIds.some((function(e){return 0===n.$store.state.files.files[e].favorite}))}}),watch:{face:function(){this.face&&this.fetchFaceContent(this.faceName)}},methods:V(V({},(0,r.nv)(["appendFiles","deleteFace","renameFace","downloadFiles","toggleFavoriteForFiles","removeFilesFromFace","moveFilesToFace"])),{},{openViewer:function(n){var e=this,t=this.files[n];OCA.Viewer.open({path:t.filename,list:this.faceFileIds.map((function(n){return V(V({},e.files[n]),{},{basename:e.files[n].basename.split("-",2)[1]})})).filter((function(n){return!n.sectionHeader})),loadMore:t.loadMore?H(regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,t.loadMore(!0);case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}),n)}))):function(){return[]},canLoop:t.canLoop})},handleRemoveFilesFromFace:function(n){var e=this;return H(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.loadingCount++,t.next=4,e.removeFilesFromFace({faceName:e.faceName,fileIdsToRemove:n});case 4:e.resetSelection(),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),_.Z.error(t.t0);case 10:return t.prev=10,e.loadingCount--,t.finish(10);case 13:case"end":return t.stop()}}),t,null,[[0,7,10,13]])})))()},handleDeleteFace:function(){var n=this;return H(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n.loadingCount++,e.next=4,n.deleteFace({faceName:n.faceName});case 4:n.$router.push("/faces"),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),_.Z.error(e.t0);case 10:return e.prev=10,n.loadingCount--,e.finish(10);case 13:case"end":return e.stop()}}),e,null,[[0,7,10,13]])})))()},handleRenameFace:function(n){var e=this;return H(regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.loadingCount++,e.showRenameModal=!1,r=e.faceName,t.next=6,e.renameFace({oldName:r,faceName:n});case 6:e.$router.push({name:"facecontent",params:{faceName:n}}),t.next=12;break;case 9:t.prev=9,t.t0=t.catch(0),_.Z.error(t.t0);case 12:return t.prev=12,e.loadingCount--,t.finish(12);case 15:case"end":return t.stop()}}),t,null,[[0,9,12,15]])})))()},handleMerge:function(n){var e=this;return H(regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,e.loadingCount++,t.next=4,e.moveFilesToFace({oldFace:e.faceName,faceName:n,fileIdsToMove:e.facesFiles[e.faceName]});case 4:return t.next=6,e.deleteFace({faceName:e.faceName});case 6:e.showMergeModal=!1,e.$router.push({name:"facecontent",params:{faceName:n}}),t.next=13;break;case 10:t.prev=10,t.t0=t.catch(0),_.Z.error(t.t0);case 13:return t.prev=13,e.loadingCount--,t.finish(13);case 16:case"end":return t.stop()}}),t,null,[[0,10,13,16]])})))()},favoriteSelection:function(){var n=this;return H(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n.loadingCount++,e.next=4,n.toggleFavoriteForFiles({fileIds:n.selectedFileIds,favoriteState:!0});case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),_.Z.error(e.t0);case 9:return e.prev=9,n.loadingCount--,e.finish(9);case 12:case"end":return e.stop()}}),e,null,[[0,6,9,12]])})))()},unFavoriteSelection:function(){var n=this;return H(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n.loadingCount++,e.next=4,n.toggleFavoriteForFiles({fileIds:n.selectedFileIds,favoriteState:!1});case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),_.Z.error(e.t0);case 9:return e.prev=9,n.loadingCount--,e.finish(9);case 12:case"end":return e.stop()}}),e,null,[[0,6,9,12]])})))()},downloadSelection:function(){var n=this;return H(regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n.loadingCount++,e.next=4,n.downloadFiles(n.selectedFileIds);case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),_.Z.error(e.t0);case 9:return e.prev=9,n.loadingCount--,e.finish(9);case 12:case"end":return e.stop()}}),e,null,[[0,6,9,12]])})))()}})};var K=t(9744),X={};X.styleTagTransform=$(),X.setAttributes=T(),X.insert=D().bind(null,"head"),X.domAPI=M(),X.insertStyleElement=N();B()(K.Z,X);K.Z&&K.Z.locals&&K.Z.locals;const J=(0,f.Z)(U,(function(){var n=this,e=n.$createElement,t=n._self._c||e;return void 0!==n.face||n.loadingFiles||n.loadingFaces?n.errorFetchingFiles||n.errorFetchingFaces?t("EmptyContent",{scopedSlots:n._u([{key:"icon",fn:function(){return[t("AlertCircle")]},proxy:!0}])},[n._v("\n\t"+n._s(n.t("photos","An error occurred"))+"\n")]):t("div",{staticClass:"face"},[t("div",{staticClass:"face__header"},[t("div",{staticClass:"face__header__left"},[t("Actions",[t("ActionButton",{on:{click:function(e){return n.$router.push("/faces/")}},scopedSlots:n._u([{key:"icon",fn:function(){return[t("ArrowLeft")]},proxy:!0}])},[n._v(n._s(n.t("photos","Back"))+"\n\t\t\t\t")])],1),n._v(" "),t("div",{staticClass:"face__header__title"},[void 0!==n.face?t("h2",{class:{"face-name":!0,"hidden-visually":n.face.basename.match(/^[0-9]+$/)}},[n._v("\n\t\t\t\t\t"+n._s(n.face.basename)+"\n\t\t\t\t")]):n._e()]),n._v(" "),n.loadingCount>0||n.loadingFaces?t("Loader"):n._e()],1),n._v(" "),void 0!==n.face?t("div",{staticClass:"face__header__actions"},[t("Actions",[t("ActionButton",{attrs:{"close-after-click":!0,"aria-label":n.t("photos","Rename person")},on:{click:function(e){n.showRenameModal=!0}},scopedSlots:n._u([{key:"icon",fn:function(){return[t("Pencil")]},proxy:!0}],null,!1,514409694)},[n._v("\n\t\t\t\t\t"+n._s(n.t("photos","Rename person"))+"\n\t\t\t\t")])],1),n._v(" "),t("Actions",{attrs:{"force-menu":!0}},[Object.keys(n.faces).length>1?t("ActionButton",{attrs:{"close-after-click":!0,"aria-label":n.t("photos","Merge with different person")},on:{click:function(e){n.showMergeModal=!0}},scopedSlots:n._u([{key:"icon",fn:function(){return[t("Merge")]},proxy:!0}],null,!1,3117189691)},[n._v("\n\t\t\t\t\t"+n._s(n.t("photos","Merge with different person"))+"\n\t\t\t\t")]):n._e(),n._v(" "),n.selectedFileIds.length?[t("ActionButton",{attrs:{"close-after-click":!0,"aria-label":n.t("photos","Download selected files")},on:{click:n.downloadSelection}},[t("Download",{attrs:{slot:"icon"},slot:"icon"}),n._v("\n\t\t\t\t\t\t"+n._s(n.t("photos","Download selected photos"))+"\n\t\t\t\t\t")],1),n._v(" "),n.shouldFavoriteSelection?t("ActionButton",{attrs:{"close-after-click":!0,"aria-label":n.t("photos","Mark selection as favorite")},on:{click:n.favoriteSelection}},[t("Star",{attrs:{slot:"icon"},slot:"icon"}),n._v("\n\t\t\t\t\t\t"+n._s(n.t("photos","Favorite"))+"\n\t\t\t\t\t")],1):t("ActionButton",{attrs:{"close-after-click":!0,"aria-label":n.t("photos","Remove selection from favorites")},on:{click:n.unFavoriteSelection}},[t("Star",{attrs:{slot:"icon"},slot:"icon"}),n._v("\n\t\t\t\t\t\t"+n._s(n.t("photos","Remove from favorites"))+"\n\t\t\t\t\t")],1),n._v(" "),t("ActionButton",{attrs:{"close-after-click":!0},on:{click:function(e){return n.handleRemoveFilesFromFace(n.selectedFileIds)}},scopedSlots:n._u([{key:"icon",fn:function(){return[t("Close")]},proxy:!0}],null,!1,1051939733)},[n._v("\n\t\t\t\t\t\t"+n._s(n.n("photos","Remove photo from person","Remove photos from person",n.selectedFileIds.length))+"\n\t\t\t\t\t")])]:n._e(),n._v(" "),t("ActionButton",{attrs:{"close-after-click":!0},on:{click:n.handleDeleteFace},scopedSlots:n._u([{key:"icon",fn:function(){return[t("Close")]},proxy:!0}],null,!1,1051939733)},[n._v("\n\t\t\t\t\t"+n._s(n.t("photos","Remove person"))+"\n\t\t\t\t")])],2)],1):n._e()]),n._v(" "),void 0!==n.face?t("FilesListViewer",{staticClass:"face__photos",attrs:{"use-window":!0,"file-ids":n.faceFileIds,loading:n.loadingFiles||n.loadingFaces},scopedSlots:n._u([{key:"default",fn:function(e){var r=e.file,a=e.visibility;return t("File",{attrs:{file:n.files[r.id],"allow-selection":!0,selected:!0===n.selection[r.id],visibility:a,semaphore:n.semaphore},on:{click:n.openViewer,"select-toggled":n.onFileSelectToggle}})}}],null,!1,3592900521)}):n._e(),n._v(" "),n.showRenameModal?t("Modal",{attrs:{title:n.t("photos","Rename person")},on:{close:function(e){n.showRenameModal=!1}}},[t("div",{staticClass:"rename-form"},[t("input",{directives:[{name:"focus",rawName:"v-focus"}],ref:"nameInput",attrs:{type:"text",name:"name",required:"",placeholder:n.t("photos","Name of this person")},domProps:{value:n.faceName},on:{keydown:function(e){return!e.type.indexOf("key")&&n._k(e.keyCode,"enter",13,e.key,"Enter")?null:n.handleRenameFace(n.$refs.nameInput.value)}}}),n._v(" "),t("Button",{attrs:{"aria-label":n.t("photos","Save."),type:"primary",disabled:n.$refs.nameInput&&""===n.$refs.nameInput.value.trim()},on:{click:function(e){return n.handleRenameFace(n.$refs.nameInput.value)}},scopedSlots:n._u([{key:"icon",fn:function(){return[n.loadingCount?t("Loader"):t("Send")]},proxy:!0}],null,!1,3935163698)},[n._v("\n\t\t\t\t"+n._s(n.t("photos","Save"))+"\n\t\t\t")])],1)]):n._e(),n._v(" "),n.showMergeModal?t("Modal",{attrs:{title:n.t("photos","Merge person")},on:{close:function(e){n.showMergeModal=!1}}},[t("FaceMergeForm",{attrs:{"first-face":n.faceName},on:{select:function(e){return n.handleMerge(e)}}})],1):n._e()],1):t("EmptyContent",{staticClass:"empty-content-with-illustration",scopedSlots:n._u([{key:"icon",fn:function(){return[t("AccountBoxMultipleOutline")]},proxy:!0}],null,!1,2861705255)},[n._v("\n\t"+n._s(n.t("photos","This person could not be found"))+"\n")])}),[],!1,null,"bbffc378",null).exports}}]);
//# sourceMappingURL=photos-src_views_FaceContent_vue.js.map?v=df98cfe7425a327719e5