"use strict";
const common_vendor = require("../../../../../common/vendor.js");
require("../../../../adapter-vue.js");
const common_assets = require("../../../../../common/assets.js");
const TUIKit_components_TUIChat_utils_wordsList = require("../../utils/wordsList.js");
const TUIKit_components_TUIChat_utils_utils = require("../../utils/utils.js");
const TUIKit_utils_env = require("../../../../utils/env.js");
const TUIKit_components_TUIChat_config = require("../../config.js");
if (!Math) {
  ToolbarItemContainer();
}
const ToolbarItemContainer = () => "../toolbar-item-container/index.js";
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "index",
  emits: ["onDialogPopupShowOrHide"],
  setup(__props, { emit: __emit }) {
    const wordsIcon = TUIKit_components_TUIChat_config.ChatConfig.getTheme() === "dark" ? common_assets.wordsIconDark : common_assets.wordsIconLight;
    const emits = __emit;
    const currentConversation = common_vendor.ref();
    const container = common_vendor.ref();
    common_vendor.Jt.watch(common_vendor.o.CONV, {
      currentConversation: (conversation) => {
        currentConversation.value = conversation;
      }
    });
    const selectWord = (item) => {
      var _a, _b, _c, _d, _e, _f;
      const options = {
        to: ((_b = (_a = currentConversation == null ? void 0 : currentConversation.value) == null ? void 0 : _a.groupProfile) == null ? void 0 : _b.groupID) || ((_d = (_c = currentConversation == null ? void 0 : currentConversation.value) == null ? void 0 : _c.userProfile) == null ? void 0 : _d.userID),
        conversationType: (_e = currentConversation == null ? void 0 : currentConversation.value) == null ? void 0 : _e.type,
        payload: {
          text: common_vendor.Wt.t(`Words.${item.value}`)
        },
        needReadReceipt: TUIKit_components_TUIChat_utils_utils.isEnabledMessageReadReceiptGlobal()
      };
      common_vendor.Qt.sendTextMessage(options);
      (_f = container == null ? void 0 : container.value) == null ? void 0 : _f.toggleDialogDisplay(false);
    };
    const closeDialog = () => {
      var _a;
      (_a = container == null ? void 0 : container.value) == null ? void 0 : _a.toggleDialogDisplay(false);
    };
    const onDialogShow = () => {
      emits("onDialogPopupShowOrHide", true);
    };
    const onDialogClose = () => {
      emits("onDialogPopupShowOrHide", false);
    };
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("Words.常用语-快捷回复工具")),
        b: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "words-h5-header-title"),
        c: !common_vendor.unref(TUIKit_utils_env.isPC)
      }, !common_vendor.unref(TUIKit_utils_env.isPC) ? {
        d: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "words-h5-header-close"),
        e: common_vendor.o$1(closeDialog)
      } : {}, {
        f: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "words-h5-header"),
        g: common_vendor.f(common_vendor.unref(TUIKit_components_TUIChat_utils_wordsList.wordsList), (item, index, i0) => {
          return {
            a: common_vendor.t(common_vendor.unref(common_vendor.Wt).t(`Words.${item.value}`)),
            b: index,
            c: common_vendor.o$1(($event) => selectWord(item), index)
          };
        }),
        h: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "words-h5-list-item"),
        i: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "words-h5-list"),
        j: common_vendor.n(!common_vendor.unref(TUIKit_utils_env.isPC) && "words-h5"),
        k: common_vendor.sr(container, "ac0e1580-0", {
          "k": "container"
        }),
        l: common_vendor.o$1(onDialogShow),
        m: common_vendor.o$1(onDialogClose),
        n: common_vendor.p({
          iconFile: common_vendor.unref(wordsIcon),
          title: "常用语",
          needBottomPopup: true,
          iconWidth: common_vendor.unref(TUIKit_utils_env.isUniFrameWork) ? "26px" : "20px",
          iconHeight: common_vendor.unref(TUIKit_utils_env.isUniFrameWork) ? "26px" : "20px"
        })
      });
    };
  }
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-ac0e1580"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../../.sourcemap/mp-weixin/TUIKit/components/TUIChat/message-input-toolbar/words/index.js.map
