Vue.component("album-access-abbr",{props:{access:{type:Object,required:!0}},template:'\t\t
\t\t\t\t\t\t\t\t
\t',computed:{albumAccessInfoText:function(){var key="";switch(!0){case!this.access.public&&this.access.urlAccessEnabled&&this.access.nsfw:key="album_access.private_url_access_nsfw";break;case!this.access.public&&this.access.urlAccessEnabled:key="album_access.private_url_access";break;case!this.access.public&&this.access.nsfw:key="album_access.private_nsfw";break;case!this.access.public:key="album_access.private";break;case this.access.public&&this.access.nsfw:key="album_access.public_nsfw";break;case this.access.public:key="album_access.public"}return i18next.t(key)}}}),Vue.component("album-access-icon-info",{props:{access:{type:Object,required:!0}},template:'\t\t
\t\t\t
\t\t\t\t\t\t\t
\t\t\t
\t\t\t\t\t\t\t
\t\t\t
\t\t\t\t\t\t\t
\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t
\t',computed:{albumAccessTypeText:function(){var key="";switch(!0){case!this.access.public&&this.access.urlAccessEnabled&&this.access.nsfw:key="album_access.type.private_url_access_nsfw";break;case!this.access.public&&this.access.urlAccessEnabled:key="album_access.type.private_url_access";break;case!this.access.public&&this.access.nsfw:key="album_access.type.private_nsfw";break;case!this.access.public:key="album_access.type.private";break;case this.access.public&&this.access.nsfw:key="album_access.type.public_nsfw";break;case this.access.public:key="album_access.type.public"}return i18next.t(key)},iconStyle:function(){return{width:"24px",height:"24px","flex-shrink":0}}}}),Vue.component("album-add-file-button",{template:'\t\t\t',computed:{isAlbumFull:function(){return this.$store.state.albumGallery.media.length>=this.$store.state.albumGallery.mediaLimit},classes:function(){return{disabled:this.isAlbumFull}},getTitle:function(){return this.isAlbumFull?i18next.t("general.error_messages.full_album"):""}},methods:{selectFiles:function(){window.dispatchEvent(new CustomEvent("album-gallery-select-files"))}}}),Vue.component("album-card",{props:{album:{type:Object,required:!0},media:{type:Object,required:!1,default:[]},cols:{type:Number,default:3,required:!1},totalMediaCount:{type:Number,required:!1,default:0},eventGroup:{type:Object,required:!1}},data:function(){return{i18next:i18next}},template:'\t\t
\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t
\t\t\t
\t\t
\t',computed:{id:function(){return"a-"+this.album.albumID},isNsfw:function(){return this.album.is_nsfw&&this.settings.enable_nsfw_warning},classes:function(){var result=this.isNsfw?"nsfw-album ":"";switch(this.cols){case 1:result+="col-sm-12";break;case 2:result+="col-sm-6";break;case 3:result+="col-sm-6 col-lg-4";break;default:result+="col-sm-6 col-md-4 col-lg-3"}return result},backgroundClass:function(){var ratio=0;return{contain:0<(ratio=this.album.cover_medium?0\t\t\t\t\t\t',computed:{confirmationText:function(){return i18next.t("delete_album.confirmation_text",{album_name:this.album.name})}},mounted:function(){var self=this;Vue.nextTick(function(){var modal=$(self.$refs.modal);modal.modal("show"),modal.on("hidden.bs.modal",function(){self.$store.commit("showAlbumDeleteConfirmModal",!1)})})},methods:{deleteAlbum:function(){this.$store.dispatch("deleteAlbum")}}}),Vue.component("album-delete-medium-box",{data:function(){return{saving:!1,timeout:null}},template:'\t\t
\t\t\t
\t\t\t\t

\t\t\t\t

\t\t\t\t\t\t\t\t\t\t\t
\t\t\t
\t\t\t\t

\t\t\t\t\t\t\t\t\t\t\t\t\t\t

\t\t\t
\t\t
\t',computed:{mediaToDelete:function(){return this.$store.state.albumGallery.mediaToDelete},hasMediaToDelete:function(){return 0\t\t\t
\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t

\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t

\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t

\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t

\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t
\t\t\t
\t\t\t',computed:{album:function(){return this.$store.state.album},initialized:function(){return this.$store.state.initialized.albumInfo},media:function(){return this.$store.state.media},pending:function(){return this.$store.state.pending},medium:function(){return this.$store.state.medium},editingMedium:function(){return this.medium.selected},isLastMedium:function(){return Number(this.media[this.media.length-1].photoID)===Number(this.editingMedium.photoID)},suggestedTags:function(){return this.$store.state.suggestedTags},albumSecurityClass:function(){return{hidden:this.album.settings.hidden,locked:this.album.settings.locked,nsfw:this.album.settings.access.nsfw}},albumNameClass:function(){return{"has-danger":this.showErrors&&!this.validator.name,"has-warning":!this.validator.nameCheck}},showErrors:function(){return this.$store.state.show.albumSettingsErrors},validator:function(){return this.$store.getters.albumSettingsValidator},isLegacySecurityAlbum:function(){return 1===this.$store.state.album.settings.access.version}},methods:{getChangedData:function(){var data={},name=this.album.name&&this.album.name.trim(),description=this.album.description&&this.album.description.trim(),visible=this.album.settings.hidden?0:1,secure=this.album.settings.locked?1:0,secureName=this.album.settings.secureName&&this.album.settings.secureName.trim(),securePass=this.album.settings.securePass&&this.album.settings.securePass.trim(),nsfw=this.album.settings.access.nsfw?1:0;return name!==this.album.oldInfo.name&&(data.name=this.album.oldInfo.name=name),description!==this.album.oldInfo.description&&(data.description=this.album.oldInfo.description=description),visible!==this.album.oldInfo.visible&&(data.is_visible=this.album.oldInfo.visible=visible),secure===this.album.oldInfo.secure&&secureName===this.album.oldInfo.secureName&&securePass===this.album.oldInfo.securePass||(data.is_secure=this.album.oldInfo.secure=secure,data.secure_name=this.album.oldInfo.secureName=secureName,data.secure_code=this.album.oldInfo.securePass=securePass),nsfw!==this.album.oldInfo.is_nsfw&&(data.is_nsfw=this.album.oldInfo.is_nsfw=nsfw),data},addSuggestedTag:function(index){var tag=this.suggestedTags[index],tag=this.album.description+" #"+tag;this.$store.commit("setAlbumDescription",tag),this.$store.commit("removeSuggestedTag",index),this.saveAlbumInfo(!1)},saveAlbumInfo:function(force){var self=this;this.$store.commit("setPendingAlbumInfoSave",!0),this.$store.commit("setSaveAlbumInfoTimeout",{callback:function(){var data=self.getChangedData();self.$store.dispatch("saveAlbumInfo",data)},timeout:force?0:2e3})},checkAlbumName:function(){this.$store.dispatch("checkAlbumName"),this.saveAlbumInfo(!1)},showSharingModal:function(){this.$store.commit("sharingModal/showSharingModal",null)},showCopyLinkModal:function(){this.$store.commit("sharingModal/showCopyLinkModal")},showAlbumSettingsMobile:function(){this.$store.commit("showAlbumSettingsMobile",!0)}}}),Vue.component("album-draft-commit-button",{data:function(){return{commitRequested:!1}},template:'\t\t
\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t
\t',computed:{album:function(){return this.$store.state.album},pending:function(){return this.$store.state.pending},uploading:function(){return this.$store.state.albumGallery.uploading},saving:function(){return this.$store.state.albumGallery.saving},editHistory:function(){return this.$store.state.albumGallery.editHistory},validator:function(){return this.$store.getters.albumSettingsValidator},showErrors:function(){return this.$store.state.show.albumSettingsErrors},isAlbumSettingsValid:function(){return this.album.settings.locked?this.validator.name&&this.validator.secure.name&&this.validator.secure.pass:this.validator.name},pendingChanges:function(){return this.pending.saveAlbumInfo||this.pending.saveMediumInfo||this.pending.albumNameCheck},isCommitButtonDisabled:function(){return!(!this.uploading&&!this.editHistory.length)||!this.isAlbumSettingsValid&&this.showErrors},classes:function(){return{disabled:this.isCommitButtonDisabled}},canCommitAlbum:function(){return!this.$store.state.uploading&&this.isAlbumSettingsValid},popoverContent:function(){return'"}},methods:{commitAlbum:function(){this.showErrors||this.isAlbumSettingsValid?this.canCommitAlbum&&(this.$store.commit("setLoadingAlbumInfo",!0),this.pendingChanges?this.commitRequested=!0:this.$store.dispatch("commitAlbum")):this.$store.commit("setAlbumSettingsErrorsVisibility",!0)}},watch:{pendingChanges:function(pending){!pending&&this.commitRequested&&(this.canCommitAlbum?this.commitAlbum():(this.commitRequested=!1,this.$store.commit("setLoadingAlbumInfo",!1)))}}}),Vue.component("album-draft-medium-settings",{data:function(){return{id:null,name:"",description:"",old:{name:"",description:""}}},template:'\t\t
\t\t\t
\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t

\t\t\t\t\t\t

\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t

\t\t\t\t\t\t\t\t

\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t

\t\t\t\t\t\t

\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t
\t\t\t
\t\t\t
\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t
\t\t\t
\t\t
\t',computed:{album:function(){return this.$store.state.album},media:function(){return this.$store.state.albumGallery.media},medium:function(){return this.$store.state.medium},editingMedium:function(){return this.medium.selected},validator:function(){return{name:this.editingMedium.name.length<=window.settings.medium_name_max_length&&null===this.medium.serverError.name,description:this.editingMedium.desc.length<=window.settings.medium_description_max_length&&null===this.medium.serverError.description}},editingMediumThumbStyle:function(){return{"background-image":"url("+storage+"thumb/"+this.editingMedium.filename+"?ver="+this.editingMedium.version+")"}},isAlbumCoverMedium:function(){return Number(this.$store.state.albumGallery.gallery.coverID)===Number(this.id)},isFirstMedium:function(){return Number(this.media[0].photoID)===Number(this.id)},isLastMedium:function(){return Number(this.media[this.media.length-1].photoID)===Number(this.id)},isFormValid:function(){return this.validator.name&&this.validator.description},pending:function(){return this.$store.state.pending.saveMediumInfo}},methods:{deselectMedium:function(){this.$store.commit("deselectMedium")},deleteMedium:function(){1!==this.media.length&&(this.isLastMedium?this.deselectMedium():this.selectNextMedium()),this.$store.dispatch("albumGallery/deleteMedia",[this.id])},rotateMedium:function(){this.$store.dispatch("albumGallery/rotateMedium",{id:this.id})},setMediumAsAlbumCover:function(){this.$store.dispatch("albumGallery/setMediumAsAlbumCover",{id:this.id})},selectPreviousMedium:function(){this.isFormValid&&!this.pending&&this.$store.commit("selectPreviousMedium")},selectNextMedium:function(){this.isFormValid&&!this.pending&&this.$store.commit("selectNextMedium")},saveMediumInfo:function(){var self=this;this.$store.commit("setPendingMediumInfoSave",!0),this.$store.commit("setSaveMediumInfoTimeout",function(){self.name!==self.old.name&&self.saveMediumName(),self.description!==self.old.description&&self.saveMediumDescription()})},saveMediumName:function(){this.$store.dispatch("saveMediumInfo",{id:this.id,type:"name",value:this.name}),this.old.name=this.name},saveMediumDescription:function(){this.$store.dispatch("saveMediumInfo",{id:this.id,type:"description",value:this.description}),this.old.description=this.desc},validateInput:function(input){this.$store.commit("setMediumServerError",{type:input,error:null}),this.validator[input]&&this.saveMediumInfo()},getInputErrorText:function(input){input=this.medium.serverError[input];return null!==input&&"input_too_long"===input.message?i18next.t("general.error_messages.max_length",{max:input["max-length"]}):i18next.t("general.error_messages.server_communication_error")},setMediumData:function(){this.id=this.editingMedium.photoID,this.name=this.old.name=this.editingMedium.name,this.description=this.old.description=this.editingMedium.desc}},watch:{editingMedium:function(){this.setMediumData()}},mounted:function(){this.setMediumData()}}),Vue.component("album-draft-settings",{template:'\t\t
\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t
\t\t\t\t

\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t',computed:{album:function(){return this.$store.state.album},loading:function(){return this.$store.state.loading},media:function(){return this.$store.state.albumGallery.media},medium:function(){return this.$store.state.medium},editingMedium:function(){return this.medium.selected},isLastMedium:function(){return Number(this.media[this.media.length-1].photoID)===Number(this.editingMedium.photoID)},showCommitButton:function(){return!this.editingMedium||this.isLastMedium},isMobile:function(){return this.$store.getters["base/isMobile"]}},methods:{hideAlbumSettingsMobile:function(){this.$store.commit("showAlbumSettingsMobile",!1)}},mounted:function(){this.isMobile||Vue.nextTick(function(){$("#album-settings-wrap").stick_in_parent({parent:"#main-content",offset_top:90})})}}),Vue.component("album-filter-alert",{template:'\t\t
\t\t\t - \t\t\t.\t\t
\t',computed:{media:function(){return this.$store.state.albumGallery.media},activefilter:function(){return this.$store.state.albumGallery.mediaFilter},isFilterApllied:function(){return"none"!==this.activefilter},filterType:function(){switch(this.activefilter){case"comment_count":return"commented";case"like_count":return"liked";default:return"none"}},alertText:function(){var self=this;return i18next.t("album.photos_filter.info_message.type_"+this.filterType,{count:_.filter(this.media,function(o){return 0\t\t\t\t\t\t\t\t\t\t\t\t\t
1
\t\t\t\t\t\t',computed:{activeFilter:function(){return this.$store.state.albumGallery.mediaFilter},media:function(){return this.$store.state.albumGallery.media},showBadge:function(){return"none"!==this.activeFilter},mediaFilterCounts:function(){return{none:this.media.length,commented:_.filter(this.media,function(o){return 0\t\t\t
\t\t\t\t
\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t',computed:{filepond:function(){return this.$store.state.albumGallery.filepond},acceptedFileTypes:function(){return this.$store.state.albumGallery.fileExtensions.photo.concat(this.$store.state.albumGallery.fileExtensions.video).map(function(type){return"."+type}).join()},album:function(){return this.$store.state.albumGallery.album},media:function(){return this.$store.state.albumGallery.media},filter:function(){return this.$store.state.albumGallery.mediaFilter},isFilterApllied:function(){return"none"!==this.filter},filteredMedia:function(){var self=this;return this.isFilterApllied?_.filter(this.media,function(o){return 0=this.mediaLimit},isDraftMode:function(){return this.$store.state.albumGallery.draftMode},isOwner:function(){return this.$store.getters["base/isOwner"]},uploadEnabled:function(){return this.$store.state.albumGallery.uploadEnabled},uploadAllowed:function(){return this.isOwner&&this.uploadEnabled},maxRetries:function(){return this.$store.state.albumGallery.maxRetries},errorCodes:function(){return this.$store.state.albumGallery.errorCodes},saving:function(){return this.$store.state.albumGallery.saving},editHistory:function(){return this.$store.state.albumGallery.editHistory},mediaOrderTimeout:function(){return this.$store.state.albumGallery.timeout.saveMediaOrder}},methods:{getMedia:function(){this.$store.dispatch("albumGallery/getMedia")},addMedium:function(medium){this.$store.commit("albumGallery/addMedium",medium)},initFilepond:function(filepond){this.$store.commit("albumGallery/initFilepond",filepond)},setUploading:function(payload){this.$store.commit("albumGallery/setUploading",payload)},increaseUploadedFilesCounter:function(){this.$store.commit("albumGallery/increaseUploadedFilesCounter")},increaseFailedFilesCounter:function(){this.$store.commit("albumGallery/increaseFailedFilesCounter")},resetUploadCounters:function(){this.$store.commit("albumGallery/resetUploadCounters")},updateFileStatus:function(payload){this.$store.commit("albumGallery/updateFileStatus",payload)},setFileUploadProgress:function(payload){this.$store.commit("albumGallery/setFileUploadProgress",payload)},addIdToChecklist:function(id){this.$store.commit("albumGallery/addIdToChecklist",id)},removeIdFromChecklist:function(id){this.$store.commit("albumGallery/removeIdFromChecklist",id)},setUploadId:function(payload){this.$store.commit("albumGallery/setUploadId",payload)},setMediumErrorCode:function(payload){this.$store.commit("albumGallery/setMediumErrorCode",payload)},selectFiles:function(){var error;this.isAlbumFull?((error=new InfoModal).setTitle(i18next.t("general.error_messages.full_album")),error.setContent("

"+i18next.t("upload.media_limit_info",{limit:this.mediaLimit})+"

"),error.show()):this.$refs.filesInput.click()},getFileType:function(filename){filename=filename.split(".").pop();return this.$store.state.albumGallery.fileExtensions.photo.includes(filename.toLowerCase())?"photo":this.$store.state.albumGallery.fileExtensions.video.includes(filename.toLowerCase())?"video":null},handleSelectedFiles:function(e){var availableUploadsCount,error,e=e.target.files||e.dataTransfer.files;e.length&&(e=Object.values(e),(availableUploadsCount=this.mediaLimit-this.media.length)"+i18next.t("upload.not_enough_space_info",{limit:this.mediaLimit,total:e.length,available:availableUploadsCount})+"

"),error.show(),e=e.splice(0,availableUploadsCount)),this.$store.commit("albumGallery/addFilesToFileList",e),this.$store.commit("albumGallery/setTotalFilesToUploadCounter",e.length),this.$refs.filesInput.value="",this.uploading||this.processFilesChunk())},processFilesChunk:function(){var fileList=_.cloneDeep(this.fileList),chunk=fileList.splice(0,this.chunkSize);this.filepond.addFiles(chunk),this.$store.commit("albumGallery/setFileList",fileList)},initWindowFileDrop:function(){var self=this,target=document.documentElement;target.addEventListener("dragover",function(e){e.preventDefault()}),target.addEventListener("drop",function(e){e.preventDefault(),self.handleSelectedFiles(e)})},bindLegacyPhotosSyncEvents:function(){var self=this;window.addEventListener("album-gallery-select-files",function(e){self.selectFiles()},!1),window.addEventListener("album-gallery-remove-medium",function(e){e=e.detail;self.$store.commit("albumGallery/deleteMedium",e)},!1),window.addEventListener("album-gallery-rotate-medium",function(e){e=e.detail;self.$store.commit("albumGallery/rotateMedium",{id:e.id,width:e.width,height:e.height,version:e.version})},!1),window.addEventListener("album-gallery-set-cover",function(e){e=e.detail;self.$store.commit("albumGallery/setMediumAsAlbumCover",e.id)},!1),window.addEventListener("album-gallery-set-medium-like",function(e){e=e.detail;self.$store.commit("setMediumLike",{id:e.id,liked:e.liked,updatePhotos:!1})},!1)},handleEditHistoryChange:function(){var self=this,history=this.editHistory;if(!self.saving)if(history.length){switch(history[history.length-1].type){case"move":self.$store.commit("albumGallery/setSaveMediaOrderTimeout",function(){self.$store.dispatch("albumGallery/syncMediaOrderChanges")});break;case"delete":null==self.mediaOrderTimeout?self.$store.dispatch("albumGallery/syncMediaDelete"):(self.$store.commit("albumGallery/clearMediaOrderTimeout"),self.$store.dispatch("albumGallery/syncMediaOrderChanges"))}window.onbeforeunload=function(e){e.preventDefault(),e.returnValue=""}}else window.onbeforeunload=null}},watch:{checklist:function(length){var self=this;clearInterval(self.uploadStateCheck),0self.maxRetries?error("File upload error."):((request=new XMLHttpRequest).withCredentials=!1,request.upload.onprogress=function(e){progress(e.lengthComputable,e.loaded,e.total)},request.onload=function(){var uploadID,obj=JSON.parse(request.responseText);200<=request.status&&request.status<300?(load(request.responseText),uploadID=("photo"===type?obj.data:obj).id,self.setUploadId({file_id:metadata.file_id,upload_id:uploadID}),self.addIdToChecklist(uploadID)):self.errorCodes.reportedFile===obj.code?(self.setMediumErrorCode({id:metadata.file_id,code:obj.code}),error("File upload error - "+self.errorCodes.reportedFile)):setTimeout(function(){createXMLHttpRequest()},1e3)},request.onerror=function(ev){setTimeout(function(){createXMLHttpRequest()},1e3)},request.open("POST",metadata.upload_url),request.send(formData))}switch(type){case"photo":formData.append(fieldName,file,file.name);break;case"video":formData.append("filename",file.name),formData.append("blob",file,file.name)}var reader,cryptoSubtle=window.crypto.subtle||window.crypto.webkitSubtle;if(cryptoSubtle)return(reader=new FileReader).onload=function(){cryptoSubtle.digest("SHA-1",reader.result).then(function(buffer){formData.append("checksum-sha1",Rajce.checksumUtils.hex(buffer)),createXMLHttpRequest()})},reader.readAsArrayBuffer(originalFile.file),{abort:function(){request.abort(),abort()}};createXMLHttpRequest()}}}),pond=FilePond.create(inputElement,{name:"Filedata",instantUpload:!1,dropOnPage:!1,dropOnElement:!1,allowRemove:!1,allowImageResize:!0,imageResizeTargetWidth:void 0!==settings.photo_long_edge_limit?settings.photo_long_edge_limit:2e3,imageResizeTargetHeight:void 0!==settings.photo_long_edge_limit?settings.photo_long_edge_limit:2e3,imageResizeMode:"contain",imageResizeUpscale:!1,imageTransformOutputQuality:92,imageTransformOutputStripImageHead:!1,allowFileTypeValidation:!1,maxFiles:1e3,oninit:function(){$(self.$refs.filepond).remove()},oninitfile:function(file){if(null===self.getFileType(file.filename))return file.abortLoad(),pond.removeFile(file.id),file.setMetadata("rejected",!0,!1),!1;file.setMetadata("file_id",file.id,!1),self.addMedium(file),self.setUploading(!0),window.dispatchEvent(new CustomEvent("media-gallery-align"))},onaddfile:function(error,file){if(null!==file&&void 0===file.getMetadata("rejected")&&(self.updateFileStatus({file:file,status:"waiting"}),!self.hasLoadingMedia)){for(var files=pond.getFiles(),requests=[],i=0;i\t\t\t
\t\t\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{{ i18next.t("general.more").toLowerCase() }} \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{{ i18next.t("album.close_album_description") }} \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t\t{{ i18next.t("general.plural.comment", {count: commentCount}) }}\t\t\t\t\t\t\t{{ i18next.t("general.plural.view_readable", {count: Rajce.numberUtils.readableNumber(item.view_count)}) }}\t\t\t\t\t\t\t
    \t\t\t\t\t\t\t\t
  • \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t {{ Rajce.libs.dateTime.getInterval(item.date.start_date, item.date.end_date) }}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
  • \t\t\t\t\t\t\t\t
  • \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{{ i18next.t("general.formatted_number", {value: commentCount }) }}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{{ i18next.t("comments.hide_comments").toLowerCase() }}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t {{ i18next.t("general.formatted_number", {value: commentCount }) }}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
  • \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
  • \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t {{ Rajce.numberUtils.readableNumber(item.view_count) }}\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
  • \t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t\t{{ i18next.t("album.create_product_from_album_card_label") }}\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t
\t\t\t
\t\t\t',computed:{settings:function(){return this.$store.state.base.settings},isUserLogged:function(){return this.$store.getters["base/isUserLogged"]},isOwner:function(){return this.$store.getters["base/isOwner"]},isUserProfile:function(){return void 0!==this.settings.owner_user_id},id:function(){return"a_"+this.item.id},classes:function(){var access=this.item.access,version=access.version,hiddenAlbum=!1,lockedAlbum=!1,nsfwAlbum=!1;return 1===version&&(hiddenAlbum=!this.item.is_visible,lockedAlbum=this.item.is_code_protected,nsfwAlbum=this.item.is_nsfw),2===version&&(hiddenAlbum=!access.is_public,nsfwAlbum=access.is_nsfw),{"nsfw-album":nsfwAlbum,"hidden-album":hiddenAlbum&&this.showItemInfoIcons,"locked-album":lockedAlbum&&this.showItemInfoIcons,product:this.item.is_public_prints_enabled,"empty-album":0===this.item.media_count,"comments-expanded":this.show.comments,"description-expanded":this.show.description,open:this.show.comments||this.show.description}},descriptionClasses:function(){return{open:this.descriptionState.open,collapsed:this.descriptionState.collapsed,"multiline-name":this.albumNameState.multiLine,"username-hidden":this.userContext}},backgroundClass:function(){return{contain:0$(this.$refs.description).height()?this.descriptionState.collapsed=!0:(this.descriptionState.collapsed=!1,this.descriptionState.open=!1))},showFullAlbumDescription:function(show){this.descriptionState.collapsed=!show,this.descriptionState.open=show,this.show.description=show}},watch:{viewType:function(value){this.handleAlbumName(),"list"===this.viewType&&this.handleAlbumDescription()}},mounted:function(){this.handleAlbumDescription(),this.handleAlbumName(),this.commentsExpanded&&this.toggleComments(),window.addEventListener("resize",this.handleAlbumDescription),window.addEventListener("resize",this.handleAlbumName)},beforeDestroy:function(){window.removeEventListener("resize",this.handleAlbumDescription),window.removeEventListener("resize",this.handleAlbumName)}}),Vue.component("album-like",{props:{album:{type:Object,required:!0}},template:'\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t',computed:{isUserLogged:function(){return this.$store.getters["base/isUserLogged"]},loginLink:function(){return this.$store.getters["base/loginLink"]},canLike:function(){return this.$store.getters["base/canLike"]},icon:function(){return this.album.is_liked||this.album.fav?"icon-thumbs-up-f":"icon-thumbs-up"},likeCount:function(){return this.album.like_count||this.album.rating}},methods:{toggleLike:function(){this.$store.dispatch("setAlbumLike",{id:Number(this.album.albumID),is_liked:this.album.is_liked})}}}),Vue.component("album-security-info",{template:'\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t'}),Vue.component("album-share-join-button",{data:function(){return{usersLimit:3}},template:'\t\t
\t\t\t
\t\t\t\t\t\t\t\t
+{{album.settings.access.users.length - usersLimit}}
\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t',computed:{album:function(){return this.$store.state.album},isOwner:function(){return this.$store.getters["base/isOwner"]},share:function(){return this.$store.state.album.settings.share}},methods:{showSharingModal:function(suggestion){this.$store.commit("sharingModal/showSharingModal",suggestion)},getAvatarStyle:function(user){return{"background-image":"url("+(user.avatar_url||Rajce.url.createBase("/img/storage/avatar/160.jpg"))+")"}},joinAlbum:function(){this.$store.dispatch("joinAlbum")},unlinkAlbum:function(){this.$store.dispatch("unlinkAlbum")}},mounted:function(){var self=this;window.addEventListener("show-album-share-modal",function(e){self.showSharingModal()},!1)}}),Vue.component("album-share-settings",{template:'\t\t
\t\t\t\t\t\t\t\t
\t',computed:{isSharingModalVisible:function(){return this.$store.state.sharingModal.show.sharingModal},isCopyAlbumLinkModalVisible:function(){return this.$store.state.sharingModal.show.copyLinkModal}}}),Vue.component("album-sort-dropdown",{data:function(){return{active:{sort:null,order:null}}},template:'\t\t\t',computed:{uploading:function(){return this.$store.state.albumGallery.uploading},isDraftMode:function(){return this.$store.state.albumGallery.draftMode},classes:function(){var classes=this.uploading?"disabled ":"";return classes+=this.isDraftMode?"btn btn-sm btn-md btn-link-secondary":"btn btn-icon mb-2 py-0 ms-2"}},methods:{getItemClasses:function(sort,order){return{active:sort===this.active.sort&&order===this.active.order}},sort:function(sort,order){this.active.sort=sort,this.active.order=order,"date"===sort?(this.$store.commit("albumGallery/orderMediaByCreateDate",order),this.$store.dispatch("albumGallery/setAlbumMediaOrder")):this.$store.dispatch("albumGallery/setAlbumMediaOrderBy",{sort:sort,order:order})}}}),Vue.component("album-upload-droparea",{template:'\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t

\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t
\t\t\t\t\t\t\t
\t\t
\t',computed:{isDraftMode:function(){return this.$store.state.albumGallery.draftMode},mediaLimit:function(){return this.$store.state.albumGallery.mediaLimit},mediaCount:function(){return this.$store.state.albumGallery.media.length},isAlbumAlmostFull:function(){return this.mediaCount>=.8*this.mediaLimit},isAlbumFull:function(){return this.mediaCount>=this.mediaLimit},toLimit:function(){return this.mediaLimit-this.mediaCount},classes:function(){return{disabled:this.isAlbumFull}}},methods:{selectFiles:function(){window.dispatchEvent(new CustomEvent("album-gallery-select-files"))},deleteAlbum:function(){this.$store.dispatch("deleteAlbum")}}}),Vue.component("album-upload-progress",{props:{album:{type:Object,required:!0}},template:'\t\t
\t\t\t
\t\t\t\t
\t\t\t
\t\t\t\t\t\t\t\t
\t',computed:{filepond:function(){return this.$store.state.albumGallery.filepond},uploading:function(){return this.$store.state.albumGallery.uploading},errorCodes:function(){return this.$store.state.albumGallery.errorCodes},failedUploads:function(){var self=this;return _.countBy(this.$store.state.albumGallery.media,function(o){return"error"===o.uploadStatus&&self.errorCodes.reportedFile!==o.errorCode}).true},reportedUploads:function(){var self=this;return _.countBy(this.$store.state.albumGallery.media,function(o){return"error"===o.uploadStatus&&self.errorCodes.reportedFile===o.errorCode}).true},classes:function(){return{visible:this.uploading||this.failedUploads}},counters:function(){return this.$store.state.albumGallery.uploadProgress},progress:function(){return this.counters.total?this.counters.uploaded/this.counters.total*100:0},progressBarStyle:function(){return{"min-width":"50px",width:this.progress+"%"}},progressBarCount:function(){return this.counters.uploaded+"/"+this.counters.total}},methods:{stopUpload:function(){for(var files=this.filepond.getFiles(),i=0;i"+i18next.t("upload.error_messages.upload_contains_reported_files",{count:this.reportedUploads,url:Rajce.url.createBase("/pravidla")})+"

"),value.show())}}}),Vue.component("album-url-access-confirm-modal",{template:'\t\t\t',computed:{setPublic:function(){return this.$store.state.sharingModal.urlAccessConfirmation.setPublic}},mounted:function(){var self=this;Vue.nextTick(function(){var modal=$(self.$refs.modal);modal.modal("show"),modal.on("hidden.bs.modal",function(){self.$store.commit("sharingModal/hideUrlAccessConfirmation"),self.$store.commit("sharingModal/showSharingModal",null)})})},methods:{disableAlbumUrlAccess:function(){this.$store.dispatch("sharingModal/setAlbumAccess",{is_public:this.setPublic,is_url_access_enabled:!1})}}}),Vue.component("copy-album-link-modal",{data:function(){return{copied:!1}},template:'\t\t\t',computed:{users:function(){return this.$store.state.sharingModal.users},loading:function(){return this.$store.state.sharingModal.loading.copyLink},albumLink:function(){return this.$store.state.sharingModal.copyLink}},mounted:function(){var self=this;self.copied=!1,self.$store.dispatch("sharingModal/getAlbumUrl"),Vue.nextTick(function(){var modal=$(self.$refs.modal);modal.modal("show"),modal.on("hidden.bs.modal",function(){self.$store.commit("sharingModal/hideCopyLinkModal"),self.$store.commit("sharingModal/showSharingModal",null)})})},methods:{copyLinkToClipboard:function(){var self=this;$(this.$refs.input).select(),document.execCommand("Copy"),this.copied=!0,setTimeout(function(){self.copied=!1},3e3)}}}),Vue.component("gallery",{props:{media:{type:Array,required:!0}},data:function(){return{config:{gap:8,ratio_default:4/3,min_height:"undefined"!=typeof album_properties?album_properties.thumb.min_height:75,min_width:"undefined"!=typeof album_properties?album_properties.thumb.min_width:134,max_height:"undefined"!=typeof album_properties?album_properties.thumb.max_height:200,max_width:"undefined"!=typeof album_properties?album_properties.thumb.max_width:400,mobile:{breakpoint:768,min_height:100,min_width:100,max_height:200,max_width:200,ad:{width:300,height:300}},row_with_ad:5,ad:{width:480,height:344}},container:{rowCount:0,totalHeight:0,width:0,lastWidth:0,scrollbarWidth:0},isMobile:"undefined"!=typeof is_mobile&&is_mobile,ads:{desktop:null,mobile:null}}},template:'\t\t
\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t
\t\t\t
\t\t\t
\t\t\t\t
\t\t\t
\t\t
\t',computed:{gallery:function(){return this.$store.state.albumGallery.gallery},selectedMedium:function(){return!!this.isDraftMode&&this.$store.state.medium.selected},isDragging:function(){return this.$store.state.albumGallery.gallery.dragging},indication:function(){return this.$store.state.albumGallery.gallery.indication},draggedMedium:function(){return this.$store.state.albumGallery.gallery.draggedMedium},draggedMediumPosition:function(){return this.$store.state.albumGallery.gallery.draggedMedium.position.left+this.$store.state.albumGallery.gallery.draggedMedium.position.top},floatItemThumbStyle:function(){return{"background-image":"url("+this.draggedMedium.medium.thumb_url+"?ver="+this.draggedMedium.medium.version+")",width:this.draggedMedium.width+"px",height:this.draggedMedium.height+"px"}},floatItemPosition:function(){return{position:"fixed",left:this.draggedMedium.position.left+"px",top:this.draggedMedium.position.top+"px"}},indicationStyle:function(){return{height:this.indication.computedStyle.height+"px",left:this.indication.computedStyle.position.left+"px",top:this.indication.computedStyle.position.top+"px",display:"block"}},galleryClasses:function(){return{editing:this.selectedMedium}},isDraftMode:function(){return this.$store.state.albumGallery.draftMode},isOwner:function(){return this.$store.getters["base/isOwner"]},adsState:function(){return this.$store.state.base.ads},adAvailable:function(){return 0=this.container.width){for(var medium=null,currentRowCopy={width:_.cloneDeep(currentRow.width),fixedWidth:_.cloneDeep(currentRow.fixedWidth),thumbStyles:[]},j=0;jthis.config.max_width&&(medium=this.config.max_width,panorama=!0),{width:Math.round(medium),height:h,panorama:panorama})},roundThumbDimension:function(widthDiff,dimension){var widthMod=dimension%1;return dimension=.5<=widthDiff+1-widthMod?(widthDiff-=widthMod,Math.floor(dimension)):(widthDiff+=1-widthMod,Math.ceil(dimension)),{widthDiff:widthDiff,dimension:dimension}},scaleDownThumbsInRow:function(row){for(var maxWidth=this.container.width-(row.thumbs.length-1)*this.config.gap,ratio=(maxWidth-row.fixedWidth)/(row.width-row.fixedWidth),widthDiff=(row.completed=!0,row.width=0,row.fixedWidth=0),i=0;imaxWidth&&(row.fixedWidththis.config.max_width?this.config.max_width:thumb.computed.width*ratio,row.thumbs[i].computed.width===this.config.max_width?row.fixedWidth+=row.thumbs[i].computed.width:(widthDiff=(rounded=this.roundThumbDimension(widthDiff,thumb.computed.width)).widthDiff,thumb.computed.width=rounded.dimension),row.width+=row.thumbs[i].computed.width}row.width=this.config.ad.width?this.placeAd(this.ads.desktop,row):0elements.offset().left+targetElement.width()/2)return this.indicateMove(targetMediumIndex,"after"),!1}this.resetIndication()},indicateMove:function(index,position){this.$store.commit("albumGallery/setIndication",{index:index,index2:"before"===position?index-1:index+1,position:position}),this.calcIndicationStyle(),this.$store.commit("albumGallery/showIndication",!0)},resetIndication:function(){this.$store.commit("albumGallery/setIndication",{index:null,index2:null,position:null}),this.$store.commit("albumGallery/showIndication",!1)},calcIndicationStyle:function(){var element=$(this.$refs.gallery).find(".medium").eq(this.indication.index),position=this.indication.position,shift=(parseInt(element.css("margin-bottom"))-2)/2+2,height=element.outerHeight()+2*shift,top=element.position().top-shift,left=element.position().left;"before"===position?(left-=shift,element.hasClass("moved-right")&&(left-=this.indication.config.moveIndication)):"after"===position&&(left+=element.width()+shift-2,element.hasClass("moved-left"))&&(left+=this.indication.config.moveIndication),this.$store.commit("albumGallery/setIndicationComputedStyle",{height:height,position:{top:top,left:left}})},getItemIndexForMousePos:function(curPosX,curPosY){for(var elements=$(this.$refs.gallery).find(".medium"),index=0,$thumb=elements.eq(index),lastOffsetTop=-1,lastIndexOnPreviousRow=1;1===$thumb.length;){var offset,newRow,thumbHeight=$thumb.outerHeight()+10;if((newRow=lastOffsetTop!==(offset=$thumb.offset()).top)&&(lastIndexOnPreviousRow=Math.max(0,index-1)),curPosY>offset.top&&curPosY\t\t\t
\t\t\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t
\t\t\t
\t\t\t',computed:{items:function(){return this.$store.state.items},hasItems:function(){return 0\t\t\t\t\t\t\t\t\t\t\t\t\t',computed:{classes:function(){return{backdrop:this.backdrop}}}}),Vue.component("medium-item",{data:function(){return{preview:{show:!1,loaded:!1}}},props:{medium:{type:Object,required:!0},index:{type:Number,required:!0}},template:'\t\t
\t\t\t
\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t
\t\t\t
\t\t\t
\t\t\t\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t
\t\t\t\t\t\t\t\t\t
\t\t\t\t
\t\t\t\t\t\t\t\t\t
\t\t\t
\t\t\t
\t\t\t\t\t\t\t
\t\t\t
\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t\t
\t\t\t\t\t\t\t\t\t\t\t
\t\t\t\t
\t\t\t\t\t\t\t
\t\t
\t',computed:{id:function(){return this.medium.photoID||this.medium.id},elementID:function(){return"medium_"+this.id},filepond:function(){return this.$store.state.albumGallery.filepond},thumbsLoader:function(){return this.$store.state.albumGallery.gallery.thumbsLoader},thumbLoaded:function(){return this.medium.thumbLoaded},loadThumbRequested:function(){return this.thumbsLoader.currentlyLoading.includes(this.id)},thumb:function(){return this.medium.version?this.medium.thumb_url+"?ver="+this.medium.version:this.medium.thumb_url},legacyThumbSize:function(){return this.$store.state.albumGallery.legacyThumbSize},gallery:function(){return this.$store.state.albumGallery.gallery},media:function(){return this.$store.state.albumGallery.media},isDraggedMedium:function(){return this.gallery.draggedMedium.medium===this.medium},isAlbumCoverMedium:function(){return Number(this.gallery.coverID)===Number(this.id)},isSelectedMedium:function(){return!(!this.isDraftMode||!this.$store.state.medium.selected)&&Number(this.$store.state.medium.selected.photoID)===Number(this.id)},moveIndication:function(){return this.$store.state.albumGallery.gallery.indication},isMoveTargetElement:function(){return!1},isMoveSecondElement:function(){return!1},mediumClasses:function(){return{video:this.medium.is_video,loading:"loading"===this.status||!this.thumbLoaded,waiting:"waiting"===this.status,uploading:"uploading"===this.status,processing:"processing"===this.status,error:"error"===this.status,editing:this.isSelectedMedium,"blank-item":this.isDraggedMedium,"album-cover-thumb":this.isAlbumCoverMedium,"moved-right":this.isMoveTargetElement&&"before"===this.moveIndication.position||this.isMoveSecondElement&&"after"===this.moveIndication.position,"moved-left":this.isMoveTargetElement&&"after"===this.moveIndication.position||this.isMoveSecondElement&&"before"===this.moveIndication.position,panorama:!!this.medium.computedStyle&&this.medium.computedStyle.panorama,"preview-loaded":this.preview.loaded,delete:this.mediaToDelete.includes(this.id),duplicate:this.hasDuplicates,reported:this.isReported}},style:function(){if(this.medium.computedStyle)return{width:this.medium.computedStyle.width+"px",height:this.medium.computedStyle.height+"px","margin-right":this.medium.computedStyle.marginRight+"px","margin-bottom":this.medium.computedStyle.marginBottom+"px"}},status:function(){return this.medium.uploadStatus},uploadProgressStyle:function(){return{width:this.medium.uploadProgress+"%"}},error:function(){return"error"===this.status},isUploading:function(){return"uploading"===this.status},isProcessing:function(){return"processing"===this.status},isCompleted:function(){return"completed"===this.status||void 0===this.status},isFailed:function(){return"failed"===this.status},isDraftMode:function(){return this.$store.state.albumGallery.draftMode},isOwner:function(){return this.$store.getters["base/isOwner"]},mediaToDelete:function(){return this.$store.state.albumGallery.mediaToDelete},videoIconSizeClass:function(){return this.legacyThumbSize?"icon-size-2x":"icon-size-4x"},uploadProgress:function(){return this.$store.state.albumGallery.uploadProgress},duplicates:function(){var self=this;return null===this.medium.duplicates?[]:_.filter(this.medium.duplicates,function(duplicate){return duplicate!==Number(self.id)})},hasDuplicates:function(){return!!this.isDraftMode&&0\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'):(item.src=(medium.image_url||storage+"images/"+medium.filename)+"?ver="+medium.version,item.w=parseInt(medium.width,10),item.h=parseInt(medium.height,10)),items.push(item))}return items},openPhotoSwipe:function(){function stopVideoPlayers(gallery){var video=$(gallery.container).find("video");if(video.length)for(var i=0;i\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t',computed:{isUserLogged:function(){return this.$store.getters["base/isUserLogged"]},isLiked:function(){var isLiked=this.medium.is_liked;return void 0!==this.medium.is_favorited&&(isLiked=this.medium.is_favorited),isLiked=void 0!==this.medium.context?this.medium.context.is_liked:isLiked},icon:function(){return this.isLiked?"icon-thumbs-up-f":"icon-thumbs-up"}},methods:{toggleLike:function(){this.$store.dispatch("setMediumLike",{id:void 0!==this.medium.id?this.medium.id:this.medium.medium_id,is_liked:this.isLiked})}}}),Vue.component("pagination-item",{props:{page:{type:Number,required:!1,default:1},type:{type:String,required:!1,default:""}},template:'\t\t
  • \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
  • \t',computed:{pagesCount:function(){return this.$store.getters.pagesCount},currentPage:function(){return this.$store.state.currentPage},disabled:function(){return"prev"===this.type&&this.isPageActive(1)||"next"===this.type&&this.isPageActive(this.pagesCount)},active:function(){return!this.type&&this.isPageActive(this.page)},classes:function(){return this.type?{prev:"prev"===this.type,next:"next"===this.type,disabled:this.disabled}:{active:this.isPageActive(this.page)}},iconClass:function(){switch(this.type){case"prev":return"icon-chevron-left";case"next":return"icon-chevron-right"}}},methods:{isPageActive:function(page){return page===this.currentPage},getPage:function(){if(this.disabled||this.active)return!1;var page;switch(this.type){case"prev":page=this.currentPage-1;break;case"next":page=this.currentPage+1;break;default:page=this.page}this.$store.dispatch("getData",{page:page})}}}),Vue.component("pagination",{props:{pagesButtons:{type:Boolean,required:!1,default:!0},loadMoreButton:{type:Boolean,required:!1,default:!1},buttonText:{type:String,required:!1}},data:function(){return{maxSize:0}},template:'\t\t
    \t\t\t\t\t\t
      \t\t\t\t\t\t\t\t\t\t\t\t
    • ...
    • \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
    • ...
    • \t\t\t\t\t\t\t\t\t\t\t
    \t\t
    \t',computed:{pagesCount:function(){return this.$store.getters.pagesCount},currentPage:function(){return this.$store.state.currentPage},loadedPages:function(){return this.$store.state.loadedPages},loadingMoreItems:function(){return this.$store.state.loadingMoreItems},lastPrevPage:function(){var page=this.currentPage-this.maxSize;return this.currentPage>=this.pagesCount-this.maxSize&&(page-=this.maxSize-(this.pagesCount-this.currentPage)+1),page=page<2?2:page},lastNextPage:function(){var page=this.currentPage+this.maxSize;return this.currentPage<=this.maxSize+1&&(page+=this.maxSize+1-this.currentPage+1),page=page>=this.pagesCount?this.pagesCount-1:page},prevPagesCount:function(){return 1===this.currentPage?0:this.currentPage-this.lastPrevPage},nextPagesCount:function(){return this.pagesCount===this.currentPage?0:this.lastNextPage-this.currentPage},isNextPageAvailable:function(){return this.currentPage!==this.pagesCount},showButton:function(){return this.loadMoreButton&&this.buttonText&&this.isNextPageAvailable},showPagesButtons:function(){return this.pagesButtons}},methods:{isPageActive:function(page){return page===this.currentPage},configure:function(){var width=window.innerWidth;switch(!0){case width<=400:this.maxSize=0;break;case 400\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t',computed:{previousQueries:function(){return this.$store.state.searchState.previousQueries},baseSearchUrl:function(){return Rajce.url.createBase("/hledej")},queryLink:function(){return this.baseSearchUrl+"?q="+this.query}},methods:{removeQuery:function(){this.$store.commit("searchState/removePreviousQuery",this.index),this.previousQueries.length?Cookies.set("rajce-previous-search",this.previousQueries.join("|"),{expires:14}):Cookies.remove("rajce-previous-search")}}}),Vue.component("search-suggestion",{props:{index:{type:Number,required:!0},suggestion:{type:Object,required:!0}},template:'\t\t\t',computed:{coverImageStyle:function(){if(!this.isTag&&!this.showNsfwWarning)return{"background-image":"url("+this.suggestion.thumbnail+")"}},classes:function(){var classes=["type-"+this.suggestion.type];return this.$store.state.searchState.selectedSuggestion===this.index&&classes.push("selected"),this.showNsfwWarning&&classes.push("nsfw"),this.suggestion.display_name||classes.push("d-flex align-items-center"),classes},showNsfwWarning:function(){return this.$store.getters["base/isNsfwWarningEnabled"]&&this.suggestion.is_nsfw},isAlbum:function(){return"albums"===this.suggestion.type},isVideo:function(){return"videos"===this.suggestion.type},isTag:function(){return"tags"===this.suggestion.type}},methods:{deselectSuggestion:function(){this.$store.commit("searchState/setSelectedSuggestion",null)}}}),Vue.component("search",{props:{q:{type:String,required:!1,default:""},placeholder:{type:String,required:!1,default:null},type:{type:String,required:!1},maxLength:{type:Number,required:!1,default:100}},template:'\t\t\t',computed:{query:{get:function(){return this.$store.state.searchState.query},set:function(value){this.$store.commit("searchState/setQuery",value)}},placeholderText:function(){return this.placeholder||i18next.t("general.search")},hasQuery:function(){return 0this.totalSuggestions},baseSearchUrl:function(){return Rajce.url.createBase("/hledej")},notFoundLink:function(){return Rajce.url.create("alba","/nova")},selectedSuggestion:function(){return this.$store.state.searchState.selectedSuggestion},showAllresultsClasses:function(){return{selected:this.totalSuggestions===this.selectedSuggestion}},suggestionsEnabled:function(){return this.$store.state.searchState.suggestionsEnabled}},methods:{showSuggestions:function(){this.suggestionsEnabled&&this.$store.commit("searchState/setSuggestionsShow",!0)},blur:function(){this.suggestionsEnabled&&(this.$refs.input.blur(),this.$store.commit("searchState/setSuggestionsShow",!1))},getQueryLink:function(query){return this.baseSearchUrl+"?q="+query},selectPrevSuggestion:function(){var index=this.selectedSuggestion;null!==index&&this.suggestionsEnabled&&this.selectSuggestion(0===index?null:index-1)},selectNextSuggestion:function(){var index=this.selectedSuggestion;this.totalSuggestions!==index&&this.suggestionsEnabled&&this.selectSuggestion(null===index?0:index+1)},selectSuggestion:function(index){var self=this;this.$store.commit("searchState/setSelectedSuggestion",index),null!==index&&Vue.nextTick(function(){self.scrollToSelectedSuggestion()})},scrollToSelectedSuggestion:function(){var visible_area_top,visible_area_bottom,suggestion_area_top,suggestion,container=this.$refs.suggestions;container&&(suggestion=this.$refs.suggestions.getElementsByClassName("selected")).length&&(visible_area_top=container.scrollTop,visible_area_bottom=container.scrollTop+container.offsetHeight,suggestion_area_top=suggestion[0].offsetTop,suggestion=suggestion[0].offsetTop+suggestion[0].offsetHeight,visible_area_top',methods:{copyToClipBoard:function(){var self=this,input=$('');self.copied=!0,$("body").append(input),input.val(self.urls.permanent).select(),document.execCommand("Copy"),input.remove(),setTimeout(function(){self.copied=!1},5e3)}}}),Vue.component("share-suggestion",{props:{index:{type:Number,required:!0},suggestion:{type:Object,required:!0}},data:function(){return{i18next:i18next}},template:'\t\t
    \t\t\t\t\t
    \t',computed:{coverImageStyle:function(){if(!this.isEmail)return{"background-image":"url("+this.suggestion.thumbnail+")"}},classes:function(){var classes=["type-"+this.suggestion.type];return this.$store.state.searchState.selectedSuggestion===this.index&&classes.push("selected"),this.suggestion.display_name||classes.push("d-flex align-items-center"),classes},isEmail:function(){return"emails"===this.suggestion.type},isDraftMode:function(){return this.$store.state.sharingModal.draftMode}},methods:{deselectSuggestion:function(){this.$store.commit("searchState/setSelectedSuggestion",null)},shareAlbum:function(){this.isEmail?this.$store.dispatch("sharingModal/shareAlbumToEmail",this.suggestion):this.$store.dispatch("sharingModal/shareAlbumToUser",this.suggestion),this.$store.commit("searchState/setSuggestionsShow",!1),this.$store.commit("searchState/setQuery","")}}}),Vue.component("share-suggestor",{props:{placeholder:{type:String,required:!1,default:null},type:{type:String,required:!1},maxLength:{type:Number,required:!1,default:100},value:{type:String,required:!1}},template:'\t\t\t',computed:{query:{get:function(){return this.$store.state.searchState.query},set:function(value){this.$store.commit("searchState/setQuery",value)}},placeholderText:function(){return this.placeholder||i18next.t("general.search")},hasQuery:function(){return 0