import { defineComponent as N, computed as ie, watch as u, createElementBlock as S, openBlock as L, createElementVNode as E, createCommentVNode as D, normalizeClass as ne, unref as w, toDisplayString as ce, shallowRef as J, ref as h, onMounted as me, onUnmounted as de } from "vue";
import ue from "@amap/amap-jsapi-loader";
import ye from "axios";
import { nanoid as pe } from "nanoid";
import { debounce as M } from "lodash";
/* 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/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 "./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 "../Earth/index.mjs";
import { SHJDatasourceV2 as ge } from "../../../../commons/plugins/datasource/index.mjs";
import { SHJParseEvent as p } from "../../../../commons/plugins/event/index.mjs";
import { upgradeAmap3d as fe } from "./version.mjs";
const ve = { class: "relative w-full h-full" }, he = {
  key: 0,
  class: "empty-wrap"
}, ke = {
  key: 0,
  class: "iconfont shj-gaodeditu",
  style: { "font-size": "48px" }
}, be = { class: "text-gray-500" }, ze = N({ name: "ShjAmap3d" }), wr = /* @__PURE__ */ N({
  ...ze,
  props: {
    option: {},
    sources: {},
    useEvents: {}
  },
  emits: [
    "amap3d-scene-success",
    "amap3d-scene-zoomstart",
    "amap3d-scene-zoomend",
    "amap3d-scene-mapclick",
    "amap3d-scene-dragstart",
    "amap3d-scene-dragging",
    "amap3d-scene-dragend",
    "amap3d-scene-pulseLinkLayer"
  ],
  setup(m, { expose: T, emit: F }) {
    const o = ie(() => fe(m.option)), y = F, G = () => {
      const s = J(), c = J(), x = h(!1), k = h(), b = h(), z = h(), d = h(), C = h(""), B = (t) => {
        $(), window._AMapSecurityConfig = {
          securityJsCode: t.basic.securityJsCode
        }, ue.load({
          key: t.basic.key,
          // 申请好的Web端开发者Key，首次调用 load 时必填
          version: "2.0",
          // 指定要加载的 JSAPI 的版本，缺省时默认为 1.4.15
          Loca: {
            version: "2.0.0"
          },
          plugins: [
            "AMap.ControlBar",
            "AMap.ToolBar",
            "AMap.Scale",
            "AMap.HeatMap",
            "AMap.GeoJSON",
            "AMap.ImageLayer",
            "AMap.TileLayer"
          ]
        }).then((e) => {
          d.value = e;
          const a = new d.value.createDefaultLayer({
            visible: !0,
            // 是否可见
            opacity: 1,
            // 透明度
            zIndex: 0
            // 叠加层级
          });
          s.value = new e.Map("zerov-amap-3d", {
            rotateEnable: t.config.rotateEnable,
            // 是否开启地图旋转交互 鼠标右键 + 鼠标画圈移动 或 键盘Ctrl + 鼠标画圈移动
            pitchEnable: t.config.pitchEnable,
            // 是否开启地图倾斜交互 鼠标右键 + 鼠标上下移动或键盘Ctrl + 鼠标上下移动
            resizeEnable: t.config.resizeEnable,
            zoomEnable: t.config.zoomEnable,
            dragEnable: t.config.dragEnable,
            zoom: t.config.zoom,
            // 初始化地图层级
            viewMode: "3D",
            // 开启3D视图,默认为关闭
            zooms: t.config.zooms,
            // 地图显示的缩放级别范围
            center: t.config.center,
            // 初始地图中心经纬度
            mapStyle: t.config.mapStyle,
            features: t.config.features,
            pitch: t.config.pitch,
            // 0-83
            rotation: t.config.rotation,
            // 0-360
            wallColor: t.config.floors.wallColor,
            roofColor: t.config.floors.roofColor,
            skyColor: t.config.skyColor,
            layers: [a]
          }), c.value = new window.Loca.Container({
            map: s.value
          }), z.value = new d.value.Scale({
            visible: t.config.plugin.scale.visible,
            position: {
              left: t.config.plugin.scale.position.left + "px",
              bottom: t.config.plugin.scale.position.bottom + "px"
            }
          }), s.value.addControl(z.value), k.value = new e.ControlBar({
            visible: t.config.plugin.controlBar.visible,
            showControlButton: t.config.plugin.controlBar.showControlButton,
            position: {
              right: t.config.plugin.controlBar.position.right + "px",
              top: t.config.plugin.controlBar.position.top + "px"
            }
          }), s.value.addControl(k.value), b.value = new e.ToolBar({
            visible: t.config.plugin.toolBar.visible,
            position: {
              left: t.config.plugin.toolBar.position.left + "px",
              top: t.config.plugin.toolBar.position.top + "px"
            }
          }), s.value.addControl(b.value), W(e), s.value.on("complete", () => {
            setTimeout(() => {
              x.value = !0, y("amap3d-scene-success"), p.parseEvents(m.useEvents, "amap3d-scene-success", null), C.value = "";
            }, 666);
          }), s.value.on("zoomstart", () => {
            y("amap3d-scene-zoomstart"), p.parseEvents(m.useEvents, "amap3d-scene-zoomstart", null);
          }), s.value.on("zoomend", () => {
            y("amap3d-scene-zoomend"), p.parseEvents(m.useEvents, "amap3d-scene-zoomend", null);
          }), s.value.on("click", (r) => {
            y("amap3d-scene-mapclick", r.lnglat), p.parseEvents(
              m.useEvents,
              "amap3d-scene-mapclick",
              r.lnglat
            );
          }), s.value.on("dragstart", (r) => {
            y("amap3d-scene-dragstart", r.lnglat), p.parseEvents(
              m.useEvents,
              "amap3d-scene-dragstart",
              r.lnglat
            );
          }), s.value.on("dragend", (r) => {
            y("amap3d-scene-dragend", r.lnglat), p.parseEvents(
              m.useEvents,
              "amap3d-scene-dragend",
              r.lnglat
            );
          });
        }).catch((e) => {
          x.value = !1, C.value = "缺少必要的Key和密钥，请先在右侧配置面板中进行配置";
        });
      }, W = M((t) => {
        m.sources && m.sources.length > 0 ? o.value.widgets.forEach((a, r) => {
          ge.parse({
            sources: [m.sources[r]],
            callback: (l) => {
              try {
                a && a.type === "heatmap" && K(
                  window.Loca,
                  a,
                  f(l.data[0].data, "Point")
                ), a && a.type === "dotlayers" && Q(
                  window.Loca,
                  a,
                  f(l.data[0].data, "Point")
                ), a && a.type === "scatter" && X(
                  window.Loca,
                  a,
                  f(l.data[0].data, "Point")
                ), a && a.type === "labelsLayer" && Y(
                  window.Loca,
                  a,
                  f(l.data[0].data, "Point")
                ), a && a.type === "signagePoints" && _(
                  window.Loca,
                  a,
                  f(l.data[0].data, "Point")
                ), a && a.type === "pulseLinkLayer" && ee(
                  window.Loca,
                  a,
                  f(l.data[0].data, "LineString")
                );
              } catch {
              }
              o.value.widgets.filter((i) => i.type === "boundary").forEach((i) => {
                P(t, i);
              });
            }
          });
        }) : o.value.widgets.filter((a) => a.type === "boundary").forEach((a) => {
          P(t, a);
        });
        const e = s.value.getLayers();
        for (let a = 0; a < e.length; a++)
          (e[a].type === "sketchTileLayer" || e[a]._opts.type === "sketchImageLayer") && s.value.removeLayer(e[a]);
        o.value.widgets.filter((a) => a.type === "sketchTile").forEach((a) => {
          const r = U(a);
          r && s.value.addLayer(r);
        }), o.value.widgets.filter((a) => a.type === "sketchImage").forEach((a) => {
          const r = q(a);
          s.value.addLayer(r);
        });
      }, 200), V = (t) => {
        const a = t.slice(
          t.indexOf("(") + 1,
          t.lastIndexOf(")")
        ).split(",").map((l) => l.trim()), r = {};
        for (let l = 1; l < a.length; l++) {
          const i = a[l].split(" "), n = i[0], v = parseFloat(i[1]) / 100, oe = Math.round(v * 100) / 100;
          r[oe] = n;
        }
        return r;
      }, U = (t) => {
        try {
          return new d.value.TileLayer({
            bounds: new d.value.Bounds(
              t.bounds[0],
              t.bounds[1]
            ),
            getTileUrl: function(a, r, l) {
              try {
                return t.url.replace("{z}", l).replace("{x}", a).replace("{y}", r);
              } catch {
              }
            },
            type: "sketchTileLayer",
            tileSize: t.tileSize,
            opacity: t.opacity,
            zIndex: t.zIndex,
            zooms: t.zooms
          });
        } catch {
        }
        return null;
      }, q = (t) => {
        try {
          return new d.value.ImageLayer({
            bounds: new d.value.Bounds(
              t.bounds[0],
              // 左下  手绘图左下相对于地图的经纬度
              t.bounds[1]
              // 右上  手绘图右上相对于地图的经纬度
            ),
            type: "sketchImageLayer",
            opacity: t.opacity,
            url: t.url,
            zIndex: t.zIndex,
            zooms: t.zooms
            // 设置可见级别，[最小级别，最大级别]
          });
        } catch {
        }
        return null;
      }, K = (t, e, a) => {
        try {
          const r = new t.HeatMapLayer({
            zIndex: 10,
            opacity: e.opacity,
            visible: !0,
            zooms: [2, 22]
          }), l = new t.GeoJSONSource({
            data: a
          });
          r.setSource(l, {
            radius: e.style.radius,
            unit: e.style.unit,
            height: e.style.height,
            opacity: e.style.opacity,
            gradient: V(e.style.gradient),
            value: function(i, n) {
              return n.coordinates[2] || 0;
            },
            min: e.style.min,
            max: e.style.max,
            // 4.6
            heightBezier: [0, 0.53, 0.37, 0.98]
          }), c.value.add(r);
        } catch {
        }
      }, P = async (t, e) => {
        try {
          const a = await ye.get(e.geojson);
          if (a.status === 200) {
            const r = new t.GeoJSON({
              geoJSON: a.data,
              getPolygon: function(l, i) {
                const n = new t.Polygon({
                  path: i,
                  zIndex: e.zIndex,
                  fillColor: e.style.fillColor,
                  // 填充色
                  strokeOpacity: e.style.strokeOpacity,
                  // 轮廓线透明度
                  fillOpacity: e.style.fillOpacity,
                  // 填充色透明度
                  strokeColor: e.style.strokeColor,
                  // 线条颜色
                  strokeWeight: e.style.strokeWeight,
                  // 线条宽度
                  strokeStyle: e.style.strokeStyle
                  // 线条样式
                });
                return n.on("mouseover", () => {
                  n.setOptions({
                    fillOpacity: e.mouseover.fillOpacity,
                    fillColor: e.mouseover.fillColor,
                    strokeOpacity: e.mouseover.strokeOpacity,
                    strokeColor: e.mouseover.strokeColor,
                    strokeStyle: e.mouseover.strokeStyle,
                    strokeWeight: e.mouseover.strokeWeight
                  });
                }), n.on("mouseout", () => {
                  n.setOptions({
                    fillColor: e.style.fillColor,
                    // 填充色
                    strokeOpacity: e.style.strokeOpacity,
                    // 轮廓线透明度
                    fillOpacity: e.style.fillOpacity,
                    // 填充色透明度
                    strokeColor: e.style.strokeColor,
                    // 线条颜色
                    strokeWeight: e.style.strokeWeight,
                    // 线条宽度
                    strokeStyle: e.style.strokeStyle
                    // 线条样式
                  });
                }), n;
              }
            });
            s.value.add(r);
          }
        } catch {
        }
      }, Q = (t, e, a) => {
        try {
          const r = new t.GeoJSONSource({
            data: a
          }), l = new t.PointLayer({
            zIndex: e.zIndex,
            blend: e.blend,
            visible: e.visible,
            opacity: e.opacity
          }), i = {
            radius: e.style.radius,
            unit: e.style.unit,
            color: e.style.color,
            borderWidth: e.style.borderWidth,
            blurWidth: e.style.blurWidth,
            borderColor: e.style.borderColor
          };
          l.setSource(r), l.setStyle(i), c.value.add(l), l.addAnimate({
            key: e.animate.key,
            value: e.animate.value,
            duration: e.animate.duration,
            easing: e.animate.easing,
            transform: e.animate.transform,
            random: e.animate.random,
            delay: e.animate.delay,
            yoyo: e.animate.yoyo,
            repeat: e.animate.repeat
          });
        } catch {
        }
      }, X = (t, e, a) => {
        try {
          const r = new t.GeoJSONSource({
            data: a
          }), l = new t.ScatterLayer({
            loca: c.value,
            zIndex: e.zIndex,
            opacity: e.opacity,
            visible: e.visible,
            zooms: e.zooms
          });
          l.setSource(r), l.setStyle({
            unit: e.style.unit,
            size: e.style.size,
            borderWidth: e.style.borderWidth,
            texture: e.style.texture,
            duration: e.style.duration,
            animate: e.style.animate
          }), c.value.animate.start();
        } catch {
        }
      }, Y = (t, e, a) => {
        try {
          const r = new t.GeoJSONSource({
            data: a
          }), l = new t.LabelsLayer({
            eventSupport: !0,
            visible: e.visible,
            zooms: e.zooms,
            opacity: e.opacity,
            collision: e.collision,
            allowCollision: e.allowCollision,
            zIndex: e.zIndex
          });
          l.setSource(r), l.setStyle({
            icon: {
              image: e.icon.image,
              size: e.icon.size,
              clipOrigin: e.icon.clipOrigin,
              offset: e.icon.offset,
              anchor: e.icon.anchor
            },
            text: {
              // 每项配置都可使用回调函数来动态配置
              content: (i, n) => n.properties[e.text.content],
              zooms: e.text.zooms,
              offset: e.text.offset,
              direction: e.text.direction,
              style: {
                fontSize: e.text.style.fontSize,
                fillColor: e.text.style.fillColor,
                strokeColor: e.text.style.strokeColor,
                strokeWidth: e.text.style.strokeWidth,
                padding: e.text.style.padding,
                backgroundColor: e.text.style.backgroundColor,
                borderColor: e.text.style.borderColor,
                borderWidth: e.text.style.borderWidth,
                fold: e.text.style.fold,
                fontWeight: e.text.style.fontWeight
              }
            }
          }), l.on("complete", () => {
            const i = l.getLabelsLayer().getAllOverlays();
            for (const n of i)
              n.on("click", (v) => {
              }), n.on("mouseover", (v) => {
              }), n.on("mouseout", (v) => {
              });
          }), c.value.add(l);
        } catch {
        }
      }, _ = (t, e, a) => {
        try {
          const r = new t.GeoJSONSource({
            data: a
          }), l = new t.ZMarkerLayer({
            zIndex: e.signs.zIndex,
            visible: e.signs.visible,
            zooms: e.signs.zooms,
            opacity: e.signs.opacity,
            depth: !1
          });
          l.setSource(r), l.setStyle({
            content: (n, v) => `<div style="
                                width: ${e.signs.style.width}px;
                                height: ${e.signs.style.height + 148}px;
                            ">
                            <p style="
                                display: block;
                                height:${e.signs.style.height}px;
                                background-image:${e.signs.style.background};
                                border:${e.signs.style.borderWidth}px ${e.signs.style.borderStyle} ${e.signs.style.borderColor};
                                border-radius: ${e.signs.style.borderRadius}px;
                                line-height:${e.signs.style.lineHeight}px;
                                text-align:${e.signs.style.textAlign};
                                font-size:${e.signs.style.fontSize}px;
                                color:${e.signs.style.fillColor};
                                margin:0;
                            ">
                                ${v.properties.name}
                            </p>
                        </div>`,
            unit: e.signs.style.unit,
            rotation: e.signs.style.rotation,
            alwaysFront: e.signs.style.alwaysFront,
            size: [e.signs.style.width, e.signs.style.height + 148],
            altitude: e.signs.style.altitude
          }), c.value.add(l);
          const i = new t.ZMarkerLayer({
            zIndex: e.landmark.zIndex,
            visible: e.landmark.visible,
            zooms: e.landmark.zooms,
            opacity: e.landmark.opacity,
            depth: !1
          });
          i.setSource(r), i.setStyle({
            content: () => `<div style="
                            width: ${e.landmark.style.size[0]}px;
                            height: ${e.landmark.style.size[1]}px;
                            background: url(${e.landmark.style.image});
                            background-size:contain;
                        ">
                        </div>`,
            unit: e.landmark.style.unit,
            rotation: e.landmark.style.rotation,
            alwaysFront: e.landmark.style.alwaysFront,
            size: e.landmark.style.size,
            altitude: e.landmark.style.altitude
          }), i.addAnimate({
            key: "altitude",
            value: [0, 1],
            random: e.landmark.animate.random,
            duration: e.landmark.animate.duration,
            transform: e.landmark.animate.transform,
            delay: e.landmark.animate.delay,
            yoyo: e.landmark.animate.yoyo,
            repeat: e.landmark.animate.repeat
          }), c.value.add(i), c.value.animate.start();
        } catch {
        }
      }, ee = (t, e, a) => {
        const r = new t.PulseLinkLayer({
          zIndex: e.zIndex,
          opacity: e.opacity,
          visible: e.visible,
          zooms: e.zooms,
          depth: e.depth
        }), l = new t.GeoJSONSource({
          data: a
        });
        r.setSource(l), r.setStyle({
          unit: e.style.unit,
          dash: [4e4, 0, 4e4, 0],
          lineWidth: e.style.lineWidth,
          height: function(i, n) {
            return n.distance / 3 + e.style.height;
          },
          // altitude: 1000,
          smoothSteps: 30,
          speed: function() {
            return 1e5 + Math.random() * e.style.speed;
          },
          flowLength: e.style.flowLength,
          lineColors: e.style.lineColors,
          maxHeightScale: e.style.maxHeightScale,
          // 弧顶位置比例
          headColor: e.style.headColor,
          trailColor: e.style.trailColor
        }), s.value.on("click", (i) => {
          const n = r.queryFeature(i.pixel.toArray());
          n && (y("amap3d-scene-pulseLinkLayer", n), p.parseEvents(
            m.useEvents,
            "amap3d-scene-pulseLinkLayer",
            n
          ));
        }), c.value.add(r), c.value.animate.start();
      }, f = (t, e) => {
        const a = {
          type: "FeatureCollection",
          features: []
        };
        return t.forEach((r) => {
          const l = {
            type: "Feature",
            id: pe(),
            properties: {
              type: e === "Point" ? e : 0,
              ...r
            },
            geometry: {
              type: e,
              coordinates: r.value
            }
          };
          a.features.push(l);
        }), a;
      }, te = (t) => {
        s.value && (s.value.setFeatures(t.config.features), s.value.setPitch(t.config.pitch), s.value.setRotation(t.config.rotation), s.value.setStatus({
          dragEnable: t.config.dragEnable,
          zoomEnable: t.config.zoomEnable,
          rotateEnable: t.config.rotateEnable,
          pitchEnable: t.config.pitchEnable
        }), t.config.plugin.scale.visible ? z.value.show() : z.value.hide(), t.config.plugin.toolBar.visible ? b.value.show() : b.value.hide(), t.config.plugin.controlBar.visible ? k.value.show() : k.value.hide());
      }, ae = () => {
        s.value && (s.value.clearMap(), c.value.clear(), W(d.value));
      }, re = (t) => {
        s.value && s.value.setMapStyle(t.config.mapStyle);
      }, le = (t) => {
        s.value && s.value.setZoom(t.config.zoom, !1, 200);
      }, se = (t) => {
        s.value && s.value.setCenter(t.config.center, !1, 200);
      }, $ = () => {
        s.value && (s.value.clearMap(), s.value.destroy(), s.value = null, c.value && (c.value.clear(), c.value.destroy(), c.value = null));
      };
      return me(() => {
        setTimeout(() => {
          B(o.value);
        }, 0);
      }), de(() => $()), {
        initAMap3d: B,
        updateAMapStyle: re,
        updateAMapConfig: te,
        updateAMapComponents: ae,
        updateAMapZoom: le,
        updateAMapCenter: se,
        amap3d: s,
        loading: x,
        AMapPrototype: d,
        errorMessage: C
      };
    }, {
      initAMap3d: g,
      updateAMapStyle: H,
      updateAMapConfig: A,
      updateAMapComponents: Z,
      updateAMapZoom: j,
      updateAMapCenter: R,
      loading: I,
      errorMessage: O
    } = G();
    return u(
      () => o.value.config,
      () => {
        A(o.value);
      },
      { deep: !0 }
    ), u(
      () => o.value.config.zoom,
      () => {
        j(o.value);
      },
      { deep: !0 }
    ), u(
      () => o.value.config.center,
      () => {
        R(o.value);
      },
      { deep: !0 }
    ), u(
      () => o.value.config.floors,
      M(() => {
        g(o.value);
      }, 300),
      { deep: !0 }
    ), u(
      () => o.value.config.skyColor,
      M(() => {
        g(o.value);
      }, 300),
      { deep: !0 }
    ), u(
      () => o.value.widgets,
      () => {
        Z();
      },
      { deep: !0 }
    ), u(
      () => o.value.config.mapStyle,
      () => {
        H(o.value);
      },
      { deep: !0 }
    ), u(
      () => o.value.basic,
      () => {
        g(o.value);
      },
      { deep: !0 }
    ), u(
      () => m.sources,
      () => {
        g(o.value);
      },
      { deep: !0 }
    ), T({
      refresh: () => g(o.value),
      refreshView: () => A(o.value),
      refreshData: () => g(o.value)
    }), (s, c) => (L(), S("div", ve, [
      E("div", {
        class: ne(["amap-3d-wrap", { show: w(I) }])
      }, c[0] || (c[0] = [
        E("div", {
          id: "zerov-amap-3d",
          class: "zerov-amap-container"
        }, null, -1)
      ]), 2),
      w(I) ? D("", !0) : (L(), S("div", he, [
        w(O) !== "" ? (L(), S("i", ke)) : D("", !0),
        E("p", be, ce(w(O)), 1)
      ]))
    ]));
  }
});
export {
  wr as default
};
