import { isString as m, isBoolean as N, forOwn as I, isPlainObject as D } from "lodash-es";
import { ay as P, az as A, at as C, aI as g, an as E, a7 as F, aJ as M, aK as j } from "./index-1e3e8095.js";
import L from "./index-42d870b4.js";
import { openBlock as T, createElementBlock as b, renderSlot as O, resolveComponent as K, createVNode as V, withCtx as W } from "vue";
import "axios";
import "@vueuse/core";
import "vue-i18n";
var q = { exports: {} };
(function(e) {
  (function(t) {
    var l = function(i, r, s) {
      if (!k(r) || _(r) || z(r) || H(r) || B(r))
        return r;
      var p, f = 0, w = 0;
      if ($(r))
        for (p = [], w = r.length; f < w; f++)
          p.push(l(i, r[f], s));
      else {
        p = {};
        for (var y in r)
          Object.prototype.hasOwnProperty.call(r, y) && (p[i(y, s)] = l(i, r[y], s));
      }
      return p;
    }, o = function(i, r) {
      r = r || {};
      var s = r.separator || "_", p = r.split || /(?=[A-Z])/;
      return i.split(p).join(s);
    }, a = function(i) {
      return x(i) ? i : (i = i.replace(/[\-_\s]+(.)?/g, function(r, s) {
        return s ? s.toUpperCase() : "";
      }), i.substr(0, 1).toLowerCase() + i.substr(1));
    }, u = function(i) {
      var r = a(i);
      return r.substr(0, 1).toUpperCase() + r.substr(1);
    }, d = function(i, r) {
      return o(i, r).toLowerCase();
    }, c = Object.prototype.toString, B = function(i) {
      return typeof i == "function";
    }, k = function(i) {
      return i === Object(i);
    }, $ = function(i) {
      return c.call(i) == "[object Array]";
    }, _ = function(i) {
      return c.call(i) == "[object Date]";
    }, z = function(i) {
      return c.call(i) == "[object RegExp]";
    }, H = function(i) {
      return c.call(i) == "[object Boolean]";
    }, x = function(i) {
      return i = i - 0, i === i;
    }, h = function(i, r) {
      var s = r && "process" in r ? r.process : r;
      return typeof s != "function" ? i : function(p, f) {
        return s(p, i, f);
      };
    }, v = {
      camelize: a,
      decamelize: d,
      pascalize: u,
      depascalize: d,
      camelizeKeys: function(i, r) {
        return l(h(a, r), i);
      },
      decamelizeKeys: function(i, r) {
        return l(h(d, r), i, r);
      },
      pascalizeKeys: function(i, r) {
        return l(h(u, r), i);
      },
      depascalizeKeys: function() {
        return this.decamelizeKeys.apply(this, arguments);
      }
    };
    e.exports ? e.exports = v : t.humps = v;
  })(P);
})(q);
var U = q.exports;
const R = /* @__PURE__ */ A(U), G = {
  provide() {
    return {
      tippyParent: this.$parent
    };
  }
};
function J(e, t, l, o, a, u) {
  return T(), b("div", null, [
    O(e.$slots, "default")
  ]);
}
const Z = /* @__PURE__ */ C(G, [["render", J]]), Q = {
  a11y: !0,
  allowHTML: !0,
  animateFill: !0,
  arrow: !1,
  flip: !0,
  flipOnUpdate: !1,
  followCursor: !1,
  hideOnClick: !0,
  ignoreAttributes: !1,
  inertia: !1,
  interactive: !1,
  lazy: !0,
  multiple: !0,
  showOnInit: !1,
  sticky: !1,
  touch: !0,
  fullScreen: !1,
  touchHold: !1
}, n = {
  animation: g() ? !1 : "shift-away",
  appendTo: () => document.getElementById(E) || document.body,
  aria: "describedby",
  arrowType: "sharp",
  boundary: "window",
  content: "",
  delay: g() ? [0, 0] : [0, 300],
  distance: 10,
  duration: g() ? [0, 0] : [275, 250],
  flipBehavior: "flip",
  interactiveBorder: 2,
  interactiveDebounce: 0,
  maxWidth: 350,
  offset: 0,
  onHidden() {
  },
  onHide() {
  },
  onMount() {
  },
  onShow() {
  },
  onShown() {
  },
  placement: "top",
  popperOptions: {},
  role: "tooltip",
  size: "regular",
  target: "",
  theme: "dark",
  trigger: "mouseenter focus",
  updateDuration: 0,
  wait: null,
  zIndex: 9999,
  ...Q
}, X = `.tippy-tooltip.no-event-theme{pointer-events:none}.tippy-tooltip.no-event-theme .tippy-content>div>div{pointer-events:auto}.tippy-popper.full-screen{height:100%;width:100%;max-width:none;transform:none!important}.tippy-popper.full-screen>.tippy-tooltip{height:100%;width:100%;pointer-events:none!important}.tippy-popper.full-screen>.tippy-tooltip>.tippy-backdrop{display:none}.tippy-popper.full-screen>.tippy-tooltip>.tippy-content{height:100%;width:100%;pointer-events:none;overflow:hidden}.tippy-popper.full-screen>.tippy-tooltip>.tippy-content>div{display:flex;align-items:center;justify-content:center;height:100%;width:100%;pointer-events:none;align-content:center}.tippy-popper.full-screen>.tippy-tooltip>.tippy-content>div .kapix-tooltip>.inner-style{pointer-events:auto}.tippy-popper.full-screen>.tippy-tooltip>.tippy-content>div .kapix-tooltip>.template-style{pointer-events:auto}.tippy-popper.full-screen .kapix-tooltip.modal{pointer-events:auto}
`;
F("Tippy", X);
function S(e) {
  if (e)
    return e.provided ? e : S(e.tippyParent);
}
let Y = 1;
const ee = {
  name: "Tippy",
  components: {
    TippyContentWrapper: Z
  },
  inject: {
    tippyParent: { default: null },
    tippyDefaultOptions: { default: null }
  },
  props: {
    name: {
      type: String,
      default: null
    },
    to: {
      type: [String, Object],
      required: !1,
      default: void 0
    },
    toSelector: {
      type: String,
      required: !1,
      default: void 0
    },
    content: {
      type: [String, Object, Function],
      required: !1,
      default: ""
    },
    enabled: {
      type: Boolean,
      required: !1,
      default: void 0
    },
    visible: {
      type: Boolean,
      required: !1,
      default: void 0
    },
    triggerTarget: {
      type: String,
      required: !1,
      default: void 0
    },
    appendTo: {
      type: [String, Function, Object],
      default() {
        return n.appendTo;
      },
      required: !1
    },
    aria: {
      type: String,
      default: n.aria,
      required: !1
    },
    arrowType: {
      type: String,
      default: n.arrowType,
      required: !1,
      validator: (e) => ["sharp", "round"].includes(e)
    },
    boundary: {
      type: [String, Object],
      default: n.boundary,
      required: !1,
      validator: (e) => m(e) ? ["scrollParent", "window", "viewport"].includes(e) : !0
    },
    lazyDelay: {
      type: Number,
      default: 0,
      required: !1
    },
    openDelay: {
      type: Number,
      default: 0,
      required: !1
    },
    delay: {
      type: [Number, Array],
      default: void 0,
      required: !1
    },
    duration: {
      type: [Number, Array],
      default() {
        return n.duration;
      },
      required: !1
    },
    distance: {
      type: Number,
      default: n.distance,
      required: !1
    },
    flip: {
      type: Boolean,
      default: n.flip,
      required: !1
    },
    flipBehavior: {
      type: [String, Array],
      default: n.flipBehavior,
      required: !1
    },
    flipOnUpdate: {
      type: Boolean,
      default: n.flipOnUpdate,
      required: !1
    },
    followCursor: {
      type: [Boolean, String],
      default: n.followCursor,
      required: !1
    },
    hideOnClick: {
      type: [Boolean, String],
      default: n.hideOnClick,
      validator: (e) => N(e) || e === "toggle",
      required: !1
    },
    interactiveBorder: {
      type: Number,
      default: n.interactiveBorder,
      required: !1
    },
    interactiveDebounce: {
      type: Number,
      default: n.interactiveDebounce,
      required: !1
    },
    maxWidth: {
      type: [Number, String],
      default: n.maxWidth,
      required: !1
    },
    offset: {
      type: [Number, String],
      default: n.offset,
      required: !1
    },
    placement: {
      type: String,
      default: n.placement,
      required: !1
    },
    popperOptions: {
      type: Object,
      default() {
        return {};
      },
      required: !1
    },
    role: {
      type: String,
      default: n.role,
      required: !1
    },
    size: {
      type: String,
      default: n.size,
      required: !1,
      validator: (e) => ["small", "regular", "large"].includes(e)
    },
    // target: { // CAUSING CRASH !!!!!!!!!!!!
    //   type: String,
    //   default: 'regular',
    //   required: false
    // },
    theme: {
      type: String,
      default: n.theme,
      required: !1
    },
    trigger: {
      type: String,
      default: n.trigger,
      required: !1
    },
    updateDuration: {
      type: Number,
      default: n.updateDuration,
      required: !1
    },
    wait: {
      type: Function,
      default: n.wait,
      required: !1
    },
    zIndex: {
      type: Number,
      default: 9999,
      required: !1
    },
    a11y: {
      type: Boolean,
      default: n.a11y,
      required: !1
    },
    animation: {
      type: [String, Boolean],
      required: !1,
      default: n.animation,
      validator: (e) => m(e) ? ["shift-away", "shift-toward", "fade", "scale", "perspective"].includes(e) : !0
    },
    animateFill: {
      type: Boolean,
      default: n.animateFill,
      required: !1
    },
    allowHTML: {
      type: Boolean,
      default: n.allowHTML,
      required: !1
    },
    arrow: {
      type: Boolean,
      default: n.arrow,
      required: !1
    },
    ignoreAttributes: {
      type: Boolean,
      default: !0,
      required: !1
    },
    inertia: {
      type: Boolean,
      default: n.inertia,
      required: !1
    },
    interactive: {
      type: Boolean,
      default: n.interactive,
      required: !1
    },
    lazy: {
      type: Boolean,
      default: n.lazy,
      required: !1
    },
    multiple: {
      type: Boolean,
      default: n.multiple,
      required: !1
    },
    showOnInit: {
      type: Boolean,
      default: n.showOnInit,
      required: !1
    },
    sticky: {
      type: Boolean,
      default: n.sticky,
      required: !1
    },
    touch: {
      type: Boolean,
      default: n.touch,
      required: !1
    },
    touchHold: {
      type: Boolean,
      default: !1,
      required: n.touchHold
    },
    deepInteractive: {
      type: Boolean,
      default: !0,
      required: !1
    },
    updateOnChange: {
      type: Boolean,
      default: !1
    },
    className: {
      type: String,
      default: void 0
    },
    standalone: {
      type: Boolean,
      default: !1
    },
    provided: {
      type: Boolean,
      default: !0
    },
    fullScreen: {
      type: Boolean,
      default: !1
    },
    onMount: {
      type: Function,
      default: null
    },
    onShow: {
      type: Function,
      default: null
    },
    onShown: {
      type: Function,
      default: null
    },
    onHide: {
      type: Function,
      default: null
    },
    onHidden: {
      type: Function,
      default: null
    }
  },
  emits: ["onCreate", "init", "shown", "hidden", "mount", "show", "hide"],
  data() {
    return {
      id: Y++,
      tip: null,
      hasBeenOpen: !1,
      options: {},
      customOptions: {},
      internalHideOnClick: {},
      internalVisible: null,
      children: []
    };
  },
  computed: {
    tippyParentTarget() {
      return S(this.tippyParent);
    },
    isManualTrigger() {
      return ["manual", "click"].includes(this.trigger);
    },
    parentShouldNotClose({ tippyParentTarget: e }) {
      return e && this.provided && this.deepInteractive && this.internalVisible && e.isManualTrigger && e.interactive;
    },
    contentElement() {
      const e = this.$refs.content;
      return e && e.$el;
    }
  },
  watch: {
    parentShouldNotClose(e) {
      this.setParentInternalHideOnClick(e ? !1 : null);
    },
    to() {
      this.$nextTick(this.init);
    },
    toSelector() {
      this.$nextTick(this.init);
    },
    placement() {
      this.update();
    },
    content() {
      this.update();
    },
    enabled(e) {
      this.tip && (e ? this.tip.enable() : (this.tip.hide(), this.tip.disable()));
    },
    visible(e) {
      this.tip && (clearTimeout(this.openTimeout), clearTimeout(this.lazyTimeout), e ? !this.hasBeenOpen && this.lazyDelay > 0 ? this.lazyTimeout = setTimeout(() => {
        this.hasBeenOpen = !0, this.tip.show();
      }, this.lazyDelay) : this.openDelay > 0 ? this.openTimeout = setTimeout(() => {
        this.tip.show();
      }, this.openDelay) : this.tip.show() : this.tip.hide());
    }
  },
  mounted() {
    this.init();
    const e = !this.standalone && this.tippyParentTarget;
    e && (e.addChild(this), this.closeAllTippyListeners = [
      () => e.removeChild(this)
    ]);
  },
  beforeUnmount() {
    this.destroyTippy(), this.children = [], this.closeAllTippyListeners && this.closeAllTippyListeners.forEach((e) => e && e()), this.setParentInternalHideOnClick(null);
  },
  updated() {
    this.updateOnChange && this.update();
  },
  methods: {
    setParentInternalHideOnClick(e) {
      var t;
      (t = this.tippyParentTarget) == null || t.setInternalHideOnClick(e, this.id);
    },
    setInternalHideOnClick(e, t) {
      if (t || (t = "default"), this.internalHideOnClick[t] != e) {
        e == null ? delete this.internalHideOnClick[t] : this.internalHideOnClick[t] = e;
        const l = Object.values(this.internalHideOnClick), o = l.find((a) => a === !1) ?? l.find((a) => a === !0) ?? l[0];
        this.tip.props.hideOnClick !== o && (this.tip.props.hideOnClick = o ?? this.getOptions().hideOnClick), this.setParentInternalHideOnClick(e ?? (this.parentShouldNotClose ? !1 : null));
      }
    },
    setCustomOptions(e) {
      return this.customOptions = e, this.update(), (t) => {
        this.clearCustomOptions(), t && this.close();
      };
    },
    clearCustomOptions() {
      this.customOptions = {}, this.update();
    },
    destroyTippy() {
      const { tip: e } = this;
      if (e) {
        try {
          e.destroy();
        } catch {
        }
        this.tip = null;
      }
    },
    init() {
      try {
        this.replacingTippy = !0, this.destroyTippy();
      } finally {
        this.replacingTippy = !1;
      }
      let e;
      if (this.to ? e = m(this.to) ? document.querySelector(`[name='${this.to}']`) : this.to : this.toSelector ? e = document.querySelector(this.toSelector) : this.$slots.trigger && this.contentElement !== this.$el.children[0] ? e = this.$el.children[0] : e = this.$el.parentElement, !e)
        return;
      let t = L(e, this.getOptions());
      if (t) {
        if (Array.isArray(t))
          if (t.length > 0)
            t = t[0];
          else
            return;
        this.tip = t, this.$emit("onCreate", t), this.$emit("init", t), this.enabled === !1 && t.disable(), this.isManualTrigger && this.visible === !0 && t.show(), this.className && M(t.popper, this.className), t.setCustomOptions = this.setCustomOptions;
      }
    },
    tippy() {
      return this.tip;
    },
    filterOptions() {
      const { options: e } = this;
      return I(e, (t, l) => {
        n.hasOwnProperty(l) ? D(t) && (e[l] = {
          ...t
        }) : delete e[l];
      }), e;
    },
    getOptions() {
      const {
        options: e,
        customOptions: t,
        tippyDefaultOptions: l,
        internalHideOnClick: o
      } = this;
      return Object.assign(e, R.camelizeKeys({
        ...this.$props,
        ...t,
        to: void 0
        // because create bug if to is HtmlElement
      })), this.delay == null && (e.delay = this.interactive ? n.delay : [0, 20]), l && Object.assign(e, l), Object.values(o).includes(!1) && Object.keys(t).length === 0 && (e.hideOnClick = !1), this.filterOptions(), e.onShow = this.onShowThunk(e.onShow), e.onShown = this.onShownThunk(e.onShown), e.onHide = this.onHideThunk(e.onHide), e.onHidden = this.onHiddenThunk(e.onHidden), e.onMount || (e.onMount = (...a) => this.$emit("mount", ...a)), this.contentElement && (e.content = this.contentElement), e.triggerTarget = this.triggerTarget, e;
    },
    update() {
      var e;
      (e = this.tip) == null || e.set(this.getOptions());
    },
    updatePosition() {
      var e, t;
      (t = (e = this.tip) == null ? void 0 : e.popperInstance) == null || t.update();
    },
    show() {
      var e;
      return (e = this.tip) == null ? void 0 : e.show();
    },
    open() {
      return this.show();
    },
    hide(e = void 0) {
      var t;
      return (t = this.tip) == null ? void 0 : t.hide(e);
    },
    close(e = void 0) {
      return this.hide(e);
    },
    closeChildren(e = 0) {
      this.children.forEach((t) => t.hide(e));
    },
    addChild(e) {
      this.children.push(e);
    },
    removeChild(e) {
      j(this.children, e);
    },
    onShowThunk(e) {
      return (...t) => {
        e ? e(...t) : this.$emit("show", ...t);
      };
    },
    onShownThunk(e) {
      return (...t) => {
        this.internalVisible = !0, e ? e(...t) : this.$emit("shown", ...t);
      };
    },
    onHideThunk(e) {
      return (...t) => {
        if (e) {
          const l = e && e(...t);
          return (l === !0 || l == null) && this.closeChildren(), l;
        } else {
          this.closeChildren(), this.$emit("hide", ...t);
          return;
        }
      };
    },
    onHiddenThunk(e) {
      return (...t) => {
        this.replacingTippy ? this.internalVisible = !1 : setTimeout(() => {
          this.internalVisible = !1, e ? e(...t) : this.$emit("hidden", ...t);
        });
      };
    }
  }
}, te = { class: "tippy-container" };
function ie(e, t, l, o, a, u) {
  const d = K("TippyContentWrapper");
  return T(), b("div", te, [
    O(e.$slots, "trigger"),
    V(d, { ref: "content" }, {
      default: W(() => [
        O(e.$slots, "default", {
          close: u.close,
          visible: a.internalVisible
        })
      ]),
      _: 3
    }, 512)
  ]);
}
const ue = /* @__PURE__ */ C(ee, [["render", ie]]);
export {
  ue as default
};
