import { defineComponent as b, createVNode as v, Transition as Z, mergeProps as V, openBlock as f, createBlock as E, toHandlers as gt, withCtx as j, renderSlot as $, computed as m, createElementBlock as _, normalizeClass as g, normalizeStyle as H, createElementVNode as R, ref as M, watch as tt, onMounted as mt, unref as d, nextTick as ht, resolveComponent as z, Fragment as et, useSlots as _t, createCommentVNode as q, createTextVNode as bt, toDisplayString as $t, withDirectives as wt, vShow as Ot } from "vue";
import { isNil as St } from "lodash-es";
import { Tooltip as D, Skeleton as Tt } from "ant-design-vue";
import "dayjs";
import xt from "@purge-icons/generated";
import { InfoCircleOutlined as jt } from "@ant-design/icons-vue";
import "resize-observer-polyfill";
import { tryOnUnmounted as Bt } from "@vueuse/core";
const nt = "G", Ct = Object.prototype.toString;
function Et(t, n) {
  return Ct.call(t) === `[object ${n}]`;
}
function ot(t) {
  return Et(t, "String");
}
function Nt(t) {
  return t && Array.isArray(t);
}
function rt(t) {
  return typeof t == "function";
}
function st(t, n = "default", e, o) {
  if (!t || !Reflect.has(t, n))
    return null;
  if (!rt(t[n]))
    return console.error(`${n} is not a function!`), null;
  const s = t[n];
  if (!s)
    return null;
  const i = {
    ...e,
    ...o
  };
  return s(i);
}
function Pt(t) {
  return (t || "").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g, "");
}
function it(t, n) {
  if (!t || !n)
    return !1;
  if (n.indexOf(" ") !== -1)
    throw new Error("className should not contain space.");
  return t.classList ? t.classList.contains(n) : (" " + t.className + " ").indexOf(" " + n + " ") > -1;
}
function G(t, n) {
  if (!t)
    return;
  let e = t.className;
  const o = (n || "").split(" ");
  for (let s = 0, i = o.length; s < i; s++) {
    const r = o[s];
    r && (t.classList ? t.classList.add(r) : it(t, r) || (e += " " + r));
  }
  t.classList || (t.className = e);
}
function Y(t, n) {
  if (!t || !n)
    return;
  const e = n.split(" ");
  let o = " " + t.className + " ";
  for (let s = 0, i = e.length; s < i; s++) {
    const r = e[s];
    r && (t.classList ? t.classList.remove(r) : it(t, r) && (o = o.replace(" " + r + " ", " ")));
  }
  t.classList || (t.className = Pt(o));
}
for (let t = 0; t <= 15; t++)
  t.toString(16);
/*!
 * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
 *
 * Copyright (c) 2014-2017, Jon Schlinkert.
 * Released under the MIT License.
 */
