import { defineComponent as V, ref as h, computed as n, onMounted as F, onBeforeUnmount as I, openBlock as d, createElementBlock as c, normalizeClass as x, createElementVNode as l, withModifiers as m, toDisplayString as z, createCommentVNode as C, createVNode as $, TransitionGroup as D, withCtx as E, Fragment as R, renderList as G, withDirectives as O, createBlock as P, resolveDynamicComponent as U, vShow as W } from "vue";
import { u as j, C as q, A as J, V as K, m as Q, o as X } from "./index-20f08fc9.mjs";
import "pinia";
import "dayjs";
const Y = { class: "cds-slides-header" }, Z = ["innerHTML"], ee = ["innerHTML"], se = { class: "cds-slides-header__body" }, ne = { class: "cds-slides-header__title" }, te = ["textContent"], le = {
  key: 0,
  class: "cds-slides-header__sub-title"
}, oe = ["textContent"], ie = ["innerHTML"], ae = ["innerHTML"], de = { class: "cds-slides-body" }, he = /* @__PURE__ */ V({
  __name: "index",
  setup(ce) {
    const o = j(), r = { iconClose: q, iconBack: J };
    h(null);
    const u = h({ w: 0, h: 0 }), v = h(null), w = n(() => o.slides), i = n(() => o.sideCurrent), y = n(() => {
      var e;
      return (e = i.value) == null ? void 0 : e.resizable;
    }), L = n(() => {
      var e;
      return (e = i.value) == null ? void 0 : e.title;
    }), p = n(() => {
      var e;
      return (e = i.value) == null ? void 0 : e.subTitle;
    }), f = n(() => {
      var e;
      return (e = i.value) == null ? void 0 : e.size;
    }), a = n(() => {
      var e;
      return (e = i.value) == null ? void 0 : e.sizes;
    }), M = n(() => {
      var e;
      return (e = i.value) == null ? void 0 : e.blockClose;
    }), S = n(() => {
      var e;
      return (e = i.value) == null ? void 0 : e.blockCloseMessage;
    }), _ = n(() => o.sideCount), T = { small: K, medium: Q, large: X }, g = n(() => {
      if (!a.value || !a.value.length > 1)
        return;
      const e = a.value.length, s = a.value.findIndex((t) => t === f.value);
      return s + 1 < e ? a.value[s + 1] : a.value[0];
    }), A = n(() => {
      if (!(!a.value || !a.value.length > 1))
        return T[g.value];
    });
    F(() => {
      const e = new ResizeObserver((s) => {
        s.forEach((t) => {
          const b = t.contentRect;
          u.value.w = Number(b.width.toFixed(0)), u.value.h = Number(b.height.toFixed(0)), o.setSidePanelSize(u.value);
        });
      });
      v.value && e.observe(v.value);
    }), I(() => o.closeAllSlide());
    const k = (e = !0) => {
      M.value && !confirm(S.value || "Закрыть?") || (e ? o.closeLastSlide() : o.closeAllSlide());
    }, H = () => o.changeSize(g.value), B = () => k(!0), N = () => k();
    return (e, s) => (d(), c("div", {
      ref_key: "slide",
      ref: v,
      class: x([`cds-slides-container--${f.value}`, "cds-slides-container"])
    }, [
      l("div", Y, [
        l("a", {
          class: x([{ "cds-slides-header__side--danger": _.value === 1 }, "cds-slides-header__side"]),
          role: "button",
          onClick: s[0] || (s[0] = m((t) => B(), ["prevent"]))
        }, [
          _.value > 1 ? (d(), c("span", {
            key: 0,
            class: "cds-slides-header__icon",
            innerHTML: r.iconBack
          }, null, 8, Z)) : (d(), c("span", {
            key: 1,
            class: "cds-slides-header__icon cds-slides-header__icon--danger",
            innerHTML: r.iconClose
          }, null, 8, ee))
        ], 2),
        l("div", se, [
          l("div", ne, [
            l("div", {
              textContent: z(L.value)
            }, null, 8, te)
          ]),
          p.value ? (d(), c("div", le, [
            l("div", {
              textContent: z(p.value)
            }, null, 8, oe)
          ])) : C("", !0)
        ]),
        y.value ? (d(), c("a", {
          key: 0,
          class: "cds-slides-header__side",
          onClick: s[1] || (s[1] = m((t) => H(), ["prevent"]))
        }, [
          l("span", {
            class: "cds-slides-header__icon",
            innerHTML: A.value
          }, null, 8, ie)
        ])) : C("", !0),
        _.value > 1 ? (d(), c("a", {
          key: 1,
          class: "cds-slides-header__side",
          onClick: s[2] || (s[2] = m((t) => N(), ["prevent"]))
        }, [
          l("span", {
            class: "cds-slides-header__icon cds-slides-header__icon--danger",
            innerHTML: r.iconClose
          }, null, 8, ae)
        ])) : C("", !0)
      ]),
      l("div", de, [
        $(D, {
          name: "sidenav-child",
          persisted: ""
        }, {
          default: E(() => [
            (d(!0), c(R, null, G(w.value, (t) => O((d(), P(U(t.component), {
              key: t.id,
              data: t.data
            }, null, 8, ["data"])), [
              [W, i.value.id === t.id]
            ])), 128))
          ]),
          _: 1
        })
      ])
    ], 2));
  }
});
export {
  he as default
};
//# sourceMappingURL=index-13feba3e.mjs.map
