import '@das-fed/ui/packages/components/time-line/style.css';
import { withInstall as T } from "@das-fed/utils/with-install/index";
import { defineComponent as $, provide as E, reactive as N, createElementBlock as k, openBlock as d, createVNode as w, unref as B, mergeProps as I, withCtx as u, renderSlot as o, ref as F, inject as S, onMounted as W, createBlock as L, createElementVNode as i, normalizeStyle as P } from "vue";
import "ant-design-vue/es/timeline/style/css";
import { Timeline as V, TimelineItem as j } from "ant-design-vue";
import { setThemeRule as z } from "@das-fed/web/packages/theme/index";
const M = { class: "das-ui-time-line" }, O = /* @__PURE__ */ $({
  __name: "Index",
  props: {
    layoutType: { default: "right" },
    alignWidth: { default: "" },
    isThrough: { type: Boolean, default: !1 }
  },
  setup(a) {
    return E("DasForm", N({ props: a })), (s, n) => (d(), k("div", M, [
      w(B(V), I(s.$attrs, {
        class: ["timeline-layout", "timeline-layout-" + s.layoutType, { "top-through": s.isThrough }]
      }), {
        default: u(() => [
          o(s.$slots, "default", {}, void 0, !0)
        ]),
        _: 3
        /* FORWARDED */
      }, 16, ["class"])
    ]));
  }
}), C = (a, e) => {
  const s = a.__vccOpts || a;
  for (const [n, l] of e)
    s[n] = l;
  return s;
}, R = /* @__PURE__ */ C(O, [["__scopeId", "data-v-c498830a"]]), q = { class: "das-timeline-dot-wrap" }, G = { class: "das-timeline-label-left" }, H = { class: "das-timeline-label-right" }, J = /* @__PURE__ */ $({
  __name: "TimelineItem",
  props: {
    dotSlot: { type: Boolean, default: !1 },
    color: { default: "#276FF5" },
    layoutType: { default: "right" },
    alignWidth: { default: "" }
  },
  setup(a) {
    const e = F(null), n = S("DasForm").props, l = n.alignWidth, m = n.layoutType;
    return W(() => {
      var t, r, c, f, p, h, y, g, _;
      if (l !== "") {
        (t = e == null ? void 0 : e.value) == null || t.$el;
        const b = (c = (r = e == null ? void 0 : e.value) == null ? void 0 : r.$el) == null ? void 0 : c.getElementsByClassName("ant-timeline-item-tail")[0], v = (p = (f = e == null ? void 0 : e.value) == null ? void 0 : f.$el) == null ? void 0 : p.getElementsByClassName("ant-timeline-item-head")[0], D = (y = (h = e == null ? void 0 : e.value) == null ? void 0 : h.$el) == null ? void 0 : y.getElementsByClassName("das-timeline-label-left")[0], A = (_ = (g = e == null ? void 0 : e.value) == null ? void 0 : g.$el) == null ? void 0 : _.getElementsByClassName("das-timeline-label-right")[0];
        m === "double-left" ? (b.setAttribute(
          "style",
          `
          left:${l};
        `
        ), v.setAttribute(
          "style",
          `
          left:${l};
        `
        ), D.setAttribute(
          "style",
          `
          width:${l};
        `
        )) : m === "double-right" && (b.setAttribute(
          "style",
          `
          left:calc(100% - ${l});
        `
        ), v.setAttribute(
          "style",
          `
        left:calc(100% - ${l});
        `
        ), A.setAttribute(
          "style",
          `
          width:${l};
        `
        ));
      }
    }), (t, r) => (d(), L(
      B(j),
      I({
        ref_key: "$timelineitem",
        ref: e
      }, t.$attrs, { class: ["das-timeline-item"] }),
      {
        dot: u(() => [
          i("span", q, [
            t.dotSlot ? o(t.$slots, "dot", { key: 0 }, void 0, !0) : (d(), k(
              "span",
              {
                key: 1,
                class: "das-timeline-dot-custom",
                style: P({ "background-color": t.color })
              },
              null,
              4
              /* STYLE */
            ))
          ])
        ]),
        default: u(() => [
          i("span", G, [
            o(t.$slots, "left", {}, void 0, !0),
            o(t.$slots, "default", {}, void 0, !0)
          ]),
          r[0] || (r[0] = i(
            "span",
            { class: "das-timeline-label-seprate" },
            null,
            -1
            /* HOISTED */
          )),
          i("span", H, [
            o(t.$slots, "right", {}, void 0, !0),
            o(t.$slots, "default", {}, void 0, !0)
          ])
        ]),
        _: 3
        /* FORWARDED */
      },
      16
      /* FULL_PROPS */
    ));
  }
}), K = /* @__PURE__ */ C(J, [["__scopeId", "data-v-3fe8b33b"]]), Q = {
  "--demo-alert-bg": {
    light: "#fff",
    dark: "rgba(255,255,255,.2)"
  }
};
z(Q);
const ee = T(R), te = T(K);
export {
  ee as DasTimeLine,
  te as DasTimelineItem,
  ee as default
};
