mediacms/static/js/profile-about.js

1 line
38 KiB
JavaScript

!function(){var t,e={24254:function(t,e,n){"use strict";var r=n(92541),o=(n(13233),n(54458),n(25101),n(52004),n(28407),n(56394),n(64669),n(62322),n(49268),n(13080),n(38288),n(55677),n(92129),n(24655),n(35466)),i=n(3074),a=n.n(i),u=n(50137),c=n.n(u),l=n(43613),s=n(80473),f=n(20541),p=n(98578),m=n(68556),d=n(26970),y=n(27180),h=n(64982),b=n(1283);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 g(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function S(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 w(t,e,n){return e&&S(t.prototype,e),n&&S(t,n),t}function E(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)}function k(t,e){return(k=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function O(t){var e=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(t){return!1}}();return function(){var n,r=j(t);if(e){var o=j(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return A(this,n)}}function A(t,e){return!e||"object"!==v(e)&&"function"!=typeof e?P(t):e}function P(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function j(t){return(j=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}var _=function(t){E(n,t);var e=O(n);function n(t){var r;return g(this,n),(r=e.call(this,t)).state={subject:"",body:"",isSending:!1},r.onUpdateSubject=r.onUpdateSubject.bind(P(r)),r.onUpdateBody=r.onUpdateBody.bind(P(r)),r.onSubmit=r.onSubmit.bind(P(r)),r.onSubmitSuccess=r.onSubmitSuccess.bind(P(r)),r.onSubmitFail=r.onSubmitFail.bind(P(r)),r}return w(n,[{key:"onUpdateSubject",value:function(){this.setState({subject:this.refs.msgSubject.value.trim()})}},{key:"onUpdateBody",value:function(){this.setState({body:this.refs.msgBody.value.trim()})}},{key:"onSubmitSuccess",value:function(t){this.setState({subject:"",body:"",isSending:!1},(function(){setTimeout(function(){f.PageActions.addNotification("Your message was successfully submitted to "+this.props.author.name,"messageSubmitSucceed")}.bind(this),100)}))}},{key:"onSubmitFail",value:function(t){this.setState({isSending:!1},(function(){b.log(t),setTimeout(function(){f.PageActions.addNotification("Your message failed to submit. Please try again","messageSubmitFailed")}.bind(this),100)}))}},{key:"onSubmit",value:function(t){this.state.isSending||""===this.state.subject||""===this.state.body||(t.preventDefault(),t.stopPropagation(),this.setState({isSending:!0},(function(){var t=l.ApiUrlContext._currentValue.users+"/"+this.props.author.username+"/contact";(0,s.postRequest)(t,{subject:this.state.subject,body:this.state.body},{headers:{"X-CSRFToken":(0,s.csrfToken)()}},!1,this.onSubmitSuccess,this.onSubmitFail)})))}},{key:"render",value:function(){return o.createElement("div",{className:"media-list-row profile-contact"},o.createElement("div",{className:"media-list-header"},o.createElement("h2",null,"Contact")),o.createElement("form",{method:"post",className:"user-contact-form"+(this.state.isSending?" pending-response":"")},o.createElement("span",null,o.createElement("label",null,"Subject"),o.createElement("input",{ref:"msgSubject",type:"text",required:!0,onChange:this.onUpdateSubject,value:this.state.subject})),o.createElement("span",null,o.createElement("label",null,"Message"),o.createElement("textarea",{ref:"msgBody",required:!0,cols:"40",rows:"10",onChange:this.onUpdateBody,value:this.state.body})),o.createElement("button",{onClick:this.onSubmit},"SUBMIT")))}}]),n}(o.PureComponent),C=function(t){E(n,t);var e=O(n);function n(t){var r;return g(this,n),(r=e.call(this,t,"author-about")).userIsAuthor=null,r.enabledContactForm=!1,r}return w(n,[{key:"pageContent",value:function(){var t=null,e=[],n=[];if(this.state.author){var r,i;if(null===this.userIsAuthor&&(l.MemberContext._currentValue.is.anonymous?(this.userIsAuthor=!1,this.enabledContactForm=!1):(this.userIsAuthor=p.ProfilePageStore.get("author-data").username===l.MemberContext._currentValue.username,this.enabledContactForm=!this.userIsAuthor&&l.MemberContext._currentValue.can.contactUser)),void 0!==this.state.author.description&&this.state.author.description&&""!==this.state.author.description&&(t=this.state.author.description),void 0!==this.state.author.location_info&&this.state.author.location_info.length){var a=[];for(r=0;r<this.state.author.location_info.length;)void 0!==this.state.author.location_info[r].title&&void 0!==this.state.author.location_info[r].url&&a.push(o.createElement("a",{key:r,href:(0,s.formatInnerLink)(this.state.author.location_info[r].url,l.SiteContext._currentValue.url),title:this.state.author.location_info[r].title},this.state.author.location_info[r].title)),r+=1;e.push(o.createElement("li",{key:"location"},o.createElement("span",null,"Location:"),o.createElement("span",null,a)))}else void 0!==this.state.author.location&&this.state.author.location&&""!==this.state.author.location&&e.push(o.createElement("li",{key:"location"},o.createElement("span",null,"Location:"),o.createElement("span",null,this.state.author.location)));if(void 0!==this.state.author.home_page&&this.state.author.home_page&&""!==this.state.author.home_page&&""!==(i=c()(this.state.author.home_page.trim()).toString())&&e.push(o.createElement("li",{key:"website"},o.createElement("span",null,"Website:"),o.createElement("span",null,i))),void 0!==this.state.author.social_media_links&&this.state.author.social_media_links&&""!==this.state.author.social_media_links){var u=this.state.author.social_media_links.split(",");if(u.length){for(r=0;r<u.length;)""!==(i=u[r].trim())&&n.push(o.createElement("span",{key:r},i)),r+=1;e.push(o.createElement("li",{key:"social_media"},o.createElement("span",null,"Social media:"),o.createElement("span",{className:"author-social-media"},n)))}}}return[this.state.author?o.createElement(m.Z,{key:"ProfilePagesHeader",author:this.state.author,type:"about"}):null,this.state.author?o.createElement(d.Z,{key:"ProfilePagesContent",enabledContactForm:this.enabledContactForm},o.createElement("div",{className:"media-list-wrapper items-list-ver profile-about-content "},null===t&&0<e.length?null:p.PageStore.get("config-options").pages.profile.htmlInDescription?o.createElement(y.MediaListRow,{title:this.props.title},o.createElement("span",{dangerouslySetInnerHTML:{__html:t||null}})):o.createElement(y.MediaListRow,{title:this.props.title},t),e.length?o.createElement(y.MediaListRow,{title:"Details"},o.createElement("ul",{className:"profile-details"},e)):null,this.enabledContactForm?o.createElement(_,{author:this.state.author}):null)):null]}}]),n}(h.a);C.propTypes={title:a().string.isRequired},C.defaultProps={title:"Biography"},(0,r.X)("page-profile-about",C)},17714:function(t,e,n){"use strict";n.d(e,{M:function(){return u}}),n(74517);var r=n(35466),o=n(3074),i=n.n(o);function a(){return(a=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function u(t){var e=r.createElement("span",null,r.createElement("span",null,t.children)),n={tabIndex:t.tabIndex||null,title:t.title||null,className:"circle-icon-button"+(void 0!==t.className?" "+t.className:"")+(t.buttonShadow?" button-shadow":"")};return void 0!==t["data-page-id"]&&(n["data-page-id"]=t["data-page-id"]),void 0!==t["aria-label"]&&(n["aria-label"]=t["aria-label"]),"link"===t.type?r.createElement("a",a({},n,{href:t.href||null,rel:t.rel||null}),e):"span"===t.type?r.createElement("span",a({},n,{onClick:t.onClick||null}),e):r.createElement("button",a({},n,{onClick:t.onClick||null}),e)}u.propTypes={type:i().oneOf(["button","link","span"]),buttonShadow:i().bool,className:i().string},u.defaultProps={type:"button",buttonShadow:!1}},47446:function(t,e,n){"use strict";n(92070),n(35466);var r=n(3074),o=n.n(r);n(2299),o().string.isRequired,o().string.isRequired,o().func.isRequired},2915:function(t,e,n){"use strict";n(52004),n(28407),n(56394),n(38288),n(55677),n(92129),n(24655),n(20288),n(54458),n(23675);var r=n(35466),o=n(3074),i=n.n(o),a=n(2299);function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function c(t){var e,n,o=(e=(0,r.useState)(t.active),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,n)||function(t,e){if(t){if("string"==typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}(e,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.")}()),i=o[0],c=o[1];return r.createElement("div",{className:"mi-filters-toggle"},r.createElement("button",{className:i?"active":"","aria-label":"Filter",onClick:function(){c(!i),void 0!==t.onClick&&t.onClick()}},r.createElement(a.O,{type:"filter_list"}),r.createElement("span",{className:"filter-button-label"},r.createElement("span",{className:"filter-button-label-text"},"FILTERS"))))}c.propTypes={onClick:i().func,active:i().bool},c.defaultProps={active:!1}},84234:function(t,e,n){"use strict";n.d(e,{CircleIconButton:function(){return r.M},MaterialIcon:function(){return o.O},NavigationContentApp:function(){return i.o},NavigationMenuList:function(){return a.S},Notifications:function(){return u.T},PopupMain:function(){return c.W8},PopupTop:function(){return c.HF},SpinnerLoader:function(){return l.i},UserThumbnail:function(){return s.q}});var r=n(17714),o=(n(47446),n(2915),n(2299)),i=n(72917),a=n(5671),u=n(72436),c=(n(15517),n(60940)),l=n(26309),s=n(86142)},2299:function(t,e,n){"use strict";n.d(e,{O:function(){return o}});var r=n(35466),o=function(t){var e=t.type;return e?r.createElement("i",{className:"material-icons","data-icon":e}):null}},72917:function(t,e,n){"use strict";n.d(e,{o:function(){return c}}),n(13233),n(99751),n(52004),n(28407),n(56394),n(38288),n(55677),n(92129),n(24655),n(20288),n(54458),n(23675);var r=n(35466),o=n(46116),i=n(3074),a=n.n(i);function u(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function c(t){var e,n,i=(0,r.useRef)(null),a=(e=(0,r.useState)(null),n=2,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,n)||function(t,e){if(t){if("string"==typeof t)return u(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?u(t,e):void 0}}(e,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.")}()),c=a[0],l=a[1],s=[];function f(e,n){var r;n.preventDefault(),n.stopPropagation(),r=s[e].id,void 0!==t.pages[r]&&l(r)}return(0,r.useEffect)((function(){void 0!==t.pages[t.initPage]?l(t.initPage):Object.keys(t.pages).length?l(Object.keys(t.pages)[0]):l(null)}),[t.initPage]),(0,r.useEffect)((function(){!function(){for(var t=0;t<s.length;)s[t].elem.removeEventListener("click",s[t].listener),t+=1;s=[]}(),c&&(function(){var e,n,r=(0,o.findDOMNode)(i.current),a=r.querySelectorAll(t.pageChangeSelector);if(a.length)for(e=0;e<a.length;)(n=(n=a[e].getAttribute(t.pageIdSelectorAttr))?n.trim():n)&&(s[e]={id:n,elem:a[e]},s[e].listener=function(t){return function(e){return f(t,e)}}(e),s[e].elem.addEventListener("click",s[e].listener)),e+=1;t.focusFirstItemOnPageChange&&r.focus()}(),"function"==typeof t.pageChangeCallback&&t.pageChangeCallback(c))}),[c]),c?r.createElement("div",{ref:i},r.cloneElement(t.pages[c])):null}c.propTypes={initPage:a().string,pages:a().object.isRequired,pageChangeSelector:a().string.isRequired,pageIdSelectorAttr:a().string.isRequired,focusFirstItemOnPageChange:a().bool,pageChangeCallback:a().func},c.defaultProps={focusFirstItemOnPageChange:!0}},5671:function(t,e,n){"use strict";n.d(e,{S:function(){return l}}),n(59808),n(13233),n(92070),n(74517);var r=n(35466),o=n(3074),i=n.n(o),a=n(2299);function u(){return(u=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function c(t){var e=[],n=t.itemAttr||{};void 0===n.className?n.className="":n.className&&(n.className+=" ");var o=t.text?t.icon&&"right"!==t.iconPos?1:0:-1,i=t.icon?t.text&&"right"===t.iconPos?1:0:-1;switch(-1<o&&(e[o]=r.createElement("span",{key:"Text"},t.text)),-1<i&&(e[i]=r.createElement("span",{key:"Icon",className:"right"===t.iconPos?"menu-item-icon-right":"menu-item-icon"},r.createElement(a.O,{type:t.icon}))),t.itemType){case"link":e=r.createElement("a",u({},t.linkAttr||{},{href:t.link,title:t.text||null}),e),n.className+="link-item"+(t.active?" active":"");break;case"button":case"open-subpage":e=r.createElement("button",u({},t.buttonAttr||{},{key:"button"}),e);break;case"label":e=r.createElement("button",u({},t.buttonAttr||{},{key:"button"}),r.createElement("span",null,t.text||null)),n.className="label-item";break;case"div":e=r.createElement("div",u({},t.divAttr||{},{key:"div"}),t.text||null)}return""!==n.className&&(n.className=" "+n.className),n.className=n.className.trim(),r.createElement("li",n,e)}function l(t){var e=t.items.map((function(t,e){return r.createElement(c,u({key:e},t))}));return e.length?r.createElement("div",{className:"nav-menu"+(t.removeVerticalPadding?" pv0":"")},r.createElement("nav",null,r.createElement("ul",null,e))):null}c.propTypes={itemType:i().oneOf(["link","open-subpage","button","label","div"]),link:i().string,icon:i().string,iconPos:i().oneOf(["left","right"]),text:i().string,active:i().bool,divAttr:i().object,buttonAttr:i().object,itemAttr:i().object,linkAttr:i().object},c.defaultProps={itemType:"link",iconPos:"left",active:!1},l.propTypes={removeVerticalPadding:i().bool,items:i().arrayOf(i().shape(c.propTypes)).isRequired},l.defaultProps={removeVerticalPadding:!1}},72436:function(t,e,n){"use strict";n.d(e,{T:function(){return f}}),n(92070),n(11646),n(52004),n(28407),n(56394),n(38288),n(55677),n(92129),n(24655),n(20288),n(54458),n(23675);var r=n(35466),o=n(7959);function i(t){return function(t){if(Array.isArray(t))return c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||u(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 a(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(t,e)||u(t,e)||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.")}()}function u(t,e){if(t){if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?c(t,e):void 0}}function c(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var l=[];function s(t){var e=a((0,r.useState)(!1),2),n=e[0],o=e[1],i=a((0,r.useState)(!0),2),u=i[0],c=i[1],l=null,s=null;return(0,r.useEffect)((function(){return l=setTimeout((function(){s=setTimeout((function(){c(!1),s=null}),1e3),l=null,o(!0),t.onHide(t.id)}),5e3),function(){l&&clearTimeout(l),s&&clearTimeout(s)}}),[]),u?r.createElement("div",{className:"notification-item"+(n?" hidden":"")},r.createElement("div",null,t.children||null)):null}function f(){var t,e,n,u=a((0,r.useState)(l.length),2),c=u[0],f=u[1];function p(){f(o.default.get("notifications-size")+l.length)}function m(t){var e=[];l.map((function(n){n[0]!==t&&e.push(n)})),l=e}return(0,r.useEffect)((function(){return p(),o.default.on("added_notification",p),function(){return o.default.removeListener("added_notification",p)}}),[]),c?r.createElement("div",{className:"notifications"},r.createElement("div",null,(t=o.default.get("notifications"),e=l.map((function(t){return r.createElement(s,{key:t[0],id:t[0],onHide:m},t[1])})),n=t.map((function(t){return l.push(t),r.createElement(s,{key:t[0],id:t[0],onHide:m},t[1])})),[].concat(i(e),i(n))))," "):null}},15517:function(t,e,n){"use strict";n(52004),n(28407),n(56394),n(38288),n(55677),n(92129),n(24655),n(20288),n(54458),n(23675),n(35466);var r=n(3074),o=n.n(r);o().string,o().array.isRequired,o().string,o().number,o().number,o().number,o().func,o().func},60940:function(t,e,n){"use strict";n.d(e,{HF:function(){return i},W8:function(){return a}});var r=n(35466),o=r.forwardRef((function(t,e){return void 0!==t.children?r.createElement("div",{ref:e,className:"popup"+(void 0!==t.className?" "+t.className:""),style:t.style},t.children):null}));function i(t){return void 0!==t.children?r.createElement("div",{className:"popup-top"+(void 0!==t.className?" "+t.className:""),style:t.style},t.children):null}function a(t){return void 0!==t.children?r.createElement("div",{className:"popup-main"+(void 0!==t.className?" "+t.className:""),style:t.style},t.children):null}e.ZP=o},26309:function(t,e,n){"use strict";n.d(e,{i:function(){return a}});var r=n(35466),o=n(3074),i=n.n(o);function a(t){var e="spinner-loader";switch(t.size){case"tiny":case"x-small":case"small":case"large":case"x-large":e+=" "+t.size}return r.createElement("div",{className:e},r.createElement("svg",{className:"circular",viewBox:"25 25 50 50"},r.createElement("circle",{className:"path",cx:"50",cy:"50",r:"20",fill:"none",strokeWidth:"1.5",strokeMiterlimit:"10"})))}a.propTypes={size:i().oneOf(["tiny","x-small","small","medium","large","x-large"])},a.defaultProps={size:"medium"}},86142:function(t,e,n){"use strict";n.d(e,{q:function(){return l}});var r=n(35466),o=n(3074),i=n.n(o),a=n(49747),u=n(17714),c=n(2299);function l(t){var e=(0,a.useUser)().thumbnail,n={"aria-label":"Account profile photo that opens list of options and settings pages links",className:"thumbnail"};switch(t.isButton?void 0!==t.onClick&&(n.onClick=t.onClick):n.type="span",t.size){case"small":case"large":n.className+=" "+t.size+"-thumb"}return r.createElement(u.M,n,e?r.createElement("img",{src:e,alt:""}):r.createElement(c.O,{type:"person"}))}l.propTypes={isButton:i().bool,size:i().oneOf(["small","medium","large"]),onClick:i().func},l.defaultProps={isButton:!1,size:"medium"}},40824:function(t,e,n){"use strict";n.d(e,{LazyLoadItemListAsync:function(){return y}}),n(92070),n(52004),n(28407),n(56394),n(38288),n(55677),n(92129),n(24655),n(20288),n(54458),n(23675),n(74517),n(99751),n(38833),n(10815),n(55090),n(79174);var r=n(35466),o=n(98578),i=n(62546),a=n(58982),u=n(32832),c=n(83632),l=n(28986);function s(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 f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?s(Object(n),!0).forEach((function(e){p(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function m(){return(m=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t}).apply(this,arguments)}function d(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function y(t){var e,n,a=(e=(0,i.useItemListLazyLoad)(t),n=13,function(t){if(Array.isArray(t))return t}(e)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,o,i=[],a=!0,u=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(i.push(r.value),!e||i.length!==e);a=!0);}catch(t){u=!0,o=t}finally{try{a||null==n.return||n.return()}finally{if(u)throw o}}return i}}(e,n)||function(t,e){if(t){if("string"==typeof t)return d(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?d(t,e):void 0}}(e,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=a[0],f=a[1],p=a[2],y=a[3],h=a[4],b=a[5],v=a[6],g=a[7],S=a[8],w=a[9],E=a[10],k=a[11],O=a[12];return(0,r.useEffect)((function(){return y(new l.g(t.pageItems,t.maxItems,t.firstItemRequestUrl,t.requestUrl,b,v)),o.PageStore.on("window_scroll",g),o.PageStore.on("document_visibility_change",S),g(),function(){o.PageStore.removeListener("window_scroll",g),o.PageStore.removeListener("document_visibility_change",S),p&&(p.cancelAll(),y(null))}}),[]),f?s.length?r.createElement("div",{className:h.listOuter},k(),r.createElement("div",{ref:w,className:"items-list-wrap"},r.createElement("div",{ref:E,className:h.list},s.map((function(e,n){return r.createElement(c.H,m({key:n},(0,c.j)(t,e,n)))})))),O()):null:r.createElement(u.K,{className:h.listOuter})}y.propTypes=f({},a.ItemListAsync.propTypes),y.defaultProps=f(f({},a.ItemListAsync.defaultProps),{},{pageItems:2})},36191:function(t,e,n){"use strict";n.d(e,{PageHeader:function(){return r.m},PageMain:function(){return o.r},PageSidebar:function(){return i.$}});var r=n(56006),o=n(29198),i=n(22947);n(41542)},82083:function(t,e,n){var r=n(64835).Dispatcher;t.exports=new r},91450:function(t,e,n){"use strict";function r(){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}n.d(e,{o:function(){return r}}),n(62322),n(49268),n(13233)},39039:function(t,e,n){"use strict";n.d(e,{O:function(){return a},a:function(){return u}}),n(11646),n(20288),n(52004),n(28407),n(56394),n(38288),n(55677),n(92129),n(24655),n(23675),n(54458);var r=n(24646);function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function i(t,e,n){var r,i;switch(n){case TypeError:case RangeError:case SyntaxError:case ReferenceError:r=new n(e[0]);break;default:r=new Error(e[0])}return t.apply(void 0,[r.message].concat(function(t){if(Array.isArray(t))return o(t)}(i=e.slice(1))||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(i)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(t,e):void 0}}(i)||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.")}())),r}function a(t,e){return i(r.v,t,e)}function u(t,e){return i(r.Z,t,e)}},89264:function(t,e,n){"use strict";n.d(e,{Z:function(){return o}});var r=n(82083);function o(t,e){return r.register(t[e].bind(t)),t}},51397:function(t,e,n){"use strict";n.d(e,{U:function(){return i}}),n(62322),n(93296),n(56394),n(64669);var r=n(50137),o=n.n(r);function i(t,e){var n=o()(t,{});return""!==n.origin&&"null"!==n.origin&&n.origin||(n=o()(e+"/"+t.replace(/^\//g,""),{})),n.toString()}},20705:function(t,e,n){"use strict";function r(t,e){function n(t,e,n){return Number(parseFloat(t/e).toFixed(t<10*e?1:0))+n}return e?t.toLocaleString():function(t,e,r,o,i,a){for(;e>=o;)i*=r,o*=r,t+=1;return t<a.length?n(e,i,a[t]):n(e*(r*(t-(a.length-1))),i,a[a.length-1])}(0,t,1e3,1e3,1,["","K","M","B","T"])}n.d(e,{Z:function(){return r}}),n(30717),n(56660)},12161:function(t,e,n){"use strict";n.d(e,{s:function(){return r}}),n(62322),n(49268);var r=function(t){if(t){var e=t.split(".");return e[e.length-1]}}},24646:function(t,e,n){"use strict";n.d(e,{Z:function(){return u},v:function(){return c}}),n(20288),n(11646),n(52004),n(28407),n(56394),n(38288),n(55677),n(92129),n(24655),n(23675),n(54458);var r=n(1283);function o(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}(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 i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var a=function(){for(var t,e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];return(t=r)[n[0]].apply(t,o(n.slice(1)))},u=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return a.apply(void 0,["warn"].concat(e))},c=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return a.apply(void 0,["error"].concat(e))}},50408:function(t,e,n){"use strict";n.d(e,{ju:function(){return r},Fr:function(){return o},hj:function(){return i},U:function(){return a},xP:function(){return u},r:function(){return c},aP:function(){return l},ZU:function(){return s},$A:function(){return f}}),n(45777);var r=function(t,e){return t>e},o=function(t){return 0===t},i=function(t){return!isNaN(t)&&t===0+t},a=function(t){return t===Math.trunc(t)},u=function(t){return r(t,0)},c=function(t){return i(t)&&u(t)},l=function(t){return a(t)&&u(t)},s=function(t){return a(t)&&(u(t)||o(t))},f=function t(e,n){return n?t(n,e%n):e}},65477:function(t,e,n){"use strict";n.d(e,{g:function(){return a},n:function(){return u}}),n(52004),n(28407),n(56394),n(38288),n(55677),n(92129),n(24655);var r=n(39039),o=n(50408);function i(t){return(i="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)}var a=function(t,e,n){return void 0===t[e]||(0,o.ZU)(t[e])?null:(0,r.O)(["Invalid prop `"+e+"` of type `"+i(t[e])+"` supplied to `"+(n||"N/A")+"`, expected `positive integer or zero` ("+t[e]+")."])},u=function(t,e,n){return void 0===t[e]||(0,o.aP)(t[e])?null:(0,r.O)(["Invalid prop `"+e+"` of type `"+i(t[e])+"` supplied to `"+(n||"N/A")+"`, expected `positive integer` ("+t[e]+")."])}},41024:function(t,e,n){"use strict";function r(t){for(var e in window.REPLACEMENTS)t=t.replace(e,window.REPLACEMENTS[e]);return t}n.d(e,{G:function(){return r}}),n(62322),n(93296)},40447:function(t,e,n){"use strict";n.d(e,{A_:function(){return u},j0:function(){return l},GH:function(){return f},Jl:function(){return m}}),n(77588),n(56394),n(25334);var r=n(24559),o=n.n(r);function i(t,e,n,r,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function a(t){return function(){var e=this,n=arguments;return new Promise((function(r,o){var a=t.apply(e,n);function u(t){i(a,r,o,u,c,"next",t)}function c(t){i(a,r,o,u,c,"throw",t)}u(void 0)}))}}function u(t,e,n,r){return c.apply(this,arguments)}function c(){return(c=a(regeneratorRuntime.mark((function t(e,n,o,i){var a,u,c;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(c=function(t){if(i instanceof Function){var e=t;if(void 0===t.response)e={type:"network",error:t};else if(void 0!==t.response.status)switch(t.response.status){case 401:e={type:"private",error:t,message:"Media is private"};break;case 400:e={type:"unavailable",error:t,message:"Media is unavailable"}}i(e)}},u=function(t){o instanceof Function&&o(t)},a={timeout:null,maxContentLength:null},!n){t.next=8;break}return t.next=6,(0,r.get)(e,a).then(u).catch(c||null);case 6:t.next=9;break;case 8:(0,r.get)(e,a).then(u).catch(c||null);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function l(t,e,n,r,o,i){return s.apply(this,arguments)}function s(){return(s=a(regeneratorRuntime.mark((function t(e,n,o,i,a,u){var c,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(l=function(t){u instanceof Function&&u(t)},c=function(t){a instanceof Function&&a(t)},n=n||{},!i){t.next=8;break}return t.next=6,(0,r.post)(e,n,o||null).then(c).catch(l||null);case 6:t.next=9;break;case 8:(0,r.post)(e,n,o||null).then(c).catch(l||null);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function f(t,e,n,r,o,i){return p.apply(this,arguments)}function p(){return(p=a(regeneratorRuntime.mark((function t(e,n,o,i,a,u){var c,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(l=function(t){u instanceof Function&&u(t)},c=function(t){a instanceof Function&&a(t)},n=n||{},!i){t.next=8;break}return t.next=6,(0,r.put)(e,n,o||null).then(c).catch(l||null);case 6:t.next=9;break;case 8:(0,r.put)(e,n,o||null).then(c).catch(l||null);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function m(t,e,n,r,o){return d.apply(this,arguments)}function d(){return(d=a(regeneratorRuntime.mark((function t(e,n,r,i,a){var u,c;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(c=function(t){a instanceof Function&&a(t)},u=function(t){i instanceof Function&&i(t)},n=n||{},!r){t.next=8;break}return t.next=6,o().delete(e,n||null).then(u).catch(c||null);case 6:t.next=9;break;case 8:o().delete(e,n||null).then(u).catch(c||null);case 9:case"end":return t.stop()}}),t)})))).apply(this,arguments)}},7959:function(t,e,n){"use strict";n.r(e),n(55677),n(56394),n(60506),n(53224),n(50597),n(43543),n(35210),n(95785),n(30091),n(29595),n(23357),n(91816),n(2161),n(47445),n(84875),n(71608),n(72994),n(284),n(30601),n(39494),n(66229),n(19149),n(79503),n(9617),n(91962),n(8097),n(62322),n(93296),n(64669),n(67441),n(92070),n(23675),n(92129),n(49268),n(52004),n(28407),n(38288),n(24655),n(20288),n(54458),n(25101),n(13080);var r,o=n(41590),i=n.n(o),a=n(9722),u=n(80473),c=n(39479);function l(t){return(l="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 s(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 p(t,e){return!e||"object"!==l(e)&&"function"!=typeof e?m(t):e}function m(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function d(t){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var h=null,b=null,v=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)}(v,t);var e,n,o,i,l=(o=v,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(t){return!1}}(),function(){var t,e=d(o);if(i){var n=d(this).constructor;t=Reflect.construct(e,arguments,n)}else t=e.apply(this,arguments);return p(this,t)});function v(t){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,v),e=l.call(this),b=(0,c.v)(window.MediaCMS),r=new a.BrowserCache(b.site.id,86400),(h={mediaAutoPlay:r.get("media-auto-play")}).mediaAutoPlay=null===h.mediaAutoPlay||h.mediaAutoPlay,e.browserEvents=(0,u.BrowserEvents)(),e.browserEvents.doc(e.onDocumentVisibilityChange.bind(m(e))),e.browserEvents.win(e.onWindowResize.bind(m(e)),e.onWindowScroll.bind(m(e))),e.notifications=function(t){var e=[];function n(t){var n;"string"==typeof t&&e.push([(n=new Uint32Array(3),window.crypto.getRandomValues(n),(performance.now().toString(36)+Array.from(n).map((function(t){return t.toString(36)})).join("")).replace(/./g,""+Math.random()+Intl.DateTimeFormat().resolvedOptions().timeZone+Date.now())),t])}return t.map(n),{size:function(){return e.length},push:n,clear:function(){e=[]},messages:function(){return function(t){if(Array.isArray(t))return y(t)}(t=e)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(t,e):void 0}}(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.")}();var t}}}(void 0!==window.MediaCMS&&void 0!==window.MediaCMS.notifications?window.MediaCMS.notifications:[]),e}return e=v,(n=[{key:"onDocumentVisibilityChange",value:function(){this.emit("document_visibility_change")}},{key:"onWindowScroll",value:function(){this.emit("window_scroll")}},{key:"onWindowResize",value:function(){this.emit("window_resize")}},{key:"initPage",value:function(t){h.currentPage=t}},{key:"get",value:function(t){var e,n;switch(t){case"browser-cache":e=r;break;case"media-auto-play":e=h.mediaAutoPlay;break;case"config-contents":e=b.contents;break;case"config-enabled":e=b.enabled;break;case"config-media-item":e=b.media.item;break;case"config-options":e=b.options;break;case"config-site":e=b.site;break;case"api-playlists":n=t.split("-")[1],e=b.api[n]||null;break;case"notifications-size":e=this.notifications.size();break;case"notifications":e=this.notifications.messages(),this.notifications.clear();break;case"current-page":e=h.currentPage}return e}},{key:"actions_handler",value:function(t){switch(t.type){case"INIT_PAGE":this.initPage(t.page),this.emit("page_init");break;case"TOGGLE_AUTO_PLAY":h.mediaAutoPlay=!h.mediaAutoPlay,r.set("media-auto-play",h.mediaAutoPlay),this.emit("switched_media_auto_play");break;case"ADD_NOTIFICATION":this.notifications.push(t.notification),this.emit("added_notification")}}}])&&s(e.prototype,n),v}(i());e.default=(0,u.exportStore)(new v,"actions_handler")}},n={};function r(t){var o=n[t];if(void 0!==o)return o.exports;var i=n[t]={exports:{}};return e[t].call(i.exports,i,i.exports,r),i.exports}r.m=e,t=[],r.O=function(e,n,o,i){if(!n){var a=1/0;for(l=0;l<t.length;l++){n=t[l][0],o=t[l][1],i=t[l][2];for(var u=!0,c=0;c<n.length;c++)(!1&i||a>=i)&&Object.keys(r.O).every((function(t){return r.O[t](n[c])}))?n.splice(c--,1):(u=!1,i<a&&(a=i));u&&(t.splice(l--,1),e=o())}return e}i=i||0;for(var l=t.length;l>0&&t[l-1][2]>i;l--)t[l]=t[l-1];t[l]=[n,o,i]},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,{a:e}),e},r.d=function(t,e){for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.j=797,function(){var t={797:0};r.O.j=function(e){return 0===t[e]};var e=function(e,n){var o,i,a=n[0],u=n[1],c=n[2],l=0;for(o in u)r.o(u,o)&&(r.m[o]=u[o]);if(c)var s=c(r);for(e&&e(n);l<a.length;l++)i=a[l],r.o(t,i)&&t[i]&&t[i][0](),t[a[l]]=0;return r.O(s)},n=self.webpackChunkmediacms_frontend=self.webpackChunkmediacms_frontend||[];n.forEach(e.bind(null,0)),n.push=e.bind(null,n.push.bind(n))}();var o=r.O(void 0,[431],(function(){return r(24254)}));o=r.O(o)}();