function J(t) {
  return Object.prototype.toString.call(t) === "[object Object]";
}
function At(t) {
  var n, e;
  return J(t) === !1 ? !1 : (n = t.constructor, n === void 0 ? !0 : (e = n.prototype, !(J(e) === !1 || e.hasOwnProperty("isPrototypeOf") === !1)));
}
function B() {
  return B = Object.assign ? Object.assign.bind() : function(t) {
    for (var n = 1; n < arguments.length; n++) {
      var e = arguments[n];
      for (var o in e)
        Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
    }
    return t;
  }, B.apply(this, arguments);
}
function at(t, n) {
  if (t == null)
    return {};
  var e, o, s = {}, i = Object.keys(t);
  for (o = 0; o < i.length; o++)
    n.indexOf(e = i[o]) >= 0 || (s[e] = t[e]);
  return s;
}
const F = { silent: !1, logLevel: "warn" }, Lt = ["validator"], lt = Object.prototype, ct = lt.toString, kt = lt.hasOwnProperty, ut = /^\s*function (\w+)/;
function U(t) {
  var n;
  const e = (n = t == null ? void 0 : t.type) !== null && n !== void 0 ? n : t;
  if (e) {
    const o = e.toString().match(ut);
    return o ? o[1] : "";
  }
  return "";
}
const w = At, ft = (t) => t;
let u = ft;
process.env.NODE_ENV !== "production" && (u = typeof console < "u" ? function(n, e = F.logLevel) {
  F.silent === !1 && console[e](`[VueTypes warn]: ${n}`);
} : ft);
const S = (t, n) => kt.call(t, n), It = Number.isInteger || function(t) {
  return typeof t == "number" && isFinite(t) && Math.floor(t) === t;
}, T = Array.isArray || function(t) {
  return ct.call(t) === "[object Array]";
}, x = (t) => ct.call(t) === "[object Function]", L = (t) => w(t) && S(t, "_vueTypes_name"), pt = (t) => w(t) && (S(t, "type") || ["_vueTypes_name", "validator", "default", "required"].some((n) => S(t, n)));
function W(t, n) {
  return Object.defineProperty(t.bind(n), "__original", { value: t });
}
function O(t, n, e = !1) {
  let o, s = !0, i = "";
  o = w(t) ? t : { type: t };
  const r = L(o) ? o._vueTypes_name + " - " : "";
  if (pt(o) && o.type !== null) {
    if (o.type === void 0 || o.type === !0 || !o.required && n === void 0)
      return s;
    T(o.type) ? (s = o.type.some((a) => O(a, n, !0) === !0), i = o.type.map((a) => U(a)).join(" or ")) : (i = U(o), s = i === "Array" ? T(n) : i === "Object" ? w(n) : i === "String" || i === "Number" || i === "Boolean" || i === "Function" ? function(a) {
      if (a == null)
        return "";
      const l = a.constructor.toString().match(ut);
      return l ? l[1] : "";
    }(n) === i : n instanceof o.type);
  }
  if (!s) {
    const a = `${r}value "${n}" should be of type "${i}"`;
    return e === !1 ? (u(a), !1) : a;
  }
  if (S(o, "validator") && x(o.validator)) {
    const a = u, l = [];
    if (u = (c) => {
      l.push(c);
    }, s = o.validator(n), u = a, !s) {
      const c = (l.length > 1 ? "* " : "") + l.join(`
* `);
      return l.length = 0, e === !1 ? (u(c), s) : c;
    }
  }
  return s;
}
function y(t, n) {
  const e = Object.defineProperties(n, { _vueTypes_name: { value: t, writable: !0 }, isRequired: { get() {
    return this.required = !0, this;
  } }, def: { value(s) {
    return s === void 0 ? (S(this, "default") && delete this.default, this) : x(s) || O(this, s, !0) === !0 ? (this.default = T(s) ? () => [...s] : w(s) ? () => Object.assign({}, s) : s, this) : (u(`${this._vueTypes_name} - invalid default value: "${s}"`), this);
  } } }), { validator: o } = e;
  return x(o) && (e.validator = W(o, e)), e;
}
function h(t, n) {
  const e = y(t, n);
  return Object.defineProperty(e, "validate", { value(o) {
    return x(this.validator) && u(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:
${JSON.stringify(this)}`), this.validator = W(o, this), this;
  } });
}
function K(t, n, e) {
  const o = function(l) {
    const c = {};
    return Object.getOwnPropertyNames(l).forEach((p) => {
      c[p] = Object.getOwnPropertyDescriptor(l, p);
    }), Object.defineProperties({}, c);
  }(n);
  if (o._vueTypes_name = t, !w(e))
    return o;
  const { validator: s } = e, i = at(e, Lt);
  if (x(s)) {
    let { validator: l } = o;
    l && (l = (a = (r = l).__original) !== null && a !== void 0 ? a : r), o.validator = W(l ? function(c) {
      return l.call(this, c) && s.call(this, c);
    } : s, o);
  }
  var r, a;
  return Object.assign(o, i);
}
function k(t) {
  return t.replace(/^(?!\s*$)/gm, "  ");
}
const zt = () => h("any", {}), Ft = () => h("function", { type: Function }), Vt = () => h("boolean", { type: Boolean }), Ht = () => h("string", { type: String }), Rt = () => h("number", { type: Number }), Mt = () => h("array", { type: Array }), qt = () => h("object", { type: Object }), Wt = () => y("integer", { type: Number, validator: (t) => It(t) }), Dt = () => y("symbol", { validator: (t) => typeof t == "symbol" });
function Gt(t, n = "custom validation failed") {
  if (typeof t != "function")
    throw new TypeError("[VueTypes error]: You must provide a function as argument");
  return y(t.name || "<<anonymous function>>", { type: null, validator(e) {
    const o = t(e);
    return o || u(`${this._vueTypes_name} - ${n}`), o;
  } });
}
function Yt(t) {
  if (!T(t))
    throw new TypeError("[VueTypes error]: You must provide an array as argument.");
  const n = `oneOf - value should be one of "${t.join('", "')}".`, e = t.reduce((o, s) => {
    if (s != null) {
      const i = s.constructor;
      o.indexOf(i) === -1 && o.push(i);
    }
    return o;
  }, []);
  return y("oneOf", { type: e.length > 0 ? e : void 0, validator(o) {
    const s = t.indexOf(o) !== -1;
    return s || u(n), s;
  } });
}
function Jt(t) {
  if (!T(t))
    throw new TypeError("[VueTypes error]: You must provide an array as argument");
  let n = !1, e = [];
  for (let s = 0; s < t.length; s += 1) {
    const i = t[s];
    if (pt(i)) {
      if (L(i) && i._vueTypes_name === "oneOf" && i.type) {
        e = e.concat(i.type);
        continue;
      }
      if (x(i.validator) && (n = !0), i.type === !0 || !i.type) {
        u('oneOfType - invalid usage of "true" or "null" as types.');
        continue;
      }
      e = e.concat(i.type);
    } else
      e.push(i);
  }
  e = e.filter((s, i) => e.indexOf(s) === i);
  const o = e.length > 0 ? e : null;
  return y("oneOfType", n ? { type: o, validator(s) {
    const i = [], r = t.some((a) => {
      const l = O(L(a) && a._vueTypes_name === "oneOf" ? a.type || null : a, s, !0);
      return typeof l == "string" && i.push(l), l === !0;
    });
    return r || u(`oneOfType - provided value does not match any of the ${i.length} passed-in validators:
${k(i.join(`
`))}`), r;
  } } : { type: o });
}
function Ut(t) {
  return y("arrayOf", { type: Array, validator(n) {
    let e = "";
    const o = n.every((s) => (e = O(t, s, !0), e === !0));
    return o || u(`arrayOf - value validation error:
${k(e)}`), o;
  } });
}
function Kt(t) {
  return y("instanceOf", { type: t });
}
function Qt(t) {
  return y("objectOf", { type: Object, validator(n) {
    let e = "";
    const o = Object.keys(n).every((s) => (e = O(t, n[s], !0), e === !0));
    return o || u(`objectOf - value validation error:
${k(e)}`), o;
  } });
}
function Xt(t) {
  const n = Object.keys(t), e = n.filter((s) => {
    var i;
    return !((i = t[s]) === null || i === void 0 || !i.required);
  }), o = y("shape", { type: Object, validator(s) {
    if (!w(s))
      return !1;
    const i = Object.keys(s);
    if (e.length > 0 && e.some((r) => i.indexOf(r) === -1)) {
      const r = e.filter((a) => i.indexOf(a) === -1);
      return u(r.length === 1 ? `shape - required property "${r[0]}" is not defined.` : `shape - required properties "${r.join('", "')}" are not defined.`), !1;
    }
    return i.every((r) => {
      if (n.indexOf(r) === -1)
        return this._vueTypes_isLoose === !0 || (u(`shape - shape definition does not include a "${r}" property. Allowed keys: "${n.join('", "')}".`), !1);
      const a = O(t[r], s[r], !0);
      return typeof a == "string" && u(`shape - "${r}" property validation error:
 ${k(a)}`), a === !0;
    });
  } });
  return Object.defineProperty(o, "_vueTypes_isLoose", { writable: !0, value: !1 }), Object.defineProperty(o, "loose", { get() {
    return this._vueTypes_isLoose = !0, this;
  } }), o;
}
const Zt = ["name", "validate", "getter"], te = /* @__PURE__ */ (() => {
  var t;
  return (t = class {
    static get any() {
      return zt();
    }
    static get func() {
      return Ft().def(this.defaults.func);
    }
    static get bool() {
      return Vt().def(this.defaults.bool);
    }
    static get string() {
      return Ht().def(this.defaults.string);
    }
    static get number() {
      return Rt().def(this.defaults.number);
    }
    static get array() {
      return Mt().def(this.defaults.array);
    }
    static get object() {
      return qt().def(this.defaults.object);
    }
    static get integer() {
      return Wt().def(this.defaults.integer);
    }
    static get symbol() {
      return Dt();
    }
    static get nullable() {
      return { type: null };
    }
    static extend(n) {
      if (T(n))
        return n.forEach((l) => this.extend(l)), this;
      const { name: e, validate: o = !1, getter: s = !1 } = n, i = at(n, Zt);
      if (S(this, e))
        throw new TypeError(`[VueTypes error]: Type "${e}" already defined`);
      const { type: r } = i;
      if (L(r))
        return delete i.type, Object.defineProperty(this, e, s ? { get: () => K(e, r, i) } : { value(...l) {
          const c = K(e, r, i);
          return c.validator && (c.validator = c.validator.bind(c, ...l)), c;
        } });
      let a;
      return a = s ? { get() {
        const l = Object.assign({}, i);
        return o ? h(e, l) : y(e, l);
      }, enumerable: !0 } : { value(...l) {
        const c = Object.assign({}, i);
        let p;
        return p = o ? h(e, c) : y(e, c), c.validator && (p.validator = c.validator.bind(p, ...l)), p;
      }, enumerable: !0 }, Object.defineProperty(this, e, a);
    }
  }).defaults = {}, t.sensibleDefaults = void 0, t.config = F, t.custom = Gt, t.oneOf = Yt, t.instanceOf = Kt, t.oneOfType = Jt, t.arrayOf = Ut, t.objectOf = Qt, t.shape = Xt, t.utils = { validate: (n, e) => O(e, n, !0) === !0, toType: (n, e, o = !1) => o ? h(n, e) : y(n, e) }, t;
})();
function dt(t = { func: () => {
}, bool: !0, string: "", number: 0, array: () => [], object: () => ({}), integer: 0 }) {
  var n;
  return (n = class extends te {
    static get sensibleDefaults() {
      return B({}, this.defaults);
    }
    static set sensibleDefaults(e) {
      this.defaults = e !== !1 ? B({}, e !== !0 ? e : t) : {};
    }
  }).defaults = B({}, t), n;
}
class Ae extends dt() {
}
const ee = dt({
  func: void 0,
  bool: void 0,
  string: void 0,
  number: void 0,
  object: void 0,
  integer: void 0
});
ee.extend([
  {
    name: "style",
    getter: !0,
    type: [String, Object],
    default: void 0
  },
  {
    name: "VNodeChild",
    getter: !0,
    type: void 0
  }
]);
function yt(t, n, e = "in-out") {
  return /* @__PURE__ */ b({
    name: t,
    props: {
      mode: {
        type: String,
        default: e
      }
    },
    setup(o, {
      attrs: s,
      slots: i
    }) {
      return () => v(Z, V({
        name: t,
        mode: o.mode
      }, s, {
        onBeforeEnter: n.beforeEnter,
        onEnter: n.enter,
        onLeave: n.leave,
        onAfterLeave: n.afterLeave,
        onLeaveCancelled: n.afterLeave
      }), {
        default: () => st(i)
      });
    }
  });
}
function ne(t) {
  return t.charAt(0).toUpperCase() + t.slice(1);
}
function vt(t = "", n = !1) {
  const e = n ? "width" : "height", o = `offset${ne(e)}`;
  function s(r) {
    const a = r._initialStyle[e];
    r.style.overflow = r._initialStyle.overflow, a != null && (r.style[e] = a), Reflect.deleteProperty(r, "_initialStyle");
  }
  function i(r) {
    t && r._parent && r._parent.classList.remove(t), s(r);
  }
  return {
    beforeEnter(r) {
      r._parent = r == null ? void 0 : r.parentNode, r._initialStyle = {
        transition: r.style.transition,
        overflow: r.style.overflow,
        [e]: r.style[e]
      };
    },
    enter(r) {
      const a = r._initialStyle;
      r.style.setProperty("transition", "none", "important"), r.style.overflow = "hidden", r.offsetHeight, r.style.transition = a.transition, t && r._parent && r._parent.classList.add(t), requestAnimationFrame(() => {
      });
    },
    afterEnter: s,
    enterCancelled: s,
    leave(r) {
      r._initialStyle = {
        transition: "",
        overflow: r.style.overflow,
        [e]: r.style[e]
      }, r.style.overflow = "hidden", r.style[e] = `${r[o]}px`, r.offsetHeight, requestAnimationFrame(() => r.style[e] = "0");
    },
    afterLeave: i,
    leaveCancelled: i
  };
}
const oe = b({
  name: "CollapseTransition",
  setup() {
    return {
      on: {
        beforeEnter(t) {
          G(t, "collapse-transition"), t.dataset || (t.dataset = {}), t.dataset.oldPaddingTop = t.style.paddingTop, t.dataset.oldPaddingBottom = t.style.paddingBottom, t.style.height = "0", t.style.paddingTop = 0, t.style.paddingBottom = 0;
        },
        enter(t) {
          t.dataset.oldOverflow = t.style.overflow, t.scrollHeight !== 0 ? (t.style.height = t.scrollHeight + "px", t.style.paddingTop = t.dataset.oldPaddingTop, t.style.paddingBottom = t.dataset.oldPaddingBottom) : (t.style.height = "", t.style.paddingTop = t.dataset.oldPaddingTop, t.style.paddingBottom = t.dataset.oldPaddingBottom), t.style.overflow = "hidden";
        },
        afterEnter(t) {
          Y(t, "collapse-transition"), t.style.height = "", t.style.overflow = t.dataset.oldOverflow;
        },
        beforeLeave(t) {
          t.dataset || (t.dataset = {}), t.dataset.oldPaddingTop = t.style.paddingTop, t.dataset.oldPaddingBottom = t.style.paddingBottom, t.dataset.oldOverflow = t.style.overflow, t.style.height = t.scrollHeight + "px", t.style.overflow = "hidden";
        },
        leave(t) {
          t.scrollHeight !== 0 && (G(t, "collapse-transition"), t.style.height = 0, t.style.paddingTop = 0, t.style.paddingBottom = 0);
        },
        afterLeave(t) {
          Y(t, "collapse-transition"), t.style.height = "", t.style.overflow = t.dataset.oldOverflow, t.style.paddingTop = t.dataset.oldPaddingTop, t.style.paddingBottom = t.dataset.oldPaddingBottom;
        }
      }
    };
  }
}), I = (t, n) => {
  const e = t.__vccOpts || t;
  for (const [o, s] of n)
    e[o] = s;
  return e;
};
function re(t, n, e, o, s, i) {
  return f(), E(Z, V({ mode: "out-in" }, gt(t.on)), {
    default: j(() => [
      $(t.$slots, "default")
    ]),
    _: 3
  }, 16);
}
const se = /* @__PURE__ */ I(oe, [["render", re]]);
yt(
  "expand-x-transition",
  vt("", !0)
);
yt(
  "expand-transition",
  vt("")
);
const Q = "g";
function P(t, n, e) {
  let o = t;
  return n && (o += `__${n}`), e && (o += `--${e}`), o;
}
function N(t, n = !1) {
  const e = n ? `.${Q}-${t}` : `${Q}-${t}`;
  return {
    b: () => P(e),
    e: (a) => a ? P(e, a) : "",
    m: (a) => a ? P(e, "", a) : "",
    em: (a, l) => a && l ? P(e, a, l) : ""
  };
}
const ie = b({
  name: `${nt}SvgIcon`,
  props: {
    prefix: {
      type: String,
      default: "icon"
    },
    name: {
      type: String,
      required: !0
    },
    size: {
      type: [Number, String],
      default: 16
    },
    spin: {
      type: Boolean,
      default: !1
    }
  },
  setup(t) {
    const e = N("svg-icon").b(), o = m(() => `#${t.prefix}-${t.name}`), s = m(() => {
      const { size: i } = t;
      let r = `${i}`;
      return r = `${r.replace("px", "")}px`, {
        width: r,
        height: r
      };
    });
    return { symbolId: o, prefixCls: e, getStyle: s };
  }
});
const ae = ["xlink:href"];
function le(t, n, e, o, s, i) {
  return f(), _("svg", {
    class: g([t.prefixCls, t.$attrs.class, t.spin && "svg-icon-spin"]),
    style: H(t.getStyle),
    "aria-hidden": "true"
  }, [
    R("use", { "xlink:href": t.symbolId }, null, 8, ae)
  ], 6);
}
const ce = /* @__PURE__ */ I(ie, [["render", le]]), X = "|svg", ue = b({
  name: `${nt}Icon`,
  components: { SvgIcon: ce },
  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(t) {
    const n = M(null), e = m(() => {
      var a;
      return (a = t.icon) == null ? void 0 : a.endsWith(X);
    }), o = m(
      () => t.icon.replace(X, "")
    ), s = m(
      () => `${t.prefix ? t.prefix + ":" : ""}${t.icon}`
    ), i = async () => {
      if (d(e))
        return;
      const a = d(n);
      if (!a)
        return;
      await ht();
      const l = d(s);
      if (!l)
        return;
      const c = xt.renderSVG(l, {});
      if (c)
        a.textContent = "", a.appendChild(c);
      else {
        const p = document.createElement("span");
        p.className = "iconify", p.dataset.icon = l, a.textContent = "", a.appendChild(p);
      }
    }, r = m(() => {
      const { size: a, color: l } = t;
      let c = a;
      return ot(a) && (c = parseInt(a, 10)), {
        fontSize: `${c}px`,
        color: l,
        display: "inline-flex"
      };
    });
    return tt(() => t.icon, i, { flush: "post" }), mt(i), { elRef: n, getWrapStyle: r, isSvgIcon: e, getSvgIcon: o };
  }
});
function fe(t, n, e, o, s, i) {
  const r = z("SvgIcon");
  return t.isSvgIcon ? (f(), E(r, {
    key: 0,
    size: t.size,
    name: t.getSvgIcon,
    class: g([t.$attrs.class, "anticon"]),
    spin: t.spin
  }, null, 8, ["size", "name", "class", "spin"])) : (f(), _("span", {
    key: 1,
    ref: "elRef",
    class: g([t.$attrs.class, "app-iconify anticon", t.spin && "app-iconify-spin"]),
    style: H(t.getWrapStyle)
  }, null, 6));
}
const A = /* @__PURE__ */ I(ue, [["render", fe]]);
A.install = function(t, n) {
  t.component(n || A.name, A);
};
const pe = /* @__PURE__ */ b({
  __name: "BasicArrow",
  props: {
    /**
     * Arrow expand state
     */
    expand: { type: Boolean },
    /**
     * Arrow up by default
     */
    up: { type: Boolean },
    /**
     * Arrow down by default
     */
    down: { type: Boolean },
    /**
     * Cancel padding/margin for inline
     */
    inset: { type: Boolean }
  },
  setup(t) {
    const n = t, o = N("basic-arrow").b(), s = m(() => {
      const { expand: i, up: r, down: a, inset: l } = n;
      return [
        o,
        {
          [`${o}--active`]: i,
          up: r,
          inset: l,
          down: a
        }
      ];
    });
    return (i, r) => (f(), _("span", {
      class: g(s.value)
    }, [
      v(d(A), {
        icon: "ion:chevron-forward",
        style: H(i.$attrs.iconStyle)
      }, null, 8, ["style"])
    ], 2));
  }
});
const de = {
  /**
   * 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]
  }
}, ye = /* @__PURE__ */ b({
  name: "BasicHelp",
  components: {
    Tooltip: D
  },
  props: de,
  setup(t, {
    slots: n
  }) {
    const o = N("basic-help").b(), s = m(() => ({
      color: t.color,
      fontSize: t.fontSize
    })), i = m(() => ({
      maxWidth: t.maxWidth
    }));
    function r() {
      const l = t.text;
      return ot(l) ? v("p", null, [l]) : Nt(l) ? l.map((c, p) => v("p", {
        key: c
      }, [v(et, null, [t.showIndex ? `${p + 1}. ` : "", c])])) : null;
    }
    function a(l) {
      return (l == null ? void 0 : l.parentNode) ?? document.body;
    }
    return () => v(D, {
      overlayClassName: `${o}__wrap`,
      title: v("div", {
        style: d(s)
      }, [r()]),
      autoAdjustOverflow: !0,
      overlayStyle: d(i),
      placement: t.placement,
      getPopupContainer: () => a()
    }, {
      default: () => [v("span", {
        class: o
      }, [st(n) || v(jt, null, null)])]
    });
  }
});
const ve = /* @__PURE__ */ b({
  __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(t) {
    const n = N("basic-title"), e = t, o = n.b(), s = _t(), i = m(() => [
      o,
      { [`${o}-show-span`]: e.span && s.default },
      { [`${o}-normal`]: e.normal }
    ]);
    return (r, a) => (f(), _("span", {
      class: g(i.value)
    }, [
      $(r.$slots, "default"),
      t.helpMessage ? (f(), E(ye, {
        key: 0,
        class: g(`${d(o)}-help`),
        text: t.helpMessage
      }, null, 8, ["class", "text"])) : q("", !0)
    ], 2));
  }
});
const ge = {
  prefixCls: { type: String },
  helpMessage: {
    type: [Array, String],
    default: ""
  },
  title: { type: String },
  show: { type: Boolean },
  canExpan: { type: Boolean }
}, me = b({
  components: { BasicArrow: pe, BasicTitle: ve },
  inheritAttrs: !1,
  props: ge,
  emits: ["expand"]
});
function he(t, n, e, o, s, i) {
  const r = z("BasicTitle"), a = z("BasicArrow");
  return f(), _("div", {
    class: g([`${t.prefixCls}__header px-2 py-5`, t.$attrs.class])
  }, [
    v(r, {
      helpMessage: t.helpMessage,
      normal: ""
    }, {
      default: j(() => [
        t.title ? (f(), _(et, { key: 0 }, [
          bt($t(t.title), 1)
        ], 64)) : $(t.$slots, "title", { key: 1 })
      ]),
      _: 3
    }, 8, ["helpMessage"]),
    R("div", {
      class: g(`${t.prefixCls}__action`)
    }, [
      $(t.$slots, "action"),
      t.canExpan ? (f(), E(a, {
        key: 0,
        up: "",
        expand: t.show,
        onClick: n[0] || (n[0] = (l) => t.$emit("expand"))
      }, null, 8, ["expand"])) : q("", !0)
    ], 2)
  ], 2);
}
const _e = /* @__PURE__ */ I(me, [["render", he]]);
function be() {
  const t = document.createEvent("HTMLEvents");
  t.initEvent("resize", !0, !0), t.eventType = "message", window.dispatchEvent(t);
}
function $e(t) {
  const n = M(!1);
  let e;
  function o() {
    n.value = !1, e && window.clearTimeout(e);
  }
  function s() {
    o(), e = setTimeout(() => {
      n.value = !0;
    }, t);
  }
  return s(), Bt(o), { readyRef: n, stop: o, start: s };
}
function we(t, n, e = !1) {
  if (!rt(t))
    throw new Error("handle is not Function!");
  const { readyRef: o, stop: s, start: i } = $e(n);
  return e ? t() : tt(
    o,
    (r) => {
      r && t();
    },
    { immediate: !1 }
  ), { readyRef: o, stop: s, start: i };
}
const Oe = { class: "p-2" }, Se = {
  name: "GCollapseContainer"
}, C = /* @__PURE__ */ b({
  ...Se,
  props: {
    title: { type: String, default: "" },
    loading: { type: Boolean },
    /**
     *  Can it be expanded
     */
    canExpan: { type: Boolean, default: !0 },
    /**
     * Warm reminder on the right side of the title
     */
    helpMessage: {
      type: [Array, String],
      default: ""
    },
    /**
     * Whether to trigger window.resize when expanding and contracting,
     * Can adapt to tables and forms, when the form shrinks, the form triggers resize to adapt to the height
     */
    triggerWindowResize: { type: Boolean },
    /**
     * Delayed loading time
     */
    lazyTime: { type: Number, default: 0 }
  },
  setup(t, { expose: n }) {
    const e = t, o = M(!0), s = N("collapse-container").b();
    function i(r) {
      o.value = St(r) ? !o.value : r, e.triggerWindowResize && we(be, 200);
    }
    return n({
      handleExpand: i
    }), (r, a) => (f(), _("div", {
      class: g(d(s))
    }, [
      v(_e, V(e, {
        prefixCls: d(s),
        show: o.value,
        onExpand: i
      }), {
        title: j(() => [
          $(r.$slots, "title")
        ]),
        action: j(() => [
          $(r.$slots, "action")
        ]),
        _: 3
      }, 16, ["prefixCls", "show"]),
      R("div", Oe, [
        v(d(se), { enable: t.canExpan }, {
          default: j(() => [
            t.loading ? (f(), E(d(Tt), {
              key: 0,
              active: t.loading
            }, null, 8, ["active"])) : wt((f(), _("div", {
              key: 1,
              class: g(`${d(s)}__body`)
            }, [
              $(r.$slots, "default")
            ], 2)), [
              [Ot, o.value]
            ])
          ]),
          _: 3
        }, 8, ["enable"])
      ]),
      r.$slots.footer ? (f(), _("div", {
        key: 0,
        class: g(`${d(s)}__footer`)
      }, [
        $(r.$slots, "footer")
      ], 2)) : q("", !0)
    ], 2));
  }
});
C.install = function(t, n) {
  t.component(n || C.name, C);
};
const Le = {
  title: "CollapseContainer 折叠",
  category: "布局",
  status: "100%",
  install(t) {
    t.component(C.name, C);
  }
};
export {
  C as CollapseContainer,
  Le as default
};
