import { reactive as Ta, computed as E, defineComponent as yt, ref as Ge, watch as Tt, onMounted as Pa, onUnmounted as yl, toRefs as Zd, inject as hs, watchEffect as Xd, provide as vs, nextTick as es, unref as W, openBlock as O, createBlock as Fe, resolveDynamicComponent as wr, normalizeProps as gt, mergeProps as wn, renderSlot as j, normalizeClass as ee, withCtx as le, createVNode as be, createElementVNode as C, createElementBlock as A, toDisplayString as pe, createCommentVNode as se, Fragment as Te, renderList as Le, normalizeStyle as fi, withKeys as xf, withDirectives as Xn, toRef as da, guardReactiveProps as cn, createTextVNode as Zt, isRef as Vi, Transition as Jd, resolveComponent as Xe, resolveDirective as ob, toHandlers as lb, withModifiers as In, vShow as pi, vModelText as Qd, isReactive as ub, createSlots as as, createApp as cb } from "vue";
var Nt = "top", vn = "bottom", pn = "right", Wt = "left", _l = "auto", ps = [Nt, vn, pn, Wt], mi = "start", os = "end", fb = "clippingParents", eh = "viewport", Gi = "popper", db = "reference", Af = /* @__PURE__ */ ps.reduce(function(e, n) {
  return e.concat([n + "-" + mi, n + "-" + os]);
}, []), th = /* @__PURE__ */ [].concat(ps, [_l]).reduce(function(e, n) {
  return e.concat([n, n + "-" + mi, n + "-" + os]);
}, []), hb = "beforeRead", vb = "read", pb = "afterRead", mb = "beforeMain", gb = "main", yb = "afterMain", _b = "beforeWrite", bb = "write", wb = "afterWrite", Db = [hb, vb, pb, mb, gb, yb, _b, bb, wb];
function Ln(e) {
  return e ? (e.nodeName || "").toLowerCase() : null;
}
function Jt(e) {
  if (e == null)
    return window;
  if (e.toString() !== "[object Window]") {
    var n = e.ownerDocument;
    return n && n.defaultView || window;
  }
  return e;
}
function Br(e) {
  var n = Jt(e).Element;
  return e instanceof n || e instanceof Element;
}
function dn(e) {
  var n = Jt(e).HTMLElement;
  return e instanceof n || e instanceof HTMLElement;
}
function bl(e) {
  if (typeof ShadowRoot > "u")
    return !1;
  var n = Jt(e).ShadowRoot;
  return e instanceof n || e instanceof ShadowRoot;
}
function $b(e) {
  var n = e.state;
  Object.keys(n.elements).forEach(function(r) {
    var a = n.styles[r] || {}, l = n.attributes[r] || {}, o = n.elements[r];
    !dn(o) || !Ln(o) || (Object.assign(o.style, a), Object.keys(l).forEach(function(c) {
      var f = l[c];
      f === !1 ? o.removeAttribute(c) : o.setAttribute(c, f === !0 ? "" : f);
    }));
  });
}
function Cb(e) {
  var n = e.state, r = {
    popper: {
      position: n.options.strategy,
      left: "0",
      top: "0",
      margin: "0"
    },
    arrow: {
      position: "absolute"
    },
    reference: {}
  };
  return Object.assign(n.elements.popper.style, r.popper), n.styles = r, n.elements.arrow && Object.assign(n.elements.arrow.style, r.arrow), function() {
    Object.keys(n.elements).forEach(function(a) {
      var l = n.elements[a], o = n.attributes[a] || {}, c = Object.keys(n.styles.hasOwnProperty(a) ? n.styles[a] : r[a]), f = c.reduce(function(h, p) {
        return h[p] = "", h;
      }, {});
      !dn(l) || !Ln(l) || (Object.assign(l.style, f), Object.keys(o).forEach(function(h) {
        l.removeAttribute(h);
      }));
    });
  };
}
const Sb = {
  name: "applyStyles",
  enabled: !0,
  phase: "write",
  fn: $b,
  effect: Cb,
  requires: ["computeStyles"]
};
function En(e) {
  return e.split("-")[0];
}
var Wr = Math.max, ya = Math.min, gi = Math.round;
function al() {
  var e = navigator.userAgentData;
  return e != null && e.brands && Array.isArray(e.brands) ? e.brands.map(function(n) {
    return n.brand + "/" + n.version;
  }).join(" ") : navigator.userAgent;
}
function nh() {
  return !/^((?!chrome|android).)*safari/i.test(al());
}
function yi(e, n, r) {
  n === void 0 && (n = !1), r === void 0 && (r = !1);
  var a = e.getBoundingClientRect(), l = 1, o = 1;
  n && dn(e) && (l = e.offsetWidth > 0 && gi(a.width) / e.offsetWidth || 1, o = e.offsetHeight > 0 && gi(a.height) / e.offsetHeight || 1);
  var c = Br(e) ? Jt(e) : window, f = c.visualViewport, h = !nh() && r, p = (a.left + (h && f ? f.offsetLeft : 0)) / l, g = (a.top + (h && f ? f.offsetTop : 0)) / o, w = a.width / l, M = a.height / o;
  return {
    width: w,
    height: M,
    top: g,
    right: p + w,
    bottom: g + M,
    left: p,
    x: p,
    y: g
  };
}
function wl(e) {
  var n = yi(e), r = e.offsetWidth, a = e.offsetHeight;
  return Math.abs(n.width - r) <= 1 && (r = n.width), Math.abs(n.height - a) <= 1 && (a = n.height), {
    x: e.offsetLeft,
    y: e.offsetTop,
    width: r,
    height: a
  };
}
function rh(e, n) {
  var r = n.getRootNode && n.getRootNode();
  if (e.contains(n))
    return !0;
  if (r && bl(r)) {
    var a = n;
    do {
      if (a && e.isSameNode(a))
        return !0;
      a = a.parentNode || a.host;
    } while (a);
  }
  return !1;
}
function Jn(e) {
  return Jt(e).getComputedStyle(e);
}
function Mb(e) {
  return ["table", "td", "th"].indexOf(Ln(e)) >= 0;
}
function $r(e) {
  return ((Br(e) ? e.ownerDocument : (
    // $FlowFixMe[prop-missing]
    e.document
  )) || window.document).documentElement;
}
function ka(e) {
  return Ln(e) === "html" ? e : (
    // this is a quicker (but less type safe) way to save quite some bytes from the bundle
    // $FlowFixMe[incompatible-return]
    // $FlowFixMe[prop-missing]
    e.assignedSlot || // step into the shadow DOM of the parent of a slotted node
    e.parentNode || // DOM Element detected
    (bl(e) ? e.host : null) || // ShadowRoot detected
    // $FlowFixMe[incompatible-call]: HTMLElement is a Node
    $r(e)
  );
}
function Tf(e) {
  return !dn(e) || // https://github.com/popperjs/popper-core/issues/837
  Jn(e).position === "fixed" ? null : e.offsetParent;
}
function Ob(e) {
  var n = /firefox/i.test(al()), r = /Trident/i.test(al());
  if (r && dn(e)) {
    var a = Jn(e);
    if (a.position === "fixed")
      return null;
  }
  var l = ka(e);
  for (bl(l) && (l = l.host); dn(l) && ["html", "body"].indexOf(Ln(l)) < 0; ) {
    var o = Jn(l);
    if (o.transform !== "none" || o.perspective !== "none" || o.contain === "paint" || ["transform", "perspective"].indexOf(o.willChange) !== -1 || n && o.willChange === "filter" || n && o.filter && o.filter !== "none")
      return l;
    l = l.parentNode;
  }
  return null;
}
function ms(e) {
  for (var n = Jt(e), r = Tf(e); r && Mb(r) && Jn(r).position === "static"; )
    r = Tf(r);
  return r && (Ln(r) === "html" || Ln(r) === "body" && Jn(r).position === "static") ? n : r || Ob(e) || n;
}
function Dl(e) {
  return ["top", "bottom"].indexOf(e) >= 0 ? "x" : "y";
}
function is(e, n, r) {
  return Wr(e, ya(n, r));
}
function xb(e, n, r) {
  var a = is(e, n, r);
  return a > r ? r : a;
}
function ih() {
  return {
    top: 0,
    right: 0,
    bottom: 0,
    left: 0
  };
}
function sh(e) {
  return Object.assign({}, ih(), e);
}
function ah(e, n) {
  return n.reduce(function(r, a) {
    return r[a] = e, r;
  }, {});
}
var Ab = function(n, r) {
  return n = typeof n == "function" ? n(Object.assign({}, r.rects, {
    placement: r.placement
  })) : n, sh(typeof n != "number" ? n : ah(n, ps));
};
function Tb(e) {
  var n, r = e.state, a = e.name, l = e.options, o = r.elements.arrow, c = r.modifiersData.popperOffsets, f = En(r.placement), h = Dl(f), p = [Wt, pn].indexOf(f) >= 0, g = p ? "height" : "width";
  if (!(!o || !c)) {
    var w = Ab(l.padding, r), M = wl(o), S = h === "y" ? Nt : Wt, k = h === "y" ? vn : pn, U = r.rects.reference[g] + r.rects.reference[h] - c[h] - r.rects.popper[g], R = c[h] - r.rects.reference[h], P = ms(o), J = P ? h === "y" ? P.clientHeight || 0 : P.clientWidth || 0 : 0, Q = U / 2 - R / 2, H = w[S], z = J - M[g] - w[k], te = J / 2 - M[g] / 2 + Q, V = is(H, te, z), ne = h;
    r.modifiersData[a] = (n = {}, n[ne] = V, n.centerOffset = V - te, n);
  }
}
function Pb(e) {
  var n = e.state, r = e.options, a = r.element, l = a === void 0 ? "[data-popper-arrow]" : a;
  l != null && (typeof l == "string" && (l = n.elements.popper.querySelector(l), !l) || rh(n.elements.popper, l) && (n.elements.arrow = l));
}
const kb = {
  name: "arrow",
  enabled: !0,
  phase: "main",
  fn: Tb,
  effect: Pb,
  requires: ["popperOffsets"],
  requiresIfExists: ["preventOverflow"]
};
function _i(e) {
  return e.split("-")[1];
}
var Ib = {
  top: "auto",
  right: "auto",
  bottom: "auto",
  left: "auto"
};
function Eb(e, n) {
  var r = e.x, a = e.y, l = n.devicePixelRatio || 1;
  return {
    x: gi(r * l) / l || 0,
    y: gi(a * l) / l || 0
  };
}
function Pf(e) {
  var n, r = e.popper, a = e.popperRect, l = e.placement, o = e.variation, c = e.offsets, f = e.position, h = e.gpuAcceleration, p = e.adaptive, g = e.roundOffsets, w = e.isFixed, M = c.x, S = M === void 0 ? 0 : M, k = c.y, U = k === void 0 ? 0 : k, R = typeof g == "function" ? g({
    x: S,
    y: U
  }) : {
    x: S,
    y: U
  };
  S = R.x, U = R.y;
  var P = c.hasOwnProperty("x"), J = c.hasOwnProperty("y"), Q = Wt, H = Nt, z = window;
  if (p) {
    var te = ms(r), V = "clientHeight", ne = "clientWidth";
    if (te === Jt(r) && (te = $r(r), Jn(te).position !== "static" && f === "absolute" && (V = "scrollHeight", ne = "scrollWidth")), te = te, l === Nt || (l === Wt || l === pn) && o === os) {
      H = vn;
      var me = w && te === z && z.visualViewport ? z.visualViewport.height : (
        // $FlowFixMe[prop-missing]
        te[V]
      );
      U -= me - a.height, U *= h ? 1 : -1;
    }
    if (l === Wt || (l === Nt || l === vn) && o === os) {
      Q = pn;
      var we = w && te === z && z.visualViewport ? z.visualViewport.width : (
        // $FlowFixMe[prop-missing]
        te[ne]
      );
      S -= we - a.width, S *= h ? 1 : -1;
    }
  }
  var $e = Object.assign({
    position: f
  }, p && Ib), Z = g === !0 ? Eb({
    x: S,
    y: U
  }, Jt(r)) : {
    x: S,
    y: U
  };
  if (S = Z.x, U = Z.y, h) {
    var fe;
    return Object.assign({}, $e, (fe = {}, fe[H] = J ? "0" : "", fe[Q] = P ? "0" : "", fe.transform = (z.devicePixelRatio || 1) <= 1 ? "translate(" + S + "px, " + U + "px)" : "translate3d(" + S + "px, " + U + "px, 0)", fe));
  }
  return Object.assign({}, $e, (n = {}, n[H] = J ? U + "px" : "", n[Q] = P ? S + "px" : "", n.transform = "", n));
}
function Lb(e) {
  var n = e.state, r = e.options, a = r.gpuAcceleration, l = a === void 0 ? !0 : a, o = r.adaptive, c = o === void 0 ? !0 : o, f = r.roundOffsets, h = f === void 0 ? !0 : f, p = {
    placement: En(n.placement),
    variation: _i(n.placement),
    popper: n.elements.popper,
    popperRect: n.rects.popper,
    gpuAcceleration: l,
    isFixed: n.options.strategy === "fixed"
  };
  n.modifiersData.popperOffsets != null && (n.styles.popper = Object.assign({}, n.styles.popper, Pf(Object.assign({}, p, {
    offsets: n.modifiersData.popperOffsets,
    position: n.options.strategy,
    adaptive: c,
    roundOffsets: h
  })))), n.modifiersData.arrow != null && (n.styles.arrow = Object.assign({}, n.styles.arrow, Pf(Object.assign({}, p, {
    offsets: n.modifiersData.arrow,
    position: "absolute",
    adaptive: !1,
    roundOffsets: h
  })))), n.attributes.popper = Object.assign({}, n.attributes.popper, {
    "data-popper-placement": n.placement
  });
}
const Yb = {
  name: "computeStyles",
  enabled: !0,
  phase: "beforeWrite",
  fn: Lb,
  data: {}
};
var la = {
  passive: !0
};
function Rb(e) {
  var n = e.state, r = e.instance, a = e.options, l = a.scroll, o = l === void 0 ? !0 : l, c = a.resize, f = c === void 0 ? !0 : c, h = Jt(n.elements.popper), p = [].concat(n.scrollParents.reference, n.scrollParents.popper);
  return o && p.forEach(function(g) {
    g.addEventListener("scroll", r.update, la);
  }), f && h.addEventListener("resize", r.update, la), function() {
    o && p.forEach(function(g) {
      g.removeEventListener("scroll", r.update, la);
    }), f && h.removeEventListener("resize", r.update, la);
  };
}
const Fb = {
  name: "eventListeners",
  enabled: !0,
  phase: "write",
  fn: function() {
  },
  effect: Rb,
  data: {}
};
var Nb = {
  left: "right",
  right: "left",
  bottom: "top",
  top: "bottom"
};
function ha(e) {
  return e.replace(/left|right|bottom|top/g, function(n) {
    return Nb[n];
  });
}
var Wb = {
  start: "end",
  end: "start"
};
function kf(e) {
  return e.replace(/start|end/g, function(n) {
    return Wb[n];
  });
}
function $l(e) {
  var n = Jt(e), r = n.pageXOffset, a = n.pageYOffset;
  return {
    scrollLeft: r,
    scrollTop: a
  };
}
function Cl(e) {
  return yi($r(e)).left + $l(e).scrollLeft;
}
function Bb(e, n) {
  var r = Jt(e), a = $r(e), l = r.visualViewport, o = a.clientWidth, c = a.clientHeight, f = 0, h = 0;
  if (l) {
    o = l.width, c = l.height;
    var p = nh();
    (p || !p && n === "fixed") && (f = l.offsetLeft, h = l.offsetTop);
  }
  return {
    width: o,
    height: c,
    x: f + Cl(e),
    y: h
  };
}
function Ub(e) {
  var n, r = $r(e), a = $l(e), l = (n = e.ownerDocument) == null ? void 0 : n.body, o = Wr(r.scrollWidth, r.clientWidth, l ? l.scrollWidth : 0, l ? l.clientWidth : 0), c = Wr(r.scrollHeight, r.clientHeight, l ? l.scrollHeight : 0, l ? l.clientHeight : 0), f = -a.scrollLeft + Cl(e), h = -a.scrollTop;
  return Jn(l || r).direction === "rtl" && (f += Wr(r.clientWidth, l ? l.clientWidth : 0) - o), {
    width: o,
    height: c,
    x: f,
    y: h
  };
}
function Sl(e) {
  var n = Jn(e), r = n.overflow, a = n.overflowX, l = n.overflowY;
  return /auto|scroll|overlay|hidden/.test(r + l + a);
}
function oh(e) {
  return ["html", "body", "#document"].indexOf(Ln(e)) >= 0 ? e.ownerDocument.body : dn(e) && Sl(e) ? e : oh(ka(e));
}
function ss(e, n) {
  var r;
  n === void 0 && (n = []);
  var a = oh(e), l = a === ((r = e.ownerDocument) == null ? void 0 : r.body), o = Jt(a), c = l ? [o].concat(o.visualViewport || [], Sl(a) ? a : []) : a, f = n.concat(c);
  return l ? f : (
    // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here
    f.concat(ss(ka(c)))
  );
}
function ol(e) {
  return Object.assign({}, e, {
    left: e.x,
    top: e.y,
    right: e.x + e.width,
    bottom: e.y + e.height
  });
}
function Hb(e, n) {
  var r = yi(e, !1, n === "fixed");
  return r.top = r.top + e.clientTop, r.left = r.left + e.clientLeft, r.bottom = r.top + e.clientHeight, r.right = r.left + e.clientWidth, r.width = e.clientWidth, r.height = e.clientHeight, r.x = r.left, r.y = r.top, r;
}
function If(e, n, r) {
  return n === eh ? ol(Bb(e, r)) : Br(n) ? Hb(n, r) : ol(Ub($r(e)));
}
function zb(e) {
  var n = ss(ka(e)), r = ["absolute", "fixed"].indexOf(Jn(e).position) >= 0, a = r && dn(e) ? ms(e) : e;
  return Br(a) ? n.filter(function(l) {
    return Br(l) && rh(l, a) && Ln(l) !== "body";
  }) : [];
}
function qb(e, n, r, a) {
  var l = n === "clippingParents" ? zb(e) : [].concat(n), o = [].concat(l, [r]), c = o[0], f = o.reduce(function(h, p) {
    var g = If(e, p, a);
    return h.top = Wr(g.top, h.top), h.right = ya(g.right, h.right), h.bottom = ya(g.bottom, h.bottom), h.left = Wr(g.left, h.left), h;
  }, If(e, c, a));
  return f.width = f.right - f.left, f.height = f.bottom - f.top, f.x = f.left, f.y = f.top, f;
}
function lh(e) {
  var n = e.reference, r = e.element, a = e.placement, l = a ? En(a) : null, o = a ? _i(a) : null, c = n.x + n.width / 2 - r.width / 2, f = n.y + n.height / 2 - r.height / 2, h;
  switch (l) {
    case Nt:
      h = {
        x: c,
        y: n.y - r.height
      };
      break;
    case vn:
      h = {
        x: c,
        y: n.y + n.height
      };
      break;
    case pn:
      h = {
        x: n.x + n.width,
        y: f
      };
      break;
    case Wt:
      h = {
        x: n.x - r.width,
        y: f
      };
      break;
    default:
      h = {
        x: n.x,
        y: n.y
      };
  }
  var p = l ? Dl(l) : null;
  if (p != null) {
    var g = p === "y" ? "height" : "width";
    switch (o) {
      case mi:
        h[p] = h[p] - (n[g] / 2 - r[g] / 2);
        break;
      case os:
        h[p] = h[p] + (n[g] / 2 - r[g] / 2);
        break;
    }
  }
  return h;
}
function ls(e, n) {
  n === void 0 && (n = {});
  var r = n, a = r.placement, l = a === void 0 ? e.placement : a, o = r.strategy, c = o === void 0 ? e.strategy : o, f = r.boundary, h = f === void 0 ? fb : f, p = r.rootBoundary, g = p === void 0 ? eh : p, w = r.elementContext, M = w === void 0 ? Gi : w, S = r.altBoundary, k = S === void 0 ? !1 : S, U = r.padding, R = U === void 0 ? 0 : U, P = sh(typeof R != "number" ? R : ah(R, ps)), J = M === Gi ? db : Gi, Q = e.rects.popper, H = e.elements[k ? J : M], z = qb(Br(H) ? H : H.contextElement || $r(e.elements.popper), h, g, c), te = yi(e.elements.reference), V = lh({
    reference: te,
    element: Q,
    strategy: "absolute",
    placement: l
  }), ne = ol(Object.assign({}, Q, V)), me = M === Gi ? ne : te, we = {
    top: z.top - me.top + P.top,
    bottom: me.bottom - z.bottom + P.bottom,
    left: z.left - me.left + P.left,
    right: me.right - z.right + P.right
  }, $e = e.modifiersData.offset;
  if (M === Gi && $e) {
    var Z = $e[l];
    Object.keys(we).forEach(function(fe) {
      var Ae = [pn, vn].indexOf(fe) >= 0 ? 1 : -1, ae = [Nt, vn].indexOf(fe) >= 0 ? "y" : "x";
      we[fe] += Z[ae] * Ae;
    });
  }
  return we;
}
function Kb(e, n) {
  n === void 0 && (n = {});
  var r = n, a = r.placement, l = r.boundary, o = r.rootBoundary, c = r.padding, f = r.flipVariations, h = r.allowedAutoPlacements, p = h === void 0 ? th : h, g = _i(a), w = g ? f ? Af : Af.filter(function(k) {
    return _i(k) === g;
  }) : ps, M = w.filter(function(k) {
    return p.indexOf(k) >= 0;
  });
  M.length === 0 && (M = w);
  var S = M.reduce(function(k, U) {
    return k[U] = ls(e, {
      placement: U,
      boundary: l,
      rootBoundary: o,
      padding: c
    })[En(U)], k;
  }, {});
  return Object.keys(S).sort(function(k, U) {
    return S[k] - S[U];
  });
}
function Vb(e) {
  if (En(e) === _l)
    return [];
  var n = ha(e);
  return [kf(e), n, kf(n)];
}
function Gb(e) {
  var n = e.state, r = e.options, a = e.name;
  if (!n.modifiersData[a]._skip) {
    for (var l = r.mainAxis, o = l === void 0 ? !0 : l, c = r.altAxis, f = c === void 0 ? !0 : c, h = r.fallbackPlacements, p = r.padding, g = r.boundary, w = r.rootBoundary, M = r.altBoundary, S = r.flipVariations, k = S === void 0 ? !0 : S, U = r.allowedAutoPlacements, R = n.options.placement, P = En(R), J = P === R, Q = h || (J || !k ? [ha(R)] : Vb(R)), H = [R].concat(Q).reduce(function(Pe, Ne) {
      return Pe.concat(En(Ne) === _l ? Kb(n, {
        placement: Ne,
        boundary: g,
        rootBoundary: w,
        padding: p,
        flipVariations: k,
        allowedAutoPlacements: U
      }) : Ne);
    }, []), z = n.rects.reference, te = n.rects.popper, V = /* @__PURE__ */ new Map(), ne = !0, me = H[0], we = 0; we < H.length; we++) {
      var $e = H[we], Z = En($e), fe = _i($e) === mi, Ae = [Nt, vn].indexOf(Z) >= 0, ae = Ae ? "width" : "height", xe = ls(n, {
        placement: $e,
        boundary: g,
        rootBoundary: w,
        altBoundary: M,
        padding: p
      }), Me = Ae ? fe ? pn : Wt : fe ? vn : Nt;
      z[ae] > te[ae] && (Me = ha(Me));
      var Ye = ha(Me), Ue = [];
      if (o && Ue.push(xe[Z] <= 0), f && Ue.push(xe[Me] <= 0, xe[Ye] <= 0), Ue.every(function(Pe) {
        return Pe;
      })) {
        me = $e, ne = !1;
        break;
      }
      V.set($e, Ue);
    }
    if (ne)
      for (var B = k ? 3 : 1, he = function(Ne) {
        var Qe = H.find(function(et) {
          var je = V.get(et);
          if (je)
            return je.slice(0, Ne).every(function(ot) {
              return ot;
            });
        });
        if (Qe)
          return me = Qe, "break";
      }, re = B; re > 0; re--) {
        var Je = he(re);
        if (Je === "break")
          break;
      }
    n.placement !== me && (n.modifiersData[a]._skip = !0, n.placement = me, n.reset = !0);
  }
}
const jb = {
  name: "flip",
  enabled: !0,
  phase: "main",
  fn: Gb,
  requiresIfExists: ["offset"],
  data: {
    _skip: !1
  }
};
function Ef(e, n, r) {
  return r === void 0 && (r = {
    x: 0,
    y: 0
  }), {
    top: e.top - n.height - r.y,
    right: e.right - n.width + r.x,
    bottom: e.bottom - n.height + r.y,
    left: e.left - n.width - r.x
  };
}
function Lf(e) {
  return [Nt, pn, vn, Wt].some(function(n) {
    return e[n] >= 0;
  });
}
function Zb(e) {
  var n = e.state, r = e.name, a = n.rects.reference, l = n.rects.popper, o = n.modifiersData.preventOverflow, c = ls(n, {
    elementContext: "reference"
  }), f = ls(n, {
    altBoundary: !0
  }), h = Ef(c, a), p = Ef(f, l, o), g = Lf(h), w = Lf(p);
  n.modifiersData[r] = {
    referenceClippingOffsets: h,
    popperEscapeOffsets: p,
    isReferenceHidden: g,
    hasPopperEscaped: w
  }, n.attributes.popper = Object.assign({}, n.attributes.popper, {
    "data-popper-reference-hidden": g,
    "data-popper-escaped": w
  });
}
const Xb = {
  name: "hide",
  enabled: !0,
  phase: "main",
  requiresIfExists: ["preventOverflow"],
  fn: Zb
};
function Jb(e, n, r) {
  var a = En(e), l = [Wt, Nt].indexOf(a) >= 0 ? -1 : 1, o = typeof r == "function" ? r(Object.assign({}, n, {
    placement: e
  })) : r, c = o[0], f = o[1];
  return c = c || 0, f = (f || 0) * l, [Wt, pn].indexOf(a) >= 0 ? {
    x: f,
    y: c
  } : {
    x: c,
    y: f
  };
}
function Qb(e) {
  var n = e.state, r = e.options, a = e.name, l = r.offset, o = l === void 0 ? [0, 0] : l, c = th.reduce(function(g, w) {
    return g[w] = Jb(w, n.rects, o), g;
  }, {}), f = c[n.placement], h = f.x, p = f.y;
  n.modifiersData.popperOffsets != null && (n.modifiersData.popperOffsets.x += h, n.modifiersData.popperOffsets.y += p), n.modifiersData[a] = c;
}
const ew = {
  name: "offset",
  enabled: !0,
  phase: "main",
  requires: ["popperOffsets"],
  fn: Qb
};
function tw(e) {
  var n = e.state, r = e.name;
  n.modifiersData[r] = lh({
    reference: n.rects.reference,
    element: n.rects.popper,
    strategy: "absolute",
    placement: n.placement
  });
}
const nw = {
  name: "popperOffsets",
  enabled: !0,
  phase: "read",
  fn: tw,
  data: {}
};
function rw(e) {
  return e === "x" ? "y" : "x";
}
function iw(e) {
  var n = e.state, r = e.options, a = e.name, l = r.mainAxis, o = l === void 0 ? !0 : l, c = r.altAxis, f = c === void 0 ? !1 : c, h = r.boundary, p = r.rootBoundary, g = r.altBoundary, w = r.padding, M = r.tether, S = M === void 0 ? !0 : M, k = r.tetherOffset, U = k === void 0 ? 0 : k, R = ls(n, {
    boundary: h,
    rootBoundary: p,
    padding: w,
    altBoundary: g
  }), P = En(n.placement), J = _i(n.placement), Q = !J, H = Dl(P), z = rw(H), te = n.modifiersData.popperOffsets, V = n.rects.reference, ne = n.rects.popper, me = typeof U == "function" ? U(Object.assign({}, n.rects, {
    placement: n.placement
  })) : U, we = typeof me == "number" ? {
    mainAxis: me,
    altAxis: me
  } : Object.assign({
    mainAxis: 0,
    altAxis: 0
  }, me), $e = n.modifiersData.offset ? n.modifiersData.offset[n.placement] : null, Z = {
    x: 0,
    y: 0
  };
  if (te) {
    if (o) {
      var fe, Ae = H === "y" ? Nt : Wt, ae = H === "y" ? vn : pn, xe = H === "y" ? "height" : "width", Me = te[H], Ye = Me + R[Ae], Ue = Me - R[ae], B = S ? -ne[xe] / 2 : 0, he = J === mi ? V[xe] : ne[xe], re = J === mi ? -ne[xe] : -V[xe], Je = n.elements.arrow, Pe = S && Je ? wl(Je) : {
        width: 0,
        height: 0
      }, Ne = n.modifiersData["arrow#persistent"] ? n.modifiersData["arrow#persistent"].padding : ih(), Qe = Ne[Ae], et = Ne[ae], je = is(0, V[xe], Pe[xe]), ot = Q ? V[xe] / 2 - B - je - Qe - we.mainAxis : he - je - Qe - we.mainAxis, mn = Q ? -V[xe] / 2 + B + je + et + we.mainAxis : re + je + et + we.mainAxis, _t = n.elements.arrow && ms(n.elements.arrow), ft = _t ? H === "y" ? _t.clientTop || 0 : _t.clientLeft || 0 : 0, St = (fe = $e == null ? void 0 : $e[H]) != null ? fe : 0, st = Me + ot - St - ft, Qt = Me + mn - St, en = is(S ? ya(Ye, st) : Ye, Me, S ? Wr(Ue, Qt) : Ue);
      te[H] = en, Z[H] = en - Me;
    }
    if (f) {
      var dt, Sn = H === "x" ? Nt : Wt, Fn = H === "x" ? vn : pn, ht = te[z], at = z === "y" ? "height" : "width", It = ht + R[Sn], Bt = ht - R[Fn], Mn = [Nt, Wt].indexOf(P) !== -1, Et = (dt = $e == null ? void 0 : $e[z]) != null ? dt : 0, On = Mn ? It : ht - V[at] - ne[at] - Et + we.altAxis, Ut = Mn ? ht + V[at] + ne[at] - Et - we.altAxis : Bt, Ht = S && Mn ? xb(On, ht, Ut) : is(S ? On : It, ht, S ? Ut : Bt);
      te[z] = Ht, Z[z] = Ht - ht;
    }
    n.modifiersData[a] = Z;
  }
}
const sw = {
  name: "preventOverflow",
  enabled: !0,
  phase: "main",
  fn: iw,
  requiresIfExists: ["offset"]
};
function aw(e) {
  return {
    scrollLeft: e.scrollLeft,
    scrollTop: e.scrollTop
  };
}
function ow(e) {
  return e === Jt(e) || !dn(e) ? $l(e) : aw(e);
}
function lw(e) {
  var n = e.getBoundingClientRect(), r = gi(n.width) / e.offsetWidth || 1, a = gi(n.height) / e.offsetHeight || 1;
  return r !== 1 || a !== 1;
}
function uw(e, n, r) {
  r === void 0 && (r = !1);
  var a = dn(n), l = dn(n) && lw(n), o = $r(n), c = yi(e, l, r), f = {
    scrollLeft: 0,
    scrollTop: 0
  }, h = {
    x: 0,
    y: 0
  };
  return (a || !a && !r) && ((Ln(n) !== "body" || // https://github.com/popperjs/popper-core/issues/1078
  Sl(o)) && (f = ow(n)), dn(n) ? (h = yi(n, !0), h.x += n.clientLeft, h.y += n.clientTop) : o && (h.x = Cl(o))), {
    x: c.left + f.scrollLeft - h.x,
    y: c.top + f.scrollTop - h.y,
    width: c.width,
    height: c.height
  };
}
function cw(e) {
  var n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Set(), a = [];
  e.forEach(function(o) {
    n.set(o.name, o);
  });
  function l(o) {
    r.add(o.name);
    var c = [].concat(o.requires || [], o.requiresIfExists || []);
    c.forEach(function(f) {
      if (!r.has(f)) {
        var h = n.get(f);
        h && l(h);
      }
    }), a.push(o);
  }
  return e.forEach(function(o) {
    r.has(o.name) || l(o);
  }), a;
}
function fw(e) {
  var n = cw(e);
  return Db.reduce(function(r, a) {
    return r.concat(n.filter(function(l) {
      return l.phase === a;
    }));
  }, []);
}
function dw(e) {
  var n;
  return function() {
    return n || (n = new Promise(function(r) {
      Promise.resolve().then(function() {
        n = void 0, r(e());
      });
    })), n;
  };
}
function hw(e) {
  var n = e.reduce(function(r, a) {
    var l = r[a.name];
    return r[a.name] = l ? Object.assign({}, l, a, {
      options: Object.assign({}, l.options, a.options),
      data: Object.assign({}, l.data, a.data)
    }) : a, r;
  }, {});
  return Object.keys(n).map(function(r) {
    return n[r];
  });
}
var Yf = {
  placement: "bottom",
  modifiers: [],
  strategy: "absolute"
};
function Rf() {
  for (var e = arguments.length, n = new Array(e), r = 0; r < e; r++)
    n[r] = arguments[r];
  return !n.some(function(a) {
    return !(a && typeof a.getBoundingClientRect == "function");
  });
}
function vw(e) {
  e === void 0 && (e = {});
  var n = e, r = n.defaultModifiers, a = r === void 0 ? [] : r, l = n.defaultOptions, o = l === void 0 ? Yf : l;
  return function(f, h, p) {
    p === void 0 && (p = o);
    var g = {
      placement: "bottom",
      orderedModifiers: [],
      options: Object.assign({}, Yf, o),
      modifiersData: {},
      elements: {
        reference: f,
        popper: h
      },
      attributes: {},
      styles: {}
    }, w = [], M = !1, S = {
      state: g,
      setOptions: function(P) {
        var J = typeof P == "function" ? P(g.options) : P;
        U(), g.options = Object.assign({}, o, g.options, J), g.scrollParents = {
          reference: Br(f) ? ss(f) : f.contextElement ? ss(f.contextElement) : [],
          popper: ss(h)
        };
        var Q = fw(hw([].concat(a, g.options.modifiers)));
        return g.orderedModifiers = Q.filter(function(H) {
          return H.enabled;
        }), k(), S.update();
      },
      // Sync update – it will always be executed, even if not necessary. This
      // is useful for low frequency updates where sync behavior simplifies the
      // logic.
      // For high frequency updates (e.g. `resize` and `scroll` events), always
      // prefer the async Popper#update method
      forceUpdate: function() {
        if (!M) {
          var P = g.elements, J = P.reference, Q = P.popper;
          if (Rf(J, Q)) {
            g.rects = {
              reference: uw(J, ms(Q), g.options.strategy === "fixed"),
              popper: wl(Q)
            }, g.reset = !1, g.placement = g.options.placement, g.orderedModifiers.forEach(function(we) {
              return g.modifiersData[we.name] = Object.assign({}, we.data);
            });
            for (var H = 0; H < g.orderedModifiers.length; H++) {
              if (g.reset === !0) {
                g.reset = !1, H = -1;
                continue;
              }
              var z = g.orderedModifiers[H], te = z.fn, V = z.options, ne = V === void 0 ? {} : V, me = z.name;
              typeof te == "function" && (g = te({
                state: g,
                options: ne,
                name: me,
                instance: S
              }) || g);
            }
          }
        }
      },
      // Async and optimistically optimized update – it will not be executed if
      // not necessary (debounced to run at most once-per-tick)
      update: dw(function() {
        return new Promise(function(R) {
          S.forceUpdate(), R(g);
        });
      }),
      destroy: function() {
        U(), M = !0;
      }
    };
    if (!Rf(f, h))
      return S;
    S.setOptions(p).then(function(R) {
      !M && p.onFirstUpdate && p.onFirstUpdate(R);
    });
    function k() {
      g.orderedModifiers.forEach(function(R) {
        var P = R.name, J = R.options, Q = J === void 0 ? {} : J, H = R.effect;
        if (typeof H == "function") {
          var z = H({
            state: g,
            name: P,
            instance: S,
            options: Q
          }), te = function() {
          };
          w.push(z || te);
        }
      });
    }
    function U() {
      w.forEach(function(R) {
        return R();
      }), w = [];
    }
    return S;
  };
}
var pw = [Fb, nw, Yb, Sb, ew, jb, sw, kb, Xb], mw = /* @__PURE__ */ vw({
  defaultModifiers: pw
}), gw = Object.defineProperty, yw = (e, n, r) => n in e ? gw(e, n, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[n] = r, ie = (e, n, r) => (yw(e, typeof n != "symbol" ? n + "" : n, r), r), ua = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function uh(e) {
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
}
var _w = Object.prototype, bw = _w.hasOwnProperty;
function ww(e, n) {
  return e != null && bw.call(e, n);
}
var Dw = ww, $w = Array.isArray, $n = $w, Cw = typeof ua == "object" && ua && ua.Object === Object && ua, ch = Cw, Sw = ch, Mw = typeof self == "object" && self && self.Object === Object && self, Ow = Sw || Mw || Function("return this")(), Yn = Ow, xw = Yn, Aw = xw.Symbol, Ia = Aw, Ff = Ia, fh = Object.prototype, Tw = fh.hasOwnProperty, Pw = fh.toString, ji = Ff ? Ff.toStringTag : void 0;
function kw(e) {
  var n = Tw.call(e, ji), r = e[ji];
  try {
    e[ji] = void 0;
    var a = !0;
  } catch {
  }
  var l = Pw.call(e);
  return a && (n ? e[ji] = r : delete e[ji]), l;
}
var Iw = kw, Ew = Object.prototype, Lw = Ew.toString;
function Yw(e) {
  return Lw.call(e);
}
var Rw = Yw, Nf = Ia, Fw = Iw, Nw = Rw, Ww = "[object Null]", Bw = "[object Undefined]", Wf = Nf ? Nf.toStringTag : void 0;
function Uw(e) {
  return e == null ? e === void 0 ? Bw : Ww : Wf && Wf in Object(e) ? Fw(e) : Nw(e);
}
var Rn = Uw;
function Hw(e) {
  return e != null && typeof e == "object";
}
var Cn = Hw, zw = Rn, qw = Cn, Kw = "[object Symbol]";
function Vw(e) {
  return typeof e == "symbol" || qw(e) && zw(e) == Kw;
}
var Ml = Vw, Gw = $n, jw = Ml, Zw = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Xw = /^\w*$/;
function Jw(e, n) {
  if (Gw(e))
    return !1;
  var r = typeof e;
  return r == "number" || r == "symbol" || r == "boolean" || e == null || jw(e) ? !0 : Xw.test(e) || !Zw.test(e) || n != null && e in Object(n);
}
var Ol = Jw;
function Qw(e) {
  var n = typeof e;
  return e != null && (n == "object" || n == "function");
}
var tr = Qw, eD = Rn, tD = tr, nD = "[object AsyncFunction]", rD = "[object Function]", iD = "[object GeneratorFunction]", sD = "[object Proxy]";
function aD(e) {
  if (!tD(e))
    return !1;
  var n = eD(e);
  return n == rD || n == iD || n == nD || n == sD;
}
var Hr = aD, oD = Yn, lD = oD["__core-js_shared__"], uD = lD, Xo = uD, Bf = function() {
  var e = /[^.]+$/.exec(Xo && Xo.keys && Xo.keys.IE_PROTO || "");
  return e ? "Symbol(src)_1." + e : "";
}();
function cD(e) {
  return !!Bf && Bf in e;
}
var fD = cD, dD = Function.prototype, hD = dD.toString;
function vD(e) {
  if (e != null) {
    try {
      return hD.call(e);
    } catch {
    }
    try {
      return e + "";
    } catch {
    }
  }
  return "";
}
var dh = vD, pD = Hr, mD = fD, gD = tr, yD = dh, _D = /[\\^$.*+?()[\]{}|]/g, bD = /^\[object .+?Constructor\]$/, wD = Function.prototype, DD = Object.prototype, $D = wD.toString, CD = DD.hasOwnProperty, SD = RegExp(
  "^" + $D.call(CD).replace(_D, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
);
function MD(e) {
  if (!gD(e) || mD(e))
    return !1;
  var n = pD(e) ? SD : bD;
  return n.test(yD(e));
}
var OD = MD;
function xD(e, n) {
  return e == null ? void 0 : e[n];
}
var AD = xD, TD = OD, PD = AD;
function kD(e, n) {
  var r = PD(e, n);
  return TD(r) ? r : void 0;
}
var zr = kD, ID = zr, ED = ID(Object, "create"), Ea = ED, Uf = Ea;
function LD() {
  this.__data__ = Uf ? Uf(null) : {}, this.size = 0;
}
var YD = LD;
function RD(e) {
  var n = this.has(e) && delete this.__data__[e];
  return this.size -= n ? 1 : 0, n;
}
var FD = RD, ND = Ea, WD = "__lodash_hash_undefined__", BD = Object.prototype, UD = BD.hasOwnProperty;
function HD(e) {
  var n = this.__data__;
  if (ND) {
    var r = n[e];
    return r === WD ? void 0 : r;
  }
  return UD.call(n, e) ? n[e] : void 0;
}
var zD = HD, qD = Ea, KD = Object.prototype, VD = KD.hasOwnProperty;
function GD(e) {
  var n = this.__data__;
  return qD ? n[e] !== void 0 : VD.call(n, e);
}
var jD = GD, ZD = Ea, XD = "__lodash_hash_undefined__";
function JD(e, n) {
  var r = this.__data__;
  return this.size += this.has(e) ? 0 : 1, r[e] = ZD && n === void 0 ? XD : n, this;
}
var QD = JD, e$ = YD, t$ = FD, n$ = zD, r$ = jD, i$ = QD;
function Di(e) {
  var n = -1, r = e == null ? 0 : e.length;
  for (this.clear(); ++n < r; ) {
    var a = e[n];
    this.set(a[0], a[1]);
  }
}
Di.prototype.clear = e$;
Di.prototype.delete = t$;
Di.prototype.get = n$;
Di.prototype.has = r$;
Di.prototype.set = i$;
var s$ = Di;
function a$() {
  this.__data__ = [], this.size = 0;
}
var o$ = a$;
function l$(e, n) {
  return e === n || e !== e && n !== n;
}
var $i = l$, u$ = $i;
function c$(e, n) {
  for (var r = e.length; r--; )
    if (u$(e[r][0], n))
      return r;
  return -1;
}
var La = c$, f$ = La, d$ = Array.prototype, h$ = d$.splice;
function v$(e) {
  var n = this.__data__, r = f$(n, e);
  if (r < 0)
    return !1;
  var a = n.length - 1;
  return r == a ? n.pop() : h$.call(n, r, 1), --this.size, !0;
}
var p$ = v$, m$ = La;
function g$(e) {
  var n = this.__data__, r = m$(n, e);
  return r < 0 ? void 0 : n[r][1];
}
var y$ = g$, _$ = La;
function b$(e) {
  return _$(this.__data__, e) > -1;
}
var w$ = b$, D$ = La;
function $$(e, n) {
  var r = this.__data__, a = D$(r, e);
  return a < 0 ? (++this.size, r.push([e, n])) : r[a][1] = n, this;
}
var C$ = $$, S$ = o$, M$ = p$, O$ = y$, x$ = w$, A$ = C$;
function Ci(e) {
  var n = -1, r = e == null ? 0 : e.length;
  for (this.clear(); ++n < r; ) {
    var a = e[n];
    this.set(a[0], a[1]);
  }
}
Ci.prototype.clear = S$;
Ci.prototype.delete = M$;
Ci.prototype.get = O$;
Ci.prototype.has = x$;
Ci.prototype.set = A$;
var Ya = Ci, T$ = zr, P$ = Yn, k$ = T$(P$, "Map"), xl = k$, Hf = s$, I$ = Ya, E$ = xl;
function L$() {
  this.size = 0, this.__data__ = {
    hash: new Hf(),
    map: new (E$ || I$)(),
    string: new Hf()
  };
}
var Y$ = L$;
function R$(e) {
  var n = typeof e;
  return n == "string" || n == "number" || n == "symbol" || n == "boolean" ? e !== "__proto__" : e === null;
}
var F$ = R$, N$ = F$;
function W$(e, n) {
  var r = e.__data__;
  return N$(n) ? r[typeof n == "string" ? "string" : "hash"] : r.map;
}
var Ra = W$, B$ = Ra;
function U$(e) {
  var n = B$(this, e).delete(e);
  return this.size -= n ? 1 : 0, n;
}
var H$ = U$, z$ = Ra;
function q$(e) {
  return z$(this, e).get(e);
}
var K$ = q$, V$ = Ra;
function G$(e) {
  return V$(this, e).has(e);
}
var j$ = G$, Z$ = Ra;
function X$(e, n) {
  var r = Z$(this, e), a = r.size;
  return r.set(e, n), this.size += r.size == a ? 0 : 1, this;
}
var J$ = X$, Q$ = Y$, e2 = H$, t2 = K$, n2 = j$, r2 = J$;
function Si(e) {
  var n = -1, r = e == null ? 0 : e.length;
  for (this.clear(); ++n < r; ) {
    var a = e[n];
    this.set(a[0], a[1]);
  }
}
Si.prototype.clear = Q$;
Si.prototype.delete = e2;
Si.prototype.get = t2;
Si.prototype.has = n2;
Si.prototype.set = r2;
var Al = Si, hh = Al, i2 = "Expected a function";
function Tl(e, n) {
  if (typeof e != "function" || n != null && typeof n != "function")
    throw new TypeError(i2);
  var r = function() {
    var a = arguments, l = n ? n.apply(this, a) : a[0], o = r.cache;
    if (o.has(l))
      return o.get(l);
    var c = e.apply(this, a);
    return r.cache = o.set(l, c) || o, c;
  };
  return r.cache = new (Tl.Cache || hh)(), r;
}
Tl.Cache = hh;
var s2 = Tl, a2 = s2, o2 = 500;
function l2(e) {
  var n = a2(e, function(a) {
    return r.size === o2 && r.clear(), a;
  }), r = n.cache;
  return n;
}
var u2 = l2, c2 = u2, f2 = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, d2 = /\\(\\)?/g, h2 = c2(function(e) {
  var n = [];
  return e.charCodeAt(0) === 46 && n.push(""), e.replace(f2, function(r, a, l, o) {
    n.push(l ? o.replace(d2, "$1") : a || r);
  }), n;
}), v2 = h2;
function p2(e, n) {
  for (var r = -1, a = e == null ? 0 : e.length, l = Array(a); ++r < a; )
    l[r] = n(e[r], r, e);
  return l;
}
var m2 = p2, zf = Ia, g2 = m2, y2 = $n, _2 = Ml, b2 = 1 / 0, qf = zf ? zf.prototype : void 0, Kf = qf ? qf.toString : void 0;
function vh(e) {
  if (typeof e == "string")
    return e;
  if (y2(e))
    return g2(e, vh) + "";
  if (_2(e))
    return Kf ? Kf.call(e) : "";
  var n = e + "";
  return n == "0" && 1 / e == -b2 ? "-0" : n;
}
var w2 = vh, D2 = w2;
function $2(e) {
  return e == null ? "" : D2(e);
}
var C2 = $2, S2 = $n, M2 = Ol, O2 = v2, x2 = C2;
function A2(e, n) {
  return S2(e) ? e : M2(e, n) ? [e] : O2(x2(e));
}
var ph = A2, T2 = Rn, P2 = Cn, k2 = "[object Arguments]";
function I2(e) {
  return P2(e) && T2(e) == k2;
}
var E2 = I2, Vf = E2, L2 = Cn, mh = Object.prototype, Y2 = mh.hasOwnProperty, R2 = mh.propertyIsEnumerable, F2 = Vf(/* @__PURE__ */ function() {
  return arguments;
}()) ? Vf : function(e) {
  return L2(e) && Y2.call(e, "callee") && !R2.call(e, "callee");
}, Pl = F2, N2 = 9007199254740991, W2 = /^(?:0|[1-9]\d*)$/;
function B2(e, n) {
  var r = typeof e;
  return n = n ?? N2, !!n && (r == "number" || r != "symbol" && W2.test(e)) && e > -1 && e % 1 == 0 && e < n;
}
var kl = B2, U2 = 9007199254740991;
function H2(e) {
  return typeof e == "number" && e > -1 && e % 1 == 0 && e <= U2;
}
var Il = H2, z2 = Ml, q2 = 1 / 0;
function K2(e) {
  if (typeof e == "string" || z2(e))
    return e;
  var n = e + "";
  return n == "0" && 1 / e == -q2 ? "-0" : n;
}
var Fa = K2, V2 = ph, G2 = Pl, j2 = $n, Z2 = kl, X2 = Il, J2 = Fa;
function Q2(e, n, r) {
  n = V2(n, e);
  for (var a = -1, l = n.length, o = !1; ++a < l; ) {
    var c = J2(n[a]);
    if (!(o = e != null && r(e, c)))
      break;
    e = e[c];
  }
  return o || ++a != l ? o : (l = e == null ? 0 : e.length, !!l && X2(l) && Z2(c, l) && (j2(e) || G2(e)));
}
var gh = Q2, eC = Dw, tC = gh;
function nC(e, n) {
  return e != null && tC(e, n, eC);
}
var yh = nC, rC = Rn, iC = Cn, sC = "[object Date]";
function aC(e) {
  return iC(e) && rC(e) == sC;
}
var oC = aC;
function lC(e) {
  return function(n) {
    return e(n);
  };
}
var _h = lC, us = {}, uC = {
  get exports() {
    return us;
  },
  set exports(e) {
    us = e;
  }
};
(function(e, n) {
  var r = ch, a = n && !n.nodeType && n, l = a && !0 && e && !e.nodeType && e, o = l && l.exports === a, c = o && r.process, f = function() {
    try {
      var h = l && l.require && l.require("util").types;
      return h || c && c.binding && c.binding("util");
    } catch {
    }
  }();
  e.exports = f;
})(uC, us);
var cC = oC, fC = _h, Gf = us, jf = Gf && Gf.isDate, dC = jf ? fC(jf) : cC, hC = dC, vC = Rn, pC = $n, mC = Cn, gC = "[object String]";
function yC(e) {
  return typeof e == "string" || !pC(e) && mC(e) && vC(e) == gC;
}
var Pn = yC;
function _C(e, n) {
  for (var r = -1, a = e == null ? 0 : e.length; ++r < a; )
    if (n(e[r], r, e))
      return !0;
  return !1;
}
var bh = _C, bC = Ya;
function wC() {
  this.__data__ = new bC(), this.size = 0;
}
var DC = wC;
function $C(e) {
  var n = this.__data__, r = n.delete(e);
  return this.size = n.size, r;
}
var CC = $C;
function SC(e) {
  return this.__data__.get(e);
}
var MC = SC;
function OC(e) {
  return this.__data__.has(e);
}
var xC = OC, AC = Ya, TC = xl, PC = Al, kC = 200;
function IC(e, n) {
  var r = this.__data__;
  if (r instanceof AC) {
    var a = r.__data__;
    if (!TC || a.length < kC - 1)
      return a.push([e, n]), this.size = ++r.size, this;
    r = this.__data__ = new PC(a);
  }
  return r.set(e, n), this.size = r.size, this;
}
var EC = IC, LC = Ya, YC = DC, RC = CC, FC = MC, NC = xC, WC = EC;
function Mi(e) {
  var n = this.__data__ = new LC(e);
  this.size = n.size;
}
Mi.prototype.clear = YC;
Mi.prototype.delete = RC;
Mi.prototype.get = FC;
Mi.prototype.has = NC;
Mi.prototype.set = WC;
var El = Mi, BC = "__lodash_hash_undefined__";
function UC(e) {
  return this.__data__.set(e, BC), this;
}
var HC = UC;
function zC(e) {
  return this.__data__.has(e);
}
var qC = zC, KC = Al, VC = HC, GC = qC;
function _a(e) {
  var n = -1, r = e == null ? 0 : e.length;
  for (this.__data__ = new KC(); ++n < r; )
    this.add(e[n]);
}
_a.prototype.add = _a.prototype.push = VC;
_a.prototype.has = GC;
var jC = _a;
function ZC(e, n) {
  return e.has(n);
}
var XC = ZC, JC = jC, QC = bh, eS = XC, tS = 1, nS = 2;
function rS(e, n, r, a, l, o) {
  var c = r & tS, f = e.length, h = n.length;
  if (f != h && !(c && h > f))
    return !1;
  var p = o.get(e), g = o.get(n);
  if (p && g)
    return p == n && g == e;
  var w = -1, M = !0, S = r & nS ? new JC() : void 0;
  for (o.set(e, n), o.set(n, e); ++w < f; ) {
    var k = e[w], U = n[w];
    if (a)
      var R = c ? a(U, k, w, n, e, o) : a(k, U, w, e, n, o);
    if (R !== void 0) {
      if (R)
        continue;
      M = !1;
      break;
    }
    if (S) {
      if (!QC(n, function(P, J) {
        if (!eS(S, J) && (k === P || l(k, P, r, a, o)))
          return S.push(J);
      })) {
        M = !1;
        break;
      }
    } else if (!(k === U || l(k, U, r, a, o))) {
      M = !1;
      break;
    }
  }
  return o.delete(e), o.delete(n), M;
}
var wh = rS, iS = Yn, sS = iS.Uint8Array, Dh = sS;
function aS(e) {
  var n = -1, r = Array(e.size);
  return e.forEach(function(a, l) {
    r[++n] = [l, a];
  }), r;
}
var oS = aS;
function lS(e) {
  var n = -1, r = Array(e.size);
  return e.forEach(function(a) {
    r[++n] = a;
  }), r;
}
var uS = lS, Zf = Ia, Xf = Dh, cS = $i, fS = wh, dS = oS, hS = uS, vS = 1, pS = 2, mS = "[object Boolean]", gS = "[object Date]", yS = "[object Error]", _S = "[object Map]", bS = "[object Number]", wS = "[object RegExp]", DS = "[object Set]", $S = "[object String]", CS = "[object Symbol]", SS = "[object ArrayBuffer]", MS = "[object DataView]", Jf = Zf ? Zf.prototype : void 0, Jo = Jf ? Jf.valueOf : void 0;
function OS(e, n, r, a, l, o, c) {
  switch (r) {
    case MS:
      if (e.byteLength != n.byteLength || e.byteOffset != n.byteOffset)
        return !1;
      e = e.buffer, n = n.buffer;
    case SS:
      return !(e.byteLength != n.byteLength || !o(new Xf(e), new Xf(n)));
    case mS:
    case gS:
    case bS:
      return cS(+e, +n);
    case yS:
      return e.name == n.name && e.message == n.message;
    case wS:
    case $S:
      return e == n + "";
    case _S:
      var f = dS;
    case DS:
      var h = a & vS;
      if (f || (f = hS), e.size != n.size && !h)
        return !1;
      var p = c.get(e);
      if (p)
        return p == n;
      a |= pS, c.set(e, n);
      var g = fS(f(e), f(n), a, l, o, c);
      return c.delete(e), g;
    case CS:
      if (Jo)
        return Jo.call(e) == Jo.call(n);
  }
  return !1;
}
var xS = OS;
function AS(e, n) {
  for (var r = -1, a = n.length, l = e.length; ++r < a; )
    e[l + r] = n[r];
  return e;
}
var TS = AS, PS = TS, kS = $n;
function IS(e, n, r) {
  var a = n(e);
  return kS(e) ? a : PS(a, r(e));
}
var ES = IS;
function LS(e, n) {
  for (var r = -1, a = e == null ? 0 : e.length, l = 0, o = []; ++r < a; ) {
    var c = e[r];
    n(c, r, e) && (o[l++] = c);
  }
  return o;
}
var YS = LS;
function RS() {
  return [];
}
var FS = RS, NS = YS, WS = FS, BS = Object.prototype, US = BS.propertyIsEnumerable, Qf = Object.getOwnPropertySymbols, HS = Qf ? function(e) {
  return e == null ? [] : (e = Object(e), NS(Qf(e), function(n) {
    return US.call(e, n);
  }));
} : WS, zS = HS;
function qS(e, n) {
  for (var r = -1, a = Array(e); ++r < e; )
    a[r] = n(r);
  return a;
}
var KS = qS, bi = {}, VS = {
  get exports() {
    return bi;
  },
  set exports(e) {
    bi = e;
  }
};
function GS() {
  return !1;
}
var jS = GS;
(function(e, n) {
  var r = Yn, a = jS, l = n && !n.nodeType && n, o = l && !0 && e && !e.nodeType && e, c = o && o.exports === l, f = c ? r.Buffer : void 0, h = f ? f.isBuffer : void 0, p = h || a;
  e.exports = p;
})(VS, bi);
var ZS = Rn, XS = Il, JS = Cn, QS = "[object Arguments]", eM = "[object Array]", tM = "[object Boolean]", nM = "[object Date]", rM = "[object Error]", iM = "[object Function]", sM = "[object Map]", aM = "[object Number]", oM = "[object Object]", lM = "[object RegExp]", uM = "[object Set]", cM = "[object String]", fM = "[object WeakMap]", dM = "[object ArrayBuffer]", hM = "[object DataView]", vM = "[object Float32Array]", pM = "[object Float64Array]", mM = "[object Int8Array]", gM = "[object Int16Array]", yM = "[object Int32Array]", _M = "[object Uint8Array]", bM = "[object Uint8ClampedArray]", wM = "[object Uint16Array]", DM = "[object Uint32Array]", Ke = {};
Ke[vM] = Ke[pM] = Ke[mM] = Ke[gM] = Ke[yM] = Ke[_M] = Ke[bM] = Ke[wM] = Ke[DM] = !0;
Ke[QS] = Ke[eM] = Ke[dM] = Ke[tM] = Ke[hM] = Ke[nM] = Ke[rM] = Ke[iM] = Ke[sM] = Ke[aM] = Ke[oM] = Ke[lM] = Ke[uM] = Ke[cM] = Ke[fM] = !1;
function $M(e) {
  return JS(e) && XS(e.length) && !!Ke[ZS(e)];
}
var CM = $M, SM = CM, MM = _h, ed = us, td = ed && ed.isTypedArray, OM = td ? MM(td) : SM, Ll = OM, xM = KS, AM = Pl, TM = $n, PM = bi, kM = kl, IM = Ll, EM = Object.prototype, LM = EM.hasOwnProperty;
function YM(e, n) {
  var r = TM(e), a = !r && AM(e), l = !r && !a && PM(e), o = !r && !a && !l && IM(e), c = r || a || l || o, f = c ? xM(e.length, String) : [], h = f.length;
  for (var p in e)
    (n || LM.call(e, p)) && !(c && // Safari 9 has enumerable `arguments.length` in strict mode.
    (p == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
    l && (p == "offset" || p == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
    o && (p == "buffer" || p == "byteLength" || p == "byteOffset") || // Skip index properties.
    kM(p, h))) && f.push(p);
  return f;
}
var $h = YM, RM = Object.prototype;
function FM(e) {
  var n = e && e.constructor, r = typeof n == "function" && n.prototype || RM;
  return e === r;
}
var Yl = FM;
function NM(e, n) {
  return function(r) {
    return e(n(r));
  };
}
var Ch = NM, WM = Ch, BM = WM(Object.keys, Object), UM = BM, HM = Yl, zM = UM, qM = Object.prototype, KM = qM.hasOwnProperty;
function VM(e) {
  if (!HM(e))
    return zM(e);
  var n = [];
  for (var r in Object(e))
    KM.call(e, r) && r != "constructor" && n.push(r);
  return n;
}
var GM = VM, jM = Hr, ZM = Il;
function XM(e) {
  return e != null && ZM(e.length) && !jM(e);
}
var gs = XM, JM = $h, QM = GM, eO = gs;
function tO(e) {
  return eO(e) ? JM(e) : QM(e);
}
var Rl = tO, nO = ES, rO = zS, iO = Rl;
function sO(e) {
  return nO(e, iO, rO);
}
var aO = sO, nd = aO, oO = 1, lO = Object.prototype, uO = lO.hasOwnProperty;
function cO(e, n, r, a, l, o) {
  var c = r & oO, f = nd(e), h = f.length, p = nd(n), g = p.length;
  if (h != g && !c)
    return !1;
  for (var w = h; w--; ) {
    var M = f[w];
    if (!(c ? M in n : uO.call(n, M)))
      return !1;
  }
  var S = o.get(e), k = o.get(n);
  if (S && k)
    return S == n && k == e;
  var U = !0;
  o.set(e, n), o.set(n, e);
  for (var R = c; ++w < h; ) {
    M = f[w];
    var P = e[M], J = n[M];
    if (a)
      var Q = c ? a(J, P, M, n, e, o) : a(P, J, M, e, n, o);
    if (!(Q === void 0 ? P === J || l(P, J, r, a, o) : Q)) {
      U = !1;
      break;
    }
    R || (R = M == "constructor");
  }
  if (U && !R) {
    var H = e.constructor, z = n.constructor;
    H != z && "constructor" in e && "constructor" in n && !(typeof H == "function" && H instanceof H && typeof z == "function" && z instanceof z) && (U = !1);
  }
  return o.delete(e), o.delete(n), U;
}
var fO = cO, dO = zr, hO = Yn, vO = dO(hO, "DataView"), pO = vO, mO = zr, gO = Yn, yO = mO(gO, "Promise"), _O = yO, bO = zr, wO = Yn, DO = bO(wO, "Set"), $O = DO, CO = zr, SO = Yn, MO = CO(SO, "WeakMap"), OO = MO, ll = pO, ul = xl, cl = _O, fl = $O, dl = OO, Sh = Rn, Oi = dh, rd = "[object Map]", xO = "[object Object]", id = "[object Promise]", sd = "[object Set]", ad = "[object WeakMap]", od = "[object DataView]", AO = Oi(ll), TO = Oi(ul), PO = Oi(cl), kO = Oi(fl), IO = Oi(dl), Fr = Sh;
(ll && Fr(new ll(new ArrayBuffer(1))) != od || ul && Fr(new ul()) != rd || cl && Fr(cl.resolve()) != id || fl && Fr(new fl()) != sd || dl && Fr(new dl()) != ad) && (Fr = function(e) {
  var n = Sh(e), r = n == xO ? e.constructor : void 0, a = r ? Oi(r) : "";
  if (a)
    switch (a) {
      case AO:
        return od;
      case TO:
        return rd;
      case PO:
        return id;
      case kO:
        return sd;
      case IO:
        return ad;
    }
  return n;
});
var EO = Fr, Qo = El, LO = wh, YO = xS, RO = fO, ld = EO, ud = $n, cd = bi, FO = Ll, NO = 1, fd = "[object Arguments]", dd = "[object Array]", ca = "[object Object]", WO = Object.prototype, hd = WO.hasOwnProperty;
function BO(e, n, r, a, l, o) {
  var c = ud(e), f = ud(n), h = c ? dd : ld(e), p = f ? dd : ld(n);
  h = h == fd ? ca : h, p = p == fd ? ca : p;
  var g = h == ca, w = p == ca, M = h == p;
  if (M && cd(e)) {
    if (!cd(n))
      return !1;
    c = !0, g = !1;
  }
  if (M && !g)
    return o || (o = new Qo()), c || FO(e) ? LO(e, n, r, a, l, o) : YO(e, n, h, r, a, l, o);
  if (!(r & NO)) {
    var S = g && hd.call(e, "__wrapped__"), k = w && hd.call(n, "__wrapped__");
    if (S || k) {
      var U = S ? e.value() : e, R = k ? n.value() : n;
      return o || (o = new Qo()), l(U, R, r, a, o);
    }
  }
  return M ? (o || (o = new Qo()), RO(e, n, r, a, l, o)) : !1;
}
var UO = BO, HO = UO, vd = Cn;
function Mh(e, n, r, a, l) {
  return e === n ? !0 : e == null || n == null || !vd(e) && !vd(n) ? e !== e && n !== n : HO(e, n, r, a, Mh, l);
}
var Oh = Mh, zO = El, qO = Oh, KO = 1, VO = 2;
function GO(e, n, r, a) {
  var l = r.length, o = l, c = !a;
  if (e == null)
    return !o;
  for (e = Object(e); l--; ) {
    var f = r[l];
    if (c && f[2] ? f[1] !== e[f[0]] : !(f[0] in e))
      return !1;
  }
  for (; ++l < o; ) {
    f = r[l];
    var h = f[0], p = e[h], g = f[1];
    if (c && f[2]) {
      if (p === void 0 && !(h in e))
        return !1;
    } else {
      var w = new zO();
      if (a)
        var M = a(p, g, h, e, n, w);
      if (!(M === void 0 ? qO(g, p, KO | VO, a, w) : M))
        return !1;
    }
  }
  return !0;
}
var jO = GO, ZO = tr;
function XO(e) {
  return e === e && !ZO(e);
}
var xh = XO, JO = xh, QO = Rl;
function ex(e) {
  for (var n = QO(e), r = n.length; r--; ) {
    var a = n[r], l = e[a];
    n[r] = [a, l, JO(l)];
  }
  return n;
}
var tx = ex;
function nx(e, n) {
  return function(r) {
    return r == null ? !1 : r[e] === n && (n !== void 0 || e in Object(r));
  };
}
var Ah = nx, rx = jO, ix = tx, sx = Ah;
function ax(e) {
  var n = ix(e);
  return n.length == 1 && n[0][2] ? sx(n[0][0], n[0][1]) : function(r) {
    return r === e || rx(r, e, n);
  };
}
var ox = ax, lx = ph, ux = Fa;
function cx(e, n) {
  n = lx(n, e);
  for (var r = 0, a = n.length; e != null && r < a; )
    e = e[ux(n[r++])];
  return r && r == a ? e : void 0;
}
var Th = cx, fx = Th;
function dx(e, n, r) {
  var a = e == null ? void 0 : fx(e, n);
  return a === void 0 ? r : a;
}
var Nr = dx;
function hx(e, n) {
  return e != null && n in Object(e);
}
var vx = hx, px = vx, mx = gh;
function gx(e, n) {
  return e != null && mx(e, n, px);
}
var yx = gx, _x = Oh, bx = Nr, wx = yx, Dx = Ol, $x = xh, Cx = Ah, Sx = Fa, Mx = 1, Ox = 2;
function xx(e, n) {
  return Dx(e) && $x(n) ? Cx(Sx(e), n) : function(r) {
    var a = bx(r, e);
    return a === void 0 && a === n ? wx(r, e) : _x(n, a, Mx | Ox);
  };
}
var Ax = xx;
function Tx(e) {
  return e;
}
var Fl = Tx;
function Px(e) {
  return function(n) {
    return n == null ? void 0 : n[e];
  };
}
var kx = Px, Ix = Th;
function Ex(e) {
  return function(n) {
    return Ix(n, e);
  };
}
var Lx = Ex, Yx = kx, Rx = Lx, Fx = Ol, Nx = Fa;
function Wx(e) {
  return Fx(e) ? Yx(Nx(e)) : Rx(e);
}
var Bx = Wx, Ux = ox, Hx = Ax, zx = Fl, qx = $n, Kx = Bx;
function Vx(e) {
  return typeof e == "function" ? e : e == null ? zx : typeof e == "object" ? qx(e) ? Hx(e[0], e[1]) : Ux(e) : Kx(e);
}
var Ph = Vx;
function Gx(e) {
  return function(n, r, a) {
    for (var l = -1, o = Object(n), c = a(n), f = c.length; f--; ) {
      var h = c[e ? f : ++l];
      if (r(o[h], h, o) === !1)
        break;
    }
    return n;
  };
}
var jx = Gx, Zx = jx, Xx = Zx(), kh = Xx, Jx = kh, Qx = Rl;
function eA(e, n) {
  return e && Jx(e, n, Qx);
}
var Ih = eA, tA = gs;
function nA(e, n) {
  return function(r, a) {
    if (r == null)
      return r;
    if (!tA(r))
      return e(r, a);
    for (var l = r.length, o = n ? l : -1, c = Object(r); (n ? o-- : ++o < l) && a(c[o], o, c) !== !1; )
      ;
    return r;
  };
}
var rA = nA, iA = Ih, sA = rA, aA = sA(iA), oA = aA, lA = oA;
function uA(e, n) {
  var r;
  return lA(e, function(a, l, o) {
    return r = n(a, l, o), !r;
  }), !!r;
}
var cA = uA, fA = $i, dA = gs, hA = kl, vA = tr;
function pA(e, n, r) {
  if (!vA(r))
    return !1;
  var a = typeof n;
  return (a == "number" ? dA(r) && hA(n, r.length) : a == "string" && n in r) ? fA(r[n], e) : !1;
}
var Nl = pA, mA = bh, gA = Ph, yA = cA, _A = $n, bA = Nl;
function wA(e, n, r) {
  var a = _A(e) ? mA : yA;
  return r && bA(e, n, r) && (n = void 0), a(e, gA(n));
}
var DA = wA, $A = Rn, CA = Cn, SA = "[object Boolean]";
function MA(e) {
  return e === !0 || e === !1 || CA(e) && $A(e) == SA;
}
var OA = MA, xA = Rn, AA = Cn, TA = "[object Number]";
function PA(e) {
  return typeof e == "number" || AA(e) && xA(e) == TA;
}
var Dn = PA, kA = zr, IA = function() {
  try {
    var e = kA(Object, "defineProperty");
    return e({}, "", {}), e;
  } catch {
  }
}(), Eh = IA, pd = Eh;
function EA(e, n, r) {
  n == "__proto__" && pd ? pd(e, n, {
    configurable: !0,
    enumerable: !0,
    value: r,
    writable: !0
  }) : e[n] = r;
}
var Na = EA, LA = Na, YA = $i, RA = Object.prototype, FA = RA.hasOwnProperty;
function NA(e, n, r) {
  var a = e[n];
  (!(FA.call(e, n) && YA(a, r)) || r === void 0 && !(n in e)) && LA(e, n, r);
}
var WA = NA, BA = Na, UA = Ih, HA = Ph;
function zA(e, n) {
  var r = {};
  return n = HA(n), UA(e, function(a, l, o) {
    BA(r, l, n(a, l, o));
  }), r;
}
var qA = zA;
function KA(e, n, r) {
  switch (r.length) {
    case 0:
      return e.call(n);
    case 1:
      return e.call(n, r[0]);
    case 2:
      return e.call(n, r[0], r[1]);
    case 3:
      return e.call(n, r[0], r[1], r[2]);
  }
  return e.apply(n, r);
}
var Lh = KA, VA = Lh, md = Math.max;
function GA(e, n, r) {
  return n = md(n === void 0 ? e.length - 1 : n, 0), function() {
    for (var a = arguments, l = -1, o = md(a.length - n, 0), c = Array(o); ++l < o; )
      c[l] = a[n + l];
    l = -1;
    for (var f = Array(n + 1); ++l < n; )
      f[l] = a[l];
    return f[n] = r(c), VA(e, this, f);
  };
}
var jA = GA;
function ZA(e) {
  return function() {
    return e;
  };
}
var XA = ZA, JA = XA, gd = Eh, QA = Fl, eT = gd ? function(e, n) {
  return gd(e, "toString", {
    configurable: !0,
    enumerable: !1,
    value: JA(n),
    writable: !0
  });
} : QA, tT = eT, nT = 800, rT = 16, iT = Date.now;
function sT(e) {
  var n = 0, r = 0;
  return function() {
    var a = iT(), l = rT - (a - r);
    if (r = a, l > 0) {
      if (++n >= nT)
        return arguments[0];
    } else
      n = 0;
    return e.apply(void 0, arguments);
  };
}
var aT = sT, oT = tT, lT = aT, uT = lT(oT), cT = uT, fT = Fl, dT = jA, hT = cT;
function vT(e, n) {
  return hT(dT(e, n, fT), e + "");
}
var Wl = vT;
function pT(e) {
  var n = [];
  if (e != null)
    for (var r in Object(e))
      n.push(r);
  return n;
}
var mT = pT, gT = tr, yT = Yl, _T = mT, bT = Object.prototype, wT = bT.hasOwnProperty;
function DT(e) {
  if (!gT(e))
    return _T(e);
  var n = yT(e), r = [];
  for (var a in e)
    a == "constructor" && (n || !wT.call(e, a)) || r.push(a);
  return r;
}
var $T = DT, CT = $h, ST = $T, MT = gs;
function OT(e) {
  return MT(e) ? CT(e, !0) : ST(e);
}
var Bl = OT, xT = Wl, AT = $i, TT = Nl, PT = Bl, Yh = Object.prototype, kT = Yh.hasOwnProperty, IT = xT(function(e, n) {
  e = Object(e);
  var r = -1, a = n.length, l = a > 2 ? n[2] : void 0;
  for (l && TT(n[0], n[1], l) && (a = 1); ++r < a; )
    for (var o = n[r], c = PT(o), f = -1, h = c.length; ++f < h; ) {
      var p = c[f], g = e[p];
      (g === void 0 || AT(g, Yh[p]) && !kT.call(e, p)) && (e[p] = o[p]);
    }
  return e;
}), yd = IT, ET = Na, LT = $i;
function YT(e, n, r) {
  (r !== void 0 && !LT(e[n], r) || r === void 0 && !(n in e)) && ET(e, n, r);
}
var Rh = YT, ba = {}, RT = {
  get exports() {
    return ba;
  },
  set exports(e) {
    ba = e;
  }
};
(function(e, n) {
  var r = Yn, a = n && !n.nodeType && n, l = a && !0 && e && !e.nodeType && e, o = l && l.exports === a, c = o ? r.Buffer : void 0, f = c ? c.allocUnsafe : void 0;
  function h(p, g) {
    if (g)
      return p.slice();
    var w = p.length, M = f ? f(w) : new p.constructor(w);
    return p.copy(M), M;
  }
  e.exports = h;
})(RT, ba);
var _d = Dh;
function FT(e) {
  var n = new e.constructor(e.byteLength);
  return new _d(n).set(new _d(e)), n;
}
var NT = FT, WT = NT;
function BT(e, n) {
  var r = n ? WT(e.buffer) : e.buffer;
  return new e.constructor(r, e.byteOffset, e.length);
}
var UT = BT;
function HT(e, n) {
  var r = -1, a = e.length;
  for (n || (n = Array(a)); ++r < a; )
    n[r] = e[r];
  return n;
}
var zT = HT, qT = tr, bd = Object.create, KT = /* @__PURE__ */ function() {
  function e() {
  }
  return function(n) {
    if (!qT(n))
      return {};
    if (bd)
      return bd(n);
    e.prototype = n;
    var r = new e();
    return e.prototype = void 0, r;
  };
}(), VT = KT, GT = Ch, jT = GT(Object.getPrototypeOf, Object), Fh = jT, ZT = VT, XT = Fh, JT = Yl;
function QT(e) {
  return typeof e.constructor == "function" && !JT(e) ? ZT(XT(e)) : {};
}
var eP = QT, tP = gs, nP = Cn;
function rP(e) {
  return nP(e) && tP(e);
}
var iP = rP, sP = Rn, aP = Fh, oP = Cn, lP = "[object Object]", uP = Function.prototype, cP = Object.prototype, Nh = uP.toString, fP = cP.hasOwnProperty, dP = Nh.call(Object);
function hP(e) {
  if (!oP(e) || sP(e) != lP)
    return !1;
  var n = aP(e);
  if (n === null)
    return !0;
  var r = fP.call(n, "constructor") && n.constructor;
  return typeof r == "function" && r instanceof r && Nh.call(r) == dP;
}
var vP = hP;
function pP(e, n) {
  if (!(n === "constructor" && typeof e[n] == "function") && n != "__proto__")
    return e[n];
}
var Wh = pP, mP = WA, gP = Na;
function yP(e, n, r, a) {
  var l = !r;
  r || (r = {});
  for (var o = -1, c = n.length; ++o < c; ) {
    var f = n[o], h = a ? a(r[f], e[f], f, r, e) : void 0;
    h === void 0 && (h = e[f]), l ? gP(r, f, h) : mP(r, f, h);
  }
  return r;
}
var _P = yP, bP = _P, wP = Bl;
function DP(e) {
  return bP(e, wP(e));
}
var $P = DP, wd = Rh, CP = ba, SP = UT, MP = zT, OP = eP, Dd = Pl, $d = $n, xP = iP, AP = bi, TP = Hr, PP = tr, kP = vP, IP = Ll, Cd = Wh, EP = $P;
function LP(e, n, r, a, l, o, c) {
  var f = Cd(e, r), h = Cd(n, r), p = c.get(h);
  if (p) {
    wd(e, r, p);
    return;
  }
  var g = o ? o(f, h, r + "", e, n, c) : void 0, w = g === void 0;
  if (w) {
    var M = $d(h), S = !M && AP(h), k = !M && !S && IP(h);
    g = h, M || S || k ? $d(f) ? g = f : xP(f) ? g = MP(f) : S ? (w = !1, g = CP(h, !0)) : k ? (w = !1, g = SP(h, !0)) : g = [] : kP(h) || Dd(h) ? (g = f, Dd(f) ? g = EP(f) : (!PP(f) || TP(f)) && (g = OP(h))) : w = !1;
  }
  w && (c.set(h, g), l(g, h, a, o, c), c.delete(h)), wd(e, r, g);
}
var YP = LP, RP = El, FP = Rh, NP = kh, WP = YP, BP = tr, UP = Bl, HP = Wh;
function Bh(e, n, r, a, l) {
  e !== n && NP(n, function(o, c) {
    if (l || (l = new RP()), BP(o))
      WP(e, n, c, r, Bh, a, l);
    else {
      var f = a ? a(HP(e, c), o, c + "", e, n, l) : void 0;
      f === void 0 && (f = o), FP(e, c, f);
    }
  }, UP);
}
var Uh = Bh, zP = Uh, Sd = tr;
function Hh(e, n, r, a, l, o) {
  return Sd(e) && Sd(n) && (o.set(n, e), zP(e, n, void 0, Hh, o), o.delete(n)), e;
}
var qP = Hh, KP = Wl, VP = Nl;
function GP(e) {
  return KP(function(n, r) {
    var a = -1, l = r.length, o = l > 1 ? r[l - 1] : void 0, c = l > 2 ? r[2] : void 0;
    for (o = e.length > 3 && typeof o == "function" ? (l--, o) : void 0, c && VP(r[0], r[1], c) && (o = l < 3 ? void 0 : o, l = 1), n = Object(n); ++a < l; ) {
      var f = r[a];
      f && e(n, f, a, o);
    }
    return n;
  });
}
var jP = GP, ZP = Uh, XP = jP, JP = XP(function(e, n, r, a) {
  ZP(e, n, r, a);
}), QP = JP, ek = Lh, tk = Wl, nk = qP, rk = QP, ik = tk(function(e) {
  return e.push(void 0, nk), ek(rk, void 0, e);
}), cs = ik;
function sk(e) {
  return e && e.length ? e[0] : void 0;
}
var zh = sk;
function ak(e) {
  var n = e == null ? 0 : e.length;
  return n ? e[n - 1] : void 0;
}
var ci = ak;
const ok = (e) => Object.prototype.toString.call(e).slice(8, -1), di = (e) => hC(e) && !isNaN(e.getTime()), Qn = (e) => ok(e) === "Object", qh = yh, Md = (e, n) => DA(n, (r) => yh(e, r)), Re = (e, n, r = "0") => {
  for (e = e != null ? String(e) : "", n = n || 2; e.length < n; )
    e = `${r}${e}`;
  return e;
}, hn = (e) => Array.isArray(e), Zn = (e) => hn(e) && e.length > 0, wa = (e) => e == null ? null : document && Pn(e) ? document.querySelector(e) : e.$el ?? e, _r = (e, n, r, a = void 0) => {
  e.removeEventListener(n, r, a);
}, br = (e, n, r, a = void 0) => (e.addEventListener(n, r, a), () => _r(e, n, r, a)), va = (e, n) => !!e && !!n && (e === n || e.contains(n)), fa = (e, n) => {
  (e.key === " " || e.key === "Enter") && (n(e), e.preventDefault());
}, Kh = (e, ...n) => {
  const r = {};
  let a;
  for (a in e)
    n.includes(a) || (r[a] = e[a]);
  return r;
}, Vh = (e, n) => {
  const r = {};
  return n.forEach((a) => {
    a in e && (r[a] = e[a]);
  }), r;
};
function lk(e, n, r) {
  return Math.min(Math.max(e, n), r);
}
var Da = {}, uk = {
  get exports() {
    return Da;
  },
  set exports(e) {
    Da = e;
  }
};
(function(e, n) {
  Object.defineProperty(n, "__esModule", {
    value: !0
  }), n.default = r;
  function r(a) {
    if (a === null || a === !0 || a === !1)
      return NaN;
    var l = Number(a);
    return isNaN(l) ? l : l < 0 ? Math.ceil(l) : Math.floor(l);
  }
  e.exports = n.default;
})(uk, Da);
const ck = /* @__PURE__ */ uh(Da);
var $a = {}, fk = {
  get exports() {
    return $a;
  },
  set exports(e) {
    $a = e;
  }
};
(function(e, n) {
  Object.defineProperty(n, "__esModule", {
    value: !0
  }), n.default = r;
  function r(a) {
    var l = new Date(Date.UTC(a.getFullYear(), a.getMonth(), a.getDate(), a.getHours(), a.getMinutes(), a.getSeconds(), a.getMilliseconds()));
    return l.setUTCFullYear(a.getFullYear()), a.getTime() - l.getTime();
  }
  e.exports = n.default;
})(fk, $a);
const Od = /* @__PURE__ */ uh($a);
function dk(e, n) {
  var r = mk(n);
  return r.formatToParts ? vk(r, e) : pk(r, e);
}
var hk = {
  year: 0,
  month: 1,
  day: 2,
  hour: 3,
  minute: 4,
  second: 5
};
function vk(e, n) {
  try {
    for (var r = e.formatToParts(n), a = [], l = 0; l < r.length; l++) {
      var o = hk[r[l].type];
      o >= 0 && (a[o] = parseInt(r[l].value, 10));
    }
    return a;
  } catch (c) {
    if (c instanceof RangeError)
      return [NaN];
    throw c;
  }
}
function pk(e, n) {
  var r = e.format(n).replace(/\u200E/g, ""), a = /(\d+)\/(\d+)\/(\d+),? (\d+):(\d+):(\d+)/.exec(r);
  return [a[3], a[1], a[2], a[4], a[5], a[6]];
}
var el = {};
function mk(e) {
  if (!el[e]) {
    var n = new Intl.DateTimeFormat("en-US", {
      hour12: !1,
      timeZone: "America/New_York",
      year: "numeric",
      month: "numeric",
      day: "2-digit",
      hour: "2-digit",
      minute: "2-digit",
      second: "2-digit"
    }).format(/* @__PURE__ */ new Date("2014-06-25T04:00:00.123Z")), r = n === "06/25/2014, 00:00:00" || n === "‎06‎/‎25‎/‎2014‎ ‎00‎:‎00‎:‎00";
    el[e] = r ? new Intl.DateTimeFormat("en-US", {
      hour12: !1,
      timeZone: e,
      year: "numeric",
      month: "numeric",
      day: "2-digit",
      hour: "2-digit",
      minute: "2-digit",
      second: "2-digit"
    }) : new Intl.DateTimeFormat("en-US", {
      hourCycle: "h23",
      timeZone: e,
      year: "numeric",
      month: "numeric",
      day: "2-digit",
      hour: "2-digit",
      minute: "2-digit",
      second: "2-digit"
    });
  }
  return el[e];
}
function Gh(e, n, r, a, l, o, c) {
  var f = /* @__PURE__ */ new Date(0);
  return f.setUTCFullYear(e, n, r), f.setUTCHours(a, l, o, c), f;
}
var xd = 36e5, gk = 6e4, tl = {
  timezone: /([Z+-].*)$/,
  timezoneZ: /^(Z)$/,
  timezoneHH: /^([+-]\d{2})$/,
  timezoneHHMM: /^([+-]\d{2}):?(\d{2})$/
};
function yk(e, n, r) {
  var a, l;
  if (!e || (a = tl.timezoneZ.exec(e), a))
    return 0;
  var o;
  if (a = tl.timezoneHH.exec(e), a)
    return o = parseInt(a[1], 10), Ad(o) ? -(o * xd) : NaN;
  if (a = tl.timezoneHHMM.exec(e), a) {
    o = parseInt(a[1], 10);
    var c = parseInt(a[2], 10);
    return Ad(o, c) ? (l = Math.abs(o) * xd + c * gk, o > 0 ? -l : l) : NaN;
  }
  if (wk(e)) {
    n = new Date(n || Date.now());
    var f = r ? n : _k(n), h = hl(f, e), p = r ? h : bk(n, h, e);
    return -p;
  }
  return NaN;
}
function _k(e) {
  return Gh(
    e.getFullYear(),
    e.getMonth(),
    e.getDate(),
    e.getHours(),
    e.getMinutes(),
    e.getSeconds(),
    e.getMilliseconds()
  );
}
function hl(e, n) {
  var r = dk(e, n), a = Gh(
    r[0],
    r[1] - 1,
    r[2],
    r[3] % 24,
    r[4],
    r[5],
    0
  ).getTime(), l = e.getTime(), o = l % 1e3;
  return l -= o >= 0 ? o : 1e3 + o, a - l;
}
function bk(e, n, r) {
  var a = e.getTime(), l = a - n, o = hl(new Date(l), r);
  if (n === o)
    return n;
  l -= o - n;
  var c = hl(new Date(l), r);
  return o === c ? o : Math.max(o, c);
}
function Ad(e, n) {
  return -23 <= e && e <= 23 && (n == null || 0 <= n && n <= 59);
}
var Td = {};
function wk(e) {
  if (Td[e])
    return !0;
  try {
    return new Intl.DateTimeFormat(void 0, { timeZone: e }), Td[e] = !0, !0;
  } catch {
    return !1;
  }
}
var Dk = /(Z|[+-]\d{2}(?::?\d{2})?| UTC| [a-zA-Z]+\/[a-zA-Z_]+(?:\/[a-zA-Z_]+)?)$/;
const $k = Dk;
var nl = 36e5, Pd = 6e4, Ck = 2, kt = {
  dateTimePattern: /^([0-9W+-]+)(T| )(.*)/,
  datePattern: /^([0-9W+-]+)(.*)/,
  plainTime: /:/,
  // year tokens
  YY: /^(\d{2})$/,
  YYY: [
    /^([+-]\d{2})$/,
    // 0 additional digits
    /^([+-]\d{3})$/,
    // 1 additional digit
    /^([+-]\d{4})$/
    // 2 additional digits
  ],
  YYYY: /^(\d{4})/,
  YYYYY: [
    /^([+-]\d{4})/,
    // 0 additional digits
    /^([+-]\d{5})/,
    // 1 additional digit
    /^([+-]\d{6})/
    // 2 additional digits
  ],
  // date tokens
  MM: /^-(\d{2})$/,
  DDD: /^-?(\d{3})$/,
  MMDD: /^-?(\d{2})-?(\d{2})$/,
  Www: /^-?W(\d{2})$/,
  WwwD: /^-?W(\d{2})-?(\d{1})$/,
  HH: /^(\d{2}([.,]\d*)?)$/,
  HHMM: /^(\d{2}):?(\d{2}([.,]\d*)?)$/,
  HHMMSS: /^(\d{2}):?(\d{2}):?(\d{2}([.,]\d*)?)$/,
  // time zone tokens (to identify the presence of a tz)
  timeZone: $k
};
function Sk(e, n) {
  if (arguments.length < 1)
    throw new TypeError("1 argument required, but only " + arguments.length + " present");
  if (e === null)
    return /* @__PURE__ */ new Date(NaN);
  var r = n || {}, a = r.additionalDigits == null ? Ck : ck(r.additionalDigits);
  if (a !== 2 && a !== 1 && a !== 0)
    throw new RangeError("additionalDigits must be 0, 1 or 2");
  if (e instanceof Date || typeof e == "object" && Object.prototype.toString.call(e) === "[object Date]")
    return new Date(e.getTime());
  if (typeof e == "number" || Object.prototype.toString.call(e) === "[object Number]")
    return new Date(e);
  if (!(typeof e == "string" || Object.prototype.toString.call(e) === "[object String]"))
    return /* @__PURE__ */ new Date(NaN);
  var l = Mk(e), o = Ok(l.date, a), c = o.year, f = o.restDateString, h = xk(f, c);
  if (isNaN(h))
    return /* @__PURE__ */ new Date(NaN);
  if (h) {
    var p = h.getTime(), g = 0, w;
    if (l.time && (g = Ak(l.time), isNaN(g)))
      return /* @__PURE__ */ new Date(NaN);
    if (l.timeZone || r.timeZone) {
      if (w = yk(l.timeZone || r.timeZone, new Date(p + g)), isNaN(w))
        return /* @__PURE__ */ new Date(NaN);
    } else
      w = Od(new Date(p + g)), w = Od(new Date(p + g + w));
    return new Date(p + g + w);
  } else
    return /* @__PURE__ */ new Date(NaN);
}
function Mk(e) {
  var n = {}, r = kt.dateTimePattern.exec(e), a;
  if (r ? (n.date = r[1], a = r[3]) : (r = kt.datePattern.exec(e), r ? (n.date = r[1], a = r[2]) : (n.date = null, a = e)), a) {
    var l = kt.timeZone.exec(a);
    l ? (n.time = a.replace(l[1], ""), n.timeZone = l[1].trim()) : n.time = a;
  }
  return n;
}
function Ok(e, n) {
  var r = kt.YYY[n], a = kt.YYYYY[n], l;
  if (l = kt.YYYY.exec(e) || a.exec(e), l) {
    var o = l[1];
    return {
      year: parseInt(o, 10),
      restDateString: e.slice(o.length)
    };
  }
  if (l = kt.YY.exec(e) || r.exec(e), l) {
    var c = l[1];
    return {
      year: parseInt(c, 10) * 100,
      restDateString: e.slice(c.length)
    };
  }
  return {
    year: null
  };
}
function xk(e, n) {
  if (n === null)
    return null;
  var r, a, l, o;
  if (e.length === 0)
    return a = /* @__PURE__ */ new Date(0), a.setUTCFullYear(n), a;
  if (r = kt.MM.exec(e), r)
    return a = /* @__PURE__ */ new Date(0), l = parseInt(r[1], 10) - 1, Id(n, l) ? (a.setUTCFullYear(n, l), a) : /* @__PURE__ */ new Date(NaN);
  if (r = kt.DDD.exec(e), r) {
    a = /* @__PURE__ */ new Date(0);
    var c = parseInt(r[1], 10);
    return kk(n, c) ? (a.setUTCFullYear(n, 0, c), a) : /* @__PURE__ */ new Date(NaN);
  }
  if (r = kt.MMDD.exec(e), r) {
    a = /* @__PURE__ */ new Date(0), l = parseInt(r[1], 10) - 1;
    var f = parseInt(r[2], 10);
    return Id(n, l, f) ? (a.setUTCFullYear(n, l, f), a) : /* @__PURE__ */ new Date(NaN);
  }
  if (r = kt.Www.exec(e), r)
    return o = parseInt(r[1], 10) - 1, Ed(n, o) ? kd(n, o) : /* @__PURE__ */ new Date(NaN);
  if (r = kt.WwwD.exec(e), r) {
    o = parseInt(r[1], 10) - 1;
    var h = parseInt(r[2], 10) - 1;
    return Ed(n, o, h) ? kd(n, o, h) : /* @__PURE__ */ new Date(NaN);
  }
  return null;
}
function Ak(e) {
  var n, r, a;
  if (n = kt.HH.exec(e), n)
    return r = parseFloat(n[1].replace(",", ".")), rl(r) ? r % 24 * nl : NaN;
  if (n = kt.HHMM.exec(e), n)
    return r = parseInt(n[1], 10), a = parseFloat(n[2].replace(",", ".")), rl(r, a) ? r % 24 * nl + a * Pd : NaN;
  if (n = kt.HHMMSS.exec(e), n) {
    r = parseInt(n[1], 10), a = parseInt(n[2], 10);
    var l = parseFloat(n[3].replace(",", "."));
    return rl(r, a, l) ? r % 24 * nl + a * Pd + l * 1e3 : NaN;
  }
  return null;
}
function kd(e, n, r) {
  n = n || 0, r = r || 0;
  var a = /* @__PURE__ */ new Date(0);
  a.setUTCFullYear(e, 0, 4);
  var l = a.getUTCDay() || 7, o = n * 7 + r + 1 - l;
  return a.setUTCDate(a.getUTCDate() + o), a;
}
var Tk = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], Pk = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
function jh(e) {
  return e % 400 === 0 || e % 4 === 0 && e % 100 !== 0;
}
function Id(e, n, r) {
  if (n < 0 || n > 11)
    return !1;
  if (r != null) {
    if (r < 1)
      return !1;
    var a = jh(e);
    if (a && r > Pk[n] || !a && r > Tk[n])
      return !1;
  }
  return !0;
}
function kk(e, n) {
  if (n < 1)
    return !1;
  var r = jh(e);
  return !(r && n > 366 || !r && n > 365);
}
function Ed(e, n, r) {
  return !(n < 0 || n > 52 || r != null && (r < 0 || r > 6));
}
function rl(e, n, r) {
  return !(e != null && (e < 0 || e >= 25) || n != null && (n < 0 || n >= 60) || r != null && (r < 0 || r >= 60));
}
function Ct(e, n) {
  if (n.length < e)
    throw new TypeError(e + " argument" + (e > 1 ? "s" : "") + " required, but only " + n.length + " present");
}
function pa(e) {
  "@babel/helpers - typeof";
  return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? pa = function(r) {
    return typeof r;
  } : pa = function(r) {
    return r && typeof Symbol == "function" && r.constructor === Symbol && r !== Symbol.prototype ? "symbol" : typeof r;
  }, pa(e);
}
function nr(e) {
  Ct(1, arguments);
  var n = Object.prototype.toString.call(e);
  return e instanceof Date || pa(e) === "object" && n === "[object Date]" ? new Date(e.getTime()) : typeof e == "number" || n === "[object Number]" ? new Date(e) : ((typeof e == "string" || n === "[object String]") && typeof console < "u" && (console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#string-arguments"), console.warn(new Error().stack)), /* @__PURE__ */ new Date(NaN));
}
function xi(e) {
  if (e === null || e === !0 || e === !1)
    return NaN;
  var n = Number(e);
  return isNaN(n) ? n : n < 0 ? Math.ceil(n) : Math.floor(n);
}
var Ik = {};
function Ul() {
  return Ik;
}
function Ur(e, n) {
  var r, a, l, o, c, f, h, p;
  Ct(1, arguments);
  var g = Ul(), w = xi((r = (a = (l = (o = n == null ? void 0 : n.weekStartsOn) !== null && o !== void 0 ? o : n == null || (c = n.locale) === null || c === void 0 || (f = c.options) === null || f === void 0 ? void 0 : f.weekStartsOn) !== null && l !== void 0 ? l : g.weekStartsOn) !== null && a !== void 0 ? a : (h = g.locale) === null || h === void 0 || (p = h.options) === null || p === void 0 ? void 0 : p.weekStartsOn) !== null && r !== void 0 ? r : 0);
  if (!(w >= 0 && w <= 6))
    throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");
  var M = nr(e), S = M.getDay(), k = (S < w ? 7 : 0) + S - w;
  return M.setDate(M.getDate() - k), M.setHours(0, 0, 0, 0), M;
}
function Ld(e) {
  var n = new Date(Date.UTC(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()));
  return n.setUTCFullYear(e.getFullYear()), e.getTime() - n.getTime();
}
var Ek = 6048e5;
function Lk(e, n, r) {
  Ct(2, arguments);
  var a = Ur(e, r), l = Ur(n, r), o = a.getTime() - Ld(a), c = l.getTime() - Ld(l);
  return Math.round((o - c) / Ek);
}
function Yk(e) {
  Ct(1, arguments);
  var n = nr(e), r = n.getMonth();
  return n.setFullYear(n.getFullYear(), r + 1, 0), n.setHours(0, 0, 0, 0), n;
}
function Rk(e) {
  Ct(1, arguments);
  var n = nr(e);
  return n.setDate(1), n.setHours(0, 0, 0, 0), n;
}
function Fk(e, n) {
  return Ct(1, arguments), Lk(Yk(e), Rk(e), n) + 1;
}
function Nk(e, n) {
  var r, a, l, o, c, f, h, p;
  Ct(1, arguments);
  var g = nr(e), w = g.getFullYear(), M = Ul(), S = xi((r = (a = (l = (o = n == null ? void 0 : n.firstWeekContainsDate) !== null && o !== void 0 ? o : n == null || (c = n.locale) === null || c === void 0 || (f = c.options) === null || f === void 0 ? void 0 : f.firstWeekContainsDate) !== null && l !== void 0 ? l : M.firstWeekContainsDate) !== null && a !== void 0 ? a : (h = M.locale) === null || h === void 0 || (p = h.options) === null || p === void 0 ? void 0 : p.firstWeekContainsDate) !== null && r !== void 0 ? r : 1);
  if (!(S >= 1 && S <= 7))
    throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");
  var k = /* @__PURE__ */ new Date(0);
  k.setFullYear(w + 1, 0, S), k.setHours(0, 0, 0, 0);
  var U = Ur(k, n), R = /* @__PURE__ */ new Date(0);
  R.setFullYear(w, 0, S), R.setHours(0, 0, 0, 0);
  var P = Ur(R, n);
  return g.getTime() >= U.getTime() ? w + 1 : g.getTime() >= P.getTime() ? w : w - 1;
}
function Wk(e, n) {
  var r, a, l, o, c, f, h, p;
  Ct(1, arguments);
  var g = Ul(), w = xi((r = (a = (l = (o = n == null ? void 0 : n.firstWeekContainsDate) !== null && o !== void 0 ? o : n == null || (c = n.locale) === null || c === void 0 || (f = c.options) === null || f === void 0 ? void 0 : f.firstWeekContainsDate) !== null && l !== void 0 ? l : g.firstWeekContainsDate) !== null && a !== void 0 ? a : (h = g.locale) === null || h === void 0 || (p = h.options) === null || p === void 0 ? void 0 : p.firstWeekContainsDate) !== null && r !== void 0 ? r : 1), M = Nk(e, n), S = /* @__PURE__ */ new Date(0);
  S.setFullYear(M, 0, w), S.setHours(0, 0, 0, 0);
  var k = Ur(S, n);
  return k;
}
var Bk = 6048e5;
function Uk(e, n) {
  Ct(1, arguments);
  var r = nr(e), a = Ur(r, n).getTime() - Wk(r, n).getTime();
  return Math.round(a / Bk) + 1;
}
function Ca(e) {
  return Ct(1, arguments), Ur(e, {
    weekStartsOn: 1
  });
}
function Hk(e) {
  Ct(1, arguments);
  var n = nr(e), r = n.getFullYear(), a = /* @__PURE__ */ new Date(0);
  a.setFullYear(r + 1, 0, 4), a.setHours(0, 0, 0, 0);
  var l = Ca(a), o = /* @__PURE__ */ new Date(0);
  o.setFullYear(r, 0, 4), o.setHours(0, 0, 0, 0);
  var c = Ca(o);
  return n.getTime() >= l.getTime() ? r + 1 : n.getTime() >= c.getTime() ? r : r - 1;
}
function zk(e) {
  Ct(1, arguments);
  var n = Hk(e), r = /* @__PURE__ */ new Date(0);
  r.setFullYear(n, 0, 4), r.setHours(0, 0, 0, 0);
  var a = Ca(r);
  return a;
}
var qk = 6048e5;
function Kk(e) {
  Ct(1, arguments);
  var n = nr(e), r = Ca(n).getTime() - zk(n).getTime();
  return Math.round(r / qk) + 1;
}
function Pt(e, n) {
  Ct(2, arguments);
  var r = nr(e), a = xi(n);
  return isNaN(a) ? /* @__PURE__ */ new Date(NaN) : (a && r.setDate(r.getDate() + a), r);
}
function Sa(e, n) {
  Ct(2, arguments);
  var r = nr(e), a = xi(n);
  if (isNaN(a))
    return /* @__PURE__ */ new Date(NaN);
  if (!a)
    return r;
  var l = r.getDate(), o = new Date(r.getTime());
  o.setMonth(r.getMonth() + a + 1, 0);
  var c = o.getDate();
  return l >= c ? o : (r.setFullYear(o.getFullYear(), o.getMonth(), l), r);
}
function Yd(e, n) {
  Ct(2, arguments);
  var r = xi(n);
  return Sa(e, r * 12);
}
const Vk = {
  daily: ["year", "month", "day"],
  weekly: ["year", "month", "week"],
  monthly: ["year", "month"]
};
function Gk({
  monthComps: e,
  prevMonthComps: n,
  nextMonthComps: r
}, a) {
  const l = [], {
    firstDayOfWeek: o,
    firstWeekday: c,
    isoWeeknumbers: f,
    weeknumbers: h,
    numDays: p,
    numWeeks: g
  } = e, w = c + (c < o ? $t : 0) - o;
  let M = !0, S = !1, k = !1, U = 0;
  const R = new Intl.DateTimeFormat(a.id, {
    weekday: "long",
    year: "numeric",
    month: "short",
    day: "numeric"
  });
  let P = n.numDays - w + 1, J = n.numDays - P + 1, Q = Math.floor((P - 1) / $t + 1), H = 1, z = n.numWeeks, te = 1, V = n.month, ne = n.year;
  const me = /* @__PURE__ */ new Date(), we = me.getDate(), $e = me.getMonth() + 1, Z = me.getFullYear();
  for (let fe = 1; fe <= WI; fe++) {
    for (let Ae = 1, ae = o; Ae <= $t; Ae++, ae += ae === $t ? 1 - $t : 1) {
      M && ae === c && (P = 1, J = e.numDays, Q = Math.floor((P - 1) / $t + 1), H = Math.floor((p - P) / $t + 1), z = 1, te = g, V = e.month, ne = e.year, M = !1, S = !0);
      const xe = a.getDateFromParams(ne, V, P, 0, 0, 0, 0), Me = a.getDateFromParams(ne, V, P, 12, 0, 0, 0), Ye = a.getDateFromParams(
        ne,
        V,
        P,
        23,
        59,
        59,
        999
      ), Ue = xe, B = `${Re(ne, 4)}-${Re(V, 2)}-${Re(P, 2)}`, he = Ae, re = $t - Ae, Je = h[fe - 1], Pe = f[fe - 1], Ne = P === we && V === $e && ne === Z, Qe = S && P === 1, et = S && P === p, je = fe === 1, ot = fe === g, mn = Ae === 1, _t = Ae === $t, ft = ov(ne, V, P);
      l.push({
        locale: a,
        id: B,
        position: ++U,
        label: P.toString(),
        ariaLabel: R.format(new Date(ne, V - 1, P)),
        day: P,
        dayFromEnd: J,
        weekday: ae,
        weekdayPosition: he,
        weekdayPositionFromEnd: re,
        weekdayOrdinal: Q,
        weekdayOrdinalFromEnd: H,
        week: z,
        weekFromEnd: te,
        weekPosition: fe,
        weeknumber: Je,
        isoWeeknumber: Pe,
        month: V,
        year: ne,
        date: Ue,
        startDate: xe,
        endDate: Ye,
        noonDate: Me,
        dayIndex: ft,
        isToday: Ne,
        isFirstDay: Qe,
        isLastDay: et,
        isDisabled: !S,
        isFocusable: !S,
        isFocused: !1,
        inMonth: S,
        inPrevMonth: M,
        inNextMonth: k,
        onTop: je,
        onBottom: ot,
        onLeft: mn,
        onRight: _t,
        classes: [
          `id-${B}`,
          `day-${P}`,
          `day-from-end-${J}`,
          `weekday-${ae}`,
          `weekday-position-${he}`,
          `weekday-ordinal-${Q}`,
          `weekday-ordinal-from-end-${H}`,
          `week-${z}`,
          `week-from-end-${te}`,
          {
            "is-today": Ne,
            "is-first-day": Qe,
            "is-last-day": et,
            "in-month": S,
            "in-prev-month": M,
            "in-next-month": k,
            "on-top": je,
            "on-bottom": ot,
            "on-left": mn,
            "on-right": _t
          }
        ]
      }), S && et ? (S = !1, k = !0, P = 1, J = p, Q = 1, H = Math.floor((p - P) / $t + 1), z = 1, te = r.numWeeks, V = r.month, ne = r.year) : (P++, J--, Q = Math.floor((P - 1) / $t + 1), H = Math.floor((p - P) / $t + 1));
    }
    z++, te--;
  }
  return l;
}
function jk(e, n, r, a) {
  const l = e.reduce((o, c, f) => {
    const h = Math.floor(f / 7);
    let p = o[h];
    return p || (p = {
      id: `week-${h + 1}`,
      title: "",
      week: c.week,
      weekPosition: c.weekPosition,
      weeknumber: c.weeknumber,
      isoWeeknumber: c.isoWeeknumber,
      weeknumberDisplay: n ? c.weeknumber : r ? c.isoWeeknumber : void 0,
      days: []
    }, o[h] = p), p.days.push(c), o;
  }, Array(e.length / $t));
  return l.forEach((o) => {
    const c = o.days[0], f = o.days[o.days.length - 1];
    c.month === f.month ? o.title = `${a.formatDate(c.date, "MMMM YYYY")}` : c.year === f.year ? o.title = `${a.formatDate(
      c.date,
      "MMM"
    )} - ${a.formatDate(f.date, "MMM YYYY")}` : o.title = `${a.formatDate(
      c.date,
      "MMM YYYY"
    )} - ${a.formatDate(f.date, "MMM YYYY")}`;
  }), l;
}
function Zk(e, n) {
  return e.days.map((r) => ({
    label: n.formatDate(r.date, n.masks.weekdays),
    weekday: r.weekday
  }));
}
function Xk(e, n) {
  return `${n}.${Re(e, 2)}`;
}
function Zh(e, n, r) {
  return Vh(
    r.getDateParts(r.toDate(e)),
    Vk[n]
  );
}
function Xh({ day: e, week: n, month: r, year: a }, l, o, c) {
  if (o === "daily" && e) {
    const f = new Date(a, r - 1, e), h = Pt(f, l);
    return {
      day: h.getDate(),
      month: h.getMonth() + 1,
      year: h.getFullYear()
    };
  } else if (o === "weekly" && n) {
    const h = c.getMonthParts(r, a).firstDayOfMonth, p = Pt(h, (n - 1 + l) * 7), g = c.getDateParts(p);
    return {
      week: g.week,
      month: g.month,
      year: g.year
    };
  } else {
    const f = new Date(a, r - 1, 1), h = Sa(f, l);
    return {
      month: h.getMonth() + 1,
      year: h.getFullYear()
    };
  }
}
function kn(e) {
  return e != null && e.month != null && e.year != null;
}
function vl(e, n) {
  return !kn(e) || !kn(n) ? !1 : (e = e, n = n, e.year !== n.year ? e.year < n.year : e.month && n.month && e.month !== n.month ? e.month < n.month : e.week && n.week && e.week !== n.week ? e.week < n.week : e.day && n.day && e.day !== n.day ? e.day < n.day : !1);
}
function Ma(e, n) {
  return !kn(e) || !kn(n) ? !1 : (e = e, n = n, e.year !== n.year ? e.year > n.year : e.month && n.month && e.month !== n.month ? e.month > n.month : e.week && n.week && e.week !== n.week ? e.week > n.week : e.day && n.day && e.day !== n.day ? e.day > n.day : !1);
}
function Jk(e, n, r) {
  return (e || !1) && !vl(e, n) && !Ma(e, r);
}
function Qk(e, n) {
  return !e && n || e && !n ? !1 : !e && !n ? !0 : (e = e, n = n, e.year === n.year && e.month === n.month && e.week === n.week && e.day === n.day);
}
function eI(e, n, r, a) {
  if (!kn(e) || !kn(n))
    return [];
  const l = [];
  for (; !Ma(e, n); )
    l.push(e), e = Xh(e, 1, r, a);
  return l;
}
function Jh(e) {
  const { day: n, week: r, month: a, year: l } = e;
  let o = `${l}-${Re(a, 2)}`;
  return r && (o = `${o}-w${r}`), n && (o = `${o}-${Re(n, 2)}`), o;
}
function tI(e, n) {
  const { month: r, year: a, showWeeknumbers: l, showIsoWeeknumbers: o } = e, c = new Date(a, r - 1, 15), f = n.getMonthParts(r, a), h = n.getPrevMonthParts(r, a), p = n.getNextMonthParts(r, a), g = Gk({ monthComps: f, prevMonthComps: h, nextMonthComps: p }, n), w = jk(g, l, o, n), M = Zk(w[0], n);
  return {
    id: Jh(e),
    month: r,
    year: a,
    monthTitle: n.formatDate(c, n.masks.title),
    shortMonthLabel: n.formatDate(c, "MMM"),
    monthLabel: n.formatDate(c, "MMMM"),
    shortYearLabel: a.toString().substring(2),
    yearLabel: a.toString(),
    monthComps: f,
    prevMonthComps: h,
    nextMonthComps: p,
    days: g,
    weeks: w,
    weekdays: M
  };
}
function nI(e, n) {
  const { day: r, week: a, view: l, trimWeeks: o } = e, c = {
    ...n,
    ...e,
    title: "",
    viewDays: [],
    viewWeeks: []
  };
  switch (l) {
    case "daily": {
      let f = c.days.find((p) => p.inMonth);
      r ? f = c.days.find((p) => p.day === r && p.inMonth) || f : a && (f = c.days.find((p) => p.week === a && p.inMonth));
      const h = c.weeks[f.week - 1];
      c.viewWeeks = [h], c.viewDays = [f], c.week = f.week, c.weekTitle = h.title, c.day = f.day, c.dayTitle = f.ariaLabel, c.title = c.dayTitle;
      break;
    }
    case "weekly": {
      c.week = a || 1;
      const f = c.weeks[c.week - 1];
      c.viewWeeks = [f], c.viewDays = f.days, c.weekTitle = f.title, c.title = c.weekTitle;
      break;
    }
    default: {
      c.title = c.monthTitle, c.viewWeeks = c.weeks.slice(
        0,
        o ? c.monthComps.numWeeks : void 0
      ), c.viewDays = c.days;
      break;
    }
  }
  return c;
}
class Rd {
  constructor(n, r, a) {
    ie(this, "keys", []), ie(this, "store", {}), this.size = n, this.createKey = r, this.createItem = a;
  }
  get(...n) {
    const r = this.createKey(...n);
    return this.store[r];
  }
  getOrSet(...n) {
    const r = this.createKey(...n);
    if (this.store[r])
      return this.store[r];
    const a = this.createItem(...n);
    if (this.keys.length >= this.size) {
      const l = this.keys.shift();
      l != null && delete this.store[l];
    }
    return this.keys.push(r), this.store[r] = a, a;
  }
}
class hi {
  constructor(n, r = new Oa()) {
    ie(this, "order"), ie(this, "locale"), ie(this, "start", null), ie(this, "end", null), ie(this, "repeat", null);
    var a;
    this.locale = r;
    const { start: l, end: o, span: c, order: f, repeat: h } = n;
    di(l) && (this.start = r.getDateParts(l)), di(o) ? this.end = r.getDateParts(o) : this.start != null && c && (this.end = r.getDateParts(Pt(this.start.date, c - 1))), this.order = f ?? 0, h && (this.repeat = new xa(
      {
        from: (a = this.start) == null ? void 0 : a.date,
        ...h
      },
      {
        locale: this.locale
      }
    ));
  }
  static fromMany(n, r) {
    return (hn(n) ? n : [n]).filter((a) => a).map((a) => hi.from(a, r));
  }
  static from(n, r) {
    if (n instanceof hi)
      return n;
    const a = {
      start: null,
      end: null
    };
    return n != null && (hn(n) ? (a.start = n[0] ?? null, a.end = n[1] ?? null) : Qn(n) ? Object.assign(a, n) : (a.start = n, a.end = n)), a.start != null && (a.start = new Date(a.start)), a.end != null && (a.end = new Date(a.end)), new hi(a, r);
  }
  get opts() {
    const { order: n, locale: r } = this;
    return { order: n, locale: r };
  }
  get hasRepeat() {
    return !!this.repeat;
  }
  get isSingleDay() {
    const { start: n, end: r } = this;
    return n && r && n.year === r.year && n.month === r.month && n.day === r.day;
  }
  get isMultiDay() {
    return !this.isSingleDay;
  }
  get daySpan() {
    return this.start == null || this.end == null ? this.hasRepeat ? 1 : 1 / 0 : this.end.dayIndex - this.start.dayIndex;
  }
  startsOnDay(n) {
    var r, a;
    return ((r = this.start) == null ? void 0 : r.dayIndex) === n.dayIndex || !!((a = this.repeat) != null && a.passes(n));
  }
  intersectsDay(n) {
    return this.intersectsDayRange(n, n);
  }
  intersectsRange(n) {
    var r, a;
    return this.intersectsDayRange(
      ((r = n.start) == null ? void 0 : r.dayIndex) ?? -1 / 0,
      ((a = n.end) == null ? void 0 : a.dayIndex) ?? 1 / 0
    );
  }
  intersectsDayRange(n, r) {
    return !(this.start && this.start.dayIndex > r || this.end && this.end.dayIndex < n);
  }
}
class rI {
  constructor() {
    ie(this, "records", {});
  }
  render(n, r, a) {
    var l, o, c, f;
    let h = null;
    const p = a[0].dayIndex, g = a[a.length - 1].dayIndex;
    return r.hasRepeat ? a.forEach((w) => {
      var M, S;
      if (r.startsOnDay(w)) {
        const k = r.daySpan < 1 / 0 ? r.daySpan : 1;
        h = {
          startDay: w.dayIndex,
          startTime: ((M = r.start) == null ? void 0 : M.time) ?? 0,
          endDay: w.dayIndex + k - 1,
          endTime: ((S = r.end) == null ? void 0 : S.time) ?? ma
        }, this.getRangeRecords(n).push(h);
      }
    }) : r.intersectsDayRange(p, g) && (h = {
      startDay: ((l = r.start) == null ? void 0 : l.dayIndex) ?? -1 / 0,
      startTime: ((o = r.start) == null ? void 0 : o.time) ?? -1 / 0,
      endDay: ((c = r.end) == null ? void 0 : c.dayIndex) ?? 1 / 0,
      endTime: ((f = r.end) == null ? void 0 : f.time) ?? 1 / 0
    }, this.getRangeRecords(n).push(h)), h;
  }
  getRangeRecords(n) {
    let r = this.records[n.key];
    return r || (r = {
      ranges: [],
      data: n
    }, this.records[n.key] = r), r.ranges;
  }
  getCell(n, r) {
    return this.getCells(r).find((o) => o.data.key === n);
  }
  cellExists(n, r) {
    const a = this.records[n];
    return a == null ? !1 : a.ranges.some(
      (l) => l.startDay <= r && l.endDay >= r
    );
  }
  getCells(n) {
    const r = Object.values(this.records), a = [], { dayIndex: l } = n;
    return r.forEach(({ data: o, ranges: c }) => {
      c.filter((f) => f.startDay <= l && f.endDay >= l).forEach((f) => {
        const h = l === f.startDay, p = l === f.endDay, g = h ? f.startTime : 0, w = new Date(n.startDate.getTime() + g), M = p ? f.endTime : ma, S = new Date(n.endDate.getTime() + M), k = g === 0 && M === ma, U = o.order || 0;
        a.push({
          ...f,
          data: o,
          onStart: h,
          onEnd: p,
          startTime: g,
          startDate: w,
          endTime: M,
          endDate: S,
          allDay: k,
          order: U
        });
      });
    }), a.sort((o, c) => o.order - c.order), a;
  }
}
const er = {
  // Arabic
  ar: { dow: 7, L: "D/‏M/‏YYYY" },
  // Bulgarian
  bg: { dow: 2, L: "D.MM.YYYY" },
  // Catalan
  ca: { dow: 2, L: "DD/MM/YYYY" },
  // Chinese (China)
  "zh-CN": { dow: 2, L: "YYYY/MM/DD" },
  // Chinese (Taiwan)
  "zh-TW": { dow: 1, L: "YYYY/MM/DD" },
  // Croatian
  hr: { dow: 2, L: "DD.MM.YYYY" },
  // Czech
  cs: { dow: 2, L: "DD.MM.YYYY" },
  // Danish
  da: { dow: 2, L: "DD.MM.YYYY" },
  // Dutch
  nl: { dow: 2, L: "DD-MM-YYYY" },
  // English (US)
  "en-US": { dow: 1, L: "MM/DD/YYYY" },
  // English (Australia)
  "en-AU": { dow: 2, L: "DD/MM/YYYY" },
  // English (Canada)
  "en-CA": { dow: 1, L: "YYYY-MM-DD" },
  // English (Great Britain)
  "en-GB": { dow: 2, L: "DD/MM/YYYY" },
  // English (Ireland)
  "en-IE": { dow: 2, L: "DD-MM-YYYY" },
  // English (New Zealand)
  "en-NZ": { dow: 2, L: "DD/MM/YYYY" },
  // English (South Africa)
  "en-ZA": { dow: 1, L: "YYYY/MM/DD" },
  // Esperanto
  eo: { dow: 2, L: "YYYY-MM-DD" },
  // Estonian
  et: { dow: 2, L: "DD.MM.YYYY" },
  // Finnish
  fi: { dow: 2, L: "DD.MM.YYYY" },
  // French
  fr: { dow: 2, L: "DD/MM/YYYY" },
  // French (Canada)
  "fr-CA": { dow: 1, L: "YYYY-MM-DD" },
  // French (Switzerland)
  "fr-CH": { dow: 2, L: "DD.MM.YYYY" },
  // German
  de: { dow: 2, L: "DD.MM.YYYY" },
  // Hebrew
  he: { dow: 1, L: "DD.MM.YYYY" },
  // Indonesian
  id: { dow: 2, L: "DD/MM/YYYY" },
  // Italian
  it: { dow: 2, L: "DD/MM/YYYY" },
  // Japanese
  ja: { dow: 1, L: "YYYY年M月D日" },
  // Korean
  ko: { dow: 1, L: "YYYY.MM.DD" },
  // Latvian
  lv: { dow: 2, L: "DD.MM.YYYY" },
  // Lithuanian
  lt: { dow: 2, L: "DD.MM.YYYY" },
  // Macedonian
  mk: { dow: 2, L: "D.MM.YYYY" },
  // Norwegian
  nb: { dow: 2, L: "D. MMMM YYYY" },
  nn: { dow: 2, L: "D. MMMM YYYY" },
  // Polish
  pl: { dow: 2, L: "DD.MM.YYYY" },
  // Portuguese
  pt: { dow: 2, L: "DD/MM/YYYY" },
  // Romanian
  ro: { dow: 2, L: "DD.MM.YYYY" },
  // Russian
  ru: { dow: 2, L: "DD.MM.YYYY" },
  // Slovak
  sk: { dow: 2, L: "DD.MM.YYYY" },
  // Spanish (Spain)
  "es-ES": { dow: 2, L: "DD/MM/YYYY" },
  // Spanish (Mexico)
  "es-MX": { dow: 2, L: "DD/MM/YYYY" },
  // Swedish
  sv: { dow: 2, L: "YYYY-MM-DD" },
  // Thai
  th: { dow: 1, L: "DD/MM/YYYY" },
  // Turkish
  tr: { dow: 2, L: "DD.MM.YYYY" },
  // Ukrainian
  uk: { dow: 2, L: "DD.MM.YYYY" },
  // Vietnam
  vi: { dow: 2, L: "DD/MM/YYYY" }
};
er.en = er["en-US"];
er.es = er["es-ES"];
er.no = er.nb;
er.zh = er["zh-CN"];
const iI = Object.entries(er).reduce(
  (e, [n, { dow: r, L: a }]) => (e[n] = {
    id: n,
    firstDayOfWeek: r,
    masks: { L: a }
  }, e),
  {}
), sI = "MMMM YYYY", aI = "W", oI = "MMM", lI = "h A", uI = [
  "L",
  "YYYY-MM-DD",
  "YYYY/MM/DD"
], cI = [
  "L h:mm A",
  "YYYY-MM-DD h:mm A",
  "YYYY/MM/DD h:mm A"
], fI = [
  "L HH:mm",
  "YYYY-MM-DD HH:mm",
  "YYYY/MM/DD HH:mm"
], dI = [
  "h:mm A"
], hI = [
  "HH:mm"
], vI = "WWW, MMM D, YYYY", pI = [
  "L",
  "YYYY-MM-DD",
  "YYYY/MM/DD"
], mI = "iso", gI = "YYYY-MM-DDTHH:mm:ss.SSSZ", yI = {
  title: sI,
  weekdays: aI,
  navMonths: oI,
  hours: lI,
  input: uI,
  inputDateTime: cI,
  inputDateTime24hr: fI,
  inputTime: dI,
  inputTime24hr: hI,
  dayPopover: vI,
  data: pI,
  model: mI,
  iso: gI
}, _I = 300, bI = 60, wI = 80, DI = {
  maxSwipeTime: _I,
  minHorizontalSwipeDistance: bI,
  maxVerticalSwipeDistance: wI
}, $I = {
  componentPrefix: "V",
  color: "blue",
  isDark: !1,
  navVisibility: "click",
  titlePosition: "center",
  transition: "slide-h",
  touch: DI,
  masks: yI,
  locales: iI,
  datePicker: {
    updateOnInput: !0,
    inputDebounce: 1e3,
    popover: {
      visibility: "hover-focus",
      placement: "bottom-start",
      isInteractive: !0
    }
  }
}, pl = Ta($I), CI = E(() => qA(pl.locales, (e) => (e.masks = cs(e.masks, pl.masks), e))), Dr = (e) => typeof window < "u" && qh(window.__vcalendar__, e) ? Nr(window.__vcalendar__, e) : Nr(pl, e), SI = 12, MI = 5;
function OI(e, n) {
  const r = new Intl.DateTimeFormat().resolvedOptions().locale;
  let a;
  Pn(e) ? a = e : qh(e, "id") && (a = e.id), a = (a || r).toLowerCase();
  const l = Object.keys(n), o = (h) => l.find((p) => p.toLowerCase() === h);
  a = o(a) || o(a.substring(0, 2)) || r;
  const c = {
    ...n["en-IE"],
    ...n[a],
    id: a,
    monthCacheSize: SI,
    pageCacheSize: MI
  };
  return Qn(e) ? cs(e, c) : c;
}
class Oa {
  constructor(n = void 0, r) {
    ie(this, "id"), ie(this, "daysInWeek"), ie(this, "firstDayOfWeek"), ie(this, "masks"), ie(this, "timezone"), ie(this, "hourLabels"), ie(this, "dayNames"), ie(this, "dayNamesShort"), ie(this, "dayNamesShorter"), ie(this, "dayNamesNarrow"), ie(this, "monthNames"), ie(this, "monthNamesShort"), ie(this, "relativeTimeNames"), ie(this, "amPm", ["am", "pm"]), ie(this, "monthCache"), ie(this, "pageCache");
    const { id: a, firstDayOfWeek: l, masks: o, monthCacheSize: c, pageCacheSize: f } = OI(n, CI.value);
    this.monthCache = new Rd(
      c,
      jI,
      ZI
    ), this.pageCache = new Rd(f, Jh, tI), this.id = a, this.daysInWeek = $t, this.firstDayOfWeek = lk(l, 1, $t), this.masks = o, this.timezone = r || void 0, this.hourLabels = this.getHourLabels(), this.dayNames = il("long", this.id), this.dayNamesShort = il("short", this.id), this.dayNamesShorter = this.dayNamesShort.map((h) => h.substring(0, 2)), this.dayNamesNarrow = il("narrow", this.id), this.monthNames = Hd("long", this.id), this.monthNamesShort = Hd("short", this.id), this.relativeTimeNames = QI(this.id);
  }
  formatDate(n, r) {
    return iE(n, r, this);
  }
  parseDate(n, r) {
    return zd(n, r, this);
  }
  toDate(n, r = {}) {
    const a = /* @__PURE__ */ new Date(NaN);
    let l = a;
    const { fillDate: o, mask: c, patch: f, rules: h } = r;
    if (Dn(n) ? (r.type = "number", l = /* @__PURE__ */ new Date(+n)) : Pn(n) ? (r.type = "string", l = n ? zd(n, c || "iso", this) : a) : di(n) ? (r.type = "date", l = new Date(n.getTime())) : Hl(n) && (r.type = "object", l = this.getDateFromParts(n)), l && (f || h)) {
      let p = this.getDateParts(l);
      if (f && o != null) {
        const g = this.getDateParts(this.toDate(o));
        p = this.getDateParts(
          this.toDate({ ...g, ...Vh(p, NI[f]) })
        );
      }
      h && (p = rE(p, h)), l = this.getDateFromParts(p);
    }
    return l || a;
  }
  toDateOrNull(n, r = {}) {
    const a = this.toDate(n, r);
    return isNaN(a.getTime()) ? null : a;
  }
  fromDate(n, { type: r, mask: a } = {}) {
    switch (r) {
      case "number":
        return n ? n.getTime() : NaN;
      case "string":
        return n ? this.formatDate(n, a || "iso") : "";
      case "object":
        return n ? this.getDateParts(n) : null;
      default:
        return n ? new Date(n) : null;
    }
  }
  range(n) {
    return hi.from(n, this);
  }
  ranges(n) {
    return hi.fromMany(n, this);
  }
  getDateParts(n) {
    return GI(n, this);
  }
  getDateFromParts(n) {
    return uv(n, this.timezone);
  }
  getDateFromParams(n, r, a, l, o, c, f) {
    return this.getDateFromParts({
      year: n,
      month: r,
      day: a,
      hours: l,
      minutes: o,
      seconds: c,
      milliseconds: f
    });
  }
  getPage(n) {
    const r = this.pageCache.getOrSet(n, this);
    return nI(n, r);
  }
  getMonthParts(n, r) {
    const { firstDayOfWeek: a } = this;
    return this.monthCache.getOrSet(n, r, a);
  }
  getThisMonthParts() {
    const n = /* @__PURE__ */ new Date();
    return this.getMonthParts(
      n.getMonth() + 1,
      n.getFullYear()
    );
  }
  getPrevMonthParts(n, r) {
    return n === 1 ? this.getMonthParts(12, r - 1) : this.getMonthParts(n - 1, r);
  }
  getNextMonthParts(n, r) {
    return n === 12 ? this.getMonthParts(1, r + 1) : this.getMonthParts(n + 1, r);
  }
  getHourLabels() {
    return JI().map((n) => this.formatDate(n, this.masks.hours));
  }
  getDayId(n) {
    return this.formatDate(n, "YYYY-MM-DD");
  }
}
var ui = /* @__PURE__ */ ((e) => (e.Any = "any", e.All = "all", e))(ui || {}), Qh = /* @__PURE__ */ ((e) => (e.Days = "days", e.Weeks = "weeks", e.Months = "months", e.Years = "years", e))(Qh || {}), ev = /* @__PURE__ */ ((e) => (e.Days = "days", e.Weekdays = "weekdays", e.Weeks = "weeks", e.Months = "months", e.Years = "years", e))(ev || {}), tv = /* @__PURE__ */ ((e) => (e.OrdinalWeekdays = "ordinalWeekdays", e))(tv || {});
class xI {
  constructor(n, r, a) {
    ie(this, "validated", !0), this.type = n, this.interval = r, this.from = a, this.from || (console.error(
      'A valid "from" date is required for date interval rule. This rule will be skipped.'
    ), this.validated = !1);
  }
  passes(n) {
    if (!this.validated)
      return !0;
    const { date: r } = n;
    switch (this.type) {
      case "days":
        return zl(this.from.date, r) % this.interval === 0;
      case "weeks":
        return KI(this.from.date, r) % this.interval === 0;
      case "months":
        return VI(this.from.date, r) % this.interval === 0;
      case "years":
        return lv(this.from.date, r) % this.interval === 0;
      default:
        return !1;
    }
  }
}
class Ai {
  constructor(n, r, a, l) {
    ie(this, "components", []), this.type = n, this.validator = a, this.getter = l, this.components = this.normalizeComponents(r);
  }
  static create(n, r) {
    switch (n) {
      case "days":
        return new AI(r);
      case "weekdays":
        return new TI(r);
      case "weeks":
        return new PI(r);
      case "months":
        return new kI(r);
      case "years":
        return new II(r);
    }
  }
  normalizeComponents(n) {
    if (this.validator(n))
      return [n];
    if (!hn(n))
      return [];
    const r = [];
    return n.forEach((a) => {
      if (!this.validator(a)) {
        console.error(
          `Component value ${a} in invalid for "${this.type}" rule. This rule will be skipped.`
        );
        return;
      }
      r.push(a);
    }), r;
  }
  passes(n) {
    return this.getter(n).some((l) => this.components.includes(l));
  }
}
class AI extends Ai {
  constructor(n) {
    super(
      "days",
      n,
      YI,
      ({ day: r, dayFromEnd: a }) => [r, -a]
    );
  }
}
class TI extends Ai {
  constructor(n) {
    super(
      "weekdays",
      n,
      ml,
      ({ weekday: r }) => [r]
    );
  }
}
class PI extends Ai {
  constructor(n) {
    super(
      "weeks",
      n,
      RI,
      ({ week: r, weekFromEnd: a }) => [r, -a]
    );
  }
}
class kI extends Ai {
  constructor(n) {
    super("months", n, FI, ({ month: r }) => [
      r
    ]);
  }
}
class II extends Ai {
  constructor(n) {
    super("years", n, Dn, ({ year: r }) => [r]);
  }
}
class EI {
  constructor(n, r) {
    ie(this, "components"), this.type = n, this.components = this.normalizeComponents(r);
  }
  normalizeArrayConfig(n) {
    const r = [];
    return n.forEach((a, l) => {
      if (Dn(a)) {
        if (l === 0)
          return;
        if (!Fd(n[0])) {
          console.error(
            `Ordinal range for "${this.type}" rule is from -5 to -1 or 1 to 5. This rule will be skipped.`
          );
          return;
        }
        if (!ml(a)) {
          console.error(
            `Acceptable range for "${this.type}" rule is from 1 to 5. This rule will be skipped`
          );
          return;
        }
        r.push([n[0], a]);
      } else
        hn(a) && r.push(...this.normalizeArrayConfig(a));
    }), r;
  }
  normalizeComponents(n) {
    const r = [];
    return n.forEach((a, l) => {
      if (Dn(a)) {
        if (l === 0)
          return;
        if (!Fd(n[0])) {
          console.error(
            `Ordinal range for "${this.type}" rule is from -5 to -1 or 1 to 5. This rule will be skipped.`
          );
          return;
        }
        if (!ml(a)) {
          console.error(
            `Acceptable range for "${this.type}" rule is from 1 to 5. This rule will be skipped`
          );
          return;
        }
        r.push([n[0], a]);
      } else
        hn(a) && r.push(...this.normalizeArrayConfig(a));
    }), r;
  }
  passes(n) {
    const { weekday: r, weekdayOrdinal: a, weekdayOrdinalFromEnd: l } = n;
    return this.components.some(
      ([o, c]) => (o === a || o === -l) && r === c
    );
  }
}
class LI {
  constructor(n) {
    ie(this, "type", "function"), ie(this, "validated", !0), this.fn = n, Hr(n) || (console.error(
      "The function rule requires a valid function. This rule will be skipped."
    ), this.validated = !1);
  }
  passes(n) {
    return this.validated ? this.fn(n) : !0;
  }
}
class xa {
  constructor(n, r = {}, a) {
    ie(this, "validated", !0), ie(this, "config"), ie(this, "type", ui.Any), ie(this, "from"), ie(this, "until"), ie(this, "rules", []), ie(this, "locale", new Oa()), this.parent = a, r.locale && (this.locale = r.locale), this.config = n, Hr(n) ? (this.type = ui.All, this.rules = [new LI(n)]) : hn(n) ? (this.type = ui.Any, this.rules = n.map((l) => new xa(l, r, this))) : Qn(n) ? (this.type = ui.All, this.from = n.from ? this.locale.getDateParts(n.from) : a == null ? void 0 : a.from, this.until = n.until ? this.locale.getDateParts(n.until) : a == null ? void 0 : a.until, this.rules = this.getObjectRules(n)) : (console.error("Rule group configuration must be an object or an array."), this.validated = !1);
  }
  getObjectRules(n) {
    const r = [];
    if (n.every && (Pn(n.every) && (n.every = [1, `${n.every}s`]), hn(n.every))) {
      const [a = 1, l = Qh.Days] = n.every;
      r.push(new xI(l, a, this.from));
    }
    return Object.values(ev).forEach((a) => {
      a in n && r.push(Ai.create(a, n[a]));
    }), Object.values(tv).forEach((a) => {
      a in n && r.push(new EI(a, n[a]));
    }), n.on != null && (hn(n.on) || (n.on = [n.on]), r.push(
      new xa(n.on, { locale: this.locale }, this.parent)
    )), r;
  }
  passes(n) {
    return this.validated ? this.from && n.dayIndex <= this.from.dayIndex || this.until && n.dayIndex >= this.until.dayIndex ? !1 : this.type === ui.Any ? this.rules.some((r) => r.passes(n)) : this.rules.every((r) => r.passes(n)) : !0;
  }
}
function YI(e) {
  return Dn(e) ? e >= 1 && e <= 31 : !1;
}
function ml(e) {
  return Dn(e) ? e >= 1 && e <= 7 : !1;
}
function RI(e) {
  return Dn(e) ? e >= -6 && e <= -1 || e >= 1 && e <= 6 : !1;
}
function FI(e) {
  return Dn(e) ? e >= 1 && e <= 12 : !1;
}
function Fd(e) {
  return !(!Dn(e) || e < -5 || e > 5 || e === 0);
}
const NI = {
  dateTime: [
    "year",
    "month",
    "day",
    "hours",
    "minutes",
    "seconds",
    "milliseconds"
  ],
  date: ["year", "month", "day"],
  time: ["hours", "minutes", "seconds", "milliseconds"]
}, $t = 7, WI = 6, nv = 1e3, rv = nv * 60, iv = rv * 60, ma = iv * 24, BI = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31], UI = ["L", "iso"], ts = {
  milliseconds: [0, 999, 3],
  seconds: [0, 59, 2],
  minutes: [0, 59, 2],
  hours: [0, 23, 2]
}, sv = /d{1,2}|W{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|Z{1,4}|([HhMsDm])\1?|[aA]|"[^"]*"|'[^']*'/g, HI = /\[([^]*?)\]/gm, Nd = {
  D(e) {
    return e.day;
  },
  DD(e) {
    return Re(e.day, 2);
  },
  // Do(d: DateParts, l: Locale) {
  //   return l.DoFn(d.day);
  // },
  d(e) {
    return e.weekday - 1;
  },
  dd(e) {
    return Re(e.weekday - 1, 2);
  },
  W(e, n) {
    return n.dayNamesNarrow[e.weekday - 1];
  },
  WW(e, n) {
    return n.dayNamesShorter[e.weekday - 1];
  },
  WWW(e, n) {
    return n.dayNamesShort[e.weekday - 1];
  },
  WWWW(e, n) {
    return n.dayNames[e.weekday - 1];
  },
  M(e) {
    return e.month;
  },
  MM(e) {
    return Re(e.month, 2);
  },
  MMM(e, n) {
    return n.monthNamesShort[e.month - 1];
  },
  MMMM(e, n) {
    return n.monthNames[e.month - 1];
  },
  YY(e) {
    return String(e.year).substr(2);
  },
  YYYY(e) {
    return Re(e.year, 4);
  },
  h(e) {
    return e.hours % 12 || 12;
  },
  hh(e) {
    return Re(e.hours % 12 || 12, 2);
  },
  H(e) {
    return e.hours;
  },
  HH(e) {
    return Re(e.hours, 2);
  },
  m(e) {
    return e.minutes;
  },
  mm(e) {
    return Re(e.minutes, 2);
  },
  s(e) {
    return e.seconds;
  },
  ss(e) {
    return Re(e.seconds, 2);
  },
  S(e) {
    return Math.round(e.milliseconds / 100);
  },
  SS(e) {
    return Re(Math.round(e.milliseconds / 10), 2);
  },
  SSS(e) {
    return Re(e.milliseconds, 3);
  },
  a(e, n) {
    return e.hours < 12 ? n.amPm[0] : n.amPm[1];
  },
  A(e, n) {
    return e.hours < 12 ? n.amPm[0].toUpperCase() : n.amPm[1].toUpperCase();
  },
  Z() {
    return "Z";
  },
  ZZ(e) {
    const n = e.timezoneOffset;
    return `${n > 0 ? "-" : "+"}${Re(Math.floor(Math.abs(n) / 60), 2)}`;
  },
  ZZZ(e) {
    const n = e.timezoneOffset;
    return `${n > 0 ? "-" : "+"}${Re(
      Math.floor(Math.abs(n) / 60) * 100 + Math.abs(n) % 60,
      4
    )}`;
  },
  ZZZZ(e) {
    const n = e.timezoneOffset;
    return `${n > 0 ? "-" : "+"}${Re(Math.floor(Math.abs(n) / 60), 2)}:${Re(
      Math.abs(n) % 60,
      2
    )}`;
  }
}, yr = /\d\d?/, zI = /\d{3}/, qI = /\d{4}/, Zi = /[0-9]*['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]+|[\u0600-\u06FF/]+(\s*?[\u0600-\u06FF]+){1,2}/i, Wd = () => {
}, Bd = (e) => (n, r, a) => {
  const l = a[e].indexOf(
    r.charAt(0).toUpperCase() + r.substr(1).toLowerCase()
  );
  ~l && (n.month = l);
}, Be = {
  D: [
    yr,
    (e, n) => {
      e.day = n;
    }
  ],
  Do: [
    new RegExp(yr.source + Zi.source),
    (e, n) => {
      e.day = parseInt(n, 10);
    }
  ],
  d: [yr, Wd],
  W: [Zi, Wd],
  M: [
    yr,
    (e, n) => {
      e.month = n - 1;
    }
  ],
  MMM: [Zi, Bd("monthNamesShort")],
  MMMM: [Zi, Bd("monthNames")],
  YY: [
    yr,
    (e, n) => {
      const a = +(/* @__PURE__ */ new Date()).getFullYear().toString().substr(0, 2);
      e.year = +`${n > 68 ? a - 1 : a}${n}`;
    }
  ],
  YYYY: [
    qI,
    (e, n) => {
      e.year = n;
    }
  ],
  S: [
    /\d/,
    (e, n) => {
      e.milliseconds = n * 100;
    }
  ],
  SS: [
    /\d{2}/,
    (e, n) => {
      e.milliseconds = n * 10;
    }
  ],
  SSS: [
    zI,
    (e, n) => {
      e.milliseconds = n;
    }
  ],
  h: [
    yr,
    (e, n) => {
      e.hours = n;
    }
  ],
  m: [
    yr,
    (e, n) => {
      e.minutes = n;
    }
  ],
  s: [
    yr,
    (e, n) => {
      e.seconds = n;
    }
  ],
  a: [
    Zi,
    (e, n, r) => {
      const a = n.toLowerCase();
      a === r.amPm[0] ? e.isPm = !1 : a === r.amPm[1] && (e.isPm = !0);
    }
  ],
  Z: [
    /[^\s]*?[+-]\d\d:?\d\d|[^\s]*?Z?/,
    (e, n) => {
      n === "Z" && (n = "+00:00");
      const r = `${n}`.match(/([+-]|\d\d)/gi);
      if (r) {
        const a = +r[1] * 60 + parseInt(r[2], 10);
        e.timezoneOffset = r[0] === "+" ? a : -a;
      }
    }
  ]
};
Be.DD = Be.D;
Be.dd = Be.d;
Be.WWWW = Be.WWW = Be.WW = Be.W;
Be.MM = Be.M;
Be.mm = Be.m;
Be.hh = Be.H = Be.HH = Be.h;
Be.ss = Be.s;
Be.A = Be.a;
Be.ZZZZ = Be.ZZZ = Be.ZZ = Be.Z;
function av(e, n) {
  return (Zn(e) && e || [
    Pn(e) && e || "YYYY-MM-DD"
  ]).map(
    (r) => UI.reduce(
      (a, l) => a.replace(l, n.masks[l] || ""),
      r
    )
  );
}
function Hl(e) {
  return Qn(e) && "year" in e && "month" in e && "day" in e;
}
function Ud(e, n = 1) {
  const r = e.getDay() + 1, a = r >= n ? n - r : -(7 - (n - r));
  return Pt(e, a);
}
function ov(e, n, r) {
  const a = Date.UTC(e, n - 1, r);
  return zl(/* @__PURE__ */ new Date(0), new Date(a));
}
function zl(e, n) {
  return Math.round((n.getTime() - e.getTime()) / ma);
}
function KI(e, n) {
  return Math.ceil(zl(Ud(e), Ud(n)) / 7);
}
function lv(e, n) {
  return n.getUTCFullYear() - e.getUTCFullYear();
}
function VI(e, n) {
  return lv(e, n) * 12 + (n.getMonth() - e.getMonth());
}
function uv(e, n = "") {
  const r = /* @__PURE__ */ new Date(), {
    year: a = r.getFullYear(),
    month: l = r.getMonth() + 1,
    day: o = r.getDate(),
    hours: c = 0,
    minutes: f = 0,
    seconds: h = 0,
    milliseconds: p = 0
  } = e;
  if (n) {
    const g = `${Re(a, 4)}-${Re(l, 2)}-${Re(o, 2)}T${Re(
      c,
      2
    )}:${Re(f, 2)}:${Re(h, 2)}.${Re(p, 3)}`;
    return Sk(g, { timeZone: n });
  }
  return new Date(a, l - 1, o, c, f, h, p);
}
function GI(e, n) {
  let r = new Date(e.getTime());
  n.timezone && (r = new Date(
    e.toLocaleString("en-US", { timeZone: n.timezone })
  ), r.setMilliseconds(e.getMilliseconds()));
  const a = r.getMilliseconds(), l = r.getSeconds(), o = r.getMinutes(), c = r.getHours(), f = a + l * nv + o * rv + c * iv, h = r.getMonth() + 1, p = r.getFullYear(), g = n.getMonthParts(h, p), w = r.getDate(), M = g.numDays - w + 1, S = r.getDay() + 1, k = Math.floor((w - 1) / 7 + 1), U = Math.floor((g.numDays - w) / 7 + 1), R = Math.ceil(
    (w + Math.abs(g.firstWeekday - g.firstDayOfWeek)) / 7
  ), P = g.numWeeks - R + 1, J = g.weeknumbers[R], Q = ov(p, h, w);
  return {
    milliseconds: a,
    seconds: l,
    minutes: o,
    hours: c,
    time: f,
    day: w,
    dayFromEnd: M,
    weekday: S,
    weekdayOrdinal: k,
    weekdayOrdinalFromEnd: U,
    week: R,
    weekFromEnd: P,
    weeknumber: J,
    month: h,
    year: p,
    date: r,
    dateTime: r.getTime(),
    dayIndex: Q,
    timezoneOffset: 0,
    isValid: !0
  };
}
function jI(e, n, r) {
  return `${n}-${e}-${r}`;
}
function ZI(e, n, r) {
  const a = n % 4 === 0 && n % 100 !== 0 || n % 400 === 0, l = new Date(n, e - 1, 1), o = l.getDay() + 1, c = e === 2 && a ? 29 : BI[e - 1], f = r - 1, h = Fk(l, {
    weekStartsOn: f
  }), p = [], g = [];
  for (let w = 0; w < h; w++) {
    const M = Pt(l, w * 7);
    p.push(Uk(M, { weekStartsOn: f })), g.push(Kk(M));
  }
  return {
    firstDayOfWeek: r,
    firstDayOfMonth: l,
    inLeapYear: a,
    firstWeekday: o,
    numDays: c,
    numWeeks: h,
    month: e,
    year: n,
    weeknumbers: p,
    isoWeeknumbers: g
  };
}
function XI() {
  const e = [];
  for (let l = 0; l < $t; l++)
    e.push(
      uv({
        year: 2020,
        month: 1,
        day: 5 + l,
        hours: 12
      })
    );
  return e;
}
function il(e, n = void 0) {
  const r = new Intl.DateTimeFormat(n, {
    weekday: e
  });
  return XI().map((a) => r.format(a));
}
function JI() {
  const e = [];
  for (let n = 0; n <= 24; n++)
    e.push(new Date(2e3, 0, 1, n));
  return e;
}
function QI(e = void 0) {
  const n = [
    "second",
    "minute",
    "hour",
    "day",
    "week",
    "month",
    "quarter",
    "year"
  ], r = new Intl.RelativeTimeFormat(e);
  return n.reduce((a, l) => {
    const o = r.formatToParts(100, l);
    return a[l] = o[1].unit, a;
  }, {});
}
function cv() {
  const e = [];
  for (let n = 0; n < 12; n++)
    e.push(new Date(2e3, n, 15));
  return e;
}
function Hd(e, n = void 0) {
  const r = new Intl.DateTimeFormat(n, {
    month: e,
    timeZone: "UTC"
  });
  return cv().map((a) => r.format(a));
}
function eE(e, n, r) {
  return Dn(n) ? n === e : hn(n) ? n.includes(e) : Hr(n) ? n(e, r) : !(n.min != null && n.min > e || n.max != null && n.max < e || n.interval != null && e % n.interval !== 0);
}
function ns(e, n, r) {
  const a = [], [l, o, c] = n;
  for (let f = l; f <= o; f++)
    (r == null || eE(f, r, e)) && a.push({
      value: f,
      label: Re(f, c)
    });
  return a;
}
function tE(e, n) {
  return {
    milliseconds: ns(
      e,
      ts.milliseconds,
      n.milliseconds
    ),
    seconds: ns(e, ts.seconds, n.seconds),
    minutes: ns(e, ts.minutes, n.minutes),
    hours: ns(e, ts.hours, n.hours)
  };
}
function nE(e, n, r, a) {
  const o = ns(e, n, a).reduce((c, f) => {
    if (f.disabled)
      return c;
    if (isNaN(c))
      return f.value;
    const h = Math.abs(c - r);
    return Math.abs(f.value - r) < h ? f.value : c;
  }, NaN);
  return isNaN(o) ? r : o;
}
function rE(e, n) {
  const r = { ...e };
  return Object.entries(n).forEach(([a, l]) => {
    const o = ts[a], c = e[a];
    r[a] = nE(
      e,
      o,
      c,
      l
    );
  }), r;
}
function zd(e, n, r) {
  return av(n, r).map((l) => {
    if (typeof l != "string")
      throw new Error("Invalid mask");
    let o = e;
    if (o.length > 1e3)
      return !1;
    let c = !0;
    const f = {};
    if (l.replace(sv, (g) => {
      if (Be[g]) {
        const w = Be[g], M = o.search(w[0]);
        ~M ? o.replace(w[0], (S) => (w[1](f, S, r), o = o.substr(M + S.length), S)) : c = !1;
      }
      return Be[g] ? "" : g.slice(1, g.length - 1);
    }), !c)
      return !1;
    const h = /* @__PURE__ */ new Date();
    f.hours != null && (f.isPm === !0 && +f.hours != 12 ? f.hours = +f.hours + 12 : f.isPm === !1 && +f.hours == 12 && (f.hours = 0));
    let p;
    return f.timezoneOffset != null ? (f.minutes = +(f.minutes || 0) - +f.timezoneOffset, p = new Date(
      Date.UTC(
        f.year || h.getFullYear(),
        f.month || 0,
        f.day || 1,
        f.hours || 0,
        f.minutes || 0,
        f.seconds || 0,
        f.milliseconds || 0
      )
    )) : p = r.getDateFromParts({
      year: f.year || h.getFullYear(),
      month: (f.month || 0) + 1,
      day: f.day || 1,
      hours: f.hours || 0,
      minutes: f.minutes || 0,
      seconds: f.seconds || 0,
      milliseconds: f.milliseconds || 0
    }), p;
  }).find((l) => l) || new Date(e);
}
function iE(e, n, r) {
  if (e == null)
    return "";
  let a = av(n, r)[0];
  /Z$/.test(a) && (r.timezone = "utc");
  const l = [];
  a = a.replace(HI, (c, f) => (l.push(f), "??"));
  const o = r.getDateParts(e);
  return a = a.replace(
    sv,
    (c) => c in Nd ? Nd[c](o, r) : c.slice(1, c.length - 1)
  ), a.replace(/\?\?/g, () => l.shift());
}
let sE = 0;
class fv {
  constructor(n, r, a) {
    ie(this, "key", ""), ie(this, "hashcode", ""), ie(this, "highlight", null), ie(this, "content", null), ie(this, "dot", null), ie(this, "bar", null), ie(this, "event", null), ie(this, "popover", null), ie(this, "customData", null), ie(this, "ranges"), ie(this, "hasRanges", !1), ie(this, "order", 0), ie(this, "pinPage", !1), ie(this, "maxRepeatSpan", 0), ie(this, "locale");
    const { dates: l } = Object.assign(
      this,
      { hashcode: "", order: 0, pinPage: !1 },
      n
    );
    this.key || (this.key = ++sE), this.locale = a, r.normalizeGlyphs(this), this.ranges = a.ranges(l ?? []), this.hasRanges = !!Zn(this.ranges), this.maxRepeatSpan = this.ranges.filter((o) => o.hasRepeat).map((o) => o.daySpan).reduce((o, c) => Math.max(o, c), 0);
  }
  intersectsRange({ start: n, end: r }) {
    if (n == null || r == null)
      return !1;
    const a = this.ranges.filter((c) => !c.hasRepeat);
    for (const c of a)
      if (c.intersectsDayRange(n.dayIndex, r.dayIndex))
        return !0;
    const l = this.ranges.filter((c) => c.hasRepeat);
    if (!l.length)
      return !1;
    let o = n;
    for (this.maxRepeatSpan > 1 && (o = this.locale.getDateParts(Pt(o.date, -this.maxRepeatSpan))); o.dayIndex <= r.dayIndex; ) {
      for (const c of l)
        if (c.startsOnDay(o))
          return !0;
      o = this.locale.getDateParts(Pt(o.date, 1));
    }
    return !1;
  }
}
function gl(e) {
  document && document.dispatchEvent(
    new CustomEvent("show-popover", {
      detail: e
    })
  );
}
function fs(e) {
  document && document.dispatchEvent(
    new CustomEvent("hide-popover", {
      detail: e
    })
  );
}
function dv(e) {
  document && document.dispatchEvent(
    new CustomEvent("toggle-popover", {
      detail: e
    })
  );
}
function hv(e) {
  const { visibility: n } = e, r = n === "click", a = n === "hover", l = n === "hover-focus", o = n === "focus";
  e.autoHide = !r;
  let c = !1, f = !1;
  const h = (k) => {
    r && (dv({
      ...e,
      target: e.target || k.currentTarget
    }), k.stopPropagation());
  }, p = (k) => {
    c || (c = !0, (a || l) && gl({
      ...e,
      target: e.target || k.currentTarget
    }));
  }, g = () => {
    c && (c = !1, (a || l && !f) && fs(e));
  }, w = (k) => {
    f || (f = !0, (o || l) && gl({
      ...e,
      target: e.target || k.currentTarget
    }));
  }, M = (k) => {
    f && !va(k.currentTarget, k.relatedTarget) && (f = !1, (o || l && !c) && fs(e));
  }, S = {};
  switch (e.visibility) {
    case "click":
      S.click = h;
      break;
    case "hover":
      S.mousemove = p, S.mouseleave = g;
      break;
    case "focus":
      S.focusin = w, S.focusout = M;
      break;
    case "hover-focus":
      S.mousemove = p, S.mouseleave = g, S.focusin = w, S.focusout = M;
      break;
  }
  return S;
}
const qd = (e) => {
  const n = wa(e);
  if (n == null)
    return;
  const r = n.popoverHandlers;
  !r || !r.length || (r.forEach((a) => a()), delete n.popoverHandlers);
}, Kd = (e, n) => {
  const r = wa(e);
  if (r == null)
    return;
  const a = [], l = hv(n);
  Object.entries(l).forEach(([o, c]) => {
    a.push(br(r, o, c));
  }), r.popoverHandlers = a;
}, vv = {
  mounted(e, n) {
    const { value: r } = n;
    r && Kd(e, r);
  },
  updated(e, n) {
    const { oldValue: r, value: a } = n, l = r == null ? void 0 : r.visibility, o = a == null ? void 0 : a.visibility;
    l !== o && (l && (qd(e), o || fs(r)), o && Kd(e, a));
  },
  unmounted(e) {
    qd(e);
  }
}, aE = (e, n, {
  maxSwipeTime: r,
  minHorizontalSwipeDistance: a,
  maxVerticalSwipeDistance: l
}) => {
  if (!e || !e.addEventListener || !Hr(n))
    return null;
  let o = 0, c = 0, f = null, h = !1;
  function p(w) {
    const M = w.changedTouches[0];
    o = M.screenX, c = M.screenY, f = (/* @__PURE__ */ new Date()).getTime(), h = !0;
  }
  function g(w) {
    if (!h || !f)
      return;
    h = !1;
    const M = w.changedTouches[0], S = M.screenX - o, k = M.screenY - c;
    if ((/* @__PURE__ */ new Date()).getTime() - f < r && Math.abs(S) >= a && Math.abs(k) <= l) {
      const R = { toLeft: !1, toRight: !1 };
      S < 0 ? R.toLeft = !0 : R.toRight = !0, n(R);
    }
  }
  return br(e, "touchstart", p, { passive: !0 }), br(e, "touchend", g, { passive: !0 }), () => {
    _r(e, "touchstart", p), _r(e, "touchend", g);
  };
}, ga = {}, oE = (e, n = 10) => {
  ga[e] = Date.now() + n;
}, lE = (e, n) => {
  if (e in ga) {
    const r = ga[e];
    if (Date.now() < r)
      return;
    delete ga[e];
  }
  n();
};
function pv() {
  return typeof window < "u";
}
function uE(e) {
  return pv() && e in window;
}
function cE(e) {
  const n = Ge(!1), r = E(() => n.value ? "dark" : "light");
  let a, l;
  function o(S) {
    n.value = S.matches;
  }
  function c() {
    uE("matchMedia") && (a = window.matchMedia("(prefers-color-scheme: dark)"), a.addEventListener("change", o), n.value = a.matches);
  }
  function f() {
    const { selector: S = ":root", darkClass: k = "dark" } = e.value, U = document.querySelector(S);
    n.value = U.classList.contains(k);
  }
  function h(S) {
    const { selector: k = ":root", darkClass: U = "dark" } = S;
    if (pv() && k && U) {
      const R = document.querySelector(k);
      R && (l = new MutationObserver(f), l.observe(R, {
        attributes: !0,
        attributeFilter: ["class"]
      }), n.value = R.classList.contains(U));
    }
  }
  function p() {
    w();
    const S = typeof e.value;
    S === "string" && e.value.toLowerCase() === "system" ? c() : S === "object" ? h(e.value) : n.value = !!e.value;
  }
  const g = Tt(() => e.value, () => p(), {
    immediate: !0
  });
  function w() {
    a && (a.removeEventListener("change", o), a = void 0), l && (l.disconnect(), l = void 0);
  }
  function M() {
    w(), g();
  }
  return yl(() => M()), {
    isDark: n,
    displayMode: r,
    cleanup: M
  };
}
const fE = ["base", "start", "end", "startEnd"], dE = [
  "class",
  "wrapperClass",
  "contentClass",
  "style",
  "contentStyle",
  "color",
  "fillMode"
], hE = { base: {}, start: {}, end: {} };
function ql(e, n, r = hE) {
  let a = e, l = {};
  n === !0 || Pn(n) ? (a = Pn(n) ? n : a, l = { ...r }) : Qn(n) && (Md(n, fE) ? l = { ...n } : l = {
    base: { ...n },
    start: { ...n },
    end: { ...n }
  });
  const o = cs(
    l,
    { start: l.startEnd, end: l.startEnd },
    r
  );
  return Object.entries(o).forEach(([c, f]) => {
    let h = a;
    f === !0 || Pn(f) ? (h = Pn(f) ? f : h, o[c] = { color: h }) : Qn(f) && (Md(f, dE) ? o[c] = { ...f } : o[c] = {}), cs(o[c], { color: h });
  }), o;
}
class vE {
  constructor() {
    ie(this, "type", "highlight");
  }
  normalizeConfig(n, r) {
    return ql(n, r, {
      base: { fillMode: "light" },
      start: { fillMode: "solid" },
      end: { fillMode: "solid" }
    });
  }
  prepareRender(n) {
    n.highlights = [], n.content || (n.content = []);
  }
  render({ data: n, onStart: r, onEnd: a }, l) {
    const { key: o, highlight: c } = n;
    if (!c)
      return;
    const { highlights: f } = l, { base: h, start: p, end: g } = c;
    r && a ? f.push({
      ...p,
      key: o,
      wrapperClass: `vc-day-layer vc-day-box-center-center vc-attr vc-${p.color}`,
      class: [`vc-highlight vc-highlight-bg-${p.fillMode}`, p.class],
      contentClass: [
        `vc-attr vc-highlight-content-${p.fillMode} vc-${p.color}`,
        p.contentClass
      ]
    }) : r ? (f.push({
      ...h,
      key: `${o}-base`,
      wrapperClass: `vc-day-layer vc-day-box-right-center vc-attr vc-${h.color}`,
      class: [
        `vc-highlight vc-highlight-base-start vc-highlight-bg-${h.fillMode}`,
        h.class
      ]
    }), f.push({
      ...p,
      key: o,
      wrapperClass: `vc-day-layer vc-day-box-center-center vc-attr vc-${p.color}`,
      class: [`vc-highlight vc-highlight-bg-${p.fillMode}`, p.class],
      contentClass: [
        `vc-attr vc-highlight-content-${p.fillMode} vc-${p.color}`,
        p.contentClass
      ]
    })) : a ? (f.push({
      ...h,
      key: `${o}-base`,
      wrapperClass: `vc-day-layer vc-day-box-left-center vc-attr vc-${h.color}`,
      class: [
        `vc-highlight vc-highlight-base-end vc-highlight-bg-${h.fillMode}`,
        h.class
      ]
    }), f.push({
      ...g,
      key: o,
      wrapperClass: `vc-day-layer vc-day-box-center-center vc-attr vc-${g.color}`,
      class: [`vc-highlight vc-highlight-bg-${g.fillMode}`, g.class],
      contentClass: [
        `vc-attr vc-highlight-content-${g.fillMode} vc-${g.color}`,
        g.contentClass
      ]
    })) : f.push({
      ...h,
      key: `${o}-middle`,
      wrapperClass: `vc-day-layer vc-day-box-center-center vc-attr vc-${h.color}`,
      class: [
        `vc-highlight vc-highlight-base-middle vc-highlight-bg-${h.fillMode}`,
        h.class
      ],
      contentClass: [
        `vc-attr vc-highlight-content-${h.fillMode} vc-${h.color}`,
        h.contentClass
      ]
    });
  }
}
class Kl {
  constructor(n, r) {
    ie(this, "type", ""), ie(this, "collectionType", ""), this.type = n, this.collectionType = r;
  }
  normalizeConfig(n, r) {
    return ql(n, r);
  }
  prepareRender(n) {
    n[this.collectionType] = [];
  }
  render({ data: n, onStart: r, onEnd: a }, l) {
    const { key: o } = n, c = n[this.type];
    if (!o || !c)
      return;
    const f = l[this.collectionType], { base: h, start: p, end: g } = c;
    r ? f.push({
      ...p,
      key: o,
      class: [
        `vc-${this.type} vc-${this.type}-start vc-${p.color} vc-attr`,
        p.class
      ]
    }) : a ? f.push({
      ...g,
      key: o,
      class: [
        `vc-${this.type} vc-${this.type}-end vc-${g.color} vc-attr`,
        g.class
      ]
    }) : f.push({
      ...h,
      key: o,
      class: [
        `vc-${this.type} vc-${this.type}-base vc-${h.color} vc-attr`,
        h.class
      ]
    });
  }
}
class pE extends Kl {
  constructor() {
    super("content", "content");
  }
  normalizeConfig(n, r) {
    return ql("base", r);
  }
}
class mE extends Kl {
  constructor() {
    super("dot", "dots");
  }
}
class gE extends Kl {
  constructor() {
    super("bar", "bars");
  }
}
class yE {
  constructor(n) {
    ie(this, "color"), ie(this, "renderers", [
      new pE(),
      new vE(),
      new mE(),
      new gE()
    ]), this.color = n;
  }
  normalizeGlyphs(n) {
    this.renderers.forEach((r) => {
      const a = r.type;
      n[a] != null && (n[a] = r.normalizeConfig(this.color, n[a]));
    });
  }
  prepareRender(n = {}) {
    return this.renderers.forEach((r) => {
      r.prepareRender(n);
    }), n;
  }
  render(n, r) {
    this.renderers.forEach((a) => {
      a.render(n, r);
    });
  }
}
const mv = Symbol("__vc_base_context__"), gv = {
  color: {
    type: String,
    default: () => Dr("color")
  },
  isDark: {
    type: [Boolean, String, Object],
    default: () => Dr("isDark")
  },
  firstDayOfWeek: Number,
  masks: Object,
  locale: [String, Object],
  timezone: String,
  minDate: null,
  maxDate: null,
  disabledDates: null
};
function yv(e) {
  const n = E(() => e.color ?? ""), r = E(() => e.isDark ?? !1), { displayMode: a } = cE(r), l = E(() => new yE(n.value)), o = E(() => {
    if (e.locale instanceof Oa)
      return e.locale;
    const M = Qn(e.locale) ? e.locale : {
      id: e.locale,
      firstDayOfWeek: e.firstDayOfWeek,
      masks: e.masks
    };
    return new Oa(M, e.timezone);
  }), c = E(() => o.value.masks), f = E(() => e.minDate), h = E(() => e.maxDate), p = E(() => {
    const M = e.disabledDates ? [...e.disabledDates] : [];
    return f.value != null && M.push({
      start: null,
      end: Pt(o.value.toDate(f.value), -1)
    }), h.value != null && M.push({
      start: Pt(o.value.toDate(h.value), 1),
      end: null
    }), o.value.ranges(M);
  }), g = E(() => new fv(
    {
      key: "disabled",
      dates: p.value,
      order: 100
    },
    l.value,
    o.value
  )), w = {
    color: n,
    isDark: r,
    displayMode: a,
    theme: l,
    locale: o,
    masks: c,
    minDate: f,
    maxDate: h,
    disabledDates: p,
    disabledAttribute: g
  };
  return vs(mv, w), w;
}
function _E(e) {
  return hs(mv, () => yv(e), !0);
}
function _v(e) {
  return `__vc_slot_${e}__`;
}
function bv(e, n = {}) {
  Object.keys(e).forEach((r) => {
    vs(_v(n[r] ?? r), e[r]);
  });
}
function wv(e) {
  return hs(_v(e), null);
}
const bE = {
  ...gv,
  view: {
    type: String,
    default: "monthly",
    validator(e) {
      return ["daily", "weekly", "monthly"].includes(e);
    }
  },
  rows: {
    type: Number,
    default: 1
  },
  columns: {
    type: Number,
    default: 1
  },
  step: Number,
  titlePosition: {
    type: String,
    default: () => Dr("titlePosition")
  },
  navVisibility: {
    type: String,
    default: () => Dr("navVisibility")
  },
  showWeeknumbers: [Boolean, String],
  showIsoWeeknumbers: [Boolean, String],
  expanded: Boolean,
  borderless: Boolean,
  transparent: Boolean,
  initialPage: Object,
  initialPagePosition: { type: Number, default: 1 },
  minPage: Object,
  maxPage: Object,
  transition: String,
  attributes: Array,
  trimWeeks: Boolean,
  disablePageSwipe: Boolean
}, wE = [
  "dayclick",
  "daymouseenter",
  "daymouseleave",
  "dayfocusin",
  "dayfocusout",
  "daykeydown",
  "weeknumberclick",
  "transition-start",
  "transition-end",
  "did-move",
  "update:view",
  "update:pages"
], Dv = Symbol("__vc_calendar_context__");
function DE(e, { slots: n, emit: r }) {
  const a = Ge(null), l = Ge(null), o = Ge((/* @__PURE__ */ new Date()).getDate()), c = Ge(!1), f = Ge(Symbol()), h = Ge(Symbol()), p = Ge(e.view), g = Ge([]), w = Ge("");
  let M = null, S = null;
  bv(n);
  const {
    theme: k,
    color: U,
    displayMode: R,
    locale: P,
    masks: J,
    minDate: Q,
    maxDate: H,
    disabledAttribute: z,
    disabledDates: te
  } = _E(e), V = E(() => e.rows * e.columns), ne = E(() => e.step || V.value), me = E(() => zh(g.value) ?? null), we = E(() => ci(g.value) ?? null), $e = E(
    () => e.minPage || (Q.value ? re(Q.value) : null)
  ), Z = E(
    () => e.maxPage || (H.value ? re(H.value) : null)
  ), fe = E(() => e.navVisibility), Ae = E(() => !!e.showWeeknumbers), ae = E(() => !!e.showIsoWeeknumbers), xe = E(() => p.value === "monthly"), Me = E(() => p.value === "weekly"), Ye = E(() => p.value === "daily"), Ue = () => {
    c.value = !0, r("transition-start");
  }, B = () => {
    c.value = !1, r("transition-end"), M && (M.resolve(!0), M = null);
  }, he = (N, _, Y = p.value) => Xh(N, _, Y, P.value), re = (N) => Zh(N, p.value, P.value), Je = (N) => {
    !z.value || !ot.value || (N.isDisabled = ot.value.cellExists(
      z.value.key,
      N.dayIndex
    ));
  }, Pe = (N) => {
    N.isFocusable = N.inMonth && N.day === o.value;
  }, Ne = (N, _) => {
    for (const Y of N)
      for (const q of Y.days)
        if (_(q) === !1)
          return;
  }, Qe = E(
    () => g.value.reduce((N, _) => (N.push(..._.viewDays), N), [])
  ), et = E(() => {
    const N = [];
    return (e.attributes || []).forEach((_, Y) => {
      !_ || !_.dates || N.push(
        new fv(
          {
            ..._,
            order: _.order || 0
          },
          k.value,
          P.value
        )
      );
    }), z.value && N.push(z.value), N;
  }), je = E(() => Zn(et.value)), ot = E(() => {
    const N = new rI();
    return et.value.forEach((_) => {
      _.ranges.forEach((Y) => {
        N.render(_, Y, Qe.value);
      });
    }), N;
  }), mn = E(() => Qe.value.reduce((N, _) => (N[_.dayIndex] = { day: _, cells: [] }, N[_.dayIndex].cells.push(...ot.value.getCells(_)), N), {})), _t = (N, _) => {
    const Y = e.showWeeknumbers || e.showIsoWeeknumbers;
    return Y == null ? "" : OA(Y) ? Y ? "left" : "" : Y.startsWith("right") ? _ > 1 ? "right" : Y : N > 1 ? "left" : Y;
  }, ft = () => {
    var N, _;
    if (!je.value)
      return null;
    const Y = et.value.find((He) => He.pinPage) || et.value[0];
    if (!Y || !Y.hasRanges)
      return null;
    const [q] = Y.ranges, de = ((N = q.start) == null ? void 0 : N.date) || ((_ = q.end) == null ? void 0 : _.date);
    return de ? re(de) : null;
  }, St = () => {
    if (kn(me.value))
      return me.value;
    const N = ft();
    return kn(N) ? N : re(/* @__PURE__ */ new Date());
  }, st = (N, _ = {}) => {
    const { view: Y = p.value, position: q = 1, force: de } = _, He = q > 0 ? 1 - q : -(V.value + q);
    let vt = he(N, He, Y), Mt = he(vt, V.value - 1, Y);
    return de || (vl(vt, $e.value) ? vt = $e.value : Ma(Mt, Z.value) && (vt = he(Z.value, 1 - V.value)), Mt = he(vt, V.value - 1)), { fromPage: vt, toPage: Mt };
  }, Qt = (N, _, Y = "") => {
    if (Y === "none" || Y === "fade")
      return Y;
    if ((N == null ? void 0 : N.view) !== (_ == null ? void 0 : _.view))
      return "fade";
    const q = Ma(_, N), de = vl(_, N);
    return !q && !de ? "fade" : Y === "slide-v" ? de ? "slide-down" : "slide-up" : de ? "slide-right" : "slide-left";
  }, en = (N = {}) => new Promise((_, Y) => {
    const { position: q = 1, force: de = !1, transition: He } = N, vt = kn(N.page) ? N.page : St(), { fromPage: Mt } = st(vt, {
      position: q,
      force: de
    }), or = [];
    for (let lr = 0; lr < V.value; lr++) {
      const Kr = he(Mt, lr), bt = lr + 1, Ti = Math.ceil(bt / e.columns), Vr = e.rows - Ti + 1, Wn = bt % e.columns || e.columns, xr = e.columns - Wn + 1, Pi = _t(Wn, xr);
      or.push(
        P.value.getPage({
          ...Kr,
          view: p.value,
          titlePosition: e.titlePosition,
          trimWeeks: e.trimWeeks,
          position: bt,
          row: Ti,
          rowFromEnd: Vr,
          column: Wn,
          columnFromEnd: xr,
          showWeeknumbers: Ae.value,
          showIsoWeeknumbers: ae.value,
          weeknumberPosition: Pi
        })
      );
    }
    w.value = Qt(
      g.value[0],
      or[0],
      He
    ), g.value = or, w.value && w.value !== "none" ? M = {
      resolve: _,
      reject: Y
    } : _(!0);
  }), dt = (N) => {
    const _ = me.value ?? re(/* @__PURE__ */ new Date());
    return he(_, N);
  }, Sn = (N, _ = {}) => {
    const Y = kn(N) ? N : re(N);
    return Object.assign(
      _,
      st(Y, {
        ..._,
        force: !0
      })
    ), eI(
      _.fromPage,
      _.toPage,
      p.value,
      P.value
    ).map((de) => Jk(de, $e.value, Z.value)).some((de) => de);
  }, Fn = (N, _ = {}) => Sn(dt(N), _), ht = E(() => Fn(-ne.value)), at = E(() => Fn(ne.value)), It = async (N, _ = {}) => !_.force && !Sn(N, _) ? !1 : (_.fromPage && !Qk(_.fromPage, me.value) && (fs({ id: f.value, hideDelay: 0 }), _.view && (oE("view", 10), p.value = _.view), await en({
    ..._,
    page: _.fromPage,
    position: 1,
    force: !0
  }), r("did-move", g.value)), !0), Bt = (N, _ = {}) => It(dt(N), _), Mn = () => Bt(-ne.value), Et = () => Bt(ne.value), On = (N) => {
    const _ = xe.value ? ".in-month" : "", Y = `.id-${P.value.getDayId(N)}${_}`, q = `${Y}.vc-focusable, ${Y} .vc-focusable`, de = a.value;
    if (de) {
      const He = de.querySelector(q);
      if (He)
        return He.focus(), !0;
    }
    return !1;
  }, Ut = async (N, _ = {}) => On(N) ? !0 : (await It(N, _), On(N)), Ht = (N, _) => {
    o.value = N.day, r("dayclick", N, _);
  }, Sr = (N, _) => {
    r("daymouseenter", N, _);
  }, Nn = (N, _) => {
    r("daymouseleave", N, _);
  }, Mr = (N, _) => {
    o.value = N.day, l.value = N, N.isFocused = !0, r("dayfocusin", N, _);
  }, rr = (N, _) => {
    l.value = null, N.isFocused = !1, r("dayfocusout", N, _);
  }, ir = (N, _) => {
    r("daykeydown", N, _);
    const Y = N.noonDate;
    let q = null;
    switch (_.key) {
      case "ArrowLeft": {
        q = Pt(Y, -1);
        break;
      }
      case "ArrowRight": {
        q = Pt(Y, 1);
        break;
      }
      case "ArrowUp": {
        q = Pt(Y, -7);
        break;
      }
      case "ArrowDown": {
        q = Pt(Y, 7);
        break;
      }
      case "Home": {
        q = Pt(Y, -N.weekdayPosition + 1);
        break;
      }
      case "End": {
        q = Pt(Y, N.weekdayPositionFromEnd);
        break;
      }
      case "PageUp": {
        _.altKey ? q = Yd(Y, -1) : q = Sa(Y, -1);
        break;
      }
      case "PageDown": {
        _.altKey ? q = Yd(Y, 1) : q = Sa(Y, 1);
        break;
      }
    }
    q && (_.preventDefault(), Ut(q).catch());
  }, Or = (N) => {
    const _ = l.value;
    _ != null && ir(_, N);
  }, sr = (N, _) => {
    r("weeknumberclick", N, _);
  };
  en({
    page: e.initialPage,
    position: e.initialPagePosition
  }), Pa(() => {
    !e.disablePageSwipe && a.value && (S = aE(
      a.value,
      ({ toLeft: N = !1, toRight: _ = !1 }) => {
        N ? Et() : _ && Mn();
      },
      Dr("touch")
    ));
  }), yl(() => {
    g.value = [], S && S();
  }), Tt(
    () => P.value,
    () => {
      en();
    }
  ), Tt(
    () => V.value,
    () => en()
  ), Tt(
    () => e.view,
    () => p.value = e.view
  ), Tt(
    () => p.value,
    () => {
      lE("view", () => {
        en();
      }), r("update:view", p.value);
    }
  ), Tt(
    () => o.value,
    () => {
      Ne(g.value, (N) => Pe(N));
    }
  ), Xd(() => {
    r("update:pages", g.value), Ne(g.value, (N) => {
      Je(N), Pe(N);
    });
  });
  const ar = {
    emit: r,
    containerRef: a,
    focusedDay: l,
    inTransition: c,
    navPopoverId: f,
    dayPopoverId: h,
    view: p,
    pages: g,
    transitionName: w,
    theme: k,
    color: U,
    displayMode: R,
    locale: P,
    masks: J,
    attributes: et,
    disabledAttribute: z,
    disabledDates: te,
    attributeContext: ot,
    days: Qe,
    dayCells: mn,
    count: V,
    step: ne,
    firstPage: me,
    lastPage: we,
    canMovePrev: ht,
    canMoveNext: at,
    minPage: $e,
    maxPage: Z,
    isMonthly: xe,
    isWeekly: Me,
    isDaily: Ye,
    navVisibility: fe,
    showWeeknumbers: Ae,
    showIsoWeeknumbers: ae,
    getDateAddress: re,
    canMove: Sn,
    canMoveBy: Fn,
    move: It,
    moveBy: Bt,
    movePrev: Mn,
    moveNext: Et,
    onTransitionBeforeEnter: Ue,
    onTransitionAfterEnter: B,
    tryFocusDate: On,
    focusDate: Ut,
    onKeydown: Or,
    onDayKeydown: ir,
    onDayClick: Ht,
    onDayMouseenter: Sr,
    onDayMouseleave: Nn,
    onDayFocusin: Mr,
    onDayFocusout: rr,
    onWeeknumberClick: sr
  };
  return vs(Dv, ar), ar;
}
function qr() {
  const e = hs(Dv);
  if (e)
    return e;
  throw new Error(
    "Calendar context missing. Please verify this component is nested within a valid context provider."
  );
}
const $E = yt({
  inheritAttrs: !1,
  emits: ["before-show", "after-show", "before-hide", "after-hide"],
  props: {
    id: { type: [Number, String, Symbol], required: !0 },
    showDelay: { type: Number, default: 0 },
    hideDelay: { type: Number, default: 110 },
    boundarySelector: { type: String }
  },
  setup(e, { emit: n }) {
    let r;
    const a = Ge();
    let l = null, o = null;
    const c = Ta({
      isVisible: !1,
      target: null,
      data: null,
      transition: "slide-fade",
      placement: "bottom",
      direction: "",
      positionFixed: !1,
      modifiers: [],
      isInteractive: !0,
      visibility: "click",
      isHovered: !1,
      isFocused: !1,
      autoHide: !1,
      force: !1
    });
    function f(B) {
      B && (c.direction = B.split("-")[0]);
    }
    function h({ placement: B, options: he }) {
      f(B || (he == null ? void 0 : he.placement));
    }
    const p = E(() => ({
      placement: c.placement,
      strategy: c.positionFixed ? "fixed" : "absolute",
      boundary: "",
      modifiers: [
        {
          name: "onUpdate",
          enabled: !0,
          phase: "afterWrite",
          fn: h
        },
        ...c.modifiers || []
      ],
      onFirstUpdate: h
    })), g = E(() => {
      const B = c.direction === "left" || c.direction === "right";
      let he = "";
      if (c.placement) {
        const re = c.placement.split("-");
        re.length > 1 && (he = re[1]);
      }
      return ["start", "top", "left"].includes(he) ? B ? "top" : "left" : ["end", "bottom", "right"].includes(he) ? B ? "bottom" : "right" : B ? "middle" : "center";
    });
    function w() {
      o && (o.destroy(), o = null);
    }
    function M() {
      es(() => {
        const B = wa(c.target);
        !B || !a.value || (o && o.state.elements.reference !== B && w(), o ? o.update() : o = mw(
          B,
          a.value,
          p.value
        ));
      });
    }
    function S(B) {
      Object.assign(c, Kh(B, "force"));
    }
    function k(B, he) {
      clearTimeout(r), B > 0 ? r = setTimeout(he, B) : he();
    }
    function U(B) {
      return !B || !o ? !1 : wa(B) === o.state.elements.reference;
    }
    async function R(B = {}) {
      c.force || (B.force && (c.force = !0), k(B.showDelay ?? e.showDelay, () => {
        c.isVisible && (c.force = !1), S({
          ...B,
          isVisible: !0
        }), M();
      }));
    }
    function P(B = {}) {
      o && (B.target && !U(B.target) || c.force || (B.force && (c.force = !0), k(B.hideDelay ?? e.hideDelay, () => {
        c.isVisible || (c.force = !1), c.isVisible = !1;
      })));
    }
    function J(B = {}) {
      B.target != null && (c.isVisible && U(B.target) ? P(B) : R(B));
    }
    function Q(B) {
      if (!o)
        return;
      const he = o.state.elements.reference;
      if (!a.value || !he)
        return;
      const re = B.target;
      va(a.value, re) || va(he, re) || P({ force: !0 });
    }
    function H(B) {
      (B.key === "Esc" || B.key === "Escape") && P();
    }
    function z({ detail: B }) {
      !B.id || B.id !== e.id || R(B);
    }
    function te({ detail: B }) {
      !B.id || B.id !== e.id || P(B);
    }
    function V({ detail: B }) {
      !B.id || B.id !== e.id || J(B);
    }
    function ne() {
      br(document, "keydown", H), br(document, "click", Q), br(document, "show-popover", z), br(document, "hide-popover", te), br(document, "toggle-popover", V);
    }
    function me() {
      _r(document, "keydown", H), _r(document, "click", Q), _r(document, "show-popover", z), _r(document, "hide-popover", te), _r(document, "toggle-popover", V);
    }
    function we(B) {
      n("before-show", B);
    }
    function $e(B) {
      c.force = !1, n("after-show", B);
    }
    function Z(B) {
      n("before-hide", B);
    }
    function fe(B) {
      c.force = !1, w(), n("after-hide", B);
    }
    function Ae(B) {
      B.stopPropagation();
    }
    function ae() {
      c.isHovered = !0, c.isInteractive && ["hover", "hover-focus"].includes(c.visibility) && R();
    }
    function xe() {
      if (c.isHovered = !1, !o)
        return;
      const B = o.state.elements.reference;
      c.autoHide && !c.isFocused && (!B || B !== document.activeElement) && ["hover", "hover-focus"].includes(c.visibility) && P();
    }
    function Me() {
      c.isFocused = !0, c.isInteractive && ["focus", "hover-focus"].includes(c.visibility) && R();
    }
    function Ye(B) {
      ["focus", "hover-focus"].includes(c.visibility) && (!B.relatedTarget || !va(a.value, B.relatedTarget)) && (c.isFocused = !1, !c.isHovered && c.autoHide && P());
    }
    function Ue() {
      l != null && (l.disconnect(), l = null);
    }
    return Tt(
      () => a.value,
      (B) => {
        Ue(), B && (l = new ResizeObserver(() => {
          o && o.update();
        }), l.observe(B));
      }
    ), Tt(() => c.placement, f, {
      immediate: !0
    }), Pa(() => {
      ne();
    }), yl(() => {
      w(), Ue(), me();
    }), {
      ...Zd(c),
      popoverRef: a,
      alignment: g,
      hide: P,
      setupPopper: M,
      beforeEnter: we,
      afterEnter: $e,
      beforeLeave: Z,
      afterLeave: fe,
      onClick: Ae,
      onMouseOver: ae,
      onMouseLeave: xe,
      onFocusIn: Me,
      onFocusOut: Ye
    };
  }
}), Cr = (e, n) => {
  const r = e.__vccOpts || e;
  for (const [a, l] of n)
    r[a] = l;
  return r;
};
function CE(e, n, r, a, l, o) {
  return O(), A("div", {
    class: ee(["vc-popover-content-wrapper", { "is-interactive": e.isInteractive }]),
    ref: "popoverRef",
    onClick: n[0] || (n[0] = (...c) => e.onClick && e.onClick(...c)),
    onMouseover: n[1] || (n[1] = (...c) => e.onMouseOver && e.onMouseOver(...c)),
    onMouseleave: n[2] || (n[2] = (...c) => e.onMouseLeave && e.onMouseLeave(...c)),
    onFocusin: n[3] || (n[3] = (...c) => e.onFocusIn && e.onFocusIn(...c)),
    onFocusout: n[4] || (n[4] = (...c) => e.onFocusOut && e.onFocusOut(...c))
  }, [
    be(Jd, {
      name: `vc-${e.transition}`,
      appear: "",
      onBeforeEnter: e.beforeEnter,
      onAfterEnter: e.afterEnter,
      onBeforeLeave: e.beforeLeave,
      onAfterLeave: e.afterLeave
    }, {
      default: le(() => [
        e.isVisible ? (O(), A("div", wn({
          key: 0,
          tabindex: "-1",
          class: `vc-popover-content direction-${e.direction}`
        }, e.$attrs), [
          j(e.$slots, "default", {
            direction: e.direction,
            alignment: e.alignment,
            data: e.data,
            hide: e.hide
          }, () => [
            Zt(pe(e.data), 1)
          ]),
          C("span", {
            class: ee([
              "vc-popover-caret",
              `direction-${e.direction}`,
              `align-${e.alignment}`
            ])
          }, null, 2)
        ], 16)) : se("", !0)
      ]),
      _: 3
    }, 8, ["name", "onBeforeEnter", "onAfterEnter", "onBeforeLeave", "onAfterLeave"])
  ], 34);
}
const Vl = /* @__PURE__ */ Cr($E, [["render", CE]]), SE = { class: "vc-day-popover-row" }, ME = {
  key: 0,
  class: "vc-day-popover-row-indicator"
}, OE = { class: "vc-day-popover-row-label" }, xE = /* @__PURE__ */ yt({
  __name: "PopoverRow",
  props: {
    attribute: null
  },
  setup(e) {
    const n = e, r = E(() => {
      const { content: a, highlight: l, dot: o, bar: c, popover: f } = n.attribute;
      return f && f.hideIndicator ? null : a ? {
        class: `vc-bar vc-day-popover-row-bar vc-attr vc-${a.base.color}`
      } : l ? {
        class: `vc-highlight-bg-solid vc-day-popover-row-highlight vc-attr vc-${l.base.color}`
      } : o ? {
        class: `vc-dot vc-attr vc-${o.base.color}`
      } : c ? {
        class: `vc-bar vc-day-popover-row-bar vc-attr vc-${c.base.color}`
      } : null;
    });
    return (a, l) => (O(), A("div", SE, [
      W(r) ? (O(), A("div", ME, [
        C("span", {
          class: ee(W(r).class)
        }, null, 2)
      ])) : se("", !0),
      C("div", OE, [
        j(a.$slots, "default", {}, () => [
          Zt(pe(e.attribute.popover ? e.attribute.popover.label : "No content provided"), 1)
        ])
      ])
    ]));
  }
}), AE = {
  inheritAttrs: !1
}, fn = /* @__PURE__ */ yt({
  ...AE,
  __name: "CalendarSlot",
  props: {
    name: null
  },
  setup(e) {
    const r = wv(e.name);
    return (a, l) => W(r) ? (O(), Fe(wr(W(r)), gt(wn({ key: 0 }, a.$attrs)), null, 16)) : j(a.$slots, "default", { key: 1 });
  }
}), TE = { class: "vc-day-popover-container" }, PE = {
  key: 0,
  class: "vc-day-popover-header"
}, kE = /* @__PURE__ */ yt({
  __name: "CalendarDayPopover",
  setup(e) {
    const { dayPopoverId: n, displayMode: r, color: a, masks: l, locale: o } = qr();
    function c(h, p) {
      return o.value.formatDate(h, p);
    }
    function f(h) {
      return o.value.formatDate(h.date, l.value.dayPopover);
    }
    return (h, p) => (O(), Fe(Vl, {
      id: W(n),
      class: ee([`vc-${W(a)}`, `vc-${W(r)}`])
    }, {
      default: le(({ data: { day: g, attributes: w }, hide: M }) => [
        be(fn, {
          name: "day-popover",
          day: g,
          "day-title": f(g),
          attributes: w,
          format: c,
          masks: W(l),
          hide: M
        }, {
          default: le(() => [
            C("div", TE, [
              W(l).dayPopover ? (O(), A("div", PE, pe(f(g)), 1)) : se("", !0),
              (O(!0), A(Te, null, Le(w, (S) => (O(), Fe(xE, {
                key: S.key,
                attribute: S
              }, null, 8, ["attribute"]))), 128))
            ])
          ]),
          _: 2
        }, 1032, ["day", "day-title", "attributes", "masks", "hide"])
      ]),
      _: 1
    }, 8, ["id", "class"]));
  }
}), IE = {}, EE = {
  "stroke-linecap": "round",
  "stroke-linejoin": "round",
  viewBox: "0 0 24 24"
}, LE = /* @__PURE__ */ C("polyline", { points: "9 18 15 12 9 6" }, null, -1), YE = [
  LE
];
function RE(e, n) {
  return O(), A("svg", EE, YE);
}
const FE = /* @__PURE__ */ Cr(IE, [["render", RE]]), NE = {}, WE = {
  "stroke-linecap": "round",
  "stroke-linejoin": "round",
  viewBox: "0 0 24 24"
}, BE = /* @__PURE__ */ C("polyline", { points: "15 18 9 12 15 6" }, null, -1), UE = [
  BE
];
function HE(e, n) {
  return O(), A("svg", WE, UE);
}
const zE = /* @__PURE__ */ Cr(NE, [["render", HE]]), qE = {}, KE = {
  "stroke-linecap": "round",
  "stroke-linejoin": "round",
  viewBox: "0 0 24 24"
}, VE = /* @__PURE__ */ C("polyline", { points: "6 9 12 15 18 9" }, null, -1), GE = [
  VE
];
function jE(e, n) {
  return O(), A("svg", KE, GE);
}
const ZE = /* @__PURE__ */ Cr(qE, [["render", jE]]), XE = {}, JE = {
  fill: "none",
  "stroke-linecap": "round",
  "stroke-linejoin": "round",
  "stroke-width": "2",
  viewBox: "0 0 24 24"
}, QE = /* @__PURE__ */ C("path", { d: "M12 8v4l3 3m6-3a9 9 0 11-18 0 9 9 0 0118 0z" }, null, -1), eL = [
  QE
];
function tL(e, n) {
  return O(), A("svg", JE, eL);
}
const nL = /* @__PURE__ */ Cr(XE, [["render", tL]]), rL = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  IconChevronDown: ZE,
  IconChevronLeft: zE,
  IconChevronRight: FE,
  IconClock: nL
}, Symbol.toStringTag, { value: "Module" })), wi = /* @__PURE__ */ yt({
  __name: "BaseIcon",
  props: {
    name: { type: String, required: !0 },
    width: { type: String },
    height: { type: String },
    size: { type: String, default: "26" },
    viewBox: { type: String }
  },
  setup(e) {
    const n = e, r = E(() => n.width || n.size), a = E(() => n.height || n.size), l = E(() => rL[`Icon${n.name}`]);
    return (o, c) => (O(), Fe(wr(W(l)), {
      width: W(r),
      height: W(a),
      class: "vc-base-icon"
    }, null, 8, ["width", "height"]));
  }
}), iL = ["disabled"], sL = {
  key: 1,
  class: "vc-title-wrapper"
}, aL = {
  type: "button",
  class: "vc-title"
}, oL = ["disabled"], $v = /* @__PURE__ */ yt({
  __name: "CalendarHeader",
  props: {
    page: null,
    layout: null,
    isLg: { type: Boolean },
    isXl: { type: Boolean },
    is2xl: { type: Boolean },
    hideTitle: { type: Boolean },
    hideArrows: { type: Boolean }
  },
  setup(e) {
    const n = e, {
      navPopoverId: r,
      navVisibility: a,
      canMovePrev: l,
      movePrev: o,
      canMoveNext: c,
      moveNext: f
    } = qr(), h = E(() => {
      switch (n.page.titlePosition) {
        case "left":
          return "bottom-start";
        case "right":
          return "bottom-end";
        default:
          return "bottom";
      }
    }), p = E(() => {
      const { page: U } = n;
      return {
        id: r.value,
        visibility: a.value,
        placement: h.value,
        modifiers: [{ name: "flip", options: { fallbackPlacements: ["bottom"] } }],
        data: { page: U },
        isInteractive: !0
      };
    }), g = E(() => n.page.titlePosition.includes("left")), w = E(() => n.page.titlePosition.includes("right")), M = E(() => n.layout ? n.layout : g.value ? "tu-pn" : w.value ? "pn-tu" : "p-tu-n;"), S = E(() => ({
      prev: M.value.includes("p") && !n.hideArrows,
      title: M.value.includes("t") && !n.hideTitle,
      next: M.value.includes("n") && !n.hideArrows
    })), k = E(() => ({ gridTemplateColumns: M.value.split("").map((R) => {
      switch (R) {
        case "p":
          return "[prev] auto";
        case "n":
          return "[next] auto";
        case "t":
          return "[title] auto";
        case "-":
          return "1fr";
        default:
          return "";
      }
    }).join(" ") }));
    return (U, R) => (O(), A("div", {
      class: ee(["vc-header", { "is-lg": e.isLg, "is-xl": e.isXl, "is-2xl": e.is2xl }]),
      style: fi(W(k))
    }, [
      W(S).prev ? (O(), A("button", {
        key: 0,
        type: "button",
        class: "vc-arrow vc-prev vc-focus",
        disabled: !W(l),
        onClick: R[0] || (R[0] = //@ts-ignore
        (...P) => W(o) && W(o)(...P)),
        onKeydown: R[1] || (R[1] = xf(
          //@ts-ignore
          (...P) => W(o) && W(o)(...P),
          ["space", "enter"]
        ))
      }, [
        be(fn, {
          name: "header-prev-button",
          disabled: !W(l)
        }, {
          default: le(() => [
            be(wi, {
              name: "ChevronLeft",
              size: "24"
            })
          ]),
          _: 1
        }, 8, ["disabled"])
      ], 40, iL)) : se("", !0),
      W(S).title ? (O(), A("div", sL, [
        be(fn, { name: "header-title-wrapper" }, {
          default: le(() => [
            Xn((O(), A("button", aL, [
              be(fn, {
                name: "header-title",
                title: e.page.title
              }, {
                default: le(() => [
                  C("span", null, pe(e.page.title), 1)
                ]),
                _: 1
              }, 8, ["title"])
            ])), [
              [W(vv), W(p)]
            ])
          ]),
          _: 1
        })
      ])) : se("", !0),
      W(S).next ? (O(), A("button", {
        key: 2,
        type: "button",
        class: "vc-arrow vc-next vc-focus",
        disabled: !W(c),
        onClick: R[2] || (R[2] = //@ts-ignore
        (...P) => W(f) && W(f)(...P)),
        onKeydown: R[3] || (R[3] = xf(
          //@ts-ignore
          (...P) => W(f) && W(f)(...P),
          ["space", "enter"]
        ))
      }, [
        be(fn, {
          name: "header-next-button",
          disabled: !W(c)
        }, {
          default: le(() => [
            be(wi, {
              name: "ChevronRight",
              size: "24"
            })
          ]),
          _: 1
        }, 8, ["disabled"])
      ], 40, oL)) : se("", !0)
    ], 6));
  }
}), Cv = Symbol("__vc_page_context__");
function lL(e) {
  const { locale: n, getDateAddress: r, canMove: a } = qr();
  function l(f, h) {
    const { month: p, year: g } = r(/* @__PURE__ */ new Date());
    return cv().map((w, M) => {
      const S = M + 1;
      return {
        month: S,
        year: f,
        id: Xk(S, f),
        label: n.value.formatDate(w, h),
        ariaLabel: n.value.formatDate(w, "MMMM"),
        isActive: S === e.value.month && f === e.value.year,
        isCurrent: S === p && f === g,
        isDisabled: !a(
          { month: S, year: f },
          { position: e.value.position }
        )
      };
    });
  }
  function o(f, h) {
    const { year: p } = r(/* @__PURE__ */ new Date()), { position: g } = e.value, w = [];
    for (let M = f; M <= h; M += 1) {
      const S = [...Array(12).keys()].some(
        (k) => a({ month: k + 1, year: M }, { position: g })
      );
      w.push({
        year: M,
        id: M.toString(),
        label: M.toString(),
        ariaLabel: M.toString(),
        isActive: M === e.value.year,
        isCurrent: M === p,
        isDisabled: !S
      });
    }
    return w;
  }
  const c = { page: e, getMonthItems: l, getYearItems: o };
  return vs(Cv, c), c;
}
function Sv() {
  const e = hs(Cv);
  if (e)
    return e;
  throw new Error(
    "Page context missing. Please verify this component is nested within a valid context provider."
  );
}
const uL = { class: "vc-nav-header" }, cL = ["disabled"], fL = ["disabled"], dL = { class: "vc-nav-items" }, hL = ["data-id", "aria-label", "disabled", "onClick", "onKeydown"], vL = /* @__PURE__ */ yt({
  __name: "CalendarNav",
  setup(e) {
    const { masks: n, move: r } = qr(), { page: a, getMonthItems: l, getYearItems: o } = Sv(), c = Ge(!0), f = 12, h = Ge(a.value.year), p = Ge(M(a.value.year)), g = Ge(null);
    function w() {
      setTimeout(() => {
        if (g.value == null)
          return;
        const re = g.value.querySelector(
          ".vc-nav-item:not(:disabled)"
        );
        re && re.focus();
      }, 10);
    }
    function M(re) {
      return Math.floor(re / f);
    }
    function S() {
      c.value = !c.value;
    }
    function k(re) {
      return re * f;
    }
    function U(re) {
      return f * (re + 1) - 1;
    }
    function R() {
      Me.value && (c.value && J(), H());
    }
    function P() {
      Ye.value && (c.value && Q(), z());
    }
    function J() {
      h.value--;
    }
    function Q() {
      h.value++;
    }
    function H() {
      p.value--;
    }
    function z() {
      p.value++;
    }
    const te = E(
      () => l(h.value, n.value.navMonths).map((re) => ({
        ...re,
        click: () => r(
          { month: re.month, year: re.year },
          { position: a.value.position }
        )
      }))
    ), V = E(
      () => l(h.value - 1, n.value.navMonths)
    ), ne = E(
      () => V.value.some((re) => !re.isDisabled)
    ), me = E(
      () => l(h.value + 1, n.value.navMonths)
    ), we = E(
      () => me.value.some((re) => !re.isDisabled)
    ), $e = E(
      () => o(
        k(p.value),
        U(p.value)
      ).map((re) => ({
        ...re,
        click: () => {
          h.value = re.year, c.value = !0, w();
        }
      }))
    ), Z = E(
      () => o(
        k(p.value - 1),
        U(p.value - 1)
      )
    ), fe = E(
      () => Z.value.some((re) => !re.isDisabled)
    ), Ae = E(
      () => o(
        k(p.value + 1),
        U(p.value + 1)
      )
    ), ae = E(
      () => Ae.value.some((re) => !re.isDisabled)
    ), xe = E(
      () => c.value ? te.value : $e.value
    ), Me = E(
      () => c.value ? ne.value : fe.value
    ), Ye = E(
      () => c.value ? we.value : ae.value
    ), Ue = E(() => zh($e.value.map((re) => re.year))), B = E(() => ci($e.value.map((re) => re.year))), he = E(() => c.value ? h.value : `${Ue.value} - ${B.value}`);
    return Xd(() => {
      h.value = a.value.year, w();
    }), Tt(
      () => h.value,
      (re) => p.value = M(re)
    ), Pa(() => w()), (re, Je) => (O(), A("div", {
      class: "vc-nav-container",
      ref_key: "navContainer",
      ref: g
    }, [
      C("div", uL, [
        C("button", {
          type: "button",
          class: "vc-nav-arrow is-left vc-focus",
          disabled: !W(Me),
          onClick: R,
          onKeydown: Je[0] || (Je[0] = (Pe) => W(fa)(Pe, R))
        }, [
          be(fn, {
            name: "nav-prev-button",
            move: R,
            disabled: !W(Me)
          }, {
            default: le(() => [
              be(wi, {
                name: "ChevronLeft",
                width: "22px",
                height: "24px"
              })
            ]),
            _: 1
          }, 8, ["disabled"])
        ], 40, cL),
        C("button", {
          type: "button",
          class: "vc-nav-title vc-focus",
          onClick: S,
          onKeydown: Je[1] || (Je[1] = (Pe) => W(fa)(Pe, S))
        }, pe(W(he)), 33),
        C("button", {
          type: "button",
          class: "vc-nav-arrow is-right vc-focus",
          disabled: !W(Ye),
          onClick: P,
          onKeydown: Je[2] || (Je[2] = (Pe) => W(fa)(Pe, P))
        }, [
          be(fn, {
            name: "nav-next-button",
            move: P,
            disabled: !W(Ye)
          }, {
            default: le(() => [
              be(wi, {
                name: "ChevronRight",
                width: "22px",
                height: "24px"
              })
            ]),
            _: 1
          }, 8, ["disabled"])
        ], 40, fL)
      ]),
      C("div", dL, [
        (O(!0), A(Te, null, Le(W(xe), (Pe) => (O(), A("button", {
          key: Pe.label,
          type: "button",
          "data-id": Pe.id,
          "aria-label": Pe.ariaLabel,
          class: ee(["vc-nav-item vc-focus", [
            Pe.isActive ? "is-active" : Pe.isCurrent ? "is-current" : ""
          ]]),
          disabled: Pe.isDisabled,
          onClick: Pe.click,
          onKeydown: (Ne) => W(fa)(Ne, Pe.click)
        }, pe(Pe.label), 43, hL))), 128))
      ])
    ], 512));
  }
}), Mv = /* @__PURE__ */ yt({
  __name: "CalendarPageProvider",
  props: {
    page: null
  },
  setup(e) {
    return lL(da(e, "page")), (r, a) => j(r.$slots, "default");
  }
}), pL = /* @__PURE__ */ yt({
  __name: "CalendarNavPopover",
  setup(e) {
    const { navPopoverId: n, color: r, displayMode: a } = qr();
    return (l, o) => (O(), Fe(Vl, {
      id: W(n),
      class: ee(["vc-nav-popover-container", `vc-${W(r)}`, `vc-${W(a)}`])
    }, {
      default: le(({ data: c }) => [
        be(Mv, {
          page: c.page
        }, {
          default: le(() => [
            be(fn, { name: "nav" }, {
              default: le(() => [
                be(vL)
              ]),
              _: 1
            })
          ]),
          _: 2
        }, 1032, ["page"])
      ]),
      _: 1
    }, 8, ["id", "class"]));
  }
}), mL = yt({
  directives: { popover: vv },
  components: { CalendarSlot: fn },
  props: {
    day: { type: Object, required: !0 }
  },
  setup(e) {
    const {
      locale: n,
      theme: r,
      attributeContext: a,
      dayPopoverId: l,
      onDayClick: o,
      onDayMouseenter: c,
      onDayMouseleave: f,
      onDayFocusin: h,
      onDayFocusout: p,
      onDayKeydown: g
    } = qr(), w = E(() => e.day), M = E(() => a.value.getCells(w.value)), S = E(
      () => M.value.map((ae) => ae.data)
    ), k = E(() => ({
      ...w.value,
      attributes: S.value,
      attributeCells: M.value
    }));
    function U({ data: ae }, { popovers: xe }) {
      const { key: Me, customData: Ye, popover: Ue } = ae;
      if (!Ue)
        return;
      const B = yd(
        {
          key: Me,
          customData: Ye,
          attribute: ae
        },
        { ...Ue },
        {
          visibility: Ue.label ? "hover" : "click",
          placement: "bottom",
          isInteractive: !Ue.label
        }
      );
      xe.splice(0, 0, B);
    }
    const R = E(() => {
      const ae = {
        ...r.value.prepareRender({}),
        popovers: []
      };
      return M.value.forEach((xe) => {
        r.value.render(xe, ae), U(xe, ae);
      }), ae;
    }), P = E(() => R.value.highlights), J = E(() => !!Zn(P.value)), Q = E(() => R.value.content), H = E(() => R.value.dots), z = E(() => !!Zn(H.value)), te = E(() => R.value.bars), V = E(() => !!Zn(te.value)), ne = E(() => R.value.popovers), me = E(
      () => ne.value.map((ae) => ae.attribute)
    ), we = wv("day-content"), $e = E(() => [
      "vc-day",
      ...w.value.classes,
      { "vc-day-box-center-center": !we },
      { "is-not-in-month": !e.day.inMonth }
    ]), Z = E(() => {
      let ae;
      w.value.isFocusable ? ae = "0" : ae = "-1";
      const xe = [
        "vc-day-content vc-focusable vc-focus vc-attr",
        { "vc-disabled": w.value.isDisabled },
        Nr(ci(P.value), "contentClass"),
        Nr(ci(Q.value), "class") || ""
      ], Me = {
        ...Nr(ci(P.value), "contentStyle"),
        ...Nr(ci(Q.value), "style")
      };
      return {
        class: xe,
        style: Me,
        tabindex: ae,
        "aria-label": w.value.ariaLabel,
        "aria-disabled": !!w.value.isDisabled,
        role: "button"
      };
    }), fe = E(() => ({
      click(ae) {
        o(k.value, ae);
      },
      mouseenter(ae) {
        c(k.value, ae);
      },
      mouseleave(ae) {
        f(k.value, ae);
      },
      focusin(ae) {
        h(k.value, ae);
      },
      focusout(ae) {
        p(k.value, ae);
      },
      keydown(ae) {
        g(k.value, ae);
      }
    })), Ae = E(() => Zn(ne.value) ? yd(
      {
        id: l.value,
        data: { day: w, attributes: me.value }
      },
      ...ne.value
    ) : null);
    return {
      attributes: S,
      attributeCells: M,
      bars: te,
      dayClasses: $e,
      dayContentProps: Z,
      dayContentEvents: fe,
      dayPopover: Ae,
      glyphs: R,
      dots: H,
      hasDots: z,
      hasBars: V,
      highlights: P,
      hasHighlights: J,
      locale: n,
      popovers: ne
    };
  }
}), gL = {
  key: 0,
  class: "vc-highlights vc-day-layer"
}, yL = {
  key: 1,
  class: "vc-day-layer vc-day-box-center-bottom"
}, _L = { class: "vc-dots" }, bL = {
  key: 2,
  class: "vc-day-layer vc-day-box-center-bottom"
}, wL = { class: "vc-bars" };
function DL(e, n, r, a, l, o) {
  const c = Xe("CalendarSlot"), f = ob("popover");
  return O(), A("div", {
    class: ee(e.dayClasses)
  }, [
    e.hasHighlights ? (O(), A("div", gL, [
      (O(!0), A(Te, null, Le(e.highlights, ({ key: h, wrapperClass: p, class: g, style: w }) => (O(), A("div", {
        key: h,
        class: ee(p)
      }, [
        C("div", {
          class: ee(g),
          style: fi(w)
        }, null, 6)
      ], 2))), 128))
    ])) : se("", !0),
    be(c, {
      name: "day-content",
      day: e.day,
      attributes: e.attributes,
      "attribute-cells": e.attributeCells,
      dayProps: e.dayContentProps,
      dayEvents: e.dayContentEvents,
      locale: e.locale
    }, {
      default: le(() => [
        Xn((O(), A("div", wn(e.dayContentProps, lb(e.dayContentEvents, !0)), [
          Zt(pe(e.day.label), 1)
        ], 16)), [
          [f, e.dayPopover]
        ])
      ]),
      _: 1
    }, 8, ["day", "attributes", "attribute-cells", "dayProps", "dayEvents", "locale"]),
    e.hasDots ? (O(), A("div", yL, [
      C("div", _L, [
        (O(!0), A(Te, null, Le(e.dots, ({ key: h, class: p, style: g }) => (O(), A("span", {
          key: h,
          class: ee(p),
          style: fi(g)
        }, null, 6))), 128))
      ])
    ])) : se("", !0),
    e.hasBars ? (O(), A("div", bL, [
      C("div", wL, [
        (O(!0), A(Te, null, Le(e.bars, ({ key: h, class: p, style: g }) => (O(), A("span", {
          key: h,
          class: ee(p),
          style: fi(g)
        }, null, 6))), 128))
      ])
    ])) : se("", !0)
  ], 2);
}
const $L = /* @__PURE__ */ Cr(mL, [["render", DL]]), CL = { class: "vc-weekdays" }, SL = ["onClick"], ML = {
  inheritAttrs: !1
}, OL = /* @__PURE__ */ yt({
  ...ML,
  __name: "CalendarPage",
  setup(e) {
    const { page: n } = Sv(), { onWeeknumberClick: r } = qr();
    return (a, l) => (O(), A("div", {
      class: ee([
        "vc-pane",
        `row-${W(n).row}`,
        `row-from-end-${W(n).rowFromEnd}`,
        `column-${W(n).column}`,
        `column-from-end-${W(n).columnFromEnd}`
      ]),
      ref: "pane"
    }, [
      be($v, {
        page: W(n),
        "is-lg": "",
        "hide-arrows": ""
      }, null, 8, ["page"]),
      C("div", {
        class: ee(["vc-weeks", {
          [`vc-show-weeknumbers-${W(n).weeknumberPosition}`]: W(n).weeknumberPosition
        }])
      }, [
        C("div", CL, [
          (O(!0), A(Te, null, Le(W(n).weekdays, ({ weekday: o, label: c }, f) => (O(), A("div", {
            key: f,
            class: ee(`vc-weekday vc-weekday-${o}`)
          }, pe(c), 3))), 128))
        ]),
        (O(!0), A(Te, null, Le(W(n).viewWeeks, (o) => (O(), A("div", {
          key: `weeknumber-${o.weeknumber}`,
          class: "vc-week"
        }, [
          W(n).weeknumberPosition ? (O(), A("div", {
            key: 0,
            class: ee(["vc-weeknumber", `is-${W(n).weeknumberPosition}`])
          }, [
            C("span", {
              class: ee(["vc-weeknumber-content"]),
              onClick: (c) => W(r)(o, c)
            }, pe(o.weeknumberDisplay), 9, SL)
          ], 2)) : se("", !0),
          (O(!0), A(Te, null, Le(o.days, (c) => (O(), Fe($L, {
            key: c.id,
            day: c
          }, null, 8, ["day"]))), 128))
        ]))), 128))
      ], 2)
    ], 2));
  }
}), xL = yt({
  components: {
    CalendarHeader: $v,
    CalendarPage: OL,
    CalendarNavPopover: pL,
    CalendarDayPopover: kE,
    CalendarPageProvider: Mv,
    CalendarSlot: fn
  },
  props: bE,
  emit: wE,
  setup(e, { emit: n, slots: r }) {
    return DE(e, { emit: n, slots: r });
  }
}), AL = { class: "vc-pane-header-wrapper" };
function TL(e, n, r, a, l, o) {
  const c = Xe("CalendarHeader"), f = Xe("CalendarPage"), h = Xe("CalendarSlot"), p = Xe("CalendarPageProvider"), g = Xe("CalendarDayPopover"), w = Xe("CalendarNavPopover");
  return O(), A(Te, null, [
    C("div", wn({ "data-helptext": "Press the arrow keys to navigate by day, Home and End to navigate to week ends, PageUp and PageDown to navigate by month, Alt+PageUp and Alt+PageDown to navigate by year" }, e.$attrs, {
      class: [
        "vc-container",
        `vc-${e.view}`,
        `vc-${e.color}`,
        `vc-${e.displayMode}`,
        {
          "vc-expanded": e.expanded,
          "vc-bordered": !e.borderless,
          "vc-transparent": e.transparent
        }
      ],
      onMouseup: n[0] || (n[0] = In(() => {
      }, ["prevent"])),
      ref: "containerRef"
    }), [
      C("div", {
        class: ee(["vc-pane-container", { "in-transition": e.inTransition }])
      }, [
        C("div", AL, [
          e.firstPage ? (O(), Fe(c, {
            key: 0,
            page: e.firstPage,
            "is-lg": "",
            "hide-title": ""
          }, null, 8, ["page"])) : se("", !0)
        ]),
        be(Jd, {
          name: `vc-${e.transitionName}`,
          onBeforeEnter: e.onTransitionBeforeEnter,
          onAfterEnter: e.onTransitionAfterEnter
        }, {
          default: le(() => [
            (O(), A("div", {
              key: e.pages[0].id,
              class: "vc-pane-layout",
              style: fi({
                gridTemplateColumns: `repeat(${e.columns}, 1fr)`
              })
            }, [
              (O(!0), A(Te, null, Le(e.pages, (M) => (O(), Fe(p, {
                key: M.id,
                page: M
              }, {
                default: le(() => [
                  be(h, {
                    name: "page",
                    page: M
                  }, {
                    default: le(() => [
                      be(f)
                    ]),
                    _: 2
                  }, 1032, ["page"])
                ]),
                _: 2
              }, 1032, ["page"]))), 128))
            ], 4))
          ]),
          _: 1
        }, 8, ["name", "onBeforeEnter", "onAfterEnter"]),
        be(h, { name: "footer" })
      ], 2)
    ], 16),
    be(g),
    be(w)
  ], 64);
}
const Ov = /* @__PURE__ */ Cr(xL, [["render", TL]]), xv = Symbol("__vc_date_picker_context__"), PL = {
  ...gv,
  mode: { type: String, default: "date" },
  modelValue: {
    type: [Number, String, Date, Object]
  },
  modelModifiers: {
    type: Object,
    default: () => ({})
  },
  rules: [String, Object],
  is24hr: Boolean,
  hideTimeHeader: Boolean,
  timeAccuracy: { type: Number, default: 2 },
  isRequired: Boolean,
  isRange: Boolean,
  updateOnInput: {
    type: Boolean,
    default: () => Dr("datePicker.updateOnInput")
  },
  inputDebounce: {
    type: Number,
    default: () => Dr("datePicker.inputDebounce")
  },
  popover: {
    type: [Boolean, Object],
    default: !0
  },
  dragAttribute: Object,
  selectAttribute: Object,
  attributes: [Object, Array]
}, kL = [
  "update:modelValue",
  "drag",
  "dayclick",
  "daykeydown",
  "popover-will-show",
  "popover-did-show",
  "popover-will-hide",
  "popover-did-hide"
];
function IL(e, { emit: n, slots: r }) {
  bv(r, { footer: "dp-footer" });
  const a = yv(e), { locale: l, masks: o, disabledAttribute: c } = a, f = Ge(!1), h = Ge(Symbol()), p = Ge(null), g = Ge(null), w = Ge(["", ""]), M = Ge(null), S = Ge(null);
  let k, U, R = !0;
  const P = E(() => e.isRange || e.modelModifiers.range === !0), J = E(
    () => P.value && p.value != null ? p.value.start : null
  ), Q = E(
    () => P.value && p.value != null ? p.value.end : null
  ), H = E(() => e.mode.toLowerCase() === "date"), z = E(
    () => e.mode.toLowerCase() === "datetime"
  ), te = E(() => e.mode.toLowerCase() === "time"), V = E(() => !!g.value), ne = E(() => {
    let _ = "date";
    e.modelModifiers.number && (_ = "number"), e.modelModifiers.string && (_ = "string");
    const Y = o.value.modelValue || "iso";
    return Je({ type: _, mask: Y });
  }), me = E(
    () => Fn(g.value ?? p.value)
  ), we = E(() => te.value ? e.is24hr ? o.value.inputTime24hr : o.value.inputTime : z.value ? e.is24hr ? o.value.inputDateTime24hr : o.value.inputDateTime : o.value.input), $e = E(() => /[Hh]/g.test(we.value)), Z = E(
    () => /[dD]{1,2}|Do|W{1,4}|M{1,4}|YY(?:YY)?/g.test(we.value)
  ), fe = E(() => {
    if ($e.value && Z.value)
      return "dateTime";
    if (Z.value)
      return "date";
    if ($e.value)
      return "time";
  }), Ae = E(() => {
    var _;
    const Y = ((_ = M.value) == null ? void 0 : _.$el.previousElementSibling) ?? void 0;
    return cs({}, e.popover, Dr("datePicker.popover"), {
      target: Y
    });
  }), ae = E(
    () => hv({
      ...Ae.value,
      id: h.value
    })
  ), xe = E(() => P.value ? {
    start: w.value[0],
    end: w.value[1]
  } : w.value[0]), Me = E(() => {
    const _ = ["start", "end"].map((Y) => ({
      input: en(Y),
      change: dt(Y),
      keyup: Sn,
      ...e.popover && ae.value
    }));
    return P.value ? {
      start: _[0],
      end: _[1]
    } : _[0];
  }), Ye = E(() => {
    if (!et(p.value))
      return null;
    const _ = {
      key: "select-drag",
      ...e.selectAttribute,
      dates: p.value,
      pinPage: !0
    }, { dot: Y, bar: q, highlight: de, content: He } = _;
    return !Y && !q && !de && !He && (_.highlight = !0), _;
  }), Ue = E(() => {
    if (!P.value || !et(g.value))
      return null;
    const _ = {
      key: "select-drag",
      ...e.dragAttribute,
      dates: g.value
    }, { dot: Y, bar: q, highlight: de, content: He } = _;
    return !Y && !q && !de && !He && (_.highlight = {
      startEnd: {
        fillMode: "outline"
      }
    }), _;
  }), B = E(() => {
    const _ = hn(e.attributes) ? [...e.attributes] : [];
    return Ue.value ? _.unshift(Ue.value) : Ye.value && _.unshift(Ye.value), _;
  }), he = E(() => Je(
    e.rules === "auto" ? re() : e.rules ?? {}
  ));
  function re() {
    const _ = {
      ms: [0, 999],
      sec: [0, 59],
      min: [0, 59],
      hr: [0, 23]
    }, Y = H.value ? 0 : e.timeAccuracy;
    return [0, 1].map((q) => {
      switch (Y) {
        case 0:
          return {
            hours: _.hr[q],
            minutes: _.min[q],
            seconds: _.sec[q],
            milliseconds: _.ms[q]
          };
        case 1:
          return {
            minutes: _.min[q],
            seconds: _.sec[q],
            milliseconds: _.ms[q]
          };
        case 3:
          return { milliseconds: _.ms[q] };
        case 4:
          return {};
        default:
          return { seconds: _.sec[q], milliseconds: _.ms[q] };
      }
    });
  }
  function Je(_) {
    return hn(_) ? _.length === 1 ? [_[0], _[0]] : _ : [_, _];
  }
  function Pe(_) {
    return Je(_).map(
      (Y, q) => ({
        ...Y,
        rules: he.value[q]
      })
    );
  }
  function Ne(_) {
    return _ == null ? !1 : Dn(_) ? !isNaN(_) : di(_) ? !isNaN(_.getTime()) : Pn(_) ? _ !== "" : Hl(_);
  }
  function Qe(_) {
    return Qn(_) && "start" in _ && "end" in _ && Ne(_.start ?? null) && Ne(_.end ?? null);
  }
  function et(_) {
    return Qe(_) || Ne(_);
  }
  function je(_, Y) {
    if (_ == null && Y == null)
      return !0;
    if (_ == null || Y == null)
      return !1;
    const q = di(_), de = di(Y);
    return q && de ? _.getTime() === Y.getTime() : q || de ? !1 : je(_.start, Y.start) && je(_.end, Y.end);
  }
  function ot(_) {
    return !et(_) || !c.value ? !1 : c.value.intersectsRange(l.value.range(_));
  }
  function mn(_, Y, q, de) {
    if (!et(_))
      return null;
    if (Qe(_)) {
      const He = l.value.toDate(_.start, {
        ...Y[0],
        fillDate: J.value ?? void 0,
        patch: q
      }), vt = l.value.toDate(_.end, {
        ...Y[1],
        fillDate: Q.value ?? void 0,
        patch: q
      });
      return rr({ start: He, end: vt }, de);
    }
    return l.value.toDateOrNull(_, {
      ...Y[0],
      fillDate: p.value,
      patch: q
    });
  }
  function _t(_, Y) {
    return Qe(_) ? {
      start: l.value.fromDate(_.start, Y[0]),
      end: l.value.fromDate(_.end, Y[1])
    } : P.value ? null : l.value.fromDate(_, Y[0]);
  }
  function ft(_, Y = {}) {
    return clearTimeout(k), new Promise((q) => {
      const { debounce: de = 0, ...He } = Y;
      de > 0 ? k = window.setTimeout(() => {
        q(St(_, He));
      }, de) : q(St(_, He));
    });
  }
  function St(_, {
    config: Y = ne.value,
    patch: q = "dateTime",
    clearIfEqual: de = !1,
    formatInput: He = !0,
    hidePopover: vt = !1,
    dragging: Mt = V.value,
    targetPriority: or,
    moveToValue: lr = !1
  } = {}) {
    const Kr = Pe(Y);
    let bt = mn(
      _,
      Kr,
      q,
      or
    );
    if (ot(bt)) {
      if (Mt)
        return null;
      bt = p.value, vt = !1;
    } else
      bt == null && e.isRequired ? bt = p.value : (
        // Clear value if same value was passed
        bt != null && je(p.value, bt) && de && (bt = null)
      );
    const Vr = Mt ? g : p, Wn = !je(Vr.value, bt);
    Vr.value = bt, Mt || (g.value = null);
    const xr = _t(
      bt,
      ne.value
    );
    return Wn && (R = !1, n(Mt ? "drag" : "update:modelValue", xr), es(() => R = !0)), vt && !Mt && Nn(), He && st(), lr && es(() => sr(or ?? "start")), xr;
  }
  function st() {
    es(() => {
      const _ = Pe({
        type: "string",
        mask: we.value
      }), Y = _t(
        g.value ?? p.value,
        _
      );
      P.value ? w.value = [Y && Y.start, Y && Y.end] : w.value = [Y, ""];
    });
  }
  function Qt(_, Y, q) {
    w.value.splice(Y === "start" ? 0 : 1, 1, _);
    const de = P.value ? {
      start: w.value[0],
      end: w.value[1] || w.value[0]
    } : _, He = {
      type: "string",
      mask: we.value
    };
    ft(de, {
      ...q,
      config: He,
      patch: fe.value,
      targetPriority: Y,
      moveToValue: !0
    });
  }
  function en(_) {
    return (Y) => {
      e.updateOnInput && Qt(Y.currentTarget.value, _, {
        formatInput: !1,
        hidePopover: !1,
        debounce: e.inputDebounce
      });
    };
  }
  function dt(_) {
    return (Y) => {
      Qt(Y.currentTarget.value, _, {
        formatInput: !0,
        hidePopover: !1
      });
    };
  }
  function Sn(_) {
    _.key === "Escape" && ft(p.value, {
      formatInput: !0,
      hidePopover: !0
    });
  }
  function Fn(_) {
    return P.value ? [
      _ && _.start ? l.value.getDateParts(_.start) : null,
      _ && _.end ? l.value.getDateParts(_.end) : null
    ] : [_ ? l.value.getDateParts(_) : null];
  }
  function ht() {
    g.value = null, st();
  }
  function at(_) {
    n("popover-will-show", _);
  }
  function It(_) {
    n("popover-did-show", _);
  }
  function Bt(_) {
    ht(), n("popover-will-hide", _);
  }
  function Mn(_) {
    n("popover-did-hide", _);
  }
  function Et(_) {
    const Y = {
      patch: "date",
      formatInput: !0,
      hidePopover: !0
    };
    if (P.value) {
      const q = !V.value;
      q ? U = { start: _.startDate, end: _.endDate } : U != null && (U.end = _.date), ft(U, {
        ...Y,
        dragging: q
      });
    } else
      ft(_.date, {
        ...Y,
        clearIfEqual: !e.isRequired
      });
  }
  function On(_, Y) {
    Et(_), n("dayclick", _, Y);
  }
  function Ut(_, Y) {
    switch (Y.key) {
      case " ":
      case "Enter": {
        Et(_), Y.preventDefault();
        break;
      }
      case "Escape":
        Nn();
    }
    n("daykeydown", _, Y);
  }
  function Ht(_, Y) {
    !V.value || U == null || (U.end = _.date, ft(rr(U), {
      patch: "date",
      formatInput: !0
    }));
  }
  function Sr(_ = {}) {
    gl({
      ...Ae.value,
      ..._,
      isInteractive: !0,
      id: h.value
    });
  }
  function Nn(_ = {}) {
    fs({
      hideDelay: 10,
      force: !0,
      ...Ae.value,
      ..._,
      id: h.value
    });
  }
  function Mr(_) {
    dv({
      ...Ae.value,
      ..._,
      isInteractive: !0,
      id: h.value
    });
  }
  function rr(_, Y) {
    const { start: q, end: de } = _;
    if (q > de)
      switch (Y) {
        case "start":
          return { start: q, end: q };
        case "end":
          return { start: de, end: de };
        default:
          return { start: de, end: q };
      }
    return { start: q, end: de };
  }
  async function ir(_, Y = {}) {
    return S.value == null ? !1 : S.value.move(_, Y);
  }
  async function Or(_, Y = {}) {
    return S.value == null ? !1 : S.value.moveBy(_, Y);
  }
  async function sr(_, Y = {}) {
    const q = p.value;
    if (S.value == null || !et(q))
      return !1;
    const de = _ !== "end", He = de ? 1 : -1, vt = Qe(q) ? de ? q.start : q.end : q, Mt = Zh(vt, "monthly", l.value);
    return S.value.move(Mt, { position: He, ...Y });
  }
  Tt(
    () => e.isRange,
    (_) => {
      _ && console.warn(
        "The `is-range` prop will be deprecated in future releases. Please use the `range` modifier."
      );
    },
    { immediate: !0 }
  ), Tt(
    () => P.value,
    () => {
      St(null, { formatInput: !0 });
    }
  ), Tt(
    () => we.value,
    () => st()
  ), Tt(
    () => e.modelValue,
    (_) => {
      R && St(_, {
        formatInput: !0,
        hidePopover: !1
      });
    }
  ), Tt(
    () => he.value,
    () => {
      Qn(e.rules) && St(e.modelValue, {
        formatInput: !0,
        hidePopover: !1
      });
    }
  ), Tt(
    () => e.timezone,
    () => {
      St(p.value, { formatInput: !0 });
    }
  );
  const ar = Je(ne.value);
  p.value = mn(
    e.modelValue ?? null,
    ar,
    "dateTime"
  ), Pa(() => {
    St(e.modelValue, {
      formatInput: !0,
      hidePopover: !1
    });
  }), es(() => f.value = !0);
  const N = {
    ...a,
    showCalendar: f,
    datePickerPopoverId: h,
    popoverRef: M,
    popoverEvents: ae,
    calendarRef: S,
    isRange: P,
    isTimeMode: te,
    isDateTimeMode: z,
    is24hr: da(e, "is24hr"),
    hideTimeHeader: da(e, "hideTimeHeader"),
    timeAccuracy: da(e, "timeAccuracy"),
    isDragging: V,
    inputValue: xe,
    inputEvents: Me,
    dateParts: me,
    attributes: B,
    rules: he,
    move: ir,
    moveBy: Or,
    moveToValue: sr,
    updateValue: ft,
    showPopover: Sr,
    hidePopover: Nn,
    togglePopover: Mr,
    onDayClick: On,
    onDayKeydown: Ut,
    onDayMouseEnter: Ht,
    onPopoverBeforeShow: at,
    onPopoverAfterShow: It,
    onPopoverBeforeHide: Bt,
    onPopoverAfterHide: Mn
  };
  return vs(xv, N), N;
}
function Gl() {
  const e = hs(xv);
  if (e)
    return e;
  throw new Error(
    "DatePicker context missing. Please verify this component is nested within a valid context provider."
  );
}
const EL = [
  { value: 0, label: "12" },
  { value: 1, label: "1" },
  { value: 2, label: "2" },
  { value: 3, label: "3" },
  { value: 4, label: "4" },
  { value: 5, label: "5" },
  { value: 6, label: "6" },
  { value: 7, label: "7" },
  { value: 8, label: "8" },
  { value: 9, label: "9" },
  { value: 10, label: "10" },
  { value: 11, label: "11" }
], LL = [
  { value: 12, label: "12" },
  { value: 13, label: "1" },
  { value: 14, label: "2" },
  { value: 15, label: "3" },
  { value: 16, label: "4" },
  { value: 17, label: "5" },
  { value: 18, label: "6" },
  { value: 19, label: "7" },
  { value: 20, label: "8" },
  { value: 21, label: "9" },
  { value: 22, label: "10" },
  { value: 23, label: "11" }
];
function YL(e) {
  const n = Gl(), {
    locale: r,
    isRange: a,
    isTimeMode: l,
    dateParts: o,
    rules: c,
    is24hr: f,
    hideTimeHeader: h,
    timeAccuracy: p,
    updateValue: g
  } = n;
  function w(Z) {
    Z = Object.assign(S.value, Z);
    let fe = null;
    if (a.value) {
      const Ae = M.value ? Z : o.value[0], ae = M.value ? o.value[1] : Z;
      fe = { start: Ae, end: ae };
    } else
      fe = Z;
    g(fe, {
      patch: "time",
      targetPriority: M.value ? "start" : "end",
      moveToValue: !0
    });
  }
  const M = E(() => e.position === 0), S = E(
    () => o.value[e.position] || { isValid: !1 }
  ), k = E(() => Hl(S.value)), U = E(() => !!S.value.isValid), R = E(() => !h.value && U.value), P = E(() => {
    if (!k.value)
      return null;
    let Z = r.value.toDate(S.value);
    return S.value.hours === 24 && (Z = new Date(Z.getTime() - 1)), Z;
  }), J = E({
    get() {
      return S.value.hours;
    },
    set(Z) {
      w({ hours: Z });
    }
  }), Q = E({
    get() {
      return S.value.minutes;
    },
    set(Z) {
      w({ minutes: Z });
    }
  }), H = E({
    get() {
      return S.value.seconds;
    },
    set(Z) {
      w({ seconds: Z });
    }
  }), z = E({
    get() {
      return S.value.milliseconds;
    },
    set(Z) {
      w({ milliseconds: Z });
    }
  }), te = E({
    get() {
      return S.value.hours < 12;
    },
    set(Z) {
      Z = String(Z).toLowerCase() == "true";
      let fe = J.value;
      Z && fe >= 12 ? fe -= 12 : !Z && fe < 12 && (fe += 12), w({ hours: fe });
    }
  }), V = E(
    () => tE(S.value, c.value[e.position])
  ), ne = E(() => EL.filter(
    (Z) => V.value.hours.some((fe) => fe.value === Z.value)
  )), me = E(() => LL.filter(
    (Z) => V.value.hours.some((fe) => fe.value === Z.value)
  )), we = E(() => f.value ? V.value.hours : te.value ? ne.value : me.value), $e = E(() => {
    const Z = [];
    return Zn(ne.value) && Z.push({ value: !0, label: "AM" }), Zn(me.value) && Z.push({ value: !1, label: "PM" }), Z;
  });
  return {
    ...n,
    showHeader: R,
    timeAccuracy: p,
    parts: S,
    isValid: U,
    date: P,
    hours: J,
    minutes: Q,
    seconds: H,
    milliseconds: z,
    options: V,
    hourOptions: we,
    isAM: te,
    isAMOptions: $e,
    is24hr: f
  };
}
const RL = ["value"], FL = ["value", "disabled"], NL = {
  key: 1,
  class: "vc-base-sizer",
  "aria-hidden": "true"
}, WL = {
  inheritAttrs: !1
}, Xi = /* @__PURE__ */ yt({
  ...WL,
  __name: "BaseSelect",
  props: {
    options: null,
    modelValue: null,
    alignRight: { type: Boolean },
    alignLeft: { type: Boolean },
    showIcon: { type: Boolean },
    fitContent: { type: Boolean }
  },
  emits: ["update:modelValue"],
  setup(e) {
    const n = e, r = E(() => {
      const a = n.options.find((l) => l.value === n.modelValue);
      return a == null ? void 0 : a.label;
    });
    return (a, l) => (O(), A("div", {
      class: ee(["vc-base-select", {
        "vc-fit-content": e.fitContent,
        "vc-has-icon": e.showIcon
      }])
    }, [
      C("select", wn(a.$attrs, {
        value: e.modelValue,
        class: ["vc-focus", {
          "vc-align-right": e.alignRight,
          "vc-align-left": e.alignLeft
        }],
        onChange: l[0] || (l[0] = (o) => a.$emit("update:modelValue", o.target.value))
      }), [
        (O(!0), A(Te, null, Le(e.options, (o) => (O(), A("option", {
          key: o.value,
          value: o.value,
          disabled: o.disabled
        }, pe(o.label), 9, FL))), 128))
      ], 16, RL),
      e.showIcon ? (O(), Fe(wi, {
        key: 0,
        name: "ChevronDown",
        size: "18"
      })) : se("", !0),
      e.fitContent ? (O(), A("div", NL, pe(W(r)), 1)) : se("", !0)
    ], 2));
  }
}), BL = {
  key: 0,
  class: "vc-time-header"
}, UL = { class: "vc-time-weekday" }, HL = { class: "vc-time-month" }, zL = { class: "vc-time-day" }, qL = { class: "vc-time-year" }, KL = { class: "vc-time-select-group" }, VL = /* @__PURE__ */ C("span", { class: "vc-time-colon" }, ":", -1), GL = /* @__PURE__ */ C("span", { class: "vc-time-colon" }, ":", -1), jL = /* @__PURE__ */ C("span", { class: "vc-time-decimal" }, ".", -1), Vd = /* @__PURE__ */ yt({
  __name: "TimePicker",
  props: {
    position: null
  },
  setup(e, { expose: n }) {
    const a = YL(e);
    n(a);
    const {
      locale: l,
      isValid: o,
      date: c,
      hours: f,
      minutes: h,
      seconds: p,
      milliseconds: g,
      options: w,
      hourOptions: M,
      isTimeMode: S,
      isAM: k,
      isAMOptions: U,
      is24hr: R,
      showHeader: P,
      timeAccuracy: J
    } = a;
    return (Q, H) => (O(), A("div", {
      class: ee(["vc-time-picker", [{ "vc-invalid": !W(o), "vc-attached": !W(S) }]])
    }, [
      be(fn, { name: "time-header" }, {
        default: le(() => [
          W(P) && W(c) ? (O(), A("div", BL, [
            C("span", UL, pe(W(l).formatDate(W(c), "WWW")), 1),
            C("span", HL, pe(W(l).formatDate(W(c), "MMM")), 1),
            C("span", zL, pe(W(l).formatDate(W(c), "D")), 1),
            C("span", qL, pe(W(l).formatDate(W(c), "YYYY")), 1)
          ])) : se("", !0)
        ]),
        _: 1
      }),
      C("div", KL, [
        be(wi, {
          name: "Clock",
          size: "17"
        }),
        be(Xi, {
          modelValue: W(f),
          "onUpdate:modelValue": H[0] || (H[0] = (z) => Vi(f) ? f.value = z : null),
          modelModifiers: { number: !0 },
          options: W(M),
          class: "vc-time-select-hours",
          "align-right": ""
        }, null, 8, ["modelValue", "options"]),
        W(J) > 1 ? (O(), A(Te, { key: 0 }, [
          VL,
          be(Xi, {
            modelValue: W(h),
            "onUpdate:modelValue": H[1] || (H[1] = (z) => Vi(h) ? h.value = z : null),
            modelModifiers: { number: !0 },
            options: W(w).minutes,
            class: "vc-time-select-minutes",
            "align-left": W(J) === 2
          }, null, 8, ["modelValue", "options", "align-left"])
        ], 64)) : se("", !0),
        W(J) > 2 ? (O(), A(Te, { key: 1 }, [
          GL,
          be(Xi, {
            modelValue: W(p),
            "onUpdate:modelValue": H[2] || (H[2] = (z) => Vi(p) ? p.value = z : null),
            modelModifiers: { number: !0 },
            options: W(w).seconds,
            class: "vc-time-select-seconds",
            "align-left": W(J) === 3
          }, null, 8, ["modelValue", "options", "align-left"])
        ], 64)) : se("", !0),
        W(J) > 3 ? (O(), A(Te, { key: 2 }, [
          jL,
          be(Xi, {
            modelValue: W(g),
            "onUpdate:modelValue": H[3] || (H[3] = (z) => Vi(g) ? g.value = z : null),
            modelModifiers: { number: !0 },
            options: W(w).milliseconds,
            class: "vc-time-select-milliseconds",
            "align-left": ""
          }, null, 8, ["modelValue", "options"])
        ], 64)) : se("", !0),
        W(R) ? se("", !0) : (O(), Fe(Xi, {
          key: 3,
          modelValue: W(k),
          "onUpdate:modelValue": H[4] || (H[4] = (z) => Vi(k) ? k.value = z : null),
          options: W(U)
        }, null, 8, ["modelValue", "options"]))
      ])
    ], 2));
  }
}), Av = /* @__PURE__ */ yt({
  __name: "DatePickerBase",
  setup(e) {
    const {
      attributes: n,
      calendarRef: r,
      color: a,
      displayMode: l,
      isDateTimeMode: o,
      isTimeMode: c,
      isRange: f,
      onDayClick: h,
      onDayMouseEnter: p,
      onDayKeydown: g
    } = Gl(), w = f.value ? [0, 1] : [0];
    return (M, S) => W(c) ? (O(), A("div", {
      key: 0,
      class: ee(`vc-container vc-bordered vc-${W(a)} vc-${W(l)}`)
    }, [
      (O(!0), A(Te, null, Le(W(w), (k) => (O(), Fe(Vd, {
        key: k,
        position: k
      }, null, 8, ["position"]))), 128))
    ], 2)) : (O(), Fe(Ov, {
      key: 1,
      attributes: W(n),
      ref_key: "calendarRef",
      ref: r,
      onDayclick: W(h),
      onDaymouseenter: W(p),
      onDaykeydown: W(g)
    }, {
      footer: le(() => [
        W(o) ? (O(!0), A(Te, { key: 0 }, Le(W(w), (k) => (O(), Fe(Vd, {
          key: k,
          position: k
        }, null, 8, ["position"]))), 128)) : se("", !0),
        be(fn, { name: "dp-footer" })
      ]),
      _: 1
    }, 8, ["attributes", "onDayclick", "onDaymouseenter", "onDaykeydown"]));
  }
}), ZL = {
  inheritAttrs: !1
}, XL = /* @__PURE__ */ yt({
  ...ZL,
  __name: "DatePickerPopover",
  setup(e) {
    const {
      datePickerPopoverId: n,
      color: r,
      displayMode: a,
      popoverRef: l,
      onPopoverBeforeShow: o,
      onPopoverAfterShow: c,
      onPopoverBeforeHide: f,
      onPopoverAfterHide: h
    } = Gl();
    return (p, g) => (O(), Fe(Vl, {
      id: W(n),
      placement: "bottom-start",
      class: ee(`vc-date-picker-content vc-${W(r)} vc-${W(a)}`),
      ref_key: "popoverRef",
      ref: l,
      onBeforeShow: W(o),
      onAfterShow: W(c),
      onBeforeHide: W(f),
      onAfterHide: W(h)
    }, {
      default: le(() => [
        be(Av, gt(cn(p.$attrs)), null, 16)
      ]),
      _: 1
    }, 8, ["id", "class", "onBeforeShow", "onAfterShow", "onBeforeHide", "onAfterHide"]));
  }
}), JL = yt({
  inheritAttrs: !1,
  emits: kL,
  props: PL,
  components: { DatePickerBase: Av, DatePickerPopover: XL },
  setup(e, n) {
    const r = IL(e, n), a = Ta(Kh(r, "calendarRef", "popoverRef"));
    return { ...r, slotCtx: a };
  }
});
function QL(e, n, r, a, l, o) {
  const c = Xe("DatePickerPopover"), f = Xe("DatePickerBase");
  return e.$slots.default ? (O(), A(Te, { key: 0 }, [
    j(e.$slots, "default", gt(cn(e.slotCtx))),
    be(c, gt(cn(e.$attrs)), null, 16)
  ], 64)) : (O(), Fe(f, gt(wn({ key: 1 }, e.$attrs)), null, 16));
}
const eY = /* @__PURE__ */ Cr(JL, [["render", QL]]);
function tY(e) {
  if (document.cookie && document.cookie !== "") {
    const n = document.cookie.split(";").find((r) => r.trim().startsWith(e + "="));
    return n ? decodeURIComponent(n.split("=")[1]) : null;
  }
  return null;
}
var sl = null;
function Tv() {
  return sl === null && (sl = tY("csrftoken")), sl;
}
class Xt {
  /**
   * Instanciate model with provided data and options.
   * By default `url` is taken from `data.url_`.
   */
  constructor(n = {}, { url: r = null, ...a } = {}) {
    this.url = r || n.url_, this.options = a, this.commit(n);
  }
  get errors() {
    return this.data && this.data.__errors__;
  }
  /**
   * Get instance id from its data
   */
  static getId(n) {
    return "id" in n ? n.id : n.pk;
  }
  /**
   * Return fetch options
   */
  static getOptions(n) {
    return {
      headers: {
        "Content-Type": "application/json",
        Accept: "application/json",
        "X-CSRFToken": Tv()
      },
      ...n
    };
  }
  /**
   * Return model instances for the provided list of model data.
   * @param {Array} items: array of data
   * @param {Object} options: options passed down to all model instances
   */
  static fromList(n, r = {}) {
    return n ? n.map((a) => new this(a, r)) : [];
  }
  /**
   * Fetch item from server
   */
  static fetch(n, { many: r = !1, ...a } = {}, l = {}) {
    a = this.getOptions(a);
    const o = fetch(n, a).then((c) => c.json());
    return r ? o.then((c) => (c instanceof Array || (c = c.results), this.fromList(c, l))) : o.then((c) => new this(c, { url: n, ...l }));
  }
  /**
   * Fetch data from server.
   */
  fetch(n) {
    return n = this.constructor.getOptions(n), fetch(this.url, n).then((r) => r.json()).then((r) => this.commit(r));
  }
  /**
   * Call API action on object.
   */
  action(n, r, a = !1) {
    r = this.constructor.getOptions(r);
    const l = fetch(this.url + n, r);
    return a ? l.then((o) => o.json()).then((o) => {
      this.commit(o), this.data;
    }) : l;
  }
  /**
   * Update instance's data with provided data. Return None
   */
  commit(n) {
    this.data = n, this.id = this.constructor.getId(this.data);
  }
  /**
   * Update model data, without reset previous value
   */
  update(n) {
    this.data = { ...this.data, ...n }, this.id = this.constructor.getId(this.data);
  }
  /**
   * Save instance into localStorage.
   */
  store(n) {
    window.localStorage.setItem(n, JSON.stringify(this.data));
  }
  /**
   * Load model instance from localStorage.
   */
  static storeLoad(n) {
    let r = window.localStorage.getItem(n);
    return r === null ? r : new this(JSON.parse(r));
  }
  /**
   * Return true if model instance has no data
   */
  get isEmpty() {
    return !this.data || Object.keys(this.data).findIndex((n) => !!this.data[n] && this.data[n] !== 0) == -1;
  }
  /**
   * Return error for a specific attribute name if any
   */
  error(n = null) {
    return n === null ? this.errors : this.errors && this.errors[n];
  }
}
let ys = class {
  constructor(n, { items: r = [], url: a = null, args: l = {}, unique: o = null, max: c = null, storeKey: f = null } = {}) {
    this.items = [], this.model = n, this.url = a, this.unique = o, this.max = c, this.storeKey = f;
    for (var h of r)
      this.push(h, { args: l, save: !1 });
  }
  get length() {
    return this.items.length;
  }
  /**
   * Fetch multiple items from server
   */
  static fetch(n, r, a = null, l = null) {
    return a = n.getOptions(a), fetch(r, a).then((o) => o.json()).then((o) => (o instanceof Array ? o : o.results).map((c) => new n(c, { url: r, ...l })));
  }
  /**
   * Load list from localStorage
   */
  static storeLoad(n, r, a = {}) {
    let l = window.localStorage.getItem(r);
    return new this(n, { ...a, storeKey: r, items: l ? JSON.parse(l) : [] });
  }
  /**
   * Store list into localStorage
   */
  store() {
    this.storeKey && window.localStorage.setItem(this.storeKey, JSON.stringify(
      this.items.map((n) => n.data)
    ));
  }
  /**
   * Save item
   */
  save() {
    this.storeKey && this.store();
  }
  /**
   * Get item at index
   */
  get(n) {
    return this.items[n];
  }
  /**
   * Find an item by id or using a predicate function
   */
  find(n) {
    return n instanceof Function ? this.items.find(n) : this.items.find((r) => r.id == n.id);
  }
  /**
   * Find item index by id or using a predicate function
   */
  findIndex(n) {
    return n instanceof Function ? this.items.findIndex(n) : this.items.findIndex((r) => r.id == n.id);
  }
  /**
   * Add item to set, return index.
   */
  push(n, { args: r = {}, save: a = !0 } = {}) {
    if (n = n instanceof this.model ? n : new this.model(n, r), this.unique) {
      let l = this.findIndex(n);
      if (l > -1)
        return l;
    }
    return this.max && this.items.length >= this.max && this.items.splice(0, this.items.length - this.max), this.items.push(n), a && this.save(), this.items.length - 1;
  }
  /**
   * Remove item from set by index
   */
  remove(n, { save: r = !0 } = {}) {
    this.items.splice(n, 1), r && this.save();
  }
  /**
   * Clear items, assign new ones
   */
  reset(n = []) {
    this.items = [];
    for (var r of n)
      this.push(r);
  }
  move(n, r) {
    if (n >= this.length || r > this.length)
      throw "source or target index is not in range";
    const a = this.items[n];
    this.items.splice(n, 1), this.items.splice(r, 0, a);
  }
};
ys[Symbol.iterator] = function() {
  return this.items[Symbol.iterator]();
};
const nt = (e, n) => {
  const r = e.__vccOpts || e;
  for (const [a, l] of n)
    r[a] = l;
  return r;
}, nY = {
  emit: ["start", "done"],
  props: {
    //! Component tag, by default, `button`
    tag: { type: String, default: "a" },
    //! Button icon
    icon: String,
    //! Data or model instance to send
    data: Object,
    //! Action method, by default, `POST`
    method: { type: String, default: "POST" },
    //! If provided open confirmation box before proceeding
    confirm: { type: String, default: "" },
    //! Action url
    url: String,
    //! Extra request options
    fetchOptions: { type: Object, default: () => ({}) },
    //! Component class while action is running
    runClass: String,
    //! Icon class while action is running
    runIcon: String
  },
  computed: {
    //! Input data as model instance
    item() {
      return this.data instanceof Xt ? this.data : new Xt(this.data);
    },
    //! Computed button class
    buttonClass() {
      return this.promise ? this.runClass : "";
    }
  },
  data() {
    return {
      promise: !1
    };
  },
  methods: {
    call() {
      if (this.promise || !this.url || this.confirm && !confirm(this.confirm))
        return;
      const e = Xt.getOptions({
        ...this.fetchOptions,
        method: this.method,
        body: JSON.stringify(this.item.data)
      });
      return this.promise = fetch(this.url, e).then((n) => n.text()).then((n) => (n = n && JSON.parse(n) || null, this.promise = null, this.$emit("done", n), n), (n) => (this.promise = null, n)), this.promise;
    }
  }
}, rY = { key: 0 }, iY = {
  key: 1,
  class: "icon is-small"
}, sY = { key: 2 };
function aY(e, n, r, a, l, o) {
  return O(), Fe(wr(r.tag), {
    onClickCapture: In(o.call, ["stop"]),
    type: "button",
    class: ee([o.buttonClass, this.promise && "blink" || ""])
  }, {
    default: le(() => [
      l.promise && r.runIcon ? (O(), A("span", rY, [
        C("i", {
          class: ee(r.runIcon)
        }, null, 2)
      ])) : r.icon ? (O(), A("span", iY, [
        C("i", {
          class: ee(r.icon)
        }, null, 2)
      ])) : se("", !0),
      e.$slots.default ? (O(), A("span", sY, [
        j(e.$slots, "default")
      ])) : se("", !0)
    ]),
    _: 3
  }, 40, ["onClickCapture", "class"]);
}
const jl = /* @__PURE__ */ nt(nY, [["render", aY]]), oY = {
  emit: [
    "change",
    "keypress",
    "keydown",
    "keyup",
    "select",
    "unselect",
    "update:modelValue"
  ],
  props: {
    //! Search URL (where `${query}` is replaced by search term)
    url: String,
    //! Items' model
    model: Function,
    //! Input tag class
    inputClass: Array,
    //! input text placeholder
    placeholder: String,
    //! input form field name
    name: String,
    //! Field on items to use as label
    labelField: String,
    //! Field on selected item to get selectedValue from, if any
    valueField: { type: String, default: null },
    count: { type: Number, count: 10 },
    //! If true, show button when value has been selected
    button: Boolean,
    //! If true, value must come from a selection
    mustExist: { type: Boolean, default: !1 },
    //! Minimum input size before fetching
    minFetchLength: { type: Number, default: 3 },
    modelValue: { default: "" }
  },
  data() {
    return {
      inputValue: this.modelValue || "",
      query: "",
      items: [],
      selectedIndex: -1,
      cursor: -1,
      promise: null
    };
  },
  watch: {
    modelValue(e) {
      this.inputValue = e;
    },
    inputValue(e, n) {
      e != n && e != this.modelValue && (this.$emit("update:modelValue", e), this.$emit("change", { target: this.$refs.input })), this.selectedLabel != e && (this.selectedIndex = -1);
    }
  },
  computed: {
    isFetching() {
      return !!this.promise;
    },
    selected() {
      let e = this.selectedIndex;
      return e < 0 ? null : (e = Math.min(e, this.items.length - 1), this.items[e]);
    },
    selectedValue() {
      let e = this.itemValue(this.selected);
      return !e && !this.mustExist && (e = this.inputValue), e;
    },
    selectedLabel() {
      return this.itemLabel(this.selected);
    },
    dropdownClass() {
      var e = this.cursor > -1 && this.items.length;
      return e && this.items.length == 1 && this.itemValue(this.items[0]) == this.inputValue && (e = !1), ["dropdown is-fullwidth", e ? "is-active" : ""];
    }
  },
  methods: {
    itemValue(e) {
      return this.valueField ? e && e[this.valueField] : e;
    },
    itemLabel(e) {
      return this.labelField ? e && e[this.labelField] : e;
    },
    hide() {
      this.cursor = -1, this.selectedIndex = -1;
    },
    move(e = -1, n = !1) {
      n && (e += this.cursor), this.cursor = Math.max(-1, Math.min(e, this.items.length - 1));
    },
    select(e = -1, n = !1, r = null) {
      if (n)
        e += this.selectedIndex;
      else if (e == this.selectedIndex)
        return;
      this.selectedIndex = Math.max(-1, Math.min(e, this.items.length - 1)), e >= 0 && (this.inputValue = this.selectedLabel, this.$refs.input.focus()), this.selectedIndex < 0 ? this.$emit("unselect") : this.$emit("select", e, this.selected, this.selectedValue), r !== null && (r && this.move(0) || this.move(-1));
    },
    onInputFocus() {
      this.cursor < 0 && this.move(0);
    },
    onBlur(e) {
      if (this.items.length) {
        var n = e.relatedTarget && Math.parseInt(e.relatedTarget.dataset.autocompleteIndex);
        n != null && this.select(n, !1, !1), this.cursor = -1;
      }
    },
    onKeyDown(e) {
      if (!(e.ctrlKey || e.altKey || e.metaKey)) {
        switch (e.keyCode) {
          case 13:
            this.select(this.cursor, !1, !1);
            break;
          case 27:
            this.hide(), this.select();
            break;
          case 38:
            this.move(-1, !0);
            break;
          case 40:
            this.move(1, !0);
            break;
          default:
            return;
        }
        e.preventDefault(), e.stopPropagation();
      }
    },
    onKeyUp(e) {
      if (e.ctrlKey || e.altKey || e.metaKey)
        return;
      const n = e.target.value;
      if (n !== this.query) {
        if (this.inputValue = n, !n)
          return this.selected && this.select(-1);
        (!this.minFetchLength || n.length >= this.minFetchLength) && this.fetch(n);
      }
    },
    fetch(e) {
      if (!(!e || this.promise)) {
        this.query = e;
        var n = this.url.replace("${query}", e), r = this.model ? this.model.fetch(n, { many: !0 }) : fetch(n, Xt.getOptions()).then((a) => a.json());
        return r = r.then((a) => (a.results && (a = a.results), this.items = a.filter((l) => l) || [], this.promise = null, this.move(0), a), (a) => {
          this.promise = null, Promise.reject(a);
        }), this.promise = r, r;
      }
    }
  },
  mounted() {
    this.$el.closest("form").addEventListener("reset", () => {
      this.inputValue = this.value, this.select(-1);
    });
  }
}, lY = { class: "control" }, uY = ["name", "value"], cY = ["placeholder"], fY = /* @__PURE__ */ C("span", { class: "icon is-small ml-1" }, [
  /* @__PURE__ */ C("i", { class: "fa fa-pen" })
], -1), dY = {
  key: 0,
  class: "is-inline-block"
}, hY = { class: "dropdown-menu is-fullwidth" }, vY = {
  class: "dropdown-content",
  style: { overflow: "hidden" }
}, pY = ["data-autocomplete-index", "onClick", "title"];
function mY(e, n, r, a, l, o) {
  return O(), A("div", lY, [
    C("input", {
      type: "hidden",
      name: r.name,
      value: o.selectedValue,
      onChange: n[0] || (n[0] = (c) => e.$emit("change", c))
    }, null, 40, uY),
    Xn(C("input", {
      type: "text",
      ref: "input",
      class: ee(["input is-fullwidth", r.inputClass]),
      "onUpdate:modelValue": n[1] || (n[1] = (c) => l.inputValue = c),
      placeholder: r.placeholder,
      onKeydownCapture: n[2] || (n[2] = (...c) => o.onKeyDown && o.onKeyDown(...c)),
      onKeyup: n[3] || (n[3] = (c) => {
        o.onKeyUp(c), e.$emit("keyup", c);
      }),
      onKeydown: n[4] || (n[4] = (c) => e.$emit("keydown", c)),
      onKeypress: n[5] || (n[5] = (c) => e.$emit("keypress", c)),
      onFocus: n[6] || (n[6] = (...c) => o.onInputFocus && o.onInputFocus(...c)),
      onBlur: n[7] || (n[7] = (...c) => o.onBlur && o.onBlur(...c))
    }, null, 42, cY), [
      [pi, !r.button || !o.selected],
      [Qd, l.inputValue]
    ]),
    o.selected && r.button ? (O(), A("a", {
      key: 0,
      class: "button is-normal is-fullwidth has-text-left is-inline-block overflow-hidden",
      onClick: n[8] || (n[8] = (c) => o.select(-1, !1, !0))
    }, [
      fY,
      o.selected ? (O(), A("span", dY, [
        j(e.$slots, "button", {
          index: l.selectedIndex,
          item: o.selected,
          valueField: r.valueField,
          labelField: r.labelField
        }, () => [
          Zt(pe(r.labelField && o.selected.data[r.labelField] || o.selected), 1)
        ])
      ])) : se("", !0)
    ])) : se("", !0),
    C("div", {
      class: ee(o.dropdownClass)
    }, [
      C("div", hY, [
        C("div", vY, [
          (O(!0), A(Te, null, Le(l.items, (c, f) => (O(), A("a", {
            key: c.id,
            href: "#",
            "data-autocomplete-index": f,
            onClick: (h) => o.select(f, !1, !1),
            class: ee(["dropdown-item", f == this.cursor ? "is-active" : ""]),
            title: r.labelField && c.data[r.labelField] || c,
            tabindex: "-1"
          }, [
            j(e.$slots, "item", {
              index: f,
              item: c,
              valueField: r.valueField,
              labelField: r.labelField
            }, () => [
              Zt(pe(r.labelField && c.data[r.labelField] || c), 1)
            ])
          ], 10, pY))), 128))
        ])
      ])
    ], 2)
  ]);
}
const gY = /* @__PURE__ */ nt(oY, [["render", mY]]);
class vi {
  constructor(n, r = null, a = null) {
    this.el = n, this.rect = n.getBoundingClientRect(), { min: r, max: a } = this.minmax(r, a), this.min = r, this.max = a, this.size = a - r;
  }
  minmax(n = null, r = null) {
    return n = n === null ? this.rect.left : n, r = r === null ? this.rect.right : r, { min: n, max: r };
  }
  relative(n) {
    return new vi(this.el, this.min - n.min, this.max - n.min);
  }
}
class Gd extends vi {
  constructor(n, r) {
    super(n), this.index = r;
  }
  visible(n) {
    return n.min <= this.min && n.max >= this.max;
  }
}
const yY = {
  setup() {
    return {
      viewport: Ge(null),
      container: Ge(null)
    };
  },
  data() {
    return {
      cards: [],
      index: 0,
      refresh_: 0
    };
  },
  props: {
    cardSelector: { type: String, default: "" },
    containerClass: { type: String, default: "" },
    buttonClass: { type: String, default: "button" },
    leftButtonIcon: { type: String, default: "fas fa-chevron-left" },
    rightButtonIcon: { type: String, default: "fas fa-chevron-right" }
  },
  computed: {
    card() {
      return this.cards()[this.index];
    },
    showPrev() {
      return this.index > 0;
    },
    showNext() {
      if (!this.cards || this.cards.length <= 1)
        return !1;
      let e = this.bullets[this.bullets.length - 1];
      return this.index != e;
    },
    bullets() {
      if (!this.cards || !this.$refs.viewport)
        return [];
      let e = new vi(this.$refs.container), n = new vi(this.$refs.viewport).size, r = [], a = 0, l = n;
      for (r.push(a); a < this.cards.length; )
        for (; a < this.cards.length; a++) {
          let o = this.cards[a].relative(e);
          if (o.max > l) {
            l = o.min + n, r.push(a), a++;
            break;
          }
        }
      return r;
    }
  },
  methods: {
    getCards() {
      return this.$refs.container ? (this.cardSelector ? [...this.$refs.container.querySelectorAll(this.cardSelector)] : [...this.$refs.container.children]).map((n, r) => new Gd(n, r)) : [];
    },
    select(e, n = !1) {
      n && (e = this.index + e), e = Math.min(e, this.cards.length), e = Math.max(e, 0);
      let r = this.cards[e];
      if (!r)
        return null;
      r = new Gd(r.el);
      const a = new vi(this.$refs.container), l = r.relative(a);
      return this.$refs.container.style.marginLeft = `-${l.min}px`, this.index = e, r.el;
    },
    next() {
      let e = this.bullets.indexOf(this.index), n = this.bullets[e + 1];
      this.select(n);
    },
    prev() {
      let e = this.bullets.indexOf(this.index), n = this.bullets[e - 1];
      this.select(n);
    },
    refresh() {
      this.cards = this.getCards(), this.select(this.index), this.refresh_++;
    }
  },
  mounted() {
    this.observers = [
      new MutationObserver(() => this.refresh()),
      new ResizeObserver(() => this.refresh())
    ], this.observers[0].observe(this.$refs.container, { childList: !0 }), this.observers[1].observe(this.$refs.container), this.refresh();
  },
  unmounted() {
    for (var e of this.observers)
      e.disconnect();
  }
}, _Y = { class: "a-carousel" }, bY = {
  ref: "viewport",
  class: "a-carousel-viewport"
}, wY = { class: "a-carousel-bullets-container" }, DY = { class: "left" }, $Y = ["onClick"], CY = {
  key: 0,
  class: "fa fa-circle"
}, SY = {
  key: 1,
  class: "far fa-circle"
}, MY = { class: "right" };
function OY(e, n, r, a, l, o) {
  return O(), A("section", _Y, [
    C("nav", bY, [
      C("section", {
        ref: "container",
        class: ee(["a-carousel-container", r.containerClass])
      }, [
        j(e.$slots, "default", {}, void 0, !0)
      ], 2)
    ], 512),
    C("nav", wY, [
      C("span", DY, [
        o.showPrev ? (O(), A("span", {
          key: 0,
          class: "icon bullet",
          onClick: n[0] || (n[0] = (c) => o.prev())
        }, [
          C("i", {
            class: ee(r.leftButtonIcon)
          }, null, 2)
        ])) : se("", !0)
      ]),
      o.bullets.length > 1 ? (O(!0), A(Te, { key: 0 }, Le(o.bullets, (c) => (O(), A("span", {
        class: "icon bullet",
        key: c,
        onClick: (f) => o.select(c)
      }, [
        c == l.index ? (O(), A("i", CY)) : (O(), A("i", SY))
      ], 8, $Y))), 128)) : se("", !0),
      C("span", MY, [
        o.showNext ? (O(), A("span", {
          key: 0,
          class: "icon bullet",
          onClick: n[1] || (n[1] = (c) => o.next())
        }, [
          C("i", {
            class: ee(r.rightButtonIcon)
          }, null, 2)
        ])) : se("", !0)
      ]),
      j(e.$slots, "bullets-right", { vBind: this }, void 0, !0)
    ])
  ]);
}
const xY = /* @__PURE__ */ nt(yY, [["render", OY], ["__scopeId", "data-v-e8953967"]]), AY = {
  data() {
    return {
      active: this.open
    };
  },
  props: {
    tag: { type: String, default: "div" },
    label: { type: String, default: "" },
    labelIcon: { type: String, default: "" },
    buttonTag: { type: String, default: "button" },
    activeClass: { type: String, default: "is-active" },
    buttonClass: { type: String, default: "button" },
    buttonIcon: { type: String, default: "fa fa-angle-down" },
    buttonIconClose: { type: String, default: "fa fa-angle-up" },
    contentClass: String,
    open: { type: Boolean, default: !1 },
    noButton: { type: Boolean, default: !1 }
  },
  methods: {
    toggle() {
      this.active = !this.active;
    }
  }
}, TY = {
  key: 0,
  class: "icon"
}, PY = { class: "icon" };
function kY(e, n, r, a, l, o) {
  return O(), Fe(wr(r.tag), {
    class: ee([e.itemClass, l.active ? r.activeClass : ""])
  }, {
    default: le(() => [
      j(e.$slots, "before-button", {
        toggle: o.toggle,
        active: l.active
      }),
      j(e.$slots, "button", {
        toggle: o.toggle,
        active: l.active
      }, () => [
        (O(), Fe(wr(r.buttonTag), {
          class: ee(r.buttonClass),
          onClick: n[0] || (n[0] = (c) => o.toggle())
        }, {
          default: le(() => [
            r.labelIcon ? (O(), A("span", TY, [
              C("i", {
                class: ee(r.labelIcon)
              }, null, 2)
            ])) : se("", !0),
            C("span", null, pe(r.label), 1),
            C("span", PY, [
              l.active ? se("", !0) : (O(), A("i", {
                key: 0,
                class: ee(r.buttonIcon)
              }, null, 2)),
              l.active ? (O(), A("i", {
                key: 1,
                class: ee(r.buttonIconClose)
              }, null, 2)) : se("", !0)
            ])
          ]),
          _: 1
        }, 8, ["class"]))
      ]),
      Xn(C("div", {
        class: ee(r.contentClass)
      }, [
        j(e.$slots, "default")
      ], 2), [
        [pi, l.active]
      ])
    ]),
    _: 3
  }, 8, ["class"]);
}
const IY = /* @__PURE__ */ nt(AY, [["render", kY]]);
class _s extends Xt {
  constructor({ sound: n = {}, ...r } = {}, a = {}) {
    super({ ...n, ...r }, a);
  }
  get name() {
    return this.data.name;
  }
  get src() {
    return this.data.url;
  }
}
const EY = {
  data() {
    return {};
  },
  props: {
    page: Object,
    title: String
  }
};
function LY(e, n, r, a, l, o) {
  return O(), A("div", null, [
    j(e.$slots, "default")
  ]);
}
const Pv = /* @__PURE__ */ nt(EY, [["render", LY]]), YY = {
  extends: Pv,
  data() {
    return {
      podcasts: new ys(_s, { items: this.page.podcasts })
    };
  }
};
function RY(e, n, r, a, l, o) {
  return j(e.$slots, "default", {
    page: e.page,
    podcasts: l.podcasts
  });
}
const FY = /* @__PURE__ */ nt(YY, [["render", RY]]), NY = {
  emits: ["select", "unselect", "move"],
  data() {
    return {
      selectedIndex: this.defaultIndex
    };
  },
  props: {
    listClass: String,
    itemClass: String,
    defaultIndex: { type: Number, default: -1 },
    set: Object,
    orderable: { type: Boolean, default: !1 },
    itemTag: { default: "li" },
    listTag: { default: "ul" }
  },
  computed: {
    model() {
      return this.set.model;
    },
    items() {
      return this.set.items;
    },
    length() {
      return this.set.length;
    },
    selected() {
      return this.selectedIndex > -1 && this.items.length > this.selectedIndex > -1 ? this.items[this.selectedIndex] : null;
    }
  },
  methods: {
    get(e) {
      return this.set.get(e);
    },
    find(e) {
      return this.set.find(e);
    },
    findIndex(e) {
      return this.set.findIndex(e);
    },
    remove(e, n = !1) {
      this.set.remove(e), e < this.selectedIndex && this.selectedIndex--, n && this.selectedIndex == e && this.select(e);
    },
    select(e) {
      return this.selectedIndex = e > -1 && this.items.length ? e % this.items.length : -1, this.$emit("select", { item: this.selected, index: this.selectedIndex }), this.selectedIndex;
    },
    unselect() {
      this.$emit("unselect", { item: this.selected, index: this.selectedIndex }), this.selectedIndex = -1;
    },
    onDragStart(e) {
      const r = `row:${e.target.dataset.index}`;
      e.dataTransfer.setData("text/cell", r), e.dataTransfer.dropEffect = "move";
    },
    onDragOver(e) {
      e.preventDefault(), e.dataTransfer.dropEffect = "move";
    },
    onDrop(e) {
      const n = e.dataTransfer.getData("text/cell");
      if (!n || !n.startsWith("row:"))
        return;
      e.preventDefault();
      const r = Number(n.slice(4)), a = e.target.tagName == this.itemTag ? e.target : e.target.closest(this.itemTag);
      this.$emit("move", {
        from: r,
        target: a,
        to: Number(a.dataset.index),
        set: this.set
      });
    }
  }
};
function WY(e, n, r, a, l, o) {
  return O(), A("div", null, [
    j(e.$slots, "header"),
    (O(), Fe(wr(r.listTag), {
      class: ee(r.listClass)
    }, {
      default: le(() => [
        (O(!0), A(Te, null, Le(o.items, (c, f) => (O(), Fe(wr(r.itemTag), {
          key: f,
          class: ee(r.itemClass),
          onClick: (h) => o.select(f),
          draggable: r.orderable,
          "data-index": f,
          onDragstart: o.onDragStart,
          onDragover: o.onDragOver,
          onDrop: o.onDrop
        }, {
          default: le(() => [
            j(e.$slots, "item", {
              selected: f == l.selectedIndex,
              set: r.set,
              index: f,
              item: c
            })
          ]),
          _: 2
        }, 1064, ["class", "onClick", "draggable", "data-index", "onDragstart", "onDragover", "onDrop"]))), 128))
      ]),
      _: 3
    }, 8, ["class"])),
    j(e.$slots, "footer")
  ]);
}
const ds = /* @__PURE__ */ nt(NY, [["render", WY]]);
function Zl(e, ...n) {
  return setInterval((...r) => {
    !document.hidden && e(...r);
  }, ...n);
}
class BY {
  constructor({ url: n, timeout: r = 10, src: a = "" } = {}) {
    this.url = n, this.timeout = r, this.src = a, this.interval = null, this.promise = null, this.items = [], this.current = null;
  }
  //-- data refreshing
  drop() {
    this.promise = null;
  }
  /**
   * Fetch data from server.
   *
   * @param {Object} options
   * @param {Function} options.then: call this method on fetch, `this` passed as argument.
   * @return {Promise} Promise resolving to fetched items.
   */
  fetch({ then: n = null } = {}) {
    const r = fetch(this.url).then(
      (a) => a.ok ? a.json() : Promise.reject(a)
    ).then((a) => {
      a = a.results, a.forEach((c) => {
        c.start && (c.start = new Date(c.start)), c.end && (c.end = new Date(c.end));
      }), this.items = a;
      const l = /* @__PURE__ */ new Date();
      let o = a.find((c) => c.start && c.start <= l < c.end) || a.length ? a[0] : null;
      return o ? (o.src = this.src, this.current = new Xt(o)) : this.current = null, n && n(this), this.items;
    });
    return this.promise = r, r;
  }
  _refresh(n = {}) {
    const r = this.fetch(n);
    return r.then(() => {
      if (r != this.promise)
        return [];
    }), r;
  }
  /**
   * Refresh live info every `this.timeout`.
   * @param {Object} options: arguments passed to `this.fetch`.
   */
  refresh(n = {}) {
    if (this.interval === null)
      return this._refresh(n), this.interval = Zl(() => this._refresh(n), this.timeout * 1e3), this.interval;
  }
  stopRefresh() {
    this.interval !== null && clearInterval(this.interval);
  }
}
const UY = {
  props: {
    data: { type: Object, default: () => {
    } },
    name: String,
    player: Object,
    page_url: String,
    actions: { type: Array, default: () => [] },
    index: { type: Number, default: null }
  },
  computed: {
    item() {
      return this.data instanceof Xt ? this.data : new _s(this.data || {});
    },
    loaded() {
      return this.player && this.player.isLoaded(this.item);
    },
    playing() {
      return this.player && this.player.isPlaying(this.item);
    },
    paused() {
      return this.player && this.player.paused && this.loaded;
    },
    pinned() {
      return this.player && this.player.sets.pin.find(this.item);
    }
  },
  methods: {
    hasAction(e) {
      return this.actions && this.actions.indexOf(e) != -1;
    }
  }
}, HY = { class: "button-group actions" }, zY = ["href"], qY = /* @__PURE__ */ C("span", { class: "icon is-small" }, [
  /* @__PURE__ */ C("i", { class: "fa fa-external-link" })
], -1), KY = [
  qY
], VY = ["href"], GY = /* @__PURE__ */ C("span", { class: "icon is-small" }, [
  /* @__PURE__ */ C("span", { class: "fa fa-download" })
], -1), jY = [
  GY
], ZY = /* @__PURE__ */ C("span", { class: "icon is-small" }, [
  /* @__PURE__ */ C("span", { class: "fa fa-star" })
], -1), XY = [
  ZY
];
function JY(e, n, r, a, l, o) {
  return O(), A("div", {
    class: ee(["a-sound-item m-0 button-group", o.playing && "playing" || ""])
  }, [
    j(e.$slots, "title", {
      player: r.player,
      item: o.item,
      loaded: o.loaded
    }, () => [
      C("span", {
        class: ee(["label is-flex-grow-1 align-left", o.playing && "blink" || ""]),
        onClick: n[0] || (n[0] = In((c) => e.$emit("togglePlay"), ["stop"]))
      }, pe(r.name || o.item.name), 3)
    ]),
    j(e.$slots, "after-title", {
      player: r.player,
      item: o.item,
      loaded: o.loaded
    }),
    C("div", HY, [
      o.hasAction("page") ? (O(), A("a", {
        key: 0,
        class: "button action",
        href: o.item.data.page_url
      }, KY, 8, zY)) : se("", !0),
      o.hasAction("download") && o.item.data.is_downloadable ? (O(), A("a", {
        key: 1,
        class: "button action",
        href: o.item.data.url,
        target: "_blank"
      }, jY, 8, VY)) : se("", !0),
      o.hasAction("pin") && r.player && r.player.sets.pin != e.$parent.set ? (O(), A("button", {
        key: 2,
        class: ee(["button action", o.pinned ? "selected" : "not-selected"]),
        onClick: n[1] || (n[1] = In((c) => r.player.togglePlaylist("pin", o.item), ["stop"]))
      }, XY, 2)) : se("", !0),
      j(e.$slots, "actions", {
        player: r.player,
        item: o.item,
        loaded: o.loaded
      })
    ]),
    j(e.$slots, "extra-right", {
      player: r.player,
      item: o.item,
      loaded: o.loaded
    })
  ], 2);
}
const kv = /* @__PURE__ */ nt(UY, [["render", JY]]), QY = {
  extends: ds,
  emits: [...ds.emits, "remove"],
  components: { ASoundItem: kv },
  props: {
    actions: Array,
    // FIXME: remove
    name: String,
    player: Object,
    editable: Boolean,
    withLink: Boolean
  },
  computed: {
    self() {
      return this;
    },
    player_() {
      return this.player || window.aircox.player;
    }
  },
  methods: {
    hasAction(e) {
      return this.actions && this.actions.indexOf(e) != -1;
    },
    selectNext() {
      let e = this.selectedIndex + 1;
      return this.select(e >= this.items.length ? -1 : e);
    },
    togglePlay(e) {
      this.player_.isPlaying(this.set.get(e)) ? this.player_.pause() : this.select(e);
    }
  }
}, eR = { class: "a-playlist" }, tR = { class: "header" }, nR = ["onClick"], rR = ["onClick"], iR = /* @__PURE__ */ C("span", { class: "icon is-small" }, [
  /* @__PURE__ */ C("span", { class: "fa fa-close" })
], -1), sR = [
  iR
];
function aR(e, n, r, a, l, o) {
  const c = Xe("ASoundItem");
  return O(), A("div", eR, [
    C("div", tR, [
      j(e.$slots, "header")
    ]),
    C("ul", {
      class: ee(e.listClass)
    }, [
      (O(!0), A(Te, null, Le(e.items, (f, h) => (O(), A("li", {
        class: ee([e.itemClass, r.player.isPlaying(f) ? "is-active" : ""]),
        onClick: (p) => !o.hasAction("play") && e.select(h),
        key: h
      }, [
        be(c, {
          data: f,
          index: h,
          set: e.set,
          player: o.player_,
          onTogglePlay: (p) => o.togglePlay(h),
          actions: r.actions
        }, {
          "after-title": le((p) => [
            j(e.$slots, "after-title", gt(cn(p)))
          ]),
          actions: le((p) => [
            j(e.$slots, "actions", gt(cn(p))),
            r.editable ? (O(), A("button", {
              key: 0,
              class: "button",
              onClick: In((g) => e.remove(h, !0), ["stop"])
            }, sR, 8, rR)) : se("", !0)
          ]),
          _: 2
        }, 1032, ["data", "index", "set", "player", "onTogglePlay", "actions"])
      ], 10, nR))), 128))
    ], 2),
    j(e.$slots, "footer")
  ]);
}
const Iv = /* @__PURE__ */ nt(QY, [["render", aR]]), oR = {
  data() {
    return {
      hoverValue: null
    };
  },
  props: {
    value: Number,
    max: Number,
    format: { type: Function, default: (e) => e },
    progressClass: { default: "a-progress-bar" },
    vertical: { type: Boolean, default: !1 }
  },
  computed: {
    valueDisplay() {
      return this.hoverValue === null ? this.value : this.hoverValue;
    },
    progressStyle() {
      if (!this.max)
        return null;
      let e = this.max ? this.valueDisplay * 100 / this.max : 0;
      return this.vertical ? { height: `${e}%` } : { width: `${e}%` };
    }
  },
  methods: {
    xToValue(e) {
      return e * this.max / this.$refs.bar.getBoundingClientRect().width;
    },
    yToValue(e) {
      return e * this.max / this.$refs.bar.getBoundingClientRect().height;
    },
    valueFromEvent(e) {
      let n = e.currentTarget.getBoundingClientRect();
      return this.vertical ? this.yToValue(e.clientY - n.y) : this.xToValue(e.clientX - n.x);
    },
    onClick(e) {
      this.$emit("select", this.valueFromEvent(e));
    },
    onMouseMove(e) {
      e.type == "mouseleave" ? this.hoverValue = null : this.hoverValue = this.valueFromEvent(e);
    }
  }
}, lR = { class: "a-progress m-0" }, uR = { class: "time-now" }, cR = { key: 0 }, fR = { class: "time-total" };
function dR(e, n, r, a, l, o) {
  return O(), A("div", lR, [
    C("time", uR, [
      j(e.$slots, "value", {
        value: r.value,
        max: r.max
      }, () => [
        Zt(pe(r.format(r.value)), 1)
      ])
    ]),
    C("div", {
      ref: "bar",
      class: "a-progress-bar-container",
      onClick: n[0] || (n[0] = In((...c) => o.onClick && o.onClick(...c), ["stop"])),
      onMouseleave: n[1] || (n[1] = In((...c) => o.onMouseMove && o.onMouseMove(...c), ["stop"])),
      onMousemove: n[2] || (n[2] = In((...c) => o.onMouseMove && o.onMouseMove(...c), ["stop"]))
    }, [
      C("div", {
        class: ee(r.progressClass),
        style: fi(o.progressStyle)
      }, [
        l.hoverValue ? (O(), A("time", cR, pe(r.format(l.hoverValue)), 1)) : (O(), A(Te, { key: 1 }, [
          Zt(" ")
        ], 64))
      ], 6)
    ], 544),
    C("time", fR, [
      j(e.$slots, "value", {
        value: o.valueDisplay,
        max: r.max
      }, () => [
        Zt(pe(r.format(r.max)), 1)
      ])
    ])
  ]);
}
const Ev = /* @__PURE__ */ nt(oR, [["render", dR]]), li = {
  paused: 0,
  playing: 1,
  loading: 2
}, hR = {
  components: { APlaylist: Iv, AProgress: Ev },
  data() {
    let e = new Audio();
    e.addEventListener("ended", (a) => this.onState(a)), e.addEventListener("pause", (a) => this.onState(a)), e.addEventListener("playing", (a) => this.onState(a)), e.addEventListener("timeupdate", () => {
      this.currentTime = this.audio.currentTime;
    }), e.addEventListener("durationchange", () => {
      this.duration = Number.isFinite(this.audio.duration) ? this.audio.duration : null;
    });
    let n = this.liveArgs ? Ta(new BY(this.liveArgs)) : null;
    n && n.refresh();
    const r = {};
    for (const a in this.playlists)
      r[a] = ys.storeLoad(
        _s,
        "playlist." + a,
        { max: 30, unique: !0 }
      );
    return {
      audio: e,
      duration: 0,
      currentTime: 0,
      state: li.paused,
      live: n,
      /// Loaded item
      loaded: null,
      //! Active panel name
      panel: null,
      //! current playing playlist name
      playlistName: null,
      //! players' playlists' sets
      sets: r
    };
  },
  props: {
    buttonTitle: String,
    liveArgs: Object,
    ///! dict of {'slug': ['Label', 'icon']}
    playlists: Object
  },
  computed: {
    self() {
      return this;
    },
    paused() {
      return this.state == li.paused;
    },
    playing() {
      return this.state == li.playing;
    },
    loading() {
      return this.state == li.loading;
    },
    playlist() {
      return this.playlistName ? this.$refs[this.playlistName][0] : null;
    },
    current() {
      return this.loaded ? this.loaded : this.live && this.live.current;
    }
  },
  methods: {
    displayTime(e) {
      e = parseInt(e);
      let n = e % 60;
      e = (e - n) / 60;
      let r = e % 60, a = (e - r) / 60, [l, o, c] = [
        n.toString().padStart(2, "0"),
        r.toString().padStart(2, "0"),
        a.toString().padStart(2, "0")
      ];
      return a ? `${c}:${o}:${l}` : `${o}:${l}`;
    },
    playlistButtonClass(e) {
      let n = this.sets[e];
      return (n ? (n.length ? "" : "has-text-grey-light ") + (this.panel == e ? "open" : this.playlistName == e ? "active" : "") : "") + " button";
    },
    /// Show/hide panel
    togglePanel(e) {
      this.panel = this.panel == e ? null : e;
    },
    /// Return True if item is loaded
    isLoaded(e) {
      return this.loaded && this.loaded.id == e.id;
    },
    /// Return True if item is loaded
    isPlaying(e) {
      return this.isLoaded(e) && !this.paused;
    },
    _setPlaylist(e) {
      this.playlistName = e;
      for (var n in this.sets)
        n != e && this.$refs[n] && this.$refs[n][0].unselect();
    },
    /// Load a sound from playlist or live
    load(e = null, n = 0) {
      let r = null;
      if (e !== null && n != -1) {
        let o = this.$refs[e][0].get(n);
        if (!o)
          throw `No sound at index ${n} for playlist ${e}`;
        this.loaded = o, r = o.src;
      } else
        this.loaded = null, r = this.live.src;
      this._setPlaylist(e);
      const a = this.audio;
      if (r instanceof Array) {
        a.innerHTML = "", a.removeAttribute("src");
        for (var l of r) {
          let o = document.createElement("source");
          o.setAttribute("src", l), a.appendChild(o);
        }
      } else
        a.src = r;
      a.load();
    },
    play(e = null, n = 0) {
      this.load(e, n), this.audio.play().catch((r) => console.error(r));
    },
    /// Push items to playlist (by name)
    push(e, ...n) {
      return this.sets[e].push(...n);
    },
    /// Push and play items
    playItems(e, ...n) {
      let r = this.push(e, ...n);
      this.$refs[e][0].selectedIndex = r, this.play(e, r);
    },
    /// Handle click event that plays multiple items (from `data-sounds` attribute)
    playButtonClick(e) {
      var n = JSON.parse(e.currentTarget.dataset.sounds);
      this.playItems("queue", ...n);
    },
    /// Pause
    pause() {
      this.audio.pause();
    },
    //! Play/pause
    togglePlay(e = null, n = 0) {
      if (e !== null) {
        this.panel = null;
        let r = this.sets[e].get(n);
        if (!this.playlist || this.playlistName !== e || this.loaded != r) {
          this.play(e, n);
          return;
        }
      }
      this.paused ? this.audio.play().catch((r) => console.error(r)) : this.audio.pause();
    },
    //! Pin/Unpin an item
    togglePlaylist(e, n) {
      const r = this.sets[e];
      let a = r.findIndex(n);
      a > -1 ? r.remove(a) : r.push(n);
    },
    /// Audio player state change event
    onState(e) {
      const n = this.audio;
      this.state = n.paused ? li.paused : li.playing, e.type == "ended" && (!this.playlist || this.playlist.selectNext() == -1) && this.play();
    }
  },
  mounted() {
    this.load();
  }
}, vR = { class: "a-player" }, pR = { class: "title is-flex-grow-1" }, mR = { class: "icon" }, gR = { class: "action button no-border" }, yR = /* @__PURE__ */ C("i", { class: "fa fa-close" }, null, -1), _R = [
  yR
], bR = {
  key: 0,
  class: "a-player-progress"
}, wR = { class: "a-player-bar button-group" }, DR = ["title", "aria-label"], $R = {
  key: 0,
  class: "fas fa-pause"
}, CR = {
  key: 1,
  class: "fas fa-play"
}, SR = /* @__PURE__ */ C("span", { class: "icon is-size-6 has-text-danger" }, [
  /* @__PURE__ */ C("span", { class: "fa fa-circle" })
], -1), MR = [
  SR
], OR = ["onClick"], xR = { class: "is-size-6" }, AR = { class: "icon" };
function TR(e, n, r, a, l, o) {
  const c = Xe("APlaylist"), f = Xe("AProgress");
  return O(), A("div", vR, [
    C("div", {
      class: ee(["a-player-panels", l.panel ? "is-open" : ""])
    }, [
      (O(!0), A(Te, null, Le(r.playlists, (h, p) => Xn((O(), Fe(c, {
        key: p,
        ref_for: !0,
        ref: p,
        class: "a-player-panel a-playlist",
        actions: ["page", p != "pin" && "pin" || ""],
        editable: !0,
        player: o.self,
        set: l.sets[p],
        onSelect: (g) => o.togglePlay(p, g.index),
        listClass: "menu-list",
        itemClass: "menu-item"
      }, {
        header: le(() => [
          C("div", pR, [
            C("span", mR, [
              C("i", {
                class: ee(h[1])
              }, null, 2)
            ]),
            Zt(" " + pe(h[0]), 1)
          ]),
          C("button", gR, [
            C("span", {
              class: "icon",
              onClick: n[0] || (n[0] = In((g) => o.togglePanel(), ["stop"]))
            }, _R)
          ])
        ]),
        _: 2
      }, 1032, ["actions", "player", "set", "onSelect"])), [
        [pi, l.panel == p && l.sets[p].length]
      ])), 128))
    ], 2),
    l.loaded && l.duration ? (O(), A("div", bR, [
      l.loaded && l.duration ? (O(), Fe(f, {
        key: 0,
        value: l.currentTime,
        max: this.duration,
        format: o.displayTime,
        onSelect: n[1] || (n[1] = (h) => l.audio.currentTime = h)
      }, null, 8, ["value", "max", "format"])) : se("", !0)
    ])) : se("", !0),
    C("div", wR, [
      C("button", {
        class: "button",
        onClick: n[2] || (n[2] = (h) => o.togglePlay()),
        title: r.buttonTitle,
        "aria-label": r.buttonTitle
      }, [
        o.playing ? (O(), A("span", $R)) : (O(), A("span", CR))
      ], 8, DR),
      C("div", {
        class: ee(["a-player-bar-content", l.loaded && l.duration ? "has-progress" : ""])
      }, [
        j(e.$slots, "content", {
          loaded: l.loaded,
          live: l.live,
          current: o.current
        })
      ], 2),
      l.loaded ? (O(), A("button", {
        key: 0,
        class: "button has-text-weight-bold",
        onClick: n[3] || (n[3] = (h) => o.play()),
        title: "Live"
      }, MR)) : se("", !0),
      l.sets ? (O(!0), A(Te, { key: 1 }, Le(r.playlists, (h, p) => Xn((O(), A("button", {
        key: p,
        class: ee(o.playlistButtonClass(p)),
        onClick: (g) => o.togglePanel(p)
      }, [
        C("span", xR, pe(l.sets[p] && l.sets[p].length), 1),
        C("span", AR, [
          C("i", {
            class: ee(h[1])
          }, null, 2)
        ])
      ], 10, OR)), [
        [pi, l.sets[p] && l.sets[p].length]
      ])), 128)) : se("", !0)
    ])
  ]);
}
const PR = /* @__PURE__ */ nt(hR, [["render", TR]]), kR = {
  props: {
    initialActive: { type: Boolean, default: null },
    el: { type: String, default: "" },
    label: { type: String, default: "" },
    icon: { type: String, default: "fa fa-bars" },
    ariaLabel: { type: String, default: "" },
    ariaDescription: { type: String, default: "" },
    activeClass: { type: String, default: "active" },
    /// switch toggle of all items of this group.
    group: { type: String, default: "" }
  },
  data() {
    return {
      active: this.initialActive
    };
  },
  computed: {
    groupClass() {
      return this.group && "a-switch-" + this.group || "";
    },
    buttonClass() {
      return [
        this.active && "active" || "",
        this.groupClass
      ];
    }
  },
  methods: {
    toggle() {
      this.set(!this.active);
    },
    set(e) {
      if (this.el) {
        const n = document.querySelector(this.el);
        e ? n.classList.add(this.activeClass) : n.classList.remove(this.activeClass);
      }
      this.active = e, e && this.resetGroup();
    },
    resetGroup() {
      if (!this.groupClass)
        return;
      const e = document.querySelectorAll("." + this.groupClass);
      for (var n of e)
        n != this.$el && n.__vnode.ctx.ctx.set(!1);
    }
  },
  mounted() {
    this.initialActive !== null && this.set(this.initialActive);
  }
}, IR = ["title", "aria-label", "aria-description"], ER = { class: "icon" }, LR = { key: 0 };
function YR(e, n, r, a, l, o) {
  return O(), A("button", {
    title: r.ariaLabel,
    type: "button",
    "aria-label": r.ariaLabel || r.label,
    "aria-description": r.ariaDescription,
    onClick: n[0] || (n[0] = (...c) => o.toggle && o.toggle(...c)),
    class: ee(o.buttonClass)
  }, [
    j(e.$slots, "default", { active: l.active }, () => [
      C("span", ER, [
        C("i", {
          class: ee(r.icon)
        }, null, 2)
      ]),
      r.label ? (O(), A("label", LR, pe(r.label), 1)) : se("", !0)
    ])
  ], 10, IR);
}
const RR = /* @__PURE__ */ nt(kR, [["render", YR]]), FR = {
  props: {
    title: { type: String, default: "" }
  },
  data() {
    return {
      ///! If true, modal is open
      active: !1,
      ///! Item or data passed down to slots.
      item: null
    };
  },
  methods: {
    ///! Open modal dialog. Set provided `item` to dialog's one.
    open(e = null) {
      this.active = !0, this.item = e;
    },
    ///! Close modal and reset item to null.
    close() {
      this.active = !1, this.item = null;
    }
  }
}, NR = { class: "modal-card" }, WR = { class: "modal-card-head" }, BR = { class: "modal-card-title" }, UR = /* @__PURE__ */ C("span", { class: "icon" }, [
  /* @__PURE__ */ C("i", { class: "fa fa-close" })
], -1), HR = [
  UR
], zR = { class: "modal-card-body" }, qR = { class: "modal-card-foot align-right" };
function KR(e, n, r, a, l, o) {
  return O(), A("section", {
    class: ee(["modal", l.active && "is-active" || ""])
  }, [
    C("div", {
      class: "modal-background",
      onClick: n[0] || (n[0] = (...c) => o.close && o.close(...c))
    }),
    C("div", NR, [
      C("header", WR, [
        C("div", BR, [
          j(e.$slots, "title", {}, () => [
            Zt(pe(r.title), 1)
          ])
        ]),
        j(e.$slots, "bar"),
        C("button", {
          type: "button",
          class: "delete square",
          "aria-label": "close",
          onClick: n[1] || (n[1] = (...c) => o.close && o.close(...c))
        }, HR)
      ]),
      C("section", zR, [
        j(e.$slots, "default", { item: l.item })
      ]),
      C("div", qR, [
        j(e.$slots, "footer", {
          item: l.item,
          close: o.close
        })
      ])
    ])
  ], 2);
}
const Xl = /* @__PURE__ */ nt(FR, [["render", KR]]), VR = {
  emit: ["fileChange", "load", "abort", "error"],
  props: {
    url: { type: String },
    fieldName: { type: String, default: "file" },
    label: { type: String, default: "Select a file" },
    submitLabel: { type: String, default: "Upload" }
  },
  data() {
    return {
      STATE: {
        DEFAULT: 0,
        UPLOADING: 1
      },
      state: 0,
      upload: {},
      file: null,
      fileUrl: null,
      total: 0,
      loaded: 0,
      request: null
    };
  },
  methods: {
    abort() {
      this.request && this.request.abort();
    },
    onFileChange() {
      const [e] = this.$refs.uploadFile.files;
      e && (this._setUploadFile(e), this.$emit("fileChange", { upload: this, file: this.file, fileUrl: this.fileUrl }));
    },
    submit() {
      const e = new XMLHttpRequest();
      e.open("POST", this.url), e.upload.addEventListener("progress", (r) => this.onUploadProgress(r)), e.addEventListener("load", (r) => this.onUploadDone(r, "load")), e.addEventListener("abort", (r) => this.onUploadDone(r, "abort")), e.addEventListener("error", (r) => this.onUploadDone(r, "error"));
      const n = new FormData(this.$refs.form);
      n.append("csrfmiddlewaretoken", Tv()), e.send(n), this._resetUpload(this.STATE.UPLOADING, !1, e);
    },
    onUploadProgress(e) {
      this.loaded = e.loaded, this.total = e.total;
    },
    onUploadDone(e, n) {
      this.$emit(n, e), this._resetUpload(this.STATE.DEFAULT, !0);
    },
    _setUploadFile(e) {
      this.file = e, this.fileURL = e && URL.createObjectURL(e);
    },
    _resetUpload(e, n = !1, r = null) {
      this.state = e, this.loaded = 0, this.total = 0, this.request = r, n && (this.file = null);
    }
  }
}, GR = {
  ref: "list",
  class: "a-select-file-list"
}, jR = {
  key: 0,
  ref: "form",
  class: "flex-column"
}, ZR = { class: "field is-horizontal" }, XR = { class: "label" }, JR = ["name"], QR = {
  key: 0,
  class: "flex-row align-right"
}, eF = {
  key: 1,
  class: "flex-column"
}, tF = { class: "flex-row" }, nF = ["max", "value"], rF = /* @__PURE__ */ C("span", { class: "icon small" }, [
  /* @__PURE__ */ C("i", { class: "fa fa-close" })
], -1), iF = [
  rF
];
function sF(e, n, r, a, l, o) {
  return O(), A("div", GR, [
    l.state == l.STATE.DEFAULT ? (O(), A("form", jR, [
      j(e.$slots, "form"),
      C("div", ZR, [
        C("label", XR, pe(r.label), 1),
        C("input", {
          type: "file",
          ref: "uploadFile",
          name: r.fieldName,
          onChange: n[0] || (n[0] = (...c) => o.onFileChange && o.onFileChange(...c))
        }, null, 40, JR)
      ]),
      r.submitLabel ? (O(), A("div", QR, [
        C("button", {
          type: "button",
          class: "button small",
          onClick: n[1] || (n[1] = (...c) => o.submit && o.submit(...c))
        }, pe(r.submitLabel), 1)
      ])) : se("", !0)
    ], 512)) : (O(), A("div", eF, [
      j(e.$slots, "preview", {
        fileUrl: l.fileUrl,
        file: l.file,
        loaded: l.loaded,
        total: l.total
      }),
      C("div", tF, [
        C("progress", {
          max: l.total,
          value: l.loaded
        }, null, 8, nF),
        C("button", {
          type: "button",
          class: "button small square ml-2",
          onClick: n[2] || (n[2] = (...c) => o.abort && o.abort(...c))
        }, iF)
      ])
    ]))
  ], 512);
}
const Lv = /* @__PURE__ */ nt(VR, [["render", sF]]), aF = {
  emit: ["select"],
  components: { AActionButton: jl, AFileUpload: Lv, AModal: Xl },
  props: {
    title: { type: String },
    labels: Object,
    listClass: { type: String, default: "" },
    // List url
    listUrl: { type: String },
    // URL to delete an item, where "123" is replaced by
    // the item id.
    deleteUrl: { type: String },
    uploadUrl: { type: String },
    uploadFieldName: { type: String, default: "file" },
    uploadLabel: { type: String, default: "Upload a file" }
  },
  data() {
    return {
      LIST: 0,
      UPLOAD: 1,
      panel: 0,
      item: null,
      items: [],
      nextUrl: "",
      prevUrl: "",
      lastUrl: ""
    };
  },
  methods: {
    open() {
      this.$refs.modal.open();
    },
    close() {
      this.$refs.modal.close();
    },
    showPanel(e) {
      this.panel = e;
    },
    load(e) {
      return fetch(e || this.listUrl).then(
        (n) => n.ok ? n.json() : Promise.reject(n)
      ).then((n) => (this.lastUrl = e, this.nextUrl = n.next, this.prevUrl = n.previous, this.items = n.results, this.showPanel(this.LIST), this.$forceUpdate(), this.$refs.list.scroll(0, 0), this.items));
    },
    //! Select an item
    select(e) {
      this.item = e;
    },
    //! User click on select button (confirm selection)
    selected() {
      this.$emit("select", this.item), this.close();
    },
    uploadDone(e = !1) {
      e && this.load().then((n) => {
        this.item = n[0];
      });
    }
  },
  mounted() {
    this.load();
  }
}, oF = /* @__PURE__ */ C("span", { class: "icon" }, [
  /* @__PURE__ */ C("i", { class: "fa fa-upload" })
], -1), lF = /* @__PURE__ */ C("span", { class: "icon" }, [
  /* @__PURE__ */ C("i", { class: "fa fa-list" })
], -1), uF = {
  key: 1,
  class: "a-select-file"
}, cF = { key: 0 }, fF = ["onClick"], dF = { key: 1 }, hF = {
  key: 0,
  class: "mr-3"
};
function vF(e, n, r, a, l, o) {
  const c = Xe("a-file-upload"), f = Xe("a-action-button"), h = Xe("a-modal");
  return O(), Fe(h, {
    ref: "modal",
    title: r.title
  }, {
    bar: le(() => [
      l.panel == l.LIST ? (O(), A("button", {
        key: 0,
        type: "button",
        class: "button small mr-3",
        onClick: n[0] || (n[0] = (p) => o.showPanel(l.UPLOAD))
      }, [
        oF,
        C("span", null, pe(r.labels.upload), 1)
      ])) : (O(), A("button", {
        key: 1,
        type: "button",
        class: "button small mr-3",
        onClick: n[1] || (n[1] = (p) => o.showPanel(l.LIST))
      }, [
        lF,
        C("span", null, pe(r.labels.list), 1)
      ]))
    ]),
    default: le(() => [
      l.panel == l.UPLOAD ? (O(), Fe(c, {
        key: 0,
        ref: "upload",
        url: r.uploadUrl,
        label: r.uploadLabel,
        "field-name": r.uploadFieldName,
        onLoad: o.uploadDone
      }, {
        form: le((p) => [
          j(e.$slots, "upload-form", gt(cn(p)))
        ]),
        preview: le((p) => [
          j(e.$slots, "upload-preview", gt(cn(p)))
        ]),
        _: 3
      }, 8, ["url", "label", "field-name", "onLoad"])) : (O(), A("div", uF, [
        C("div", {
          ref: "list",
          class: ee(["a-select-file-list", r.listClass])
        }, [
          l.prevUrl ? (O(), A("div", cF, [
            C("a", {
              href: "#",
              onClick: n[2] || (n[2] = (p) => o.load(l.prevUrl))
            }, pe(r.labels.show_previous), 1)
          ])) : se("", !0),
          (O(!0), A(Te, null, Le(l.items, (p) => (O(), A("div", {
            key: p.id,
            class: ee(["file-preview", this.item && p.id == this.item.id && "active"]),
            onClick: (g) => o.select(p)
          }, [
            j(e.$slots, "default", {
              item: p,
              load: o.load,
              lastUrl: l.lastUrl
            }),
            r.deleteUrl ? (O(), Fe(f, {
              key: 0,
              class: "has-text-danger small float-right",
              icon: "fa fa-trash",
              confirm: r.labels.confirm_delete,
              method: "DELETE",
              url: r.deleteUrl.replace("123", p.id),
              onDone: n[3] || (n[3] = (g) => o.load(l.lastUrl))
            }, null, 8, ["confirm", "url"])) : se("", !0)
          ], 10, fF))), 128)),
          l.nextUrl ? (O(), A("div", dF, [
            C("a", {
              href: "#",
              onClick: n[4] || (n[4] = (p) => o.load(l.nextUrl))
            }, pe(r.labels.show_next), 1)
          ])) : se("", !0)
        ], 2)
      ]))
    ]),
    footer: le(() => [
      j(e.$slots, "footer", { item: l.item }, () => [
        l.item ? (O(), A("span", hF, pe(l.item.name), 1)) : se("", !0)
      ]),
      l.panel == l.LIST ? (O(), A("button", {
        key: 0,
        type: "button",
        class: "button align-right",
        onClick: n[5] || (n[5] = (...p) => o.selected && o.selected(...p))
      }, pe(r.labels.select_file), 1)) : se("", !0)
    ]),
    _: 3
  }, 8, ["title"]);
}
const Yv = /* @__PURE__ */ nt(aF, [["render", vF]]), pF = new RegExp(",\\s*|\\s+", "g"), mF = {
  data() {
    return {
      counts: {}
    };
  },
  methods: {
    update() {
      const e = this.$el.querySelectorAll('input[name="data"]:checked'), n = {};
      for (var r of e)
        if (r.value)
          for (var a of r.value.split(pF))
            a.trim() && (n[a.trim()] = (n[a.trim()] || 0) + 1);
      this.counts = n;
    },
    onclick() {
    }
  },
  mounted() {
    console.log(this.counts), this.$refs.form.addEventListener("change", () => this.update()), this.update();
  }
}, gF = { ref: "form" };
function yF(e, n, r, a, l, o) {
  return O(), A("form", gF, [
    j(e.$slots, "default", { counts: l.counts })
  ], 512);
}
const _F = /* @__PURE__ */ nt(mF, [["render", yF]]);
class bF extends Xt {
  get playlists() {
    return this.data ? this.data.playlists : [];
  }
  get queues() {
    return this.data ? this.data.queues : [];
  }
  get sources() {
    return [...this.queues, ...this.playlists];
  }
  get source() {
    return this.sources.find((n) => n.id == this.data.source);
  }
  commit(n) {
    this.data || (this.data = { id: n.id, playlists: [], queues: [] }), n.playlists = DF.fromList(n.playlists, { streamer: this }), n.queues = $F.fromList(n.queues, { streamer: this }), super.commit(n);
  }
}
class wF extends Xt {
  static getId(n) {
    return n.rid;
  }
}
class Rv extends Xt {
  constructor(n, { streamer: r = null, ...a } = {}) {
    super(n, a), this.streamer = r, Zl(() => this.tick(), 1e3);
  }
  get isQueue() {
    return !1;
  }
  get isPlaylist() {
    return !1;
  }
  get isPlaying() {
    return this.data.status == "playing";
  }
  get isPaused() {
    return this.data.status == "paused";
  }
  get remainingString() {
    if (!this.remaining)
      return "00:00";
    const n = Math.floor(this.remaining % 60), r = Math.floor(this.remaining / 60);
    return String(r).padStart(2, "0") + ":" + String(n).padStart(2, "0");
  }
  sync() {
    return this.action("sync/", { method: "POST" }, !0);
  }
  skip() {
    return this.action("skip/", { method: "POST" }, !0);
  }
  restart() {
    return this.action("restart/", { method: "POST" }, !0);
  }
  seek(n) {
    return this.action("seek/", {
      method: "POST",
      body: JSON.stringify({ count: n })
    }, !0);
  }
  tick() {
    if (!this.data.remaining || !this.isPlaying)
      return;
    const n = (Date.now() - this.commitDate) / 1e3;
    this.remaining = this.data.remaining - n;
  }
  commit(n) {
    n.air_time && (n.air_time = new Date(n.air_time)), this.commitDate = Date.now(), super.commit(n), this.remaining = n.remaining;
  }
}
class DF extends Rv {
  get isPlaylist() {
    return !0;
  }
}
class $F extends Rv {
  get isQueue() {
    return !0;
  }
  get queue() {
    return this.data && this.data.queue;
  }
  commit(n) {
    n.queue = wF.fromList(n.queue), super.commit(n);
  }
  push(n) {
    return this.action("push/", {
      method: "POST",
      body: JSON.stringify({ sound_id: parseInt(n) })
    }, !0);
  }
}
const CF = {
  props: {
    apiUrl: String
  },
  data() {
    return {
      // current streamer
      streamer: null,
      // all streamers
      streamers: [],
      // fetch interval id
      fetchInterval: null,
      Sound: _s
    };
  },
  computed: {
    sources() {
      var e = this.streamer ? this.streamer.sources : [];
      return e.filter((n) => n.data);
    }
  },
  methods: {
    fetchStreamers() {
      bF.fetch(this.apiUrl, { many: !0 }).then((e) => {
        this.streamers = e, this.streamer = e ? e[0] : null;
      });
    }
  },
  mounted() {
    this.fetchStreamers(), this.fetchInterval = Zl(() => this.streamer && this.streamer.fetch(), 5e3);
  },
  unmounted() {
    this.fetchInterval !== null && clearInterval(this.fetchInterval);
  }
};
function SF(e, n, r, a, l, o) {
  return O(), A("div", null, [
    j(e.$slots, "default", {
      streamer: l.streamer,
      streamers: l.streamers,
      Sound: l.Sound,
      sources: o.sources,
      fetchStreamers: o.fetchStreamers
    })
  ]);
}
const MF = /* @__PURE__ */ nt(CF, [["render", SF]]);
var Ji = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, Aa = { exports: {} };
/**
 * @license
 * Lodash <https://lodash.com/>
 * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
 * Released under MIT license <https://lodash.com/license>
 * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
 */
Aa.exports;
(function(e, n) {
  (function() {
    var r, a = "4.17.21", l = 200, o = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", c = "Expected a function", f = "Invalid `variable` option passed into `_.template`", h = "__lodash_hash_undefined__", p = 500, g = "__lodash_placeholder__", w = 1, M = 2, S = 4, k = 1, U = 2, R = 1, P = 2, J = 4, Q = 8, H = 16, z = 32, te = 64, V = 128, ne = 256, me = 512, we = 30, $e = "...", Z = 800, fe = 16, Ae = 1, ae = 2, xe = 3, Me = 1 / 0, Ye = 9007199254740991, Ue = 17976931348623157e292, B = NaN, he = 4294967295, re = he - 1, Je = he >>> 1, Pe = [
      ["ary", V],
      ["bind", R],
      ["bindKey", P],
      ["curry", Q],
      ["curryRight", H],
      ["flip", me],
      ["partial", z],
      ["partialRight", te],
      ["rearg", ne]
    ], Ne = "[object Arguments]", Qe = "[object Array]", et = "[object AsyncFunction]", je = "[object Boolean]", ot = "[object Date]", mn = "[object DOMException]", _t = "[object Error]", ft = "[object Function]", St = "[object GeneratorFunction]", st = "[object Map]", Qt = "[object Number]", en = "[object Null]", dt = "[object Object]", Sn = "[object Promise]", Fn = "[object Proxy]", ht = "[object RegExp]", at = "[object Set]", It = "[object String]", Bt = "[object Symbol]", Mn = "[object Undefined]", Et = "[object WeakMap]", On = "[object WeakSet]", Ut = "[object ArrayBuffer]", Ht = "[object DataView]", Sr = "[object Float32Array]", Nn = "[object Float64Array]", Mr = "[object Int8Array]", rr = "[object Int16Array]", ir = "[object Int32Array]", Or = "[object Uint8Array]", sr = "[object Uint8ClampedArray]", ar = "[object Uint16Array]", N = "[object Uint32Array]", _ = /\b__p \+= '';/g, Y = /\b(__p \+=) '' \+/g, q = /(__e\(.*?\)|\b__t\)) \+\n'';/g, de = /&(?:amp|lt|gt|quot|#39);/g, He = /[&<>"']/g, vt = RegExp(de.source), Mt = RegExp(He.source), or = /<%-([\s\S]+?)%>/g, lr = /<%([\s\S]+?)%>/g, Kr = /<%=([\s\S]+?)%>/g, bt = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, Ti = /^\w*$/, Vr = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, Wn = /[\\^$.*+?()[\]{}|]/g, xr = RegExp(Wn.source), Pi = /^\s+/, Nv = /\s/, Wv = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, Bv = /\{\n\/\* \[wrapped with (.+)\] \*/, Uv = /,? & /, Hv = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g, zv = /[()=,{}\[\]\/\s]/, qv = /\\(\\)?/g, Kv = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g, tu = /\w*$/, Vv = /^[-+]0x[0-9a-f]+$/i, Gv = /^0b[01]+$/i, jv = /^\[object .+?Constructor\]$/, Zv = /^0o[0-7]+$/i, Xv = /^(?:0|[1-9]\d*)$/, Jv = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g, bs = /($^)/, Qv = /['\n\r\u2028\u2029\\]/g, ws = "\\ud800-\\udfff", ep = "\\u0300-\\u036f", tp = "\\ufe20-\\ufe2f", np = "\\u20d0-\\u20ff", nu = ep + tp + np, ru = "\\u2700-\\u27bf", iu = "a-z\\xdf-\\xf6\\xf8-\\xff", rp = "\\xac\\xb1\\xd7\\xf7", ip = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", sp = "\\u2000-\\u206f", ap = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", su = "A-Z\\xc0-\\xd6\\xd8-\\xde", au = "\\ufe0e\\ufe0f", ou = rp + ip + sp + ap, Wa = "['’]", op = "[" + ws + "]", lu = "[" + ou + "]", Ds = "[" + nu + "]", uu = "\\d+", lp = "[" + ru + "]", cu = "[" + iu + "]", fu = "[^" + ws + ou + uu + ru + iu + su + "]", Ba = "\\ud83c[\\udffb-\\udfff]", up = "(?:" + Ds + "|" + Ba + ")", du = "[^" + ws + "]", Ua = "(?:\\ud83c[\\udde6-\\uddff]){2}", Ha = "[\\ud800-\\udbff][\\udc00-\\udfff]", Gr = "[" + su + "]", hu = "\\u200d", vu = "(?:" + cu + "|" + fu + ")", cp = "(?:" + Gr + "|" + fu + ")", pu = "(?:" + Wa + "(?:d|ll|m|re|s|t|ve))?", mu = "(?:" + Wa + "(?:D|LL|M|RE|S|T|VE))?", gu = up + "?", yu = "[" + au + "]?", fp = "(?:" + hu + "(?:" + [du, Ua, Ha].join("|") + ")" + yu + gu + ")*", dp = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", hp = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", _u = yu + gu + fp, vp = "(?:" + [lp, Ua, Ha].join("|") + ")" + _u, pp = "(?:" + [du + Ds + "?", Ds, Ua, Ha, op].join("|") + ")", mp = RegExp(Wa, "g"), gp = RegExp(Ds, "g"), za = RegExp(Ba + "(?=" + Ba + ")|" + pp + _u, "g"), yp = RegExp([
      Gr + "?" + cu + "+" + pu + "(?=" + [lu, Gr, "$"].join("|") + ")",
      cp + "+" + mu + "(?=" + [lu, Gr + vu, "$"].join("|") + ")",
      Gr + "?" + vu + "+" + pu,
      Gr + "+" + mu,
      hp,
      dp,
      uu,
      vp
    ].join("|"), "g"), _p = RegExp("[" + hu + ws + nu + au + "]"), bp = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/, wp = [
      "Array",
      "Buffer",
      "DataView",
      "Date",
      "Error",
      "Float32Array",
      "Float64Array",
      "Function",
      "Int8Array",
      "Int16Array",
      "Int32Array",
      "Map",
      "Math",
      "Object",
      "Promise",
      "RegExp",
      "Set",
      "String",
      "Symbol",
      "TypeError",
      "Uint8Array",
      "Uint8ClampedArray",
      "Uint16Array",
      "Uint32Array",
      "WeakMap",
      "_",
      "clearTimeout",
      "isFinite",
      "parseInt",
      "setTimeout"
    ], Dp = -1, qe = {};
    qe[Sr] = qe[Nn] = qe[Mr] = qe[rr] = qe[ir] = qe[Or] = qe[sr] = qe[ar] = qe[N] = !0, qe[Ne] = qe[Qe] = qe[Ut] = qe[je] = qe[Ht] = qe[ot] = qe[_t] = qe[ft] = qe[st] = qe[Qt] = qe[dt] = qe[ht] = qe[at] = qe[It] = qe[Et] = !1;
    var ze = {};
    ze[Ne] = ze[Qe] = ze[Ut] = ze[Ht] = ze[je] = ze[ot] = ze[Sr] = ze[Nn] = ze[Mr] = ze[rr] = ze[ir] = ze[st] = ze[Qt] = ze[dt] = ze[ht] = ze[at] = ze[It] = ze[Bt] = ze[Or] = ze[sr] = ze[ar] = ze[N] = !0, ze[_t] = ze[ft] = ze[Et] = !1;
    var $p = {
      // Latin-1 Supplement block.
      À: "A",
      Á: "A",
      Â: "A",
      Ã: "A",
      Ä: "A",
      Å: "A",
      à: "a",
      á: "a",
      â: "a",
      ã: "a",
      ä: "a",
      å: "a",
      Ç: "C",
      ç: "c",
      Ð: "D",
      ð: "d",
      È: "E",
      É: "E",
      Ê: "E",
      Ë: "E",
      è: "e",
      é: "e",
      ê: "e",
      ë: "e",
      Ì: "I",
      Í: "I",
      Î: "I",
      Ï: "I",
      ì: "i",
      í: "i",
      î: "i",
      ï: "i",
      Ñ: "N",
      ñ: "n",
      Ò: "O",
      Ó: "O",
      Ô: "O",
      Õ: "O",
      Ö: "O",
      Ø: "O",
      ò: "o",
      ó: "o",
      ô: "o",
      õ: "o",
      ö: "o",
      ø: "o",
      Ù: "U",
      Ú: "U",
      Û: "U",
      Ü: "U",
      ù: "u",
      ú: "u",
      û: "u",
      ü: "u",
      Ý: "Y",
      ý: "y",
      ÿ: "y",
      Æ: "Ae",
      æ: "ae",
      Þ: "Th",
      þ: "th",
      ß: "ss",
      // Latin Extended-A block.
      Ā: "A",
      Ă: "A",
      Ą: "A",
      ā: "a",
      ă: "a",
      ą: "a",
      Ć: "C",
      Ĉ: "C",
      Ċ: "C",
      Č: "C",
      ć: "c",
      ĉ: "c",
      ċ: "c",
      č: "c",
      Ď: "D",
      Đ: "D",
      ď: "d",
      đ: "d",
      Ē: "E",
      Ĕ: "E",
      Ė: "E",
      Ę: "E",
      Ě: "E",
      ē: "e",
      ĕ: "e",
      ė: "e",
      ę: "e",
      ě: "e",
      Ĝ: "G",
      Ğ: "G",
      Ġ: "G",
      Ģ: "G",
      ĝ: "g",
      ğ: "g",
      ġ: "g",
      ģ: "g",
      Ĥ: "H",
      Ħ: "H",
      ĥ: "h",
      ħ: "h",
      Ĩ: "I",
      Ī: "I",
      Ĭ: "I",
      Į: "I",
      İ: "I",
      ĩ: "i",
      ī: "i",
      ĭ: "i",
      į: "i",
      ı: "i",
      Ĵ: "J",
      ĵ: "j",
      Ķ: "K",
      ķ: "k",
      ĸ: "k",
      Ĺ: "L",
      Ļ: "L",
      Ľ: "L",
      Ŀ: "L",
      Ł: "L",
      ĺ: "l",
      ļ: "l",
      ľ: "l",
      ŀ: "l",
      ł: "l",
      Ń: "N",
      Ņ: "N",
      Ň: "N",
      Ŋ: "N",
      ń: "n",
      ņ: "n",
      ň: "n",
      ŋ: "n",
      Ō: "O",
      Ŏ: "O",
      Ő: "O",
      ō: "o",
      ŏ: "o",
      ő: "o",
      Ŕ: "R",
      Ŗ: "R",
      Ř: "R",
      ŕ: "r",
      ŗ: "r",
      ř: "r",
      Ś: "S",
      Ŝ: "S",
      Ş: "S",
      Š: "S",
      ś: "s",
      ŝ: "s",
      ş: "s",
      š: "s",
      Ţ: "T",
      Ť: "T",
      Ŧ: "T",
      ţ: "t",
      ť: "t",
      ŧ: "t",
      Ũ: "U",
      Ū: "U",
      Ŭ: "U",
      Ů: "U",
      Ű: "U",
      Ų: "U",
      ũ: "u",
      ū: "u",
      ŭ: "u",
      ů: "u",
      ű: "u",
      ų: "u",
      Ŵ: "W",
      ŵ: "w",
      Ŷ: "Y",
      ŷ: "y",
      Ÿ: "Y",
      Ź: "Z",
      Ż: "Z",
      Ž: "Z",
      ź: "z",
      ż: "z",
      ž: "z",
      Ĳ: "IJ",
      ĳ: "ij",
      Œ: "Oe",
      œ: "oe",
      ŉ: "'n",
      ſ: "s"
    }, Cp = {
      "&": "&amp;",
      "<": "&lt;",
      ">": "&gt;",
      '"': "&quot;",
      "'": "&#39;"
    }, Sp = {
      "&amp;": "&",
      "&lt;": "<",
      "&gt;": ">",
      "&quot;": '"',
      "&#39;": "'"
    }, Mp = {
      "\\": "\\",
      "'": "'",
      "\n": "n",
      "\r": "r",
      "\u2028": "u2028",
      "\u2029": "u2029"
    }, Op = parseFloat, xp = parseInt, bu = typeof Ji == "object" && Ji && Ji.Object === Object && Ji, Ap = typeof self == "object" && self && self.Object === Object && self, pt = bu || Ap || Function("return this")(), qa = n && !n.nodeType && n, Ar = qa && !0 && e && !e.nodeType && e, wu = Ar && Ar.exports === qa, Ka = wu && bu.process, tn = function() {
      try {
        var D = Ar && Ar.require && Ar.require("util").types;
        return D || Ka && Ka.binding && Ka.binding("util");
      } catch {
      }
    }(), Du = tn && tn.isArrayBuffer, $u = tn && tn.isDate, Cu = tn && tn.isMap, Su = tn && tn.isRegExp, Mu = tn && tn.isSet, Ou = tn && tn.isTypedArray;
    function zt(D, T, x) {
      switch (x.length) {
        case 0:
          return D.call(T);
        case 1:
          return D.call(T, x[0]);
        case 2:
          return D.call(T, x[0], x[1]);
        case 3:
          return D.call(T, x[0], x[1], x[2]);
      }
      return D.apply(T, x);
    }
    function Tp(D, T, x, G) {
      for (var ve = -1, ke = D == null ? 0 : D.length; ++ve < ke; ) {
        var lt = D[ve];
        T(G, lt, x(lt), D);
      }
      return G;
    }
    function nn(D, T) {
      for (var x = -1, G = D == null ? 0 : D.length; ++x < G && T(D[x], x, D) !== !1; )
        ;
      return D;
    }
    function Pp(D, T) {
      for (var x = D == null ? 0 : D.length; x-- && T(D[x], x, D) !== !1; )
        ;
      return D;
    }
    function xu(D, T) {
      for (var x = -1, G = D == null ? 0 : D.length; ++x < G; )
        if (!T(D[x], x, D))
          return !1;
      return !0;
    }
    function ur(D, T) {
      for (var x = -1, G = D == null ? 0 : D.length, ve = 0, ke = []; ++x < G; ) {
        var lt = D[x];
        T(lt, x, D) && (ke[ve++] = lt);
      }
      return ke;
    }
    function $s(D, T) {
      var x = D == null ? 0 : D.length;
      return !!x && jr(D, T, 0) > -1;
    }
    function Va(D, T, x) {
      for (var G = -1, ve = D == null ? 0 : D.length; ++G < ve; )
        if (x(T, D[G]))
          return !0;
      return !1;
    }
    function Ve(D, T) {
      for (var x = -1, G = D == null ? 0 : D.length, ve = Array(G); ++x < G; )
        ve[x] = T(D[x], x, D);
      return ve;
    }
    function cr(D, T) {
      for (var x = -1, G = T.length, ve = D.length; ++x < G; )
        D[ve + x] = T[x];
      return D;
    }
    function Ga(D, T, x, G) {
      var ve = -1, ke = D == null ? 0 : D.length;
      for (G && ke && (x = D[++ve]); ++ve < ke; )
        x = T(x, D[ve], ve, D);
      return x;
    }
    function kp(D, T, x, G) {
      var ve = D == null ? 0 : D.length;
      for (G && ve && (x = D[--ve]); ve--; )
        x = T(x, D[ve], ve, D);
      return x;
    }
    function ja(D, T) {
      for (var x = -1, G = D == null ? 0 : D.length; ++x < G; )
        if (T(D[x], x, D))
          return !0;
      return !1;
    }
    var Ip = Za("length");
    function Ep(D) {
      return D.split("");
    }
    function Lp(D) {
      return D.match(Hv) || [];
    }
    function Au(D, T, x) {
      var G;
      return x(D, function(ve, ke, lt) {
        if (T(ve, ke, lt))
          return G = ke, !1;
      }), G;
    }
    function Cs(D, T, x, G) {
      for (var ve = D.length, ke = x + (G ? 1 : -1); G ? ke-- : ++ke < ve; )
        if (T(D[ke], ke, D))
          return ke;
      return -1;
    }
    function jr(D, T, x) {
      return T === T ? Vp(D, T, x) : Cs(D, Tu, x);
    }
    function Yp(D, T, x, G) {
      for (var ve = x - 1, ke = D.length; ++ve < ke; )
        if (G(D[ve], T))
          return ve;
      return -1;
    }
    function Tu(D) {
      return D !== D;
    }
    function Pu(D, T) {
      var x = D == null ? 0 : D.length;
      return x ? Ja(D, T) / x : B;
    }
    function Za(D) {
      return function(T) {
        return T == null ? r : T[D];
      };
    }
    function Xa(D) {
      return function(T) {
        return D == null ? r : D[T];
      };
    }
    function ku(D, T, x, G, ve) {
      return ve(D, function(ke, lt, We) {
        x = G ? (G = !1, ke) : T(x, ke, lt, We);
      }), x;
    }
    function Rp(D, T) {
      var x = D.length;
      for (D.sort(T); x--; )
        D[x] = D[x].value;
      return D;
    }
    function Ja(D, T) {
      for (var x, G = -1, ve = D.length; ++G < ve; ) {
        var ke = T(D[G]);
        ke !== r && (x = x === r ? ke : x + ke);
      }
      return x;
    }
    function Qa(D, T) {
      for (var x = -1, G = Array(D); ++x < D; )
        G[x] = T(x);
      return G;
    }
    function Fp(D, T) {
      return Ve(T, function(x) {
        return [x, D[x]];
      });
    }
    function Iu(D) {
      return D && D.slice(0, Ru(D) + 1).replace(Pi, "");
    }
    function qt(D) {
      return function(T) {
        return D(T);
      };
    }
    function eo(D, T) {
      return Ve(T, function(x) {
        return D[x];
      });
    }
    function ki(D, T) {
      return D.has(T);
    }
    function Eu(D, T) {
      for (var x = -1, G = D.length; ++x < G && jr(T, D[x], 0) > -1; )
        ;
      return x;
    }
    function Lu(D, T) {
      for (var x = D.length; x-- && jr(T, D[x], 0) > -1; )
        ;
      return x;
    }
    function Np(D, T) {
      for (var x = D.length, G = 0; x--; )
        D[x] === T && ++G;
      return G;
    }
    var Wp = Xa($p), Bp = Xa(Cp);
    function Up(D) {
      return "\\" + Mp[D];
    }
    function Hp(D, T) {
      return D == null ? r : D[T];
    }
    function Zr(D) {
      return _p.test(D);
    }
    function zp(D) {
      return bp.test(D);
    }
    function qp(D) {
      for (var T, x = []; !(T = D.next()).done; )
        x.push(T.value);
      return x;
    }
    function to(D) {
      var T = -1, x = Array(D.size);
      return D.forEach(function(G, ve) {
        x[++T] = [ve, G];
      }), x;
    }
    function Yu(D, T) {
      return function(x) {
        return D(T(x));
      };
    }
    function fr(D, T) {
      for (var x = -1, G = D.length, ve = 0, ke = []; ++x < G; ) {
        var lt = D[x];
        (lt === T || lt === g) && (D[x] = g, ke[ve++] = x);
      }
      return ke;
    }
    function Ss(D) {
      var T = -1, x = Array(D.size);
      return D.forEach(function(G) {
        x[++T] = G;
      }), x;
    }
    function Kp(D) {
      var T = -1, x = Array(D.size);
      return D.forEach(function(G) {
        x[++T] = [G, G];
      }), x;
    }
    function Vp(D, T, x) {
      for (var G = x - 1, ve = D.length; ++G < ve; )
        if (D[G] === T)
          return G;
      return -1;
    }
    function Gp(D, T, x) {
      for (var G = x + 1; G--; )
        if (D[G] === T)
          return G;
      return G;
    }
    function Xr(D) {
      return Zr(D) ? Zp(D) : Ip(D);
    }
    function gn(D) {
      return Zr(D) ? Xp(D) : Ep(D);
    }
    function Ru(D) {
      for (var T = D.length; T-- && Nv.test(D.charAt(T)); )
        ;
      return T;
    }
    var jp = Xa(Sp);
    function Zp(D) {
      for (var T = za.lastIndex = 0; za.test(D); )
        ++T;
      return T;
    }
    function Xp(D) {
      return D.match(za) || [];
    }
    function Jp(D) {
      return D.match(yp) || [];
    }
    var Qp = function D(T) {
      T = T == null ? pt : Jr.defaults(pt.Object(), T, Jr.pick(pt, wp));
      var x = T.Array, G = T.Date, ve = T.Error, ke = T.Function, lt = T.Math, We = T.Object, no = T.RegExp, em = T.String, rn = T.TypeError, Ms = x.prototype, tm = ke.prototype, Qr = We.prototype, Os = T["__core-js_shared__"], xs = tm.toString, Ee = Qr.hasOwnProperty, nm = 0, Fu = function() {
        var t = /[^.]+$/.exec(Os && Os.keys && Os.keys.IE_PROTO || "");
        return t ? "Symbol(src)_1." + t : "";
      }(), As = Qr.toString, rm = xs.call(We), im = pt._, sm = no(
        "^" + xs.call(Ee).replace(Wn, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
      ), Ts = wu ? T.Buffer : r, dr = T.Symbol, Ps = T.Uint8Array, Nu = Ts ? Ts.allocUnsafe : r, ks = Yu(We.getPrototypeOf, We), Wu = We.create, Bu = Qr.propertyIsEnumerable, Is = Ms.splice, Uu = dr ? dr.isConcatSpreadable : r, Ii = dr ? dr.iterator : r, Tr = dr ? dr.toStringTag : r, Es = function() {
        try {
          var t = Lr(We, "defineProperty");
          return t({}, "", {}), t;
        } catch {
        }
      }(), am = T.clearTimeout !== pt.clearTimeout && T.clearTimeout, om = G && G.now !== pt.Date.now && G.now, lm = T.setTimeout !== pt.setTimeout && T.setTimeout, Ls = lt.ceil, Ys = lt.floor, ro = We.getOwnPropertySymbols, um = Ts ? Ts.isBuffer : r, Hu = T.isFinite, cm = Ms.join, fm = Yu(We.keys, We), ut = lt.max, wt = lt.min, dm = G.now, hm = T.parseInt, zu = lt.random, vm = Ms.reverse, io = Lr(T, "DataView"), Ei = Lr(T, "Map"), so = Lr(T, "Promise"), ei = Lr(T, "Set"), Li = Lr(T, "WeakMap"), Yi = Lr(We, "create"), Rs = Li && new Li(), ti = {}, pm = Yr(io), mm = Yr(Ei), gm = Yr(so), ym = Yr(ei), _m = Yr(Li), Fs = dr ? dr.prototype : r, Ri = Fs ? Fs.valueOf : r, qu = Fs ? Fs.toString : r;
      function v(t) {
        if (tt(t) && !ge(t) && !(t instanceof Se)) {
          if (t instanceof sn)
            return t;
          if (Ee.call(t, "__wrapped__"))
            return Kc(t);
        }
        return new sn(t);
      }
      var ni = /* @__PURE__ */ function() {
        function t() {
        }
        return function(i) {
          if (!Ze(i))
            return {};
          if (Wu)
            return Wu(i);
          t.prototype = i;
          var s = new t();
          return t.prototype = r, s;
        };
      }();
      function Ns() {
      }
      function sn(t, i) {
        this.__wrapped__ = t, this.__actions__ = [], this.__chain__ = !!i, this.__index__ = 0, this.__values__ = r;
      }
      v.templateSettings = {
        /**
         * Used to detect `data` property values to be HTML-escaped.
         *
         * @memberOf _.templateSettings
         * @type {RegExp}
         */
        escape: or,
        /**
         * Used to detect code to be evaluated.
         *
         * @memberOf _.templateSettings
         * @type {RegExp}
         */
        evaluate: lr,
        /**
         * Used to detect `data` property values to inject.
         *
         * @memberOf _.templateSettings
         * @type {RegExp}
         */
        interpolate: Kr,
        /**
         * Used to reference the data object in the template text.
         *
         * @memberOf _.templateSettings
         * @type {string}
         */
        variable: "",
        /**
         * Used to import variables into the compiled template.
         *
         * @memberOf _.templateSettings
         * @type {Object}
         */
        imports: {
          /**
           * A reference to the `lodash` function.
           *
           * @memberOf _.templateSettings.imports
           * @type {Function}
           */
          _: v
        }
      }, v.prototype = Ns.prototype, v.prototype.constructor = v, sn.prototype = ni(Ns.prototype), sn.prototype.constructor = sn;
      function Se(t) {
        this.__wrapped__ = t, this.__actions__ = [], this.__dir__ = 1, this.__filtered__ = !1, this.__iteratees__ = [], this.__takeCount__ = he, this.__views__ = [];
      }
      function bm() {
        var t = new Se(this.__wrapped__);
        return t.__actions__ = Lt(this.__actions__), t.__dir__ = this.__dir__, t.__filtered__ = this.__filtered__, t.__iteratees__ = Lt(this.__iteratees__), t.__takeCount__ = this.__takeCount__, t.__views__ = Lt(this.__views__), t;
      }
      function wm() {
        if (this.__filtered__) {
          var t = new Se(this);
          t.__dir__ = -1, t.__filtered__ = !0;
        } else
          t = this.clone(), t.__dir__ *= -1;
        return t;
      }
      function Dm() {
        var t = this.__wrapped__.value(), i = this.__dir__, s = ge(t), u = i < 0, d = s ? t.length : 0, m = Eg(0, d, this.__views__), y = m.start, b = m.end, $ = b - y, I = u ? b : y - 1, L = this.__iteratees__, F = L.length, K = 0, X = wt($, this.__takeCount__);
        if (!s || !u && d == $ && X == $)
          return pc(t, this.__actions__);
        var ue = [];
        e:
          for (; $-- && K < X; ) {
            I += i;
            for (var _e = -1, ce = t[I]; ++_e < F; ) {
              var Ce = L[_e], Oe = Ce.iteratee, Gt = Ce.type, At = Oe(ce);
              if (Gt == ae)
                ce = At;
              else if (!At) {
                if (Gt == Ae)
                  continue e;
                break e;
              }
            }
            ue[K++] = ce;
          }
        return ue;
      }
      Se.prototype = ni(Ns.prototype), Se.prototype.constructor = Se;
      function Pr(t) {
        var i = -1, s = t == null ? 0 : t.length;
        for (this.clear(); ++i < s; ) {
          var u = t[i];
          this.set(u[0], u[1]);
        }
      }
      function $m() {
        this.__data__ = Yi ? Yi(null) : {}, this.size = 0;
      }
      function Cm(t) {
        var i = this.has(t) && delete this.__data__[t];
        return this.size -= i ? 1 : 0, i;
      }
      function Sm(t) {
        var i = this.__data__;
        if (Yi) {
          var s = i[t];
          return s === h ? r : s;
        }
        return Ee.call(i, t) ? i[t] : r;
      }
      function Mm(t) {
        var i = this.__data__;
        return Yi ? i[t] !== r : Ee.call(i, t);
      }
      function Om(t, i) {
        var s = this.__data__;
        return this.size += this.has(t) ? 0 : 1, s[t] = Yi && i === r ? h : i, this;
      }
      Pr.prototype.clear = $m, Pr.prototype.delete = Cm, Pr.prototype.get = Sm, Pr.prototype.has = Mm, Pr.prototype.set = Om;
      function Bn(t) {
        var i = -1, s = t == null ? 0 : t.length;
        for (this.clear(); ++i < s; ) {
          var u = t[i];
          this.set(u[0], u[1]);
        }
      }
      function xm() {
        this.__data__ = [], this.size = 0;
      }
      function Am(t) {
        var i = this.__data__, s = Ws(i, t);
        if (s < 0)
          return !1;
        var u = i.length - 1;
        return s == u ? i.pop() : Is.call(i, s, 1), --this.size, !0;
      }
      function Tm(t) {
        var i = this.__data__, s = Ws(i, t);
        return s < 0 ? r : i[s][1];
      }
      function Pm(t) {
        return Ws(this.__data__, t) > -1;
      }
      function km(t, i) {
        var s = this.__data__, u = Ws(s, t);
        return u < 0 ? (++this.size, s.push([t, i])) : s[u][1] = i, this;
      }
      Bn.prototype.clear = xm, Bn.prototype.delete = Am, Bn.prototype.get = Tm, Bn.prototype.has = Pm, Bn.prototype.set = km;
      function Un(t) {
        var i = -1, s = t == null ? 0 : t.length;
        for (this.clear(); ++i < s; ) {
          var u = t[i];
          this.set(u[0], u[1]);
        }
      }
      function Im() {
        this.size = 0, this.__data__ = {
          hash: new Pr(),
          map: new (Ei || Bn)(),
          string: new Pr()
        };
      }
      function Em(t) {
        var i = Js(this, t).delete(t);
        return this.size -= i ? 1 : 0, i;
      }
      function Lm(t) {
        return Js(this, t).get(t);
      }
      function Ym(t) {
        return Js(this, t).has(t);
      }
      function Rm(t, i) {
        var s = Js(this, t), u = s.size;
        return s.set(t, i), this.size += s.size == u ? 0 : 1, this;
      }
      Un.prototype.clear = Im, Un.prototype.delete = Em, Un.prototype.get = Lm, Un.prototype.has = Ym, Un.prototype.set = Rm;
      function kr(t) {
        var i = -1, s = t == null ? 0 : t.length;
        for (this.__data__ = new Un(); ++i < s; )
          this.add(t[i]);
      }
      function Fm(t) {
        return this.__data__.set(t, h), this;
      }
      function Nm(t) {
        return this.__data__.has(t);
      }
      kr.prototype.add = kr.prototype.push = Fm, kr.prototype.has = Nm;
      function yn(t) {
        var i = this.__data__ = new Bn(t);
        this.size = i.size;
      }
      function Wm() {
        this.__data__ = new Bn(), this.size = 0;
      }
      function Bm(t) {
        var i = this.__data__, s = i.delete(t);
        return this.size = i.size, s;
      }
      function Um(t) {
        return this.__data__.get(t);
      }
      function Hm(t) {
        return this.__data__.has(t);
      }
      function zm(t, i) {
        var s = this.__data__;
        if (s instanceof Bn) {
          var u = s.__data__;
          if (!Ei || u.length < l - 1)
            return u.push([t, i]), this.size = ++s.size, this;
          s = this.__data__ = new Un(u);
        }
        return s.set(t, i), this.size = s.size, this;
      }
      yn.prototype.clear = Wm, yn.prototype.delete = Bm, yn.prototype.get = Um, yn.prototype.has = Hm, yn.prototype.set = zm;
      function Ku(t, i) {
        var s = ge(t), u = !s && Rr(t), d = !s && !u && gr(t), m = !s && !u && !d && ai(t), y = s || u || d || m, b = y ? Qa(t.length, em) : [], $ = b.length;
        for (var I in t)
          (i || Ee.call(t, I)) && !(y && // Safari 9 has enumerable `arguments.length` in strict mode.
          (I == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
          d && (I == "offset" || I == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
          m && (I == "buffer" || I == "byteLength" || I == "byteOffset") || // Skip index properties.
          Kn(I, $))) && b.push(I);
        return b;
      }
      function Vu(t) {
        var i = t.length;
        return i ? t[go(0, i - 1)] : r;
      }
      function qm(t, i) {
        return Qs(Lt(t), Ir(i, 0, t.length));
      }
      function Km(t) {
        return Qs(Lt(t));
      }
      function ao(t, i, s) {
        (s !== r && !_n(t[i], s) || s === r && !(i in t)) && Hn(t, i, s);
      }
      function Fi(t, i, s) {
        var u = t[i];
        (!(Ee.call(t, i) && _n(u, s)) || s === r && !(i in t)) && Hn(t, i, s);
      }
      function Ws(t, i) {
        for (var s = t.length; s--; )
          if (_n(t[s][0], i))
            return s;
        return -1;
      }
      function Vm(t, i, s, u) {
        return hr(t, function(d, m, y) {
          i(u, d, s(d), y);
        }), u;
      }
      function Gu(t, i) {
        return t && An(i, ct(i), t);
      }
      function Gm(t, i) {
        return t && An(i, Rt(i), t);
      }
      function Hn(t, i, s) {
        i == "__proto__" && Es ? Es(t, i, {
          configurable: !0,
          enumerable: !0,
          value: s,
          writable: !0
        }) : t[i] = s;
      }
      function oo(t, i) {
        for (var s = -1, u = i.length, d = x(u), m = t == null; ++s < u; )
          d[s] = m ? r : Uo(t, i[s]);
        return d;
      }
      function Ir(t, i, s) {
        return t === t && (s !== r && (t = t <= s ? t : s), i !== r && (t = t >= i ? t : i)), t;
      }
      function an(t, i, s, u, d, m) {
        var y, b = i & w, $ = i & M, I = i & S;
        if (s && (y = d ? s(t, u, d, m) : s(t)), y !== r)
          return y;
        if (!Ze(t))
          return t;
        var L = ge(t);
        if (L) {
          if (y = Yg(t), !b)
            return Lt(t, y);
        } else {
          var F = Dt(t), K = F == ft || F == St;
          if (gr(t))
            return yc(t, b);
          if (F == dt || F == Ne || K && !d) {
            if (y = $ || K ? {} : Rc(t), !b)
              return $ ? Sg(t, Gm(y, t)) : Cg(t, Gu(y, t));
          } else {
            if (!ze[F])
              return d ? t : {};
            y = Rg(t, F, b);
          }
        }
        m || (m = new yn());
        var X = m.get(t);
        if (X)
          return X;
        m.set(t, y), hf(t) ? t.forEach(function(ce) {
          y.add(an(ce, i, s, ce, t, m));
        }) : ff(t) && t.forEach(function(ce, Ce) {
          y.set(Ce, an(ce, i, s, Ce, t, m));
        });
        var ue = I ? $ ? xo : Oo : $ ? Rt : ct, _e = L ? r : ue(t);
        return nn(_e || t, function(ce, Ce) {
          _e && (Ce = ce, ce = t[Ce]), Fi(y, Ce, an(ce, i, s, Ce, t, m));
        }), y;
      }
      function jm(t) {
        var i = ct(t);
        return function(s) {
          return ju(s, t, i);
        };
      }
      function ju(t, i, s) {
        var u = s.length;
        if (t == null)
          return !u;
        for (t = We(t); u--; ) {
          var d = s[u], m = i[d], y = t[d];
          if (y === r && !(d in t) || !m(y))
            return !1;
        }
        return !0;
      }
      function Zu(t, i, s) {
        if (typeof t != "function")
          throw new rn(c);
        return qi(function() {
          t.apply(r, s);
        }, i);
      }
      function Ni(t, i, s, u) {
        var d = -1, m = $s, y = !0, b = t.length, $ = [], I = i.length;
        if (!b)
          return $;
        s && (i = Ve(i, qt(s))), u ? (m = Va, y = !1) : i.length >= l && (m = ki, y = !1, i = new kr(i));
        e:
          for (; ++d < b; ) {
            var L = t[d], F = s == null ? L : s(L);
            if (L = u || L !== 0 ? L : 0, y && F === F) {
              for (var K = I; K--; )
                if (i[K] === F)
                  continue e;
              $.push(L);
            } else
              m(i, F, u) || $.push(L);
          }
        return $;
      }
      var hr = $c(xn), Xu = $c(uo, !0);
      function Zm(t, i) {
        var s = !0;
        return hr(t, function(u, d, m) {
          return s = !!i(u, d, m), s;
        }), s;
      }
      function Bs(t, i, s) {
        for (var u = -1, d = t.length; ++u < d; ) {
          var m = t[u], y = i(m);
          if (y != null && (b === r ? y === y && !Vt(y) : s(y, b)))
            var b = y, $ = m;
        }
        return $;
      }
      function Xm(t, i, s, u) {
        var d = t.length;
        for (s = ye(s), s < 0 && (s = -s > d ? 0 : d + s), u = u === r || u > d ? d : ye(u), u < 0 && (u += d), u = s > u ? 0 : pf(u); s < u; )
          t[s++] = i;
        return t;
      }
      function Ju(t, i) {
        var s = [];
        return hr(t, function(u, d, m) {
          i(u, d, m) && s.push(u);
        }), s;
      }
      function mt(t, i, s, u, d) {
        var m = -1, y = t.length;
        for (s || (s = Ng), d || (d = []); ++m < y; ) {
          var b = t[m];
          i > 0 && s(b) ? i > 1 ? mt(b, i - 1, s, u, d) : cr(d, b) : u || (d[d.length] = b);
        }
        return d;
      }
      var lo = Cc(), Qu = Cc(!0);
      function xn(t, i) {
        return t && lo(t, i, ct);
      }
      function uo(t, i) {
        return t && Qu(t, i, ct);
      }
      function Us(t, i) {
        return ur(i, function(s) {
          return Vn(t[s]);
        });
      }
      function Er(t, i) {
        i = pr(i, t);
        for (var s = 0, u = i.length; t != null && s < u; )
          t = t[Tn(i[s++])];
        return s && s == u ? t : r;
      }
      function ec(t, i, s) {
        var u = i(t);
        return ge(t) ? u : cr(u, s(t));
      }
      function Ot(t) {
        return t == null ? t === r ? Mn : en : Tr && Tr in We(t) ? Ig(t) : Kg(t);
      }
      function co(t, i) {
        return t > i;
      }
      function Jm(t, i) {
        return t != null && Ee.call(t, i);
      }
      function Qm(t, i) {
        return t != null && i in We(t);
      }
      function eg(t, i, s) {
        return t >= wt(i, s) && t < ut(i, s);
      }
      function fo(t, i, s) {
        for (var u = s ? Va : $s, d = t[0].length, m = t.length, y = m, b = x(m), $ = 1 / 0, I = []; y--; ) {
          var L = t[y];
          y && i && (L = Ve(L, qt(i))), $ = wt(L.length, $), b[y] = !s && (i || d >= 120 && L.length >= 120) ? new kr(y && L) : r;
        }
        L = t[0];
        var F = -1, K = b[0];
        e:
          for (; ++F < d && I.length < $; ) {
            var X = L[F], ue = i ? i(X) : X;
            if (X = s || X !== 0 ? X : 0, !(K ? ki(K, ue) : u(I, ue, s))) {
              for (y = m; --y; ) {
                var _e = b[y];
                if (!(_e ? ki(_e, ue) : u(t[y], ue, s)))
                  continue e;
              }
              K && K.push(ue), I.push(X);
            }
          }
        return I;
      }
      function tg(t, i, s, u) {
        return xn(t, function(d, m, y) {
          i(u, s(d), m, y);
        }), u;
      }
      function Wi(t, i, s) {
        i = pr(i, t), t = Bc(t, i);
        var u = t == null ? t : t[Tn(ln(i))];
        return u == null ? r : zt(u, t, s);
      }
      function tc(t) {
        return tt(t) && Ot(t) == Ne;
      }
      function ng(t) {
        return tt(t) && Ot(t) == Ut;
      }
      function rg(t) {
        return tt(t) && Ot(t) == ot;
      }
      function Bi(t, i, s, u, d) {
        return t === i ? !0 : t == null || i == null || !tt(t) && !tt(i) ? t !== t && i !== i : ig(t, i, s, u, Bi, d);
      }
      function ig(t, i, s, u, d, m) {
        var y = ge(t), b = ge(i), $ = y ? Qe : Dt(t), I = b ? Qe : Dt(i);
        $ = $ == Ne ? dt : $, I = I == Ne ? dt : I;
        var L = $ == dt, F = I == dt, K = $ == I;
        if (K && gr(t)) {
          if (!gr(i))
            return !1;
          y = !0, L = !1;
        }
        if (K && !L)
          return m || (m = new yn()), y || ai(t) ? Ec(t, i, s, u, d, m) : Pg(t, i, $, s, u, d, m);
        if (!(s & k)) {
          var X = L && Ee.call(t, "__wrapped__"), ue = F && Ee.call(i, "__wrapped__");
          if (X || ue) {
            var _e = X ? t.value() : t, ce = ue ? i.value() : i;
            return m || (m = new yn()), d(_e, ce, s, u, m);
          }
        }
        return K ? (m || (m = new yn()), kg(t, i, s, u, d, m)) : !1;
      }
      function sg(t) {
        return tt(t) && Dt(t) == st;
      }
      function ho(t, i, s, u) {
        var d = s.length, m = d, y = !u;
        if (t == null)
          return !m;
        for (t = We(t); d--; ) {
          var b = s[d];
          if (y && b[2] ? b[1] !== t[b[0]] : !(b[0] in t))
            return !1;
        }
        for (; ++d < m; ) {
          b = s[d];
          var $ = b[0], I = t[$], L = b[1];
          if (y && b[2]) {
            if (I === r && !($ in t))
              return !1;
          } else {
            var F = new yn();
            if (u)
              var K = u(I, L, $, t, i, F);
            if (!(K === r ? Bi(L, I, k | U, u, F) : K))
              return !1;
          }
        }
        return !0;
      }
      function nc(t) {
        if (!Ze(t) || Bg(t))
          return !1;
        var i = Vn(t) ? sm : jv;
        return i.test(Yr(t));
      }
      function ag(t) {
        return tt(t) && Ot(t) == ht;
      }
      function og(t) {
        return tt(t) && Dt(t) == at;
      }
      function lg(t) {
        return tt(t) && sa(t.length) && !!qe[Ot(t)];
      }
      function rc(t) {
        return typeof t == "function" ? t : t == null ? Ft : typeof t == "object" ? ge(t) ? ac(t[0], t[1]) : sc(t) : Mf(t);
      }
      function vo(t) {
        if (!zi(t))
          return fm(t);
        var i = [];
        for (var s in We(t))
          Ee.call(t, s) && s != "constructor" && i.push(s);
        return i;
      }
      function ug(t) {
        if (!Ze(t))
          return qg(t);
        var i = zi(t), s = [];
        for (var u in t)
          u == "constructor" && (i || !Ee.call(t, u)) || s.push(u);
        return s;
      }
      function po(t, i) {
        return t < i;
      }
      function ic(t, i) {
        var s = -1, u = Yt(t) ? x(t.length) : [];
        return hr(t, function(d, m, y) {
          u[++s] = i(d, m, y);
        }), u;
      }
      function sc(t) {
        var i = To(t);
        return i.length == 1 && i[0][2] ? Nc(i[0][0], i[0][1]) : function(s) {
          return s === t || ho(s, t, i);
        };
      }
      function ac(t, i) {
        return ko(t) && Fc(i) ? Nc(Tn(t), i) : function(s) {
          var u = Uo(s, t);
          return u === r && u === i ? Ho(s, t) : Bi(i, u, k | U);
        };
      }
      function Hs(t, i, s, u, d) {
        t !== i && lo(i, function(m, y) {
          if (d || (d = new yn()), Ze(m))
            cg(t, i, y, s, Hs, u, d);
          else {
            var b = u ? u(Eo(t, y), m, y + "", t, i, d) : r;
            b === r && (b = m), ao(t, y, b);
          }
        }, Rt);
      }
      function cg(t, i, s, u, d, m, y) {
        var b = Eo(t, s), $ = Eo(i, s), I = y.get($);
        if (I) {
          ao(t, s, I);
          return;
        }
        var L = m ? m(b, $, s + "", t, i, y) : r, F = L === r;
        if (F) {
          var K = ge($), X = !K && gr($), ue = !K && !X && ai($);
          L = $, K || X || ue ? ge(b) ? L = b : rt(b) ? L = Lt(b) : X ? (F = !1, L = yc($, !0)) : ue ? (F = !1, L = _c($, !0)) : L = [] : Ki($) || Rr($) ? (L = b, Rr(b) ? L = mf(b) : (!Ze(b) || Vn(b)) && (L = Rc($))) : F = !1;
        }
        F && (y.set($, L), d(L, $, u, m, y), y.delete($)), ao(t, s, L);
      }
      function oc(t, i) {
        var s = t.length;
        if (s)
          return i += i < 0 ? s : 0, Kn(i, s) ? t[i] : r;
      }
      function lc(t, i, s) {
        i.length ? i = Ve(i, function(m) {
          return ge(m) ? function(y) {
            return Er(y, m.length === 1 ? m[0] : m);
          } : m;
        }) : i = [Ft];
        var u = -1;
        i = Ve(i, qt(oe()));
        var d = ic(t, function(m, y, b) {
          var $ = Ve(i, function(I) {
            return I(m);
          });
          return { criteria: $, index: ++u, value: m };
        });
        return Rp(d, function(m, y) {
          return $g(m, y, s);
        });
      }
      function fg(t, i) {
        return uc(t, i, function(s, u) {
          return Ho(t, u);
        });
      }
      function uc(t, i, s) {
        for (var u = -1, d = i.length, m = {}; ++u < d; ) {
          var y = i[u], b = Er(t, y);
          s(b, y) && Ui(m, pr(y, t), b);
        }
        return m;
      }
      function dg(t) {
        return function(i) {
          return Er(i, t);
        };
      }
      function mo(t, i, s, u) {
        var d = u ? Yp : jr, m = -1, y = i.length, b = t;
        for (t === i && (i = Lt(i)), s && (b = Ve(t, qt(s))); ++m < y; )
          for (var $ = 0, I = i[m], L = s ? s(I) : I; ($ = d(b, L, $, u)) > -1; )
            b !== t && Is.call(b, $, 1), Is.call(t, $, 1);
        return t;
      }
      function cc(t, i) {
        for (var s = t ? i.length : 0, u = s - 1; s--; ) {
          var d = i[s];
          if (s == u || d !== m) {
            var m = d;
            Kn(d) ? Is.call(t, d, 1) : bo(t, d);
          }
        }
        return t;
      }
      function go(t, i) {
        return t + Ys(zu() * (i - t + 1));
      }
      function hg(t, i, s, u) {
        for (var d = -1, m = ut(Ls((i - t) / (s || 1)), 0), y = x(m); m--; )
          y[u ? m : ++d] = t, t += s;
        return y;
      }
      function yo(t, i) {
        var s = "";
        if (!t || i < 1 || i > Ye)
          return s;
        do
          i % 2 && (s += t), i = Ys(i / 2), i && (t += t);
        while (i);
        return s;
      }
      function De(t, i) {
        return Lo(Wc(t, i, Ft), t + "");
      }
      function vg(t) {
        return Vu(oi(t));
      }
      function pg(t, i) {
        var s = oi(t);
        return Qs(s, Ir(i, 0, s.length));
      }
      function Ui(t, i, s, u) {
        if (!Ze(t))
          return t;
        i = pr(i, t);
        for (var d = -1, m = i.length, y = m - 1, b = t; b != null && ++d < m; ) {
          var $ = Tn(i[d]), I = s;
          if ($ === "__proto__" || $ === "constructor" || $ === "prototype")
            return t;
          if (d != y) {
            var L = b[$];
            I = u ? u(L, $, b) : r, I === r && (I = Ze(L) ? L : Kn(i[d + 1]) ? [] : {});
          }
          Fi(b, $, I), b = b[$];
        }
        return t;
      }
      var fc = Rs ? function(t, i) {
        return Rs.set(t, i), t;
      } : Ft, mg = Es ? function(t, i) {
        return Es(t, "toString", {
          configurable: !0,
          enumerable: !1,
          value: qo(i),
          writable: !0
        });
      } : Ft;
      function gg(t) {
        return Qs(oi(t));
      }
      function on(t, i, s) {
        var u = -1, d = t.length;
        i < 0 && (i = -i > d ? 0 : d + i), s = s > d ? d : s, s < 0 && (s += d), d = i > s ? 0 : s - i >>> 0, i >>>= 0;
        for (var m = x(d); ++u < d; )
          m[u] = t[u + i];
        return m;
      }
      function yg(t, i) {
        var s;
        return hr(t, function(u, d, m) {
          return s = i(u, d, m), !s;
        }), !!s;
      }
      function zs(t, i, s) {
        var u = 0, d = t == null ? u : t.length;
        if (typeof i == "number" && i === i && d <= Je) {
          for (; u < d; ) {
            var m = u + d >>> 1, y = t[m];
            y !== null && !Vt(y) && (s ? y <= i : y < i) ? u = m + 1 : d = m;
          }
          return d;
        }
        return _o(t, i, Ft, s);
      }
      function _o(t, i, s, u) {
        var d = 0, m = t == null ? 0 : t.length;
        if (m === 0)
          return 0;
        i = s(i);
        for (var y = i !== i, b = i === null, $ = Vt(i), I = i === r; d < m; ) {
          var L = Ys((d + m) / 2), F = s(t[L]), K = F !== r, X = F === null, ue = F === F, _e = Vt(F);
          if (y)
            var ce = u || ue;
          else
            I ? ce = ue && (u || K) : b ? ce = ue && K && (u || !X) : $ ? ce = ue && K && !X && (u || !_e) : X || _e ? ce = !1 : ce = u ? F <= i : F < i;
          ce ? d = L + 1 : m = L;
        }
        return wt(m, re);
      }
      function dc(t, i) {
        for (var s = -1, u = t.length, d = 0, m = []; ++s < u; ) {
          var y = t[s], b = i ? i(y) : y;
          if (!s || !_n(b, $)) {
            var $ = b;
            m[d++] = y === 0 ? 0 : y;
          }
        }
        return m;
      }
      function hc(t) {
        return typeof t == "number" ? t : Vt(t) ? B : +t;
      }
      function Kt(t) {
        if (typeof t == "string")
          return t;
        if (ge(t))
          return Ve(t, Kt) + "";
        if (Vt(t))
          return qu ? qu.call(t) : "";
        var i = t + "";
        return i == "0" && 1 / t == -Me ? "-0" : i;
      }
      function vr(t, i, s) {
        var u = -1, d = $s, m = t.length, y = !0, b = [], $ = b;
        if (s)
          y = !1, d = Va;
        else if (m >= l) {
          var I = i ? null : Ag(t);
          if (I)
            return Ss(I);
          y = !1, d = ki, $ = new kr();
        } else
          $ = i ? [] : b;
        e:
          for (; ++u < m; ) {
            var L = t[u], F = i ? i(L) : L;
            if (L = s || L !== 0 ? L : 0, y && F === F) {
              for (var K = $.length; K--; )
                if ($[K] === F)
                  continue e;
              i && $.push(F), b.push(L);
            } else
              d($, F, s) || ($ !== b && $.push(F), b.push(L));
          }
        return b;
      }
      function bo(t, i) {
        return i = pr(i, t), t = Bc(t, i), t == null || delete t[Tn(ln(i))];
      }
      function vc(t, i, s, u) {
        return Ui(t, i, s(Er(t, i)), u);
      }
      function qs(t, i, s, u) {
        for (var d = t.length, m = u ? d : -1; (u ? m-- : ++m < d) && i(t[m], m, t); )
          ;
        return s ? on(t, u ? 0 : m, u ? m + 1 : d) : on(t, u ? m + 1 : 0, u ? d : m);
      }
      function pc(t, i) {
        var s = t;
        return s instanceof Se && (s = s.value()), Ga(i, function(u, d) {
          return d.func.apply(d.thisArg, cr([u], d.args));
        }, s);
      }
      function wo(t, i, s) {
        var u = t.length;
        if (u < 2)
          return u ? vr(t[0]) : [];
        for (var d = -1, m = x(u); ++d < u; )
          for (var y = t[d], b = -1; ++b < u; )
            b != d && (m[d] = Ni(m[d] || y, t[b], i, s));
        return vr(mt(m, 1), i, s);
      }
      function mc(t, i, s) {
        for (var u = -1, d = t.length, m = i.length, y = {}; ++u < d; ) {
          var b = u < m ? i[u] : r;
          s(y, t[u], b);
        }
        return y;
      }
      function Do(t) {
        return rt(t) ? t : [];
      }
      function $o(t) {
        return typeof t == "function" ? t : Ft;
      }
      function pr(t, i) {
        return ge(t) ? t : ko(t, i) ? [t] : qc(Ie(t));
      }
      var _g = De;
      function mr(t, i, s) {
        var u = t.length;
        return s = s === r ? u : s, !i && s >= u ? t : on(t, i, s);
      }
      var gc = am || function(t) {
        return pt.clearTimeout(t);
      };
      function yc(t, i) {
        if (i)
          return t.slice();
        var s = t.length, u = Nu ? Nu(s) : new t.constructor(s);
        return t.copy(u), u;
      }
      function Co(t) {
        var i = new t.constructor(t.byteLength);
        return new Ps(i).set(new Ps(t)), i;
      }
      function bg(t, i) {
        var s = i ? Co(t.buffer) : t.buffer;
        return new t.constructor(s, t.byteOffset, t.byteLength);
      }
      function wg(t) {
        var i = new t.constructor(t.source, tu.exec(t));
        return i.lastIndex = t.lastIndex, i;
      }
      function Dg(t) {
        return Ri ? We(Ri.call(t)) : {};
      }
      function _c(t, i) {
        var s = i ? Co(t.buffer) : t.buffer;
        return new t.constructor(s, t.byteOffset, t.length);
      }
      function bc(t, i) {
        if (t !== i) {
          var s = t !== r, u = t === null, d = t === t, m = Vt(t), y = i !== r, b = i === null, $ = i === i, I = Vt(i);
          if (!b && !I && !m && t > i || m && y && $ && !b && !I || u && y && $ || !s && $ || !d)
            return 1;
          if (!u && !m && !I && t < i || I && s && d && !u && !m || b && s && d || !y && d || !$)
            return -1;
        }
        return 0;
      }
      function $g(t, i, s) {
        for (var u = -1, d = t.criteria, m = i.criteria, y = d.length, b = s.length; ++u < y; ) {
          var $ = bc(d[u], m[u]);
          if ($) {
            if (u >= b)
              return $;
            var I = s[u];
            return $ * (I == "desc" ? -1 : 1);
          }
        }
        return t.index - i.index;
      }
      function wc(t, i, s, u) {
        for (var d = -1, m = t.length, y = s.length, b = -1, $ = i.length, I = ut(m - y, 0), L = x($ + I), F = !u; ++b < $; )
          L[b] = i[b];
        for (; ++d < y; )
          (F || d < m) && (L[s[d]] = t[d]);
        for (; I--; )
          L[b++] = t[d++];
        return L;
      }
      function Dc(t, i, s, u) {
        for (var d = -1, m = t.length, y = -1, b = s.length, $ = -1, I = i.length, L = ut(m - b, 0), F = x(L + I), K = !u; ++d < L; )
          F[d] = t[d];
        for (var X = d; ++$ < I; )
          F[X + $] = i[$];
        for (; ++y < b; )
          (K || d < m) && (F[X + s[y]] = t[d++]);
        return F;
      }
      function Lt(t, i) {
        var s = -1, u = t.length;
        for (i || (i = x(u)); ++s < u; )
          i[s] = t[s];
        return i;
      }
      function An(t, i, s, u) {
        var d = !s;
        s || (s = {});
        for (var m = -1, y = i.length; ++m < y; ) {
          var b = i[m], $ = u ? u(s[b], t[b], b, s, t) : r;
          $ === r && ($ = t[b]), d ? Hn(s, b, $) : Fi(s, b, $);
        }
        return s;
      }
      function Cg(t, i) {
        return An(t, Po(t), i);
      }
      function Sg(t, i) {
        return An(t, Lc(t), i);
      }
      function Ks(t, i) {
        return function(s, u) {
          var d = ge(s) ? Tp : Vm, m = i ? i() : {};
          return d(s, t, oe(u, 2), m);
        };
      }
      function ri(t) {
        return De(function(i, s) {
          var u = -1, d = s.length, m = d > 1 ? s[d - 1] : r, y = d > 2 ? s[2] : r;
          for (m = t.length > 3 && typeof m == "function" ? (d--, m) : r, y && xt(s[0], s[1], y) && (m = d < 3 ? r : m, d = 1), i = We(i); ++u < d; ) {
            var b = s[u];
            b && t(i, b, u, m);
          }
          return i;
        });
      }
      function $c(t, i) {
        return function(s, u) {
          if (s == null)
            return s;
          if (!Yt(s))
            return t(s, u);
          for (var d = s.length, m = i ? d : -1, y = We(s); (i ? m-- : ++m < d) && u(y[m], m, y) !== !1; )
            ;
          return s;
        };
      }
      function Cc(t) {
        return function(i, s, u) {
          for (var d = -1, m = We(i), y = u(i), b = y.length; b--; ) {
            var $ = y[t ? b : ++d];
            if (s(m[$], $, m) === !1)
              break;
          }
          return i;
        };
      }
      function Mg(t, i, s) {
        var u = i & R, d = Hi(t);
        function m() {
          var y = this && this !== pt && this instanceof m ? d : t;
          return y.apply(u ? s : this, arguments);
        }
        return m;
      }
      function Sc(t) {
        return function(i) {
          i = Ie(i);
          var s = Zr(i) ? gn(i) : r, u = s ? s[0] : i.charAt(0), d = s ? mr(s, 1).join("") : i.slice(1);
          return u[t]() + d;
        };
      }
      function ii(t) {
        return function(i) {
          return Ga(Cf($f(i).replace(mp, "")), t, "");
        };
      }
      function Hi(t) {
        return function() {
          var i = arguments;
          switch (i.length) {
            case 0:
              return new t();
            case 1:
              return new t(i[0]);
            case 2:
              return new t(i[0], i[1]);
            case 3:
              return new t(i[0], i[1], i[2]);
            case 4:
              return new t(i[0], i[1], i[2], i[3]);
            case 5:
              return new t(i[0], i[1], i[2], i[3], i[4]);
            case 6:
              return new t(i[0], i[1], i[2], i[3], i[4], i[5]);
            case 7:
              return new t(i[0], i[1], i[2], i[3], i[4], i[5], i[6]);
          }
          var s = ni(t.prototype), u = t.apply(s, i);
          return Ze(u) ? u : s;
        };
      }
      function Og(t, i, s) {
        var u = Hi(t);
        function d() {
          for (var m = arguments.length, y = x(m), b = m, $ = si(d); b--; )
            y[b] = arguments[b];
          var I = m < 3 && y[0] !== $ && y[m - 1] !== $ ? [] : fr(y, $);
          if (m -= I.length, m < s)
            return Tc(
              t,
              i,
              Vs,
              d.placeholder,
              r,
              y,
              I,
              r,
              r,
              s - m
            );
          var L = this && this !== pt && this instanceof d ? u : t;
          return zt(L, this, y);
        }
        return d;
      }
      function Mc(t) {
        return function(i, s, u) {
          var d = We(i);
          if (!Yt(i)) {
            var m = oe(s, 3);
            i = ct(i), s = function(b) {
              return m(d[b], b, d);
            };
          }
          var y = t(i, s, u);
          return y > -1 ? d[m ? i[y] : y] : r;
        };
      }
      function Oc(t) {
        return qn(function(i) {
          var s = i.length, u = s, d = sn.prototype.thru;
          for (t && i.reverse(); u--; ) {
            var m = i[u];
            if (typeof m != "function")
              throw new rn(c);
            if (d && !y && Xs(m) == "wrapper")
              var y = new sn([], !0);
          }
          for (u = y ? u : s; ++u < s; ) {
            m = i[u];
            var b = Xs(m), $ = b == "wrapper" ? Ao(m) : r;
            $ && Io($[0]) && $[1] == (V | Q | z | ne) && !$[4].length && $[9] == 1 ? y = y[Xs($[0])].apply(y, $[3]) : y = m.length == 1 && Io(m) ? y[b]() : y.thru(m);
          }
          return function() {
            var I = arguments, L = I[0];
            if (y && I.length == 1 && ge(L))
              return y.plant(L).value();
            for (var F = 0, K = s ? i[F].apply(this, I) : L; ++F < s; )
              K = i[F].call(this, K);
            return K;
          };
        });
      }
      function Vs(t, i, s, u, d, m, y, b, $, I) {
        var L = i & V, F = i & R, K = i & P, X = i & (Q | H), ue = i & me, _e = K ? r : Hi(t);
        function ce() {
          for (var Ce = arguments.length, Oe = x(Ce), Gt = Ce; Gt--; )
            Oe[Gt] = arguments[Gt];
          if (X)
            var At = si(ce), jt = Np(Oe, At);
          if (u && (Oe = wc(Oe, u, d, X)), m && (Oe = Dc(Oe, m, y, X)), Ce -= jt, X && Ce < I) {
            var it = fr(Oe, At);
            return Tc(
              t,
              i,
              Vs,
              ce.placeholder,
              s,
              Oe,
              it,
              b,
              $,
              I - Ce
            );
          }
          var bn = F ? s : this, jn = K ? bn[t] : t;
          return Ce = Oe.length, b ? Oe = Vg(Oe, b) : ue && Ce > 1 && Oe.reverse(), L && $ < Ce && (Oe.length = $), this && this !== pt && this instanceof ce && (jn = _e || Hi(jn)), jn.apply(bn, Oe);
        }
        return ce;
      }
      function xc(t, i) {
        return function(s, u) {
          return tg(s, t, i(u), {});
        };
      }
      function Gs(t, i) {
        return function(s, u) {
          var d;
          if (s === r && u === r)
            return i;
          if (s !== r && (d = s), u !== r) {
            if (d === r)
              return u;
            typeof s == "string" || typeof u == "string" ? (s = Kt(s), u = Kt(u)) : (s = hc(s), u = hc(u)), d = t(s, u);
          }
          return d;
        };
      }
      function So(t) {
        return qn(function(i) {
          return i = Ve(i, qt(oe())), De(function(s) {
            var u = this;
            return t(i, function(d) {
              return zt(d, u, s);
            });
          });
        });
      }
      function js(t, i) {
        i = i === r ? " " : Kt(i);
        var s = i.length;
        if (s < 2)
          return s ? yo(i, t) : i;
        var u = yo(i, Ls(t / Xr(i)));
        return Zr(i) ? mr(gn(u), 0, t).join("") : u.slice(0, t);
      }
      function xg(t, i, s, u) {
        var d = i & R, m = Hi(t);
        function y() {
          for (var b = -1, $ = arguments.length, I = -1, L = u.length, F = x(L + $), K = this && this !== pt && this instanceof y ? m : t; ++I < L; )
            F[I] = u[I];
          for (; $--; )
            F[I++] = arguments[++b];
          return zt(K, d ? s : this, F);
        }
        return y;
      }
      function Ac(t) {
        return function(i, s, u) {
          return u && typeof u != "number" && xt(i, s, u) && (s = u = r), i = Gn(i), s === r ? (s = i, i = 0) : s = Gn(s), u = u === r ? i < s ? 1 : -1 : Gn(u), hg(i, s, u, t);
        };
      }
      function Zs(t) {
        return function(i, s) {
          return typeof i == "string" && typeof s == "string" || (i = un(i), s = un(s)), t(i, s);
        };
      }
      function Tc(t, i, s, u, d, m, y, b, $, I) {
        var L = i & Q, F = L ? y : r, K = L ? r : y, X = L ? m : r, ue = L ? r : m;
        i |= L ? z : te, i &= ~(L ? te : z), i & J || (i &= ~(R | P));
        var _e = [
          t,
          i,
          d,
          X,
          F,
          ue,
          K,
          b,
          $,
          I
        ], ce = s.apply(r, _e);
        return Io(t) && Uc(ce, _e), ce.placeholder = u, Hc(ce, t, i);
      }
      function Mo(t) {
        var i = lt[t];
        return function(s, u) {
          if (s = un(s), u = u == null ? 0 : wt(ye(u), 292), u && Hu(s)) {
            var d = (Ie(s) + "e").split("e"), m = i(d[0] + "e" + (+d[1] + u));
            return d = (Ie(m) + "e").split("e"), +(d[0] + "e" + (+d[1] - u));
          }
          return i(s);
        };
      }
      var Ag = ei && 1 / Ss(new ei([, -0]))[1] == Me ? function(t) {
        return new ei(t);
      } : Go;
      function Pc(t) {
        return function(i) {
          var s = Dt(i);
          return s == st ? to(i) : s == at ? Kp(i) : Fp(i, t(i));
        };
      }
      function zn(t, i, s, u, d, m, y, b) {
        var $ = i & P;
        if (!$ && typeof t != "function")
          throw new rn(c);
        var I = u ? u.length : 0;
        if (I || (i &= ~(z | te), u = d = r), y = y === r ? y : ut(ye(y), 0), b = b === r ? b : ye(b), I -= d ? d.length : 0, i & te) {
          var L = u, F = d;
          u = d = r;
        }
        var K = $ ? r : Ao(t), X = [
          t,
          i,
          s,
          u,
          d,
          L,
          F,
          m,
          y,
          b
        ];
        if (K && zg(X, K), t = X[0], i = X[1], s = X[2], u = X[3], d = X[4], b = X[9] = X[9] === r ? $ ? 0 : t.length : ut(X[9] - I, 0), !b && i & (Q | H) && (i &= ~(Q | H)), !i || i == R)
          var ue = Mg(t, i, s);
        else
          i == Q || i == H ? ue = Og(t, i, b) : (i == z || i == (R | z)) && !d.length ? ue = xg(t, i, s, u) : ue = Vs.apply(r, X);
        var _e = K ? fc : Uc;
        return Hc(_e(ue, X), t, i);
      }
      function kc(t, i, s, u) {
        return t === r || _n(t, Qr[s]) && !Ee.call(u, s) ? i : t;
      }
      function Ic(t, i, s, u, d, m) {
        return Ze(t) && Ze(i) && (m.set(i, t), Hs(t, i, r, Ic, m), m.delete(i)), t;
      }
      function Tg(t) {
        return Ki(t) ? r : t;
      }
      function Ec(t, i, s, u, d, m) {
        var y = s & k, b = t.length, $ = i.length;
        if (b != $ && !(y && $ > b))
          return !1;
        var I = m.get(t), L = m.get(i);
        if (I && L)
          return I == i && L == t;
        var F = -1, K = !0, X = s & U ? new kr() : r;
        for (m.set(t, i), m.set(i, t); ++F < b; ) {
          var ue = t[F], _e = i[F];
          if (u)
            var ce = y ? u(_e, ue, F, i, t, m) : u(ue, _e, F, t, i, m);
          if (ce !== r) {
            if (ce)
              continue;
            K = !1;
            break;
          }
          if (X) {
            if (!ja(i, function(Ce, Oe) {
              if (!ki(X, Oe) && (ue === Ce || d(ue, Ce, s, u, m)))
                return X.push(Oe);
            })) {
              K = !1;
              break;
            }
          } else if (!(ue === _e || d(ue, _e, s, u, m))) {
            K = !1;
            break;
          }
        }
        return m.delete(t), m.delete(i), K;
      }
      function Pg(t, i, s, u, d, m, y) {
        switch (s) {
          case Ht:
            if (t.byteLength != i.byteLength || t.byteOffset != i.byteOffset)
              return !1;
            t = t.buffer, i = i.buffer;
          case Ut:
            return !(t.byteLength != i.byteLength || !m(new Ps(t), new Ps(i)));
          case je:
          case ot:
          case Qt:
            return _n(+t, +i);
          case _t:
            return t.name == i.name && t.message == i.message;
          case ht:
          case It:
            return t == i + "";
          case st:
            var b = to;
          case at:
            var $ = u & k;
            if (b || (b = Ss), t.size != i.size && !$)
              return !1;
            var I = y.get(t);
            if (I)
              return I == i;
            u |= U, y.set(t, i);
            var L = Ec(b(t), b(i), u, d, m, y);
            return y.delete(t), L;
          case Bt:
            if (Ri)
              return Ri.call(t) == Ri.call(i);
        }
        return !1;
      }
      function kg(t, i, s, u, d, m) {
        var y = s & k, b = Oo(t), $ = b.length, I = Oo(i), L = I.length;
        if ($ != L && !y)
          return !1;
        for (var F = $; F--; ) {
          var K = b[F];
          if (!(y ? K in i : Ee.call(i, K)))
            return !1;
        }
        var X = m.get(t), ue = m.get(i);
        if (X && ue)
          return X == i && ue == t;
        var _e = !0;
        m.set(t, i), m.set(i, t);
        for (var ce = y; ++F < $; ) {
          K = b[F];
          var Ce = t[K], Oe = i[K];
          if (u)
            var Gt = y ? u(Oe, Ce, K, i, t, m) : u(Ce, Oe, K, t, i, m);
          if (!(Gt === r ? Ce === Oe || d(Ce, Oe, s, u, m) : Gt)) {
            _e = !1;
            break;
          }
          ce || (ce = K == "constructor");
        }
        if (_e && !ce) {
          var At = t.constructor, jt = i.constructor;
          At != jt && "constructor" in t && "constructor" in i && !(typeof At == "function" && At instanceof At && typeof jt == "function" && jt instanceof jt) && (_e = !1);
        }
        return m.delete(t), m.delete(i), _e;
      }
      function qn(t) {
        return Lo(Wc(t, r, jc), t + "");
      }
      function Oo(t) {
        return ec(t, ct, Po);
      }
      function xo(t) {
        return ec(t, Rt, Lc);
      }
      var Ao = Rs ? function(t) {
        return Rs.get(t);
      } : Go;
      function Xs(t) {
        for (var i = t.name + "", s = ti[i], u = Ee.call(ti, i) ? s.length : 0; u--; ) {
          var d = s[u], m = d.func;
          if (m == null || m == t)
            return d.name;
        }
        return i;
      }
      function si(t) {
        var i = Ee.call(v, "placeholder") ? v : t;
        return i.placeholder;
      }
      function oe() {
        var t = v.iteratee || Ko;
        return t = t === Ko ? rc : t, arguments.length ? t(arguments[0], arguments[1]) : t;
      }
      function Js(t, i) {
        var s = t.__data__;
        return Wg(i) ? s[typeof i == "string" ? "string" : "hash"] : s.map;
      }
      function To(t) {
        for (var i = ct(t), s = i.length; s--; ) {
          var u = i[s], d = t[u];
          i[s] = [u, d, Fc(d)];
        }
        return i;
      }
      function Lr(t, i) {
        var s = Hp(t, i);
        return nc(s) ? s : r;
      }
      function Ig(t) {
        var i = Ee.call(t, Tr), s = t[Tr];
        try {
          t[Tr] = r;
          var u = !0;
        } catch {
        }
        var d = As.call(t);
        return u && (i ? t[Tr] = s : delete t[Tr]), d;
      }
      var Po = ro ? function(t) {
        return t == null ? [] : (t = We(t), ur(ro(t), function(i) {
          return Bu.call(t, i);
        }));
      } : jo, Lc = ro ? function(t) {
        for (var i = []; t; )
          cr(i, Po(t)), t = ks(t);
        return i;
      } : jo, Dt = Ot;
      (io && Dt(new io(new ArrayBuffer(1))) != Ht || Ei && Dt(new Ei()) != st || so && Dt(so.resolve()) != Sn || ei && Dt(new ei()) != at || Li && Dt(new Li()) != Et) && (Dt = function(t) {
        var i = Ot(t), s = i == dt ? t.constructor : r, u = s ? Yr(s) : "";
        if (u)
          switch (u) {
            case pm:
              return Ht;
            case mm:
              return st;
            case gm:
              return Sn;
            case ym:
              return at;
            case _m:
              return Et;
          }
        return i;
      });
      function Eg(t, i, s) {
        for (var u = -1, d = s.length; ++u < d; ) {
          var m = s[u], y = m.size;
          switch (m.type) {
            case "drop":
              t += y;
              break;
            case "dropRight":
              i -= y;
              break;
            case "take":
              i = wt(i, t + y);
              break;
            case "takeRight":
              t = ut(t, i - y);
              break;
          }
        }
        return { start: t, end: i };
      }
      function Lg(t) {
        var i = t.match(Bv);
        return i ? i[1].split(Uv) : [];
      }
      function Yc(t, i, s) {
        i = pr(i, t);
        for (var u = -1, d = i.length, m = !1; ++u < d; ) {
          var y = Tn(i[u]);
          if (!(m = t != null && s(t, y)))
            break;
          t = t[y];
        }
        return m || ++u != d ? m : (d = t == null ? 0 : t.length, !!d && sa(d) && Kn(y, d) && (ge(t) || Rr(t)));
      }
      function Yg(t) {
        var i = t.length, s = new t.constructor(i);
        return i && typeof t[0] == "string" && Ee.call(t, "index") && (s.index = t.index, s.input = t.input), s;
      }
      function Rc(t) {
        return typeof t.constructor == "function" && !zi(t) ? ni(ks(t)) : {};
      }
      function Rg(t, i, s) {
        var u = t.constructor;
        switch (i) {
          case Ut:
            return Co(t);
          case je:
          case ot:
            return new u(+t);
          case Ht:
            return bg(t, s);
          case Sr:
          case Nn:
          case Mr:
          case rr:
          case ir:
          case Or:
          case sr:
          case ar:
          case N:
            return _c(t, s);
          case st:
            return new u();
          case Qt:
          case It:
            return new u(t);
          case ht:
            return wg(t);
          case at:
            return new u();
          case Bt:
            return Dg(t);
        }
      }
      function Fg(t, i) {
        var s = i.length;
        if (!s)
          return t;
        var u = s - 1;
        return i[u] = (s > 1 ? "& " : "") + i[u], i = i.join(s > 2 ? ", " : " "), t.replace(Wv, `{
/* [wrapped with ` + i + `] */
`);
      }
      function Ng(t) {
        return ge(t) || Rr(t) || !!(Uu && t && t[Uu]);
      }
      function Kn(t, i) {
        var s = typeof t;
        return i = i ?? Ye, !!i && (s == "number" || s != "symbol" && Xv.test(t)) && t > -1 && t % 1 == 0 && t < i;
      }
      function xt(t, i, s) {
        if (!Ze(s))
          return !1;
        var u = typeof i;
        return (u == "number" ? Yt(s) && Kn(i, s.length) : u == "string" && i in s) ? _n(s[i], t) : !1;
      }
      function ko(t, i) {
        if (ge(t))
          return !1;
        var s = typeof t;
        return s == "number" || s == "symbol" || s == "boolean" || t == null || Vt(t) ? !0 : Ti.test(t) || !bt.test(t) || i != null && t in We(i);
      }
      function Wg(t) {
        var i = typeof t;
        return i == "string" || i == "number" || i == "symbol" || i == "boolean" ? t !== "__proto__" : t === null;
      }
      function Io(t) {
        var i = Xs(t), s = v[i];
        if (typeof s != "function" || !(i in Se.prototype))
          return !1;
        if (t === s)
          return !0;
        var u = Ao(s);
        return !!u && t === u[0];
      }
      function Bg(t) {
        return !!Fu && Fu in t;
      }
      var Ug = Os ? Vn : Zo;
      function zi(t) {
        var i = t && t.constructor, s = typeof i == "function" && i.prototype || Qr;
        return t === s;
      }
      function Fc(t) {
        return t === t && !Ze(t);
      }
      function Nc(t, i) {
        return function(s) {
          return s == null ? !1 : s[t] === i && (i !== r || t in We(s));
        };
      }
      function Hg(t) {
        var i = ra(t, function(u) {
          return s.size === p && s.clear(), u;
        }), s = i.cache;
        return i;
      }
      function zg(t, i) {
        var s = t[1], u = i[1], d = s | u, m = d < (R | P | V), y = u == V && s == Q || u == V && s == ne && t[7].length <= i[8] || u == (V | ne) && i[7].length <= i[8] && s == Q;
        if (!(m || y))
          return t;
        u & R && (t[2] = i[2], d |= s & R ? 0 : J);
        var b = i[3];
        if (b) {
          var $ = t[3];
          t[3] = $ ? wc($, b, i[4]) : b, t[4] = $ ? fr(t[3], g) : i[4];
        }
        return b = i[5], b && ($ = t[5], t[5] = $ ? Dc($, b, i[6]) : b, t[6] = $ ? fr(t[5], g) : i[6]), b = i[7], b && (t[7] = b), u & V && (t[8] = t[8] == null ? i[8] : wt(t[8], i[8])), t[9] == null && (t[9] = i[9]), t[0] = i[0], t[1] = d, t;
      }
      function qg(t) {
        var i = [];
        if (t != null)
          for (var s in We(t))
            i.push(s);
        return i;
      }
      function Kg(t) {
        return As.call(t);
      }
      function Wc(t, i, s) {
        return i = ut(i === r ? t.length - 1 : i, 0), function() {
          for (var u = arguments, d = -1, m = ut(u.length - i, 0), y = x(m); ++d < m; )
            y[d] = u[i + d];
          d = -1;
          for (var b = x(i + 1); ++d < i; )
            b[d] = u[d];
          return b[i] = s(y), zt(t, this, b);
        };
      }
      function Bc(t, i) {
        return i.length < 2 ? t : Er(t, on(i, 0, -1));
      }
      function Vg(t, i) {
        for (var s = t.length, u = wt(i.length, s), d = Lt(t); u--; ) {
          var m = i[u];
          t[u] = Kn(m, s) ? d[m] : r;
        }
        return t;
      }
      function Eo(t, i) {
        if (!(i === "constructor" && typeof t[i] == "function") && i != "__proto__")
          return t[i];
      }
      var Uc = zc(fc), qi = lm || function(t, i) {
        return pt.setTimeout(t, i);
      }, Lo = zc(mg);
      function Hc(t, i, s) {
        var u = i + "";
        return Lo(t, Fg(u, Gg(Lg(u), s)));
      }
      function zc(t) {
        var i = 0, s = 0;
        return function() {
          var u = dm(), d = fe - (u - s);
          if (s = u, d > 0) {
            if (++i >= Z)
              return arguments[0];
          } else
            i = 0;
          return t.apply(r, arguments);
        };
      }
      function Qs(t, i) {
        var s = -1, u = t.length, d = u - 1;
        for (i = i === r ? u : i; ++s < i; ) {
          var m = go(s, d), y = t[m];
          t[m] = t[s], t[s] = y;
        }
        return t.length = i, t;
      }
      var qc = Hg(function(t) {
        var i = [];
        return t.charCodeAt(0) === 46 && i.push(""), t.replace(Vr, function(s, u, d, m) {
          i.push(d ? m.replace(qv, "$1") : u || s);
        }), i;
      });
      function Tn(t) {
        if (typeof t == "string" || Vt(t))
          return t;
        var i = t + "";
        return i == "0" && 1 / t == -Me ? "-0" : i;
      }
      function Yr(t) {
        if (t != null) {
          try {
            return xs.call(t);
          } catch {
          }
          try {
            return t + "";
          } catch {
          }
        }
        return "";
      }
      function Gg(t, i) {
        return nn(Pe, function(s) {
          var u = "_." + s[0];
          i & s[1] && !$s(t, u) && t.push(u);
        }), t.sort();
      }
      function Kc(t) {
        if (t instanceof Se)
          return t.clone();
        var i = new sn(t.__wrapped__, t.__chain__);
        return i.__actions__ = Lt(t.__actions__), i.__index__ = t.__index__, i.__values__ = t.__values__, i;
      }
      function jg(t, i, s) {
        (s ? xt(t, i, s) : i === r) ? i = 1 : i = ut(ye(i), 0);
        var u = t == null ? 0 : t.length;
        if (!u || i < 1)
          return [];
        for (var d = 0, m = 0, y = x(Ls(u / i)); d < u; )
          y[m++] = on(t, d, d += i);
        return y;
      }
      function Zg(t) {
        for (var i = -1, s = t == null ? 0 : t.length, u = 0, d = []; ++i < s; ) {
          var m = t[i];
          m && (d[u++] = m);
        }
        return d;
      }
      function Xg() {
        var t = arguments.length;
        if (!t)
          return [];
        for (var i = x(t - 1), s = arguments[0], u = t; u--; )
          i[u - 1] = arguments[u];
        return cr(ge(s) ? Lt(s) : [s], mt(i, 1));
      }
      var Jg = De(function(t, i) {
        return rt(t) ? Ni(t, mt(i, 1, rt, !0)) : [];
      }), Qg = De(function(t, i) {
        var s = ln(i);
        return rt(s) && (s = r), rt(t) ? Ni(t, mt(i, 1, rt, !0), oe(s, 2)) : [];
      }), ey = De(function(t, i) {
        var s = ln(i);
        return rt(s) && (s = r), rt(t) ? Ni(t, mt(i, 1, rt, !0), r, s) : [];
      });
      function ty(t, i, s) {
        var u = t == null ? 0 : t.length;
        return u ? (i = s || i === r ? 1 : ye(i), on(t, i < 0 ? 0 : i, u)) : [];
      }
      function ny(t, i, s) {
        var u = t == null ? 0 : t.length;
        return u ? (i = s || i === r ? 1 : ye(i), i = u - i, on(t, 0, i < 0 ? 0 : i)) : [];
      }
      function ry(t, i) {
        return t && t.length ? qs(t, oe(i, 3), !0, !0) : [];
      }
      function iy(t, i) {
        return t && t.length ? qs(t, oe(i, 3), !0) : [];
      }
      function sy(t, i, s, u) {
        var d = t == null ? 0 : t.length;
        return d ? (s && typeof s != "number" && xt(t, i, s) && (s = 0, u = d), Xm(t, i, s, u)) : [];
      }
      function Vc(t, i, s) {
        var u = t == null ? 0 : t.length;
        if (!u)
          return -1;
        var d = s == null ? 0 : ye(s);
        return d < 0 && (d = ut(u + d, 0)), Cs(t, oe(i, 3), d);
      }
      function Gc(t, i, s) {
        var u = t == null ? 0 : t.length;
        if (!u)
          return -1;
        var d = u - 1;
        return s !== r && (d = ye(s), d = s < 0 ? ut(u + d, 0) : wt(d, u - 1)), Cs(t, oe(i, 3), d, !0);
      }
      function jc(t) {
        var i = t == null ? 0 : t.length;
        return i ? mt(t, 1) : [];
      }
      function ay(t) {
        var i = t == null ? 0 : t.length;
        return i ? mt(t, Me) : [];
      }
      function oy(t, i) {
        var s = t == null ? 0 : t.length;
        return s ? (i = i === r ? 1 : ye(i), mt(t, i)) : [];
      }
      function ly(t) {
        for (var i = -1, s = t == null ? 0 : t.length, u = {}; ++i < s; ) {
          var d = t[i];
          u[d[0]] = d[1];
        }
        return u;
      }
      function Zc(t) {
        return t && t.length ? t[0] : r;
      }
      function uy(t, i, s) {
        var u = t == null ? 0 : t.length;
        if (!u)
          return -1;
        var d = s == null ? 0 : ye(s);
        return d < 0 && (d = ut(u + d, 0)), jr(t, i, d);
      }
      function cy(t) {
        var i = t == null ? 0 : t.length;
        return i ? on(t, 0, -1) : [];
      }
      var fy = De(function(t) {
        var i = Ve(t, Do);
        return i.length && i[0] === t[0] ? fo(i) : [];
      }), dy = De(function(t) {
        var i = ln(t), s = Ve(t, Do);
        return i === ln(s) ? i = r : s.pop(), s.length && s[0] === t[0] ? fo(s, oe(i, 2)) : [];
      }), hy = De(function(t) {
        var i = ln(t), s = Ve(t, Do);
        return i = typeof i == "function" ? i : r, i && s.pop(), s.length && s[0] === t[0] ? fo(s, r, i) : [];
      });
      function vy(t, i) {
        return t == null ? "" : cm.call(t, i);
      }
      function ln(t) {
        var i = t == null ? 0 : t.length;
        return i ? t[i - 1] : r;
      }
      function py(t, i, s) {
        var u = t == null ? 0 : t.length;
        if (!u)
          return -1;
        var d = u;
        return s !== r && (d = ye(s), d = d < 0 ? ut(u + d, 0) : wt(d, u - 1)), i === i ? Gp(t, i, d) : Cs(t, Tu, d, !0);
      }
      function my(t, i) {
        return t && t.length ? oc(t, ye(i)) : r;
      }
      var gy = De(Xc);
      function Xc(t, i) {
        return t && t.length && i && i.length ? mo(t, i) : t;
      }
      function yy(t, i, s) {
        return t && t.length && i && i.length ? mo(t, i, oe(s, 2)) : t;
      }
      function _y(t, i, s) {
        return t && t.length && i && i.length ? mo(t, i, r, s) : t;
      }
      var by = qn(function(t, i) {
        var s = t == null ? 0 : t.length, u = oo(t, i);
        return cc(t, Ve(i, function(d) {
          return Kn(d, s) ? +d : d;
        }).sort(bc)), u;
      });
      function wy(t, i) {
        var s = [];
        if (!(t && t.length))
          return s;
        var u = -1, d = [], m = t.length;
        for (i = oe(i, 3); ++u < m; ) {
          var y = t[u];
          i(y, u, t) && (s.push(y), d.push(u));
        }
        return cc(t, d), s;
      }
      function Yo(t) {
        return t == null ? t : vm.call(t);
      }
      function Dy(t, i, s) {
        var u = t == null ? 0 : t.length;
        return u ? (s && typeof s != "number" && xt(t, i, s) ? (i = 0, s = u) : (i = i == null ? 0 : ye(i), s = s === r ? u : ye(s)), on(t, i, s)) : [];
      }
      function $y(t, i) {
        return zs(t, i);
      }
      function Cy(t, i, s) {
        return _o(t, i, oe(s, 2));
      }
      function Sy(t, i) {
        var s = t == null ? 0 : t.length;
        if (s) {
          var u = zs(t, i);
          if (u < s && _n(t[u], i))
            return u;
        }
        return -1;
      }
      function My(t, i) {
        return zs(t, i, !0);
      }
      function Oy(t, i, s) {
        return _o(t, i, oe(s, 2), !0);
      }
      function xy(t, i) {
        var s = t == null ? 0 : t.length;
        if (s) {
          var u = zs(t, i, !0) - 1;
          if (_n(t[u], i))
            return u;
        }
        return -1;
      }
      function Ay(t) {
        return t && t.length ? dc(t) : [];
      }
      function Ty(t, i) {
        return t && t.length ? dc(t, oe(i, 2)) : [];
      }
      function Py(t) {
        var i = t == null ? 0 : t.length;
        return i ? on(t, 1, i) : [];
      }
      function ky(t, i, s) {
        return t && t.length ? (i = s || i === r ? 1 : ye(i), on(t, 0, i < 0 ? 0 : i)) : [];
      }
      function Iy(t, i, s) {
        var u = t == null ? 0 : t.length;
        return u ? (i = s || i === r ? 1 : ye(i), i = u - i, on(t, i < 0 ? 0 : i, u)) : [];
      }
      function Ey(t, i) {
        return t && t.length ? qs(t, oe(i, 3), !1, !0) : [];
      }
      function Ly(t, i) {
        return t && t.length ? qs(t, oe(i, 3)) : [];
      }
      var Yy = De(function(t) {
        return vr(mt(t, 1, rt, !0));
      }), Ry = De(function(t) {
        var i = ln(t);
        return rt(i) && (i = r), vr(mt(t, 1, rt, !0), oe(i, 2));
      }), Fy = De(function(t) {
        var i = ln(t);
        return i = typeof i == "function" ? i : r, vr(mt(t, 1, rt, !0), r, i);
      });
      function Ny(t) {
        return t && t.length ? vr(t) : [];
      }
      function Wy(t, i) {
        return t && t.length ? vr(t, oe(i, 2)) : [];
      }
      function By(t, i) {
        return i = typeof i == "function" ? i : r, t && t.length ? vr(t, r, i) : [];
      }
      function Ro(t) {
        if (!(t && t.length))
          return [];
        var i = 0;
        return t = ur(t, function(s) {
          if (rt(s))
            return i = ut(s.length, i), !0;
        }), Qa(i, function(s) {
          return Ve(t, Za(s));
        });
      }
      function Jc(t, i) {
        if (!(t && t.length))
          return [];
        var s = Ro(t);
        return i == null ? s : Ve(s, function(u) {
          return zt(i, r, u);
        });
      }
      var Uy = De(function(t, i) {
        return rt(t) ? Ni(t, i) : [];
      }), Hy = De(function(t) {
        return wo(ur(t, rt));
      }), zy = De(function(t) {
        var i = ln(t);
        return rt(i) && (i = r), wo(ur(t, rt), oe(i, 2));
      }), qy = De(function(t) {
        var i = ln(t);
        return i = typeof i == "function" ? i : r, wo(ur(t, rt), r, i);
      }), Ky = De(Ro);
      function Vy(t, i) {
        return mc(t || [], i || [], Fi);
      }
      function Gy(t, i) {
        return mc(t || [], i || [], Ui);
      }
      var jy = De(function(t) {
        var i = t.length, s = i > 1 ? t[i - 1] : r;
        return s = typeof s == "function" ? (t.pop(), s) : r, Jc(t, s);
      });
      function Qc(t) {
        var i = v(t);
        return i.__chain__ = !0, i;
      }
      function Zy(t, i) {
        return i(t), t;
      }
      function ea(t, i) {
        return i(t);
      }
      var Xy = qn(function(t) {
        var i = t.length, s = i ? t[0] : 0, u = this.__wrapped__, d = function(m) {
          return oo(m, t);
        };
        return i > 1 || this.__actions__.length || !(u instanceof Se) || !Kn(s) ? this.thru(d) : (u = u.slice(s, +s + (i ? 1 : 0)), u.__actions__.push({
          func: ea,
          args: [d],
          thisArg: r
        }), new sn(u, this.__chain__).thru(function(m) {
          return i && !m.length && m.push(r), m;
        }));
      });
      function Jy() {
        return Qc(this);
      }
      function Qy() {
        return new sn(this.value(), this.__chain__);
      }
      function e1() {
        this.__values__ === r && (this.__values__ = vf(this.value()));
        var t = this.__index__ >= this.__values__.length, i = t ? r : this.__values__[this.__index__++];
        return { done: t, value: i };
      }
      function t1() {
        return this;
      }
      function n1(t) {
        for (var i, s = this; s instanceof Ns; ) {
          var u = Kc(s);
          u.__index__ = 0, u.__values__ = r, i ? d.__wrapped__ = u : i = u;
          var d = u;
          s = s.__wrapped__;
        }
        return d.__wrapped__ = t, i;
      }
      function r1() {
        var t = this.__wrapped__;
        if (t instanceof Se) {
          var i = t;
          return this.__actions__.length && (i = new Se(this)), i = i.reverse(), i.__actions__.push({
            func: ea,
            args: [Yo],
            thisArg: r
          }), new sn(i, this.__chain__);
        }
        return this.thru(Yo);
      }
      function i1() {
        return pc(this.__wrapped__, this.__actions__);
      }
      var s1 = Ks(function(t, i, s) {
        Ee.call(t, s) ? ++t[s] : Hn(t, s, 1);
      });
      function a1(t, i, s) {
        var u = ge(t) ? xu : Zm;
        return s && xt(t, i, s) && (i = r), u(t, oe(i, 3));
      }
      function o1(t, i) {
        var s = ge(t) ? ur : Ju;
        return s(t, oe(i, 3));
      }
      var l1 = Mc(Vc), u1 = Mc(Gc);
      function c1(t, i) {
        return mt(ta(t, i), 1);
      }
      function f1(t, i) {
        return mt(ta(t, i), Me);
      }
      function d1(t, i, s) {
        return s = s === r ? 1 : ye(s), mt(ta(t, i), s);
      }
      function ef(t, i) {
        var s = ge(t) ? nn : hr;
        return s(t, oe(i, 3));
      }
      function tf(t, i) {
        var s = ge(t) ? Pp : Xu;
        return s(t, oe(i, 3));
      }
      var h1 = Ks(function(t, i, s) {
        Ee.call(t, s) ? t[s].push(i) : Hn(t, s, [i]);
      });
      function v1(t, i, s, u) {
        t = Yt(t) ? t : oi(t), s = s && !u ? ye(s) : 0;
        var d = t.length;
        return s < 0 && (s = ut(d + s, 0)), aa(t) ? s <= d && t.indexOf(i, s) > -1 : !!d && jr(t, i, s) > -1;
      }
      var p1 = De(function(t, i, s) {
        var u = -1, d = typeof i == "function", m = Yt(t) ? x(t.length) : [];
        return hr(t, function(y) {
          m[++u] = d ? zt(i, y, s) : Wi(y, i, s);
        }), m;
      }), m1 = Ks(function(t, i, s) {
        Hn(t, s, i);
      });
      function ta(t, i) {
        var s = ge(t) ? Ve : ic;
        return s(t, oe(i, 3));
      }
      function g1(t, i, s, u) {
        return t == null ? [] : (ge(i) || (i = i == null ? [] : [i]), s = u ? r : s, ge(s) || (s = s == null ? [] : [s]), lc(t, i, s));
      }
      var y1 = Ks(function(t, i, s) {
        t[s ? 0 : 1].push(i);
      }, function() {
        return [[], []];
      });
      function _1(t, i, s) {
        var u = ge(t) ? Ga : ku, d = arguments.length < 3;
        return u(t, oe(i, 4), s, d, hr);
      }
      function b1(t, i, s) {
        var u = ge(t) ? kp : ku, d = arguments.length < 3;
        return u(t, oe(i, 4), s, d, Xu);
      }
      function w1(t, i) {
        var s = ge(t) ? ur : Ju;
        return s(t, ia(oe(i, 3)));
      }
      function D1(t) {
        var i = ge(t) ? Vu : vg;
        return i(t);
      }
      function $1(t, i, s) {
        (s ? xt(t, i, s) : i === r) ? i = 1 : i = ye(i);
        var u = ge(t) ? qm : pg;
        return u(t, i);
      }
      function C1(t) {
        var i = ge(t) ? Km : gg;
        return i(t);
      }
      function S1(t) {
        if (t == null)
          return 0;
        if (Yt(t))
          return aa(t) ? Xr(t) : t.length;
        var i = Dt(t);
        return i == st || i == at ? t.size : vo(t).length;
      }
      function M1(t, i, s) {
        var u = ge(t) ? ja : yg;
        return s && xt(t, i, s) && (i = r), u(t, oe(i, 3));
      }
      var O1 = De(function(t, i) {
        if (t == null)
          return [];
        var s = i.length;
        return s > 1 && xt(t, i[0], i[1]) ? i = [] : s > 2 && xt(i[0], i[1], i[2]) && (i = [i[0]]), lc(t, mt(i, 1), []);
      }), na = om || function() {
        return pt.Date.now();
      };
      function x1(t, i) {
        if (typeof i != "function")
          throw new rn(c);
        return t = ye(t), function() {
          if (--t < 1)
            return i.apply(this, arguments);
        };
      }
      function nf(t, i, s) {
        return i = s ? r : i, i = t && i == null ? t.length : i, zn(t, V, r, r, r, r, i);
      }
      function rf(t, i) {
        var s;
        if (typeof i != "function")
          throw new rn(c);
        return t = ye(t), function() {
          return --t > 0 && (s = i.apply(this, arguments)), t <= 1 && (i = r), s;
        };
      }
      var Fo = De(function(t, i, s) {
        var u = R;
        if (s.length) {
          var d = fr(s, si(Fo));
          u |= z;
        }
        return zn(t, u, i, s, d);
      }), sf = De(function(t, i, s) {
        var u = R | P;
        if (s.length) {
          var d = fr(s, si(sf));
          u |= z;
        }
        return zn(i, u, t, s, d);
      });
      function af(t, i, s) {
        i = s ? r : i;
        var u = zn(t, Q, r, r, r, r, r, i);
        return u.placeholder = af.placeholder, u;
      }
      function of(t, i, s) {
        i = s ? r : i;
        var u = zn(t, H, r, r, r, r, r, i);
        return u.placeholder = of.placeholder, u;
      }
      function lf(t, i, s) {
        var u, d, m, y, b, $, I = 0, L = !1, F = !1, K = !0;
        if (typeof t != "function")
          throw new rn(c);
        i = un(i) || 0, Ze(s) && (L = !!s.leading, F = "maxWait" in s, m = F ? ut(un(s.maxWait) || 0, i) : m, K = "trailing" in s ? !!s.trailing : K);
        function X(it) {
          var bn = u, jn = d;
          return u = d = r, I = it, y = t.apply(jn, bn), y;
        }
        function ue(it) {
          return I = it, b = qi(Ce, i), L ? X(it) : y;
        }
        function _e(it) {
          var bn = it - $, jn = it - I, Of = i - bn;
          return F ? wt(Of, m - jn) : Of;
        }
        function ce(it) {
          var bn = it - $, jn = it - I;
          return $ === r || bn >= i || bn < 0 || F && jn >= m;
        }
        function Ce() {
          var it = na();
          if (ce(it))
            return Oe(it);
          b = qi(Ce, _e(it));
        }
        function Oe(it) {
          return b = r, K && u ? X(it) : (u = d = r, y);
        }
        function Gt() {
          b !== r && gc(b), I = 0, u = $ = d = b = r;
        }
        function At() {
          return b === r ? y : Oe(na());
        }
        function jt() {
          var it = na(), bn = ce(it);
          if (u = arguments, d = this, $ = it, bn) {
            if (b === r)
              return ue($);
            if (F)
              return gc(b), b = qi(Ce, i), X($);
          }
          return b === r && (b = qi(Ce, i)), y;
        }
        return jt.cancel = Gt, jt.flush = At, jt;
      }
      var A1 = De(function(t, i) {
        return Zu(t, 1, i);
      }), T1 = De(function(t, i, s) {
        return Zu(t, un(i) || 0, s);
      });
      function P1(t) {
        return zn(t, me);
      }
      function ra(t, i) {
        if (typeof t != "function" || i != null && typeof i != "function")
          throw new rn(c);
        var s = function() {
          var u = arguments, d = i ? i.apply(this, u) : u[0], m = s.cache;
          if (m.has(d))
            return m.get(d);
          var y = t.apply(this, u);
          return s.cache = m.set(d, y) || m, y;
        };
        return s.cache = new (ra.Cache || Un)(), s;
      }
      ra.Cache = Un;
      function ia(t) {
        if (typeof t != "function")
          throw new rn(c);
        return function() {
          var i = arguments;
          switch (i.length) {
            case 0:
              return !t.call(this);
            case 1:
              return !t.call(this, i[0]);
            case 2:
              return !t.call(this, i[0], i[1]);
            case 3:
              return !t.call(this, i[0], i[1], i[2]);
          }
          return !t.apply(this, i);
        };
      }
      function k1(t) {
        return rf(2, t);
      }
      var I1 = _g(function(t, i) {
        i = i.length == 1 && ge(i[0]) ? Ve(i[0], qt(oe())) : Ve(mt(i, 1), qt(oe()));
        var s = i.length;
        return De(function(u) {
          for (var d = -1, m = wt(u.length, s); ++d < m; )
            u[d] = i[d].call(this, u[d]);
          return zt(t, this, u);
        });
      }), No = De(function(t, i) {
        var s = fr(i, si(No));
        return zn(t, z, r, i, s);
      }), uf = De(function(t, i) {
        var s = fr(i, si(uf));
        return zn(t, te, r, i, s);
      }), E1 = qn(function(t, i) {
        return zn(t, ne, r, r, r, i);
      });
      function L1(t, i) {
        if (typeof t != "function")
          throw new rn(c);
        return i = i === r ? i : ye(i), De(t, i);
      }
      function Y1(t, i) {
        if (typeof t != "function")
          throw new rn(c);
        return i = i == null ? 0 : ut(ye(i), 0), De(function(s) {
          var u = s[i], d = mr(s, 0, i);
          return u && cr(d, u), zt(t, this, d);
        });
      }
      function R1(t, i, s) {
        var u = !0, d = !0;
        if (typeof t != "function")
          throw new rn(c);
        return Ze(s) && (u = "leading" in s ? !!s.leading : u, d = "trailing" in s ? !!s.trailing : d), lf(t, i, {
          leading: u,
          maxWait: i,
          trailing: d
        });
      }
      function F1(t) {
        return nf(t, 1);
      }
      function N1(t, i) {
        return No($o(i), t);
      }
      function W1() {
        if (!arguments.length)
          return [];
        var t = arguments[0];
        return ge(t) ? t : [t];
      }
      function B1(t) {
        return an(t, S);
      }
      function U1(t, i) {
        return i = typeof i == "function" ? i : r, an(t, S, i);
      }
      function H1(t) {
        return an(t, w | S);
      }
      function z1(t, i) {
        return i = typeof i == "function" ? i : r, an(t, w | S, i);
      }
      function q1(t, i) {
        return i == null || ju(t, i, ct(i));
      }
      function _n(t, i) {
        return t === i || t !== t && i !== i;
      }
      var K1 = Zs(co), V1 = Zs(function(t, i) {
        return t >= i;
      }), Rr = tc(/* @__PURE__ */ function() {
        return arguments;
      }()) ? tc : function(t) {
        return tt(t) && Ee.call(t, "callee") && !Bu.call(t, "callee");
      }, ge = x.isArray, G1 = Du ? qt(Du) : ng;
      function Yt(t) {
        return t != null && sa(t.length) && !Vn(t);
      }
      function rt(t) {
        return tt(t) && Yt(t);
      }
      function j1(t) {
        return t === !0 || t === !1 || tt(t) && Ot(t) == je;
      }
      var gr = um || Zo, Z1 = $u ? qt($u) : rg;
      function X1(t) {
        return tt(t) && t.nodeType === 1 && !Ki(t);
      }
      function J1(t) {
        if (t == null)
          return !0;
        if (Yt(t) && (ge(t) || typeof t == "string" || typeof t.splice == "function" || gr(t) || ai(t) || Rr(t)))
          return !t.length;
        var i = Dt(t);
        if (i == st || i == at)
          return !t.size;
        if (zi(t))
          return !vo(t).length;
        for (var s in t)
          if (Ee.call(t, s))
            return !1;
        return !0;
      }
      function Q1(t, i) {
        return Bi(t, i);
      }
      function e_(t, i, s) {
        s = typeof s == "function" ? s : r;
        var u = s ? s(t, i) : r;
        return u === r ? Bi(t, i, r, s) : !!u;
      }
      function Wo(t) {
        if (!tt(t))
          return !1;
        var i = Ot(t);
        return i == _t || i == mn || typeof t.message == "string" && typeof t.name == "string" && !Ki(t);
      }
      function t_(t) {
        return typeof t == "number" && Hu(t);
      }
      function Vn(t) {
        if (!Ze(t))
          return !1;
        var i = Ot(t);
        return i == ft || i == St || i == et || i == Fn;
      }
      function cf(t) {
        return typeof t == "number" && t == ye(t);
      }
      function sa(t) {
        return typeof t == "number" && t > -1 && t % 1 == 0 && t <= Ye;
      }
      function Ze(t) {
        var i = typeof t;
        return t != null && (i == "object" || i == "function");
      }
      function tt(t) {
        return t != null && typeof t == "object";
      }
      var ff = Cu ? qt(Cu) : sg;
      function n_(t, i) {
        return t === i || ho(t, i, To(i));
      }
      function r_(t, i, s) {
        return s = typeof s == "function" ? s : r, ho(t, i, To(i), s);
      }
      function i_(t) {
        return df(t) && t != +t;
      }
      function s_(t) {
        if (Ug(t))
          throw new ve(o);
        return nc(t);
      }
      function a_(t) {
        return t === null;
      }
      function o_(t) {
        return t == null;
      }
      function df(t) {
        return typeof t == "number" || tt(t) && Ot(t) == Qt;
      }
      function Ki(t) {
        if (!tt(t) || Ot(t) != dt)
          return !1;
        var i = ks(t);
        if (i === null)
          return !0;
        var s = Ee.call(i, "constructor") && i.constructor;
        return typeof s == "function" && s instanceof s && xs.call(s) == rm;
      }
      var Bo = Su ? qt(Su) : ag;
      function l_(t) {
        return cf(t) && t >= -Ye && t <= Ye;
      }
      var hf = Mu ? qt(Mu) : og;
      function aa(t) {
        return typeof t == "string" || !ge(t) && tt(t) && Ot(t) == It;
      }
      function Vt(t) {
        return typeof t == "symbol" || tt(t) && Ot(t) == Bt;
      }
      var ai = Ou ? qt(Ou) : lg;
      function u_(t) {
        return t === r;
      }
      function c_(t) {
        return tt(t) && Dt(t) == Et;
      }
      function f_(t) {
        return tt(t) && Ot(t) == On;
      }
      var d_ = Zs(po), h_ = Zs(function(t, i) {
        return t <= i;
      });
      function vf(t) {
        if (!t)
          return [];
        if (Yt(t))
          return aa(t) ? gn(t) : Lt(t);
        if (Ii && t[Ii])
          return qp(t[Ii]());
        var i = Dt(t), s = i == st ? to : i == at ? Ss : oi;
        return s(t);
      }
      function Gn(t) {
        if (!t)
          return t === 0 ? t : 0;
        if (t = un(t), t === Me || t === -Me) {
          var i = t < 0 ? -1 : 1;
          return i * Ue;
        }
        return t === t ? t : 0;
      }
      function ye(t) {
        var i = Gn(t), s = i % 1;
        return i === i ? s ? i - s : i : 0;
      }
      function pf(t) {
        return t ? Ir(ye(t), 0, he) : 0;
      }
      function un(t) {
        if (typeof t == "number")
          return t;
        if (Vt(t))
          return B;
        if (Ze(t)) {
          var i = typeof t.valueOf == "function" ? t.valueOf() : t;
          t = Ze(i) ? i + "" : i;
        }
        if (typeof t != "string")
          return t === 0 ? t : +t;
        t = Iu(t);
        var s = Gv.test(t);
        return s || Zv.test(t) ? xp(t.slice(2), s ? 2 : 8) : Vv.test(t) ? B : +t;
      }
      function mf(t) {
        return An(t, Rt(t));
      }
      function v_(t) {
        return t ? Ir(ye(t), -Ye, Ye) : t === 0 ? t : 0;
      }
      function Ie(t) {
        return t == null ? "" : Kt(t);
      }
      var p_ = ri(function(t, i) {
        if (zi(i) || Yt(i)) {
          An(i, ct(i), t);
          return;
        }
        for (var s in i)
          Ee.call(i, s) && Fi(t, s, i[s]);
      }), gf = ri(function(t, i) {
        An(i, Rt(i), t);
      }), oa = ri(function(t, i, s, u) {
        An(i, Rt(i), t, u);
      }), m_ = ri(function(t, i, s, u) {
        An(i, ct(i), t, u);
      }), g_ = qn(oo);
      function y_(t, i) {
        var s = ni(t);
        return i == null ? s : Gu(s, i);
      }
      var __ = De(function(t, i) {
        t = We(t);
        var s = -1, u = i.length, d = u > 2 ? i[2] : r;
        for (d && xt(i[0], i[1], d) && (u = 1); ++s < u; )
          for (var m = i[s], y = Rt(m), b = -1, $ = y.length; ++b < $; ) {
            var I = y[b], L = t[I];
            (L === r || _n(L, Qr[I]) && !Ee.call(t, I)) && (t[I] = m[I]);
          }
        return t;
      }), b_ = De(function(t) {
        return t.push(r, Ic), zt(yf, r, t);
      });
      function w_(t, i) {
        return Au(t, oe(i, 3), xn);
      }
      function D_(t, i) {
        return Au(t, oe(i, 3), uo);
      }
      function $_(t, i) {
        return t == null ? t : lo(t, oe(i, 3), Rt);
      }
      function C_(t, i) {
        return t == null ? t : Qu(t, oe(i, 3), Rt);
      }
      function S_(t, i) {
        return t && xn(t, oe(i, 3));
      }
      function M_(t, i) {
        return t && uo(t, oe(i, 3));
      }
      function O_(t) {
        return t == null ? [] : Us(t, ct(t));
      }
      function x_(t) {
        return t == null ? [] : Us(t, Rt(t));
      }
      function Uo(t, i, s) {
        var u = t == null ? r : Er(t, i);
        return u === r ? s : u;
      }
      function A_(t, i) {
        return t != null && Yc(t, i, Jm);
      }
      function Ho(t, i) {
        return t != null && Yc(t, i, Qm);
      }
      var T_ = xc(function(t, i, s) {
        i != null && typeof i.toString != "function" && (i = As.call(i)), t[i] = s;
      }, qo(Ft)), P_ = xc(function(t, i, s) {
        i != null && typeof i.toString != "function" && (i = As.call(i)), Ee.call(t, i) ? t[i].push(s) : t[i] = [s];
      }, oe), k_ = De(Wi);
      function ct(t) {
        return Yt(t) ? Ku(t) : vo(t);
      }
      function Rt(t) {
        return Yt(t) ? Ku(t, !0) : ug(t);
      }
      function I_(t, i) {
        var s = {};
        return i = oe(i, 3), xn(t, function(u, d, m) {
          Hn(s, i(u, d, m), u);
        }), s;
      }
      function E_(t, i) {
        var s = {};
        return i = oe(i, 3), xn(t, function(u, d, m) {
          Hn(s, d, i(u, d, m));
        }), s;
      }
      var L_ = ri(function(t, i, s) {
        Hs(t, i, s);
      }), yf = ri(function(t, i, s, u) {
        Hs(t, i, s, u);
      }), Y_ = qn(function(t, i) {
        var s = {};
        if (t == null)
          return s;
        var u = !1;
        i = Ve(i, function(m) {
          return m = pr(m, t), u || (u = m.length > 1), m;
        }), An(t, xo(t), s), u && (s = an(s, w | M | S, Tg));
        for (var d = i.length; d--; )
          bo(s, i[d]);
        return s;
      });
      function R_(t, i) {
        return _f(t, ia(oe(i)));
      }
      var F_ = qn(function(t, i) {
        return t == null ? {} : fg(t, i);
      });
      function _f(t, i) {
        if (t == null)
          return {};
        var s = Ve(xo(t), function(u) {
          return [u];
        });
        return i = oe(i), uc(t, s, function(u, d) {
          return i(u, d[0]);
        });
      }
      function N_(t, i, s) {
        i = pr(i, t);
        var u = -1, d = i.length;
        for (d || (d = 1, t = r); ++u < d; ) {
          var m = t == null ? r : t[Tn(i[u])];
          m === r && (u = d, m = s), t = Vn(m) ? m.call(t) : m;
        }
        return t;
      }
      function W_(t, i, s) {
        return t == null ? t : Ui(t, i, s);
      }
      function B_(t, i, s, u) {
        return u = typeof u == "function" ? u : r, t == null ? t : Ui(t, i, s, u);
      }
      var bf = Pc(ct), wf = Pc(Rt);
      function U_(t, i, s) {
        var u = ge(t), d = u || gr(t) || ai(t);
        if (i = oe(i, 4), s == null) {
          var m = t && t.constructor;
          d ? s = u ? new m() : [] : Ze(t) ? s = Vn(m) ? ni(ks(t)) : {} : s = {};
        }
        return (d ? nn : xn)(t, function(y, b, $) {
          return i(s, y, b, $);
        }), s;
      }
      function H_(t, i) {
        return t == null ? !0 : bo(t, i);
      }
      function z_(t, i, s) {
        return t == null ? t : vc(t, i, $o(s));
      }
      function q_(t, i, s, u) {
        return u = typeof u == "function" ? u : r, t == null ? t : vc(t, i, $o(s), u);
      }
      function oi(t) {
        return t == null ? [] : eo(t, ct(t));
      }
      function K_(t) {
        return t == null ? [] : eo(t, Rt(t));
      }
      function V_(t, i, s) {
        return s === r && (s = i, i = r), s !== r && (s = un(s), s = s === s ? s : 0), i !== r && (i = un(i), i = i === i ? i : 0), Ir(un(t), i, s);
      }
      function G_(t, i, s) {
        return i = Gn(i), s === r ? (s = i, i = 0) : s = Gn(s), t = un(t), eg(t, i, s);
      }
      function j_(t, i, s) {
        if (s && typeof s != "boolean" && xt(t, i, s) && (i = s = r), s === r && (typeof i == "boolean" ? (s = i, i = r) : typeof t == "boolean" && (s = t, t = r)), t === r && i === r ? (t = 0, i = 1) : (t = Gn(t), i === r ? (i = t, t = 0) : i = Gn(i)), t > i) {
          var u = t;
          t = i, i = u;
        }
        if (s || t % 1 || i % 1) {
          var d = zu();
          return wt(t + d * (i - t + Op("1e-" + ((d + "").length - 1))), i);
        }
        return go(t, i);
      }
      var Z_ = ii(function(t, i, s) {
        return i = i.toLowerCase(), t + (s ? Df(i) : i);
      });
      function Df(t) {
        return zo(Ie(t).toLowerCase());
      }
      function $f(t) {
        return t = Ie(t), t && t.replace(Jv, Wp).replace(gp, "");
      }
      function X_(t, i, s) {
        t = Ie(t), i = Kt(i);
        var u = t.length;
        s = s === r ? u : Ir(ye(s), 0, u);
        var d = s;
        return s -= i.length, s >= 0 && t.slice(s, d) == i;
      }
      function J_(t) {
        return t = Ie(t), t && Mt.test(t) ? t.replace(He, Bp) : t;
      }
      function Q_(t) {
        return t = Ie(t), t && xr.test(t) ? t.replace(Wn, "\\$&") : t;
      }
      var e0 = ii(function(t, i, s) {
        return t + (s ? "-" : "") + i.toLowerCase();
      }), t0 = ii(function(t, i, s) {
        return t + (s ? " " : "") + i.toLowerCase();
      }), n0 = Sc("toLowerCase");
      function r0(t, i, s) {
        t = Ie(t), i = ye(i);
        var u = i ? Xr(t) : 0;
        if (!i || u >= i)
          return t;
        var d = (i - u) / 2;
        return js(Ys(d), s) + t + js(Ls(d), s);
      }
      function i0(t, i, s) {
        t = Ie(t), i = ye(i);
        var u = i ? Xr(t) : 0;
        return i && u < i ? t + js(i - u, s) : t;
      }
      function s0(t, i, s) {
        t = Ie(t), i = ye(i);
        var u = i ? Xr(t) : 0;
        return i && u < i ? js(i - u, s) + t : t;
      }
      function a0(t, i, s) {
        return s || i == null ? i = 0 : i && (i = +i), hm(Ie(t).replace(Pi, ""), i || 0);
      }
      function o0(t, i, s) {
        return (s ? xt(t, i, s) : i === r) ? i = 1 : i = ye(i), yo(Ie(t), i);
      }
      function l0() {
        var t = arguments, i = Ie(t[0]);
        return t.length < 3 ? i : i.replace(t[1], t[2]);
      }
      var u0 = ii(function(t, i, s) {
        return t + (s ? "_" : "") + i.toLowerCase();
      });
      function c0(t, i, s) {
        return s && typeof s != "number" && xt(t, i, s) && (i = s = r), s = s === r ? he : s >>> 0, s ? (t = Ie(t), t && (typeof i == "string" || i != null && !Bo(i)) && (i = Kt(i), !i && Zr(t)) ? mr(gn(t), 0, s) : t.split(i, s)) : [];
      }
      var f0 = ii(function(t, i, s) {
        return t + (s ? " " : "") + zo(i);
      });
      function d0(t, i, s) {
        return t = Ie(t), s = s == null ? 0 : Ir(ye(s), 0, t.length), i = Kt(i), t.slice(s, s + i.length) == i;
      }
      function h0(t, i, s) {
        var u = v.templateSettings;
        s && xt(t, i, s) && (i = r), t = Ie(t), i = oa({}, i, u, kc);
        var d = oa({}, i.imports, u.imports, kc), m = ct(d), y = eo(d, m), b, $, I = 0, L = i.interpolate || bs, F = "__p += '", K = no(
          (i.escape || bs).source + "|" + L.source + "|" + (L === Kr ? Kv : bs).source + "|" + (i.evaluate || bs).source + "|$",
          "g"
        ), X = "//# sourceURL=" + (Ee.call(i, "sourceURL") ? (i.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++Dp + "]") + `
`;
        t.replace(K, function(ce, Ce, Oe, Gt, At, jt) {
          return Oe || (Oe = Gt), F += t.slice(I, jt).replace(Qv, Up), Ce && (b = !0, F += `' +
__e(` + Ce + `) +
'`), At && ($ = !0, F += `';
` + At + `;
__p += '`), Oe && (F += `' +
((__t = (` + Oe + `)) == null ? '' : __t) +
'`), I = jt + ce.length, ce;
        }), F += `';
`;
        var ue = Ee.call(i, "variable") && i.variable;
        if (!ue)
          F = `with (obj) {
` + F + `
}
`;
        else if (zv.test(ue))
          throw new ve(f);
        F = ($ ? F.replace(_, "") : F).replace(Y, "$1").replace(q, "$1;"), F = "function(" + (ue || "obj") + `) {
` + (ue ? "" : `obj || (obj = {});
`) + "var __t, __p = ''" + (b ? ", __e = _.escape" : "") + ($ ? `, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
` : `;
`) + F + `return __p
}`;
        var _e = Sf(function() {
          return ke(m, X + "return " + F).apply(r, y);
        });
        if (_e.source = F, Wo(_e))
          throw _e;
        return _e;
      }
      function v0(t) {
        return Ie(t).toLowerCase();
      }
      function p0(t) {
        return Ie(t).toUpperCase();
      }
      function m0(t, i, s) {
        if (t = Ie(t), t && (s || i === r))
          return Iu(t);
        if (!t || !(i = Kt(i)))
          return t;
        var u = gn(t), d = gn(i), m = Eu(u, d), y = Lu(u, d) + 1;
        return mr(u, m, y).join("");
      }
      function g0(t, i, s) {
        if (t = Ie(t), t && (s || i === r))
          return t.slice(0, Ru(t) + 1);
        if (!t || !(i = Kt(i)))
          return t;
        var u = gn(t), d = Lu(u, gn(i)) + 1;
        return mr(u, 0, d).join("");
      }
      function y0(t, i, s) {
        if (t = Ie(t), t && (s || i === r))
          return t.replace(Pi, "");
        if (!t || !(i = Kt(i)))
          return t;
        var u = gn(t), d = Eu(u, gn(i));
        return mr(u, d).join("");
      }
      function _0(t, i) {
        var s = we, u = $e;
        if (Ze(i)) {
          var d = "separator" in i ? i.separator : d;
          s = "length" in i ? ye(i.length) : s, u = "omission" in i ? Kt(i.omission) : u;
        }
        t = Ie(t);
        var m = t.length;
        if (Zr(t)) {
          var y = gn(t);
          m = y.length;
        }
        if (s >= m)
          return t;
        var b = s - Xr(u);
        if (b < 1)
          return u;
        var $ = y ? mr(y, 0, b).join("") : t.slice(0, b);
        if (d === r)
          return $ + u;
        if (y && (b += $.length - b), Bo(d)) {
          if (t.slice(b).search(d)) {
            var I, L = $;
            for (d.global || (d = no(d.source, Ie(tu.exec(d)) + "g")), d.lastIndex = 0; I = d.exec(L); )
              var F = I.index;
            $ = $.slice(0, F === r ? b : F);
          }
        } else if (t.indexOf(Kt(d), b) != b) {
          var K = $.lastIndexOf(d);
          K > -1 && ($ = $.slice(0, K));
        }
        return $ + u;
      }
      function b0(t) {
        return t = Ie(t), t && vt.test(t) ? t.replace(de, jp) : t;
      }
      var w0 = ii(function(t, i, s) {
        return t + (s ? " " : "") + i.toUpperCase();
      }), zo = Sc("toUpperCase");
      function Cf(t, i, s) {
        return t = Ie(t), i = s ? r : i, i === r ? zp(t) ? Jp(t) : Lp(t) : t.match(i) || [];
      }
      var Sf = De(function(t, i) {
        try {
          return zt(t, r, i);
        } catch (s) {
          return Wo(s) ? s : new ve(s);
        }
      }), D0 = qn(function(t, i) {
        return nn(i, function(s) {
          s = Tn(s), Hn(t, s, Fo(t[s], t));
        }), t;
      });
      function $0(t) {
        var i = t == null ? 0 : t.length, s = oe();
        return t = i ? Ve(t, function(u) {
          if (typeof u[1] != "function")
            throw new rn(c);
          return [s(u[0]), u[1]];
        }) : [], De(function(u) {
          for (var d = -1; ++d < i; ) {
            var m = t[d];
            if (zt(m[0], this, u))
              return zt(m[1], this, u);
          }
        });
      }
      function C0(t) {
        return jm(an(t, w));
      }
      function qo(t) {
        return function() {
          return t;
        };
      }
      function S0(t, i) {
        return t == null || t !== t ? i : t;
      }
      var M0 = Oc(), O0 = Oc(!0);
      function Ft(t) {
        return t;
      }
      function Ko(t) {
        return rc(typeof t == "function" ? t : an(t, w));
      }
      function x0(t) {
        return sc(an(t, w));
      }
      function A0(t, i) {
        return ac(t, an(i, w));
      }
      var T0 = De(function(t, i) {
        return function(s) {
          return Wi(s, t, i);
        };
      }), P0 = De(function(t, i) {
        return function(s) {
          return Wi(t, s, i);
        };
      });
      function Vo(t, i, s) {
        var u = ct(i), d = Us(i, u);
        s == null && !(Ze(i) && (d.length || !u.length)) && (s = i, i = t, t = this, d = Us(i, ct(i)));
        var m = !(Ze(s) && "chain" in s) || !!s.chain, y = Vn(t);
        return nn(d, function(b) {
          var $ = i[b];
          t[b] = $, y && (t.prototype[b] = function() {
            var I = this.__chain__;
            if (m || I) {
              var L = t(this.__wrapped__), F = L.__actions__ = Lt(this.__actions__);
              return F.push({ func: $, args: arguments, thisArg: t }), L.__chain__ = I, L;
            }
            return $.apply(t, cr([this.value()], arguments));
          });
        }), t;
      }
      function k0() {
        return pt._ === this && (pt._ = im), this;
      }
      function Go() {
      }
      function I0(t) {
        return t = ye(t), De(function(i) {
          return oc(i, t);
        });
      }
      var E0 = So(Ve), L0 = So(xu), Y0 = So(ja);
      function Mf(t) {
        return ko(t) ? Za(Tn(t)) : dg(t);
      }
      function R0(t) {
        return function(i) {
          return t == null ? r : Er(t, i);
        };
      }
      var F0 = Ac(), N0 = Ac(!0);
      function jo() {
        return [];
      }
      function Zo() {
        return !1;
      }
      function W0() {
        return {};
      }
      function B0() {
        return "";
      }
      function U0() {
        return !0;
      }
      function H0(t, i) {
        if (t = ye(t), t < 1 || t > Ye)
          return [];
        var s = he, u = wt(t, he);
        i = oe(i), t -= he;
        for (var d = Qa(u, i); ++s < t; )
          i(s);
        return d;
      }
      function z0(t) {
        return ge(t) ? Ve(t, Tn) : Vt(t) ? [t] : Lt(qc(Ie(t)));
      }
      function q0(t) {
        var i = ++nm;
        return Ie(t) + i;
      }
      var K0 = Gs(function(t, i) {
        return t + i;
      }, 0), V0 = Mo("ceil"), G0 = Gs(function(t, i) {
        return t / i;
      }, 1), j0 = Mo("floor");
      function Z0(t) {
        return t && t.length ? Bs(t, Ft, co) : r;
      }
      function X0(t, i) {
        return t && t.length ? Bs(t, oe(i, 2), co) : r;
      }
      function J0(t) {
        return Pu(t, Ft);
      }
      function Q0(t, i) {
        return Pu(t, oe(i, 2));
      }
      function eb(t) {
        return t && t.length ? Bs(t, Ft, po) : r;
      }
      function tb(t, i) {
        return t && t.length ? Bs(t, oe(i, 2), po) : r;
      }
      var nb = Gs(function(t, i) {
        return t * i;
      }, 1), rb = Mo("round"), ib = Gs(function(t, i) {
        return t - i;
      }, 0);
      function sb(t) {
        return t && t.length ? Ja(t, Ft) : 0;
      }
      function ab(t, i) {
        return t && t.length ? Ja(t, oe(i, 2)) : 0;
      }
      return v.after = x1, v.ary = nf, v.assign = p_, v.assignIn = gf, v.assignInWith = oa, v.assignWith = m_, v.at = g_, v.before = rf, v.bind = Fo, v.bindAll = D0, v.bindKey = sf, v.castArray = W1, v.chain = Qc, v.chunk = jg, v.compact = Zg, v.concat = Xg, v.cond = $0, v.conforms = C0, v.constant = qo, v.countBy = s1, v.create = y_, v.curry = af, v.curryRight = of, v.debounce = lf, v.defaults = __, v.defaultsDeep = b_, v.defer = A1, v.delay = T1, v.difference = Jg, v.differenceBy = Qg, v.differenceWith = ey, v.drop = ty, v.dropRight = ny, v.dropRightWhile = ry, v.dropWhile = iy, v.fill = sy, v.filter = o1, v.flatMap = c1, v.flatMapDeep = f1, v.flatMapDepth = d1, v.flatten = jc, v.flattenDeep = ay, v.flattenDepth = oy, v.flip = P1, v.flow = M0, v.flowRight = O0, v.fromPairs = ly, v.functions = O_, v.functionsIn = x_, v.groupBy = h1, v.initial = cy, v.intersection = fy, v.intersectionBy = dy, v.intersectionWith = hy, v.invert = T_, v.invertBy = P_, v.invokeMap = p1, v.iteratee = Ko, v.keyBy = m1, v.keys = ct, v.keysIn = Rt, v.map = ta, v.mapKeys = I_, v.mapValues = E_, v.matches = x0, v.matchesProperty = A0, v.memoize = ra, v.merge = L_, v.mergeWith = yf, v.method = T0, v.methodOf = P0, v.mixin = Vo, v.negate = ia, v.nthArg = I0, v.omit = Y_, v.omitBy = R_, v.once = k1, v.orderBy = g1, v.over = E0, v.overArgs = I1, v.overEvery = L0, v.overSome = Y0, v.partial = No, v.partialRight = uf, v.partition = y1, v.pick = F_, v.pickBy = _f, v.property = Mf, v.propertyOf = R0, v.pull = gy, v.pullAll = Xc, v.pullAllBy = yy, v.pullAllWith = _y, v.pullAt = by, v.range = F0, v.rangeRight = N0, v.rearg = E1, v.reject = w1, v.remove = wy, v.rest = L1, v.reverse = Yo, v.sampleSize = $1, v.set = W_, v.setWith = B_, v.shuffle = C1, v.slice = Dy, v.sortBy = O1, v.sortedUniq = Ay, v.sortedUniqBy = Ty, v.split = c0, v.spread = Y1, v.tail = Py, v.take = ky, v.takeRight = Iy, v.takeRightWhile = Ey, v.takeWhile = Ly, v.tap = Zy, v.throttle = R1, v.thru = ea, v.toArray = vf, v.toPairs = bf, v.toPairsIn = wf, v.toPath = z0, v.toPlainObject = mf, v.transform = U_, v.unary = F1, v.union = Yy, v.unionBy = Ry, v.unionWith = Fy, v.uniq = Ny, v.uniqBy = Wy, v.uniqWith = By, v.unset = H_, v.unzip = Ro, v.unzipWith = Jc, v.update = z_, v.updateWith = q_, v.values = oi, v.valuesIn = K_, v.without = Uy, v.words = Cf, v.wrap = N1, v.xor = Hy, v.xorBy = zy, v.xorWith = qy, v.zip = Ky, v.zipObject = Vy, v.zipObjectDeep = Gy, v.zipWith = jy, v.entries = bf, v.entriesIn = wf, v.extend = gf, v.extendWith = oa, Vo(v, v), v.add = K0, v.attempt = Sf, v.camelCase = Z_, v.capitalize = Df, v.ceil = V0, v.clamp = V_, v.clone = B1, v.cloneDeep = H1, v.cloneDeepWith = z1, v.cloneWith = U1, v.conformsTo = q1, v.deburr = $f, v.defaultTo = S0, v.divide = G0, v.endsWith = X_, v.eq = _n, v.escape = J_, v.escapeRegExp = Q_, v.every = a1, v.find = l1, v.findIndex = Vc, v.findKey = w_, v.findLast = u1, v.findLastIndex = Gc, v.findLastKey = D_, v.floor = j0, v.forEach = ef, v.forEachRight = tf, v.forIn = $_, v.forInRight = C_, v.forOwn = S_, v.forOwnRight = M_, v.get = Uo, v.gt = K1, v.gte = V1, v.has = A_, v.hasIn = Ho, v.head = Zc, v.identity = Ft, v.includes = v1, v.indexOf = uy, v.inRange = G_, v.invoke = k_, v.isArguments = Rr, v.isArray = ge, v.isArrayBuffer = G1, v.isArrayLike = Yt, v.isArrayLikeObject = rt, v.isBoolean = j1, v.isBuffer = gr, v.isDate = Z1, v.isElement = X1, v.isEmpty = J1, v.isEqual = Q1, v.isEqualWith = e_, v.isError = Wo, v.isFinite = t_, v.isFunction = Vn, v.isInteger = cf, v.isLength = sa, v.isMap = ff, v.isMatch = n_, v.isMatchWith = r_, v.isNaN = i_, v.isNative = s_, v.isNil = o_, v.isNull = a_, v.isNumber = df, v.isObject = Ze, v.isObjectLike = tt, v.isPlainObject = Ki, v.isRegExp = Bo, v.isSafeInteger = l_, v.isSet = hf, v.isString = aa, v.isSymbol = Vt, v.isTypedArray = ai, v.isUndefined = u_, v.isWeakMap = c_, v.isWeakSet = f_, v.join = vy, v.kebabCase = e0, v.last = ln, v.lastIndexOf = py, v.lowerCase = t0, v.lowerFirst = n0, v.lt = d_, v.lte = h_, v.max = Z0, v.maxBy = X0, v.mean = J0, v.meanBy = Q0, v.min = eb, v.minBy = tb, v.stubArray = jo, v.stubFalse = Zo, v.stubObject = W0, v.stubString = B0, v.stubTrue = U0, v.multiply = nb, v.nth = my, v.noConflict = k0, v.noop = Go, v.now = na, v.pad = r0, v.padEnd = i0, v.padStart = s0, v.parseInt = a0, v.random = j_, v.reduce = _1, v.reduceRight = b1, v.repeat = o0, v.replace = l0, v.result = N_, v.round = rb, v.runInContext = D, v.sample = D1, v.size = S1, v.snakeCase = u0, v.some = M1, v.sortedIndex = $y, v.sortedIndexBy = Cy, v.sortedIndexOf = Sy, v.sortedLastIndex = My, v.sortedLastIndexBy = Oy, v.sortedLastIndexOf = xy, v.startCase = f0, v.startsWith = d0, v.subtract = ib, v.sum = sb, v.sumBy = ab, v.template = h0, v.times = H0, v.toFinite = Gn, v.toInteger = ye, v.toLength = pf, v.toLower = v0, v.toNumber = un, v.toSafeInteger = v_, v.toString = Ie, v.toUpper = p0, v.trim = m0, v.trimEnd = g0, v.trimStart = y0, v.truncate = _0, v.unescape = b0, v.uniqueId = q0, v.upperCase = w0, v.upperFirst = zo, v.each = ef, v.eachRight = tf, v.first = Zc, Vo(v, function() {
        var t = {};
        return xn(v, function(i, s) {
          Ee.call(v.prototype, s) || (t[s] = i);
        }), t;
      }(), { chain: !1 }), v.VERSION = a, nn(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(t) {
        v[t].placeholder = v;
      }), nn(["drop", "take"], function(t, i) {
        Se.prototype[t] = function(s) {
          s = s === r ? 1 : ut(ye(s), 0);
          var u = this.__filtered__ && !i ? new Se(this) : this.clone();
          return u.__filtered__ ? u.__takeCount__ = wt(s, u.__takeCount__) : u.__views__.push({
            size: wt(s, he),
            type: t + (u.__dir__ < 0 ? "Right" : "")
          }), u;
        }, Se.prototype[t + "Right"] = function(s) {
          return this.reverse()[t](s).reverse();
        };
      }), nn(["filter", "map", "takeWhile"], function(t, i) {
        var s = i + 1, u = s == Ae || s == xe;
        Se.prototype[t] = function(d) {
          var m = this.clone();
          return m.__iteratees__.push({
            iteratee: oe(d, 3),
            type: s
          }), m.__filtered__ = m.__filtered__ || u, m;
        };
      }), nn(["head", "last"], function(t, i) {
        var s = "take" + (i ? "Right" : "");
        Se.prototype[t] = function() {
          return this[s](1).value()[0];
        };
      }), nn(["initial", "tail"], function(t, i) {
        var s = "drop" + (i ? "" : "Right");
        Se.prototype[t] = function() {
          return this.__filtered__ ? new Se(this) : this[s](1);
        };
      }), Se.prototype.compact = function() {
        return this.filter(Ft);
      }, Se.prototype.find = function(t) {
        return this.filter(t).head();
      }, Se.prototype.findLast = function(t) {
        return this.reverse().find(t);
      }, Se.prototype.invokeMap = De(function(t, i) {
        return typeof t == "function" ? new Se(this) : this.map(function(s) {
          return Wi(s, t, i);
        });
      }), Se.prototype.reject = function(t) {
        return this.filter(ia(oe(t)));
      }, Se.prototype.slice = function(t, i) {
        t = ye(t);
        var s = this;
        return s.__filtered__ && (t > 0 || i < 0) ? new Se(s) : (t < 0 ? s = s.takeRight(-t) : t && (s = s.drop(t)), i !== r && (i = ye(i), s = i < 0 ? s.dropRight(-i) : s.take(i - t)), s);
      }, Se.prototype.takeRightWhile = function(t) {
        return this.reverse().takeWhile(t).reverse();
      }, Se.prototype.toArray = function() {
        return this.take(he);
      }, xn(Se.prototype, function(t, i) {
        var s = /^(?:filter|find|map|reject)|While$/.test(i), u = /^(?:head|last)$/.test(i), d = v[u ? "take" + (i == "last" ? "Right" : "") : i], m = u || /^find/.test(i);
        d && (v.prototype[i] = function() {
          var y = this.__wrapped__, b = u ? [1] : arguments, $ = y instanceof Se, I = b[0], L = $ || ge(y), F = function(Ce) {
            var Oe = d.apply(v, cr([Ce], b));
            return u && K ? Oe[0] : Oe;
          };
          L && s && typeof I == "function" && I.length != 1 && ($ = L = !1);
          var K = this.__chain__, X = !!this.__actions__.length, ue = m && !K, _e = $ && !X;
          if (!m && L) {
            y = _e ? y : new Se(this);
            var ce = t.apply(y, b);
            return ce.__actions__.push({ func: ea, args: [F], thisArg: r }), new sn(ce, K);
          }
          return ue && _e ? t.apply(this, b) : (ce = this.thru(F), ue ? u ? ce.value()[0] : ce.value() : ce);
        });
      }), nn(["pop", "push", "shift", "sort", "splice", "unshift"], function(t) {
        var i = Ms[t], s = /^(?:push|sort|unshift)$/.test(t) ? "tap" : "thru", u = /^(?:pop|shift)$/.test(t);
        v.prototype[t] = function() {
          var d = arguments;
          if (u && !this.__chain__) {
            var m = this.value();
            return i.apply(ge(m) ? m : [], d);
          }
          return this[s](function(y) {
            return i.apply(ge(y) ? y : [], d);
          });
        };
      }), xn(Se.prototype, function(t, i) {
        var s = v[i];
        if (s) {
          var u = s.name + "";
          Ee.call(ti, u) || (ti[u] = []), ti[u].push({ name: i, func: s });
        }
      }), ti[Vs(r, P).name] = [{
        name: "wrapper",
        func: r
      }], Se.prototype.clone = bm, Se.prototype.reverse = wm, Se.prototype.value = Dm, v.prototype.at = Xy, v.prototype.chain = Jy, v.prototype.commit = Qy, v.prototype.next = e1, v.prototype.plant = n1, v.prototype.reverse = r1, v.prototype.toJSON = v.prototype.valueOf = v.prototype.value = i1, v.prototype.first = v.prototype.head, Ii && (v.prototype[Ii] = t1), v;
    }, Jr = Qp();
    Ar ? ((Ar.exports = Jr)._ = Jr, qa._ = Jr) : pt._ = Jr;
  }).call(Ji);
})(Aa, Aa.exports);
var rs = Aa.exports;
const OF = {
  emits: ["move", "cell"],
  props: {
    //! Item to display in row
    item: { type: Object, default: () => ({}) },
    //! Columns to display, as items' attributes
    //! - name: field name / item attribute value
    //! - label: display label
    //! - help: help text
    columns: Array,
    //! Default cell's info
    cell: { type: Object, default() {
      return { row: 0 };
    } },
    //! Cell component tag
    cellTag: { type: String, default: "td" },
    //! If true, can reorder cell by drag & drop
    orderable: { type: Boolean, default: !1 }
  },
  computed: {
    /**
     * Row index
     */
    row() {
      return this.cell && this.cell.row || 0;
    },
    /**
     * Item's data if model instance, otherwise item
     */
    itemData() {
      return this.item instanceof Xt ? this.item.data : this.item;
    },
    /**
     * Computed cell infos
     */
    cells() {
      const e = ub(this.cell) && Zd(this.cell) || this.cell || {}, n = [];
      for (var r in this.columns)
        n.push({ ...e, col: Number(r) });
      return n;
    }
  },
  methods: {
    /**
     * Emit a 'cell' event.
     * Event data: `{name, cell, data, item}`
     * @param {Number} col: cell column's index
     * @param {String} name: cell's event name
     * @param {} data: cell's event data
     */
    cellEmit(e, n, r) {
      this.$emit("cell", {
        name: e,
        cell: n,
        data: r,
        item: this.item
      });
    },
    onDragStart(e) {
      const r = `cell:${e.target.dataset.col}`;
      e.dataTransfer.setData("text/cell", r), e.dataTransfer.dropEffect = "move";
    },
    onDragOver(e) {
      e.preventDefault(), e.dataTransfer.dropEffect = "move";
    },
    /**
     * Handle drop event, emit `'move': { from, to }`.
     */
    onDrop(e) {
      const n = e.dataTransfer.getData("text/cell");
      !n || !n.startsWith("cell:") || (e.preventDefault(), this.$emit("move", {
        from: Number(n.slice(5)),
        to: Number(e.target.dataset.col)
      }));
    },
    /**
     * Return DOM node for cells at provided position `col`
     */
    getCellEl(e) {
      const n = this.$el.querySelectorAll(this.cellTag);
      for (var r of n)
        if (e == Number(r.dataset.col))
          return r;
      return null;
    },
    /**
     * Focus cell's form input. If from is provided, related focus
     */
    focus(e, n) {
      n && (e += n.col);
      const r = this.getCellEl(e);
      if (!r)
        return;
      const a = r.querySelector('input:not([type="hidden"])') || r.querySelector("button") || r.querySelector("select") || r.querySelector("a");
      a && a.focus();
    }
  },
  mounted() {
    this.$el.__row = this;
  }
};
function xF(e, n, r, a, l, o) {
  return O(), A("tr", null, [
    j(e.$slots, "head", {
      item: r.item,
      row: o.row
    }),
    (O(!0), A(Te, null, Le(r.columns, (c, f) => (O(), A(Te, { key: f }, [
      j(e.$slots, "cell-before", {
        item: r.item,
        cell: o.cells[f],
        attr: c
      }),
      (O(), Fe(wr(r.cellTag), {
        class: ee(["cell", "cell-" + c]),
        "data-col": f,
        draggable: r.orderable,
        onDragstart: o.onDragStart,
        onDragover: o.onDragOver,
        onDrop: o.onDrop
      }, {
        default: le(() => [
          j(e.$slots, c, {
            item: r.item,
            cell: o.cells[f],
            data: o.itemData,
            attr: c,
            emit: o.cellEmit,
            value: o.itemData && o.itemData[c]
          }, () => [
            Zt(pe(o.itemData && o.itemData[c]), 1)
          ]),
          j(e.$slots, "cell", {
            item: r.item,
            cell: o.cells[f],
            data: o.itemData,
            attr: c,
            emit: o.cellEmit,
            value: o.itemData && o.itemData[c]
          })
        ]),
        _: 2
      }, 1064, ["class", "data-col", "draggable", "onDragstart", "onDragover", "onDrop"])),
      j(e.$slots, "cell-after", {
        item: r.item,
        col: f,
        cell: o.cells[f],
        attr: c
      })
    ], 64))), 128)),
    j(e.$slots, "tail", {
      item: r.item,
      row: o.row
    })
  ]);
}
const Fv = /* @__PURE__ */ nt(OF, [["render", xF]]), Jl = {
  extends: ds,
  components: { ARow: Fv },
  //! Event:
  //! - cell(event): an event occured inside cell
  //! - colmove({from,to}), colmove(): columns moved
  emits: ["cell", "colmove"],
  props: {
    ...ds.props,
    //! Ordered list of columns, as objects with:
    //! - name: item attribute value
    //! - label: display label
    //! - help: help text
    //! - hidden: if true, field is hidden
    columns: Array,
    //! If True, columns are orderable
    columnsOrderable: Boolean
  },
  data() {
    return {
      ...super.data,
      // TODO: add observer
      columns_: [...this.columns],
      extraItem: new this.set.model()
    };
  },
  computed: {
    columnNames() {
      return this.columns_.map((e) => e.name);
    },
    columnLabels() {
      return this.columns_.reduce(
        (e, n) => ({ ...e, [n.name]: n.label }),
        {}
      );
    },
    rowSlots() {
      return Object.keys(this.$slots).filter((e) => e.startsWith("row-")).map((e) => [e, e.slice(4)]);
    }
  },
  methods: {
    // TODO: use in tracklist
    sortColumns(e) {
      const n = e.map((a) => this.columns_.find((l) => l.name == a)).filter((a) => !!a), r = this.columns_.filter((a) => e.indexOf(a.name) == -1);
      this.columns_ = [...n, ...r], this.$emit("colmove");
    },
    /**
     * Move column using provided event object (as `{from, to}`)
     */
    moveColumn(e) {
      const { from: n, to: r } = e, a = this.columns_[n];
      this.columns_.splice(n, 1), this.columns_.splice(r, 0, a), this.$emit("colmove", e);
    },
    /**
     * React on 'cell' event, re-emitting it with additional values:
     * - `set`: data set
     * - `row`: row index
     *
     * @param {Number} row: row index
     * @param {} data: cell's event data
     */
    onCellEvent(e, n) {
      n.name == "focus" && this.focus(n.data, n.cell), this.$emit("cell", {
        ...n,
        row: e,
        set: this.set
      });
    },
    /**
     * Return row component at provided index
     */
    getRow(e) {
      const n = this.$el.querySelectorAll("tr");
      for (var r of n)
        if (r.__row && e == Number(r.dataset.row))
          return r.__row;
    },
    /**
    * Focus on a cell
    */
    focus(e, n, r = null) {
      r && (e += r.row), e = this.getRow(e), e && e.focus(n, r);
    }
  }
};
Jl.props.itemTag.default = "tr";
Jl.props.listTag.default = "tbody";
const AF = Jl, TF = { class: "table is-stripped is-fullwidth" }, PF = ["title"], kF = /* @__PURE__ */ C("i", { class: "fa fa-circle-question" }, null, -1), IF = [
  kF
];
function EF(e, n, r, a, l, o) {
  const c = Xe("a-row");
  return O(), A("table", TF, [
    C("thead", null, [
      be(c, {
        columns: e.columnNames,
        orderable: e.columnsOrderable,
        cellTag: "th",
        onMove: e.moveColumn
      }, as({ _: 2 }, [
        e.$slots["header-head"] ? {
          name: "head",
          fn: le((f) => [
            j(e.$slots, "header-head", gt(cn(f)))
          ]),
          key: "0"
        } : void 0,
        e.$slots["header-tail"] ? {
          name: "tail",
          fn: le((f) => [
            j(e.$slots, "header-tail", gt(cn(f)))
          ]),
          key: "1"
        } : void 0,
        Le(e.columns, (f) => ({
          name: f.name,
          fn: le((h) => [
            j(e.$slots, "header-" + f.name, gt(cn(h)), () => [
              Zt(pe(f.label) + " ", 1),
              f.help ? (O(), A("span", {
                key: 0,
                class: "icon small",
                title: f.help
              }, IF, 8, PF)) : se("", !0)
            ])
          ])
        }))
      ]), 1032, ["columns", "orderable", "onMove"])
    ]),
    C("tbody", null, [
      j(e.$slots, "head"),
      (O(!0), A(Te, null, Le(e.items, (f, h) => (O(), Fe(c, {
        key: h,
        item: f,
        cell: { row: h },
        columns: e.columnNames,
        "data-index": h,
        "data-row": h,
        draggable: e.orderable,
        onDragstart: e.onDragStart,
        onDragover: e.onDragOver,
        onDrop: e.onDrop,
        onCell: (p) => e.onCellEvent(h, p)
      }, as({ _: 2 }, [
        Le(e.rowSlots, ([p, g]) => ({
          name: g,
          fn: le((w) => [
            j(e.$slots, p, gt(cn(w)))
          ])
        }))
      ]), 1032, ["item", "cell", "columns", "data-index", "data-row", "draggable", "onDragstart", "onDragover", "onDrop", "onCell"]))), 128)),
      j(e.$slots, "tail")
    ])
  ]);
}
const LF = /* @__PURE__ */ nt(AF, [["render", EF]]), YF = {
  emit: ["cell", "move", "colmove", "load"],
  components: { ARows: LF },
  props: {
    labels: Object,
    //! If provided call this function instead of adding an item to rows on "+" button click.
    actionAdd: Function,
    //! If True, columns can be reordered
    columnsOrderable: Boolean,
    //! Field name used for ordering
    orderBy: String,
    //! Formset data as returned by get_formset_data
    formData: Object,
    //! Model class used for item's set
    model: { type: Function, default: Xt },
    //! initial data set load at mount
    initials: Array
  },
  data() {
    return {
      set: new ys(Xt)
    };
  },
  computed: {
    // ---- fields
    _prefix() {
      return this.formData.prefix ? this.formData.prefix + "-" : "";
    },
    fields() {
      return this.formData.fields;
    },
    orderField() {
      return this.orderBy && this.fields.find((e) => e.name == this.orderBy);
    },
    orderable() {
      return !!this.orderField;
    },
    hiddenFields() {
      return this.fields.filter((e) => e.hidden && !(this.orderable && e == this.orderField));
    },
    visibleFields() {
      return this.fields.filter((e) => !e.hidden);
    },
    fieldSlots() {
      return this.visibleFields.reduce(
        (e, n) => ({ ...e, ["row-" + n.name]: n }),
        {}
      );
    },
    items() {
      return this.set.items;
    },
    rows() {
      return this.$refs.rows;
    }
  },
  methods: {
    onCellEvent(e) {
      this.$emit("cell", e);
    },
    onColumnMove(e) {
      this.$emit("colmove", e);
    },
    onActionAdd() {
      if (this.actionAdd)
        return this.actionAdd(this);
      this.set.push();
    },
    moveItem(e) {
      const { from: n, to: r } = e, a = e.set || this.set;
      a.move(n, r), this.$emit("move", { ...e, seŧ: a });
    },
    removeItem(e) {
      this.items[e].id || this.items.splice(e, 1);
    },
    //! Load items into set
    load(e = [], n = !1) {
      n && (this.set.items = []);
      for (var r of e)
        this.set.push(rs.cloneDeep(r));
      this.$emit("load", e);
    },
    //! Reset forms to initials
    reset() {
      this.load(this.initials || [], !0);
    }
  },
  mounted() {
    this.reset();
  }
}, RF = ["name", "value"], FF = ["name", "value"], NF = ["title", "aria-label", "aria-description"], WF = /* @__PURE__ */ C("span", { class: "icon" }, [
  /* @__PURE__ */ C("i", { class: "fa fa-arrow-down-1-9" })
], -1), BF = [
  WF
], UF = ["name", "value"], HF = ["name", "value"], zF = ["name", "value"], qF = { key: 0 }, KF = { class: "field" }, VF = { class: "control" }, GF = { class: "align-right pr-0" }, jF = ["onClick", "title", "aria-label"], ZF = /* @__PURE__ */ C("span", { class: "icon" }, [
  /* @__PURE__ */ C("i", { class: "fa fa-trash" })
], -1), XF = [
  ZF
], JF = { class: "a-formset-footer flex-row" }, QF = { class: "flex-grow-1 flex-row" }, eN = { class: "flex-grow-1 align-right" }, tN = ["title", "aria-label"], nN = /* @__PURE__ */ C("span", { class: "icon" }, [
  /* @__PURE__ */ C("i", { class: "fa fa-rotate" })
], -1), rN = [
  nN
], iN = ["title", "aria-label"], sN = /* @__PURE__ */ C("span", { class: "icon" }, [
  /* @__PURE__ */ C("i", { class: "fa fa-plus" })
], -1), aN = [
  sN
];
function oN(e, n, r, a, l, o) {
  const c = Xe("a-rows");
  return O(), A("div", null, [
    C("input", {
      type: "hidden",
      name: o._prefix + "TOTAL_FORMS",
      value: o.items.length || 0
    }, null, 8, RF),
    (O(!0), A(Te, null, Le(r.formData.management, (f, h) => (O(), A("input", {
      key: h,
      type: "hidden",
      name: o._prefix + h.toUpperCase(),
      value: f
    }, null, 8, FF))), 128)),
    be(c, {
      ref: "rows",
      set: l.set,
      columns: o.visibleFields,
      columnsOrderable: r.columnsOrderable,
      orderable: o.orderable,
      onMove: o.moveItem,
      onColmove: o.onColumnMove,
      onCell: n[0] || (n[0] = (f) => e.$emit("cell", f))
    }, as({
      "header-head": le(() => [
        o.orderable ? (O(), A(Te, { key: 0 }, [
          C("th", {
            style: { "max-width": "2em" },
            title: o.orderField.label,
            "aria-label": o.orderField.label,
            "aria-description": o.orderField.help || ""
          }, BF, 8, NF),
          j(e.$slots, "rows-header-head")
        ], 64)) : se("", !0)
      ]),
      "row-head": le((f) => [
        o.orderable ? (O(), A("input", {
          key: 0,
          type: "hidden",
          name: o._prefix + f.row + "-" + r.orderBy,
          value: f.row
        }, null, 8, UF)) : se("", !0),
        C("input", {
          type: "hidden",
          name: o._prefix + f.row + "-id",
          value: f.item ? f.item.id : ""
        }, null, 8, HF),
        (O(!0), A(Te, null, Le(o.hiddenFields, (h) => (O(), A(Te, {
          key: h.name
        }, [
          h.name in ["id", r.orderBy] ? se("", !0) : (O(), A("input", {
            key: 0,
            type: "hidden",
            name: o._prefix + f.row + "-" + h.name,
            value: h.value in [null, void 0] ? f.item.data[e.name] : h.value
          }, null, 8, zF))
        ], 64))), 128)),
        j(e.$slots, "row-head", gt(cn(f)), () => [
          o.orderable ? (O(), A("td", qF, pe(f.row + 1), 1)) : se("", !0)
        ])
      ]),
      "row-tail": le((f) => [
        e.$slots["row-tail"] ? j(e.$slots, "row-tail", gt(wn({ key: 0 }, f))) : se("", !0),
        C("td", GF, [
          C("button", {
            type: "button",
            class: "button square",
            onClick: In((h) => o.removeItem(f.row, f.item), ["stop"]),
            title: r.labels.remove_item,
            "aria-label": r.labels.remove_item
          }, XF, 8, jF)
        ])
      ]),
      _: 2
    }, [
      Le(o.fieldSlots, (f, h) => ({
        name: h,
        fn: le((p) => [
          j(e.$slots, h, wn(p, {
            field: f,
            inputName: o._prefix + p.cell.row + "-" + f.name
          }), () => [
            C("div", KF, [
              C("div", VF, [
                j(e.$slots, "control-" + f.name, wn(p, {
                  field: f,
                  inputName: o._prefix + p.cell.row + "-" + f.name
                }))
              ]),
              (O(!0), A(Te, null, Le(p.item.error(f.name), ([g, w]) => (O(), A("p", {
                class: "help is-danger",
                key: w
              }, pe(g), 1))), 128))
            ])
          ])
        ])
      }))
    ]), 1032, ["set", "columns", "columnsOrderable", "orderable", "onMove", "onColmove"]),
    C("div", JF, [
      C("div", QF, [
        j(e.$slots, "footer")
      ]),
      C("div", eN, [
        C("button", {
          type: "button",
          class: "button square is-warning p-2",
          onClick: n[1] || (n[1] = (f) => o.reset()),
          title: r.labels.discard_changes,
          "aria-label": r.labels.discard_changes
        }, rN, 8, tN),
        C("button", {
          type: "button",
          class: "button square is-primary p-2",
          onClick: n[2] || (n[2] = (...f) => o.onActionAdd && o.onActionAdd(...f)),
          title: r.labels.add_item,
          "aria-label": r.labels.add_item
        }, aN, 8, iN)
      ])
    ])
  ]);
}
const Ql = /* @__PURE__ */ nt(YF, [["render", oN]]), Qi = {
  Text: 0,
  List: 1,
  Settings: 2
}, lN = {
  components: { AActionButton: jl, AFormSet: Ql, ARow: Fv, AModal: Xl },
  props: {
    formData: Object,
    labels: Object,
    ///! initial data as: {items: [], fields: {column_name: label, settings: {}}
    initData: Object,
    dataPrefix: String,
    settingsUrl: String,
    defaultColumns: {
      type: Array,
      default: () => ["artist", "title", "tags", "album", "year", "timestamp"]
    }
  },
  data() {
    const e = {
      // tracklist_editor_columns: this.columns,
      tracklist_editor_sep: " -- "
    };
    return {
      Page: Qi,
      page: Qi.Text,
      extraData: {},
      settings: e,
      savedSettings: rs.cloneDeep(e)
    };
  },
  computed: {
    rows() {
      return this.$refs.formset && this.$refs.formset.rows;
    },
    columns() {
      return this.rows && this.rows.columns_ || [];
    },
    settingsChanged() {
      var e = Object.keys(this.savedSettings).findIndex((n) => !rs.isEqual(this.settings[n], this.savedSettings[n]));
      return e != -1;
    },
    separator: {
      set(e) {
        this.settings.tracklist_editor_sep = e, this.page == Qi.List && this.updateInput();
      },
      get() {
        return this.settings.tracklist_editor_sep;
      }
    },
    rowsSlots() {
      return Object.keys(this.$slots).filter((e) => e.startsWith("row-") || e.startsWith("rows-") || e.startsWith("control-")).map((e) => [e, e.startsWith("rows-") ? e.slice(5) : e]);
    }
  },
  methods: {
    onCellEvent(e) {
      switch (e.name) {
        case "change":
          this.updateInput();
          break;
      }
    },
    onColumnMove() {
      this.settings.tracklist_editor_columns = this.$refs.formset.rows.columnNames, this.page == this.Page.List ? this.updateInput() : this.updateList();
    },
    updateList() {
      const e = this.toList(this.$refs.textarea.value);
      this.$refs.formset.set.reset(e);
    },
    updateInput() {
      const e = this.toText(this.$refs.formset.items);
      this.$refs.textarea.value = e;
    },
    /**
     * From input and separator, return list of items.
     */
    toList(e) {
      const n = this.$refs.formset.rows.columns_;
      var r = e.split(`
`), a = [];
      for (let f of r)
        if (f = f.trimLeft(), !!f) {
          var l = f.split(this.separator), o = {};
          for (var c in n) {
            if (c >= l.length)
              break;
            const h = n[c];
            o[h.name] = l[c].trim();
          }
          o && a.push(o);
        }
      return a;
    },
    /**
     * From items and separator return a string
     */
    toText(e) {
      const n = this.$refs.formset.rows.columns_, r = ` ${this.separator.trim()} `, a = [];
      for (let c of e)
        if (c) {
          var l = [];
          for (var o of n)
            l.push(c.data[o.name] || "");
          l = rs.dropRightWhile(l, (f) => !f || !("" + f).trim()), l = l.join(r).trimRight(), a.push(l);
        }
      return a.join(`
`);
    },
    _data_key(e) {
      e = e.slice(this.dataPrefix.length);
      try {
        var [n, r] = e.split("-", 1);
        return [Number(n), r];
      } catch {
        return [null, e];
      }
    },
    //! Update saved settings from this.settings
    settingsSaved(e = null) {
      e !== null && (this.settings = e), this.$refs.settings && this.$refs.settings.close(), this.savedSettings = rs.cloneDeep(this.settings);
    }
  },
  mounted() {
    const e = this.initData && this.initData.settings;
    e && (this.settingsSaved(e), this.rows.sortColumns(e.tracklist_editor_columns)), this.page = this.initData.items.length ? Qi.List : Qi.Text;
  }
}, uN = { class: "a-tracklist-editor" }, cN = { class: "flex-row" }, fN = { class: "flex-grow-1" }, dN = { class: "flex-row align-right" }, hN = { class: "field has-addons" }, vN = { class: "control" }, pN = /* @__PURE__ */ C("span", { class: "icon is-small" }, [
  /* @__PURE__ */ C("i", { class: "fa fa-pencil" })
], -1), mN = { class: "control" }, gN = /* @__PURE__ */ C("span", { class: "icon is-small" }, [
  /* @__PURE__ */ C("i", { class: "fa fa-list" })
], -1), yN = { class: "control ml-3" }, _N = ["title"], bN = /* @__PURE__ */ C("span", { class: "icon is-small" }, [
  /* @__PURE__ */ C("i", { class: "fa fa-cog" })
], -1), wN = [
  bN
], DN = { class: "panel" }, $N = { class: "panel" }, CN = { class: "field" }, SN = {
  class: "label",
  style: { "vertical-align": "middle" }
}, MN = {
  class: "table is-bordered",
  style: { "vertical-align": "middle" }
}, ON = { key: 0 }, xN = {
  key: 0,
  style: { cursor: "pointer" }
}, AN = ["onClick"], TN = /* @__PURE__ */ C("i", { class: "fa fa-left-right" }, null, -1), PN = [
  TN
], kN = { class: "flex-row" }, IN = { class: "field is-inline-block is-vcentered flex-grow-1" }, EN = /* @__PURE__ */ C("label", {
  class: "label is-inline mr-2",
  style: { "vertical-align": "middle" }
}, " Séparateur", -1), LN = {
  class: "control is-inline-block",
  style: { "vertical-align": "middle" }
}, YN = { class: "flex-row align-right" };
function RN(e, n, r, a, l, o) {
  const c = Xe("a-form-set"), f = Xe("a-row"), h = Xe("a-action-button"), p = Xe("a-modal");
  return O(), A("div", uN, [
    C("div", cN, [
      C("div", fN, [
        j(e.$slots, "title")
      ]),
      C("div", dN, [
        C("div", hN, [
          C("p", vN, [
            C("button", {
              type: "button",
              class: ee(["button", "p-2", l.page == l.Page.Text ? "is-primary" : "is-light"]),
              onClick: n[0] || (n[0] = (g) => l.page = l.Page.Text)
            }, [
              pN,
              C("span", null, pe(r.labels.text), 1)
            ], 2)
          ]),
          C("p", mN, [
            C("button", {
              type: "button",
              class: ee(["button", "p-2", l.page == l.Page.List ? "is-primary" : "is-light"]),
              onClick: n[1] || (n[1] = (g) => l.page = l.Page.List)
            }, [
              gN,
              C("span", null, pe(r.labels.list), 1)
            ], 2)
          ]),
          C("p", yN, [
            C("button", {
              type: "button",
              class: "button is-info square",
              title: r.labels.settings,
              onClick: n[2] || (n[2] = (g) => e.$refs.settings.open())
            }, wN, 8, _N)
          ])
        ])
      ])
    ]),
    Xn(C("section", DN, [
      C("textarea", {
        ref: "textarea",
        class: "is-fullwidth is-size-6",
        rows: "20",
        onChange: n[3] || (n[3] = (...g) => o.updateList && o.updateList(...g))
      }, null, 544)
    ], 512), [
      [pi, l.page == l.Page.Text]
    ]),
    Xn(C("section", $N, [
      be(c, {
        ref: "formset",
        "form-data": r.formData,
        initials: r.initData.items,
        columnsOrderable: !0,
        labels: r.labels,
        "order-by": "position",
        onLoad: o.updateInput,
        onColmove: o.onColumnMove,
        onMove: o.updateInput,
        onCell: o.onCellEvent
      }, as({ _: 2 }, [
        Le(o.rowsSlots, ([g, w]) => ({
          name: w,
          fn: le((M) => [
            g != "row-tail" ? j(e.$slots, g, gt(wn({ key: 0 }, M))) : se("", !0)
          ])
        }))
      ]), 1032, ["form-data", "initials", "labels", "onLoad", "onColmove", "onMove", "onCell"])
    ], 512), [
      [pi, l.page == l.Page.List]
    ]),
    be(p, {
      ref: "settings",
      title: r.labels.settings
    }, {
      default: le(() => [
        C("div", CN, [
          C("label", SN, pe(r.labels.columns), 1),
          C("table", MN, [
            e.$refs.formset ? (O(), A("tr", ON, [
              be(f, {
                columns: e.$refs.formset.rows.columnNames,
                item: e.$refs.formset.rows.columnLabels,
                onMove: e.$refs.formset.rows.moveColumn
              }, {
                "cell-after": le(({ cell: g }) => [
                  g.col < e.$refs.formset.rows.columns_.length - 1 ? (O(), A("td", xN, [
                    C("span", {
                      class: "icon",
                      onClick: (w) => e.$refs.formset.rows.moveColumn({ from: g.col, to: g.col + 1 })
                    }, PN, 8, AN)
                  ])) : se("", !0)
                ]),
                _: 1
              }, 8, ["columns", "item", "onMove"])
            ])) : se("", !0)
          ])
        ]),
        C("div", kN, [
          C("div", IN, [
            EN,
            C("div", LN, [
              Xn(C("input", {
                type: "text",
                ref: "sep",
                class: "input is-inline is-text-centered is-small",
                style: { "max-width": "5em" },
                "onUpdate:modelValue": n[4] || (n[4] = (g) => o.separator = g),
                onChange: n[5] || (n[5] = (g) => o.updateList())
              }, null, 544), [
                [Qd, o.separator]
              ])
            ])
          ])
        ])
      ]),
      footer: le(() => [
        C("div", YN, [
          o.settingsChanged ? (O(), Fe(h, {
            key: 0,
            icon: "fa fa-floppy-disk",
            class: "button control p-2 mr-3 is-secondary",
            "run-class": "blink",
            url: r.settingsUrl,
            method: "POST",
            data: l.settings,
            "aria-label": r.labels.save_settings,
            onDone: n[6] || (n[6] = (g) => o.settingsSaved())
          }, {
            default: le(() => [
              Zt(pe(r.labels.save_settings), 1)
            ]),
            _: 1
          }, 8, ["url", "data", "aria-label"])) : se("", !0),
          C("button", {
            class: "button",
            type: "button",
            onClick: n[7] || (n[7] = (g) => e.$refs.settings.close())
          }, " Fermer ")
        ])
      ]),
      _: 1
    }, 8, ["title"])
  ]);
}
const FN = /* @__PURE__ */ nt(lN, [["render", RN]]), NN = {
  components: { AFormSet: Ql, ASelectFile: Yv },
  props: {
    formData: Object,
    labels: Object,
    // initial datas
    initData: Object,
    soundListUrl: String,
    soundUploadUrl: String,
    soundDeleteUrl: String
  },
  computed: {
    rowsSlots() {
      return Object.keys(this.$slots).filter((e) => e.startsWith("row-") || e.startsWith("rows-") || e.startsWith("control-")).map((e) => [e, e.startsWith("rows-") ? e.slice(5) : e]);
    }
  },
  methods: {
    actionAdd() {
      this.$refs["select-file"].open();
    },
    selected(e) {
      const n = {
        sound: e.id,
        name: e.name,
        url: e.url,
        broadcast: e.broadcast
      };
      this.$refs.formset.set.push(n);
    }
  }
}, WN = { class: "a-playlist-editor" }, BN = ["src"], UN = { class: "label small flex-grow-1" }, HN = /* @__PURE__ */ C("br", null, null, -1), zN = ["src"], qN = ["name", "value"];
function KN(e, n, r, a, l, o) {
  const c = Xe("a-select-file"), f = Xe("a-form-set");
  return O(), A("div", WN, [
    be(c, {
      ref: "select-file",
      title: r.labels && r.labels.add_sound,
      labels: r.labels,
      "list-url": r.soundListUrl,
      deleteUrl: r.soundDeleteUrl,
      uploadUrl: r.soundUploadUrl,
      uploadLabel: r.labels.select_file,
      onSelect: o.selected
    }, {
      "upload-preview": le(({ upload: h }) => [
        j(e.$slots, "upload-preview", { upload: h })
      ]),
      "upload-form": le(() => [
        j(e.$slots, "upload-form")
      ]),
      default: le(({ item: h }) => [
        C("audio", {
          controls: "",
          src: h.url
        }, null, 8, BN),
        C("label", UN, pe(h.name), 1)
      ]),
      _: 3
    }, 8, ["title", "labels", "list-url", "deleteUrl", "uploadUrl", "uploadLabel", "onSelect"]),
    be(f, {
      ref: "formset",
      "form-data": r.formData,
      labels: r.labels,
      initials: r.initData.items,
      "order-by": "position",
      "action-add": o.actionAdd
    }, as({
      "row-sound": le(({ item: h, inputName: p }) => [
        C("label", null, pe(h.data.name), 1),
        HN,
        C("audio", {
          controls: "",
          src: h.data.url
        }, null, 8, zN),
        C("input", {
          type: "hidden",
          name: p,
          value: h.data.sound
        }, null, 8, qN)
      ]),
      _: 2
    }, [
      Le(o.rowsSlots, ([h, p]) => ({
        name: p,
        fn: le((g) => [
          h != "row-tail" ? j(e.$slots, h, gt(wn({ key: 0 }, g))) : se("", !0)
        ])
      }))
    ]), 1032, ["form-data", "labels", "initials", "action-add"])
  ]);
}
const VN = /* @__PURE__ */ nt(NN, [["render", KN]]), eu = {
  AAutocomplete: gY,
  ACarousel: xY,
  ADropdown: IY,
  AEpisode: FY,
  AList: ds,
  APage: Pv,
  APlayer: PR,
  APlaylist: Iv,
  AProgress: Ev,
  ASoundItem: kv,
  ASwitch: RR
}, QN = {
  ...eu,
  AActionButton: jl,
  AFileUpload: Lv,
  ASelectFile: Yv,
  AModal: Xl,
  AFormSet: Ql,
  ATrackListEditor: FN,
  ASoundListEditor: VN,
  AStatistics: _F,
  AStreamer: MF
}, GN = {
  el: "#app",
  delimiters: ["[[", "]]"],
  components: {
    ...eu,
    VCalendar: Ov,
    VDatepicker: eY
  },
  computed: {
    player() {
      return window.aircox.player;
    }
  },
  methods: {
    deleteElements(e) {
      for (var n of document.querySelectorAll(e))
        n.parentNode.removeChild(n);
    }
  }
}, jN = {
  el: "#player",
  delimiters: ["[[", "]]"],
  components: { ...eu }
};
class ZN {
  constructor(n, { loadingClass: r = "loading", append: a = !1 } = {}) {
    this.el = n, this.append = a, this.loadingClass = r;
  }
  get target() {
    return this._target || (this._target = document.querySelector(this.el)), this._target;
  }
  reset() {
    this._target = null;
  }
  /**
   * Enable hot reload: catch page change in order to fetch them and
   * load page without actually leaving current one.
   */
  enable(n = null) {
    if (this._pageChanged)
      throw "Already enabled, please disable me";
    n || (n = this.target || document.body), this.historySave(document.location, !0), this._pageChanged = (r) => this.pageChanged(r), this._statePopped = (r) => this.statePopped(r), n.addEventListener("click", this._pageChanged, !0), n.addEventListener("submit", this._pageChanged, !0), window.addEventListener("popstate", this._statePopped, !0);
  }
  /**
   * Disable hot reload, remove listeners.
   */
  disable() {
    this.target.removeEventListener("click", this._pageChanged, !0), this.target.removeEventListener("submit", this._pageChanged, !0), window.removeEventListener("popstate", this._statePopped, !0), this._pageChanged = null, this._statePopped = null;
  }
  /**
  * Fetch url, return promise, similar to standard Fetch API.
  * Default implementation just forward argument to it.
  */
  fetch(n, r) {
    return fetch(n, r);
  }
  /**
   * Fetch app from remote and mount application.
   */
  load(n, { mount: r = !0, scroll: a = [0, 0], ...l } = {}) {
    return this.loadingClass && this.target.classList.add(this.loadingClass), this.onLoad && this.onLoad({ url: n, el: this.el, options: l }), a && window.scroll(...a), this.fetch(n, l).then((o) => o.text()).then((o) => {
      this.loadingClass && this.target.classList.remove(this.loadingClass);
      var c = new DOMParser().parseFromString(o, "text/html"), f = c.querySelectorAll(this.el), h = {
        url: n,
        content: f || [document.createTextNode(o)],
        title: c.title,
        append: this.append
      };
      return r && this.mount(h), h;
    });
  }
  /**
  * Mount the page on provided target element
  */
  mount({ content: n, title: r = null, ...a } = {}) {
    this.onPreMount && this.onPreMount({ target: this.target, content: n, items: l, title: r });
    var l = null;
    n && (l = this.mountContent(n, a)), r && (document.title = r), this.onMount && this.onMount({ target: this.target, content: n, items: l, title: r });
  }
  /**
  * Mount page content
  */
  mountContent(n, { append: r = !1 } = {}) {
    if (typeof n == "string")
      return this.target.innerHTML = r ? this.target.innerHTML + n : n, [];
    r || (this.target.innerHTML = "");
    var a = document.createDocumentFragment(), l = [];
    for (var o of n)
      for (; o.firstChild; )
        l.push(o.firstChild), a.appendChild(o.firstChild);
    return this.target.append(a), l;
  }
  /// Save application state into browser history
  historySave(n, r = !1) {
    const a = {
      content: this.target.innerHTML,
      title: document.title
    };
    r ? history.replaceState(a, "", n) : history.pushState(a, "", n);
  }
  // --- events
  pageChanged(n) {
    let r = n.type == "submit", a = r || n.target.tagName == "A" ? n.target : n.target.closest("a");
    if (!a || a.hasAttribute("target") || a.data.forceReload)
      return;
    let l = r ? a.getAttribute("action") || "" : a.getAttribute("href"), o = window.location.protocol + "//" + window.location.hostname, c = (l === "" || l.startsWith("/") || l.startsWith("?") || l.startsWith(o)) && l.indexOf("wp-admin") == -1;
    if (l === null || !c)
      return;
    let f = {};
    if (r) {
      let h = new FormData(n.target);
      a.method == "get" ? l += "?" + new URLSearchParams(h).toString() : f = { ...f, method: a.method, body: h };
    }
    this.load(l, f).then(() => this.historySave(l)), n.preventDefault(), n.stopPropagation();
  }
  statePopped(n) {
    const r = n.state;
    r && r.content && this.mount({ content: r.content, title: r.title });
  }
}
class jd {
  constructor({ el: n = null, props: r = {}, ...a } = {}, l = {}) {
    this.appConfig = a, this.appConfig.el = n, this.props = r, this.pageLoad = new ZN(n, l), this.pageLoad.onPreMount = (o) => this.onPreMount(o), this.pageLoad.onMount = (o) => this.onMount(o);
  }
  enable(n = !0) {
    n && this.pageLoad.enable(document.body), this.mount();
  }
  mount() {
    this.app && this.unmount();
    const n = cb(this.appConfig, this.props);
    n.config.globalProperties.window = window, this.vm = n.mount(this.pageLoad.el), this.app = n;
  }
  unmount() {
    if (this.app) {
      try {
        this.app.unmount();
      } catch {
      }
      this.app = null, this.vm = null, this.pageLoad.reset();
    }
  }
  onPreMount() {
    this.unmount();
  }
  onMount() {
    this.mount();
  }
}
window.aircox = {
  // main application
  loader: null,
  get app() {
    return this.loader.app;
  },
  // player application
  playerLoader: null,
  get playerApp() {
    return this.playerLoader && this.playerLoader.app;
  },
  get player() {
    return this.playerLoader.vm && this.playerLoader.vm.$refs.player;
  },
  Set: ys,
  Sound: _s,
  /**
   * Initialize main application and player.
   */
  init(e = null, {
    hotReload: n = !1,
    el: r = null,
    config: a = null,
    playerConfig: l = null,
    initApp: o = !0,
    initPlayer: c = !0,
    loader: f = null,
    playerLoader: h = null
  } = {}) {
    c && (l = l || jN, h = h || new jd(l), h.enable(!1), this.playerLoader = h, document.addEventListener("keyup", (p) => this.onKeyPress(p), !1)), o && (a = a || window.App || GN, a.el = r || a.el, f = f || new jd({ el: r, props: e, ...a }), f.enable(n), this.loader = f);
  },
  onKeyPress() {
  },
  /**
   * Filter navbar dropdown menu items
   */
  filter_menu(e) {
    var n = new RegExp(e.target.value, "gi"), r = e.target.closest(".navbar-dropdown");
    if (e.target.value)
      for (let a of r.querySelectorAll("a.navbar-item"))
        a.style.display = a.innerHTML.search(n) == -1 ? "none" : null;
    else
      for (let a of r.querySelectorAll("a.navbar-item"))
        a.style.display = null;
  },
  pickDate(e, n) {
    e = `${e}?date=${n.id}`, this.loader.pageLoad.load(e);
  }
};
export {
  GN as A,
  QN as a
};
