import{d as s,f as r,t as a,k as l}from"./preload-helper-DadE4qT2.chunk.mjs";import{j as n,q as i,u as m,v as u,w as p}from"./index-CTabiXQG.chunk.mjs";import{N as c}from"./NcEmptyContent-nvOtdNB6.chunk.mjs";import{C as b,I as f,P as h,n as d}from"./icons-CFZwNZD8.chunk.mjs";import{A as C}from"./AlbumForm-B5mdjlOf.chunk.mjs";import{C as _,a as y}from"./CollectionsList-CiLe-XYk.chunk.mjs";import{H as v}from"./HeaderNavigation-DJYxed00.chunk.mjs";import{F as g}from"./FetchCollectionsMixin-Cpz_5SEM.chunk.mjs";import"./index-BCevi9E9.chunk.mjs";import"./createElementId-DhjFt1I9-B2HCdIOx.chunk.mjs";import"./NcTextField-CfZknuqx-C5cYwRpX.chunk.mjs";import"./useModelMigration-EhAWvqDD-Zhby4giX.chunk.mjs";import"./PhotosFiltersInput-7yzIZFFy.chunk.mjs";import"./NcSelect-DTniMiUS-B4Evo1tl.chunk.mjs";import"./NcAvatar-D5nljVEA-v3fM8YER.chunk.mjs";import"./NcActionButton-DykQxmXJ-CTbph1Ex.chunk.mjs";import"./NcDateTimePicker-C-e6Oa1e.chunk.mjs";import"./useFormatDateTime-DuMg0AS_.chunk.mjs";import"./NcDateTime-enXYuwj8-CrCRQy-Y.chunk.mjs";import"./collectionFetcher-umd8irlb.chunk.mjs";import"./video-BSG4kMCj.chunk.mjs";import"./index-x9vhq81Z.chunk.mjs";import"./NcSelectUsers-RyUVUaWQ-YWvYp84K.chunk.mjs";import"./FetchCollectionContentMixin-lypnRdPc.chunk.mjs";import"./AbortControllerMixin-Bb5X6Yae.chunk.mjs";const A=s({name:"AlbumsView",components:{Plus:h,ImageMultipleOutline:f,NcModal:i,NcButton:n,NcEmptyContent:c,CollectionsList:y,CollectionCover:_,HeaderNavigation:v,AlbumForm:C,CogOutline:b},filters:{coverUrl(t){return t===-1?"":l(`/apps/photos/api/v1/preview/${t}?x=512&y=512`)}},mixins:[g],setup(){return{isMobile:p()}},data(){return{showAlbumCreationForm:!1}},computed:{albums(){return this.$store.getters.albums}},async beforeMount(){this.fetchAlbums()},methods:{fetchAlbums(){this.fetchCollections(m,u)},handleAlbumCreated({album:t}){this.showAlbumCreationForm=!1,this.$router.push(`/albums/${t.basename}`)},t:a,n:r}});var N=function(){var t=this,o=t._self._c;return t._self._setupProxy,o("div",[o("CollectionsList",{staticClass:"albums-list",attrs:{collections:t.albums,loading:t.loadingCollections,error:t.errorFetchingCollections},scopedSlots:t._u([{key:"header",fn:function(){return[o("HeaderNavigation",{key:"navigation",attrs:{loading:t.loadingCollections,title:t.t("photos","Albums"),"root-title":t.t("photos","Albums")},on:{refresh:t.fetchAlbums}},[o("NcButton",{attrs:{"aria-label":t.isMobile?t.t("photos","New album"):void 0},on:{click:function(e){t.showAlbumCreationForm=!0}},scopedSlots:t._u([{key:"icon",fn:function(){return[o("Plus",{attrs:{size:20}})]},proxy:!0},t.isMobile?null:{key:"default",fn:function(){return[t._v(" "+t._s(t.t("photos","New album"))+" ")]},proxy:!0}],null,!0)})],1)]},proxy:!0},{key:"default",fn:function({collection:e}){return[o("CollectionCover",{key:e.basename,attrs:{"parent-route":"/albums","collection-name":e.basename,"alt-img":t.t("photos","Cover photo for album {albumName}",{albumName:e.basename}),"cover-url":t._f("coverUrl")(e.attributes["last-photo"])},scopedSlots:t._u([{key:"default",fn:function(){return[o("span",{staticClass:"album__name"},[t._v(" "+t._s(e.basename)+" ")]),Object.keys(e.attributes.filters).length!==0?o("CogOutline",{attrs:{"fill-color":"var(--color-text-lighter)"}}):t._e()]},proxy:!0},{key:"subtitle",fn:function(){return[o("div",{staticClass:"album__details"},[t._v(" "+t._s(e.attributes.date)+" ⸱ "+t._s(t.n("photos","%n item","%n photos and videos",e.attributes.nbItems))+" ")])]},proxy:!0}],null,!0)})]}},{key:"empty-collections-list",fn:function(){return[o("NcEmptyContent",{attrs:{name:t.t("photos","There is no album yet!")},scopedSlots:t._u([{key:"icon",fn:function(){return[o("ImageMultipleOutline")]},proxy:!0}])})]},proxy:!0}])}),t.showAlbumCreationForm?o("NcModal",{attrs:{"label-id":"new-album-form"},on:{close:function(e){t.showAlbumCreationForm=!1}}},[o("h2",{staticClass:"album-creation__heading"},[t._v(" "+t._s(t.t("photos","New album"))+" ")]),o("AlbumForm",{on:{done:t.handleAlbumCreated}})],1):t._e()],1)},k=[],x=d(A,N,k,!1,null,"aaa5b5ca");const X=x.exports;export{X as default};
//# sourceMappingURL=AlbumsView-Btisvx5l.chunk.mjs.map
