{"version":3,"file":"waze-bot-authors.js","names":["define","_exports","_object","_component","_getUrl","Object","defineProperty","value","default","WazeBotAuthorsSettings","category","this","args","outletArgs","static","dt7948","n","prototype","computed","parentCategory","botUserId","custom_fields","waze_bot_author_id","parentCategoryBotUserId","parentCategoryHasBot","waze_enable_bot_author","shouldShowBotLink","botUserAdminPageUrl","defaultCategoryWazeBotType","wazeBotCategoryTypeSelection","waze_bot_category_type","toString","_templateFactory","createTemplateFactory","id","block","moduleName","isStrictMode"],"sources":["discourse/plugins/waze-bot-authors/discourse/connectors/category-custom-settings/waze-bot-authors-settings.js","discourse/plugins/waze-bot-authors/discourse/placeholder.js","discourse/plugins/waze-bot-authors/discourse/templates/connectors/category-custom-settings/waze-bot-authors-settings.js"],"sourcesContent":["define(\"discourse/plugins/waze-bot-authors/discourse/connectors/category-custom-settings/waze-bot-authors-settings\", [\"exports\", \"@ember/object\", \"@glimmer/component\", \"discourse-common/lib/get-url\"], function (_exports, _object, _component, _getUrl) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  class WazeBotAuthorsSettings extends _component.default {\n    get category() {\n      return this.args.outletArgs.category;\n    }\n    static #_ = (() => dt7948.n(this.prototype, \"category\", [(0, _object.computed)(\"args.outletArgs.category\")]))();\n    get parentCategory() {\n      return this.category.parentCategory;\n    }\n    static #_2 = (() => dt7948.n(this.prototype, \"parentCategory\", [(0, _object.computed)(\"category\", \"category.parent_category_id\")]))();\n    get botUserId() {\n      return this.category.custom_fields.waze_bot_author_id;\n    }\n    static #_3 = (() => dt7948.n(this.prototype, \"botUserId\", [(0, _object.computed)(\"category.custom_fields.waze_bot_author_id\")]))();\n    get parentCategoryBotUserId() {\n      if (this.parentCategory != null) {\n        return this.parentCategory.custom_fields.waze_bot_author_id;\n      }\n      return undefined;\n    }\n    static #_4 = (() => dt7948.n(this.prototype, \"parentCategoryBotUserId\", [(0, _object.computed)(\"parentCategory\")]))();\n    get parentCategoryHasBot() {\n      return this.parentCategoryBotUserId != null && this.parentCategory.custom_fields.waze_enable_bot_author;\n    }\n    static #_5 = (() => dt7948.n(this.prototype, \"parentCategoryHasBot\", [(0, _object.computed)(\"parentCategoryBotUserId\")]))();\n    get shouldShowBotLink() {\n      return this.category.custom_fields.waze_enable_bot_author && this.botUserId != null;\n    }\n    static #_6 = (() => dt7948.n(this.prototype, \"shouldShowBotLink\", [(0, _object.computed)(\"category.custom_fields.waze_enable_bot_author\", \"botUserId\")]))();\n    get botUserAdminPageUrl() {\n      return `${(0, _getUrl.default)()}/admin/users/${this.botUserId}/_`;\n    }\n    static #_7 = (() => dt7948.n(this.prototype, \"botUserAdminPageUrl\", [(0, _object.computed)(\"botUserId\")]))();\n    get defaultCategoryWazeBotType() {\n      if (this.parentCategoryHasBot) {\n        return \"1\";\n      }\n      return \"2\";\n    }\n    get wazeBotCategoryTypeSelection() {\n      if (this.category.custom_fields.waze_bot_category_type != null) {\n        return this.category.custom_fields.waze_bot_category_type.toString();\n      }\n      return this.defaultCategoryWazeBotType;\n    }\n    static #_8 = (() => dt7948.n(this.prototype, \"wazeBotCategoryTypeSelection\", [(0, _object.computed)(\"category.custom_fields.waze_enable_bot_author\", \"category.custom_fields.waze_bot_category_type\")]))();\n  }\n  _exports.default = WazeBotAuthorsSettings;\n});","define(\"discourse/plugins/waze-bot-authors/discourse/placeholder\", [], function () {\n  \"use strict\";\n\n  var __webpack_exports__ = {};\n  // This file is a placeholder\n});","define(\"discourse/plugins/waze-bot-authors/discourse/templates/connectors/category-custom-settings/waze-bot-authors-settings\", [\"exports\", \"@ember/template-factory\"], function (_exports, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _default = _exports.default = (0, _templateFactory.createTemplateFactory)(\n  /*\n    {{#if @outletArgs.category.all_topics_wiki}}\n    <h3>Waze Bot Authors</h3>\n    <section class=\"field\">\n      <div class=\"controls\">\n        <label class=\"checkbox-label\">\n          <Input\n            @type=\"checkbox\"\n            @checked={{this.category.custom_fields.waze_enable_bot_author}}\n          />\n          Enable bot author for this category?\n        </label>\n        <b>This will cause every new topic created by any user to automatically\n          switch authorship to a bot user.</b>\n        {{#if @outletArgs.category.custom_fields.waze_enable_bot_author}}\n          <div class=\"radios\">\n            <label class=\"radio-label\" for=\"waze-bot-type-parent\">\n              <RadioButton\n                @name=\"waze-bot-type-parent\"\n                @id=\"waze-bot-type-parent\"\n                @value=\"1\"\n                @selection={{this.wazeBotCategoryTypeSelection}}\n                @onChange={{action\n                  (mut this.category.custom_fields.waze_bot_category_type)\n                }}\n                @disabled={{not this.parentCategoryHasBot}}\n              />\n              Parent category bot - reuse the same bot category as the parent.\n            </label>\n  \n            <label class=\"radio-label\" for=\"waze-bot-type-local\">\n              <RadioButton\n                @name=\"waze-bot-type-local\"\n                @id=\"waze-bot-type-local\"\n                @value=\"2\"\n                @selection={{this.wazeBotCategoryTypeSelection}}\n                @onChange={{action\n                  (mut this.category.custom_fields.waze_bot_category_type)\n                }}\n              />\n              Local category bot - create a bot for this category.\n            </label>\n          </div>\n        {{/if}}\n        {{#if this.shouldShowBotLink}}\n          <br />\n          <a href=\"{{this.botUserAdminPageUrl}}\" class=\"\">Link to bot author admin\n            page</a>\n        {{/if}}\n      </div>\n    </section>\n  {{/if}}\n  */\n  {\n    \"id\": \"hI0rh05Z\",\n    \"block\": \"[[[41,[30,1,[\\\"category\\\",\\\"all_topics_wiki\\\"]],[[[1,\\\"  \\\"],[10,\\\"h3\\\"],[12],[1,\\\"Waze Bot Authors\\\"],[13],[1,\\\"\\\\n  \\\"],[10,\\\"section\\\"],[14,0,\\\"field\\\"],[12],[1,\\\"\\\\n    \\\"],[10,0],[14,0,\\\"controls\\\"],[12],[1,\\\"\\\\n      \\\"],[10,\\\"label\\\"],[14,0,\\\"checkbox-label\\\"],[12],[1,\\\"\\\\n        \\\"],[8,[39,5],null,[[\\\"@type\\\",\\\"@checked\\\"],[\\\"checkbox\\\",[30,0,[\\\"category\\\",\\\"custom_fields\\\",\\\"waze_enable_bot_author\\\"]]]],null],[1,\\\"\\\\n        Enable bot author for this category?\\\\n      \\\"],[13],[1,\\\"\\\\n      \\\"],[10,\\\"b\\\"],[12],[1,\\\"This will cause every new topic created by any user to automatically\\\\n        switch authorship to a bot user.\\\"],[13],[1,\\\"\\\\n\\\"],[41,[30,1,[\\\"category\\\",\\\"custom_fields\\\",\\\"waze_enable_bot_author\\\"]],[[[1,\\\"        \\\"],[10,0],[14,0,\\\"radios\\\"],[12],[1,\\\"\\\\n          \\\"],[10,\\\"label\\\"],[14,0,\\\"radio-label\\\"],[14,\\\"for\\\",\\\"waze-bot-type-parent\\\"],[12],[1,\\\"\\\\n            \\\"],[8,[39,7],null,[[\\\"@name\\\",\\\"@id\\\",\\\"@value\\\",\\\"@selection\\\",\\\"@onChange\\\",\\\"@disabled\\\"],[\\\"waze-bot-type-parent\\\",\\\"waze-bot-type-parent\\\",\\\"1\\\",[30,0,[\\\"wazeBotCategoryTypeSelection\\\"]],[28,[37,8],[[30,0],[28,[37,9],[[30,0,[\\\"category\\\",\\\"custom_fields\\\",\\\"waze_bot_category_type\\\"]]],null]],null],[28,[37,10],[[30,0,[\\\"parentCategoryHasBot\\\"]]],null]]],null],[1,\\\"\\\\n            Parent category bot - reuse the same bot category as the parent.\\\\n          \\\"],[13],[1,\\\"\\\\n\\\\n          \\\"],[10,\\\"label\\\"],[14,0,\\\"radio-label\\\"],[14,\\\"for\\\",\\\"waze-bot-type-local\\\"],[12],[1,\\\"\\\\n            \\\"],[8,[39,7],null,[[\\\"@name\\\",\\\"@id\\\",\\\"@value\\\",\\\"@selection\\\",\\\"@onChange\\\"],[\\\"waze-bot-type-local\\\",\\\"waze-bot-type-local\\\",\\\"2\\\",[30,0,[\\\"wazeBotCategoryTypeSelection\\\"]],[28,[37,8],[[30,0],[28,[37,9],[[30,0,[\\\"category\\\",\\\"custom_fields\\\",\\\"waze_bot_category_type\\\"]]],null]],null]]],null],[1,\\\"\\\\n            Local category bot - create a bot for this category.\\\\n          \\\"],[13],[1,\\\"\\\\n        \\\"],[13],[1,\\\"\\\\n\\\"]],[]],null],[41,[30,0,[\\\"shouldShowBotLink\\\"]],[[[1,\\\"        \\\"],[10,\\\"br\\\"],[12],[13],[1,\\\"\\\\n        \\\"],[10,3],[15,6,[29,[[30,0,[\\\"botUserAdminPageUrl\\\"]]]]],[14,0,\\\"\\\"],[12],[1,\\\"Link to bot author admin\\\\n          page\\\"],[13],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"    \\\"],[13],[1,\\\"\\\\n  \\\"],[13],[1,\\\"\\\\n\\\"]],[]],null]],[\\\"@outletArgs\\\"],false,[\\\"if\\\",\\\"h3\\\",\\\"section\\\",\\\"div\\\",\\\"label\\\",\\\"input\\\",\\\"b\\\",\\\"radio-button\\\",\\\"action\\\",\\\"mut\\\",\\\"not\\\",\\\"br\\\",\\\"a\\\"]]\",\n    \"moduleName\": \"discourse/plugins/waze-bot-authors/discourse/templates/connectors/category-custom-settings/waze-bot-authors-settings.hbs\",\n    \"isStrictMode\": false\n  });\n});"],"mappings":"AAAAA,OAAA,uMAAAC,EAAAC,EAAAC,EAAAC,GACA;AAEAC,OAAAC,eAAAL,EAAA,cACAM,OAAA,IAEAN,EAAAO,aAAA;AACA,MAAAC,UAAAN,EAAAK,QACA,YAAAE,GACA,OAAAC,KAAAC,KAAAC,WAAAH,QACA,CACAI,SAAA,KAAAC,OAAAC,EAAAL,KAAAM,UAAA,eAAAf,EAAAgB,UAAA;AACA,kBAAAC,GACA,OAAAR,KAAAD,SAAAS,cACA,CACAL,SAAA,KAAAC,OAAAC,EAAAL,KAAAM,UAAA,qBAAAf,EAAAgB,UAAA;AACA,aAAAE,GACA,OAAAT,KAAAD,SAAAW,cAAAC,kBACA,CACAR,SAAA,KAAAC,OAAAC,EAAAL,KAAAM,UAAA,gBAAAf,EAAAgB,UAAA;AACA,2BAAAK,GACA,SAAAZ,KAAA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