import { ref as T, reactive as te, watch as Ce, watchEffect as Le, unref as u, defineComponent as O, toRefs as Fe, createVNode as f, isVNode as Gt, getCurrentInstance as ze, inject as Xt, computed as D, onUnmounted as Re, h as F, provide as Nt, onMounted as Be, nextTick as B, onBeforeUnmount as Vt, resolveComponent as z, openBlock as h, createElementBlock as x, createElementVNode as I, normalizeClass as X, normalizeStyle as pe, createBlock as _, resolveDynamicComponent as Tt, withCtx as N, renderSlot as U, Fragment as re, createCommentVNode as q, mergeProps as oe, readonly as Jt, resolveDirective as qt, withDirectives as Kt, createTextVNode as V, toDisplayString as b, useSlots as en, toRef as tn, createSlots as Xe, renderList as ye, normalizeProps as Ve, guardReactiveProps as Je, toRaw as Te, render as ht, pushScopeId as nn, popScopeId as on } from "vue";
import { FullscreenExitOutlined as ln, FullscreenOutlined as rn, CloseOutlined as Dt, InfoCircleOutlined as an, LeftOutlined as sn, RightOutlined as cn, MailOutlined as vt, InfoCircleFilled as qe, CheckCircleFilled as un, CloseCircleFilled as dn, FilePptOutlined as Ke, FileExcelOutlined as gn, FileWordOutlined as Mn, FileJpgOutlined as fn, FileGifOutlined as pn, FileTextOutlined as yn, FilePdfOutlined as mn, FileOutlined as Ln, EyeOutlined as In, DownloadOutlined as jn } from "@ant-design/icons-vue";
import { Modal as K, Tooltip as ve, Button as Ue, Avatar as St, notification as Ct, message as zt, List as et, Card as Nn, Dropdown as Tn, Menu as tt } from "ant-design-vue";
import { tryOnUnmounted as At, useDebounceFn as hn, tryOnMounted as Dn, useMutationObserver as vn } from "@vueuse/core";
import { mergeWith as Sn, intersectionWith as Cn, isEqual as Pe, unionWith as zn, omit as Ee } from "lodash-es";
import An from "dayjs";
import xn from "resize-observer-polyfill";
import wn from "@purge-icons/generated";
import _e from "msgreader";
const On = {
  pagination: {
    totalItemText: "Total",
    goToText: "Go to"
  },
  accordion: {
    loading: "loading",
    noData: "No Data"
  },
  autoCompleteDropdown: {
    latestInput: "Latest input"
  },
  cascaderList: {
    noData: "No data"
  },
  colorPicker: {
    foundationPanel: "Foundation panel",
    advancedPanel: "Advanced panel"
  },
  datePickerPro: {
    ok: "OK",
    placeholder: "select date",
    month1: "Jan",
    month2: "Feb",
    month3: "Mar",
    month4: "Apr",
    month5: "May",
    month6: "June",
    month7: "July",
    month8: "Aug",
    month9: "Sep",
    month10: "Oct",
    month11: "Nov",
    month12: "Dec",
    year: "年",
    startPlaceholder: "select start date",
    endPlaceholder: "select end date",
    getWeekDays() {
      return ["Sun", "Mon", "Tue", "Wed", "Thur", "Fri", "Sat"];
    },
    getTimeArr() {
      return ["Hr", "Min", "Sec"];
    },
    getYearMonthStr(e, t) {
      return `${e} - ${t}`;
    }
  },
  editableSelect: {
    noRelatedRecords: "No related records found",
    noData: "No data"
  },
  input: {
    placeholder: "Please enter"
  },
  splitterBar: {
    collapse: "Collapse",
    expand: "Expand"
  },
  stepsGuide: {
    previous: "Previous",
    continue: "Continue",
    ok: "OK"
  },
  table: {
    selectAll: "Select all",
    ok: "OK"
  },
  timePopup: {
    ok: "OK"
  },
  transfer: {
    unit: "",
    panelUnit: "",
    headerUnit: "",
    noData: "No Data",
    placeholder: "Please enter keywords"
  },
  tree: {
    loading: "Loading",
    newNode: "New node",
    selectPlaceholder: "Please select"
  },
  upload: {
    save: "Save",
    upload: "Upload",
    imgUpload: "ImageUpload",
    uploaded: "Uploaded",
    operating: "Operating",
    del: "Delete",
    download: "download",
    saveWarn: "Please wait for the file to upload and save!",
    saveError: "There is no file successfully uploaded and cannot be saved!",
    preview: "Preview",
    choose: "Select the file",
    accept: "Support {0} format",
    acceptUpload: "Only upload files in {0} format",
    maxSize: "A single file does not exceed {0}MB ",
    maxSizeMultiple: "Only upload files up to {0}MB!",
    maxNumber: "Only upload up to {0} files",
    legend: "Legend",
    fileName: "File name",
    fileSize: "File size",
    fileStatue: "File status",
    startUpload: "Start upload",
    uploadSuccess: "Upload successfully",
    uploadError: "Upload failed",
    uploading: "Uploading",
    uploadWait: "Please wait for the file upload to finish",
    reUploadFailed: "Re-upload failed files",
    noFile: "The file does not exist!"
  },
  search: {
    placeholder: "Enter a keyword"
  },
  select: {
    placeholder: "Please select",
    noDataText: "No data",
    noMatchText: "No related records found",
    loadingText: "Loading..."
  },
  tagInput: {
    maxTagsText: "Maximum number reached: "
  },
  timeSelect: {
    placeholder: "Please select time"
  },
  modal: {
    cancelText: "Close",
    okText: "Confirm",
    close: "Close",
    maximize: "Maximize",
    restore: "Restore"
  },
  excel: {
    exportModalTitle: "Export data",
    fileType: "File type",
    fileName: "File name"
  },
  form: {
    putAway: "Put away",
    unfold: "Unfold",
    maxTip: "The number of characters should be less than {0}",
    apiSelectNotFound: "Wait for data loading to complete..."
  },
  previewFile: {
    notSupport: "The file does not support preview",
    download: "download"
  },
  signature: {
    deleteSelectedSignature: "Delete selected signature",
    deleteAllSignature: "Delete all signatures",
    page: "page",
    jumpTo: "jump to",
    dragTip: "Please select the following signature and drag it to the left file",
    selectTip: "Please select the signature",
    smallTip: "The signature can't be any smaller",
    deleteTip: "Please select the signature you want to delete",
    addSignature: "Add Signature"
  },
  common: {
    preview: "Preview",
    download: "Download",
    okText: "OK",
    closeText: "Close",
    cancelText: "Cancel",
    loadingText: "Loading...",
    saveText: "Save",
    submitText: "Submit",
    delText: "Delete",
    resetText: "Reset",
    searchText: "Search",
    queryText: "Search",
    inputText: "Please enter",
    chooseText: "Please choose",
    redo: "Refresh",
    back: "Back",
    light: "Light",
    dark: "Dark",
    zoomIn: "Zoom In",
    zoomOut: "Zoom Out",
    reset: "reset",
    enterFullScreen: "Full Screen",
    exitFullScreen: "Exit Full Screen"
  }
}, bn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: On
}, Symbol.toStringTag, { value: "Module" })), En = {
  pagination: {
    totalItemText: "所有条目",
    goToText: "跳至",
    perPage: "条/页"
  },
  accordion: {
    loading: "加载中",
    noData: "没有数据"
  },
  autoCompleteDropdown: {
    latestInput: "最近输入"
  },
  cascaderList: {
    noData: "没有数据"
  },
  colorPicker: {
    foundationPanel: "基础面板",
    advancedPanel: "高级面板"
  },
  datePickerPro: {
    ok: "确定",
    placeholder: "请选择日期",
    month1: "1月",
    month2: "2月",
    month3: "3月",
    month4: "4月",
    month5: "5月",
    month6: "6月",
    month7: "7月",
    month8: "8月",
    month9: "9月",
    month10: "10月",
    month11: "11月",
    month12: "12月",
    year: "年",
    startPlaceholder: "请选择开始日期",
    endPlaceholder: "请选择结束日期",
    getWeekDays() {
      return ["日", "一", "二", "三", "四", "五", "六"];
    },
    getTimeArr() {
      return ["时", "分", "秒"];
    },
    getYearMonthStr(e, t) {
      return `${e}年${t}月`;
    }
  },
  editableSelect: {
    noRelatedRecords: "找不到相关记录",
    noData: "没有数据"
  },
  input: {
    placeholder: "请输入"
  },
  splitterBar: {
    collapse: "收起",
    expand: "展开"
  },
  stepsGuide: {
    previous: "上一步",
    continue: "我知道啦，继续",
    ok: "我知道啦"
  },
  table: {
    selectAll: "全选",
    ok: "确定"
  },
  timePopup: {
    ok: "确定"
  },
  transfer: {
    unit: "项",
    panelUnit: "项",
    headerUnit: "项",
    noData: "暂无数据",
    placeholder: "请输入关键词搜索"
  },
  tree: {
    loading: "加载中",
    newNode: "新节点",
    selectPlaceholder: "请选择"
  },
  upload: {
    save: "保存",
    upload: "上传",
    imgUpload: "图片上传",
    uploaded: "已上传",
    operating: "操作",
    del: "删除",
    download: "下载",
    saveWarn: "请等待文件上传后，保存!",
    saveError: "没有上传成功的文件，无法保存!",
    preview: "预览",
    choose: "选择文件",
    accept: "支持{0}格式",
    acceptUpload: "只能上传{0}格式文件",
    maxSize: "单个文件不超过{0}MB",
    maxSizeMultiple: "只能上传不超过{0}MB的文件!",
    maxNumber: "最多只能上传{0}个文件",
    legend: "略缩图",
    fileName: "文件名",
    fileSize: "文件大小",
    fileStatue: "状态",
    startUpload: "开始上传",
    uploadSuccess: "上传成功",
    uploadError: "上传失败",
    uploading: "上传中",
    uploadWait: "请等待文件上传结束后操作",
    reUploadFailed: "重新上传失败文件",
    import: "导入",
    startImport: "开始导入",
    importing: "导入中",
    reImportFailed: "重新导入失败文件",
    noFile: "文件不存在！"
  },
  search: {
    placeholder: "请输入关键字"
  },
  select: {
    placeholder: "请选择",
    noDataText: "无数据",
    noMatchText: "找不到相关记录",
    loadingText: "加载中..."
  },
  tagInput: {
    maxTagsText: "已达到最大个数："
  },
  timeSelect: {
    placeholder: "请选择时间"
  },
  modal: {
    cancelText: "关闭",
    okText: "确认",
    close: "关闭",
    maximize: "最大化",
    restore: "还原"
  },
  excel: {
    exportModalTitle: "导出数据",
    fileType: "文件类型",
    fileName: "文件名"
  },
  form: {
    putAway: "收起",
    unfold: "展开",
    maxTip: "字符数应小于{0}位",
    apiSelectNotFound: "请等待数据加载完成..."
  },
  previewFile: {
    notSupport: "该文件不支持预览",
    download: "下载"
  },
  signature: {
    deleteSelectedSignature: "删除选中签名",
    deleteAllSignature: "删除全部签名",
    page: "页",
    jumpTo: "跳至",
    dragTip: "请选择以下签名并将其拖到左侧文件",
    selectTip: "请选择签名",
    smallTip: "已经最小了",
    deleteTip: "请选中你要删除的签名",
    addSignature: "新建电子签章"
  },
  common: {
    preview: "预览",
    download: "下载",
    okText: "确认",
    closeText: "关闭",
    cancelText: "取消",
    loadingText: "加载中...",
    saveText: "保存",
    submitText: "提交",
    delText: "删除",
    resetText: "重置",
    searchText: "搜索",
    queryText: "查询",
    inputText: "请输入",
    chooseText: "请选择",
    redo: "刷新",
    back: "返回",
    light: "亮色主题",
    dark: "黑暗主题",
    zoomIn: "放大",
    zoomOut: "缩小",
    reset: "还原",
    enterFullScreen: "全屏",
    exitFullScreen: "退出全屏"
  }
}, _n = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: En
}, Symbol.toStringTag, { value: "Module" })), nt = /* @__PURE__ */ Object.assign({ "./lang/en.ts": bn, "./lang/zh_cn.ts": _n }), xt = {};
Object.keys(nt).forEach((e) => {
  const t = nt[e].default || {};
  xt[e] = t;
});
const ot = T("zh_cn"), wt = () => {
  const e = te({
    langMessages: xt
  }), t = () => ot.value.toLocaleLowerCase();
  return {
    getLang: t,
    setLang: (n) => {
      ot.value = n;
    },
    getMessages: () => {
      const n = `./lang/${t()}.ts`;
      return e.langMessages[n];
    }
  };
};
function kn(e, t) {
  const o = t.split(".");
  let i = e;
  return o.forEach((n) => {
    i = i[n] ?? "";
  }), i;
}
function Ie() {
  return (e) => {
    const t = wt().getMessages();
    return kn(t, e);
  };
}
const it = Ie(), Pn = {
  visible: { type: Boolean },
  scrollTop: { type: Boolean, default: !0 },
  height: { type: Number },
  minHeight: { type: Number },
  // open drag
  draggable: { type: Boolean, default: !0 },
  centered: { type: Boolean },
  cancelText: { type: String, default: it("modal.cancelText") },
  okText: { type: String, default: it("modal.okText") },
  closeFunc: Function
}, He = Object.assign({}, Pn, {
  defaultFullscreen: { type: Boolean },
  // Can it be full screen
  canFullscreen: { type: Boolean, default: !0 },
  // After enabling the wrapper, the bottom can be increased in height
  wrapperFooterOffset: { type: Number, default: 0 },
  // Warm reminder message
  helpMessage: [String, Array],
  // Whether to setting wrapper
  useWrapper: { type: Boolean, default: !0 },
  loading: { type: Boolean },
  loadingTip: { type: String },
  /**
   * @description: Show close button
   */
  showCancelBtn: { type: Boolean, default: !0 },
  /**
   * @description: Show confirmation button
   */
  showOkBtn: { type: Boolean, default: !0 },
  wrapperProps: Object,
  afterClose: Function,
  bodyStyle: Object,
  closable: { type: Boolean, default: !0 },
  closeIcon: Object,
  confirmLoading: { type: Boolean },
  destroyOnClose: { type: Boolean, default: !0 },
  footer: Object,
  getContainer: Function,
  mask: { type: Boolean, default: !0 },
  maskClosable: { type: Boolean, default: !0 },
  keyboard: { type: Boolean, default: !0 },
  maskStyle: Object,
  okType: { type: String, default: "primary" },
  okButtonProps: Object,
  cancelButtonProps: Object,
  title: { type: String },
  visible: { type: Boolean },
  width: [String, Number],
  wrapClassName: { type: String },
  zIndex: { type: Number }
}), Ae = "G", Yn = Object.prototype.toString;
function Ot(e, t) {
  return Yn.call(e) === `[object ${t}]`;
}
function me(e) {
  return Ot(e, "String");
}
function Ye(e) {
  return e && Array.isArray(e);
}
function lt(e) {
  return e !== null && Ot(e, "Object");
}
function xe(e) {
  return typeof e == "function";
}
function $n(e) {
  return typeof e < "u";
}
function Qn(e) {
  return !$n(e);
}
const Fn = typeof window > "u", bt = !Fn;
function Et(e, t, o = "replace") {
  return t ? e ? Sn({}, e, t, (i, n) => {
    if (Ye(n) && Ye(i))
      switch (o) {
        case "union":
          return zn(i, n, Pe);
        case "intersection":
          return Cn(i, n, Pe);
        case "concat":
          return i.concat(n);
        case "replace":
          return n;
        default:
          throw new Error(
            `Unknown merge array strategy: ${o}`
          );
      }
    if (lt(n) && lt(i))
      return Et(i, n, o);
  }) : t : e;
}
function _t(e, t = "default", o, i) {
  if (!e || !Reflect.has(e, t))
    return null;
  if (!xe(e[t]))
    return console.error(`${t} is not a function!`), null;
  const n = e[t];
  if (!n)
    return null;
  const l = {
    ...o,
    ...i
  };
  return n(l);
}
function Rn(e, t = []) {
  const o = Object.keys(e), i = {};
  return o.map((n) => {
    if (t.includes(n))
      return null;
    i[n] = (l) => _t(e, n, l);
  }), i;
}
const Bn = "gopher-gui";
function Un(e) {
  throw new Error(`[${Bn} error]:${e}`);
}
function rt(e, t, o) {
  e && t && o && e.addEventListener(t, o, !1);
}
function at(e, t, o) {
  e && t && o && e.removeEventListener(t, o, !1);
}
for (let e = 0; e <= 15; e++)
  e.toString(16);
