text: module.exports=function(t){var e={};function a(n){if(e[n])return e[n].exports;var s=e[n]={i:n,l:!1,exports:{}};return t[n].call(s.exports,s,s.exports,a),s.l=!0,s.exports}return a.m=t,a.c=e,a.d=function(t,e,n){a.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},a.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.t=function(t,e){if(1&e&&(t=a(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var s in t)a.d(n,s,function(e){return t[e]}.bind(null,s));return n},a.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return a.d(e,"a",e),e},a.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},a.p="",a(a.s=22)}([function(t,e){t.exports=flarum.core.compat.app},,,,function(t,e){t.exports=flarum.core.compat["utils/isExtensionEnabled"]},,function(t,e){t.exports=flarum.core.compat["components/Switch"]},function(t,e){t.exports=flarum.core.compat["common/components/Alert"]},,,,,,,,,,function(t,e){t.exports=flarum.core.compat["common/components/ExtensionPage"]},function(t,e){t.exports=flarum.core.compat["components/Button"]},function(t,e){t.exports=flarum.core.compat["utils/saveSettings"]},function(t,e){t.exports=flarum.core.compat["helpers/icon"]},,function(t,e,a){"use strict";function n(t,e){return(n=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}a.r(e);var s=a(17),o=a.n(s),r=a(0),i=a.n(r),l=a(6),u=a.n(l),c=a(18),d=a.n(c),f=a(19),p=a.n(f),g=a(4),h=a.n(g),b=a(20),y=a.n(b),v=a(7),_=a.n(v),x=function(t){var e,a;function s(){return t.apply(this,arguments)||this}a=t,(e=s).prototype=Object.create(a.prototype),e.prototype.constructor=e,n(e,a);var o=s.prototype;return o.oninit=function(e){var a=this;t.prototype.oninit.call(this,e),this.settings=JSON.parse(i.a.data.settings["block-cat.default_settings"]),this.routes=JSON.parse(i.a.data.settings["block-cat.default_routes"]),this.loading=!1,this.modified=!1,this.settingStates={hideMainPageMenu:0,hideToolBar:0,hideDiscussionMenu:0},this.sameValue={},Object.keys(this.settings).map((function(t){"mainPageMenu"===t&&(a.settingStates.hideMainPageMenu=a.settings[t]),"toolbar"===t&&(a.settingStates.hideToolBar=a.settings[t]),"discussionMenu"===t&&(a.settingStates.hideDiscussionMenu=a.settings[t])}))},o.content=function(){var t=this,e=i.a.translator.trans("core.admin.basics.all_discussions_label");return m(".ExtensionPage-settings",[m(".container",[m("Form",{onsubmit:this.onsubmit.bind(this)},[m(".SettingsGroup",[m(".Settings",[m("label",i.a.translator.trans("block-cat-default.admin.settings.title")),this.settingStates.hideMainPageMenu?"":m(".Form-group",[m("label",i.a.translator.trans("block-cat-default.admin.settings.icon")),m(".helpText",i.a.translator.trans("block-cat-default.admin.settings.icon_help_text",{text:e})),m(".inline",""!==this.settings.allDiscussionsIcon?y()(this.settings.allDiscussionsIcon):"",""!==this.settings.allDiscussionsIcon?m("span",i.a.translator.trans("core.admin.basics.all_discussions_label")):"",m("input.FormControl",{type:"text",placeholder:"far fa-comments",value:this.settings.allDiscussionsIcon,oninput:function(e){t.settings.allDiscussionsIcon=e.target.value,t.modified=!0}}))]),Object.keys(this.settings).map((function(e){if("allDiscussionsIcon"!==e)return"refreshButton"===e||"markAllAsReadButton"===e?[t.settingStates.hideToolBar?"":m(".Form-group",[u.a.component({state:t.settings[e]||!1,onchange:function(){t.settings[e]^=!0,t.modified=!0}},m("li",i.a.translator.trans("block-cat-default.admin.settings."+e))),m(".helpText",i.a.translator.trans("block-cat-default.admin.settings."+e+"_help_text"))])]:"controlsButton"===e||"scrubberDiv"===e?[t.settingStates.hideDiscussionMenu?"":m(".Form-group",[u.a.component({state:t.settings[e]||!1,onchange:function(){t.settings[e]^=!0,t.modified=!0}},m("li",i.a.translator.trans("block-cat-default.admin.settings."+e))),m(".helpText",i.a.translator.trans("block-cat-default.admin.settings."+e+"_help_text"))])]:[m(".Form-group",[u.a.component({state:t.settings[e]||!1,onchange:function(){t.settings[e]^=!0,t.modified=!0,"mainPageMenu"===e&&(t.settingStates.hideMainPageMenu^=!0),"toolbar"===e&&(t.settingStates.hideToolBar^=!0),"discussionMenu"===e&&(t.settingStates.hideDiscussionMenu^=!0)}},m("li",i.a.translator.trans("block-cat-default.admin.settings."+e))),m(".helpText",i.a.translator.trans("block-cat-default.admin.settings."+e+"_help_text"))])]}))]),m(".Routes",[m("label",i.a.translator.trans("block-cat-default.admin.routes.title")),Object.keys(this.routes).map((function(e){if(("flags"!==e||h()("flarum-flags"))&&("following"!==e||h()("flarum-subscriptions"))&&("tag"!==e&&"tags"!==e||h()("flarum-tags"))&&("user.mentions"!==e||h()("flarum-mentions"))&&("user.uploads"!==e||h()("fof-upload")))return m(".Form-group",[m("label",i.a.translator.trans("block-cat-default.admin.routes.route_label",{route:e})),m(".helpText",i.a.translator.trans("block-cat-default.admin.routes."+e)),m(".Default-Routes-Field",{className:t.routes[e].path?"Default-Routes-Field--with-value":"",title:e},[m(".Default-Routes-Field-Wrap",[m("input.FormControl.Default-Routes-Input",{type:"text",value:t.routes[e].path,pattern:t.routes[e].regex,oninput:function(a){""!==a.target.value?null!==a.target.value.match(a.target.pattern)?a.target.style.borderColor="green":a.target.style.borderColor="red":$(a.target).removeAttr("style"),t.routes[e].path=a.target.value,t.modified=!0},onfocusout:function(t){$(t.target).removeAttr("style")},onfocus:function(t){""!==t.target.value&&(null!==t.target.value.match(t.target.pattern)?t.target.style.borderColor="green":t.target.style.borderColor="red")}}),m(".Default-Routes-Placeholder",[m("span.Default-Routes-Placeholder-Hint",i.a.translator.trans("block-cat-default.admin.routes.hint"))," ",m("span",t.routes[e].placeholder)])])])])}))])]),d.a.component({type:"submit",className:"Button Button--primary",loading:this.loading,disabled:!this.modified},i.a.translator.trans("core.admin.edit_header.submit_button"))])])])},o.onsubmit=function(t){var e=this;t.preventDefault(),this.loading=!0;var a=0;if(Object.keys(this.routes).map((function(t){Object.keys(e.routes).map((function(n){""!==e.routes[t].path&&t!==n&&e.routes[t].path===e.routes[n].path&&($('.Default-Routes-Field[title="'+t+'"] > div > input').css("border-color","red"),a++)}))})),a>0)return i.a.alerts.show(_.a,{type:"error"},i.a.translator.trans("block-cat-default.admin.routes.same_value")),this.loading=!1,void(this.modified=!1);try{var n;p()(((n={})["block-cat.default_settings"]=JSON.stringify(this.settings),n["block-cat.default_routes"]=JSON.stringify(this.routes),n)),i.a.alerts.show(_.a,{type:"success"},i.a.translator.trans("core.admin.settings.saved_message"))}catch(t){i.a.alerts.show(_.a,{type:"error"},i.a.translator.trans("core.lib.error.generic_message"))}finally{this.settings=JSON.parse(i.a.data.settings["block-cat.default_settings"]),this.routes=JSON.parse(i.a.data.settings["block-cat.default_routes"]),this.loading=!1,this.modified=!1}},s}(o.a);app.initializers.add("block-cat/default",(function(){app.extensionData.for("block-cat-default").registerPage(x)}))}]);
  //# sourceMappingURL=admin.js.map