From e57b6b4c62039eae9b602b95098e482d2d9e171a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Pito=C5=84?= Date: Fri, 10 Mar 2023 22:36:39 +0100 Subject: [PATCH] Update embed youtube markup (#1462) * Update embed youtube player * Add SECURE_REFERRER_POLICY to dev settings, bump version to dev2 --- devproject/settings.py | 2 ++ frontend/src/services/one-box.js | 9 +++++---- misago/__init__.py | 2 +- misago/static/misago/js/misago.js | 2 +- misago/static/misago/js/misago.js.map | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-) diff --git a/devproject/settings.py b/devproject/settings.py index 33ee2ff15..1ad3e55b6 100644 --- a/devproject/settings.py +++ b/devproject/settings.py @@ -238,6 +238,8 @@ ROOT_URLCONF = "devproject.urls" +SECURE_REFERRER_POLICY = "strict-origin-when-cross-origin" + SOCIAL_AUTH_STRATEGY = "misago.socialauth.strategy.MisagoStrategy" SOCIAL_AUTH_PIPELINE = ( diff --git a/frontend/src/services/one-box.js b/frontend/src/services/one-box.js index 706321f87..83c269033 100644 --- a/frontend/src/services/one-box.js +++ b/frontend/src/services/one-box.js @@ -43,15 +43,16 @@ export class OneBox { swapYoutubePlayer(element, youtube) { let url = "https://www.youtube.com/embed/" url += youtube.video - url += "?rel=0" + url += "?feature=oembed" if (youtube.start) { url += "&start=" + youtube.start } const player = $( - '' + '' ) $(element).replaceWith(player) player.wrap('
') diff --git a/misago/__init__.py b/misago/__init__.py index 4b856fd6f..a8efe39e3 100644 --- a/misago/__init__.py +++ b/misago/__init__.py @@ -1,5 +1,5 @@ from .plugins.pluginlist import load_plugin_list_if_exists -__version__ = "0.30.0.dev1" +__version__ = "0.30.0.dev2" __released__ = False diff --git a/misago/static/misago/js/misago.js b/misago/static/misago/js/misago.js index 6807bd698..0572f61e6 100644 --- a/misago/static/misago/js/misago.js +++ b/misago/static/misago/js/misago.js @@ -1,2 +1,2 @@ -!function(){var e,t,n,a={98936:function(e,t,n){"use strict";n.d(t,{gq:function(){return o},Z6:function(){return r},kw:function(){return l}});var a=n(22928),i=n(94184),s=n.n(i),o=(n(57588),function(e){var t=e.children,n=e.className;return(0,a.Z)("div",{className:s()("flex-row",n)},void 0,t)}),r=function(e){var t=e.children,n=e.className,i=e.shrink;return(0,a.Z)("div",{className:s()("flex-row-col",n,{"flex-row-col-shrink":i})},void 0,t)},l=function(e){var t=e.auto,n=e.children,i=e.className;return(0,a.Z)("div",{className:s()("flex-row-section",{"flex-row-section-auto":t},i)},void 0,n)}},59131:function(e,t,n){"use strict";var a=n(22928);n(57588),t.Z=function(e){var t=e.children;return(0,a.Z)("div",{className:"container page-container"},void 0,t)}},99755:function(e,t,n){"use strict";n.d(t,{mr:function(){return r},gC:function(){return l},sP:function(){return c},eA:function(){return u},Ql:function(){return d},bM:function(){return p},Iv:function(){return h}});var a,i=n(22928),s=n(94184),o=n.n(s),r=(n(57588),function(e){var t=e.children,n=e.className,s=e.styleName;return(0,i.Z)("div",{className:o()("page-header",n,s&&"page-header-"+s)},void 0,(0,i.Z)("div",{className:"page-header-bg-image"},void 0,(0,i.Z)("div",{className:"page-header-bg-overlay"},void 0,a||(a=(0,i.Z)("div",{className:"page-header-image"})),t)))}),l=function(e){var t=e.children,n=e.className,a=e.styleName;return(0,i.Z)("div",{className:o()("page-header-banner",n,a&&"page-header-banner-"+a)},void 0,(0,i.Z)("div",{className:"page-header-banner-bg-image"},void 0,(0,i.Z)("div",{className:"page-header-banner-bg-overlay"},void 0,t)))},c=function(e){var t=e.children;return(0,i.Z)("div",{className:"container page-header-container"},void 0,t)},u=function(e){var t=e.children,n=e.className;return(0,i.Z)("div",{className:o()("page-header-details",n)},void 0,t)},d=function(e){var t=e.className,n=e.message;return(0,i.Z)("div",{className:o()("page-header-message",t),dangerouslySetInnerHTML:{__html:n}})},p=function(e){var t=e.children,n=e.className;return(0,i.Z)("div",{className:o()("page-header-message",n)},void 0,t)},h=function(e){var t=e.styleName,n=e.header,a=e.message;return(0,i.Z)(c,{},void 0,(0,i.Z)(r,{styleName:t},void 0,(0,i.Z)(l,{styleName:t},void 0,(0,i.Z)("h1",{},void 0,n)),a&&(0,i.Z)(u,{styleName:t},void 0,a)))}},26106:function(e,t,n){"use strict";var a=n(22928),i=(n(57588),n(32233)),s=n(89627),o=function(e){var t=e.agreement,n=e.checked,i=e.errors,o=e.url,r=e.value,l=e.onChange;if(!o)return null;var c=interpolate('%(agreement)s',{agreement:(0,s.Z)(t),url:(0,s.Z)(o)},!0),u=interpolate(gettext("I have read and accept %(agreement)s."),{agreement:c},!0);return(0,a.Z)("div",{className:"checkbox legal-footnote"},void 0,(0,a.Z)("label",{},void 0,(0,a.Z)("input",{checked:n,type:"checkbox",value:r,onChange:l}),(0,a.Z)("span",{dangerouslySetInnerHTML:{__html:u}})),i&&i.map((function(e,t){return(0,a.Z)("div",{className:"help-block errors"},t,e)})))};t.Z=function(e){var t=e.errors,n=e.privacyPolicy,s=e.termsOfService,r=e.onPrivacyPolicyChange,l=e.onTermsOfServiceChange,c=i.Z.get("TERMS_OF_SERVICE_ID"),u=i.Z.get("TERMS_OF_SERVICE_URL"),d=i.Z.get("PRIVACY_POLICY_ID"),p=i.Z.get("PRIVACY_POLICY_URL");return c||d?(0,a.Z)("div",{},void 0,(0,a.Z)(o,{agreement:gettext("the terms of service"),checked:null!==s,errors:t.termsOfService,url:u,value:c,onChange:l}),(0,a.Z)(o,{agreement:gettext("the privacy policy"),checked:null!==n,errors:t.privacyPolicy,url:p,value:d,onChange:r})):null}},47235:function(e,t,n){"use strict";var a,i=n(22928),s=(n(57588),n(32233)),o=function(e){var t=e.className,n=e.text;return n?(0,i.Z)("h5",{className:t||""},void 0,n):null};t.Z=function(e){var t=e.buttonClassName,n=e.buttonLabel,r=e.formLabel,l=e.header,c=e.labelClassName,u=s.Z.get("SOCIAL_AUTH");return 0===u.length?null:(0,i.Z)("div",{className:"form-group form-social-auth"},void 0,(0,i.Z)(o,{className:c,text:l}),(0,i.Z)("div",{className:"row"},void 0,u.map((function(e){var a=e.id,s=e.name,o=e.button_text,r=e.button_color,l=e.url,c="btn btn-block btn-default btn-social-"+a,u=r?{color:r}:null,d=o||interpolate(n,{site:s},!0);return(0,i.Z)("div",{className:t||"col-xs-12"},a,(0,i.Z)("a",{className:c,style:u,href:l},void 0,d))}))),a||(a=(0,i.Z)("hr",{})),(0,i.Z)(o,{className:c,text:r}))}},50366:function(e,t,n){"use strict";var a,i,s,o,r,l,c,u=n(22928);n(57588),t.Z=function(e){var t=e.thread;return(0,u.Z)("ul",{className:"thread-flags"},void 0,2==t.weight&&(0,u.Z)("li",{className:"thread-flag-pinned-globally",title:gettext("Pinned globally")},void 0,a||(a=(0,u.Z)("span",{className:"material-icon"},void 0,"bookmark"))),1==t.weight&&(0,u.Z)("li",{className:"thread-flag-pinned-locally",title:gettext("Pinned in category")},void 0,i||(i=(0,u.Z)("span",{className:"material-icon"},void 0,"bookmark_outline"))),t.best_answer&&(0,u.Z)("li",{className:"thread-flag-answered",title:gettext("Answered")},void 0,s||(s=(0,u.Z)("span",{className:"material-icon"},void 0,"check_circle"))),t.has_poll&&(0,u.Z)("li",{className:"thread-flag-poll",title:gettext("Poll")},void 0,o||(o=(0,u.Z)("span",{className:"material-icon"},void 0,"poll"))),(t.is_unapproved||t.has_unapproved_posts)&&(0,u.Z)("li",{className:"thread-flag-unapproved",title:t.is_unapproved?gettext("Awaiting approval"):gettext("Has unapproved posts")},void 0,r||(r=(0,u.Z)("span",{className:"material-icon"},void 0,"visibility"))),t.is_closed&&(0,u.Z)("li",{className:"thread-flag-closed",title:gettext("Closed")},void 0,l||(l=(0,u.Z)("span",{className:"material-icon"},void 0,"lock"))),t.is_hidden&&(0,u.Z)("li",{className:"thread-flag-hidden",title:gettext("Hidden")},void 0,c||(c=(0,u.Z)("span",{className:"material-icon"},void 0,"visibility_off"))))}},16768:function(e,t,n){"use strict";var a,i=n(22928);n(57588),t.Z=function(e){var t=e.thread;return(0,i.Z)("span",{className:"threads-replies",title:interpolate(ngettext("%(replies)s reply","%(replies)s replies",t.replies),{replies:t.replies},!0)},void 0,a||(a=(0,i.Z)("span",{className:"material-icon"},void 0,"chat_bubble_outline")),t.replies>980?Math.round(t.replies/1e3)+"K":t.replies)}},92490:function(e,t,n){"use strict";n.d(t,{o8:function(){return o},Eg:function(){return r},Z2:function(){return l},tw:function(){return c}});var a=n(22928),i=n(94184),s=n.n(i),o=(n(57588),function(e){var t=e.children,n=e.className;return(0,a.Z)("nav",{className:s()("toolbar",n)},void 0,t)}),r=function(e){var t=e.children,n=e.className,i=e.shrink;return(0,a.Z)("div",{className:s()("toolbar-item",n,{"toolbar-item-shrink":i})},void 0,t)},l=function(e){var t=e.auto,n=e.children,i=e.className;return(0,a.Z)("div",{className:s()("toolbar-section",{"toolbar-section-auto":t},i)},void 0,n)},c=function(e){var t=e.className;return(0,a.Z)("div",{className:s()("toolbar-spacer",t)})}},19605:function(e,t,n){"use strict";n.d(t,{ZP:function(){return s}});var a=n(22928),i=(n(57588),n(32233));function s(e){var t=e.size||100,n=e.size2x||t;return(0,a.Z)("img",{alt:"",className:e.className||"user-avatar",src:o(e.user,t),srcSet:o(e.user,n),width:t,height:t})}function o(e,t){return e&&e.id?function(e,t){var n=e[0];return e.forEach((function(e){e.size>=t&&(n=e)})),n}(e.avatars,t).url:i.Z.get("BLANK_AVATAR_URL")}},82211:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var a,i=n(22928),s=n(15671),o=n(43144),r=n(79340),l=n(6215),c=n(61120),u=n(57588),d=n.n(u),p=n(37848);var h=function(e){(0,r.Z)(d,e);var t,n,u=(t=d,n=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,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function d(){return(0,s.Z)(this,d),u.apply(this,arguments)}return(0,o.Z)(d,[{key:"render",value:function(){var e="btn "+this.props.className,t=this.props.disabled;return this.props.loading&&(e+=" btn-loading",t=!0),(0,i.Z)("button",{className:e,disabled:t,onClick:this.props.onClick,type:this.props.onClick?"button":"submit"},void 0,this.props.children,this.props.loading?a||(a=(0,i.Z)(p.Z,{})):null)}}]),d}(d().Component);h.defaultProps={className:"btn-default",type:"submit",loading:!1,disabled:!1,onClick:null}},57026:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var a=n(22928);function i(e){return(0,a.Z)("select",{className:e.className||"form-control",disabled:e.disabled||!1,id:e.id||null,onChange:e.onChange,value:e.value},void 0,e.choices.map((function(e){return(0,a.Z)("option",{disabled:e.disabled||!1,value:e.value},e.value,"- - ".repeat(e.level)+e.label)})))}n(57588)},21688:function(e,t,n){"use strict";n.d(t,{Z:function(){return S}});var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120),c=n(57588),u=n.n(c),d=n(33556);function p(e){return e.display?(0,a.Z)(d.Z,{helpText:gettext("No profile details are editable at this time."),message:gettext("This option is currently unavailable.")}):null}var h,v=n(37848);function f(e){return e.display?h||(h=(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)(v.Z,{}))):null}var m=n(97326),Z=n(4942),g=n(60471);var y=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,n=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,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){var e;(0,i.Z)(this,u);for(var t=arguments.length,n=new Array(t),a=0;acode"),i=0;ia"),n=0;n');d(e).replaceWith(a),a.wrap('
')}}]),e}());function v(e){var t=function(e){var t=e;return"https://"===e.substr(0,8)?t=t.substr(8):"http://"===e.substr(0,7)&&(t=t.substr(7)),"www."===t.substr(0,4)&&(t=t.substr(4)),t}(e),n=function(e){if(-1===e.indexOf("youtu"))return null;var t=e.match(p);return t?t[1]:null}(t);if(!n)return null;var a=0;if(t.indexOf("?")>0){var i=t.substr(t.indexOf("?")+1).split("&").filter((function(e){return"t="===e.substr(0,2)}))[0];if(i){var s=i.substr(2).split("m");"s"===s[0].substr(-1)?a+=parseInt(s[0].substr(0,s[0].length-1)):(a+=60*parseInt(s[0]),s[1]&&"s"===s[1].substr(-1)&&(a+=parseInt(s[1].substr(0,s[1].length-1))))}}return{start:a,video:n}}var f=n(19755);var m=function(e){(0,s.Z)(u,e);var t,n,l=(t=u,n=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,a=(0,r.Z)(t);if(n){var i=(0,r.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,o.Z)(this,e)});function u(){return(0,a.Z)(this,u),l.apply(this,arguments)}return(0,i.Z)(u,[{key:"componentDidMount",value:function(){h.render(this.documentNode),f(this.documentNode).find(".spoiler-reveal").click(Z)}},{key:"componentDidUpdate",value:function(e,t){h.render(this.documentNode),f(this.documentNode).find(".spoiler-reveal").click(Z)}},{key:"shouldComponentUpdate",value:function(e,t){return e.markup!==this.props.markup}},{key:"render",value:function(){var e=this;return c().createElement("article",{className:"misago-markup",dangerouslySetInnerHTML:{__html:this.props.markup},"data-author":this.props.author||void 0,ref:function(t){e.documentNode=t}})}}]),u}(c().Component);function Z(e){var t=e.target;f(t).parent().parent().addClass("revealed")}},3784:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var a,i=n(22928),s=n(15671),o=n(43144),r=n(79340),l=n(6215),c=n(61120),u=n(57588),d=n.n(u),p=n(37848);var h=function(e){(0,r.Z)(d,e);var t,n,u=(t=d,n=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,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function d(){return(0,s.Z)(this,d),u.apply(this,arguments)}return(0,o.Z)(d,[{key:"render",value:function(){return a||(a=(0,i.Z)("div",{className:"modal-body modal-loader"},void 0,(0,i.Z)(p.Z,{})))}}]),d}(d().Component)},30337:function(e,t,n){"use strict";n.d(t,{Z:function(){return c}});var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120);n(57588);var c=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,n=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,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"getHelpText",value:function(){return this.props.helpText?(0,a.Z)("p",{className:"help-block"},void 0,this.props.helpText):null}},{key:"render",value:function(){return(0,a.Z)("div",{className:"modal-body"},void 0,(0,a.Z)("div",{className:"message-icon"},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,this.props.icon||"info_outline")),(0,a.Z)("div",{className:"message-body"},void 0,(0,a.Z)("p",{className:"lead"},void 0,this.props.message),this.getHelpText(),(0,a.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Ok"))))}}]),u}(n(33556).Z)},95187:function(e,t,n){"use strict";n.d(t,{Z:function(){return h}});var a,i=n(22928),s=n(15671),o=n(43144),r=n(79340),l=n(6215),c=n(61120),u=n(57588),d=n.n(u),p=n(37848);var h=function(e){(0,r.Z)(d,e);var t,n,u=(t=d,n=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,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function d(){return(0,s.Z)(this,d),u.apply(this,arguments)}return(0,o.Z)(d,[{key:"render",value:function(){return a||(a=(0,i.Z)("div",{className:"panel-body panel-body-loading"},void 0,(0,i.Z)(p.Z,{className:"loader loader-spaced"})))}}]),d}(d().Component)},33556:function(e,t,n){"use strict";n.d(t,{Z:function(){return u}});var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120),c=n(57588);var u=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,n=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,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"getHelpText",value:function(){return this.props.helpText?(0,a.Z)("p",{className:"help-block"},void 0,this.props.helpText):null}},{key:"render",value:function(){return(0,a.Z)("div",{className:"panel-body panel-message-body"},void 0,(0,a.Z)("div",{className:"message-icon"},void 0,(0,a.Z)("span",{className:"material-icon"},void 0,this.props.icon||"info_outline")),(0,a.Z)("div",{className:"message-body"},void 0,(0,a.Z)("p",{className:"lead"},void 0,this.props.message),this.getHelpText()))}}]),u}(n.n(c)().Component)},11005:function(e,t,n){"use strict";n.d(t,{Z:function(){return x}});var a=n(22928),i=n(57588),s=n.n(i),o=n(69092);function r(e){return e.post.content?s().createElement(l,e):s().createElement(c,e)}function l(e){return(0,a.Z)("div",{className:"post-body"},void 0,(0,a.Z)(o.Z,{markup:e.post.content}))}function c(e){return(0,a.Z)("div",{className:"post-body post-body-invalid"},void 0,(0,a.Z)("p",{className:"lead"},void 0,gettext("This post's contents cannot be displayed.")),(0,a.Z)("p",{className:"text-muted"},void 0,gettext("This error is caused by invalid post content manipulation.")))}function u(e){var t=e.post,n=t.category,i=t.thread,s=interpolate(gettext("posted %(posted_on)s"),{posted_on:t.posted_on.format("LL, LT")},!0);return(0,a.Z)("div",{className:"post-heading"},void 0,(0,a.Z)("a",{className:"btn btn-link item-title",href:i.url},void 0,i.title),(0,a.Z)("a",{className:"btn btn-link post-category",href:n.url.index},void 0,n.name),(0,a.Z)("a",{href:t.url.index,className:"btn btn-link posted-on",title:s},void 0,t.posted_on.fromNow()))}var d,p,h=n(19605);function v(e){var t=e.post;return(0,a.Z)("a",{className:"btn btn-default btn-icon pull-right",href:t.url.index},void 0,(0,a.Z)("span",{className:"btn-text-left hidden-xs"},void 0,gettext("See post")),d||(d=(0,a.Z)("span",{className:"material-icon"},void 0,"chevron_right")))}function f(e){var t=e.post;return(0,a.Z)("div",{className:"post-side post-side-anonymous"},void 0,(0,a.Z)(v,{post:t}),(0,a.Z)("div",{className:"media"},void 0,p||(p=(0,a.Z)("div",{className:"media-left"},void 0,(0,a.Z)("span",{},void 0,(0,a.Z)(h.ZP,{className:"poster-avatar",size:50})))),(0,a.Z)("div",{className:"media-body"},void 0,(0,a.Z)("div",{className:"media-heading"},void 0,(0,a.Z)("span",{className:"item-title"},void 0,t.poster_name)),(0,a.Z)("span",{className:"user-title user-title-anonymous"},void 0,gettext("Removed user")))))}function m(e){var t=e.rank,n=e.title||t.title||t.name,i="user-title";return t.css_class&&(i+=" user-title-"+t.css_class),t.is_tab?(0,a.Z)("a",{className:i,href:t.url},void 0,n):(0,a.Z)("span",{className:i},void 0,n)}function Z(e){var t=e.post,n=e.poster;return(0,a.Z)("div",{className:"post-side post-side-registered"},void 0,(0,a.Z)(v,{post:t}),(0,a.Z)("div",{className:"media"},void 0,(0,a.Z)("div",{className:"media-left"},void 0,(0,a.Z)("a",{href:n.url},void 0,(0,a.Z)(h.ZP,{className:"poster-avatar",size:50,user:n}))),(0,a.Z)("div",{className:"media-body"},void 0,(0,a.Z)("div",{className:"media-heading"},void 0,(0,a.Z)("a",{className:"item-title",href:n.url},void 0,n.username)),(0,a.Z)(m,{title:n.title,rank:n.rank}))))}function g(e){var t=e.post,n=e.poster;return n&&n.id?(0,a.Z)(Z,{post:t,poster:n}):(0,a.Z)(f,{post:t})}function y(e){var t=e.post,n=e.poster||t.poster,i="post";return n&&n.rank.css_class&&(i+=" post-"+n.rank.css_class),(0,a.Z)("li",{className:i,id:"post-"+t.id},void 0,(0,a.Z)("div",{className:"panel panel-default panel-post"},void 0,(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)("div",{className:"panel-content"},void 0,(0,a.Z)(g,{post:t,poster:n}),(0,a.Z)(u,{post:t}),(0,a.Z)(r,{post:t})))))}var b,_,N=n(44039);function k(){return(0,a.Z)("ul",{className:"posts-list post-feed ui-preview"},void 0,(0,a.Z)("li",{className:"post"},void 0,(0,a.Z)("div",{className:"panel panel-default panel-post"},void 0,(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)("div",{className:"panel-content"},void 0,(0,a.Z)("div",{className:"post-side post-side-anonymous"},void 0,(0,a.Z)("div",{className:"media"},void 0,b||(b=(0,a.Z)("div",{className:"media-left"},void 0,(0,a.Z)("span",{},void 0,(0,a.Z)(h.ZP,{className:"poster-avatar",size:50})))),(0,a.Z)("div",{className:"media-body"},void 0,(0,a.Z)("div",{className:"media-heading"},void 0,(0,a.Z)("span",{className:"item-title"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,200)+"px"}},void 0," "))),(0,a.Z)("span",{className:"user-title user-title-anonymous"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,200)+"px"}},void 0," "))))),(0,a.Z)("div",{className:"post-heading"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,200)+"px"}},void 0," ")),(0,a.Z)("div",{className:"post-body"},void 0,(0,a.Z)("article",{className:"misago-markup"},void 0,(0,a.Z)("p",{},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,200)+"px"}},void 0," ")," ",(0,a.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,200)+"px"}},void 0," ")," ",(0,a.Z)("span",{className:"ui-preview-text",style:{width:N.e(30,200)+"px"}},void 0," ")))))))))}function x(e){var t=e.isReady,n=e.posts,i=e.poster;return t?(0,a.Z)("ul",{className:"posts-list post-feed ui-ready"},void 0,n.map((function(e){return(0,a.Z)(y,{post:e,poster:i},e.id)}))):_||(_=(0,a.Z)(k,{}))}},78107:function(e,t,n){"use strict";n.d(t,{mv:function(){return f},ZP:function(){return pn},MO:function(){return A},Fi:function(){return k}});var a,i=n(57588),s=n.n(i),o=n(22928),r=n(43144),l=n(15671),c=n(97326),u=n(79340),d=n(6215),p=n(61120),h=n(4942),v=n(64646);var f=function(e){(0,u.Z)(f,e);var t,n,i=(t=f,n=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,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function f(e){var t;return(0,l.Z)(this,f),t=i.call(this,e),(0,h.Z)((0,c.Z)(t),"selected",(function(){if(t.element){var e=Z(t.element)||null,n=e?e.getBoundingClientRect():null;t.setState({range:e,rect:n})}})),(0,h.Z)((0,c.Z)(t),"reply",(function(){if(v.Z.isOpen()){var e=A();e&&!e.disabled&&(e.quote(k(t.state.range)),t.setState({range:null,rect:null}),m())}else{var n=k(t.state.range);v.Z.open(Object.assign({},t.props.posting,{default:n})),t.setState({range:null,rect:null}),window.setTimeout(m,1e3)}})),(0,h.Z)((0,c.Z)(t),"render",(function(){return s().createElement("div",{ref:function(e){e&&(t.element=e)},onMouseUp:t.selected},t.props.children,!!t.state.rect&&(0,o.Z)("div",{className:"quote-control",style:{position:"absolute",left:t.state.rect.left+window.scrollX,top:t.state.rect.bottom+window.scrollY}},void 0,a||(a=(0,o.Z)("div",{className:"quote-control-arrow"})),(0,o.Z)("div",{className:"quote-control-inner"},void 0,(0,o.Z)("button",{className:"btn quote-control-btn",type:"button",onClick:t.reply},void 0,pgettext("post reply","Quote")))))})),t.state={range:null,rect:null},t.element=null,t}return(0,r.Z)(f)}(s().Component);function m(){var e=document.querySelector("#posting-mount textarea");e.focus(),e.selectionStart=e.selectionEnd=e.value.length}var Z=function(e){if(void 0!==window.getSelection){var t=window.getSelection();if(t&&"Range"===t.type&&1===t.rangeCount){var n=t.getRangeAt(0);if(g(n,e)&&y(n)&&b(n.cloneContents()))return n}}},g=function(e,t){var n=e.commonAncestorContainer;if(n===t)return!0;for(var a=n.parentNode;a;){if(a===t)return!0;a=a.parentNode}return!1},y=function(e){var t=e.commonAncestorContainer;if("ARTICLE"===t.nodeName)return!0;if(t.dataset&&"1"===t.dataset.noquote)return!1;for(var n=t.parentNode;n;){if(n.dataset&&"1"===n.dataset.noquote)return!1;if("ARTICLE"===n.nodeName)return!0;n=n.parentNode}return!1},b=function e(t){for(var n=0;n0)return!0;if("IMG"===a.nodeName)return!0;if(e(a))return!0}return!1},_=n(42982),N=n(70885),k=function(e){var t=x(e),n=L(e.cloneContents().childNodes,[]),a=t?'[quote="'.concat(t,'"]\n'):"[quote]\n",i="\n[/quote]\n\n",s=C(e);return s?(a+=s.syntax?"[code=".concat(s.syntax,"]\n"):"[code]\n",i="\n[/code]"+i):E(e)?(n=n.trim(),a+="`",i="`"+i):n=n.trim(),a+n+i},x=function(e){var t=e.commonAncestorContainer;if(w(t))return R(t);for(var n=t.parentNode;n;){if(w(n))return R(n);n=n.parentNode}return""},w=function(e){return e.nodeType===Node.ELEMENT_NODE&&("ARTICLE"===e.nodeName||"BLOCKQUOTE"===e.nodeName&&e.dataset&&"quote"===e.dataset.block)},R=function(e){return e.dataset&&e.dataset.author||null},C=function(e){var t=e.commonAncestorContainer;if(S(t))return P(t);for(var n=t.parentNode;n;){if(S(n))return P(n);n=n.parentNode}return null},S=function(e){return"PRE"===e.nodeName},E=function(e){var t=e.commonAncestorContainer;if("CODE"===t.nodeName)return!0;for(var n=t.parentNode;n;){if(w(n))return!1;if("CODE"===n.nodeName)return!0;n=n.parentNode}return!1},P=function(e){return e.dataset?{syntax:e.dataset.syntax||null}:{syntax:null}},L=function(e,t){for(var n="",a=0;a0&&(0,o.Z)("li",{},void 0,(0,K.Z)(n.size))))),!!n.id&&(0,o.Z)("div",{className:"markup-editor-attachment-buttons"},void 0,(0,o.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","Insert into message"),type:"button",disabled:a,onClick:function(){var e=function(e){var t="[";return e.is_image?(t+="!["+e.filename+"]",t+="("+(e.url.thumb||e.url.index)+"?shva=1)"):t+=e.filename,t+"]("+e.url.index+"?shva=1)"}(n),t=re(i);oe(t,r,e)}},void 0,X||(X=(0,o.Z)("span",{className:"material-icon"},void 0,"flip_to_front"))),(0,o.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","Remove attachment"),type:"button",disabled:a,onClick:function(){s((function(e){var t=e.attachments;if(window.confirm(pgettext("markup editor","Remove this attachment?")))return{attachments:t.filter((function(e){return e.id!==n.id}))}}))}},void 0,ee||(ee=(0,o.Z)("span",{className:"material-icon"},void 0,"close")))),!n.id&&!!n.key&&(0,o.Z)("div",{className:"markup-editor-attachment-buttons"},void 0,n.error&&(0,o.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","See error"),type:"button",onClick:function(){Y.Z.error(interpolate(pgettext("markup editor","%(filename)s: %(error)s"),{filename:n.filename,error:n.error},!0))}},void 0,te||(te=(0,o.Z)("span",{className:"material-icon"},void 0,"warning"))),(0,o.Z)("button",{className:"btn btn-markup-editor-attachment btn-icon",title:pgettext("markup editor","Remove attachment"),type:"button",disabled:a,onClick:function(){s((function(e){return{attachments:e.attachments.filter((function(e){return e.key!==n.key}))}}))}},void 0,ne||(ne=(0,o.Z)("span",{className:"material-icon"},void 0,"close"))))))},ue=function(e){var t=e.attachments,n=e.disabled,a=e.element,i=e.setState,s=e.update;return(0,o.Z)("div",{className:"markup-editor-attachments"},void 0,(0,o.Z)("div",{className:"markup-editor-attachments-container"},void 0,t.map((function(e){return(0,o.Z)(ce,{attachment:e,disabled:n,element:a,setState:i,update:s},e.key||e.id)}))))},de=n(82211),pe=function(e){var t=e.canProtect,n=e.disabled,a=e.empty,i=e.preview,s=e.isProtected,r=e.submitText,l=e.showPreview,c=e.closePreview,u=e.enableProtection,d=e.disableProtection;return(0,o.Z)("div",{className:"markup-editor-footer"},void 0,!!t&&(0,o.Z)(de.Z,{className:"btn-default btn-icon hidden-sm hidden-md hidden-lg",title:s?pgettext("markup editor","Protected"):pgettext("markup editor","Protect"),type:"button",disabled:n,onClick:function(){s?d():u()}},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,s?"lock":"lock_open")),!!t&&(0,o.Z)("div",{},void 0,(0,o.Z)(de.Z,{className:"btn-default hidden-xs",type:"button",disabled:n,onClick:function(){s?d():u()}},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,s?"lock":"lock_open"),s?pgettext("markup editor","Protected"):pgettext("markup editor","Protect"))),ae||(ae=(0,o.Z)("div",{className:"markup-editor-spacer"})),i?(0,o.Z)(de.Z,{className:"btn-default btn-auto",type:"button",onClick:c},void 0,pgettext("markup editor","Edit")):(0,o.Z)(de.Z,{className:"btn-default btn-auto",disabled:n||a,type:"button",onClick:l},void 0,pgettext("markup editor","Preview")),(0,o.Z)(de.Z,{className:"btn-primary btn-auto",disabled:n||a},void 0,r||gettext("Post")))},he=n(96359);var ve,fe,me,Ze,ge,ye,be,_e,Ne,ke,xe,we,Re,Ce,Se,Ee,Pe,Le,Te,Oe,Ae,Be,Ie,De,je,ze,Ue,Me,qe,He,Fe,Ye,Ve,Ge,$e,We,Qe,Ke,Je,Xe,et,tt,nt,at,it,st=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=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,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSubmit",(function(e){e.preventDefault();var n=t.props,a=n.selection,i=n.update,s=t.state.syntax.trim(),o=t.state.text.trim();if(0===o.length)return t.setState({error:gettext("This field is required.")}),!1;var r=a.prefix.trim().length?"\n\n":"";return oe(Object.assign({},a,{text:o}),i,r+"```"+s+"\n"+o+"\n```\n\n"),Q.Z.hide(),!1})),t.state={error:null,syntax:"",text:e.selection.text},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,o.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ie||(ie=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Code"))),(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(he.Z,{for:"markup_code_syntax",label:pgettext("markup editor","Syntax highlighting")},void 0,(0,o.Z)("select",{id:"markup_code_syntax",className:"form-control",value:this.state.syntax,onChange:function(t){return e.setState({syntax:t.target.value})}},void 0,(0,o.Z)("option",{value:""},void 0,pgettext("markup editor","No syntax highlighting")),ot.map((function(e){var t=e.value,n=e.name;return(0,o.Z)("option",{value:t},t,n)})))),(0,o.Z)(he.Z,{for:"markup_code_text",label:pgettext("markup editor","Code to insert"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,o.Z)("textarea",{id:"markup_code_text",className:"form-control",rows:"8",value:this.state.text,onChange:function(t){return e.setState({text:t.target.value})}}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert code"))))))}}]),i}(s().Component),ot=[{value:"bash",name:"Bash"},{value:"c",name:"C"},{value:"c#",name:"C#"},{value:"c++",name:"C++"},{value:"css",name:"CSS"},{value:"diff",name:"Diff"},{value:"go",name:"Go"},{value:"graphql",name:"GraphQL"},{value:"html,",name:"HTML"},{value:"xml",name:"XML"},{value:"json",name:"JSON"},{value:"java",name:"Java"},{value:"javascript",name:"JavaScript"},{value:"kotlin",name:"Kotlin"},{value:"less",name:"Less"},{value:"lua",name:"Lua"},{value:"makefile",name:"Makefile"},{value:"markdown",name:"Markdown"},{value:"objective-C",name:"Objective-C"},{value:"php",name:"PHP"},{value:"perl",name:"Perl"},{value:"plain",name:"Plain"},{value:"text",name:"text"},{value:"python",name:"Python"},{value:"repl",name:"REPL"},{value:"r",name:"R"},{value:"ruby",name:"Ruby"},{value:"rust",name:"Rust"},{value:"scss",name:"SCSS"},{value:"sql",name:"SQL"},{value:"shell",name:"Shell Session"},{value:"swift",name:"Swift"},{value:"toml",name:"TOML"},{value:"ini",name:"INI"},{value:"typescript",name:"TypeScript"},{value:"visualbasic",name:"Visual Basic .NET"},{value:"webassembly",name:"WebAssembly"},{value:"yaml",name:"YAML"}],rt=st;function lt(){return(0,o.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ve||(ve=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("markup help","Formatting help"))),(0,o.Z)("div",{className:"modal-body formatting-help"},void 0,(0,o.Z)("h4",{},void 0,pgettext("markup help","Emphasis text")),(0,o.Z)(ct,{markup:pgettext("markup help","_This text will have emphasis_"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("em",{},void 0,pgettext("markup help","This text will have emphasis")))}),fe||(fe=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Bold text")),(0,o.Z)(ct,{markup:pgettext("markup help","**This text will be bold**"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("strong",{},void 0,pgettext("markup help","This text will be bold")))}),me||(me=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Removed text")),(0,o.Z)(ct,{markup:pgettext("markup help","~~This text will be removed~~"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("del",{},void 0,pgettext("markup help","This text will be removed")))}),Ze||(Ze=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Bold text (BBCode)")),(0,o.Z)(ct,{markup:pgettext("markup help","[b]This text will be bold[/b]"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("b",{},void 0,pgettext("markup help","This text will be bold")))}),ge||(ge=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Underlined text (BBCode)")),(0,o.Z)(ct,{markup:pgettext("markup help","[u]This text will be underlined[/u]"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("u",{},void 0,pgettext("markup help","This text will be underlined")))}),ye||(ye=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Italics text (BBCode)")),(0,o.Z)(ct,{markup:pgettext("markup help","[i]This text will be in italics[/i]"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("i",{},void 0,pgettext("markup help","This text will be in italics")))}),be||(be=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Link")),_e||(_e=(0,o.Z)(ct,{markup:"",result:(0,o.Z)("p",{},void 0,(0,o.Z)("a",{href:"#"},void 0,"example.com"))})),Ne||(Ne=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Link with text")),(0,o.Z)(ct,{markup:"["+pgettext("markup help","Link text")+"](http://example.com)",result:(0,o.Z)("p",{},void 0,(0,o.Z)("a",{href:"#"},void 0,pgettext("markup help","Link text")))}),ke||(ke=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Link (BBCode)")),xe||(xe=(0,o.Z)(ct,{markup:"[url]http://example.com[/url]",result:(0,o.Z)("p",{},void 0,(0,o.Z)("a",{href:"#"},void 0,"example.com"))})),we||(we=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Link with text (BBCode)")),(0,o.Z)(ct,{markup:"[url=http://example.com]"+pgettext("markup help","Link text")+"[/url]",result:(0,o.Z)("p",{},void 0,(0,o.Z)("a",{href:"#"},void 0,pgettext("markup help","Link text")))}),Re||(Re=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Image")),Ce||(Ce=(0,o.Z)(ct,{markup:"!(http://placekitten.com/38/38)",result:(0,o.Z)("p",{},void 0,(0,o.Z)("img",{alt:"",src:"http://placekitten.com/38/38"}))})),Se||(Se=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Image with alternate text")),(0,o.Z)(ct,{markup:"!["+pgettext("markup help","Image text")+"](http://placekitten.com/38/38)",result:(0,o.Z)("p",{},void 0,(0,o.Z)("img",{alt:pgettext("markup help","Image text"),src:"http://placekitten.com/38/38"}))}),Ee||(Ee=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Image (BBCode)")),Pe||(Pe=(0,o.Z)(ct,{markup:"[img]http://placekitten.com/38/38[/img]",result:(0,o.Z)("p",{},void 0,(0,o.Z)("img",{alt:"",src:"http://placekitten.com/38/38"}))})),Le||(Le=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Mention user by their name")),Te||(Te=(0,o.Z)(ct,{markup:"@username",result:(0,o.Z)("p",{},void 0,(0,o.Z)("a",{href:"#"},void 0,"@username"))})),Oe||(Oe=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Heading 1")),(0,o.Z)(ct,{markup:pgettext("markup help","# First level heading"),result:(0,o.Z)("h1",{},void 0,pgettext("markup help","First level heading"))}),Ae||(Ae=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Heading 2")),(0,o.Z)(ct,{markup:pgettext("markup help","## Second level heading"),result:(0,o.Z)("h2",{},void 0,pgettext("markup help","Second level heading"))}),Be||(Be=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Heading 3")),(0,o.Z)(ct,{markup:pgettext("markup help","### Third level heading"),result:(0,o.Z)("h3",{},void 0,pgettext("markup help","Third level heading"))}),Ie||(Ie=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Heading 4")),(0,o.Z)(ct,{markup:pgettext("markup help","#### Fourth level heading"),result:(0,o.Z)("h4",{},void 0,pgettext("markup help","Fourth level heading"))}),De||(De=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Heading 5")),(0,o.Z)(ct,{markup:pgettext("markup help","##### Fifth level heading"),result:(0,o.Z)("h5",{},void 0,pgettext("markup help","Fifth level heading"))}),je||(je=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Unordered list")),ze||(ze=(0,o.Z)(ct,{markup:"- Lorem ipsum\n- Dolor met\n- Vulputate lectus",result:(0,o.Z)("ul",{},void 0,(0,o.Z)("li",{},void 0,"Lorem ipsum"),(0,o.Z)("li",{},void 0,"Dolor met"),(0,o.Z)("li",{},void 0,"Vulputate lectus"))})),Ue||(Ue=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Ordered list")),Me||(Me=(0,o.Z)(ct,{markup:"1. Lorem ipsum\n2. Dolor met\n3. Vulputate lectus",result:(0,o.Z)("ol",{},void 0,(0,o.Z)("li",{},void 0,"Lorem ipsum"),(0,o.Z)("li",{},void 0,"Dolor met"),(0,o.Z)("li",{},void 0,"Vulputate lectus"))})),qe||(qe=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Quote text")),(0,o.Z)(ct,{markup:"> "+pgettext("markup help","Quoted text"),result:(0,o.Z)("blockquote",{},void 0,(0,o.Z)("p",{},void 0,pgettext("markup help","Quoted text")))}),He||(He=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Quote text (BBCode)")),(0,o.Z)(ct,{markup:"[quote]\n"+pgettext("markup help","Quoted text")+"\n[/quote]",result:(0,o.Z)("aside",{className:"quote-block"},void 0,(0,o.Z)("div",{className:"quote-heading"},void 0,gettext("Quoted message:")),(0,o.Z)("blockquote",{className:"quote-body"},void 0,(0,o.Z)("p",{},void 0,pgettext("markup help","Quoted text"))))}),Fe||(Fe=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Quote text with title (BBCode)")),(0,o.Z)(ct,{markup:'[quote="'+pgettext("markup help","Quote title")+'"]\n'+pgettext("markup help","Quoted text")+"\n[/quote]",result:(0,o.Z)("aside",{className:"quote-block"},void 0,(0,o.Z)("div",{className:"quote-heading"},void 0,gettext("Quote title has written:")),(0,o.Z)("blockquote",{className:"quote-body"},void 0,(0,o.Z)("p",{},void 0,pgettext("markup help","Quoted text"))))}),Ye||(Ye=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Spoiler")),(0,o.Z)(ct,{markup:"[spoiler]\n"+pgettext("markup help","Secret text")+"\n[/spoiler]",result:(0,o.Z)(dt,{},void 0,pgettext("markup help","Secret text"))}),Ve||(Ve=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Inline code")),(0,o.Z)(ct,{markup:pgettext("markup help","`Inline code`"),result:(0,o.Z)("p",{},void 0,(0,o.Z)("code",{},void 0,pgettext("markup help","Inline code")))}),Ge||(Ge=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Code block")),$e||($e=(0,o.Z)(ct,{markup:'```\nalert("Hello world!");\n```',result:(0,o.Z)("pre",{},void 0,(0,o.Z)("code",{className:"hljs"},void 0,'alert("Hello world!");'))})),We||(We=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Code block with syntax highlighting")),Qe||(Qe=(0,o.Z)(ct,{markup:'```python\nprint("Hello world!");\n```',result:(0,o.Z)("pre",{},void 0,(0,o.Z)("code",{className:"hljs language-python"},void 0,(0,o.Z)("span",{className:"hljs-built_in"},void 0,"print"),'("Hello world!");'))})),Ke||(Ke=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Code block (BBCode)")),Je||(Je=(0,o.Z)(ct,{markup:'[code]\nalert("Hello world!");\n[/code]',result:(0,o.Z)("pre",{},void 0,(0,o.Z)("code",{className:"hljs"},void 0,'alert("Hello world!");'))})),Xe||(Xe=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Code block with syntax highlighting (BBCode)")),et||(et=(0,o.Z)(ct,{markup:'[code="python"]\nprint("Hello world!");\n[/code]',result:(0,o.Z)("pre",{},void 0,(0,o.Z)("code",{className:"hljs language-python"},void 0,(0,o.Z)("span",{className:"hljs-built_in"},void 0,"print"),'("Hello world!");'))})),tt||(tt=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Horizontal rule")),nt||(nt=(0,o.Z)(ct,{markup:"Lorem ipsum\n- - -\nDolor met",result:(0,o.Z)("div",{},void 0,(0,o.Z)("p",{},void 0,"Lorem ipsum"),(0,o.Z)("hr",{}),(0,o.Z)("p",{},void 0,"Dolor met"))})),at||(at=(0,o.Z)("hr",{})),(0,o.Z)("h4",{},void 0,pgettext("markup help","Horizontal rule (BBCode)")),it||(it=(0,o.Z)(ct,{markup:"Lorem ipsum\n[hr]\nDolor met",result:(0,o.Z)("div",{},void 0,(0,o.Z)("p",{},void 0,"Lorem ipsum"),(0,o.Z)("hr",{}),(0,o.Z)("p",{},void 0,"Dolor met"))}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,pgettext("modal","Close")))))}function ct(e){var t=e.markup,n=e.result;return(0,o.Z)("div",{className:"formatting-help-item"},void 0,(0,o.Z)("div",{className:"formatting-help-item-markup"},void 0,(0,o.Z)("pre",{},void 0,(0,o.Z)("code",{},void 0,t))),(0,o.Z)("div",{className:"formatting-help-item-preview"},void 0,(0,o.Z)("article",{className:"misago-markup"},void 0,n)))}var ut,dt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=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,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),(t=a.call(this,e)).state={reveal:!1},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,o.Z)("aside",{className:this.state.reveal?"spoiler-block revealed":"spoiler-block"},void 0,(0,o.Z)("blockquote",{className:"spoiler-body"},void 0,(0,o.Z)("p",{},void 0,this.props.children)),!this.state.reveal&&(0,o.Z)("div",{className:"spoiler-overlay"},void 0,(0,o.Z)("button",{className:"spoiler-reveal",type:"button",onClick:function(){e.setState({reveal:!0})}},void 0,gettext("Reveal spoiler"))))}}]),i}(s().Component),pt=n(19755),ht=new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*(\\?[;&a-z\\d%_.~+=-]*)?(\\#[-a-z\\d_]*)?$","i");function vt(e){return ht.test(pt.trim(e))}var ft,mt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=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,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSubmit",(function(e){e.preventDefault();var n=t.props,a=n.selection,i=n.update,s=t.state.text.trim(),o=t.state.url.trim();return 0===o.length?(t.setState({error:gettext("This field is required.")}),!1):vt(o)?(s.length>0?oe(a,i,"!["+s+"]("+o+")"):oe(a,i,"!("+o+")"),Q.Z.hide(),!1):(t.setState({error:gettext("Enter a valid address.")}),!1)}));var n=e.selection.text.trim(),s=vt(n);return t.state={error:null,text:s?"":n,url:s?n:""},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,o.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ut||(ut=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Image"))),(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(he.Z,{for:"markup_link_url",label:pgettext("markup editor","Image description"),helpText:pgettext("markup editor","Optional but recommended . Will be displayed instead of image when it fails to load.")},void 0,(0,o.Z)("input",{id:"markup_link_text",className:"form-control",type:"text",value:this.state.text,onChange:function(t){return e.setState({text:t.target.value})}})),(0,o.Z)(he.Z,{for:"markup_link_url",label:pgettext("markup editor","Image address"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,o.Z)("input",{id:"markup_link_url",className:"form-control",type:"text",value:this.state.url,onChange:function(t){return e.setState({url:t.target.value})}}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert image"))))))}}]),i}(s().Component);var Zt,gt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=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,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSubmit",(function(e){e.preventDefault();var n=t.props,a=n.selection,i=n.update,s=t.state.text.trim(),o=t.state.url.trim();return 0===o.length?(t.setState({error:gettext("This field is required.")}),!1):vt(o)?(s.length>0?oe(a,i,"["+s+"]("+o+")"):oe(a,i,"<"+o+">"),Q.Z.hide(),!1):(t.setState({error:gettext("Enter a valid address.")}),!1)}));var n=e.selection.text.trim(),s=vt(n);return t.state={error:null,text:s?"":n,url:s?n:""},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,o.Z)("div",{className:"modal-dialog",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,ft||(ft=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Link"))),(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(he.Z,{for:"markup_link_url",label:pgettext("markup editor","Link text"),helpText:pgettext("markup editor","Optional. Will be displayed instead of link's address.")},void 0,(0,o.Z)("input",{id:"markup_link_text",className:"form-control",type:"text",value:this.state.text,onChange:function(t){return e.setState({text:t.target.value})}})),(0,o.Z)(he.Z,{for:"markup_link_url",label:pgettext("markup editor","Link address"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,o.Z)("input",{id:"markup_link_url",className:"form-control",type:"text",value:this.state.url,onChange:function(t){return e.setState({url:t.target.value})}}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert link"))))))}}]),i}(s().Component);var yt,bt,_t=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=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,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"handleSubmit",(function(e){e.preventDefault();var n=t.props,a=n.selection,i=n.update,s=t.state.author.trim(),o=t.state.text.trim();if(0===o.length)return t.setState({error:gettext("This field is required.")}),!1;var r=a.prefix.trim().length?"\n\n":"";return oe(a,i,s?r+'[quote="'+s+'"]\n'+o+"\n[/quote]\n\n":r+"[quote]\n"+o+"\n[/quote]\n\n"),Q.Z.hide(),!1})),t.state={error:null,author:"",text:e.selection.text},t}return(0,r.Z)(i,[{key:"render",value:function(){var e=this;return(0,o.Z)("div",{className:"modal-dialog modal-lg",role:"document"},void 0,(0,o.Z)("div",{className:"modal-content"},void 0,(0,o.Z)("div",{className:"modal-header"},void 0,(0,o.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,Zt||(Zt=(0,o.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,o.Z)("h4",{className:"modal-title"},void 0,pgettext("markup editor","Quote"))),(0,o.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,o.Z)("div",{className:"modal-body"},void 0,(0,o.Z)(he.Z,{for:"markup_quote_author",label:pgettext("markup editor","Quote's author or source"),helpText:pgettext("markup editor",'Optional. If it\'s username, put "@" before it ("@JohnDoe").')},void 0,(0,o.Z)("input",{id:"markup_quote_author",className:"form-control",type:"text",value:this.state.author,onChange:function(t){return e.setState({author:t.target.value})}})),(0,o.Z)(he.Z,{for:"markup_quote_text",label:pgettext("markup editor","Quoted text"),validation:this.state.error?[this.state.error]:void 0},void 0,(0,o.Z)("textarea",{id:"markup_quote_text",className:"form-control",rows:"8",value:this.state.text,onChange:function(t){return e.setState({text:t.target.value})}}))),(0,o.Z)("div",{className:"modal-footer"},void 0,(0,o.Z)("button",{className:"btn btn-default","data-dismiss":"modal",type:"button"},void 0,gettext("Cancel")),(0,o.Z)("button",{className:"btn btn-primary"},void 0,pgettext("markup editor","Insert quote"))))))}}]),i}(s().Component),Nt=function(e){var t=e.disabled,n=e.icon,a=e.title,i=e.onClick;return(0,o.Z)("button",{className:"btn btn-markup-editor",title:a,type:"button",disabled:t,onClick:i},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,n))},kt="12345678990abcdefghijklmnopqrstuvwxyz",xt=kt.length,wt=function(e){for(var t=[],n=0;nn)Y.Z.error(interpolate(pgettext("markup editor","File %(filename)s is bigger than %(limit)s."),{filename:e.name,limit:(0,K.Z)(n)},!0));else{var a={id:null,key:wt(32),error:null,uploaded_on:null,progress:0,filename:e.name,filetype:null,is_image:!1,size:e.size,url:null,uploader_name:null};t((function(e){var t=e.attachments;return{attachments:[a].concat(t)}}));var i=function(){t((function(e){return{attachments:e.attachments.concat()}}))},s=new FormData;s.append("upload",e),F.Z.upload($.Z.get("ATTACHMENTS_API"),s,(function(e){a.progress=e,i()})).then((function(e){Object.assign(a,e,{uploaded_on:U()(e.uploaded_on)}),i()}),(function(e){400===e.status||413===e.status?(a.error=e.detail,Y.Z.error(e.detail),i()):Y.Z.apiError(e)}))}},Ct=function(e){var t=e.disabled,n=e.element,a=e.update,i=e.updateAttachments,s=[{name:pgettext("markup editor","Strong"),icon:"format_bold",onClick:function(){se(re(n),a,"**","**",pgettext("example markup","Strong text"))}},{name:pgettext("markup editor","Emphasis"),icon:"format_italic",onClick:function(){se(re(n),a,"*","*",pgettext("example markup","Text with emphasis"))}},{name:pgettext("markup editor","Strikethrough"),icon:"format_strikethrough",onClick:function(){se(re(n),a,"~~","~~",pgettext("example markup","Text with strikethrough"))}},{name:pgettext("markup editor","Horizontal ruler"),icon:"remove",onClick:function(){oe(re(n),a,"\n\n- - -\n\n")}},{name:pgettext("markup editor","Link"),icon:"insert_link",onClick:function(){var e=re(n);Q.Z.show((0,o.Z)(gt,{selection:e,element:n,update:a}))}},{name:pgettext("markup editor","Image"),icon:"insert_photo",onClick:function(){var e=re(n);Q.Z.show((0,o.Z)(mt,{selection:e,element:n,update:a}))}},{name:pgettext("markup editor","Quote"),icon:"format_quote",onClick:function(){var e=re(n);Q.Z.show((0,o.Z)(_t,{selection:e,element:n,update:a}))}},{name:pgettext("markup editor","Spoiler"),icon:"visibility_off",onClick:function(){!function(e,t){var n=re(e),a=n.prefix.trim().length?"\n\n":"";se(n,t,a+"[spoiler]\n","\n[/spoiler]\n\n",pgettext("markup editor","Spoiler text"))}(n,a)}},{name:pgettext("markup editor","Code"),icon:"code",onClick:function(){var e=re(n);Q.Z.show((0,o.Z)(rt,{selection:e,element:n,update:a}))}}];return $.Z.get("user").acl.max_attachment_size&&s.push({name:pgettext("markup editor","Upload file"),icon:"file_upload",onClick:function(){return e=i,(t=document.createElement("input")).type="file",t.multiple="multiple",t.addEventListener("change",(function(){for(var n=0;n${username}',insertTpl:"@${username}",searchKey:"username",callbacks:{remoteFilter:function(e,t){St.getJSON($.Z.get("MENTION_API"),{q:e},t)}}}),St(t).on("inserted.atwho",(function(t,n,a){e.onChange(t)}))}(t.props,e))},onChange:t.props.onChange,onDrop:t.onDrop,onFocus:function(){return t.setState({focused:!0})},onPaste:t.onPaste,onBlur:function(){return t.setState({focused:!1})}}),t.props.attachments.length>0&&(0,o.Z)(ue,{attachments:t.props.attachments,disabled:t.props.disabled||t.state.preview,element:t.state.element,setState:t.props.onAttachmentsChange,update:function(e){return t.props.onChange({target:{value:e}})}}),(0,o.Z)(pe,{preview:t.state.preview,canProtect:t.props.canProtect,isProtected:t.props.isProtected,disabled:t.props.disabled,empty:t.props.value.trim().length<$.Z.get("SETTINGS").post_length_min||t.state.loading,enableProtection:t.props.enableProtection,disableProtection:t.props.disableProtection,showPreview:t.showPreview,closePreview:t.closePreview,submitText:t.props.submitText}))})),t.state={element:null,focused:!1,loading:!1,preview:!1,parsed:null},t}return(0,r.Z)(i)}(s().Component),Pt=n(92490);var Lt,Tt,Ot,At,Bt,It,Dt,jt,zt,Ut,Mt,qt,Ht,Ft,Yt,Vt="posting-active",Gt="posting-default",$t="posting-minimized",Wt="posting-fullscreen",Qt=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=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,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(){return(0,l.Z)(this,i),a.apply(this,arguments)}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){document.body.classList.add(Vt,Gt)}},{key:"componentWillUnmount",value:function(){document.body.classList.remove(Vt,Gt,$t,Wt)}},{key:"componentWillReceiveProps",value:function(e){var t=e.fullscreen;e.minimized?(document.body.classList.remove(Gt,Wt),document.body.classList.add($t)):t?(document.body.classList.remove(Gt,$t),document.body.classList.add(Wt)):(document.body.classList.remove(Wt,$t),document.body.classList.add(Gt))}},{key:"render",value:function(){var e=this.props,t=e.children,n=e.fullscreen,a=e.minimized;return(0,o.Z)("div",{className:G()("posting-dialog",{"posting-dialog-minimized":a,"posting-dialog-fullscreen":n&&!a})},void 0,(0,o.Z)("div",{className:"posting-dialog-container"},void 0,t))}}]),i}(s().Component),Kt=Qt,Jt=function(e){var t=e.children;return(0,o.Z)("div",{className:"posting-dialog-body"},void 0,t)},Xt=function(e){var t=e.close,n=e.message;return(0,o.Z)("div",{className:"posting-dialog-error"},void 0,Lt||(Lt=(0,o.Z)("div",{className:"posting-dialog-error-icon"},void 0,(0,o.Z)("span",{className:"material-icon"},void 0,"error_outlined"))),(0,o.Z)("div",{className:"posting-dialog-error-detail"},void 0,(0,o.Z)("p",{},void 0,n),(0,o.Z)("button",{type:"button",className:"btn btn-default",onClick:t},void 0,pgettext("modal","Close"))))},en=function(e){var t=e.children,n=e.close,a=e.fullscreen,i=e.minimize,s=e.minimized,r=e.fullscreenEnter,l=e.fullscreenExit,c=e.open;return(0,o.Z)("div",{className:"posting-dialog-header"},void 0,(0,o.Z)("div",{className:"posting-dialog-caption"},void 0,t),s?(0,o.Z)("button",{className:"btn btn-posting-dialog",title:pgettext("dialog","Open"),type:"button",onClick:c},void 0,Tt||(Tt=(0,o.Z)("span",{className:"material-icon"},void 0,"expand_less"))):(0,o.Z)("button",{className:"btn btn-posting-dialog",title:pgettext("dialog","Minimize"),type:"button",onClick:i},void 0,Ot||(Ot=(0,o.Z)("span",{className:"material-icon"},void 0,"expand_more"))),a?(0,o.Z)("button",{className:"btn btn-posting-dialog hidden-xs",title:pgettext("dialog","Exit the fullscreen mode"),type:"button",onClick:l},void 0,At||(At=(0,o.Z)("span",{className:"material-icon"},void 0,"fullscreen_exit"))):(0,o.Z)("button",{className:"btn btn-posting-dialog hidden-xs",title:pgettext("dialog","Enter the fullscreen mode"),type:"button",onClick:r},void 0,Bt||(Bt=(0,o.Z)("span",{className:"material-icon"},void 0,"fullscreen"))),(0,o.Z)("button",{className:"btn btn-posting-dialog",title:pgettext("dialog","Cancel"),type:"button",onClick:n},void 0,It||(It=(0,o.Z)("span",{className:"material-icon"},void 0,"close"))))};function tn(e){var t=e.isClosed,n=e.isHidden,a=e.isPinned,i=e.disabled,s=e.options,r=e.close,l=e.open,c=e.hide,u=e.unhide,d=e.pinGlobally,p=e.pinLocally,h=e.unpin,v=function(e,t,n){var a=[];return 2===n&&a.push("bookmark"),1===n&&a.push("bookmark_outline"),e&&a.push("lock"),t&&a.push("visibility_off"),a}(t,n,a);return(0,o.Z)("div",{className:"dropdown"},void 0,(0,o.Z)("button",{className:"btn btn-default btn-outline btn-icon",title:pgettext("post thread","Options"),"aria-expanded":"true","aria-haspopup":"true","data-toggle":"dropdown",type:"button",disabled:i},void 0,v.length>0?(0,o.Z)("span",{className:"btn-icons-family"},void 0,v.map((function(e){return(0,o.Z)("span",{className:"material-icon"},e,e)}))):Dt||(Dt=(0,o.Z)("span",{className:"material-icon"},void 0,"more_horiz"))),(0,o.Z)("ul",{className:"dropdown-menu dropdown-menu-right stick-to-bottom"},void 0,2===s.pin&&2!==a&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:d,type:"button",disabled:i},void 0,jt||(jt=(0,o.Z)("span",{className:"material-icon"},void 0,"bookmark")),pgettext("post thread","Pinned globally"))),s.pin>=a&&1!==a&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:p,type:"button",disabled:i},void 0,zt||(zt=(0,o.Z)("span",{className:"material-icon"},void 0,"bookmark_outline")),pgettext("post thread","Pinned locally"))),s.pin>=a&&0!==a&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:h,type:"button",disabled:i},void 0,Ut||(Ut=(0,o.Z)("span",{className:"material-icon"},void 0,"radio_button_unchecked")),pgettext("post thread","Not pinned"))),s.close&&!!t&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:l,type:"button",disabled:i},void 0,Mt||(Mt=(0,o.Z)("span",{className:"material-icon"},void 0,"lock_outline")),pgettext("post thread","Open"))),s.close&&!t&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:r,type:"button",disabled:i},void 0,qt||(qt=(0,o.Z)("span",{className:"material-icon"},void 0,"lock")),pgettext("post thread","Closed"))),s.hide&&!!n&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:u,type:"button",disabled:i},void 0,Ht||(Ht=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility")),pgettext("post thread","Visible"))),s.hide&&!n&&(0,o.Z)("li",{},void 0,(0,o.Z)("button",{className:"btn btn-link",onClick:c,type:"button",disabled:i},void 0,Ft||(Ft=(0,o.Z)("span",{className:"material-icon"},void 0,"visibility_off")),pgettext("post thread","Hidden")))))}var nn=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=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,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"loadSuccess",(function(e){var n=null,a=null,i=e.map((function(e){return!1===e.post||n&&e.id!=t.state.category||(n=e.id,a=e.post),Object.assign(e,{disabled:!1===e.post,label:e.name,value:e.id})}));t.setState({isReady:!0,options:a,categories:i,category:n})})),(0,h.Z)((0,c.Z)(t),"loadError",(function(e){t.setState({error:e.detail})})),(0,h.Z)((0,c.Z)(t),"onCancel",(function(){window.confirm(pgettext("post thread","Are you sure you want to discard thread?"))&&(t.minimize(),v.Z.close())})),(0,h.Z)((0,c.Z)(t),"onTitleChange",(function(e){t.changeValue("title",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onCategoryChange",(function(e){var n=t.state.categories.find((function(t){return e.target.value==t.value})),a=t.state.pin;n.post.pin&&n.post.pin0}));return t.filter((function(e,n){return t.indexOf(e)==n}))}var on=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=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,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"onCancel",(function(){window.confirm(pgettext("post thread","Are you sure you want to discard private thread?"))&&t.close()})),(0,h.Z)((0,c.Z)(t),"onToChange",(function(e){t.changeValue("to",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onTitleChange",(function(e){t.changeValue("title",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onPostChange",(function(e){t.changeValue("post",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onAttachmentsChange",(function(e){t.setState(e)})),(0,h.Z)((0,c.Z)(t),"close",(function(){t.minimize(),v.Z.close()})),(0,h.Z)((0,c.Z)(t),"minimize",(function(){t.setState({fullscreen:!1,minimized:!0})})),(0,h.Z)((0,c.Z)(t),"open",(function(){t.setState({minimized:!1}),t.state.fullscreen})),(0,h.Z)((0,c.Z)(t),"fullscreenEnter",(function(){t.setState({fullscreen:!0,minimized:!1})})),(0,h.Z)((0,c.Z)(t),"fullscreenExit",(function(){t.setState({fullscreen:!1,minimized:!1})}));var n=(e.to||[]).map((function(e){return e.username})).join(", ");return t.state={isLoading:!1,error:null,minimized:!1,fullscreen:!1,to:n,title:"",post:"",attachments:[],validators:{title:(0,H.jn)(),post:(0,H.Jh)()},errors:{}},t}return(0,r.Z)(i,[{key:"clean",value:function(){if(!sn(this.state.to).length)return Y.Z.error(gettext("You have to enter at least one recipient.")),!1;if(!this.state.title.trim().length)return Y.Z.error(gettext("You have to enter thread title.")),!1;if(!this.state.post.trim().length)return Y.Z.error(gettext("You have to enter a message.")),!1;var e=this.validate();return e.title?(Y.Z.error(e.title[0]),!1):!e.post||(Y.Z.error(e.post[0]),!1)}},{key:"send",value:function(){return F.Z.post(this.props.submit,{to:sn(this.state.to),title:this.state.title,post:this.state.post,attachments:M(this.state.attachments)})}},{key:"handleSuccess",value:function(e){Y.Z.success(pgettext("post thread","Your thread has been posted.")),window.location=e.url,this.setState({isLoading:!0})}},{key:"handleError",value:function(e){if(400===e.status){var t=[].concat(e.non_field_errors||[],e.to||[],e.title||[],e.post||[],e.attachments||[]);Y.Z.error(t[0])}else Y.Z.apiError(e)}},{key:"render",value:function(){var e={minimized:this.state.minimized,minimize:this.minimize,open:this.open,fullscreen:this.state.fullscreen,fullscreenEnter:this.fullscreenEnter,fullscreenExit:this.fullscreenExit,close:this.onCancel};return s().createElement(rn,e,(0,o.Z)("form",{className:"posting-dialog-form",onSubmit:this.handleSubmit},void 0,(0,o.Z)(Pt.o8,{className:"posting-dialog-toolbar"},void 0,(0,o.Z)(Pt.Z2,{className:"posting-dialog-thread-recipients",auto:!0},void 0,(0,o.Z)(Pt.Eg,{auto:!0},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,onChange:this.onToChange,placeholder:pgettext("post thread","Recipients, eg.: Danny, Lisa, Alice"),type:"text",value:this.state.to}))),(0,o.Z)(Pt.Z2,{className:"posting-dialog-thread-title",auto:!0},void 0,(0,o.Z)(Pt.Eg,{auto:!0},void 0,(0,o.Z)("input",{className:"form-control",disabled:this.state.isLoading,onChange:this.onTitleChange,placeholder:pgettext("post thread","Thread title"),type:"text",value:this.state.title})))),(0,o.Z)(Et,{attachments:this.state.attachments,value:this.state.post,submitText:pgettext("post thread submit","Start thread"),disabled:this.state.isLoading,onAttachmentsChange:this.onAttachmentsChange,onChange:this.onPostChange})))}}]),i}(j.Z),rn=function(e){var t=e.children,n=e.close,a=e.minimized,i=e.minimize,s=e.open,r=e.fullscreen,l=e.fullscreenEnter,c=e.fullscreenExit;return(0,o.Z)(Kt,{fullscreen:r,minimized:a},void 0,(0,o.Z)(en,{fullscreen:r,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:s,close:n},void 0,pgettext("post thread","Start private thread")),(0,o.Z)(Jt,{},void 0,t))};var ln=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=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,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"loadSuccess",(function(e){t.setState({isReady:!0,post:e.post?'[quote="@'+e.poster+'"]\n'+e.post+"\n[/quote]":t.state.post})})),(0,h.Z)((0,c.Z)(t),"loadError",(function(e){t.setState({error:e.detail})})),(0,h.Z)((0,c.Z)(t),"appendData",(function(e){var n=e.post?'[quote="@'+e.poster+'"]\n'+e.post+"\n[/quote]\n\n":"";t.setState((function(e,t){return e.post.length>0?{post:e.post+"\n\n"+n}:{post:n}})),t.open()})),(0,h.Z)((0,c.Z)(t),"onCancel",(function(){window.confirm(pgettext("post reply","Are you sure you want to discard your reply?"))&&t.close()})),(0,h.Z)((0,c.Z)(t),"onPostChange",(function(e){t.changeValue("post",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onAttachmentsChange",(function(e){t.setState(e)})),(0,h.Z)((0,c.Z)(t),"onQuote",(function(e){t.setState((function(t){var n=t.post;return n.length>0?{post:n.trim()+"\n\n"+e}:{post:e}})),t.open()})),(0,h.Z)((0,c.Z)(t),"close",(function(){t.minimize(),v.Z.close()})),(0,h.Z)((0,c.Z)(t),"minimize",(function(){t.setState({fullscreen:!1,minimized:!0})})),(0,h.Z)((0,c.Z)(t),"open",(function(){t.setState({minimized:!1}),t.state.fullscreen})),(0,h.Z)((0,c.Z)(t),"fullscreenEnter",(function(){t.setState({fullscreen:!0,minimized:!1})})),(0,h.Z)((0,c.Z)(t),"fullscreenExit",(function(){t.setState({fullscreen:!1,minimized:!1})})),t.state={isReady:!1,isLoading:!1,error:null,minimized:!1,fullscreen:!1,post:t.props.default||"",attachments:[],validators:{post:(0,H.Jh)()},errors:{}},t}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){F.Z.get(this.props.config,this.props.context||null).then(this.loadSuccess,this.loadError),B(!1,this.onQuote)}},{key:"componentWillUnmount",value:function(){I()}},{key:"componentWillReceiveProps",value:function(e){var t=this.props.context,n=e.context;t&&n&&t.reply===n.reply||F.Z.get(e.config,e.context||null).then(this.appendData,Y.Z.apiError)}},{key:"clean",value:function(){if(!this.state.post.trim().length)return Y.Z.error(gettext("You have to enter a message.")),!1;var e=this.validate();return!e.post||(Y.Z.error(e.post[0]),!1)}},{key:"send",value:function(){return B(!0,this.onQuote),F.Z.post(this.props.submit,{post:this.state.post,attachments:M(this.state.attachments)})}},{key:"handleSuccess",value:function(e){Y.Z.success(pgettext("post reply","Your reply has been posted.")),window.location=e.url.index,this.setState({isLoading:!0}),B(!1,this.onQuote)}},{key:"handleError",value:function(e){if(400===e.status){var t=[].concat(e.non_field_errors||[],e.post||[],e.attachments||[]);Y.Z.error(t[0])}else Y.Z.apiError(e);B(!1,this.onQuote)}},{key:"render",value:function(){var e={thread:this.props.thread,minimized:this.state.minimized,minimize:this.minimize,open:this.open,fullscreen:this.state.fullscreen,fullscreenEnter:this.fullscreenEnter,fullscreenExit:this.fullscreenExit,close:this.onCancel};return this.state.error?s().createElement(cn,e,(0,o.Z)(Xt,{message:this.state.error,close:this.close})):this.state.isReady?s().createElement(cn,e,(0,o.Z)("form",{className:"posting-dialog-form",method:"POST",onSubmit:this.handleSubmit},void 0,(0,o.Z)(Et,{attachments:this.state.attachments,value:this.state.post,submitText:pgettext("post reply submit","Post reply"),disabled:this.state.isLoading,onAttachmentsChange:this.onAttachmentsChange,onChange:this.onPostChange}))):s().createElement(cn,e,(0,o.Z)("div",{className:"posting-loading ui-preview"},void 0,(0,o.Z)(Et,{attachments:[],value:"",submitText:pgettext("post reply submit","Post reply"),disabled:!0,onAttachmentsChange:function(){},onChange:function(){}})))}}]),i}(j.Z),cn=function(e){var t=e.children,n=e.close,a=e.minimized,i=e.minimize,s=e.open,r=e.fullscreen,l=e.fullscreenEnter,c=e.fullscreenExit,u=e.thread;return(0,o.Z)(Kt,{fullscreen:r,minimized:a},void 0,(0,o.Z)(en,{fullscreen:r,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:s,close:n},void 0,interpolate(pgettext("post reply","Reply to: %(thread)s"),{thread:u.title},!0)),(0,o.Z)(Jt,{},void 0,t))};var un=function(e){(0,u.Z)(i,e);var t,n,a=(t=i,n=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,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function i(e){var t;return(0,l.Z)(this,i),t=a.call(this,e),(0,h.Z)((0,c.Z)(t),"loadSuccess",(function(e){var n;t.setState({isReady:!0,post:e.post,attachments:(n=e.attachments,n.map((function(e){return Object.assign({},e,{uploaded_on:U()(e.uploaded_on)})}))),protect:e.is_protected,canProtect:e.can_protect})})),(0,h.Z)((0,c.Z)(t),"loadError",(function(e){t.setState({error:e.detail})})),(0,h.Z)((0,c.Z)(t),"appendData",(function(e){var n=e.post?'[quote="@'+e.poster+'"]\n'+e.post+"\n[/quote]\n\n":"";t.setState((function(e,t){return e.post.length>0?{post:e.post+"\n\n"+n}:{post:n}})),t.open()})),(0,h.Z)((0,c.Z)(t),"onCancel",(function(){window.confirm(gettext("Are you sure you want to discard changes?"))&&t.close()})),(0,h.Z)((0,c.Z)(t),"onProtect",(function(){t.setState({protect:!0})})),(0,h.Z)((0,c.Z)(t),"onUnprotect",(function(){t.setState({protect:!1})})),(0,h.Z)((0,c.Z)(t),"onPostChange",(function(e){t.changeValue("post",e.target.value)})),(0,h.Z)((0,c.Z)(t),"onAttachmentsChange",(function(e){t.setState(e)})),(0,h.Z)((0,c.Z)(t),"onQuote",(function(e){t.setState((function(t){var n=t.post;return n.length>0?{post:n.trim()+"\n\n"+e}:{post:e}})),t.open()})),(0,h.Z)((0,c.Z)(t),"close",(function(){t.minimize(),v.Z.close()})),(0,h.Z)((0,c.Z)(t),"minimize",(function(){t.setState({fullscreen:!1,minimized:!0})})),(0,h.Z)((0,c.Z)(t),"open",(function(){t.setState({minimized:!1}),t.state.fullscreen})),(0,h.Z)((0,c.Z)(t),"fullscreenEnter",(function(){t.setState({fullscreen:!0,minimized:!1})})),(0,h.Z)((0,c.Z)(t),"fullscreenExit",(function(){t.setState({fullscreen:!1,minimized:!1})})),t.state={isReady:!1,isLoading:!1,error:!1,minimized:!1,fullscreen:!1,post:"",attachments:[],protect:!1,canProtect:!1,validators:{post:(0,H.Jh)()},errors:{}},t}return(0,r.Z)(i,[{key:"componentDidMount",value:function(){F.Z.get(this.props.config).then(this.loadSuccess,this.loadError),B(!1,this.onQuote)}},{key:"componentWillUnmount",value:function(){I()}},{key:"componentWillReceiveProps",value:function(e){var t=this.props.context,n=e.context;t&&n&&t.reply===n.reply||F.Z.get(e.config,e.context||null).then(this.appendData,Y.Z.apiError)}},{key:"clean",value:function(){if(!this.state.post.trim().length)return Y.Z.error(gettext("You have to enter a message.")),!1;var e=this.validate();return!e.post||(Y.Z.error(e.post[0]),!1)}},{key:"send",value:function(){return B(!0,this.onQuote),F.Z.put(this.props.submit,{post:this.state.post,attachments:M(this.state.attachments),protect:this.state.protect})}},{key:"handleSuccess",value:function(e){Y.Z.success(gettext("Reply has been edited.")),window.location=e.url.index,this.setState({isLoading:!0}),B(!1,this.onQuote)}},{key:"handleError",value:function(e){if(400===e.status){var t=[].concat(e.non_field_errors||[],e.category||[],e.title||[],e.post||[],e.attachments||[]);Y.Z.error(t[0])}else Y.Z.apiError(e);B(!1,this.onQuote)}},{key:"render",value:function(){var e=this,t={post:this.props.post,minimized:this.state.minimized,minimize:this.minimize,open:this.open,fullscreen:this.state.fullscreen,fullscreenEnter:this.fullscreenEnter,fullscreenExit:this.fullscreenExit,close:this.onCancel};return this.state.error?s().createElement(dn,t,(0,o.Z)(Xt,{message:this.state.error,close:this.close})):this.state.isReady?s().createElement(dn,t,(0,o.Z)("form",{className:"posting-dialog-form",method:"POST",onSubmit:this.handleSubmit},void 0,(0,o.Z)(Et,{attachments:this.state.attachments,canProtect:this.state.canProtect,isProtected:this.state.protect,enableProtection:function(){return e.setState({protect:!0})},disableProtection:function(){return e.setState({protect:!1})},value:this.state.post,submitText:pgettext("edit reply submit","Edit reply"),disabled:this.state.isLoading,onAttachmentsChange:this.onAttachmentsChange,onChange:this.onPostChange}))):s().createElement(dn,t,(0,o.Z)("div",{className:"posting-loading ui-preview"},void 0,(0,o.Z)(Et,{attachments:[],value:"",submitText:pgettext("edit reply submit","Edit reply"),disabled:!0,onAttachmentsChange:function(){},onChange:function(){}})))}}]),i}(j.Z),dn=function(e){var t=e.children,n=e.close,a=e.minimized,i=e.minimize,s=e.open,r=e.fullscreen,l=e.fullscreenEnter,c=e.fullscreenExit,u=e.post;return(0,o.Z)(Kt,{fullscreen:r,minimized:a},void 0,(0,o.Z)(en,{fullscreen:r,fullscreenEnter:l,fullscreenExit:c,minimized:a,minimize:i,open:s,close:n},void 0,interpolate(pgettext("edit reply","Edit reply by %(poster)s from %(date)s"),{poster:u.poster?u.poster.username:u.poster_name,date:u.posted_on.fromNow()},!0)),(0,o.Z)(Jt,{},void 0,t))};function pn(e){switch(e.mode){case"START":return s().createElement(nn,e);case"START_PRIVATE":return s().createElement(on,e);case"REPLY":return s().createElement(ln,e);case"EDIT":return s().createElement(un,e);default:return null}}},12891:function(e,t,n){"use strict";n.d(t,{Jh:function(){return o},jn:function(){return s}});var a=n(55210),i=n(32233);function s(){return[(0,a.Ei)(i.Z.get("SETTINGS").thread_title_length_min,(function(e,t){var n=ngettext("Thread title should be at least %(limit_value)s character long (it has %(show_value)s).","Thread title should be at least %(limit_value)s characters long (it has %(show_value)s).",e);return interpolate(n,{limit_value:e,show_value:t},!0)})),(0,a.BS)(i.Z.get("SETTINGS").thread_title_length_max,(function(e,t){var n=ngettext("Thread title cannot be longer than %(limit_value)s character (it has %(show_value)s).","Thread title cannot be longer than %(limit_value)s characters (it has %(show_value)s).",e);return interpolate(n,{limit_value:e,show_value:t},!0)}))]}function o(){return i.Z.get("SETTINGS").post_length_max?[r(),(0,a.BS)(i.Z.get("SETTINGS").post_length_max||1e6,(function(e,t){var n=ngettext("Posted message cannot be longer than %(limit_value)s character (it has %(show_value)s).","Posted message cannot be longer than %(limit_value)s characters (it has %(show_value)s).",e);return interpolate(n,{limit_value:e,show_value:t},!0)}))]:[r()]}function r(){return(0,a.Ei)(i.Z.get("SETTINGS").post_length_min,(function(e,t){var n=ngettext("Posted message should be at least %(limit_value)s character long (it has %(show_value)s).","Posted message should be at least %(limit_value)s characters long (it has %(show_value)s).",e);return interpolate(n,{limit_value:e,show_value:t},!0)}))}},60471:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var a=n(22928),i=n(15671),s=n(43144),o=n(97326),r=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(57588);var p=function(e){(0,r.Z)(p,e);var t,n,d=(t=p,n=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,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function p(){var e;(0,i.Z)(this,p);for(var t=arguments.length,n=new Array(t),a=0;a'),e.append(''),e.find('input[type="hidden"]').val(v.Z.getCsrfToken()),e.find('input[name="redirect_to"]').val(window.location.pathname),e.find('input[name="username"]').val(this.state.username),e.find('input[name="password"]').val(this.state.password),e.submit(),this.setState({isLoading:!0})}},{key:"handleError",value:function(e){400===e.status?"inactive_admin"===e.code?m.Z.info(e.detail):"inactive_user"===e.code?(m.Z.info(e.detail),this.setState({showActivation:!0})):"banned"===e.code?((0,Z.Z)(e.detail),f.Z.hide()):m.Z.error(e.detail):403===e.status&&e.ban?((0,Z.Z)(e.ban),f.Z.hide()):m.Z.apiError(e)}},{key:"getActivationButton",value:function(){return this.state.showActivation?(0,i.Z)("a",{className:"btn btn-success btn-block",href:u.Z.get("REQUEST_ACTIVATION_URL")},void 0,gettext("Activate account")):null}},{key:"render",value:function(){return(0,i.Z)("div",{className:"modal-dialog modal-sm modal-sign-in",role:"document"},void 0,(0,i.Z)("div",{className:"modal-content"},void 0,(0,i.Z)("div",{className:"modal-header"},void 0,(0,i.Z)("button",{"aria-label":pgettext("modal","Close"),className:"close","data-dismiss":"modal",type:"button"},void 0,a||(a=(0,i.Z)("span",{"aria-hidden":"true"},void 0,"×"))),(0,i.Z)("h4",{className:"modal-title"},void 0,gettext("Sign in"))),(0,i.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,i.Z)("div",{className:"modal-body"},void 0,(0,i.Z)(h.Z,{buttonLabel:gettext("Sign in with %(site)s"),formLabel:gettext("Or use your forum account:"),labelClassName:"text-center"}),(0,i.Z)("div",{className:"form-group"},void 0,(0,i.Z)("div",{className:"control-input"},void 0,(0,i.Z)("input",{className:"form-control input-lg",disabled:this.state.isLoading,id:"id_username",onChange:this.bindInput("username"),placeholder:gettext("Username or e-mail"),type:"text",value:this.state.username}))),(0,i.Z)("div",{className:"form-group"},void 0,(0,i.Z)("div",{className:"control-input"},void 0,(0,i.Z)("input",{className:"form-control input-lg",disabled:this.state.isLoading,id:"id_password",onChange:this.bindInput("password"),placeholder:gettext("Password"),type:"password",value:this.state.password})))),(0,i.Z)("div",{className:"modal-footer"},void 0,this.getActivationButton(),(0,i.Z)(d.Z,{className:"btn-primary btn-block",loading:this.state.isLoading},void 0,gettext("Sign in")),(0,i.Z)("a",{className:"btn btn-default btn-block",href:u.Z.get("FORGOTTEN_PASSWORD_URL")},void 0,gettext("Forgot password?"))))))}}]),y}(p.Z)},24678:function(e,t,n){"use strict";n.d(t,{Jj:function(){return h},ZP:function(){return p},pg:function(){return v}});var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120),c=n(57588),u=n.n(c);function d(e){var t=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}}();return function(){var n,a=(0,l.Z)(e);if(t){var i=(0,l.Z)(this).constructor;n=Reflect.construct(a,arguments,i)}else n=a.apply(this,arguments);return(0,r.Z)(this,n)}}var p=function(e){(0,o.Z)(n,e);var t=d(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,s.Z)(n,[{key:"getClass",value:function(){return e=this.props.status,t="",e.is_banned?t="banned":e.is_hidden?t="offline":e.is_online_hidden?t="online":e.is_offline_hidden?t="offline":e.is_online?t="online":e.is_offline&&(t="offline"),"user-status user-"+t;var e,t}},{key:"render",value:function(){return(0,a.Z)("span",{className:this.getClass()},void 0,this.props.children)}}]),n}(u().Component),h=function(e){(0,o.Z)(n,e);var t=d(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,s.Z)(n,[{key:"getIcon",value:function(){return this.props.status.is_banned?"remove_circle_outline":this.props.status.is_hidden?"help_outline":this.props.status.is_online_hidden?"label":this.props.status.is_offline_hidden?"label_outline":this.props.status.is_online?"lens":this.props.status.is_offline?"panorama_fish_eye":void 0}},{key:"render",value:function(){return(0,a.Z)("span",{className:"material-icon status-icon"},void 0,this.getIcon())}}]),n}(u().Component),v=function(e){(0,o.Z)(n,e);var t=d(n);function n(){return(0,i.Z)(this,n),t.apply(this,arguments)}return(0,s.Z)(n,[{key:"getHelp",value:function(){return e=this.props.user,(t=this.props.status).is_banned?t.banned_until?interpolate(gettext("%(username)s is banned until %(ban_expires)s"),{username:e.username,ban_expires:t.banned_until.format("LL, LT")},!0):interpolate(gettext("%(username)s is banned"),{username:e.username},!0):t.is_hidden?interpolate(gettext("%(username)s is hiding presence"),{username:e.username},!0):t.is_online_hidden?interpolate(gettext("%(username)s is online (hidden)"),{username:e.username},!0):t.is_offline_hidden?interpolate(gettext("%(username)s was last seen %(last_click)s (hidden)"),{username:e.username,last_click:t.last_click.fromNow()},!0):t.is_online?interpolate(gettext("%(username)s is online"),{username:e.username},!0):t.is_offline?interpolate(gettext("%(username)s was last seen %(last_click)s"),{username:e.username,last_click:t.last_click.fromNow()},!0):void 0;var e,t}},{key:"getLabel",value:function(){return this.props.status.is_banned?gettext("Banned"):this.props.status.is_hidden?gettext("Hidden"):this.props.status.is_online_hidden?gettext("Online (hidden)"):this.props.status.is_offline_hidden?gettext("Offline (hidden)"):this.props.status.is_online?gettext("Online"):this.props.status.is_offline?gettext("Offline"):void 0}},{key:"render",value:function(){return(0,a.Z)("span",{className:this.props.className||"status-label",title:this.getHelp()},void 0,this.getLabel())}}]),n}(u().Component)},7850:function(e,t,n){"use strict";n.d(t,{Z:function(){return k}});var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120),c=n(57588),u=n.n(c);var d,p,h=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,n=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,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"getEmptyMessage",value:function(){return this.props.emptyMessage?this.props.emptyMessage:gettext("No name changes have been recorded for your account.")}},{key:"render",value:function(){return(0,a.Z)("div",{className:"username-history ui-ready"},void 0,(0,a.Z)("ul",{className:"list-group"},void 0,(0,a.Z)("li",{className:"list-group-item empty-message"},void 0,this.getEmptyMessage())))}}]),u}(u().Component),v=n(19605);var f=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,n=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,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"renderUserAvatar",value:function(){return this.props.change.changed_by?(0,a.Z)("a",{href:this.props.change.changed_by.url,className:"user-avatar-wrapper"},void 0,(0,a.Z)(v.ZP,{user:this.props.change.changed_by,size:"100"})):d||(d=(0,a.Z)("span",{className:"user-avatar-wrapper"},void 0,(0,a.Z)(v.ZP,{size:"100"})))}},{key:"renderUsername",value:function(){return this.props.change.changed_by?(0,a.Z)("a",{href:this.props.change.changed_by.url,className:"item-title"},void 0,this.props.change.changed_by.username):(0,a.Z)("span",{className:"item-title"},void 0,this.props.change.changed_by_username)}},{key:"render",value:function(){return(0,a.Z)("li",{className:"list-group-item"},this.props.change.id,(0,a.Z)("div",{className:"change-avatar"},void 0,this.renderUserAvatar()),(0,a.Z)("div",{className:"change-author"},void 0,this.renderUsername()),(0,a.Z)("div",{className:"change"},void 0,(0,a.Z)("span",{className:"old-username"},void 0,this.props.change.old_username),p||(p=(0,a.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),(0,a.Z)("span",{className:"new-username"},void 0,this.props.change.new_username)),(0,a.Z)("div",{className:"change-date"},void 0,(0,a.Z)("abbr",{title:this.props.change.changed_on.format("LLL")},void 0,this.props.change.changed_on.fromNow())))}}]),u}(u().Component);var m,Z,g=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,n=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,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"render",value:function(){return(0,a.Z)("div",{className:"username-history ui-ready"},void 0,(0,a.Z)("ul",{className:"list-group"},void 0,this.props.changes.map((function(e){return(0,a.Z)(f,{change:e},e.id)}))))}}]),u}(u().Component),y=n(44039);var b=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,n=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,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"getClassName",value:function(){return this.props.hiddenOnMobile?"list-group-item hidden-xs hidden-sm":"list-group-item"}},{key:"render",value:function(){return(0,a.Z)("li",{className:this.getClassName()},void 0,m||(m=(0,a.Z)("div",{className:"change-avatar"},void 0,(0,a.Z)("span",{className:"user-avatar"},void 0,(0,a.Z)(v.ZP,{size:"100"})))),(0,a.Z)("div",{className:"change-author"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:y.e(30,100)+"px"}},void 0," ")),(0,a.Z)("div",{className:"change"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:y.e(30,70)+"px"}},void 0," "),Z||(Z=(0,a.Z)("span",{className:"material-icon"},void 0,"arrow_forward")),(0,a.Z)("span",{className:"ui-preview-text",style:{width:y.e(30,70)+"px"}},void 0," ")),(0,a.Z)("div",{className:"change-date"},void 0,(0,a.Z)("span",{className:"ui-preview-text",style:{width:y.e(80,140)+"px"}},void 0," ")))}}]),u}(u().Component);var _,N=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,n=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,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){return(0,a.Z)("div",{className:"username-history ui-preview"},void 0,(0,a.Z)("ul",{className:"list-group"},void 0,[0,1,2].map((function(e){return(0,a.Z)(b,{hiddenOnMobile:e>0},e)}))))}}]),u}(u().Component);var k=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,n=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,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){return(0,i.Z)(this,u),c.apply(this,arguments)}return(0,s.Z)(u,[{key:"render",value:function(){return this.props.isLoaded?this.props.changes.length?(0,a.Z)(g,{changes:this.props.changes}):(0,a.Z)(h,{emptyMessage:this.props.emptyMessage}):_||(_=(0,a.Z)(N,{}))}}]),u}(u().Component)},40429:function(e,t,n){"use strict";n.d(t,{Z:function(){return P}});var a,i=n(22928),s=n(57588),o=n.n(s),r=n(19605),l=n(24678);function c(e){var t=e.showStatus,n=e.user;return(0,i.Z)("ul",{className:"list-unstyled"},void 0,(0,i.Z)(u,{showStatus:t,user:n}),(0,i.Z)(d,{user:n}),a||(a=(0,i.Z)("li",{className:"user-stat-divider"})),(0,i.Z)(p,{user:n}),(0,i.Z)(h,{user:n}),(0,i.Z)(v,{user:n}))}function u(e){var t=e.showStatus,n=e.user;return t?(0,i.Z)("li",{className:"user-stat-status"},void 0,(0,i.Z)(l.ZP,{status:n.status},void 0,(0,i.Z)(l.pg,{status:n.status,user:n}))):null}function d(e){var t=e.user.joined_on,n=interpolate(gettext("Joined on %(joined_on)s"),{joined_on:t.format("LL, LT")},!0),a=interpolate(gettext("Joined %(joined_on)s"),{joined_on:t.fromNow()},!0);return(0,i.Z)("li",{className:"user-stat-join-date"},void 0,(0,i.Z)("abbr",{title:n},void 0,a))}function p(e){var t=e.user,n=f("user-stat-posts",t.posts),a=ngettext("%(posts)s post","%(posts)s posts",t.posts);return(0,i.Z)("li",{className:n},void 0,interpolate(a,{posts:t.posts},!0))}function h(e){var t=e.user,n=f("user-stat-threads",t.threads),a=ngettext("%(threads)s thread","%(threads)s threads",t.threads);return(0,i.Z)("li",{className:n},void 0,interpolate(a,{threads:t.threads},!0))}function v(e){var t=e.user,n=f("user-stat-followers",t.followers),a=ngettext("%(followers)s follower","%(followers)s followers",t.followers);return(0,i.Z)("li",{className:n},void 0,interpolate(a,{followers:t.followers},!0))}function f(e,t){return 0===t?e+" user-stat-empty":e}function m(e){var t=e.rank,n=e.title||t.title||t.name,a="user-title";return t.css_class&&(a+=" user-title-"+t.css_class),t.is_tab?(0,i.Z)("a",{className:a,href:t.url},void 0,n):(0,i.Z)("span",{className:a},void 0,n)}function Z(e){var t=e.showStatus,n=e.user,a=n.rank,s="panel user-card";return a.css_class&&(s+=" user-card-"+a.css_class),(0,i.Z)("div",{className:s},void 0,(0,i.Z)("div",{className:"panel-body"},void 0,(0,i.Z)("div",{className:"row"},void 0,(0,i.Z)("div",{className:"col-xs-3 user-card-left"},void 0,(0,i.Z)("div",{className:"user-card-small-avatar"},void 0,(0,i.Z)("a",{href:n.url},void 0,(0,i.Z)(r.ZP,{size:"50",size2x:"80",user:n})))),(0,i.Z)("div",{className:"col-xs-9 col-sm-12 user-card-body"},void 0,(0,i.Z)("div",{className:"user-card-avatar"},void 0,(0,i.Z)("a",{href:n.url},void 0,(0,i.Z)(r.ZP,{size:"150",size2x:"200",user:n}))),(0,i.Z)("div",{className:"user-card-username"},void 0,(0,i.Z)("a",{href:n.url},void 0,n.username)),(0,i.Z)("div",{className:"user-card-title"},void 0,(0,i.Z)(m,{rank:a,title:n.title})),(0,i.Z)("div",{className:"user-card-stats"},void 0,(0,i.Z)(c,{showStatus:t,user:n}))))))}var g,y,b,_=n(15671),N=n(43144),k=n(79340),x=n(6215),w=n(61120),R=n(44039);var C,S=function(e){(0,k.Z)(s,e);var t,n,a=(t=s,n=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,a=(0,w.Z)(t);if(n){var i=(0,w.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,x.Z)(this,e)});function s(){return(0,_.Z)(this,s),a.apply(this,arguments)}return(0,N.Z)(s,[{key:"shouldComponentUpdate",value:function(){return!1}},{key:"render",value:function(){return(0,i.Z)("div",{className:"panel user-card user-card-preview"},void 0,(0,i.Z)("div",{className:"panel-body"},void 0,(0,i.Z)("div",{className:"row"},void 0,g||(g=(0,i.Z)("div",{className:"col-xs-3 user-card-left"},void 0,(0,i.Z)("div",{className:"user-card-small-avatar"},void 0,(0,i.Z)("span",{},void 0,(0,i.Z)(r.ZP,{size:"50",size2x:"80"}))))),(0,i.Z)("div",{className:"col-xs-9 col-sm-12 user-card-body"},void 0,y||(y=(0,i.Z)("div",{className:"user-card-avatar"},void 0,(0,i.Z)("span",{},void 0,(0,i.Z)(r.ZP,{size:"150",size2x:"200"})))),(0,i.Z)("div",{className:"user-card-username"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:R.e(60,150)+"px"}},void 0," ")),(0,i.Z)("div",{className:"user-card-title"},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:R.e(60,150)+"px"}},void 0," ")),(0,i.Z)("div",{className:"user-card-stats"},void 0,(0,i.Z)("ul",{className:"list-unstyled"},void 0,(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:R.e(30,70)+"px"}},void 0," ")),(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:R.e(30,70)+"px"}},void 0," ")),b||(b=(0,i.Z)("li",{className:"user-stat-divider"})),(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:R.e(30,70)+"px"}},void 0," ")),(0,i.Z)("li",{},void 0,(0,i.Z)("span",{className:"ui-preview-text",style:{width:R.e(30,70)+"px"}},void 0," "))))))))}}]),s}(o().Component);function E(e){var t=e.colClassName,n=e.cols,a=Array.apply(null,{length:n}).map(Number.call,Number);return(0,i.Z)("div",{className:"users-cards-list ui-preview"},void 0,(0,i.Z)("div",{className:"row"},void 0,a.map((function(e){var n=t;return 0!==e&&(n+=" hidden-xs"),3===e&&(n+=" hidden-sm"),(0,i.Z)("div",{className:n},e,C||(C=(0,i.Z)(S,{})))}))))}function P(e){var t=e.cols,n=e.isReady,a=e.showStatus,s=e.users,o="col-xs-12 col-sm-4";return 4===t&&(o+=" col-md-3"),n?(0,i.Z)("div",{className:"users-cards-list ui-ready"},void 0,(0,i.Z)("div",{className:"row"},void 0,s.map((function(e){return(0,i.Z)("div",{className:o},e.id,(0,i.Z)(Z,{showStatus:a,user:e}))})))):(0,i.Z)(E,{colClassName:o,cols:t})}},82125:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var a=n(15671),i=n(43144),s=n(97326),o=n(79340),r=n(6215),l=n(61120),c=n(4942),u=n(57588);var d=function(e){(0,o.Z)(d,e);var t,n,u=(t=d,n=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,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function d(e){var t;return(0,a.Z)(this,d),t=u.call(this,e),(0,c.Z)((0,s.Z)(t),"toggleNav",(function(){t.setState({dropdown:!t.state.dropdown})})),(0,c.Z)((0,s.Z)(t),"hideNav",(function(){t.setState({dropdown:!1})})),t.state={dropdown:!1},t}return(0,i.Z)(d,[{key:"getCompactNavClassName",value:function(){return this.state.dropdown?"compact-nav open":"compact-nav"}}]),d}(n.n(u)().Component)},7227:function(e,t,n){"use strict";n.d(t,{Z:function(){return p}});var a=n(22928),i=n(15671),s=n(43144),o=n(97326),r=n(79340),l=n(6215),c=n(61120),u=n(4942),d=n(57588);var p=function(e){(0,r.Z)(p,e);var t,n,d=(t=p,n=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,a=(0,c.Z)(t);if(n){var i=(0,c.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,l.Z)(this,e)});function p(){var e;(0,i.Z)(this,p);for(var t=arguments.length,n=new Array(t),a=0;a0&&t.length!==a.length;)s-=1,e.forEach(i);return n}}]),e}()),o=new(function(){function e(){(0,a.Z)(this,e),this._initializers=[],this._context={}}return(0,i.Z)(e,[{key:"addInitializer",value:function(e){this._initializers.push({key:e.name,item:e.initializer,after:e.after,before:e.before})}},{key:"init",value:function(e){var t=this;this._context=e,new s(this._initializers).orderedValues().forEach((function(e){e(t)}))}},{key:"has",value:function(e){return!!this._context[e]}},{key:"get",value:function(e,t){return this.has(e)?this._context[e]:t||void 0}},{key:"pop",value:function(e){if(this.has(e)){var t=this._context[e];return this._context[e]=null,t}}}]),e}());window.misago=o;var r=o},58339:function(e,t,n){"use strict";var a=n(32233),i=n(78657);a.Z.addInitializer({name:"ajax",initializer:function(){i.Z.init(a.Z.get("CSRF_COOKIE_NAME"))}})},64109:function(e,t,n){"use strict";var a=n(32233),i=n(35486),s=n(78657),o=n(53904),r=n(90287);a.Z.addInitializer({name:"auth-sync",initializer:function(e){e.get("isAuthenticated")&&window.setInterval((function(){s.Z.get(e.get("AUTH_API")).then((function(e){r.Z.dispatch((0,i.r$)(e))}),(function(e){o.Z.apiError(e)}))}),45e3)},after:"auth"})},46226:function(e,t,n){"use strict";var a=n(32233),i=n(98274),s=n(59801),o=n(90287),r=n(62833);a.Z.addInitializer({name:"auth",initializer:function(){i.Z.init(o.Z,r.Z,s.Z)},after:"store"})},93240:function(e,t,n){"use strict";var a=n(32233),i=n(78657),s=n(93825),o=n(96142),r=n(53904);a.Z.addInitializer({name:"captcha",initializer:function(e){s.ZP.init(e,i.Z,o.Z,r.Z)}})},75147:function(e,t,n){"use strict";var a=n(22928),i=n(57588),s=n.n(i),o=n(32233),r=n(15671),l=n(43144),c=n(97326),u=n(79340),d=n(6215),p=n(61120),h=n(4942),v=n(78657);var f=function(e){(0,u.Z)(s,e);var t,n,i=(t=s,n=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,a=(0,p.Z)(t);if(n){var i=(0,p.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,d.Z)(this,e)});function s(e){var t;return(0,r.Z)(this,s),t=i.call(this,e),(0,h.Z)((0,c.Z)(t),"handleDecline",(function(){t.state.submiting||window.confirm(gettext("Declining will result in immediate deactivation and deletion of your account. This action is not reversible."))&&(t.setState({submiting:!0}),v.Z.post(t.props.api,{accept:!1}).then((function(){window.location.reload(!0)})))})),(0,h.Z)((0,c.Z)(t),"handleAccept",(function(){t.state.submiting||(t.setState({submiting:!0}),v.Z.post(t.props.api,{accept:!0}).then((function(){window.location.reload(!0)})))})),t.state={submiting:!1},t}return(0,l.Z)(s,[{key:"render",value:function(){return(0,a.Z)("div",{},void 0,(0,a.Z)("button",{className:"btn btn-default",disabled:this.state.submiting,type:"buton",onClick:this.handleDecline},void 0,gettext("Decline")),(0,a.Z)("button",{className:"btn btn-primary",disabled:this.state.submiting,type:"buton",onClick:this.handleAccept},void 0,gettext("Accept and continue")))}}]),s}(s().Component),m=n(4869);o.Z.addInitializer({name:"component:accept-agreement",initializer:function(e){document.getElementById("required-agreement-mount")&&(0,m.Z)((0,a.Z)(f,{api:e.get("REQUIRED_AGREEMENT_API")}),"required-agreement-mount",!1)},after:"store"})},4894:function(e,t,n){"use strict";var a=n(37424),i=n(32233),s=n(22928),o=n(15671),r=n(43144),l=n(79340),c=n(6215),u=n(61120),d=n(57588);var p=function(e){(0,l.Z)(i,e);var t,n,a=(t=i,n=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,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function i(){return(0,o.Z)(this,i),a.apply(this,arguments)}return(0,r.Z)(i,[{key:"refresh",value:function(){window.location.reload()}},{key:"getMessage",value:function(){return this.props.signedIn?interpolate(gettext("You have signed in as %(username)s. Please refresh the page before continuing."),{username:this.props.signedIn.username},!0):this.props.signedOut?interpolate(gettext("%(username)s, you have been signed out. Please refresh the page before continuing."),{username:this.props.user.username},!0):void 0}},{key:"render",value:function(){var e="auth-message";return(this.props.signedIn||this.props.signedOut)&&(e+=" show"),(0,s.Z)("div",{className:e},void 0,(0,s.Z)("div",{className:"container"},void 0,(0,s.Z)("p",{className:"lead"},void 0,this.getMessage()),(0,s.Z)("p",{},void 0,(0,s.Z)("button",{className:"btn btn-default",type:"button",onClick:this.refresh},void 0,gettext("Reload page")),(0,s.Z)("span",{className:"hidden-xs hidden-sm"},void 0," "+gettext("or press F5 key.")))))}}]),i}(n.n(d)().Component);function h(e){return{user:e.auth.user,signedIn:e.auth.signedIn,signedOut:e.auth.signedOut}}var v=n(4869);i.Z.addInitializer({name:"component:auth-message",initializer:function(){(0,v.Z)((0,a.$j)(h)(p),"auth-message-mount")},after:"store"})},29223:function(e,t,n){"use strict";var a=n(32233),i=n(93051);a.Z.addInitializer({name:"component:banmed-page",initializer:function(e){e.has("BAN_MESSAGE")&&(0,i.Z)(e.get("BAN_MESSAGE"),!1)},after:"store"})},3026:function(e,t,n){"use strict";var a=n(37424),i=n(22928),s=n(15671),o=n(43144),r=n(97326),l=n(79340),c=n(6215),u=n(61120),d=n(4942),p=n(30381),h=n.n(p),v=n(57588),f=n.n(v);function m(e){return(0,i.Z)("div",{className:"categories-list"},void 0,(0,i.Z)("ul",{className:"list-group"},void 0,(0,i.Z)("li",{className:"list-group-item empty-message"},void 0,(0,i.Z)("p",{className:"lead"},void 0,gettext("No categories exist or you don't have permission to see them.")))))}function Z(e){var t=e.category;return t.description?(0,i.Z)("div",{className:"category-description",dangerouslySetInnerHTML:{__html:t.description.html}}):null}function g(e){var t=e.category;return(0,i.Z)("div",{className:y(t),title:b(t)},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,function(e){return e.is_closed?e.is_read?"lock_outline":"lock":e.is_read?"chat_bubble_outline":"chat_bubble"}(t)))}function y(e){return e.is_read?"read-status item-read":"read-status item-new"}function b(e){return e.is_closed?e.is_read?gettext("This category has no new posts. (closed)"):gettext("This category has new posts. (closed)"):e.is_read?gettext("This category has no new posts."):gettext("This category has new posts.")}function _(e){var t=e.category;return(0,i.Z)("div",{className:"col-xs-12 col-sm-6 col-md-6 category-main"},void 0,(0,i.Z)("div",{className:"media"},void 0,(0,i.Z)("div",{className:"media-left"},void 0,(0,i.Z)(g,{category:t})),(0,i.Z)("div",{className:"media-body"},void 0,(0,i.Z)("h4",{className:"media-heading"},void 0,(0,i.Z)("a",{href:t.url.index},void 0,t.name)),(0,i.Z)(Z,{category:t}))))}var N,k,x,w=n(19605);function R(e){var t=e.category;return(0,i.Z)("div",{className:"col-xs-12 col-sm-6 col-md-4 category-last-thread"},void 0,(0,i.Z)(C,{category:t}),(0,i.Z)(P,{category:t}),(0,i.Z)(L,{category:t}),(0,i.Z)(T,{category:t}))}function C(e){var t=e.category;return t.acl.can_browse&&t.acl.can_see_all_threads&&t.last_thread_title?(0,i.Z)("div",{className:"media"},void 0,(0,i.Z)("div",{className:"media-left hidden-xs"},void 0,(0,i.Z)(S,{category:t})),(0,i.Z)("div",{className:"media-body"},void 0,(0,i.Z)("div",{className:"media-heading"},void 0,(0,i.Z)("a",{className:"item-title thread-title",href:t.url.last_thread_new,title:t.last_thread_title},void 0,t.last_thread_title)),(0,i.Z)("ul",{className:"list-inline"},void 0,(0,i.Z)("li",{className:"category-last-thread-poster"},void 0,(0,i.Z)(E,{category:t})),N||(N=(0,i.Z)("li",{className:"divider"},void 0,"—")),(0,i.Z)("li",{className:"category-last-thread-date"},void 0,(0,i.Z)("a",{href:t.url.last_post},void 0,t.last_post_on.fromNow()))))):null}function S(e){var t=e.category;return t.last_poster?(0,i.Z)("a",{className:"last-poster-avatar",href:t.last_poster.url,title:t.last_poster_name},void 0,(0,i.Z)(w.ZP,{className:"media-object",size:40,user:t.last_poster})):(0,i.Z)("span",{className:"last-poster-avatar",title:t.last_poster_name},void 0,k||(k=(0,i.Z)(w.ZP,{className:"media-object",size:40})))}function E(e){var t=e.category;return t.last_poster?(0,i.Z)("a",{className:"item-title",href:t.last_poster.url},void 0,t.last_poster_name):(0,i.Z)("span",{className:"item-title"},void 0,t.last_poster_name)}function P(e){var t=e.category;return t.acl.can_browse&&t.acl.can_see_all_threads?t.last_thread_title?null:(0,i.Z)(O,{message:gettext("This category is empty. No threads were posted within it so far.")}):null}function L(e){var t=e.category;return t.acl.can_browse?t.acl.can_see_all_threads?null:(0,i.Z)(O,{message:gettext("This category is private. You can see only your own threads within it.")}):null}function T(e){return e.category.acl.can_browse?null:(0,i.Z)(O,{message:gettext("This category is protected. You can't browse its contents.")})}function O(e){var t=e.message;return(0,i.Z)("div",{className:"media category-thread-message"},void 0,x||(x=(0,i.Z)("div",{className:"media-left"},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,"info_outline"))),(0,i.Z)("div",{className:"media-body"},void 0,(0,i.Z)("p",{},void 0,t)))}function A(e){var t=e.category;return(0,i.Z)("div",{className:"col-md-2 hidden-xs hidden-sm"},void 0,(0,i.Z)("ul",{className:"list-unstyled category-stats"},void 0,(0,i.Z)(B,{threads:t.threads}),(0,i.Z)(I,{posts:t.posts})))}function B(e){var t=e.threads,n=ngettext("%(threads)s thread","%(threads)s threads",t);return(0,i.Z)("li",{className:"category-stat-threads"},void 0,interpolate(n,{threads:t},!0))}function I(e){var t=e.posts,n=ngettext("%(posts)s post","%(posts)s posts",t);return(0,i.Z)("li",{className:"category-stat-posts"},void 0,interpolate(n,{posts:t},!0))}function D(e){var t=e.category,n="btn btn-default btn-block btn-sm btn-subcategory";return t.is_read||(n+=" btn-subcategory-new"),(0,i.Z)("div",{className:"col-xs-12 col-sm-4 col-md-3"},void 0,(0,i.Z)("a",{className:n,href:t.url.index},void 0,(0,i.Z)("span",{className:"material-icon"},void 0,function(e){return e.is_closed?e.is_read?"lock_outline":"lock":e.is_read?"chat_bubble_outline":"chat_bubble"}(t)),(0,i.Z)("span",{className:"icon-text"},void 0,t.name)))}function j(e){var t=e.category;return e.isFirst||0===t.subcategories.length?null:(0,i.Z)("div",{className:"row subcategories-list"},void 0,t.subcategories.map((function(e){return(0,i.Z)(D,{category:e},e.id)})))}function z(e){var t=e.category,n=e.isFirst,a="list-group-item";return t.description?a+=" list-group-category-has-description":a+=" list-group-category-no-description",n&&(a+=" list-group-item-first"),t.css_class&&(a+=" list-group-category-has-flavor",a+=" list-group-item-category-"+t.css_class),(0,i.Z)("li",{className:a},void 0,(0,i.Z)("div",{className:"row"},void 0,(0,i.Z)(_,{category:t}),(0,i.Z)(A,{category:t}),(0,i.Z)(R,{category:t})),(0,i.Z)(j,{category:t,isFirst:n}))}function U(e){var t=e.category,n="list-group list-group-category";return t.css_class&&(n+=" list-group-category-has-flavor",n+=" list-group-category-"+t.css_class),(0,i.Z)("ul",{className:n},void 0,(0,i.Z)(z,{category:t,isFirst:!0}),t.subcategories.map((function(e){return(0,i.Z)(z,{category:e,isFirst:!1},e.id)})))}function M(e){var t=e.categories;return(0,i.Z)("div",{className:"categories-list"},void 0,t.map((function(e){return(0,i.Z)(U,{category:e},e.id)})))}var q,H=n(32233),F=n(55547);var Y=function e(t){return Object.assign({},t,{last_post_on:t.last_post_on?h()(t.last_post_on):null,subcategories:t.subcategories.map(e)})},V=function(e){(0,l.Z)(p,e);var t,n,a=(t=p,n=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,a=(0,u.Z)(t);if(n){var i=(0,u.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,c.Z)(this,e)});function p(e){var t;return(0,s.Z)(this,p),t=a.call(this,e),(0,d.Z)((0,r.Z)(t),"update",(function(e){t.setState({categories:e.map(Y)})})),t.state={categories:H.Z.get("CATEGORIES").map(Y)},t.startPolling(H.Z.get("CATEGORIES_API")),t}return(0,o.Z)(p,[{key:"startPolling",value:function(e){F.Z.start({poll:"categories",url:e,frequency:18e4,update:this.update})}},{key:"render",value:function(){var e=this.state.categories;return 0===e.length?q||(q=(0,i.Z)(m,{})):(0,i.Z)(M,{categories:e})}}]),p}(f().Component);function G(e){return{tick:e.tick.tick}}var $=n(4869);H.Z.addInitializer({name:"component:categories",initializer:function(){document.getElementById("categories-mount")&&(0,$.Z)((0,a.$j)(G)(V),"categories-mount")},after:"store"})},94795:function(e,t,n){"use strict";var a=n(22928),i=n(15671),s=n(43144),o=n(79340),r=n(6215),l=n(61120),c=n(57588),u=n.n(c),d=n(37424),p=n(69987),h=n(94417);function v(e){return(0,a.Z)("div",{className:"list-group nav-side"},void 0,e.options.map((function(t){return(0,a.Z)(p.rU,{to:e.baseUrl+t.component+"/",className:"list-group-item",activeClassName:"active"},t.component,(0,a.Z)("span",{className:"material-icon"},void 0,t.icon),t.name)})))}function f(e){return(0,a.Z)("ul",{className:e.className||"dropdown-menu",role:"menu"},void 0,e.options.map((function(t){return(0,a.Z)(h.Z,{path:e.baseUrl+t.component+"/"},t.component,(0,a.Z)(p.rU,{to:e.baseUrl+t.component+"/",onClick:e.hideNav},void 0,(0,a.Z)("span",{className:"material-icon hidden-sm"},void 0,t.icon),t.name))})))}var m,Z=n(97326),g=n(4942),y=n(82211),b=n(78657),_=n(53328),N=n(53904),k=n(90287),x=n(32233);var w=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,n=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,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(e){var t;return(0,i.Z)(this,u),t=c.call(this,e),(0,g.Z)((0,Z.Z)(t),"onPasswordChange",(function(e){t.setState({password:e.target.value})})),(0,g.Z)((0,Z.Z)(t),"handleSubmit",(function(e){e.preventDefault();var n=t.state,a=n.isLoading,i=n.password,s=t.props.user;return 0==i.length?(N.Z.error(gettext("Enter your password to confirm account deletion.")),!1):!a&&(t.setState({isLoading:!0}),void b.Z.post(s.api.delete,{password:i}).then((function(e){window.location.href=x.Z.get("MISAGO_PATH")}),(function(e){t.setState({isLoading:!1}),e.password?N.Z.error(e.password[0]):N.Z.apiError(e)})))})),t.state={isLoading:!1,password:""},t}return(0,s.Z)(u,[{key:"componentDidMount",value:function(){_.Z.set({title:gettext("Delete account"),parent:gettext("Change your options")})}},{key:"render",value:function(){return(0,a.Z)("form",{onSubmit:this.handleSubmit},void 0,(0,a.Z)("div",{className:"panel panel-danger panel-form"},void 0,(0,a.Z)("div",{className:"panel-heading"},void 0,(0,a.Z)("h3",{className:"panel-title"},void 0,gettext("Delete account"))),(0,a.Z)("div",{className:"panel-body"},void 0,(0,a.Z)("p",{className:"lead"},void 0,gettext("You are going to delete your account. This action is nonreversible, and will result in following data being deleted:")),(0,a.Z)("p",{},void 0,"-"," ",gettext("Stored IP addresses associated with content that you have posted will be deleted.")),(0,a.Z)("p",{},void 0,"-"," ",gettext("Your username will become available for other user to rename to or for new user to register their account with.")),(0,a.Z)("p",{},void 0,"-"," ",gettext("Your e-mail will become available for use in new account registration.")),m||(m=(0,a.Z)("hr",{})),(0,a.Z)("p",{},void 0,gettext("All your posted content will NOT be deleted, but username associated with it will be changed to one shared by all deleted accounts."))),(0,a.Z)("div",{className:"panel-footer"},void 0,(0,a.Z)("div",{className:"input-group"},void 0,(0,a.Z)("input",{className:"form-control",disabled:this.state.isLoading,name:"password-confirmation",type:"password",placeholder:gettext("Enter your password to confirm account deletion."),value:this.state.password,onChange:this.onPasswordChange}),(0,a.Z)("span",{className:"input-group-btn"},void 0,(0,a.Z)(y.Z,{className:"btn-danger",loading:this.state.isLoading},void 0,gettext("Delete my account")))))))}}]),u}(u().Component),R=n(21688);var C=function(e){(0,o.Z)(u,e);var t,n,c=(t=u,n=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,a=(0,l.Z)(t);if(n){var i=(0,l.Z)(this).constructor;e=Reflect.construct(a,arguments,i)}else e=a.apply(this,arguments);return(0,r.Z)(this,e)});function u(){var e;(0,i.Z)(this,u);for(var t=arguments.length,n=new Array(t),a=0;a