/*!
 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
 *
 * Copyright (c) 2014-2017, Jon Schlinkert.
 * Released under the MIT License.
 */
function st(e) {
  return Object.prototype.toString.call(e) === "[object Object]";
}
function Hn(e) {
  var t, o;
  return st(e) === !1 ? !1 : (t = e.constructor, t === void 0 ? !0 : (o = t.prototype, !(st(o) === !1 || o.hasOwnProperty("isPrototypeOf") === !1)));
}
function ge() {
  return ge = Object.assign ? Object.assign.bind() : function(e) {
    for (var t = 1; t < arguments.length; t++) {
      var o = arguments[t];
      for (var i in o)
        Object.prototype.hasOwnProperty.call(o, i) && (e[i] = o[i]);
    }
    return e;
  }, ge.apply(this, arguments);
}
function kt(e, t) {
  if (e == null)
    return {};
  var o, i, n = {}, l = Object.keys(e);
  for (i = 0; i < l.length; i++)
    t.indexOf(o = l[i]) >= 0 || (n[o] = e[o]);
  return n;
}
const $e = { silent: !1, logLevel: "warn" }, Wn = ["validator"], Pt = Object.prototype, Yt = Pt.toString, Zn = Pt.hasOwnProperty, $t = /^\s*function (\w+)/;
function ct(e) {
  var t;
  const o = (t = e == null ? void 0 : e.type) !== null && t !== void 0 ? t : e;
  if (o) {
    const i = o.toString().match($t);
    return i ? i[1] : "";
  }
  return "";
}
const ee = Hn, Qt = (e) => e;
let w = Qt;
process.env.NODE_ENV !== "production" && (w = typeof console < "u" ? function(t, o = $e.logLevel) {
  $e.silent === !1 && console[o](`[VueTypes warn]: ${t}`);
} : Qt);
const ae = (e, t) => Zn.call(e, t), Gn = Number.isInteger || function(e) {
  return typeof e == "number" && isFinite(e) && Math.floor(e) === e;
}, se = Array.isArray || function(e) {
  return Yt.call(e) === "[object Array]";
}, ce = (e) => Yt.call(e) === "[object Function]", Se = (e) => ee(e) && ae(e, "_vueTypes_name"), Ft = (e) => ee(e) && (ae(e, "type") || ["_vueTypes_name", "validator", "default", "required"].some((t) => ae(e, t)));
function We(e, t) {
  return Object.defineProperty(e.bind(t), "__original", { value: e });
}
function ne(e, t, o = !1) {
  let i, n = !0, l = "";
  i = ee(e) ? e : { type: e };
  const a = Se(i) ? i._vueTypes_name + " - " : "";
  if (Ft(i) && i.type !== null) {
    if (i.type === void 0 || i.type === !0 || !i.required && t === void 0)
      return n;
    se(i.type) ? (n = i.type.some((r) => ne(r, t, !0) === !0), l = i.type.map((r) => ct(r)).join(" or ")) : (l = ct(i), n = l === "Array" ? se(t) : l === "Object" ? ee(t) : l === "String" || l === "Number" || l === "Boolean" || l === "Function" ? function(r) {
      if (r == null)
        return "";
      const s = r.constructor.toString().match($t);
      return s ? s[1] : "";
    }(t) === l : t instanceof i.type);
  }
  if (!n) {
    const r = `${a}value "${t}" should be of type "${l}"`;
    return o === !1 ? (w(r), !1) : r;
  }
  if (ae(i, "validator") && ce(i.validator)) {
    const r = w, s = [];
    if (w = (c) => {
      s.push(c);
    }, n = i.validator(t), w = r, !n) {
      const c = (s.length > 1 ? "* " : "") + s.join(`
* `);
      return s.length = 0, o === !1 ? (w(c), n) : c;
    }
  }
  return n;
}
function P(e, t) {
  const o = Object.defineProperties(t, { _vueTypes_name: { value: e, writable: !0 }, isRequired: { get() {
    return this.required = !0, this;
  } }, def: { value(n) {
    return n === void 0 ? (ae(this, "default") && delete this.default, this) : ce(n) || ne(this, n, !0) === !0 ? (this.default = se(n) ? () => [...n] : ee(n) ? () => Object.assign({}, n) : n, this) : (w(`${this._vueTypes_name} - invalid default value: "${n}"`), this);
  } } }), { validator: i } = o;
  return ce(i) && (o.validator = We(i, o)), o;
}
function H(e, t) {
  const o = P(e, t);
  return Object.defineProperty(o, "validate", { value(i) {
    return ce(this.validator) && w(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:
${JSON.stringify(this)}`), this.validator = We(i, this), this;
  } });
}
function ut(e, t, o) {
  const i = function(s) {
    const c = {};
    return Object.getOwnPropertyNames(s).forEach((M) => {
      c[M] = Object.getOwnPropertyDescriptor(s, M);
    }), Object.defineProperties({}, c);
  }(t);
  if (i._vueTypes_name = e, !ee(o))
    return i;
  const { validator: n } = o, l = kt(o, Wn);
  if (ce(n)) {
    let { validator: s } = i;
    s && (s = (r = (a = s).__original) !== null && r !== void 0 ? r : a), i.validator = We(s ? function(c) {
      return s.call(this, c) && n.call(this, c);
    } : n, i);
  }
  var a, r;
  return Object.assign(i, l);
}
function we(e) {
  return e.replace(/^(?!\s*$)/gm, "  ");
}
const Xn = () => H("any", {}), Vn = () => H("function", { type: Function }), Jn = () => H("boolean", { type: Boolean }), qn = () => H("string", { type: String }), Kn = () => H("number", { type: Number }), eo = () => H("array", { type: Array }), to = () => H("object", { type: Object }), no = () => P("integer", { type: Number, validator: (e) => Gn(e) }), oo = () => P("symbol", { validator: (e) => typeof e == "symbol" });
function io(e, t = "custom validation failed") {
  if (typeof e != "function")
    throw new TypeError("[VueTypes error]: You must provide a function as argument");
  return P(e.name || "<<anonymous function>>", { type: null, validator(o) {
    const i = e(o);
    return i || w(`${this._vueTypes_name} - ${t}`), i;
  } });
}
function lo(e) {
  if (!se(e))
    throw new TypeError("[VueTypes error]: You must provide an array as argument.");
  const t = `oneOf - value should be one of "${e.join('", "')}".`, o = e.reduce((i, n) => {
    if (n != null) {
      const l = n.constructor;
      i.indexOf(l) === -1 && i.push(l);
    }
    return i;
  }, []);
  return P("oneOf", { type: o.length > 0 ? o : void 0, validator(i) {
    const n = e.indexOf(i) !== -1;
    return n || w(t), n;
  } });
}
function ro(e) {
  if (!se(e))
    throw new TypeError("[VueTypes error]: You must provide an array as argument");
  let t = !1, o = [];
  for (let n = 0; n < e.length; n += 1) {
    const l = e[n];
    if (Ft(l)) {
      if (Se(l) && l._vueTypes_name === "oneOf" && l.type) {
        o = o.concat(l.type);
        continue;
      }
      if (ce(l.validator) && (t = !0), l.type === !0 || !l.type) {
        w('oneOfType - invalid usage of "true" or "null" as types.');
        continue;
      }
      o = o.concat(l.type);
    } else
      o.push(l);
  }
  o = o.filter((n, l) => o.indexOf(n) === l);
  const i = o.length > 0 ? o : null;
  return P("oneOfType", t ? { type: i, validator(n) {
    const l = [], a = e.some((r) => {
      const s = ne(Se(r) && r._vueTypes_name === "oneOf" ? r.type || null : r, n, !0);
      return typeof s == "string" && l.push(s), s === !0;
    });
    return a || w(`oneOfType - provided value does not match any of the ${l.length} passed-in validators:
${we(l.join(`
`))}`), a;
  } } : { type: i });
}
function ao(e) {
  return P("arrayOf", { type: Array, validator(t) {
    let o = "";
    const i = t.every((n) => (o = ne(e, n, !0), o === !0));
    return i || w(`arrayOf - value validation error:
${we(o)}`), i;
  } });
}
function so(e) {
  return P("instanceOf", { type: e });
}
function co(e) {
  return P("objectOf", { type: Object, validator(t) {
    let o = "";
    const i = Object.keys(t).every((n) => (o = ne(e, t[n], !0), o === !0));
    return i || w(`objectOf - value validation error:
${we(o)}`), i;
  } });
}
function uo(e) {
  const t = Object.keys(e), o = t.filter((n) => {
    var l;
    return !((l = e[n]) === null || l === void 0 || !l.required);
  }), i = P("shape", { type: Object, validator(n) {
    if (!ee(n))
      return !1;
    const l = Object.keys(n);
    if (o.length > 0 && o.some((a) => l.indexOf(a) === -1)) {
      const a = o.filter((r) => l.indexOf(r) === -1);
      return w(a.length === 1 ? `shape - required property "${a[0]}" is not defined.` : `shape - required properties "${a.join('", "')}" are not defined.`), !1;
    }
    return l.every((a) => {
      if (t.indexOf(a) === -1)
        return this._vueTypes_isLoose === !0 || (w(`shape - shape definition does not include a "${a}" property. Allowed keys: "${t.join('", "')}".`), !1);
      const r = ne(e[a], n[a], !0);
      return typeof r == "string" && w(`shape - "${a}" property validation error:
 ${we(r)}`), r === !0;
    });
  } });
  return Object.defineProperty(i, "_vueTypes_isLoose", { writable: !0, value: !1 }), Object.defineProperty(i, "loose", { get() {
    return this._vueTypes_isLoose = !0, this;
  } }), i;
}
const go = ["name", "validate", "getter"], Mo = /* @__PURE__ */ (() => {
  var e;
  return (e = class {
    static get any() {
      return Xn();
    }
    static get func() {
      return Vn().def(this.defaults.func);
    }
    static get bool() {
      return Jn().def(this.defaults.bool);
    }
    static get string() {
      return qn().def(this.defaults.string);
    }
    static get number() {
      return Kn().def(this.defaults.number);
    }
    static get array() {
      return eo().def(this.defaults.array);
    }
    static get object() {
      return to().def(this.defaults.object);
    }
    static get integer() {
      return no().def(this.defaults.integer);
    }
    static get symbol() {
      return oo();
    }
    static get nullable() {
      return { type: null };
    }
    static extend(t) {
      if (se(t))
        return t.forEach((s) => this.extend(s)), this;
      const { name: o, validate: i = !1, getter: n = !1 } = t, l = kt(t, go);
      if (ae(this, o))
        throw new TypeError(`[VueTypes error]: Type "${o}" already defined`);
      const { type: a } = l;
      if (Se(a))
        return delete l.type, Object.defineProperty(this, o, n ? { get: () => ut(o, a, l) } : { value(...s) {
          const c = ut(o, a, l);
          return c.validator && (c.validator = c.validator.bind(c, ...s)), c;
        } });
      let r;
      return r = n ? { get() {
        const s = Object.assign({}, l);
        return i ? H(o, s) : P(o, s);
      }, enumerable: !0 } : { value(...s) {
        const c = Object.assign({}, l);
        let M;
        return M = i ? H(o, c) : P(o, c), c.validator && (M.validator = c.validator.bind(M, ...s)), M;
      }, enumerable: !0 }, Object.defineProperty(this, o, r);
    }
  }).defaults = {}, e.sensibleDefaults = void 0, e.config = $e, e.custom = io, e.oneOf = lo, e.instanceOf = so, e.oneOfType = ro, e.arrayOf = ao, e.objectOf = co, e.shape = uo, e.utils = { validate: (t, o) => ne(o, t, !0) === !0, toType: (t, o, i = !1) => i ? H(t, o) : P(t, o) }, e;
})();
function Rt(e = { func: () => {
}, bool: !0, string: "", number: 0, array: () => [], object: () => ({}), integer: 0 }) {
  var t;
  return (t = class extends Mo {
    static get sensibleDefaults() {
      return ge({}, this.defaults);
    }
    static set sensibleDefaults(o) {
      this.defaults = o !== !1 ? ge({}, o !== !0 ? o : e) : {};
    }
  }).defaults = ge({}, e), t;
}
class Ol extends Rt() {
}
const fo = Rt({
  func: void 0,
  bool: void 0,
  string: void 0,
  number: void 0,
  object: void 0,
  integer: void 0
});
fo.extend([
  {
    name: "style",
    getter: !0,
    type: [String, Object],
    default: void 0
  },
  {
    name: "VNodeChild",
    getter: !0,
    type: void 0
  }
]);
const Qe = "-internal", dt = (e) => (e == null ? void 0 : e.startsWith("http")) && (e == null ? void 0 : e.includes(Qe)), po = (e) => {
  if (me(e))
    return dt(e) && (e = e == null ? void 0 : e.replace(Qe, "")), e;
  let t = e == null ? void 0 : e.fileUrl;
  return me(t) && dt(t) && (t = t == null ? void 0 : t.replace(Qe, "")), t;
};
function yo(e) {
  const t = T(!1);
  let o;
  function i() {
    t.value = !1, o && window.clearTimeout(o);
  }
  function n() {
    i(), o = setTimeout(() => {
      t.value = !0;
    }, e);
  }
  return n(), At(i), { readyRef: t, stop: i, start: n };
}
function mo(e, t, o = !1) {
  if (!xe(e))
    throw new Error("handle is not Function!");
  const { readyRef: i, stop: n, start: l } = yo(t);
  return o ? e() : Ce(
    i,
    (a) => {
      a && e();
    },
    { immediate: !1 }
  ), { readyRef: i, stop: n, start: l };
}
function Lo(e) {
  const t = (n, l) => getComputedStyle(n)[l], o = (n) => {
    if (!n)
      return;
    n.setAttribute("data-drag", u(e.draggable));
    const l = n.querySelector(".ant-modal-header"), a = n.querySelector(".ant-modal");
    !l || !a || !u(e.draggable) || (l.style.cursor = "move", l.onmousedown = (r) => {
      if (!r)
        return;
      const s = r.clientX, c = r.clientY, M = document.body.clientWidth, y = document.documentElement.clientHeight, g = a.offsetWidth, j = a.offsetHeight, v = a.offsetLeft, L = M - a.offsetLeft - g, p = a.offsetTop, S = y - a.offsetTop - j, C = t(a, "left"), E = t(a, "top");
      let Y = +C, W = +E;
      C.includes("%") ? (Y = +document.body.clientWidth * (+C.replace(/%/g, "") / 100), W = +document.body.clientHeight * (+E.replace(/%/g, "") / 100)) : (Y = +C.replace(/px/g, ""), W = +E.replace(/px/g, "")), document.onmousemove = function(G) {
        let m = G.clientX - s, $ = G.clientY - c;
        -m > v ? m = -v : m > L && (m = L), -$ > p ? $ = -p : $ > S && ($ = S), a.style.cssText += `;left:${m + Y}px;top:${$ + W}px;`;
      }, document.onmouseup = () => {
        document.onmousemove = null, document.onmouseup = null;
      };
    });
  }, i = () => {
    const n = document.querySelectorAll(".ant-modal-wrap");
    for (const l of Array.from(n)) {
      if (!l)
        continue;
      const a = t(l, "display"), r = l.getAttribute("data-drag");
      a !== "none" && (r === null || u(e.destroyOnClose)) && o(l);
    }
  };
  Le(() => {
    !u(e.visible) || !u(e.draggable) || mo(() => {
      i();
    }, 30);
  });
}
function Io(e) {
  return typeof e == "function" || Object.prototype.toString.call(e) === "[object Object]" && !Gt(e);
}
const jo = /* @__PURE__ */ O({
  name: "Modal",
  inheritAttrs: !1,
  components: {
    Modal: K
  },
  props: He,
  emits: ["cancel"],
  setup(e, {
    slots: t,
    emit: o,
    attrs: i
  }) {
    const {
      visible: n,
      draggable: l,
      destroyOnClose: a
    } = Fe(e);
    Lo({
      visible: n,
      destroyOnClose: a,
      draggable: l
    });
    const r = (s) => {
      o("cancel", s);
    };
    return () => {
      let s;
      const c = {
        ...u(i),
        ...e,
        onCancel: r
      };
      return f(K, c, Io(s = Rn(t)) ? s : {
        default: () => [s]
      });
    };
  }
});
function No(e, t = 150, o) {
  let i = () => {
    e();
  };
  i = hn(i, t);
  const l = () => {
    o && o.immediate && i(), window.addEventListener("resize", i);
  }, a = () => {
    window.removeEventListener("resize", i);
  };
  return Dn(() => {
    l();
  }), At(() => {
    a();
  }), [l, a];
}
const To = typeof window > "u";
function ho(e) {
  for (const t of e) {
    const o = t.target.__resizeListeners__ || [];
    o.length && o.forEach((i) => {
      i();
    });
  }
}
function gt(e, t) {
  To || (e.__resizeListeners__ || (e.__resizeListeners__ = [], e.__ro__ = new xn(ho), e.__ro__.observe(e)), e.__resizeListeners__.push(t));
}
function Mt(e, t) {
  !e || !e.__resizeListeners__ || (e.__resizeListeners__.splice(
    e.__resizeListeners__.indexOf(t),
    1
  ), e.__resizeListeners__.length || e.__ro__.disconnect());
}
const Do = {
  vertical: {
    offset: "offsetHeight",
    scroll: "scrollTop",
    scrollSize: "scrollHeight",
    size: "height",
    key: "vertical",
    axis: "Y",
    client: "clientY",
    direction: "top"
  },
  horizontal: {
    offset: "offsetWidth",
    scroll: "scrollLeft",
    scrollSize: "scrollWidth",
    size: "width",
    key: "horizontal",
    axis: "X",
    client: "clientX",
    direction: "left"
  }
};
function vo({ move: e, size: t, bar: o }) {
  const i = {}, n = `translate${o.axis}(${e}%)`;
  return i[o.size] = t, i.transform = n, i.msTransform = n, i.webkitTransform = n, i;
}
function So(e, t) {
  return Object.assign(e, t);
}
function Co(e) {
  const t = {};
  for (let o = 0; o < e.length; o++)
    e[o] && So(t, e[o]);
  return t;
}
const zo = O({
  name: "Bar",
  props: {
    vertical: Boolean,
    size: String,
    move: Number
  },
  setup(e) {
    const t = ze(), o = T(), i = Xt(
      "scroll-bar-wrap",
      {}
    ), n = D(() => Do[e.vertical ? "vertical" : "horizontal"]), l = T({}), a = T(), r = (g) => {
      var S, C;
      if (a.value === !1)
        return;
      const j = l.value[n.value.axis];
      if (!j)
        return;
      const v = (((S = t == null ? void 0 : t.vnode.el) == null ? void 0 : S.getBoundingClientRect()[n.value.direction]) - g[n.value.client]) * -1, L = o.value[n.value.offset] - j, p = (v - L) * 100 / ((C = t == null ? void 0 : t.vnode.el) == null ? void 0 : C[n.value.offset]);
      i.value[n.value.scroll] = p * i.value[n.value.scrollSize] / 100;
    };
    function s() {
      a.value = !1, l.value[n.value.axis] = 0, at(document, "mousemove", r), document.onselectstart = null;
    }
    const c = (g) => {
      g.stopImmediatePropagation(), a.value = !0, rt(document, "mousemove", r), rt(document, "mouseup", s), document.onselectstart = () => !1;
    }, M = (g) => {
      var j;
      g.ctrlKey || g.button === 2 || ((j = window.getSelection()) == null || j.removeAllRanges(), c(g), l.value[n.value.axis] = g.currentTarget[n.value.offset] - (g[n.value.client] - g.currentTarget.getBoundingClientRect()[n.value.direction]));
    }, y = (g) => {
      var p;
      const j = Math.abs(
        g.target.getBoundingClientRect()[n.value.direction] - g[n.value.client]
      ), v = o.value[n.value.offset] / 2, L = (j - v) * 100 / ((p = t == null ? void 0 : t.vnode.el) == null ? void 0 : p[n.value.offset]);
      i.value[n.value.scroll] = L * i.value[n.value.scrollSize] / 100;
    };
    return Re(() => {
      at(document, "mouseup", s);
    }), () => F(
      "div",
      {
        class: ["scrollbar__bar", "is-" + n.value.key],
        onMousedown: y
      },
      F("div", {
        ref: o,
        class: "scrollbar__thumb",
        onMousedown: M,
        style: vo({
          size: e.size,
          move: e.move,
          bar: n.value
        })
      })
    );
  }
}), Ao = O({
  name: "Scrollbar",
  // inheritAttrs: false,
  components: { Bar: zo },
  props: {
    native: {
      type: Boolean,
      default: !1
    },
    wrapStyle: {
      type: [String, Array],
      default: ""
    },
    wrapClass: {
      type: [String, Array],
      default: ""
    },
    viewClass: {
      type: [String, Array],
      default: ""
    },
    viewStyle: {
      type: [String, Array],
      default: ""
    },
    noresize: Boolean,
    // 如果 container 尺寸不会发生变化，最好设置它可以优化性能
    tag: {
      type: String,
      default: "div"
    }
  },
  setup(e) {
    const t = T("0"), o = T("0"), i = T(0), n = T(0), l = T(), a = T();
    Nt("scroll-bar-wrap", l);
    const r = D(() => Array.isArray(e.wrapStyle) ? Co(e.wrapStyle) : e.wrapStyle), s = () => {
      e.native || (n.value = u(l).scrollTop * 100 / u(l).clientHeight, i.value = u(l).scrollLeft * 100 / u(l).clientWidth);
    }, c = () => {
      if (!u(l))
        return;
      const M = u(l).clientHeight * 100 / u(l).scrollHeight, y = u(l).clientWidth * 100 / u(l).scrollWidth;
      o.value = M < 100 ? M + "%" : "", t.value = y < 100 ? y + "%" : "";
    };
    return Be(() => {
      e.native || (B(c), e.noresize || (gt(u(a), c), gt(u(l), c), addEventListener("resize", c)));
    }), Vt(() => {
      e.native || e.noresize || (Mt(u(a), c), Mt(u(l), c), removeEventListener("resize", c));
    }), {
      moveX: i,
      moveY: n,
      sizeWidth: t,
      sizeHeight: o,
      style: r,
      wrap: l,
      resize: a,
      update: c,
      handleScroll: s
    };
  }
});
const R = (e, t) => {
  const o = e.__vccOpts || e;
  for (const [i, n] of t)
    o[i] = n;
  return o;
}, xo = { class: "scrollbar" };
function wo(e, t, o, i, n, l) {
  const a = z("bar");
  return h(), x("div", xo, [
    I("div", {
      ref: "wrap",
      class: X([
        e.wrapClass,
        "scrollbar__wrap",
        e.native ? "" : "scrollbar__wrap--hidden-default"
      ]),
      style: pe(e.style),
      onScroll: t[0] || (t[0] = (...r) => e.handleScroll && e.handleScroll(...r))
    }, [
      (h(), _(Tt(e.tag), {
        ref: "resize",
        class: X(["scrollbar__view", e.viewClass]),
        style: pe(e.viewStyle)
      }, {
        default: N(() => [
          U(e.$slots, "default")
        ]),
        _: 3
      }, 8, ["class", "style"]))
    ], 38),
    e.native ? q("", !0) : (h(), x(re, { key: 0 }, [
      f(a, {
        move: e.moveX,
        size: e.sizeWidth
      }, null, 8, ["move", "size"]),
      f(a, {
        vertical: "",
        move: e.moveY,
        size: e.sizeHeight
      }, null, 8, ["move", "size"])
    ], 64))
  ]);
}
const Oo = /* @__PURE__ */ R(Ao, [["render", wo]]), bo = (e, t, o, i) => (e /= i / 2, e < 1 ? o / 2 * e * e + t : (e--, -o / 2 * (e * (e - 2) - 1) + t)), Eo = (e, t) => {
  e.scrollTop = t;
}, _o = (e) => e.scrollTop;
function ft({
  el: e,
  to: t,
  duration: o = 500,
  callback: i
}) {
  const n = T(!1), l = _o(e), a = t - l, r = 20;
  let s = 0;
  o = Qn(o) ? 500 : o;
  const c = function() {
    if (!u(n))
      return;
    s += r;
    const g = bo(s, l, a, o);
    Eo(e, g), s < o && u(n) ? requestAnimationFrame(c) : i && xe(i) && i();
  };
  return { start: () => {
    n.value = !0, c();
  }, stop: () => {
    n.value = !1;
  } };
}
const ko = O({
  name: `${Ae}ScrollContainer`,
  components: { Scrollbar: Oo },
  setup() {
    const e = T(null);
    function t(n, l = 500) {
      const a = u(e);
      a && B(() => {
        const r = u(a.wrap);
        if (!r)
          return;
        const { start: s } = ft({
          el: r,
          to: n,
          duration: l
        });
        s();
      });
    }
    function o() {
      const n = u(e);
      return n ? n.wrap : null;
    }
    function i() {
      const n = u(e);
      n && B(() => {
        const l = u(n.wrap);
        if (!l)
          return;
        const a = l.scrollHeight, { start: r } = ft({
          el: l,
          to: a
        });
        r();
      });
    }
    return {
      scrollbarRef: e,
      scrollTo: t,
      scrollBottom: i,
      getScrollWrap: o
    };
  }
});
function Po(e, t, o, i, n, l) {
  const a = z("Scrollbar");
  return h(), _(a, oe({
    ref: "scrollbarRef",
    class: "scroll-container"
  }, e.$attrs), {
    default: N(() => [
      U(e.$slots, "default")
    ]),
    _: 3
  }, 16);
}
const De = /* @__PURE__ */ R(ko, [["render", Po]]);
De.install = function(e, t) {
  e.component(t || De.name, De);
};
function Yo(e, t = Symbol(), o = {}) {
  const { readonly: i = !0, createProvider: n = !1, native: l = !1 } = o, a = te(e), r = i ? Jt(a) : a;
  return !n && Nt(t, l ? e : r), {
    state: a
  };
}
const $o = Symbol();
function Qo(e) {
  return Yo(e, $o);
}
const Fo = {
  loading: { type: Boolean },
  useWrapper: { type: Boolean, default: !0 },
  modalHeaderHeight: { type: Number, default: 57 },
  modalFooterHeight: { type: Number, default: 74 },
  minHeight: { type: Number, default: 200 },
  height: { type: Number },
  footerOffset: { type: Number, default: 0 },
  visible: { type: Boolean },
  fullScreen: { type: Boolean },
  loadingTip: { type: String }
}, Ro = O({
  name: "ModalWrapper",
  components: { ScrollContainer: De },
  inheritAttrs: !1,
  props: Fo,
  emits: ["height-change", "ext-height"],
  setup(e, { emit: t }) {
    const o = T(null), i = T(null), n = T(0), l = T(0);
    let a = 0;
    No(c.bind(null, !1)), vn(
      i,
      () => {
        c();
      },
      {
        attributes: !0,
        subtree: !0
      }
    ), Qo({
      redoModalHeight: c
    });
    const r = D(() => ({
      minHeight: `${e.minHeight}px`,
      [e.fullScreen ? "height" : "maxHeight"]: `${u(n)}px`
    }));
    Le(() => {
      e.useWrapper && c();
    }), Ce(
      () => e.fullScreen,
      (M) => {
        c(), M ? l.value = n.value : n.value = l.value;
      }
    ), Be(() => {
      const { modalHeaderHeight: M, modalFooterHeight: y } = e;
      t("ext-height", M + y);
    }), Re(() => {
    });
    async function s() {
      B(() => {
        var y;
        const M = u(o);
        M && ((y = M == null ? void 0 : M.scrollTo) == null || y.call(M, 0));
      });
    }
    async function c() {
      if (!e.visible)
        return;
      const M = u(o);
      if (!M)
        return;
      const y = M.$el.parentElement;
      if (y) {
        y.style.padding = "0", await B();
        try {
          const g = y.parentElement && y.parentElement.parentElement;
          if (!g)
            return;
          const j = getComputedStyle(g).top, v = Number.parseInt(j);
          let L = window.innerHeight - v * 2 + (e.footerOffset || 0) - e.modalFooterHeight - e.modalHeaderHeight;
          v < 40 && (L -= 26), await B();
          const p = u(i);
          if (!p)
            return;
          await B(), a = p.scrollHeight, e.fullScreen ? n.value = window.innerHeight - e.modalFooterHeight - e.modalHeaderHeight - 28 : n.value = e.height ? e.height : a > L ? L : a, t("height-change", u(n));
        } catch (g) {
          console.log(g);
        }
      }
    }
    return { wrapperRef: o, spinRef: i, spinStyle: r, scrollTop: s, setModalHeight: c };
  }
}), Bo = ["loading-tip"];
function Uo(e, t, o, i, n, l) {
  const a = z("ScrollContainer"), r = qt("loading");
  return h(), _(a, { ref: "wrapperRef" }, {
    default: N(() => [
      Kt((h(), x("div", {
        ref: "spinRef",
        style: pe(e.spinStyle),
        "loading-tip": e.loadingTip
      }, [
        U(e.$slots, "default")
      ], 12, Bo)), [
        [r, e.loading]
      ])
    ]),
    _: 3
  }, 512);
}
const Ho = /* @__PURE__ */ R(Ro, [["render", Uo]]), pt = "g";
function he(e, t, o) {
  let i = e;
  return t && (i += `__${t}`), o && (i += `--${o}`), i;
}
function je(e, t = !1) {
  const o = t ? `.${pt}-${e}` : `${pt}-${e}`;
  return {
    b: () => he(o),
    e: (r) => r ? he(o, r) : "",
    m: (r) => r ? he(o, "", r) : "",
    em: (r, s) => r && s ? he(o, r, s) : ""
  };
}
const Wo = O({
  name: "ModalClose",
  components: {
    Tooltip: ve,
    FullscreenExitOutlined: ln,
    FullscreenOutlined: rn,
    CloseOutlined: Dt
  },
  props: {
    canFullscreen: { type: Boolean, default: !0 },
    fullScreen: { type: Boolean }
  },
  emits: ["cancel", "fullscreen"],
  setup(e, { emit: t }) {
    const i = je("basic-modal-close").b();
    ze();
    const n = Ie(), l = D(() => [
      i,
      `${i}--custom`,
      {
        [`${i}--can-full`]: e.canFullscreen
      }
    ]);
    function a(s) {
      t("cancel", s);
    }
    function r(s) {
      s == null || s.stopPropagation(), s == null || s.preventDefault(), t("fullscreen");
    }
    return {
      t: n,
      getClass: l,
      prefixCls: i,
      handleCancel: a,
      handleFullScreen: r
    };
  }
});
function Zo(e, t, o, i, n, l) {
  const a = z("FullscreenExitOutlined"), r = z("Tooltip"), s = z("FullscreenOutlined"), c = z("CloseOutlined");
  return h(), x("div", {
    class: X(e.getClass)
  }, [
    e.canFullscreen ? (h(), x(re, { key: 0 }, [
      e.fullScreen ? (h(), _(r, {
        key: 0,
        title: e.t("modal.restore"),
        placement: "bottom"
      }, {
        default: N(() => [
          f(a, {
            role: "full",
            onClick: e.handleFullScreen
          }, null, 8, ["onClick"])
        ]),
        _: 1
      }, 8, ["title"])) : (h(), _(r, {
        key: 1,
        title: e.t("modal.maximize"),
        placement: "bottom"
      }, {
        default: N(() => [
          f(s, {
            role: "close",
            onClick: e.handleFullScreen
          }, null, 8, ["onClick"])
        ]),
        _: 1
      }, 8, ["title"]))
    ], 64)) : q("", !0),
    f(r, {
      title: e.t("modal.close"),
      placement: "bottom"
    }, {
      default: N(() => [
        f(c, { onClick: e.handleCancel }, null, 8, ["onClick"])
      ]),
      _: 1
    }, 8, ["title"])
  ], 2);
}
const Go = /* @__PURE__ */ R(Wo, [["render", Zo]]), Xo = O({
  name: "BasicModalFooter",
  props: He,
  components: {
    Button: Ue
  },
  emits: ["ok", "cancel"],
  setup(e, { emit: t }) {
    function o(n) {
      t("ok", n);
    }
    function i(n) {
      t("cancel", n);
    }
    return { handleOk: o, handleCancel: i };
  }
});
function Vo(e, t, o, i, n, l) {
  const a = z("Button");
  return h(), x("div", null, [
    U(e.$slots, "insertFooter"),
    e.showCancelBtn ? (h(), _(a, oe({ key: 0 }, e.cancelButtonProps, { onClick: e.handleCancel }), {
      default: N(() => [
        V(b(e.cancelText), 1)
      ]),
      _: 1
    }, 16, ["onClick"])) : q("", !0),
    U(e.$slots, "centerFooter"),
    e.showOkBtn ? (h(), _(a, oe({
      key: 1,
      type: e.okType,
      onClick: e.handleOk,
      loading: e.confirmLoading
    }, e.okButtonProps), {
      default: N(() => [
        V(b(e.okText), 1)
      ]),
      _: 1
    }, 16, ["type", "onClick", "loading"])) : q("", !0),
    U(e.$slots, "appendFooter")
  ]);
}
const Jo = /* @__PURE__ */ R(Xo, [["render", Vo]]), qo = O({
  name: `${Ae}SvgIcon`,
  props: {
    prefix: {
      type: String,
      default: "icon"
    },
    name: {
      type: String,
      required: !0
    },
    size: {
      type: [Number, String],
      default: 16
    },
    spin: {
      type: Boolean,
      default: !1
    }
  },
  setup(e) {
    const o = je("svg-icon").b(), i = D(() => `#${e.prefix}-${e.name}`), n = D(() => {
      const { size: l } = e;
      let a = `${l}`;
      return a = `${a.replace("px", "")}px`, {
        width: a,
        height: a
      };
    });
    return { symbolId: i, prefixCls: o, getStyle: n };
  }
});
const Ko = ["xlink:href"];
function ei(e, t, o, i, n, l) {
  return h(), x("svg", {
    class: X([e.prefixCls, e.$attrs.class, e.spin && "svg-icon-spin"]),
    style: pe(e.getStyle),
    "aria-hidden": "true"
  }, [
    I("use", { "xlink:href": e.symbolId }, null, 8, Ko)
  ], 6);
}
const ti = /* @__PURE__ */ R(qo, [["render", ei]]), yt = "|svg", ni = O({
  name: `${Ae}Icon`,
  components: { SvgIcon: ti },
  props: {
    // icon name
    icon: String,
    // icon color
    color: String,
    // icon size
    size: {
      type: [String, Number],
      default: 16
    },
    spin: {
      type: Boolean,
      default: !1
    },
    prefix: {
      type: String,
      default: ""
    }
  },
  setup(e) {
    const t = T(null), o = D(() => {
      var r;
      return (r = e.icon) == null ? void 0 : r.endsWith(yt);
    }), i = D(
      () => e.icon.replace(yt, "")
    ), n = D(
      () => `${e.prefix ? e.prefix + ":" : ""}${e.icon}`
    ), l = async () => {
      if (u(o))
        return;
      const r = u(t);
      if (!r)
        return;
      await B();
      const s = u(n);
      if (!s)
        return;
      const c = wn.renderSVG(s, {});
      if (c)
        r.textContent = "", r.appendChild(c);
      else {
        const M = document.createElement("span");
        M.className = "iconify", M.dataset.icon = s, r.textContent = "", r.appendChild(M);
      }
    }, a = D(() => {
      const { size: r, color: s } = e;
      let c = r;
      return me(r) && (c = parseInt(r, 10)), {
        fontSize: `${c}px`,
        color: s,
        display: "inline-flex"
      };
    });
    return Ce(() => e.icon, l, { flush: "post" }), Be(l), { elRef: t, getWrapStyle: a, isSvgIcon: o, getSvgIcon: i };
  }
});
function oi(e, t, o, i, n, l) {
  const a = z("SvgIcon");
  return e.isSvgIcon ? (h(), _(a, {
    key: 0,
    size: e.size,
    name: e.getSvgIcon,
    class: X([e.$attrs.class, "anticon"]),
    spin: e.spin
  }, null, 8, ["size", "name", "class", "spin"])) : (h(), x("span", {
    key: 1,
    ref: "elRef",
    class: X([e.$attrs.class, "app-iconify anticon", e.spin && "app-iconify-spin"]),
    style: pe(e.getWrapStyle)
  }, null, 6));
}
const ke = /* @__PURE__ */ R(ni, [["render", oi]]);
ke.install = function(e, t) {
  e.component(t || ke.name, ke);
};
const ii = {
  /**
   * Help text max-width
   * @default: 600px
   */
  maxWidth: {
    type: String,
    default: "600px"
  },
  /**
   * Whether to display the serial number
   * @default: false
   */
  showIndex: {
    type: Boolean
  },
  /**
   * Help text font color
   * @default: #ffffff
   */
  color: {
    type: String,
    default: "#ffffff"
  },
  /**
   * Help text font size
   * @default: 14px
   */
  fontSize: {
    type: String,
    default: "14px"
  },
  /**
   * Help text list
   */
  placement: {
    type: String,
    default: "right"
  },
  /**
   * Help text list
   */
  text: {
    type: [Array, String]
  }
}, li = /* @__PURE__ */ O({
  name: "BasicHelp",
  components: {
    Tooltip: ve
  },
  props: ii,
  setup(e, {
    slots: t
  }) {
    const i = je("basic-help").b(), n = D(() => ({
      color: e.color,
      fontSize: e.fontSize
    })), l = D(() => ({
      maxWidth: e.maxWidth
    }));
    function a() {
      const s = e.text;
      return me(s) ? f("p", null, [s]) : Ye(s) ? s.map((c, M) => f("p", {
        key: c
      }, [f(re, null, [e.showIndex ? `${M + 1}. ` : "", c])])) : null;
    }
    function r(s) {
      return (s == null ? void 0 : s.parentNode) ?? document.body;
    }
    return () => f(ve, {
      overlayClassName: `${i}__wrap`,
      title: f("div", {
        style: u(n)
      }, [a()]),
      autoAdjustOverflow: !0,
      overlayStyle: u(l),
      placement: e.placement,
      getPopupContainer: () => r()
    }, {
      default: () => [f("span", {
        class: i
      }, [_t(t) || f(an, null, null)])]
    });
  }
});
const ri = /* @__PURE__ */ O({
  __name: "BasicTitle",
  props: {
    /**
     * Help text list or string
     * @default: ''
     */
    helpMessage: {
      type: [String, Array],
      default: ""
    },
    /**
     * Whether the color block on the left side of the title
     * @default: false
     */
    span: { type: Boolean },
    /**
     * Whether to default the text, that is, not bold
     * @default: false
     */
    normal: { type: Boolean }
  },
  setup(e) {
    const t = je("basic-title"), o = e, i = t.b(), n = en(), l = D(() => [
      i,
      { [`${i}-show-span`]: o.span && n.default },
      { [`${i}-normal`]: o.normal }
    ]);
    return (a, r) => (h(), x("span", {
      class: X(l.value)
    }, [
      U(a.$slots, "default"),
      e.helpMessage ? (h(), _(li, {
        key: 0,
        class: X(`${u(i)}-help`),
        text: e.helpMessage
      }, null, 8, ["class", "text"])) : q("", !0)
    ], 2));
  }
});
const ai = O({
  name: "BasicModalHeader",
  components: { BasicTitle: ri },
  props: {
    helpMessage: {
      type: [String, Array]
    },
    title: { type: String }
  },
  emits: ["dblclick"]
});
function si(e, t, o, i, n, l) {
  const a = z("BasicTitle");
  return h(), _(a, { helpMessage: e.helpMessage }, {
    default: N(() => [
      V(b(e.title), 1)
    ]),
    _: 1
  }, 8, ["helpMessage"]);
}
const ci = /* @__PURE__ */ R(ai, [["render", si]]);
function ui(e) {
  const t = T(!1), o = D(() => {
    const n = u(e.wrapClassName) || "";
    return u(t) ? `fullscreen-modal ${n} ` : u(n);
  });
  function i(n) {
    n && n.stopPropagation(), t.value = !u(t);
  }
  return { getWrapClassName: o, handleFullScreen: i, fullScreenRef: t };
}
const di = O({
  name: `${Ae}BasicModal`,
  components: { Modal: jo, ModalWrapper: Ho, ModalClose: Go, ModalFooter: Jo, ModalHeader: ci },
  inheritAttrs: !1,
  props: He,
  emits: [
    "visible-change",
    "height-change",
    "cancel",
    "ok",
    "register",
    "update:visible"
  ],
  setup(e, { emit: t, attrs: o }) {
    const i = T(!1), n = T(null), l = T(null), a = je("basic-modal"), r = T(0), s = {
      setModalProps: C,
      emitVisible: void 0,
      redoModalHeight: () => {
        B(() => {
          u(l) && u(l).setModalHeight();
        });
      }
    }, c = ze();
    c && t("register", s, c.uid);
    const M = D(() => ({
      ...e,
      ...u(n)
    })), { handleFullScreen: y, getWrapClassName: g, fullScreenRef: j } = ui(
      {
        modalWrapperRef: l,
        extHeightRef: r,
        wrapClassName: tn(M.value, "wrapClassName")
      }
    ), v = D(() => ({
      ...{
        ...u(M),
        visible: u(i),
        okButtonProps: void 0,
        cancelButtonProps: void 0,
        title: void 0
      },
      wrapClassName: u(g)
    })), L = D(() => {
      const m = {
        ...o,
        ...u(M),
        visible: u(i),
        wrapClassName: u(g)
      };
      return u(j) ? Ee(m, ["height", "title"]) : Ee(m, "title");
    }), p = D(() => {
      if (!u(j))
        return u(v).height;
    });
    Le(() => {
      i.value = !!e.visible, j.value = !!e.defaultFullscreen;
    }), Ce(
      () => u(i),
      (m) => {
        t("visible-change", m), t("update:visible", m), B(() => {
          e.scrollTop && m && u(l) && u(l).scrollTop();
        });
      },
      {
        immediate: !1
      }
    );
    async function S(m) {
      var $, Ne;
      if (m == null || m.stopPropagation(), !((Ne = ($ = m.target) == null ? void 0 : $.classList) != null && Ne.contains(
        a.b() + "-close--custom"
      ))) {
        if (e.closeFunc && xe(e.closeFunc)) {
          const be = await e.closeFunc();
          i.value = !be;
          return;
        }
        i.value = !1, t("cancel", m);
      }
    }
    function C(m) {
      n.value = Et(u(n) || {}, m), Reflect.has(m, "visible") && (i.value = !!m.visible), Reflect.has(m, "defaultFullscreen") && (j.value = !!m.defaultFullscreen);
    }
    function E(m) {
      t("ok", m);
    }
    function Y(m) {
      t("height-change", m);
    }
    function W(m) {
      r.value = m;
    }
    function G(m) {
      e.canFullscreen && (m.stopPropagation(), y(m));
    }
    return {
      handleCancel: S,
      getBindValue: L,
      getProps: v,
      handleFullScreen: y,
      fullScreenRef: j,
      getMergeProps: M,
      handleOk: E,
      visibleRef: i,
      omit: Ee,
      modalWrapperRef: l,
      handleExtHeight: W,
      handleHeightChange: Y,
      handleTitleDbClick: G,
      getWrapperHeight: p
    };
  }
});
function gi(e, t, o, i, n, l) {
  const a = z("ModalClose"), r = z("ModalHeader"), s = z("ModalFooter"), c = z("ModalWrapper"), M = z("Modal", !0);
  return h(), _(M, oe(e.getBindValue, { onCancel: e.handleCancel }), Xe({
    default: N(() => [
      f(c, oe(
        {
          useWrapper: e.getProps.useWrapper,
          footerOffset: e.wrapperFooterOffset,
          fullScreen: e.fullScreenRef,
          ref: "modalWrapperRef",
          loading: e.getProps.loading,
          "loading-tip": e.getProps.loadingTip,
          minHeight: e.getProps.minHeight,
          height: e.getWrapperHeight,
          visible: e.visibleRef,
          modalFooterHeight: e.footer !== void 0 && !e.footer ? 0 : void 0
        },
        e.omit(e.getProps.wrapperProps, "visible", "height", "modalFooterHeight"),
        {
          onExtHeight: e.handleExtHeight,
          onHeightChange: e.handleHeightChange
        }
      ), {
        default: N(() => [
          U(e.$slots, "default")
        ]),
        _: 3
      }, 16, ["useWrapper", "footerOffset", "fullScreen", "loading", "loading-tip", "minHeight", "height", "visible", "modalFooterHeight", "onExtHeight", "onHeightChange"])
    ]),
    _: 2
  }, [
    e.$slots.closeIcon ? void 0 : {
      name: "closeIcon",
      fn: N(() => [
        f(a, {
          canFullscreen: e.getProps.canFullscreen,
          fullScreen: e.fullScreenRef,
          onCancel: e.handleCancel,
          onFullscreen: e.handleFullScreen
        }, null, 8, ["canFullscreen", "fullScreen", "onCancel", "onFullscreen"])
      ]),
      key: "0"
    },
    e.$slots.title ? void 0 : {
      name: "title",
      fn: N(() => [
        f(r, {
          helpMessage: e.getProps.helpMessage,
          title: e.getMergeProps.title,
          onDblclick: e.handleTitleDbClick
        }, null, 8, ["helpMessage", "title", "onDblclick"])
      ]),
      key: "1"
    },
    e.$slots.footer ? void 0 : {
      name: "footer",
      fn: N(() => [
        f(s, oe(e.getBindValue, {
          onOk: e.handleOk,
          onCancel: e.handleCancel
        }), Xe({ _: 2 }, [
          ye(Object.keys(e.$slots), (y) => ({
            name: y,
            fn: N((g) => [
              U(e.$slots, y, Ve(Je(g || {})))
            ])
          }))
        ]), 1040, ["onOk", "onCancel"])
      ]),
      key: "2"
    },
    ye(Object.keys(e.omit(e.$slots, "default")), (y) => ({
      name: y,
      fn: N((g) => [
        U(e.$slots, y, Ve(Je(g || {})))
      ])
    }))
  ]), 1040, ["onCancel"]);
}
const Me = /* @__PURE__ */ R(di, [["render", gi]]);
const de = te({}), mt = te({});
function Mi() {
  const e = T(null), t = T(!1), o = T("");
  function i(a, r) {
    if (!ze())
      throw new Error(
        "useModal() can only be used inside setup() or functional components!"
      );
    o.value = r, Re(() => {
      e.value = null, t.value = !1, de[u(o)] = null;
    }), !(u(t) && a === u(e)) && (e.value = a, t.value = !0, a.emitVisible = (s, c) => {
      mt[c] = s;
    });
  }
  const n = () => {
    const a = u(e);
    return a || Un("useModal instance is undefined!"), a;
  }, l = {
    setModalProps: (a) => {
      var r;
      (r = n()) == null || r.setModalProps(a);
    },
    getVisible: D(() => mt[~~u(o)]),
    redoModalHeight: () => {
      var a, r;
      (r = (a = n()) == null ? void 0 : a.redoModalHeight) == null || r.call(a);
    },
    openModal: (a = !0, r, s = !0) => {
      var y;
      if ((y = n()) == null || y.setModalProps({
        visible: a
      }), !r)
        return;
      const c = u(o);
      if (s) {
        de[c] = null, de[c] = Te(r);
        return;
      }
      Pe(Te(de[c]), Te(r)) || (de[c] = Te(r));
    },
    closeModal: () => {
      var a;
      (a = n()) == null || a.setModalProps({ visible: !1 });
    }
  };
  return [i, l];
}
Me.install = function(e, t) {
  e.component(t || Me.name, Me);
};
function fi(e, t, o, i) {
  const n = typeof i < "u" ? [i, e] : [e], l = new Blob(n, { type: o || "application/octet-stream" }), a = window.URL.createObjectURL(l), r = document.createElement("a");
  r.style.display = "none", r.href = a, r.setAttribute("download", t), typeof r.download > "u" && r.setAttribute("target", "_blank"), document.body.appendChild(r), r.click(), document.body.removeChild(r), window.URL.revokeObjectURL(a);
}
const pi = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBzdGFuZGFsb25lPSJubyI/PjwhRE9DVFlQRSBzdmcgUFVCTElDICItLy9XM0MvL0RURCBTVkcgMS4xLy9FTiIgImh0dHA6Ly93d3cudzMub3JnL0dyYXBoaWNzL1NWRy8xLjEvRFREL3N2ZzExLmR0ZCI+PHN2ZyB0PSIxNTk1MzA3MTU0MjM5IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjczMTciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB3aWR0aD0iNDgiIGhlaWdodD0iNDgiPjxkZWZzPjxzdHlsZSB0eXBlPSJ0ZXh0L2NzcyI+PC9zdHlsZT48L2RlZnM+PHBhdGggZD0iTTMxNiA2NzJoNjBjNC40IDAgOC0zLjYgOC04VjM2MGMwLTQuNC0zLjYtOC04LThoLTYwYy00LjQgMC04IDMuNi04IDh2MzA0YzAgNC40IDMuNiA4IDggOHpNNTEyIDYyMmMyMi4xIDAgNDAtMTcuOSA0MC0zOSAwLTIzLjEtMTcuOS00MS00MC00MXMtNDAgMTcuOS00MCA0MWMwIDIxLjEgMTcuOSAzOSA0MCAzOXpNNTEyIDQ4MmMyMi4xIDAgNDAtMTcuOSA0MC0zOSAwLTIzLjEtMTcuOS00MS00MC00MXMtNDAgMTcuOS00MCA0MWMwIDIxLjEgMTcuOSAzOSA0MCAzOXoiIHAtaWQ9IjczMTgiIGZpb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MTUuOS05LjMtMjIuMS02LjItNi4yLTEzLjYtOS4zLTIyLjItOS4zcy0xNi4xIDMuMS0yMi40IDkuM2MtNi4zIDYuMi05LjQgMTMuNy05LjQgMjIuNi0wLjEgOC40IDMgMTUuOCA5LjMgMjIuMXoiIHAtaWQ9IjEzNTQiIGZpbGw9IiNmZmZmZmYiPjwvcGF0aD48L3N2Zz4K";
var J;
(function(e) {
  e[e.LOADING = 0] = "LOADING", e[e.DONE = 1] = "DONE", e[e.FAIL = 2] = "FAIL";
})(J || (J = {}));
const ji = {
  show: {
    type: Boolean,
    default: !1
  },
  imageList: {
    type: [Array],
    default: null
  },
  index: {
    type: Number,
    default: 0
  },
  scaleStep: {
    type: Number
  },
  defaultWidth: {
    type: Number
  },
  maskClosable: {
    type: Boolean
  },
  rememberState: {
    type: Boolean
  }
}, k = "img-preview", Ni = /* @__PURE__ */ O({
  name: "ImagePreview",
  props: ji,
  emits: ["img-load", "img-error"],
  setup(e, {
    expose: t,
    emit: o
  }) {
    const i = /* @__PURE__ */ new Map(), n = te({
      currentUrl: "",
      imgScale: 1,
      imgRotate: 0,
      imgTop: 0,
      imgLeft: 0,
      status: J.LOADING,
      currentIndex: 0,
      moveX: 0,
      moveY: 0,
      show: e.show
    }), l = T(null), a = T(null);
    function r() {
      c();
      const {
        index: d,
        imageList: A
      } = e;
      if (!A || !A.length)
        throw new Error("imageList is undefined");
      n.currentIndex = d, L(A[d]);
    }
    function s() {
      n.imgScale = 1, n.imgRotate = 0, n.imgTop = 0, n.imgLeft = 0;
    }
    function c() {
      const d = u(l);
      d && (d.onmousewheel = y, document.body.addEventListener("DOMMouseScroll", y), document.ondragstart = function() {
        return !1;
      });
    }
    const M = D(() => {
      const d = (e == null ? void 0 : e.scaleStep) ?? 0;
      return d ?? 0 > 0 ? d / 100 : n.imgScale / 10;
    });
    function y(d) {
      d = d || window.event, d.delta = d.wheelDelta || -d.detail, d.preventDefault(), d.delta > 0 && g(M.value), d.delta < 0 && g(-M.value);
    }
    function g(d) {
      n.imgScale <= 0.2 && d < 0 || (n.imgScale += d);
    }
    function j(d) {
      n.imgRotate += d;
    }
    function v() {
      const d = u(a);
      d && (d.onmousemove = null);
    }
    function L(d) {
      n.status = J.LOADING;
      const A = new Image();
      A.src = d, A.onload = (Q) => {
        if (n.currentUrl !== d) {
          const Z = Q.composedPath();
          if (e.rememberState) {
            i.set(n.currentUrl, {
              scale: n.imgScale,
              top: n.imgTop,
              left: n.imgLeft,
              rotate: n.imgRotate
            });
            const ue = i.get(d);
            ue ? (n.imgScale = ue.scale, n.imgTop = ue.top, n.imgRotate = ue.rotate, n.imgLeft = ue.left) : (s(), e.defaultWidth && (n.imgScale = e.defaultWidth / Z[0].naturalWidth));
          } else
            e.defaultWidth && (n.imgScale = e.defaultWidth / Z[0].naturalWidth);
          Z && o("img-load", {
            index: n.currentIndex,
            dom: Z[0],
            url: d
          });
        }
        n.currentUrl = d, n.status = J.DONE;
      }, A.onerror = (Q) => {
        const Z = Q.composedPath();
        Z && o("img-error", {
          index: n.currentIndex,
          dom: Z[0],
          url: d
        }), n.status = J.FAIL;
      };
    }
    function p(d) {
      d && d.stopPropagation(), S();
    }
    function S() {
      n.show = !1, document.body.removeEventListener("DOMMouseScroll", y), document.ondragstart = null;
    }
    function C() {
      s();
    }
    t({
      resume: C,
      close: S,
      prev: E.bind(null, "left"),
      next: E.bind(null, "right"),
      setScale: (d) => {
        d > 0 && d <= 10 && (n.imgScale = d);
      },
      setRotate: (d) => {
        n.imgRotate = d;
      }
    });
    function E(d) {
      const {
        currentIndex: A
      } = n, {
        imageList: Q
      } = e;
      d === "left" && (n.currentIndex--, A <= 0 && (n.currentIndex = Q.length - 1)), d === "right" && (n.currentIndex++, A >= Q.length - 1 && (n.currentIndex = 0)), L(Q[n.currentIndex]);
    }
    function Y(d) {
      d = d || window.event, n.moveX = d.clientX, n.moveY = d.clientY;
      const A = u(a);
      A && (A.onmousemove = W);
    }
    function W(d) {
      d = d || window.event, d.preventDefault();
      const A = d.clientX - n.moveX, Q = d.clientY - n.moveY;
      n.imgLeft += A, n.imgTop += Q, n.moveX = d.clientX, n.moveY = d.clientY;
    }
    const G = D(() => {
      const {
        imgScale: d,
        imgRotate: A,
        imgTop: Q,
        imgLeft: Z
      } = n;
      return {
        transform: `scale(${d}) rotate(${A}deg)`,
        marginTop: `${Q}px`,
        marginLeft: `${Z}px`,
        maxWidth: e.defaultWidth ? "unset" : "100%"
      };
    }), m = D(() => {
      const {
        imageList: d
      } = e;
      return d.length > 1;
    });
    Le(() => {
      e.show && r(), e.imageList && s();
    });
    const $ = (d) => {
      e.maskClosable && d.target && d.target.classList.contains(`${k}-content`) && p(d);
    }, Ne = () => f("div", {
      class: `${k}__close`,
      onClick: p
    }, [f(Dt, {
      class: `${k}__close-icon`
    }, null)]), be = () => {
      if (!u(m))
        return null;
      const {
        currentIndex: d
      } = n, {
        imageList: A
      } = e;
      return f("div", {
        class: `${k}__index`
      }, [d + 1, V(" / "), A.length]);
    }, Zt = () => f("div", {
      class: `${k}__controller`
    }, [f("div", {
      class: `${k}__controller-item`,
      onClick: () => g(-M.value)
    }, [f("img", {
      src: Li
    }, null)]), f("div", {
      class: `${k}__controller-item`,
      onClick: () => g(M.value)
    }, [f("img", {
      src: mi
    }, null)]), f("div", {
      class: `${k}__controller-item`,
      onClick: C
    }, [f("img", {
      src: pi
    }, null)]), f("div", {
      class: `${k}__controller-item`,
      onClick: () => j(-90)
    }, [f("img", {
      src: Ii
    }, null)]), f("div", {
      class: `${k}__controller-item`,
      onClick: () => j(90)
    }, [f("img", {
      src: yi
    }, null)])]), Ge = (d) => u(m) ? f("div", {
      class: [`${k}__arrow`, d],
      onClick: () => E(d)
    }, [d === "left" ? f(sn, null, null) : f(cn, null, null)]) : null;
    return () => n.show && f("div", {
      class: k,
      ref: l,
      onMouseup: v,
      onClick: $
    }, [f("div", {
      class: `${k}-content`
    }, [f("img", {
      style: u(G),
      class: [`${k}-image`, n.status === J.DONE ? "" : "hidden"],
      ref: a,
      src: n.currentUrl,
      onMousedown: Y
    }, null), Ne(), be(), Zt(), Ge("left"), Ge("right")])]);
  }
});
const Ti = (e) => {
  const t = e == null ? void 0 : e.split(".").pop().toLowerCase();
  return ["doc", "docx"].includes(t) ? "application/msword" : ["docx"].includes(t) ? "application/vnd.openxmlformats-officedocument.wordprocessingml.document" : ["xls"].includes(t) ? "application/vnd.ms-excel" : ["xlsx"].includes(t) ? "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" : ["ppt"].includes(t) ? "application/vnd.ms-powerpoint" : ["pptx"].includes(t) ? "application/vnd.openxmlformats-officedocument.presentationml.presentation" : ["pdf"].includes(t) ? "application/pdf" : ["png", "jpg", "jpeg", "gif", "bmp", "svg", "webp"].includes(t) ? `image/${t}` : ["zip"].includes(t) ? "application/zip" : "";
}, hi = { class: "content" }, Di = { class: "subject" }, vi = { class: "sender" }, Si = { style: { width: "50px" } }, Ci = { class: "person" }, zi = { class: "sender-t" }, Ai = /* @__PURE__ */ I("b", null, "发件人: ", -1), xi = ["title"], wi = /* @__PURE__ */ I("b", null, "收件人: ", -1), Oi = ["title"], bi = { class: "body" }, Ei = ["innerHTML"], _i = {
  key: 0,
  class: "file"
}, ki = /* @__PURE__ */ I("h1", null, "附件", -1), Pi = ["href", "download"], Yi = {
  name: "GMsgUrlReader"
}, $i = /* @__PURE__ */ O({
  ...Yi,
  props: {
    url: {
      type: String,
      default: ""
    },
    fileName: {
      type: String,
      default: ""
    },
    msgApi: {
      type: Function,
      default: () => {
      },
      required: !1
    }
  },
  setup(e) {
    const t = e, o = T(!1), i = T({});
    T(t.url).value ? a() : console.error("msg url or msg api is empty");
    const l = (r) => {
      const s = r.body, c = /<(https?:\/\/[^>]+)>/g;
      return s.replace(
        c,
        (y, g) => `<a href="${g}" target="_blank">${g}</a>`
      ).replace(/\r\n/g, "<br/>");
    };
    async function a() {
      try {
        const r = t == null ? void 0 : t.fileName, s = t == null ? void 0 : t.url, M = await (t == null ? void 0 : t.msgApi)({ fileName: r, fileUrl: s }), y = M == null ? void 0 : M.data, g = new Blob([new Uint8Array(y)], {
          type: "application/octet-stream"
        }), j = new FileReader();
        j.onload = (v) => {
          var L;
          try {
            const p = (L = v == null ? void 0 : v.target) == null ? void 0 : L.result;
            let S;
            typeof _e == "function" ? S = new _e(p) : S = new _e.default(p);
            const C = S.getFileData();
            console.log("Parsed MSG Data:", C);
            const E = ((C == null ? void 0 : C.attachments) || []).map((Y, W) => {
              const G = S == null ? void 0 : S.getAttachment(W), m = Ti(Y.fileName), $ = new Blob([new Uint8Array(G.content)], {
                type: m || "application/octet-stream"
              });
              return {
                ...Y,
                url: URL.createObjectURL($)
              };
            });
            i.value = {
              subject: C.subject,
              senderEmail: C.senderEmail,
              senderName: C.senderName,
              recipients: C == null ? void 0 : C.recipients,
              body: l(C),
              attachments: E
            }, o.value = !0;
          } catch (p) {
            console.error("文件解析失败:", p);
          }
        }, j.readAsArrayBuffer(g);
      } catch (r) {
        console.error("解析 .msg 文件失败:", r);
      }
    }
    return (r, s) => (h(), _(u(Me), {
      width: "800px",
      minHeight: "300",
      wrapClassName: "g-msgFile-model-wrapper",
      showOkBtn: !1,
      maskClosable: !1,
      visible: o.value,
      "onUpdate:visible": s[1] || (s[1] = (c) => o.value = c),
      onCancel: s[2] || (s[2] = (c) => o.value = !1)
    }, {
      title: N(() => [
        f(u(vt))
      ]),
      footer: N(() => [
        f(u(Ue), {
          onClick: s[0] || (s[0] = (c) => o.value = !1)
        }, {
          default: N(() => [
            V("cancle")
          ]),
          _: 1
        })
      ]),
      default: N(() => {
        var c, M, y, g, j, v, L;
        return [
          I("div", hi, [
            I("h1", Di, b((c = i.value) == null ? void 0 : c.subject), 1),
            I("div", vi, [
              I("div", Si, [
                f(u(St), { style: { "background-color": "#0084f4", opacity: "0.8" } }, {
                  default: N(() => {
                    var p, S;
                    return [
                      V(b((S = (p = i.value) == null ? void 0 : p.senderName) == null ? void 0 : S.slice(0, 1)), 1)
                    ];
                  }),
                  _: 1
                })
              ]),
              I("div", Ci, [
                I("div", zi, [
                  Ai,
                  I("span", {
                    title: (M = i.value) == null ? void 0 : M.senderEmail
                  }, b((y = i.value) == null ? void 0 : y.senderName), 9, xi)
                ]),
                I("div", null, [
                  wi,
                  (h(!0), x(re, null, ye((g = i.value) == null ? void 0 : g.recipients, (p, S) => (h(), x("span", { key: S }, [
                    I("span", {
                      style: { "margin-right": "3px" },
                      title: p == null ? void 0 : p.email
                    }, b(p == null ? void 0 : p.name) + ";", 9, Oi)
                  ]))), 128))
                ])
              ])
            ]),
            I("div", bi, [
              I("p", {
                innerHTML: (j = i.value) == null ? void 0 : j.body
              }, null, 8, Ei)
            ]),
            (L = (v = i.value) == null ? void 0 : v.attachments) != null && L.length ? (h(), x("div", _i, [
              ki,
              I("ul", null, [
                (h(!0), x(re, null, ye(i.value.attachments, (p, S) => (h(), x("li", { key: S }, [
                  I("a", {
                    href: p == null ? void 0 : p.url,
                    download: p == null ? void 0 : p.fileName
                  }, b(p == null ? void 0 : p.fileName), 9, Pi)
                ]))), 128))
              ])
            ])) : q("", !0)
          ])
        ];
      }),
      _: 1
    }, 8, ["visible"]));
  }
});
var It, jt;
const Qi = ((jt = (It = import.meta) == null ? void 0 : It.env) == null ? void 0 : jt.VITE_PUBLIC_PATH) || "/", Fi = Qi + "preview.html", Bt = [
  "csv",
  "djvu",
  "doc",
  "docm",
  "docx",
  "docxf",
  "dot",
  "dotm",
  "dotx",
  "epub",
  "fb2",
  "fodp",
  "fods",
  "fodt",
  "htm",
  "html",
  "mht",
  "odp",
  "ods",
  "odt",
  "oform",
  "otp",
  "ots",
  "ott",
  "oxps",
  "pdf",
  "pot",
  "potm",
  "potx",
  "pps",
  "ppsm",
  "ppsx",
  "ppt",
  "pptm",
  "pptx",
  "rtf",
  "txt",
  "xls",
  "xlsb",
  "xlsm",
  "xlsx",
  "xlt",
  "xltm",
  "xltx",
  "xml",
  "xps"
], Ut = ["jpg", "jpeg", "png", "gif", "bmp", "webp"], Ri = ["msg"], Bi = [...Bt, ...Ut, ...Ri];
function Ui(e) {
  const { url: t, fileName: o, ...i } = e, n = D(() => {
    const g = u(o);
    if (g)
      return g;
    if (!u(t))
      return "";
    const v = u(t).split("/"), L = v.length, p = v[L - 1].split("?");
    return decodeURIComponent(p[0]);
  }), l = D(() => {
    const g = u(n);
    if (!g)
      return "";
    const j = g.split(".").pop();
    return (j == null ? void 0 : j.toLowerCase()) || "";
  }), a = D(() => {
    const g = u(l);
    return g ? Bi.includes(g) : !1;
  }), r = D(() => {
    const g = u(l);
    return g ? Bt.includes(g) : !1;
  }), s = D(() => {
    const g = u(l);
    return g ? Ut.includes(g) : !1;
  }), c = D(() => u(l) === "pdf"), M = D(() => {
    const g = u(l);
    return g ? g === "msg" : !1;
  }), y = D(() => {
    const g = po(u(t)), j = u(c), v = u(r), { getLang: L } = wt(), p = L() === "en" ? "en" : "zh_CN", S = u(e == null ? void 0 : e.mode) || "view";
    if (j && S === "view")
      return g;
    if (v) {
      let C = `${Fi}?url=${encodeURIComponent(
        g
      )}&fileName=${encodeURIComponent(u(n))}&fileType=${u(
        l
      )}&lang=${p}`;
      for (const E in i)
        if (Object.prototype.hasOwnProperty.call(i, E)) {
          const Y = u(i[E]);
          C += `&${E}=${encodeURIComponent(Y)}`;
        }
      return C;
    }
    return g;
  });
  return {
    getFileName: n,
    getFileExt: l,
    getIsSupportPreview: a,
    getIsOfficeFile: r,
    getIsImageFile: s,
    getIsPdfFile: c,
    getPreviewSrc: y,
    getIsMsgFile: M
  };
}
function Ht(e) {
  return e === "warning" ? f(qe, {
    class: "modal-icon-warning"
  }, null) : e === "success" ? f(un, {
    class: "modal-icon-success"
  }, null) : e === "info" ? f(qe, {
    class: "modal-icon-info"
  }, null) : f(dn, {
    class: "modal-icon-error"
  }, null);
}
function Wt({
  content: e
}) {
  return me(e) ? f("div", {
    innerHTML: `<div>${e}</div>`
  }, null) : e;
}
function Hi(e) {
  const t = e.iconType || "warning";
  Reflect.deleteProperty(e, "iconType");
  const o = {
    centered: !0,
    icon: Ht(t),
    ...e,
    content: Wt(e)
  };
  return K.confirm(o);
}
const Wi = () => ({
  okText: Ie()("common.okText"),
  centered: !0
});
function Oe(e, t) {
  return {
    ...Wi(),
    ...e,
    content: Wt(e),
    icon: Ht(t)
  };
}
function Zi(e) {
  return K.success(Oe(e, "success"));
}
function Gi(e) {
  return K.error(Oe(e, "close"));
}
function Xi(e) {
  return K.info(Oe(e, "info"));
}
function Vi(e) {
  return K.warning(Oe(e, "warning"));
}
Ct.config({
  placement: "topRight",
  duration: 3
});
function Ji() {
  return {
    createMessage: zt,
    notification: Ct,
    createConfirm: Hi,
    createSuccessModal: Zi,
    createErrorModal: Gi,
    createInfoModal: Xi,
    createWarningModal: Vi
  };
}
const { createMessage: qi } = Ji(), Ki = Ie();
let ie = null;
function el(e) {
  var i;
  if (!bt)
    return;
  const t = {}, o = document.createElement("div");
  return Object.assign(t, { show: !0, index: 0, scaleStep: 10 }, e), ie = f(Ni, t), ht(ie, o), document.body.appendChild(o), (i = ie.component) == null ? void 0 : i.exposed;
}
function tl(e) {
  var i;
  if (!bt)
    return;
  const t = {}, o = document.createElement("div");
  return Object.assign(t, e), ie = f($i, t), ht(ie, o), document.body.appendChild(o), (i = ie.component) == null ? void 0 : i.exposed;
}
function Lt(e) {
  const { getPreviewSrc: t, getIsSupportPreview: o, getIsImageFile: i, getIsMsgFile: n } = Ui(Fe(e)), l = o.value, a = i.value, r = n.value, s = t.value;
  if (!l) {
    qi.warning(Ki("previewFile.notSupport"));
    return;
  }
  if (r) {
    tl({ ...e });
    return;
  }
  a ? el({ imageList: [s] }) : window.open(s);
}
const nl = O({
  name: "EmailReview",
  components: {
    Avatar: St,
    List: et,
    ListItem: et.Item,
    Card: Nn,
    Dropdown: Tn,
    Tooltip: ve,
    Button: Ue,
    Menu: tt,
    MenuItem: tt.Item
  },
  props: {
    data: {
      type: Object,
      default: () => {
      }
    },
    downLoadRequest: {
      // 优先使用方式下载，如果没有传入request，则只用传入的方法down-files
      type: Function
    },
    downLoadParams: {
      type: Object,
      default: () => {
      }
    }
  },
  emits: ["down-files"],
  setup(e, { emit: t }) {
    const o = Ie(), i = (r) => {
      const s = r == null ? void 0 : r.split(".")[(r == null ? void 0 : r.split(".").length) - 1].toLocaleLowerCase();
      let c = null;
      return ["ppt", "pptx"].includes(s) ? c = F(Ke) : ["xlsx", "xls"].includes(s) ? c = F(gn) : ["doc", "docx"].includes(s) ? c = F(Mn) : ["jpg", "jpeg"].includes(s) ? c = F(fn) : ["png"].includes(s) ? c = F(Ke) : ["gif"].includes(s) ? c = F(pn) : ["txt"].includes(s) ? c = F(yn) : ["pdf"].includes(s) ? c = F(mn) : c = F(Ln), c;
    }, n = te({
      emailData: {}
    }), l = T(!0);
    function a() {
      return [
        {
          label: o("common.preview"),
          icon: In,
          onClick: (r) => {
            Lt({ url: r.fileUrl || r.url, fileName: r.fileName });
          }
        },
        {
          label: o("common.download"),
          icon: jn,
          onClick: (r) => {
            if (!r.fileUrl && !r.url)
              return zt.warning(o("upload.noFile"));
            if (e.downLoadRequest) {
              let s = { fileName: r.fileName, fileUrl: r.fileUrl };
              Object.keys(e.downLoadParams).length > 0 && (s = {
                ...e.downLoadParams
              }), e.downLoadRequest(s).then((c) => {
                let M = "";
                if (c.headers["content-disposition"]) {
                  let y = c.headers["content-disposition"].split(";")[1].split("filename=")[1];
                  M = decodeURIComponent(y);
                }
                fi(c.data, M);
              });
            } else
              t("down-files", r);
          }
        }
      ];
    }
    return Le(() => {
      var r, s, c;
      e.data && (n.emailData = {
        ...e.data,
        createTime: (r = An(e.data.sendDate)) == null ? void 0 : r.format("YYYY-MM-DD HH:mm:ss dddd"),
        fileList: ((c = (s = e.data) == null ? void 0 : s.emailFileVos) == null ? void 0 : c.map((M) => ({
          ...M,
          icon: i(M.fileName)
        }))) || []
      });
    }), {
      confirmLoading: l,
      emailData: D(() => n.emailData),
      getDropDownActions: a,
      createDocPreview: Lt
    };
  }
});
const Ze = (e) => (nn("data-v-c11f2250"), e = e(), on(), e), ol = { class: "email-wrapper" }, il = { class: "subject" }, ll = { class: "sender" }, rl = { style: { width: "50px" } }, al = { class: "person" }, sl = { class: "sender-t" }, cl = /* @__PURE__ */ Ze(() => /* @__PURE__ */ I("span", { class: "grey-c" }, "收件人：", -1)), ul = { class: "address" }, dl = /* @__PURE__ */ Ze(() => /* @__PURE__ */ I("span", { class: "grey-c" }, "抄送人：", -1)), gl = { class: "address" }, Ml = {
  style: { width: "250px" },
  class: "grey-c"
}, fl = ["innerHTML"], pl = {
  key: 0,
  class: "mt-4"
}, yl = /* @__PURE__ */ Ze(() => /* @__PURE__ */ I("div", { class: "file-title" }, " File List ", -1)), ml = { class: "flex items-center" }, Ll = { style: { width: "calc(100% - 64px)" } }, Il = { class: "att-title" };
function jl(e, t, o, i, n, l) {
  const a = z("Avatar"), r = z("Button"), s = z("Tooltip"), c = z("MenuItem"), M = z("Menu"), y = z("Dropdown"), g = z("Card"), j = z("ListItem"), v = z("List");
  return h(), x("div", ol, [
    I("h1", il, b(e.emailData.emailSubject), 1),
    I("div", ll, [
      I("div", rl, [
        f(a, null, {
          default: N(() => {
            var L;
            return [
              V(b((L = e.emailData.sender) == null ? void 0 : L.slice(0, 1)), 1)
            ];
          }),
          _: 1
        })
      ]),
      I("div", al, [
        I("div", sl, b(e.emailData.sender), 1),
        I("div", null, [
          cl,
          I("span", ul, b(e.emailData.toRecipients), 1)
        ]),
        I("div", null, [
          dl,
          I("span", gl, b(e.emailData.ccRecipients), 1)
        ])
      ]),
      I("div", Ml, b(e.emailData.createTime), 1)
    ]),
    I("div", null, [
      I("div", {
        class: "content rich-text-html",
        innerHTML: e.emailData.messageBody
      }, null, 8, fl)
    ]),
    e.emailData.fileList.length ? (h(), x("div", pl, [
      yl,
      f(v, {
        grid: { gutter: 16, xs: 1, sm: 2, md: 2, lg: 2, xl: 3, xxl: 3, xxxl: 4 },
        "data-source": e.emailData.fileList
      }, {
        renderItem: N(({ item: L }) => [
          f(j, { class: "list" }, {
            default: N(() => [
              f(g, { class: "card" }, {
                default: N(() => [
                  f(y, null, {
                    overlay: N(() => [
                      f(M, null, {
                        default: N(() => [
                          (h(!0), x(re, null, ye(e.getDropDownActions(L), (p) => (h(), _(c, null, {
                            default: N(() => [
                              f(r, {
                                type: "text",
                                size: "mini",
                                onClick: (S) => p.onClick({ url: L.fileUrl, fileName: L.fileName })
                              }, {
                                icon: N(() => [
                                  (h(), _(Tt(p.icon)))
                                ]),
                                default: N(() => [
                                  V(" " + b(p.label), 1)
                                ]),
                                _: 2
                              }, 1032, ["onClick"])
                            ]),
                            _: 2
                          }, 1024))), 256))
                        ]),
                        _: 2
                      }, 1024)
                    ]),
                    default: N(() => [
                      I("div", ml, [
                        f(r, {
                          type: "link",
                          size: "large",
                          icon: L.icon,
                          onClick: (p) => e.createDocPreview({ url: L.fileUrl, fileName: L.fileName })
                        }, null, 8, ["icon", "onClick"]),
                        I("div", Ll, [
                          f(s, {
                            title: L.fileName,
                            placement: "top"
                          }, {
                            default: N(() => [
                              I("div", Il, b(L.fileName), 1)
                            ]),
                            _: 2
                          }, 1032, ["title"])
                        ])
                      ])
                    ]),
                    _: 2
                  }, 1024)
                ]),
                _: 2
              }, 1024)
            ]),
            _: 2
          }, 1024)
        ]),
        _: 1
      }, 8, ["data-source"])
    ])) : q("", !0)
  ]);
}
const le = /* @__PURE__ */ R(nl, [["render", jl], ["__scopeId", "data-v-c11f2250"]]), Nl = O({
  name: "EmailModal",
  components: {
    BasicModal: Me,
    MailOutlined: vt,
    EmailReview: le
  },
  props: {
    downLoadRequest: {
      // 优先使用方式下载，如果没有传入request，则只用传入的方法down-files
      type: Function
    },
    downLoadParams: {
      type: Object,
      default: () => {
      }
    }
  },
  emits: ["down-files"],
  setup(e, { emit: t }) {
    const [o, { openModal: i }] = Mi(), n = te({
      data: {}
    });
    T(!1);
    const l = (r) => {
      n.data = r, i(!0);
    }, a = (r) => {
      t("down-files", r);
    };
    return {
      ...Fe(n),
      register: o,
      downFiles: a,
      handleOpen: l,
      downLoadApi: e.downLoadApi,
      downLoadParams: e.downLoadParams
    };
  }
});
function Tl(e, t, o, i, n, l) {
  const a = z("MailOutlined"), r = z("EmailReview"), s = z("BasicModal");
  return h(), _(s, {
    onRegister: e.register,
    destroyOnClose: !0,
    width: "60%",
    wrapClassName: "email-model-wrapper",
    showCancelBtn: !1,
    showOkBtn: !1,
    onCancel: e.closeModal
  }, {
    title: N(() => [
      f(a)
    ]),
    default: N(() => [
      f(r, {
        data: e.data,
        downLoadRequest: e.downLoadRequest,
        downLoadParams: e.downLoadParams,
        onDownFiles: e.downFiles
      }, null, 8, ["data", "downLoadRequest", "downLoadParams", "onDownFiles"])
    ]),
    _: 1
  }, 8, ["onRegister", "onCancel"]);
}
const fe = /* @__PURE__ */ R(Nl, [["render", Tl]]);
fe.install = function(e, t) {
  e.component(fe.name || t, fe);
};
le.install = function(e, t) {
  e.component(le.name || t, le);
};
const bl = {
  title: "EmailReview 邮件内容显示",
  parts: "功能组件",
  category: "",
  status: "100%",
  // TODO: 组件若开发完成则填入"100%"，并删除该注释
  install(e) {
    e.component(fe.name, fe), e.component(le.name, le);
  }
};
export {
  le as EmailReview,
  bl as default
};
