(function(){if('Discourse'in window&&Discourse.__container__){Discourse.__container__.lookup("service:theme-settings").registerSettings(29,{"categories_layout":"categories_boxes"});}})();define("discourse/initializers/category-layout-override",["exports","@ember/string","discourse/lib/plugin-api","discourse/models/category-list","discourse-common/utils/decorators"],function(_exports,_string,_pluginApi,_categoryList,_decorators){"use strict";Object.defineProperty(_exports,"__esModule",{value:true});_exports.default=void 0;function _applyDecoratedDescriptor(target,property,decorators,descriptor,context){var desc={};Object.keys(descriptor).forEach(function(key){desc[key]=descriptor[key];});desc.enumerable=!!desc.enumerable;desc.configurable=!!desc.configurable;if('value'in desc||desc.initializer){desc.writable=true;}desc=decorators.slice().reverse().reduce(function(desc,decorator){return decorator(target,property,desc)||desc;},desc);if(context&&desc.initializer!==void 0){desc.value=desc.initializer?desc.initializer.call(context):void 0;desc.initializer=undefined;}if(desc.initializer===void 0){Object.defineProperty(target,property,desc);desc=null;}return desc;}
var __theme_name__="Categories Layout Override";var settings=Discourse.__container__.lookup("service:theme-settings").getObjectForTheme(29);var themePrefix=function themePrefix(key){return "theme_translations.29.".concat(key);};var _default={name:"category-layout-override",initialize:function initialize(){(0,_pluginApi.withPluginApi)("0.8",function(api){var _dec,_obj;api.modifyClass("controller:discovery/categories",(_dec=(0,_decorators.default)("model.parentCategory"),(_obj={categoryPageStyle:function categoryPageStyle(parentCategory){var value=this._super();if(!this.site.mobileView&&!parentCategory){return(0,_string.dasherize)(settings.categories_layout);}
return value;}},(_applyDecoratedDescriptor(_obj,"categoryPageStyle",[_dec],Object.getOwnPropertyDescriptor(_obj,"categoryPageStyle"),_obj)),_obj)));api.modifyClass("route:discovery.categories",{findCategories:function findCategories(){var style=!this.site.mobileView&&settings.categories_layout;var parentCategory=this.get("model.parentCategory");if(parentCategory){return _categoryList.default.listForParent(this.store,parentCategory);}else if(style==="categories_and_latest_topics"){return this._findCategoriesAndTopics("latest");}else if(style==="categories_and_top_topics"){return this._findCategoriesAndTopics("top");}
return _categoryList.default.list(this.store);}});});}};_exports.default=_default;});