{"version":3,"file":"virtual_main.js","sources":["theme-88/virtual:init-settings","theme-88/virtual:theme","theme-88/discourse/lib/minimasonry.js","theme-88/discourse/components/gif-result.gjs","theme-88/discourse/components/gif-result-list.gjs","theme-88/discourse/components/modal/gif.gjs","theme-88/discourse/components/gif-button.gjs","theme-88/discourse/connectors/composer-mobile-buttons-bottom/mobile-gif-button.gjs","theme-88/discourse/initializers/gif-integration.js","theme-88/virtual:main"],"sourcesContent":["import { registerSettings } from \"discourse/lib/theme-settings-store\";\n\nregisterSettings(88, {\n  \"api_provider\": \"giphy\",\n  \"giphy_api_key\": \"3k3bLaFqr7F3P8KGVU2bWQP69sb63HUa\",\n  \"giphy_file_format\": \"webp\",\n  \"giphy_content_rating\": \"r\",\n  \"giphy_locale\": \"en\",\n  \"limit_infinite_search_results\": false,\n  \"max_results_limit\": 240,\n  \"tenor_api_key\": \"\",\n  \"tenor_client_key\": \"discourse\",\n  \"tenor_file_detail\": \"gif\",\n  \"tenor_content_filter\": \"high\",\n  \"tenor_country\": \"US\",\n  \"tenor_locale\": \"en_US\",\n  \"theme_uploads\": {\n    \"giphy-logo\": \"https://forum-cdn.spyhub.tv/uploads/default/original/3X/d/b/dbdc564bd4335e3190b0c3beed437b36cfd418cb.gif\",\n    \"icons-sprite\": \"/uploads/default/original/1X/f12ce05b66e5cb7eba2bb0dbf1aa2712ef206865.svg\",\n    \"tenor-logo\": \"/uploads/default/original/3X/7/a/7aab078ffae237ff5522c7a9c32482985f4f1131.png\"\n  }\n});\n","import { getObjectForTheme } from \"discourse/lib/theme-settings-store\";\n\nexport const settings = getObjectForTheme(88);\n\nexport function themePrefix(key) {\n  return `theme_translations.88.${key}`;\n}\n","/* eslint-disable */\nvar MiniMasonry = function(conf) {\n    this._sizes             = [];\n    this._columns           = [];\n    this._container         = null;\n    this._count             = null;\n    this._width             = 0;\n    this._removeListener    = null;\n    this._currentGutterX    = null;\n    this._currentGutterY    = null;\n\n    this._resizeTimeout = null,\n\n    this.conf = {\n        baseWidth: 255,\n        gutterX: null,\n        gutterY: null,\n        gutter: 10,\n        container: null,\n        minify: true,\n        ultimateGutter: 5,\n        surroundingGutter: true,\n        direction: 'ltr',\n        wedge: false\n    };\n\n    this.init(conf);\n\n    return this;\n}\n\nMiniMasonry.prototype.init = function(conf) {\n    for (var i in this.conf) {\n        if (conf[i] != undefined) {\n            this.conf[i] = conf[i];\n        }\n    }\n\n    if (this.conf.gutterX == null || this.conf.gutterY == null) {\n        this.conf.gutterX = this.conf.gutterY = this.conf.gutter;\n    }\n    this._currentGutterX = this.conf.gutterX;\n    this._currentGutterY = this.conf.gutterY;\n\n    this._container = typeof this.conf.container == 'object' && this.conf.container.nodeName ?\n        this.conf.container :\n        document.querySelector(this.conf.container);\n\n    if (!this._container) {\n        throw new Error('Container not found or missing');\n    }\n\n    var onResize = this.resizeThrottler.bind(this)\n    window.addEventListener(\"resize\", onResize);\n    this._removeListener = function() {\n        window.removeEventListener(\"resize\", onResize);\n        if (this._resizeTimeout != null) {\n            window.clearTimeout(this._resizeTimeout);\n            this._resizeTimeout = null;\n        }\n    }\n\n    this.layout();\n};\n\nMiniMasonry.prototype.reset = function() {\n    this._sizes   = [];\n    this._columns = [];\n    this._count   = null;\n    this._width   = this._container.clientWidth;\n    var minWidth  = this.conf.baseWidth;\n    if (this._width < minWidth) {\n        this._width = minWidth;\n        this._container.style.minWidth = minWidth + 'px';\n    }\n\n    if (this.getCount() == 1) {\n        // Set ultimate gutter when only one column is displayed\n        this._currentGutterX = this.conf.ultimateGutter;\n        // As gutters are reduced, two column may fit, forcing to 1\n        this._count = 1;\n    } else if (this._width < (this.conf.baseWidth + (2 * this._currentGutterX))) {\n        // Remove gutter when screen is to low\n        this._currentGutterX = 0;\n    } else {\n        this._currentGutterX = this.conf.gutterX;\n    }\n};\n\nMiniMasonry.prototype.getCount = function() {\n    if (this.conf.surroundingGutter) {\n        return Math.floor((this._width - this._currentGutterX) / (this.conf.baseWidth + this._currentGutterX));\n    }\n\n    return Math.floor((this._width + this._currentGutterX) / (this.conf.baseWidth + this._currentGutterX));\n}\n\nMiniMasonry.prototype.computeWidth = function() {\n    var width;\n    if (this.conf.surroundingGutter) {\n        width = ((this._width - this._currentGutterX) / this._count) - this._currentGutterX;\n    } else {\n        width = ((this._width + this._currentGutterX) / this._count) - this._currentGutterX;\n    }\n    width = Number.parseFloat(width.toFixed(2));\n\n    return width;\n}\n\nMiniMasonry.prototype.layout =  function() {\n    if (!this._container) {\n        console.error('Container not found');\n        return;\n    }\n    this.reset();\n\n    //Computing columns count\n    if (this._count == null) {\n        this._count = this.getCount();\n    }\n    //Computing columns width\n    var colWidth = this.computeWidth();\n\n    for (var i = 0; i < this._count; i++) {\n        this._columns[i] = 0;\n    }\n\n    //Saving children real heights\n    var children = this._container.children;\n    for (var k = 0;k< children.length; k++) {\n        // Set colWidth before retrieving element height if content is proportional\n        children[k].style.width = colWidth + 'px';\n        this._sizes[k] = children[k].clientHeight;\n    }\n\n    var startX;\n    if (this.conf.direction == 'ltr') {\n        startX = this.conf.surroundingGutter ? this._currentGutterX : 0;\n    } else {\n        startX = this._width - (this.conf.surroundingGutter ? this._currentGutterX : 0);\n    }\n    if (this._count > this._sizes.length) {\n        //If more columns than children\n        var occupiedSpace = (this._sizes.length * (colWidth + this._currentGutterX)) - this._currentGutterX;\n        if (this.conf.wedge === false) {\n            if (this.conf.direction == 'ltr') {\n                startX = ((this._width - occupiedSpace) / 2);\n            } else {\n                startX = this._width - ((this._width - occupiedSpace) / 2);\n            }\n        } else {\n            if (this.conf.direction == 'ltr') {\n                //\n            } else {\n                startX = this._width - this._currentGutterX;\n            }\n        }\n    }\n\n    //Computing position of children\n    for (var index = 0;index < children.length; index++) {\n        var nextColumn = this.conf.minify ? this.getShortest() : this.getNextColumn(index);\n\n        var childrenGutter = 0;\n        if (this.conf.surroundingGutter || nextColumn != this._columns.length) {\n            childrenGutter = this._currentGutterX;\n        }\n        var x;\n        if (this.conf.direction == 'ltr') {\n            x = startX + ((colWidth + childrenGutter) * (nextColumn));\n        } else {\n            x = startX - ((colWidth + childrenGutter) * (nextColumn)) - colWidth;\n        }\n        var y = this._columns[nextColumn];\n\n\n        children[index].style.transform = 'translate3d(' + Math.round(x) + 'px,' + Math.round(y) + 'px,0)';\n\n        this._columns[nextColumn] += this._sizes[index] + (this._count > 1 ? this.conf.gutterY : this.conf.ultimateGutter);//margin-bottom\n    }\n\n    this._container.style.height = (this._columns[this.getLongest()] - this._currentGutterY) + 'px';\n};\n\nMiniMasonry.prototype.getNextColumn = function(index) {\n    return index % this._columns.length;\n};\n\nMiniMasonry.prototype.getShortest = function() {\n    var shortest = 0;\n    for (var i = 0; i < this._count; i++) {\n        if (this._columns[i] < this._columns[shortest]) {\n            shortest = i;\n        }\n    }\n\n    return shortest;\n};\n\nMiniMasonry.prototype.getLongest = function() {\n    var longest = 0;\n    for (var i = 0; i < this._count; i++) {\n        if (this._columns[i] > this._columns[longest]) {\n            longest = i;\n        }\n    }\n\n    return longest;\n};\n\nMiniMasonry.prototype.resizeThrottler = function() {\n    // ignore resize events as long as an actualResizeHandler execution is in the queue\n    if ( !this._resizeTimeout ) {\n\n        this._resizeTimeout = setTimeout(function() {\n            this._resizeTimeout = null;\n            //IOS Safari throw random resize event on scroll, call layout only if size has changed\n            if (this._container.clientWidth != this._width) {\n                this.layout();\n            }\n           // The actualResizeHandler will execute at a rate of 30fps\n        }.bind(this), 33);\n    }\n}\n\nMiniMasonry.prototype.destroy = function() {\n    if (typeof this._removeListener == \"function\") {\n        this._removeListener();\n    }\n\n    var children = this._container.children;\n    for (var k = 0;k< children.length; k++) {\n        children[k].style.removeProperty('width');\n        children[k].style.removeProperty('transform');\n    }\n    this._container.style.removeProperty('height');\n    this._container.style.removeProperty('min-width');\n}\n\nexport default MiniMasonry;\n","import Component from \"@glimmer/component\";\nimport { fn } from \"@ember/helper\";\nimport { on } from \"@ember/modifier\";\nimport { action } from \"@ember/object\";\nimport { htmlSafe } from \"@ember/template\";\n\nexport default class GifResult extends Component {\n  get style() {\n    const { width, height } = this.args.gif;\n\n    if (width && height) {\n      return htmlSafe(`--aspect-ratio: ${width / height};`);\n    }\n  }\n\n  @action\n  keyDown(event) {\n    if (event.key === \"Enter\") {\n      this.args.pick(this.args.gif);\n    }\n  }\n\n  <template>\n    <div\n      {{on \"click\" (fn @pick @gif)}}\n      {{on \"keydown\" this.keyDown}}\n      role=\"button\"\n      tabindex=\"0\"\n      class=\"gif-imgwrap\"\n    >\n      <img\n        class=\"gif-img\"\n        alt={{@gif.title}}\n        title={{@gif.title}}\n        src={{@gif.preview}}\n        style={{this.style}}\n        width={{@gif.width}}\n        height={{@gif.height}}\n      />\n    </div>\n  </template>\n}\n","import Component from \"@glimmer/component\";\nimport { action } from \"@ember/object\";\nimport didInsert from \"@ember/render-modifiers/modifiers/did-insert\";\nimport didUpdate from \"@ember/render-modifiers/modifiers/did-update\";\nimport { schedule } from \"@ember/runloop\";\nimport { service } from \"@ember/service\";\nimport ConditionalLoadingSpinner from \"discourse/components/conditional-loading-spinner\";\nimport MiniMasonry from \"../lib/minimasonry\";\nimport GifResult from \"./gif-result\";\n\nexport default class GifResultList extends Component {\n  @service site;\n\n  observer;\n  masonry;\n\n  willDestroy() {\n    super.willDestroy(...arguments);\n    this.observer.disconnect();\n  }\n\n  @action\n  setup() {\n    this.observer = new IntersectionObserver(() => {\n      const scroller = document.querySelector(\".gif-content\");\n      // ensure we don't load more if we haven't scrolled at all\n      if (scroller?.scrollTop > 0 && this.args.content?.length > 0) {\n        this.args.loadMore();\n      }\n    });\n\n    let target = document.querySelector(\"div.gif-box div.loading-container\");\n    this.observer.observe(target);\n\n    this.masonry = new MiniMasonry({\n      container: \".gif-result-list\",\n      baseWidth: this.site.mobileView ? 145 : 200,\n      surroundingGutter: false,\n    });\n\n    schedule(\"afterRender\", () => this.masonry.layout());\n  }\n\n  @action\n  update() {\n    schedule(\"afterRender\", () => this.masonry.layout());\n  }\n\n  <template>\n    <div\n      {{didInsert this.setup}}\n      {{didUpdate this.update @content}}\n      class=\"gif-result-list\"\n    >\n      {{#each @content as |result|}}\n        <GifResult @gif={{result}} @pick={{@pick}} />\n      {{/each}}\n\n      <ConditionalLoadingSpinner @condition={{this.loading}} />\n    </div>\n  </template>\n}\n","import Component from \"@glimmer/component\";\nimport { tracked } from \"@glimmer/tracking\";\nimport { Input } from \"@ember/component\";\nimport { on } from \"@ember/modifier\";\nimport { action } from \"@ember/object\";\nimport { service } from \"@ember/service\";\nimport DModal from \"discourse/components/d-modal\";\nimport loadingSpinner from \"discourse/helpers/loading-spinner\";\nimport discourseDebounce from \"discourse/lib/debounce\";\nimport { i18n } from \"discourse-i18n\";\nimport GifResultList from \"../gif-result-list\";\n\nexport default class Gif extends Component {\n  @service appEvents;\n  @service dialog;\n\n  @tracked currentGifs = [];\n  @tracked loading = false;\n  @tracked offset = 0;\n  @tracked query = \"\";\n\n  get providerLogo() {\n    return settings.theme_uploads[`${settings.api_provider}-logo`];\n  }\n\n  @action\n  pick(content) {\n    let markup = [\n      \"\\n\",\n      `![${content.title}|${content.width}x${content.height}](${content.original})`,\n      \"\\n\",\n    ].join(\"\");\n\n    if (this.args.model?.customPickHandler) {\n      this.args.model.customPickHandler(markup);\n    } else {\n      this.appEvents.trigger(\"composer:insert-text\", markup);\n    }\n\n    this.args.closeModal();\n  }\n\n  @action\n  async loadMore() {\n    if (!this.loading) {\n      await this.search(false);\n    }\n  }\n\n  @action\n  refresh(event) {\n    this.query = event.target.value;\n    discourseDebounce(this, this.search, 700);\n  }\n\n  async search(clearResults = true) {\n    if (clearResults) {\n      this.currentGifs = [];\n      this.offset = 0;\n    }\n\n    // Check for minimum search query and if search result limit was set & reached\n    if (\n      (this.query.length > 2 && !settings.limit_infinite_search_results) ||\n      (settings.limit_infinite_search_results &&\n        this.currentGifs.length < settings.max_results_limit)\n    ) {\n      this.loading = true;\n\n      try {\n        if (\n          (settings.api_provider === \"tenor\" &&\n            settings.tenor_api_key === \"\") ||\n          (settings.api_provider === \"giphy\" && settings.giphy_api_key === \"\")\n        ) {\n          throw new Error(`${settings.api_provider.toUpperCase()} API key is not set. Site Admins, \\\n            please visit the \"Discourse Gifs\" theme-component topic on Discourse Meta \\\n            for setup instructions.`);\n        }\n\n        const response = await fetch(this.getEndpoint(this.query, this.offset));\n\n        if (this.isDestroying || this.isDestroyed) {\n          return;\n        }\n\n        if (!response.ok) {\n          // Use the same errorMsg variable to handle variable replacement at the end for API Provider Display Name $api_provider.\n          let errorMsg;\n\n          // Only check for certain errors if setting is configured to do so.\n          // This is to allow server admins time & the choice to update the custom messages. Existing Plugin users will have this setting disabled by default.\n          if (response.status === 429) {\n            errorMsg = i18n(themePrefix(\"gif.error_rate_limit\"));\n          } else if (response.status === 414) {\n            errorMsg = i18n(themePrefix(\"gif.error_search_too_long\"));\n          } else if (response.status === 403 || response.status === 401) {\n            errorMsg = i18n(themePrefix(\"gif.bad_api_key\"));\n          }\n\n          // Parse Error Messages from Tenor if one isn't set yet\n          if (\n            !errorMsg &&\n            settings.api_provider === \"tenor\" &&\n            response.headers.get(\"content-type\")?.includes(\"application/json\")\n          ) {\n            const errorResponse = await response.json();\n\n            // Check for API Key Errors first\n            if (\n              errorResponse.error.details.find(\n                (e) => e.reason === \"API_KEY_INVALID\"\n              ) !== undefined\n            ) {\n              errorMsg = i18n(themePrefix(\"gif.bad_api_key\"));\n            } else {\n              // Map Error Message according to default Google API standards\n              throw new Error(\n                `Tenor Error Code ${errorResponse.error.code}: ${\n                  errorResponse.error.message\n                } [${errorResponse.error.details\n                  .map((e) => e.reason)\n                  .join(\", \")}]`\n              );\n            }\n          }\n\n          // If error message is set, check if the API Provider variable was used.\n          // Replace if needed - throw at the end of it.\n          if (errorMsg) {\n            throw new Error(\n              errorMsg.replaceAll(\n                \"$api_provider\",\n                settings.api_provider.toUpperCase()\n              )\n            );\n          } else {\n            // Fallback to returning the entire response along with a status code.\n            throw new Error(\n              `${settings.api_provider.toUpperCase()} Status ${\n                response.status\n              }: ${await response.text()}`\n            );\n          }\n        }\n\n        const data = await response.json();\n        if (this.isDestroying || this.isDestroyed) {\n          return;\n        }\n\n        let images;\n\n        if (settings.api_provider === \"giphy\") {\n          // Giphy\n          images = data.data.map((gif) => ({\n            title: gif.title,\n            preview:\n              settings.giphy_file_format === \"webp\"\n                ? gif.images.fixed_width.webp\n                : gif.images.fixed_width.url,\n            original:\n              settings.giphy_file_format === \"webp\"\n                ? gif.images.original.webp\n                : gif.images.original.url,\n            width: gif.images.original.width,\n            height: gif.images.original.height,\n          }));\n        } else {\n          // Tenor\n          images = data.results.map((gif) => {\n            // Use tinygif as default for previews and \"preview\" as a backup\n            const hasTinyGif = \"tinygif\" in gif.media_formats;\n\n            // Use user-defined file format for attached GIFS and \"preview\" as a backup\n            const media_format =\n              settings.tenor_file_detail in gif.media_formats\n                ? gif.media_formats[`${settings.tenor_file_detail}`]\n                : gif.media_formats.preview;\n\n            return {\n              title: gif.title,\n              preview: hasTinyGif\n                ? gif.media_formats.tinygif.url\n                : gif.media_formats.preview.url,\n              original: media_format.url,\n              width: media_format.dims[0],\n              height: media_format.dims[1],\n            };\n          });\n        }\n\n        // Handle offset differences between Giphy and Tenor\n        this.offset =\n          settings.api_provider === \"giphy\"\n            ? data.pagination.offset + data.pagination.count\n            : data.next === \"\"\n              ? 0\n              : data.next;\n\n        this.currentGifs.addObjects(images);\n      } catch (error) {\n        this.dialog.alert({ message: error });\n      } finally {\n        this.loading = false;\n      }\n    }\n  }\n\n  getEndpoint(query, offset) {\n    if (settings.api_provider === \"tenor\") {\n      let params = {\n        key: settings.tenor_api_key,\n        q: query,\n        country: settings.tenor_country,\n        locale: settings.tenor_locale,\n        contentfilter: settings.tenor_content_filter,\n        media_filter: settings.tenor_file_detail,\n        limit: 24,\n        pos: offset,\n      };\n\n      // Optional Parameter\n      if (settings.tenor_client_key !== \"\") {\n        params.client_key = settings.tenor_client_key;\n      }\n\n      // Include tinygif for preview and \"preview\" for backup.\n      params.media_filter +=\n        settings.tenor_file_detail !== \"tinygif\"\n          ? \",tinygif,preview\"\n          : \",preview\";\n\n      return (\n        \"https://tenor.googleapis.com/v2/search?\" + new URLSearchParams(params)\n      );\n    } else {\n      // GIPHY\n      return (\n        \"https://api.giphy.com/v1/gifs/search?\" +\n        new URLSearchParams({\n          limit: 24,\n          q: query,\n          offset,\n          api_key: settings.giphy_api_key,\n          lang: settings.giphy_locale,\n          rating: settings.giphy_content_rating,\n        })\n      );\n    }\n  }\n\n  <template>\n    <DModal\n      @title={{i18n (themePrefix \"gif.modal_title\")}}\n      @closeModal={{@closeModal}}\n      id=\"gif-modal\"\n      class=\"gif-modal\"\n    >\n      <:body>\n        <div class=\"gif-input\">\n          <Input {{on \"input\" this.refresh}} @type=\"text\" name=\"query\" />\n\n          {{#if this.loading}}\n            {{loadingSpinner size=\"small\"}}\n          {{/if}}\n        </div>\n\n        {{#if this.currentGifs}}\n          <div class=\"gif-content\">\n            <div class=\"gif-box\">\n              <GifResultList\n                @content={{this.currentGifs}}\n                @pick={{this.pick}}\n                @loadMore={{this.loadMore}}\n              />\n            </div>\n          </div>\n        {{else}}\n          <div class=\"gif-no-results\">{{i18n\n              (themePrefix \"gif.no_results\")\n            }}</div>\n        {{/if}}\n      </:body>\n\n      <:footer>\n        <img src={{this.providerLogo}} />\n      </:footer>\n    </DModal>\n  </template>\n}\n","import Component from \"@glimmer/component\";\nimport { on } from \"@ember/modifier\";\nimport { action } from \"@ember/object\";\nimport { service } from \"@ember/service\";\nimport icon from \"discourse/helpers/d-icon\";\nimport { i18n } from \"discourse-i18n\";\nimport GifModal from \"../components/modal/gif\";\n\nexport default class GifButton extends Component {\n  @service modal;\n\n  @action\n  showGifModal() {\n    this.modal.show(GifModal);\n  }\n\n  <template>\n    <button\n      type=\"button\"\n      class=\"btn btn-default no-text mobile-gif-insert\"\n      aria-label={{i18n (themePrefix \"gif.composer_title\")}}\n      {{on \"click\" this.showGifModal}}\n    >\n      {{icon \"discourse-gifs-gif\"}}\n    </button>\n  </template>\n}\n","import Component from \"@ember/component\";\nimport { tagName } from \"@ember-decorators/component\";\nimport GifButton from \"../../components/gif-button\";\n\n@tagName(\"\")\nexport default class MobileGifButton extends Component {\n  <template><GifButton /></template>\n}\n","import { action } from \"@ember/object\";\nimport { service } from \"@ember/service\";\nimport { withPluginApi } from \"discourse/lib/plugin-api\";\nimport GifModal from \"../components/modal/gif\";\n\nexport default {\n  name: \"discourse-gifs\",\n\n  initialize(container) {\n    withPluginApi(\"0.1\", (api) => {\n      if (!api.container.lookup(\"service:site\").mobileView) {\n        api.onToolbarCreate((toolbar) => {\n          if (toolbar.context.composerEvents) {\n            toolbar.addButton({\n              title: themePrefix(\"gif.composer_title\"),\n              id: \"gif_button\",\n              group: \"extras\",\n              icon: \"discourse-gifs-gif\",\n              action: () => {\n                const modal = api.container.lookup(\"service:modal\");\n                modal.show(GifModal);\n              },\n            });\n          }\n        });\n      }\n\n      const chat = api.container.lookup(\"service:chat\");\n      if (chat) {\n        api.registerChatComposerButton?.({\n          translatedLabel: themePrefix(\"gif.composer_title\"),\n          id: \"gif_button\",\n          icon: \"discourse-gifs-gif\",\n          action: \"showChatGifModal\",\n          position: \"dropdown\",\n        });\n\n        api.modifyClass(\n          \"component:chat-composer\",\n          (Superclass) =>\n            class extends Superclass {\n              @service modal;\n\n              @action\n              showChatGifModal(context) {\n                this.modal.show(GifModal, {\n                  model: {\n                    customPickHandler: (message) => {\n                      api.sendChatMessage(this.draft.channel.id, {\n                        message,\n                        threadId:\n                          context === \"thread\" ? this.draft.thread.id : null,\n                      });\n                    },\n                  },\n                });\n              }\n            }\n        );\n      }\n    });\n\n    // for old tenor gifs compat\n    const caps = container.lookup(\"service:capabilities\");\n    if (caps.isSafari || caps.isIOS) {\n      document.documentElement.classList.add(\"discourse-gifs-with-img\");\n    }\n  },\n};\n","import \"virtual:init-settings\";\n\nconst themeCompatModules = {};\nimport * as Mod1 from \"./discourse/components/gif-button\";\nthemeCompatModules[\"discourse/components/gif-button\"] = Mod1;\n\nimport * as Mod2 from \"./discourse/components/gif-result\";\nthemeCompatModules[\"discourse/components/gif-result\"] = Mod2;\n\nimport * as Mod3 from \"./discourse/components/gif-result-list\";\nthemeCompatModules[\"discourse/components/gif-result-list\"] = Mod3;\n\nimport * as Mod4 from \"./discourse/components/modal/gif\";\nthemeCompatModules[\"discourse/components/modal/gif\"] = Mod4;\n\nimport * as Mod5 from \"./discourse/connectors/composer-mobile-buttons-bottom/mobile-gif-button\";\nthemeCompatModules[\"discourse/connectors/composer-mobile-buttons-bottom/mobile-gif-button\"] = Mod5;\n\nimport * as Mod6 from \"./discourse/initializers/gif-integration\";\nthemeCompatModules[\"discourse/initializers/gif-integration\"] = Mod6;\n\nimport * as Mod7 from \"./discourse/lib/minimasonry\";\nthemeCompatModules[\"discourse/lib/minimasonry\"] = Mod7;\n\nexport default themeCompatModules;\n"],"names":["registerSettings","api_provider","giphy_api_key","giphy_file_format","giphy_content_rating","giphy_locale","limit_infinite_search_results","max_results_limit","tenor_api_key","tenor_client_key","tenor_file_detail","tenor_content_filter","tenor_country","tenor_locale","theme_uploads","settings","getObjectForTheme","themePrefix","key","MiniMasonry","conf","this","_sizes","_columns","_container","_count","_width","_removeListener","_currentGutterX","_currentGutterY","_resizeTimeout","baseWidth","gutterX","gutterY","gutter","container","minify","ultimateGutter","surroundingGutter","direction","wedge","init","prototype","i","undefined","nodeName","document","querySelector","Error","onResize","resizeThrottler","bind","window","addEventListener","removeEventListener","clearTimeout","layout","reset","clientWidth","minWidth","style","getCount","Math","floor","computeWidth","width","Number","parseFloat","toFixed","colWidth","startX","children","k","length","clientHeight","occupiedSpace","index","x","nextColumn","getShortest","getNextColumn","childrenGutter","y","transform","round","height","getLongest","console","error","shortest","longest","setTimeout","destroy","removeProperty","GifResult","Component","args","gif","htmlSafe","keyDown","event","pick","static","dt7948","n","action","setComponentTemplate","createTemplateFactory","id","block","moduleName","scope","on","fn","isStrictMode","GifResultList","g","service","site","observer","masonry","willDestroy","super","arguments","disconnect","setup","IntersectionObserver","scroller","scrollTop","content","loadMore","target","observe","mobileView","schedule","update","didInsert","didUpdate","ConditionalLoadingSpinner","Gif","appEvents","dialog","tracked","currentGifs","loading","offset","query","providerLogo","markup","title","original","join","model","customPickHandler","trigger","closeModal","search","refresh","value","discourseDebounce","toUpperCase","response","fetch","getEndpoint","isDestroying","isDestroyed","ok","errorMsg","status","i18n","headers","get","includes","errorResponse","json","details","find","e","reason","code","message","map","replaceAll","text","data","images","preview","fixed_width","webp","url","results","hasTinyGif","media_formats","media_format","tinygif","dims","pagination","count","next","addObjects","alert","params","q","country","locale","contentfilter","media_filter","limit","pos","client_key","URLSearchParams","api_key","lang","rating","DModal","Input","loadingSpinner","GifButton","modal","showGifModal","show","GifModal","icon","MobileGifButton","c","tagName","gifIntegration","name","initialize","withPluginApi","api","lookup","onToolbarCreate","toolbar","context","composerEvents","addButton","group","registerChatComposerButton","translatedLabel","position","modifyClass","Superclass","showChatGifModal","sendChatMessage","draft","channel","threadId","thread","caps","isSafari","isIOS","documentElement","classList","add","themeCompatModules","Mod1","Mod2","Mod3","Mod4","Mod5","Mod6","Mod7"],"mappings":";AAEAA,EAAiB,GAAI,CACnBC,aAAgB,QAChBC,cAAiB,mCACjBC,kBAAqB,OACrBC,qBAAwB,IACxBC,aAAgB,KAChBC,+BAAiC,EACjCC,kBAAqB,IACrBC,cAAiB,GACjBC,iBAAoB,YACpBC,kBAAqB,MACrBC,qBAAwB,OACxBC,cAAiB,KACjBC,aAAgB,QAChBC,cAAiB,CACf,aAAc,2GACd,eAAgB,4EAChB,aAAc;ACjBX,MAAMC,EAAWC,EAAkB;AAEnC,SAASC,EAAYC,GAC1B,MAAO,yBAAyBA,GAClC,CCLA,IAAIC,EAAc,SAASC,GA2BvB,OA1BAC,KAAKC,OAAqB,GAC1BD,KAAKE,SAAqB,GAC1BF,KAAKG,WAAqB,KAC1BH,KAAKI,OAAqB,KAC1BJ,KAAKK,OAAqB,EAC1BL,KAAKM,gBAAqB,KAC1BN,KAAKO,gBAAqB,KAC1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