diff --git a/public/js/activity.js b/public/js/activity.js index 4fdce4aea..3c93e0378 100644 --- a/public/js/activity.js +++ b/public/js/activity.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{1:function(t,a,e){t.exports=e("hUgz")},"KHd+":function(t,a,e){"use strict";function n(t,a,e,n,o,s,i,r){var c,l="function"==typeof t?t.options:t;if(a&&(l.render=a,l.staticRenderFns=e,l._compiled=!0),n&&(l.functional=!0),s&&(l._scopeId="data-v-"+s),i?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(i)},l._ssrRegister=c):o&&(c=r?function(){o.call(this,this.$root.$options.shadowRoot)}:o),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(t,a){return c.call(a),u(t,a)}}else{var d=l.beforeCreate;l.beforeCreate=d?[].concat(d,c):[c]}return{exports:t,options:l}}e.d(a,"a",(function(){return n}))},hUgz:function(t,a,e){Vue.component("activity-component",e("tXHz").default)},tXHz:function(t,a,e){"use strict";e.r(a);function n(t){return function(t){if(Array.isArray(t)){for(var a=0,e=new Array(t.length);a10?t.complete():axios.get("/api/pixelfed/v1/notifications",{params:{pg:!0,page:this.notificationCursor}}).then((function(e){if(e.data.length){var o,s=e.data.filter((function(t){return!("share"==t.type&&!status)&&!_.find(a.notifications,{id:t.id})}));(o=a.notifications).push.apply(o,n(s)),a.notificationCursor++,t.loaded()}else t.complete()}))},truncate:function(t){return t.length<=15?t:t.slice(0,15)+"..."},timeAgo:function(t){var a=Date.parse(t),e=Math.floor((new Date-a)/1e3),n=Math.floor(e/31536e3);return n>=1?n+"y":(n=Math.floor(e/604800))>=1?n+"w":(n=Math.floor(e/86400))>=1?n+"d":(n=Math.floor(e/3600))>=1?n+"h":(n=Math.floor(e/60))>=1?n+"m":Math.floor(e)+"s"},mentionUrl:function(t){return"/p/"+t.account.username+"/"+t.id},followProfile:function(t){var a=this,e=t.account.id;axios.post("/i/follow",{item:e}).then((function(t){a.notifications.map((function(t){t.account.id===e&&(t.relationship.following=!0)}))})).catch((function(t){t.response.data.message&&swal("Error",t.response.data.message,"error")}))},viewContext:function(t){switch(t.type){case"follow":return t.account.url;case"mention":return t.status.url;case"like":case"favourite":case"comment":return t.status.url;case"tagged":return t.tagged.post_url;case"direct":return"/account/direct/t/"+t.account.id}return"/"}}},s=e("KHd+"),i=Object(s.a)(o,(function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",[e("div",{staticClass:"container"},[e("div",{staticClass:"row my-5"},[e("div",{staticClass:"col-12 col-md-8 offset-md-2"},[t._l(t.notifications,(function(a,n){return t.notifications.length>0?e("div",{staticClass:"media mb-3 align-items-center px-3 border-bottom pb-3"},[e("img",{staticClass:"mr-2 rounded-circle",staticStyle:{border:"1px solid #ccc"},attrs:{src:a.account.avatar,alt:"",width:"32px",height:"32px"}}),t._v(" "),e("div",{staticClass:"media-body font-weight-light"},["favourite"==a.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:a.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:a.account.username}},[t._v(t._s(t.truncate(a.account.username)))]),t._v(" liked your "),e("a",{staticClass:"font-weight-bold",attrs:{href:a.status.url}},[t._v("post")]),t._v(".\n\t\t\t\t\t\t\t")])]):"comment"==a.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:a.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:a.account.username}},[t._v(t._s(t.truncate(a.account.username)))]),t._v(" commented on your "),e("a",{staticClass:"font-weight-bold",attrs:{href:a.status.url}},[t._v("post")]),t._v(".\n\t\t\t\t\t\t\t")])]):"mention"==a.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:a.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:a.account.username}},[t._v(t._s(t.truncate(a.account.username)))]),t._v(" "),e("a",{staticClass:"font-weight-bold",attrs:{href:t.mentionUrl(a.status)}},[t._v("mentioned")]),t._v(" you.\n\t\t\t\t\t\t\t")])]):"follow"==a.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:a.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:a.account.username}},[t._v(t._s(t.truncate(a.account.username)))]),t._v(" followed you.\n\t\t\t\t\t\t\t")])]):"share"==a.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:a.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:a.account.username}},[t._v(t._s(t.truncate(a.account.username)))]),t._v(" shared your "),e("a",{staticClass:"font-weight-bold",attrs:{href:a.status.reblog.url}},[t._v("post")]),t._v(".\n\t\t\t\t\t\t\t")])]):"modlog"==a.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:a.account.url,title:a.account.username}},[t._v(t._s(t.truncate(a.account.username)))]),t._v(" updated a "),e("a",{staticClass:"font-weight-bold",attrs:{href:a.modlog.url}},[t._v("modlog")]),t._v(".\n\t\t\t\t\t\t\t")])]):"tagged"==a.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:a.account.url,title:a.account.username}},[t._v(t._s(t.truncate(a.account.username)))]),t._v(" tagged you in a "),e("a",{staticClass:"font-weight-bold",attrs:{href:a.tagged.post_url}},[t._v("post")]),t._v(".\n\t\t\t\t\t\t\t")])]):"direct"==a.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:a.account.url,title:a.account.username}},[t._v(t._s(t.truncate(a.account.username)))]),t._v(" sent a "),e("a",{staticClass:"font-weight-bold",attrs:{href:"/account/direct/t/"+a.account.id}},[t._v("dm")]),t._v(".\n\t\t\t\t\t\t")])]):t._e(),t._v(" "),e("div",{staticClass:"align-items-center"},[e("span",{staticClass:"small text-muted",attrs:{"data-toggle":"tooltip","data-placement":"bottom",title:a.created_at}},[t._v(t._s(t.timeAgo(a.created_at)))])])]),t._v(" "),e("div",[a.status&&a.status&&a.status.media_attachments&&a.status.media_attachments.length?e("div",[e("a",{attrs:{href:a.status.url}},[e("img",{attrs:{src:a.status.media_attachments[0].preview_url,width:"32px",height:"32px"}})])]):a.status&&a.status.parent&&a.status.parent.media_attachments&&a.status.parent.media_attachments.length?e("div",[e("a",{attrs:{href:a.status.parent.url}},[e("img",{attrs:{src:a.status.parent.media_attachments[0].preview_url,width:"32px",height:"32px"}})])]):e("div",[e("a",{staticClass:"btn btn-outline-primary py-0 font-weight-bold",attrs:{href:t.viewContext(a)}},[t._v("View")])])])]):t._e()})),t._v(" "),t.notifications.length?e("div",[e("infinite-loading",{on:{infinite:t.infiniteNotifications}},[e("div",{staticClass:"font-weight-bold",attrs:{slot:"no-results"},slot:"no-results"}),t._v(" "),e("div",{staticClass:"font-weight-bold",attrs:{slot:"no-more"},slot:"no-more"})])],1):t._e(),t._v(" "),0==t.notifications.length?e("div",{staticClass:"text-lighter text-center py-3"},[t._m(0),t._v(" "),e("p",{staticClass:"mb-0 small font-weight-bold"},[t._v("0 Notifications!")])]):t._e()],2)])])])}),[function(){var t=this.$createElement,a=this._self._c||t;return a("p",{staticClass:"mb-0"},[a("i",{staticClass:"fas fa-inbox fa-3x"})])}],!1,null,null,null);a.default=i.exports}},[[1,0]]]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[3],{1:function(t,a,e){t.exports=e("hUgz")},"KHd+":function(t,a,e){"use strict";function n(t,a,e,n,o,i,s,r){var c,l="function"==typeof t?t.options:t;if(a&&(l.render=a,l.staticRenderFns=e,l._compiled=!0),n&&(l.functional=!0),i&&(l._scopeId="data-v-"+i),s?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),o&&o.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(s)},l._ssrRegister=c):o&&(c=r?function(){o.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:o),c)if(l.functional){l._injectStyles=c;var u=l.render;l.render=function(t,a){return c.call(a),u(t,a)}}else{var d=l.beforeCreate;l.beforeCreate=d?[].concat(d,c):[c]}return{exports:t,options:l}}e.d(a,"a",(function(){return n}))},hUgz:function(t,a,e){Vue.component("activity-component",e("tXHz").default)},tXHz:function(t,a,e){"use strict";e.r(a);function n(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||function(t,a){if(!t)return;if("string"==typeof t)return o(t,a);var e=Object.prototype.toString.call(t).slice(8,-1);"Object"===e&&t.constructor&&(e=t.constructor.name);if("Map"===e||"Set"===e)return Array.from(t);if("Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return o(t,a)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,a){(null==a||a>t.length)&&(a=t.length);for(var e=0,n=new Array(a);e10?t.complete():axios.get("/api/pixelfed/v1/notifications",{params:{pg:!0,page:this.notificationCursor}}).then((function(e){if(e.data.length){var o,i=e.data.filter((function(t){return!("share"==t.type&&!status)&&!_.find(a.notifications,{id:t.id})}));(o=a.notifications).push.apply(o,n(i)),a.notificationCursor++,t.loaded()}else t.complete()}))},truncate:function(t){return t.length<=15?t:t.slice(0,15)+"..."},timeAgo:function(t){var a=Date.parse(t),e=Math.floor((new Date-a)/1e3),n=Math.floor(e/31536e3);return n>=1?n+"y":(n=Math.floor(e/604800))>=1?n+"w":(n=Math.floor(e/86400))>=1?n+"d":(n=Math.floor(e/3600))>=1?n+"h":(n=Math.floor(e/60))>=1?n+"m":Math.floor(e)+"s"},mentionUrl:function(t){return"/p/"+t.account.username+"/"+t.id},followProfile:function(t){var a=this,e=t.account.id;axios.post("/i/follow",{item:e}).then((function(t){a.notifications.map((function(t){t.account.id===e&&(t.relationship.following=!0)}))})).catch((function(t){t.response.data.message&&swal("Error",t.response.data.message,"error")}))},viewContext:function(t){switch(t.type){case"follow":return t.account.url;case"mention":return t.status.url;case"like":case"favourite":case"comment":return t.status.url;case"tagged":return t.tagged.post_url;case"direct":return"/account/direct/t/"+t.account.id}return"/"}}},s=e("KHd+"),r=Object(s.a)(i,(function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",[e("div",{staticClass:"container"},[e("div",{staticClass:"row my-5"},[e("div",{staticClass:"col-12 col-md-8 offset-md-2"},[t._l(t.notifications,(function(a,n){return t.notifications.length>0?e("div",{staticClass:"media mb-3 align-items-center px-3 border-bottom pb-3"},[e("img",{staticClass:"mr-2 rounded-circle",staticStyle:{border:"1px solid #ccc"},attrs:{src:a.account.avatar,alt:"",width:"32px",height:"32px"}}),t._v(" "),e("div",{staticClass:"media-body font-weight-light"},["favourite"==a.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:a.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:a.account.username}},[t._v(t._s(t.truncate(a.account.username)))]),t._v(" liked your "),e("a",{staticClass:"font-weight-bold",attrs:{href:a.status.url}},[t._v("post")]),t._v(".\n\t\t\t\t\t\t\t")])]):"comment"==a.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:a.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:a.account.username}},[t._v(t._s(t.truncate(a.account.username)))]),t._v(" commented on your "),e("a",{staticClass:"font-weight-bold",attrs:{href:a.status.url}},[t._v("post")]),t._v(".\n\t\t\t\t\t\t\t")])]):"mention"==a.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:a.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:a.account.username}},[t._v(t._s(t.truncate(a.account.username)))]),t._v(" "),e("a",{staticClass:"font-weight-bold",attrs:{href:t.mentionUrl(a.status)}},[t._v("mentioned")]),t._v(" you.\n\t\t\t\t\t\t\t")])]):"follow"==a.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:a.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:a.account.username}},[t._v(t._s(t.truncate(a.account.username)))]),t._v(" followed you.\n\t\t\t\t\t\t\t")])]):"share"==a.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:a.account.url,"data-placement":"bottom","data-toggle":"tooltip",title:a.account.username}},[t._v(t._s(t.truncate(a.account.username)))]),t._v(" shared your "),e("a",{staticClass:"font-weight-bold",attrs:{href:a.status.reblog.url}},[t._v("post")]),t._v(".\n\t\t\t\t\t\t\t")])]):"modlog"==a.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:a.account.url,title:a.account.username}},[t._v(t._s(t.truncate(a.account.username)))]),t._v(" updated a "),e("a",{staticClass:"font-weight-bold",attrs:{href:a.modlog.url}},[t._v("modlog")]),t._v(".\n\t\t\t\t\t\t\t")])]):"tagged"==a.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:a.account.url,title:a.account.username}},[t._v(t._s(t.truncate(a.account.username)))]),t._v(" tagged you in a "),e("a",{staticClass:"font-weight-bold",attrs:{href:a.tagged.post_url}},[t._v("post")]),t._v(".\n\t\t\t\t\t\t\t")])]):"direct"==a.type?e("div",[e("p",{staticClass:"my-0"},[e("a",{staticClass:"font-weight-bold text-dark word-break",attrs:{href:a.account.url,title:a.account.username}},[t._v(t._s(t.truncate(a.account.username)))]),t._v(" sent a "),e("a",{staticClass:"font-weight-bold",attrs:{href:"/account/direct/t/"+a.account.id}},[t._v("dm")]),t._v(".\n\t\t\t\t\t\t")])]):t._e(),t._v(" "),e("div",{staticClass:"align-items-center"},[e("span",{staticClass:"small text-muted",attrs:{"data-toggle":"tooltip","data-placement":"bottom",title:a.created_at}},[t._v(t._s(t.timeAgo(a.created_at)))])])]),t._v(" "),e("div",[a.status&&a.status&&a.status.media_attachments&&a.status.media_attachments.length?e("div",[e("a",{attrs:{href:a.status.url}},[e("img",{attrs:{src:a.status.media_attachments[0].preview_url,width:"32px",height:"32px"}})])]):a.status&&a.status.parent&&a.status.parent.media_attachments&&a.status.parent.media_attachments.length?e("div",[e("a",{attrs:{href:a.status.parent.url}},[e("img",{attrs:{src:a.status.parent.media_attachments[0].preview_url,width:"32px",height:"32px"}})])]):e("div",[e("a",{staticClass:"btn btn-outline-primary py-0 font-weight-bold",attrs:{href:t.viewContext(a)}},[t._v("View")])])])]):t._e()})),t._v(" "),t.notifications.length?e("div",[e("infinite-loading",{on:{infinite:t.infiniteNotifications}},[e("div",{staticClass:"font-weight-bold",attrs:{slot:"no-results"},slot:"no-results"}),t._v(" "),e("div",{staticClass:"font-weight-bold",attrs:{slot:"no-more"},slot:"no-more"})])],1):t._e(),t._v(" "),0==t.notifications.length?e("div",{staticClass:"text-lighter text-center py-3"},[t._m(0),t._v(" "),e("p",{staticClass:"mb-0 small font-weight-bold"},[t._v("0 Notifications!")])]):t._e()],2)])])])}),[function(){var t=this.$createElement,a=this._self._c||t;return a("p",{staticClass:"mb-0"},[a("i",{staticClass:"fas fa-inbox fa-3x"})])}],!1,null,null,null);a.default=r.exports}},[[1,0]]]); \ No newline at end of file diff --git a/public/js/collectioncompose.js b/public/js/collectioncompose.js index ad65223e1..fca253b9a 100644 --- a/public/js/collectioncompose.js +++ b/public/js/collectioncompose.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{17:function(t,i,e){t.exports=e("iBgk")},GicU:function(t,i,e){"use strict";e.r(i);var o={props:["collection-id","profile-id"],data:function(){return{config:window.App.config,loaded:!1,limit:8,step:1,title:"",description:"",visibility:"private",collection:{title:"",description:"",visibility:"public"},id:"",posts:[],tab:"add",tabs:["all","add","order"],recentPosts:[],selectedPost:""}},beforeMount:function(){var t=this;axios.get("/api/local/collection/"+this.collectionId).then((function(i){t.collection=i.data}))},mounted:function(){this.fetchRecentPosts(),this.fetchItems(),axios.get("/api/pixelfed/v1/accounts/verify_credentials").then((function(t){window._sharedData.curUser=t.data,window.App.util.navatar()}))},methods:{addToIds:function(t){var i=this;axios.post("/api/local/collection/item",{collection_id:this.collectionId,post_id:t}).then((function(t){i.fetchItems(),i.fetchRecentPosts(),i.tab="all",i.id=""})).catch((function(t){swal("Invalid URL","The post you entered was invalid","error"),i.id=""}))},fetchItems:function(){var t=this;axios.get("/api/local/collection/items/"+this.collectionId).then((function(i){t.posts=i.data,t.loaded=!0}))},addId:function(){var t=this.config.uploader.max_collection_length;if(this.posts.length>=t)swal("Error","You can only add "+t+" posts per collection","error");else{var i=this.id,e=window.location.origin,o=i.split("/");i.slice(0,e.length)!==e&&(swal("Invalid URL","You can only add posts from this instance","error"),this.id=""),i.slice(0,e.length+3)===e+"/p/"&&6===o.length||(swal("Invalid URL","Invalid URL","error"),this.id=""),this.addToIds(o[5])}},previewUrl:function(t){return t.sensitive?"/storage/no-preview.png?v="+(new Date).getTime():t.media_attachments[0].preview_url},previewBackground:function(t){return"background-image: url("+this.previewUrl(t)+");background-size:cover;"},fetchRecentPosts:function(){var t=this;axios.get("/api/pixelfed/v1/accounts/"+this.profileId+"/statuses",{params:{only_media:!0,min_id:1}}).then((function(i){t.recentPosts=i.data.filter((function(i){var e=t.posts.map((function(t){return t.id}));return"public"==i.visibility&&0==i.sensitive&&-1==e.indexOf(i.id)})).slice(0,3)}))},selectPost:function(t){this.selectedPost=t.id,this.id=t.url},publish:function(){0!=this.posts.length?axios.post("/api/local/collection/"+this.collectionId+"/publish",{title:this.collection.title,description:this.collection.description,visibility:this.collection.visibility}).then((function(t){window.location.href=t.data})).catch((function(t){swal("Something went wrong","There was a problem with your request, please try again later.","error")})):swal("Error","You cannot publish an empty collection")},save:function(){axios.post("/api/local/collection/"+this.collectionId,{title:this.collection.title,description:this.collection.description,visibility:this.collection.visibility}).then((function(t){swal("Saved!","You have successfully saved this collection.","success")}))},deleteCollection:function(){window.confirm("Are you sure you want to delete this collection?")&&axios.delete("/api/local/collection/"+this.collectionId).then((function(t){window.location.href="/"}))}}},s=e("KHd+"),l=Object(s.a)(o,(function(){var t=this,i=t.$createElement,e=t._self._c||i;return e("div",{staticClass:"container"},[t.loaded?e("div",{staticClass:"row"},[t._m(0),t._v(" "),e("div",{staticClass:"col-12 col-md-4 pt-3"},[e("div",{staticClass:"card rounded-0 shadow-none border ",staticStyle:{"min-height":"440px"}},[e("div",{staticClass:"card-body"},[e("div",[e("form",[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"title"}},[t._v("Title")]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.collection.title,expression:"collection.title"}],staticClass:"form-control",attrs:{type:"text",id:"title",placeholder:"Collection Title"},domProps:{value:t.collection.title},on:{input:function(i){i.target.composing||t.$set(t.collection,"title",i.target.value)}}})]),t._v(" "),e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"description"}},[t._v("Description")]),t._v(" "),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.collection.description,expression:"collection.description"}],staticClass:"form-control",attrs:{id:"description",placeholder:"Example description here",rows:"3"},domProps:{value:t.collection.description},on:{input:function(i){i.target.composing||t.$set(t.collection,"description",i.target.value)}}})]),t._v(" "),e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"visibility"}},[t._v("Visibility")]),t._v(" "),e("select",{directives:[{name:"model",rawName:"v-model",value:t.collection.visibility,expression:"collection.visibility"}],staticClass:"custom-select",on:{change:function(i){var e=Array.prototype.filter.call(i.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.collection,"visibility",i.target.multiple?e:e[0])}}},[e("option",{attrs:{value:"public"}},[t._v("Public")]),t._v(" "),e("option",{attrs:{value:"private"}},[t._v("Followers Only")])])])]),t._v(" "),e("hr"),t._v(" "),e("p",[t.posts.length>0?e("button",{staticClass:"btn btn-primary font-weight-bold btn-block",attrs:{type:"button"},on:{click:t.publish}},[t._v("Publish")]):e("button",{staticClass:"btn btn-primary font-weight-bold btn-block disabled",attrs:{type:"button",disabled:""}},[t._v("Publish")])]),t._v(" "),e("p",[e("button",{staticClass:"btn btn-outline-primary font-weight-bold btn-block",attrs:{type:"button"},on:{click:t.save}},[t._v("Save")])]),t._v(" "),e("p",{staticClass:"mb-0"},[e("button",{staticClass:"btn btn-outline-secondary font-weight-bold btn-block",attrs:{type:"button"},on:{click:t.deleteCollection}},[t._v("Delete")])])])])])]),t._v(" "),e("div",{staticClass:"col-12 col-md-8 pt-3"},[e("div",[e("ul",{staticClass:"nav nav-tabs"},[e("li",{staticClass:"nav-item"},[e("a",{class:["add"==t.tab?"nav-link font-weight-bold bg-white active":"nav-link font-weight-bold text-muted"],attrs:{href:"#"},on:{click:function(i){i.preventDefault(),t.tab="add"}}},[t._v("Add Posts")])]),t._v(" "),e("li",{staticClass:"nav-item"},[e("a",{class:["all"==t.tab?"nav-link font-weight-bold bg-white active":"nav-link font-weight-bold text-muted"],attrs:{href:"#"},on:{click:function(i){i.preventDefault(),t.tab="all"}}},[t._v("Preview")])])])]),t._v(" "),e("div",{staticClass:"card rounded-0 shadow-none border border-top-0"},[e("div",{staticClass:"card-body",staticStyle:{height:"460px","overflow-y":"auto"}},["all"==t.tab?e("div",{staticClass:"row"},t._l(t.posts,(function(i,o){return e("div",{staticClass:"col-4 p-1"},[e("a",{staticClass:"card info-overlay card-md-border-0",attrs:{href:i.url}},[e("div",{staticClass:"square"},["photo:album"==i.pf_type?e("span",{staticClass:"float-right mr-3 post-icon"},[e("i",{staticClass:"fas fa-images fa-2x"})]):t._e(),t._v(" "),"video"==i.pf_type?e("span",{staticClass:"float-right mr-3 post-icon"},[e("i",{staticClass:"fas fa-video fa-2x"})]):t._e(),t._v(" "),"video:album"==i.pf_type?e("span",{staticClass:"float-right mr-3 post-icon"},[e("i",{staticClass:"fas fa-film fa-2x"})]):t._e(),t._v(" "),e("div",{staticClass:"square-content",style:t.previewBackground(i)}),t._v(" "),e("div",{staticClass:"info-overlay-text"},[e("h5",{staticClass:"text-white m-auto font-weight-bold"},[e("span",[e("span",{staticClass:"far fa-heart fa-lg p-2 d-flex-inline"}),t._v(" "),e("span",{staticClass:"d-flex-inline"},[t._v(t._s(i.favourites_count))])]),t._v(" "),e("span",[e("span",{staticClass:"fas fa-retweet fa-lg p-2 d-flex-inline"}),t._v(" "),e("span",{staticClass:"d-flex-inline"},[t._v(t._s(i.reblogs_count))])])])])])])])})),0):t._e(),t._v(" "),"add"==t.tab?e("div",[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"title"}},[t._v("Add Post by URL")]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.id,expression:"id"}],staticClass:"form-control",attrs:{type:"text",placeholder:"https://pixelfed.dev/p/admin/1"},domProps:{value:t.id},on:{input:function(i){i.target.composing||(t.id=i.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text small text-muted"},[t._v("Only local, public posts can be added")])]),t._v(" "),e("div",{staticClass:"form-group pt-4"},[e("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"title"}},[t._v("Add Recent Post")]),t._v(" "),e("div",t._l(t.recentPosts,(function(i,o){return e("div",{class:[t.selectedPost==i.id?"box-shadow border border-warning d-inline-block m-1":"d-inline-block m-1"],on:{click:function(e){return t.selectPost(i)}}},[e("div",{staticClass:"cursor-pointer",style:"width: 175px; height: 175px; "+t.previewBackground(i)})])})),0)]),t._v(" "),e("hr"),t._v(" "),e("button",{staticClass:"btn btn-primary font-weight-bold btn-block",attrs:{type:"button"},on:{click:t.addId}},[t._v("Add Post")])]):t._e(),t._v(" "),"order"==t.tab?e("div"):t._e()])])])]):t._e()])}),[function(){var t=this.$createElement,i=this._self._c||t;return i("div",{staticClass:"col-12 col-md-6 offset-md-3 pt-5"},[i("div",{staticClass:"text-center pb-4"},[i("h1",[this._v("Create Collection")])])])}],!1,null,null,null);i.default=l.exports},"KHd+":function(t,i,e){"use strict";function o(t,i,e,o,s,l,n,a){var c,r="function"==typeof t?t.options:t;if(i&&(r.render=i,r.staticRenderFns=e,r._compiled=!0),o&&(r.functional=!0),l&&(r._scopeId="data-v-"+l),n?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(n)},r._ssrRegister=c):s&&(c=a?function(){s.call(this,this.$root.$options.shadowRoot)}:s),c)if(r.functional){r._injectStyles=c;var d=r.render;r.render=function(t,i){return c.call(i),d(t,i)}}else{var p=r.beforeCreate;r.beforeCreate=p?[].concat(p,c):[c]}return{exports:t,options:r}}e.d(i,"a",(function(){return o}))},iBgk:function(t,i,e){Vue.component("collection-compose",e("GicU").default)}},[[17,0]]]); \ No newline at end of file +(window.webpackJsonp=window.webpackJsonp||[]).push([[5],{17:function(t,i,e){t.exports=e("iBgk")},GicU:function(t,i,e){"use strict";e.r(i);var o={props:["collection-id","profile-id"],data:function(){return{config:window.App.config,loaded:!1,limit:8,step:1,title:"",description:"",visibility:"private",collection:{title:"",description:"",visibility:"public"},id:"",posts:[],tab:"add",tabs:["all","add","order"],recentPosts:[],selectedPost:""}},beforeMount:function(){var t=this;axios.get("/api/local/collection/"+this.collectionId).then((function(i){t.collection=i.data}))},mounted:function(){this.fetchRecentPosts(),this.fetchItems(),axios.get("/api/pixelfed/v1/accounts/verify_credentials").then((function(t){window._sharedData.curUser=t.data,window.App.util.navatar()}))},methods:{addToIds:function(t){var i=this;axios.post("/api/local/collection/item",{collection_id:this.collectionId,post_id:t}).then((function(t){i.fetchItems(),i.fetchRecentPosts(),i.tab="all",i.id=""})).catch((function(t){swal("Invalid URL","The post you entered was invalid","error"),i.id=""}))},fetchItems:function(){var t=this;axios.get("/api/local/collection/items/"+this.collectionId).then((function(i){t.posts=i.data,t.loaded=!0}))},addId:function(){var t=this.config.uploader.max_collection_length;if(this.posts.length>=t)swal("Error","You can only add "+t+" posts per collection","error");else{var i=this.id,e=window.location.origin,o=i.split("/");i.slice(0,e.length)!==e&&(swal("Invalid URL","You can only add posts from this instance","error"),this.id=""),i.slice(0,e.length+3)===e+"/p/"&&6===o.length||(swal("Invalid URL","Invalid URL","error"),this.id=""),this.addToIds(o[5])}},previewUrl:function(t){return t.sensitive?"/storage/no-preview.png?v="+(new Date).getTime():t.media_attachments[0].preview_url},previewBackground:function(t){return"background-image: url("+this.previewUrl(t)+");background-size:cover;"},fetchRecentPosts:function(){var t=this;axios.get("/api/pixelfed/v1/accounts/"+this.profileId+"/statuses",{params:{only_media:!0,min_id:1}}).then((function(i){t.recentPosts=i.data.filter((function(i){var e=t.posts.map((function(t){return t.id}));return"public"==i.visibility&&0==i.sensitive&&-1==e.indexOf(i.id)})).slice(0,3)}))},selectPost:function(t){this.selectedPost=t.id,this.id=t.url},publish:function(){0!=this.posts.length?axios.post("/api/local/collection/"+this.collectionId+"/publish",{title:this.collection.title,description:this.collection.description,visibility:this.collection.visibility}).then((function(t){window.location.href=t.data})).catch((function(t){swal("Something went wrong","There was a problem with your request, please try again later.","error")})):swal("Error","You cannot publish an empty collection")},save:function(){axios.post("/api/local/collection/"+this.collectionId,{title:this.collection.title,description:this.collection.description,visibility:this.collection.visibility}).then((function(t){swal("Saved!","You have successfully saved this collection.","success")}))},deleteCollection:function(){window.confirm("Are you sure you want to delete this collection?")&&axios.delete("/api/local/collection/"+this.collectionId).then((function(t){window.location.href="/"}))}}},s=e("KHd+"),l=Object(s.a)(o,(function(){var t=this,i=t.$createElement,e=t._self._c||i;return e("div",{staticClass:"container"},[t.loaded?e("div",{staticClass:"row"},[t._m(0),t._v(" "),e("div",{staticClass:"col-12 col-md-4 pt-3"},[e("div",{staticClass:"card rounded-0 shadow-none border ",staticStyle:{"min-height":"440px"}},[e("div",{staticClass:"card-body"},[e("div",[e("form",[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"title"}},[t._v("Title")]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.collection.title,expression:"collection.title"}],staticClass:"form-control",attrs:{type:"text",id:"title",placeholder:"Collection Title"},domProps:{value:t.collection.title},on:{input:function(i){i.target.composing||t.$set(t.collection,"title",i.target.value)}}})]),t._v(" "),e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"description"}},[t._v("Description")]),t._v(" "),e("textarea",{directives:[{name:"model",rawName:"v-model",value:t.collection.description,expression:"collection.description"}],staticClass:"form-control",attrs:{id:"description",placeholder:"Example description here",rows:"3"},domProps:{value:t.collection.description},on:{input:function(i){i.target.composing||t.$set(t.collection,"description",i.target.value)}}})]),t._v(" "),e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"visibility"}},[t._v("Visibility")]),t._v(" "),e("select",{directives:[{name:"model",rawName:"v-model",value:t.collection.visibility,expression:"collection.visibility"}],staticClass:"custom-select",on:{change:function(i){var e=Array.prototype.filter.call(i.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.$set(t.collection,"visibility",i.target.multiple?e:e[0])}}},[e("option",{attrs:{value:"public"}},[t._v("Public")]),t._v(" "),e("option",{attrs:{value:"private"}},[t._v("Followers Only")])])])]),t._v(" "),e("hr"),t._v(" "),e("p",[t.posts.length>0?e("button",{staticClass:"btn btn-primary font-weight-bold btn-block",attrs:{type:"button"},on:{click:t.publish}},[t._v("Publish")]):e("button",{staticClass:"btn btn-primary font-weight-bold btn-block disabled",attrs:{type:"button",disabled:""}},[t._v("Publish")])]),t._v(" "),e("p",[e("button",{staticClass:"btn btn-outline-primary font-weight-bold btn-block",attrs:{type:"button"},on:{click:t.save}},[t._v("Save")])]),t._v(" "),e("p",{staticClass:"mb-0"},[e("button",{staticClass:"btn btn-outline-secondary font-weight-bold btn-block",attrs:{type:"button"},on:{click:t.deleteCollection}},[t._v("Delete")])])])])])]),t._v(" "),e("div",{staticClass:"col-12 col-md-8 pt-3"},[e("div",[e("ul",{staticClass:"nav nav-tabs"},[e("li",{staticClass:"nav-item"},[e("a",{class:["add"==t.tab?"nav-link font-weight-bold bg-white active":"nav-link font-weight-bold text-muted"],attrs:{href:"#"},on:{click:function(i){i.preventDefault(),t.tab="add"}}},[t._v("Add Posts")])]),t._v(" "),e("li",{staticClass:"nav-item"},[e("a",{class:["all"==t.tab?"nav-link font-weight-bold bg-white active":"nav-link font-weight-bold text-muted"],attrs:{href:"#"},on:{click:function(i){i.preventDefault(),t.tab="all"}}},[t._v("Preview")])])])]),t._v(" "),e("div",{staticClass:"card rounded-0 shadow-none border border-top-0"},[e("div",{staticClass:"card-body",staticStyle:{height:"460px","overflow-y":"auto"}},["all"==t.tab?e("div",{staticClass:"row"},t._l(t.posts,(function(i,o){return e("div",{staticClass:"col-4 p-1"},[e("a",{staticClass:"card info-overlay card-md-border-0",attrs:{href:i.url}},[e("div",{staticClass:"square"},["photo:album"==i.pf_type?e("span",{staticClass:"float-right mr-3 post-icon"},[e("i",{staticClass:"fas fa-images fa-2x"})]):t._e(),t._v(" "),"video"==i.pf_type?e("span",{staticClass:"float-right mr-3 post-icon"},[e("i",{staticClass:"fas fa-video fa-2x"})]):t._e(),t._v(" "),"video:album"==i.pf_type?e("span",{staticClass:"float-right mr-3 post-icon"},[e("i",{staticClass:"fas fa-film fa-2x"})]):t._e(),t._v(" "),e("div",{staticClass:"square-content",style:t.previewBackground(i)}),t._v(" "),e("div",{staticClass:"info-overlay-text"},[e("h5",{staticClass:"text-white m-auto font-weight-bold"},[e("span",[e("span",{staticClass:"far fa-heart fa-lg p-2 d-flex-inline"}),t._v(" "),e("span",{staticClass:"d-flex-inline"},[t._v(t._s(i.favourites_count))])]),t._v(" "),e("span",[e("span",{staticClass:"fas fa-retweet fa-lg p-2 d-flex-inline"}),t._v(" "),e("span",{staticClass:"d-flex-inline"},[t._v(t._s(i.reblogs_count))])])])])])])])})),0):t._e(),t._v(" "),"add"==t.tab?e("div",[e("div",{staticClass:"form-group"},[e("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"title"}},[t._v("Add Post by URL")]),t._v(" "),e("input",{directives:[{name:"model",rawName:"v-model",value:t.id,expression:"id"}],staticClass:"form-control",attrs:{type:"text",placeholder:"https://pixelfed.dev/p/admin/1"},domProps:{value:t.id},on:{input:function(i){i.target.composing||(t.id=i.target.value)}}}),t._v(" "),e("p",{staticClass:"help-text small text-muted"},[t._v("Only local, public posts can be added")])]),t._v(" "),e("div",{staticClass:"form-group pt-4"},[e("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"title"}},[t._v("Add Recent Post")]),t._v(" "),e("div",t._l(t.recentPosts,(function(i,o){return e("div",{class:[t.selectedPost==i.id?"box-shadow border border-warning d-inline-block m-1":"d-inline-block m-1"],on:{click:function(e){return t.selectPost(i)}}},[e("div",{staticClass:"cursor-pointer",style:"width: 175px; height: 175px; "+t.previewBackground(i)})])})),0)]),t._v(" "),e("hr"),t._v(" "),e("button",{staticClass:"btn btn-primary font-weight-bold btn-block",attrs:{type:"button"},on:{click:t.addId}},[t._v("Add Post")])]):t._e(),t._v(" "),"order"==t.tab?e("div"):t._e()])])])]):t._e()])}),[function(){var t=this.$createElement,i=this._self._c||t;return i("div",{staticClass:"col-12 col-md-6 offset-md-3 pt-5"},[i("div",{staticClass:"text-center pb-4"},[i("h1",[this._v("Create Collection")])])])}],!1,null,null,null);i.default=l.exports},"KHd+":function(t,i,e){"use strict";function o(t,i,e,o,s,l,n,a){var c,r="function"==typeof t?t.options:t;if(i&&(r.render=i,r.staticRenderFns=e,r._compiled=!0),o&&(r.functional=!0),l&&(r._scopeId="data-v-"+l),n?(c=function(t){(t=t||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext)||"undefined"==typeof __VUE_SSR_CONTEXT__||(t=__VUE_SSR_CONTEXT__),s&&s.call(this,t),t&&t._registeredComponents&&t._registeredComponents.add(n)},r._ssrRegister=c):s&&(c=a?function(){s.call(this,(r.functional?this.parent:this).$root.$options.shadowRoot)}:s),c)if(r.functional){r._injectStyles=c;var d=r.render;r.render=function(t,i){return c.call(i),d(t,i)}}else{var p=r.beforeCreate;r.beforeCreate=p?[].concat(p,c):[c]}return{exports:t,options:r}}e.d(i,"a",(function(){return o}))},iBgk:function(t,i,e){Vue.component("collection-compose",e("GicU").default)}},[[17,0]]]); \ No newline at end of file diff --git a/public/js/collections.js b/public/js/collections.js index e15addb32..373da2b0c 100644 --- a/public/js/collections.js +++ b/public/js/collections.js @@ -1 +1 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[6],{"+BJ4":function(t,e,n){"use strict";var o=n("rvdV");n.n(o).a},18:function(t,e,n){t.exports=n("ntcu")},"9tPo":function(t,e){t.exports=function(t){var e="undefined"!=typeof window&&window.location;if(!e)throw new Error("fixUrls requires window.location");if(!t||"string"!=typeof t)return t;var n=e.protocol+"//"+e.host,o=n+e.pathname.replace(/\/[^\/]*$/,"/");return t.replace(/url\s*\(((?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)\)/gi,(function(t,e){var i,r=e.trim().replace(/^"(.*)"$/,(function(t,e){return e})).replace(/^'(.*)'$/,(function(t,e){return e}));return/^(#|data:|http:\/\/|https:\/\/|file:\/\/\/|\s*$)/i.test(r)?t:(i=0===r.indexOf("//")?r:0===r.indexOf("/")?n+r:o+r.replace(/^\.\//,""),"url("+JSON.stringify(i)+")")}))}},BzCV:function(t,e,n){"use strict";n.r(e);var o=n("la7V");function i(t){return function(t){if(Array.isArray(t)){for(var e=0,n=new Array(t.length);e=e)swal("Error","You can only add "+e+" posts per collection","error");else{var o=this.photoId,r=window.location.origin,s=o.split("/");o.slice(0,r.length)!==r&&(swal("Invalid URL","You can only add posts from this instance","error"),this.photoId=""),o.slice(0,r.length+3)===r+"/p/"&&6===s.length||(swal("Invalid URL","Invalid URL","error"),this.photoId=""),axios.post("/api/local/collection/item",{collection_id:this.collectionId,post_id:s[5]}).then((function(t){var e;(e=n.ids).push.apply(e,i(s[5]))})).catch((function(e){swal("Invalid URL","The post you entered was invalid","error"),t.photoId=""})),n.$refs.addPhotoModal.hide(),window.location.reload()}},editCollection:function(){this.$refs.editModal.show()},deleteCollection:function(){0!=this.owner&&(window.confirm("Are you sure you want to delete this collection?")&&axios.delete("/api/local/collection/"+this.collectionId).then((function(t){window.location.href="/"})))},updateCollection:function(){this.$refs.editModal.hide(),axios.post("/api/local/collection/"+this.collectionId,{title:this.title,description:this.description,visibility:this.visibility}).then((function(t){console.log(t.data)}))},showEditPhotosModal:function(){this.$refs.editModal.hide(),this.$refs.editPhotosModal.show()},markPhotoForDeletion:function(t){-1==this.markedForDeletion.indexOf(t)?this.markedForDeletion.push(t):this.markedForDeletion=this.markedForDeletion.filter((function(e){return e!=t}))},confirmDeletion:function(){var t=this,e=this;window.confirm("Are you sure you want to delete this?")&&(this.markedForDeletion.forEach((function(n){axios.delete("/api/local/collection/item",{params:{collection_id:e.collectionId,post_id:n}}).then((function(o){e.removeItem(n),t.$refs.editPhotosModal.hide()})).catch((function(t){swal("Oops!","An error occured with your request, please try again later.","error")}))})),this.markedForDeletion=[])},removeItem:function(t){this.posts=this.posts.filter((function(e){return e.id!=t}))},addRecentId:function(t){var e=this;axios.post("/api/local/collection/item",{collection_id:this.collectionId,post_id:t.id}).then((function(t){window.location.reload()})).catch((function(t){swal("Oops!","An error occured, please try selecting another post.","error"),e.photoId=""}))}}},s=(n("+BJ4"),n("KHd+")),a=Object(s.a)(r,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"w-100 h-100"},[t.loaded?t._e():n("div",{staticClass:"d-flex justify-content-center align-items-center",staticStyle:{height:"80vh"}},[n("img",{attrs:{src:"/img/pixelfed-icon-grey.svg"}})]),t._v(" "),t.loaded?n("div",{staticClass:"row mt-3"},[n("div",{staticClass:"col-12 p-0 mb-3"},[n("picture",{staticClass:"d-flex align-items-center justify-content-center"},[n("div",{staticClass:"dims"}),t._v(" "),n("div",{staticClass:"text-white",staticStyle:{"z-index":"500",position:"absolute"}},[n("p",{staticClass:"display-4 text-center pt-3"},[t._v(t._s(t.title||"Untitled Collection"))]),t._v(" "),n("p",{staticClass:"lead text-center mb-3"},[t._v(t._s(t.description))]),t._v(" "),n("p",{staticClass:"text-center"},[t._v("\n\t\t\t\t\t\t"+t._s(t.posts.length)+" photos · by "),n("a",{staticClass:"font-weight-bold text-white",attrs:{href:"/"+t.profileUsername}},[t._v(t._s(t.profileUsername))])]),t._v(" "),1==t.owner?n("p",{staticClass:"pt-3 text-center"},[n("span",[n("button",{staticClass:"btn btn-outline-light btn-sm",attrs:{onclick:"this.blur();"},on:{click:function(e){return e.preventDefault(),t.addToCollection(e)}}},[0==t.loadingPostList?n("span",[t._v("Add Photo")]):n("span",{staticClass:"px-4"},[t._m(0)])]),t._v("\n\t\t\t\t\t\t\t     \n\t\t\t\t\t\t\t"),n("button",{staticClass:"btn btn-outline-light btn-sm",attrs:{onclick:"this.blur();"},on:{click:function(e){return e.preventDefault(),t.editCollection(e)}}},[t._v("Edit")]),t._v("\n\t\t\t\t\t\t\t     \n\t\t\t\t\t\t\t"),n("button",{staticClass:"btn btn-outline-light btn-sm",on:{click:function(e){return e.preventDefault(),t.deleteCollection(e)}}},[t._v("Delete")])])]):t._e()]),t._v(" "),n("img",{staticStyle:{width:"100%",height:"600px","object-fit":"cover"},attrs:{src:t.previewUrl(t.posts[0]),alt:""}})])]),t._v(" "),n("div",{staticClass:"col-12 p-0"},[n("masonry",{attrs:{cols:{default:2,700:2,400:1},gutter:{default:"5px"}}},t._l(t.posts,(function(e,o){return n("div",[n("a",{staticClass:"card info-overlay card-md-border-0 mb-1",attrs:{href:e.url}},[n("img",{staticClass:"img-fluid w-100",attrs:{src:t.previewUrl(e)}})])])})),0)],1)]):t._e(),t._v(" "),n("b-modal",{ref:"editModal",attrs:{id:"edit-modal","hide-footer":"",centered:"",title:"Edit Collection","body-class":""}},[n("form",[n("div",{staticClass:"form-group"},[n("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"title"}},[t._v("Title")]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.title,expression:"title"}],staticClass:"form-control",attrs:{type:"text",id:"title",placeholder:"Untitled Collection"},domProps:{value:t.title},on:{input:function(e){e.target.composing||(t.title=e.target.value)}}})]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"description"}},[t._v("Description")]),t._v(" "),n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.description,expression:"description"}],staticClass:"form-control",attrs:{id:"description",placeholder:"Add a description here ...",rows:"3"},domProps:{value:t.description},on:{input:function(e){e.target.composing||(t.description=e.target.value)}}})]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"visibility"}},[t._v("Visibility")]),t._v(" "),n("select",{directives:[{name:"model",rawName:"v-model",value:t.visibility,expression:"visibility"}],staticClass:"custom-select",on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.visibility=e.target.multiple?n:n[0]}}},[n("option",{attrs:{value:"public"}},[t._v("Public")]),t._v(" "),n("option",{attrs:{value:"private"}},[t._v("Followers Only")])])]),t._v(" "),n("div",{staticClass:"d-flex justify-content-between align-items-center pt-3"},[n("a",{staticClass:"text-primary font-weight-bold text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showEditPhotosModal(e)}}},[t._v("Edit Photos")]),t._v(" "),n("button",{staticClass:"btn btn-primary btn-sm py-1 font-weight-bold px-3 float-right",attrs:{type:"button"},on:{click:function(e){return e.preventDefault(),t.updateCollection(e)}}},[t._v("Save")])])])]),t._v(" "),n("b-modal",{ref:"addPhotoModal",attrs:{id:"add-photo-modal","hide-footer":"",centered:"",title:"Add Photo","body-class":"m-3"}},[n("div",{staticClass:"form-group"},[n("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"title"}},[t._v("Add Recent Post")]),t._v(" "),t.postsList.length>0?n("div",{staticClass:"row m-1"},[t._l(t.postsList,(function(e,o){return n("div",{key:"postList-"+o,staticClass:"col-4 p-1 cursor-pointer",on:{click:function(n){return t.addRecentId(e)}}},[n("div",{staticClass:"square"},[n("div",{staticClass:"square-content",style:"background-image: url("+e.media_attachments[0].url+");"})])])})),t._v(" "),n("div",{staticClass:"col-12"},[n("hr")])],2):t._e()]),t._v(" "),n("form",[n("div",{staticClass:"form-group"},[n("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"title"}},[t._v("Add Post by URL")]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.photoId,expression:"photoId"}],staticClass:"form-control",attrs:{type:"text",placeholder:"https://pixelfed.dev/p/admin/1"},domProps:{value:t.photoId},on:{input:function(e){e.target.composing||(t.photoId=e.target.value)}}}),t._v(" "),n("p",{staticClass:"help-text small text-muted"},[t._v("Only local, public posts can be added")])]),t._v(" "),n("button",{staticClass:"btn btn-primary btn-sm py-1 font-weight-bold px-3 float-right",attrs:{type:"button"},on:{click:function(e){return e.preventDefault(),t.pushId(e)}}},[t.addingPostToCollection?n("span",{staticClass:"px-4"},[n("div",{staticClass:"spinner-border spinner-border-sm",attrs:{role:"status"}},[n("span",{staticClass:"sr-only"},[t._v("Loading...")])])]):n("span",[t._v("\n\t\t\t\t\tAdd Photo\n\t\t\t\t")])])])]),t._v(" "),n("b-modal",{ref:"editPhotosModal",attrs:{id:"edit-photos-modal","hide-footer":"",centered:"",title:"Edit Collection Photos","body-class":"m-3"}},[n("div",{staticClass:"form-group"},[n("p",{staticClass:"font-weight-bold text-dark text-center"},[t._v("Select a Photo to Delete")]),t._v(" "),t.posts.length>0?n("div",{staticClass:"row m-1 scrollbar-hidden",staticStyle:{"max-height":"350px","overflow-y":"auto"}},t._l(t.posts,(function(e,o){return n("div",{key:"plm-"+o,staticClass:"col-4 p-1 cursor-pointer"},[n("div",{class:[-1==t.markedForDeletion.indexOf(e.id)?"square":"square delete-border"],on:{click:function(n){return t.markPhotoForDeletion(e.id)}}},[n("div",{staticClass:"square-content",style:"background-image: url("+e.media_attachments[0].url+");"})])])})),0):t._e(),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.markedForDeletion.length>0,expression:"markedForDeletion.length > 0"}]},[n("button",{staticClass:"btn btn-primary font-weight-bold py-0 btn-block mb-0 mt-4",attrs:{type:"button"},on:{click:function(e){return e.preventDefault(),t.confirmDeletion(e)}}},[t._v("Delete "+t._s(t.markedForDeletion.length)+" "+t._s(1==t.markedForDeletion.length?"photo":"photos"))])])])])],1)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"spinner-border spinner-border-sm",attrs:{role:"status"}},[e("span",{staticClass:"sr-only"},[this._v("Loading...")])])}],!1,null,"77a83cb3",null);e.default=a.exports},I1BE:function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",o=t[3];if(!o)return n;if(e&&"function"==typeof btoa){var i=(s=o,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),r=o.sources.map((function(t){return"/*# sourceURL="+o.sourceRoot+t+" */"}));return[n].concat(r).concat([i]).join("\n")}var s;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var o={},i=0;i=0&&u.splice(e,1)}function b(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var o=function(){0;return n.nc}();o&&(t.attrs.nonce=o)}return g(e,t.attrs),v(t,e),e}function g(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function y(t,e){var n,o,i,r;if(e.transform&&t.css){if(!(r="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=r}if(e.singleton){var s=d++;n=c||(c=b(e)),o=_.bind(null,n,s,!1),i=_.bind(null,n,s,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",g(e,t.attrs),v(t,e),e}(e),o=I.bind(null,n,e),i=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=b(e),o=x.bind(null,n),i=function(){m(n)});return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else i()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=s()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=h(t,e);return f(n,e),function(t){for(var o=[],i=0;i-1)return t;if("object"!=typeof t)return 0;var n=1/0,o=t.default||0;for(var i in t){var r=parseInt(i),s=t[r],a=parseInt(s);if(!isNaN(r)&&!isNaN(a))e<=r&&rt.length)&&(e=t.length);for(var n=0,o=new Array(e);n=e)swal("Error","You can only add "+e+" posts per collection","error");else{var o=this.photoId,r=window.location.origin,s=o.split("/");o.slice(0,r.length)!==r&&(swal("Invalid URL","You can only add posts from this instance","error"),this.photoId=""),o.slice(0,r.length+3)===r+"/p/"&&6===s.length||(swal("Invalid URL","Invalid URL","error"),this.photoId=""),axios.post("/api/local/collection/item",{collection_id:this.collectionId,post_id:s[5]}).then((function(t){var e;(e=n.ids).push.apply(e,i(s[5]))})).catch((function(e){swal("Invalid URL","The post you entered was invalid","error"),t.photoId=""})),n.$refs.addPhotoModal.hide(),window.location.reload()}},editCollection:function(){this.$refs.editModal.show()},deleteCollection:function(){0!=this.owner&&(window.confirm("Are you sure you want to delete this collection?")&&axios.delete("/api/local/collection/"+this.collectionId).then((function(t){window.location.href="/"})))},updateCollection:function(){this.$refs.editModal.hide(),axios.post("/api/local/collection/"+this.collectionId,{title:this.title,description:this.description,visibility:this.visibility}).then((function(t){console.log(t.data)}))},showEditPhotosModal:function(){this.$refs.editModal.hide(),this.$refs.editPhotosModal.show()},markPhotoForDeletion:function(t){-1==this.markedForDeletion.indexOf(t)?this.markedForDeletion.push(t):this.markedForDeletion=this.markedForDeletion.filter((function(e){return e!=t}))},confirmDeletion:function(){var t=this,e=this;window.confirm("Are you sure you want to delete this?")&&(this.markedForDeletion.forEach((function(n){axios.delete("/api/local/collection/item",{params:{collection_id:e.collectionId,post_id:n}}).then((function(o){e.removeItem(n),t.$refs.editPhotosModal.hide()})).catch((function(t){swal("Oops!","An error occured with your request, please try again later.","error")}))})),this.markedForDeletion=[])},removeItem:function(t){this.posts=this.posts.filter((function(e){return e.id!=t}))},addRecentId:function(t){var e=this;axios.post("/api/local/collection/item",{collection_id:this.collectionId,post_id:t.id}).then((function(t){window.location.reload()})).catch((function(t){swal("Oops!","An error occured, please try selecting another post.","error"),e.photoId=""}))}}},a=(n("+BJ4"),n("KHd+")),l=Object(a.a)(s,(function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("div",{staticClass:"w-100 h-100"},[t.loaded?t._e():n("div",{staticClass:"d-flex justify-content-center align-items-center",staticStyle:{height:"80vh"}},[n("img",{attrs:{src:"/img/pixelfed-icon-grey.svg"}})]),t._v(" "),t.loaded?n("div",{staticClass:"row mt-3"},[n("div",{staticClass:"col-12 p-0 mb-3"},[n("picture",{staticClass:"d-flex align-items-center justify-content-center"},[n("div",{staticClass:"dims"}),t._v(" "),n("div",{staticClass:"text-white",staticStyle:{"z-index":"500",position:"absolute"}},[n("p",{staticClass:"display-4 text-center pt-3"},[t._v(t._s(t.title||"Untitled Collection"))]),t._v(" "),n("p",{staticClass:"lead text-center mb-3"},[t._v(t._s(t.description))]),t._v(" "),n("p",{staticClass:"text-center"},[t._v("\n\t\t\t\t\t\t"+t._s(t.posts.length)+" photos · by "),n("a",{staticClass:"font-weight-bold text-white",attrs:{href:"/"+t.profileUsername}},[t._v(t._s(t.profileUsername))])]),t._v(" "),1==t.owner?n("p",{staticClass:"pt-3 text-center"},[n("span",[n("button",{staticClass:"btn btn-outline-light btn-sm",attrs:{onclick:"this.blur();"},on:{click:function(e){return e.preventDefault(),t.addToCollection(e)}}},[0==t.loadingPostList?n("span",[t._v("Add Photo")]):n("span",{staticClass:"px-4"},[t._m(0)])]),t._v("\n\t\t\t\t\t\t\t     \n\t\t\t\t\t\t\t"),n("button",{staticClass:"btn btn-outline-light btn-sm",attrs:{onclick:"this.blur();"},on:{click:function(e){return e.preventDefault(),t.editCollection(e)}}},[t._v("Edit")]),t._v("\n\t\t\t\t\t\t\t     \n\t\t\t\t\t\t\t"),n("button",{staticClass:"btn btn-outline-light btn-sm",on:{click:function(e){return e.preventDefault(),t.deleteCollection(e)}}},[t._v("Delete")])])]):t._e()]),t._v(" "),n("img",{staticStyle:{width:"100%",height:"600px","object-fit":"cover"},attrs:{src:t.previewUrl(t.posts[0]),alt:""}})])]),t._v(" "),n("div",{staticClass:"col-12 p-0"},[n("masonry",{attrs:{cols:{default:2,700:2,400:1},gutter:{default:"5px"}}},t._l(t.posts,(function(e,o){return n("div",[n("a",{staticClass:"card info-overlay card-md-border-0 mb-1",attrs:{href:e.url}},[n("img",{staticClass:"img-fluid w-100",attrs:{src:t.previewUrl(e)}})])])})),0)],1)]):t._e(),t._v(" "),n("b-modal",{ref:"editModal",attrs:{id:"edit-modal","hide-footer":"",centered:"",title:"Edit Collection","body-class":""}},[n("form",[n("div",{staticClass:"form-group"},[n("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"title"}},[t._v("Title")]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.title,expression:"title"}],staticClass:"form-control",attrs:{type:"text",id:"title",placeholder:"Untitled Collection"},domProps:{value:t.title},on:{input:function(e){e.target.composing||(t.title=e.target.value)}}})]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"description"}},[t._v("Description")]),t._v(" "),n("textarea",{directives:[{name:"model",rawName:"v-model",value:t.description,expression:"description"}],staticClass:"form-control",attrs:{id:"description",placeholder:"Add a description here ...",rows:"3"},domProps:{value:t.description},on:{input:function(e){e.target.composing||(t.description=e.target.value)}}})]),t._v(" "),n("div",{staticClass:"form-group"},[n("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"visibility"}},[t._v("Visibility")]),t._v(" "),n("select",{directives:[{name:"model",rawName:"v-model",value:t.visibility,expression:"visibility"}],staticClass:"custom-select",on:{change:function(e){var n=Array.prototype.filter.call(e.target.options,(function(t){return t.selected})).map((function(t){return"_value"in t?t._value:t.value}));t.visibility=e.target.multiple?n:n[0]}}},[n("option",{attrs:{value:"public"}},[t._v("Public")]),t._v(" "),n("option",{attrs:{value:"private"}},[t._v("Followers Only")])])]),t._v(" "),n("div",{staticClass:"d-flex justify-content-between align-items-center pt-3"},[n("a",{staticClass:"text-primary font-weight-bold text-decoration-none",attrs:{href:"#"},on:{click:function(e){return e.preventDefault(),t.showEditPhotosModal(e)}}},[t._v("Edit Photos")]),t._v(" "),n("button",{staticClass:"btn btn-primary btn-sm py-1 font-weight-bold px-3 float-right",attrs:{type:"button"},on:{click:function(e){return e.preventDefault(),t.updateCollection(e)}}},[t._v("Save")])])])]),t._v(" "),n("b-modal",{ref:"addPhotoModal",attrs:{id:"add-photo-modal","hide-footer":"",centered:"",title:"Add Photo","body-class":"m-3"}},[n("div",{staticClass:"form-group"},[n("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"title"}},[t._v("Add Recent Post")]),t._v(" "),t.postsList.length>0?n("div",{staticClass:"row m-1"},[t._l(t.postsList,(function(e,o){return n("div",{key:"postList-"+o,staticClass:"col-4 p-1 cursor-pointer",on:{click:function(n){return t.addRecentId(e)}}},[n("div",{staticClass:"square"},[n("div",{staticClass:"square-content",style:"background-image: url("+e.media_attachments[0].url+");"})])])})),t._v(" "),n("div",{staticClass:"col-12"},[n("hr")])],2):t._e()]),t._v(" "),n("form",[n("div",{staticClass:"form-group"},[n("label",{staticClass:"font-weight-bold text-muted",attrs:{for:"title"}},[t._v("Add Post by URL")]),t._v(" "),n("input",{directives:[{name:"model",rawName:"v-model",value:t.photoId,expression:"photoId"}],staticClass:"form-control",attrs:{type:"text",placeholder:"https://pixelfed.dev/p/admin/1"},domProps:{value:t.photoId},on:{input:function(e){e.target.composing||(t.photoId=e.target.value)}}}),t._v(" "),n("p",{staticClass:"help-text small text-muted"},[t._v("Only local, public posts can be added")])]),t._v(" "),n("button",{staticClass:"btn btn-primary btn-sm py-1 font-weight-bold px-3 float-right",attrs:{type:"button"},on:{click:function(e){return e.preventDefault(),t.pushId(e)}}},[t.addingPostToCollection?n("span",{staticClass:"px-4"},[n("div",{staticClass:"spinner-border spinner-border-sm",attrs:{role:"status"}},[n("span",{staticClass:"sr-only"},[t._v("Loading...")])])]):n("span",[t._v("\n\t\t\t\t\tAdd Photo\n\t\t\t\t")])])])]),t._v(" "),n("b-modal",{ref:"editPhotosModal",attrs:{id:"edit-photos-modal","hide-footer":"",centered:"",title:"Edit Collection Photos","body-class":"m-3"}},[n("div",{staticClass:"form-group"},[n("p",{staticClass:"font-weight-bold text-dark text-center"},[t._v("Select a Photo to Delete")]),t._v(" "),t.posts.length>0?n("div",{staticClass:"row m-1 scrollbar-hidden",staticStyle:{"max-height":"350px","overflow-y":"auto"}},t._l(t.posts,(function(e,o){return n("div",{key:"plm-"+o,staticClass:"col-4 p-1 cursor-pointer"},[n("div",{class:[-1==t.markedForDeletion.indexOf(e.id)?"square":"square delete-border"],on:{click:function(n){return t.markPhotoForDeletion(e.id)}}},[n("div",{staticClass:"square-content",style:"background-image: url("+e.media_attachments[0].url+");"})])])})),0):t._e(),t._v(" "),n("div",{directives:[{name:"show",rawName:"v-show",value:t.markedForDeletion.length>0,expression:"markedForDeletion.length > 0"}]},[n("button",{staticClass:"btn btn-primary font-weight-bold py-0 btn-block mb-0 mt-4",attrs:{type:"button"},on:{click:function(e){return e.preventDefault(),t.confirmDeletion(e)}}},[t._v("Delete "+t._s(t.markedForDeletion.length)+" "+t._s(1==t.markedForDeletion.length?"photo":"photos"))])])])])],1)}),[function(){var t=this.$createElement,e=this._self._c||t;return e("div",{staticClass:"spinner-border spinner-border-sm",attrs:{role:"status"}},[e("span",{staticClass:"sr-only"},[this._v("Loading...")])])}],!1,null,"77a83cb3",null);e.default=l.exports},I1BE:function(t,e){t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=function(t,e){var n=t[1]||"",o=t[3];if(!o)return n;if(e&&"function"==typeof btoa){var i=(s=o,"/*# sourceMappingURL=data:application/json;charset=utf-8;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(s))))+" */"),r=o.sources.map((function(t){return"/*# sourceURL="+o.sourceRoot+t+" */"}));return[n].concat(r).concat([i]).join("\n")}var s;return[n].join("\n")}(e,t);return e[2]?"@media "+e[2]+"{"+n+"}":n})).join("")},e.i=function(t,n){"string"==typeof t&&(t=[[null,t,""]]);for(var o={},i=0;i=0&&u.splice(e,1)}function b(t){var e=document.createElement("style");if(void 0===t.attrs.type&&(t.attrs.type="text/css"),void 0===t.attrs.nonce){var o=function(){0;return n.nc}();o&&(t.attrs.nonce=o)}return g(e,t.attrs),v(t,e),e}function g(t,e){Object.keys(e).forEach((function(n){t.setAttribute(n,e[n])}))}function y(t,e){var n,o,i,r;if(e.transform&&t.css){if(!(r="function"==typeof e.transform?e.transform(t.css):e.transform.default(t.css)))return function(){};t.css=r}if(e.singleton){var s=d++;n=c||(c=b(e)),o=_.bind(null,n,s,!1),i=_.bind(null,n,s,!0)}else t.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=function(t){var e=document.createElement("link");return void 0===t.attrs.type&&(t.attrs.type="text/css"),t.attrs.rel="stylesheet",g(e,t.attrs),v(t,e),e}(e),o=I.bind(null,n,e),i=function(){m(n),n.href&&URL.revokeObjectURL(n.href)}):(n=b(e),o=x.bind(null,n),i=function(){m(n)});return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else i()}}t.exports=function(t,e){if("undefined"!=typeof DEBUG&&DEBUG&&"object"!=typeof document)throw new Error("The style-loader cannot be used in a non-browser environment");(e=e||{}).attrs="object"==typeof e.attrs?e.attrs:{},e.singleton||"boolean"==typeof e.singleton||(e.singleton=s()),e.insertInto||(e.insertInto="head"),e.insertAt||(e.insertAt="bottom");var n=h(t,e);return p(n,e),function(t){for(var o=[],i=0;i-1)return t;if("object"!=typeof t)return 0;var n=1/0,o=t.default||0;for(var i in t){var r=parseInt(i),s=t[r],a=parseInt(s);if(!isNaN(r)&&!isNaN(a))e<=r&&r0;(o>>>=1)&&(e+=e))1&o&&(n+=e);return n}},"19aa":function(t,e){t.exports=function(t,e,n){if(!(t instanceof e))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return t}},"1be4":function(t,e,n){var r=n("d066");t.exports=r("document","documentElement")},"1c0b":function(t,e){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},"1c7e":function(t,e,n){var r=n("b622")("iterator"),i=!1;try{var o=0,a={next:function(){return{done:!!o++}},return:function(){i=!0}};a[r]=function(){return this},Array.from(a,(function(){throw 2}))}catch(t){}t.exports=function(t,e){if(!e&&!i)return!1;var n=!1;try{var o={};o[r]=function(){return{next:function(){return{done:n=!0}}}},t(o)}catch(t){}return n}},"1cdc":function(t,e,n){var r=n("342f");t.exports=/(iphone|ipod|ipad).*applewebkit/i.test(r)},"1d80":function(t,e){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},2266:function(t,e,n){var r=n("825a"),i=n("e95a"),o=n("50c4"),a=n("0366"),s=n("35a1"),l=n("9bdd"),u=function(t,e){this.stopped=t,this.result=e};(t.exports=function(t,e,n,c,d){var f,h,p,b,m,v,g,y=a(e,n,c?2:1);if(d)f=t;else{if("function"!=typeof(h=s(t)))throw TypeError("Target is not iterable");if(i(h)){for(p=0,b=o(t.length);b>p;p++)if((m=c?y(r(g=t[p])[0],g[1]):y(t[p]))&&m instanceof u)return m;return new u(!1)}f=h.call(t)}for(v=f.next;!(g=v.call(f)).done;)if("object"==typeof(m=l(f,y,g.value,c))&&m&&m instanceof u)return m;return new u(!1)}).stop=function(t){return new u(!0,t)}},"23cb":function(t,e,n){var r=n("a691"),i=Math.max,o=Math.min;t.exports=function(t,e){var n=r(t);return n<0?i(n+e,0):o(n,e)}},"23e7":function(t,e,n){var r=n("da84"),i=n("06cf").f,o=n("9112"),a=n("6eeb"),s=n("ce4e"),l=n("e893"),u=n("94ca");t.exports=function(t,e){var n,c,d,f,h,p=t.target,b=t.global,m=t.stat;if(n=b?r:m?r[p]||s(p,{}):(r[p]||{}).prototype)for(c in e){if(f=e[c],d=t.noTargetGet?(h=i(n,c))&&h.value:n[c],!u(b?c:p+(m?".":"#")+c,t.forced)&&void 0!==d){if(typeof f==typeof d)continue;l(f,d)}(t.sham||d&&d.sham)&&o(f,"sham",!0),a(n,c,f,t)}}},"241c":function(t,e,n){var r=n("ca84"),i=n("7839").concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,i)}},"25f0":function(t,e,n){"use strict";var r=n("6eeb"),i=n("825a"),o=n("d039"),a=n("ad6d"),s=RegExp.prototype,l=s.toString,u=o((function(){return"/a/b"!=l.call({source:"a",flags:"b"})})),c="toString"!=l.name;(u||c)&&r(RegExp.prototype,"toString",(function(){var t=i(this),e=String(t.source),n=t.flags;return"/"+e+"/"+String(void 0===n&&t instanceof RegExp&&!("flags"in s)?a.call(t):n)}),{unsafe:!0})},2626:function(t,e,n){"use strict";var r=n("d066"),i=n("9bf2"),o=n("b622"),a=n("83ab"),s=o("species");t.exports=function(t){var e=r(t),n=i.f;a&&e&&!e[s]&&n(e,s,{configurable:!0,get:function(){return this}})}},2994:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n("49d8"),i=n("3054"),o=n("aacc");e.default=function(t,e,n,a,s){if(a<1||a>9||s<1||s>9)throw new o.ValidationError("BlurHash must have between 1 and 9 components");if(e*n*4!==t.length)throw new o.ValidationError("Width and height must match the pixels array");for(var l=[],u=function(r){for(var o=function(o){var a=0==o&&0==r?1:2,s=function(t,e,n,r){for(var o=0,a=0,s=0,l=4*e,u=0;u0){var v=Math.max.apply(Math,p.map((function(t){return Math.max.apply(Math,t)}))),g=Math.floor(Math.max(0,Math.min(82,Math.floor(166*v-.5))));d=(g+1)/166,b+=r.encode83(g,1)}else d=1,b+=r.encode83(0,1);return b+=r.encode83((f=h,(i.linearTosRGB(f[0])<<16)+(i.linearTosRGB(f[1])<<8)+i.linearTosRGB(f[2])),4),p.forEach((function(t){b+=r.encode83(function(t,e){return 19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*i.signPow(t[0]/e,.5)+9.5))))*19+19*Math.floor(Math.max(0,Math.min(18,Math.floor(9*i.signPow(t[1]/e,.5)+9.5))))+Math.floor(Math.max(0,Math.min(18,Math.floor(9*i.signPow(t[2]/e,.5)+9.5))))}(t,d),2)})),b}},"2cf4":function(t,e,n){var r,i,o,a=n("da84"),s=n("d039"),l=n("c6b6"),u=n("0366"),c=n("1be4"),d=n("cc12"),f=n("1cdc"),h=a.location,p=a.setImmediate,b=a.clearImmediate,m=a.process,v=a.MessageChannel,g=a.Dispatch,y=0,w={},S=function(t){if(w.hasOwnProperty(t)){var e=w[t];delete w[t],e()}},O=function(t){return function(){S(t)}},T=function(t){S(t.data)},x=function(t){a.postMessage(t+"",h.protocol+"//"+h.host)};p&&b||(p=function(t){for(var e=[],n=1;arguments.length>n;)e.push(arguments[n++]);return w[++y]=function(){("function"==typeof t?t:Function(t)).apply(void 0,e)},r(y),y},b=function(t){delete w[t]},"process"==l(m)?r=function(t){m.nextTick(O(t))}:g&&g.now?r=function(t){g.now(O(t))}:v&&!f?(o=(i=new v).port2,i.port1.onmessage=T,r=u(o.postMessage,o,1)):!a.addEventListener||"function"!=typeof postMessage||a.importScripts||s(x)||"file:"===h.protocol?r="onreadystatechange"in d("script")?function(t){c.appendChild(d("script")).onreadystatechange=function(){c.removeChild(this),S(t)}}:function(t){setTimeout(O(t),0)}:(r=x,a.addEventListener("message",T,!1))),t.exports={set:p,clear:b}},"2d00":function(t,e,n){var r,i,o=n("da84"),a=n("342f"),s=o.process,l=s&&s.versions,u=l&&l.v8;u?i=(r=u.split("."))[0]+r[1]:a&&(!(r=a.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/))&&(i=r[1]),t.exports=i&&+i},3054:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sRGBToLinear=function(t){var e=t/255;return e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},e.linearTosRGB=function(t){var e=Math.max(0,Math.min(1,t));return e<=.0031308?Math.round(12.92*e*255+.5):Math.round(255*(1.055*Math.pow(e,1/2.4)-.055)+.5)},e.sign=function(t){return t<0?-1:1},e.signPow=function(t,n){return e.sign(t)*Math.pow(Math.abs(t),n)}},3410:function(t,e,n){var r=n("23e7"),i=n("d039"),o=n("7b0b"),a=n("e163"),s=n("e177");r({target:"Object",stat:!0,forced:i((function(){a(1)})),sham:!s},{getPrototypeOf:function(t){return a(o(t))}})},"342f":function(t,e,n){var r=n("d066");t.exports=r("navigator","userAgent")||""},"35a1":function(t,e,n){var r=n("f5df"),i=n("3f8c"),o=n("b622")("iterator");t.exports=function(t){if(null!=t)return t[o]||t["@@iterator"]||i[r(t)]}},"37e8":function(t,e,n){var r=n("83ab"),i=n("9bf2"),o=n("825a"),a=n("df75");t.exports=r?Object.defineProperties:function(t,e){o(t);for(var n,r=a(e),s=r.length,l=0;s>l;)i.f(t,n=r[l++],e[n]);return t}},"3bbe":function(t,e,n){var r=n("861d");t.exports=function(t){if(!r(t)&&null!==t)throw TypeError("Can't set "+String(t)+" as a prototype");return t}},"3ca3":function(t,e,n){"use strict";var r=n("6547").charAt,i=n("69f3"),o=n("7dd0"),a=i.set,s=i.getterFor("String Iterator");o(String,"String",(function(t){a(this,{type:"String Iterator",string:String(t),index:0})}),(function(){var t,e=s(this),n=e.string,i=e.index;return i>=n.length?{value:void 0,done:!0}:(t=r(n,i),e.index+=t.length,{value:t,done:!1})}))},"3f8c":function(t,e){t.exports={}},"408a":function(t,e,n){var r=n("c6b6");t.exports=function(t){if("number"!=typeof t&&"Number"!=r(t))throw TypeError("Incorrect invocation");return+t}},"428f":function(t,e,n){var r=n("da84");t.exports=r},"44ad":function(t,e,n){var r=n("d039"),i=n("c6b6"),o="".split;t.exports=r((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==i(t)?o.call(t,""):Object(t)}:Object},"44d2":function(t,e,n){var r=n("b622"),i=n("7c73"),o=n("9bf2"),a=r("unscopables"),s=Array.prototype;null==s[a]&&o.f(s,a,{configurable:!0,value:i(null)}),t.exports=function(t){s[a][t]=!0}},"44de":function(t,e,n){var r=n("da84");t.exports=function(t,e){var n=r.console;n&&n.error&&(1===arguments.length?n.error(t):n.error(t,e))}},4840:function(t,e,n){var r=n("825a"),i=n("1c0b"),o=n("b622")("species");t.exports=function(t,e){var n,a=r(t).constructor;return void 0===a||null==(n=r(a)[o])?e:i(n)}},4930:function(t,e,n){var r=n("d039");t.exports=!!Object.getOwnPropertySymbols&&!r((function(){return!String(Symbol())}))},"49d8":function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","#","$","%","*","+",",","-",".",":",";","=","?","@","[","]","^","_","{","|","}","~"];e.decode83=function(t){for(var e=0,n=0;nc;)if((s=l[c++])!=s)return!0}else for(;u>c;c++)if((t||c in l)&&l[c]===n)return t||c||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},"50c4":function(t,e,n){var r=n("a691"),i=Math.min;t.exports=function(t){return t>0?i(r(t),9007199254740991):0}},5135:function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},5692:function(t,e,n){var r=n("c430"),i=n("c6cd");(t.exports=function(t,e){return i[t]||(i[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.6.5",mode:r?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},"56ef":function(t,e,n){var r=n("d066"),i=n("241c"),o=n("7418"),a=n("825a");t.exports=r("Reflect","ownKeys")||function(t){var e=i.f(a(t)),n=o.f;return n?e.concat(n(t)):e}},5899:function(t,e){t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},"58a8":function(t,e,n){var r=n("1d80"),i="["+n("5899")+"]",o=RegExp("^"+i+i+"*"),a=RegExp(i+i+"*$"),s=function(t){return function(e){var n=String(r(e));return 1&t&&(n=n.replace(o,"")),2&t&&(n=n.replace(a,"")),n}};t.exports={start:s(1),end:s(2),trim:s(3)}},"5c6c":function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"63a9":function(t,e,n){},6547:function(t,e,n){var r=n("a691"),i=n("1d80"),o=function(t){return function(e,n){var o,a,s=String(i(e)),l=r(n),u=s.length;return l<0||l>=u?t?"":void 0:(o=s.charCodeAt(l))<55296||o>56319||l+1===u||(a=s.charCodeAt(l+1))<56320||a>57343?t?s.charAt(l):o:t?s.slice(l,l+2):a-56320+(o-55296<<10)+65536}};t.exports={codeAt:o(!1),charAt:o(!0)}},"65f0":function(t,e,n){var r=n("861d"),i=n("e8b5"),o=n("b622")("species");t.exports=function(t,e){var n;return i(t)&&("function"!=typeof(n=t.constructor)||n!==Array&&!i(n.prototype)?r(n)&&null===(n=n[o])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===e?0:e)}},"69f3":function(t,e,n){var r,i,o,a=n("7f9a"),s=n("da84"),l=n("861d"),u=n("9112"),c=n("5135"),d=n("f772"),f=n("d012"),h=s.WeakMap;if(a){var p=new h,b=p.get,m=p.has,v=p.set;r=function(t,e){return v.call(p,t,e),e},i=function(t){return b.call(p,t)||{}},o=function(t){return m.call(p,t)}}else{var g=d("state");f[g]=!0,r=function(t,e){return u(t,g,e),e},i=function(t){return c(t,g)?t[g]:{}},o=function(t){return c(t,g)}}t.exports={set:r,get:i,has:o,enforce:function(t){return o(t)?i(t):r(t,{})},getterFor:function(t){return function(e){var n;if(!l(e)||(n=i(e)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}},"6eeb":function(t,e,n){var r=n("da84"),i=n("9112"),o=n("5135"),a=n("ce4e"),s=n("8925"),l=n("69f3"),u=l.get,c=l.enforce,d=String(String).split("String");(t.exports=function(t,e,n,s){var l=!!s&&!!s.unsafe,u=!!s&&!!s.enumerable,f=!!s&&!!s.noTargetGet;"function"==typeof n&&("string"!=typeof e||o(n,"name")||i(n,"name",e),c(n).source=d.join("string"==typeof e?e:"")),t!==r?(l?!f&&t[e]&&(u=!0):delete t[e],u?t[e]=n:i(t,e,n)):u?t[e]=n:a(e,n)})(Function.prototype,"toString",(function(){return"function"==typeof this&&u(this).source||s(this)}))},7156:function(t,e,n){var r=n("861d"),i=n("d2bb");t.exports=function(t,e,n){var o,a;return i&&"function"==typeof(o=e.constructor)&&o!==n&&r(a=o.prototype)&&a!==n.prototype&&i(t,a),t}},7418:function(t,e){e.f=Object.getOwnPropertySymbols},"746f":function(t,e,n){var r=n("428f"),i=n("5135"),o=n("e538"),a=n("9bf2").f;t.exports=function(t){var e=r.Symbol||(r.Symbol={});i(e,t)||a(e,t,{value:o.f(t)})}},7839:function(t,e){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"7b0b":function(t,e,n){var r=n("1d80");t.exports=function(t){return Object(r(t))}},"7c73":function(t,e,n){var r,i=n("825a"),o=n("37e8"),a=n("7839"),s=n("d012"),l=n("1be4"),u=n("cc12"),c=n("f772"),d=c("IE_PROTO"),f=function(){},h=function(t){return"