import { a3 as g, w as r, cJ as b, dr as S, a5 as d, eC as V, aG as $, ci as x, U as D, H as e, aI as v, eD as E, ad as o, I as u, ae as n, af as i, a4 as s, am as m, co as H, ag as k, ah as B, aj as I, ai as N, V as y, eE as R } from "./56c67d3b.js";
import { useRef as j, useState as z, useContext as h } from "react";
import "react-dom";
const F = g.div`
  background: ${(a) => a.$src && `url(${a.$src})`} no-repeat 50% 50%;
  background-size: contain;
`, M = g.div`
  &,
  .ant-carousel {
    height: 100%;
    background: ${(a) => a.$bg};
    ${(a) => a.$animationStyle}
  }
`;
let c = function() {
  const a = {
    autoPlay: r(y, !0),
    data: r(b, JSON.stringify(["https://temp.im/403x192", "https://temp.im/403x192"])),
    onEvent: S,
    showDots: r(y, !0),
    dotPosition: r(R, "bottom"),
    style: d(V, "style"),
    animationStyle: d($, "animationStyle"),
    ...x
  };
  return new D(a, (t) => {
    const l = j(null), [C, w] = z(0), p = () => {
      l.current && w(l.current.clientHeight);
    };
    return /* @__PURE__ */ e(M, {
      ref: l,
      $bg: t.style.background,
      $animationStyle: t.animationStyle,
      children: /* @__PURE__ */ e(v, {
        onResize: p,
        children: /* @__PURE__ */ e(E, {
          dots: t.showDots,
          dotPosition: t.dotPosition,
          autoplay: t.autoPlay,
          afterChange: () => t.onEvent("change"),
          children: t.data.map((f, P) => /* @__PURE__ */ e("div", {
            children: /* @__PURE__ */ e(F, {
              $src: f,
              style: {
                height: C
              }
            })
          }, P))
        })
      })
    });
  }).setPropertyViewFn((t) => /* @__PURE__ */ o(u, {
    children: [/* @__PURE__ */ e(n, {
      name: i.basic,
      children: t.data.propertyView({
        label: s("data")
      })
    }), ["logic", "both"].includes(h(m).editorModeStatus) && /* @__PURE__ */ o(u, {
      children: [/* @__PURE__ */ e(H, {
        ...t
      }), /* @__PURE__ */ o(n, {
        name: i.interaction,
        children: [t.onEvent.getPropertyView(), k(t), t.autoPlay.propertyView({
          label: s("carousel.autoPlay")
        })]
      })]
    }), ["layout", "both"].includes(h(m).editorModeStatus) && /* @__PURE__ */ o(u, {
      children: [/* @__PURE__ */ o(n, {
        name: i.layout,
        children: [t.showDots.propertyView({
          label: s("carousel.showDots")
        }), t.dotPosition.propertyView({
          label: s("carousel.dotPosition"),
          radioButton: !0
        })]
      }), /* @__PURE__ */ e(n, {
        name: i.style,
        children: t.style.getPropertyView()
      }), /* @__PURE__ */ e(n, {
        name: i.animationStyle,
        hasTooltip: !0,
        children: t.animationStyle.getPropertyView()
      })]
    })]
  })).build();
}();
c = class extends c {
  autoHeight() {
    return !1;
  }
};
const G = B(c, [new I("data", s("data")), N]);
export {
  G as CarouselComp
};
