import { defineComponent as F, computed as ue, watch as y, createElementBlock as E, openBlock as A, createElementVNode as I, createCommentVNode as T, normalizeClass as me, unref as x, toDisplayString as de, shallowRef as N, ref as p, onMounted as ye, onUnmounted as pe } from "vue";
import ge from "@amap/amap-jsapi-loader";
import ve from "axios";
import { nanoid as fe } from "nanoid";
import { debounce as O } 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/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 "./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 he } from "../../../../commons/plugins/datasource/index.mjs";
import { SHJParseEvent as f } from "../../../../commons/plugins/event/index.mjs";
import { upgradeAmap3d as ke } from "./version.mjs";
const be = { class: "relative w-full h-full" }, ze = {
  key: 0,
  class: "empty-wrap"
}, we = {
  key: 0,
  class: "iconfont shj-gaodeditu",
  style: { "font-size": "48px" }
}, xe = { class: "text-gray-500" }, Ce = F({ name: "ShjAmap3d" }), Lr = /* @__PURE__ */ F({
  ...Ce,
  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(u, { expose: H, emit: G }) {
    const s = ue(() => ke(u.option)), g = G, Z = () => {
      const l = N(), c = N(), C = p(!1), S = p(!1);
      let L = 0;
      const b = p(), z = p(), w = p(), d = p(), M = p(""), v = p(null), $ = (t) => {
        L += 1;
        const e = L;
        S.value = !1, J(), window._AMapSecurityConfig = {
          securityJsCode: t.basic.securityJsCode
        }, ge.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((a) => {
          if (S.value || e !== L) return;
          d.value = a;
          const o = new d.value.createDefaultLayer({
            visible: !0,
            // 是否可见
            opacity: 1,
            // 透明度
            zIndex: 0
            // 叠加层级
          });
          l.value = new a.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: [o]
          }), c.value = new window.Loca.Container({
            map: l.value
          }), w.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"
            }
          }), l.value.addControl(w.value), b.value = new a.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"
            }
          }), l.value.addControl(b.value), z.value = new a.ToolBar({
            visible: t.config.plugin.toolBar.visible,
            position: {
              left: t.config.plugin.toolBar.position.left + "px",
              top: t.config.plugin.toolBar.position.top + "px"
            }
          }), l.value.addControl(z.value), D(a), l.value.on("complete", () => {
            setTimeout(() => {
              C.value = !0, g("amap3d-scene-success"), f.parseEvents(u.useEvents, "amap3d-scene-success", null), M.value = "";
            }, 666);
          }), l.value.on("zoomstart", () => {
            g("amap3d-scene-zoomstart"), f.parseEvents(u.useEvents, "amap3d-scene-zoomstart", null);
          }), l.value.on("zoomend", () => {
            g("amap3d-scene-zoomend"), f.parseEvents(u.useEvents, "amap3d-scene-zoomend", null);
          }), l.value.on("click", (r) => {
            g("amap3d-scene-mapclick", r.lnglat), f.parseEvents(
              u.useEvents,
              "amap3d-scene-mapclick",
              r.lnglat
            );
          }), l.value.on("dragstart", (r) => {
            g("amap3d-scene-dragstart", r.lnglat), f.parseEvents(
              u.useEvents,
              "amap3d-scene-dragstart",
              r.lnglat
            );
          }), l.value.on("dragend", (r) => {
            g("amap3d-scene-dragend", r.lnglat), f.parseEvents(
              u.useEvents,
              "amap3d-scene-dragend",
              r.lnglat
            );
          });
        }).catch((a) => {
          C.value = !1, M.value = "缺少必要的Key和密钥，请先在右侧配置面板中进行配置";
        });
      }, D = O((t) => {
        u.sources && u.sources.length > 0 && s.value.widgets.forEach((a, o) => {
          a && a.type === "boundary" || he.parse({
            sources: [u.sources[o]],
            callback: (r) => {
              try {
                a && a.type === "heatmap" && X(
                  window.Loca,
                  a,
                  k(r.data[0].data, "Point")
                ), a && a.type === "dotlayers" && _(
                  window.Loca,
                  a,
                  k(r.data[0].data, "Point")
                ), a && a.type === "scatter" && ee(
                  window.Loca,
                  a,
                  k(r.data[0].data, "Point")
                ), a && a.type === "labelsLayer" && te(
                  window.Loca,
                  a,
                  k(r.data[0].data, "Point")
                ), a && a.type === "signagePoints" && ae(
                  window.Loca,
                  a,
                  k(r.data[0].data, "Point")
                ), a && a.type === "pulseLinkLayer" && re(
                  window.Loca,
                  a,
                  k(r.data[0].data, "LineString")
                );
              } catch {
              }
            }
          });
        }), s.value.widgets.filter((a) => a.type === "boundary").forEach((a) => {
          Y(t, a);
        });
        const e = l.value.getLayers();
        for (let a = 0; a < e.length; a++)
          (e[a].type === "sketchTileLayer" || e[a]._opts.type === "sketchImageLayer") && l.value.removeLayer(e[a]);
        s.value.widgets.filter((a) => a.type === "sketchTile").forEach((a) => {
          const o = K(a);
          o && l.value.addLayer(o);
        }), s.value.widgets.filter((a) => a.type === "sketchImage").forEach((a) => {
          const o = Q(a);
          l.value.addLayer(o);
        });
      }, 200), q = (t) => {
        const a = t.slice(
          t.indexOf("(") + 1,
          t.lastIndexOf(")")
        ).split(",").map((r) => r.trim()), o = {};
        for (let r = 1; r < a.length; r++) {
          const i = a[r].split(" "), n = i[0], m = parseFloat(i[1]) / 100, ce = Math.round(m * 100) / 100;
          o[ce] = n;
        }
        return o;
      }, K = (t) => {
        try {
          return new d.value.TileLayer({
            bounds: new d.value.Bounds(
              t.bounds[0],
              t.bounds[1]
            ),
            getTileUrl: function(a, o, r) {
              try {
                return t.url.replace("{z}", r).replace("{x}", a).replace("{y}", o);
              } 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;
      }, X = (t, e, a) => {
        try {
          const o = new t.HeatMapLayer({
            zIndex: 10,
            opacity: e.opacity,
            visible: !0,
            zooms: [2, 22]
          }), r = new t.GeoJSONSource({
            data: a
          });
          o.setSource(r, {
            radius: e.style.radius,
            unit: e.style.unit,
            height: e.style.height,
            opacity: e.style.opacity,
            gradient: q(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(o);
        } catch {
        }
      }, Y = async (t, e) => {
        try {
          const a = await ve.get(e.geojson);
          if (a.status === 200) {
            const o = new t.GeoJSON({
              geoJSON: a.data,
              getPolygon: function(r, 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;
              }
            });
            l.value.add(o);
          }
        } catch {
        }
      }, _ = (t, e, a) => {
        try {
          const o = new t.GeoJSONSource({
            data: a
          }), r = 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
          };
          r.setSource(o), r.setStyle(i), c.value.add(r), r.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 {
        }
      }, ee = (t, e, a) => {
        try {
          const o = new t.GeoJSONSource({
            data: a
          }), r = new t.ScatterLayer({
            loca: c.value,
            zIndex: e.zIndex,
            opacity: e.opacity,
            visible: e.visible,
            zooms: e.zooms
          });
          r.setSource(o), r.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 {
        }
      }, te = (t, e, a) => {
        try {
          const o = new t.GeoJSONSource({
            data: a
          }), r = new t.LabelsLayer({
            eventSupport: !0,
            visible: e.visible,
            zooms: e.zooms,
            opacity: e.opacity,
            collision: e.collision,
            allowCollision: e.allowCollision,
            zIndex: e.zIndex
          });
          r.setSource(o), r.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
              }
            }
          }), r.on("complete", () => {
            const i = r.getLabelsLayer().getAllOverlays();
            for (const n of i)
              n.on("click", (m) => {
              }), n.on("mouseover", (m) => {
              }), n.on("mouseout", (m) => {
              });
          }), c.value.add(r);
        } catch {
        }
      }, ae = (t, e, a) => {
        try {
          const o = new t.GeoJSONSource({
            data: a
          }), r = new t.ZMarkerLayer({
            zIndex: e.signs.zIndex,
            visible: e.signs.visible,
            zooms: e.signs.zooms,
            opacity: e.signs.opacity,
            depth: !1
          });
          r.setSource(o), r.setStyle({
            content: (n, m) => `<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;
                            ">
                                ${m.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(r);
          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(o), 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 {
        }
      }, re = (t, e, a) => {
        const o = new t.PulseLinkLayer({
          zIndex: e.zIndex,
          opacity: e.opacity,
          visible: e.visible,
          zooms: e.zooms,
          depth: e.depth
        }), r = new t.GeoJSONSource({
          data: a
        });
        if (o.setSource(r), o.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
        }), l.value && v.value && (l.value.off("click", v.value), v.value = null), l.value) {
          const i = (n) => {
            const m = o.queryFeature(n.pixel.toArray());
            m && (g("amap3d-scene-pulseLinkLayer", m), f.parseEvents(
              u.useEvents,
              "amap3d-scene-pulseLinkLayer",
              m
            ));
          };
          l.value.on("click", i), v.value = i;
        }
        c.value.add(o), c.value.animate.start();
      }, k = (t, e) => {
        const a = {
          type: "FeatureCollection",
          features: []
        };
        return t.forEach((o) => {
          const r = {
            type: "Feature",
            id: fe(),
            properties: {
              type: e === "Point" ? e : 0,
              ...o
            },
            geometry: {
              type: e,
              coordinates: o.value
            }
          };
          a.features.push(r);
        }), a;
      }, le = (t) => {
        l.value && (l.value.setFeatures(t.config.features), l.value.setPitch(t.config.pitch), l.value.setRotation(t.config.rotation), l.value.setStatus({
          dragEnable: t.config.dragEnable,
          zoomEnable: t.config.zoomEnable,
          rotateEnable: t.config.rotateEnable,
          pitchEnable: t.config.pitchEnable
        }), t.config.plugin.scale.visible ? w.value.show() : w.value.hide(), t.config.plugin.toolBar.visible ? z.value.show() : z.value.hide(), t.config.plugin.controlBar.visible ? b.value.show() : b.value.hide());
      }, oe = () => {
        l.value && (l.value.clearMap(), c.value.clear(), D(d.value));
      }, se = (t) => {
        l.value && l.value.setMapStyle(t.config.mapStyle);
      }, ie = (t) => {
        l.value && l.value.setZoom(t.config.zoom, !1, 200);
      }, ne = (t) => {
        l.value && l.value.setCenter(t.config.center, !1, 200);
      }, J = () => {
        l.value && v.value && (l.value.off("click", v.value), v.value = null), l.value && (l.value.clearMap(), l.value.destroy(), l.value = null), c.value && (c.value.clear(), c.value.destroy(), c.value = null);
      };
      return ye(() => {
        setTimeout(() => {
          $(s.value);
        }, 0);
      }), pe(() => {
        S.value = !0, J();
      }), {
        initAMap3d: $,
        updateAMapStyle: se,
        updateAMapConfig: le,
        updateAMapComponents: oe,
        updateAMapZoom: ie,
        updateAMapCenter: ne,
        amap3d: l,
        loading: C,
        AMapPrototype: d,
        errorMessage: M
      };
    }, {
      initAMap3d: h,
      updateAMapStyle: j,
      updateAMapConfig: B,
      updateAMapComponents: R,
      updateAMapZoom: V,
      updateAMapCenter: U,
      loading: W,
      errorMessage: P
    } = Z();
    return y(
      () => s.value.config,
      () => {
        B(s.value);
      },
      { deep: !0 }
    ), y(
      () => s.value.config.zoom,
      () => {
        V(s.value);
      },
      { deep: !0 }
    ), y(
      () => s.value.config.center,
      () => {
        U(s.value);
      },
      { deep: !0 }
    ), y(
      () => s.value.config.floors,
      O(() => {
        h(s.value);
      }, 300),
      { deep: !0 }
    ), y(
      () => s.value.config.skyColor,
      O(() => {
        h(s.value);
      }, 300),
      { deep: !0 }
    ), y(
      () => s.value.widgets,
      () => {
        R();
      },
      { deep: !0 }
    ), y(
      () => s.value.config.mapStyle,
      () => {
        j(s.value);
      },
      { deep: !0 }
    ), y(
      () => s.value.basic,
      () => {
        h(s.value);
      },
      { deep: !0 }
    ), y(
      () => u.sources,
      () => {
        h(s.value);
      },
      { deep: !0 }
    ), H({
      refresh: () => h(s.value),
      refreshView: () => B(s.value),
      refreshData: () => h(s.value)
    }), (l, c) => (A(), E("div", be, [
      I("div", {
        class: me(["amap-3d-wrap", { show: x(W) }])
      }, c[0] || (c[0] = [
        I("div", {
          id: "zerov-amap-3d",
          class: "zerov-amap-container"
        }, null, -1)
      ]), 2),
      x(W) ? T("", !0) : (A(), E("div", ze, [
        x(P) !== "" ? (A(), E("i", we)) : T("", !0),
        I("p", xe, de(x(P)), 1)
      ]))
    ]));
  }
});
export {
  Lr as default
};
