{"version":3,"file":"virtual_main.js","sources":["theme-4/virtual:init-settings","theme-4/virtual:theme","theme-4/discourse/initializers/theme-field-161-common-html-script-1.js","theme-4/virtual:main"],"sourcesContent":["import { registerSettings } from \"discourse/lib/theme-settings-store\";\n\nregisterSettings(4, {});\n","import { getObjectForTheme } from \"discourse/lib/theme-settings-store\";\n\nexport const settings = getObjectForTheme(4);\n\nexport function themePrefix(key) {\n  return `theme_translations.4.${key}`;\n}\n","import { withPluginApi } from \"discourse/lib/plugin-api\";\nimport deprecated from \"discourse/lib/deprecated\";\n\nexport default {\n  name: \"theme-field-161-common-html-script-1\",\n  after: \"inject-objects\",\n\n  initialize() {\n    deprecated(\n      \"Adding JS code using <script type='text/discourse-plugin'> is deprecated. Move this code to a dedicated JavaScript file.\",\n      {\n        id: \"discourse.script-tag-discourse-plugin\",\n        url: \"https://meta.discourse.org/t/366482\",\n      }\n    )\n    withPluginApi(\"0.1\", (api) => {\n      \n  // Add FAQPage schema to FAQ category pages\n  api.onPageChange((url) => {\n    const existingFaqSchema = document.getElementById('faq-schema-ld');\n    if (existingFaqSchema) existingFaqSchema.remove();\n\n    if (!url.includes('/c/faq')) return;\n\n    const topics = document.querySelectorAll('.topic-list-item');\n    if (!topics.length) return;\n\n    const faqItems = [];\n    topics.forEach(topic => {\n      const titleEl = topic.querySelector('.title');\n      const excerptEl = topic.querySelector('.excerpt') || topic.querySelector('.topic-excerpt');\n      if (titleEl) {\n        faqItems.push({\n          \"@type\": \"Question\",\n          \"name\": titleEl.textContent.trim(),\n          \"acceptedAnswer\": {\n            \"@type\": \"Answer\",\n            \"text\": excerptEl ? excerptEl.textContent.trim() : titleEl.textContent.trim()\n          }\n        });\n      }\n    });\n\n    if (faqItems.length > 0) {\n      const script = document.createElement('script');\n      script.type = 'application/ld+json';\n      script.id = 'faq-schema-ld';\n      script.textContent = JSON.stringify({\n        \"@context\": \"https://schema.org\",\n        \"@type\": \"FAQPage\",\n        \"mainEntity\": faqItems\n      });\n      document.head.appendChild(script);\n    }\n  });\n\n    });\n  }\n};\n","import \"virtual:init-settings\";\n\nconst themeCompatModules = {};\nimport * as Mod1 from \"./discourse/initializers/theme-field-161-common-html-script-1\";\nthemeCompatModules[\"discourse/initializers/theme-field-161-common-html-script-1\"] = Mod1;\n\nexport default themeCompatModules;\n"],"names":["registerSettings","getObjectForTheme","themeField161CommonHtmlScript1","name","after","initialize","deprecated","id","url","withPluginApi","api","onPageChange","existingFaqSchema","document","getElementById","remove","includes","topics","querySelectorAll","length","faqItems","forEach","topic","titleEl","querySelector","excerptEl","push","textContent","trim","acceptedAnswer","text","script","createElement","type","JSON","stringify","mainEntity","head","appendChild","themeCompatModules","Mod1"],"mappings":";AAEAA,EAAiB,EAAG,CAAA,GCAIC,EAAkB;ACC1C,IAAAC,EAAe,CACbC,KAAM,uCACNC,MAAO,iBAEPC,UAAAA,GACEC,EACE,2HACA,CACEC,GAAI,wCACJC,IAAK,wCAGTC,EAAc,MAAQC,IAGxBA,EAAIC,aAAcH,IAChB,MAAMI,EAAoBC,SAASC,eAAe;AAGlD,GAFIF,GAAmBA,EAAkBG,UAEpCP,EAAIQ,SAAS,UAAW;AAE7B,MAAMC,EAASJ,SAASK,iBAAiB;AACzC,IAAKD,EAAOE,OAAQ;AAEpB,MAAMC,EAAW;AAgBjB,GAfAH,EAAOI,QAAQC,IACb,MAAMC,EAAUD,EAAME,cAAc,UAC9BC,EAAYH,EAAME,cAAc,aAAeF,EAAME,cAAc;AACrED,GACFH,EAASM,KAAK,CACZ,QAAS,WACTvB,KAAQoB,EAAQI,YAAYC,OAC5BC,eAAkB,CAChB,QAAS,SACTC,KAAQL,EAAYA,EAAUE,YAAYC,OAASL,EAAQI,YAAYC,YAM3ER,EAASD,OAAS,EAAG,CACvB,MAAMY,EAASlB,SAASmB,cAAc;AACtCD,EAAOE,KAAO,sBACdF,EAAOxB,GAAK,gBACZwB,EAAOJ,YAAcO,KAAKC,UAAU,CAClC,WAAY,qBACZ,QAAS,UACTC,WAAchB,IAEhBP,SAASwB,KAAKC,YAAYP,EAC5B,KAIF;ACvDG,MAACQ,EAAqB,CAAA;AAE3BA,EAAmB,+DAAiEC;"}