"use strict";
const common_vendor = require("../../common/vendor.js");
const TUIKit_tuiCustomerServicePlugin_utils_index = require("./utils/index.js");
const MessageCustomerService = () => "./components/message-customer-service.js";
const MessageRating = () => "./components/message-rating/index.js";
const _sfc_main = {
  components: {
    MessageCustomerService,
    MessageRating
  },
  props: {
    message: {
      type: Object,
      default: () => ({})
    }
  },
  setup(props) {
    const sendTextMessage = (payload) => {
      common_vendor.R.callService({
        serviceName: common_vendor.E.TUIChat.SERVICE.NAME,
        method: common_vendor.E.TUIChat.SERVICE.METHOD.SEND_TEXT_MESSAGE,
        params: { payload }
      });
    };
    const sendCustomMessage = (payload) => {
      common_vendor.R.callService({
        serviceName: common_vendor.E.TUIChat.SERVICE.NAME,
        method: common_vendor.E.TUIChat.SERVICE.METHOD.SEND_CUSTOM_MESSAGE,
        params: { payload }
      });
    };
    return {
      props,
      sendTextMessage,
      sendCustomMessage,
      isCustomerServiceMessage: TUIKit_tuiCustomerServicePlugin_utils_index.isCustomerServiceMessage,
      isMessageRating: TUIKit_tuiCustomerServicePlugin_utils_index.isMessageRating
    };
  }
};
if (!Array) {
  const _component_MessageRating = common_vendor.resolveComponent("MessageRating");
  const _component_MessageCustomerService = common_vendor.resolveComponent("MessageCustomerService");
  (_component_MessageRating + _component_MessageCustomerService)();
}
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
  return common_vendor.e({
    a: $setup.isMessageRating($setup.props.message)
  }, $setup.isMessageRating($setup.props.message) ? {
    b: common_vendor.o$1($setup.sendCustomMessage),
    c: common_vendor.p({
      message: $setup.props.message
    })
  } : $setup.isCustomerServiceMessage($setup.props.message) ? {
    e: common_vendor.o$1($setup.sendTextMessage),
    f: common_vendor.p({
      message: $setup.props.message
    })
  } : {}, {
    d: $setup.isCustomerServiceMessage($setup.props.message)
  });
}
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["render", _sfc_render]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../.sourcemap/mp-weixin/TUIKit/tui-customer-service-plugin/index.js.map
