"use strict";
const common_vendor = require("../../../../../../common/vendor.js");
require("../../../../../adapter-vue.js");
const TUIKit_constant = require("../../../../../constant.js");
const TUIKit_utils_typeCheck = require("../../../../../utils/type-check.js");
const common_assets = require("../../../../../../common/assets.js");
if (!Math) {
  Icon();
}
const Icon = () => "../../../../common/Icon.js";
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "message-abstract-custom",
  props: {
    contentText: { default: () => [] },
    message: { default: () => ({}) },
    messageContent: { default: () => ({}) }
  },
  setup(__props) {
    var _a, _b;
    const props = __props;
    const custom = common_vendor.ref(
      (_a = props == null ? void 0 : props.message) == null ? void 0 : _a.payload
    );
    const extensionJSON = common_vendor.computed(() => {
      var _a2, _b2;
      return ((_a2 = custom == null ? void 0 : custom.value) == null ? void 0 : _a2.data) ? TUIKit_utils_typeCheck.JSONToObject(custom.value.data) : (_b2 = custom == null ? void 0 : custom.value) == null ? void 0 : _b2.data;
    });
    const businessID = common_vendor.computed(() => {
      var _a2;
      return (_a2 = extensionJSON == null ? void 0 : extensionJSON.value) == null ? void 0 : _a2.businessID;
    });
    const descriptionForShow = common_vendor.ref(props == null ? void 0 : props.contentText);
    const defaultMessageContent = common_vendor.ref(((_b = props == null ? void 0 : props.messageContent) == null ? void 0 : _b.custom) || "[自定义消息]");
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: common_vendor.unref(businessID) === common_vendor.unref(TUIKit_constant.CHAT_MSG_CUSTOM_TYPE).SERVICE
      }, common_vendor.unref(businessID) === common_vendor.unref(TUIKit_constant.CHAT_MSG_CUSTOM_TYPE).SERVICE ? common_vendor.e({
        b: common_vendor.t(common_vendor.unref(extensionJSON).title),
        c: common_vendor.unref(extensionJSON).hyperlinks_text
      }, common_vendor.unref(extensionJSON).hyperlinks_text ? {
        d: common_vendor.t(common_vendor.unref(extensionJSON).hyperlinks_text.key),
        e: common_vendor.unref(extensionJSON).hyperlinks_text.value
      } : {}, {
        f: common_vendor.unref(extensionJSON).item && common_vendor.unref(extensionJSON).item.length > 0
      }, common_vendor.unref(extensionJSON).item && common_vendor.unref(extensionJSON).item.length > 0 ? {
        g: common_vendor.f(common_vendor.unref(extensionJSON).item, (item, index, i0) => {
          return common_vendor.e({
            a: common_vendor.unref(TUIKit_utils_typeCheck.isUrl)(item.value)
          }, common_vendor.unref(TUIKit_utils_typeCheck.isUrl)(item.value) ? {
            b: common_vendor.t(item.key),
            c: item.value
          } : {
            d: common_vendor.t(item.key)
          }, {
            e: index
          });
        })
      } : {}, {
        h: common_vendor.f(common_vendor.unref(descriptionForShow), (contentItem, index, i0) => {
          return {
            a: common_vendor.t(contentItem.text),
            b: index,
            c: common_vendor.n(contentItem && contentItem.isHighlight ? "highlight" : "normal")
          };
        })
      }) : common_vendor.unref(businessID) === common_vendor.unref(TUIKit_constant.CHAT_MSG_CUSTOM_TYPE).EVALUATE ? common_vendor.e({
        j: common_vendor.f(common_vendor.unref(descriptionForShow), (contentItem, index, i0) => {
          return {
            a: common_vendor.t(contentItem.text),
            b: index,
            c: common_vendor.n(contentItem && contentItem.isHighlight ? "highlight" : "normal")
          };
        }),
        k: common_vendor.unref(extensionJSON).score
      }, common_vendor.unref(extensionJSON).score ? {
        l: common_vendor.f(Math.max(common_vendor.unref(extensionJSON).score, 0), (item, index, i0) => {
          return {
            a: "88d2ba7b-0-" + i0,
            b: index
          };
        }),
        m: common_vendor.p({
          file: common_vendor.unref(common_assets.star)
        })
      } : {}, {
        n: common_vendor.t(common_vendor.unref(extensionJSON).comment)
      }) : common_vendor.unref(businessID) === common_vendor.unref(TUIKit_constant.CHAT_MSG_CUSTOM_TYPE).ORDER ? {
        p: common_vendor.unref(extensionJSON).imageUrl,
        q: common_vendor.t(common_vendor.unref(extensionJSON).title),
        r: common_vendor.f(common_vendor.unref(descriptionForShow), (contentItem, index, i0) => {
          return {
            a: common_vendor.t(contentItem.text),
            b: index,
            c: common_vendor.n(contentItem && contentItem.isHighlight ? "highlight" : "normal")
          };
        }),
        s: common_vendor.t(common_vendor.unref(extensionJSON).price)
      } : common_vendor.unref(businessID) === common_vendor.unref(TUIKit_constant.CHAT_MSG_CUSTOM_TYPE).LINK ? {
        v: common_vendor.t(common_vendor.unref(extensionJSON).text),
        w: common_vendor.t(common_vendor.unref(common_vendor.Wt).t("message.custom.查看详情>>")),
        x: common_vendor.unref(extensionJSON).link
      } : {
        y: common_vendor.t(common_vendor.unref(defaultMessageContent))
      }, {
        i: common_vendor.unref(businessID) === common_vendor.unref(TUIKit_constant.CHAT_MSG_CUSTOM_TYPE).EVALUATE,
        o: common_vendor.unref(businessID) === common_vendor.unref(TUIKit_constant.CHAT_MSG_CUSTOM_TYPE).ORDER,
        t: common_vendor.unref(businessID) === common_vendor.unref(TUIKit_constant.CHAT_MSG_CUSTOM_TYPE).LINK,
        z: common_vendor.o$1(() => {
        })
      });
    };
  }
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-88d2ba7b"]]);
wx.createComponent(Component);
//# sourceMappingURL=../../../../../../../.sourcemap/mp-weixin/TUIKit/components/TUISearch/search-result/search-result-item/message-abstract/message-abstract-custom.js.map
