import { b9 as d, a0 as o, w as u, ct as c, bL as p, bB as b, cu as m, bv as a, U as y, V as t, P as i, bh as f, bi as n, bj as s, bg as l, bl as v, bn as C, bo as h, bG as g, ep as w } from "./684d2f28.js";
import { useContext as r } from "react";
import { mediaCommonChildren as P, mediaMethods as E } from "./62fcc7e8.js";
import "react-dom";
const x = d.div`
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;

  div > audio {
    object-fit: contain;
    pointer-events: auto;
    height: 100%;
    width: 100%;
    :focus-visible {
      outline: 0px;
    }
  }
`, S = [{
  label: o("audio.play"),
  value: "play",
  description: o("audio.playDesc")
}, {
  label: o("audio.pause"),
  value: "pause",
  description: o("audio.pauseDesc")
}, {
  label: o("audio.ended"),
  value: "ended",
  description: o("audio.endedDesc")
}], V = (e) => /* @__PURE__ */ t(x, {
  ref: e.containerRef,
  children: /* @__PURE__ */ t(w, {
    audioRef: e.viewRef,
    url: e.src.value,
    onPlay: () => e.onEvent("play"),
    onPause: () => e.onEvent("pause"),
    onEnded: () => e.onEvent("ended"),
    autoPlay: e.autoPlay,
    loop: e.loop
  })
}), D = {
  src: u(c, o("audio.defaultSrcUrl")),
  onEvent: p(S),
  style: b(m),
  autoPlay: a,
  loop: a,
  ...P
};
let j = function() {
  return new y(D, (e) => /* @__PURE__ */ t(V, {
    ...e
  })).setPropertyViewFn((e) => /* @__PURE__ */ i(f, {
    children: [/* @__PURE__ */ t(n, {
      name: s.basic,
      children: e.src.propertyView({
        label: o("audio.src"),
        tooltip: o("audio.srcDesc")
      })
    }), (r(l).editorModeStatus === "logic" || r(l).editorModeStatus === "both") && /* @__PURE__ */ i(n, {
      name: s.interaction,
      children: [e.onEvent.getPropertyView(), v(e), e.autoPlay.propertyView({
        label: o("audio.autoPlay")
      }), e.loop.propertyView({
        label: o("audio.loop")
      })]
    })]
  })).setExposeMethodConfigs(E()).build();
}();
const R = C(j, [new h("src", o("audio.srcDesc")), g]);
export {
  R as AudioComp
};
