{"version":3,"names":["define","_exports","_component","_controller","_helper","_modifier","_object","_service","_dIcon","_i18n","_dropdownSelectBox","_openComposer","_component2","_templateFactory","Object","defineProperty","value","default","HeaderBreadcrumbs","_","dt7948","g","prototype","service","site","i","_2","siteSettings","_3","topicTrackingState","_4","router","_5","inject","topic","category","model","categories","filterCategory1","currentRouteName","startsWith","get","parentCategory","homepageLink","filter1","homepageTitle","global_filters","find","f1","name","globalFilter","alternate_name","replace","applicationSelectors","map","id","description","icon","onChange","selectedAction1","openComposer","selectedAction","categoryId","hasFormTemplate","_6","n","action","onFilterDropdownChange","filterId1","routeToGlobalFilter","_7","e1","arguments","length","undefined","preventDefault","url1","window","location","href","_8","_9","setComponentTemplate","createTemplateFactory","scope","on","hash"],"sources":["theme-157-inline-common-header.js"],"sourcesContent":["\ndefine(\"discourse/plugins/discourse-epic-games/discourse/components/header-breadcrumbs\", [\"exports\", \"@glimmer/component\", \"@ember/controller\", \"@ember/helper\", \"@ember/modifier\", \"@ember/object\", \"@ember/service\", \"discourse-common/helpers/d-icon\", \"discourse-common/helpers/i18n\", \"select-kit/components/dropdown-select-box\", \"discourse/plugins/discourse-epic-games/discourse/lib/open-composer\", \"@ember/component\", \"@ember/template-factory\"], function (_exports, _component, _controller, _helper, _modifier, _object, _service, _dIcon, _i18n, _dropdownSelectBox, _openComposer, _component2, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  class HeaderBreadcrumbs extends _component.default {\n    static #_ = (() => dt7948.g(this.prototype, \"site\", [_service.service]))();\n    #site = (() => (dt7948.i(this, \"site\"), void 0))();\n    static #_2 = (() => dt7948.g(this.prototype, \"siteSettings\", [_service.service]))();\n    #siteSettings = (() => (dt7948.i(this, \"siteSettings\"), void 0))();\n    static #_3 = (() => dt7948.g(this.prototype, \"topicTrackingState\", [_service.service]))();\n    #topicTrackingState = (() => (dt7948.i(this, \"topicTrackingState\"), void 0))();\n    static #_4 = (() => dt7948.g(this.prototype, \"router\", [_service.service]))();\n    #router = (() => (dt7948.i(this, \"router\"), void 0))();\n    static #_5 = (() => dt7948.g(this.prototype, \"topic\", [_controller.inject]))();\n    #topic = (() => (dt7948.i(this, \"topic\"), void 0))();\n    get category() {\n      return this.topic.model?.category;\n    }\n    get categories() {\n      let filterCategory1;\n      if (this.router.currentRouteName.startsWith(\"topic.\")) {\n        filterCategory1 = this.category;\n      } else {\n        filterCategory1 = this.topicTrackingState.get(\"filterCategory\");\n      }\n      if (filterCategory1?.parentCategory) {\n        return [filterCategory1.parentCategory, filterCategory1];\n      } else if (filterCategory1) {\n        return [filterCategory1];\n      } else {\n        return null;\n      }\n    }\n    get homepageLink() {\n      const filter1 = this.site.get(\"globalFilter\");\n      if (filter1) {\n        return `/?tag=${filter1}`;\n      }\n      return \"/\";\n    }\n    get homepageTitle() {\n      const filter1 = this.site.global_filters?.find(f1 => f1.name === this.site.globalFilter);\n      return filter1 ? filter1.alternate_name || filter1.name.replace(/-/g, \" \") : \"\";\n    }\n    get applicationSelectors() {\n      return (this.site.global_filters || []).map(filter1 => ({\n        id: filter1.id,\n        name: (filter1.alternate_name || filter1.name).replace(/-/g, \" \"),\n        description: filter1.description,\n        icon: `gf-${filter1.name}`\n      }));\n    }\n    onChange(selectedAction1) {\n      (0, _openComposer.openComposer)({\n        selectedAction: selectedAction1,\n        categoryId: this.category?.id,\n        hasFormTemplate: this.hasFormTemplate\n      });\n    }\n    static #_6 = (() => dt7948.n(this.prototype, \"onChange\", [_object.action]))();\n    onFilterDropdownChange(filterId1) {\n      const filter1 = this.site.global_filters.find(f1 => f1.id === filterId1).name;\n      this.routeToGlobalFilter(null, filter1);\n    }\n    static #_7 = (() => dt7948.n(this.prototype, \"onFilterDropdownChange\", [_object.action]))();\n    routeToGlobalFilter(e1) {\n      let filter1 = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.site.globalFilter;\n      e1?.preventDefault();\n      const url1 = `/categories?tag=${filter1}`;\n      // this is a hack to ensure that the global filter is fully updated\n      // we do the same in the global filter plugin when changing the filter\n      window.location.href = url1;\n    }\n    static #_8 = (() => dt7948.n(this.prototype, \"routeToGlobalFilter\", [_object.action]))();\n    static #_9 = (() => (0, _component2.setComponentTemplate)((0, _templateFactory.createTemplateFactory)(\n    /*\n      \n        <div class=\"wrap\">\n          <ul class=\"unreal-header\">\n            <li class=\"unreal-header__title\">\n              <a href={{this.siteSettings.epic_developer_url}}>\n                {{icon \"ue-home\"}}\n                {{i18n \"discourse_epic_games.breadcrumbs_header.developer\"}}\n              </a>\n            </li>\n    \n            {{#unless this.site.mobileView}}\n              <a\n                href\n                {{on \"click\" this.routeToGlobalFilter}}\n                class=\"unreal-header__category\"\n              >\n                {{i18n \"discourse_epic_games.breadcrumbs_header.title\"}}\n              </a>\n            {{/unless}}\n    \n            <li class=\"unreal-header__category\">\n              <a href {{on \"click\" this.routeToGlobalFilter}}>\n                {{this.homepageTitle}}\n              </a>\n              <DropdownSelectBox\n                @content={{this.applicationSelectors}}\n                @options={{hash\n                  careDownIcon=\"ue-caret-down\"\n                  caretUpIcon=\"ue-caret-up\"\n                  showCaret=true\n                }}\n                @id=\"breadcrumb-global-filter-picker\"\n                @onChange={{this.onFilterDropdownChange}}\n              />\n            </li>\n    \n            {{#if this.site.desktopView}}\n              {{#each this.categories as |category|}}\n                <li class=\"unreal-header__category\">\n                  <a href={{category.url}}>{{category.name}}</a>\n                </li>\n              {{/each}}\n            {{/if}}\n          </ul>\n        </div>\n      \n    */\n    {\n      \"id\": \"+n5u8Z5/\",\n      \"block\": \"[[[1,\\\"\\\\n    \\\"],[10,0],[14,0,\\\"wrap\\\"],[12],[1,\\\"\\\\n      \\\"],[10,\\\"ul\\\"],[14,0,\\\"unreal-header\\\"],[12],[1,\\\"\\\\n        \\\"],[10,\\\"li\\\"],[14,0,\\\"unreal-header__title\\\"],[12],[1,\\\"\\\\n          \\\"],[10,3],[15,6,[30,0,[\\\"siteSettings\\\",\\\"epic_developer_url\\\"]]],[12],[1,\\\"\\\\n            \\\"],[1,[28,[32,0],[\\\"ue-home\\\"],null]],[1,\\\"\\\\n            \\\"],[1,[28,[32,1],[\\\"discourse_epic_games.breadcrumbs_header.developer\\\"],null]],[1,\\\"\\\\n          \\\"],[13],[1,\\\"\\\\n        \\\"],[13],[1,\\\"\\\\n\\\\n\\\"],[41,[51,[30,0,[\\\"site\\\",\\\"mobileView\\\"]]],[[[1,\\\"          \\\"],[11,3],[24,6,\\\"\\\"],[24,0,\\\"unreal-header__category\\\"],[4,[32,2],[\\\"click\\\",[30,0,[\\\"routeToGlobalFilter\\\"]]],null],[12],[1,\\\"\\\\n            \\\"],[1,[28,[32,1],[\\\"discourse_epic_games.breadcrumbs_header.title\\\"],null]],[1,\\\"\\\\n          \\\"],[13],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"\\\\n        \\\"],[10,\\\"li\\\"],[14,0,\\\"unreal-header__category\\\"],[12],[1,\\\"\\\\n          \\\"],[11,3],[24,6,\\\"\\\"],[4,[32,2],[\\\"click\\\",[30,0,[\\\"routeToGlobalFilter\\\"]]],null],[12],[1,\\\"\\\\n            \\\"],[1,[30,0,[\\\"homepageTitle\\\"]]],[1,\\\"\\\\n          \\\"],[13],[1,\\\"\\\\n          \\\"],[8,[32,3],null,[[\\\"@content\\\",\\\"@options\\\",\\\"@id\\\",\\\"@onChange\\\"],[[30,0,[\\\"applicationSelectors\\\"]],[28,[32,4],null,[[\\\"careDownIcon\\\",\\\"caretUpIcon\\\",\\\"showCaret\\\"],[\\\"ue-caret-down\\\",\\\"ue-caret-up\\\",true]]],\\\"breadcrumb-global-filter-picker\\\",[30,0,[\\\"onFilterDropdownChange\\\"]]]],null],[1,\\\"\\\\n        \\\"],[13],[1,\\\"\\\\n\\\\n\\\"],[41,[30,0,[\\\"site\\\",\\\"desktopView\\\"]],[[[42,[28,[31,3],[[28,[31,3],[[30,0,[\\\"categories\\\"]]],null]],null],null,[[[1,\\\"            \\\"],[10,\\\"li\\\"],[14,0,\\\"unreal-header__category\\\"],[12],[1,\\\"\\\\n              \\\"],[10,3],[15,6,[30,1,[\\\"url\\\"]]],[12],[1,[30,1,[\\\"name\\\"]]],[13],[1,\\\"\\\\n            \\\"],[13],[1,\\\"\\\\n\\\"]],[1]],null]],[]],null],[1,\\\"      \\\"],[13],[1,\\\"\\\\n    \\\"],[13],[1,\\\"\\\\n  \\\"]],[\\\"category\\\"],false,[\\\"unless\\\",\\\"if\\\",\\\"each\\\",\\\"-track-array\\\"]]\",\n      \"moduleName\": \"/var/www/discourse/app/assets/javascripts/discourse/discourse/plugins/discourse-epic-games/discourse/components/header-breadcrumbs.js\",\n      \"scope\": () => [_dIcon.default, _i18n.default, _modifier.on, _dropdownSelectBox.default, _helper.hash],\n      \"isStrictMode\": true\n    }), this))();\n  }\n  _exports.default = HeaderBreadcrumbs;\n});\n"],"mappings":"AACAA,MAAM,CAAC,gFAAgF,EAAE,CAAC,SAAS,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,eAAe,EAAE,iBAAiB,EAAE,eAAe,EAAE,gBAAgB,EAAE,iCAAiC,EAAE,+BAA+B,EAAE,2CAA2C,EAAE,oEAAoE,EAAE,kBAAkB,EAAE,yBAAyB,CAAC,EAAE,UAAUC,QAAQ,EAAEC,UAAU,EAAEC,WAAW,EAAEC,OAAO,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,EAAEC,MAAM,EAAEC,KAAK,EAAEC,kBAAkB,EAAEC,aAAa,EAAEC,WAAW,EAAEC,gBAAgB,EAAE;EACjmB,YAAY;;EAEZC,MAAM,CAACC,cAAc,CAACd,QAAQ,EAAE,YAAY,EAAE;IAC5Ce,KAAK,EAAE;EACT,CAAC,CAAC;EACFf,QAAQ,CAACgB,OAAO,GAAG,KAAK,CAAC;EACzB,MAAMC,iBAAiB,SAAShB,UAAU,CAACe,OAAO,CAAC;IACjD,OAAO,CAACE,CAAC,GAAG,CAAC,MAAMC,MAAM,CAACC,CAAC,CAAC,IAA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