mirror of
https://github.com/mediacms-io/mediacms.git
synced 2024-11-22 08:13:33 +01:00
1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
!function(){"use strict";var e,t={510:function(e,t,n){var r=n(2541),o=n(8259);(0,r.X)("page-liked",o.LikedMediaPage)},4234:function(e,t,n){n.r(t),n.d(t,{CircleIconButton:function(){return r.M},FilterOptions:function(){return o.j},FiltersToggleButton:function(){return i._},MaterialIcon:function(){return u.O},NavigationContentApp:function(){return a.o},NavigationMenuList:function(){return l.S},Notifications:function(){return c.T},NumericInputWithUnit:function(){return s.O},PopupMain:function(){return f.W8},PopupTop:function(){return f.HF},SpinnerLoader:function(){return d.i},UserThumbnail:function(){return p.q}});var r=n(7714),o=n(7446),i=n(2915),u=n(2299),a=n(2917),l=n(5671),c=n(2436),s=n(5517),f=n(940),d=n(6309),p=n(6142)},824:function(e,t,n){n.r(t),n.d(t,{LazyLoadItemListAsync:function(){return m}}),n(2070),n(2004),n(8407),n(6394),n(8288),n(5677),n(2129),n(4655),n(288),n(4458),n(3675),n(4517),n(9751),n(8833),n(815),n(5090),n(9174);var r=n(5466),o=n(8578),i=n(2546),u=n(8982),a=n(2832),l=n(3632),c=n(8986);function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function f(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){d(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function d(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function p(){return(p=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function y(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function m(e){var t,n,u=(t=(0,i.useItemListLazyLoad)(e),n=13,function(e){if(Array.isArray(e))return e}(t)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i=[],u=!0,a=!1;try{for(n=n.call(e);!(u=(r=n.next()).done)&&(i.push(r.value),!t||i.length!==t);u=!0);}catch(e){a=!0,o=e}finally{try{u||null==n.return||n.return()}finally{if(a)throw o}}return i}}(t,n)||function(e,t){if(e){if("string"==typeof e)return y(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(e,t):void 0}}(t,n)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=u[0],f=u[1],d=u[2],m=u[3],g=u[4],b=u[5],h=u[6],v=u[7],O=u[8],P=u[9],w=u[10],j=u[11],S=u[12];return(0,r.useEffect)((function(){return m(new c.g(e.pageItems,e.maxItems,e.firstItemRequestUrl,e.requestUrl,b,h)),o.PageStore.on("window_scroll",v),o.PageStore.on("document_visibility_change",O),v(),function(){o.PageStore.removeListener("window_scroll",v),o.PageStore.removeListener("document_visibility_change",O),d&&(d.cancelAll(),m(null))}}),[]),f?s.length?r.createElement("div",{className:g.listOuter},j(),r.createElement("div",{ref:P,className:"items-list-wrap"},r.createElement("div",{ref:w,className:g.list},s.map((function(t,n){return r.createElement(l.H,p({key:n},(0,l.j)(e,t,n)))})))),S()):null:r.createElement(a.K,{className:g.listOuter})}m.propTypes=f({},u.ItemListAsync.propTypes),m.defaultProps=f(f({},u.ItemListAsync.defaultProps),{},{pageItems:2})},6191:function(e,t,n){n.r(t),n.d(t,{PageHeader:function(){return r.m},PageMain:function(){return o.r},PageSidebar:function(){return i.$},PageSidebarContentOverlay:function(){return u.a}});var r=n(6006),o=n(9198),i=n(2947),u=n(1542)},8285:function(e,t,n){n.r(t),n.d(t,{ProfileLikedPage:function(){return h}}),n(5101),n(3080),n(2004),n(8407),n(6394),n(8288),n(5677),n(2129),n(4655);var r=n(5466),o=n(3074),i=n.n(o),u=n(3613),a=n(8578),l=n(5910),c=n(8556),s=n(6970),f=n(824);function d(e){return(d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function p(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){return!t||"object"!==d(t)&&"function"!=typeof t?g(e):t}function g(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var h=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}(h,e);var t,n,o,i,d=(o=h,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t=b(o);if(i){var n=b(this).constructor;e=Reflect.construct(t,arguments,n)}else e=t.apply(this,arguments);return m(this,e)});function h(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,h),(t=d.call(this,e,"author-liked")).state={resultsCount:null},t.getCountFunc=t.getCountFunc.bind(g(t)),t}return t=h,(n=[{key:"getCountFunc",value:function(e){this.setState({resultsCount:e})}},{key:"pageContent",value:function(){var e=this;return[this.state.author?r.createElement(c.Z,{key:"ProfilePagesHeader",author:this.state.author,type:"liked"}):null,this.state.author?r.createElement(s.Z,{key:"ProfilePagesContent"},r.createElement(u.ApiUrlConsumer,null,(function(t){return r.createElement(l.MediaListWrapper,{title:e.props.title+(null!==e.state.resultsCount?" ("+e.state.resultsCount+")":""),className:"items-list-ver"},r.createElement(f.LazyLoadItemListAsync,{itemsCountCallback:e.getCountFunc,requestUrl:t.user.liked,hideAuthor:!a.PageStore.get("config-media-item").displayAuthor,hideViews:!a.PageStore.get("config-media-item").displayViews,hideDate:!a.PageStore.get("config-media-item").displayPublishDate,canEdit:!1}))}))):null]}}])&&p(t.prototype,n),h}(n(4982).a);h.propTypes={title:i().string.isRequired},h.defaultProps={title:"Liked media"}},8259:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)"default"!==n&&Object.prototype.hasOwnProperty.call(e,n)&&r(t,e,n);return o(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.LikedMediaPage=t.AnonymousLikedMediaPage=void 0;var u=i(n(5466)),a=n(3613),l=n(8578),c=n(2546),s=n(473),f=n(5910),d=n(824),p=n(8285),y=n(7637),m=n(473);t.AnonymousLikedMediaPage=function(e){var t=e.id,n=void 0===t?"liked-media":t,r=e.title,o=void 0===r?m.translateString("Liked media"):r,i=u.useState(null),c=i[0],s=i[1];return u.default.createElement(y.Page,{id:n},u.default.createElement(a.ApiUrlConsumer,null,(function(e){return u.default.createElement(f.MediaListWrapper,{title:o+(null!==c?" ("+c+")":""),className:"search-results-wrap items-list-hor"},u.default.createElement(d.LazyLoadItemListAsync,{singleLinkContent:!1,horizontalItemsOrientation:!0,itemsCountCallback:s,requestUrl:e.user.liked,hideViews:!l.PageStore.get("config-media-item").displayViews,hideAuthor:!l.PageStore.get("config-media-item").displayAuthor,hideDate:!l.PageStore.get("config-media-item").displayPublishDate}))})))},t.LikedMediaPage=function(){var e=c.useUser(),n=e.username,r=e.isAnonymous||!l.PageStore.get("config-options").pages.profile.includeLikedMedia;return r||(s.addClassname(document.getElementById("page-liked"),"profile-page-liked"),window.MediaCMS.profileId=n),r?u.default.createElement(t.AnonymousLikedMediaPage,null):u.default.createElement(p.ProfileLikedPage,null)}}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e].call(i.exports,i,i.exports,r),i.exports}r.m=t,e=[],r.O=function(t,n,o,i){if(!n){var u=1/0;for(c=0;c<e.length;c++){n=e[c][0],o=e[c][1],i=e[c][2];for(var a=!0,l=0;l<n.length;l++)(!1&i||u>=i)&&Object.keys(r.O).every((function(e){return r.O[e](n[l])}))?n.splice(l--,1):(a=!1,i<u&&(u=i));a&&(e.splice(c--,1),t=o())}return t}i=i||0;for(var c=e.length;c>0&&e[c-1][2]>i;c--)e[c]=e[c-1];e[c]=[n,o,i]},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.j=41,function(){var e={41:0};r.O.j=function(t){return 0===e[t]};var t=function(t,n){var o,i,u=n[0],a=n[1],l=n[2],c=0;for(o in a)r.o(a,o)&&(r.m[o]=a[o]);if(l)var s=l(r);for(t&&t(n);c<u.length;c++)i=u[c],r.o(e,i)&&e[i]&&e[i][0](),e[u[c]]=0;return r.O(s)},n=self.webpackChunkmediacms_frontend=self.webpackChunkmediacms_frontend||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))}();var o=r.O(void 0,[431],(function(){return r(510)}));o=r.O(o)}(); |