photos/js/photos-src_services_Albums_...

3 lines
19 KiB
JavaScript

/*! For license information please see photos-src_services_Albums_js-src_components_HeaderNavigation_vue.js.LICENSE.txt */
"use strict";(self.webpackChunkphotos=self.webpackChunkphotos||[]).push([["src_services_Albums_js-src_components_HeaderNavigation_vue"],{99622:(t,n,r)=>{r.d(n,{CE:()=>C,Lc:()=>x,Lz:()=>y});var e=r(80351),o=r.n(e),a=r(9944),i=r(81067),s=r(59537),c=r(2161),u=r(94236),l=r(25108);function p(){p=function(){return t};var t={},n=Object.prototype,r=n.hasOwnProperty,e=Object.defineProperty||function(t,n,r){t[n]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(t,n,r){return Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{c({},"")}catch(t){c=function(t,n,r){return t[n]=r}}function u(t,n,r,o){var a=n&&n.prototype instanceof g?n:g,i=Object.create(a.prototype),s=new L(o||[]);return e(i,"_invoke",{value:w(t,r,s)}),i}function l(t,n,r){try{return{type:"normal",arg:t.call(n,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=u;var h={};function g(){}function f(){}function d(){}var m={};c(m,a,(function(){return this}));var A=Object.getPrototypeOf,y=A&&A(A(O([])));y&&y!==n&&r.call(y,a)&&(m=y);var b=d.prototype=g.prototype=Object.create(m);function C(t){["next","throw","return"].forEach((function(n){c(t,n,(function(t){return this._invoke(n,t)}))}))}function _(t,n){function o(e,a,i,s){var c=l(t[e],t,a);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==v(p)&&r.call(p,"__await")?n.resolve(p.__await).then((function(t){o("next",t,i,s)}),(function(t){o("throw",t,i,s)})):n.resolve(p).then((function(t){u.value=t,i(u)}),(function(t){return o("throw",t,i,s)}))}s(c.arg)}var a;e(this,"_invoke",{value:function(t,r){function e(){return new n((function(n,e){o(t,r,n,e)}))}return a=a?a.then(e,e):e()}})}function w(t,n,r){var e="suspendedStart";return function(o,a){if("executing"===e)throw new Error("Generator is already running");if("completed"===e){if("throw"===o)throw a;return T()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var s=x(i,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===e)throw e="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);e="executing";var c=l(t,n,r);if("normal"===c.type){if(e=r.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(e="completed",r.method="throw",r.arg=c.arg)}}}function x(t,n){var r=t.iterator[n.method];if(void 0===r){if(n.delegate=null,"throw"===n.method){if(t.iterator.return&&(n.method="return",n.arg=void 0,x(t,n),"throw"===n.method))return h;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var e=l(r,t.iterator,n.arg);if("throw"===e.type)return n.method="throw",n.arg=e.arg,n.delegate=null,h;var o=e.arg;return o?o.done?(n[t.resultName]=o.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=void 0),n.delegate=null,h):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,h)}function E(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function k(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function L(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(E,this),this.reset(!0)}function O(t){if(t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,o=function n(){for(;++e<t.length;)if(r.call(t,e))return n.value=t[e],n.done=!1,n;return n.value=void 0,n.done=!0,n};return o.next=o}}return{next:T}}function T(){return{value:void 0,done:!0}}return f.prototype=d,e(b,"constructor",{value:d,configurable:!0}),e(d,"constructor",{value:f,configurable:!0}),f.displayName=c(d,s,"GeneratorFunction"),t.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===f||"GeneratorFunction"===(n.displayName||n.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,d):(t.__proto__=d,c(t,s,"GeneratorFunction")),t.prototype=Object.create(b),t},t.awrap=function(t){return{__await:t}},C(_.prototype),c(_.prototype,i,(function(){return this})),t.AsyncIterator=_,t.async=function(n,r,e,o,a){void 0===a&&(a=Promise);var i=new _(u(n,r,e,o),a);return t.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},C(b),c(b,s,"Generator"),c(b,a,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var n=Object(t),r=[];for(var e in n)r.push(e);return r.reverse(),function t(){for(;r.length;){var e=r.pop();if(e in n)return t.value=e,t.done=!1,t}return t.done=!0,t}},t.values=O,L.prototype={constructor:L,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(k),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function e(r,e){return i.type="throw",i.arg=t,n.next=r,e&&(n.method="next",n.arg=void 0),!!e}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return e("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return e(a.catchLoc,!0);if(this.prev<a.finallyLoc)return e(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return e(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return e(a.finallyLoc)}}}},abrupt:function(t,n){for(var e=this.tryEntries.length-1;e>=0;--e){var o=this.tryEntries[e];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=n&&n<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=n,a?(this.method="next",this.next=a.finallyLoc,h):this.complete(i)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),h},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),k(r),h}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var e=r.completion;if("throw"===e.type){var o=e.arg;k(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:O(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},t}function h(t,n){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(t);n&&(e=e.filter((function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable}))),r.push.apply(r,e)}return r}function g(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?h(Object(r),!0).forEach((function(n){f(t,n,r[n])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):h(Object(r)).forEach((function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))}))}return t}function f(t,n,r){return n in t?Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[n]=r,t}function v(t){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},v(t)}function d(t,n,r,e,o,a,i){try{var s=t[a](i),c=s.value}catch(t){return void r(t)}s.done?n(c):Promise.resolve(c).then(e,o)}function m(t){return function(){var n=this,r=arguments;return new Promise((function(e,o){var a=t.apply(n,r);function i(t){d(a,e,o,i,s,"next",t)}function s(t){d(a,e,o,i,s,"throw",t)}i(void 0)}))}}function A(){return'<?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<nc:location />\n\t\t\t\t\t<nc:dateRange />\n\t\t\t\t\t<nc:collaborators />\n\t\t\t\t\t'.concat(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"","\n\t\t\t\t</d:prop>\n\t\t\t</d:propfind>")}function y(t,n){return b.apply(this,arguments)}function b(){return b=m(p().mark((function t(n,r){var e,o,a,c=arguments;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=c.length>2&&void 0!==c[2]?c[2]:"",o=c.length>3&&void 0!==c[3]?c[3]:i.ZP,t.prev=2,t.next=5,o.stat(n,g({data:A(e),details:!0},r));case 5:return a=t.sent,s.Z.debug("[Albums] Fetched an album: ",{data:a.data}),t.abrupt("return",w(a.data));case 10:if(t.prev=10,t.t0=t.catch(2),"ERR_CANCELED"!==t.t0.code){t.next=14;break}return t.abrupt("return",null);case 14:throw t.t0;case 15:case"end":return t.stop()}}),t,null,[[2,10]])}))),b.apply(this,arguments)}function C(t,n){return _.apply(this,arguments)}function _(){return _=m(p().mark((function t(n,r){var e,o,a,c=arguments;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=c.length>2&&void 0!==c[2]?c[2]:"",o=c.length>3&&void 0!==c[3]?c[3]:i.ZP,t.prev=2,t.next=5,o.getDirectoryContents(n,g({data:A(e),details:!0},r));case 5:return a=t.sent,s.Z.debug("[Albums] Fetched ".concat(a.data.length," albums: "),{data:a.data}),t.abrupt("return",a.data.filter((function(t){return t.filename!==n})).map(w));case 10:if(t.prev=10,t.t0=t.catch(2),"ERR_CANCELED"!==t.t0.code){t.next=14;break}return t.abrupt("return",[]);case 14:throw t.t0;case 15:case"end":return t.stop()}}),t,null,[[2,10]])}))),_.apply(this,arguments)}function w(t){var n,r;""===t.props.collaborators?t.props.collaborators=[]:"object"===v(t.props.collaborators.collaborator)&&(Array.isArray(t.props.collaborators.collaborator)?t.props.collaborators=t.props.collaborators.collaborator:t.props.collaborators=[t.props.collaborators.collaborator]),t=(0,u.AX)(t);var e=JSON.parse(null!==(n=null===(r=t.dateRange)||void 0===r?void 0:r.replace(/&quot;/g,'"'))&&void 0!==n?n:"{}");null===e.start&&(e.start=o()().unix(),e.end=o()().unix());var i={startDate:o().unix(e.start).format("MMMM YYYY"),endDate:o().unix(e.end).format("MMMM YYYY")};return t.date=i.startDate===i.endDate?i.startDate:(0,a.translate)("photos","{startDate} to {endDate}",i),t}function x(t,n){return E.apply(this,arguments)}function E(){return E=m(p().mark((function t(n,r){var e,o,a,h=arguments;return p().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return e=h.length>2&&void 0!==h[2]?h[2]:i.ZP,t.prev=1,t.next=4,e.getDirectoryContents(n,g({data:c.Z,details:!0},r));case 4:return o=t.sent,a=o.data.map((function(t){return(0,u.AX)(t)})).filter((function(t){return t.fileid})),s.Z.debug("[Albums] Fetched ".concat(a.length," new files: "),a),t.abrupt("return",a);case 10:if(t.prev=10,t.t0=t.catch(1),"ERR_CANCELED"!==t.t0.code){t.next=14;break}return t.abrupt("return",[]);case 14:throw s.Z.error("Error fetching album files",{error:t.t0}),l.error(t.t0),t.t0;case 17:case"end":return t.stop()}}),t,null,[[1,10]])}))),E.apply(this,arguments)}},28262:(t,n,r)=>{r.d(n,{Z:()=>s});var e=r(87537),o=r.n(e),a=r(23645),i=r.n(a)()(o());i.push([t.id,":root{--photos-navigation-height: 64px;--photos-navigation-spacing: calc((var(--photos-navigation-height) - 44px) / 2)}button.app-navigation-toggle{top:0 !important;right:calc(var(--photos-navigation-height)*-1) !important;margin:var(--photos-navigation-spacing) !important}","",{version:3,sources:["webpack://./src/components/HeaderNavigation.vue"],names:[],mappings:"AAEA,MACC,gCAAA,CAEA,+EAAA,CAID,6BAEC,gBAAA,CACA,yDAAA,CACA,kDAAA",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:root {\n\t--photos-navigation-height: 64px;\n\t// header height - button size\n\t--photos-navigation-spacing: calc((var(--photos-navigation-height) - 44px) / 2);\n}\n\n// Properly position the navigation toggle button\nbutton.app-navigation-toggle {\n\t// App-navigation have a 4px margin top\n\ttop: 0 !important;\n\tright: calc(var(--photos-navigation-height) * -1) !important;\n\tmargin: var(--photos-navigation-spacing) !important;\n}\n\n'],sourceRoot:""}]);const s=i},24620:(t,n,r)=>{r.d(n,{Z:()=>s});var e=r(87537),o=r.n(e),a=r(23645),i=r.n(a)()(o());i.push([t.id,".photos-navigation[data-v-809e621a]{position:-webkit-sticky;position:sticky;z-index:20;top:0;display:flex;align-items:center;width:100%;min-height:var(--photos-navigation-height);padding:0 var(--photos-navigation-height);background:var(--color-main-background)}.photos-navigation__back[data-v-809e621a]{position:absolute !important;left:0;margin:var(--photos-navigation-spacing) !important}.photos-navigation__title[data-v-809e621a]{max-width:50%;margin-right:calc(2*var(--photos-navigation-spacing));display:flex;flex-direction:column}.photos-navigation__title__main[data-v-809e621a]{margin:0;cursor:pointer}.photos-navigation__title__main[data-v-809e621a],.photos-navigation__title__sub[data-v-809e621a]{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.photos-navigation__loader[data-v-809e621a]{margin-left:32px}.photos-navigation__content-right[data-v-809e621a]{display:flex;align-items:center;justify-content:center;margin-left:auto}","",{version:3,sources:["webpack://./src/components/HeaderNavigation.vue"],names:[],mappings:"AAEA,oCACC,uBAAA,CAAA,eAAA,CACA,UAAA,CACA,KAAA,CACA,YAAA,CACA,kBAAA,CACA,UAAA,CACA,0CAAA,CACA,yCAAA,CACA,uCAAA,CAEA,0CAEC,4BAAA,CACA,MAAA,CACA,kDAAA,CAGD,2CACC,aAAA,CACA,qDAAA,CACA,YAAA,CACA,qBAAA,CAEA,iDACC,QAAA,CACA,cAAA,CAGD,iGACC,eAAA,CACA,kBAAA,CACA,sBAAA,CAIF,4CACC,gBAAA,CAGD,mDACC,YAAA,CACA,kBAAA,CACA,sBAAA,CACA,gBAAA",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\talign-items: center;\n\twidth: 100%;\n\tmin-height: var(--photos-navigation-height);\n\tpadding: 0 var(--photos-navigation-height);\n\tbackground: var(--color-main-background);\n\n\t&__back {\n\t\t// Above the navigation menu\n\t\tposition: absolute !important;\n\t\tleft: 0;\n\t\tmargin: var(--photos-navigation-spacing) !important;\n\t}\n\n\t&__title {\n\t\tmax-width: 50%;\n\t\tmargin-right: calc(2 * var(--photos-navigation-spacing));\n\t\tdisplay: flex;\n\t\tflex-direction: column;\n\n\t\t&__main {\n\t\t\tmargin: 0;\n\t\t\tcursor: pointer;\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-left: 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-left: auto;\n\t}\n}\n\n'],sourceRoot:""}]);const s=i},71823:(n,r,e)=>{e.d(r,{Z:()=>w});var o=e(24823),a=e(15961);const i={name:"HeaderNavigation",components:{ArrowLeft:o.default,NcButton:a.P2,NcLoadingIcon:a.lb},inheritAttrs:!1,props:{loading:{type:Boolean,default:!1},path:{type:String,default:"/"},title:{type:String,required:!0},rootTitle:{type:String,default:t("photos","Photos")},params:{type:Object,default:null}},computed:{isRoot:function(){var t="/"===this.path;return this.toggleNavigationButton(!t),t},name:function(){return this.isRoot?this.rootTitle:this.title},parentPath:function(){var t=this.path.split("/");t.pop();var n=t.join("/");return this.isRoot||""===n.trim()?"/":t.join("/")},parentName:function(){return this.parentPath&&this.parentPath.split("/").pop()},backToText:function(){return"/"===this.parentPath?t("photos","Back to {folder}",{folder:this.rootTitle}):t("photos","Back to {folder}",{folder:this.parentName})},to:function(){var t=/^\/?(.*)/i.exec(this.parentPath)[1],n=Object.assign({},this.$route,{params:this.params||{path:t}}),r=n.name,e=n.params;return""===t?{name:r}:decodeURIComponent(this.$router.resolve({name:r,params:e}).resolved.path)}},methods:{folderUp:function(){this.$router.push(this.to)},refresh:function(){this.$emit("refresh")},toggleNavigationButton:function(t){var n=document.querySelector("button.app-navigation-toggle");null!==n&&(n.style.display=t?"none":null)}}};var s=e(93379),c=e.n(s),u=e(7795),l=e.n(u),p=e(90569),h=e.n(p),g=e(3565),f=e.n(g),v=e(19216),d=e.n(v),m=e(44589),A=e.n(m),y=e(28262),b={};b.styleTagTransform=A(),b.setAttributes=f(),b.insert=h().bind(null,"head"),b.domAPI=l(),b.insertStyleElement=d();c()(y.Z,b);y.Z&&y.Z.locals&&y.Z.locals;var C=e(24620),_={};_.styleTagTransform=A(),_.setAttributes=f(),_.insert=h().bind(null,"head"),_.domAPI=l(),_.insertStyleElement=d();c()(C.Z,_);C.Z&&C.Z.locals&&C.Z.locals;const w=(0,e(51900).Z)(i,(function(){var t=this,n=t._self._c;return n("div",{staticClass:"photos-navigation",class:{"photos-navigation--root":t.isRoot},attrs:{role:"toolbar"}},[t.isRoot?t._e():n("NcButton",{staticClass:"photos-navigation__back",attrs:{type:"tertiary"},on:{click:t.folderUp},scopedSlots:t._u([{key:"icon",fn:function(){return[n("ArrowLeft",{attrs:{size:20}})]},proxy:!0}],null,!1,1821202730)}),t._v(" "),n("div",{staticClass:"photos-navigation__title"},[n("h2",{staticClass:"photos-navigation__title__main",on:{click:t.refresh}},[t._v("\n\t\t\t"+t._s(t.name)+"\n\t\t")]),t._v(" "),n("div",{staticClass:"photos-navigation__title__sub"}),t._v(" "),t._t("subtitle")],2),t._v(" "),t.$slots.default?n("div",{staticClass:"photos-navigation__content"},[t._t("default")],2):t._e(),t._v(" "),n("NcLoadingIcon",{directives:[{name:"show",rawName:"v-show",value:t.loading,expression:"loading"}],staticClass:"photos-navigation__loader"}),t._v(" "),n("div",{staticClass:"photos-navigation__content-right"},[t._t("right")],2)],1)}),[],!1,null,"809e621a",null).exports}}]);
//# sourceMappingURL=photos-src_services_Albums_js-src_components_HeaderNavigation_vue.js.map?v=544968b6ac4e8528d577