mediacms/static/js/profile-playlists.js

1 line
14 KiB
JavaScript

!function(){var t={4792:function(t,e,n){"use strict";var r=n(2667),o=(n(5101),n(5466)),i=(n(6116),n(4426)),u=n(2259),c=(n(8170),n(612)),a=n(5464),f=n(9174),l=n(5261);function s(t){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function p(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function y(t,e){return(y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function h(t,e){return!e||"object"!==s(e)&&"function"!=typeof e?b(t):e}function b(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function m(t){return(m=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var d=n(3441);function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function O(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function g(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?O(Object(n),!0).forEach((function(e){w(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function w(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function P(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function _(t,e){return(_=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function j(t,e){return!e||"object"!==v(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function S(t){return(S=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function R(t){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function D(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function k(t,e){return(k=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function E(t,e){return!e||"object"!==R(e)&&"function"!=typeof e?C(t):e}function C(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function x(t){return(x=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&_(t,e)}(o,t);var e,n,r=(e=o,n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,r=S(e);if(n){var o=S(this).constructor;t=Reflect.construct(r,arguments,o)}else t=r.apply(this,arguments);return j(this,t)});function o(){return P(this,o),r.apply(this,arguments)}return o}(function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e)}(c,t);var e,n,r,i,u=(r=c,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=m(r);if(i){var n=m(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return h(this,t)});function c(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,c),(e=u.call(this,t)).onClickLoadMore=e.onClickLoadMore.bind(b(e)),e}return e=c,(n=[{key:"onClickLoadMore",value:function(){this.listHandler.loadItems()}},{key:"renderAfterListWrap",value:function(){return 1>this.listHandler.totalPages()||this.listHandler.loadedAllItems()?null:o.createElement("button",{className:"load-more",onClick:this.onClickLoadMore},"SHOW MORE")}}])&&p(e.prototype,n),c}(d.Y))).defaultProps=g(g({},d.Y.defaultProps),{},{pageItems:24});var T=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&k(t,e)}(p,t);var e,n,r,u,s=(r=p,u=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=x(r);if(u){var n=x(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return E(this,t)});function p(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,p),(e=s.call(this,t,"author-playlists")).state={loadedAuthor:!1,loadedPlaylists:!1,playlistsCount:-1},e.getPlaylistsCountFunc=e.getPlaylistsCountFunc.bind(C(e)),e}return e=p,(n=[{key:"getPlaylistsCountFunc",value:function(t){this.setState({loadedPlaylists:!0,playlistsCount:t})}},{key:"pageContent",value:function(){return[this.state.author?o.createElement(c.Z,{key:"ProfilePagesHeader",author:this.state.author,type:"playlists"}):null,this.state.author?o.createElement(a.Z,{key:"ProfilePagesContent"},o.createElement(f._,{title:-1<this.state.playlistsCount?"Created playlists":void 0,className:"profile-playlists-content items-list-ver"},o.createElement(l.J,{requestUrl:i.Z.get("api-user-playlists")+this.state.author.username,itemsCountCallback:this.getPlaylistsCountFunc,hideViews:!i.Z.get("config-media-item").displayViews,hideAuthor:!i.Z.get("config-media-item").displayAuthor,hideDate:!i.Z.get("config-media-item").displayPublishDate}))):null]}}])&&D(e.prototype,n),p}(u.G);(0,r.X)("page-profile-playlists",T)},8416:function(t,e,n){var r=n(4835).Dispatcher;t.exports=new r},6203:function(t,e,n){"use strict";n(2322),n(9268),n(3233),e.Z=function(){var t,e,n,r=null;if(document.cookie&&""!==document.cookie)for(e=document.cookie.split(";"),t=0;t<e.length;){if("csrftoken="===(n=e[t].trim()).substring(0,10)){r=decodeURIComponent(n.substring(10));break}t+=1}return r}},8420:function(t,e,n){"use strict";n.d(e,{A_:function(){return r.Z},GH:function(){return o.Z},Jl:function(){return i.Z},v$:function(){return u.Z},uf:function(){return c.Z},$4:function(){return a.Z},m5:function(){return f.Z}});var r=n(1712),o=(n(9752),n(84)),i=n(9009),u=n(1438),c=n(4135),a=n(3140),f=(n(1752),n(7514),n(1569),n(6203));n(7188)},9752:function(t,e,n){"use strict";n(6394),n(5334),n(7588),n(4559),n(6028)},8170:function(t,e,n){"use strict";n(4458),n(5101),n(2322),n(9006),n(9268),n(5466);var r=n(1590),o=n.n(r),i=n(8420),u=n(4426);function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function f(t,e){return(f=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function l(t,e){return!e||"object"!==c(e)&&"function"!=typeof e?s(t):e}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var y=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&f(t,e)}(y,t);var e,n,r,o,c=(r=y,o=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=p(r);if(o){var n=p(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return l(this,t)});function y(){var t;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,y),(t=c.call(this)).authorData=null,t.authorQuery=void 0,t.onDataLoad=t.onDataLoad.bind(s(t)),t.onDataLoadFail=t.onDataLoadFail.bind(s(t)),t.removeProfileResponse=t.removeProfileResponse.bind(s(t)),t.removeProfileFail=t.removeProfileFail.bind(s(t)),t.removingProfile=!1,t}return e=y,(n=[{key:"removeProfileResponse",value:function(t){t&&204===t.status&&this.emit("profile_delete",this.authorData.username)}},{key:"removeProfileFail",value:function(){this.emit("profile_delete_fail",this.authorData.username),setTimeout((function(t){this.removingProfile=!1}),100,this)}},{key:"get",value:function(t){switch(t){case"author-data":return this.authorData;case"author-query":if(void 0===this.authorQuery){this.authorQuery=null;var e=window.location.search;if(e&&""!==e){e=e.split("?")[1].split("=");for(var n=0;n<e.length;){if("aq"===e[n]){this.authorQuery=e[n+1]||null;break}n+=1}}}return this.authorQuery}}},{key:"onDataLoad",value:function(t){t&&t.data&&(this.authorData=t.data,this.authorData.id=this.authorData.username,this.authorData.name=""!==this.authorData.name?this.authorData.name:this.authorData.username,this.emit("load-author-data"))}},{key:"onDataLoadFail",value:function(t){}},{key:"actions_handler",value:function(t){switch(t.type){case"REMOVE_PROFILE":if(this.removingProfile)return;this.removingProfile=!0;var e=u.Z.get("api-users")+"/"+this.authorData.username;(0,i.Jl)(e,{headers:{"X-CSRFToken":(0,i.m5)()}},!1,this.removeProfileResponse,this.removeProfileFail);break;case"LOAD_AUTHOR_DATA":(0,i.A_)(u.Z.get("api-users")+"/"+window.MediaCMS.profileId,!1,this.onDataLoad,this.onDataLoadFail)}}}])&&a(e.prototype,n),y}(o());e.Z=(0,i.v$)(new y,"actions_handler")},9174:function(t,e,n){"use strict";n.d(e,{_:function(){return y}}),n(5101);var r=n(5466),o=(n(6116),n(3074)),i=n.n(o),u=n(3085);function c(t){return(c="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function a(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function l(t,e){return(l=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function s(t,e){return!e||"object"!==c(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function p(t){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var y=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&l(t,e)}(y,t);var e,n,o,i,c=(o=y,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}(),function(){var t,e=p(o);if(i){var n=p(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return s(this,t)});function y(){return a(this,y),c.apply(this,arguments)}return e=y,(n=[{key:"render",value:function(){return r.createElement("div",{className:(void 0===this.props.className||null===this.props.className?"":this.props.className+" ")+"media-list-wrapper",style:this.props.style},r.createElement(u.G,{title:this.props.title,viewAllLink:this.props.viewAllLink,viewAllText:this.props.viewAllText},this.props.children||null))}}])&&f(e.prototype,n),y}(r.PureComponent);y.propTypes={style:i().object,className:i().string},y.defaultProps={}}},e={};function n(r){if(e[r])return e[r].exports;var o=e[r]={exports:{}};return t[r].call(o.exports,o,o.exports,n),o.exports}n.m=t,n.x=function(){},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,{a:e}),e},n.d=function(t,e){for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.j=149,function(){var t={149:0},e=[[4792,431]],r=function(){},o=function(o,i){for(var u,c,a=i[0],f=i[1],l=i[2],s=i[3],p=0,y=[];p<a.length;p++)c=a[p],n.o(t,c)&&t[c]&&y.push(t[c][0]),t[c]=0;for(u in f)n.o(f,u)&&(n.m[u]=f[u]);for(l&&l(n),o&&o(i);y.length;)y.shift()();return s&&e.push.apply(e,s),r()},i=self.webpackChunk_mediacms_frontend=self.webpackChunk_mediacms_frontend||[];function u(){for(var r,o=0;o<e.length;o++){for(var i=e[o],u=!0,c=1;c<i.length;c++){var a=i[c];0!==t[a]&&(u=!1)}u&&(e.splice(o--,1),r=n(n.s=i[0]))}return 0===e.length&&(n.x(),n.x=function(){}),r}i.forEach(o.bind(null,0)),i.push=o.bind(null,i.push.bind(i));var c=n.x;n.x=function(){return n.x=c||function(){},(r=u)()}}(),n.x()}();