!function(){"use strict";var e={7251:function(e,t,n){var i=n(2667),a=(n(5101),n(5466)),o=(n(6116),n(9518)),r=n(3074),l=n.n(r),s=n(365),u=n(920),c=n.n(u),d=n(2276),p=n(2787),m=n(4426),f=n(3811);function h(e){var t=null,n=e.split(".");if(n.length)switch(n=n[n.length-1]){case"webm":t="audio/webm";break;case"flac":t="audio/flac";break;case"wave":t="audio/wave";break;case"wav":t="audio/wav";break;case"ogg":case"ogg":t="audio/ogg";break;case"mp3":case"mpeg":t="audio/mpeg"}return t}n(2322),n(9268);var y=n(9688),b=n(5793),g=n(6983),v=n(9450);function _(e){return(_="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 E(e,t){for(var n=0;n'),this.AudioPlayerData.instance=new(c())(this.refs.AudioElem,{sources:this.videoSources,poster:this.videoPoster,autoplay:!this.props.inEmbed,bigPlayButton:!0,controlBar:{fullscreen:!1,theaterMode:!1,next:!this.props.inEmbed&&0this.refs.Text.offsetHeight;this.setState({enabledViewMoreContent:e,viewMoreContent:!!e&&this.state.viewMoreContent})}},{key:"toggleMore",value:function(){this.setState({viewMoreContent:!this.state.viewMoreContent})}},{key:"onPopupsDisplayChange",value:function(){this.setState({isOpenRemoveCommentPopup:this.removeCommentPopup.isPopupOpen()})}},{key:"cancelCommentRemoval",value:function(){this.removeCommentPopup.setOpenPopupState(!1)}},{key:"proceedCommentRemoval",value:function(){G.deleteComment(this.props.comment_id),this.cancelCommentRemoval()}},{key:"render",value:function(){return a.createElement("div",{key:this.props.comment_id,className:"comment"},a.createElement("div",{className:"comment-inner"},a.createElement("a",{className:"comment-author-thumb",href:this.props.author_link,title:this.props.author_name},a.createElement("img",{src:this.props.author_thumb,alt:this.props.author_name})),a.createElement("div",{className:"comment-content"},a.createElement("div",{className:"comment-meta"},a.createElement("div",{className:"comment-author"},a.createElement("a",{href:this.props.author_link,title:this.props.author_name},this.props.author_name)),a.createElement("div",{className:"comment-date"},(0,le.WU)(new Date(this.props.publish_date)))),a.createElement("div",{ref:"Text",className:"comment-text"+(this.state.viewMoreContent?" show-all":"")},a.createElement("div",{ref:"TextInner",className:"comment-text-inner",dangerouslySetInnerHTML:{__html:this.props.text}})),this.state.enabledViewMoreContent?a.createElement("button",{className:"toggle-more",onClick:this.toggleMore},this.state.viewMoreContent?"Show less":"Read more"):null,te.Z._currentValue.can.deleteComment?a.createElement("div",{className:"comment-actions"},te.Z._currentValue.can.deleteComment?a.createElement("div",{className:"comment-action remove-comment"},this.removeCommentPopup.triggerComponent(),this.state.isOpenRemoveCommentPopup?this.removeCommentPopup.contentComponent():null):null):null)))}}]),n}(a.PureComponent);Ce.propTypes={comment_id:l().oneOfType([l().string,l().number]).isRequired,media_id:l().oneOfType([l().string,l().number]).isRequired,text:l().string,author_name:l().string,author_link:l().string,author_thumb:l().string,publish_date:l().oneOfType([l().string,l().number]),likes:l().number,dislikes:l().number},Ce.defaultProps={author_name:"",author_link:"#",publish_date:0,likes:0,dislikes:0};var Pe=function(e){fe(n,e);var t=ye(n);function n(e){var i;if(de(this,n),(i=t.call(this,e)).state={mediaId:d.Z.get("media-id")},te.Z._currentValue.can.readComment){var a=d.Z.get("media-comments");i.state.comments=a,i.state.commentsLength=a?a.length:0,i.state.commentsLength||(i.onCommentsLoad=i.onCommentsLoad.bind(ge(i)),i.onCommentSubmit=i.onCommentSubmit.bind(ge(i)),i.onCommentSubmitFail=i.onCommentSubmitFail.bind(ge(i)),i.onCommentDelete=i.onCommentDelete.bind(ge(i)),i.onCommentDeleteFail=i.onCommentDeleteFail.bind(ge(i)),d.Z.on("comments_load",i.onCommentsLoad),d.Z.on("comment_submit",i.onCommentSubmit),d.Z.on("comment_submit_fail",i.onCommentSubmitFail),d.Z.on("comment_delete",i.onCommentDelete),d.Z.on("comment_delete_fail",i.onCommentDeleteFail))}return i}return me(n,[{key:"onCommentsLoad",value:function(){var e=d.Z.get("media-comments");this.setState({comments:e,commentsLength:e?e.length:0},(function(){}));var t=document.querySelector(".page-main"),n=t.querySelector(".no-comment");if(0===e.length&&"unlisted"===d.Z.get("media-data").state){if(-1'+this.props.title+'".'})}},{key:"onFailedRateSubmit",value:function(e){this.setState({submitingScore:!1,message:'A problem has occurred when submitting your score for the category of "'+this.props.title+'". Please try again.'})}},{key:"onButtonClick",value:function(e){this.setState({score:e})}},{key:"submitRate",value:function(){this.setState({submitingScore:!0},(function(){var e,t;e=this.props.id,t=this.state.score,Ve().dispatch({type:"RATE_SUBMIT",id:e,score:t})}))}},{key:"stars",value:function(){for(var e=[],t=1;t<6;)e.push(a.createElement("div",{key:t,className:(t<=this.state.score?"active":"")+(t===this.state.score?" selected":"")},a.createElement(ae.M,{onClick:this.onButtonClick.bind(this,t)},a.createElement("i",{className:"material-icons"},"star_rate")))),t+=1;return e}},{key:"render",value:function(){return a.createElement("div",{className:"rating-category"+(this.state.submitingScore||null!==this.state.message?" submit-loading":"")},a.createElement("div",{className:"category-title"},this.props.title),a.createElement("div",{className:"stars"},this.stars()),a.createElement("div",{className:"rate-action"},a.createElement("button",{disabled:this.state.score===this.state.initialScore,onClick:this.state.score===this.state.initialScore?null:this.submitRate},"Submit score")),this.state.submitingScore?a.createElement("div",{className:"submit-loader"},a.createElement(Fe.i,null)):null,null!==this.state.message?a.createElement("div",{className:"submit-loader"},a.createElement("div",{className:"submit-msg"},a.createElement("div",{dangerouslySetInnerHTML:{__html:this.state.message}})),a.createElement(ae.M,{className:"close-msg",onClick:this.closeRateMessage},a.createElement("i",{className:"material-icons"},"clear"))):null)}}]),n}(a.PureComponent);Ke.propTypes={id:l().oneOfType([l().string,l().number]).isRequired,title:l().string.isRequired,score:l().number.isRequired};var Je=function(e){ze(n,e);var t=Ge(n);function n(e){var i;return He(this,n),(i=t.call(this,e)).state={extended:Ae.get("extended-rate-categories")},i.onClickExtend=i.onClickExtend.bind($e(i)),i.onRateCategoriesToggle=i.onRateCategoriesToggle.bind($e(i)),Ae.on("changed_rate_categories_visibility",i.onRateCategoriesToggle),i}return qe(n,[{key:"componentDidMount",value:function(){var e;e=this.props.media_id,Ve().dispatch({type:"INIT",media_id:e})}},{key:"onClickExtend",value:function(){Ve().dispatch({type:"EXTEND_RATE_CATEGORIES"})}},{key:"onRateCategoriesToggle",value:function(){this.setState({extended:Ae.get("extended-rate-categories")})}},{key:"ratingCategories",value:function(){for(var e=[],t=0;te.length)&&(t=e.length);for(var n=0,i=new Array(t);nGt.Z.get("container-width")-80?Gt.Z.get("container-width")-80:null},t.onClickCopyMediaLink=t.onClickCopyMediaLink.bind(en(t)),t.onCompleteCopyMediaLink=t.onCompleteCopyMediaLink.bind(en(t)),t.inlineSlider=null,t.nextSlide=t.nextSlide.bind(en(t)),t.prevSlide=t.prevSlide.bind(en(t)),t.previousBtn=a.createElement("span",{className:"previous-slide"},a.createElement(ae.M,{buttonShadow:!0,onClick:t.prevSlide},a.createElement("i",{className:"material-icons"},"keyboard_arrow_left"))),t.nextBtn=a.createElement("span",{className:"next-slide"},a.createElement(ae.M,{buttonShadow:!0,onClick:t.nextSlide},a.createElement("i",{className:"material-icons"},"keyboard_arrow_right")));var i=function(){for(var e=$t._currentValue,t=d.Z.get("media-url"),n=d.Z.get("media-data").title,i={},a=0;aGt.Z.get("container-width")-80?Gt.Z.get("container-width")-80:null},this.updateSlider)}},{key:"updateSlider",value:function(e){if(!this.inlineSlider){var t=this.refs.MediaShareOptionsContent.querySelector(".share-options-inner");t&&(this.inlineSlider=new Yt.Z(t,".sh-option"))}this.inlineSlider&&(this.inlineSlider.updateDataState(this.shareOptionsElems.length,!0,!0),this.updateSliderButtonsView())}},{key:"nextSlide",value:function(){this.inlineSlider.nextSlide(),this.updateSliderButtonsView(),this.inlineSlider.scrollToCurrentSlide()}},{key:"prevSlide",value:function(){this.inlineSlider.previousSlide(),this.updateSliderButtonsView(),this.inlineSlider.scrollToCurrentSlide()}},{key:"updateSliderButtonsView",value:function(){this.setState({displayPrev:this.inlineSlider.hasPreviousSlide(),displayNext:this.inlineSlider.hasNextSlide()})}},{key:"enableEvents",value:function(){m.Z.on("window_resize",this.onWindowResize),d.Z.on("copied_media_link",this.onCompleteCopyMediaLink)}},{key:"disableEvents",value:function(){m.Z.removeListener("window_resize",this.onWindowResize),d.Z.removeListener("copied_media_link",this.onCompleteCopyMediaLink)}},{key:"onClickCopyMediaLink",value:function(){G.copyShareLink(this.refs.MediaShareOptionsContent.querySelector(".copy-field input"))}},{key:"onCompleteCopyMediaLink",value:function(){setTimeout(function(){ne.wN("Link copied to clipboard","clipboardLinkCopy")}.bind(this),100)}},{key:"render",value:function(){return a.createElement("div",{ref:"MediaShareOptionsContent",style:null!==this.state.maxPopupWidth?{maxWidth:this.state.maxPopupWidth+"px"}:null},a.createElement("div",{className:"scrollable-content",style:null!==this.state.maxFormContentHeight?{maxHeight:this.state.maxFormContentHeight+"px"}:null},a.createElement("div",{className:"share-popup-title"},"Share media"),a.createElement("div",{ref:"ShareOptions",className:"share-options"},this.state.displayPrev?this.previousBtn:null,a.createElement("div",{className:"share-options-inner"},this.shareOptionsElems),this.state.displayNext?this.nextBtn:null)),a.createElement("div",{className:"copy-field"},a.createElement("div",null,a.createElement("input",{type:"text",readOnly:!0,value:d.Z.get("media-url")}),a.createElement("button",{onClick:this.onClickCopyMediaLink},"COPY"))))}}])&&Kt(t.prototype,n),l}(a.PureComponent);function an(e){return(an="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 on(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n=this.props.views?"view":"views"):null,a.createElement("div",{className:"media-actions"},a.createElement("div",null,te.Z._currentValue.can.likeMedia?a.createElement(bt,null):null,te.Z._currentValue.can.dislikeMedia?a.createElement(Ct,null):null,te.Z._currentValue.can.shareMedia?a.createElement(cn,null):null,te.Z._currentValue.can.saveMedia&&-1e.length)&&(t=e.length);for(var n=0,i=new Array(t);ne.length)&&(t=e.length);for(var n=0,i=new Array(t);ne.length)&&(t=e.length);for(var n=0,i=new Array(t);ne?t:e,void 0!==n&&ne.length)&&(t=e.length);for(var n=0,i=new Array(t);n'}),a.createElement("div",{className:"iframe-config"},a.createElement("div",{className:"iframe-config-options-title"},"Embed options"),a.createElement("div",{className:"iframe-config-option"},a.createElement("div",{className:"option-content"},a.createElement("div",{className:"ratio-options"},a.createElement("div",{className:"options-group"},a.createElement("label",{style:{minHeight:"36px"}},a.createElement("input",{type:"checkbox",checked:y,onChange:function(){var e=!y,t=v.split(":"),n=t[0],i=t[1];b(e),S(e?"px":P),Z(e?"px":D),M(e?parseInt(w*i/n,10):R),U(e?[{key:"px",label:"px"}]:[{key:"px",label:"px"},{key:"percent",label:"%"}])}}),"Keep aspect ratio")),y?a.createElement("div",{className:"options-group"},a.createElement("select",{ref:i,onChange:function(){var e=i.current.value,t=e.split(":"),n=t[0],a=t[1];_(e),M(y?parseInt(w*a/n,10):R)},value:v},a.createElement("optgroup",{label:"Horizontal orientation"},a.createElement("option",{value:"16:9"},"16:9"),a.createElement("option",{value:"4:3"},"4:3"),a.createElement("option",{value:"3:2"},"3:2")),a.createElement("optgroup",{label:"Vertical orientation"},a.createElement("option",{value:"9:16"},"9:16"),a.createElement("option",{value:"3:4"},"3:4"),a.createElement("option",{value:"2:3"},"2:3")))):null),a.createElement("br",null),a.createElement("div",{className:"options-group"},a.createElement(di,{valueCallback:function(e){e=""===e?0:e;var t=v.split(":"),n=t[0],i=t[1];k(e),M(y?parseInt(e*i/n,10):R)},unitCallback:function(e){S(e)},label:"Width",defaultValue:parseInt(w,10),defaultUnit:P,minValue:1,maxValue:99999,units:F})),a.createElement("div",{className:"options-group"},a.createElement(di,{valueCallback:function(e){e=""===e?0:e;var t=v.split(":"),n=t[0],i=t[1];M(e),k(y?parseInt(e*n/i,10):w)},unitCallback:function(e){Z(e)},label:"Height",defaultValue:parseInt(R,10),defaultUnit:D,minValue:1,maxValue:99999,units:F})))))),a.createElement("div",{ref:u,className:"on-right-bottom"},a.createElement("button",{onClick:function(){G.copyEmbedMediaCode(s.current.querySelector("textarea"))}},"COPY")))))}function hi(e){return(hi="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 yi(e,t){return(yi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function bi(e,t){return!t||"object"!==hi(t)&&"function"!=typeof t?gi(e):t}function gi(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function vi(e){return(vi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}di.propTypes={label:l().string,units:l().array.isRequired,defaultUnit:l().string,defaultValue:l().number,minValue:l().number,maxValue:l().number,valueCallback:l().func,unitCallback:l().func},fi.propTypes={triggerPopupClose:l().func};var _i=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&&yi(e,t)}(o,e);var t,n,i=(t=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(e){return!1}}(),function(){var e,i=vi(t);if(n){var a=vi(this).constructor;e=Reflect.construct(i,arguments,a)}else e=i.apply(this,arguments);return bi(this,e)});function o(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e)).state={isOpenPopup:!1,popupCurrentPage:"shareOptions"},t.onPopupsDisplayChange=t.onPopupsDisplayChange.bind(gi(t)),t.onPopupPageChange=t.onPopupPageChange.bind(gi(t)),t.triggerPopupClose=t.triggerPopupClose.bind(gi(t));var n={shareOptions:a.createElement("div",{className:"popup-fullscreen"},a.createElement(ue.W8,null,a.createElement("span",{className:"popup-fullscreen-overlay"}),a.createElement(nn,null))),shareEmbed:a.createElement("div",{className:"popup-fullscreen share-embed-popup"},a.createElement(ue.W8,null,a.createElement("span",{className:"popup-fullscreen-overlay"}),a.createElement(fi,{triggerPopupClose:t.triggerPopupClose})))};return t.sharePopup=new se.Z(a.createElement("button",null,a.createElement(ae.M,{type:"span"},a.createElement(oe.O,{type:"share"})),a.createElement("span",null,"SHARE")),a.createElement(Ot.o,{initPage:t.state.popupCurrentPage,pageChangeSelector:".change-page",pageIdSelectorAttr:"data-page-id",pages:n,focusFirstItemOnPageChange:!1,pageChangeCallback:t.onPopupPageChange}),t.onPopupsDisplayChange),t}return o}(cn);function Ei(e){return(Ei="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 wi(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ki(e,t){for(var n=0;n=this.props.views?"view":"views"):null,a.createElement("div",{className:"media-actions"},a.createElement("div",null,te.Z._currentValue.can.likeMedia?a.createElement(bt,null):null,te.Z._currentValue.can.dislikeMedia?a.createElement(Ct,null):null,te.Z._currentValue.can.shareMedia?a.createElement(_i,null):null,te.Z._currentValue.can.saveMedia&&-1(new Date).getTime()?n.value:null:n},clear:function(){var t;if(a&&Object.keys(localStorage).length)for(t in localStorage)localStorage.hasOwnProperty(t)&&0===t.indexOf(e)&&localStorage.removeItem(t);return!0}}:(0,i.O)(["Cache object prefix is required"])}},9450:function(e,t,n){n(7441),n(9751),n(6394),n(4669);var i=n(2186);function a(e,t){for(var n=0;no[this.id].minutes?"0":"")+o[this.id].minutes+":"+o[this.id].fn.infoToString(o[this.id].seconds)),o[this.id].toString}},{key:"ariaLabel",value:function(){if(void 0===o[this.id].ariaLabel){var e=[];0this.state.totalItems},a.prototype.loadMoreItems=function(){return this.state.currentSlide+this.state.slideItemsFit>=this.state.maxSlideIndex},a.prototype.itemsFit=function(){return this.state.slideItemsFit}},8420:function(e,t,n){n.d(t,{A_:function(){return i.Z},j0:function(){return a.Z},GH:function(){return o.Z},Jl:function(){return r.Z},v$:function(){return l.Z},uf:function(){return s.Z},$4:function(){return u.Z},hm:function(){return c.Z},UN:function(){return d.Z},$A:function(){return p.Z},m5:function(){return m.Z},vo:function(){return f.ZP}});var i=n(1712),a=n(9752),o=n(84),r=n(9009),l=n(1438),s=n(4135),u=n(3140),c=(n(1752),n(7514),n(7634)),d=n(4582),p=n(4845),m=(n(1569),n(6203)),f=n(7188)},3699:function(e,t,n){n.r(t),n.d(t,{loadMediaData:function(){return o},likeMedia:function(){return r},unlikeMedia:function(){return l},dislikeMedia:function(){return s},undislikeMedia:function(){return u},reportMedia:function(){return c},copyShareLink:function(){return d},copyEmbedMediaCode:function(){return p},removeMedia:function(){return m},submitComment:function(){return f},deleteComment:function(){return h},createPlaylist:function(){return y},addMediaToPlaylist:function(){return b},removeMediaFromPlaylist:function(){return g},addNewPlaylist:function(){return v}}),n(2322),n(3296);var i=n(8416),a=n.n(i);function o(){a().dispatch({type:"LOAD_MEDIA_DATA"})}function r(){a().dispatch({type:"LIKE_MEDIA"})}function l(){a().dispatch({type:"UNLIKE_MEDIA"})}function s(){a().dispatch({type:"DISLIKE_MEDIA"})}function u(){a().dispatch({type:"UNDISLIKE_MEDIA"})}function c(e){a().dispatch({type:"REPORT_MEDIA",reportDescription:e?e.replace(/\s/g,""):""})}function d(e){a().dispatch({type:"COPY_SHARE_LINK",inputElement:e})}function p(e){a().dispatch({type:"COPY_EMBED_MEDIA_CODE",inputElement:e})}function m(){a().dispatch({type:"REMOVE_MEDIA"})}function f(e){a().dispatch({type:"SUBMIT_COMMENT",commentText:e})}function h(e){a().dispatch({type:"DELETE_COMMENT",commentId:e})}function y(e){a().dispatch({type:"CREATE_PLAYLIST",playlist_data:e})}function b(e,t){a().dispatch({type:"ADD_MEDIA_TO_PLAYLIST",playlist_id:e,media_id:t})}function g(e,t){a().dispatch({type:"REMOVE_MEDIA_FROM_PLAYLIST",playlist_id:e,media_id:t})}function v(e){a().dispatch({type:"APPEND_NEW_PLAYLIST",playlist_data:e})}},2276:function(e,t,n){n(2004),n(8407),n(5101),n(9751),n(2322),n(3296),n(9006),n(9268),n(3233),n(5466);var i=n(1590),a=n.n(i),o=n(8420),r=(n(4559),n(4547)),l=n(137),s=n.n(l),u=n(4426);function c(e){return(c="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 d(e,t){for(var n=0;n