import { defineComponent as l, computed as w, ref as m, onMounted as x, nextTick as L, createElementBlock as k, openBlock as S, withDirectives as V, createElementVNode as s, vShow as D, normalizeClass as F, createStaticVNode as H } from "vue";
import { upgradeAudio as B } from "./version.mjs";
import { nanoid as T } from "nanoid";
/* empty css                                     */
/* empty css                                     */
import "../../../Interaction/components/Tabs/index.mjs";
import "../../../Interaction/components/Tabs-icon/index.mjs";
import "../../../Interaction/components/Button/index.mjs";
import "../../../Interaction/components/DatePicker/index.mjs";
import "../../../Interaction/components/DatePickerRange/index.mjs";
import "../../../Interaction/components/Switch/index.mjs";
import "../../../Interaction/components/Input/index.mjs";
import "../../../Interaction/components/Select/index.mjs";
import "../../../Interaction/components/Slider/index.mjs";
import "../../../Text/components/List/index.mjs";
import "../../../Text/components/Text/index.mjs";
import "../../../Text/components/TextDynamic/index.mjs";
import "../../../Text/components/TableBasic/index.mjs";
import "../../../Text/components/TableScroll/index.mjs";
import "../../../Text/components/RowScroll/index.mjs";
import "../../../Text/components/RealTime/index.mjs";
import "../../../Text/components/OverNumber/index.mjs";
import "../../../Text/components/CountDown/index.mjs";
import "../../../Text/components/TextCarousel/index.mjs";
import "./index.mjs";
import "../Video/index.mjs";
import "../VideoDynamic/index.mjs";
import "../Carousel/index.mjs";
import "../Flv/index.mjs";
import "../Iframe/index.mjs";
import "../IframeCarousel/index.mjs";
import "../Image/index.mjs";
import "../ImageDynamic/index.mjs";
import "../M3u8/index.mjs";
import "../Wavesurfer/index.mjs";
import "../Weather/index.mjs";
import "../Qrcode/index.mjs";
import "../../../Chart/components/bar/basic/index.mjs";
import "../../../Chart/components/bar/animation/index.mjs";
import "../../../Chart/components/bar/contrast/index.mjs";
import "../../../Chart/components/bar/contrast2/index.mjs";
import "../../../Chart/components/bar/contrast3/index.mjs";
import "../../../Chart/components/bar/gradient-column-chart/index.mjs";
import "../../../Chart/components/bar/horizontal/index.mjs";
import "../../../Chart/components/bar/horizontal-stack/index.mjs";
import "../../../Chart/components/bar/line-bar/index.mjs";
import "../../../Chart/components/bar/line-bar2/index.mjs";
import "../../../Chart/components/bar/loop/index.mjs";
import "../../../Chart/components/bar/mini/index.mjs";
import "../../../Chart/components/bar/polar/index.mjs";
import "../../../Chart/components/bar/polar-stack/index.mjs";
import "../../../Chart/components/bar/polar2/index.mjs";
import "../../../Chart/components/bar/radius-circle/index.mjs";
import "../../../Chart/components/bar/rank/index.mjs";
import "../../../Chart/components/bar/segmented-progress/index.mjs";
import "../../../Chart/components/bar/spire/index.mjs";
import "../../../Chart/components/bar/stack/index.mjs";
import "../../../Chart/components/bar/stack-line/index.mjs";
import "../../../Chart/components/bar/stack2/index.mjs";
import "../../../Chart/components/bar/stack3/index.mjs";
import "../../../Chart/components/bar/staggered/index.mjs";
import "../../../Chart/components/bar/three/index.mjs";
import "../../../Chart/components/bar/waterfall/index.mjs";
import "../../../Chart/components/bar/zebra/index.mjs";
import "../../../Chart/components/line/area-gradient/index.mjs";
import "../../../Chart/components/line/area-highlight/index.mjs";
import "../../../Chart/components/line/area-highlight2/index.mjs";
import "../../../Chart/components/line/basic/index.mjs";
import "../../../Chart/components/line/bump/index.mjs";
import "../../../Chart/components/line/dashed/index.mjs";
import "../../../Chart/components/line/ladder/index.mjs";
import "../../../Chart/components/line/logarithm/index.mjs";
import "../../../Chart/components/line/multix/index.mjs";
import "../../../Chart/components/line/polar-double/index.mjs";
import "../../../Chart/components/line/rain-flow/index.mjs";
import "../../../Chart/components/line/scale/index.mjs";
import "../../../Chart/components/line/smooth/index.mjs";
import "../../../Chart/components/line/smooth-area/index.mjs";
import "../../../Chart/components/line/stack/index.mjs";
import "../../../Chart/components/line/stack-area/index.mjs";
import "../../../Chart/components/line/temp/index.mjs";
import "../../../Chart/components/line/vertical/index.mjs";
import "../../../Chart/components/map/basic/index.mjs";
import "../../../Chart/components/map/bmap-basic/index.mjs";
import "../../../Chart/components/map/bmap-heatmap/index.mjs";
import "../../../Chart/components/map/bmap-rich/index.mjs";
import "../../../Chart/components/map/customize/index.mjs";
import "../../../Chart/components/map/lines/index.mjs";
import "../../../Chart/components/map/scatter/index.mjs";
import "../../../Chart/components/pie/3d/index.mjs";
import "../../../Chart/components/pie/basic/index.mjs";
import "../../../Chart/components/pie/basic2/index.mjs";
import "../../../Chart/components/pie/customized/index.mjs";
import "../../../Chart/components/pie/index/index.mjs";
import "../../../Chart/components/pie/interval/index.mjs";
import "../../../Chart/components/pie/legend-scroll/index.mjs";
import "../../../Chart/components/pie/radius/index.mjs";
import "../../../Chart/components/pie/rose/index.mjs";
import "../../../Chart/components/pie/round/index.mjs";
import "../../../Chart/components/pie/sunburst/index.mjs";
import "../../../Chart/components/scatter/basic/index.mjs";
import "../../../Chart/components/scatter/basic2/index.mjs";
import "../../../Chart/components/scatter/bubble/index.mjs";
import "../../../Chart/components/scatter/ripples/index.mjs";
import "../../../Chart/components/other/candlestick-basic/index.mjs";
import "../../../Chart/components/other/sunburst-basic/index.mjs";
import "../../../Chart/components/other/sunburst-basic2/index.mjs";
import "../../../Chart/components/other/sunburst-basic3/index.mjs";
import "../../../Chart/components/other/sunburst-basic4/index.mjs";
import "../../../Chart/components/other/sunburst-book/index.mjs";
import "../../../Chart/components/other/sunburst-flavors/index.mjs";
import "../../../Chart/components/other/sunburst-radius/index.mjs";
import "../../../Chart/components/other/funnel/index.mjs";
import "../../../Chart/components/other/funnel-contrast/index.mjs";
import "../../../Chart/components/other/funnel-split/index.mjs";
import "../../../Chart/components/other/funnel2/index.mjs";
import "../../../Chart/components/other/force/index.mjs";
import "../../../Chart/components/other/force2/index.mjs";
import "../../../Chart/components/other/gauge/index.mjs";
import "../../../Chart/components/other/gauge-grade/index.mjs";
import "../../../Chart/components/other/gauge-stage/index.mjs";
import "../../../Chart/components/other/graph-basic/index.mjs";
import "../../../Chart/components/other/graph-basic2/index.mjs";
import "../../../Chart/components/other/graph-calendar/index.mjs";
import "../../../Chart/components/other/circular-graph/index.mjs";
import "../../../Chart/components/other/heatmap/index.mjs";
import "../../../Chart/components/other/liquidfill/index.mjs";
import "../../../Chart/components/other/parallel-basic/index.mjs";
import "../../../Chart/components/other/parallel-mul/index.mjs";
import "../../../Chart/components/other/radar-stack/index.mjs";
import "../../../Chart/components/other/tree/index.mjs";
import "../../../Chart/components/other/tree-line/index.mjs";
import "../../../Chart/components/other/word-cloud/index.mjs";
import "../../../Chart/components/other/treemap/index.mjs";
import "../../../Chart/components/other/treemap-basic/index.mjs";
import "../../../Chart/components/other/label-gauge/index.mjs";
import "../../../Chart/components/other/grid-percentage/index.mjs";
import "../../../Chart/components/other/radar/index.mjs";
import "../../../Commons/components/CustomComponentRender/index.mjs";
import "../../../Commons/components/Graphical/index.mjs";
import "../../../Commons/components/Svg/index.mjs";
import "../../../Commons/components/ModelViewer/index.mjs";
import "../../../Commons/components/VrVideo/index.mjs";
import "../../../Commons/components/VrPhoto/index.mjs";
import "../../../Commons/components/Babylon/index.mjs";
import "../../../Commons/components/Echarts/index.mjs";
import "../../../Commons/components/GSViewer/index.mjs";
import "../../../Scene/components/Amap2d/index.mjs";
import "../../../Scene/components/Amap3d/index.mjs";
import "../../../Scene/components/Default/index.mjs";
import "../../../Scene/components/Map2d/index.mjs";
import "../../../Scene/components/Map3d/index.mjs";
import "../../../Scene/components/UeIframe/index.mjs";
import "../../../Scene/components/UeShj/index.mjs";
import "../../../Scene/components/UnityIframe/index.mjs";
import "../../../Scene/components/UnityWebgl/index.mjs";
import "../../../Scene/components/Vr/index.mjs";
import "../../../Scene/components/Earth/index.mjs";
import { SHJDatasourceV2 as G } from "../../../../commons/plugins/datasource/index.mjs";
import { SHJParseEvent as t } from "../../../../commons/plugins/event/index.mjs";
import "lodash";
const J = ["autoplay", "loop", "muted"], M = ["src"], N = l({ name: "ShjAudio" }), Ri = /* @__PURE__ */ l({
  ...N,
  props: {
    option: {},
    sources: {},
    useEvents: {}
  },
  emits: [
    "on-audio-progress",
    "on-audio-play",
    "on-audio-pause",
    "on-audio-ended",
    "on-audio-playing",
    "on-audio-timeupdate",
    "on-audio-error",
    "on-audio-volumechange"
  ],
  setup(o, { expose: c, emit: v }) {
    const a = w(() => B(o.option)), u = m(""), f = m(T()), r = m(!1), e = () => {
      G.parse({
        sources: o.sources,
        callback: ({ data: n }) => {
          try {
            t.parseEvents(o.useEvents, "dataListener", n), u.value = n[0].data[0].src;
          } catch {
            t.parseEvents(o.useEvents, "dataListener", null);
          }
        }
      });
    }, p = m(), i = v, E = () => {
      i("on-audio-progress"), t.parseEvents(o.useEvents, "on-audio-progress"), r.value = !0;
    }, y = () => {
      i("on-audio-play"), t.parseEvents(o.useEvents, "on-audio-play"), r.value = !0;
    }, C = () => {
      i("on-audio-pause"), t.parseEvents(o.useEvents, "on-audio-pause"), r.value = !1;
    }, g = () => {
      i("on-audio-ended"), t.parseEvents(o.useEvents, "on-audio-ended"), r.value = !1;
    }, h = () => {
      i("on-audio-playing"), t.parseEvents(o.useEvents, "on-audio-playing");
    }, b = () => {
      i("on-audio-timeupdate"), t.parseEvents(o.useEvents, "on-audio-timeupdate");
    }, A = () => {
      i("on-audio-error"), t.parseEvents(o.useEvents, "on-audio-error"), r.value = !1;
    }, P = () => {
      i("on-audio-volumechange"), t.parseEvents(o.useEvents, "on-audio-volumechange");
    };
    return x(() => {
      L(() => {
        e();
      });
    }), c({
      play: () => {
        p.value && p.value.play();
      },
      pause: () => {
        p.value && p.value.pause();
      },
      refresh: () => e(),
      refreshView: () => e(),
      refreshData: () => e()
    }), (n, d) => (S(), k("div", {
      key: f.value,
      class: "audio"
    }, [
      V(s("audio", {
        ref_key: "audioRef",
        ref: p,
        autoplay: a.value.base.autoplay,
        loop: a.value.base.loop,
        controls: !1,
        muted: a.value.base.muted,
        onProgress: E,
        onPlay: y,
        onEnded: g,
        onPlaying: h,
        onPause: C,
        onTimeupdate: b,
        onError: A,
        onVolumechange: P
      }, [
        s("source", { src: u.value }, null, 8, M)
      ], 40, J), [
        [D, !1]
      ]),
      s("div", {
        class: F(["audio-svg", {
          animation: r.value
        }])
      }, d[0] || (d[0] = [
        H('<svg width="100%" height="100%" viewBox="0 0 75 75" fill="none" xmlns="http://www.w3.org/2000/svg" data-v-b258833c><circle cx="37.5" cy="37.5" r="37.5" fill="#3D9CFF" fill-opacity="0.1" data-v-b258833c></circle><path fill-rule="evenodd" clip-rule="evenodd" d="M51.3268 20.4054H33.1254C32.2255 20.4 31.3554 20.728 30.6832 21.3264C30.0109 21.9247 29.5841 22.7508 29.4852 23.6453L27.0161 44.2762C26.1001 43.746 25.053 43.4598 23.9763 43.4598C22.3672 43.4598 20.824 44.099 19.6862 45.2368C18.5484 46.3746 17.9092 47.9178 17.9092 49.5269C17.9092 51.136 18.5484 52.6792 19.6862 53.817C20.824 54.9548 22.3672 55.594 23.9763 55.594C25.5854 55.594 27.1286 54.9548 28.2664 53.817C29.3529 52.7305 29.9848 51.2743 30.0395 49.744L30.0555 49.746L32.361 31.3141H50.5623L48.8975 44.2994C47.9722 43.7543 46.9103 43.4598 45.818 43.4598C44.2089 43.4598 42.6657 44.099 41.5279 45.2368C40.3901 46.3746 39.7509 47.9178 39.7509 49.5269C39.7509 51.136 40.3901 52.6792 41.5279 53.817C42.6657 54.9548 44.2089 55.594 45.818 55.594C47.4271 55.594 48.9703 54.9548 50.1081 53.817C51.1946 52.7305 51.8265 51.2743 51.8812 49.744L51.8971 49.746L54.9792 24.434C55.034 23.9233 54.9801 23.4069 54.8211 22.9185C54.6621 22.4301 54.4015 21.981 54.0566 21.6005C53.7116 21.22 53.29 20.9168 52.8196 20.7108C52.3491 20.5049 51.8403 20.4008 51.3268 20.4054Z" fill="url(#paint0_linear_534:1941)" data-v-b258833c></path><defs data-v-b258833c><linearGradient id="paint0_linear_534:1941" x1="17.9092" y1="37.9996" x2="56.4836" y2="37.9996" gradientUnits="userSpaceOnUse" data-v-b258833c><stop stop-color="#3D9CFF" data-v-b258833c></stop><stop offset="1" stop-color="#43E8F3" data-v-b258833c></stop></linearGradient></defs></svg>', 1)
      ]), 2)
    ]));
  }
});
export {
  Ri as default
};
