import { defineComponent as f, computed as S, ref as h, onMounted as C, nextTick as x, createElementBlock as E, openBlock as a, createElementVNode as L, unref as W, createVNode as z, withCtx as N, createBlock as m, createCommentVNode as n } from "vue";
import { debounce as O } from "lodash";
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 "../../../Media/components/Audio/index.mjs";
import "../../../Media/components/Video/index.mjs";
import "../../../Media/components/VideoDynamic/index.mjs";
import "../../../Media/components/Carousel/index.mjs";
import "../../../Media/components/Flv/index.mjs";
import "../../../Media/components/Iframe/index.mjs";
import "../../../Media/components/IframeCarousel/index.mjs";
import "../../../Media/components/Image/index.mjs";
import "../../../Media/components/ImageDynamic/index.mjs";
import "../../../Media/components/M3u8/index.mjs";
import "../../../Media/components/Wavesurfer/index.mjs";
import "../../../Media/components/Weather/index.mjs";
import "../../../Media/components/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 "../Amap2d/index.mjs";
import "../Amap3d/index.mjs";
import "../Default/index.mjs";
import "../Map2d/index.mjs";
import "../Map3d/index.mjs";
import "../UeIframe/index.mjs";
import "../UeShj/index.mjs";
import "../UnityIframe/index.mjs";
import "../UnityWebgl/index.mjs";
import "../Vr/index.mjs";
import "./index.mjs";
import { SHJDatasourceV2 as I } from "../../../../commons/plugins/datasource/index.mjs";
import { SHJParseEvent as s } from "../../../../commons/plugins/event/index.mjs";
import V from "./components/Earth/main.vue.mjs";
import u from "./components/Earth/border.vue.mjs";
import { upgradeEarth as _ } from "./version.mjs";
import { useWatch as j } from "./hooks/useWatch.mjs";
const A = { class: "zerov-widget" }, D = ["id"], F = f({ name: "ShjEarth" }), Re = /* @__PURE__ */ f({
  ...F,
  props: {
    option: {},
    sources: {},
    useEvents: {}
  },
  emits: ["on-success"],
  setup(t, { expose: k, emit: g }) {
    const w = g, r = S(() => _(t.option)), b = T(), l = h(), c = h(!0), o = O((p = !1) => {
      c.value = !0, t.sources && t.sources.length > 0 ? I.parse({
        sources: t.sources,
        callback: (e) => {
          try {
            s.parseEvents(t.useEvents, "dataListener", e.data);
            const d = r.value.lines && r.value.lines.find((i) => i._sourceId === e.id);
            d && (d.data = e.data[0].data);
            const v = r.value.flylines && r.value.flylines.find(
              (i) => i._sourceId === e.id
            );
            v && (v.data = e.data[0].data);
            const y = r.value.lightBeams && r.value.lightBeams.find(
              (i) => i._sourceId === e.id
            );
            y && (y.data = e.data[0].data), !p && l.value.refresh();
          } catch {
            s.parseEvents(t.useEvents, "dataListener", null);
          }
        }
      }) : !p && l.value.refresh();
    }, 200), B = () => {
      c.value = !1, w("on-success"), s.parseEvents(t.useEvents, "on-success", null);
    };
    return C(() => {
      x(() => {
        o(!0);
      });
    }), j({ option: r.value, sources: t.sources }, o), k({
      refresh: () => o(),
      refreshView: () => o(),
      refreshData: () => o()
    }), (p, e) => (a(), E("div", A, [
      L("div", {
        id: W(b),
        class: "widget"
      }, [
        z(V, {
          ref_key: "earthRef",
          ref: l,
          style: { height: "100%" },
          background: r.value.background,
          "is-background": r.value.isBackground,
          fog: r.value.fog,
          "fog-color": r.value.fogColor,
          "fog-near": r.value.fogNear,
          "fog-far": r.value.fogFar,
          stats: r.value.stats,
          "stats-type": r.value.statsType,
          radius: r.value.radius,
          subdivision: r.value.subdivision,
          animation: r.value.animation,
          "animation-speed": r.value.animationSpeed,
          texture: r.value.texture,
          color: r.value.color,
          opacity: r.value.opacity,
          transparent: r.value.transparent,
          wireframe: r.value.wireframe,
          label: r.value.label,
          particle: r.value.particle,
          "particle-color": r.value.particleColor,
          "particle-size": r.value.particleSize,
          aperture: r.value.aperture,
          "aperture-color": r.value.apertureColor,
          "aperture-opacity": r.value.apertureOpacity,
          "aperture-transparent": r.value.apertureTransparent,
          "aperture-depth-write": r.value.apertureDepthWrite,
          "cloud-cover": r.value.cloudCover,
          "cloud-cover-color": r.value.cloudCoverColor,
          "cloud-cover-opacity": r.value.cloudCoverOpacity,
          "cloud-cover-transparent": r.value.cloudCoverTransparent,
          "cloud-cover-animation": r.value.cloudCoverAnimation,
          "cloud-cover-animation-speed": r.value.cloudCoverAnimationSpeed,
          "starry-sky": r.value.starrySky,
          "starry-sky-texture": r.value.starrySkyTexture,
          "starry-sky-number": r.value.starrySkyNumber,
          "starry-sky-size": r.value.starrySkySize,
          "starry-sky-color": r.value.starrySkyColor,
          "starry-sky-opacity": r.value.starrySkyOpacity,
          "starry-sky-animation": r.value.starrySkyAnimation,
          "starry-sky-animation-speed": r.value.starrySkyAnimationSpeed,
          "ambient-light-color": r.value.ambientLightColor,
          "ambient-light-intensity": r.value.ambientLightIntensity,
          "directional-light-x": r.value.directionalLightX,
          "directional-light-y": r.value.directionalLightY,
          "directional-light-z": r.value.directionalLightZ,
          "directional-light-intensity": r.value.directionalLightIntensity,
          "directional-light-color": r.value.directionalLightColor,
          "is-composer": r.value.isComposer,
          composer: r.value.composer,
          flylines: r.value.flylines,
          lines: r.value.lines,
          "light-beam": r.value.lightBeams,
          onOnSuccess: B
        }, {
          default: N(() => [
            r.value.chinaBorderShow ? (a(), m(u, {
              key: 0,
              geojson: "china",
              color: r.value.chinaBorderColor,
              width: r.value.chinaBorderWidth,
              opacity: r.value.chinaBorderOpacity,
              wakeline: r.value.chinaBorderWakeline,
              "wakeline-number": r.value.chinaBorderWakelineNumber
            }, null, 8, ["color", "width", "opacity", "wakeline", "wakeline-number"])) : n("", !0),
            r.value.china2BorderShow ? (a(), m(u, {
              key: 1,
              geojson: "china-border",
              color: r.value.china2BorderColor,
              width: r.value.china2BorderWidth,
              opacity: r.value.china2BorderOpacity,
              wakeline: r.value.china2BorderWakeline,
              "wakeline-number": r.value.china2BorderWakelineNumber
            }, null, 8, ["color", "width", "opacity", "wakeline", "wakeline-number"])) : n("", !0),
            r.value.worldBorderShow ? (a(), m(u, {
              key: 2,
              geojson: "world",
              color: r.value.worldBorderColor,
              width: r.value.worldBorderWidth,
              opacity: r.value.worldBorderOpacity,
              wakeline: r.value.worldBorderWakeline,
              "wakeline-number": r.value.worldBorderWakelineNumber
            }, null, 8, ["color", "width", "opacity", "wakeline", "wakeline-number"])) : n("", !0)
          ]),
          _: 1
        }, 8, ["background", "is-background", "fog", "fog-color", "fog-near", "fog-far", "stats", "stats-type", "radius", "subdivision", "animation", "animation-speed", "texture", "color", "opacity", "transparent", "wireframe", "label", "particle", "particle-color", "particle-size", "aperture", "aperture-color", "aperture-opacity", "aperture-transparent", "aperture-depth-write", "cloud-cover", "cloud-cover-color", "cloud-cover-opacity", "cloud-cover-transparent", "cloud-cover-animation", "cloud-cover-animation-speed", "starry-sky", "starry-sky-texture", "starry-sky-number", "starry-sky-size", "starry-sky-color", "starry-sky-opacity", "starry-sky-animation", "starry-sky-animation-speed", "ambient-light-color", "ambient-light-intensity", "directional-light-x", "directional-light-y", "directional-light-z", "directional-light-intensity", "directional-light-color", "is-composer", "composer", "flylines", "lines", "light-beam"])
      ], 8, D)
    ]));
  }
});
export {
  Re as default
};
