{"version":3,"file":"main.B1hNSn.js","sources":["theme-2/virtual:theme","theme-2/discourse/components/custom-header-links.hbs","theme-2/discourse/components/custom-header-links.js","theme-2/discourse/initializers/discourse-custom-header-links.js","theme-2/virtual:entrypoint:main"],"sourcesContent":["import { getObjectForTheme } from \"discourse/lib/theme-settings-store\";\n\nexport const settings = getObjectForTheme(2);\n\nexport function themePrefix(key) {\n  return `theme_translations.2.${key}`;\n}\n","{{#if this.shouldShow}}\n  <ul\n    class=\"custom-header-links\n      {{if @outletArgs.topicInfoVisible 'custom-header-links--hide-links'}}\"\n  >\n    {{#each this.links as |link|}}\n      <li\n        class={{concat-class\n          \"headerLink\"\n          link.device\n          link.locale\n          link.linkClass\n          link.hideOnScroll\n        }}\n      >\n        <a\n          title={{link.anchorAttributes.title}}\n          href={{link.anchorAttributes.href}}\n          target={{link.anchorAttributes.target}}\n        >\n          {{link.linkText}}\n        </a>\n      </li>\n    {{/each}}\n  </ul>\n{{/if}}","import Component from \"@glimmer/component\";\nimport { dasherize } from \"@ember/string\";\n\nexport default class CustomHeaderLinks extends Component {\n  get shouldShow() {\n    return settings.custom_header_links?.length > 0;\n  }\n\n  get links() {\n    return settings.custom_header_links.reduce((result, link) => {\n      const linkText = link.text;\n      const linkTitle = link.title;\n      const linkHref = link.url;\n      const target = link.target;\n      const hideOnScroll = link.hide_on_scroll;\n      const locale = link.locale;\n      const device = link.view;\n\n      if (!linkText || (locale && document.documentElement.lang !== locale)) {\n        return result;\n      }\n\n      const linkClass = `${dasherize(linkText)}-custom-header-links`; // legacy name\n\n      const anchorAttributes = {\n        title: linkTitle,\n        href: linkHref,\n        target: target === \"self\" ? \"\" : \"_blank\",\n      };\n\n      result.push({\n        device: `headerLink--${device}`,\n        hideOnScroll: `headerLink--${hideOnScroll}`,\n        locale: locale ? `headerLink--${locale}` : null,\n        linkClass,\n        anchorAttributes,\n        linkText,\n      });\n\n      return result;\n    }, []);\n  }\n}\n","import { apiInitializer } from \"discourse/lib/api\";\nimport CustomHeaderLinks from \"../components/custom-header-links\";\n\nexport default apiInitializer(\"1.14.0\", (api) => {\n  api.renderInOutlet(\"before-header-panel\", CustomHeaderLinks);\n});\n","import * as Mod1 from \"./discourse/components/custom-header-links\";\nimport * as Mod2 from \"./discourse/initializers/discourse-custom-header-links\";\nconst compatModules = {\n  \"discourse/components/custom-header-links\": Mod1,\n  \"discourse/initializers/discourse-custom-header-links\": Mod2,\n};\nexport default compatModules;\n"],"names":["settings","getObjectForTheme","template","createTemplateFactory","id","block","moduleName","isStrictMode","deprecated","url","CustomHeaderLinks","Component","shouldShow","custom_header_links","length","links","reduce","result","link","linkText","text","linkTitle","title","linkHref","target","hideOnScroll","hide_on_scroll","locale","device","view","document","documentElement","lang","linkClass","dasherize","anchorAttributes","href","push","_setComponentTemplate","__COLOCATED_TEMPLATE__","discourseCustomHeaderLinks","apiInitializer","api","renderInOutlet","compatModules","Mod1"],"mappings":"wgBAEaA,EAAWC,EAAkB;ACA5B,IAAAC,EAAAC,EAAA,CAAAC,GAAA,KAAAC,MAAA,wxBAAAC,WAAA,uDAAAC,cAAA;AAGAC,EACE,yIACA,CACEJ,GAAI,0BACJK,IAAK;;ACNR,MAAMC,UAA0BC,EAC7C,cAAIC,GACF,OAAOZ,EAASa,qBAAqBC,OAAS,CAChD,CAEA,SAAIC,GACF,OAAOf,EAASa,oBAAoBG,OAAO,CAACC,EAAQC,KAClD,MAAMC,EAAWD,EAAKE,KAChBC,EAAYH,EAAKI,MACjBC,EAAWL,EAAKT,IAChBe,EAASN,EAAKM,OACdC,EAAeP,EAAKQ,eACpBC,EAAST,EAAKS,OACdC,EAASV,EAAKW;AAEpB,IAAKV,GAAaQ,GAAUG,SAASC,gBAAgBC,OAASL,EAC5D,OAAOV;AAGT,MAAMgB,EAAY,GAAGC,EAAUf,yBAEzBgB,EAAmB,CACvBb,MAAOD,EACPe,KAAMb,EACNC,OAAmB,SAAXA,EAAoB,GAAK;AAYnC,OATAP,EAAOoB,KAAK,CACVT,OAAQ,eAAeA,IACvBH,aAAc,eAAeA,IAC7BE,OAAQA,EAAS,eAAeA,IAAW,KAC3CM,YACAE,mBACAhB,aAGKF,GACN,GACL,EACFqB,EAAAC,EAvCqB7B;;;ACArB,IAAA8B;oCAAeC,CAAe,SAAWC,IACvCA,EAAIC,eAAe,sBAAuBjC;ACFvC,MAACkC,EAAgB,CACpB,2CAA4CC,EAC5C;"}