"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
const common_libraries_upload = require("../../common/libraries/upload.js");
require("../../gen/Apis.js");
require("../../common/libraries/request.js");
require("../../common/store/useWeAppAuthStore.js");
require("../../common/libraries/apiLoading.js");
require("../../common/store/useWatermarkStore.js");
require("../../common/store/useWorkStore.js");
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "hs-upload-id-card",
  props: [
    "valueFrontModel",
    "valueBackModel",
    "size",
    "display",
    "borderTop",
    "length",
    "required",
    "mediaType",
    "labelTitle",
    "count",
    "styles",
    "hasCover",
    "iconName",
    "iconSize"
  ],
  emits: ["update:valueFrontModel", "update:valueBackModel"],
  setup(__props, { emit }) {
    const props = __props;
    const frontImg = common_vendor.ref({});
    const backImg = common_vendor.ref({});
    const handleUpload = async (type) => {
      const res = await common_libraries_upload.upload(1, 4, (props == null ? void 0 : props.mediaType) || ["image"]);
      console.log(res, "res32");
      if (type === 1) {
        frontImg.value = res[0];
        emit("update:valueFrontModel", res);
      }
      if (type === 2) {
        backImg.value = res[0];
        emit("update:valueBackModel", res);
      }
    };
    return (_ctx, _cache) => {
      var _a, _b, _c, _d, _e, _f;
      return common_vendor.e({
        a: props == null ? void 0 : props.required
      }, (props == null ? void 0 : props.required) ? {} : {}, {
        b: !((_a = frontImg.value) == null ? void 0 : _a.url)
      }, !((_b = frontImg.value) == null ? void 0 : _b.url) ? {
        c: common_assets._imports_0
      } : {
        d: (_c = frontImg.value) == null ? void 0 : _c.url
      }, {
        e: common_vendor.o(($event) => handleUpload(1)),
        f: common_vendor.s(props == null ? void 0 : props.styles),
        g: !((_d = backImg.value) == null ? void 0 : _d.url)
      }, !((_e = backImg.value) == null ? void 0 : _e.url) ? {
        h: common_assets._imports_1
      } : {
        i: (_f = backImg.value) == null ? void 0 : _f.url
      }, {
        j: common_vendor.o(($event) => handleUpload(2)),
        k: common_vendor.s(props == null ? void 0 : props.styles),
        l: props.borderTop ? "1rpx solid #eee" : ""
      });
    };
  }
});
const Component = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-1ecf7582"], ["__file", "/Users/zsq/Sources/github/2025property-pay/pay-employee/src/components/hs-upload-id-card/hs-upload-id-card.vue"]]);
wx.createComponent(Component);
