{"version":3,"file":"discourse-templates.js","names":["define","_exports","_component","_tracking","_object","_didInsert","_runloop","_service","_conditionalLoadingSpinner","_textField","_ajax","_ajaxError","_decorators","_discourseI18n","_tagDrop","_item","_tagDrop2","_component2","_templateFactory","Object","defineProperty","value","default","DTemplatesFilterableList","static","dt7948","g","this","prototype","service","siteSettings","i","tracked","loading","listFilter","replies","ALL_TAGS_ID","selectedTag","availableTags","filteredReplies","filterTitle","toLowerCase","map","template","score","title","includes","content","filter","NO_TAG_ID","tags","length","sort","a","b","n","computed","load","results","ajax","templates","tagging_enabled","values","reduce","forEach","tag","count","id","name","e","popupAjaxError","schedule","document","querySelector","focus","bind","changeSelectedTag","tagId","action","insertTemplate","args","onBeforeInsertTemplate","onInsertTemplate","onAfterInsertTemplate","setComponentTemplate","createTemplateFactory","block","moduleName","scope","i18n","isStrictMode","_helper","_routing","_cookText","_dIcon","_templateOnly","ItemContent","LinkTo","array","undefined","_dButton","_itemContent","DTemplatesItem","apply","type","catch","_dModal","_filterableList","Form","appEvents","constructor","super","arguments","closeModal","on","willDestroy","off","DTemplatesTagDrop","topTags","search","defaultItem","tagFilter","onChange","onChangeSelectedTag","_form","DTemplatesModalContainer","dTemplatesModal","SELECTOR_EDITOR_PREVIEW","DTemplatesEditorPreview","c","shouldRender","context","site","mobileView","templatesVisible","show","_ref","elemEditorPreview","style","display","set","hide","classNames","_concatClass","_debounce","DiscourseTemplatesButton","outletArgs","helper","model","is_template","currentUser","can_create_topic","composer","copyConfirm","fetchRaw","topic","dataType","createNewTopic","text","openNewTopic","body","copy","navigator","clipboard","writeText","resetCopyButton","_keyboardShortcuts","_pluginApi","_variablesChatChannel","_variablesChatThread","initialize","container","lookup","discourse_templates_enabled","can_use_templates","withPluginApi","api","dTemplates","addComposerToolbarPopupMenuOption","icon","label","showComposerUI","addOptionsMenuItem","addKeyboardShortcut","PLATFORM_KEY_MODIFIER","event","preventDefault","isComposerFocused","target","_templateShortcutTargets","isTextAreaFocused","isFocused","activeElement","showTextAreaUI","variables","global","help","category","definition","keys1","keysDelimiter","userCanChat","channelVariablesExtractor","chat","activeChannel","currentMessage","draft","router","threadVariablesExtractor","activeThread","registerChatComposerButton","position","contextVariablesExtractor","textarea","displayed","push","element","addChatIntegration","DTemplatesModalService","_owner","_textareaTextManipulation","_replaceVariables","_variablesComposer","DTemplatesService","modal","insertTemplateIntoComposer","isPreviewVisible","showModal","showComposerPreviewUI","variablesExtractor","isTextArea","insertTemplateIntoTextArea","extractVariables","contains","classList","modalModel","activeModal","opts","composerModel","getOwner","composerElement","nodeName","trigger","replaceTemplateVariables","insertBlock","templateVariables","replaceVariables","my_username","username","my_name","displayName","_user","TEMPLATES_ALLOWED_VARIABLES","modelVariables","current","key","replace","RegExp","freeze","channel","message","inReplyTo","channelVariables","chat_channel_name","chat_channel_url","routeModels","urlFor","reply_to_username","user","reply_to_name","context_title","context_url","thread","originalMessage","threadVariables","chat_thread_name","chat_thread_url","composerVariables","topic_title","topic_url","url","original_poster_username","details","created_by","original_poster_name","post","last_poster_username","reply_to_or_last_poster_username"],"sources":["discourse/plugins/discourse-templates/discourse/components/d-templates/filterable-list.js","discourse/plugins/discourse-templates/discourse/components/d-templates/item-content.js","discourse/plugins/discourse-templates/discourse/components/d-templates/item.js","discourse/plugins/discourse-templates/discourse/components/d-templates/modal/form.js","discourse/plugins/discourse-templates/discourse/components/d-templates/tag-drop.js","discourse/plugins/discourse-templates/discourse/connectors/below-footer/d-templates-modal-container.js","discourse/plugins/discourse-templates/discourse/connectors/editor-preview/d-templates.js","discourse/plugins/discourse-templates/discourse/connectors/topic-above-posts/discourse-templates-button.js","discourse/plugins/discourse-templates/discourse/initializers/d-templates.js","discourse/plugins/discourse-templates/discourse/services/d-templates-modal.js","discourse/plugins/discourse-templates/discourse/services/d-templates.js","discourse/plugins/discourse-templates/lib/replace-variables.js","discourse/plugins/discourse-templates/lib/variables-chat-channel.js","discourse/plugins/discourse-templates/lib/variables-chat-thread.js","discourse/plugins/discourse-templates/lib/variables-composer.js"],"sourcesContent":["define(\"discourse/plugins/discourse-templates/discourse/components/d-templates/filterable-list\", [\"exports\", \"@glimmer/component\", \"@glimmer/tracking\", \"@ember/object\", \"@ember/render-modifiers/modifiers/did-insert\", \"@ember/runloop\", \"@ember/service\", \"discourse/components/conditional-loading-spinner\", \"discourse/components/text-field\", \"discourse/lib/ajax\", \"discourse/lib/ajax-error\", \"discourse/lib/decorators\", \"discourse-i18n\", \"select-kit/components/tag-drop\", \"discourse/plugins/discourse-templates/discourse/components/d-templates/item\", \"discourse/plugins/discourse-templates/discourse/components/d-templates/tag-drop\", \"@ember/component\", \"@ember/template-factory\"], function (_exports, _component, _tracking, _object, _didInsert, _runloop, _service, _conditionalLoadingSpinner, _textField, _ajax, _ajaxError, _decorators, _discourseI18n, _tagDrop, _item, _tagDrop2, _component2, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  class DTemplatesFilterableList extends _component.default {\n    static #_ = (() => dt7948.g(this.prototype, \"siteSettings\", [_service.service]))();\n    #siteSettings = (() => (dt7948.i(this, \"siteSettings\"), void 0))();\n    static #_2 = (() => dt7948.g(this.prototype, \"loading\", [_tracking.tracked], function () {\n      return true;\n    }))();\n    #loading = (() => (dt7948.i(this, \"loading\"), void 0))();\n    static #_3 = (() => dt7948.g(this.prototype, \"listFilter\", [_tracking.tracked], function () {\n      return \"\";\n    }))();\n    #listFilter = (() => (dt7948.i(this, \"listFilter\"), void 0))();\n    static #_4 = (() => dt7948.g(this.prototype, \"replies\", [_tracking.tracked], function () {\n      return [];\n    }))();\n    #replies = (() => (dt7948.i(this, \"replies\"), void 0))();\n    static #_5 = (() => dt7948.g(this.prototype, \"selectedTag\", [_tracking.tracked], function () {\n      return _tagDrop.ALL_TAGS_ID;\n    }))();\n    #selectedTag = (() => (dt7948.i(this, \"selectedTag\"), void 0))();\n    static #_6 = (() => dt7948.g(this.prototype, \"availableTags\", [_tracking.tracked], function () {\n      return [];\n    }))();\n    #availableTags = (() => (dt7948.i(this, \"availableTags\"), void 0))();\n    get filteredReplies() {\n      const filterTitle = this.listFilter.toLowerCase();\n      return this.replies.map(template => {\n        /* Give a relevant score to each template. */template.score = 0;\n        if (template.title.toLowerCase().includes(filterTitle)) {\n          template.score += 2;\n        } else if (template.content.toLowerCase().includes(filterTitle)) {\n          template.score += 1;\n        }\n        return template;\n      }) // Filter irrelevant replies.\n      .filter(template => template.score !== 0) // Filter only replies tagged with the selected tag.\n      .filter(template => {\n        if (this.selectedTag === _tagDrop.ALL_TAGS_ID) {\n          return true;\n        }\n        if (this.selectedTag === _tagDrop.NO_TAG_ID && template.tags.length === 0) {\n          return true;\n        }\n        return template.tags.includes(this.selectedTag);\n      }).sort((a, b) => {\n        /* Sort replies by relevance and title. */if (a.score !== b.score) {\n          return a.score > b.score ? -1 : 1; /* descending */\n        } else if (a.title !== b.title) {\n          return a.title < b.title ? -1 : 1; /* ascending */\n        }\n        return 0;\n      });\n    }\n    static #_7 = (() => dt7948.n(this.prototype, \"filteredReplies\", [(0, _object.computed)(\"replies\", \"selectedTag\", \"listFilter\")]))();\n    async load() {\n      try {\n        this.loading = true;\n        const results = await (0, _ajax.ajax)(\"/discourse_templates\");\n        this.replies = results.templates;\n        if (this.siteSettings.tagging_enabled) {\n          this.availableTags = Object.values(this.replies.reduce((availableTags, template) => {\n            template.tags.forEach(tag => {\n              if (availableTags[tag]) {\n                availableTags[tag].count += 1;\n              } else {\n                availableTags[tag] = {\n                  id: tag,\n                  name: tag,\n                  count: 1\n                };\n              }\n            });\n            return availableTags;\n          }, {}));\n        }\n      } catch (e) {\n        this.loading = false;\n        (0, _ajaxError.popupAjaxError)(e);\n      } finally {\n        this.loading = false;\n        (0, _runloop.schedule)(\"afterRender\", () => document.querySelector(\".templates-filter\")?.focus());\n      }\n    }\n    static #_8 = (() => dt7948.n(this.prototype, \"load\", [_decorators.bind]))();\n    changeSelectedTag(tagId) {\n      this.selectedTag = tagId;\n    }\n    static #_9 = (() => dt7948.n(this.prototype, \"changeSelectedTag\", [_object.action]))();\n    insertTemplate(template) {\n      this.args.onBeforeInsertTemplate?.();\n      this.args.onInsertTemplate?.(template);\n      this.args.onAfterInsertTemplate?.();\n    }\n    static #_10 = (() => dt7948.n(this.prototype, \"insertTemplate\", [_object.action]))();\n    static #_11 = (() => (0, _component2.setComponentTemplate)((0, _templateFactory.createTemplateFactory)(\n    /*\n      \n        <div class=\"templates-filterable-list\" {{didInsert this.load}}>\n    \n          <ConditionalLoadingSpinner @condition={{this.loading}}>\n            <div class=\"templates-filter-bar\">\n              {{#if this.siteSettings.tagging_enabled}}\n                <TagDrop\n                  @availableTags={{this.availableTags}}\n                  @tagId={{this.selectedTag}}\n                  @onChangeSelectedTag={{this.changeSelectedTag}}\n                />\n              {{/if}}\n              <TextField\n                class=\"templates-filter\"\n                @value={{this.listFilter}}\n                placeholder={{i18n \"templates.filter_hint\"}}\n              />\n            </div>\n            <div class=\"templates-list\">\n              {{#each this.filteredReplies as |r|}}\n                <Item\n                  @template={{r}}\n                  @model={{@model}}\n                  @onInsertTemplate={{this.insertTemplate}}\n                />\n              {{/each}}\n            </div>\n          </ConditionalLoadingSpinner>\n        </div>\n      \n    */\n    {\n      \"id\": \"QG8uHpVW\",\n      \"block\": \"[[[1,\\\"\\\\n    \\\"],[11,0],[24,0,\\\"templates-filterable-list\\\"],[4,[32,0],[[30,0,[\\\"load\\\"]]],null],[12],[1,\\\"\\\\n\\\\n      \\\"],[8,[32,1],null,[[\\\"@condition\\\"],[[30,0,[\\\"loading\\\"]]]],[[\\\"default\\\"],[[[[1,\\\"\\\\n        \\\"],[10,0],[14,0,\\\"templates-filter-bar\\\"],[12],[1,\\\"\\\\n\\\"],[41,[30,0,[\\\"siteSettings\\\",\\\"tagging_enabled\\\"]],[[[1,\\\"            \\\"],[8,[32,2],null,[[\\\"@availableTags\\\",\\\"@tagId\\\",\\\"@onChangeSelectedTag\\\"],[[30,0,[\\\"availableTags\\\"]],[30,0,[\\\"selectedTag\\\"]],[30,0,[\\\"changeSelectedTag\\\"]]]],null],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"          \\\"],[8,[32,3],[[24,0,\\\"templates-filter\\\"],[16,\\\"placeholder\\\",[28,[32,4],[\\\"templates.filter_hint\\\"],null]]],[[\\\"@value\\\"],[[30,0,[\\\"listFilter\\\"]]]],null],[1,\\\"\\\\n        \\\"],[13],[1,\\\"\\\\n        \\\"],[10,0],[14,0,\\\"templates-list\\\"],[12],[1,\\\"\\\\n\\\"],[42,[28,[31,2],[[28,[31,2],[[30,0,[\\\"filteredReplies\\\"]]],null]],null],null,[[[1,\\\"            \\\"],[8,[32,5],null,[[\\\"@template\\\",\\\"@model\\\",\\\"@onInsertTemplate\\\"],[[30,1],[30,2],[30,0,[\\\"insertTemplate\\\"]]]],null],[1,\\\"\\\\n\\\"]],[1]],null],[1,\\\"        \\\"],[13],[1,\\\"\\\\n      \\\"]],[]]]]],[1,\\\"\\\\n    \\\"],[13],[1,\\\"\\\\n  \\\"]],[\\\"r\\\",\\\"@model\\\"],false,[\\\"if\\\",\\\"each\\\",\\\"-track-array\\\"]]\",\n      \"moduleName\": \"/root/prime/srv/discourse/app/app/assets/javascripts/discourse/discourse/plugins/discourse-templates/discourse/components/d-templates/filterable-list.js\",\n      \"scope\": () => [_didInsert.default, _conditionalLoadingSpinner.default, _tagDrop2.default, _textField.default, _discourseI18n.i18n, _item.default],\n      \"isStrictMode\": true\n    }), this))();\n  }\n  _exports.default = DTemplatesFilterableList;\n});","define(\"discourse/plugins/discourse-templates/discourse/components/d-templates/item-content\", [\"exports\", \"@ember/helper\", \"@ember/routing\", \"discourse/components/cook-text\", \"discourse/helpers/d-icon\", \"discourse-i18n\", \"@ember/component\", \"@ember/template-factory\", \"@ember/component/template-only\"], function (_exports, _helper, _routing, _cookText, _dIcon, _discourseI18n, _component, _templateFactory, _templateOnly) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  const ItemContent = (0, _component.setComponentTemplate)((0, _templateFactory.createTemplateFactory)(\n  /*\n    \n    <div class=\"templates-content\">\n      <LinkTo\n        class=\"template-item-source-link\"\n        @route=\"topic\"\n        @models={{array @template.slug @template.id}}\n      >\n        {{icon \"crosshairs\"}}\n        {{i18n \"templates.source\"}}\n      </LinkTo>\n      <CookText @rawText={{@template.content}} />\n    </div>\n  \n  */\n  {\n    \"id\": \"ki1q1bCx\",\n    \"block\": \"[[[1,\\\"\\\\n  \\\"],[10,0],[14,0,\\\"templates-content\\\"],[12],[1,\\\"\\\\n    \\\"],[8,[32,0],[[24,0,\\\"template-item-source-link\\\"]],[[\\\"@route\\\",\\\"@models\\\"],[\\\"topic\\\",[28,[32,1],[[30,1,[\\\"slug\\\"]],[30,1,[\\\"id\\\"]]],null]]],[[\\\"default\\\"],[[[[1,\\\"\\\\n      \\\"],[1,[28,[32,2],[\\\"crosshairs\\\"],null]],[1,\\\"\\\\n      \\\"],[1,[28,[32,3],[\\\"templates.source\\\"],null]],[1,\\\"\\\\n    \\\"]],[]]]]],[1,\\\"\\\\n    \\\"],[8,[32,4],null,[[\\\"@rawText\\\"],[[30,1,[\\\"content\\\"]]]],null],[1,\\\"\\\\n  \\\"],[13],[1,\\\"\\\\n\\\"]],[\\\"@template\\\"],false,[]]\",\n    \"moduleName\": \"/root/prime/srv/discourse/app/app/assets/javascripts/discourse/discourse/plugins/discourse-templates/discourse/components/d-templates/item-content.js\",\n    \"scope\": () => [_routing.LinkTo, _helper.array, _dIcon.default, _discourseI18n.i18n, _cookText.default],\n    \"isStrictMode\": true\n  }), (0, _templateOnly.default)(undefined, \"item-content:ItemContent\"));\n  var _default = _exports.default = ItemContent;\n});","define(\"discourse/plugins/discourse-templates/discourse/components/d-templates/item\", [\"exports\", \"@glimmer/component\", \"@ember/object\", \"discourse/components/d-button\", \"discourse/lib/ajax\", \"discourse/lib/ajax-error\", \"discourse/plugins/discourse-templates/discourse/components/d-templates/item-content\", \"@ember/component\", \"@ember/template-factory\"], function (_exports, _component, _object, _dButton, _ajax, _ajaxError, _itemContent, _component2, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  class DTemplatesItem extends _component.default {\n    apply() {\n      // run parametrized action to insert the template\n      this.args.onInsertTemplate?.(this.args.template);\n      (0, _ajax.ajax)(`/discourse_templates/${this.args.template.id}/use`, {\n        type: \"POST\"\n      }).catch(_ajaxError.popupAjaxError);\n    }\n    static #_ = (() => dt7948.n(this.prototype, \"apply\", [_object.action]))();\n    static #_2 = (() => (0, _component2.setComponentTemplate)((0, _templateFactory.createTemplateFactory)(\n    /*\n      \n        <details class=\"template-item\" id=\"template-item-{{@template.id}}\">\n          <summary class=\"template-item-title\">\n            <div class=\"template-item-title-text\">{{@template.title}}</div>\n    \n            <div class=\"actions\">\n              <DButton\n                @action={{this.apply}}\n                @icon=\"far-clipboard\"\n                class=\"templates-apply\"\n              />\n            </div>\n          </summary>\n    \n          <ItemContent @template={{@template}} />\n        </details>\n      \n    */\n    {\n      \"id\": \"k2OKHTCv\",\n      \"block\": \"[[[1,\\\"\\\\n    \\\"],[10,\\\"details\\\"],[14,0,\\\"template-item\\\"],[15,1,[29,[\\\"template-item-\\\",[30,1,[\\\"id\\\"]]]]],[12],[1,\\\"\\\\n      \\\"],[10,\\\"summary\\\"],[14,0,\\\"template-item-title\\\"],[12],[1,\\\"\\\\n        \\\"],[10,0],[14,0,\\\"template-item-title-text\\\"],[12],[1,[30,1,[\\\"title\\\"]]],[13],[1,\\\"\\\\n\\\\n        \\\"],[10,0],[14,0,\\\"actions\\\"],[12],[1,\\\"\\\\n          \\\"],[8,[32,0],[[24,0,\\\"templates-apply\\\"]],[[\\\"@action\\\",\\\"@icon\\\"],[[30,0,[\\\"apply\\\"]],\\\"far-clipboard\\\"]],null],[1,\\\"\\\\n        \\\"],[13],[1,\\\"\\\\n      \\\"],[13],[1,\\\"\\\\n\\\\n      \\\"],[8,[32,1],null,[[\\\"@template\\\"],[[30,1]]],null],[1,\\\"\\\\n    \\\"],[13],[1,\\\"\\\\n  \\\"]],[\\\"@template\\\"],false,[]]\",\n      \"moduleName\": \"/root/prime/srv/discourse/app/app/assets/javascripts/discourse/discourse/plugins/discourse-templates/discourse/components/d-templates/item.js\",\n      \"scope\": () => [_dButton.default, _itemContent.default],\n      \"isStrictMode\": true\n    }), this))();\n  }\n  _exports.default = DTemplatesItem;\n});","define(\"discourse/plugins/discourse-templates/discourse/components/d-templates/modal/form\", [\"exports\", \"@glimmer/component\", \"@ember/service\", \"discourse/components/d-modal\", \"discourse-i18n\", \"discourse/plugins/discourse-templates/discourse/components/d-templates/filterable-list\", \"@ember/component\", \"@ember/template-factory\"], function (_exports, _component, _service, _dModal, _discourseI18n, _filterableList, _component2, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  class Form extends _component.default {\n    static #_ = (() => dt7948.g(this.prototype, \"appEvents\", [_service.service]))();\n    #appEvents = (() => (dt7948.i(this, \"appEvents\"), void 0))();\n    constructor() {\n      super(...arguments);\n      if (this.args.closeModal) {\n        this.appEvents.on(\"page:changed\", this, this.args.closeModal);\n      }\n    }\n    willDestroy() {\n      super.willDestroy(...arguments);\n      if (this.args.closeModal) {\n        this.appEvents.off(\"page:changed\", this, this.args.closeModal);\n      }\n    }\n    static #_2 = (() => (0, _component2.setComponentTemplate)((0, _templateFactory.createTemplateFactory)(\n    /*\n      \n        <DModal\n          @closeModal={{@closeModal}}\n          @title={{i18n \"templates.insert_template\"}}\n          class=\"d-templates d-templates-modal\"\n        >\n          <:body>\n            <FilterableList\n              @textarea={{@model.textarea}}\n              @onInsertTemplate={{@model.onInsertTemplate}}\n              @onAfterInsertTemplate={{@closeModal}}\n            />\n          </:body>\n        </DModal>\n      \n    */\n    {\n      \"id\": \"eovbyGuL\",\n      \"block\": \"[[[1,\\\"\\\\n    \\\"],[8,[32,0],[[24,0,\\\"d-templates d-templates-modal\\\"]],[[\\\"@closeModal\\\",\\\"@title\\\"],[[30,1],[28,[32,1],[\\\"templates.insert_template\\\"],null]]],[[\\\"body\\\"],[[[[1,\\\"\\\\n        \\\"],[8,[32,2],null,[[\\\"@textarea\\\",\\\"@onInsertTemplate\\\",\\\"@onAfterInsertTemplate\\\"],[[30,2,[\\\"textarea\\\"]],[30,2,[\\\"onInsertTemplate\\\"]],[30,1]]],null],[1,\\\"\\\\n      \\\"]],[]]]]],[1,\\\"\\\\n  \\\"]],[\\\"@closeModal\\\",\\\"@model\\\"],false,[]]\",\n      \"moduleName\": \"/root/prime/srv/discourse/app/app/assets/javascripts/discourse/discourse/plugins/discourse-templates/discourse/components/d-templates/modal/form.js\",\n      \"scope\": () => [_dModal.default, _discourseI18n.i18n, _filterableList.default],\n      \"isStrictMode\": true\n    }), this))();\n  }\n  _exports.default = Form;\n});","define(\"discourse/plugins/discourse-templates/discourse/components/d-templates/tag-drop\", [\"exports\", \"@ember/object\", \"select-kit/components/tag-drop\"], function (_exports, _object, _tagDrop) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  class DTemplatesTagDrop extends _tagDrop.default {\n    get topTags() {\n      // sort tags descending by count and ascending by name\n      return (this.availableTags || []).sort((a, b) => {\n        if (a.count !== b.count) {\n          return b.count - a.count;\n        } // descending\n        if (a.name !== b.name) {\n          return a.name < b.name ? -1 : 1;\n        } // ascending\n        return 0;\n      });\n    }\n    static #_ = (() => dt7948.n(this.prototype, \"topTags\", [(0, _object.computed)(\"availableTags.[]\")]))();\n    search(filter) {\n      return (this.content || []).map(tag => {\n        if (tag.id && tag.name) {\n          return tag;\n        }\n        return this.defaultItem(tag, tag);\n      }).filter(tag => {\n        if (filter == null) {\n          return true;\n        }\n        const tagFilter = filter.toLowerCase();\n        return tag.id.toLowerCase().includes(tagFilter) || tag.name.toLowerCase().includes(tagFilter);\n      });\n    }\n    onChange(tagId, tag) {\n      // overrides the action onChange of the parent with the value received in\n      // the property onChangeSelectedTag in the handlebars template\n      this.onChangeSelectedTag?.(tagId, tag);\n    }\n    static #_2 = (() => dt7948.n(this.prototype, \"onChange\", [_object.action]))();\n  }\n  _exports.default = DTemplatesTagDrop;\n});","define(\"discourse/plugins/discourse-templates/discourse/connectors/below-footer/d-templates-modal-container\", [\"exports\", \"@glimmer/component\", \"@ember/service\", \"discourse/plugins/discourse-templates/discourse/components/d-templates/modal/form\", \"@ember/component\", \"@ember/template-factory\"], function (_exports, _component, _service, _form, _component2, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  class DTemplatesModalContainer extends _component.default {\n    static #_ = (() => dt7948.g(this.prototype, \"dTemplatesModal\", [_service.service]))();\n    #dTemplatesModal = (() => (dt7948.i(this, \"dTemplatesModal\"), void 0))();\n    static #_2 = (() => (0, _component2.setComponentTemplate)((0, _templateFactory.createTemplateFactory)(\n    /*\n      \n        {{#if this.dTemplatesModal.model}}\n          <div class=\"modal-container d-templates-modal-container\">\n            <DTemplatesModalForm\n              @closeModal={{this.dTemplatesModal.hide}}\n              @model={{this.dTemplatesModal.model}}\n            />\n          </div>\n        {{/if}}\n      \n    */\n    {\n      \"id\": \"Vw3FX79F\",\n      \"block\": \"[[[1,\\\"\\\\n\\\"],[41,[30,0,[\\\"dTemplatesModal\\\",\\\"model\\\"]],[[[1,\\\"      \\\"],[10,0],[14,0,\\\"modal-container d-templates-modal-container\\\"],[12],[1,\\\"\\\\n        \\\"],[8,[32,0],null,[[\\\"@closeModal\\\",\\\"@model\\\"],[[30,0,[\\\"dTemplatesModal\\\",\\\"hide\\\"]],[30,0,[\\\"dTemplatesModal\\\",\\\"model\\\"]]]],null],[1,\\\"\\\\n      \\\"],[13],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"  \\\"]],[],false,[\\\"if\\\"]]\",\n      \"moduleName\": \"/root/prime/srv/discourse/app/app/assets/javascripts/discourse/discourse/plugins/discourse-templates/discourse/connectors/below-footer/d-templates-modal-container.js\",\n      \"scope\": () => [_form.default],\n      \"isStrictMode\": true\n    }), this))();\n  }\n  _exports.default = DTemplatesModalContainer;\n});","define(\"discourse/plugins/discourse-templates/discourse/connectors/editor-preview/d-templates\", [\"exports\", \"@ember/component\", \"@ember/object\", \"@ember/service\", \"@ember-decorators/component\", \"discourse/components/d-button\", \"discourse/plugins/discourse-templates/discourse/components/d-templates/filterable-list\", \"@ember/template-factory\"], function (_exports, _component, _object, _service, _component2, _dButton, _filterableList, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  /* eslint-disable ember/no-classic-components */\n\n  const SELECTOR_EDITOR_PREVIEW = \"#reply-control .d-editor-preview-wrapper > .d-editor-preview\";\n  const DTemplatesEditorPreview = dt7948.c(class DTemplatesEditorPreview extends _component.default {\n    static shouldRender(args, context) {\n      return !context.site.mobileView;\n    }\n    static #_ = (() => dt7948.g(this.prototype, \"appEvents\", [_service.service]))();\n    #appEvents = (() => (dt7948.i(this, \"appEvents\"), void 0))();\n    static #_2 = (() => dt7948.g(this.prototype, \"site\", [_service.service]))();\n    #site = (() => (dt7948.i(this, \"site\"), void 0))();\n    templatesVisible = false;\n    onInsertTemplate;\n    constructor() {\n      super(...arguments);\n      this.appEvents.on(\"discourse-templates:show\", this, \"show\");\n      this.appEvents.on(\"discourse-templates:hide\", this, \"hide\");\n    }\n    willDestroy() {\n      super.willDestroy(...arguments);\n      this.appEvents.off(\"discourse-templates:show\", this, \"show\");\n      this.appEvents.off(\"discourse-templates:hide\", this, \"hide\");\n    }\n    show(_ref) {\n      let {\n        onInsertTemplate\n      } = _ref;\n      const elemEditorPreview = document.querySelector(SELECTOR_EDITOR_PREVIEW);\n      if (elemEditorPreview) {\n        elemEditorPreview.style.display = \"none\";\n      }\n      this.set(\"onInsertTemplate\", onInsertTemplate);\n      this.set(\"templatesVisible\", true);\n    }\n    static #_3 = (() => dt7948.n(this.prototype, \"show\", [_object.action]))();\n    hide() {\n      const elemEditorPreview = document.querySelector(SELECTOR_EDITOR_PREVIEW);\n      if (elemEditorPreview) {\n        elemEditorPreview.style.display = \"\";\n      }\n      this.set(\"templatesVisible\", false);\n    }\n    static #_4 = (() => dt7948.n(this.prototype, \"hide\", [_object.action]))();\n    static #_5 = (() => (0, _component.setComponentTemplate)((0, _templateFactory.createTemplateFactory)(\n    /*\n      \n        {{#if this.templatesVisible}}\n          <div class=\"d-templates-container\">\n            <DButton\n              @action={{this.hide}}\n              @icon=\"xmark\"\n              class=\"modal-close close btn-flat\"\n            />\n            <FilterableList\n              @onInsertTemplate={{this.onInsertTemplate}}\n              @onAfterInsertTemplate={{this.hide}}\n            />\n          </div>\n        {{/if}}\n      \n    */\n    {\n      \"id\": \"6ceRFEj3\",\n      \"block\": \"[[[1,\\\"\\\\n\\\"],[41,[30,0,[\\\"templatesVisible\\\"]],[[[1,\\\"      \\\"],[10,0],[14,0,\\\"d-templates-container\\\"],[12],[1,\\\"\\\\n        \\\"],[8,[32,0],[[24,0,\\\"modal-close close btn-flat\\\"]],[[\\\"@action\\\",\\\"@icon\\\"],[[30,0,[\\\"hide\\\"]],\\\"xmark\\\"]],null],[1,\\\"\\\\n        \\\"],[8,[32,1],null,[[\\\"@onInsertTemplate\\\",\\\"@onAfterInsertTemplate\\\"],[[30,0,[\\\"onInsertTemplate\\\"]],[30,0,[\\\"hide\\\"]]]],null],[1,\\\"\\\\n      \\\"],[13],[1,\\\"\\\\n\\\"]],[]],null],[1,\\\"  \\\"]],[],false,[\\\"if\\\"]]\",\n      \"moduleName\": \"/root/prime/srv/discourse/app/app/assets/javascripts/discourse/discourse/plugins/discourse-templates/discourse/connectors/editor-preview/d-templates.js\",\n      \"scope\": () => [_dButton.default, _filterableList.default],\n      \"isStrictMode\": true\n    }), this))();\n  }, [(0, _component2.classNames)(\"d-templates\")]);\n  var _default = _exports.default = DTemplatesEditorPreview;\n});","define(\"discourse/plugins/discourse-templates/discourse/connectors/topic-above-posts/discourse-templates-button\", [\"exports\", \"@glimmer/component\", \"@glimmer/tracking\", \"@ember/object\", \"@ember/service\", \"discourse/components/d-button\", \"discourse/helpers/concat-class\", \"discourse/lib/ajax\", \"discourse/lib/debounce\", \"@ember/component\", \"@ember/template-factory\"], function (_exports, _component, _tracking, _object, _service, _dButton, _concatClass, _ajax, _debounce, _component2, _templateFactory) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  class DiscourseTemplatesButton extends _component.default {\n    static shouldRender(outletArgs, helper) {\n      return outletArgs.model.is_template && helper.currentUser?.can_create_topic;\n    }\n    static #_ = (() => dt7948.g(this.prototype, \"composer\", [_service.service]))();\n    #composer = (() => (dt7948.i(this, \"composer\"), void 0))();\n    static #_2 = (() => dt7948.g(this.prototype, \"copyConfirm\", [_tracking.tracked], function () {\n      return false;\n    }))();\n    #copyConfirm = (() => (dt7948.i(this, \"copyConfirm\"), void 0))();\n    async fetchRaw() {\n      const topic = this.args.outletArgs.model;\n      return await (0, _ajax.ajax)(`/raw/${topic.id}/1`, {\n        dataType: \"text\"\n      });\n    }\n    async createNewTopic() {\n      const text = await this.fetchRaw();\n      this.composer.openNewTopic({\n        body: text\n      });\n    }\n    static #_3 = (() => dt7948.n(this.prototype, \"createNewTopic\", [_object.action]))();\n    async copy() {\n      const text = await this.fetchRaw();\n      navigator.clipboard.writeText(text);\n      this.copyConfirm = true;\n      (0, _debounce.default)(this.resetCopyButton, 2000);\n    }\n    static #_4 = (() => dt7948.n(this.prototype, \"copy\", [_object.action]))();\n    resetCopyButton() {\n      this.copyConfirm = false;\n    }\n    static #_5 = (() => dt7948.n(this.prototype, \"resetCopyButton\", [_object.action]))();\n    static #_6 = (() => (0, _component2.setComponentTemplate)((0, _templateFactory.createTemplateFactory)(\n    /*\n      \n        <div class=\"template-topic-controls\">\n          <DButton\n            @icon={{if this.copyConfirm \"check\" \"copy\"}}\n            @action={{this.copy}}\n            @label=\"templates.copy\"\n            class={{concatClass\n              \"btn-default\"\n              \"template-copy\"\n              (if this.copyConfirm \"ok\")\n            }}\n          />\n          <DButton\n            @action={{this.createNewTopic}}\n            @label=\"templates.new_topic\"\n            @icon=\"plus\"\n            class=\"template-new-topic\"\n          />\n        </div>\n      \n    */\n    {\n      \"id\": \"EA4TaTpQ\",\n      \"block\": \"[[[1,\\\"\\\\n    \\\"],[10,0],[14,0,\\\"template-topic-controls\\\"],[12],[1,\\\"\\\\n      \\\"],[8,[32,0],[[16,0,[28,[32,1],[\\\"btn-default\\\",\\\"template-copy\\\",[52,[30,0,[\\\"copyConfirm\\\"]],\\\"ok\\\"]],null]]],[[\\\"@icon\\\",\\\"@action\\\",\\\"@label\\\"],[[52,[30,0,[\\\"copyConfirm\\\"]],\\\"check\\\",\\\"copy\\\"],[30,0,[\\\"copy\\\"]],\\\"templates.copy\\\"]],null],[1,\\\"\\\\n      \\\"],[8,[32,0],[[24,0,\\\"template-new-topic\\\"]],[[\\\"@action\\\",\\\"@label\\\",\\\"@icon\\\"],[[30,0,[\\\"createNewTopic\\\"]],\\\"templates.new_topic\\\",\\\"plus\\\"]],null],[1,\\\"\\\\n    \\\"],[13],[1,\\\"\\\\n  \\\"]],[],false,[\\\"if\\\"]]\",\n      \"moduleName\": \"/root/prime/srv/discourse/app/app/assets/javascripts/discourse/discourse/plugins/discourse-templates/discourse/connectors/topic-above-posts/discourse-templates-button.js\",\n      \"scope\": () => [_dButton.default, _concatClass.default],\n      \"isStrictMode\": true\n    }), this))();\n  }\n  _exports.default = DiscourseTemplatesButton;\n});","define(\"discourse/plugins/discourse-templates/discourse/initializers/d-templates\", [\"exports\", \"discourse/lib/keyboard-shortcuts\", \"discourse/lib/plugin-api\", \"discourse/plugins/discourse-templates/lib/variables-chat-channel\", \"discourse/plugins/discourse-templates/lib/variables-chat-thread\"], function (_exports, _keyboardShortcuts, _pluginApi, _variablesChatChannel, _variablesChatThread) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  var _default = _exports.default = {\n    name: \"discourse-templates-add-ui-builder\",\n    initialize(container) {\n      const siteSettings = container.lookup(\"service:site-settings\");\n      const currentUser = container.lookup(\"service:current-user\");\n      if (siteSettings.discourse_templates_enabled && currentUser?.can_use_templates) {\n        (0, _pluginApi.withPluginApi)(api => {\n          addOptionsMenuItem(api);\n          addKeyboardShortcut(api, container);\n          addChatIntegration(api, container);\n        });\n      }\n    }\n  };\n  function addOptionsMenuItem(api) {\n    const dTemplates = api.container.lookup(\"service:d-templates\");\n    api.addComposerToolbarPopupMenuOption({\n      icon: \"far-clipboard\",\n      label: \"templates.insert_template\",\n      action: () => {\n        dTemplates.showComposerUI();\n      }\n    });\n  }\n  const _templateShortcutTargets = [];\n  function addKeyboardShortcut(api, container) {\n    api.addKeyboardShortcut(`${_keyboardShortcuts.PLATFORM_KEY_MODIFIER}+shift+i`, event => {\n      event.preventDefault();\n      const dTemplates = container.lookup(\"service:d-templates\");\n      if (dTemplates.isComposerFocused) {\n        dTemplates.showComposerUI();\n        return;\n      }\n      for (const target of _templateShortcutTargets) {\n        if (dTemplates.isTextAreaFocused && target?.isFocused?.(document.activeElement)) {\n          dTemplates.showTextAreaUI(target?.variables);\n          return;\n        }\n      }\n      if (dTemplates.isTextAreaFocused) {\n        dTemplates.showTextAreaUI();\n      }\n    }, {\n      global: true,\n      help: {\n        category: \"templates\",\n        name: \"templates.insert_template\",\n        definition: {\n          keys1: [_keyboardShortcuts.PLATFORM_KEY_MODIFIER, \"shift\", \"i\"],\n          keysDelimiter: \"plus\"\n        }\n      }\n    });\n  }\n  function addChatIntegration(api, container) {\n    if (!container.lookup(\"service:chat\")?.userCanChat) {\n      return;\n    }\n    const channelVariablesExtractor = function () {\n      const chat = container.lookup(\"service:chat\");\n      const activeChannel = chat?.activeChannel;\n      const currentMessage = activeChannel?.draft;\n      const router = container.lookup(\"service:router\");\n      return (0, _variablesChatChannel.default)(activeChannel, currentMessage, router);\n    };\n    const threadVariablesExtractor = function () {\n      const chat = container.lookup(\"service:chat\");\n      const activeThread = chat?.activeChannel?.activeThread;\n      const currentMessage = activeThread?.draft;\n      const router = container.lookup(\"service:router\");\n      return (0, _variablesChatThread.default)(activeThread, currentMessage, router);\n    };\n\n    // add a custom chat composer button\n    api.registerChatComposerButton({\n      id: \"d-templates-chat-insert-template-btn\",\n      icon: \"far-clipboard\",\n      label: \"templates.insert_template\",\n      position: \"dropdown\",\n      action: function () {\n        let contextVariablesExtractor;\n        switch (this.context) {\n          case \"channel\":\n            contextVariablesExtractor = channelVariablesExtractor.bind(this);\n            break;\n          case \"thread\":\n            contextVariablesExtractor = threadVariablesExtractor.bind(this);\n            break;\n          default:\n            contextVariablesExtractor = null;\n        }\n        const textarea = this.composer?.textarea?.textarea; // this.composer.textarea is a TextareaInteractor instance\n\n        container.lookup(\"service:d-templates\").showTextAreaUI(contextVariablesExtractor, textarea);\n      },\n      displayed() {\n        return this.composer?.textarea && (this.context === \"channel\" || this.context === \"thread\");\n      }\n    });\n\n    // add custom keyboard shortcut handlers for the chat channel composer and chat thread composer\n    _templateShortcutTargets.push({\n      isFocused: element => element?.id === \"channel-composer\",\n      variables: channelVariablesExtractor\n    }, {\n      isFocused: element => element?.id === \"thread-composer\",\n      variables: threadVariablesExtractor\n    });\n  }\n});","define(\"discourse/plugins/discourse-templates/discourse/services/d-templates-modal\", [\"exports\", \"@glimmer/tracking\", \"@ember/object\", \"@ember/service\"], function (_exports, _tracking, _object, _service) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  class DTemplatesModalService extends _service.default {\n    static #_ = (() => dt7948.g(this.prototype, \"model\", [_tracking.tracked], function () {\n      return null;\n    }))();\n    #model = (() => (dt7948.i(this, \"model\"), void 0))();\n    show(model) {\n      this.model = model;\n    }\n    static #_2 = (() => dt7948.n(this.prototype, \"show\", [_object.action]))();\n    hide() {\n      // return the focus back to the textarea\n      this.model?.textarea?.focus();\n\n      // clear the model\n      this.model = null;\n    }\n    static #_3 = (() => dt7948.n(this.prototype, \"hide\", [_object.action]))();\n  }\n  _exports.default = DTemplatesModalService;\n});","define(\"discourse/plugins/discourse-templates/discourse/services/d-templates\", [\"exports\", \"@ember/owner\", \"@ember/service\", \"discourse/lib/textarea-text-manipulation\", \"discourse/plugins/discourse-templates/lib/replace-variables\", \"discourse/plugins/discourse-templates/lib/variables-composer\"], function (_exports, _owner, _service, _textareaTextManipulation, _replaceVariables, _variablesComposer) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = void 0;\n  class DTemplatesService extends _service.default {\n    static #_ = (() => dt7948.g(this.prototype, \"appEvents\", [_service.service]))();\n    #appEvents = (() => (dt7948.i(this, \"appEvents\"), void 0))();\n    static #_2 = (() => dt7948.g(this.prototype, \"modal\", [_service.service]))();\n    #modal = (() => (dt7948.i(this, \"modal\"), void 0))();\n    static #_3 = (() => dt7948.g(this.prototype, \"site\", [_service.service]))();\n    #site = (() => (dt7948.i(this, \"site\"), void 0))();\n    static #_4 = (() => dt7948.g(this.prototype, \"currentUser\", [_service.service]))();\n    #currentUser = (() => (dt7948.i(this, \"currentUser\"), void 0))();\n    static #_5 = (() => dt7948.g(this.prototype, \"dTemplatesModal\", [_service.service]))();\n    #dTemplatesModal = (() => (dt7948.i(this, \"dTemplatesModal\"), void 0))();\n    static #_6 = (() => dt7948.g(this.prototype, \"composer\", [_service.service]))();\n    #composer = (() => (dt7948.i(this, \"composer\"), void 0))();\n    showComposerUI() {\n      const onInsertTemplate = this.#insertTemplateIntoComposer.bind(this);\n      if (this.site.mobileView || !this.composer.isPreviewVisible) {\n        this.#showModal(null, onInsertTemplate); // textarea must be empty when targeting the composer\n      } else {\n        this.#showComposerPreviewUI(onInsertTemplate);\n      }\n    }\n    showTextAreaUI() {\n      let variablesExtractor = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;\n      let textarea = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : document.activeElement;\n      if (!this.#isTextArea(textarea)) {\n        return;\n      }\n      const modal = document.querySelector(\".d-modal\");\n      const onInsertTemplate = this.#insertTemplateIntoTextArea.bind(this);\n      const extractVariables = model => variablesExtractor?.(model);\n      if (modal?.contains(textarea)) {\n        if (!modal.classList.contains(\"d-templates\")) {\n          this.#showModal(textarea, template => {\n            const modalModel = this.modal.activeModal?.opts?.model;\n            onInsertTemplate(textarea, template, extractVariables(modalModel));\n          });\n        }\n      } else {\n        this.#showModal(textarea, template => onInsertTemplate(textarea, template, extractVariables()));\n      }\n    }\n    get isComposerFocused() {\n      const activeElement = document.activeElement;\n      const composerModel = (0, _owner.getOwner)(this).lookup(\"service:composer\").model;\n      const composerElement = document.querySelector(\".d-editor\");\n      return composerModel && composerElement?.contains(activeElement);\n    }\n    get isTextAreaFocused() {\n      return this.#isTextArea(document.activeElement);\n    }\n    #isTextArea(element) {\n      return element?.nodeName === \"TEXTAREA\";\n    }\n    #showModal(textarea, onInsertTemplate) {\n      this.dTemplatesModal.show({\n        textarea,\n        onInsertTemplate\n      });\n    }\n    #showComposerPreviewUI(onInsertTemplate) {\n      this.appEvents.trigger(\"composer-messages:close\");\n      this.appEvents.trigger(\"composer:show-preview\");\n      this.appEvents.trigger(\"discourse-templates:show\", {\n        onInsertTemplate\n      });\n    }\n    #insertTemplateIntoTextArea(textarea, template, variables) {\n      template = this.#replaceTemplateVariables(template.title, template.content, variables);\n      new _textareaTextManipulation.default((0, _owner.getOwner)(this), {\n        textarea\n      }).insertBlock(template.content);\n    }\n    #insertTemplateIntoComposer(template) {\n      const composerModel = (0, _owner.getOwner)(this).lookup(\"service:composer\").model;\n      const templateVariables = (0, _variablesComposer.default)(composerModel);\n      template = this.#replaceTemplateVariables(template.title, template.content, templateVariables);\n\n      // insert the title if blank\n      if (composerModel && !composerModel.title) {\n        composerModel.set(\"title\", template.title);\n      }\n\n      // insert the content of the template in the composer\n      this.appEvents.trigger(\"composer:insert-block\", template.content);\n    }\n    #replaceTemplateVariables(title, content) {\n      let variables = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n      return (0, _replaceVariables.replaceVariables)(title, content, {\n        ...variables,\n        my_username: this.currentUser?.username,\n        my_name: this.currentUser?.displayName\n      });\n    }\n  }\n  _exports.default = DTemplatesService;\n});","define(\"discourse/plugins/discourse-templates/lib/replace-variables\", [\"exports\", \"discourse/models/user\"], function (_exports, _user) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.TEMPLATES_ALLOWED_VARIABLES = void 0;\n  _exports.replaceVariables = replaceVariables;\n  // keep this list synchronized with the list in spec/plugin_helper.rb\n  const TEMPLATES_ALLOWED_VARIABLES = _exports.TEMPLATES_ALLOWED_VARIABLES = Object.freeze([\"my_username\", \"my_name\", \"chat_channel_name\", \"chat_channel_url\", \"chat_thread_name\", \"chat_thread_url\", \"context_title\", \"context_url\", \"topic_title\", \"topic_url\", \"original_poster_username\", \"original_poster_name\", \"reply_to_username\", \"reply_to_name\", \"last_poster_username\", \"reply_to_or_last_poster_username\"]);\n  function replaceVariables(title, content, modelVariables) {\n    const currentUser = _user.default.current();\n    const variables = {\n      ...(modelVariables || {}),\n      my_username: currentUser?.username,\n      my_name: currentUser?.displayName\n    };\n    if (variables && typeof variables === \"object\") {\n      for (const key of TEMPLATES_ALLOWED_VARIABLES) {\n        if (variables[key]) {\n          title = title.replace(new RegExp(`%{${key}(,fallback:.[^}]*)?}`, \"g\"), variables[key]);\n          content = content.replace(new RegExp(`%{${key}(,fallback:.[^}]*)?}`, \"g\"), variables[key]);\n        } else {\n          title = title.replace(new RegExp(`%{${key},fallback:(.[^}]*)}`, \"g\"), \"$1\");\n          title = title.replace(new RegExp(`%{${key}}`, \"g\"), \"\");\n          content = content.replace(new RegExp(`%{${key},fallback:(.[^}]*)}`, \"g\"), \"$1\");\n          content = content.replace(new RegExp(`%{${key}}`, \"g\"), \"\");\n        }\n      }\n    }\n    return {\n      title,\n      content\n    };\n  }\n});","define(\"discourse/plugins/discourse-templates/lib/variables-chat-channel\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = extractVariablesFromChatChannel;\n  function extractVariablesFromChatChannel(channel, message, router) {\n    if (!channel && !message) {\n      return {};\n    }\n    const inReplyTo = message?.inReplyTo;\n    const channelVariables = {\n      chat_channel_name: channel?.title,\n      chat_channel_url: channel?.routeModels ? router?.urlFor(\"chat.channel\", ...channel.routeModels) : null,\n      reply_to_username: inReplyTo?.user?.username,\n      reply_to_name: inReplyTo?.user?.name\n    };\n    return {\n      ...channelVariables,\n      context_title: channelVariables.chat_channel_name,\n      context_url: channelVariables.chat_channel_url\n    };\n  }\n});","define(\"discourse/plugins/discourse-templates/lib/variables-chat-thread\", [\"exports\", \"discourse/plugins/discourse-templates/lib/variables-chat-channel\"], function (_exports, _variablesChatChannel) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = extractVariablesFromChatThread;\n  function extractVariablesFromChatThread(thread, message, router) {\n    if (!thread && !message) {\n      return {};\n    }\n    const channel = thread?.channel;\n    const inReplyTo = thread?.originalMessage;\n    const channelVariables = (0, _variablesChatChannel.default)(channel, message, router);\n    const threadVariables = {\n      chat_thread_name: thread?.title,\n      chat_thread_url: thread?.routeModels ? router?.urlFor(\"chat.channel.thread\", ...thread.routeModels) : null,\n      reply_to_username: inReplyTo?.user?.username,\n      reply_to_name: inReplyTo?.user?.name\n    };\n    return {\n      ...channelVariables,\n      ...threadVariables,\n      context_title: threadVariables.chat_thread_name || channelVariables.chat_channel_name,\n      context_url: threadVariables.chat_thread_url || channelVariables.chat_channel_url\n    };\n  }\n});","define(\"discourse/plugins/discourse-templates/lib/variables-composer\", [\"exports\"], function (_exports) {\n  \"use strict\";\n\n  Object.defineProperty(_exports, \"__esModule\", {\n    value: true\n  });\n  _exports.default = extractVariablesFromComposerModel;\n  function extractVariablesFromComposerModel(model) {\n    if (!model) {\n      return {};\n    }\n    const composerVariables = {\n      topic_title: model.topic?.title,\n      topic_url: model.topic?.url,\n      original_poster_username: model.topic?.details.created_by.username,\n      original_poster_name: model.topic?.details.created_by.name,\n      reply_to_username: model.post?.username,\n      reply_to_name: model.post?.name,\n      last_poster_username: model.topic?.last_poster_username,\n      reply_to_or_last_poster_username: model.post?.username || model.topic?.last_poster_username\n    };\n    return {\n      ...composerVariables,\n      context_title: composerVariables.topic_title,\n      context_url: composerVariables.topic_url\n    };\n  }\n});"],"mappings":"AAAAA,OAAA,upBAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,EAAAC,GACA;AAEAC,OAAAC,eAAAnB,EAAA,cACAoB,OAAA,IAEApB,EAAAqB,aAAA;AACA,MAAAC,UAAArB,EAAAoB,QACAE,SAAA,KAAAC,OAAAC,EAAAC,KAAAC,UAAA,gBAAArB,EAAAsB,UAAA;AACAC,GAAA,MAAAL,OAAAM,EAAAJ,KAAA;AACAH,SAAA,KAAAC,OAAAC,EAAAC,KAAAC,UAAA,WAAAzB,EAAA6B,SAAA,WACA,QACA,GAFA;AAGAC,GAAA,MAAAR,OAAAM,EAAAJ,KAAA;AACAH,SAAA,KAAAC,OAAAC,EAAAC,KAAAC,UAAA,cAAAzB,EAAA6B,SAAA,WACA,QACA,GAFA;AAGAE,GAAA,MAAAT,OAAAM,EAAAJ,KAAA;AACAH,SAAA,KAAAC,OAAAC,EAAAC,KAAAC,UAAA,WAAAzB,EAAA6B,SAAA,WACA,QACA,GAFA;AAGAG,GAAA,MAAAV,OAAAM,EAAAJ,KAAA;AACAH,SAAA,KAAAC,OAAAC,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