From 3b523e5542c98abdee08dcac805bf138f752af74 Mon Sep 17 00:00:00 2001 From: flarum-bot Date: Wed, 13 Oct 2021 18:58:05 +0000 Subject: [PATCH] Bundled output for commit 766dba39e29b0027ff0ee7d8845bbd300caa2f42 Includes transpiled JS/TS, and Typescript declaration files (typings). [skip ci] --- framework/core/js/dist/admin.js | 4 ++-- framework/core/js/dist/admin.js.map | 2 +- framework/core/js/dist/forum.js | 2 +- framework/core/js/dist/forum.js.map | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/framework/core/js/dist/admin.js b/framework/core/js/dist/admin.js index 1590b1c74..eda537918 100644 --- a/framework/core/js/dist/admin.js +++ b/framework/core/js/dist/admin.js @@ -1,4 +1,4 @@ -flarum.core=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=223)}([function(t,e,n){"use strict";var i=new(n(162).a);window.app=i,e.a=i},function(t,e,n){"use strict";function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var i=n(13),r=n(22),o=n(1),s=n(4);var a=n(7),c=n(10),u=n(9),l=n(15),d=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var n=e.prototype;return n.view=function(t){var e=this.attrs,n=e.type,o=e.title,s=e["aria-label"],a=e.icon,l=e.disabled,d=e.loading,h=e.className,f=e.class,p=Object(r.a)(e,["type","title","aria-label","icon","disabled","loading","className","class"]);n||(n="button"),s||(s=o),"object"==typeof s&&(s=Object(u.a)(s)),(l||d)&&delete p.onclick,h=Object(c.a)(f,h,{hasIcon:a,disabled:l||d,loading:d});var g=Object(i.a)({disabled:l,className:h,type:n,"aria-label":s},p);return m("button",g,this.getButtonContent(t.children))},n.oncreate=function(e){var n;t.prototype.oncreate.call(this,e),this.attrs["aria-label"]||Object(u.a)(e.children)||null!=(n=this.element)&&null!=n.getAttribute&&n.getAttribute("aria-label")||function(){var t;app.forum.attribute("debug")&&(t=console).warn.apply(t,arguments)}('[Flarum Accessibility Warning] Button has no content and no accessible label. This means that screen-readers will not be able to interpret its meaning and just read "Button". Consider providing accessible text via the `aria-label` attribute. https://web.dev/button-name',this.element)},n.getButtonContent=function(t){var e=this.attrs.icon;return[e&&Object(a.a)(e,{className:"Button-icon"}),t&&m("span",{className:"Button-label"},t),this.attrs.loading&&m(l.a,{size:"small",display:"inline"})]},e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=function(t,e){this.content=void 0,this.priority=void 0,this.key=void 0,this.content=t,this.priority=e},r=function(){function t(){this.items={}}var e=t.prototype;return e.isEmpty=function(){for(var t in this.items)if(this.items.hasOwnProperty(t))return!1;return!0},e.has=function(t){return!!this.items[t]},e.get=function(t){return this.items[t].content},e.add=function(t,e,n){return void 0===n&&(n=0),this.items[t]=new i(e,n),this},e.replace=function(t,e,n){return void 0===e&&(e=null),void 0===n&&(n=null),this.items[t]&&(null!==e&&(this.items[t].content=e),null!==n&&(this.items[t].priority=n)),this},e.remove=function(t){return delete this.items[t],this},e.merge=function(t){for(var e in t.items)t.items.hasOwnProperty(e)&&t.items[e]instanceof i&&(this.items[e]=t.items[e]);return this},e.toArray=function(){var t=[];for(var e in this.items)this.items.hasOwnProperty(e)&&this.items[e]instanceof i&&(this.items[e].content=Object(this.items[e].content),this.items[e].content.itemName=e,t.push(this.items[e]),this.items[e].key=t.length);return t.sort((function(t,e){return t.priority===e.priority?t.key-e.key:t.priority>e.priority?-1:1})).map((function(t){return t.content}))},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(){this.element=void 0,this.attrs=void 0,this.state=void 0}var e=t.prototype;return e.oninit=function(t){this.setAttrs(t.attrs)},e.oncreate=function(t){this.element=t.dom},e.onbeforeupdate=function(t){this.setAttrs(t.attrs)},e.onupdate=function(t){},e.onbeforeremove=function(t){},e.onremove=function(t){},e.$=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){var e=$(this.element);return t?e.find(t):e})),t.component=function(t,e){void 0===t&&(t={}),void 0===e&&(e=null);var n=Object.assign({},t);return m(this,n,e)},e.setAttrs=function(t){if(void 0===t&&(t={}),this.constructor.initAttrs(t),t){if("children"in t)throw new Error("["+this.constructor.name+'] The "children" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute');if("tag"in t)throw new Error("["+this.constructor.name+'] You cannot use the "tag" attribute name with Mithril 2.')}this.attrs=t},t.initAttrs=function(t){},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(6),r=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e=null),this.data=t,this.freshness=new Date,this.exists=!1,this.store=e}var e=t.prototype;return e.id=function(){return this.data.id},e.attribute=function(t){return this.data.attributes[t]},e.pushData=function(e){for(var n in e)if("object"==typeof e[n])for(var i in this.data[n]=this.data[n]||{},e[n])e[n][i]instanceof t&&(e[n][i]={data:t.getIdentifier(e[n][i])}),this.data[n][i]=e[n][i];else this.data[n]=e[n];this.freshness=new Date},e.pushAttributes=function(t){this.pushData({attributes:t})},e.save=function(e,n){var r=this;void 0===n&&(n={});var o={type:this.data.type,id:this.data.id,attributes:e};if(e.relationships){for(var s in o.relationships={},e.relationships){var a=e.relationships[s];o.relationships[s]={data:a instanceof Array?a.map(t.getIdentifier):t.getIdentifier(a)}}delete e.relationships}var c=this.copyData();this.pushData(o);var u={data:o};return n.meta&&(u.meta=n.meta),i.a.request(Object.assign({method:this.exists?"PATCH":"POST",url:i.a.forum.attribute("apiUrl")+this.apiEndpoint(),body:u},n)).then((function(t){return r.store.data[t.data.type]=r.store.data[t.data.type]||{},r.store.data[t.data.type][t.data.id]=r,r.store.pushPayload(t)}),(function(t){throw r.pushData(c),m.redraw(),t}))},e.delete=function(t,e){var n=this;return void 0===e&&(e={}),this.exists?i.a.request(Object.assign({method:"DELETE",url:i.a.forum.attribute("apiUrl")+this.apiEndpoint(),body:t},e)).then((function(){n.exists=!1,n.store.remove(n)})):Promise.resolve()},e.apiEndpoint=function(){return"/"+this.data.type+(this.exists?"/"+this.data.id:"")},e.copyData=function(){return JSON.parse(JSON.stringify(this.data))},t.attribute=function(t,e){return function(){var n=this.data.attributes&&this.data.attributes[t];return e?e(n):n}},t.hasOne=function(t){return function(){if(this.data.relationships){var e=this.data.relationships[t];if(e)return i.a.store.getById(e.data.type,e.data.id)}return!1}},t.hasMany=function(t){return function(){if(this.data.relationships){var e=this.data.relationships[t];if(e)return e.data.map((function(t){return i.a.store.getById(t.type,t.id)}))}return!1}},t.transformDate=function(t){return t?new Date(t):null},t.getIdentifier=function(t){return{type:t.data.type,id:t.data.id}},t}()},function(t,e,n){"use strict";var i=window,r=new Proxy({},{get:function(t,e){return Reflect.get(i.app,e,i.app)},set:function(t,e,n){return Reflect.set(i.app,e,n,i.app)}});e.a=r},function(t,e,n){"use strict";function i(t,e){return void 0===e&&(e={}),e.className="icon "+t+" "+(e.className||""),m("i",Object.assign({"aria-hidden":"true"},e))}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(24),r=n(10);function o(t){return t.tag===i.a}function s(t){return t instanceof Array||(t=[t]),function(t){var e,n=[];return t.filter(Boolean).forEach((function(i,r){(!o(i)||e&&!o(e)&&r!==t.length-1)&&(e=i,n.push(i))})),n}(t).map((function(t){var e=t.tag&&t.tag.isListItem,n=t.tag&&t.tag.isActive&&t.tag.isActive(t.attrs),i=t.attrs&&t.attrs.itemClassName||t.itemClassName;return e&&(t.attrs=t.attrs||{},t.attrs.key=t.attrs.key||t.itemName,t.key=t.attrs.key),e?t:m("li",{className:Object(r.a)([i,t.itemName&&"item-"+t.itemName,n&&"active"]),key:t.attrs&&t.attrs.key||t.itemName},t)}))}},function(t,e,n){"use strict";function i(t){return t instanceof Array?t.map((function(t){return i(t)})).join(""):"object"==typeof t&&null!==t?t.children?i(t.children):t.text:t}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";function i(t){var e,n,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;e$(window).scrollTop()+$(window).height()),t.offset().top<0&&t.removeClass("Dropdown-menu--top"),t.toggleClass("Dropdown-menu--right",e||t.offset().left+t.width()>$(window).scrollLeft()+$(window).width())})),this.$().on("hidden.bs.dropdown",(function(){n.showing=!1,n.attrs.onhide&&n.attrs.onhide(),m.redraw()}))},n.getButton=function(t){return m("button",{className:"Dropdown-toggle "+this.attrs.buttonClassName,"aria-haspopup":"menu","aria-label":this.attrs.accessibleToggleLabel,"data-toggle":"dropdown",onclick:this.attrs.onclick},this.getButtonContent(t))},n.getButtonContent=function(t){return[this.attrs.icon?Object(s.a)(this.attrs.icon,{className:"Button-icon"}):"",m("span",{className:"Button-label"},this.attrs.label),this.attrs.caretIcon?Object(s.a)(this.attrs.caretIcon,{className:"Button-caret"}):""]},n.getMenu=function(t){return m("ul",{className:"Dropdown-menu dropdown-menu "+this.attrs.menuClassName},t)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(6);function r(t){var e=t&&t.displayName()||i.a.translator.trans("core.lib.username.deleted_text");return m("span",{className:"username"},e)}},function(t,e,n){"use strict";var i=n(0),r=n(52),o=n(11),s=n(61),a=(n(207),function(){function t(){this.position=t.Position.HIDDEN,this.height=null,this.body={attrs:{}},this.editor=null,this.clear()}var e=t.prototype;return e.load=function(t,e){var n={componentClass:t,attrs:e};this.preventExit()||(this.isVisible()&&(this.clear(),m.redraw.sync()),this.body=n)},e.clear=function(){this.position=t.Position.HIDDEN,this.body={attrs:{}},this.onExit=null,this.fields={content:Object(o.a)("")},this.editor&&this.editor.destroy(),this.editor=null},e.show=function(){this.position!==t.Position.NORMAL&&this.position!==t.Position.FULLSCREEN&&(this.position=t.Position.NORMAL,m.redraw.sync())},e.hide=function(){this.clear(),m.redraw()},e.close=function(){this.preventExit()||this.hide()},e.minimize=function(){this.isVisible()&&(this.position=t.Position.MINIMIZED,m.redraw())},e.fullScreen=function(){this.isVisible()&&(this.position=t.Position.FULLSCREEN,m.redraw())},e.exitFullScreen=function(){this.position===t.Position.FULLSCREEN&&(this.position=t.Position.NORMAL,m.redraw())},e.bodyMatches=function(t,e){var n=this;return void 0===e&&(e={}),!!Object(r.a)(this.body.componentClass,t)&&Object.keys(e).every((function(t){return n.body.attrs[t]===e[t]}))},e.isVisible=function(){return this.position!==t.Position.HIDDEN},e.isFullScreen=function(){return this.position===t.Position.FULLSCREEN||"phone"===i.a.screen()},e.composingReplyTo=function(t){return this.isVisible()&&this.bodyMatches(s.a,{discussion:t})},e.preventExit=function(){if(this.isVisible()&&this.onExit)return this.onExit.callback()?!confirm(this.onExit.message):void 0},e.preventClosingWhen=function(t,e){this.onExit={callback:t,message:e}},e.minimumHeight=function(){return 200},e.maximumHeight=function(){return $(window).height()-$("#header").outerHeight()},e.computedHeight=function(){return this.position===t.Position.MINIMIZED?"":this.position===t.Position.FULLSCREEN?$(window).height():Math.max(this.minimumHeight(),Math.min(this.height,this.maximumHeight()))},t}());a.Position={HIDDEN:"hidden",NORMAL:"normal",MINIMIZED:"minimized",FULLSCREEN:"fullScreen"},e.a=a},function(t,e,n){"use strict";function i(t,e){if(null==t)return{};var n,i,r={},o=Object.keys(t);for(i=0;i=0||(r[n]=t[n]);return r}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var i=n(1),r=n(0),o=n(29),s=n(3),a=n(114),c=n(115),u=n(121),l=n(124),d=n(15),h=n(83),f=n(8),p=n(43),g=n(125),v=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.useBrowserScrollRestoration=!1,this.discussion=null,this.near=m.route.param("near")||0,this.load(),r.a.discussions.hasItems()&&(r.a.pane.enable(),r.a.pane.hide()),r.a.history.push("discussion"),this.bodyClass="App--discussion"},n.onremove=function(e){t.prototype.onremove.call(this,e),r.a.pane.disable(),r.a.composer.composingReplyTo(this.discussion)&&!r.a.composer.fields.content()?r.a.composer.hide():r.a.composer.minimize()},n.view=function(){return m("div",{className:"DiscussionPage"},m(c.a,{state:r.a.discussions}),m("div",{className:"DiscussionPage-discussion"},this.discussion?this.pageContent().toArray():this.loadingItems().toArray()))},n.loadingItems=function(){var t=new s.a;return t.add("spinner",m(d.a,null),100),t},n.sidebar=function(){return m("nav",{className:"DiscussionPage-nav"},m("ul",null,Object(f.a)(this.sidebarItems().toArray())))},n.hero=function(){return m(a.a,{discussion:this.discussion})},n.pageContent=function(){var t=new s.a;return t.add("hero",this.hero(),100),t.add("main",m("div",{className:"container"},this.mainContent().toArray()),10),t},n.mainContent=function(){var t=new s.a;return t.add("sidebar",this.sidebar(),100),t.add("poststream",m("div",{className:"DiscussionPage-stream"},u.a.component({discussion:this.discussion,stream:this.stream,onPositionChange:this.positionChanged.bind(this)})),10),t},n.load=function(){var t=r.a.preloadedApiDocument();if(t)setTimeout(this.show.bind(this,t),0);else{var e=this.requestParams();r.a.store.find("discussions",m.route.param("id"),e).then(this.show.bind(this))}m.redraw()},n.requestParams=function(){return{bySlug:!0,page:{near:this.near}}},n.show=function(t){var e=this;r.a.history.push("discussion",t.title()),r.a.setTitle(t.title()),r.a.setTitleCount(0);var n=[];if(t.payload&&t.payload.included){var i=t.id();n=t.payload.included.filter((function(t){return"posts"===t.type&&t.relationships&&t.relationships.discussion&&t.relationships.discussion.data.id===i})).map((function(t){return r.a.store.getById("posts",t.id)})).sort((function(t,e){return t.createdAt()-e.createdAt()})).slice(0,20)}this.stream=new g.a(t,n),this.stream.goToNumber(m.route.param("near")||n[0]&&n[0].number(),!0).then((function(){e.discussion=t,r.a.current.set("discussion",t),r.a.current.set("stream",e.stream)}))},n.sidebarItems=function(){var t=new s.a;return t.add("controls",h.a.component({icon:"fas fa-ellipsis-v",className:"App-primaryControl",buttonClassName:"Button--primary",accessibleToggleLabel:r.a.translator.trans("core.forum.discussion_controls.toggle_dropdown_accessible_label")},p.a.controls(this.discussion,this).toArray())),t.add("scrubber",l.a.component({stream:this.stream,className:"App-titleControl"}),-100),t},n.positionChanged=function(t,e){var n=this.discussion,i=r.a.route.discussion(n,this.near=t);window.history.replaceState(null,document.title,i),r.a.history.push("discussion",n.title()),r.a.session.user&&e>(n.lastReadPostNumber()||0)&&(n.save({lastReadPostNumber:e}),m.redraw())},e}(o.a)},function(t,e,n){"use strict";var i=n(1),r=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.prototype.view=function(){return m("li",{className:"Dropdown-separator"})},e}(n(4).a);r.isListItem=!0,e.a=r},function(t,e,n){"use strict";function i(t,e){var n=t[e];return delete t[e],n}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(33),r=n.n(i);function o(t){var e=r()(t),n=r()();e.isAfter(n)&&(e=n);return e.diff(r()())<-2592e6?e.year()===r()().year()?e.format("D MMM"):e.format("ll"):e.fromNow()}},function(t,e,n){"use strict";function i(){for(var t=arguments.length,e=new Array(t),n=0;n or .");var c=e[0];if("object"!=typeof c||Array.isArray(c)||null===c)throw new Error("Tooltip component was provided with no direct child DOM element. Tooltips must contain a single direct DOM node to attach to.");if("string"==typeof c.tag&&["#","[","<"].includes(c.tag))throw new Error('Tooltip component with provided with a vnode with tag "'+c.tag+'". This is not a DOM element, so is not a valid child element. Please wrap this vnode in another element, such as a
or .');return this.firstChild=c,e},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.checkDomNodeChanged(),this.recreateTooltip()},n.onupdate=function(e){t.prototype.onupdate.call(this,e),this.checkDomNodeChanged(),this.recreateTooltip()},n.recreateTooltip=function(){this.shouldRecreateTooltip&&null!==this.childDomNode&&($(this.childDomNode).tooltip("destroy","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"),this.createTooltip(),this.shouldRecreateTooltip=!1),this.shouldChangeTooltipVisibility&&(this.shouldChangeTooltipVisibility=!1,this.updateVisibility())},n.updateVisibility=function(){null!==this.childDomNode&&(!0===this.attrs.tooltipVisible?$(this.childDomNode).tooltip("show","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"):!1===this.attrs.tooltipVisible&&$(this.childDomNode).tooltip("hide","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"))},n.createTooltip=function(){if(null!==this.childDomNode){var t=this.attrs,e=t.showOnFocus,n=void 0===e||e,i=t.position,r=void 0===i?"top":i,o=t.delay,a=t.html,c=void 0!==a&&a,u=t.tooltipVisible,l=(t.text,"boolean"==typeof u?"manual":Object(s.a)("hover",[n&&"focus"])),d=this.getRealText();this.childDomNode.setAttribute("title",d),this.childDomNode.setAttribute("aria-label",d),$(this.childDomNode).tooltip({html:c,delay:o,placement:r,trigger:l},"DANGEROUS_tooltip_jquery_fn_deprecation_exempt")}},n.getRealText=function(){var t=this.attrs.text;return Array.isArray(t)?Object(a.a)(t):t},n.checkDomNodeChanged=function(){var t=this.firstChild.dom;t&&!t.isSameNode(this.childDomNode)&&(this.childDomNode=t,this.shouldRecreateTooltip=!0)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(6),o=n(4),s=n(73),a=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),r.a.previous=r.a.current,r.a.current=new s.a(this.constructor,{routeName:this.attrs.routeName}),r.a.drawer.hide(),r.a.modal.close(),this.bodyClass="",this.scrollTopOnCreate=!0,this.useBrowserScrollRestoration=!0},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.bodyClass&&$("#app").addClass(this.bodyClass),this.scrollTopOnCreate&&$(window).scrollTop(0),"scrollRestoration"in history&&(history.scrollRestoration=this.useBrowserScrollRestoration?"auto":"manual")},n.onremove=function(e){t.prototype.onremove.call(this,e),this.bodyClass&&$("#app").removeClass(this.bodyClass)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(38);function r(t,e,n){if(!e&&!n)return t;var r=e instanceof RegExp?e:new RegExp(e,"gi"),o=t,s=0;return n&&(e&&(s=Math.max(0,t.search(r)-n/2)),o=Object(i.truncate)(o,n,s)),o=$("
").text(o).html(),e&&(o=o.replace(r,"$&")),m.trust(o)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(1),r=n(4),o=n(2),s=n(8),a=n(25),c=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.prototype.view=function(t){var e=Object.assign({},this.attrs),n=Object(a.a)(e,"type");e.className="Alert Alert--"+n+" "+(e.className||"");var i=Object(a.a)(e,"content")||t.children,r=Object(a.a)(e,"controls")||[],c=Object(a.a)(e,"dismissible"),u=Object(a.a)(e,"ondismiss"),l=[];return(c||void 0===c)&&l.push(m(o.a,{icon:"fas fa-times",className:"Button Button--link Button--icon Alert-dismiss",onclick:u})),m("div",e,m("span",{className:"Alert-body"},i),m("ul",{className:"Alert-controls"},Object(s.a)(r.concat(l))))},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(19),o=n(7);function s(t){var e=t.tag;return("string"!=typeof e||"a"===e||"button"===e)&&("initAttrs"in e&&e.initAttrs(t.attrs),"isActive"in e?e.isActive(t.attrs):t.attrs.active)}var a=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.initAttrs=function(e){e.caretIcon=void 0!==e.caretIcon?e.caretIcon:"fas fa-sort",t.initAttrs.call(this,e),e.className+=" Dropdown--select"},e.prototype.getButtonContent=function(t){var e=t.find(s),n=e&&e.children||this.attrs.defaultLabel;return n instanceof Array&&(n=n[0]),[m("span",{className:"Button-label"},n),Object(o.a)(this.attrs.caretIcon,{className:"Button-caret"})]},e}(r.a)},function(t,e,n){t.exports=function(){"use strict";var t="millisecond",e="second",n="minute",i="hour",r="day",o="week",s="month",a="quarter",c="year",u="date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},f=function(t,e,n){var i=String(t);return!i||i.length>=e?t:""+Array(e+1-i.length).join(n)+t},p={s:f,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),i=Math.floor(n/60),r=n%60;return(e<=0?"+":"-")+f(i,2,"0")+":"+f(r,2,"0")},m:function t(e,n){if(e.date()0?"...":"")+t.substring(n,n+e)+(t.length>n+e?"...":"")}function r(t){return t.toLowerCase().replace(/[^a-z0-9]/gi,"-").replace(/-+/g,"-").replace(/-$|^-/g,"")}function o(t){var e=t.replace(/(<\/p>|
)/g,"$1  ").replace(/]*>/gi," "),n=$("
").html(e);return n.find(o.removeSelectors.join(",")).remove(),n.text().replace(/\s+/g," ").trim()}function s(t){return t.substr(0,1).toUpperCase()+t.substr(1)}n.r(e),n.d(e,"truncate",(function(){return i})),n.d(e,"slug",(function(){return r})),n.d(e,"getPlainContent",(function(){return o})),n.d(e,"ucfirst",(function(){return s})),o.removeSelectors=["blockquote","script"]},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(33),r=n.n(i),o=n(26);function s(t){var e=r()(t),n=e.format(),i=e.format("LLLL"),s=Object(o.a)(t);return m("time",{pubdate:!0,datetime:n,title:i,"data-humantime":!0},s)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},r=function(){function t(t){this.callback=t,this.ticking=!1}var e=t.prototype;return e.loop=function(){var t=this;this.ticking||(i((function(){t.update(),t.ticking=!1})),this.ticking=!0)},e.update=function(){this.callback(window.pageYOffset)},e.start=function(){this.active||window.addEventListener("scroll",this.active=this.loop.bind(this),{passive:!0})},e.stop=function(){window.removeEventListener("scroll",this.active),this.active=null},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(1),r=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.group&&(e.icon=e.group.icon(),e.color=e.group.color(),e.label=void 0===e.label?e.group.nameSingular():e.label,e.type="group--"+e.group.id(),delete e.group)},e}(n(34).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var i=n(1),r=n(0),o=n(4),s=n(116),a=n(2),c=n(15),u=n(55),l=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.prototype.view=function(){var t,e=this.attrs.state,n=e.getParams();if(e.isInitialLoading()||e.isLoadingNext()?t=m(c.a,null):e.hasNext()&&(t=a.a.component({className:"Button",onclick:e.loadNext.bind(e)},r.a.translator.trans("core.forum.discussion_list.load_more_button"))),e.isEmpty()){var i=r.a.translator.trans("core.forum.discussion_list.empty_text");return m("div",{className:"DiscussionList"},u.a.component({text:i}))}return m("div",{className:"DiscussionList"+(e.isSearchResults()?" DiscussionList--searchResults":"")},m("ul",{className:"DiscussionList-discussions"},e.getPages().map((function(t){return t.items.map((function(t){return m("li",{key:t.id(),"data-id":t.id()},s.a.component({discussion:t,params:n}))}))}))),m("div",{className:"DiscussionList-loadMore"},t))},e}(o.a)},function(t,e,n){"use strict";var i=n(0),r=n(23),o=n(61),s=n(35),a=n(2),c=n(24),u=n(119),l=n(3),d=n(9);e.a={controls:function(t,e){var n=this,i=new l.a;return["user","moderation","destructive"].forEach((function(r){var o=n[r+"Controls"](t,e).toArray();o.length&&(o.forEach((function(t){return i.add(t.itemName,t)})),i.add(r+"Separator",c.a.component()))})),i},userControls:function(t,e){var n=this,o=new l.a;return e instanceof r.a&&o.add("reply",!i.a.session.user||t.canReply()?a.a.component({icon:"fas fa-reply",onclick:function(){return n.replyAction.bind(t)(!0,!1).catch((function(){}))}},i.a.translator.trans(i.a.session.user?"core.forum.discussion_controls.reply_button":"core.forum.discussion_controls.log_in_to_reply_button")):a.a.component({icon:"fas fa-reply",className:"disabled",title:i.a.translator.trans("core.forum.discussion_controls.cannot_reply_text")},i.a.translator.trans("core.forum.discussion_controls.cannot_reply_button"))),o},moderationControls:function(t){var e=new l.a;return t.canRename()&&e.add("rename",a.a.component({icon:"fas fa-pencil-alt",onclick:this.renameAction.bind(t)},i.a.translator.trans("core.forum.discussion_controls.rename_button"))),e},destructiveControls:function(t){var e=new l.a;return t.isHidden()?(t.canHide()&&e.add("restore",a.a.component({icon:"fas fa-reply",onclick:this.restoreAction.bind(t)},i.a.translator.trans("core.forum.discussion_controls.restore_button"))),t.canDelete()&&e.add("delete",a.a.component({icon:"fas fa-times",onclick:this.deleteAction.bind(t)},i.a.translator.trans("core.forum.discussion_controls.delete_forever_button")))):t.canHide()&&e.add("hide",a.a.component({icon:"far fa-trash-alt",onclick:this.hideAction.bind(t)},i.a.translator.trans("core.forum.discussion_controls.delete_button"))),e},replyAction:function(t,e){var n=this;return new Promise((function(r,a){return i.a.session.user?n.canReply()?(i.a.composer.composingReplyTo(n)&&!e||i.a.composer.load(o.a,{user:i.a.session.user,discussion:n}),i.a.composer.show(),t&&i.a.viewingDiscussion(n)&&!i.a.composer.isFullScreen()&&i.a.current.get("stream").goToNumber("reply"),r(i.a.composer)):a():(i.a.modal.show(s.a),a())}))},hideAction:function(){return this.pushAttributes({hiddenAt:new Date,hiddenUser:i.a.session.user}),this.save({isHidden:!0})},restoreAction:function(){return this.pushAttributes({hiddenAt:null,hiddenUser:null}),this.save({isHidden:!1})},deleteAction:function(){var t=this;if(confirm(Object(d.a)(i.a.translator.trans("core.forum.discussion_controls.delete_confirmation"))))return i.a.viewingDiscussion(this)&&i.a.history.back(),this.delete().then((function(){return i.a.discussions.removeDiscussion(t)}))},renameAction:function(){return i.a.modal.show(u.a,{currentTitle:this.title(),discussion:this})}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var i=n(1),r=n(0),o=n(16),s=n(35),a=n(2),c=n(63),u=n(9),l=n(3),d=n(11),h=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.username=Object(d.a)(this.attrs.username||""),this.email=Object(d.a)(this.attrs.email||""),this.password=Object(d.a)(this.attrs.password||"")},n.className=function(){return"Modal--small SignUpModal"},n.title=function(){return r.a.translator.trans("core.forum.sign_up.title")},n.content=function(){return[m("div",{className:"Modal-body"},this.body()),m("div",{className:"Modal-footer"},this.footer())]},n.isProvided=function(t){return this.attrs.provided&&-1!==this.attrs.provided.indexOf(t)},n.body=function(){return[this.attrs.token?"":m(c.a,null),m("div",{className:"Form Form--centered"},this.fields().toArray())]},n.fields=function(){var t=new l.a;return t.add("username",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"username",type:"text",placeholder:Object(u.a)(r.a.translator.trans("core.forum.sign_up.username_placeholder")),bidi:this.username,disabled:this.loading||this.isProvided("username")})),30),t.add("email",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"email",type:"email",placeholder:Object(u.a)(r.a.translator.trans("core.forum.sign_up.email_placeholder")),bidi:this.email,disabled:this.loading||this.isProvided("email")})),20),this.attrs.token||t.add("password",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"password",type:"password",placeholder:Object(u.a)(r.a.translator.trans("core.forum.sign_up.password_placeholder")),bidi:this.password,disabled:this.loading})),10),t.add("submit",m("div",{className:"Form-group"},m(a.a,{className:"Button Button--primary Button--block",type:"submit",loading:this.loading},r.a.translator.trans("core.forum.sign_up.submit_button"))),-10),t},n.footer=function(){return[m("p",{className:"SignUpModal-logIn"},r.a.translator.trans("core.forum.sign_up.log_in_text",{a:m("a",{onclick:this.logIn.bind(this)})}))]},n.logIn=function(){var t={identification:this.email()||this.username(),password:this.password()};r.a.modal.show(s.a,t)},n.onready=function(){this.attrs.username&&!this.attrs.email?this.$("[name=email]").select():this.$("[name=username]").select()},n.onsubmit=function(t){t.preventDefault(),this.loading=!0;var e=this.submitData();r.a.request({url:r.a.forum.attribute("baseUrl")+"/register",method:"POST",body:e,errorHandler:this.onerror.bind(this)}).then((function(){return window.location.reload()}),this.loaded.bind(this))},n.submitData=function(){var t={username:this.username(),email:this.email()};return this.attrs.token?t.token=this.attrs.token:t.password=this.password(),t},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(1),r=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.className=(e.className||"")+" Checkbox--switch"},e.prototype.getDisplay=function(){return this.attrs.loading?t.prototype.getDisplay.call(this):""},e}(n(58).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(13),r=function(){function t(t,e){this.component=void 0,this.routeName=void 0,this.component=t,this.routeName=e}var e=t.prototype;return e.makeKey=function(){return this.routeName+JSON.stringify(m.route.param())},e.makeAttrs=function(t){return Object(i.a)({},t.attrs,{routeName:this.routeName})},e.onmatch=function(t,e,n){return this.component},e.render=function(t){return[Object(i.a)({},t,{attrs:this.makeAttrs(t),key:this.makeKey()})]},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var i=n(1),r=n(4),o=n(15),s=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.handler=function(){return this.attrs.when()||void 0},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.boundHandler=this.handler.bind(this),$(window).on("beforeunload",this.boundHandler)},n.onremove=function(e){t.prototype.onremove.call(this,e),$(window).off("beforeunload",this.boundHandler)},n.view=function(t){return t.children[0]},e}(r.a),a=n(81),c=n(14),u=n(8),l=n(3),d=n(10),h=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),this.composer=this.attrs.composer,this.loading=!1,this.attrs.confirmExit&&this.composer.preventClosingWhen((function(){return n.hasChanges()}),this.attrs.confirmExit),this.composer.fields.content(this.attrs.originalContent||"")},n.view=function(){return m(s,{when:this.hasChanges.bind(this)},m("div",{className:"ComposerBody "+(this.attrs.className||"")},Object(c.a)(this.attrs.user,{className:"ComposerBody-avatar"}),m("div",{className:"ComposerBody-content"},m("ul",{className:"ComposerBody-header"},Object(u.a)(this.headerItems().toArray())),m("div",{className:"ComposerBody-editor"},a.a.component({submitLabel:this.attrs.submitLabel,placeholder:this.attrs.placeholder,disabled:this.loading||this.attrs.disabled,composer:this.composer,preview:this.jumpToPreview&&this.jumpToPreview.bind(this),onchange:this.composer.fields.content,onsubmit:this.onsubmit.bind(this),value:this.composer.fields.content()}))),m(o.a,{display:"unset",containerClassName:Object(d.a)("ComposerBody-loading",this.loading&&"active"),size:"large"})))},n.hasChanges=function(){var t=this.composer.fields.content();return t&&t!==this.attrs.originalContent},n.headerItems=function(){return new l.a},n.onsubmit=function(){},n.loaded=function(){this.loading=!1,m.redraw()},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(13);function r(t,e,n){void 0===e&&(e=null),void 0===n&&(n={});var r=Object(i.a)({},n);r.state=r.state||{},r.state.key=Date.now(),m.route.set(t,e,r)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(1),r=n(4),o=n(8),s=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.prototype.view=function(t){return m("fieldset",{className:this.attrs.className},m("legend",null,this.attrs.label),m("ul",null,Object(o.a)(t.children)))},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(1),r=n(6),o=n(4),s=n(2),a=n(17),c=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){var t=r.a.history,e=r.a.pane;return m("div",{className:"Navigation ButtonGroup "+(this.attrs.className||""),onmouseenter:e&&e.show.bind(e),onmouseleave:e&&e.onmouseleave.bind(e)},t.canGoBack()?[this.getBackButton(),this.getPaneButton()]:this.getDrawerButton())},n.getBackButton=function(){var t=r.a.history,e=t.getPrevious()||{};return a.a.component({className:"Button Navigation-back Button--icon",href:t.backUrl(),icon:"fas fa-chevron-left",title:e.title,onclick:function(e){e.shiftKey||e.ctrlKey||e.metaKey||2===e.which||(e.preventDefault(),t.back())}})},n.getPaneButton=function(){var t=r.a.pane;return t&&t.active?s.a.component({className:"Button Button--icon Navigation-pin"+(t.pinned?" active":""),onclick:t.togglePinned.bind(t),icon:"fas fa-thumbtack"}):""},n.getDrawerButton=function(){if(!this.attrs.drawer)return"";var t=r.a.drawer,e=r.a.session.user;return s.a.component({className:"Button Button--icon Navigation-drawer"+(e&&e.newNotificationCount()?" new":""),onclick:function(e){e.stopPropagation(),t.show()},icon:"fas fa-bars"})},e}(o.a)},function(t,e,n){"use strict";function i(t,e,n,i){var r,o=!1,s=0;function a(){r&&clearTimeout(r)}function c(){for(var c=arguments.length,u=new Array(c),l=0;lt?f():!0!==e&&(r=setTimeout(i?p:f,void 0===i?t-h:t)))}return"boolean"!=typeof e&&(i=n,n=e,e=void 0),c.cancel=function(){a(),o=!0},c}function r(t,e,n){return void 0===n?i(t,e,!1):i(t,n,!1!==e)}n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}))},function(t,e,n){"use strict";function i(t,e){return t&&(t===e||t.prototype instanceof e)}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(){for(var t=arguments.length,e=new Array(t),n=0;nthis.getNextPageNumber()-1?this.pages.push(o):this.pages.unshift(o),this.location={page:i},m.redraw()},e.loadPage=function(t){void 0===t&&(t=1);var e=this.requestParams();return e.page=Object(i.a)({offset:this.pageSize*(t-1)},e.page),Array.isArray(e.include)&&(e.include=e.include.join(",")),r.a.store.find(this.type,e)},e.requestParams=function(){return this.params},e.refreshParams=function(t,e){if(this.isEmpty()||this.paramsChanged(t))return this.params=t,this.refresh(e)},e.refresh=function(t){var e=this;return void 0===t&&(t=1),this.initialLoading=!0,this.loadingPrev=!1,this.loadingNext=!1,this.clear(),this.location={page:t},this.loadPage().then((function(t){e.pages=[],e.parseResults(e.location.page,t)})).finally((function(){return e.initialLoading=!1}))},e.getPages=function(){return this.pages},e.getLocation=function(){return this.location},e.isLoading=function(){return this.initialLoading||this.loadingNext||this.loadingPrev},e.isInitialLoading=function(){return this.initialLoading},e.isLoadingPrev=function(){return this.loadingPrev},e.isLoadingNext=function(){return this.loadingNext},e.hasItems=function(){return!!this.getAllItems().length},e.isEmpty=function(){return!this.isInitialLoading()&&!this.hasItems()},e.hasPrev=function(){var t;return!(null==(t=this.pages[0])||!t.hasPrev)},e.hasNext=function(){var t;return!(null==(t=this.pages[this.pages.length-1])||!t.hasNext)},e.getParams=function(){return this.params},e.getNextPageNumber=function(){var t,e=null==(t=this.pages[this.pages.length-1])?void 0:t.number;return e&&!isNaN(e)?e+1:this.location.page},e.getPrevPageNumber=function(){var t,e=null==(t=this.pages[0])?void 0:t.number;return e&&!isNaN(e)?Math.max(e-1,1):this.location.page},e.paramsChanged=function(t){var e=this;return Object.keys(t).some((function(n){return e.getParams()[n]!==t[n]}))},e.getAllItems=function(){return this.getPages().map((function(t){return t.items})).flat()},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(1),r=n(4),o=n(15),s=n(7),a=n(10),c=n(59),u=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(t){"0"===this.attrs.state&&(this.attrs.state=!1);var e=Object(a.a)(["Checkbox",this.attrs.state?"on":"off",this.attrs.className,this.attrs.loading&&"loading",this.attrs.disabled&&"disabled"]);return m("label",{className:e},m("input",{type:"checkbox",checked:this.attrs.state,disabled:this.attrs.disabled,onchange:Object(c.a)("checked",this.onchange.bind(this))}),m("div",{className:"Checkbox-display","aria-hidden":"true"},this.getDisplay()),t.children)},n.getDisplay=function(){return this.attrs.loading?m(o.a,{display:"unset",size:"small"}):Object(s.a)(this.attrs.state?"fas fa-check":"fas fa-times")},n.onchange=function(t){this.attrs.onchange&&this.attrs.onchange(t,this)},e}(r.a)},function(t,e,n){"use strict";e.a=function(t,e){return function(){e(this.getAttribute(t)||this[t])}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(1),r=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.className=e.className||"Button Button--icon Button--link"},e}(n(2).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var i=n(1),r=n(0),o=n(47),s=n(2),a=n(12),c=n(7),u=n(9);function l(t){r.a.composer.isFullScreen()&&(r.a.composer.minimize(),t.stopPropagation())}var d=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.placeholder=e.placeholder||Object(u.a)(r.a.translator.trans("core.forum.composer_reply.body_placeholder")),e.submitLabel=e.submitLabel||r.a.translator.trans("core.forum.composer_reply.submit_button"),e.confirmExit=e.confirmExit||Object(u.a)(r.a.translator.trans("core.forum.composer_reply.discard_confirmation"))};var n=e.prototype;return n.headerItems=function(){var e=t.prototype.headerItems.call(this),n=this.attrs.discussion;return e.add("title",m("h3",null,Object(c.a)("fas fa-reply")," ",m(a.a,{href:r.a.route.discussion(n),onclick:l},n.title()))),e},n.jumpToPreview=function(t){l(t),m.route.set(r.a.route.discussion(this.attrs.discussion,"reply"))},n.data=function(){return{content:this.composer.fields.content(),relationships:{discussion:this.attrs.discussion}}},n.onsubmit=function(){var t=this,e=this.attrs.discussion;this.loading=!0,m.redraw();var n=this.data();r.a.store.createRecord("posts").save(n).then((function(n){if(r.a.viewingDiscussion(e)){var i=r.a.current.get("stream");i.update().then((function(){return i.goToNumber(n.number())}))}else{var o,a=s.a.component({className:"Button Button--link",onclick:function(){m.route.set(r.a.route.post(n)),r.a.alerts.dismiss(o)}},r.a.translator.trans("core.forum.composer_reply.view_button"));o=r.a.alerts.show({type:"success",controls:[a]},r.a.translator.trans("core.forum.composer_reply.posted_message"))}t.composer.hide()}),this.loaded.bind(this))},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(176),r=n.n(i),o=n(54),s=n(3),a=function(){function t(t,e){this.el=void 0,this.el=document.createElement("textarea"),this.build(t,e)}var e=t.prototype;return e.build=function(t,e){var n=this;this.el.className=e.classNames.join(" "),this.el.disabled=e.disabled,this.el.placeholder=e.placeholder,this.el.value=e.value;var i=function(t){e.inputListeners.forEach((function(t){t()})),t.redraw=!1};this.el.oninput=function(t){e.oninput(n.el.value),i(t)},this.el.onclick=i,this.el.onkeyup=i,this.el.addEventListener("keydown",(function(t){n.keyHandlers(e).toArray().forEach((function(e){return e(t)}))})),t.append(this.el)},e.keyHandlers=function(t){var e=new s.a;return e.add("submit",(function(e){(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&t.onsubmit()})),e},e.moveCursorTo=function(t){this.setSelectionRange(t,t)},e.getSelectionRange=function(){return[this.el.selectionStart,this.el.selectionEnd]},e.getLastNChars=function(t){return this.el.value.slice(Math.max(0,this.el.selectionStart-t),this.el.selectionStart)},e.insertAtCursor=function(t){this.insertAt(this.el.selectionStart,t)},e.insertAt=function(t,e){this.insertBetween(t,t,e)},e.insertBetween=function(t,e,n){this.setSelectionRange(t,e);var i=t+n.length;Object(o.a)(this.el,{text:n,selectionStart:i,selectionEnd:i})},e.replaceBeforeCursor=function(t,e){this.insertBetween(t,this.el.selectionStart,e)},e.setSelectionRange=function(t,e){this.el.setSelectionRange(t,e),this.focus()},e.getCaretCoordinates=function(t){var e=r()(this.el,t);return{top:e.top-this.el.scrollTop,left:e.left}},e.disabled=function(t){this.el.disabled=t},e.focus=function(){this.el.focus()},e.destroy=function(){this.el.remove()},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(1),r=n(4),o=n(3),s=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){return m("div",{className:"LogInButtons"},this.items().toArray())},n.items=function(){return new o.a},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(1),r=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t),e.initAttrs=function(t){t.className=t.className||"",t.surround=t.surround||function(t){return t()}};var n=e.prototype;return n.view=function(){return m("div",{className:this.attrs.className})},n.oncreate=function(e){var n,i=this;t.prototype.oncreate.call(this,e);var r=function(){if(i.attrs.composer.isVisible()){var t=i.attrs.composer.fields.content();n!==t&&(n=t,i.attrs.surround((function(){return s9e.TextFormatter.preview(n||"",e.dom)})))}};r(),this.updateInterval=setInterval(r,50)},n.onremove=function(e){t.prototype.onremove.call(this,e),clearInterval(this.updateInterval)},e}(n(4).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var i=n(1),r=n(0),o=n(4),s=n(8),a=n(2),c=n(12),u=n(15),l=n(56),d=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){var t=this.attrs.state;return m("div",{className:"NotificationList"},m("div",{className:"NotificationList-header"},m("h4",{className:"App-titleControl App-titleControl--text"},r.a.translator.trans("core.forum.notifications.title")),m("div",{className:"App-primaryControl"},m(a.a,{className:"Button Button--link",icon:"fas fa-check",title:r.a.translator.trans("core.forum.notifications.mark_all_as_read_tooltip"),onclick:t.markAllAsRead.bind(t)}))),m("div",{className:"NotificationList-content"},this.content(t)))},n.content=function(t){return t.isLoading()?m(u.a,{className:"LoadingIndicator--block"}):t.hasItems()?t.getPages().map((function(t){var e=[],n={};return t.items.forEach((function(t){var i=t.subject();if(void 0!==i){var r=null;i instanceof l.a?r=i:i&&i.discussion&&(r=i.discussion());var o=r?r.id():0;n[o]=n[o]||{discussion:r,notifications:[]},n[o].notifications.push(t),-1===e.indexOf(n[o])&&e.push(n[o])}})),e.map((function(t){var e=t.discussion&&t.discussion.badges().toArray();return m("div",{className:"NotificationGroup"},t.discussion?m(c.a,{className:"NotificationGroup-header",href:r.a.route.discussion(t.discussion)},e&&!!e.length&&m("ul",{className:"NotificationGroup-badges badges"},Object(s.a)(e)),m("span",null,t.discussion.title())):m("div",{className:"NotificationGroup-header"},r.a.forum.attribute("title")),m("ul",{className:"NotificationGroup-content"},t.notifications.map((function(t){var e=r.a.notificationComponents[t.contentType()];return e?m("li",null,e.component({notification:t})):""}))))}))})):m("div",{className:"NotificationList-empty"},r.a.translator.trans("core.forum.notifications.empty_text"))},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.$notifications=this.$(".NotificationList-content"),this.$scrollParent=this.inPanel()?this.$notifications:$(window),this.boundScrollHandler=this.scrollHandler.bind(this),this.$scrollParent.on("scroll",this.boundScrollHandler)},n.onremove=function(e){t.prototype.onremove.call(this,e),this.$scrollParent.off("scroll",this.boundScrollHandler)},n.scrollHandler=function(){var t=this.attrs.state,e=this.inPanel()?this.$scrollParent[0]:document.documentElement,n=Math.abs(e.scrollHeight-e.scrollTop-e.clientHeight)<=1;t.hasNext()&&!t.isLoadingNext()&&n&&t.loadNext()},n.inPanel=function(){return"auto"===this.$notifications.css("overflow")},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var i=n(1),r=n(0),o=n(67),s=n(10),a=n(138),c=n(142),u=n(143),l=n(68),d=n(3),h=n(8),f=n(2),p=n(64),g=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),this.revealContent=!1,this.cardVisible=!1,this.subtree.check((function(){return n.cardVisible}),(function(){return n.isEditing()}),(function(){return n.revealContent}))},n.content=function(){return t.prototype.content.call(this).concat([m("header",{className:"Post-header"},m("ul",null,Object(h.a)(this.headerItems().toArray()))),m("div",{className:"Post-body"},this.isEditing()?m(p.a,{className:"Post-preview",composer:r.a.composer}):m.trust(this.attrs.post.contentHtml()))])},n.refreshContent=function(){var t=this.isEditing()?"":this.attrs.post.contentHtml();this.contentHtml!==t&&this.$(".Post-body script").each((function(){var t=document.createElement("script");t.textContent=this.textContent,Array.from(this.attributes).forEach((function(e){return t.setAttribute(e.name,e.value)})),this.parentNode.replaceChild(t,this)})),this.contentHtml=t},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.refreshContent()},n.onupdate=function(e){t.prototype.onupdate.call(this,e),this.refreshContent()},n.isEditing=function(){return r.a.composer.bodyMatches(l.a,{post:this.attrs.post})},n.elementAttrs=function(){var e=this.attrs.post,n=t.prototype.elementAttrs.call(this);return n.className=(n.className||"")+" "+Object(s.a)({CommentPost:!0,"Post--hidden":e.isHidden(),"Post--edited":e.isEdited(),revealContent:this.revealContent,editing:this.isEditing()}),n},n.toggleContent=function(){this.revealContent=!this.revealContent},n.headerItems=function(){var t=this,e=new d.a,n=this.attrs.post;return e.add("user",a.a.component({post:n,cardVisible:this.cardVisible,oncardshow:function(){t.cardVisible=!0,m.redraw()},oncardhide:function(){t.cardVisible=!1,m.redraw()}}),100),e.add("meta",c.a.component({post:n})),n.isEdited()&&!n.isHidden()&&e.add("edited",u.a.component({post:n})),n.isHidden()&&e.add("toggle",f.a.component({className:"Button Button--default Button--more",icon:"fas fa-ellipsis-h",onclick:this.toggleContent.bind(this)})),e},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var i=n(1),r=n(0),o=n(4),s=n(53),a=n(19),c=n(137),u=n(8),l=n(3),d=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),this.loading=!1,this.subtree=new s.a((function(){return n.attrs.post.freshness}),(function(){var t=n.attrs.post.user();return t&&t.freshness}),(function(){return n.controlsOpen}))},n.view=function(){var t=this,e=this.elementAttrs();e.className=this.classes(e.className).join(" ");var n=c.a.controls(this.attrs.post,this).toArray(),i=this.footerItems().toArray();return m("article",e,m("div",null,this.content(),m("aside",{className:"Post-actions"},m("ul",null,Object(u.a)(this.actionItems().toArray()),n.length?m("li",null,m(a.a,{className:"Post-controls",buttonClassName:"Button Button--icon Button--flat",menuClassName:"Dropdown-menu--right",icon:"fas fa-ellipsis-h",onshow:function(){return t.$(".Post-actions").addClass("open")},onhide:function(){return t.$(".Post-actions").removeClass("open")},accessibleToggleLabel:r.a.translator.trans("core.forum.post_controls.toggle_dropdown_accessible_label")},n)):"")),m("footer",{className:"Post-footer"},i.length?m("ul",null,Object(u.a)(i)):null)))},n.onbeforeupdate=function(e){return t.prototype.onbeforeupdate.call(this,e),this.subtree.needsRebuild()},n.onupdate=function(e){t.prototype.onupdate.call(this,e);var n=this.$(".Post-actions"),i=this.$(".Post-controls");n.toggleClass("open",i.hasClass("open"))},n.elementAttrs=function(){return{}},n.content=function(){return[]},n.classes=function(t){var e=(t||"").split(" ").concat(["Post"]),n=this.attrs.post.user(),i=this.attrs.post.discussion();return this.loading&&e.push("Post--loading"),n&&n===r.a.session.user&&e.push("Post--by-actor"),n&&n===i.user()&&e.push("Post--by-start-user"),e},n.actionItems=function(){return new l.a},n.footerItems=function(){return new l.a},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var i=n(1),r=n(0),o=n(47),s=n(2),a=n(12),c=n(7);function u(t){r.a.composer.isFullScreen()&&(r.a.composer.minimize(),t.stopPropagation())}var l=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.submitLabel=e.submitLabel||r.a.translator.trans("core.forum.composer_edit.submit_button"),e.confirmExit=e.confirmExit||r.a.translator.trans("core.forum.composer_edit.discard_confirmation"),e.originalContent=e.originalContent||e.post.content(),e.user=e.user||e.post.user(),e.post.editedContent=e.originalContent};var n=e.prototype;return n.headerItems=function(){var e=t.prototype.headerItems.call(this),n=this.attrs.post;return e.add("title",m("h3",null,Object(c.a)("fas fa-pencil-alt")," ",m(a.a,{href:r.a.route.discussion(n.discussion(),n.number()),onclick:u},r.a.translator.trans("core.forum.composer_edit.post_link",{number:n.number(),discussion:n.discussion().title()})))),e},n.jumpToPreview=function(t){u(t),m.route.set(r.a.route.post(this.attrs.post))},n.data=function(){return{content:this.composer.fields.content()}},n.onsubmit=function(){var t=this,e=this.attrs.post.discussion();this.loading=!0;var n=this.data();this.attrs.post.save(n).then((function(n){if(r.a.viewingDiscussion(e))r.a.current.get("stream").goToNumber(n.number());else{var i,o=s.a.component({className:"Button Button--link",onclick:function(){m.route.set(r.a.route.post(n)),r.a.alerts.dismiss(i)}},r.a.translator.trans("core.forum.composer_edit.view_button"));i=r.a.alerts.show({type:"success",controls:[o]},r.a.translator.trans("core.forum.composer_edit.edited_message"))}t.composer.hide()}),this.loaded.bind(this))},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var i=n(1),r=n(0),o=n(4),s=n(26),a=n(3),c=n(139),u=n(14),l=n(20),d=n(7),h=n(19),f=n(12),p=n(141),g=n(8),v=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){var t=this.attrs.user,e=c.a.controls(t,this).toArray(),n=t.color(),i=t.badges().toArray();return m("div",{className:"UserCard "+(this.attrs.className||""),style:n&&{"--usercard-bg":n}},m("div",{className:"darkenBackground"},m("div",{className:"container"},e.length?h.a.component({className:"UserCard-controls App-primaryControl",menuClassName:"Dropdown-menu--right",buttonClassName:this.attrs.controlsButtonClassName,label:r.a.translator.trans("core.forum.user_controls.button"),accessibleToggleLabel:r.a.translator.trans("core.forum.user_controls.toggle_dropdown_accessible_label"),icon:"fas fa-ellipsis-v"},e):"",m("div",{className:"UserCard-profile"},m("h2",{className:"UserCard-identity"},this.attrs.editable?[p.a.component({user:t,className:"UserCard-avatar"}),Object(l.a)(t)]:m(f.a,{href:r.a.route.user(t)},m("div",{className:"UserCard-avatar"},Object(u.a)(t)),Object(l.a)(t))),i.length?m("ul",{className:"UserCard-badges badges"},Object(g.a)(i)):"",m("ul",{className:"UserCard-info"},Object(g.a)(this.infoItems().toArray()))))))},n.infoItems=function(){var t=new a.a,e=this.attrs.user,n=e.lastSeenAt();if(n){var i=e.isOnline();t.add("lastSeen",m("span",{className:"UserCard-lastSeen"+(i?" online":"")},i?[Object(d.a)("fas fa-circle")," ",r.a.translator.trans("core.forum.user.online_text")]:[Object(d.a)("far fa-clock")," ",Object(s.a)(n)]))}return t.add("joined",r.a.translator.trans("core.forum.user.joined_date_text",{ago:Object(s.a)(e.joinTime())})),t},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var i=n(1),r=n(6),o=n(16),s=n(2),a=n(41),c=n(18),u=n(9),l=n(3),d=n(11),h=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e);var i=this.attrs.user;this.username=Object(d.a)(i.username()||""),this.email=Object(d.a)(i.email()||""),this.isEmailConfirmed=Object(d.a)(i.isEmailConfirmed()||!1),this.setPassword=Object(d.a)(!1),this.password=Object(d.a)(i.password()||""),this.groups={},r.a.store.all("groups").filter((function(t){return-1===[c.a.GUEST_ID,c.a.MEMBER_ID].indexOf(t.id())})).forEach((function(t){return n.groups[t.id()]=Object(d.a)(-1!==i.groups().indexOf(t))}))},n.className=function(){return"EditUserModal Modal--small"},n.title=function(){return r.a.translator.trans("core.lib.edit_user.title")},n.content=function(){var t=this.fields().toArray();return m("div",{className:"Modal-body"},t.length>1?m("div",{className:"Form"},this.fields().toArray()):r.a.translator.trans("core.lib.edit_user.nothing_available"))},n.fields=function(){var t=this,e=new l.a;return r.a.session.user.canEditCredentials()&&(e.add("username",m("div",{className:"Form-group"},m("label",null,r.a.translator.trans("core.lib.edit_user.username_heading")),m("input",{className:"FormControl",placeholder:Object(u.a)(r.a.translator.trans("core.lib.edit_user.username_label")),bidi:this.username,disabled:this.nonAdminEditingAdmin()})),40),r.a.session.user!==this.attrs.user&&(e.add("email",m("div",{className:"Form-group"},m("label",null,r.a.translator.trans("core.lib.edit_user.email_heading")),m("div",null,m("input",{className:"FormControl",placeholder:Object(u.a)(r.a.translator.trans("core.lib.edit_user.email_label")),bidi:this.email,disabled:this.nonAdminEditingAdmin()})),!this.isEmailConfirmed()&&this.userIsAdmin(r.a.session.user)?m("div",null,s.a.component({className:"Button Button--block",loading:this.loading,onclick:this.activate.bind(this)},r.a.translator.trans("core.lib.edit_user.activate_button"))):""),30),e.add("password",m("div",{className:"Form-group"},m("label",null,r.a.translator.trans("core.lib.edit_user.password_heading")),m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",onchange:function(e){t.setPassword(e.target.checked),m.redraw.sync(),e.target.checked&&t.$("[name=password]").select(),e.redraw=!1},disabled:this.nonAdminEditingAdmin()}),r.a.translator.trans("core.lib.edit_user.set_password_label")),this.setPassword()?m("input",{className:"FormControl",type:"password",name:"password",placeholder:Object(u.a)(r.a.translator.trans("core.lib.edit_user.password_label")),bidi:this.password,disabled:this.nonAdminEditingAdmin()}):"")),20))),r.a.session.user.canEditGroups()&&e.add("groups",m("div",{className:"Form-group EditUserModal-groups"},m("label",null,r.a.translator.trans("core.lib.edit_user.groups_heading")),m("div",null,Object.keys(this.groups).map((function(t){return r.a.store.getById("groups",t)})).map((function(e){return m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:t.groups[e.id()],disabled:e.id()===c.a.ADMINISTRATOR_ID&&(t.attrs.user===r.a.session.user||!t.userIsAdmin(r.a.session.user))}),a.a.component({group:e,label:""})," ",e.nameSingular())})))),10),e.add("submit",m("div",{className:"Form-group"},s.a.component({className:"Button Button--primary",type:"submit",loading:this.loading},r.a.translator.trans("core.lib.edit_user.submit_button"))),-10),e},n.activate=function(){var t=this;this.loading=!0;var e={username:this.username(),isEmailConfirmed:!0};this.attrs.user.save(e,{errorHandler:this.onerror.bind(this)}).then((function(){t.isEmailConfirmed(!0),t.loading=!1,m.redraw()})).catch((function(){t.loading=!1,m.redraw()}))},n.data=function(){var t=this,e={relationships:{}};return this.attrs.user.canEditCredentials()&&!this.nonAdminEditingAdmin()&&(e.username=this.username(),r.a.session.user!==this.attrs.user&&(e.email=this.email()),this.setPassword()&&(e.password=this.password())),this.attrs.user.canEditGroups()&&(e.relationships.groups=Object.keys(this.groups).filter((function(e){return t.groups[e]()})).map((function(t){return r.a.store.getById("groups",t)}))),e},n.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0,this.attrs.user.save(this.data(),{errorHandler:this.onerror.bind(this)}).then(this.hide.bind(this)).catch((function(){e.loading=!1,m.redraw()}))},n.nonAdminEditingAdmin=function(){return this.userIsAdmin(this.attrs.user)&&!this.userIsAdmin(r.a.session.user)},n.userIsAdmin=function(t){return t.groups().some((function(t){return t.id()===c.a.ADMINISTRATOR_ID}))},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(87),r=n(1),o=n(0);function s(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=n).toggleClass("scrolled",t>n),$(".App-header").toggleClass("navbar-fixed-top",t>=n)}));n.start(),n.update(),$((function(){$("body").addClass("ontouchstart"in window?"touch":"no-touch")})),Object(b.a)()},e.preloadedApiDocument=function(){if(this.data.apiDocument&&window.location.href===this.initialRoute){var t=this.store.pushPayload(this.data.apiDocument);return this.data.apiDocument=null,t}return null},e.screen=function(){return getComputedStyle(document.documentElement).getPropertyValue("--flarum-screen")},e.setTitle=function(t){this.title=t,this.updateTitle()},e.setTitleCount=function(t){this.titleCount=t,this.updateTitle()},e.updateTitle=function(){var t=this.titleCount?"("+this.titleCount+") ":"",e=this.title&&m.route.get()!==this.forum.attribute("basePath")+"/"?this.title+" - ":"",n=this.forum.attribute("title");document.title=t+e+n},e.request=function(t){var e=this,n=Object.assign({},t);if(n.background=n.background||!0,Object(y.extend)(n,"config",(function(t,n){return n.setRequestHeader("X-CSRF-Token",e.session.csrfToken)})),"GET"!==n.method&&"POST"!==n.method){var r=n.method;Object(y.extend)(n,"config",(function(t,e){return e.setRequestHeader("X-HTTP-Method-Override",r)})),n.method="POST"}n.deserialize=n.deserialize||function(t){return t},n.errorHandler=n.errorHandler||function(t){throw t};var s=n.extract;return n.extract=function(t){var e;e=s?s(t.responseText):t.responseText||null;var r=t.status;if(r<200||r>299)throw new g.a(r,e,n,t);if(t.getResponseHeader){var o=t.getResponseHeader("X-CSRF-Token");o&&(i.a.session.csrfToken=o)}try{return JSON.parse(e)}catch(i){throw new g.a(500,e,n,t)}},this.requestErrorAlert&&this.alerts.dismiss(this.requestErrorAlert),m.request(n).then((function(t){return t}),(function(t){var r;switch(t.status){case 422:r=t.response.errors.map((function(t){return[t.detail,m("br",null)]})).reduce((function(t,e){return t.concat(e)}),[]).slice(0,-1);break;case 401:case 403:r=i.a.translator.trans("core.lib.error.permission_denied_message");break;case 404:case 410:r=i.a.translator.trans("core.lib.error.not_found_message");break;case 413:r=i.a.translator.trans("core.lib.error.payload_too_large_message");break;case 429:r=i.a.translator.trans("core.lib.error.rate_limit_exceeded_message");break;default:r=i.a.translator.trans("core.lib.error.generic_message")}var s=i.a.forum.attribute("debug"),a=t.response&&t.response.errors,c=Array.isArray(a)&&a[0]&&a[0].detail&&a.map((function(t){return decodeURI(t.detail)}));t.alert={type:"error",content:r,controls:s&&[m(o.a,{className:"Button Button--link",onclick:e.showDebug.bind(e,t,c)},"Debug")]};try{n.errorHandler(t)}catch(t){if(s&&t.xhr){var u,l=t.options,d=l.method,h=l.url,f=t.xhr.status,p=void 0===f?"":f;console.group(d+" "+h+" "+p),(u=console).error.apply(u,c||[t]),console.groupEnd()}e.requestErrorAlert=e.alerts.show(t.alert,t.alert.content)}return Promise.reject(t)}))},e.showDebug=function(t,e){this.alerts.dismiss(this.requestErrorAlert),this.modal.show(c.a,{error:t,formattedError:e})},e.route=function(t,e){void 0===e&&(e={});var n=this.routes[t];if(!n)throw new Error("Route '"+t+"' does not exist");var i=n.path.replace(/:([^\/]+)/g,(function(t,n){return Object(h.a)(e,n)}));for(var r in e)e.hasOwnProperty(r)&&!e[r]&&delete e[r];var o=m.buildQueryString(e);return(""===m.route.prefix?this.forum.attribute("basePath"):"")+i+(o?"?"+o:"")},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(52),r=function(){function t(t,e){void 0===e&&(e={}),this.type=t,this.data=e}var e=t.prototype;return e.matches=function(t,e){var n=this;return void 0===e&&(e={}),!!Object(i.a)(this.type,t)&&Object.keys(e).every((function(t){return n.data[t]===e[t]}))},e.get=function(t){return this.data[t]},e.set=function(t,e){this.data[t]=e},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(0);function r(t,e){return void 0===e&&(e=i.a.data.locale),new Intl.NumberFormat(e).format(t)}},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(t,e,n,i){this.status=void 0,this.options=void 0,this.xhr=void 0,this.responseText=void 0,this.response=void 0,this.alert=void 0,this.status=t,this.responseText=e,this.options=n,this.xhr=i;try{this.response=JSON.parse(e)}catch(t){this.response=null}this.alert=null}},function(t,e,n){"use strict";function i(t,e,n){(Array.isArray(e)?e:[e]).forEach((function(e){var i=t[e];t[e]=function(){for(var t=arguments.length,e=new Array(t),r=0;r=1e6?Math.floor(t/1e6)+i.a.translator.trans("core.lib.number_suffix.mega_text"):t>=1e3?(t/1e3).toFixed(1)+i.a.translator.trans("core.lib.number_suffix.kilo_text"):t.toString()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var i=n(1),r=n(6),o=n(4),s=n(3),a=n(8),c=n(2),u=n(62),l=n(28),d=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.value=this.attrs.value||"",this.disabled=!!this.attrs.disabled},n.view=function(){return m("div",{className:"TextEditor"},m("div",{className:"TextEditor-editorContainer"}),m("ul",{className:"TextEditor-controls Composer-footer"},Object(a.a)(this.controlItems().toArray()),m("li",{className:"TextEditor-toolbar"},this.toolbarItems().toArray())))},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.attrs.composer.editor=this.buildEditor(this.$(".TextEditor-editorContainer")[0])},n.onupdate=function(e){t.prototype.onupdate.call(this,e);var n=!!this.attrs.disabled;this.disabled!==n&&(this.disabled=n,this.attrs.composer.editor.disabled(n))},n.buildEditorParams=function(){var t=this;return{classNames:["FormControl","Composer-flexible","TextEditor-editor"],disabled:this.disabled,placeholder:this.attrs.placeholder||"",value:this.value,oninput:this.oninput.bind(this),inputListeners:[],onsubmit:function(){t.onsubmit(),m.redraw()}}},n.buildEditor=function(t){return new u.a(t,this.buildEditorParams())},n.controlItems=function(){var t=new s.a;return t.add("submit",c.a.component({icon:"fas fa-paper-plane",className:"Button Button--primary",itemClassName:"App-primaryControl",onclick:this.onsubmit.bind(this)},this.attrs.submitLabel)),this.attrs.preview&&t.add("preview",m(l.a,{text:r.a.translator.trans("core.forum.composer.preview_tooltip")},m(c.a,{icon:"far fa-eye",className:"Button Button--icon",onclick:this.attrs.preview}))),t},n.toolbarItems=function(){return new s.a},n.oninput=function(t){this.value=t,this.attrs.onchange(this.value)},n.onsubmit=function(){this.attrs.onsubmit(this.value)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=/[.*+?^${}()|[\]\\]/g;function r(t){return t.replace(i,"\\$&")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(19),o=n(2),s=n(7),a=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.className+=" Dropdown--split",e.menuClassName+=" Dropdown-menu--right"};var n=e.prototype;return n.getButton=function(t){var e=this.getFirstChild(t),n=Object.assign({},e.attrs);return n.className=(n.className||"")+" SplitDropdown-button Button "+this.attrs.buttonClassName,[o.a.component(n,e.children),m("button",{className:"Dropdown-toggle Button Button--icon "+this.attrs.buttonClassName,"aria-haspopup":"menu","aria-label":this.attrs.accessibleToggleLabel,"data-toggle":"dropdown"},Object(s.a)(this.attrs.icon,{className:"Button-icon"}),Object(s.a)("fas fa-caret-down",{className:"Button-caret"}))]},n.getFirstChild=function(t){for(var e=t;e instanceof Array;)e=e[0];return e},e}(r.a)},function(t,e,n){"use strict";function i(t,e){var n=$(window),i=$(t).offset().top-n.scrollTop();e(),n.scrollTop($(t).offset().top-i)}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(7);function r(t){if(t.lastSeenAt()&&t.isOnline())return m("span",{className:"UserOnline"},Object(i.a)("fas fa-circle"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(33),r=n.n(i);function o(t){var e=r()(t),n=e.format(),i=e.format("LLLL");return m("time",{pubdate:!0,datetime:n},i)}},function(t,e,n){"use strict";function i(t,e){for(var n=0;n").addClass("drawer-backdrop fade").appendTo("body").click((function(){return t.hide()})),setTimeout((function(){return t.$backdrop.addClass("in")}))},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(46);function r(t,e){void 0===e&&(e="");var n={};for(var r in t){var o=t[r];if("resolver"in o)n[e+o.path]=o.resolver;else{if(!("component"in o))throw new Error("Either a resolver or a component must be provided for the route ["+r+"]");var s="resolverClass"in o?o.resolverClass:i.a;n[e+o.path]=new s(o.component,r)}}return n}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(26);function r(){$("[data-humantime]").each((function(){var t=$(this),e=Object(i.a)(t.attr("datetime"));t.html(e)}))}function o(){setInterval(r,1e4)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(1),r=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.prototype.apiEndpoint=function(){return"/"},e}(n(5).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(1),r=n(5),o=n(100),s=n(3),a=n(27),c=n(41),u=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e}(r.a);Object.assign(u.prototype,{username:r.a.attribute("username"),slug:r.a.attribute("slug"),displayName:r.a.attribute("displayName"),email:r.a.attribute("email"),isEmailConfirmed:r.a.attribute("isEmailConfirmed"),password:r.a.attribute("password"),avatarUrl:r.a.attribute("avatarUrl"),preferences:r.a.attribute("preferences"),groups:r.a.hasMany("groups"),joinTime:r.a.attribute("joinTime",r.a.transformDate),lastSeenAt:r.a.attribute("lastSeenAt",r.a.transformDate),markedAllAsReadAt:r.a.attribute("markedAllAsReadAt",r.a.transformDate),unreadNotificationCount:r.a.attribute("unreadNotificationCount"),newNotificationCount:r.a.attribute("newNotificationCount"),discussionCount:r.a.attribute("discussionCount"),commentCount:r.a.attribute("commentCount"),canEdit:r.a.attribute("canEdit"),canEditCredentials:r.a.attribute("canEditCredentials"),canEditGroups:r.a.attribute("canEditGroups"),canDelete:r.a.attribute("canDelete"),avatarColor:null,color:Object(a.a)("displayName","avatarUrl","avatarColor",(function(t,e,n){return n?"rgb("+n.join(", ")+")":e?(this.calculateAvatarColor(),""):"#"+Object(o.a)(t)})),isOnline:function(){return dayjs().subtract(5,"minutes").isBefore(this.lastSeenAt())},badges:function(){var t=new s.a,e=this.groups();return e&&e.forEach((function(e){t.add("group"+e.id(),c.a.component({group:e}))})),t},calculateAvatarColor:function(){var t=new Image,e=this;t.onload=function(){var t=new ColorThief;e.avatarColor=t.getColor(this),e.freshness=new Date,m.redraw()},t.crossOrigin="anonymous",t.src=this.avatarUrl()},savePreferences:function(t){var e=this.preferences();return Object.assign(e,t),this.save({preferences:e})}})},function(t,e,n){"use strict";function i(t){for(var e=0,n=0;n3&&void 0!==arguments[3]?arguments[3]:[];if(!e)return r;if(1===i)return r.push(e),r;var o=e.indexOf(n);if(-1===o)return r.push(e),r;var s=e.substring(0,o).trim(),a=e.substring(o+n.length+1).trim();return r.push(s),t(a,n,i-1,r)}(t.slice(1,-1),",",3)}function _(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function O(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,r=w(e),o=r.args,s=r.cases,a=parseInt(t);o.forEach((function(t){t.startsWith("offset:")&&(a-=parseInt(t.slice("offset:".length)))}));var c=[];1===a&&c.push("one"),c.push("=".concat(a),"other");for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,r=w(e),o=r.cases;return t in o?i(o[t],n):"other"in o?i(o.other,n):t}function k(t,e,n){return"<".concat(t,">").concat(n,"")}function E(t,e,n){var i=[];return A(t,0,0,i,(function(r,o,s,a,c,u){if(o)return{break:!0};var l=function(t,e,n,i){var r,o=1;return A(t,n,i,[],(function(t,n,i,s,a,c){if(i===e&&(n?o--:o++,0===o))return r={segmentIndex:s,segmentStart:c,segmentEnd:a},{exit:!0};return{exit:!1}})),r}(t,s,a,c);if(!l)throw new Error("Unbalanced tags: no closing tag found for <".concat(s,">"));var d=l.segmentIndex===a,h=t[l.segmentIndex],f=[];if(d)f.push(r.slice(c+1,l.segmentStart));else{f.push(r.slice(c+1));for(var p=a+1;p"===a[h]){var f=a.slice(u+1+c,h),p=r(a,c,f,s,h,u);if(p.exit)return;if(p.newSegmentIndex&&(s=p.newSegmentIndex),p.processedSegment&&(d=!0),p.break)break;c=!1,u=null,l=!1}else l&&(o=a[h],!/[a-zA-Z-_]/.test(o))&&(c=!1,u=null,l=!1);else u=h,l=!0,"/"===a[h+1]&&(c=!0,h++);d||i.push(a)}else i.push(a)}}function P(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=h()(t);if(e){var r=h()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return l()(this,n)}}var D=function(t){c()(n,t);var e=P(n);function n(t){var i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return r()(this,n),(i=e.call(this,t,o)).richHandler=s||k,i}return s()(n,[{key:"rich",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=b(this.process(t,e));return E(n,e,this.richHandler)}}]),n}(function(){function t(e){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),v()(this,"format",y((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return b(n.process(t,e)).join("")}))),this.locale=e,this.typeHandlers=i}return s()(t,[{key:"process",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return[];var n=t.indexOf("{");if(-1!==n){var i=x(t,n);if(-1===i)throw new Error('Unbalanced curly braces in string: "'.concat(t,'"'));var r=t.substring(n,i+1);if(r){var o=[],s=t.substring(0,n);s&&o.push(s);var a=N(r),c=p()(a,3),u=c[0],l=c[1],d=c[2],h=e[u];null==h&&(h="");var f=l&&this.typeHandlers[l];o.push(f?f(h,d,this.locale,e,this.process.bind(this)):h);var m=t.substring(i+1);return m&&o.push(this.process(m,e)),o}}return[t]}}]),t}());function I(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function $(t){for(var e=1;e1?n-1:0),o=1;o=this.loadLimit,m.redraw(),t},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(13),r=n(1),o=n(0),s=n(46),a=n(23),c=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t);var n=e.prototype;return n.canonicalizeDiscussionSlug=function(t){if(t)return t.split("-")[0]},n.makeKey=function(){var t=Object(i.a)({},m.route.param());return"near"in t&&delete t.near,t.id=this.canonicalizeDiscussionSlug(t.id),this.routeName.replace(".near","")+JSON.stringify(t)},n.onmatch=function(n,i,r){return o.a.current.matches(a.a)&&this.canonicalizeDiscussionSlug(n.id)===this.canonicalizeDiscussionSlug(m.route.param("id"))&&(e.scrollToPostNumber=n.near||"1"),t.prototype.onmatch.call(this,n,i,r)},n.render=function(n){if(null!==e.scrollToPostNumber){var i=e.scrollToPostNumber;setTimeout((function(){return o.a.current.get("stream").goToNumber(i)})),e.scrollToPostNumber=null}return t.prototype.render.call(this,n)},e}(s.a);c.scrollToPostNumber=null},function(t,e,n){"use strict";var i=n(169);t.exports=n(193)(i,requestAnimationFrame,console)},function(t,e,n){"use strict";var i=n(170),r=n(171);t.exports=function(t,e){if(/:([^\/\.-]+)(\.{3})?:/.test(t))throw new SyntaxError("Template parameter names *must* be separated");if(null==e)return t;var n=t.indexOf("?"),o=t.indexOf("#"),s=o<0?t.length:o,a=n<0?s:n,c=t.slice(0,a),u={};r(u,e);var l=c.replace(/:([^\/\.-]+)(\.{3})?/g,(function(t,n,i){return delete u[n],null==e[n]?t:i?e[n]:encodeURIComponent(String(e[n]))})),d=l.indexOf("?"),h=l.indexOf("#"),f=h<0?l.length:h,p=d<0?f:d,m=l.slice(0,p);n>=0&&(m+=t.slice(n,s)),d>=0&&(m+=(n<0?"?":"&")+l.slice(d,f));var g=i(u);return g&&(m+=(n<0&&d<0?"?":"&")+g),o>=0&&(m+=t.slice(o)),h>=0&&(m+=(o<0?"":"&")+l.slice(h)),m}},function(t,e,n){"use strict";var i=n(172);t.exports=function(t){var e=t.indexOf("?"),n=t.indexOf("#"),r=n<0?t.length:n,o=e<0?r:e,s=t.slice(0,o).replace(/\/{2,}/g,"/");return s?("/"!==s[0]&&(s="/"+s),s.length>1&&"/"===s[s.length-1]&&(s=s.slice(0,-1))):s="/",{path:s,params:e<0?{}:i(t.slice(e+1,r))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(48),r=function(){function t(t){this.stack=[]}var e=t.prototype;return e.getCurrent=function(){return this.stack[this.stack.length-1]},e.getPrevious=function(){return this.stack[this.stack.length-2]},e.push=function(t,e,n){void 0===n&&(n=m.route.get());var i=this.stack[this.stack.length-2];i&&i.name===t&&this.stack.pop();var r=this.getCurrent();r&&r.name===t?Object.assign(r,{url:n,title:e}):this.stack.push({name:t,url:n,title:e})},e.canGoBack=function(){return this.stack.length>1},e.back=function(){if(!this.canGoBack())return this.home();this.stack.pop(),m.route.set(this.getCurrent().url)},e.backUrl=function(){return this.stack[this.stack.length-2].url},e.home=function(){this.stack.splice(0),Object(i.a)("/")},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(t){this.pinnedKey="panePinned",this.$element=$(t),this.pinned="true"===localStorage.getItem(this.pinnedKey),this.active=!1,this.showing=!1,this.render()}var e=t.prototype;return e.enable=function(){this.active=!0,this.render()},e.disable=function(){this.active=!1,this.showing=!1,this.render()},e.show=function(){clearTimeout(this.hideTimeout),this.showing=!0,this.render()},e.hide=function(){this.showing=!1,this.render()},e.onmouseleave=function(){this.hideTimeout=setTimeout(this.hide.bind(this),250)},e.togglePinned=function(){this.pinned=!this.pinned,localStorage.setItem(this.pinnedKey,this.pinned?"true":"false"),this.render()},e.render=function(){this.$element.toggleClass("panePinned",this.pinned).toggleClass("hasPane",this.active).toggleClass("paneShowing",this.showing)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(4),o=n(3),s=n(8),a=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){return m("header",{className:"Hero DiscussionHero"},m("div",{className:"container"},m("ul",{className:"DiscussionHero-items"},Object(s.a)(this.items().toArray()))))},n.items=function(){var t=new o.a,e=this.attrs.discussion,n=e.badges().toArray();return n.length&&t.add("badges",m("ul",{className:"DiscussionHero-badges badges"},Object(s.a)(n)),10),t.add("title",m("h2",{className:"DiscussionHero-title"},e.title())),t},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(1),r=n(0),o=n(42),s=n(4),a=n(23),c=function(t){t.pageX<10&&r.a.pane.show()},u=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){if(this.attrs.state.hasItems())return m("div",{className:"DiscussionPage-list"},this.enoughSpace()&&m(o.a,{state:this.attrs.state}))},n.oncreate=function(e){t.prototype.oncreate.call(this,e);var n=$(e.dom),i=r.a.pane;if(n.hover(i.show.bind(i),i.onmouseleave.bind(i)),$(document).on("mousemove",c),r.a.previous.matches(a.a)){var o=r.a.cache.discussionListPaneScrollTop||0;n.scrollTop(o)}else{var s=n.find(".DiscussionListItem.active");if(s.length){var u=n.offset().top,l=u+n.outerHeight(),d=s.offset().top,h=d+s.outerHeight();(dl)&&n.scrollTop(n.scrollTop()-u+d)}}},n.onremove=function(t){r.a.cache.discussionListPaneScrollTop=$(t.dom).scrollTop(),$(document).off("mousemove",c)},n.enoughSpace=function(){return!$(".App-navigation").is(":visible")},e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var i=n(1),r=n(0),o=n(4),s=n(12),a=n(14),c=n(8),u=n(30),l=n(7),d=n(26),h=n(3),f=n(80),p=n(19),g=n(117),v=n(53),b=n(43),y=n(120),w=(n(9),n(10)),x=n(23),N=n(82),_=n(28),O=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),this.subtree=new v.a((function(){return n.attrs.discussion.freshness}),(function(){var t=r.a.session.user&&r.a.session.user.markedAllAsReadAt();return t&&t.getTime()}),(function(){return n.active()}))},n.elementAttrs=function(){return{className:Object(w.a)(["DiscussionListItem",this.active()?"active":"",this.attrs.discussion.isHidden()?"DiscussionListItem--hidden":"","ontouchstart"in window?"Slidable":""])}},n.view=function(){var t=this.attrs.discussion,e=t.user(),n=t.isUnread(),i=t.isRead(),o=!this.showRepliesCount()&&n,h=0,g=b.a.controls(t,this).toArray(),v=this.elementAttrs();if(this.attrs.params.q){var y=t.mostRelevantPost();y&&(h=y.number());var w=Object(N.a)(this.attrs.params.q);this.highlightRegExp=new RegExp(w+"|"+w.trim().replace(/\s+/g,"|"),"gi")}else h=Math.min(t.lastPostNumber(),(t.lastReadPostNumber()||0)+1);return m("div",v,g.length?p.a.component({icon:"fas fa-ellipsis-v",className:"DiscussionListItem-controls",buttonClassName:"Button Button--icon Button--flat Slidable-underneath Slidable-underneath--right",accessibleToggleLabel:r.a.translator.trans("core.forum.discussion_controls.toggle_dropdown_accessible_label")},g):"",m("span",{className:"Slidable-underneath Slidable-underneath--left Slidable-underneath--elastic"+(n?"":" disabled"),onclick:this.markAsRead.bind(this)},Object(l.a)("fas fa-check")),m("div",{className:"DiscussionListItem-content Slidable-content"+(n?" unread":"")+(i?" read":"")},m(_.a,{text:r.a.translator.trans("core.forum.discussion_list.started_text",{user:e,ago:Object(d.a)(t.createdAt())}),position:"right"},m(s.a,{className:"DiscussionListItem-author",href:e?r.a.route.user(e):"#"},Object(a.a)(e,{title:""}))),m("ul",{className:"DiscussionListItem-badges badges"},Object(c.a)(t.badges().toArray())),m(s.a,{href:r.a.route.discussion(t,h),className:"DiscussionListItem-main"},m("h3",{className:"DiscussionListItem-title"},Object(u.a)(t.title(),this.highlightRegExp)),m("ul",{className:"DiscussionListItem-info"},Object(c.a)(this.infoItems().toArray()))),m("span",{tabindex:"0",role:"button",className:"DiscussionListItem-count",onclick:this.markAsRead.bind(this),title:o?r.a.translator.trans("core.forum.discussion_list.mark_as_read_tooltip"):""},Object(f.a)(t[o?"unreadCount":"replyCount"]()))))},n.oncreate=function(e){if(t.prototype.oncreate.call(this,e),"ontouchstart"in window){var n=Object(y.a)(this.$());this.$(".DiscussionListItem-controls").on("hidden.bs.dropdown",(function(){return n.reset()}))}},n.onbeforeupdate=function(e,n){return t.prototype.onbeforeupdate.call(this,e,n),this.subtree.needsRebuild()},n.active=function(){return r.a.current.matches(x.a,{discussion:this.attrs.discussion})},n.showFirstPost=function(){return-1!==["newest","oldest"].indexOf(this.attrs.params.sort)},n.showRepliesCount=function(){return"replies"===this.attrs.params.sort},n.markAsRead=function(){var t=this.attrs.discussion;t.isUnread()&&(t.save({lastReadPostNumber:t.lastPostNumber()}),m.redraw())},n.infoItems=function(){var t=new h.a;if(this.attrs.params.q){var e=this.attrs.discussion.mostRelevantPost()||this.attrs.discussion.firstPost();if(e&&"comment"===e.contentType()){var n=Object(u.a)(e.contentPlain(),this.highlightRegExp,175);t.add("excerpt",n,-100)}}else t.add("terminalPost",g.a.component({discussion:this.attrs.discussion,lastPost:!this.showFirstPost()}));return t},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(1),r=n(0),o=n(4),s=n(39),a=n(7),c=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.prototype.view=function(){var t=this.attrs.discussion,e=this.attrs.lastPost&&t.replyCount(),n=t[e?"lastPostedUser":"user"](),i=t[e?"lastPostedAt":"createdAt"]();return m("span",null,e?Object(a.a)("fas fa-reply"):""," ",r.a.translator.trans("core.forum.discussion_list."+(e?"replied":"started")+"_text",{user:n,ago:Object(s.a)(i)}))},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(1),r=n(0),o=n(16),s=n(2),a=n(9),c=n(11),u=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.email=Object(c.a)(this.attrs.email||""),this.success=!1},n.className=function(){return"ForgotPasswordModal Modal--small"},n.title=function(){return r.a.translator.trans("core.forum.forgot_password.title")},n.content=function(){return this.success?m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},r.a.translator.trans("core.forum.forgot_password.email_sent_message")),m("div",{className:"Form-group"},m(s.a,{className:"Button Button--primary Button--block",onclick:this.hide.bind(this)},r.a.translator.trans("core.forum.forgot_password.dismiss_button"))))):m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},r.a.translator.trans("core.forum.forgot_password.text")),m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"email",type:"email",placeholder:Object(a.a)(r.a.translator.trans("core.forum.forgot_password.email_placeholder")),bidi:this.email,disabled:this.loading})),m("div",{className:"Form-group"},s.a.component({className:"Button Button--primary Button--block",type:"submit",loading:this.loading},r.a.translator.trans("core.forum.forgot_password.submit_button")))))},n.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0,r.a.request({method:"POST",url:r.a.forum.attribute("apiUrl")+"/forgot",body:{email:this.email()},errorHandler:this.onerror.bind(this)}).then((function(){e.success=!0,e.alert=null})).catch((function(){})).then(this.loaded.bind(this))},n.onerror=function(e){404===e.status&&(e.alert.content=r.a.translator.trans("core.forum.forgot_password.not_found_message")),t.prototype.onerror.call(this,e)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(1),r=n(0),o=n(16),s=n(2),a=n(11),c=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.discussion=this.attrs.discussion,this.currentTitle=this.attrs.currentTitle,this.newTitle=Object(a.a)(this.currentTitle)},n.className=function(){return"RenameDiscussionModal Modal--small"},n.title=function(){return r.a.translator.trans("core.forum.rename_discussion.title")},n.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("div",{className:"Form-group"},m("input",{className:"FormControl",bidi:this.newTitle,type:"text"})),m("div",{className:"Form-group"},s.a.component({className:"Button Button--primary Button--block",type:"submit",loading:this.loading},r.a.translator.trans("core.forum.rename_discussion.submit_button")))))},n.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0;var n=this.newTitle(),i=this.currentTitle;if(n&&n!==i)return this.discussion.save({title:n}).then((function(){r.a.viewingDiscussion(e.discussion)&&r.a.current.get("stream").update(),m.redraw(),e.hide()})).catch((function(){e.loading=!1,m.redraw()}));this.hide()},e}(o.a)},function(t,e,n){"use strict";function i(t){var e,n,i,r,o=$(t),s=!1,a=!1,c=0,u=function(t,e){void 0===e&&(e={}),e.duration=e.duration||"fast",e.step=function(t){$(this).css("transform","translate("+t+"px, 0)")},o.find(".Slidable-content").animate({"background-position-x":t},e)},l=function(){u(0,{complete:function(){o.removeClass("sliding"),e.hide(),n.hide(),a=!1}})};return o.find(".Slidable-content").on("touchstart",(function(t){e=o.find(".Slidable-underneath--left:not(.disabled)"),n=o.find(".Slidable-underneath--right:not(.disabled)"),i=t.originalEvent.targetTouches[0].clientX,r=t.originalEvent.targetTouches[0].clientY,s=!0,c=0})).on("touchmove",(function(t){var u=t.originalEvent.targetTouches[0].clientX,l=t.originalEvent.targetTouches[0].clientY;if(s&&Math.abs(u-i)>Math.abs(l-r)&&(a=!0),s=!1,a){c=u-i;var d=function(t,e){if(t.length){var n="left"===e?c>0:c<0;n&&t.hasClass("Slidable-underneath--elastic")&&(c-=.5*c),t.toggle(n);var i=Math.max(0,Math.min(1,(Math.abs(c)-25)/50));t.find(".icon").css("transform","scale("+i+")")}else c=Math["left"===e?"min":"max"](0,c)};d(e,"left"),d(n,"right"),$(this).css("transform","translate("+c+"px, 0)"),$(this).css("background-position-x",c+"px"),o.toggleClass("sliding",!!c),t.preventDefault()}})).on("touchend",(function(){var t=function(t){t.click(),t.hasClass("Slidable-underneath--elastic")?l():u((c>0?1:-1)*o.width())};n.length&&c<-50?t(n):e.length&&c>50?t(e):l(),s=!1,a=!1})),{reset:l}}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var i=n(1),r=n(0),o=n(4),s=n(40),a=n(122),c=n(123),u=n(2),l=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.discussion=this.attrs.discussion,this.stream=this.attrs.stream,this.scrollListener=new s.a(this.onscroll.bind(this))},n.view=function(){var t,e=this,n=this.stream.viewingEnd(),i=this.stream.posts(),o=this.discussion.postIds(),s=function(t){$(t.dom).addClass("fadeIn"),setTimeout((function(){return $(t.dom).removeClass("fadeIn")}),500)},l=i.map((function(n,i){var c,u={"data-index":e.stream.visibleStart+i};if(n){var l=n.createdAt(),d=r.a.postComponents[n.contentType()];c=d?d.component({post:n}):"",u.key="post"+n.id(),u.oncreate=s,u["data-time"]=l.toISOString(),u["data-number"]=n.number(),u["data-id"]=n.id(),u["data-type"]=n.contentType();var h=l-t;h>3456e5&&(c=[m("div",{className:"PostStream-timeGap"},m("span",null,r.a.translator.trans("core.forum.post_stream.time_lapsed_text",{period:dayjs().add(h,"ms").fromNow(!0)}))),c]),t=l}else u.key="post"+o[e.stream.visibleStart+i],c=a.a.component();return m("div",Object.assign({className:"PostStream-item"},u),c)}));return!n&&i[this.stream.visibleEnd-this.stream.visibleStart-1]&&l.push(m("div",{className:"PostStream-loadMore",key:"loadMore"},m(u.a,{className:"Button",onclick:this.stream.loadNext.bind(this.stream)},r.a.translator.trans("core.forum.post_stream.load_more_button")))),!n||r.a.session.user&&!this.discussion.canReply()||l.push(m("div",{className:"PostStream-item",key:"reply","data-index":this.stream.count(),oncreate:s},c.a.component({discussion:this.discussion}))),m("div",{className:"PostStream"},l)},n.onupdate=function(e){t.prototype.onupdate.call(this,e),this.triggerScroll()},n.oncreate=function(e){var n=this;t.prototype.oncreate.call(this,e),this.triggerScroll(),setTimeout((function(){return n.scrollListener.start()}))},n.onremove=function(e){t.prototype.onremove.call(this,e),this.scrollListener.stop(),clearTimeout(this.calculatePositionTimeout)},n.triggerScroll=function(){if(this.stream.needsScroll){var t=this.stream.targetPost;this.stream.needsScroll=!1,"number"in t?this.scrollToNumber(t.number,this.stream.animateScroll):"index"in t&&this.scrollToIndex(t.index,this.stream.animateScroll,t.reply)}},n.onscroll=function(t){void 0===t&&(t=window.pageYOffset),this.stream.paused||this.stream.pagesLoading||(this.updateScrubber(t),this.loadPostsIfNeeded(t),clearTimeout(this.calculatePositionTimeout),this.calculatePositionTimeout=setTimeout(this.calculatePosition.bind(this,t),100))},n.loadPostsIfNeeded=function(t){void 0===t&&(t=window.pageYOffset);var e=this.getMarginTop(),n=$(window).height()-e,i=t+e;if(this.stream.visibleStart>0){var r=this.$(".PostStream-item[data-index="+this.stream.visibleStart+"]");r.length&&r.offset().top>i-300&&this.stream.loadPrevious()}if(this.stream.visibleEndi+n)return!1;var c=Math.max(0,i-e),u=Math.min(r,i+n-e)-c;null===a&&(a=parseFloat(t.data("index"))+c/r),u>0&&(o+=u/r);var l=t.data("time");l&&(s=l)})),this.stream.index=null!==a?a+1:this.stream.count(),this.stream.visible=o,s&&(this.stream.description=dayjs(s).format("MMMM YYYY"))},n.calculatePosition=function(t){void 0===t&&(t=window.pageYOffset);var e,n,i=this.getMarginTop(),r=$(window),o=r.height()-i,s=r.scrollTop()+i,a=t+i;this.$(".PostStream-item").each((function(){var t=$(this),i=t.offset().top,r=t.outerHeight(!0),c=Math.max(0,a-i);if(void 0===e&&(c/r<.75||(r-c)/o>.25)&&(e=t.data("number")),i+r>s){if(!(i+rd){var h=i?u-$(window).height()+r.a.composer.computedHeight():t.is(":first-child")?0:c;e?h!==l&&s.animate({scrollTop:h},"fast"):s.scrollTop(h)}}var f=function(){o.updateScrubber(),void 0!==a&&(o.stream.index=a+1)};return f(),this.stream.forceUpdateScrubber=!0,Promise.all([s.promise(),this.stream.loadPromise]).then((function(){var t;if(m.redraw.sync(),i){var e=$(".PostStream-item:last-child");$(window).scrollTop(e.offset().top+e.height()-$(window).height()+r.a.composer.computedHeight())}else 0===a?$(window).scrollTop(0):(t=$(".PostStream-item[data-index="+a+"]").offset())&&$(window).scrollTop(t.top-o.getMarginTop());f(),o.calculatePosition(),o.stream.paused=!1,o.loadPostsIfNeeded()}))},n.flashItem=function(t){t.removeClass("fadeIn"),t.addClass("flash").on("animationend webkitAnimationEnd",(function(e){t.removeClass("flash")}))},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(1),r=n(4),o=n(14),s=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.prototype.view=function(){return m("div",{className:"Post CommentPost LoadingPost"},m("header",{className:"Post-header"},Object(o.a)(null,{className:"PostUser-avatar"}),m("div",{className:"fakeText"})),m("div",{className:"Post-body"},m("div",{className:"fakeText"}),m("div",{className:"fakeText"}),m("div",{className:"fakeText"})))},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var i=n(1),r=n(0),o=n(4),s=n(14),a=n(20),c=n(43),u=n(64),l=n(8),d=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){var t=this;if(r.a.composer.composingReplyTo(this.attrs.discussion))return m("article",{className:"Post CommentPost editing"},m("header",{className:"Post-header"},m("div",{className:"PostUser"},m("h3",null,Object(s.a)(r.a.session.user,{className:"PostUser-avatar"}),Object(a.a)(r.a.session.user)),m("ul",{className:"PostUser-badges badges"},Object(l.a)(r.a.session.user.badges().toArray())))),m(u.a,{className:"Post-body",composer:r.a.composer,surround:this.anchorPreview.bind(this)}));return m("article",{className:"Post ReplyPlaceholder",onclick:function(){c.a.replyAction.call(t.attrs.discussion,!0).catch((function(){}))}},m("header",{className:"Post-header"},Object(s.a)(r.a.session.user,{className:"PostUser-avatar"})," ",r.a.translator.trans("core.forum.post_stream.reply_placeholder")))},n.anchorPreview=function(t){var e=$(window).scrollTop()+$(window).height()>=$(document).height();t(),e&&$(window).scrollTop($(document).height())},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(1),r=n(0),o=n(4),s=n(7),a=n(74),c=n(40),u=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.stream=this.attrs.stream,this.handlers={},this.scrollListener=new c.a(this.updateScrubberValues.bind(this,{fromScroll:!0,forceHeightChange:!0}))},n.view=function(){var t=this.stream.count(),e=r.a.translator.trans("core.forum.post_scrubber.viewing_text",{count:t,index:m("span",{className:"Scrubber-index"}),formattedCount:m("span",{className:"Scrubber-count"},Object(a.a)(t))}),n=this.stream.discussion.unreadCount(),i=t?Math.min(t-this.stream.index,n)/t:0;function o(t){var e=$(t.dom),n={top:100-100*i+"%",height:100*i+"%"};t.state.oldStyle?e.stop(!0).css(t.state.oldStyle).animate(n):e.css(n),t.state.oldStyle=n}var c=["PostStreamScrubber","Dropdown"];return this.attrs.className&&c.push(this.attrs.className),m("div",{className:c.join(" ")},m("button",{className:"Button Dropdown-toggle","data-toggle":"dropdown"},e," ",Object(s.a)("fas fa-sort")),m("div",{className:"Dropdown-menu dropdown-menu"},m("div",{className:"Scrubber"},m("a",{className:"Scrubber-first",onclick:this.goToFirst.bind(this)},Object(s.a)("fas fa-angle-double-up")," ",r.a.translator.trans("core.forum.post_scrubber.original_post_link")),m("div",{className:"Scrubber-scrollbar"},m("div",{className:"Scrubber-before"}),m("div",{className:"Scrubber-handle"},m("div",{className:"Scrubber-bar"}),m("div",{className:"Scrubber-info"},m("strong",null,e),m("span",{className:"Scrubber-description"}))),m("div",{className:"Scrubber-after"}),m("div",{className:"Scrubber-unread",oncreate:o,onupdate:o},r.a.translator.trans("core.forum.post_scrubber.unread_text",{count:n}))),m("a",{className:"Scrubber-last",onclick:this.goToLast.bind(this)},Object(s.a)("fas fa-angle-double-down")," ",r.a.translator.trans("core.forum.post_scrubber.now_link")))))},n.onupdate=function(e){var n=this;t.prototype.onupdate.call(this,e),this.stream.forceUpdateScrubber&&(this.stream.forceUpdateScrubber=!1,this.stream.loadPromise.then((function(){return n.updateScrubberValues({animate:!0,forceHeightChange:!0})})))},n.oncreate=function(e){var n=this;t.prototype.oncreate.call(this,e),$(window).on("resize",this.handlers.onresize=this.onresize.bind(this)).resize(),this.$(".Scrubber-scrollbar").bind("click",this.onclick.bind(this)).bind("dragstart mousedown touchstart",(function(t){return t.preventDefault()})),this.dragging=!1,this.mouseStart=0,this.indexStart=0,this.$(".Scrubber-handle").bind("mousedown touchstart",this.onmousedown.bind(this)).click((function(t){return t.stopPropagation()})),$(document).on("mousemove touchmove",this.handlers.onmousemove=this.onmousemove.bind(this)).on("mouseup touchend",this.handlers.onmouseup=this.onmouseup.bind(this)),setTimeout((function(){return n.scrollListener.start()})),this.stream.loadPromise.then((function(){return n.updateScrubberValues({animate:!1,forceHeightChange:!0})}))},n.onremove=function(e){t.prototype.onremove.call(this,e),this.scrollListener.stop(),$(window).off("resize",this.handlers.onresize),$(document).off("mousemove touchmove",this.handlers.onmousemove).off("mouseup touchend",this.handlers.onmouseup)},n.updateScrubberValues=function(t){var e=this;void 0===t&&(t={});var n=this.stream.index,i=this.stream.count(),r=this.stream.visible||1,o=this.percentPerPost(),s=this.$();s.find(".Scrubber-index").text(Object(a.a)(this.stream.sanitizeIndex(Math.max(1,n)))),s.find(".Scrubber-description").text(this.stream.description),s.toggleClass("disabled",this.stream.disabled());var c={};if(c.before=Math.max(0,o.index*Math.min(n-1,i-r)),c.handle=Math.min(100-c.before,o.visible*r),c.after=100-c.before-c.handle,!(t.fromScroll&&this.stream.paused||this.adjustingHeight&&!t.forceHeightChange)){var u=t.animate?"animate":"css";this.adjustingHeight=!0;var l=[];for(var d in c){var h=s.find(".Scrubber-"+d);l.push(h.stop(!0,!0)[u]({height:c[d]+"%"},"fast").promise()),"animate"===u&&h.css("overflow","visible")}Promise.all(l).then((function(){return e.adjustingHeight=!1}))}},n.goToFirst=function(){this.stream.goToFirst(),this.updateScrubberValues({animate:!0,forceHeightChange:!0})},n.goToLast=function(){this.stream.goToLast(),this.updateScrubberValues({animate:!0,forceHeightChange:!0})},n.onresize=function(){var t=this.$(),e=this.$(".Scrubber-scrollbar");e.css("max-height",$(window).height()-t.offset().top+$(window).scrollTop()-parseInt($("#app").css("padding-bottom"),10)-(t.outerHeight()-e.outerHeight()))},n.onmousedown=function(t){t.redraw=!1,this.mouseStart=t.clientY||t.originalEvent.touches[0].clientY,this.indexStart=this.stream.index,this.dragging=!0,$("body").css("cursor","move"),this.$().toggleClass("dragging",this.dragging)},n.onmousemove=function(t){if(this.dragging){var e=((t.clientY||t.originalEvent.touches[0].clientY)-this.mouseStart)/this.$(".Scrubber-scrollbar").outerHeight()*100/this.percentPerPost().index||0,n=Math.min(this.indexStart+e,this.stream.count()-1);this.stream.index=Math.max(0,n),this.updateScrubberValues()}},n.onmouseup=function(){if(this.$().toggleClass("dragging",this.dragging),this.dragging){this.mouseStart=0,this.indexStart=0,this.dragging=!1,$("body").css("cursor",""),this.$().removeClass("open");var t=Math.floor(this.stream.index);this.stream.goToIndex(t)}},n.onclick=function(t){var e=this.$(".Scrubber-scrollbar"),n=((t.pageY||t.originalEvent.touches[0].pageY)-e.offset().top+$("body").scrollTop())/e.outerHeight()*100,i=(n-=parseFloat(e.find(".Scrubber-handle")[0].style.height)/2)/this.percentPerPost().index;i=Math.max(0,Math.min(this.stream.count()-1,i)),this.stream.goToIndex(Math.floor(i)),this.updateScrubberValues({animate:!0,forceHeightChange:!0}),this.$().removeClass("open")},n.percentPerPost=function(){var t=this.stream.count()||1,e=this.stream.visible||1,n=50/this.$(".Scrubber-scrollbar").outerHeight()*100,i=Math.max(100/t,n/e),r=t===e?0:(100-i*e)/(t-e);return{index:r,visible:i}},e}(o.a)},function(t,e,n){"use strict";var i=n(0),r=n(51),o=n(84),s=function(){function t(t,e){void 0===e&&(e=[]),this.discussion=t,this.paused=!1,this.loadPageTimeouts={},this.pagesLoading=0,this.index=0,this.number=1,this.visible=1,this.description="",this.forceUpdateScrubber=!1,this.loadNext=Object(r.b)(300,this._loadNext),this.loadPrevious=Object(r.b)(300,this._loadPrevious),this.show(e)}var e=t.prototype;return e.update=function(){return this.viewingEnd()?(this.visibleEnd=this.count(),this.loadRange(this.visibleStart,this.visibleEnd)):Promise.resolve()},e.goToFirst=function(){return this.goToIndex(0)},e.goToLast=function(){return this.goToIndex(this.count()-1,!0)},e.goToNumber=function(t,e){if(void 0===e&&(e=!1),"reply"===t){var n=this.goToLast();return this.targetPost.reply=!0,n}return this.paused=!0,this.loadPromise=this.loadNearNumber(t),this.needsScroll=!0,this.targetPost={number:t},this.animateScroll=!e,this.number=t,this.loadPromise.then((function(){return m.redraw()}))},e.goToIndex=function(t,e){return void 0===e&&(e=!1),this.paused=!0,this.loadPromise=this.loadNearIndex(t),this.needsScroll=!0,this.targetPost={index:t},this.animateScroll=!e,this.index=t,m.redraw(),this.loadPromise},e.loadNearNumber=function(t){return this.posts().some((function(e){return e&&Number(e.number())===Number(t)}))?Promise.resolve():(this.reset(),i.a.store.find("posts",{filter:{discussion:this.discussion.id()},page:{near:t}}).then(this.show.bind(this)))},e.loadNearIndex=function(t){if(t>=this.visibleStart&&tthis.visibleStart&&n>=0&&(this.visibleStart=n+this.constructor.loadCount+1,this.loadPageTimeouts[n]&&(clearTimeout(this.loadPageTimeouts[n]),this.loadPageTimeouts[n]=null,this.pagesLoading--)),this.loadPage(t,e)},e._loadPrevious=function(){var t=this.visibleStart,e=this.visibleStart=this.sanitizeIndex(this.visibleStart-this.constructor.loadCount),n=e+2*this.constructor.loadCount;ni.visibleEnd)){var r=n?i.visibleEnd-1:i.visibleStart;Object(o.a)('.PostStream-item[data-index="'+r+'"]',m.redraw.sync)}};r(),this.loadPageTimeouts[t]=setTimeout((function(){i.loadRange(t,e).then((function(){r(),i.pagesLoading--})),i.loadPageTimeouts[t]=null}),this.pagesLoading-1?1e3:0)},e.loadRange=function(t,e){var n=[],r=[];return this.discussion.postIds().slice(t,e).forEach((function(t){var e=i.a.store.getById("posts",t);e&&e.discussion()&&void 0!==e.canEdit()?r.push(e):n.push(t)})),n.length?i.a.store.find("posts",n).then((function(t){return r.concat(t).sort((function(t,e){return t.createdAt()-e.createdAt()}))})):Promise.resolve(r)},e.show=function(t){this.visibleStart=t.length?this.discussion.postIds().indexOf(t[0].id()):0,this.visibleEnd=this.sanitizeIndex(this.visibleStart+t.length)},e.reset=function(t,e){this.visibleStart=t||0,this.visibleEnd=this.sanitizeIndex(e||this.constructor.loadCount)},e.posts=function(){return this.discussion.postIds().slice(this.visibleStart,this.visibleEnd).map((function(t){var e=i.a.store.getById("posts",t);return e&&e.discussion()&&void 0!==e.canEdit()?e:null}))},e.count=function(){return this.discussion.postIds().length},e.disabled=function(){return this.visible>=this.count()},e.viewingEnd=function(){return Math.abs(this.count()-this.visibleEnd)<=1},e.sanitizeIndex=function(t){return Math.max(0,Math.min(this.count(),Math.floor(t)))},t}();s.loadCount=20,e.a=s},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(4),o=n(3),s=n(8),a=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){return m("ul",{className:"Header-controls"},Object(s.a)(this.items().toArray()))},n.items=function(){return new o.a},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var i=n(1),r=n(0),o=n(4),s=n(2),a=n(35),c=n(44),u=n(128),l=n(32),d=n(129),h=n(3),f=n(8),p=n(130),g=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){return m("ul",{className:"Header-controls"},Object(f.a)(this.items().toArray()))},n.items=function(){var t=new h.a;if(t.add("search",p.a.component({state:r.a.search}),30),r.a.forum.attribute("showLanguageSelector")&&Object.keys(r.a.data.locales).length>1){var e=[],n=function(t){e.push(s.a.component({active:r.a.data.locale===t,icon:r.a.data.locale!==t||"fas fa-check",onclick:function(){r.a.session.user?r.a.session.user.savePreferences({locale:t}).then((function(){return window.location.reload()})):(document.cookie="locale="+t+"; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT",window.location.reload())}},r.a.data.locales[t]))};for(var i in r.a.data.locales)n(i);t.add("locale",l.a.component({buttonClassName:"Button Button--link",accessibleToggleLabel:r.a.translator.trans("core.forum.header.locale_dropdown_accessible_label")},e),20)}return r.a.session.user?(t.add("notifications",d.a.component({state:r.a.notifications}),10),t.add("session",u.a.component(),0)):(r.a.forum.attribute("allowSignUp")&&t.add("signUp",s.a.component({className:"Button Button--link",onclick:function(){return r.a.modal.show(c.a)}},r.a.translator.trans("core.forum.header.sign_up_link")),10),t.add("logIn",s.a.component({className:"Button Button--link",onclick:function(){return r.a.modal.show(a.a)}},r.a.translator.trans("core.forum.header.log_in_link")),0)),t},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var i=n(13),r=n(1),o=n(0),s=n(14),a=n(20),c=n(19),u=n(17),l=n(2),d=n(3),h=n(24),f=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.className="SessionDropdown",e.buttonClassName="Button Button--user Button--flat",e.menuClassName="Dropdown-menu--right",e.accessibleToggleLabel=o.a.translator.trans("core.forum.header.session_dropdown_accessible_label")};var n=e.prototype;return n.view=function(e){return t.prototype.view.call(this,Object(i.a)({},e,{children:this.items().toArray()}))},n.getButtonContent=function(){var t=o.a.session.user;return[Object(s.a)(t)," ",m("span",{className:"Button-label"},Object(a.a)(t))]},n.items=function(){var t=new d.a,e=o.a.session.user;return t.add("profile",u.a.component({icon:"fas fa-user",href:o.a.route.user(e)},o.a.translator.trans("core.forum.header.profile_button")),100),t.add("settings",u.a.component({icon:"fas fa-cog",href:o.a.route("settings")},o.a.translator.trans("core.forum.header.settings_button")),50),o.a.forum.attribute("adminUrl")&&t.add("administration",u.a.component({icon:"fas fa-wrench",href:o.a.forum.attribute("adminUrl"),target:"_blank"},o.a.translator.trans("core.forum.header.admin_button")),0),t.add("separator",h.a.component(),-90),t.add("logOut",l.a.component({icon:"fas fa-sign-out-alt",onclick:o.a.session.logout.bind(o.a.session)},o.a.translator.trans("core.forum.header.log_out_button")),-100),t},e}(c.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(1),r=n(0),o=n(19),s=n(7),a=n(10),c=n(65),u=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t),e.initAttrs=function(e){e.className=e.className||"NotificationsDropdown",e.buttonClassName=e.buttonClassName||"Button Button--flat",e.menuClassName=e.menuClassName||"Dropdown-menu--right",e.label=e.label||r.a.translator.trans("core.forum.notifications.tooltip"),e.icon=e.icon||"fas fa-bell",e.accessibleToggleLabel=e.accessibleToggleLabel||r.a.translator.trans("core.forum.notifications.toggle_dropdown_accessible_label"),t.initAttrs.call(this,e)};var n=e.prototype;return n.getButton=function(){var e=this.getNewCount(),n=t.prototype.getButton.call(this);return n.attrs.title=this.attrs.label,n.attrs.className=Object(a.a)(n.attrs.className,[e&&"new"]),n.attrs.onclick=this.onclick.bind(this),n},n.getButtonContent=function(){var t=this.getUnreadCount();return[Object(s.a)(this.attrs.icon,{className:"Button-icon"}),0!==t&&m("span",{className:"NotificationsDropdown-unread"},t),m("span",{className:"Button-label"},this.attrs.label)]},n.getMenu=function(){return m("div",{className:Object(a.a)("Dropdown-menu",this.attrs.menuClassName),onclick:this.menuClick.bind(this)},this.showing&&c.a.component({state:this.attrs.state}))},n.onclick=function(){r.a.drawer.isOpen()?this.goToRoute():this.attrs.state.load()},n.goToRoute=function(){m.route.set(r.a.route("notifications"))},n.getUnreadCount=function(){return r.a.session.user.unreadNotificationCount()},n.getNewCount=function(){return r.a.session.user.newNotificationCount()},n.menuClick=function(t){(t.shiftKey||t.metaKey||t.ctrlKey||2===t.which)&&t.stopPropagation()},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var i=n(1),r=n(0),o=n(4),s=n(15),a=n(3),c=n(10),u=n(9),l=n(131),d=n(7),h=n(132),f=n(133),p=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),r=0;r.FormControl").getBoundingClientRect().bottom-14;this.element.querySelector(".Search-results").style["max-height"]=t+"px"},n.onupdate=function(e){t.prototype.onupdate.call(this,e),this.setIndex(this.getCurrentNumericIndex()),this.sources.length&&this.updateMaxHeight()},n.oncreate=function(n){var i=this;t.prototype.oncreate.call(this,n);var r=this,o=this.state;this.setIndex(this.getCurrentNumericIndex()),this.$(".Search-results").on("mousedown",(function(t){return t.preventDefault()})).on("click",(function(){return i.$("input").trigger("blur")})).on("mouseenter","> li:not(.Dropdown-header)",(function(){r.setIndex(r.selectableItems().index(this))}));var s=this.$("input");this.navigator=new l.a,this.navigator.onUp((function(){return i.setIndex(i.getCurrentNumericIndex()-1,!0)})).onDown((function(){return i.setIndex(i.getCurrentNumericIndex()+1,!0)})).onSelect(this.selectResult.bind(this)).onCancel(this.clear.bind(this)).bindTo(s),s.on("input focus",(function(){var t=this.value.toLowerCase();t&&(clearTimeout(r.searchTimeout),r.searchTimeout=setTimeout((function(){o.isCached(t)||(t.length>=e.MIN_SEARCH_LEN&&r.sources.map((function(e){e.search&&(r.loadingSources++,e.search(t).then((function(){r.loadingSources=Math.max(0,r.loadingSources-1),m.redraw()})))})),o.cache(t),m.redraw())}),250))})).on("focus",(function(){$(this).one("mouseup",(function(t){return t.preventDefault()})).trigger("select")})),this.updateMaxHeightHandler=this.updateMaxHeight.bind(this),window.addEventListener("resize",this.updateMaxHeightHandler)},n.onremove=function(e){t.prototype.onremove.call(this,e),window.removeEventListener("resize",this.updateMaxHeightHandler)},n.selectResult=function(){clearTimeout(this.searchTimeout),this.loadingSources=0,this.state.getValue()?m.route.set(this.getItem(this.index).find("a").attr("href")):this.clear(),this.$("input").blur()},n.clear=function(){this.state.clear()},n.sourceItems=function(){var t=new a.a;return r.a.forum.attribute("canViewForum")&&t.add("discussions",new h.a),r.a.forum.attribute("canSearchUsers")&&t.add("users",new f.a),t},n.selectableItems=function(){return this.$(".Search-results > li:not(.Dropdown-header)")},n.getCurrentNumericIndex=function(){return this.selectableItems().index(this.getItem(this.index))},n.getItem=function(t){var e=this.selectableItems(),n=e.filter('[data-index="'+t+'"]');return n.length||(n=e.eq(t)),n},n.setIndex=function(t,e){void 0===e&&(e=!1);var n=this.selectableItems(),i=n.parent(),r=t;t<0?r=n.length-1:t>=n.length&&(r=0);var o=n.removeClass("active").eq(r).addClass("active");if(this.index=parseInt(o.attr("data-index"))||r,e){var s,a=i.scrollTop(),c=i.offset().top,u=c+i.outerHeight(),l=o.offset().top,d=l+o.outerHeight();lu&&(s=a-u+d+parseInt(i.css("padding-bottom"),10)),void 0!==s&&i.stop(!0).animate({scrollTop:s},100)}},e}(o.a);p.MIN_SEARCH_LEN=3},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(){this.callbacks=new Map,this.whenCallback=function(t){return!0}}var e=t.prototype;return e.onUp=function(t){return this.callbacks.set(38,(function(e){e.preventDefault(),t(e)})),this},e.onDown=function(t){return this.callbacks.set(40,(function(e){e.preventDefault(),t(e)})),this},e.onSelect=function(t){var e=function(e){e.preventDefault(),t(e)};return this.callbacks.set(9,e),this.callbacks.set(13,e),this},e.onCancel=function(t){return this.callbacks.set(27,(function(e){e.stopPropagation(),e.preventDefault(),t(e)})),this},e.onRemove=function(t){return this.callbacks.set(8,(function(e){0===e.target.selectionStart&&0===e.target.selectionEnd&&(t(e),e.preventDefault())})),this},e.when=function(t){return this.whenCallback=t,this},e.bindTo=function(t){t.on("keydown",this.navigate.bind(this))},e.navigate=function(t){if(this.whenCallback(t)){var e=this.callbacks.get(t.which);e&&e(t)}},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(0),r=n(30),o=n(17),s=n(12),a=function(){function t(){this.results=new Map}var e=t.prototype;return e.search=function(t){var e=this;t=t.toLowerCase(),this.results.set(t,[]);var n={filter:{q:t},page:{limit:3},include:"mostRelevantPost"};return i.a.store.find("discussions",n).then((function(n){return e.results.set(t,n)}))},e.view=function(t){t=t.toLowerCase();var e=(this.results.get(t)||[]).map((function(e){var n=e.mostRelevantPost();return m("li",{className:"DiscussionSearchResult","data-index":"discussions"+e.id()},m(s.a,{href:i.a.route.discussion(e,n&&n.number())},m("div",{className:"DiscussionSearchResult-title"},Object(r.a)(e.title(),t)),n?m("div",{className:"DiscussionSearchResult-excerpt"},Object(r.a)(n.contentPlain(),t,100)):""))}));return[m("li",{className:"Dropdown-header"},i.a.translator.trans("core.forum.search.discussions_heading")),m("li",null,m(o.a,{icon:"fas fa-search",href:i.a.route("index",{q:t})},i.a.translator.trans("core.forum.search.all_discussions_button",{query:t})))].concat(e)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(13),r=n(0),o=n(30),s=n(14),a=n(20),c=n(12),u=function(){function t(){this.results=new Map}var e=t.prototype;return e.search=function(t){var e=this;return r.a.store.find("users",{filter:{q:t},page:{limit:5}}).then((function(n){e.results.set(t,n),m.redraw()}))},e.view=function(t){t=t.toLowerCase();var e=(this.results.get(t)||[]).concat(r.a.store.all("users").filter((function(e){return[e.username(),e.displayName()].some((function(e){return e.toLowerCase().substr(0,t.length)===t}))}))).filter((function(t,e,n){return n.lastIndexOf(t)===e})).sort((function(t,e){return t.displayName().localeCompare(e.displayName())}));return e.length?[m("li",{className:"Dropdown-header"},r.a.translator.trans("core.forum.search.users_heading"))].concat(e.map((function(e){var n=Object(a.a)(e),u=[Object(o.a)(n.text,t)];return m("li",{className:"UserSearchResult","data-index":"users"+e.id()},m(c.a,{href:r.a.route.user(e)},Object(s.a)(e),Object(i.a)({},n,{text:void 0,children:u})))}))):[]},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var i=n(13),r=n(1),o=n(0),s=n(4),a=n(3),c=n(60),u=n(8),l=n(10),d=n(21),h=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.state=this.attrs.state,this.active=!1,this.prevPosition=this.state.position},n.view=function(){var t=this.state.body,e={normal:this.state.position===d.a.Position.NORMAL,minimized:this.state.position===d.a.Position.MINIMIZED,fullScreen:this.state.position===d.a.Position.FULLSCREEN,active:this.active,visible:this.state.isVisible()},n=this.state.position===d.a.Position.MINIMIZED?this.state.show.bind(this.state):void 0;return m("div",{className:"Composer "+Object(l.a)(e)},m("div",{className:"Composer-handle",oncreate:this.configHandle.bind(this)}),m("ul",{className:"Composer-controls"},Object(u.a)(this.controlItems().toArray())),m("div",{className:"Composer-content",onclick:n},t.componentClass?t.componentClass.component(Object(i.a)({},t.attrs,{composer:this.state,disabled:e.minimized})):""))},n.onupdate=function(e){t.prototype.onupdate.call(this,e),this.state.position===this.prevPosition?this.updateHeight():(this.animatePositionChange(),this.prevPosition=this.state.position)},n.oncreate=function(e){var n=this;t.prototype.oncreate.call(this,e),this.initializeHeight(),this.$().hide().css("bottom",-this.state.computedHeight()),this.$().on("focus blur",":input,.TextEditor-editorContainer",(function(t){n.active="focusin"===t.type,m.redraw()})),this.$().on("keydown",":input,.TextEditor-editorContainer","esc",(function(){return n.state.close()})),this.handlers={},$(window).on("resize",this.handlers.onresize=this.updateHeight.bind(this)).resize(),$(document).on("mousemove",this.handlers.onmousemove=this.onmousemove.bind(this)).on("mouseup",this.handlers.onmouseup=this.onmouseup.bind(this))},n.onremove=function(e){t.prototype.onremove.call(this,e),$(window).off("resize",this.handlers.onresize),$(document).off("mousemove",this.handlers.onmousemove).off("mouseup",this.handlers.onmouseup)},n.configHandle=function(t){var e=this;$(t.dom).css("cursor","row-resize").bind("dragstart mousedown",(function(t){return t.preventDefault()})).mousedown((function(t){e.mouseStart=t.clientY,e.heightStart=e.$().height(),e.handle=$(this),$("body").css("cursor","row-resize")}))},n.onmousemove=function(t){if(this.handle){var e=this.mouseStart-t.clientY;this.changeHeight(this.heightStart+e);var n=$(window).scrollTop(),i=n>0&&n+$(window).height()>=$(document).height();this.updateBodyPadding(i)}},n.onmouseup=function(){this.handle&&(this.handle=null,$("body").css("cursor",""))},n.focus=function(){this.$(".Composer-content :input:enabled:visible, .TextEditor-editor").first().focus()},n.updateHeight=function(){var t=this.state.computedHeight(),e=this.$(".Composer-flexible");if(this.$().height(t),e.length){var n=e.offset().top-this.$().offset().top,i=parseInt(e.css("padding-bottom"),10),r=this.$(".Composer-footer").outerHeight(!0);e.height(this.$().outerHeight()-n-i-r)}},n.updateBodyPadding=function(){var t=this.state.position!==d.a.Position.HIDDEN&&this.state.position!==d.a.Position.MINIMIZED&&"phone"!==o.a.screen()?this.state.computedHeight()-parseInt($("#app").css("padding-bottom"),10):0;$("#content").css({paddingBottom:t})},n.animatePositionChange=function(){if(this.prevPosition!==d.a.Position.FULLSCREEN||this.state.position!==d.a.Position.NORMAL)switch(this.state.position){case d.a.Position.HIDDEN:return this.hide();case d.a.Position.MINIMIZED:return this.minimize();case d.a.Position.FULLSCREEN:return this.focus();case d.a.Position.NORMAL:return this.show()}else this.focus()},n.animateHeightChange=function(){var t=this.$().stop(!0),e=t.outerHeight(),n=$(window).scrollTop();t.show(),this.updateHeight();var i=t.outerHeight();this.prevPosition===d.a.Position.HIDDEN?t.css({bottom:-i,height:i}):t.css({height:e});var r=t.animate({bottom:0,height:i},"fast").promise();return this.updateBodyPadding(),$(window).scrollTop(n),r},n.showBackdrop=function(){this.$backdrop=$("
").addClass("composer-backdrop").appendTo("body")},n.hideBackdrop=function(){this.$backdrop&&this.$backdrop.remove()},n.show=function(){var t=this;if(this.animateHeightChange().then((function(){return t.focus()})),"phone"===o.a.screen()){var e=document.documentElement,n=Math.min(e.scrollTop,e.scrollHeight-e.clientHeight);this.$().css("top",$(".App").is(".mobile-safari")?n:0),this.showBackdrop()}},n.hide=function(){var t=this,e=this.$();e.stop(!0).animate({bottom:-e.height()},"fast",(function(){e.hide(),t.hideBackdrop(),t.updateBodyPadding()}))},n.minimize=function(){this.animateHeightChange(),this.$().css("top","auto"),this.hideBackdrop()},n.controlItems=function(){var t=new a.a;return this.state.position===d.a.Position.FULLSCREEN?t.add("exitFullScreen",c.a.component({icon:"fas fa-compress",title:o.a.translator.trans("core.forum.composer.exit_full_screen_tooltip"),onclick:this.state.exitFullScreen.bind(this.state)})):(this.state.position!==d.a.Position.MINIMIZED&&(t.add("minimize",c.a.component({icon:"fas fa-minus minimize",title:o.a.translator.trans("core.forum.composer.minimize_tooltip"),onclick:this.state.minimize.bind(this.state),itemClassName:"App-backControl"})),t.add("fullScreen",c.a.component({icon:"fas fa-expand",title:o.a.translator.trans("core.forum.composer.full_screen_tooltip"),onclick:this.state.fullScreen.bind(this.state)}))),t.add("close",c.a.component({icon:"fas fa-times",title:o.a.translator.trans("core.forum.composer.close_tooltip"),onclick:this.state.close.bind(this.state)}))),t},n.initializeHeight=function(){this.state.height=localStorage.getItem("composerHeight"),this.state.height||(this.state.height=this.defaultHeight())},n.defaultHeight=function(){return this.$().height()},n.changeHeight=function(t){this.state.height=t,this.updateHeight(),localStorage.setItem("composerHeight",this.state.height)},e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(1),r=n(0),o=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-pencil-alt"},n.href=function(){var t=this.attrs.notification;return r.a.route.discussion(t.subject(),t.content().postNumber)},n.content=function(){return r.a.translator.trans("core.forum.notifications.discussion_renamed_text",{user:this.attrs.notification.fromUser()})},e}(n(136).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var i=n(1),r=n(0),o=n(4),s=n(14),a=n(7),c=n(39),u=n(2),l=n(12),d=n(10),h=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){var t=this,e=this.attrs.notification,n=this.href();return m(l.a,{className:Object(d.a)("Notification","Notification--"+e.contentType(),[!e.isRead()&&"unread"]),href:n,external:n.includes("://"),onclick:this.markAsRead.bind(this)},Object(s.a)(e.fromUser()),Object(a.a)(this.icon(),{className:"Notification-icon"}),m("span",{className:"Notification-title"},m("span",{className:"Notification-content"},this.content()),m("span",{className:"Notification-title-spring"}),Object(c.a)(e.createdAt())),!e.isRead()&&m(u.a,{className:"Notification-action Button Button--link",icon:"fas fa-check",title:r.a.translator.trans("core.forum.notifications.mark_as_read_tooltip"),onclick:function(e){e.preventDefault(),e.stopPropagation(),t.markAsRead()}}),m("div",{className:"Notification-excerpt"},this.excerpt()))},n.icon=function(){},n.href=function(){},n.content=function(){},n.excerpt=function(){},n.markAsRead=function(){this.attrs.notification.isRead()||(r.a.session.user.pushAttributes({unreadNotificationCount:r.a.session.user.unreadNotificationCount()-1}),this.attrs.notification.save({isRead:!0}))},e}(o.a)},function(t,e,n){"use strict";var i=n(0),r=n(68),o=n(2),s=n(24),a=n(3),c=n(9);e.a={controls:function(t,e){var n=this,i=new a.a;return["user","moderation","destructive"].forEach((function(r){var o=n[r+"Controls"](t,e).toArray();o.length&&(o.forEach((function(t){return i.add(t.itemName,t)})),i.add(r+"Separator",s.a.component()))})),i},userControls:function(t,e){return new a.a},moderationControls:function(t,e){var n=new a.a;return"comment"===t.contentType()&&t.canEdit()&&(t.isHidden()||n.add("edit",o.a.component({icon:"fas fa-pencil-alt",onclick:this.editAction.bind(t)},i.a.translator.trans("core.forum.post_controls.edit_button")))),n},destructiveControls:function(t,e){var n=new a.a;return"comment"!==t.contentType()||t.isHidden()?("comment"===t.contentType()&&t.canHide()&&n.add("restore",o.a.component({icon:"fas fa-reply",onclick:this.restoreAction.bind(t)},i.a.translator.trans("core.forum.post_controls.restore_button"))),t.canDelete()&&n.add("delete",o.a.component({icon:"fas fa-times",onclick:this.deleteAction.bind(t,e)},i.a.translator.trans("core.forum.post_controls.delete_forever_button")))):t.canHide()&&n.add("hide",o.a.component({icon:"far fa-trash-alt",onclick:this.hideAction.bind(t)},i.a.translator.trans("core.forum.post_controls.delete_button"))),n},editAction:function(){var t=this;return new Promise((function(e){return i.a.composer.load(r.a,{post:t}),i.a.composer.show(),e()}))},hideAction:function(){if(confirm(Object(c.a)(i.a.translator.trans("core.forum.post_controls.hide_confirmation"))))return this.pushAttributes({hiddenAt:new Date,hiddenUser:i.a.session.user}),this.save({isHidden:!0}).then((function(){return m.redraw()}))},restoreAction:function(){return this.pushAttributes({hiddenAt:null,hiddenUser:null}),this.save({isHidden:!1}).then((function(){return m.redraw()}))},deleteAction:function(t){var e=this;if(confirm(Object(c.a)(i.a.translator.trans("core.forum.post_controls.delete_confirmation"))))return t&&(t.loading=!0),this.delete().then((function(){var t=e.discussion();t.removePost(e.id()),t.postIds().length||(i.a.discussions.removeDiscussion(t),i.a.viewingDiscussion(t)&&i.a.history.back())})).catch((function(){})).then((function(){t&&(t.loading=!1),m.redraw()}))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var i=n(1),r=n(0),o=n(4),s=n(12),a=n(69),c=n(14),u=n(20),l=n(85),d=n(8),h=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){var t=this.attrs.post,e=t.user();if(!e)return m("div",{className:"PostUser"},m("h3",null,Object(c.a)(e,{className:"PostUser-avatar"})," ",Object(u.a)(e)));var n="";return!t.isHidden()&&this.attrs.cardVisible&&(n=a.a.component({user:e,className:"UserCard--popover",controlsButtonClassName:"Button Button--icon Button--flat"})),m("div",{className:"PostUser"},m("h3",null,m(s.a,{href:r.a.route.user(e)},Object(c.a)(e,{className:"PostUser-avatar"}),Object(l.a)(e),Object(u.a)(e))),m("ul",{className:"PostUser-badges badges"},Object(d.a)(e.badges().toArray())),n)},n.oncreate=function(e){var n,i=this;t.prototype.oncreate.call(this,e),this.$().on("mouseover","h3 a, .UserCard",(function(){clearTimeout(n),n=setTimeout(i.showCard.bind(i),500)})).on("mouseout","h3 a, .UserCard",(function(){clearTimeout(n),n=setTimeout(i.hideCard.bind(i),250)}))},n.showCard=function(){var t=this;this.attrs.oncardshow(),setTimeout((function(){return t.$(".UserCard").addClass("in")}))},n.hideCard=function(){var t=this;this.$(".UserCard").removeClass("in").one("transitionend webkitTransitionEnd oTransitionEnd",(function(){t.attrs.oncardhide()}))},e}(o.a)},function(t,e,n){"use strict";var i=n(0),r=n(2),o=n(24),s=n(70),a=n(36),c=n(3);e.a={controls:function(t,e){var n=this,i=new c.a;return["user","moderation","destructive"].forEach((function(r){var s=n[r+"Controls"](t,e).toArray();s.length&&(s.forEach((function(t){return i.add(t.itemName,t)})),i.add(r+"Separator",m(o.a,null)))})),i},userControls:function(){return new c.a},moderationControls:function(t){var e=new c.a;return(t.canEdit()||t.canEditCredentials()||t.canEditGroups())&&e.add("edit",m(r.a,{icon:"fas fa-pencil-alt",onclick:this.editAction.bind(this,t)},i.a.translator.trans("core.forum.user_controls.edit_button"))),e},destructiveControls:function(t){var e=new c.a;return"1"!==t.id()&&t.canDelete()&&e.add("delete",m(r.a,{icon:"fas fa-times",onclick:this.deleteAction.bind(this,t)},i.a.translator.trans("core.forum.user_controls.delete_button"))),e},deleteAction:function(t){var e=this;confirm(i.a.translator.trans("core.forum.user_controls.delete_confirmation"))&&t.delete().then((function(){e.showDeletionAlert(t,"success"),i.a.current.matches(a.a,{user:t})?i.a.history.back():window.location.reload()})).catch((function(){return e.showDeletionAlert(t,"error")}))},showDeletionAlert:function(t,e){var n={success:"core.forum.user_controls.delete_success_message",error:"core.forum.user_controls.delete_error_message"}[e];i.a.alerts.show({type:e},i.a.translator.trans(n,{user:t,email:t.email()}))},editAction:function(t){i.a.modal.show(s.a,{user:t})}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(1),r=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(t){return t.children[0]},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.boundOnresize=this.onresize.bind(this),$(window).on("resize",this.boundOnresize).resize()},n.onremove=function(e){t.prototype.onremove.call(this,e),$(window).off("resize",this.boundOnresize)},n.onresize=function(){var t=this,e=this.$(),n=$("#header"),i=$("#footer"),r=e.find("> ul");$(window).off(".affix"),r.removeClass("affix affix-top affix-bottom").removeData("bs.affix"),e.outerHeight(!0)>$(window).height()-n.outerHeight(!0)||r.affix({offset:{top:function(){return e.offset().top-n.outerHeight(!0)-parseInt(e.css("margin-top"),10)},bottom:function(){return t.bottom=i.outerHeight(!0)}}})},e}(n(4).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var i=n(1),r=n(0),o=n(4),s=n(14),a=n(7),c=n(8),u=n(3),l=n(10),d=n(2),h=n(15),f=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.loading=!1,this.isDraggedOver=!1},n.view=function(){var t=this.attrs.user;return m("div",{className:Object(l.a)(["AvatarEditor","Dropdown",this.attrs.className,this.loading&&"loading",this.isDraggedOver&&"dragover"])},Object(s.a)(t),m("a",{className:t.avatarUrl()?"Dropdown-toggle":"Dropdown-toggle AvatarEditor--noAvatar",title:r.a.translator.trans("core.forum.user.avatar_upload_tooltip"),"data-toggle":"dropdown",onclick:this.quickUpload.bind(this),ondragover:this.enableDragover.bind(this),ondragenter:this.enableDragover.bind(this),ondragleave:this.disableDragover.bind(this),ondragend:this.disableDragover.bind(this),ondrop:this.dropUpload.bind(this)},this.loading?m(h.a,{display:"unset",size:"large"}):t.avatarUrl()?Object(a.a)("fas fa-pencil-alt"):Object(a.a)("fas fa-plus-circle")),m("ul",{className:"Dropdown-menu Menu"},Object(c.a)(this.controlItems().toArray())))},n.controlItems=function(){var t=new u.a;return t.add("upload",m(d.a,{icon:"fas fa-upload",onclick:this.openPicker.bind(this)},r.a.translator.trans("core.forum.user.avatar_upload_button"))),t.add("remove",m(d.a,{icon:"fas fa-times",onclick:this.remove.bind(this)},r.a.translator.trans("core.forum.user.avatar_remove_button"))),t},n.enableDragover=function(t){t.preventDefault(),t.stopPropagation(),this.isDraggedOver=!0},n.disableDragover=function(t){t.preventDefault(),t.stopPropagation(),this.isDraggedOver=!1},n.dropUpload=function(t){t.preventDefault(),t.stopPropagation(),this.isDraggedOver=!1,this.upload(t.dataTransfer.files[0])},n.quickUpload=function(t){this.attrs.user.avatarUrl()||(t.preventDefault(),t.stopPropagation(),this.openPicker())},n.openPicker=function(){var t=this;this.loading||$('').appendTo("body").hide().click().on("input",(function(e){t.upload($(e.target)[0].files[0])}))},n.upload=function(t){if(!this.loading){var e=this.attrs.user,n=new FormData;n.append("avatar",t),this.loading=!0,m.redraw(),r.a.request({method:"POST",url:r.a.forum.attribute("apiUrl")+"/users/"+e.id()+"/avatar",serialize:function(t){return t},body:n}).then(this.success.bind(this),this.failure.bind(this))}},n.remove=function(){var t=this.attrs.user;this.loading=!0,m.redraw(),r.a.request({method:"DELETE",url:r.a.forum.attribute("apiUrl")+"/users/"+t.id()+"/avatar"}).then(this.success.bind(this),this.failure.bind(this))},n.success=function(t){r.a.store.pushPayload(t),delete this.attrs.user.avatarColor,this.loading=!1,m.redraw()},n.failure=function(t){this.loading=!1,m.redraw()},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(1),r=n(0),o=n(4),s=n(39),a=n(86),c=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){var t=this.attrs.post,e=t.createdAt(),n=this.getPermalink(t),i="ontouchstart"in document.documentElement;return m("div",{className:"Dropdown PostMeta"},m("a",{className:"Dropdown-toggle",onclick:function(t){var e=this;setTimeout((function(){return $(e).parent().find(".PostMeta-permalink").select()})),t.redraw=!1},"data-toggle":"dropdown"},Object(s.a)(e)),m("div",{className:"Dropdown-menu dropdown-menu"},m("span",{className:"PostMeta-number"},r.a.translator.trans("core.forum.post.number_tooltip",{number:t.number()}))," ",m("span",{className:"PostMeta-time"},Object(a.a)(e))," ",m("span",{className:"PostMeta-ip"},t.data.attributes.ipAddress),i?m("a",{className:"Button PostMeta-permalink",href:n},n):m("input",{className:"FormControl PostMeta-permalink",value:n,onclick:function(t){return t.stopPropagation()}})))},n.getPermalink=function(t){return window.location.origin+r.a.route.post(t)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(1),r=n(0),o=n(4),s=n(26),a=n(28),c=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e)},n.view=function(){var t=this.attrs.post,e=t.editedUser(),n=r.a.translator.trans("core.forum.post.edited_tooltip",{user:e,ago:Object(s.a)(t.editedAt())});return m(a.a,{text:n},m("span",{class:"PostEdited"},r.a.translator.trans("core.forum.post.edited_text")))},n.oncreate=function(e){t.prototype.oncreate.call(this,e)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(0),o=n(145),s=n(9),a=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-pencil-alt"},n.description=function(t){var e=r.a.translator.trans("core.forum.post_stream.discussion_renamed_text",t),n=r.a.translator.trans("core.forum.post_stream.discussion_renamed_old_tooltip",t);return m("span",{title:Object(s.a)(n)},e)},n.descriptionData=function(){var t=this.attrs.post,e=t.content()[0],n=t.content()[1];return{old:e,new:m("strong",{className:"DiscussionRenamedPost-new"},n)}},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var i=n(1),r=n(0),o=n(67),s=n(38),a=n(20),c=n(7),u=n(12),l=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.elementAttrs=function(){var e=t.prototype.elementAttrs.call(this);return e.className=(e.className||"")+" EventPost "+Object(s.ucfirst)(this.attrs.post.contentType())+"Post",e},n.content=function(){var e=this.attrs.post.user(),n=Object(a.a)(e),i=Object.assign(this.descriptionData(),{user:e,username:e?m(u.a,{className:"EventPost-user",href:r.a.route.user(e)},n):n});return t.prototype.content.call(this).concat([Object(c.a)(this.icon(),{className:"EventPost-icon"}),m("div",{class:"EventPost-info"},this.description(i))])},n.icon=function(){return""},n.description=function(t){return r.a.translator.trans(this.descriptionKey(),t)},n.descriptionKey=function(){return""},n.descriptionData=function(){return{}},e}(o.a)},function(t,e,n){"use strict";var i=n(147),r=n(23),o=n(107),s=n(150),a=n(151),c=n(155),u=n(108);e.a=function(t){t.routes={index:{path:"/all",component:i.a},discussion:{path:"/d/:id",component:r.a,resolverClass:u.a},"discussion.near":{path:"/d/:id/:near",component:r.a,resolverClass:u.a},user:{path:"/u/:username",component:o.a},"user.posts":{path:"/u/:username",component:o.a},"user.discussions":{path:"/u/:username/discussions",component:s.a},settings:{path:"/settings",component:a.a},notifications:{path:"/notifications",component:c.a}},t.route.discussion=function(e,n){return t.route(n&&1!==n?"discussion.near":"discussion",{id:e.slug(),near:n&&1!==n?n:void 0})},t.route.post=function(e){return t.route.discussion(e.discussion(),e.number())},t.route.user=function(e){return t.route("user",{username:e.slug()})}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var i=n(1),r=n(0),o=n(29),s=n(3),a=n(8),c=n(42),u=n(148),l=n(149),d=n(35),h=n(23),f=n(19),p=n(2),g=n(17),v=n(32),b=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(n){t.prototype.oninit.call(this,n),r.a.previous.matches(h.a)&&(this.lastDiscussion=r.a.previous.get("discussion")),r.a.previous.matches(e)&&r.a.discussions.clear(),r.a.discussions.refreshParams(r.a.search.params(),m.route.param("page")),r.a.history.push("index",r.a.translator.trans("core.forum.header.back_to_index_tooltip")),this.bodyClass="App--index",this.scrollTopOnCreate=!1},n.view=function(){return m("div",{className:"IndexPage"},this.hero(),m("div",{className:"container"},m("div",{className:"sideNavContainer"},m("nav",{className:"IndexPage-nav sideNav"},m("ul",null,Object(a.a)(this.sidebarItems().toArray()))),m("div",{className:"IndexPage-results sideNavOffset"},m("div",{className:"IndexPage-toolbar"},m("ul",{className:"IndexPage-toolbar-view"},Object(a.a)(this.viewItems().toArray())),m("ul",{className:"IndexPage-toolbar-action"},Object(a.a)(this.actionItems().toArray()))),m(c.a,{state:r.a.discussions})))))},n.setTitle=function(){r.a.setTitle(r.a.translator.trans("core.forum.index.meta_title_text")),r.a.setTitleCount(0)},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.setTitle();var n=r.a.cache.heroHeight,i=r.a.cache.heroHeight=this.$(".Hero").outerHeight()||0,o=r.a.cache.scrollTop;if($("#app").css("min-height",$(window).height()+i),null!=r.a.previous.type&&("desktop"==r.a.screen()||"desktop-hd"==r.a.screen()||this.lastDiscussion?$(window).scrollTop(o-n+i):$(window).scrollTop(0),this.lastDiscussion)){var s=this.$('li[data-id="'+this.lastDiscussion.id()+'"] .DiscussionListItem');if(s.length){var a=$("#header").outerHeight(),c=$(window).height(),u=s.offset().top,l=u+s.outerHeight();(uo+c)&&$(window).scrollTop(u-a)}}},n.onbeforeremove=function(e){t.prototype.onbeforeremove.call(this,e),r.a.cache.scrollTop=$(window).scrollTop()},n.onremove=function(e){t.prototype.onremove.call(this,e),$("#app").css("min-height","")},n.hero=function(){return u.a.component()},n.sidebarItems=function(){var t=this,e=new s.a,n=r.a.forum.attribute("canStartDiscussion")||!r.a.session.user;return e.add("newDiscussion",p.a.component({icon:"fas fa-edit",className:"Button Button--primary IndexPage-newDiscussion",itemClassName:"App-primaryControl",onclick:function(){return t.newDiscussionAction().catch((function(){}))},disabled:!n},r.a.translator.trans(n?"core.forum.index.start_discussion_button":"core.forum.index.cannot_start_discussion_button"))),e.add("nav",v.a.component({buttonClassName:"Button",className:"App-titleControl",accessibleToggleLabel:r.a.translator.trans("core.forum.index.toggle_sidenav_dropdown_accessible_label")},this.navItems(this).toArray())),e},n.navItems=function(){var t=new s.a,e=r.a.search.stickyParams();return t.add("allDiscussions",g.a.component({href:r.a.route("index",e),icon:"far fa-comments"},r.a.translator.trans("core.forum.index.all_discussions_link")),100),t},n.viewItems=function(){var t=new s.a,e=r.a.discussions.sortMap(),n={};for(var i in e)n[i]=r.a.translator.trans("core.forum.index_sort."+i+"_button");return t.add("sort",f.a.component({buttonClassName:"Button",label:n[r.a.search.params().sort]||Object.keys(e).map((function(t){return n[t]}))[0],accessibleToggleLabel:r.a.translator.trans("core.forum.index_sort.toggle_dropdown_accessible_label")},Object.keys(n).map((function(t){var i=n[t],o=(r.a.search.params().sort||Object.keys(e)[0])===t;return p.a.component({icon:!o||"fas fa-check",onclick:r.a.search.changeSort.bind(r.a.search,t),active:o},i)})))),t},n.actionItems=function(){var t=new s.a;return t.add("refresh",p.a.component({title:r.a.translator.trans("core.forum.index.refresh_tooltip"),icon:"fas fa-sync",className:"Button Button--icon",onclick:function(){r.a.discussions.refresh(),r.a.session.user&&(r.a.store.find("users",r.a.session.user.id()),m.redraw())}})),r.a.session.user&&t.add("markAllAsRead",p.a.component({title:r.a.translator.trans("core.forum.index.mark_all_as_read_tooltip"),icon:"fas fa-check",className:"Button Button--icon",onclick:this.markAllAsRead.bind(this)})),t},n.newDiscussionAction=function(){return new Promise((function(t,e){return r.a.session.user?(r.a.composer.load(l.a,{user:r.a.session.user}),r.a.composer.show(),t(r.a.composer)):(r.a.modal.show(d.a),e())}))},n.markAllAsRead=function(){confirm(r.a.translator.trans("core.forum.index.mark_all_as_read_confirmation"))&&r.a.session.user.save({markedAllAsReadAt:new Date})},e}(o.a);b.providesInitialSearch=!0},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(0),o=n(4),s=n(2),a=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.hidden=localStorage.getItem("welcomeHidden")},n.view=function(){var t=this;if(this.hidden)return m("div",null);return m("header",{className:"Hero WelcomeHero"},m("div",{class:"container"},s.a.component({icon:"fas fa-times",onclick:function(){t.$().slideUp(t.hide.bind(t))},className:"Hero-close Button Button--icon Button--link"}),m("div",{className:"containerNarrow"},m("h2",{className:"Hero-title"},r.a.forum.attribute("welcomeTitle")),m("div",{className:"Hero-subtitle"},m.trust(r.a.forum.attribute("welcomeMessage"))))))},n.hide=function(){localStorage.setItem("welcomeHidden","true"),this.hidden=!0},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(1),r=n(0),o=n(47),s=n(9),a=n(11),c=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.placeholder=e.placeholder||Object(s.a)(r.a.translator.trans("core.forum.composer_discussion.body_placeholder")),e.submitLabel=e.submitLabel||r.a.translator.trans("core.forum.composer_discussion.submit_button"),e.confirmExit=e.confirmExit||Object(s.a)(r.a.translator.trans("core.forum.composer_discussion.discard_confirmation")),e.titlePlaceholder=e.titlePlaceholder||Object(s.a)(r.a.translator.trans("core.forum.composer_discussion.title_placeholder")),e.className="ComposerBody--discussion"};var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.composer.fields.title=this.composer.fields.title||Object(a.a)(""),this.title=this.composer.fields.title},n.headerItems=function(){var e=t.prototype.headerItems.call(this);return e.add("title",m("h3",null,r.a.translator.trans("core.forum.composer_discussion.title")),100),e.add("discussionTitle",m("h3",null,m("input",{className:"FormControl",bidi:this.title,placeholder:this.attrs.titlePlaceholder,disabled:!!this.attrs.disabled,onkeydown:this.onkeydown.bind(this)}))),e},n.onkeydown=function(t){13===t.which&&(t.preventDefault(),this.composer.editor.moveCursorTo(0)),t.redraw=!1},n.hasChanges=function(){return this.title()||this.composer.fields.content()},n.data=function(){return{title:this.title(),content:this.composer.fields.content()}},n.onsubmit=function(){var t=this;this.loading=!0;var e=this.data();r.a.store.createRecord("discussions").save(e).then((function(e){t.composer.hide(),r.a.discussions.refresh({deferClear:!0}),m.route.set(r.a.route.discussion(e))}),this.loaded.bind(this))},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(36),o=n(42),s=n(71),a=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.loadUser(m.route.param("username"))},n.show=function(e){t.prototype.show.call(this,e),this.state=new s.a({filter:{author:e.username()},sort:"newest"}),this.state.refresh()},n.content=function(){return m("div",{className:"DiscussionsUserPage"},o.a.component({state:this.state}))},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var i=n(1),r=n(0),o=n(36),s=n(3),a=n(45),c=n(2),u=n(49),l=n(152),d=n(153),h=n(154),f=n(8),p=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.show(r.a.session.user),r.a.setTitle(r.a.translator.trans("core.forum.settings.title"))},n.content=function(){return m("div",{className:"SettingsPage"},m("ul",null,Object(f.a)(this.settingsItems().toArray())))},n.settingsItems=function(){var t=this,e=new s.a;return["account","notifications","privacy"].forEach((function(n){e.add(n,m(u.a,{className:"Settings-"+n,label:r.a.translator.trans("core.forum.settings."+n+"_heading")},t[n+"Items"]().toArray()))})),e},n.accountItems=function(){var t=new s.a;return t.add("changePassword",m(c.a,{className:"Button",onclick:function(){return r.a.modal.show(d.a)}},r.a.translator.trans("core.forum.settings.change_password_button"))),t.add("changeEmail",m(c.a,{className:"Button",onclick:function(){return r.a.modal.show(h.a)}},r.a.translator.trans("core.forum.settings.change_email_button"))),t},n.notificationsItems=function(){var t=new s.a;return t.add("notificationGrid",m(l.a,{user:this.user})),t},n.privacyItems=function(){var t=this,e=new s.a;return e.add("discloseOnline",m(a.a,{state:this.user.preferences().discloseOnline,onchange:function(e){t.discloseOnlineLoading=!0,t.user.savePreferences({discloseOnline:e}).then((function(){t.discloseOnlineLoading=!1,m.redraw()}))},loading:this.discloseOnlineLoading},r.a.translator.trans("core.forum.settings.privacy_disclose_online_label"))),e},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(1),r=n(0),o=n(4),s=n(58),a=n(7),c=n(3),u=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.methods=this.notificationMethods().toArray(),this.loading={},this.types=this.notificationTypes().toArray()},n.view=function(){var t=this,e=this.attrs.user.preferences();return m("table",{className:"NotificationGrid"},m("thead",null,m("tr",null,m("td",null),this.methods.map((function(e){return m("th",{className:"NotificationGrid-groupToggle",onclick:t.toggleMethod.bind(t,e.name)},Object(a.a)(e.icon)," ",e.label)})))),m("tbody",null,this.types.map((function(n){return m("tr",null,m("td",{className:"NotificationGrid-groupToggle",onclick:t.toggleType.bind(t,n.name)},Object(a.a)(n.icon)," ",n.label),t.methods.map((function(i){var r=t.preferenceKey(n.name,i.name);return m("td",{className:"NotificationGrid-checkbox"},m(s.a,{state:!!e[r],loading:t.loading[r],disabled:!(r in e),onchange:t.toggle.bind(t,[r])}))})))}))))},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.$("thead .NotificationGrid-groupToggle").bind("mouseenter mouseleave",(function(t){var e=parseInt($(this).index(),10)+1;$(this).parents("table").find("td:nth-child("+e+")").toggleClass("highlighted","mouseenter"===t.type)})),this.$("tbody .NotificationGrid-groupToggle").bind("mouseenter mouseleave",(function(t){$(this).parent().find("td").toggleClass("highlighted","mouseenter"===t.type)}))},n.toggle=function(t){var e=this,n=this.attrs.user,i=n.preferences(),r=!i[t[0]];t.forEach((function(t){e.loading[t]=!0,i[t]=r})),m.redraw(),n.save({preferences:i}).then((function(){t.forEach((function(t){return e.loading[t]=!1})),m.redraw()}))},n.toggleMethod=function(t){var e=this,n=this.types.map((function(n){return e.preferenceKey(n.name,t)})).filter((function(t){return t in e.attrs.user.preferences()}));this.toggle(n)},n.toggleType=function(t){var e=this,n=this.methods.map((function(n){return e.preferenceKey(t,n.name)})).filter((function(t){return t in e.attrs.user.preferences()}));this.toggle(n)},n.preferenceKey=function(t,e){return"notify_"+t+"_"+e},n.notificationMethods=function(){var t=new c.a;return t.add("alert",{name:"alert",icon:"fas fa-bell",label:r.a.translator.trans("core.forum.settings.notify_by_web_heading")}),t.add("email",{name:"email",icon:"far fa-envelope",label:r.a.translator.trans("core.forum.settings.notify_by_email_heading")}),t},n.notificationTypes=function(){var t=new c.a;return t.add("discussionRenamed",{name:"discussionRenamed",icon:"fas fa-pencil-alt",label:r.a.translator.trans("core.forum.settings.notify_discussion_renamed_label")}),t},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(0),o=n(16),s=n(2),a=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.className=function(){return"ChangePasswordModal Modal--small"},n.title=function(){return r.a.translator.trans("core.forum.change_password.title")},n.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},r.a.translator.trans("core.forum.change_password.text")),m("div",{className:"Form-group"},s.a.component({className:"Button Button--primary Button--block",type:"submit",loading:this.loading},r.a.translator.trans("core.forum.change_password.send_button")))))},n.onsubmit=function(t){t.preventDefault(),this.loading=!0,r.a.request({method:"POST",url:r.a.forum.attribute("apiUrl")+"/forgot",body:{email:r.a.session.user.email()}}).then(this.hide.bind(this),this.loaded.bind(this))},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(1),r=n(0),o=n(16),s=n(2),a=n(11),c=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.success=!1,this.email=Object(a.a)(r.a.session.user.email()),this.password=Object(a.a)("")},n.className=function(){return"ChangeEmailModal Modal--small"},n.title=function(){return r.a.translator.trans("core.forum.change_email.title")},n.content=function(){return this.success?m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},r.a.translator.trans("core.forum.change_email.confirmation_message",{email:m("strong",null,this.email())})),m("div",{className:"Form-group"},m(s.a,{className:"Button Button--primary Button--block",onclick:this.hide.bind(this)},r.a.translator.trans("core.forum.change_email.dismiss_button"))))):m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("div",{className:"Form-group"},m("input",{type:"email",name:"email",className:"FormControl",placeholder:r.a.session.user.email(),bidi:this.email,disabled:this.loading})),m("div",{className:"Form-group"},m("input",{type:"password",name:"password",className:"FormControl",placeholder:r.a.translator.trans("core.forum.change_email.confirm_password_placeholder"),bidi:this.password,disabled:this.loading})),m("div",{className:"Form-group"},s.a.component({className:"Button Button--primary Button--block",type:"submit",loading:this.loading},r.a.translator.trans("core.forum.change_email.submit_button")))))},n.onsubmit=function(t){var e=this;t.preventDefault(),this.email()!==r.a.session.user.email()?(this.loading=!0,this.alertAttrs=null,r.a.session.user.save({email:this.email()},{errorHandler:this.onerror.bind(this),meta:{password:this.password()}}).then((function(){e.success=!0})).catch((function(){})).then(this.loaded.bind(this))):this.hide()},n.onerror=function(e){401===e.status&&(e.alert.content=r.a.translator.trans("core.forum.change_email.incorrect_password_message")),t.prototype.onerror.call(this,e)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(0),o=n(29),s=n(65),a=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),r.a.history.push("notifications"),r.a.notifications.load(),this.bodyClass="App--notifications"},n.view=function(){return m("div",{className:"NotificationsPage"},m(s.a,{state:r.a.notifications}))},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(13),r=n(1),o=n(31),s=n(2),a=n(7),c=n(4);function u(t){var e=t.session.user;if(e&&!e.isEmailConfirmed()){var n=function(n){function i(){return n.apply(this,arguments)||this}Object(r.a)(i,n);var o=i.prototype;return o.oninit=function(t){n.prototype.oninit.call(this,t),this.loading=!1,this.sent=!1},o.view=function(){return m(s.a,{class:"Button Button--link",onclick:this.onclick.bind(this),loading:this.loading,disabled:this.sent},this.sent?[Object(a.a)("fas fa-check")," ",t.translator.trans("core.forum.user_email_confirmation.sent_message")]:t.translator.trans("core.forum.user_email_confirmation.resend_button"))},o.onclick=function(){var n=this;this.loading=!0,m.redraw(),t.request({method:"POST",url:t.forum.attribute("apiUrl")+"/users/"+e.id()+"/send-confirmation"}).then((function(){n.loading=!1,n.sent=!0,m.redraw()})).catch((function(){n.loading=!1,m.redraw()}))},i}(c.a),u=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e.prototype.view=function(e){var n=t.prototype.view.call(this,e);return Object(i.a)({},n,{children:[m("div",{className:"container"},n.children)]})},e}(o.a);m.mount($("
").insertBefore("#content")[0],{view:function(){return m(u,{dismissible:!1,controls:[m(n,null)]},t.translator.trans("core.forum.user_email_confirmation.alert_message",{email:m("strong",null,e.email())}))}})}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(87),r=n(1),o=n(0),s=function(t){function e(){return t.call(this,{},1,10)||this}Object(r.a)(e,t);var n=e.prototype;return n.load=function(){return o.a.session.user.newNotificationCount()&&(this.pages=[],this.location={page:1}),this.pages.length>0?Promise.resolve():(o.a.session.user.pushAttributes({newNotificationCount:0}),t.prototype.loadNext.call(this))},n.markAllAsRead=function(){if(0!==this.pages.length)return o.a.session.user.pushAttributes({unreadNotificationCount:0}),this.pages.forEach((function(t){t.items.forEach((function(t){return t.pushAttributes({isRead:!0})}))})),o.a.request({url:o.a.forum.attribute("apiUrl")+"/notifications/read",method:"POST"})},Object(i.a)(e,[{key:"type",get:function(){return"notifications"}}]),e}(n(57).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(22),r=n(1),o=n(0),s=n(48),a=function(t){function e(e){var n;return void 0===e&&(e=[]),(n=t.call(this,e)||this).initialValueSet=!1,n}Object(r.a)(e,t);var n=e.prototype;return n.getValue=function(){return!this.initialValueSet&&this.currPageProvidesSearch()&&this.intializeValue(),t.prototype.getValue.call(this)},n.intializeValue=function(){this.setValue(this.getInitialSearch()),this.initialValueSet=!0},n.currPageProvidesSearch=function(){return o.a.current.type&&o.a.current.type.providesInitialSearch},n.getInitialSearch=function(){return this.currPageProvidesSearch()?this.params().q:""},n.clear=function(){t.prototype.clear.call(this),this.getInitialSearch()?this.clearInitialSearch():m.redraw()},n.clearInitialSearch=function(){var t=this.params(),e=(t.q,Object(i.a)(t,["q"]));Object(s.a)(o.a.route(o.a.current.get("routeName"),e))},n.stickyParams=function(){return{sort:m.route.param("sort"),q:m.route.param("q")}},n.params=function(){var t=this.stickyParams();return t.filter=m.route.param("filter"),t},n.changeSort=function(t){var e=this.params();t===Object.keys(o.a.discussions.sortMap())[0]?delete e.sort:e.sort=t,Object(s.a)(o.a.route(o.a.current.get("routeName"),e))},e}(n(159).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(t){void 0===t&&(t=[]),this.cachedSearches=void 0,this.value="",this.cachedSearches=new Set(t)}var e=t.prototype;return e.getInitialSearch=function(){return""},e.getValue=function(){return this.value},e.setValue=function(t){this.value=t},e.clear=function(){this.setValue("")},e.cache=function(t){this.cachedSearches.add(t)},e.isCached=function(t){return this.cachedSearches.has(t)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(22),r=n(1),o=n(4),s=n(7),a=n(59),c=n(10),u=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e.prototype.view=function(){var t=this.attrs,e=t.options,n=t.onchange,r=t.value,o=t.disabled,u=t.className,l=t.class,d=t.wrapperAttrs,h=(d=void 0===d?{}:d).className,f=d.class,p=Object(i.a)(d,["className","class"]),g=Object(i.a)(t,["options","onchange","value","disabled","className","class","wrapperAttrs"]);return m("span",Object.assign({className:Object(c.a)("Select",h,f)},p),m("select",Object.assign({className:Object(c.a)("Select-input FormControl",u,l),onchange:n?Object(a.a)("value",n.bind(this)):void 0,value:r,disabled:o},g),Object.keys(e).map((function(t){return m("option",{value:t},e[t])}))),Object(s.a)("fas fa-sort",{className:"Select-caret"}))},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(6);function r(t){if(2===t.length)return i.a.translator.trans("core.lib.series.two_text",{first:t[0],second:t[1]});if(t.length>=3){var e=t.slice(1,t.length-1).reduce((function(t,e){return t.concat([e,i.a.translator.trans("core.lib.series.glue_text")])}),[]).slice(0,-1);return i.a.translator.trans("core.lib.series.three_text",{first:t[0],second:e,third:t[t.length-1]})}return t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return T}));var i=n(106),r=n(1),o=n(0),s=n(112),a=n(113),c=n(23),u=n(44),l=n(126),d=n(127),h=n(134),f=n(135),p=n(66),g=n(144),v=n(146),b=n(156),y=n(72),w=n(50),x=n(157),N=n(158),_=n(71),O=n(21);var T=function(t){function e(){var e;return(e=t.call(this)||this).notificationComponents={discussionRenamed:f.a},e.postComponents={comment:p.a,discussionRenamed:g.a},e.pane=null,e.drawer=null,e.history=new s.a,e.notifications=new x.a(Object(i.a)(e)),e.search=new N.a,e.composer=new O.a,Object(v.a)(Object(i.a)(e)),e.discussions=new _.a({}),e}Object(r.a)(e,t);var n=e.prototype;return n.mount=function(){var e=this,n=this.forum.attribute("defaultRoute"),i="index";for(var r in this.routes)this.routes[r].path===n&&(i=r);this.routes[i].path="/",this.history.push(i,this.translator.trans("core.forum.header.back_to_index_tooltip"),"/"),this.pane=new a.a(document.getElementById("app")),m.route.prefix="",t.prototype.mount.call(this,this.forum.attribute("basePath")),m.mount(document.getElementById("app-navigation"),{view:function(){return w.a.component({className:"App-backControl",drawer:!0})}}),m.mount(document.getElementById("header-navigation"),w.a),m.mount(document.getElementById("header-primary"),l.a),m.mount(document.getElementById("header-secondary"),d.a),m.mount(document.getElementById("composer"),{view:function(){return h.a.component({state:e.composer})}}),Object(b.a)(this),$("#home-link").click((function(t){t.ctrlKey||t.metaKey||2===t.which||(t.preventDefault(),o.a.history.home(),o.a.session.user&&(o.a.store.find("users",o.a.session.user.id()),m.redraw()))})),"ontouchstart"in window&&navigator.vendor&&navigator.vendor.includes("Apple")&&navigator.userAgent&&!navigator.userAgent.includes("CriOS")&&!navigator.userAgent.includes("FxiOS")&&$((function(){$(".App").addClass("mobile-safari")}))},n.viewingDiscussion=function(t){return this.current.matches(c.a,{discussion:t})},n.authenticationComplete=function(t){t.loggedIn?window.location.reload():this.modal.show(u.a,t)},e}(y.a)},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.default=t.exports,t.exports.__esModule=!0,n(e)}t.exports=n,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";var i=n(37),r=n(165),o=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,s={},a={}.hasOwnProperty;function c(t){for(var e in t)if(a.call(t,e))return!1;return!0}function u(t){for(var e,n="div",i=[],r={};e=o.exec(t);){var a=e[1],c=e[2];if(""===a&&""!==c)n=c;else if("#"===a)r.id=c;else if("."===a)i.push(c);else if("["===e[3][0]){var u=e[6];u&&(u=u.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===e[4]?i.push(u):r[e[4]]=""===u?u:u||!0}}return i.length>0&&(r.className=i.join(" ")),s[t]={tag:n,attrs:r}}function l(t,e){var n=e.attrs,r=i.normalizeChildren(e.children),o=a.call(n,"class"),s=o?n.class:n.className;if(e.tag=t.tag,e.attrs=null,e.children=void 0,!c(t.attrs)&&!c(n)){var u={};for(var l in n)a.call(n,l)&&(u[l]=n[l]);n=u}for(var l in t.attrs)a.call(t.attrs,l)&&"className"!==l&&!a.call(n,l)&&(n[l]=t.attrs[l]);for(var l in null==s&&null==t.attrs.className||(n.className=null!=s?null!=t.attrs.className?String(t.attrs.className)+" "+String(s):s:null!=t.attrs.className?t.attrs.className:null),o&&(n.class=null),n)if(a.call(n,l)&&"key"!==l){e.attrs=n;break}return Array.isArray(r)&&1===r.length&&null!=r[0]&&"#"===r[0].tag?e.text=r[0].children:e.children=r,e}t.exports=function(t){if(null==t||"string"!=typeof t&&"function"!=typeof t&&"function"!=typeof t.view)throw Error("The selector must be either a string or a component.");var e=r.apply(1,arguments);return"string"==typeof t&&(e.children=i.normalizeChildren(e.children),"["!==t)?l(s[t]||u(t),e):(e.tag=t,e)}},function(t,e,n){"use strict";var i=n(37);t.exports=function(){var t,e=arguments[this],n=this+1;if(null==e?e={}:("object"!=typeof e||null!=e.tag||Array.isArray(e))&&(e={},n=this),arguments.length===n+1)t=arguments[n],Array.isArray(t)||(t=[t]);else for(t=[];n0||t(n)}}var i=n(a);try{t(n(s),i)}catch(t){i(t)}}d(n)};n.prototype.then=function(t,e){var i,r,o=this._instance;function s(t,e,n,s){e.push((function(e){if("function"!=typeof t)n(e);else try{i(t(e))}catch(t){r&&r(t)}})),"function"==typeof o.retry&&s===o.state&&o.retry()}var a=new n((function(t,e){i=t,r=e}));return s(t,o.resolvers,i,!0),s(e,o.rejectors,r,!1),a},n.prototype.catch=function(t){return this.then(null,t)},n.prototype.finally=function(t){return this.then((function(e){return n.resolve(t()).then((function(){return e}))}),(function(e){return n.resolve(t()).then((function(){return n.reject(e)}))}))},n.resolve=function(t){return t instanceof n?t:new n((function(e){e(t)}))},n.reject=function(t){return new n((function(e,n){n(t)}))},n.all=function(t){return new n((function(e,n){var i=t.length,r=0,o=[];if(0===t.length)e([]);else for(var s=0;s=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(190),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(78))},function(t,e,n){"use strict";t.exports=n(192)(window)},function(t,e,n){"use strict";t.exports=function(t){if("[object Object]"!==Object.prototype.toString.call(t))return"";var e=[];for(var n in t)i(n,t[n]);return e.join("&");function i(t,n){if(Array.isArray(n))for(var r=0;r-1&&c.pop();for(var l=0;l` component exposed by flarum/core instead. `$.tooltip` may be removed in a future version of Flarum.\n\nIf this component doesn't meet your requirements, please open an issue: https://github.com/flarum/core/issues/new?assignees=davwheat&labels=type/bug,needs-verification&template=bug-report.md&title=Tooltip%20component%20unsuitable%20for%20use%20case"),f.bind(this)(t)}},function(t,e,n){t.exports=function(){"use strict";return function(t,e,n){t=t||{};var i=e.prototype,r={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function o(t,e,n,r){return i.fromToBase(t,e,n,r)}n.en.relativeTime=r,i.fromToBase=function(e,i,o,s,a){for(var c,u,l,d=o.$locale().relativeTime||r,h=t.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],f=h.length,p=0;p0,g<=m.r||!m.r){g<=1&&p>0&&(m=h[p-1]);var v=d[m.l];a&&(g=a(""+g)),u="string"==typeof v?v.replace("%d",g):v(g,i,m.l,l);break}}if(i)return u;var b=l?d.future:d.past;return"function"==typeof b?b(u):b.replace("%s",u)},i.to=function(t,e){return o(t,e,this,!0)},i.from=function(t,e){return o(t,e,this)};var s=function(t){return t.$u?n.utc():n()};i.toNow=function(t){return this.to(s(this),t)},i.fromNow=function(t){return this.from(s(this),t)}}}()},function(t,e,n){t.exports=function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(e,n,i){var r=n.prototype,o=r.format;i.en.formats=t,r.format=function(e){void 0===e&&(e="YYYY-MM-DDTHH:mm:ssZ");var n=this.$locale().formats,i=function(e,n){return e.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,i,r){var o=r&&r.toUpperCase();return i||n[r]||t[r]||n[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))}(e,void 0===n?{}:n);return o.call(this,i)}}}()},function(t,e,n){!function(){var e=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],n="undefined"!=typeof window,i=n&&null!=window.mozInnerScreenX;function r(t,r,o){if(!n)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var s=o&&o.debug||!1;if(s){var a=document.querySelector("#input-textarea-caret-position-mirror-div");a&&a.parentNode.removeChild(a)}var c=document.createElement("div");c.id="input-textarea-caret-position-mirror-div",document.body.appendChild(c);var u=c.style,l=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,d="INPUT"===t.nodeName;u.whiteSpace="pre-wrap",d||(u.wordWrap="break-word"),u.position="absolute",s||(u.visibility="hidden"),e.forEach((function(t){d&&"lineHeight"===t?u.lineHeight=l.height:u[t]=l[t]})),i?t.scrollHeight>parseInt(l.height)&&(u.overflowY="scroll"):u.overflow="hidden",c.textContent=t.value.substring(0,r),d&&(c.textContent=c.textContent.replace(/\s/g," "));var h=document.createElement("span");h.textContent=t.value.substring(r)||".",c.appendChild(h);var f={top:h.offsetTop+parseInt(l.borderTopWidth),left:h.offsetLeft+parseInt(l.borderLeftWidth),height:parseInt(l.lineHeight)};return s?h.style.backgroundColor="#aaa":document.body.removeChild(c),f}void 0!==t.exports?t.exports=r:n&&(window.getCaretCoordinates=r)}()},function(t,e,n){"use strict";t.exports=n(206)},function(t,e,n){var i=n(208);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var i=n(209).default,r=n(210);t.exports=function(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?r(t):e},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var i=n(211),r=n(212),o=n(213),s=n(215);t.exports=function(t,e){return i(t)||r(t,e)||o(t,e)||s()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";var i={};n.r(i),n.d(i,"throttle",(function(){return S.b})),n.d(i,"debounce",(function(){return S.a}));var r=n(77),o=n(94),s=n(93),a=n(62),c={handlers:null,getHandlers:function(t){return this.handlers=this.handlers||{},this.handlers[t]=this.handlers[t]||[],this.handlers[t]},trigger:function(t){for(var e=this,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r1}function b(t,e){return Array(e+1).join(t)}function y(t,e,n){for(var i=e,r=n?/\n/:/\s/;t[i]&&!t[i].match(r);)i++;return i}function w(t){var e,n,i=t.value.slice(0,t.selectionStart),r=t.value.slice(t.selectionEnd),o=i.match(/\n*$/),s=r.match(/^\n*/),a=o?o[0].length:0,c=s?s[0].length:0;return i.match(/\S/)&&a<2&&(e=b("\n",2-a)),r.match(/\S/)&&c<2&&(n=b("\n",2-c)),null==e&&(e=""),null==n&&(n=""),{newlinesToAppend:e,newlinesToPrepend:n}}var x=n(95),N=n(84),_=n(76),O=n(80),T=n(82),C=n(38),S=n(51),j=n(11),k=n(53),E=n(48),A=n(25),P=n(40),D=n(100),I=n(52),M=n(105),L=n(103),B=n(10),R=n(9),H=n(74),U=n(96),F=n(59),q=n(102),z=n(99),W=n(101),G=n(56),V=n(18),Y=n(98),K=n(4),X=n(104),J=n(89),Q=n(29),Z=n(45),tt=n(34),et=n(15),nt=n(55),it=n(24),rt=n(19),ot=n(83),st=n(90),at=n(49),ct=n(160),ut=n(50),lt=n(31),dt=n(12),ht=n(17),ft=n(58),pt=n(32),mt=n(88),gt=n(2),vt=n(16),bt=n(41),yt=n(81),wt=n(28),xt=function(t){function e(){return t.apply(this,arguments)||this}return Object(d.a)(e,t),e.prototype.view=function(e){var n=t.prototype.view.call(this,e);return m(wt.a,{text:this.attrs.tooltipText||Object(R.a)(e.children)},n)},e.initAttrs=function(e){t.initAttrs.call(this,e),e.className=e.className||"Button Button--icon Button--link",e.tooltipText=e.title},e}(gt.a),Nt=n(70),_t=n(5),Ot=n(72),Tt=n(86),Ct=n(14),St=n(7),jt=n(39),kt=n(161),Et=n(30),At=n(20),Pt=n(85),Dt=n(8),It=function(){function t(){this.element=void 0}var e=t.prototype;return e.$=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){var e=$(this.element);return t?e.find(t):e})),e.render=function(){var t=this,e=this.view();e.attrs=e.attrs||{};var n=e.attrs.oncreate;return e.attrs.oncreate=function(e){t.element=e.dom,n&&n.apply(t,[e])},e},t}(),$t=n(46),Mt=n(57);e.a={extend:r,Session:o.a,Store:s.a,"utils/BasicEditorDriver":a.a,"utils/evented":c,"utils/liveHumanTimes":u.a,"utils/ItemList":l.a,"utils/mixin":function(t){for(var e=function(t){function e(){return t.apply(this,arguments)||this}return Object(d.a)(e,t),e}(t),n=arguments.length,i=new Array(n>1?n-1:0),r=1;r0?s+"\n":r,g=v(p)&&a.length>0?"\n"+a:o;if(u){var b=t.value[t.selectionStart-1];0===t.selectionStart||null==b||b.match(/\s/)||(m=" "+m)}p=function(t,e,n,i){void 0===i&&(i=!1);if(t.selectionStart===t.selectionEnd)t.selectionStart=function(t,e){var n=e;for(;t[n]&&null!=t[n-1]&&!t[n-1].match(/\s/);)n--;return n}(t.value,t.selectionStart),t.selectionEnd=y(t.value,t.selectionEnd,i);else{var r=t.selectionStart-e.length,o=t.selectionEnd+n.length,s=t.value.slice(r,t.selectionStart)===e,a=t.value.slice(t.selectionEnd,o)===n;s&&a&&(t.selectionStart=r,t.selectionEnd=o)}return t.value.slice(t.selectionStart,t.selectionEnd)}(t,m,g,e.multiline);var x=t.selectionStart,N=t.selectionEnd,_=c.length>0&&g.indexOf(c)>-1&&p.length>0;if(d){var O=w(t);n=O.newlinesToAppend,i=O.newlinesToPrepend,m=n+r,g+=i}if(p.startsWith(m)&&p.endsWith(g)){var T=p.slice(m.length,p.length-g.length);if(h===f){var C=h-m.length;C=Math.max(C,x),C=Math.min(C,x+T.length),x=N=C}else N=x+T.length;return{text:T,selectionStart:x,selectionEnd:N}}if(_){if(l.length>0&&p.match(l)){g=g.replace(c,p);var S=m+g;return x=N=x+m.length,{text:S,selectionStart:x,selectionEnd:N}}var j=m+p+g;return x=x+m.length+p.length+g.indexOf(c),N=x+c.length,{text:j,selectionStart:x,selectionEnd:N}}var k=m+p+g;x=h+m.length,N=f+m.length;var E=p.match(/^\s*|\s*$/g);if(e.trimFirst&&E){var A=E[0]||"",P=E[1]||"";k=A+m+p.trim()+g+P,x+=A.length,N-=P.length}return{text:k,selectionStart:x,selectionEnd:N}}(t,e),Object(p.a)(t,n)},"utils/Drawer":x.a,"utils/anchorScroll":N.a,"utils/RequestError":_.a,"utils/abbreviateNumber":O.a,"utils/string":C,"utils/SubtreeRetainer":k.a,"utils/escapeRegExp":T.a,"utils/extract":A.a,"utils/ScrollListener":P.a,"utils/stringToColor":D.a,"utils/Stream":j.a,"utils/subclassOf":I.a,"utils/setRouteWithForcedRefresh":E.a,"utils/patchMithril":M.a,"utils/proxifyCompat":L.a,"utils/classList":B.a,"utils/extractText":R.a,"utils/formatNumber":H.a,"utils/mapRoutes":U.a,"utils/withAttr":F.a,"utils/throttleDebounce":i,"models/Notification":q.a,"models/User":z.a,"models/Post":W.a,"models/Discussion":G.a,"models/Group":V.a,"models/Forum":Y.a,Component:K.a,Fragment:It,Translator:X.a,"components/AlertManager":J.a,"components/Page":Q.a,"components/Switch":Z.a,"components/Badge":tt.a,"components/LoadingIndicator":et.a,"components/Placeholder":nt.a,"components/Separator":it.a,"components/Dropdown":rt.a,"components/SplitDropdown":ot.a,"components/RequestErrorModal":st.a,"components/FieldSet":at.a,"components/Select":ct.a,"components/Navigation":ut.a,"components/Alert":lt.a,"components/Link":dt.a,"components/LinkButton":ht.a,"components/Checkbox":ft.a,"components/SelectDropdown":pt.a,"components/ModalManager":mt.a,"components/Button":gt.a,"components/Modal":vt.a,"components/GroupBadge":bt.a,"components/TextEditor":yt.a,"components/TextEditorButton":xt,"components/Tooltip":wt.a,"components/EditUserModal":Nt.a,Model:_t.a,Application:Ot.a,"helpers/fullTime":Tt.a,"helpers/avatar":Ct.a,"helpers/icon":St.a,"helpers/humanTime":jt.a,"helpers/punctuateSeries":kt.a,"helpers/highlight":Et.a,"helpers/username":At.a,"helpers/userOnline":Pt.a,"helpers/listItems":Dt.a,"resolvers/DefaultResolver":$t.a,"states/PaginatedListState":Mt.a}},function(t,e,n){var i=n(183),r=n(79);void 0===r.$&&(r.$=i),void 0===r.jQuery&&(r.jQuery=i),t.exports=i},function(t,e,n){var i; +flarum.core=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r=e[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,n),r.l=!0,r.exports}return n.m=t,n.c=e,n.d=function(t,e,i){n.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var r in t)n.d(i,r,function(e){return t[e]}.bind(null,r));return i},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=223)}([function(t,e,n){"use strict";var i=new(n(162).a);window.app=i,e.a=i},function(t,e,n){"use strict";function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function r(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,i(t,e)}n.d(e,"a",(function(){return r}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var i=n(13),r=n(22),o=n(1),s=n(4);var a=n(7),c=n(10),u=n(9),l=n(15),d=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var n=e.prototype;return n.view=function(t){var e=this.attrs,n=e.type,o=e.title,s=e["aria-label"],a=e.icon,l=e.disabled,d=e.loading,h=e.className,f=e.class,p=Object(r.a)(e,["type","title","aria-label","icon","disabled","loading","className","class"]);n||(n="button"),s||(s=o),"object"==typeof s&&(s=Object(u.a)(s)),(l||d)&&delete p.onclick,h=Object(c.a)(f,h,{hasIcon:a,disabled:l||d,loading:d});var g=Object(i.a)({disabled:l,className:h,type:n,"aria-label":s},p);return m("button",g,this.getButtonContent(t.children))},n.oncreate=function(e){var n;t.prototype.oncreate.call(this,e),this.attrs["aria-label"]||Object(u.a)(e.children)||null!=(n=this.element)&&null!=n.getAttribute&&n.getAttribute("aria-label")||function(){var t;app.forum.attribute("debug")&&(t=console).warn.apply(t,arguments)}('[Flarum Accessibility Warning] Button has no content and no accessible label. This means that screen-readers will not be able to interpret its meaning and just read "Button". Consider providing accessible text via the `aria-label` attribute. https://web.dev/button-name',this.element)},n.getButtonContent=function(t){var e=this.attrs.icon;return[e&&Object(a.a)(e,{className:"Button-icon"}),t&&m("span",{className:"Button-label"},t),this.attrs.loading&&m(l.a,{size:"small",display:"inline"})]},e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=function(t,e){this.content=void 0,this.priority=void 0,this.key=void 0,this.content=t,this.priority=e},r=function(){function t(){this.items={}}var e=t.prototype;return e.isEmpty=function(){for(var t in this.items)if(this.items.hasOwnProperty(t))return!1;return!0},e.has=function(t){return!!this.items[t]},e.get=function(t){return this.items[t].content},e.add=function(t,e,n){return void 0===n&&(n=0),this.items[t]=new i(e,n),this},e.replace=function(t,e,n){return void 0===e&&(e=null),void 0===n&&(n=null),this.items[t]&&(null!==e&&(this.items[t].content=e),null!==n&&(this.items[t].priority=n)),this},e.remove=function(t){return delete this.items[t],this},e.merge=function(t){for(var e in t.items)t.items.hasOwnProperty(e)&&t.items[e]instanceof i&&(this.items[e]=t.items[e]);return this},e.toArray=function(){var t=[];for(var e in this.items)this.items.hasOwnProperty(e)&&this.items[e]instanceof i&&(this.items[e].content=Object(this.items[e].content),this.items[e].content.itemName=e,t.push(this.items[e]),this.items[e].key=t.length);return t.sort((function(t,e){return t.priority===e.priority?t.key-e.key:t.priority>e.priority?-1:1})).map((function(t){return t.content}))},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(){this.element=void 0,this.attrs=void 0,this.state=void 0}var e=t.prototype;return e.oninit=function(t){this.setAttrs(t.attrs)},e.oncreate=function(t){this.element=t.dom},e.onbeforeupdate=function(t){this.setAttrs(t.attrs)},e.onupdate=function(t){},e.onbeforeremove=function(t){},e.onremove=function(t){},e.$=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){var e=$(this.element);return t?e.find(t):e})),t.component=function(t,e){void 0===t&&(t={}),void 0===e&&(e=null);var n=Object.assign({},t);return m(this,n,e)},e.setAttrs=function(t){if(void 0===t&&(t={}),this.constructor.initAttrs(t),t){if("children"in t)throw new Error("["+this.constructor.name+'] The "children" attribute of attrs should never be used. Either pass children in as the vnode children or rename the attribute');if("tag"in t)throw new Error("["+this.constructor.name+'] You cannot use the "tag" attribute name with Mithril 2.')}this.attrs=t},t.initAttrs=function(t){},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(6),r=function(){function t(t,e){void 0===t&&(t={}),void 0===e&&(e=null),this.data=t,this.freshness=new Date,this.exists=!1,this.store=e}var e=t.prototype;return e.id=function(){return this.data.id},e.attribute=function(t){return this.data.attributes[t]},e.pushData=function(e){for(var n in e)if("object"==typeof e[n])for(var i in this.data[n]=this.data[n]||{},e[n])e[n][i]instanceof t&&(e[n][i]={data:t.getIdentifier(e[n][i])}),this.data[n][i]=e[n][i];else this.data[n]=e[n];this.freshness=new Date},e.pushAttributes=function(t){this.pushData({attributes:t})},e.save=function(e,n){var r=this;void 0===n&&(n={});var o={type:this.data.type,id:this.data.id,attributes:e};if(e.relationships){for(var s in o.relationships={},e.relationships){var a=e.relationships[s];o.relationships[s]={data:a instanceof Array?a.map(t.getIdentifier):t.getIdentifier(a)}}delete e.relationships}var c=this.copyData();this.pushData(o);var u={data:o};return n.meta&&(u.meta=n.meta),i.a.request(Object.assign({method:this.exists?"PATCH":"POST",url:i.a.forum.attribute("apiUrl")+this.apiEndpoint(),body:u},n)).then((function(t){return r.store.data[t.data.type]=r.store.data[t.data.type]||{},r.store.data[t.data.type][t.data.id]=r,r.store.pushPayload(t)}),(function(t){throw r.pushData(c),m.redraw(),t}))},e.delete=function(t,e){var n=this;return void 0===e&&(e={}),this.exists?i.a.request(Object.assign({method:"DELETE",url:i.a.forum.attribute("apiUrl")+this.apiEndpoint(),body:t},e)).then((function(){n.exists=!1,n.store.remove(n)})):Promise.resolve()},e.apiEndpoint=function(){return"/"+this.data.type+(this.exists?"/"+this.data.id:"")},e.copyData=function(){return JSON.parse(JSON.stringify(this.data))},t.attribute=function(t,e){return function(){var n=this.data.attributes&&this.data.attributes[t];return e?e(n):n}},t.hasOne=function(t){return function(){if(this.data.relationships){var e=this.data.relationships[t];if(e)return i.a.store.getById(e.data.type,e.data.id)}return!1}},t.hasMany=function(t){return function(){if(this.data.relationships){var e=this.data.relationships[t];if(e)return e.data.map((function(t){return i.a.store.getById(t.type,t.id)}))}return!1}},t.transformDate=function(t){return t?new Date(t):null},t.getIdentifier=function(t){return{type:t.data.type,id:t.data.id}},t}()},function(t,e,n){"use strict";var i=window,r=new Proxy({},{get:function(t,e){return Reflect.get(i.app,e,i.app)},set:function(t,e,n){return Reflect.set(i.app,e,n,i.app)}});e.a=r},function(t,e,n){"use strict";function i(t,e){return void 0===e&&(e={}),e.className="icon "+t+" "+(e.className||""),m("i",Object.assign({"aria-hidden":"true"},e))}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(24),r=n(10);function o(t){return t.tag===i.a}function s(t){return t instanceof Array||(t=[t]),function(t){var e,n=[];return t.filter(Boolean).forEach((function(i,r){(!o(i)||e&&!o(e)&&r!==t.length-1)&&(e=i,n.push(i))})),n}(t).map((function(t){var e=t.tag&&t.tag.isListItem,n=t.tag&&t.tag.isActive&&t.tag.isActive(t.attrs),i=t.attrs&&t.attrs.itemClassName||t.itemClassName;return e&&(t.attrs=t.attrs||{},t.attrs.key=t.attrs.key||t.itemName,t.key=t.attrs.key),e?t:m("li",{className:Object(r.a)([i,t.itemName&&"item-"+t.itemName,n&&"active"]),key:t.attrs&&t.attrs.key||t.itemName},t)}))}},function(t,e,n){"use strict";function i(t){return t instanceof Array?t.map((function(t){return i(t)})).join(""):"object"==typeof t&&null!==t?t.children?i(t.children):t.text:t}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";function i(t){var e,n,r="";if("string"==typeof t||"number"==typeof t)r+=t;else if("object"==typeof t)if(Array.isArray(t))for(e=0;e$(window).scrollTop()+$(window).height()),r.offset().top<0&&r.removeClass("Dropdown-menu--top"),r.toggleClass("Dropdown-menu--right",o||r.offset().left+r.width()>$(window).scrollLeft()+$(window).width())})),this.$().on("hidden.bs.dropdown",(function(){n.showing=!1,n.attrs.onhide&&n.attrs.onhide(),m.redraw()}))},n.getButton=function(t){return m("button",{className:"Dropdown-toggle "+this.attrs.buttonClassName,"aria-haspopup":"menu","aria-label":this.attrs.accessibleToggleLabel,"data-toggle":"dropdown",onclick:this.attrs.onclick},this.getButtonContent(t))},n.getButtonContent=function(t){return[this.attrs.icon?Object(s.a)(this.attrs.icon,{className:"Button-icon"}):"",m("span",{className:"Button-label"},this.attrs.label),this.attrs.caretIcon?Object(s.a)(this.attrs.caretIcon,{className:"Button-caret"}):""]},n.getMenu=function(t){return m("ul",{className:"Dropdown-menu dropdown-menu "+this.attrs.menuClassName},t)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(6);function r(t){var e=t&&t.displayName()||i.a.translator.trans("core.lib.username.deleted_text");return m("span",{className:"username"},e)}},function(t,e,n){"use strict";var i=n(0),r=n(52),o=n(11),s=n(61),a=(n(207),function(){function t(){this.position=t.Position.HIDDEN,this.height=null,this.body={attrs:{}},this.editor=null,this.clear()}var e=t.prototype;return e.load=function(t,e){var n={componentClass:t,attrs:e};this.preventExit()||(this.isVisible()&&(this.clear(),m.redraw.sync()),this.body=n)},e.clear=function(){this.position=t.Position.HIDDEN,this.body={attrs:{}},this.onExit=null,this.fields={content:Object(o.a)("")},this.editor&&this.editor.destroy(),this.editor=null},e.show=function(){this.position!==t.Position.NORMAL&&this.position!==t.Position.FULLSCREEN&&(this.position=t.Position.NORMAL,m.redraw.sync())},e.hide=function(){this.clear(),m.redraw()},e.close=function(){this.preventExit()||this.hide()},e.minimize=function(){this.isVisible()&&(this.position=t.Position.MINIMIZED,m.redraw())},e.fullScreen=function(){this.isVisible()&&(this.position=t.Position.FULLSCREEN,m.redraw())},e.exitFullScreen=function(){this.position===t.Position.FULLSCREEN&&(this.position=t.Position.NORMAL,m.redraw())},e.bodyMatches=function(t,e){var n=this;return void 0===e&&(e={}),!!Object(r.a)(this.body.componentClass,t)&&Object.keys(e).every((function(t){return n.body.attrs[t]===e[t]}))},e.isVisible=function(){return this.position!==t.Position.HIDDEN},e.isFullScreen=function(){return this.position===t.Position.FULLSCREEN||"phone"===i.a.screen()},e.composingReplyTo=function(t){return this.isVisible()&&this.bodyMatches(s.a,{discussion:t})},e.preventExit=function(){if(this.isVisible()&&this.onExit)return this.onExit.callback()?!confirm(this.onExit.message):void 0},e.preventClosingWhen=function(t,e){this.onExit={callback:t,message:e}},e.minimumHeight=function(){return 200},e.maximumHeight=function(){return $(window).height()-$("#header").outerHeight()},e.computedHeight=function(){return this.position===t.Position.MINIMIZED?"":this.position===t.Position.FULLSCREEN?$(window).height():Math.max(this.minimumHeight(),Math.min(this.height,this.maximumHeight()))},t}());a.Position={HIDDEN:"hidden",NORMAL:"normal",MINIMIZED:"minimized",FULLSCREEN:"fullScreen"},e.a=a},function(t,e,n){"use strict";function i(t,e){if(null==t)return{};var n,i,r={},o=Object.keys(t);for(i=0;i=0||(r[n]=t[n]);return r}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var i=n(1),r=n(0),o=n(29),s=n(3),a=n(114),c=n(115),u=n(121),l=n(124),d=n(15),h=n(83),f=n(8),p=n(43),g=n(125),v=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.useBrowserScrollRestoration=!1,this.discussion=null,this.near=m.route.param("near")||0,this.load(),r.a.discussions.hasItems()&&(r.a.pane.enable(),r.a.pane.hide()),r.a.history.push("discussion"),this.bodyClass="App--discussion"},n.onremove=function(e){t.prototype.onremove.call(this,e),r.a.pane.disable(),r.a.composer.composingReplyTo(this.discussion)&&!r.a.composer.fields.content()?r.a.composer.hide():r.a.composer.minimize()},n.view=function(){return m("div",{className:"DiscussionPage"},m(c.a,{state:r.a.discussions}),m("div",{className:"DiscussionPage-discussion"},this.discussion?this.pageContent().toArray():this.loadingItems().toArray()))},n.loadingItems=function(){var t=new s.a;return t.add("spinner",m(d.a,null),100),t},n.sidebar=function(){return m("nav",{className:"DiscussionPage-nav"},m("ul",null,Object(f.a)(this.sidebarItems().toArray())))},n.hero=function(){return m(a.a,{discussion:this.discussion})},n.pageContent=function(){var t=new s.a;return t.add("hero",this.hero(),100),t.add("main",m("div",{className:"container"},this.mainContent().toArray()),10),t},n.mainContent=function(){var t=new s.a;return t.add("sidebar",this.sidebar(),100),t.add("poststream",m("div",{className:"DiscussionPage-stream"},u.a.component({discussion:this.discussion,stream:this.stream,onPositionChange:this.positionChanged.bind(this)})),10),t},n.load=function(){var t=r.a.preloadedApiDocument();if(t)setTimeout(this.show.bind(this,t),0);else{var e=this.requestParams();r.a.store.find("discussions",m.route.param("id"),e).then(this.show.bind(this))}m.redraw()},n.requestParams=function(){return{bySlug:!0,page:{near:this.near}}},n.show=function(t){var e=this;r.a.history.push("discussion",t.title()),r.a.setTitle(t.title()),r.a.setTitleCount(0);var n=[];if(t.payload&&t.payload.included){var i=t.id();n=t.payload.included.filter((function(t){return"posts"===t.type&&t.relationships&&t.relationships.discussion&&t.relationships.discussion.data.id===i})).map((function(t){return r.a.store.getById("posts",t.id)})).sort((function(t,e){return t.createdAt()-e.createdAt()})).slice(0,20)}this.stream=new g.a(t,n),this.stream.goToNumber(m.route.param("near")||n[0]&&n[0].number(),!0).then((function(){e.discussion=t,r.a.current.set("discussion",t),r.a.current.set("stream",e.stream)}))},n.sidebarItems=function(){var t=new s.a;return t.add("controls",h.a.component({icon:"fas fa-ellipsis-v",className:"App-primaryControl",buttonClassName:"Button--primary",accessibleToggleLabel:r.a.translator.trans("core.forum.discussion_controls.toggle_dropdown_accessible_label")},p.a.controls(this.discussion,this).toArray())),t.add("scrubber",l.a.component({stream:this.stream,className:"App-titleControl"}),-100),t},n.positionChanged=function(t,e){var n=this.discussion,i=r.a.route.discussion(n,this.near=t);window.history.replaceState(null,document.title,i),r.a.history.push("discussion",n.title()),r.a.session.user&&e>(n.lastReadPostNumber()||0)&&(n.save({lastReadPostNumber:e}),m.redraw())},e}(o.a)},function(t,e,n){"use strict";var i=n(1),r=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.prototype.view=function(){return m("li",{className:"Dropdown-separator"})},e}(n(4).a);r.isListItem=!0,e.a=r},function(t,e,n){"use strict";function i(t,e){var n=t[e];return delete t[e],n}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(33),r=n.n(i);function o(t){var e=r()(t),n=r()();e.isAfter(n)&&(e=n);return e.diff(r()())<-2592e6?e.year()===r()().year()?e.format("D MMM"):e.format("ll"):e.fromNow()}},function(t,e,n){"use strict";function i(){for(var t=arguments.length,e=new Array(t),n=0;n or .");var c=e[0];if("object"!=typeof c||Array.isArray(c)||null===c)throw new Error("Tooltip component was provided with no direct child DOM element. Tooltips must contain a single direct DOM node to attach to.");if("string"==typeof c.tag&&["#","[","<"].includes(c.tag))throw new Error('Tooltip component with provided with a vnode with tag "'+c.tag+'". This is not a DOM element, so is not a valid child element. Please wrap this vnode in another element, such as a
or .');return this.firstChild=c,e},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.checkDomNodeChanged(),this.recreateTooltip()},n.onupdate=function(e){t.prototype.onupdate.call(this,e),this.checkDomNodeChanged(),this.recreateTooltip()},n.recreateTooltip=function(){this.shouldRecreateTooltip&&null!==this.childDomNode&&($(this.childDomNode).tooltip("destroy","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"),this.createTooltip(),this.shouldRecreateTooltip=!1),this.shouldChangeTooltipVisibility&&(this.shouldChangeTooltipVisibility=!1,this.updateVisibility())},n.updateVisibility=function(){null!==this.childDomNode&&(!0===this.attrs.tooltipVisible?$(this.childDomNode).tooltip("show","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"):!1===this.attrs.tooltipVisible&&$(this.childDomNode).tooltip("hide","DANGEROUS_tooltip_jquery_fn_deprecation_exempt"))},n.createTooltip=function(){if(null!==this.childDomNode){var t=this.attrs,e=t.showOnFocus,n=void 0===e||e,i=t.position,r=void 0===i?"top":i,o=t.delay,a=t.html,c=void 0!==a&&a,u=t.tooltipVisible,l=(t.text,"boolean"==typeof u?"manual":Object(s.a)("hover",[n&&"focus"])),d=this.getRealText();this.childDomNode.setAttribute("title",d),this.childDomNode.setAttribute("aria-label",d),$(this.childDomNode).tooltip({html:c,delay:o,placement:r,trigger:l},"DANGEROUS_tooltip_jquery_fn_deprecation_exempt")}},n.getRealText=function(){var t=this.attrs.text;return Array.isArray(t)?Object(a.a)(t):t},n.checkDomNodeChanged=function(){var t=this.firstChild.dom;t&&!t.isSameNode(this.childDomNode)&&(this.childDomNode=t,this.shouldRecreateTooltip=!0)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(6),o=n(4),s=n(73),a=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),r.a.previous=r.a.current,r.a.current=new s.a(this.constructor,{routeName:this.attrs.routeName}),r.a.drawer.hide(),r.a.modal.close(),this.bodyClass="",this.scrollTopOnCreate=!0,this.useBrowserScrollRestoration=!0},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.bodyClass&&$("#app").addClass(this.bodyClass),this.scrollTopOnCreate&&$(window).scrollTop(0),"scrollRestoration"in history&&(history.scrollRestoration=this.useBrowserScrollRestoration?"auto":"manual")},n.onremove=function(e){t.prototype.onremove.call(this,e),this.bodyClass&&$("#app").removeClass(this.bodyClass)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(38);function r(t,e,n){if(!e&&!n)return t;var r=e instanceof RegExp?e:new RegExp(e,"gi"),o=t,s=0;return n&&(e&&(s=Math.max(0,t.search(r)-n/2)),o=Object(i.truncate)(o,n,s)),o=$("
").text(o).html(),e&&(o=o.replace(r,"$&")),m.trust(o)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(1),r=n(4),o=n(2),s=n(8),a=n(25),c=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.prototype.view=function(t){var e=Object.assign({},this.attrs),n=Object(a.a)(e,"type");e.className="Alert Alert--"+n+" "+(e.className||"");var i=Object(a.a)(e,"content")||t.children,r=Object(a.a)(e,"controls")||[],c=Object(a.a)(e,"dismissible"),u=Object(a.a)(e,"ondismiss"),l=[];return(c||void 0===c)&&l.push(m(o.a,{icon:"fas fa-times",className:"Button Button--link Button--icon Alert-dismiss",onclick:u})),m("div",e,m("span",{className:"Alert-body"},i),m("ul",{className:"Alert-controls"},Object(s.a)(r.concat(l))))},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(19),o=n(7);function s(t){var e=t.tag;return("string"!=typeof e||"a"===e||"button"===e)&&("initAttrs"in e&&e.initAttrs(t.attrs),"isActive"in e?e.isActive(t.attrs):t.attrs.active)}var a=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.initAttrs=function(e){e.caretIcon=void 0!==e.caretIcon?e.caretIcon:"fas fa-sort",t.initAttrs.call(this,e),e.className+=" Dropdown--select"},e.prototype.getButtonContent=function(t){var e=t.find(s),n=e&&e.children||this.attrs.defaultLabel;return n instanceof Array&&(n=n[0]),[m("span",{className:"Button-label"},n),Object(o.a)(this.attrs.caretIcon,{className:"Button-caret"})]},e}(r.a)},function(t,e,n){t.exports=function(){"use strict";var t="millisecond",e="second",n="minute",i="hour",r="day",o="week",s="month",a="quarter",c="year",u="date",l=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[^0-9]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,d=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,h={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},f=function(t,e,n){var i=String(t);return!i||i.length>=e?t:""+Array(e+1-i.length).join(n)+t},p={s:f,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),i=Math.floor(n/60),r=n%60;return(e<=0?"+":"-")+f(i,2,"0")+":"+f(r,2,"0")},m:function t(e,n){if(e.date()0?"...":"")+t.substring(n,n+e)+(t.length>n+e?"...":"")}function r(t){return t.toLowerCase().replace(/[^a-z0-9]/gi,"-").replace(/-+/g,"-").replace(/-$|^-/g,"")}function o(t){var e=t.replace(/(<\/p>|
)/g,"$1  ").replace(/]*>/gi," "),n=$("
").html(e);return n.find(o.removeSelectors.join(",")).remove(),n.text().replace(/\s+/g," ").trim()}function s(t){return t.substr(0,1).toUpperCase()+t.substr(1)}n.r(e),n.d(e,"truncate",(function(){return i})),n.d(e,"slug",(function(){return r})),n.d(e,"getPlainContent",(function(){return o})),n.d(e,"ucfirst",(function(){return s})),o.removeSelectors=["blockquote","script"]},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(33),r=n.n(i),o=n(26);function s(t){var e=r()(t),n=e.format(),i=e.format("LLLL"),s=Object(o.a)(t);return m("time",{pubdate:!0,datetime:n,title:i,"data-humantime":!0},s)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.msRequestAnimationFrame||window.oRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},r=function(){function t(t){this.callback=t,this.ticking=!1}var e=t.prototype;return e.loop=function(){var t=this;this.ticking||(i((function(){t.update(),t.ticking=!1})),this.ticking=!0)},e.update=function(){this.callback(window.pageYOffset)},e.start=function(){this.active||window.addEventListener("scroll",this.active=this.loop.bind(this),{passive:!0})},e.stop=function(){window.removeEventListener("scroll",this.active),this.active=null},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(1),r=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.group&&(e.icon=e.group.icon(),e.color=e.group.color(),e.label=void 0===e.label?e.group.nameSingular():e.label,e.type="group--"+e.group.id(),delete e.group)},e}(n(34).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var i=n(1),r=n(0),o=n(4),s=n(116),a=n(2),c=n(15),u=n(55),l=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.prototype.view=function(){var t,e=this.attrs.state,n=e.getParams();if(e.isInitialLoading()||e.isLoadingNext()?t=m(c.a,null):e.hasNext()&&(t=a.a.component({className:"Button",onclick:e.loadNext.bind(e)},r.a.translator.trans("core.forum.discussion_list.load_more_button"))),e.isEmpty()){var i=r.a.translator.trans("core.forum.discussion_list.empty_text");return m("div",{className:"DiscussionList"},u.a.component({text:i}))}return m("div",{className:"DiscussionList"+(e.isSearchResults()?" DiscussionList--searchResults":"")},m("ul",{className:"DiscussionList-discussions"},e.getPages().map((function(t){return t.items.map((function(t){return m("li",{key:t.id(),"data-id":t.id()},s.a.component({discussion:t,params:n}))}))}))),m("div",{className:"DiscussionList-loadMore"},t))},e}(o.a)},function(t,e,n){"use strict";var i=n(0),r=n(23),o=n(61),s=n(35),a=n(2),c=n(24),u=n(119),l=n(3),d=n(9);e.a={controls:function(t,e){var n=this,i=new l.a;return["user","moderation","destructive"].forEach((function(r){var o=n[r+"Controls"](t,e).toArray();o.length&&(o.forEach((function(t){return i.add(t.itemName,t)})),i.add(r+"Separator",c.a.component()))})),i},userControls:function(t,e){var n=this,o=new l.a;return e instanceof r.a&&o.add("reply",!i.a.session.user||t.canReply()?a.a.component({icon:"fas fa-reply",onclick:function(){return n.replyAction.bind(t)(!0,!1).catch((function(){}))}},i.a.translator.trans(i.a.session.user?"core.forum.discussion_controls.reply_button":"core.forum.discussion_controls.log_in_to_reply_button")):a.a.component({icon:"fas fa-reply",className:"disabled",title:i.a.translator.trans("core.forum.discussion_controls.cannot_reply_text")},i.a.translator.trans("core.forum.discussion_controls.cannot_reply_button"))),o},moderationControls:function(t){var e=new l.a;return t.canRename()&&e.add("rename",a.a.component({icon:"fas fa-pencil-alt",onclick:this.renameAction.bind(t)},i.a.translator.trans("core.forum.discussion_controls.rename_button"))),e},destructiveControls:function(t){var e=new l.a;return t.isHidden()?(t.canHide()&&e.add("restore",a.a.component({icon:"fas fa-reply",onclick:this.restoreAction.bind(t)},i.a.translator.trans("core.forum.discussion_controls.restore_button"))),t.canDelete()&&e.add("delete",a.a.component({icon:"fas fa-times",onclick:this.deleteAction.bind(t)},i.a.translator.trans("core.forum.discussion_controls.delete_forever_button")))):t.canHide()&&e.add("hide",a.a.component({icon:"far fa-trash-alt",onclick:this.hideAction.bind(t)},i.a.translator.trans("core.forum.discussion_controls.delete_button"))),e},replyAction:function(t,e){var n=this;return new Promise((function(r,a){return i.a.session.user?n.canReply()?(i.a.composer.composingReplyTo(n)&&!e||i.a.composer.load(o.a,{user:i.a.session.user,discussion:n}),i.a.composer.show(),t&&i.a.viewingDiscussion(n)&&!i.a.composer.isFullScreen()&&i.a.current.get("stream").goToNumber("reply"),r(i.a.composer)):a():(i.a.modal.show(s.a),a())}))},hideAction:function(){return this.pushAttributes({hiddenAt:new Date,hiddenUser:i.a.session.user}),this.save({isHidden:!0})},restoreAction:function(){return this.pushAttributes({hiddenAt:null,hiddenUser:null}),this.save({isHidden:!1})},deleteAction:function(){var t=this;if(confirm(Object(d.a)(i.a.translator.trans("core.forum.discussion_controls.delete_confirmation"))))return i.a.viewingDiscussion(this)&&i.a.history.back(),this.delete().then((function(){return i.a.discussions.removeDiscussion(t)}))},renameAction:function(){return i.a.modal.show(u.a,{currentTitle:this.title(),discussion:this})}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var i=n(1),r=n(0),o=n(16),s=n(35),a=n(2),c=n(63),u=n(9),l=n(3),d=n(11),h=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.username=Object(d.a)(this.attrs.username||""),this.email=Object(d.a)(this.attrs.email||""),this.password=Object(d.a)(this.attrs.password||"")},n.className=function(){return"Modal--small SignUpModal"},n.title=function(){return r.a.translator.trans("core.forum.sign_up.title")},n.content=function(){return[m("div",{className:"Modal-body"},this.body()),m("div",{className:"Modal-footer"},this.footer())]},n.isProvided=function(t){return this.attrs.provided&&-1!==this.attrs.provided.indexOf(t)},n.body=function(){return[this.attrs.token?"":m(c.a,null),m("div",{className:"Form Form--centered"},this.fields().toArray())]},n.fields=function(){var t=new l.a;return t.add("username",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"username",type:"text",placeholder:Object(u.a)(r.a.translator.trans("core.forum.sign_up.username_placeholder")),bidi:this.username,disabled:this.loading||this.isProvided("username")})),30),t.add("email",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"email",type:"email",placeholder:Object(u.a)(r.a.translator.trans("core.forum.sign_up.email_placeholder")),bidi:this.email,disabled:this.loading||this.isProvided("email")})),20),this.attrs.token||t.add("password",m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"password",type:"password",autocomplete:"new-password",placeholder:Object(u.a)(r.a.translator.trans("core.forum.sign_up.password_placeholder")),bidi:this.password,disabled:this.loading})),10),t.add("submit",m("div",{className:"Form-group"},m(a.a,{className:"Button Button--primary Button--block",type:"submit",loading:this.loading},r.a.translator.trans("core.forum.sign_up.submit_button"))),-10),t},n.footer=function(){return[m("p",{className:"SignUpModal-logIn"},r.a.translator.trans("core.forum.sign_up.log_in_text",{a:m("a",{onclick:this.logIn.bind(this)})}))]},n.logIn=function(){var t={identification:this.email()||this.username(),password:this.password()};r.a.modal.show(s.a,t)},n.onready=function(){this.attrs.username&&!this.attrs.email?this.$("[name=email]").select():this.$("[name=username]").select()},n.onsubmit=function(t){t.preventDefault(),this.loading=!0;var e=this.submitData();r.a.request({url:r.a.forum.attribute("baseUrl")+"/register",method:"POST",body:e,errorHandler:this.onerror.bind(this)}).then((function(){return window.location.reload()}),this.loaded.bind(this))},n.submitData=function(){var t={username:this.username(),email:this.email()};return this.attrs.token?t.token=this.attrs.token:t.password=this.password(),t},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(1),r=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.className=(e.className||"")+" Checkbox--switch"},e.prototype.getDisplay=function(){return this.attrs.loading?t.prototype.getDisplay.call(this):""},e}(n(58).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(13),r=function(){function t(t,e){this.component=void 0,this.routeName=void 0,this.component=t,this.routeName=e}var e=t.prototype;return e.makeKey=function(){return this.routeName+JSON.stringify(m.route.param())},e.makeAttrs=function(t){return Object(i.a)({},t.attrs,{routeName:this.routeName})},e.onmatch=function(t,e,n){return this.component},e.render=function(t){return[Object(i.a)({},t,{attrs:this.makeAttrs(t),key:this.makeKey()})]},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var i=n(1),r=n(4),o=n(15),s=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.handler=function(){return this.attrs.when()||void 0},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.boundHandler=this.handler.bind(this),$(window).on("beforeunload",this.boundHandler)},n.onremove=function(e){t.prototype.onremove.call(this,e),$(window).off("beforeunload",this.boundHandler)},n.view=function(t){return t.children[0]},e}(r.a),a=n(81),c=n(14),u=n(8),l=n(3),d=n(10),h=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),this.composer=this.attrs.composer,this.loading=!1,this.attrs.confirmExit&&this.composer.preventClosingWhen((function(){return n.hasChanges()}),this.attrs.confirmExit),this.composer.fields.content(this.attrs.originalContent||"")},n.view=function(){return m(s,{when:this.hasChanges.bind(this)},m("div",{className:"ComposerBody "+(this.attrs.className||"")},Object(c.a)(this.attrs.user,{className:"ComposerBody-avatar"}),m("div",{className:"ComposerBody-content"},m("ul",{className:"ComposerBody-header"},Object(u.a)(this.headerItems().toArray())),m("div",{className:"ComposerBody-editor"},a.a.component({submitLabel:this.attrs.submitLabel,placeholder:this.attrs.placeholder,disabled:this.loading||this.attrs.disabled,composer:this.composer,preview:this.jumpToPreview&&this.jumpToPreview.bind(this),onchange:this.composer.fields.content,onsubmit:this.onsubmit.bind(this),value:this.composer.fields.content()}))),m(o.a,{display:"unset",containerClassName:Object(d.a)("ComposerBody-loading",this.loading&&"active"),size:"large"})))},n.hasChanges=function(){var t=this.composer.fields.content();return t&&t!==this.attrs.originalContent},n.headerItems=function(){return new l.a},n.onsubmit=function(){},n.loaded=function(){this.loading=!1,m.redraw()},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(13);function r(t,e,n){void 0===e&&(e=null),void 0===n&&(n={});var r=Object(i.a)({},n);r.state=r.state||{},r.state.key=Date.now(),m.route.set(t,e,r)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(1),r=n(4),o=n(8),s=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.prototype.view=function(t){return m("fieldset",{className:this.attrs.className},m("legend",null,this.attrs.label),m("ul",null,Object(o.a)(t.children)))},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(1),r=n(6),o=n(4),s=n(2),a=n(17),c=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){var t=r.a.history,e=r.a.pane;return m("div",{className:"Navigation ButtonGroup "+(this.attrs.className||""),onmouseenter:e&&e.show.bind(e),onmouseleave:e&&e.onmouseleave.bind(e)},t.canGoBack()?[this.getBackButton(),this.getPaneButton()]:this.getDrawerButton())},n.getBackButton=function(){var t=r.a.history,e=t.getPrevious()||{};return a.a.component({className:"Button Navigation-back Button--icon",href:t.backUrl(),icon:"fas fa-chevron-left",title:e.title,onclick:function(e){e.shiftKey||e.ctrlKey||e.metaKey||2===e.which||(e.preventDefault(),t.back())}})},n.getPaneButton=function(){var t=r.a.pane;return t&&t.active?s.a.component({className:"Button Button--icon Navigation-pin"+(t.pinned?" active":""),onclick:t.togglePinned.bind(t),icon:"fas fa-thumbtack"}):""},n.getDrawerButton=function(){if(!this.attrs.drawer)return"";var t=r.a.drawer,e=r.a.session.user;return s.a.component({className:"Button Button--icon Navigation-drawer"+(e&&e.newNotificationCount()?" new":""),onclick:function(e){e.stopPropagation(),t.show()},icon:"fas fa-bars"})},e}(o.a)},function(t,e,n){"use strict";function i(t,e,n,i){var r,o=!1,s=0;function a(){r&&clearTimeout(r)}function c(){for(var c=arguments.length,u=new Array(c),l=0;lt?f():!0!==e&&(r=setTimeout(i?p:f,void 0===i?t-h:t)))}return"boolean"!=typeof e&&(i=n,n=e,e=void 0),c.cancel=function(){a(),o=!0},c}function r(t,e,n){return void 0===n?i(t,e,!1):i(t,n,!1!==e)}n.d(e,"a",(function(){return r})),n.d(e,"b",(function(){return i}))},function(t,e,n){"use strict";function i(t,e){return t&&(t===e||t.prototype instanceof e)}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(){for(var t=arguments.length,e=new Array(t),n=0;nthis.getNextPageNumber()-1?this.pages.push(o):this.pages.unshift(o),this.location={page:i},m.redraw()},e.loadPage=function(t){void 0===t&&(t=1);var e=this.requestParams();return e.page=Object(i.a)({offset:this.pageSize*(t-1)},e.page),Array.isArray(e.include)&&(e.include=e.include.join(",")),r.a.store.find(this.type,e)},e.requestParams=function(){return this.params},e.refreshParams=function(t,e){if(this.isEmpty()||this.paramsChanged(t))return this.params=t,this.refresh(e)},e.refresh=function(t){var e=this;return void 0===t&&(t=1),this.initialLoading=!0,this.loadingPrev=!1,this.loadingNext=!1,this.clear(),this.location={page:t},this.loadPage().then((function(t){e.pages=[],e.parseResults(e.location.page,t)})).finally((function(){return e.initialLoading=!1}))},e.getPages=function(){return this.pages},e.getLocation=function(){return this.location},e.isLoading=function(){return this.initialLoading||this.loadingNext||this.loadingPrev},e.isInitialLoading=function(){return this.initialLoading},e.isLoadingPrev=function(){return this.loadingPrev},e.isLoadingNext=function(){return this.loadingNext},e.hasItems=function(){return!!this.getAllItems().length},e.isEmpty=function(){return!this.isInitialLoading()&&!this.hasItems()},e.hasPrev=function(){var t;return!(null==(t=this.pages[0])||!t.hasPrev)},e.hasNext=function(){var t;return!(null==(t=this.pages[this.pages.length-1])||!t.hasNext)},e.getParams=function(){return this.params},e.getNextPageNumber=function(){var t,e=null==(t=this.pages[this.pages.length-1])?void 0:t.number;return e&&!isNaN(e)?e+1:this.location.page},e.getPrevPageNumber=function(){var t,e=null==(t=this.pages[0])?void 0:t.number;return e&&!isNaN(e)?Math.max(e-1,1):this.location.page},e.paramsChanged=function(t){var e=this;return Object.keys(t).some((function(n){return e.getParams()[n]!==t[n]}))},e.getAllItems=function(){return this.getPages().map((function(t){return t.items})).flat()},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(1),r=n(4),o=n(15),s=n(7),a=n(10),c=n(59),u=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(t){"0"===this.attrs.state&&(this.attrs.state=!1);var e=Object(a.a)(["Checkbox",this.attrs.state?"on":"off",this.attrs.className,this.attrs.loading&&"loading",this.attrs.disabled&&"disabled"]);return m("label",{className:e},m("input",{type:"checkbox",checked:this.attrs.state,disabled:this.attrs.disabled,onchange:Object(c.a)("checked",this.onchange.bind(this))}),m("div",{className:"Checkbox-display","aria-hidden":"true"},this.getDisplay()),t.children)},n.getDisplay=function(){return this.attrs.loading?m(o.a,{display:"unset",size:"small"}):Object(s.a)(this.attrs.state?"fas fa-check":"fas fa-times")},n.onchange=function(t){this.attrs.onchange&&this.attrs.onchange(t,this)},e}(r.a)},function(t,e,n){"use strict";e.a=function(t,e){return function(){e(this.getAttribute(t)||this[t])}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(1),r=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.className=e.className||"Button Button--icon Button--link"},e}(n(2).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var i=n(1),r=n(0),o=n(47),s=n(2),a=n(12),c=n(7),u=n(9);function l(t){r.a.composer.isFullScreen()&&(r.a.composer.minimize(),t.stopPropagation())}var d=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.placeholder=e.placeholder||Object(u.a)(r.a.translator.trans("core.forum.composer_reply.body_placeholder")),e.submitLabel=e.submitLabel||r.a.translator.trans("core.forum.composer_reply.submit_button"),e.confirmExit=e.confirmExit||Object(u.a)(r.a.translator.trans("core.forum.composer_reply.discard_confirmation"))};var n=e.prototype;return n.headerItems=function(){var e=t.prototype.headerItems.call(this),n=this.attrs.discussion;return e.add("title",m("h3",null,Object(c.a)("fas fa-reply")," ",m(a.a,{href:r.a.route.discussion(n),onclick:l},n.title()))),e},n.jumpToPreview=function(t){l(t),m.route.set(r.a.route.discussion(this.attrs.discussion,"reply"))},n.data=function(){return{content:this.composer.fields.content(),relationships:{discussion:this.attrs.discussion}}},n.onsubmit=function(){var t=this,e=this.attrs.discussion;this.loading=!0,m.redraw();var n=this.data();r.a.store.createRecord("posts").save(n).then((function(n){if(r.a.viewingDiscussion(e)){var i=r.a.current.get("stream");i.update().then((function(){return i.goToNumber(n.number())}))}else{var o,a=s.a.component({className:"Button Button--link",onclick:function(){m.route.set(r.a.route.post(n)),r.a.alerts.dismiss(o)}},r.a.translator.trans("core.forum.composer_reply.view_button"));o=r.a.alerts.show({type:"success",controls:[a]},r.a.translator.trans("core.forum.composer_reply.posted_message"))}t.composer.hide()}),this.loaded.bind(this))},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(176),r=n.n(i),o=n(54),s=n(3),a=function(){function t(t,e){this.el=void 0,this.el=document.createElement("textarea"),this.build(t,e)}var e=t.prototype;return e.build=function(t,e){var n=this;this.el.className=e.classNames.join(" "),this.el.disabled=e.disabled,this.el.placeholder=e.placeholder,this.el.value=e.value;var i=function(t){e.inputListeners.forEach((function(t){t()})),t.redraw=!1};this.el.oninput=function(t){e.oninput(n.el.value),i(t)},this.el.onclick=i,this.el.onkeyup=i,this.el.addEventListener("keydown",(function(t){n.keyHandlers(e).toArray().forEach((function(e){return e(t)}))})),t.append(this.el)},e.keyHandlers=function(t){var e=new s.a;return e.add("submit",(function(e){(e.metaKey||e.ctrlKey)&&"Enter"===e.key&&t.onsubmit()})),e},e.moveCursorTo=function(t){this.setSelectionRange(t,t)},e.getSelectionRange=function(){return[this.el.selectionStart,this.el.selectionEnd]},e.getLastNChars=function(t){return this.el.value.slice(Math.max(0,this.el.selectionStart-t),this.el.selectionStart)},e.insertAtCursor=function(t){this.insertAt(this.el.selectionStart,t)},e.insertAt=function(t,e){this.insertBetween(t,t,e)},e.insertBetween=function(t,e,n){this.setSelectionRange(t,e);var i=t+n.length;Object(o.a)(this.el,{text:n,selectionStart:i,selectionEnd:i})},e.replaceBeforeCursor=function(t,e){this.insertBetween(t,this.el.selectionStart,e)},e.setSelectionRange=function(t,e){this.el.setSelectionRange(t,e),this.focus()},e.getCaretCoordinates=function(t){var e=r()(this.el,t);return{top:e.top-this.el.scrollTop,left:e.left}},e.disabled=function(t){this.el.disabled=t},e.focus=function(){this.el.focus()},e.destroy=function(){this.el.remove()},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(1),r=n(4),o=n(3),s=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){return m("div",{className:"LogInButtons"},this.items().toArray())},n.items=function(){return new o.a},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(1),r=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t),e.initAttrs=function(t){t.className=t.className||"",t.surround=t.surround||function(t){return t()}};var n=e.prototype;return n.view=function(){return m("div",{className:this.attrs.className})},n.oncreate=function(e){var n,i=this;t.prototype.oncreate.call(this,e);var r=function(){if(i.attrs.composer.isVisible()){var t=i.attrs.composer.fields.content();n!==t&&(n=t,i.attrs.surround((function(){return s9e.TextFormatter.preview(n||"",e.dom)})))}};r(),this.updateInterval=setInterval(r,50)},n.onremove=function(e){t.prototype.onremove.call(this,e),clearInterval(this.updateInterval)},e}(n(4).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var i=n(1),r=n(0),o=n(4),s=n(8),a=n(2),c=n(12),u=n(15),l=n(56),d=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){var t=this.attrs.state;return m("div",{className:"NotificationList"},m("div",{className:"NotificationList-header"},m("h4",{className:"App-titleControl App-titleControl--text"},r.a.translator.trans("core.forum.notifications.title")),m("div",{className:"App-primaryControl"},m(a.a,{className:"Button Button--link",icon:"fas fa-check",title:r.a.translator.trans("core.forum.notifications.mark_all_as_read_tooltip"),onclick:t.markAllAsRead.bind(t)}))),m("div",{className:"NotificationList-content"},this.content(t)))},n.content=function(t){return t.isLoading()?m(u.a,{className:"LoadingIndicator--block"}):t.hasItems()?t.getPages().map((function(t){var e=[],n={};return t.items.forEach((function(t){var i=t.subject();if(void 0!==i){var r=null;i instanceof l.a?r=i:i&&i.discussion&&(r=i.discussion());var o=r?r.id():0;n[o]=n[o]||{discussion:r,notifications:[]},n[o].notifications.push(t),-1===e.indexOf(n[o])&&e.push(n[o])}})),e.map((function(t){var e=t.discussion&&t.discussion.badges().toArray();return m("div",{className:"NotificationGroup"},t.discussion?m(c.a,{className:"NotificationGroup-header",href:r.a.route.discussion(t.discussion)},e&&!!e.length&&m("ul",{className:"NotificationGroup-badges badges"},Object(s.a)(e)),m("span",null,t.discussion.title())):m("div",{className:"NotificationGroup-header"},r.a.forum.attribute("title")),m("ul",{className:"NotificationGroup-content"},t.notifications.map((function(t){var e=r.a.notificationComponents[t.contentType()];return e?m("li",null,e.component({notification:t})):""}))))}))})):m("div",{className:"NotificationList-empty"},r.a.translator.trans("core.forum.notifications.empty_text"))},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.$notifications=this.$(".NotificationList-content"),this.$scrollParent=this.inPanel()?this.$notifications:$(window),this.boundScrollHandler=this.scrollHandler.bind(this),this.$scrollParent.on("scroll",this.boundScrollHandler)},n.onremove=function(e){t.prototype.onremove.call(this,e),this.$scrollParent.off("scroll",this.boundScrollHandler)},n.scrollHandler=function(){var t=this.attrs.state,e=this.inPanel()?this.$scrollParent[0]:document.documentElement,n=Math.abs(e.scrollHeight-e.scrollTop-e.clientHeight)<=1;t.hasNext()&&!t.isLoadingNext()&&n&&t.loadNext()},n.inPanel=function(){return"auto"===this.$notifications.css("overflow")},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var i=n(1),r=n(0),o=n(67),s=n(10),a=n(138),c=n(142),u=n(143),l=n(68),d=n(3),h=n(8),f=n(2),p=n(64),g=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),this.revealContent=!1,this.cardVisible=!1,this.subtree.check((function(){return n.cardVisible}),(function(){return n.isEditing()}),(function(){return n.revealContent}))},n.content=function(){return t.prototype.content.call(this).concat([m("header",{className:"Post-header"},m("ul",null,Object(h.a)(this.headerItems().toArray()))),m("div",{className:"Post-body"},this.isEditing()?m(p.a,{className:"Post-preview",composer:r.a.composer}):m.trust(this.attrs.post.contentHtml()))])},n.refreshContent=function(){var t=this.isEditing()?"":this.attrs.post.contentHtml();this.contentHtml!==t&&this.$(".Post-body script").each((function(){var t=document.createElement("script");t.textContent=this.textContent,Array.from(this.attributes).forEach((function(e){return t.setAttribute(e.name,e.value)})),this.parentNode.replaceChild(t,this)})),this.contentHtml=t},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.refreshContent()},n.onupdate=function(e){t.prototype.onupdate.call(this,e),this.refreshContent()},n.isEditing=function(){return r.a.composer.bodyMatches(l.a,{post:this.attrs.post})},n.elementAttrs=function(){var e=this.attrs.post,n=t.prototype.elementAttrs.call(this);return n.className=(n.className||"")+" "+Object(s.a)({CommentPost:!0,"Post--hidden":e.isHidden(),"Post--edited":e.isEdited(),revealContent:this.revealContent,editing:this.isEditing()}),n},n.toggleContent=function(){this.revealContent=!this.revealContent},n.headerItems=function(){var t=this,e=new d.a,n=this.attrs.post;return e.add("user",a.a.component({post:n,cardVisible:this.cardVisible,oncardshow:function(){t.cardVisible=!0,m.redraw()},oncardhide:function(){t.cardVisible=!1,m.redraw()}}),100),e.add("meta",c.a.component({post:n})),n.isEdited()&&!n.isHidden()&&e.add("edited",u.a.component({post:n})),n.isHidden()&&e.add("toggle",f.a.component({className:"Button Button--default Button--more",icon:"fas fa-ellipsis-h",onclick:this.toggleContent.bind(this)})),e},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var i=n(1),r=n(0),o=n(4),s=n(53),a=n(19),c=n(137),u=n(8),l=n(3),d=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),this.loading=!1,this.subtree=new s.a((function(){return n.attrs.post.freshness}),(function(){var t=n.attrs.post.user();return t&&t.freshness}),(function(){return n.controlsOpen}))},n.view=function(){var t=this,e=this.elementAttrs();e.className=this.classes(e.className).join(" ");var n=c.a.controls(this.attrs.post,this).toArray(),i=this.footerItems().toArray();return m("article",e,m("div",null,this.content(),m("aside",{className:"Post-actions"},m("ul",null,Object(u.a)(this.actionItems().toArray()),n.length?m("li",null,m(a.a,{className:"Post-controls",buttonClassName:"Button Button--icon Button--flat",menuClassName:"Dropdown-menu--right",icon:"fas fa-ellipsis-h",onshow:function(){return t.$(".Post-actions").addClass("open")},onhide:function(){return t.$(".Post-actions").removeClass("open")},accessibleToggleLabel:r.a.translator.trans("core.forum.post_controls.toggle_dropdown_accessible_label")},n)):"")),m("footer",{className:"Post-footer"},i.length?m("ul",null,Object(u.a)(i)):null)))},n.onbeforeupdate=function(e){return t.prototype.onbeforeupdate.call(this,e),this.subtree.needsRebuild()},n.onupdate=function(e){t.prototype.onupdate.call(this,e);var n=this.$(".Post-actions"),i=this.$(".Post-controls");n.toggleClass("open",i.hasClass("open"))},n.elementAttrs=function(){return{}},n.content=function(){return[]},n.classes=function(t){var e=(t||"").split(" ").concat(["Post"]),n=this.attrs.post.user(),i=this.attrs.post.discussion();return this.loading&&e.push("Post--loading"),n&&n===r.a.session.user&&e.push("Post--by-actor"),n&&n===i.user()&&e.push("Post--by-start-user"),e},n.actionItems=function(){return new l.a},n.footerItems=function(){return new l.a},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var i=n(1),r=n(0),o=n(47),s=n(2),a=n(12),c=n(7);function u(t){r.a.composer.isFullScreen()&&(r.a.composer.minimize(),t.stopPropagation())}var l=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.submitLabel=e.submitLabel||r.a.translator.trans("core.forum.composer_edit.submit_button"),e.confirmExit=e.confirmExit||r.a.translator.trans("core.forum.composer_edit.discard_confirmation"),e.originalContent=e.originalContent||e.post.content(),e.user=e.user||e.post.user(),e.post.editedContent=e.originalContent};var n=e.prototype;return n.headerItems=function(){var e=t.prototype.headerItems.call(this),n=this.attrs.post;return e.add("title",m("h3",null,Object(c.a)("fas fa-pencil-alt")," ",m(a.a,{href:r.a.route.discussion(n.discussion(),n.number()),onclick:u},r.a.translator.trans("core.forum.composer_edit.post_link",{number:n.number(),discussion:n.discussion().title()})))),e},n.jumpToPreview=function(t){u(t),m.route.set(r.a.route.post(this.attrs.post))},n.data=function(){return{content:this.composer.fields.content()}},n.onsubmit=function(){var t=this,e=this.attrs.post.discussion();this.loading=!0;var n=this.data();this.attrs.post.save(n).then((function(n){if(r.a.viewingDiscussion(e))r.a.current.get("stream").goToNumber(n.number());else{var i,o=s.a.component({className:"Button Button--link",onclick:function(){m.route.set(r.a.route.post(n)),r.a.alerts.dismiss(i)}},r.a.translator.trans("core.forum.composer_edit.view_button"));i=r.a.alerts.show({type:"success",controls:[o]},r.a.translator.trans("core.forum.composer_edit.edited_message"))}t.composer.hide()}),this.loaded.bind(this))},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return v}));var i=n(1),r=n(0),o=n(4),s=n(26),a=n(3),c=n(139),u=n(14),l=n(20),d=n(7),h=n(19),f=n(12),p=n(141),g=n(8),v=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){var t=this.attrs.user,e=c.a.controls(t,this).toArray(),n=t.color(),i=t.badges().toArray();return m("div",{className:"UserCard "+(this.attrs.className||""),style:n&&{"--usercard-bg":n}},m("div",{className:"darkenBackground"},m("div",{className:"container"},e.length?h.a.component({className:"UserCard-controls App-primaryControl",menuClassName:"Dropdown-menu--right",buttonClassName:this.attrs.controlsButtonClassName,label:r.a.translator.trans("core.forum.user_controls.button"),accessibleToggleLabel:r.a.translator.trans("core.forum.user_controls.toggle_dropdown_accessible_label"),icon:"fas fa-ellipsis-v"},e):"",m("div",{className:"UserCard-profile"},m("h2",{className:"UserCard-identity"},this.attrs.editable?[p.a.component({user:t,className:"UserCard-avatar"}),Object(l.a)(t)]:m(f.a,{href:r.a.route.user(t)},m("div",{className:"UserCard-avatar"},Object(u.a)(t)),Object(l.a)(t))),i.length?m("ul",{className:"UserCard-badges badges"},Object(g.a)(i)):"",m("ul",{className:"UserCard-info"},Object(g.a)(this.infoItems().toArray()))))))},n.infoItems=function(){var t=new a.a,e=this.attrs.user,n=e.lastSeenAt();if(n){var i=e.isOnline();t.add("lastSeen",m("span",{className:"UserCard-lastSeen"+(i?" online":"")},i?[Object(d.a)("fas fa-circle")," ",r.a.translator.trans("core.forum.user.online_text")]:[Object(d.a)("far fa-clock")," ",Object(s.a)(n)]))}return t.add("joined",r.a.translator.trans("core.forum.user.joined_date_text",{ago:Object(s.a)(e.joinTime())})),t},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var i=n(1),r=n(6),o=n(16),s=n(2),a=n(41),c=n(18),u=n(9),l=n(3),d=n(11),h=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e);var i=this.attrs.user;this.username=Object(d.a)(i.username()||""),this.email=Object(d.a)(i.email()||""),this.isEmailConfirmed=Object(d.a)(i.isEmailConfirmed()||!1),this.setPassword=Object(d.a)(!1),this.password=Object(d.a)(i.password()||""),this.groups={},r.a.store.all("groups").filter((function(t){return-1===[c.a.GUEST_ID,c.a.MEMBER_ID].indexOf(t.id())})).forEach((function(t){return n.groups[t.id()]=Object(d.a)(-1!==i.groups().indexOf(t))}))},n.className=function(){return"EditUserModal Modal--small"},n.title=function(){return r.a.translator.trans("core.lib.edit_user.title")},n.content=function(){var t=this.fields().toArray();return m("div",{className:"Modal-body"},t.length>1?m("div",{className:"Form"},this.fields().toArray()):r.a.translator.trans("core.lib.edit_user.nothing_available"))},n.fields=function(){var t=this,e=new l.a;return r.a.session.user.canEditCredentials()&&(e.add("username",m("div",{className:"Form-group"},m("label",null,r.a.translator.trans("core.lib.edit_user.username_heading")),m("input",{className:"FormControl",placeholder:Object(u.a)(r.a.translator.trans("core.lib.edit_user.username_label")),bidi:this.username,disabled:this.nonAdminEditingAdmin()})),40),r.a.session.user!==this.attrs.user&&(e.add("email",m("div",{className:"Form-group"},m("label",null,r.a.translator.trans("core.lib.edit_user.email_heading")),m("div",null,m("input",{className:"FormControl",placeholder:Object(u.a)(r.a.translator.trans("core.lib.edit_user.email_label")),bidi:this.email,disabled:this.nonAdminEditingAdmin()})),!this.isEmailConfirmed()&&this.userIsAdmin(r.a.session.user)?m("div",null,s.a.component({className:"Button Button--block",loading:this.loading,onclick:this.activate.bind(this)},r.a.translator.trans("core.lib.edit_user.activate_button"))):""),30),e.add("password",m("div",{className:"Form-group"},m("label",null,r.a.translator.trans("core.lib.edit_user.password_heading")),m("div",null,m("label",{className:"checkbox"},m("input",{type:"checkbox",onchange:function(e){t.setPassword(e.target.checked),m.redraw.sync(),e.target.checked&&t.$("[name=password]").select(),e.redraw=!1},disabled:this.nonAdminEditingAdmin()}),r.a.translator.trans("core.lib.edit_user.set_password_label")),this.setPassword()?m("input",{className:"FormControl",type:"password",name:"password",placeholder:Object(u.a)(r.a.translator.trans("core.lib.edit_user.password_label")),bidi:this.password,disabled:this.nonAdminEditingAdmin()}):"")),20))),r.a.session.user.canEditGroups()&&e.add("groups",m("div",{className:"Form-group EditUserModal-groups"},m("label",null,r.a.translator.trans("core.lib.edit_user.groups_heading")),m("div",null,Object.keys(this.groups).map((function(t){return r.a.store.getById("groups",t)})).map((function(e){return m("label",{className:"checkbox"},m("input",{type:"checkbox",bidi:t.groups[e.id()],disabled:e.id()===c.a.ADMINISTRATOR_ID&&(t.attrs.user===r.a.session.user||!t.userIsAdmin(r.a.session.user))}),a.a.component({group:e,label:""})," ",e.nameSingular())})))),10),e.add("submit",m("div",{className:"Form-group"},s.a.component({className:"Button Button--primary",type:"submit",loading:this.loading},r.a.translator.trans("core.lib.edit_user.submit_button"))),-10),e},n.activate=function(){var t=this;this.loading=!0;var e={username:this.username(),isEmailConfirmed:!0};this.attrs.user.save(e,{errorHandler:this.onerror.bind(this)}).then((function(){t.isEmailConfirmed(!0),t.loading=!1,m.redraw()})).catch((function(){t.loading=!1,m.redraw()}))},n.data=function(){var t=this,e={relationships:{}};return this.attrs.user.canEditCredentials()&&!this.nonAdminEditingAdmin()&&(e.username=this.username(),r.a.session.user!==this.attrs.user&&(e.email=this.email()),this.setPassword()&&(e.password=this.password())),this.attrs.user.canEditGroups()&&(e.relationships.groups=Object.keys(this.groups).filter((function(e){return t.groups[e]()})).map((function(t){return r.a.store.getById("groups",t)}))),e},n.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0,this.attrs.user.save(this.data(),{errorHandler:this.onerror.bind(this)}).then(this.hide.bind(this)).catch((function(){e.loading=!1,m.redraw()}))},n.nonAdminEditingAdmin=function(){return this.userIsAdmin(this.attrs.user)&&!this.userIsAdmin(r.a.session.user)},n.userIsAdmin=function(t){return t.groups().some((function(t){return t.id()===c.a.ADMINISTRATOR_ID}))},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(87),r=n(1),o=n(0);function s(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(n)return(n=n.call(t)).next.bind(n);if(Array.isArray(t)||(n=function(t,e){if(!t)return;if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return a(t,e)}(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,i=new Array(e);n=n).toggleClass("scrolled",t>n),$(".App-header").toggleClass("navbar-fixed-top",t>=n)}));n.start(),n.update(),$((function(){$("body").addClass("ontouchstart"in window?"touch":"no-touch")})),Object(b.a)()},e.preloadedApiDocument=function(){if(this.data.apiDocument&&window.location.href===this.initialRoute){var t=this.store.pushPayload(this.data.apiDocument);return this.data.apiDocument=null,t}return null},e.screen=function(){return getComputedStyle(document.documentElement).getPropertyValue("--flarum-screen")},e.setTitle=function(t){this.title=t,this.updateTitle()},e.setTitleCount=function(t){this.titleCount=t,this.updateTitle()},e.updateTitle=function(){var t=this.titleCount?"("+this.titleCount+") ":"",e=this.title&&m.route.get()!==this.forum.attribute("basePath")+"/"?this.title+" - ":"",n=this.forum.attribute("title");document.title=t+e+n},e.request=function(t){var e=this,n=Object.assign({},t);if(n.background=n.background||!0,Object(y.extend)(n,"config",(function(t,n){return n.setRequestHeader("X-CSRF-Token",e.session.csrfToken)})),"GET"!==n.method&&"POST"!==n.method){var r=n.method;Object(y.extend)(n,"config",(function(t,e){return e.setRequestHeader("X-HTTP-Method-Override",r)})),n.method="POST"}n.deserialize=n.deserialize||function(t){return t},n.errorHandler=n.errorHandler||function(t){throw t};var s=n.extract;return n.extract=function(t){var e;e=s?s(t.responseText):t.responseText||null;var r=t.status;if(r<200||r>299)throw new g.a(r,e,n,t);if(t.getResponseHeader){var o=t.getResponseHeader("X-CSRF-Token");o&&(i.a.session.csrfToken=o)}try{return JSON.parse(e)}catch(i){throw new g.a(500,e,n,t)}},this.requestErrorAlert&&this.alerts.dismiss(this.requestErrorAlert),m.request(n).then((function(t){return t}),(function(t){var r;switch(t.status){case 422:r=t.response.errors.map((function(t){return[t.detail,m("br",null)]})).reduce((function(t,e){return t.concat(e)}),[]).slice(0,-1);break;case 401:case 403:r=i.a.translator.trans("core.lib.error.permission_denied_message");break;case 404:case 410:r=i.a.translator.trans("core.lib.error.not_found_message");break;case 413:r=i.a.translator.trans("core.lib.error.payload_too_large_message");break;case 429:r=i.a.translator.trans("core.lib.error.rate_limit_exceeded_message");break;default:r=i.a.translator.trans("core.lib.error.generic_message")}var s=i.a.forum.attribute("debug"),a=t.response&&t.response.errors,c=Array.isArray(a)&&a[0]&&a[0].detail&&a.map((function(t){return decodeURI(t.detail)}));t.alert={type:"error",content:r,controls:s&&[m(o.a,{className:"Button Button--link",onclick:e.showDebug.bind(e,t,c)},"Debug")]};try{n.errorHandler(t)}catch(t){if(s&&t.xhr){var u,l=t.options,d=l.method,h=l.url,f=t.xhr.status,p=void 0===f?"":f;console.group(d+" "+h+" "+p),(u=console).error.apply(u,c||[t]),console.groupEnd()}e.requestErrorAlert=e.alerts.show(t.alert,t.alert.content)}return Promise.reject(t)}))},e.showDebug=function(t,e){this.alerts.dismiss(this.requestErrorAlert),this.modal.show(c.a,{error:t,formattedError:e})},e.route=function(t,e){void 0===e&&(e={});var n=this.routes[t];if(!n)throw new Error("Route '"+t+"' does not exist");var i=n.path.replace(/:([^\/]+)/g,(function(t,n){return Object(h.a)(e,n)}));for(var r in e)e.hasOwnProperty(r)&&!e[r]&&delete e[r];var o=m.buildQueryString(e);return(""===m.route.prefix?this.forum.attribute("basePath"):"")+i+(o?"?"+o:"")},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(52),r=function(){function t(t,e){void 0===e&&(e={}),this.type=t,this.data=e}var e=t.prototype;return e.matches=function(t,e){var n=this;return void 0===e&&(e={}),!!Object(i.a)(this.type,t)&&Object.keys(e).every((function(t){return n.data[t]===e[t]}))},e.get=function(t){return this.data[t]},e.set=function(t,e){this.data[t]=e},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(0);function r(t,e){return void 0===e&&(e=i.a.data.locale),new Intl.NumberFormat(e).format(t)}},function(t,e){t.exports=function(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(t,e,n,i){this.status=void 0,this.options=void 0,this.xhr=void 0,this.responseText=void 0,this.response=void 0,this.alert=void 0,this.status=t,this.responseText=e,this.options=n,this.xhr=i;try{this.response=JSON.parse(e)}catch(t){this.response=null}this.alert=null}},function(t,e,n){"use strict";function i(t,e,n){(Array.isArray(e)?e:[e]).forEach((function(e){var i=t[e];t[e]=function(){for(var t=arguments.length,e=new Array(t),r=0;r=1e6?Math.floor(t/1e6)+i.a.translator.trans("core.lib.number_suffix.mega_text"):t>=1e3?(t/1e3).toFixed(1)+i.a.translator.trans("core.lib.number_suffix.kilo_text"):t.toString()}},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var i=n(1),r=n(6),o=n(4),s=n(3),a=n(8),c=n(2),u=n(62),l=n(28),d=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.value=this.attrs.value||"",this.disabled=!!this.attrs.disabled},n.view=function(){return m("div",{className:"TextEditor"},m("div",{className:"TextEditor-editorContainer"}),m("ul",{className:"TextEditor-controls Composer-footer"},Object(a.a)(this.controlItems().toArray()),m("li",{className:"TextEditor-toolbar"},this.toolbarItems().toArray())))},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.attrs.composer.editor=this.buildEditor(this.$(".TextEditor-editorContainer")[0])},n.onupdate=function(e){t.prototype.onupdate.call(this,e);var n=!!this.attrs.disabled;this.disabled!==n&&(this.disabled=n,this.attrs.composer.editor.disabled(n))},n.buildEditorParams=function(){var t=this;return{classNames:["FormControl","Composer-flexible","TextEditor-editor"],disabled:this.disabled,placeholder:this.attrs.placeholder||"",value:this.value,oninput:this.oninput.bind(this),inputListeners:[],onsubmit:function(){t.onsubmit(),m.redraw()}}},n.buildEditor=function(t){return new u.a(t,this.buildEditorParams())},n.controlItems=function(){var t=new s.a;return t.add("submit",c.a.component({icon:"fas fa-paper-plane",className:"Button Button--primary",itemClassName:"App-primaryControl",onclick:this.onsubmit.bind(this)},this.attrs.submitLabel)),this.attrs.preview&&t.add("preview",m(l.a,{text:r.a.translator.trans("core.forum.composer.preview_tooltip")},m(c.a,{icon:"far fa-eye",className:"Button Button--icon",onclick:this.attrs.preview}))),t},n.toolbarItems=function(){return new s.a},n.oninput=function(t){this.value=t,this.attrs.onchange(this.value)},n.onsubmit=function(){this.attrs.onsubmit(this.value)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=/[.*+?^${}()|[\]\\]/g;function r(t){return t.replace(i,"\\$&")}},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(19),o=n(2),s=n(7),a=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.className+=" Dropdown--split",e.menuClassName+=" Dropdown-menu--right"};var n=e.prototype;return n.getButton=function(t){var e=this.getFirstChild(t),n=Object.assign({},e.attrs);return n.className=(n.className||"")+" SplitDropdown-button Button "+this.attrs.buttonClassName,[o.a.component(n,e.children),m("button",{className:"Dropdown-toggle Button Button--icon "+this.attrs.buttonClassName,"aria-haspopup":"menu","aria-label":this.attrs.accessibleToggleLabel,"data-toggle":"dropdown"},Object(s.a)(this.attrs.icon,{className:"Button-icon"}),Object(s.a)("fas fa-caret-down",{className:"Button-caret"}))]},n.getFirstChild=function(t){for(var e=t;e instanceof Array;)e=e[0];return e},e}(r.a)},function(t,e,n){"use strict";function i(t,e){var n=$(window),i=$(t).offset().top-n.scrollTop();e(),n.scrollTop($(t).offset().top-i)}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(7);function r(t){if(t.lastSeenAt()&&t.isOnline())return m("span",{className:"UserOnline"},Object(i.a)("fas fa-circle"))}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(33),r=n.n(i);function o(t){var e=r()(t),n=e.format(),i=e.format("LLLL");return m("time",{pubdate:!0,datetime:n},i)}},function(t,e,n){"use strict";function i(t,e){for(var n=0;n").addClass("drawer-backdrop fade").appendTo("body").click((function(){return t.hide()})),setTimeout((function(){return t.$backdrop.addClass("in")}))},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(46);function r(t,e){void 0===e&&(e="");var n={};for(var r in t){var o=t[r];if("resolver"in o)n[e+o.path]=o.resolver;else{if(!("component"in o))throw new Error("Either a resolver or a component must be provided for the route ["+r+"]");var s="resolverClass"in o?o.resolverClass:i.a;n[e+o.path]=new s(o.component,r)}}return n}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(26);function r(){$("[data-humantime]").each((function(){var t=$(this),e=Object(i.a)(t.attr("datetime"));t.html(e)}))}function o(){setInterval(r,1e4)}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(1),r=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.prototype.apiEndpoint=function(){return"/"},e}(n(5).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(1),r=n(5),o=n(100),s=n(3),a=n(27),c=n(41),u=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e}(r.a);Object.assign(u.prototype,{username:r.a.attribute("username"),slug:r.a.attribute("slug"),displayName:r.a.attribute("displayName"),email:r.a.attribute("email"),isEmailConfirmed:r.a.attribute("isEmailConfirmed"),password:r.a.attribute("password"),avatarUrl:r.a.attribute("avatarUrl"),preferences:r.a.attribute("preferences"),groups:r.a.hasMany("groups"),joinTime:r.a.attribute("joinTime",r.a.transformDate),lastSeenAt:r.a.attribute("lastSeenAt",r.a.transformDate),markedAllAsReadAt:r.a.attribute("markedAllAsReadAt",r.a.transformDate),unreadNotificationCount:r.a.attribute("unreadNotificationCount"),newNotificationCount:r.a.attribute("newNotificationCount"),discussionCount:r.a.attribute("discussionCount"),commentCount:r.a.attribute("commentCount"),canEdit:r.a.attribute("canEdit"),canEditCredentials:r.a.attribute("canEditCredentials"),canEditGroups:r.a.attribute("canEditGroups"),canDelete:r.a.attribute("canDelete"),avatarColor:null,color:Object(a.a)("displayName","avatarUrl","avatarColor",(function(t,e,n){return n?"rgb("+n.join(", ")+")":e?(this.calculateAvatarColor(),""):"#"+Object(o.a)(t)})),isOnline:function(){return dayjs().subtract(5,"minutes").isBefore(this.lastSeenAt())},badges:function(){var t=new s.a,e=this.groups();return e&&e.forEach((function(e){t.add("group"+e.id(),c.a.component({group:e}))})),t},calculateAvatarColor:function(){var t=new Image,e=this;t.onload=function(){var t=new ColorThief;e.avatarColor=t.getColor(this),e.freshness=new Date,m.redraw()},t.crossOrigin="anonymous",t.src=this.avatarUrl()},savePreferences:function(t){var e=this.preferences();return Object.assign(e,t),this.save({preferences:e})}})},function(t,e,n){"use strict";function i(t){for(var e=0,n=0;n3&&void 0!==arguments[3]?arguments[3]:[];if(!e)return r;if(1===i)return r.push(e),r;var o=e.indexOf(n);if(-1===o)return r.push(e),r;var s=e.substring(0,o).trim(),a=e.substring(o+n.length+1).trim();return r.push(s),t(a,n,i-1,r)}(t.slice(1,-1),",",3)}function _(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function O(t){for(var e=1;e1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,r=w(e),o=r.args,s=r.cases,a=parseInt(t);o.forEach((function(t){t.startsWith("offset:")&&(a-=parseInt(t.slice("offset:".length)))}));var c=[];1===a&&c.push("one"),c.push("=".concat(a),"other");for(var u=0;u1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,r=w(e),o=r.cases;return t in o?i(o[t],n):"other"in o?i(o.other,n):t}function k(t,e,n){return"<".concat(t,">").concat(n,"")}function E(t,e,n){var i=[];return A(t,0,0,i,(function(r,o,s,a,c,u){if(o)return{break:!0};var l=function(t,e,n,i){var r,o=1;return A(t,n,i,[],(function(t,n,i,s,a,c){if(i===e&&(n?o--:o++,0===o))return r={segmentIndex:s,segmentStart:c,segmentEnd:a},{exit:!0};return{exit:!1}})),r}(t,s,a,c);if(!l)throw new Error("Unbalanced tags: no closing tag found for <".concat(s,">"));var d=l.segmentIndex===a,h=t[l.segmentIndex],f=[];if(d)f.push(r.slice(c+1,l.segmentStart));else{f.push(r.slice(c+1));for(var p=a+1;p"===a[h]){var f=a.slice(u+1+c,h),p=r(a,c,f,s,h,u);if(p.exit)return;if(p.newSegmentIndex&&(s=p.newSegmentIndex),p.processedSegment&&(d=!0),p.break)break;c=!1,u=null,l=!1}else l&&(o=a[h],!/[a-zA-Z-_]/.test(o))&&(c=!1,u=null,l=!1);else u=h,l=!0,"/"===a[h+1]&&(c=!0,h++);d||i.push(a)}else i.push(a)}}function P(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return!1}}();return function(){var n,i=h()(t);if(e){var r=h()(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return l()(this,n)}}var D=function(t){c()(n,t);var e=P(n);function n(t){var i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return r()(this,n),(i=e.call(this,t,o)).richHandler=s||k,i}return s()(n,[{key:"rich",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=b(this.process(t,e));return E(n,e,this.richHandler)}}]),n}(function(){function t(e){var n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};r()(this,t),v()(this,"format",y((function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return b(n.process(t,e)).join("")}))),this.locale=e,this.typeHandlers=i}return s()(t,[{key:"process",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!t)return[];var n=t.indexOf("{");if(-1!==n){var i=x(t,n);if(-1===i)throw new Error('Unbalanced curly braces in string: "'.concat(t,'"'));var r=t.substring(n,i+1);if(r){var o=[],s=t.substring(0,n);s&&o.push(s);var a=N(r),c=p()(a,3),u=c[0],l=c[1],d=c[2],h=e[u];null==h&&(h="");var f=l&&this.typeHandlers[l];o.push(f?f(h,d,this.locale,e,this.process.bind(this)):h);var m=t.substring(i+1);return m&&o.push(this.process(m,e)),o}}return[t]}}]),t}());function I(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,i)}return n}function $(t){for(var e=1;e1?n-1:0),o=1;o=this.loadLimit,m.redraw(),t},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(13),r=n(1),o=n(0),s=n(46),a=n(23),c=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t);var n=e.prototype;return n.canonicalizeDiscussionSlug=function(t){if(t)return t.split("-")[0]},n.makeKey=function(){var t=Object(i.a)({},m.route.param());return"near"in t&&delete t.near,t.id=this.canonicalizeDiscussionSlug(t.id),this.routeName.replace(".near","")+JSON.stringify(t)},n.onmatch=function(n,i,r){return o.a.current.matches(a.a)&&this.canonicalizeDiscussionSlug(n.id)===this.canonicalizeDiscussionSlug(m.route.param("id"))&&(e.scrollToPostNumber=n.near||"1"),t.prototype.onmatch.call(this,n,i,r)},n.render=function(n){if(null!==e.scrollToPostNumber){var i=e.scrollToPostNumber;setTimeout((function(){return o.a.current.get("stream").goToNumber(i)})),e.scrollToPostNumber=null}return t.prototype.render.call(this,n)},e}(s.a);c.scrollToPostNumber=null},function(t,e,n){"use strict";var i=n(169);t.exports=n(193)(i,requestAnimationFrame,console)},function(t,e,n){"use strict";var i=n(170),r=n(171);t.exports=function(t,e){if(/:([^\/\.-]+)(\.{3})?:/.test(t))throw new SyntaxError("Template parameter names *must* be separated");if(null==e)return t;var n=t.indexOf("?"),o=t.indexOf("#"),s=o<0?t.length:o,a=n<0?s:n,c=t.slice(0,a),u={};r(u,e);var l=c.replace(/:([^\/\.-]+)(\.{3})?/g,(function(t,n,i){return delete u[n],null==e[n]?t:i?e[n]:encodeURIComponent(String(e[n]))})),d=l.indexOf("?"),h=l.indexOf("#"),f=h<0?l.length:h,p=d<0?f:d,m=l.slice(0,p);n>=0&&(m+=t.slice(n,s)),d>=0&&(m+=(n<0?"?":"&")+l.slice(d,f));var g=i(u);return g&&(m+=(n<0&&d<0?"?":"&")+g),o>=0&&(m+=t.slice(o)),h>=0&&(m+=(o<0?"":"&")+l.slice(h)),m}},function(t,e,n){"use strict";var i=n(172);t.exports=function(t){var e=t.indexOf("?"),n=t.indexOf("#"),r=n<0?t.length:n,o=e<0?r:e,s=t.slice(0,o).replace(/\/{2,}/g,"/");return s?("/"!==s[0]&&(s="/"+s),s.length>1&&"/"===s[s.length-1]&&(s=s.slice(0,-1))):s="/",{path:s,params:e<0?{}:i(t.slice(e+1,r))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(48),r=function(){function t(t){this.stack=[]}var e=t.prototype;return e.getCurrent=function(){return this.stack[this.stack.length-1]},e.getPrevious=function(){return this.stack[this.stack.length-2]},e.push=function(t,e,n){void 0===n&&(n=m.route.get());var i=this.stack[this.stack.length-2];i&&i.name===t&&this.stack.pop();var r=this.getCurrent();r&&r.name===t?Object.assign(r,{url:n,title:e}):this.stack.push({name:t,url:n,title:e})},e.canGoBack=function(){return this.stack.length>1},e.back=function(){if(!this.canGoBack())return this.home();this.stack.pop(),m.route.set(this.getCurrent().url)},e.backUrl=function(){return this.stack[this.stack.length-2].url},e.home=function(){this.stack.splice(0),Object(i.a)("/")},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(t){this.pinnedKey="panePinned",this.$element=$(t),this.pinned="true"===localStorage.getItem(this.pinnedKey),this.active=!1,this.showing=!1,this.render()}var e=t.prototype;return e.enable=function(){this.active=!0,this.render()},e.disable=function(){this.active=!1,this.showing=!1,this.render()},e.show=function(){clearTimeout(this.hideTimeout),this.showing=!0,this.render()},e.hide=function(){this.showing=!1,this.render()},e.onmouseleave=function(){this.hideTimeout=setTimeout(this.hide.bind(this),250)},e.togglePinned=function(){this.pinned=!this.pinned,localStorage.setItem(this.pinnedKey,this.pinned?"true":"false"),this.render()},e.render=function(){this.$element.toggleClass("panePinned",this.pinned).toggleClass("hasPane",this.active).toggleClass("paneShowing",this.showing)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(4),o=n(3),s=n(8),a=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){return m("header",{className:"Hero DiscussionHero"},m("div",{className:"container"},m("ul",{className:"DiscussionHero-items"},Object(s.a)(this.items().toArray()))))},n.items=function(){var t=new o.a,e=this.attrs.discussion,n=e.badges().toArray();return n.length&&t.add("badges",m("ul",{className:"DiscussionHero-badges badges"},Object(s.a)(n)),10),t.add("title",m("h2",{className:"DiscussionHero-title"},e.title())),t},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(1),r=n(0),o=n(42),s=n(4),a=n(23),c=function(t){t.pageX<10&&r.a.pane.show()},u=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){if(this.attrs.state.hasItems())return m("div",{className:"DiscussionPage-list"},this.enoughSpace()&&m(o.a,{state:this.attrs.state}))},n.oncreate=function(e){t.prototype.oncreate.call(this,e);var n=$(e.dom),i=r.a.pane;if(n.hover(i.show.bind(i),i.onmouseleave.bind(i)),$(document).on("mousemove",c),r.a.previous.matches(a.a)){var o=r.a.cache.discussionListPaneScrollTop||0;n.scrollTop(o)}else{var s=n.find(".DiscussionListItem.active");if(s.length){var u=n.offset().top,l=u+n.outerHeight(),d=s.offset().top,h=d+s.outerHeight();(dl)&&n.scrollTop(n.scrollTop()-u+d)}}},n.onremove=function(t){r.a.cache.discussionListPaneScrollTop=$(t.dom).scrollTop(),$(document).off("mousemove",c)},n.enoughSpace=function(){return!$(".App-navigation").is(":visible")},e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return O}));var i=n(1),r=n(0),o=n(4),s=n(12),a=n(14),c=n(8),u=n(30),l=n(7),d=n(26),h=n(3),f=n(80),p=n(19),g=n(117),v=n(53),b=n(43),y=n(120),w=(n(9),n(10)),x=n(23),N=n(82),_=n(28),O=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){var n=this;t.prototype.oninit.call(this,e),this.subtree=new v.a((function(){return n.attrs.discussion.freshness}),(function(){var t=r.a.session.user&&r.a.session.user.markedAllAsReadAt();return t&&t.getTime()}),(function(){return n.active()}))},n.elementAttrs=function(){return{className:Object(w.a)(["DiscussionListItem",this.active()?"active":"",this.attrs.discussion.isHidden()?"DiscussionListItem--hidden":"","ontouchstart"in window?"Slidable":""])}},n.view=function(){var t=this.attrs.discussion,e=t.user(),n=t.isUnread(),i=t.isRead(),o=!this.showRepliesCount()&&n,h=0,g=b.a.controls(t,this).toArray(),v=this.elementAttrs();if(this.attrs.params.q){var y=t.mostRelevantPost();y&&(h=y.number());var w=Object(N.a)(this.attrs.params.q);this.highlightRegExp=new RegExp(w+"|"+w.trim().replace(/\s+/g,"|"),"gi")}else h=Math.min(t.lastPostNumber(),(t.lastReadPostNumber()||0)+1);return m("div",v,g.length?p.a.component({icon:"fas fa-ellipsis-v",className:"DiscussionListItem-controls",buttonClassName:"Button Button--icon Button--flat Slidable-underneath Slidable-underneath--right",accessibleToggleLabel:r.a.translator.trans("core.forum.discussion_controls.toggle_dropdown_accessible_label")},g):"",m("span",{className:"Slidable-underneath Slidable-underneath--left Slidable-underneath--elastic"+(n?"":" disabled"),onclick:this.markAsRead.bind(this)},Object(l.a)("fas fa-check")),m("div",{className:"DiscussionListItem-content Slidable-content"+(n?" unread":"")+(i?" read":"")},m(_.a,{text:r.a.translator.trans("core.forum.discussion_list.started_text",{user:e,ago:Object(d.a)(t.createdAt())}),position:"right"},m(s.a,{className:"DiscussionListItem-author",href:e?r.a.route.user(e):"#"},Object(a.a)(e,{title:""}))),m("ul",{className:"DiscussionListItem-badges badges"},Object(c.a)(t.badges().toArray())),m(s.a,{href:r.a.route.discussion(t,h),className:"DiscussionListItem-main"},m("h3",{className:"DiscussionListItem-title"},Object(u.a)(t.title(),this.highlightRegExp)),m("ul",{className:"DiscussionListItem-info"},Object(c.a)(this.infoItems().toArray()))),m("span",{tabindex:"0",role:"button",className:"DiscussionListItem-count",onclick:this.markAsRead.bind(this),title:o?r.a.translator.trans("core.forum.discussion_list.mark_as_read_tooltip"):""},Object(f.a)(t[o?"unreadCount":"replyCount"]()))))},n.oncreate=function(e){if(t.prototype.oncreate.call(this,e),"ontouchstart"in window){var n=Object(y.a)(this.$());this.$(".DiscussionListItem-controls").on("hidden.bs.dropdown",(function(){return n.reset()}))}},n.onbeforeupdate=function(e,n){return t.prototype.onbeforeupdate.call(this,e,n),this.subtree.needsRebuild()},n.active=function(){return r.a.current.matches(x.a,{discussion:this.attrs.discussion})},n.showFirstPost=function(){return-1!==["newest","oldest"].indexOf(this.attrs.params.sort)},n.showRepliesCount=function(){return"replies"===this.attrs.params.sort},n.markAsRead=function(){var t=this.attrs.discussion;t.isUnread()&&(t.save({lastReadPostNumber:t.lastPostNumber()}),m.redraw())},n.infoItems=function(){var t=new h.a;if(this.attrs.params.q){var e=this.attrs.discussion.mostRelevantPost()||this.attrs.discussion.firstPost();if(e&&"comment"===e.contentType()){var n=Object(u.a)(e.contentPlain(),this.highlightRegExp,175);t.add("excerpt",n,-100)}}else t.add("terminalPost",g.a.component({discussion:this.attrs.discussion,lastPost:!this.showFirstPost()}));return t},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(1),r=n(0),o=n(4),s=n(39),a=n(7),c=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.prototype.view=function(){var t=this.attrs.discussion,e=this.attrs.lastPost&&t.replyCount(),n=t[e?"lastPostedUser":"user"](),i=t[e?"lastPostedAt":"createdAt"]();return m("span",null,e?Object(a.a)("fas fa-reply"):""," ",r.a.translator.trans("core.forum.discussion_list."+(e?"replied":"started")+"_text",{user:n,ago:Object(s.a)(i)}))},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(1),r=n(0),o=n(16),s=n(2),a=n(9),c=n(11),u=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.email=Object(c.a)(this.attrs.email||""),this.success=!1},n.className=function(){return"ForgotPasswordModal Modal--small"},n.title=function(){return r.a.translator.trans("core.forum.forgot_password.title")},n.content=function(){return this.success?m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},r.a.translator.trans("core.forum.forgot_password.email_sent_message")),m("div",{className:"Form-group"},m(s.a,{className:"Button Button--primary Button--block",onclick:this.hide.bind(this)},r.a.translator.trans("core.forum.forgot_password.dismiss_button"))))):m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},r.a.translator.trans("core.forum.forgot_password.text")),m("div",{className:"Form-group"},m("input",{className:"FormControl",name:"email",type:"email",placeholder:Object(a.a)(r.a.translator.trans("core.forum.forgot_password.email_placeholder")),bidi:this.email,disabled:this.loading})),m("div",{className:"Form-group"},s.a.component({className:"Button Button--primary Button--block",type:"submit",loading:this.loading},r.a.translator.trans("core.forum.forgot_password.submit_button")))))},n.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0,r.a.request({method:"POST",url:r.a.forum.attribute("apiUrl")+"/forgot",body:{email:this.email()},errorHandler:this.onerror.bind(this)}).then((function(){e.success=!0,e.alert=null})).catch((function(){})).then(this.loaded.bind(this))},n.onerror=function(e){404===e.status&&(e.alert.content=r.a.translator.trans("core.forum.forgot_password.not_found_message")),t.prototype.onerror.call(this,e)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(1),r=n(0),o=n(16),s=n(2),a=n(11),c=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.discussion=this.attrs.discussion,this.currentTitle=this.attrs.currentTitle,this.newTitle=Object(a.a)(this.currentTitle)},n.className=function(){return"RenameDiscussionModal Modal--small"},n.title=function(){return r.a.translator.trans("core.forum.rename_discussion.title")},n.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("div",{className:"Form-group"},m("input",{className:"FormControl",bidi:this.newTitle,type:"text"})),m("div",{className:"Form-group"},s.a.component({className:"Button Button--primary Button--block",type:"submit",loading:this.loading},r.a.translator.trans("core.forum.rename_discussion.submit_button")))))},n.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0;var n=this.newTitle(),i=this.currentTitle;if(n&&n!==i)return this.discussion.save({title:n}).then((function(){r.a.viewingDiscussion(e.discussion)&&r.a.current.get("stream").update(),m.redraw(),e.hide()})).catch((function(){e.loading=!1,m.redraw()}));this.hide()},e}(o.a)},function(t,e,n){"use strict";function i(t){var e,n,i,r,o=$(t),s=!1,a=!1,c=0,u=function(t,e){void 0===e&&(e={}),e.duration=e.duration||"fast",e.step=function(t){$(this).css("transform","translate("+t+"px, 0)")},o.find(".Slidable-content").animate({"background-position-x":t},e)},l=function(){u(0,{complete:function(){o.removeClass("sliding"),e.hide(),n.hide(),a=!1}})};return o.find(".Slidable-content").on("touchstart",(function(t){e=o.find(".Slidable-underneath--left:not(.disabled)"),n=o.find(".Slidable-underneath--right:not(.disabled)"),i=t.originalEvent.targetTouches[0].clientX,r=t.originalEvent.targetTouches[0].clientY,s=!0,c=0})).on("touchmove",(function(t){var u=t.originalEvent.targetTouches[0].clientX,l=t.originalEvent.targetTouches[0].clientY;if(s&&Math.abs(u-i)>Math.abs(l-r)&&(a=!0),s=!1,a){c=u-i;var d=function(t,e){if(t.length){var n="left"===e?c>0:c<0;n&&t.hasClass("Slidable-underneath--elastic")&&(c-=.5*c),t.toggle(n);var i=Math.max(0,Math.min(1,(Math.abs(c)-25)/50));t.find(".icon").css("transform","scale("+i+")")}else c=Math["left"===e?"min":"max"](0,c)};d(e,"left"),d(n,"right"),$(this).css("transform","translate("+c+"px, 0)"),$(this).css("background-position-x",c+"px"),o.toggleClass("sliding",!!c),t.preventDefault()}})).on("touchend",(function(){var t=function(t){t.click(),t.hasClass("Slidable-underneath--elastic")?l():u((c>0?1:-1)*o.width())};n.length&&c<-50?t(n):e.length&&c>50?t(e):l(),s=!1,a=!1})),{reset:l}}n.d(e,"a",(function(){return i}))},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var i=n(1),r=n(0),o=n(4),s=n(40),a=n(122),c=n(123),u=n(2),l=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.discussion=this.attrs.discussion,this.stream=this.attrs.stream,this.scrollListener=new s.a(this.onscroll.bind(this))},n.view=function(){var t,e=this,n=this.stream.viewingEnd(),i=this.stream.posts(),o=this.discussion.postIds(),s=function(t){$(t.dom).addClass("fadeIn"),setTimeout((function(){return $(t.dom).removeClass("fadeIn")}),500)},l=i.map((function(n,i){var c,u={"data-index":e.stream.visibleStart+i};if(n){var l=n.createdAt(),d=r.a.postComponents[n.contentType()];c=d?d.component({post:n}):"",u.key="post"+n.id(),u.oncreate=s,u["data-time"]=l.toISOString(),u["data-number"]=n.number(),u["data-id"]=n.id(),u["data-type"]=n.contentType();var h=l-t;h>3456e5&&(c=[m("div",{className:"PostStream-timeGap"},m("span",null,r.a.translator.trans("core.forum.post_stream.time_lapsed_text",{period:dayjs().add(h,"ms").fromNow(!0)}))),c]),t=l}else u.key="post"+o[e.stream.visibleStart+i],c=a.a.component();return m("div",Object.assign({className:"PostStream-item"},u),c)}));return!n&&i[this.stream.visibleEnd-this.stream.visibleStart-1]&&l.push(m("div",{className:"PostStream-loadMore",key:"loadMore"},m(u.a,{className:"Button",onclick:this.stream.loadNext.bind(this.stream)},r.a.translator.trans("core.forum.post_stream.load_more_button")))),!n||r.a.session.user&&!this.discussion.canReply()||l.push(m("div",{className:"PostStream-item",key:"reply","data-index":this.stream.count(),oncreate:s},c.a.component({discussion:this.discussion}))),m("div",{className:"PostStream"},l)},n.onupdate=function(e){t.prototype.onupdate.call(this,e),this.triggerScroll()},n.oncreate=function(e){var n=this;t.prototype.oncreate.call(this,e),this.triggerScroll(),setTimeout((function(){return n.scrollListener.start()}))},n.onremove=function(e){t.prototype.onremove.call(this,e),this.scrollListener.stop(),clearTimeout(this.calculatePositionTimeout)},n.triggerScroll=function(){if(this.stream.needsScroll){var t=this.stream.targetPost;this.stream.needsScroll=!1,"number"in t?this.scrollToNumber(t.number,this.stream.animateScroll):"index"in t&&this.scrollToIndex(t.index,this.stream.animateScroll,t.reply)}},n.onscroll=function(t){void 0===t&&(t=window.pageYOffset),this.stream.paused||this.stream.pagesLoading||(this.updateScrubber(t),this.loadPostsIfNeeded(t),clearTimeout(this.calculatePositionTimeout),this.calculatePositionTimeout=setTimeout(this.calculatePosition.bind(this,t),100))},n.loadPostsIfNeeded=function(t){void 0===t&&(t=window.pageYOffset);var e=this.getMarginTop(),n=$(window).height()-e,i=t+e;if(this.stream.visibleStart>0){var r=this.$(".PostStream-item[data-index="+this.stream.visibleStart+"]");r.length&&r.offset().top>i-300&&this.stream.loadPrevious()}if(this.stream.visibleEndi+n)return!1;var c=Math.max(0,i-e),u=Math.min(r,i+n-e)-c;null===a&&(a=parseFloat(t.data("index"))+c/r),u>0&&(o+=u/r);var l=t.data("time");l&&(s=l)})),this.stream.index=null!==a?a+1:this.stream.count(),this.stream.visible=o,s&&(this.stream.description=dayjs(s).format("MMMM YYYY"))},n.calculatePosition=function(t){void 0===t&&(t=window.pageYOffset);var e,n,i=this.getMarginTop(),r=$(window),o=r.height()-i,s=r.scrollTop()+i,a=t+i;this.$(".PostStream-item").each((function(){var t=$(this),i=t.offset().top,r=t.outerHeight(!0),c=Math.max(0,a-i);if(void 0===e&&(c/r<.75||(r-c)/o>.25)&&(e=t.data("number")),i+r>s){if(!(i+rd){var h=i?u-$(window).height()+r.a.composer.computedHeight():t.is(":first-child")?0:c;e?h!==l&&s.animate({scrollTop:h},"fast"):s.scrollTop(h)}}var f=function(){o.updateScrubber(),void 0!==a&&(o.stream.index=a+1)};return f(),this.stream.forceUpdateScrubber=!0,Promise.all([s.promise(),this.stream.loadPromise]).then((function(){var t;if(m.redraw.sync(),i){var e=$(".PostStream-item:last-child");$(window).scrollTop(e.offset().top+e.height()-$(window).height()+r.a.composer.computedHeight())}else 0===a?$(window).scrollTop(0):(t=$(".PostStream-item[data-index="+a+"]").offset())&&$(window).scrollTop(t.top-o.getMarginTop());f(),o.calculatePosition(),o.stream.paused=!1,o.loadPostsIfNeeded()}))},n.flashItem=function(t){t.removeClass("fadeIn"),t.addClass("flash").on("animationend webkitAnimationEnd",(function(e){t.removeClass("flash")}))},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(1),r=n(4),o=n(14),s=function(t){function e(){return t.apply(this,arguments)||this}return Object(i.a)(e,t),e.prototype.view=function(){return m("div",{className:"Post CommentPost LoadingPost"},m("header",{className:"Post-header"},Object(o.a)(null,{className:"PostUser-avatar"}),m("div",{className:"fakeText"})),m("div",{className:"Post-body"},m("div",{className:"fakeText"}),m("div",{className:"fakeText"}),m("div",{className:"fakeText"})))},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return d}));var i=n(1),r=n(0),o=n(4),s=n(14),a=n(20),c=n(43),u=n(64),l=n(8),d=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){var t=this;if(r.a.composer.composingReplyTo(this.attrs.discussion))return m("article",{className:"Post CommentPost editing"},m("header",{className:"Post-header"},m("div",{className:"PostUser"},m("h3",null,Object(s.a)(r.a.session.user,{className:"PostUser-avatar"}),Object(a.a)(r.a.session.user)),m("ul",{className:"PostUser-badges badges"},Object(l.a)(r.a.session.user.badges().toArray())))),m(u.a,{className:"Post-body",composer:r.a.composer,surround:this.anchorPreview.bind(this)}));return m("article",{className:"Post ReplyPlaceholder",onclick:function(){c.a.replyAction.call(t.attrs.discussion,!0).catch((function(){}))}},m("header",{className:"Post-header"},Object(s.a)(r.a.session.user,{className:"PostUser-avatar"})," ",r.a.translator.trans("core.forum.post_stream.reply_placeholder")))},n.anchorPreview=function(t){var e=$(window).scrollTop()+$(window).height()>=$(document).height();t(),e&&$(window).scrollTop($(document).height())},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(1),r=n(0),o=n(4),s=n(7),a=n(74),c=n(40),u=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.stream=this.attrs.stream,this.handlers={},this.scrollListener=new c.a(this.updateScrubberValues.bind(this,{fromScroll:!0,forceHeightChange:!0}))},n.view=function(){var t=this.stream.count(),e=r.a.translator.trans("core.forum.post_scrubber.viewing_text",{count:t,index:m("span",{className:"Scrubber-index"}),formattedCount:m("span",{className:"Scrubber-count"},Object(a.a)(t))}),n=this.stream.discussion.unreadCount(),i=t?Math.min(t-this.stream.index,n)/t:0;function o(t){var e=$(t.dom),n={top:100-100*i+"%",height:100*i+"%"};t.state.oldStyle?e.stop(!0).css(t.state.oldStyle).animate(n):e.css(n),t.state.oldStyle=n}var c=["PostStreamScrubber","Dropdown"];return this.attrs.className&&c.push(this.attrs.className),m("div",{className:c.join(" ")},m("button",{className:"Button Dropdown-toggle","data-toggle":"dropdown"},e," ",Object(s.a)("fas fa-sort")),m("div",{className:"Dropdown-menu dropdown-menu"},m("div",{className:"Scrubber"},m("a",{className:"Scrubber-first",onclick:this.goToFirst.bind(this)},Object(s.a)("fas fa-angle-double-up")," ",r.a.translator.trans("core.forum.post_scrubber.original_post_link")),m("div",{className:"Scrubber-scrollbar"},m("div",{className:"Scrubber-before"}),m("div",{className:"Scrubber-handle"},m("div",{className:"Scrubber-bar"}),m("div",{className:"Scrubber-info"},m("strong",null,e),m("span",{className:"Scrubber-description"}))),m("div",{className:"Scrubber-after"}),m("div",{className:"Scrubber-unread",oncreate:o,onupdate:o},r.a.translator.trans("core.forum.post_scrubber.unread_text",{count:n}))),m("a",{className:"Scrubber-last",onclick:this.goToLast.bind(this)},Object(s.a)("fas fa-angle-double-down")," ",r.a.translator.trans("core.forum.post_scrubber.now_link")))))},n.onupdate=function(e){var n=this;t.prototype.onupdate.call(this,e),this.stream.forceUpdateScrubber&&(this.stream.forceUpdateScrubber=!1,this.stream.loadPromise.then((function(){return n.updateScrubberValues({animate:!0,forceHeightChange:!0})})))},n.oncreate=function(e){var n=this;t.prototype.oncreate.call(this,e),$(window).on("resize",this.handlers.onresize=this.onresize.bind(this)).resize(),this.$(".Scrubber-scrollbar").bind("click",this.onclick.bind(this)).bind("dragstart mousedown touchstart",(function(t){return t.preventDefault()})),this.dragging=!1,this.mouseStart=0,this.indexStart=0,this.$(".Scrubber-handle").bind("mousedown touchstart",this.onmousedown.bind(this)).click((function(t){return t.stopPropagation()})),$(document).on("mousemove touchmove",this.handlers.onmousemove=this.onmousemove.bind(this)).on("mouseup touchend",this.handlers.onmouseup=this.onmouseup.bind(this)),setTimeout((function(){return n.scrollListener.start()})),this.stream.loadPromise.then((function(){return n.updateScrubberValues({animate:!1,forceHeightChange:!0})}))},n.onremove=function(e){t.prototype.onremove.call(this,e),this.scrollListener.stop(),$(window).off("resize",this.handlers.onresize),$(document).off("mousemove touchmove",this.handlers.onmousemove).off("mouseup touchend",this.handlers.onmouseup)},n.updateScrubberValues=function(t){var e=this;void 0===t&&(t={});var n=this.stream.index,i=this.stream.count(),r=this.stream.visible||1,o=this.percentPerPost(),s=this.$();s.find(".Scrubber-index").text(Object(a.a)(this.stream.sanitizeIndex(Math.max(1,n)))),s.find(".Scrubber-description").text(this.stream.description),s.toggleClass("disabled",this.stream.disabled());var c={};if(c.before=Math.max(0,o.index*Math.min(n-1,i-r)),c.handle=Math.min(100-c.before,o.visible*r),c.after=100-c.before-c.handle,!(t.fromScroll&&this.stream.paused||this.adjustingHeight&&!t.forceHeightChange)){var u=t.animate?"animate":"css";this.adjustingHeight=!0;var l=[];for(var d in c){var h=s.find(".Scrubber-"+d);l.push(h.stop(!0,!0)[u]({height:c[d]+"%"},"fast").promise()),"animate"===u&&h.css("overflow","visible")}Promise.all(l).then((function(){return e.adjustingHeight=!1}))}},n.goToFirst=function(){this.stream.goToFirst(),this.updateScrubberValues({animate:!0,forceHeightChange:!0})},n.goToLast=function(){this.stream.goToLast(),this.updateScrubberValues({animate:!0,forceHeightChange:!0})},n.onresize=function(){var t=this.$(),e=this.$(".Scrubber-scrollbar");e.css("max-height",$(window).height()-t.offset().top+$(window).scrollTop()-parseInt($("#app").css("padding-bottom"),10)-(t.outerHeight()-e.outerHeight()))},n.onmousedown=function(t){t.redraw=!1,this.mouseStart=t.clientY||t.originalEvent.touches[0].clientY,this.indexStart=this.stream.index,this.dragging=!0,$("body").css("cursor","move"),this.$().toggleClass("dragging",this.dragging)},n.onmousemove=function(t){if(this.dragging){var e=((t.clientY||t.originalEvent.touches[0].clientY)-this.mouseStart)/this.$(".Scrubber-scrollbar").outerHeight()*100/this.percentPerPost().index||0,n=Math.min(this.indexStart+e,this.stream.count()-1);this.stream.index=Math.max(0,n),this.updateScrubberValues()}},n.onmouseup=function(){if(this.$().toggleClass("dragging",this.dragging),this.dragging){this.mouseStart=0,this.indexStart=0,this.dragging=!1,$("body").css("cursor",""),this.$().removeClass("open");var t=Math.floor(this.stream.index);this.stream.goToIndex(t)}},n.onclick=function(t){var e=this.$(".Scrubber-scrollbar"),n=((t.pageY||t.originalEvent.touches[0].pageY)-e.offset().top+$("body").scrollTop())/e.outerHeight()*100,i=(n-=parseFloat(e.find(".Scrubber-handle")[0].style.height)/2)/this.percentPerPost().index;i=Math.max(0,Math.min(this.stream.count()-1,i)),this.stream.goToIndex(Math.floor(i)),this.updateScrubberValues({animate:!0,forceHeightChange:!0}),this.$().removeClass("open")},n.percentPerPost=function(){var t=this.stream.count()||1,e=this.stream.visible||1,n=50/this.$(".Scrubber-scrollbar").outerHeight()*100,i=Math.max(100/t,n/e),r=t===e?0:(100-i*e)/(t-e);return{index:r,visible:i}},e}(o.a)},function(t,e,n){"use strict";var i=n(0),r=n(51),o=n(84),s=function(){function t(t,e){void 0===e&&(e=[]),this.discussion=t,this.paused=!1,this.loadPageTimeouts={},this.pagesLoading=0,this.index=0,this.number=1,this.visible=1,this.description="",this.forceUpdateScrubber=!1,this.loadNext=Object(r.b)(300,this._loadNext),this.loadPrevious=Object(r.b)(300,this._loadPrevious),this.show(e)}var e=t.prototype;return e.update=function(){return this.viewingEnd()?(this.visibleEnd=this.count(),this.loadRange(this.visibleStart,this.visibleEnd)):Promise.resolve()},e.goToFirst=function(){return this.goToIndex(0)},e.goToLast=function(){return this.goToIndex(this.count()-1,!0)},e.goToNumber=function(t,e){if(void 0===e&&(e=!1),"reply"===t){var n=this.goToLast();return this.targetPost.reply=!0,n}return this.paused=!0,this.loadPromise=this.loadNearNumber(t),this.needsScroll=!0,this.targetPost={number:t},this.animateScroll=!e,this.number=t,this.loadPromise.then((function(){return m.redraw()}))},e.goToIndex=function(t,e){return void 0===e&&(e=!1),this.paused=!0,this.loadPromise=this.loadNearIndex(t),this.needsScroll=!0,this.targetPost={index:t},this.animateScroll=!e,this.index=t,m.redraw(),this.loadPromise},e.loadNearNumber=function(t){return this.posts().some((function(e){return e&&Number(e.number())===Number(t)}))?Promise.resolve():(this.reset(),i.a.store.find("posts",{filter:{discussion:this.discussion.id()},page:{near:t}}).then(this.show.bind(this)))},e.loadNearIndex=function(t){if(t>=this.visibleStart&&tthis.visibleStart&&n>=0&&(this.visibleStart=n+this.constructor.loadCount+1,this.loadPageTimeouts[n]&&(clearTimeout(this.loadPageTimeouts[n]),this.loadPageTimeouts[n]=null,this.pagesLoading--)),this.loadPage(t,e)},e._loadPrevious=function(){var t=this.visibleStart,e=this.visibleStart=this.sanitizeIndex(this.visibleStart-this.constructor.loadCount),n=e+2*this.constructor.loadCount;ni.visibleEnd)){var r=n?i.visibleEnd-1:i.visibleStart;Object(o.a)('.PostStream-item[data-index="'+r+'"]',m.redraw.sync)}};r(),this.loadPageTimeouts[t]=setTimeout((function(){i.loadRange(t,e).then((function(){r(),i.pagesLoading--})),i.loadPageTimeouts[t]=null}),this.pagesLoading-1?1e3:0)},e.loadRange=function(t,e){var n=[],r=[];return this.discussion.postIds().slice(t,e).forEach((function(t){var e=i.a.store.getById("posts",t);e&&e.discussion()&&void 0!==e.canEdit()?r.push(e):n.push(t)})),n.length?i.a.store.find("posts",n).then((function(t){return r.concat(t).sort((function(t,e){return t.createdAt()-e.createdAt()}))})):Promise.resolve(r)},e.show=function(t){this.visibleStart=t.length?this.discussion.postIds().indexOf(t[0].id()):0,this.visibleEnd=this.sanitizeIndex(this.visibleStart+t.length)},e.reset=function(t,e){this.visibleStart=t||0,this.visibleEnd=this.sanitizeIndex(e||this.constructor.loadCount)},e.posts=function(){return this.discussion.postIds().slice(this.visibleStart,this.visibleEnd).map((function(t){var e=i.a.store.getById("posts",t);return e&&e.discussion()&&void 0!==e.canEdit()?e:null}))},e.count=function(){return this.discussion.postIds().length},e.disabled=function(){return this.visible>=this.count()},e.viewingEnd=function(){return Math.abs(this.count()-this.visibleEnd)<=1},e.sanitizeIndex=function(t){return Math.max(0,Math.min(this.count(),Math.floor(t)))},t}();s.loadCount=20,e.a=s},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(4),o=n(3),s=n(8),a=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){return m("ul",{className:"Header-controls"},Object(s.a)(this.items().toArray()))},n.items=function(){return new o.a},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return g}));var i=n(1),r=n(0),o=n(4),s=n(2),a=n(35),c=n(44),u=n(128),l=n(32),d=n(129),h=n(3),f=n(8),p=n(130),g=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){return m("ul",{className:"Header-controls"},Object(f.a)(this.items().toArray()))},n.items=function(){var t=new h.a;if(t.add("search",p.a.component({state:r.a.search}),30),r.a.forum.attribute("showLanguageSelector")&&Object.keys(r.a.data.locales).length>1){var e=[],n=function(t){e.push(s.a.component({active:r.a.data.locale===t,icon:r.a.data.locale!==t||"fas fa-check",onclick:function(){r.a.session.user?r.a.session.user.savePreferences({locale:t}).then((function(){return window.location.reload()})):(document.cookie="locale="+t+"; path=/; expires=Tue, 19 Jan 2038 03:14:07 GMT",window.location.reload())}},r.a.data.locales[t]))};for(var i in r.a.data.locales)n(i);t.add("locale",l.a.component({buttonClassName:"Button Button--link",accessibleToggleLabel:r.a.translator.trans("core.forum.header.locale_dropdown_accessible_label")},e),20)}return r.a.session.user?(t.add("notifications",d.a.component({state:r.a.notifications}),10),t.add("session",u.a.component(),0)):(r.a.forum.attribute("allowSignUp")&&t.add("signUp",s.a.component({className:"Button Button--link",onclick:function(){return r.a.modal.show(c.a)}},r.a.translator.trans("core.forum.header.sign_up_link")),10),t.add("logIn",s.a.component({className:"Button Button--link",onclick:function(){return r.a.modal.show(a.a)}},r.a.translator.trans("core.forum.header.log_in_link")),0)),t},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var i=n(13),r=n(1),o=n(0),s=n(14),a=n(20),c=n(19),u=n(17),l=n(2),d=n(3),h=n(24),f=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.className="SessionDropdown",e.buttonClassName="Button Button--user Button--flat",e.menuClassName="Dropdown-menu--right",e.accessibleToggleLabel=o.a.translator.trans("core.forum.header.session_dropdown_accessible_label")};var n=e.prototype;return n.view=function(e){return t.prototype.view.call(this,Object(i.a)({},e,{children:this.items().toArray()}))},n.getButtonContent=function(){var t=o.a.session.user;return[Object(s.a)(t)," ",m("span",{className:"Button-label"},Object(a.a)(t))]},n.items=function(){var t=new d.a,e=o.a.session.user;return t.add("profile",u.a.component({icon:"fas fa-user",href:o.a.route.user(e)},o.a.translator.trans("core.forum.header.profile_button")),100),t.add("settings",u.a.component({icon:"fas fa-cog",href:o.a.route("settings")},o.a.translator.trans("core.forum.header.settings_button")),50),o.a.forum.attribute("adminUrl")&&t.add("administration",u.a.component({icon:"fas fa-wrench",href:o.a.forum.attribute("adminUrl"),target:"_blank"},o.a.translator.trans("core.forum.header.admin_button")),0),t.add("separator",h.a.component(),-90),t.add("logOut",l.a.component({icon:"fas fa-sign-out-alt",onclick:o.a.session.logout.bind(o.a.session)},o.a.translator.trans("core.forum.header.log_out_button")),-100),t},e}(c.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(1),r=n(0),o=n(19),s=n(7),a=n(10),c=n(65),u=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t),e.initAttrs=function(e){e.className=e.className||"NotificationsDropdown",e.buttonClassName=e.buttonClassName||"Button Button--flat",e.menuClassName=e.menuClassName||"Dropdown-menu--right",e.label=e.label||r.a.translator.trans("core.forum.notifications.tooltip"),e.icon=e.icon||"fas fa-bell",e.accessibleToggleLabel=e.accessibleToggleLabel||r.a.translator.trans("core.forum.notifications.toggle_dropdown_accessible_label"),t.initAttrs.call(this,e)};var n=e.prototype;return n.getButton=function(){var e=this.getNewCount(),n=t.prototype.getButton.call(this);return n.attrs.title=this.attrs.label,n.attrs.className=Object(a.a)(n.attrs.className,[e&&"new"]),n.attrs.onclick=this.onclick.bind(this),n},n.getButtonContent=function(){var t=this.getUnreadCount();return[Object(s.a)(this.attrs.icon,{className:"Button-icon"}),0!==t&&m("span",{className:"NotificationsDropdown-unread"},t),m("span",{className:"Button-label"},this.attrs.label)]},n.getMenu=function(){return m("div",{className:Object(a.a)("Dropdown-menu",this.attrs.menuClassName),onclick:this.menuClick.bind(this)},this.showing&&c.a.component({state:this.attrs.state}))},n.onclick=function(){r.a.drawer.isOpen()?this.goToRoute():this.attrs.state.load()},n.goToRoute=function(){m.route.set(r.a.route("notifications"))},n.getUnreadCount=function(){return r.a.session.user.unreadNotificationCount()},n.getNewCount=function(){return r.a.session.user.newNotificationCount()},n.menuClick=function(t){(t.shiftKey||t.metaKey||t.ctrlKey||2===t.which)&&t.stopPropagation()},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var i=n(1),r=n(0),o=n(4),s=n(15),a=n(3),c=n(10),u=n(9),l=n(131),d=n(7),h=n(132),f=n(133),p=function(t){function e(){for(var e,n=arguments.length,i=new Array(n),r=0;r.FormControl").getBoundingClientRect().bottom-14;this.element.querySelector(".Search-results").style["max-height"]=t+"px"},n.onupdate=function(e){t.prototype.onupdate.call(this,e),this.setIndex(this.getCurrentNumericIndex()),this.sources.length&&this.updateMaxHeight()},n.oncreate=function(n){var i=this;t.prototype.oncreate.call(this,n);var r=this,o=this.state;this.setIndex(this.getCurrentNumericIndex()),this.$(".Search-results").on("mousedown",(function(t){return t.preventDefault()})).on("click",(function(){return i.$("input").trigger("blur")})).on("mouseenter","> li:not(.Dropdown-header)",(function(){r.setIndex(r.selectableItems().index(this))}));var s=this.$("input");this.navigator=new l.a,this.navigator.onUp((function(){return i.setIndex(i.getCurrentNumericIndex()-1,!0)})).onDown((function(){return i.setIndex(i.getCurrentNumericIndex()+1,!0)})).onSelect(this.selectResult.bind(this)).onCancel(this.clear.bind(this)).bindTo(s),s.on("input focus",(function(){var t=this.value.toLowerCase();t&&(clearTimeout(r.searchTimeout),r.searchTimeout=setTimeout((function(){o.isCached(t)||(t.length>=e.MIN_SEARCH_LEN&&r.sources.map((function(e){e.search&&(r.loadingSources++,e.search(t).then((function(){r.loadingSources=Math.max(0,r.loadingSources-1),m.redraw()})))})),o.cache(t),m.redraw())}),250))})).on("focus",(function(){$(this).one("mouseup",(function(t){return t.preventDefault()})).trigger("select")})),this.updateMaxHeightHandler=this.updateMaxHeight.bind(this),window.addEventListener("resize",this.updateMaxHeightHandler)},n.onremove=function(e){t.prototype.onremove.call(this,e),window.removeEventListener("resize",this.updateMaxHeightHandler)},n.selectResult=function(){clearTimeout(this.searchTimeout),this.loadingSources=0,this.state.getValue()?m.route.set(this.getItem(this.index).find("a").attr("href")):this.clear(),this.$("input").blur()},n.clear=function(){this.state.clear()},n.sourceItems=function(){var t=new a.a;return r.a.forum.attribute("canViewForum")&&t.add("discussions",new h.a),r.a.forum.attribute("canSearchUsers")&&t.add("users",new f.a),t},n.selectableItems=function(){return this.$(".Search-results > li:not(.Dropdown-header)")},n.getCurrentNumericIndex=function(){return this.selectableItems().index(this.getItem(this.index))},n.getItem=function(t){var e=this.selectableItems(),n=e.filter('[data-index="'+t+'"]');return n.length||(n=e.eq(t)),n},n.setIndex=function(t,e){void 0===e&&(e=!1);var n=this.selectableItems(),i=n.parent(),r=t;t<0?r=n.length-1:t>=n.length&&(r=0);var o=n.removeClass("active").eq(r).addClass("active");if(this.index=parseInt(o.attr("data-index"))||r,e){var s,a=i.scrollTop(),c=i.offset().top,u=c+i.outerHeight(),l=o.offset().top,d=l+o.outerHeight();lu&&(s=a-u+d+parseInt(i.css("padding-bottom"),10)),void 0!==s&&i.stop(!0).animate({scrollTop:s},100)}},e}(o.a);p.MIN_SEARCH_LEN=3},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(){this.callbacks=new Map,this.whenCallback=function(t){return!0}}var e=t.prototype;return e.onUp=function(t){return this.callbacks.set(38,(function(e){e.preventDefault(),t(e)})),this},e.onDown=function(t){return this.callbacks.set(40,(function(e){e.preventDefault(),t(e)})),this},e.onSelect=function(t){var e=function(e){e.preventDefault(),t(e)};return this.callbacks.set(9,e),this.callbacks.set(13,e),this},e.onCancel=function(t){return this.callbacks.set(27,(function(e){e.stopPropagation(),e.preventDefault(),t(e)})),this},e.onRemove=function(t){return this.callbacks.set(8,(function(e){0===e.target.selectionStart&&0===e.target.selectionEnd&&(t(e),e.preventDefault())})),this},e.when=function(t){return this.whenCallback=t,this},e.bindTo=function(t){t.on("keydown",this.navigate.bind(this))},e.navigate=function(t){if(this.whenCallback(t)){var e=this.callbacks.get(t.which);e&&e(t)}},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(0),r=n(30),o=n(17),s=n(12),a=function(){function t(){this.results=new Map}var e=t.prototype;return e.search=function(t){var e=this;t=t.toLowerCase(),this.results.set(t,[]);var n={filter:{q:t},page:{limit:3},include:"mostRelevantPost"};return i.a.store.find("discussions",n).then((function(n){return e.results.set(t,n)}))},e.view=function(t){t=t.toLowerCase();var e=(this.results.get(t)||[]).map((function(e){var n=e.mostRelevantPost();return m("li",{className:"DiscussionSearchResult","data-index":"discussions"+e.id()},m(s.a,{href:i.a.route.discussion(e,n&&n.number())},m("div",{className:"DiscussionSearchResult-title"},Object(r.a)(e.title(),t)),n?m("div",{className:"DiscussionSearchResult-excerpt"},Object(r.a)(n.contentPlain(),t,100)):""))}));return[m("li",{className:"Dropdown-header"},i.a.translator.trans("core.forum.search.discussions_heading")),m("li",null,m(o.a,{icon:"fas fa-search",href:i.a.route("index",{q:t})},i.a.translator.trans("core.forum.search.all_discussions_button",{query:t})))].concat(e)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(13),r=n(0),o=n(30),s=n(14),a=n(20),c=n(12),u=function(){function t(){this.results=new Map}var e=t.prototype;return e.search=function(t){var e=this;return r.a.store.find("users",{filter:{q:t},page:{limit:5}}).then((function(n){e.results.set(t,n),m.redraw()}))},e.view=function(t){t=t.toLowerCase();var e=(this.results.get(t)||[]).concat(r.a.store.all("users").filter((function(e){return[e.username(),e.displayName()].some((function(e){return e.toLowerCase().substr(0,t.length)===t}))}))).filter((function(t,e,n){return n.lastIndexOf(t)===e})).sort((function(t,e){return t.displayName().localeCompare(e.displayName())}));return e.length?[m("li",{className:"Dropdown-header"},r.a.translator.trans("core.forum.search.users_heading"))].concat(e.map((function(e){var n=Object(a.a)(e),u=[Object(o.a)(n.text,t)];return m("li",{className:"UserSearchResult","data-index":"users"+e.id()},m(c.a,{href:r.a.route.user(e)},Object(s.a)(e),Object(i.a)({},n,{text:void 0,children:u})))}))):[]},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var i=n(13),r=n(1),o=n(0),s=n(4),a=n(3),c=n(60),u=n(8),l=n(10),d=n(21),h=function(t){function e(){return t.apply(this,arguments)||this}Object(r.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.state=this.attrs.state,this.active=!1,this.prevPosition=this.state.position},n.view=function(){var t=this.state.body,e={normal:this.state.position===d.a.Position.NORMAL,minimized:this.state.position===d.a.Position.MINIMIZED,fullScreen:this.state.position===d.a.Position.FULLSCREEN,active:this.active,visible:this.state.isVisible()},n=this.state.position===d.a.Position.MINIMIZED?this.state.show.bind(this.state):void 0;return m("div",{className:"Composer "+Object(l.a)(e)},m("div",{className:"Composer-handle",oncreate:this.configHandle.bind(this)}),m("ul",{className:"Composer-controls"},Object(u.a)(this.controlItems().toArray())),m("div",{className:"Composer-content",onclick:n},t.componentClass?t.componentClass.component(Object(i.a)({},t.attrs,{composer:this.state,disabled:e.minimized})):""))},n.onupdate=function(e){t.prototype.onupdate.call(this,e),this.state.position===this.prevPosition?this.updateHeight():(this.animatePositionChange(),this.prevPosition=this.state.position)},n.oncreate=function(e){var n=this;t.prototype.oncreate.call(this,e),this.initializeHeight(),this.$().hide().css("bottom",-this.state.computedHeight()),this.$().on("focus blur",":input,.TextEditor-editorContainer",(function(t){n.active="focusin"===t.type,m.redraw()})),this.$().on("keydown",":input,.TextEditor-editorContainer","esc",(function(){return n.state.close()})),this.handlers={},$(window).on("resize",this.handlers.onresize=this.updateHeight.bind(this)).resize(),$(document).on("mousemove",this.handlers.onmousemove=this.onmousemove.bind(this)).on("mouseup",this.handlers.onmouseup=this.onmouseup.bind(this))},n.onremove=function(e){t.prototype.onremove.call(this,e),$(window).off("resize",this.handlers.onresize),$(document).off("mousemove",this.handlers.onmousemove).off("mouseup",this.handlers.onmouseup)},n.configHandle=function(t){var e=this;$(t.dom).css("cursor","row-resize").bind("dragstart mousedown",(function(t){return t.preventDefault()})).mousedown((function(t){e.mouseStart=t.clientY,e.heightStart=e.$().height(),e.handle=$(this),$("body").css("cursor","row-resize")}))},n.onmousemove=function(t){if(this.handle){var e=this.mouseStart-t.clientY;this.changeHeight(this.heightStart+e);var n=$(window).scrollTop(),i=n>0&&n+$(window).height()>=$(document).height();this.updateBodyPadding(i)}},n.onmouseup=function(){this.handle&&(this.handle=null,$("body").css("cursor",""))},n.focus=function(){this.$(".Composer-content :input:enabled:visible, .TextEditor-editor").first().focus()},n.updateHeight=function(){var t=this.state.computedHeight(),e=this.$(".Composer-flexible");if(this.$().height(t),e.length){var n=e.offset().top-this.$().offset().top,i=parseInt(e.css("padding-bottom"),10),r=this.$(".Composer-footer").outerHeight(!0);e.height(this.$().outerHeight()-n-i-r)}},n.updateBodyPadding=function(){var t=this.state.position!==d.a.Position.HIDDEN&&this.state.position!==d.a.Position.MINIMIZED&&"phone"!==o.a.screen()?this.state.computedHeight()-parseInt($("#app").css("padding-bottom"),10):0;$("#content").css({paddingBottom:t})},n.animatePositionChange=function(){if(this.prevPosition!==d.a.Position.FULLSCREEN||this.state.position!==d.a.Position.NORMAL)switch(this.state.position){case d.a.Position.HIDDEN:return this.hide();case d.a.Position.MINIMIZED:return this.minimize();case d.a.Position.FULLSCREEN:return this.focus();case d.a.Position.NORMAL:return this.show()}else this.focus()},n.animateHeightChange=function(){var t=this.$().stop(!0),e=t.outerHeight(),n=$(window).scrollTop();t.show(),this.updateHeight();var i=t.outerHeight();this.prevPosition===d.a.Position.HIDDEN?t.css({bottom:-i,height:i}):t.css({height:e});var r=t.animate({bottom:0,height:i},"fast").promise();return this.updateBodyPadding(),$(window).scrollTop(n),r},n.showBackdrop=function(){this.$backdrop=$("
").addClass("composer-backdrop").appendTo("body")},n.hideBackdrop=function(){this.$backdrop&&this.$backdrop.remove()},n.show=function(){var t=this;if(this.animateHeightChange().then((function(){return t.focus()})),"phone"===o.a.screen()){var e=document.documentElement,n=Math.min(e.scrollTop,e.scrollHeight-e.clientHeight);this.$().css("top",$(".App").is(".mobile-safari")?n:0),this.showBackdrop()}},n.hide=function(){var t=this,e=this.$();e.stop(!0).animate({bottom:-e.height()},"fast",(function(){e.hide(),t.hideBackdrop(),t.updateBodyPadding()}))},n.minimize=function(){this.animateHeightChange(),this.$().css("top","auto"),this.hideBackdrop()},n.controlItems=function(){var t=new a.a;return this.state.position===d.a.Position.FULLSCREEN?t.add("exitFullScreen",c.a.component({icon:"fas fa-compress",title:o.a.translator.trans("core.forum.composer.exit_full_screen_tooltip"),onclick:this.state.exitFullScreen.bind(this.state)})):(this.state.position!==d.a.Position.MINIMIZED&&(t.add("minimize",c.a.component({icon:"fas fa-minus minimize",title:o.a.translator.trans("core.forum.composer.minimize_tooltip"),onclick:this.state.minimize.bind(this.state),itemClassName:"App-backControl"})),t.add("fullScreen",c.a.component({icon:"fas fa-expand",title:o.a.translator.trans("core.forum.composer.full_screen_tooltip"),onclick:this.state.fullScreen.bind(this.state)}))),t.add("close",c.a.component({icon:"fas fa-times",title:o.a.translator.trans("core.forum.composer.close_tooltip"),onclick:this.state.close.bind(this.state)}))),t},n.initializeHeight=function(){this.state.height=localStorage.getItem("composerHeight"),this.state.height||(this.state.height=this.defaultHeight())},n.defaultHeight=function(){return this.$().height()},n.changeHeight=function(t){this.state.height=t,this.updateHeight(),localStorage.setItem("composerHeight",this.state.height)},e}(s.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var i=n(1),r=n(0),o=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-pencil-alt"},n.href=function(){var t=this.attrs.notification;return r.a.route.discussion(t.subject(),t.content().postNumber)},n.content=function(){return r.a.translator.trans("core.forum.notifications.discussion_renamed_text",{user:this.attrs.notification.fromUser()})},e}(n(136).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var i=n(1),r=n(0),o=n(4),s=n(14),a=n(7),c=n(39),u=n(2),l=n(12),d=n(10),h=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){var t=this,e=this.attrs.notification,n=this.href();return m(l.a,{className:Object(d.a)("Notification","Notification--"+e.contentType(),[!e.isRead()&&"unread"]),href:n,external:n.includes("://"),onclick:this.markAsRead.bind(this)},Object(s.a)(e.fromUser()),Object(a.a)(this.icon(),{className:"Notification-icon"}),m("span",{className:"Notification-title"},m("span",{className:"Notification-content"},this.content()),m("span",{className:"Notification-title-spring"}),Object(c.a)(e.createdAt())),!e.isRead()&&m(u.a,{className:"Notification-action Button Button--link",icon:"fas fa-check",title:r.a.translator.trans("core.forum.notifications.mark_as_read_tooltip"),onclick:function(e){e.preventDefault(),e.stopPropagation(),t.markAsRead()}}),m("div",{className:"Notification-excerpt"},this.excerpt()))},n.icon=function(){},n.href=function(){},n.content=function(){},n.excerpt=function(){},n.markAsRead=function(){this.attrs.notification.isRead()||(r.a.session.user.pushAttributes({unreadNotificationCount:r.a.session.user.unreadNotificationCount()-1}),this.attrs.notification.save({isRead:!0}))},e}(o.a)},function(t,e,n){"use strict";var i=n(0),r=n(68),o=n(2),s=n(24),a=n(3),c=n(9);e.a={controls:function(t,e){var n=this,i=new a.a;return["user","moderation","destructive"].forEach((function(r){var o=n[r+"Controls"](t,e).toArray();o.length&&(o.forEach((function(t){return i.add(t.itemName,t)})),i.add(r+"Separator",s.a.component()))})),i},userControls:function(t,e){return new a.a},moderationControls:function(t,e){var n=new a.a;return"comment"===t.contentType()&&t.canEdit()&&(t.isHidden()||n.add("edit",o.a.component({icon:"fas fa-pencil-alt",onclick:this.editAction.bind(t)},i.a.translator.trans("core.forum.post_controls.edit_button")))),n},destructiveControls:function(t,e){var n=new a.a;return"comment"!==t.contentType()||t.isHidden()?("comment"===t.contentType()&&t.canHide()&&n.add("restore",o.a.component({icon:"fas fa-reply",onclick:this.restoreAction.bind(t)},i.a.translator.trans("core.forum.post_controls.restore_button"))),t.canDelete()&&n.add("delete",o.a.component({icon:"fas fa-times",onclick:this.deleteAction.bind(t,e)},i.a.translator.trans("core.forum.post_controls.delete_forever_button")))):t.canHide()&&n.add("hide",o.a.component({icon:"far fa-trash-alt",onclick:this.hideAction.bind(t)},i.a.translator.trans("core.forum.post_controls.delete_button"))),n},editAction:function(){var t=this;return new Promise((function(e){return i.a.composer.load(r.a,{post:t}),i.a.composer.show(),e()}))},hideAction:function(){if(confirm(Object(c.a)(i.a.translator.trans("core.forum.post_controls.hide_confirmation"))))return this.pushAttributes({hiddenAt:new Date,hiddenUser:i.a.session.user}),this.save({isHidden:!0}).then((function(){return m.redraw()}))},restoreAction:function(){return this.pushAttributes({hiddenAt:null,hiddenUser:null}),this.save({isHidden:!1}).then((function(){return m.redraw()}))},deleteAction:function(t){var e=this;if(confirm(Object(c.a)(i.a.translator.trans("core.forum.post_controls.delete_confirmation"))))return t&&(t.loading=!0),this.delete().then((function(){var t=e.discussion();t.removePost(e.id()),t.postIds().length||(i.a.discussions.removeDiscussion(t),i.a.viewingDiscussion(t)&&i.a.history.back())})).catch((function(){})).then((function(){t&&(t.loading=!1),m.redraw()}))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return h}));var i=n(1),r=n(0),o=n(4),s=n(12),a=n(69),c=n(14),u=n(20),l=n(85),d=n(8),h=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){var t=this.attrs.post,e=t.user();if(!e)return m("div",{className:"PostUser"},m("h3",null,Object(c.a)(e,{className:"PostUser-avatar"})," ",Object(u.a)(e)));var n="";return!t.isHidden()&&this.attrs.cardVisible&&(n=a.a.component({user:e,className:"UserCard--popover",controlsButtonClassName:"Button Button--icon Button--flat"})),m("div",{className:"PostUser"},m("h3",null,m(s.a,{href:r.a.route.user(e)},Object(c.a)(e,{className:"PostUser-avatar"}),Object(l.a)(e),Object(u.a)(e))),m("ul",{className:"PostUser-badges badges"},Object(d.a)(e.badges().toArray())),n)},n.oncreate=function(e){var n,i=this;t.prototype.oncreate.call(this,e),this.$().on("mouseover","h3 a, .UserCard",(function(){clearTimeout(n),n=setTimeout(i.showCard.bind(i),500)})).on("mouseout","h3 a, .UserCard",(function(){clearTimeout(n),n=setTimeout(i.hideCard.bind(i),250)}))},n.showCard=function(){var t=this;this.attrs.oncardshow(),setTimeout((function(){return t.$(".UserCard").addClass("in")}))},n.hideCard=function(){var t=this;this.$(".UserCard").removeClass("in").one("transitionend webkitTransitionEnd oTransitionEnd",(function(){t.attrs.oncardhide()}))},e}(o.a)},function(t,e,n){"use strict";var i=n(0),r=n(2),o=n(24),s=n(70),a=n(36),c=n(3);e.a={controls:function(t,e){var n=this,i=new c.a;return["user","moderation","destructive"].forEach((function(r){var s=n[r+"Controls"](t,e).toArray();s.length&&(s.forEach((function(t){return i.add(t.itemName,t)})),i.add(r+"Separator",m(o.a,null)))})),i},userControls:function(){return new c.a},moderationControls:function(t){var e=new c.a;return(t.canEdit()||t.canEditCredentials()||t.canEditGroups())&&e.add("edit",m(r.a,{icon:"fas fa-pencil-alt",onclick:this.editAction.bind(this,t)},i.a.translator.trans("core.forum.user_controls.edit_button"))),e},destructiveControls:function(t){var e=new c.a;return"1"!==t.id()&&t.canDelete()&&e.add("delete",m(r.a,{icon:"fas fa-times",onclick:this.deleteAction.bind(this,t)},i.a.translator.trans("core.forum.user_controls.delete_button"))),e},deleteAction:function(t){var e=this;confirm(i.a.translator.trans("core.forum.user_controls.delete_confirmation"))&&t.delete().then((function(){e.showDeletionAlert(t,"success"),i.a.current.matches(a.a,{user:t})?i.a.history.back():window.location.reload()})).catch((function(){return e.showDeletionAlert(t,"error")}))},showDeletionAlert:function(t,e){var n={success:"core.forum.user_controls.delete_success_message",error:"core.forum.user_controls.delete_error_message"}[e];i.a.alerts.show({type:e},i.a.translator.trans(n,{user:t,email:t.email()}))},editAction:function(t){i.a.modal.show(s.a,{user:t})}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(1),r=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(t){return t.children[0]},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.boundOnresize=this.onresize.bind(this),$(window).on("resize",this.boundOnresize).resize()},n.onremove=function(e){t.prototype.onremove.call(this,e),$(window).off("resize",this.boundOnresize)},n.onresize=function(){var t=this,e=this.$(),n=$("#header"),i=$("#footer"),r=e.find("> ul");$(window).off(".affix"),r.removeClass("affix affix-top affix-bottom").removeData("bs.affix"),e.outerHeight(!0)>$(window).height()-n.outerHeight(!0)||r.affix({offset:{top:function(){return e.offset().top-n.outerHeight(!0)-parseInt(e.css("margin-top"),10)},bottom:function(){return t.bottom=i.outerHeight(!0)}}})},e}(n(4).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return f}));var i=n(1),r=n(0),o=n(4),s=n(14),a=n(7),c=n(8),u=n(3),l=n(10),d=n(2),h=n(15),f=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.loading=!1,this.isDraggedOver=!1},n.view=function(){var t=this.attrs.user;return m("div",{className:Object(l.a)(["AvatarEditor","Dropdown",this.attrs.className,this.loading&&"loading",this.isDraggedOver&&"dragover"])},Object(s.a)(t),m("a",{className:t.avatarUrl()?"Dropdown-toggle":"Dropdown-toggle AvatarEditor--noAvatar",title:r.a.translator.trans("core.forum.user.avatar_upload_tooltip"),"data-toggle":"dropdown",onclick:this.quickUpload.bind(this),ondragover:this.enableDragover.bind(this),ondragenter:this.enableDragover.bind(this),ondragleave:this.disableDragover.bind(this),ondragend:this.disableDragover.bind(this),ondrop:this.dropUpload.bind(this)},this.loading?m(h.a,{display:"unset",size:"large"}):t.avatarUrl()?Object(a.a)("fas fa-pencil-alt"):Object(a.a)("fas fa-plus-circle")),m("ul",{className:"Dropdown-menu Menu"},Object(c.a)(this.controlItems().toArray())))},n.controlItems=function(){var t=new u.a;return t.add("upload",m(d.a,{icon:"fas fa-upload",onclick:this.openPicker.bind(this)},r.a.translator.trans("core.forum.user.avatar_upload_button"))),t.add("remove",m(d.a,{icon:"fas fa-times",onclick:this.remove.bind(this)},r.a.translator.trans("core.forum.user.avatar_remove_button"))),t},n.enableDragover=function(t){t.preventDefault(),t.stopPropagation(),this.isDraggedOver=!0},n.disableDragover=function(t){t.preventDefault(),t.stopPropagation(),this.isDraggedOver=!1},n.dropUpload=function(t){t.preventDefault(),t.stopPropagation(),this.isDraggedOver=!1,this.upload(t.dataTransfer.files[0])},n.quickUpload=function(t){this.attrs.user.avatarUrl()||(t.preventDefault(),t.stopPropagation(),this.openPicker())},n.openPicker=function(){var t=this;this.loading||$('').appendTo("body").hide().click().on("input",(function(e){t.upload($(e.target)[0].files[0])}))},n.upload=function(t){if(!this.loading){var e=this.attrs.user,n=new FormData;n.append("avatar",t),this.loading=!0,m.redraw(),r.a.request({method:"POST",url:r.a.forum.attribute("apiUrl")+"/users/"+e.id()+"/avatar",serialize:function(t){return t},body:n}).then(this.success.bind(this),this.failure.bind(this))}},n.remove=function(){var t=this.attrs.user;this.loading=!0,m.redraw(),r.a.request({method:"DELETE",url:r.a.forum.attribute("apiUrl")+"/users/"+t.id()+"/avatar"}).then(this.success.bind(this),this.failure.bind(this))},n.success=function(t){r.a.store.pushPayload(t),delete this.attrs.user.avatarColor,this.loading=!1,m.redraw()},n.failure=function(t){this.loading=!1,m.redraw()},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(1),r=n(0),o=n(4),s=n(39),a=n(86),c=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.view=function(){var t=this.attrs.post,e=t.createdAt(),n=this.getPermalink(t),i="ontouchstart"in document.documentElement;return m("div",{className:"Dropdown PostMeta"},m("a",{className:"Dropdown-toggle",onclick:function(t){var e=this;setTimeout((function(){return $(e).parent().find(".PostMeta-permalink").select()})),t.redraw=!1},"data-toggle":"dropdown"},Object(s.a)(e)),m("div",{className:"Dropdown-menu dropdown-menu"},m("span",{className:"PostMeta-number"},r.a.translator.trans("core.forum.post.number_tooltip",{number:t.number()}))," ",m("span",{className:"PostMeta-time"},Object(a.a)(e))," ",m("span",{className:"PostMeta-ip"},t.data.attributes.ipAddress),i?m("a",{className:"Button PostMeta-permalink",href:n},n):m("input",{className:"FormControl PostMeta-permalink",value:n,onclick:function(t){return t.stopPropagation()}})))},n.getPermalink=function(t){return window.location.origin+r.a.route.post(t)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(1),r=n(0),o=n(4),s=n(26),a=n(28),c=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e)},n.view=function(){var t=this.attrs.post,e=t.editedUser(),n=r.a.translator.trans("core.forum.post.edited_tooltip",{user:e,ago:Object(s.a)(t.editedAt())});return m(a.a,{text:n},m("span",{class:"PostEdited"},r.a.translator.trans("core.forum.post.edited_text")))},n.oncreate=function(e){t.prototype.oncreate.call(this,e)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(0),o=n(145),s=n(9),a=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.icon=function(){return"fas fa-pencil-alt"},n.description=function(t){var e=r.a.translator.trans("core.forum.post_stream.discussion_renamed_text",t),n=r.a.translator.trans("core.forum.post_stream.discussion_renamed_old_tooltip",t);return m("span",{title:Object(s.a)(n)},e)},n.descriptionData=function(){var t=this.attrs.post,e=t.content()[0],n=t.content()[1];return{old:e,new:m("strong",{className:"DiscussionRenamedPost-new"},n)}},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return l}));var i=n(1),r=n(0),o=n(67),s=n(38),a=n(20),c=n(7),u=n(12),l=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.elementAttrs=function(){var e=t.prototype.elementAttrs.call(this);return e.className=(e.className||"")+" EventPost "+Object(s.ucfirst)(this.attrs.post.contentType())+"Post",e},n.content=function(){var e=this.attrs.post.user(),n=Object(a.a)(e),i=Object.assign(this.descriptionData(),{user:e,username:e?m(u.a,{className:"EventPost-user",href:r.a.route.user(e)},n):n});return t.prototype.content.call(this).concat([Object(c.a)(this.icon(),{className:"EventPost-icon"}),m("div",{class:"EventPost-info"},this.description(i))])},n.icon=function(){return""},n.description=function(t){return r.a.translator.trans(this.descriptionKey(),t)},n.descriptionKey=function(){return""},n.descriptionData=function(){return{}},e}(o.a)},function(t,e,n){"use strict";var i=n(147),r=n(23),o=n(107),s=n(150),a=n(151),c=n(155),u=n(108);e.a=function(t){t.routes={index:{path:"/all",component:i.a},discussion:{path:"/d/:id",component:r.a,resolverClass:u.a},"discussion.near":{path:"/d/:id/:near",component:r.a,resolverClass:u.a},user:{path:"/u/:username",component:o.a},"user.posts":{path:"/u/:username",component:o.a},"user.discussions":{path:"/u/:username/discussions",component:s.a},settings:{path:"/settings",component:a.a},notifications:{path:"/notifications",component:c.a}},t.route.discussion=function(e,n){return t.route(n&&1!==n?"discussion.near":"discussion",{id:e.slug(),near:n&&1!==n?n:void 0})},t.route.post=function(e){return t.route.discussion(e.discussion(),e.number())},t.route.user=function(e){return t.route("user",{username:e.slug()})}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return b}));var i=n(1),r=n(0),o=n(29),s=n(3),a=n(8),c=n(42),u=n(148),l=n(149),d=n(35),h=n(23),f=n(19),p=n(2),g=n(17),v=n(32),b=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(n){t.prototype.oninit.call(this,n),r.a.previous.matches(h.a)&&(this.lastDiscussion=r.a.previous.get("discussion")),r.a.previous.matches(e)&&r.a.discussions.clear(),r.a.discussions.refreshParams(r.a.search.params(),m.route.param("page")),r.a.history.push("index",r.a.translator.trans("core.forum.header.back_to_index_tooltip")),this.bodyClass="App--index",this.scrollTopOnCreate=!1},n.view=function(){return m("div",{className:"IndexPage"},this.hero(),m("div",{className:"container"},m("div",{className:"sideNavContainer"},m("nav",{className:"IndexPage-nav sideNav"},m("ul",null,Object(a.a)(this.sidebarItems().toArray()))),m("div",{className:"IndexPage-results sideNavOffset"},m("div",{className:"IndexPage-toolbar"},m("ul",{className:"IndexPage-toolbar-view"},Object(a.a)(this.viewItems().toArray())),m("ul",{className:"IndexPage-toolbar-action"},Object(a.a)(this.actionItems().toArray()))),m(c.a,{state:r.a.discussions})))))},n.setTitle=function(){r.a.setTitle(r.a.translator.trans("core.forum.index.meta_title_text")),r.a.setTitleCount(0)},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.setTitle();var n=r.a.cache.heroHeight,i=r.a.cache.heroHeight=this.$(".Hero").outerHeight()||0,o=r.a.cache.scrollTop;if($("#app").css("min-height",$(window).height()+i),null!=r.a.previous.type&&("desktop"==r.a.screen()||"desktop-hd"==r.a.screen()||this.lastDiscussion?$(window).scrollTop(o-n+i):$(window).scrollTop(0),this.lastDiscussion)){var s=this.$('li[data-id="'+this.lastDiscussion.id()+'"] .DiscussionListItem');if(s.length){var a=$("#header").outerHeight(),c=$(window).height(),u=s.offset().top,l=u+s.outerHeight();(uo+c)&&$(window).scrollTop(u-a)}}},n.onbeforeremove=function(e){t.prototype.onbeforeremove.call(this,e),r.a.cache.scrollTop=$(window).scrollTop()},n.onremove=function(e){t.prototype.onremove.call(this,e),$("#app").css("min-height","")},n.hero=function(){return u.a.component()},n.sidebarItems=function(){var t=this,e=new s.a,n=r.a.forum.attribute("canStartDiscussion")||!r.a.session.user;return e.add("newDiscussion",p.a.component({icon:"fas fa-edit",className:"Button Button--primary IndexPage-newDiscussion",itemClassName:"App-primaryControl",onclick:function(){return t.newDiscussionAction().catch((function(){}))},disabled:!n},r.a.translator.trans(n?"core.forum.index.start_discussion_button":"core.forum.index.cannot_start_discussion_button"))),e.add("nav",v.a.component({buttonClassName:"Button",className:"App-titleControl",accessibleToggleLabel:r.a.translator.trans("core.forum.index.toggle_sidenav_dropdown_accessible_label")},this.navItems(this).toArray())),e},n.navItems=function(){var t=new s.a,e=r.a.search.stickyParams();return t.add("allDiscussions",g.a.component({href:r.a.route("index",e),icon:"far fa-comments"},r.a.translator.trans("core.forum.index.all_discussions_link")),100),t},n.viewItems=function(){var t=new s.a,e=r.a.discussions.sortMap(),n={};for(var i in e)n[i]=r.a.translator.trans("core.forum.index_sort."+i+"_button");return t.add("sort",f.a.component({buttonClassName:"Button",label:n[r.a.search.params().sort]||Object.keys(e).map((function(t){return n[t]}))[0],accessibleToggleLabel:r.a.translator.trans("core.forum.index_sort.toggle_dropdown_accessible_label")},Object.keys(n).map((function(t){var i=n[t],o=(r.a.search.params().sort||Object.keys(e)[0])===t;return p.a.component({icon:!o||"fas fa-check",onclick:r.a.search.changeSort.bind(r.a.search,t),active:o},i)})))),t},n.actionItems=function(){var t=new s.a;return t.add("refresh",p.a.component({title:r.a.translator.trans("core.forum.index.refresh_tooltip"),icon:"fas fa-sync",className:"Button Button--icon",onclick:function(){r.a.discussions.refresh(),r.a.session.user&&(r.a.store.find("users",r.a.session.user.id()),m.redraw())}})),r.a.session.user&&t.add("markAllAsRead",p.a.component({title:r.a.translator.trans("core.forum.index.mark_all_as_read_tooltip"),icon:"fas fa-check",className:"Button Button--icon",onclick:this.markAllAsRead.bind(this)})),t},n.newDiscussionAction=function(){return new Promise((function(t,e){return r.a.session.user?(r.a.composer.load(l.a,{user:r.a.session.user}),r.a.composer.show(),t(r.a.composer)):(r.a.modal.show(d.a),e())}))},n.markAllAsRead=function(){confirm(r.a.translator.trans("core.forum.index.mark_all_as_read_confirmation"))&&r.a.session.user.save({markedAllAsReadAt:new Date})},e}(o.a);b.providesInitialSearch=!0},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(0),o=n(4),s=n(2),a=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.hidden=localStorage.getItem("welcomeHidden")},n.view=function(){var t=this;if(this.hidden)return m("div",null);return m("header",{className:"Hero WelcomeHero"},m("div",{class:"container"},s.a.component({icon:"fas fa-times",onclick:function(){t.$().slideUp(t.hide.bind(t))},className:"Hero-close Button Button--icon Button--link"}),m("div",{className:"containerNarrow"},m("h2",{className:"Hero-title"},r.a.forum.attribute("welcomeTitle")),m("div",{className:"Hero-subtitle"},m.trust(r.a.forum.attribute("welcomeMessage"))))))},n.hide=function(){localStorage.setItem("welcomeHidden","true"),this.hidden=!0},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(1),r=n(0),o=n(47),s=n(9),a=n(11),c=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t),e.initAttrs=function(e){t.initAttrs.call(this,e),e.placeholder=e.placeholder||Object(s.a)(r.a.translator.trans("core.forum.composer_discussion.body_placeholder")),e.submitLabel=e.submitLabel||r.a.translator.trans("core.forum.composer_discussion.submit_button"),e.confirmExit=e.confirmExit||Object(s.a)(r.a.translator.trans("core.forum.composer_discussion.discard_confirmation")),e.titlePlaceholder=e.titlePlaceholder||Object(s.a)(r.a.translator.trans("core.forum.composer_discussion.title_placeholder")),e.className="ComposerBody--discussion"};var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.composer.fields.title=this.composer.fields.title||Object(a.a)(""),this.title=this.composer.fields.title},n.headerItems=function(){var e=t.prototype.headerItems.call(this);return e.add("title",m("h3",null,r.a.translator.trans("core.forum.composer_discussion.title")),100),e.add("discussionTitle",m("h3",null,m("input",{className:"FormControl",bidi:this.title,placeholder:this.attrs.titlePlaceholder,disabled:!!this.attrs.disabled,onkeydown:this.onkeydown.bind(this)}))),e},n.onkeydown=function(t){13===t.which&&(t.preventDefault(),this.composer.editor.moveCursorTo(0)),t.redraw=!1},n.hasChanges=function(){return this.title()||this.composer.fields.content()},n.data=function(){return{title:this.title(),content:this.composer.fields.content()}},n.onsubmit=function(){var t=this;this.loading=!0;var e=this.data();r.a.store.createRecord("discussions").save(e).then((function(e){t.composer.hide(),r.a.discussions.refresh({deferClear:!0}),m.route.set(r.a.route.discussion(e))}),this.loaded.bind(this))},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(36),o=n(42),s=n(71),a=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.loadUser(m.route.param("username"))},n.show=function(e){t.prototype.show.call(this,e),this.state=new s.a({filter:{author:e.username()},sort:"newest"}),this.state.refresh()},n.content=function(){return m("div",{className:"DiscussionsUserPage"},o.a.component({state:this.state}))},e}(r.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return p}));var i=n(1),r=n(0),o=n(36),s=n(3),a=n(45),c=n(2),u=n(49),l=n(152),d=n(153),h=n(154),f=n(8),p=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.show(r.a.session.user),r.a.setTitle(r.a.translator.trans("core.forum.settings.title"))},n.content=function(){return m("div",{className:"SettingsPage"},m("ul",null,Object(f.a)(this.settingsItems().toArray())))},n.settingsItems=function(){var t=this,e=new s.a;return["account","notifications","privacy"].forEach((function(n){e.add(n,m(u.a,{className:"Settings-"+n,label:r.a.translator.trans("core.forum.settings."+n+"_heading")},t[n+"Items"]().toArray()))})),e},n.accountItems=function(){var t=new s.a;return t.add("changePassword",m(c.a,{className:"Button",onclick:function(){return r.a.modal.show(d.a)}},r.a.translator.trans("core.forum.settings.change_password_button"))),t.add("changeEmail",m(c.a,{className:"Button",onclick:function(){return r.a.modal.show(h.a)}},r.a.translator.trans("core.forum.settings.change_email_button"))),t},n.notificationsItems=function(){var t=new s.a;return t.add("notificationGrid",m(l.a,{user:this.user})),t},n.privacyItems=function(){var t=this,e=new s.a;return e.add("discloseOnline",m(a.a,{state:this.user.preferences().discloseOnline,onchange:function(e){t.discloseOnlineLoading=!0,t.user.savePreferences({discloseOnline:e}).then((function(){t.discloseOnlineLoading=!1,m.redraw()}))},loading:this.discloseOnlineLoading},r.a.translator.trans("core.forum.settings.privacy_disclose_online_label"))),e},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(1),r=n(0),o=n(4),s=n(58),a=n(7),c=n(3),u=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.methods=this.notificationMethods().toArray(),this.loading={},this.types=this.notificationTypes().toArray()},n.view=function(){var t=this,e=this.attrs.user.preferences();return m("table",{className:"NotificationGrid"},m("thead",null,m("tr",null,m("td",null),this.methods.map((function(e){return m("th",{className:"NotificationGrid-groupToggle",onclick:t.toggleMethod.bind(t,e.name)},Object(a.a)(e.icon)," ",e.label)})))),m("tbody",null,this.types.map((function(n){return m("tr",null,m("td",{className:"NotificationGrid-groupToggle",onclick:t.toggleType.bind(t,n.name)},Object(a.a)(n.icon)," ",n.label),t.methods.map((function(i){var r=t.preferenceKey(n.name,i.name);return m("td",{className:"NotificationGrid-checkbox"},m(s.a,{state:!!e[r],loading:t.loading[r],disabled:!(r in e),onchange:t.toggle.bind(t,[r])}))})))}))))},n.oncreate=function(e){t.prototype.oncreate.call(this,e),this.$("thead .NotificationGrid-groupToggle").bind("mouseenter mouseleave",(function(t){var e=parseInt($(this).index(),10)+1;$(this).parents("table").find("td:nth-child("+e+")").toggleClass("highlighted","mouseenter"===t.type)})),this.$("tbody .NotificationGrid-groupToggle").bind("mouseenter mouseleave",(function(t){$(this).parent().find("td").toggleClass("highlighted","mouseenter"===t.type)}))},n.toggle=function(t){var e=this,n=this.attrs.user,i=n.preferences(),r=!i[t[0]];t.forEach((function(t){e.loading[t]=!0,i[t]=r})),m.redraw(),n.save({preferences:i}).then((function(){t.forEach((function(t){return e.loading[t]=!1})),m.redraw()}))},n.toggleMethod=function(t){var e=this,n=this.types.map((function(n){return e.preferenceKey(n.name,t)})).filter((function(t){return t in e.attrs.user.preferences()}));this.toggle(n)},n.toggleType=function(t){var e=this,n=this.methods.map((function(n){return e.preferenceKey(t,n.name)})).filter((function(t){return t in e.attrs.user.preferences()}));this.toggle(n)},n.preferenceKey=function(t,e){return"notify_"+t+"_"+e},n.notificationMethods=function(){var t=new c.a;return t.add("alert",{name:"alert",icon:"fas fa-bell",label:r.a.translator.trans("core.forum.settings.notify_by_web_heading")}),t.add("email",{name:"email",icon:"far fa-envelope",label:r.a.translator.trans("core.forum.settings.notify_by_email_heading")}),t},n.notificationTypes=function(){var t=new c.a;return t.add("discussionRenamed",{name:"discussionRenamed",icon:"fas fa-pencil-alt",label:r.a.translator.trans("core.forum.settings.notify_discussion_renamed_label")}),t},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(0),o=n(16),s=n(2),a=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.className=function(){return"ChangePasswordModal Modal--small"},n.title=function(){return r.a.translator.trans("core.forum.change_password.title")},n.content=function(){return m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},r.a.translator.trans("core.forum.change_password.text")),m("div",{className:"Form-group"},s.a.component({className:"Button Button--primary Button--block",type:"submit",loading:this.loading},r.a.translator.trans("core.forum.change_password.send_button")))))},n.onsubmit=function(t){t.preventDefault(),this.loading=!0,r.a.request({method:"POST",url:r.a.forum.attribute("apiUrl")+"/forgot",body:{email:r.a.session.user.email()}}).then(this.hide.bind(this),this.loaded.bind(this))},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return c}));var i=n(1),r=n(0),o=n(16),s=n(2),a=n(11),c=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),this.success=!1,this.email=Object(a.a)(r.a.session.user.email()),this.password=Object(a.a)("")},n.className=function(){return"ChangeEmailModal Modal--small"},n.title=function(){return r.a.translator.trans("core.forum.change_email.title")},n.content=function(){return this.success?m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("p",{className:"helpText"},r.a.translator.trans("core.forum.change_email.confirmation_message",{email:m("strong",null,this.email())})),m("div",{className:"Form-group"},m(s.a,{className:"Button Button--primary Button--block",onclick:this.hide.bind(this)},r.a.translator.trans("core.forum.change_email.dismiss_button"))))):m("div",{className:"Modal-body"},m("div",{className:"Form Form--centered"},m("div",{className:"Form-group"},m("input",{type:"email",name:"email",className:"FormControl",placeholder:r.a.session.user.email(),bidi:this.email,disabled:this.loading})),m("div",{className:"Form-group"},m("input",{type:"password",name:"password",className:"FormControl",autocomplete:"current-password",placeholder:r.a.translator.trans("core.forum.change_email.confirm_password_placeholder"),bidi:this.password,disabled:this.loading})),m("div",{className:"Form-group"},s.a.component({className:"Button Button--primary Button--block",type:"submit",loading:this.loading},r.a.translator.trans("core.forum.change_email.submit_button")))))},n.onsubmit=function(t){var e=this;t.preventDefault(),this.email()!==r.a.session.user.email()?(this.loading=!0,this.alertAttrs=null,r.a.session.user.save({email:this.email()},{errorHandler:this.onerror.bind(this),meta:{password:this.password()}}).then((function(){e.success=!0})).catch((function(){})).then(this.loaded.bind(this))):this.hide()},n.onerror=function(e){401===e.status&&(e.alert.content=r.a.translator.trans("core.forum.change_email.incorrect_password_message")),t.prototype.onerror.call(this,e)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(1),r=n(0),o=n(29),s=n(65),a=function(t){function e(){return t.apply(this,arguments)||this}Object(i.a)(e,t);var n=e.prototype;return n.oninit=function(e){t.prototype.oninit.call(this,e),r.a.history.push("notifications"),r.a.notifications.load(),this.bodyClass="App--notifications"},n.view=function(){return m("div",{className:"NotificationsPage"},m(s.a,{state:r.a.notifications}))},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(13),r=n(1),o=n(31),s=n(2),a=n(7),c=n(4);function u(t){var e=t.session.user;if(e&&!e.isEmailConfirmed()){var n=function(n){function i(){return n.apply(this,arguments)||this}Object(r.a)(i,n);var o=i.prototype;return o.oninit=function(t){n.prototype.oninit.call(this,t),this.loading=!1,this.sent=!1},o.view=function(){return m(s.a,{class:"Button Button--link",onclick:this.onclick.bind(this),loading:this.loading,disabled:this.sent},this.sent?[Object(a.a)("fas fa-check")," ",t.translator.trans("core.forum.user_email_confirmation.sent_message")]:t.translator.trans("core.forum.user_email_confirmation.resend_button"))},o.onclick=function(){var n=this;this.loading=!0,m.redraw(),t.request({method:"POST",url:t.forum.attribute("apiUrl")+"/users/"+e.id()+"/send-confirmation"}).then((function(){n.loading=!1,n.sent=!0,m.redraw()})).catch((function(){n.loading=!1,m.redraw()}))},i}(c.a),u=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e.prototype.view=function(e){var n=t.prototype.view.call(this,e);return Object(i.a)({},n,{children:[m("div",{className:"container"},n.children)]})},e}(o.a);m.mount($("
").insertBefore("#content")[0],{view:function(){return m(u,{dismissible:!1,controls:[m(n,null)]},t.translator.trans("core.forum.user_email_confirmation.alert_message",{email:m("strong",null,e.email())}))}})}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var i=n(87),r=n(1),o=n(0),s=function(t){function e(){return t.call(this,{},1,10)||this}Object(r.a)(e,t);var n=e.prototype;return n.load=function(){return o.a.session.user.newNotificationCount()&&(this.pages=[],this.location={page:1}),this.pages.length>0?Promise.resolve():(o.a.session.user.pushAttributes({newNotificationCount:0}),t.prototype.loadNext.call(this))},n.markAllAsRead=function(){if(0!==this.pages.length)return o.a.session.user.pushAttributes({unreadNotificationCount:0}),this.pages.forEach((function(t){t.items.forEach((function(t){return t.pushAttributes({isRead:!0})}))})),o.a.request({url:o.a.forum.attribute("apiUrl")+"/notifications/read",method:"POST"})},Object(i.a)(e,[{key:"type",get:function(){return"notifications"}}]),e}(n(57).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return a}));var i=n(22),r=n(1),o=n(0),s=n(48),a=function(t){function e(e){var n;return void 0===e&&(e=[]),(n=t.call(this,e)||this).initialValueSet=!1,n}Object(r.a)(e,t);var n=e.prototype;return n.getValue=function(){return!this.initialValueSet&&this.currPageProvidesSearch()&&this.intializeValue(),t.prototype.getValue.call(this)},n.intializeValue=function(){this.setValue(this.getInitialSearch()),this.initialValueSet=!0},n.currPageProvidesSearch=function(){return o.a.current.type&&o.a.current.type.providesInitialSearch},n.getInitialSearch=function(){return this.currPageProvidesSearch()?this.params().q:""},n.clear=function(){t.prototype.clear.call(this),this.getInitialSearch()?this.clearInitialSearch():m.redraw()},n.clearInitialSearch=function(){var t=this.params(),e=(t.q,Object(i.a)(t,["q"]));Object(s.a)(o.a.route(o.a.current.get("routeName"),e))},n.stickyParams=function(){return{sort:m.route.param("sort"),q:m.route.param("q")}},n.params=function(){var t=this.stickyParams();return t.filter=m.route.param("filter"),t},n.changeSort=function(t){var e=this.params();t===Object.keys(o.a.discussions.sortMap())[0]?delete e.sort:e.sort=t,Object(s.a)(o.a.route(o.a.current.get("routeName"),e))},e}(n(159).a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var i=function(){function t(t){void 0===t&&(t=[]),this.cachedSearches=void 0,this.value="",this.cachedSearches=new Set(t)}var e=t.prototype;return e.getInitialSearch=function(){return""},e.getValue=function(){return this.value},e.setValue=function(t){this.value=t},e.clear=function(){this.setValue("")},e.cache=function(t){this.cachedSearches.add(t)},e.isCached=function(t){return this.cachedSearches.has(t)},t}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return u}));var i=n(22),r=n(1),o=n(4),s=n(7),a=n(59),c=n(10),u=function(t){function e(){return t.apply(this,arguments)||this}return Object(r.a)(e,t),e.prototype.view=function(){var t=this.attrs,e=t.options,n=t.onchange,r=t.value,o=t.disabled,u=t.className,l=t.class,d=t.wrapperAttrs,h=(d=void 0===d?{}:d).className,f=d.class,p=Object(i.a)(d,["className","class"]),g=Object(i.a)(t,["options","onchange","value","disabled","className","class","wrapperAttrs"]);return m("span",Object.assign({className:Object(c.a)("Select",h,f)},p),m("select",Object.assign({className:Object(c.a)("Select-input FormControl",u,l),onchange:n?Object(a.a)("value",n.bind(this)):void 0,value:r,disabled:o},g),Object.keys(e).map((function(t){return m("option",{value:t},e[t])}))),Object(s.a)("fas fa-sort",{className:"Select-caret"}))},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var i=n(6);function r(t){if(2===t.length)return i.a.translator.trans("core.lib.series.two_text",{first:t[0],second:t[1]});if(t.length>=3){var e=t.slice(1,t.length-1).reduce((function(t,e){return t.concat([e,i.a.translator.trans("core.lib.series.glue_text")])}),[]).slice(0,-1);return i.a.translator.trans("core.lib.series.three_text",{first:t[0],second:e,third:t[t.length-1]})}return t}},function(t,e,n){"use strict";n.d(e,"a",(function(){return T}));var i=n(106),r=n(1),o=n(0),s=n(112),a=n(113),c=n(23),u=n(44),l=n(126),d=n(127),h=n(134),f=n(135),p=n(66),g=n(144),v=n(146),b=n(156),y=n(72),w=n(50),x=n(157),N=n(158),_=n(71),O=n(21);var T=function(t){function e(){var e;return(e=t.call(this)||this).notificationComponents={discussionRenamed:f.a},e.postComponents={comment:p.a,discussionRenamed:g.a},e.pane=null,e.drawer=null,e.history=new s.a,e.notifications=new x.a(Object(i.a)(e)),e.search=new N.a,e.composer=new O.a,Object(v.a)(Object(i.a)(e)),e.discussions=new _.a({}),e}Object(r.a)(e,t);var n=e.prototype;return n.mount=function(){var e=this,n=this.forum.attribute("defaultRoute"),i="index";for(var r in this.routes)this.routes[r].path===n&&(i=r);this.routes[i].path="/",this.history.push(i,this.translator.trans("core.forum.header.back_to_index_tooltip"),"/"),this.pane=new a.a(document.getElementById("app")),m.route.prefix="",t.prototype.mount.call(this,this.forum.attribute("basePath")),m.mount(document.getElementById("app-navigation"),{view:function(){return w.a.component({className:"App-backControl",drawer:!0})}}),m.mount(document.getElementById("header-navigation"),w.a),m.mount(document.getElementById("header-primary"),l.a),m.mount(document.getElementById("header-secondary"),d.a),m.mount(document.getElementById("composer"),{view:function(){return h.a.component({state:e.composer})}}),Object(b.a)(this),$("#home-link").click((function(t){t.ctrlKey||t.metaKey||2===t.which||(t.preventDefault(),o.a.history.home(),o.a.session.user&&(o.a.store.find("users",o.a.session.user.id()),m.redraw()))})),"ontouchstart"in window&&navigator.vendor&&navigator.vendor.includes("Apple")&&navigator.userAgent&&!navigator.userAgent.includes("CriOS")&&!navigator.userAgent.includes("FxiOS")&&$((function(){$(".App").addClass("mobile-safari")}))},n.viewingDiscussion=function(t){return this.current.matches(c.a,{discussion:t})},n.authenticationComplete=function(t){t.loggedIn?window.location.reload():this.modal.show(u.a,t)},e}(y.a)},function(t,e){function n(e){return t.exports=n=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.default=t.exports,t.exports.__esModule=!0,n(e)}t.exports=n,t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";var i=n(37),r=n(165),o=/(?:(^|#|\.)([^#\.\[\]]+))|(\[(.+?)(?:\s*=\s*("|'|)((?:\\["'\]]|.)*?)\5)?\])/g,s={},a={}.hasOwnProperty;function c(t){for(var e in t)if(a.call(t,e))return!1;return!0}function u(t){for(var e,n="div",i=[],r={};e=o.exec(t);){var a=e[1],c=e[2];if(""===a&&""!==c)n=c;else if("#"===a)r.id=c;else if("."===a)i.push(c);else if("["===e[3][0]){var u=e[6];u&&(u=u.replace(/\\(["'])/g,"$1").replace(/\\\\/g,"\\")),"class"===e[4]?i.push(u):r[e[4]]=""===u?u:u||!0}}return i.length>0&&(r.className=i.join(" ")),s[t]={tag:n,attrs:r}}function l(t,e){var n=e.attrs,r=i.normalizeChildren(e.children),o=a.call(n,"class"),s=o?n.class:n.className;if(e.tag=t.tag,e.attrs=null,e.children=void 0,!c(t.attrs)&&!c(n)){var u={};for(var l in n)a.call(n,l)&&(u[l]=n[l]);n=u}for(var l in t.attrs)a.call(t.attrs,l)&&"className"!==l&&!a.call(n,l)&&(n[l]=t.attrs[l]);for(var l in null==s&&null==t.attrs.className||(n.className=null!=s?null!=t.attrs.className?String(t.attrs.className)+" "+String(s):s:null!=t.attrs.className?t.attrs.className:null),o&&(n.class=null),n)if(a.call(n,l)&&"key"!==l){e.attrs=n;break}return Array.isArray(r)&&1===r.length&&null!=r[0]&&"#"===r[0].tag?e.text=r[0].children:e.children=r,e}t.exports=function(t){if(null==t||"string"!=typeof t&&"function"!=typeof t&&"function"!=typeof t.view)throw Error("The selector must be either a string or a component.");var e=r.apply(1,arguments);return"string"==typeof t&&(e.children=i.normalizeChildren(e.children),"["!==t)?l(s[t]||u(t),e):(e.tag=t,e)}},function(t,e,n){"use strict";var i=n(37);t.exports=function(){var t,e=arguments[this],n=this+1;if(null==e?e={}:("object"!=typeof e||null!=e.tag||Array.isArray(e))&&(e={},n=this),arguments.length===n+1)t=arguments[n],Array.isArray(t)||(t=[t]);else for(t=[];n0||t(n)}}var i=n(a);try{t(n(s),i)}catch(t){i(t)}}d(n)};n.prototype.then=function(t,e){var i,r,o=this._instance;function s(t,e,n,s){e.push((function(e){if("function"!=typeof t)n(e);else try{i(t(e))}catch(t){r&&r(t)}})),"function"==typeof o.retry&&s===o.state&&o.retry()}var a=new n((function(t,e){i=t,r=e}));return s(t,o.resolvers,i,!0),s(e,o.rejectors,r,!1),a},n.prototype.catch=function(t){return this.then(null,t)},n.prototype.finally=function(t){return this.then((function(e){return n.resolve(t()).then((function(){return e}))}),(function(e){return n.resolve(t()).then((function(){return n.reject(e)}))}))},n.resolve=function(t){return t instanceof n?t:new n((function(e){e(t)}))},n.reject=function(t){return new n((function(e,n){n(t)}))},n.all=function(t){return new n((function(e,n){var i=t.length,r=0,o=[];if(0===t.length)e([]);else for(var s=0;s=0&&(t._idleTimeoutId=setTimeout((function(){t._onTimeout&&t._onTimeout()}),e))},n(190),e.setImmediate="undefined"!=typeof self&&self.setImmediate||void 0!==t&&t.setImmediate||this&&this.setImmediate,e.clearImmediate="undefined"!=typeof self&&self.clearImmediate||void 0!==t&&t.clearImmediate||this&&this.clearImmediate}).call(this,n(78))},function(t,e,n){"use strict";t.exports=n(192)(window)},function(t,e,n){"use strict";t.exports=function(t){if("[object Object]"!==Object.prototype.toString.call(t))return"";var e=[];for(var n in t)i(n,t[n]);return e.join("&");function i(t,n){if(Array.isArray(n))for(var r=0;r-1&&c.pop();for(var l=0;l` component exposed by flarum/core instead. `$.tooltip` may be removed in a future version of Flarum.\n\nIf this component doesn't meet your requirements, please open an issue: https://github.com/flarum/core/issues/new?assignees=davwheat&labels=type/bug,needs-verification&template=bug-report.md&title=Tooltip%20component%20unsuitable%20for%20use%20case"),f.bind(this)(t)}},function(t,e,n){t.exports=function(){"use strict";return function(t,e,n){t=t||{};var i=e.prototype,r={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function o(t,e,n,r){return i.fromToBase(t,e,n,r)}n.en.relativeTime=r,i.fromToBase=function(e,i,o,s,a){for(var c,u,l,d=o.$locale().relativeTime||r,h=t.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],f=h.length,p=0;p0,g<=m.r||!m.r){g<=1&&p>0&&(m=h[p-1]);var v=d[m.l];a&&(g=a(""+g)),u="string"==typeof v?v.replace("%d",g):v(g,i,m.l,l);break}}if(i)return u;var b=l?d.future:d.past;return"function"==typeof b?b(u):b.replace("%s",u)},i.to=function(t,e){return o(t,e,this,!0)},i.from=function(t,e){return o(t,e,this)};var s=function(t){return t.$u?n.utc():n()};i.toNow=function(t){return this.to(s(this),t)},i.fromNow=function(t){return this.from(s(this),t)}}}()},function(t,e,n){t.exports=function(){"use strict";var t={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(e,n,i){var r=n.prototype,o=r.format;i.en.formats=t,r.format=function(e){void 0===e&&(e="YYYY-MM-DDTHH:mm:ssZ");var n=this.$locale().formats,i=function(e,n){return e.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(e,i,r){var o=r&&r.toUpperCase();return i||n[r]||t[r]||n[o].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(t,e,n){return e||n.slice(1)}))}))}(e,void 0===n?{}:n);return o.call(this,i)}}}()},function(t,e,n){!function(){var e=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],n="undefined"!=typeof window,i=n&&null!=window.mozInnerScreenX;function r(t,r,o){if(!n)throw new Error("textarea-caret-position#getCaretCoordinates should only be called in a browser");var s=o&&o.debug||!1;if(s){var a=document.querySelector("#input-textarea-caret-position-mirror-div");a&&a.parentNode.removeChild(a)}var c=document.createElement("div");c.id="input-textarea-caret-position-mirror-div",document.body.appendChild(c);var u=c.style,l=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle,d="INPUT"===t.nodeName;u.whiteSpace="pre-wrap",d||(u.wordWrap="break-word"),u.position="absolute",s||(u.visibility="hidden"),e.forEach((function(t){d&&"lineHeight"===t?u.lineHeight=l.height:u[t]=l[t]})),i?t.scrollHeight>parseInt(l.height)&&(u.overflowY="scroll"):u.overflow="hidden",c.textContent=t.value.substring(0,r),d&&(c.textContent=c.textContent.replace(/\s/g," "));var h=document.createElement("span");h.textContent=t.value.substring(r)||".",c.appendChild(h);var f={top:h.offsetTop+parseInt(l.borderTopWidth),left:h.offsetLeft+parseInt(l.borderLeftWidth),height:parseInt(l.lineHeight)};return s?h.style.backgroundColor="#aaa":document.body.removeChild(c),f}void 0!==t.exports?t.exports=r:n&&(window.getCaretCoordinates=r)}()},function(t,e,n){"use strict";t.exports=n(206)},function(t,e,n){var i=n(208);t.exports=function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var i=n(209).default,r=n(210);t.exports=function(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?r(t):e},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){var i=n(211),r=n(212),o=n(213),s=n(215);t.exports=function(t,e){return i(t)||r(t,e)||o(t,e)||s()},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";var i={};n.r(i),n.d(i,"throttle",(function(){return S.b})),n.d(i,"debounce",(function(){return S.a}));var r=n(77),o=n(94),s=n(93),a=n(62),c={handlers:null,getHandlers:function(t){return this.handlers=this.handlers||{},this.handlers[t]=this.handlers[t]||[],this.handlers[t]},trigger:function(t){for(var e=this,n=arguments.length,i=new Array(n>1?n-1:0),r=1;r1}function b(t,e){return Array(e+1).join(t)}function y(t,e,n){for(var i=e,r=n?/\n/:/\s/;t[i]&&!t[i].match(r);)i++;return i}function w(t){var e,n,i=t.value.slice(0,t.selectionStart),r=t.value.slice(t.selectionEnd),o=i.match(/\n*$/),s=r.match(/^\n*/),a=o?o[0].length:0,c=s?s[0].length:0;return i.match(/\S/)&&a<2&&(e=b("\n",2-a)),r.match(/\S/)&&c<2&&(n=b("\n",2-c)),null==e&&(e=""),null==n&&(n=""),{newlinesToAppend:e,newlinesToPrepend:n}}var x=n(95),N=n(84),_=n(76),O=n(80),T=n(82),C=n(38),S=n(51),j=n(11),k=n(53),E=n(48),A=n(25),P=n(40),D=n(100),I=n(52),M=n(105),L=n(103),B=n(10),R=n(9),H=n(74),U=n(96),F=n(59),q=n(102),z=n(99),W=n(101),G=n(56),V=n(18),Y=n(98),K=n(4),X=n(104),J=n(89),Q=n(29),Z=n(45),tt=n(34),et=n(15),nt=n(55),it=n(24),rt=n(19),ot=n(83),st=n(90),at=n(49),ct=n(160),ut=n(50),lt=n(31),dt=n(12),ht=n(17),ft=n(58),pt=n(32),mt=n(88),gt=n(2),vt=n(16),bt=n(41),yt=n(81),wt=n(28),xt=function(t){function e(){return t.apply(this,arguments)||this}return Object(d.a)(e,t),e.prototype.view=function(e){var n=t.prototype.view.call(this,e);return m(wt.a,{text:this.attrs.tooltipText||Object(R.a)(e.children)},n)},e.initAttrs=function(e){t.initAttrs.call(this,e),e.className=e.className||"Button Button--icon Button--link",e.tooltipText=e.title},e}(gt.a),Nt=n(70),_t=n(5),Ot=n(72),Tt=n(86),Ct=n(14),St=n(7),jt=n(39),kt=n(161),Et=n(30),At=n(20),Pt=n(85),Dt=n(8),It=function(){function t(){this.element=void 0}var e=t.prototype;return e.$=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}((function(t){var e=$(this.element);return t?e.find(t):e})),e.render=function(){var t=this,e=this.view();e.attrs=e.attrs||{};var n=e.attrs.oncreate;return e.attrs.oncreate=function(e){t.element=e.dom,n&&n.apply(t,[e])},e},t}(),$t=n(46),Mt=n(57);e.a={extend:r,Session:o.a,Store:s.a,"utils/BasicEditorDriver":a.a,"utils/evented":c,"utils/liveHumanTimes":u.a,"utils/ItemList":l.a,"utils/mixin":function(t){for(var e=function(t){function e(){return t.apply(this,arguments)||this}return Object(d.a)(e,t),e}(t),n=arguments.length,i=new Array(n>1?n-1:0),r=1;r0?s+"\n":r,g=v(p)&&a.length>0?"\n"+a:o;if(u){var b=t.value[t.selectionStart-1];0===t.selectionStart||null==b||b.match(/\s/)||(m=" "+m)}p=function(t,e,n,i){void 0===i&&(i=!1);if(t.selectionStart===t.selectionEnd)t.selectionStart=function(t,e){var n=e;for(;t[n]&&null!=t[n-1]&&!t[n-1].match(/\s/);)n--;return n}(t.value,t.selectionStart),t.selectionEnd=y(t.value,t.selectionEnd,i);else{var r=t.selectionStart-e.length,o=t.selectionEnd+n.length,s=t.value.slice(r,t.selectionStart)===e,a=t.value.slice(t.selectionEnd,o)===n;s&&a&&(t.selectionStart=r,t.selectionEnd=o)}return t.value.slice(t.selectionStart,t.selectionEnd)}(t,m,g,e.multiline);var x=t.selectionStart,N=t.selectionEnd,_=c.length>0&&g.indexOf(c)>-1&&p.length>0;if(d){var O=w(t);n=O.newlinesToAppend,i=O.newlinesToPrepend,m=n+r,g+=i}if(p.startsWith(m)&&p.endsWith(g)){var T=p.slice(m.length,p.length-g.length);if(h===f){var C=h-m.length;C=Math.max(C,x),C=Math.min(C,x+T.length),x=N=C}else N=x+T.length;return{text:T,selectionStart:x,selectionEnd:N}}if(_){if(l.length>0&&p.match(l)){g=g.replace(c,p);var S=m+g;return x=N=x+m.length,{text:S,selectionStart:x,selectionEnd:N}}var j=m+p+g;return x=x+m.length+p.length+g.indexOf(c),N=x+c.length,{text:j,selectionStart:x,selectionEnd:N}}var k=m+p+g;x=h+m.length,N=f+m.length;var E=p.match(/^\s*|\s*$/g);if(e.trimFirst&&E){var A=E[0]||"",P=E[1]||"";k=A+m+p.trim()+g+P,x+=A.length,N-=P.length}return{text:k,selectionStart:x,selectionEnd:N}}(t,e),Object(p.a)(t,n)},"utils/Drawer":x.a,"utils/anchorScroll":N.a,"utils/RequestError":_.a,"utils/abbreviateNumber":O.a,"utils/string":C,"utils/SubtreeRetainer":k.a,"utils/escapeRegExp":T.a,"utils/extract":A.a,"utils/ScrollListener":P.a,"utils/stringToColor":D.a,"utils/Stream":j.a,"utils/subclassOf":I.a,"utils/setRouteWithForcedRefresh":E.a,"utils/patchMithril":M.a,"utils/proxifyCompat":L.a,"utils/classList":B.a,"utils/extractText":R.a,"utils/formatNumber":H.a,"utils/mapRoutes":U.a,"utils/withAttr":F.a,"utils/throttleDebounce":i,"models/Notification":q.a,"models/User":z.a,"models/Post":W.a,"models/Discussion":G.a,"models/Group":V.a,"models/Forum":Y.a,Component:K.a,Fragment:It,Translator:X.a,"components/AlertManager":J.a,"components/Page":Q.a,"components/Switch":Z.a,"components/Badge":tt.a,"components/LoadingIndicator":et.a,"components/Placeholder":nt.a,"components/Separator":it.a,"components/Dropdown":rt.a,"components/SplitDropdown":ot.a,"components/RequestErrorModal":st.a,"components/FieldSet":at.a,"components/Select":ct.a,"components/Navigation":ut.a,"components/Alert":lt.a,"components/Link":dt.a,"components/LinkButton":ht.a,"components/Checkbox":ft.a,"components/SelectDropdown":pt.a,"components/ModalManager":mt.a,"components/Button":gt.a,"components/Modal":vt.a,"components/GroupBadge":bt.a,"components/TextEditor":yt.a,"components/TextEditorButton":xt,"components/Tooltip":wt.a,"components/EditUserModal":Nt.a,Model:_t.a,Application:Ot.a,"helpers/fullTime":Tt.a,"helpers/avatar":Ct.a,"helpers/icon":St.a,"helpers/humanTime":jt.a,"helpers/punctuateSeries":kt.a,"helpers/highlight":Et.a,"helpers/username":At.a,"helpers/userOnline":Pt.a,"helpers/listItems":Dt.a,"resolvers/DefaultResolver":$t.a,"states/PaginatedListState":Mt.a}},function(t,e,n){var i=n(183),r=n(79);void 0===r.$&&(r.$=i),void 0===r.jQuery&&(r.jQuery=i),t.exports=i},function(t,e,n){var i; /*! * jQuery JavaScript Library v3.6.0 * https://jquery.com/ @@ -22,5 +22,5 @@ flarum.core=function(t){var e={};function n(i){if(e[i])return e[i].exports;var r * * Date: 2021-02-16 */ -function(t){var e,n,i,r,o,s,a,c,u,l,d,h,f,p,m,g,v,b,y,w="sizzle"+1*new Date,x=t.document,N=0,_=0,O=ct(),T=ct(),C=ct(),S=ct(),j=function(t,e){return t===e&&(d=!0),0},k={}.hasOwnProperty,E=[],A=E.pop,P=E.push,D=E.push,I=E.slice,$=function(t,e){for(var n=0,i=t.length;n+~]|"+L+")"+L+"*"),W=new RegExp(L+"|>"),G=new RegExp(H),V=new RegExp("^"+B+"$"),Y={ID:new RegExp("^#("+B+")"),CLASS:new RegExp("^\\.("+B+")"),TAG:new RegExp("^("+B+"|[*])"),ATTR:new RegExp("^"+R),PSEUDO:new RegExp("^"+H),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+L+"*(even|odd|(([+-]|)(\\d*)n|)"+L+"*(?:([+-]|)"+L+"*(\\d+)|))"+L+"*\\)|)","i"),bool:new RegExp("^(?:"+M+")$","i"),needsContext:new RegExp("^"+L+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+L+"*((?:-\\d)?\\d*)"+L+"*\\)|)(?=[^-]|$)","i")},K=/HTML$/i,X=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,tt=/[+~]/,et=new RegExp("\\\\[\\da-fA-F]{1,6}"+L+"?|\\\\([^\\r\\n\\f])","g"),nt=function(t,e){var n="0x"+t.slice(1)-65536;return e||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},it=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,rt=function(t,e){return e?"\0"===t?"�":t.slice(0,-1)+"\\"+t.charCodeAt(t.length-1).toString(16)+" ":"\\"+t},ot=function(){h()},st=wt((function(t){return!0===t.disabled&&"fieldset"===t.nodeName.toLowerCase()}),{dir:"parentNode",next:"legend"});try{D.apply(E=I.call(x.childNodes),x.childNodes),E[x.childNodes.length].nodeType}catch(t){D={apply:E.length?function(t,e){P.apply(t,I.call(e))}:function(t,e){for(var n=t.length,i=0;t[n++]=e[i++];);t.length=n-1}}}function at(t,e,i,r){var o,a,u,l,d,p,v,b=e&&e.ownerDocument,x=e?e.nodeType:9;if(i=i||[],"string"!=typeof t||!t||1!==x&&9!==x&&11!==x)return i;if(!r&&(h(e),e=e||f,m)){if(11!==x&&(d=Z.exec(t)))if(o=d[1]){if(9===x){if(!(u=e.getElementById(o)))return i;if(u.id===o)return i.push(u),i}else if(b&&(u=b.getElementById(o))&&y(e,u)&&u.id===o)return i.push(u),i}else{if(d[2])return D.apply(i,e.getElementsByTagName(t)),i;if((o=d[3])&&n.getElementsByClassName&&e.getElementsByClassName)return D.apply(i,e.getElementsByClassName(o)),i}if(n.qsa&&!S[t+" "]&&(!g||!g.test(t))&&(1!==x||"object"!==e.nodeName.toLowerCase())){if(v=t,b=e,1===x&&(W.test(t)||z.test(t))){for((b=tt.test(t)&&vt(e.parentNode)||e)===e&&n.scope||((l=e.getAttribute("id"))?l=l.replace(it,rt):e.setAttribute("id",l=w)),a=(p=s(t)).length;a--;)p[a]=(l?"#"+l:":scope")+" "+yt(p[a]);v=p.join(",")}try{return D.apply(i,b.querySelectorAll(v)),i}catch(e){S(t,!0)}finally{l===w&&e.removeAttribute("id")}}}return c(t.replace(F,"$1"),e,i,r)}function ct(){var t=[];return function e(n,r){return t.push(n+" ")>i.cacheLength&&delete e[t.shift()],e[n+" "]=r}}function ut(t){return t[w]=!0,t}function lt(t){var e=f.createElement("fieldset");try{return!!t(e)}catch(t){return!1}finally{e.parentNode&&e.parentNode.removeChild(e),e=null}}function dt(t,e){for(var n=t.split("|"),r=n.length;r--;)i.attrHandle[n[r]]=e}function ht(t,e){var n=e&&t,i=n&&1===t.nodeType&&1===e.nodeType&&t.sourceIndex-e.sourceIndex;if(i)return i;if(n)for(;n=n.nextSibling;)if(n===e)return-1;return t?1:-1}function ft(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function pt(t){return function(e){var n=e.nodeName.toLowerCase();return("input"===n||"button"===n)&&e.type===t}}function mt(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&st(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function gt(t){return ut((function(e){return e=+e,ut((function(n,i){for(var r,o=t([],n.length,e),s=o.length;s--;)n[r=o[s]]&&(n[r]=!(i[r]=n[r]))}))}))}function vt(t){return t&&void 0!==t.getElementsByTagName&&t}for(e in n=at.support={},o=at.isXML=function(t){var e=t&&t.namespaceURI,n=t&&(t.ownerDocument||t).documentElement;return!K.test(e||n&&n.nodeName||"HTML")},h=at.setDocument=function(t){var e,r,s=t?t.ownerDocument||t:x;return s!=f&&9===s.nodeType&&s.documentElement?(p=(f=s).documentElement,m=!o(f),x!=f&&(r=f.defaultView)&&r.top!==r&&(r.addEventListener?r.addEventListener("unload",ot,!1):r.attachEvent&&r.attachEvent("onunload",ot)),n.scope=lt((function(t){return p.appendChild(t).appendChild(f.createElement("div")),void 0!==t.querySelectorAll&&!t.querySelectorAll(":scope fieldset div").length})),n.attributes=lt((function(t){return t.className="i",!t.getAttribute("className")})),n.getElementsByTagName=lt((function(t){return t.appendChild(f.createComment("")),!t.getElementsByTagName("*").length})),n.getElementsByClassName=Q.test(f.getElementsByClassName),n.getById=lt((function(t){return p.appendChild(t).id=w,!f.getElementsByName||!f.getElementsByName(w).length})),n.getById?(i.filter.ID=function(t){var e=t.replace(et,nt);return function(t){return t.getAttribute("id")===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n=e.getElementById(t);return n?[n]:[]}}):(i.filter.ID=function(t){var e=t.replace(et,nt);return function(t){var n=void 0!==t.getAttributeNode&&t.getAttributeNode("id");return n&&n.value===e}},i.find.ID=function(t,e){if(void 0!==e.getElementById&&m){var n,i,r,o=e.getElementById(t);if(o){if((n=o.getAttributeNode("id"))&&n.value===t)return[o];for(r=e.getElementsByName(t),i=0;o=r[i++];)if((n=o.getAttributeNode("id"))&&n.value===t)return[o]}return[]}}),i.find.TAG=n.getElementsByTagName?function(t,e){return void 0!==e.getElementsByTagName?e.getElementsByTagName(t):n.qsa?e.querySelectorAll(t):void 0}:function(t,e){var n,i=[],r=0,o=e.getElementsByTagName(t);if("*"===t){for(;n=o[r++];)1===n.nodeType&&i.push(n);return i}return o},i.find.CLASS=n.getElementsByClassName&&function(t,e){if(void 0!==e.getElementsByClassName&&m)return e.getElementsByClassName(t)},v=[],g=[],(n.qsa=Q.test(f.querySelectorAll))&&(lt((function(t){var e;p.appendChild(t).innerHTML="",t.querySelectorAll("[msallowcapture^='']").length&&g.push("[*^$]="+L+"*(?:''|\"\")"),t.querySelectorAll("[selected]").length||g.push("\\["+L+"*(?:value|"+M+")"),t.querySelectorAll("[id~="+w+"-]").length||g.push("~="),(e=f.createElement("input")).setAttribute("name",""),t.appendChild(e),t.querySelectorAll("[name='']").length||g.push("\\["+L+"*name"+L+"*="+L+"*(?:''|\"\")"),t.querySelectorAll(":checked").length||g.push(":checked"),t.querySelectorAll("a#"+w+"+*").length||g.push(".#.+[+~]"),t.querySelectorAll("\\\f"),g.push("[\\r\\n\\f]")})),lt((function(t){t.innerHTML="";var e=f.createElement("input");e.setAttribute("type","hidden"),t.appendChild(e).setAttribute("name","D"),t.querySelectorAll("[name=d]").length&&g.push("name"+L+"*[*^$|!~]?="),2!==t.querySelectorAll(":enabled").length&&g.push(":enabled",":disabled"),p.appendChild(t).disabled=!0,2!==t.querySelectorAll(":disabled").length&&g.push(":enabled",":disabled"),t.querySelectorAll("*,:x"),g.push(",.*:")}))),(n.matchesSelector=Q.test(b=p.matches||p.webkitMatchesSelector||p.mozMatchesSelector||p.oMatchesSelector||p.msMatchesSelector))&<((function(t){n.disconnectedMatch=b.call(t,"*"),b.call(t,"[s!='']:x"),v.push("!=",H)})),g=g.length&&new RegExp(g.join("|")),v=v.length&&new RegExp(v.join("|")),e=Q.test(p.compareDocumentPosition),y=e||Q.test(p.contains)?function(t,e){var n=9===t.nodeType?t.documentElement:t,i=e&&e.parentNode;return t===i||!(!i||1!==i.nodeType||!(n.contains?n.contains(i):t.compareDocumentPosition&&16&t.compareDocumentPosition(i)))}:function(t,e){if(e)for(;e=e.parentNode;)if(e===t)return!0;return!1},j=e?function(t,e){if(t===e)return d=!0,0;var i=!t.compareDocumentPosition-!e.compareDocumentPosition;return i||(1&(i=(t.ownerDocument||t)==(e.ownerDocument||e)?t.compareDocumentPosition(e):1)||!n.sortDetached&&e.compareDocumentPosition(t)===i?t==f||t.ownerDocument==x&&y(x,t)?-1:e==f||e.ownerDocument==x&&y(x,e)?1:l?$(l,t)-$(l,e):0:4&i?-1:1)}:function(t,e){if(t===e)return d=!0,0;var n,i=0,r=t.parentNode,o=e.parentNode,s=[t],a=[e];if(!r||!o)return t==f?-1:e==f?1:r?-1:o?1:l?$(l,t)-$(l,e):0;if(r===o)return ht(t,e);for(n=t;n=n.parentNode;)s.unshift(n);for(n=e;n=n.parentNode;)a.unshift(n);for(;s[i]===a[i];)i++;return i?ht(s[i],a[i]):s[i]==x?-1:a[i]==x?1:0},f):f},at.matches=function(t,e){return at(t,null,null,e)},at.matchesSelector=function(t,e){if(h(t),n.matchesSelector&&m&&!S[e+" "]&&(!v||!v.test(e))&&(!g||!g.test(e)))try{var i=b.call(t,e);if(i||n.disconnectedMatch||t.document&&11!==t.document.nodeType)return i}catch(t){S(e,!0)}return at(e,f,null,[t]).length>0},at.contains=function(t,e){return(t.ownerDocument||t)!=f&&h(t),y(t,e)},at.attr=function(t,e){(t.ownerDocument||t)!=f&&h(t);var r=i.attrHandle[e.toLowerCase()],o=r&&k.call(i.attrHandle,e.toLowerCase())?r(t,e,!m):void 0;return void 0!==o?o:n.attributes||!m?t.getAttribute(e):(o=t.getAttributeNode(e))&&o.specified?o.value:null},at.escape=function(t){return(t+"").replace(it,rt)},at.error=function(t){throw new Error("Syntax error, unrecognized expression: "+t)},at.uniqueSort=function(t){var e,i=[],r=0,o=0;if(d=!n.detectDuplicates,l=!n.sortStable&&t.slice(0),t.sort(j),d){for(;e=t[o++];)e===t[o]&&(r=i.push(o));for(;r--;)t.splice(i[r],1)}return l=null,t},r=at.getText=function(t){var e,n="",i=0,o=t.nodeType;if(o){if(1===o||9===o||11===o){if("string"==typeof t.textContent)return t.textContent;for(t=t.firstChild;t;t=t.nextSibling)n+=r(t)}else if(3===o||4===o)return t.nodeValue}else for(;e=t[i++];)n+=r(e);return n},(i=at.selectors={cacheLength:50,createPseudo:ut,match:Y,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(t){return t[1]=t[1].replace(et,nt),t[3]=(t[3]||t[4]||t[5]||"").replace(et,nt),"~="===t[2]&&(t[3]=" "+t[3]+" "),t.slice(0,4)},CHILD:function(t){return t[1]=t[1].toLowerCase(),"nth"===t[1].slice(0,3)?(t[3]||at.error(t[0]),t[4]=+(t[4]?t[5]+(t[6]||1):2*("even"===t[3]||"odd"===t[3])),t[5]=+(t[7]+t[8]||"odd"===t[3])):t[3]&&at.error(t[0]),t},PSEUDO:function(t){var e,n=!t[6]&&t[2];return Y.CHILD.test(t[0])?null:(t[3]?t[2]=t[4]||t[5]||"":n&&G.test(n)&&(e=s(n,!0))&&(e=n.indexOf(")",n.length-e)-n.length)&&(t[0]=t[0].slice(0,e),t[2]=n.slice(0,e)),t.slice(0,3))}},filter:{TAG:function(t){var e=t.replace(et,nt).toLowerCase();return"*"===t?function(){return!0}:function(t){return t.nodeName&&t.nodeName.toLowerCase()===e}},CLASS:function(t){var e=O[t+" "];return e||(e=new RegExp("(^|"+L+")"+t+"("+L+"|$)"))&&O(t,(function(t){return e.test("string"==typeof t.className&&t.className||void 0!==t.getAttribute&&t.getAttribute("class")||"")}))},ATTR:function(t,e,n){return function(i){var r=at.attr(i,t);return null==r?"!="===e:!e||(r+="","="===e?r===n:"!="===e?r!==n:"^="===e?n&&0===r.indexOf(n):"*="===e?n&&r.indexOf(n)>-1:"$="===e?n&&r.slice(-n.length)===n:"~="===e?(" "+r.replace(U," ")+" ").indexOf(n)>-1:"|="===e&&(r===n||r.slice(0,n.length+1)===n+"-"))}},CHILD:function(t,e,n,i,r){var o="nth"!==t.slice(0,3),s="last"!==t.slice(-4),a="of-type"===e;return 1===i&&0===r?function(t){return!!t.parentNode}:function(e,n,c){var u,l,d,h,f,p,m=o!==s?"nextSibling":"previousSibling",g=e.parentNode,v=a&&e.nodeName.toLowerCase(),b=!c&&!a,y=!1;if(g){if(o){for(;m;){for(h=e;h=h[m];)if(a?h.nodeName.toLowerCase()===v:1===h.nodeType)return!1;p=m="only"===t&&!p&&"nextSibling"}return!0}if(p=[s?g.firstChild:g.lastChild],s&&b){for(y=(f=(u=(l=(d=(h=g)[w]||(h[w]={}))[h.uniqueID]||(d[h.uniqueID]={}))[t]||[])[0]===N&&u[1])&&u[2],h=f&&g.childNodes[f];h=++f&&h&&h[m]||(y=f=0)||p.pop();)if(1===h.nodeType&&++y&&h===e){l[t]=[N,f,y];break}}else if(b&&(y=f=(u=(l=(d=(h=e)[w]||(h[w]={}))[h.uniqueID]||(d[h.uniqueID]={}))[t]||[])[0]===N&&u[1]),!1===y)for(;(h=++f&&h&&h[m]||(y=f=0)||p.pop())&&((a?h.nodeName.toLowerCase()!==v:1!==h.nodeType)||!++y||(b&&((l=(d=h[w]||(h[w]={}))[h.uniqueID]||(d[h.uniqueID]={}))[t]=[N,y]),h!==e)););return(y-=r)===i||y%i==0&&y/i>=0}}},PSEUDO:function(t,e){var n,r=i.pseudos[t]||i.setFilters[t.toLowerCase()]||at.error("unsupported pseudo: "+t);return r[w]?r(e):r.length>1?(n=[t,t,"",e],i.setFilters.hasOwnProperty(t.toLowerCase())?ut((function(t,n){for(var i,o=r(t,e),s=o.length;s--;)t[i=$(t,o[s])]=!(n[i]=o[s])})):function(t){return r(t,0,n)}):r}},pseudos:{not:ut((function(t){var e=[],n=[],i=a(t.replace(F,"$1"));return i[w]?ut((function(t,e,n,r){for(var o,s=i(t,null,r,[]),a=t.length;a--;)(o=s[a])&&(t[a]=!(e[a]=o))})):function(t,r,o){return e[0]=t,i(e,null,o,n),e[0]=null,!n.pop()}})),has:ut((function(t){return function(e){return at(t,e).length>0}})),contains:ut((function(t){return t=t.replace(et,nt),function(e){return(e.textContent||r(e)).indexOf(t)>-1}})),lang:ut((function(t){return V.test(t||"")||at.error("unsupported lang: "+t),t=t.replace(et,nt).toLowerCase(),function(e){var n;do{if(n=m?e.lang:e.getAttribute("xml:lang")||e.getAttribute("lang"))return(n=n.toLowerCase())===t||0===n.indexOf(t+"-")}while((e=e.parentNode)&&1===e.nodeType);return!1}})),target:function(e){var n=t.location&&t.location.hash;return n&&n.slice(1)===e.id},root:function(t){return t===p},focus:function(t){return t===f.activeElement&&(!f.hasFocus||f.hasFocus())&&!!(t.type||t.href||~t.tabIndex)},enabled:mt(!1),disabled:mt(!0),checked:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&!!t.checked||"option"===e&&!!t.selected},selected:function(t){return t.parentNode&&t.parentNode.selectedIndex,!0===t.selected},empty:function(t){for(t=t.firstChild;t;t=t.nextSibling)if(t.nodeType<6)return!1;return!0},parent:function(t){return!i.pseudos.empty(t)},header:function(t){return J.test(t.nodeName)},input:function(t){return X.test(t.nodeName)},button:function(t){var e=t.nodeName.toLowerCase();return"input"===e&&"button"===t.type||"button"===e},text:function(t){var e;return"input"===t.nodeName.toLowerCase()&&"text"===t.type&&(null==(e=t.getAttribute("type"))||"text"===e.toLowerCase())},first:gt((function(){return[0]})),last:gt((function(t,e){return[e-1]})),eq:gt((function(t,e,n){return[n<0?n+e:n]})),even:gt((function(t,e){for(var n=0;ne?e:n;--i>=0;)t.push(i);return t})),gt:gt((function(t,e,n){for(var i=n<0?n+e:n;++i1?function(e,n,i){for(var r=t.length;r--;)if(!t[r](e,n,i))return!1;return!0}:t[0]}function Nt(t,e,n,i,r){for(var o,s=[],a=0,c=t.length,u=null!=e;a-1&&(o[u]=!(s[u]=d))}}else v=Nt(v===s?v.splice(p,v.length):v),r?r(null,s,v,c):D.apply(s,v)}))}function Ot(t){for(var e,n,r,o=t.length,s=i.relative[t[0].type],a=s||i.relative[" "],c=s?1:0,l=wt((function(t){return t===e}),a,!0),d=wt((function(t){return $(e,t)>-1}),a,!0),h=[function(t,n,i){var r=!s&&(i||n!==u)||((e=n).nodeType?l(t,n,i):d(t,n,i));return e=null,r}];c1&&xt(h),c>1&&yt(t.slice(0,c-1).concat({value:" "===t[c-2].type?"*":""})).replace(F,"$1"),n,c0,r=t.length>0,o=function(o,s,a,c,l){var d,p,g,v=0,b="0",y=o&&[],w=[],x=u,_=o||r&&i.find.TAG("*",l),O=N+=null==x?1:Math.random()||.1,T=_.length;for(l&&(u=s==f||s||l);b!==T&&null!=(d=_[b]);b++){if(r&&d){for(p=0,s||d.ownerDocument==f||(h(d),a=!m);g=t[p++];)if(g(d,s||f,a)){c.push(d);break}l&&(N=O)}n&&((d=!g&&d)&&v--,o&&y.push(d))}if(v+=b,n&&b!==v){for(p=0;g=e[p++];)g(y,w,s,a);if(o){if(v>0)for(;b--;)y[b]||w[b]||(w[b]=A.call(c));w=Nt(w)}D.apply(c,w),l&&!o&&w.length>0&&v+e.length>1&&at.uniqueSort(c)}return l&&(N=O,u=x),y};return n?ut(o):o}(o,r))).selector=t}return a},c=at.select=function(t,e,n,r){var o,c,u,l,d,h="function"==typeof t&&t,f=!r&&s(t=h.selector||t);if(n=n||[],1===f.length){if((c=f[0]=f[0].slice(0)).length>2&&"ID"===(u=c[0]).type&&9===e.nodeType&&m&&i.relative[c[1].type]){if(!(e=(i.find.ID(u.matches[0].replace(et,nt),e)||[])[0]))return n;h&&(e=e.parentNode),t=t.slice(c.shift().value.length)}for(o=Y.needsContext.test(t)?0:c.length;o--&&(u=c[o],!i.relative[l=u.type]);)if((d=i.find[l])&&(r=d(u.matches[0].replace(et,nt),tt.test(c[0].type)&&vt(e.parentNode)||e))){if(c.splice(o,1),!(t=r.length&&yt(c)))return D.apply(n,r),n;break}}return(h||a(t,f))(r,e,!m,n,!e||tt.test(t)&&vt(e.parentNode)||e),n},n.sortStable=w.split("").sort(j).join("")===w,n.detectDuplicates=!!d,h(),n.sortDetached=lt((function(t){return 1&t.compareDocumentPosition(f.createElement("fieldset"))})),lt((function(t){return t.innerHTML="","#"===t.firstChild.getAttribute("href")}))||dt("type|href|height|width",(function(t,e,n){if(!n)return t.getAttribute(e,"type"===e.toLowerCase()?1:2)})),n.attributes&<((function(t){return t.innerHTML="",t.firstChild.setAttribute("value",""),""===t.firstChild.getAttribute("value")}))||dt("value",(function(t,e,n){if(!n&&"input"===t.nodeName.toLowerCase())return t.defaultValue})),lt((function(t){return null==t.getAttribute("disabled")}))||dt(M,(function(t,e,n){var i;if(!n)return!0===t[e]?e.toLowerCase():(i=t.getAttributeNode(e))&&i.specified?i.value:null})),at}(n);_.find=T,(_.expr=T.selectors)[":"]=_.expr.pseudos,_.uniqueSort=_.unique=T.uniqueSort,_.text=T.getText,_.isXMLDoc=T.isXML,_.contains=T.contains,_.escapeSelector=T.escape;var C=function(t,e,n){for(var i=[],r=void 0!==n;(t=t[e])&&9!==t.nodeType;)if(1===t.nodeType){if(r&&_(t).is(n))break;i.push(t)}return i},S=function(t,e){for(var n=[];t;t=t.nextSibling)1===t.nodeType&&t!==e&&n.push(t);return n},j=_.expr.match.needsContext;function k(t,e){return t.nodeName&&t.nodeName.toLowerCase()===e.toLowerCase()}var E=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function A(t,e,n){return v(e)?_.grep(t,(function(t,i){return!!e.call(t,i,t)!==n})):e.nodeType?_.grep(t,(function(t){return t===e!==n})):"string"!=typeof e?_.grep(t,(function(t){return l.call(e,t)>-1!==n})):_.filter(e,t,n)}_.filter=function(t,e,n){var i=e[0];return n&&(t=":not("+t+")"),1===e.length&&1===i.nodeType?_.find.matchesSelector(i,t)?[i]:[]:_.find.matches(t,_.grep(e,(function(t){return 1===t.nodeType})))},_.fn.extend({find:function(t){var e,n,i=this.length,r=this;if("string"!=typeof t)return this.pushStack(_(t).filter((function(){for(e=0;e1?_.uniqueSort(n):n},filter:function(t){return this.pushStack(A(this,t||[],!1))},not:function(t){return this.pushStack(A(this,t||[],!0))},is:function(t){return!!A(this,"string"==typeof t&&j.test(t)?_(t):t||[],!1).length}});var P,D=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(_.fn.init=function(t,e,n){var i,r;if(!t)return this;if(n=n||P,"string"==typeof t){if(!(i="<"===t[0]&&">"===t[t.length-1]&&t.length>=3?[null,t,null]:D.exec(t))||!i[1]&&e)return!e||e.jquery?(e||n).find(t):this.constructor(e).find(t);if(i[1]){if(e=e instanceof _?e[0]:e,_.merge(this,_.parseHTML(i[1],e&&e.nodeType?e.ownerDocument||e:y,!0)),E.test(i[1])&&_.isPlainObject(e))for(i in e)v(this[i])?this[i](e[i]):this.attr(i,e[i]);return this}return(r=y.getElementById(i[2]))&&(this[0]=r,this.length=1),this}return t.nodeType?(this[0]=t,this.length=1,this):v(t)?void 0!==n.ready?n.ready(t):t(_):_.makeArray(t,this)}).prototype=_.fn,P=_(y);var I=/^(?:parents|prev(?:Until|All))/,$={children:!0,contents:!0,next:!0,prev:!0};function M(t,e){for(;(t=t[e])&&1!==t.nodeType;);return t}_.fn.extend({has:function(t){var e=_(t,this),n=e.length;return this.filter((function(){for(var t=0;t-1:1===n.nodeType&&_.find.matchesSelector(n,t))){o.push(n);break}return this.pushStack(o.length>1?_.uniqueSort(o):o)},index:function(t){return t?"string"==typeof t?l.call(_(t),this[0]):l.call(this,t.jquery?t[0]:t):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(t,e){return this.pushStack(_.uniqueSort(_.merge(this.get(),_(t,e))))},addBack:function(t){return this.add(null==t?this.prevObject:this.prevObject.filter(t))}}),_.each({parent:function(t){var e=t.parentNode;return e&&11!==e.nodeType?e:null},parents:function(t){return C(t,"parentNode")},parentsUntil:function(t,e,n){return C(t,"parentNode",n)},next:function(t){return M(t,"nextSibling")},prev:function(t){return M(t,"previousSibling")},nextAll:function(t){return C(t,"nextSibling")},prevAll:function(t){return C(t,"previousSibling")},nextUntil:function(t,e,n){return C(t,"nextSibling",n)},prevUntil:function(t,e,n){return C(t,"previousSibling",n)},siblings:function(t){return S((t.parentNode||{}).firstChild,t)},children:function(t){return S(t.firstChild)},contents:function(t){return null!=t.contentDocument&&s(t.contentDocument)?t.contentDocument:(k(t,"template")&&(t=t.content||t),_.merge([],t.childNodes))}},(function(t,e){_.fn[t]=function(n,i){var r=_.map(this,e,n);return"Until"!==t.slice(-5)&&(i=n),i&&"string"==typeof i&&(r=_.filter(i,r)),this.length>1&&($[t]||_.uniqueSort(r),I.test(t)&&r.reverse()),this.pushStack(r)}}));var L=/[^\x20\t\r\n\f]+/g;function B(t){return t}function R(t){throw t}function H(t,e,n,i){var r;try{t&&v(r=t.promise)?r.call(t).done(e).fail(n):t&&v(r=t.then)?r.call(t,e,n):e.apply(void 0,[t].slice(i))}catch(t){n.apply(void 0,[t])}}_.Callbacks=function(t){t="string"==typeof t?function(t){var e={};return _.each(t.match(L)||[],(function(t,n){e[n]=!0})),e}(t):_.extend({},t);var e,n,i,r,o=[],s=[],a=-1,c=function(){for(r=r||t.once,i=e=!0;s.length;a=-1)for(n=s.shift();++a-1;)o.splice(n,1),n<=a&&a--})),this},has:function(t){return t?_.inArray(t,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return r=s=[],o=n="",this},disabled:function(){return!o},lock:function(){return r=s=[],n||e||(o=n=""),this},locked:function(){return!!r},fireWith:function(t,n){return r||(n=[t,(n=n||[]).slice?n.slice():n],s.push(n),e||c()),this},fire:function(){return u.fireWith(this,arguments),this},fired:function(){return!!i}};return u},_.extend({Deferred:function(t){var e=[["notify","progress",_.Callbacks("memory"),_.Callbacks("memory"),2],["resolve","done",_.Callbacks("once memory"),_.Callbacks("once memory"),0,"resolved"],["reject","fail",_.Callbacks("once memory"),_.Callbacks("once memory"),1,"rejected"]],i="pending",r={state:function(){return i},always:function(){return o.done(arguments).fail(arguments),this},catch:function(t){return r.then(null,t)},pipe:function(){var t=arguments;return _.Deferred((function(n){_.each(e,(function(e,i){var r=v(t[i[4]])&&t[i[4]];o[i[1]]((function(){var t=r&&r.apply(this,arguments);t&&v(t.promise)?t.promise().progress(n.notify).done(n.resolve).fail(n.reject):n[i[0]+"With"](this,r?[t]:arguments)}))})),t=null})).promise()},then:function(t,i,r){var o=0;function s(t,e,i,r){return function(){var a=this,c=arguments,u=function(){var n,u;if(!(t=o&&(i!==R&&(a=void 0,c=[n]),e.rejectWith(a,c))}};t?l():(_.Deferred.getStackHook&&(l.stackTrace=_.Deferred.getStackHook()),n.setTimeout(l))}}return _.Deferred((function(n){e[0][3].add(s(0,n,v(r)?r:B,n.notifyWith)),e[1][3].add(s(0,n,v(t)?t:B)),e[2][3].add(s(0,n,v(i)?i:R))})).promise()},promise:function(t){return null!=t?_.extend(t,r):r}},o={};return _.each(e,(function(t,n){var s=n[2],a=n[5];r[n[1]]=s.add,a&&s.add((function(){i=a}),e[3-t][2].disable,e[3-t][3].disable,e[0][2].lock,e[0][3].lock),s.add(n[3].fire),o[n[0]]=function(){return o[n[0]+"With"](this===o?void 0:this,arguments),this},o[n[0]+"With"]=s.fireWith})),r.promise(o),t&&t.call(o,o),o},when:function(t){var e=arguments.length,n=e,i=Array(n),r=a.call(arguments),o=_.Deferred(),s=function(t){return function(n){i[t]=this,r[t]=arguments.length>1?a.call(arguments):n,--e||o.resolveWith(i,r)}};if(e<=1&&(H(t,o.done(s(n)).resolve,o.reject,!e),"pending"===o.state()||v(r[n]&&r[n].then)))return o.then();for(;n--;)H(r[n],s(n),o.reject);return o.promise()}});var U=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;_.Deferred.exceptionHook=function(t,e){n.console&&n.console.warn&&t&&U.test(t.name)&&n.console.warn("jQuery.Deferred exception: "+t.message,t.stack,e)},_.readyException=function(t){n.setTimeout((function(){throw t}))};var F=_.Deferred();function q(){y.removeEventListener("DOMContentLoaded",q),n.removeEventListener("load",q),_.ready()}_.fn.ready=function(t){return F.then(t).catch((function(t){_.readyException(t)})),this},_.extend({isReady:!1,readyWait:1,ready:function(t){(!0===t?--_.readyWait:_.isReady)||(_.isReady=!0,!0!==t&&--_.readyWait>0||F.resolveWith(y,[_]))}}),_.ready.then=F.then,"complete"===y.readyState||"loading"!==y.readyState&&!y.documentElement.doScroll?n.setTimeout(_.ready):(y.addEventListener("DOMContentLoaded",q),n.addEventListener("load",q));var z=function t(e,n,i,r,o,s,a){var c=0,u=e.length,l=null==i;if("object"===N(i))for(c in o=!0,i)t(e,n,c,i[c],!0,s,a);else if(void 0!==r&&(o=!0,v(r)||(a=!0),l&&(a?(n.call(e,r),n=null):(l=n,n=function(t,e,n){return l.call(_(t),n)})),n))for(;c1,null,!0)},removeData:function(t){return this.each((function(){Q.remove(this,t)}))}}),_.extend({queue:function(t,e,n){var i;if(t)return e=(e||"fx")+"queue",i=J.get(t,e),n&&(!i||Array.isArray(n)?i=J.access(t,e,_.makeArray(n)):i.push(n)),i||[]},dequeue:function(t,e){var n=_.queue(t,e=e||"fx"),i=n.length,r=n.shift(),o=_._queueHooks(t,e);"inprogress"===r&&(r=n.shift(),i--),r&&("fx"===e&&n.unshift("inprogress"),delete o.stop,r.call(t,(function(){_.dequeue(t,e)}),o)),!i&&o&&o.empty.fire()},_queueHooks:function(t,e){var n=e+"queueHooks";return J.get(t,n)||J.access(t,n,{empty:_.Callbacks("once memory").add((function(){J.remove(t,[e+"queue",n])}))})}}),_.fn.extend({queue:function(t,e){var n=2;return"string"!=typeof t&&(e=t,t="fx",n--),arguments.length\x20\t\r\n\f]*)/i,vt=/^$|^module$|\/(?:java|ecma)script/i;ft=y.createDocumentFragment().appendChild(y.createElement("div")),(pt=y.createElement("input")).setAttribute("type","radio"),pt.setAttribute("checked","checked"),pt.setAttribute("name","t"),ft.appendChild(pt),g.checkClone=ft.cloneNode(!0).cloneNode(!0).lastChild.checked,ft.innerHTML="",g.noCloneChecked=!!ft.cloneNode(!0).lastChild.defaultValue,ft.innerHTML="",g.option=!!ft.lastChild;var bt={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function yt(t,e){var n;return n=void 0!==t.getElementsByTagName?t.getElementsByTagName(e||"*"):void 0!==t.querySelectorAll?t.querySelectorAll(e||"*"):[],void 0===e||e&&k(t,e)?_.merge([t],n):n}function wt(t,e){for(var n=0,i=t.length;n",""]);var xt=/<|&#?\w+;/;function Nt(t,e,n,i,r){for(var o,s,a,c,u,l,d=e.createDocumentFragment(),h=[],f=0,p=t.length;f-1)r&&r.push(o);else if(u=st(o),s=yt(d.appendChild(o),"script"),u&&wt(s),n)for(l=0;o=s[l++];)vt.test(o.type||"")&&n.push(o);return d}var _t=/^([^.]*)(?:\.(.+)|)/;function Ot(){return!0}function Tt(){return!1}function Ct(t,e){return t===function(){try{return y.activeElement}catch(t){}}()==("focus"===e)}function St(t,e,n,i,r,o){var s,a;if("object"==typeof e){for(a in"string"!=typeof n&&(i=i||n,n=void 0),e)St(t,a,n,i,e[a],o);return t}if(null==i&&null==r?(r=n,i=n=void 0):null==r&&("string"==typeof n?(r=i,i=void 0):(r=i,i=n,n=void 0)),!1===r)r=Tt;else if(!r)return t;return 1===o&&(s=r,(r=function(t){return _().off(t),s.apply(this,arguments)}).guid=s.guid||(s.guid=_.guid++)),t.each((function(){_.event.add(this,e,r,i,n)}))}function jt(t,e,n){n?(J.set(t,e,!1),_.event.add(t,e,{namespace:!1,handler:function(t){var i,r,o=J.get(this,e);if(1&t.isTrigger&&this[e]){if(o.length)(_.event.special[e]||{}).delegateType&&t.stopPropagation();else if(o=a.call(arguments),J.set(this,e,o),i=n(this,e),this[e](),o!==(r=J.get(this,e))||i?J.set(this,e,!1):r={},o!==r)return t.stopImmediatePropagation(),t.preventDefault(),r&&r.value}else o.length&&(J.set(this,e,{value:_.event.trigger(_.extend(o[0],_.Event.prototype),o.slice(1),this)}),t.stopImmediatePropagation())}})):void 0===J.get(t,e)&&_.event.add(t,e,Ot)}_.event={global:{},add:function(t,e,n,i,r){var o,s,a,c,u,l,d,h,f,p,m,g=J.get(t);if(K(t))for(n.handler&&(n=(o=n).handler,r=o.selector),r&&_.find.matchesSelector(ot,r),n.guid||(n.guid=_.guid++),(c=g.events)||(c=g.events=Object.create(null)),(s=g.handle)||(s=g.handle=function(e){return void 0!==_&&_.event.triggered!==e.type?_.event.dispatch.apply(t,arguments):void 0}),u=(e=(e||"").match(L)||[""]).length;u--;)f=m=(a=_t.exec(e[u])||[])[1],p=(a[2]||"").split(".").sort(),f&&(d=_.event.special[f]||{},f=(r?d.delegateType:d.bindType)||f,d=_.event.special[f]||{},l=_.extend({type:f,origType:m,data:i,handler:n,guid:n.guid,selector:r,needsContext:r&&_.expr.match.needsContext.test(r),namespace:p.join(".")},o),(h=c[f])||((h=c[f]=[]).delegateCount=0,d.setup&&!1!==d.setup.call(t,i,p,s)||t.addEventListener&&t.addEventListener(f,s)),d.add&&(d.add.call(t,l),l.handler.guid||(l.handler.guid=n.guid)),r?h.splice(h.delegateCount++,0,l):h.push(l),_.event.global[f]=!0)},remove:function(t,e,n,i,r){var o,s,a,c,u,l,d,h,f,p,m,g=J.hasData(t)&&J.get(t);if(g&&(c=g.events)){for(u=(e=(e||"").match(L)||[""]).length;u--;)if(f=m=(a=_t.exec(e[u])||[])[1],p=(a[2]||"").split(".").sort(),f){for(d=_.event.special[f]||{},h=c[f=(i?d.delegateType:d.bindType)||f]||[],a=a[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),s=o=h.length;o--;)l=h[o],!r&&m!==l.origType||n&&n.guid!==l.guid||a&&!a.test(l.namespace)||i&&i!==l.selector&&("**"!==i||!l.selector)||(h.splice(o,1),l.selector&&h.delegateCount--,d.remove&&d.remove.call(t,l));s&&!h.length&&(d.teardown&&!1!==d.teardown.call(t,p,g.handle)||_.removeEvent(t,f,g.handle),delete c[f])}else for(f in c)_.event.remove(t,f+e[u],n,i,!0);_.isEmptyObject(c)&&J.remove(t,"handle events")}},dispatch:function(t){var e,n,i,r,o,s,a=new Array(arguments.length),c=_.event.fix(t),u=(J.get(this,"events")||Object.create(null))[c.type]||[],l=_.event.special[c.type]||{};for(a[0]=c,e=1;e=1))for(;u!==this;u=u.parentNode||this)if(1===u.nodeType&&("click"!==t.type||!0!==u.disabled)){for(o=[],s={},n=0;n-1:_.find(r,this,null,[u]).length),s[r]&&o.push(i);o.length&&a.push({elem:u,handlers:o})}return u=this,c\s*$/g;function Pt(t,e){return k(t,"table")&&k(11!==e.nodeType?e:e.firstChild,"tr")&&_(t).children("tbody")[0]||t}function Dt(t){return t.type=(null!==t.getAttribute("type"))+"/"+t.type,t}function It(t){return"true/"===(t.type||"").slice(0,5)?t.type=t.type.slice(5):t.removeAttribute("type"),t}function $t(t,e){var n,i,r,o,s,a;if(1===e.nodeType){if(J.hasData(t)&&(a=J.get(t).events))for(r in J.remove(e,"handle events"),a)for(n=0,i=a[r].length;n1&&"string"==typeof p&&!g.checkClone&&Et.test(p))return t.each((function(r){var o=t.eq(r);m&&(e[0]=p.call(this,r,o.html())),Lt(o,e,n,i)}));if(h&&(o=(r=Nt(e,t[0].ownerDocument,!1,t,i)).firstChild,1===r.childNodes.length&&(r=o),o||i)){for(a=(s=_.map(yt(r,"script"),Dt)).length;d0&&wt(s,!c&&yt(t,"script")),a},cleanData:function(t){for(var e,n,i,r=_.event.special,o=0;void 0!==(n=t[o]);o++)if(K(n)){if(e=n[J.expando]){if(e.events)for(i in e.events)r[i]?_.event.remove(n,i):_.removeEvent(n,i,e.handle);n[J.expando]=void 0}n[Q.expando]&&(n[Q.expando]=void 0)}}}),_.fn.extend({detach:function(t){return Bt(this,t,!0)},remove:function(t){return Bt(this,t)},text:function(t){return z(this,(function(t){return void 0===t?_.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=t)}))}),null,t,arguments.length)},append:function(){return Lt(this,arguments,(function(t){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Pt(this,t).appendChild(t)}))},prepend:function(){return Lt(this,arguments,(function(t){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var e=Pt(this,t);e.insertBefore(t,e.firstChild)}}))},before:function(){return Lt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this)}))},after:function(){return Lt(this,arguments,(function(t){this.parentNode&&this.parentNode.insertBefore(t,this.nextSibling)}))},empty:function(){for(var t,e=0;null!=(t=this[e]);e++)1===t.nodeType&&(_.cleanData(yt(t,!1)),t.textContent="");return this},clone:function(t,e){return t=null!=t&&t,e=null==e?t:e,this.map((function(){return _.clone(this,t,e)}))},html:function(t){return z(this,(function(t){var e=this[0]||{},n=0,i=this.length;if(void 0===t&&1===e.nodeType)return e.innerHTML;if("string"==typeof t&&!kt.test(t)&&!bt[(gt.exec(t)||["",""])[1].toLowerCase()]){t=_.htmlPrefilter(t);try{for(;n=0&&(c+=Math.max(0,Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-o-c-a-.5))||0),c}function ee(t,e,n){var i=Ht(t),r=(!g.boxSizingReliable()||n)&&"border-box"===_.css(t,"boxSizing",!1,i),o=r,s=qt(t,e,i),a="offset"+e[0].toUpperCase()+e.slice(1);if(Rt.test(s)){if(!n)return s;s="auto"}return(!g.boxSizingReliable()&&r||!g.reliableTrDimensions()&&k(t,"tr")||"auto"===s||!parseFloat(s)&&"inline"===_.css(t,"display",!1,i))&&t.getClientRects().length&&(r="border-box"===_.css(t,"boxSizing",!1,i),(o=a in t)&&(s=t[a])),(s=parseFloat(s)||0)+te(t,e,n||(r?"border":"content"),o,i,s)+"px"}function ne(t,e,n,i,r){return new ne.prototype.init(t,e,n,i,r)}_.extend({cssHooks:{opacity:{get:function(t,e){if(e){var n=qt(t,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{},style:function(t,e,n,i){if(t&&3!==t.nodeType&&8!==t.nodeType&&t.style){var r,o,s,a=Y(e),c=Xt.test(e),u=t.style;if(c||(e=Yt(a)),s=_.cssHooks[e]||_.cssHooks[a],void 0===n)return s&&"get"in s&&void 0!==(r=s.get(t,!1,i))?r:u[e];"string"===(o=typeof n)&&(r=it.exec(n))&&r[1]&&(n=ut(t,e,r),o="number"),null!=n&&n==n&&("number"!==o||c||(n+=r&&r[3]||(_.cssNumber[a]?"":"px")),g.clearCloneStyle||""!==n||0!==e.indexOf("background")||(u[e]="inherit"),s&&"set"in s&&void 0===(n=s.set(t,n,i))||(c?u.setProperty(e,n):u[e]=n))}},css:function(t,e,n,i){var r,o,s,a=Y(e);return Xt.test(e)||(e=Yt(a)),(s=_.cssHooks[e]||_.cssHooks[a])&&"get"in s&&(r=s.get(t,!0,n)),void 0===r&&(r=qt(t,e,i)),"normal"===r&&e in Qt&&(r=Qt[e]),""===n||n?(o=parseFloat(r),!0===n||isFinite(o)?o||0:r):r}}),_.each(["height","width"],(function(t,e){_.cssHooks[e]={get:function(t,n,i){if(n)return!Kt.test(_.css(t,"display"))||t.getClientRects().length&&t.getBoundingClientRect().width?ee(t,e,i):Ut(t,Jt,(function(){return ee(t,e,i)}))},set:function(t,n,i){var r,o=Ht(t),s=!g.scrollboxSize()&&"absolute"===o.position,a=(s||i)&&"border-box"===_.css(t,"boxSizing",!1,o),c=i?te(t,e,i,a,o):0;return a&&s&&(c-=Math.ceil(t["offset"+e[0].toUpperCase()+e.slice(1)]-parseFloat(o[e])-te(t,e,"border",!1,o)-.5)),c&&(r=it.exec(n))&&"px"!==(r[3]||"px")&&(t.style[e]=n,n=_.css(t,e)),Zt(0,n,c)}}})),_.cssHooks.marginLeft=zt(g.reliableMarginLeft,(function(t,e){if(e)return(parseFloat(qt(t,"marginLeft"))||t.getBoundingClientRect().left-Ut(t,{marginLeft:0},(function(){return t.getBoundingClientRect().left})))+"px"})),_.each({margin:"",padding:"",border:"Width"},(function(t,e){_.cssHooks[t+e]={expand:function(n){for(var i=0,r={},o="string"==typeof n?n.split(" "):[n];i<4;i++)r[t+rt[i]+e]=o[i]||o[i-2]||o[0];return r}},"margin"!==t&&(_.cssHooks[t+e].set=Zt)})),_.fn.extend({css:function(t,e){return z(this,(function(t,e,n){var i,r,o={},s=0;if(Array.isArray(e)){for(i=Ht(t),r=e.length;s1)}}),_.Tween=ne,ne.prototype={constructor:ne,init:function(t,e,n,i,r,o){this.elem=t,this.prop=n,this.easing=r||_.easing._default,this.options=e,this.start=this.now=this.cur(),this.end=i,this.unit=o||(_.cssNumber[n]?"":"px")},cur:function(){var t=ne.propHooks[this.prop];return t&&t.get?t.get(this):ne.propHooks._default.get(this)},run:function(t){var e,n=ne.propHooks[this.prop];return this.options.duration?this.pos=e=_.easing[this.easing](t,this.options.duration*t,0,1,this.options.duration):this.pos=e=t,this.now=(this.end-this.start)*e+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):ne.propHooks._default.set(this),this}},ne.prototype.init.prototype=ne.prototype,ne.propHooks={_default:{get:function(t){var e;return 1!==t.elem.nodeType||null!=t.elem[t.prop]&&null==t.elem.style[t.prop]?t.elem[t.prop]:(e=_.css(t.elem,t.prop,""))&&"auto"!==e?e:0},set:function(t){_.fx.step[t.prop]?_.fx.step[t.prop](t):1!==t.elem.nodeType||!_.cssHooks[t.prop]&&null==t.elem.style[Yt(t.prop)]?t.elem[t.prop]=t.now:_.style(t.elem,t.prop,t.now+t.unit)}}},ne.propHooks.scrollTop=ne.propHooks.scrollLeft={set:function(t){t.elem.nodeType&&t.elem.parentNode&&(t.elem[t.prop]=t.now)}},_.easing={linear:function(t){return t},swing:function(t){return.5-Math.cos(t*Math.PI)/2},_default:"swing"},(_.fx=ne.prototype.init).step={};var ie,re,oe=/^(?:toggle|show|hide)$/,se=/queueHooks$/;function ae(){re&&(!1===y.hidden&&n.requestAnimationFrame?n.requestAnimationFrame(ae):n.setTimeout(ae,_.fx.interval),_.fx.tick())}function ce(){return n.setTimeout((function(){ie=void 0})),ie=Date.now()}function ue(t,e){var n,i=0,r={height:t};for(e=e?1:0;i<4;i+=2-e)r["margin"+(n=rt[i])]=r["padding"+n]=t;return e&&(r.opacity=r.width=t),r}function le(t,e,n){for(var i,r=(de.tweeners[e]||[]).concat(de.tweeners["*"]),o=0,s=r.length;o1)},removeAttr:function(t){return this.each((function(){_.removeAttr(this,t)}))}}),_.extend({attr:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===t.getAttribute?_.prop(t,e,n):(1===o&&_.isXMLDoc(t)||(r=_.attrHooks[e.toLowerCase()]||(_.expr.match.bool.test(e)?he:void 0)),void 0!==n?null===n?void _.removeAttr(t,e):r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:(t.setAttribute(e,n+""),n):r&&"get"in r&&null!==(i=r.get(t,e))?i:null==(i=_.find.attr(t,e))?void 0:i)},attrHooks:{type:{set:function(t,e){if(!g.radioValue&&"radio"===e&&k(t,"input")){var n=t.value;return t.setAttribute("type",e),n&&(t.value=n),e}}}},removeAttr:function(t,e){var n,i=0,r=e&&e.match(L);if(r&&1===t.nodeType)for(;n=r[i++];)t.removeAttribute(n)}}),he={set:function(t,e,n){return!1===e?_.removeAttr(t,n):t.setAttribute(n,n),n}},_.each(_.expr.match.bool.source.match(/\w+/g),(function(t,e){var n=fe[e]||_.find.attr;fe[e]=function(t,e,i){var r,o,s=e.toLowerCase();return i||(o=fe[s],fe[s]=r,r=null!=n(t,e,i)?s:null,fe[s]=o),r}}));var pe=/^(?:input|select|textarea|button)$/i,me=/^(?:a|area)$/i;function ge(t){return(t.match(L)||[]).join(" ")}function ve(t){return t.getAttribute&&t.getAttribute("class")||""}function be(t){return Array.isArray(t)?t:"string"==typeof t&&t.match(L)||[]}_.fn.extend({prop:function(t,e){return z(this,_.prop,t,e,arguments.length>1)},removeProp:function(t){return this.each((function(){delete this[_.propFix[t]||t]}))}}),_.extend({prop:function(t,e,n){var i,r,o=t.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&_.isXMLDoc(t)||(e=_.propFix[e]||e,r=_.propHooks[e]),void 0!==n?r&&"set"in r&&void 0!==(i=r.set(t,n,e))?i:t[e]=n:r&&"get"in r&&null!==(i=r.get(t,e))?i:t[e]},propHooks:{tabIndex:{get:function(t){var e=_.find.attr(t,"tabindex");return e?parseInt(e,10):pe.test(t.nodeName)||me.test(t.nodeName)&&t.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),g.optSelected||(_.propHooks.selected={get:function(t){var e=t.parentNode;return e&&e.parentNode&&e.parentNode.selectedIndex,null},set:function(t){var e=t.parentNode;e&&(e.selectedIndex,e.parentNode&&e.parentNode.selectedIndex)}}),_.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){_.propFix[this.toLowerCase()]=this})),_.fn.extend({addClass:function(t){var e,n,i,r,o,s,a,c=0;if(v(t))return this.each((function(e){_(this).addClass(t.call(this,e,ve(this)))}));if((e=be(t)).length)for(;n=this[c++];)if(r=ve(n),i=1===n.nodeType&&" "+ge(r)+" "){for(s=0;o=e[s++];)i.indexOf(" "+o+" ")<0&&(i+=o+" ");r!==(a=ge(i))&&n.setAttribute("class",a)}return this},removeClass:function(t){var e,n,i,r,o,s,a,c=0;if(v(t))return this.each((function(e){_(this).removeClass(t.call(this,e,ve(this)))}));if(!arguments.length)return this.attr("class","");if((e=be(t)).length)for(;n=this[c++];)if(r=ve(n),i=1===n.nodeType&&" "+ge(r)+" "){for(s=0;o=e[s++];)for(;i.indexOf(" "+o+" ")>-1;)i=i.replace(" "+o+" "," ");r!==(a=ge(i))&&n.setAttribute("class",a)}return this},toggleClass:function(t,e){var n=typeof t,i="string"===n||Array.isArray(t);return"boolean"==typeof e&&i?e?this.addClass(t):this.removeClass(t):v(t)?this.each((function(n){_(this).toggleClass(t.call(this,n,ve(this),e),e)})):this.each((function(){var e,r,o,s;if(i)for(r=0,o=_(this),s=be(t);e=s[r++];)o.hasClass(e)?o.removeClass(e):o.addClass(e);else void 0!==t&&"boolean"!==n||((e=ve(this))&&J.set(this,"__className__",e),this.setAttribute&&this.setAttribute("class",e||!1===t?"":J.get(this,"__className__")||""))}))},hasClass:function(t){var e,n,i=0;for(e=" "+t+" ";n=this[i++];)if(1===n.nodeType&&(" "+ge(ve(n))+" ").indexOf(e)>-1)return!0;return!1}});var ye=/\r/g;_.fn.extend({val:function(t){var e,n,i,r=this[0];return arguments.length?(i=v(t),this.each((function(n){var r;1===this.nodeType&&(null==(r=i?t.call(this,n,_(this).val()):t)?r="":"number"==typeof r?r+="":Array.isArray(r)&&(r=_.map(r,(function(t){return null==t?"":t+""}))),(e=_.valHooks[this.type]||_.valHooks[this.nodeName.toLowerCase()])&&"set"in e&&void 0!==e.set(this,r,"value")||(this.value=r))}))):r?(e=_.valHooks[r.type]||_.valHooks[r.nodeName.toLowerCase()])&&"get"in e&&void 0!==(n=e.get(r,"value"))?n:"string"==typeof(n=r.value)?n.replace(ye,""):null==n?"":n:void 0}}),_.extend({valHooks:{option:{get:function(t){var e=_.find.attr(t,"value");return null!=e?e:ge(_.text(t))}},select:{get:function(t){var e,n,i,r=t.options,o=t.selectedIndex,s="select-one"===t.type,a=s?null:[],c=s?o+1:r.length;for(i=o<0?c:s?o:0;i-1)&&(n=!0);return n||(t.selectedIndex=-1),o}}}}),_.each(["radio","checkbox"],(function(){_.valHooks[this]={set:function(t,e){if(Array.isArray(e))return t.checked=_.inArray(_(t).val(),e)>-1}},g.checkOn||(_.valHooks[this].get=function(t){return null===t.getAttribute("value")?"on":t.value})})),g.focusin="onfocusin"in n;var we=/^(?:focusinfocus|focusoutblur)$/,xe=function(t){t.stopPropagation()};_.extend(_.event,{trigger:function(t,e,i,r){var o,s,a,c,u,l,d,h,p=[i||y],m=f.call(t,"type")?t.type:t,g=f.call(t,"namespace")?t.namespace.split("."):[];if(s=h=a=i=i||y,3!==i.nodeType&&8!==i.nodeType&&!we.test(m+_.event.triggered)&&(m.indexOf(".")>-1&&(g=m.split("."),m=g.shift(),g.sort()),u=m.indexOf(":")<0&&"on"+m,(t=t[_.expando]?t:new _.Event(m,"object"==typeof t&&t)).isTrigger=r?2:3,t.namespace=g.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+g.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=i),e=null==e?[t]:_.makeArray(e,[t]),d=_.event.special[m]||{},r||!d.trigger||!1!==d.trigger.apply(i,e))){if(!r&&!d.noBubble&&!b(i)){for(c=d.delegateType||m,we.test(c+m)||(s=s.parentNode);s;s=s.parentNode)p.push(s),a=s;a===(i.ownerDocument||y)&&p.push(a.defaultView||a.parentWindow||n)}for(o=0;(s=p[o++])&&!t.isPropagationStopped();)h=s,t.type=o>1?c:d.bindType||m,(l=(J.get(s,"events")||Object.create(null))[t.type]&&J.get(s,"handle"))&&l.apply(s,e),(l=u&&s[u])&&l.apply&&K(s)&&(t.result=l.apply(s,e),!1===t.result&&t.preventDefault());return t.type=m,r||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(p.pop(),e)||!K(i)||u&&v(i[m])&&!b(i)&&((a=i[u])&&(i[u]=null),_.event.triggered=m,t.isPropagationStopped()&&h.addEventListener(m,xe),i[m](),t.isPropagationStopped()&&h.removeEventListener(m,xe),_.event.triggered=void 0,a&&(i[u]=a)),t.result}},simulate:function(t,e,n){var i=_.extend(new _.Event,n,{type:t,isSimulated:!0});_.event.trigger(i,null,e)}}),_.fn.extend({trigger:function(t,e){return this.each((function(){_.event.trigger(t,e,this)}))},triggerHandler:function(t,e){var n=this[0];if(n)return _.event.trigger(t,e,n,!0)}}),g.focusin||_.each({focus:"focusin",blur:"focusout"},(function(t,e){var n=function(t){_.event.simulate(e,t.target,_.event.fix(t))};_.event.special[e]={setup:function(){var i=this.ownerDocument||this.document||this,r=J.access(i,e);r||i.addEventListener(t,n,!0),J.access(i,e,(r||0)+1)},teardown:function(){var i=this.ownerDocument||this.document||this,r=J.access(i,e)-1;r?J.access(i,e,r):(i.removeEventListener(t,n,!0),J.remove(i,e))}}}));var Ne=n.location,_e={guid:Date.now()},Oe=/\?/;_.parseXML=function(t){var e,i;if(!t||"string"!=typeof t)return null;try{e=(new n.DOMParser).parseFromString(t,"text/xml")}catch(t){}return i=e&&e.getElementsByTagName("parsererror")[0],e&&!i||_.error("Invalid XML: "+(i?_.map(i.childNodes,(function(t){return t.textContent})).join("\n"):t)),e};var Te=/\[\]$/,Ce=/\r?\n/g,Se=/^(?:submit|button|image|reset|file)$/i,je=/^(?:input|select|textarea|keygen)/i;function ke(t,e,n,i){var r;if(Array.isArray(e))_.each(e,(function(e,r){n||Te.test(t)?i(t,r):ke(t+"["+("object"==typeof r&&null!=r?e:"")+"]",r,n,i)}));else if(n||"object"!==N(e))i(t,e);else for(r in e)ke(t+"["+r+"]",e[r],n,i)}_.param=function(t,e){var n,i=[],r=function(t,e){var n=v(e)?e():e;i[i.length]=encodeURIComponent(t)+"="+encodeURIComponent(null==n?"":n)};if(null==t)return"";if(Array.isArray(t)||t.jquery&&!_.isPlainObject(t))_.each(t,(function(){r(this.name,this.value)}));else for(n in t)ke(n,t[n],e,r);return i.join("&")},_.fn.extend({serialize:function(){return _.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var t=_.prop(this,"elements");return t?_.makeArray(t):this})).filter((function(){var t=this.type;return this.name&&!_(this).is(":disabled")&&je.test(this.nodeName)&&!Se.test(t)&&(this.checked||!mt.test(t))})).map((function(t,e){var n=_(this).val();return null==n?null:Array.isArray(n)?_.map(n,(function(t){return{name:e.name,value:t.replace(Ce,"\r\n")}})):{name:e.name,value:n.replace(Ce,"\r\n")}})).get()}});var Ee=/%20/g,Ae=/#.*$/,Pe=/([?&])_=[^&]*/,De=/^(.*?):[ \t]*([^\r\n]*)$/gm,Ie=/^(?:GET|HEAD)$/,$e=/^\/\//,Me={},Le={},Be="*/".concat("*"),Re=y.createElement("a");function He(t){return function(e,n){"string"!=typeof e&&(n=e,e="*");var i,r=0,o=e.toLowerCase().match(L)||[];if(v(n))for(;i=o[r++];)"+"===i[0]?(i=i.slice(1)||"*",(t[i]=t[i]||[]).unshift(n)):(t[i]=t[i]||[]).push(n)}}function Ue(t,e,n,i){var r={},o=t===Le;function s(a){var c;return r[a]=!0,_.each(t[a]||[],(function(t,a){var u=a(e,n,i);return"string"!=typeof u||o||r[u]?o?!(c=u):void 0:(e.dataTypes.unshift(u),s(u),!1)})),c}return s(e.dataTypes[0])||!r["*"]&&s("*")}function Fe(t,e){var n,i,r=_.ajaxSettings.flatOptions||{};for(n in e)void 0!==e[n]&&((r[n]?t:i||(i={}))[n]=e[n]);return i&&_.extend(!0,t,i),t}Re.href=Ne.href,_.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:Ne.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(Ne.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":Be,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":_.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(t,e){return e?Fe(Fe(t,_.ajaxSettings),e):Fe(_.ajaxSettings,t)},ajaxPrefilter:He(Me),ajaxTransport:He(Le),ajax:function(t,e){"object"==typeof t&&(e=t,t=void 0);var i,r,o,s,a,c,u,l,d,h,f=_.ajaxSetup({},e=e||{}),p=f.context||f,m=f.context&&(p.nodeType||p.jquery)?_(p):_.event,g=_.Deferred(),v=_.Callbacks("once memory"),b=f.statusCode||{},w={},x={},N="canceled",O={readyState:0,getResponseHeader:function(t){var e;if(u){if(!s)for(s={};e=De.exec(o);)s[e[1].toLowerCase()+" "]=(s[e[1].toLowerCase()+" "]||[]).concat(e[2]);e=s[t.toLowerCase()+" "]}return null==e?null:e.join(", ")},getAllResponseHeaders:function(){return u?o:null},setRequestHeader:function(t,e){return null==u&&(t=x[t.toLowerCase()]=x[t.toLowerCase()]||t,w[t]=e),this},overrideMimeType:function(t){return null==u&&(f.mimeType=t),this},statusCode:function(t){var e;if(t)if(u)O.always(t[O.status]);else for(e in t)b[e]=[b[e],t[e]];return this},abort:function(t){var e=t||N;return i&&i.abort(e),T(0,e),this}};if(g.promise(O),f.url=((t||f.url||Ne.href)+"").replace($e,Ne.protocol+"//"),f.type=e.method||e.type||f.method||f.type,f.dataTypes=(f.dataType||"*").toLowerCase().match(L)||[""],null==f.crossDomain){c=y.createElement("a");try{c.href=f.url,c.href=c.href,f.crossDomain=Re.protocol+"//"+Re.host!=c.protocol+"//"+c.host}catch(t){f.crossDomain=!0}}if(f.data&&f.processData&&"string"!=typeof f.data&&(f.data=_.param(f.data,f.traditional)),Ue(Me,f,e,O),u)return O;for(d in(l=_.event&&f.global)&&0==_.active++&&_.event.trigger("ajaxStart"),f.type=f.type.toUpperCase(),f.hasContent=!Ie.test(f.type),r=f.url.replace(Ae,""),f.hasContent?f.data&&f.processData&&0===(f.contentType||"").indexOf("application/x-www-form-urlencoded")&&(f.data=f.data.replace(Ee,"+")):(h=f.url.slice(r.length),f.data&&(f.processData||"string"==typeof f.data)&&(r+=(Oe.test(r)?"&":"?")+f.data,delete f.data),!1===f.cache&&(r=r.replace(Pe,"$1"),h=(Oe.test(r)?"&":"?")+"_="+_e.guid+++h),f.url=r+h),f.ifModified&&(_.lastModified[r]&&O.setRequestHeader("If-Modified-Since",_.lastModified[r]),_.etag[r]&&O.setRequestHeader("If-None-Match",_.etag[r])),(f.data&&f.hasContent&&!1!==f.contentType||e.contentType)&&O.setRequestHeader("Content-Type",f.contentType),O.setRequestHeader("Accept",f.dataTypes[0]&&f.accepts[f.dataTypes[0]]?f.accepts[f.dataTypes[0]]+("*"!==f.dataTypes[0]?", "+Be+"; q=0.01":""):f.accepts["*"]),f.headers)O.setRequestHeader(d,f.headers[d]);if(f.beforeSend&&(!1===f.beforeSend.call(p,O,f)||u))return O.abort();if(N="abort",v.add(f.complete),O.done(f.success),O.fail(f.error),i=Ue(Le,f,e,O)){if(O.readyState=1,l&&m.trigger("ajaxSend",[O,f]),u)return O;f.async&&f.timeout>0&&(a=n.setTimeout((function(){O.abort("timeout")}),f.timeout));try{u=!1,i.send(w,T)}catch(t){if(u)throw t;T(-1,t)}}else T(-1,"No Transport");function T(t,e,s,c){var d,h,y,w,x,N=e;u||(u=!0,a&&n.clearTimeout(a),i=void 0,o=c||"",O.readyState=t>0?4:0,d=t>=200&&t<300||304===t,s&&(w=function(t,e,n){for(var i,r,o,s,a=t.contents,c=t.dataTypes;"*"===c[0];)c.shift(),void 0===i&&(i=t.mimeType||e.getResponseHeader("Content-Type"));if(i)for(r in a)if(a[r]&&a[r].test(i)){c.unshift(r);break}if(c[0]in n)o=c[0];else{for(r in n){if(!c[0]||t.converters[r+" "+c[0]]){o=r;break}s||(s=r)}o=o||s}if(o)return o!==c[0]&&c.unshift(o),n[o]}(f,O,s)),!d&&_.inArray("script",f.dataTypes)>-1&&_.inArray("json",f.dataTypes)<0&&(f.converters["text script"]=function(){}),w=function(t,e,n,i){var r,o,s,a,c,u={},l=t.dataTypes.slice();if(l[1])for(s in t.converters)u[s.toLowerCase()]=t.converters[s];for(o=l.shift();o;)if(t.responseFields[o]&&(n[t.responseFields[o]]=e),!c&&i&&t.dataFilter&&(e=t.dataFilter(e,t.dataType)),c=o,o=l.shift())if("*"===o)o=c;else if("*"!==c&&c!==o){if(!(s=u[c+" "+o]||u["* "+o]))for(r in u)if((a=r.split(" "))[1]===o&&(s=u[c+" "+a[0]]||u["* "+a[0]])){!0===s?s=u[r]:!0!==u[r]&&(o=a[0],l.unshift(a[1]));break}if(!0!==s)if(s&&t.throws)e=s(e);else try{e=s(e)}catch(t){return{state:"parsererror",error:s?t:"No conversion from "+c+" to "+o}}}return{state:"success",data:e}}(f,w,O,d),d?(f.ifModified&&((x=O.getResponseHeader("Last-Modified"))&&(_.lastModified[r]=x),(x=O.getResponseHeader("etag"))&&(_.etag[r]=x)),204===t||"HEAD"===f.type?N="nocontent":304===t?N="notmodified":(N=w.state,h=w.data,d=!(y=w.error))):(y=N,!t&&N||(N="error",t<0&&(t=0))),O.status=t,O.statusText=(e||N)+"",d?g.resolveWith(p,[h,N,O]):g.rejectWith(p,[O,N,y]),O.statusCode(b),b=void 0,l&&m.trigger(d?"ajaxSuccess":"ajaxError",[O,f,d?h:y]),v.fireWith(p,[O,N]),l&&(m.trigger("ajaxComplete",[O,f]),--_.active||_.event.trigger("ajaxStop")))}return O},getJSON:function(t,e,n){return _.get(t,e,n,"json")},getScript:function(t,e){return _.get(t,void 0,e,"script")}}),_.each(["get","post"],(function(t,e){_[e]=function(t,n,i,r){return v(n)&&(r=r||i,i=n,n=void 0),_.ajax(_.extend({url:t,type:e,dataType:r,data:n,success:i},_.isPlainObject(t)&&t))}})),_.ajaxPrefilter((function(t){var e;for(e in t.headers)"content-type"===e.toLowerCase()&&(t.contentType=t.headers[e]||"")})),_._evalUrl=function(t,e,n){return _.ajax({url:t,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(t){_.globalEval(t,e,n)}})},_.fn.extend({wrapAll:function(t){var e;return this[0]&&(v(t)&&(t=t.call(this[0])),e=_(t,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&e.insertBefore(this[0]),e.map((function(){for(var t=this;t.firstElementChild;)t=t.firstElementChild;return t})).append(this)),this},wrapInner:function(t){return v(t)?this.each((function(e){_(this).wrapInner(t.call(this,e))})):this.each((function(){var e=_(this),n=e.contents();n.length?n.wrapAll(t):e.append(t)}))},wrap:function(t){var e=v(t);return this.each((function(n){_(this).wrapAll(e?t.call(this,n):t)}))},unwrap:function(t){return this.parent(t).not("body").each((function(){_(this).replaceWith(this.childNodes)})),this}}),_.expr.pseudos.hidden=function(t){return!_.expr.pseudos.visible(t)},_.expr.pseudos.visible=function(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)},_.ajaxSettings.xhr=function(){try{return new n.XMLHttpRequest}catch(t){}};var qe={0:200,1223:204},ze=_.ajaxSettings.xhr();g.cors=!!ze&&"withCredentials"in ze,g.ajax=ze=!!ze,_.ajaxTransport((function(t){var e,i;if(g.cors||ze&&!t.crossDomain)return{send:function(r,o){var s,a=t.xhr();if(a.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(s in t.xhrFields)a[s]=t.xhrFields[s];for(s in t.mimeType&&a.overrideMimeType&&a.overrideMimeType(t.mimeType),t.crossDomain||r["X-Requested-With"]||(r["X-Requested-With"]="XMLHttpRequest"),r)a.setRequestHeader(s,r[s]);e=function(t){return function(){e&&(e=i=a.onload=a.onerror=a.onabort=a.ontimeout=a.onreadystatechange=null,"abort"===t?a.abort():"error"===t?"number"!=typeof a.status?o(0,"error"):o(a.status,a.statusText):o(qe[a.status]||a.status,a.statusText,"text"!==(a.responseType||"text")||"string"!=typeof a.responseText?{binary:a.response}:{text:a.responseText},a.getAllResponseHeaders()))}},a.onload=e(),i=a.onerror=a.ontimeout=e("error"),void 0!==a.onabort?a.onabort=i:a.onreadystatechange=function(){4===a.readyState&&n.setTimeout((function(){e&&i()}))},e=e("abort");try{a.send(t.hasContent&&t.data||null)}catch(t){if(e)throw t}},abort:function(){e&&e()}}})),_.ajaxPrefilter((function(t){t.crossDomain&&(t.contents.script=!1)})),_.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(t){return _.globalEval(t),t}}}),_.ajaxPrefilter("script",(function(t){void 0===t.cache&&(t.cache=!1),t.crossDomain&&(t.type="GET")})),_.ajaxTransport("script",(function(t){var e,n;if(t.crossDomain||t.scriptAttrs)return{send:function(i,r){e=_("