import { defineComponent, openBlock, createBlock, unref, createElementBlock, normalizeClass, createElementVNode, createCommentVNode, toDisplayString, createVNode, render, markRaw, defineAsyncComponent, computed, renderSlot, Fragment, renderList, normalizeStyle, withModifiers, resolveDynamicComponent, mergeProps, toHandlers } from "vue";
import { showConfirmDialog, closeDialog } from "vant";
import WlSvg from "@wltech/svg";
var employeeSelector = {
  employeeData: null,
  topFiveEmployeeData: null,
  organization: null,
  organization_count: null,
  count: 0,
  dept_list: [],
  company_list: [],
  company_list_count: 0,
  companyEmployeeList: [],
  totalCompanyEmployeeList: [],
  totalCompanyEmployeeObjList: []
};
const Store = {
  sid: "",
  app_id: "",
  user_id: "",
  user_name: "",
  corp_id: "",
  node_env: "",
  domain: "",
  token: "",
  card_resource: "",
  employeeSelector
};
var Store$1 = new Proxy(Store, {
  get(target, name, property) {
    return Reflect.get(target, name, property);
  },
  set(target, name, value, property) {
    return Reflect.set(target, name, value, property);
  }
});
const __default__$1 = {
  name: "WlSvgIcon"
};
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
  ...__default__$1,
  props: {
    type: { default: "" },
    color: { default: "var(--wl-text-color-title-1)" },
    width: { default: "16" },
    height: { default: "16" }
  },
  setup(__props) {
    const sub = location.origin;
    return (_ctx, _cache) => {
      return openBlock(), createBlock(unref(WlSvg), {
        type: __props.type,
        width: __props.width,
        height: __props.height,
        color: __props.color,
        sub: unref(sub)
      }, null, 8, ["type", "width", "height", "color", "sub"]);
    };
  }
});
var index_vue_vue_type_style_index_0_lang = "";
const _hoisted_1$1 = { class: "icon" };
const _hoisted_2$1 = { class: "text" };
const __default__ = {
  name: "WlNotice"
};
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
  ...__default__,
  props: {
    show_toast: { type: Boolean, default: true },
    message: { default: "" },
    type: { default: "success" },
    duration: { default: 1500 }
  },
  setup(__props) {
    return (_ctx, _cache) => {
      return __props.show_toast ? (openBlock(), createElementBlock("div", {
        key: 0,
        class: normalizeClass(`notice ${__props.type}`),
        "data-weiling-mobile-ui-wl-notice": ""
      }, [
        createElementVNode("div", _hoisted_1$1, [
          __props.type === "success" ? (openBlock(), createBlock(_sfc_main$2, {
            key: 0,
            type: "successFill",
            width: "24",
            height: "24",
            color: "#45ce03"
          })) : __props.type === "warning" ? (openBlock(), createBlock(_sfc_main$2, {
            key: 1,
            type: "warningFill",
            width: "24",
            height: "24",
            color: "#f3a401"
          })) : __props.type === "alert" ? (openBlock(), createBlock(_sfc_main$2, {
            key: 2,
            type: "tipsFill",
            width: "24",
            height: "24",
            color: "#1b9fff"
          })) : __props.type === "error" ? (openBlock(), createBlock(_sfc_main$2, {
            key: 3,
            type: "closeFill",
            width: "24",
            height: "24",
            color: "#ff2a2d"
          })) : createCommentVNode("", true)
        ]),
        createElementVNode("p", _hoisted_2$1, toDisplayString(__props.message), 1)
      ], 2)) : createCommentVNode("", true);
    };
  }
});
let mountNode = null;
var WlNotice = (options) => {
  const duration = options.duration | 2e3;
  if (mountNode) {
    document.body.removeChild(mountNode);
    mountNode = null;
  }
  const app = createVNode(_sfc_main$1, {
    ...options,
    duration,
    show_toast: true
  });
  const timer = setTimeout(() => {
    if (mountNode) {
      document.body.removeChild(mountNode);
      mountNode = null;
    }
    clearTimeout(timer);
  }, duration);
  mountNode = document.createElement("div");
  render(app, mountNode);
  document.body.appendChild(mountNode);
};
const useMessage = () => {
  const duration = 3e3;
  const onNotify2 = (message) => {
    WlNotice({ message, type: "success", duration });
  };
  const onError = (message) => {
    WlNotice({ message, type: "error", duration });
  };
  const onWarning = (message) => {
    WlNotice({ message, type: "warning", duration });
  };
  const onConfirm = (params) => {
    return new Promise((resolve, reject) => {
      const filter_params = {
        className: "vant-confirm-z-index",
        overlayClass: "vant-overlay-z-index",
        ...params
      };
      showConfirmDialog(filter_params).then(resolve, reject);
    });
  };
  const onConfirmCancel = () => {
    closeDialog();
  };
  return {
    onNotify: onNotify2,
    onError,
    onConfirm,
    onWarning,
    onConfirmCancel
  };
};
const { onNotify } = useMessage();
function useCopy(content) {
  try {
    const textarea = document.createElement("textarea");
    textarea.readOnly = "readonly";
    textarea.style.position = "absolute";
    textarea.style.left = "-9999px";
    textarea.value = content;
    document.body.appendChild(textarea);
    textarea.select();
    const result = document.execCommand("Copy");
    if (result) {
      onNotify("\u590D\u5236\u6210\u529F");
    }
    document.body.removeChild(textarea);
  } catch (e) {
    alert("\u590D\u5236\u5931\u8D25");
    throw Error(e);
  }
}
var index_vue_vue_type_style_index_0_scoped_true_lang = "";
var _export_sfc = (sfc, props) => {
  const target = sfc.__vccOpts || sfc;
  for (const [key, val] of props) {
    target[key] = val;
  }
  return target;
};
const _hoisted_1 = { class: "render-card" };
const _hoisted_2 = { class: "card-field" };
const _hoisted_3 = ["onClick"];
const _hoisted_4 = {
  key: 2,
  class: "row-right"
};
const _sfc_main = /* @__PURE__ */ defineComponent({
  __name: "index",
  props: {
    data: { default: () => {
      return {};
    } },
    list: { default: () => {
      return [];
    } },
    fieldConfig: { default: () => {
      return {};
    } },
    tenantConfig: { default: () => {
      return {};
    } },
    is_trial: { type: Boolean, default: false },
    env_data: { default: () => {
      return {};
    } }
  },
  setup(__props) {
    const props = __props;
    const componentDict = {
      USER_GROUPS: markRaw(
        defineAsyncComponent(() => import("./index3.js"))
      ),
      USERS: markRaw(
        defineAsyncComponent(() => import("./index6.js"))
      ),
      HANDLE_TEXT: markRaw(
        defineAsyncComponent(() => import("./index7.js"))
      ),
      BUSINESS_STAGE: markRaw(
        defineAsyncComponent(() => import("./index8.js"))
      ),
      IMAGE: markRaw(
        defineAsyncComponent(() => import("./index9.js"))
      ),
      TAGS: markRaw(
        defineAsyncComponent(() => import("./index10.js"))
      ),
      CONTACT_WAYS: markRaw(
        defineAsyncComponent(() => import("./index11.js"))
      ),
      COMPANY: markRaw(
        defineAsyncComponent(() => import("./index13.js"))
      ),
      BIND_FRIENDS: markRaw(
        defineAsyncComponent(() => import("./index14.js"))
      )
    };
    Store$1.corp_id = props.env_data.corp_id;
    Store$1.node_env = props.env_data.node_env;
    Store$1.sid = props.env_data.sid;
    Store$1.token = props.env_data.token;
    Store$1.card_resource = props.env_data.card_resource;
    const filterList = computed(() => {
      return props.list.filter((item) => item.hidden !== true);
    });
    const isEmpty = (data, item) => {
      if (["BIND_FRIENDS", "COMPANY"].includes(item.vType))
        return false;
      const val = data[item.key];
      return val === null || val === void 0 || val === "" || JSON.stringify(val) === "{}" || JSON.stringify(val) === "[]";
    };
    const onCopy = (content) => {
      useCopy(content);
    };
    return (_ctx, _cache) => {
      return openBlock(), createElementBlock("div", _hoisted_1, [
        renderSlot(_ctx.$slots, "card-title", {}, void 0, true),
        createElementVNode("div", _hoisted_2, [
          (openBlock(true), createElementBlock(Fragment, null, renderList(unref(filterList), (item, index) => {
            return openBlock(), createElementBlock("div", {
              class: "card-row",
              key: item.key || index
            }, [
              createElementVNode("span", {
                class: "row-left",
                style: normalizeStyle({ width: item.labelWidth })
              }, toDisplayString(item.label), 5),
              item.slot ? renderSlot(_ctx.$slots, item.slot, {
                key: 0,
                allData: __props.data,
                data: __props.data[item.key]
              }, void 0, true) : !isEmpty(__props.data, item) && !item.slot ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
                item.vType == "TEXT" || !item.vType ? (openBlock(), createElementBlock("span", {
                  key: 0,
                  class: normalizeClass(["row-right", { "a-row": item.aRow }])
                }, [
                  createElementVNode("span", {
                    class: normalizeClass({ "a-row": item.aRow })
                  }, toDisplayString(__props.data[item.key]), 3),
                  item.isCopy ? (openBlock(), createElementBlock("span", {
                    key: 0,
                    class: "copy-text",
                    onClick: withModifiers(($event) => onCopy(__props.data[item.key]), ["stop"])
                  }, "\u590D\u5236", 8, _hoisted_3)) : createCommentVNode("", true)
                ], 2)) : (openBlock(), createBlock(resolveDynamicComponent(componentDict[item.vType]), mergeProps({
                  key: 1,
                  data: __props.data[item.key],
                  listItem: item,
                  allData: __props.data,
                  fieldConfig: __props.fieldConfig,
                  tenantConfig: __props.tenantConfig,
                  is_trial: __props.is_trial,
                  env_data: __props.env_data
                }, { ..._ctx.$attrs, ...item }, toHandlers(item["event"] || {})), null, 16, ["data", "listItem", "allData", "fieldConfig", "tenantConfig", "is_trial", "env_data"]))
              ], 64)) : (openBlock(), createElementBlock("span", _hoisted_4, " -- "))
            ]);
          }), 128))
        ]),
        renderSlot(_ctx.$slots, "card-bottom", {}, void 0, true)
      ]);
    };
  }
});
var Comp = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-84336456"]]);
var __uno = "";
Comp.install = (app) => {
  app.component(Comp.name, Comp);
};
export { Comp as C, Store$1 as S, WlNotice as W, _export_sfc as _, _sfc_main$2 as a, useCopy as u };
