import { getCurrentInstance as Oe, inject as E, ref as Fe, computed as x, unref as q, render as Me, createVNode as We, watch as H, onMounted as ce, onUnmounted as ve, shallowRef as Ue, shallowReactive as De, reactive as ye, toRefs as we, nextTick as je, defineComponent as Je, useAttrs as Qe, resolveComponent as He, openBlock as Ke, createBlock as Xe, mergeProps as Ye, h as le } from "vue";
import { j as Ze, F as Ne, p as pe, l as ze, a as et, c as tt } from "./vendor-D4icwOYu.js";
import { zondy as J, LayerType as S, LayerEventType as P, SubLayerType as $, TokenAttachType as rt, IGSFeatureLayer as at, ElevationMode as st, ElevationInfo as nt, SketchEditorEventType as de, SketchEditorToolEventType as xe, SketchEditorState as me, SketchDataType as K } from "@mapgis/webclient-common";
import { i as Ce, a as Ve, u as it, _ as ot } from "./utils-B4smQbM-.js";
import { Checkbox as lt, Divider as ut } from "ant-design-vue";
const he = "mapgis", ct = "is-", X = (s, e, r, t, a) => {
  let n = `${s}-${e}`;
  return r && (n += `-${r}`), t && (n += `__${t}`), a && (n += `--${a}`), n;
}, yt = Symbol("namespaceContextKey"), pt = (s) => {
  const e = Oe() ? E(yt, Fe(he)) : Fe(he);
  return x(() => q(e) || he);
}, dt = (s, e) => {
  const r = pt();
  return {
    namespace: r,
    b: (y = "") => X(r.value, s, y, "", ""),
    e: (y) => y ? X(r.value, s, "", y, "") : "",
    m: (y) => y ? X(r.value, s, "", "", y) : "",
    be: (y, d) => y && d ? X(r.value, s, y, d, "") : "",
    em: (y, d) => y && d ? X(r.value, s, "", y, d) : "",
    bm: (y, d) => y && d ? X(r.value, s, y, "", d) : "",
    bem: (y, d, h) => y && d && h ? X(r.value, s, y, d, h) : "",
    is: (y, ...d) => {
      const h = d.length >= 1 ? d[0] : !0;
      return y && h ? `${ct}${y}` : "";
    },
    // css
    cssVar: (y) => {
      const d = {};
      for (const h in y)
        y[h] && (d[`--${r.value}-${h}`] = y[h]);
      return d;
    },
    cssVarName: (y) => `--${r.value}-${y}`,
    cssVarBlock: (y) => {
      const d = {};
      for (const h in y)
        y[h] && (d[`--${r.value}-${s}-${h}`] = y[h]);
      return d;
    },
    cssVarBlockName: (y) => `--${r.value}-${s}-${y}`
  };
}, { LayerType: Ge, SubLayerType: mt } = J.enum, ht = {
  /**
   * @description 选中的图层id，单选为string类型，多选为数组类型，默认为空数组
   */
  value: {
    type: [Array, String],
    default: () => []
  },
  /**
   * @description 要选择的图层类型，默认为M3D模型缓存和Cesium 3D Tiles模型缓存图层
   */
  layerTypes: {
    type: Array,
    default: [Ge.M3DModelCache, Ge.cesium3DTilesModelCache]
  },
  /**
   * @description 要选择的子图层类型，默认为M3D模型缓存
   */
  sublayerTypes: {
    type: Array,
    default: [mt.IGSSceneSubM3DCache]
  },
  /**
   * @description 对图层进行的额外筛选函数，支持自定义筛选，比如某些图层只支持M3D 2.0，默认不进行筛选
   */
  filterLayerCallBack: {
    type: Function,
    default: () => !0
  },
  /**
   * @description 是否是多选，默认是多选
   */
  multiple: {
    type: Boolean,
    default: !0
  },
  /**
   * @description 选择器高度，单位像素
   */
  height: {
    type: Number,
    default: 300
  },
  /**
   * @description 最多显示多少个标签
   */
  maxTagCount: {
    type: Number,
    default: 2
  },
  /**
   * @description 最大显示的标签文本长度
   */
  maxTagTextLength: {
    type: Number,
    default: 6
  },
  /**
   * @description 下拉菜单是否和选择器同宽
   */
  dropdownMatchSelectWidth: {
    type: Boolean,
    default: !1
  },
  /**
   * @description 替换 treeNode 中 label,value,children 字段为 treeData 中对应的字段
   */
  fieldNames: {
    type: Object,
    default: {
      label: "title",
      value: "key",
      children: "sublayers"
    }
  },
  /**
   * @description 父图层和子图层是否严格关联，true: 过滤后必须要有子图层，父图层才显示。false: 过滤后就算没有子图层，如果传了父图层类型，也显示
   * @type Boolean
   * @default true
   */
  checkStrictly: {
    type: Boolean,
    default: !0
  }
}, ft = {
  "update:value": (s) => Ce(s) || Ve(s),
  change: (s, e, r) => Ce(s) || Ve(s)
};
var B = /* @__PURE__ */ ((s) => (s.MapboxGL = "mapboxgl", s.Cesium = "cesium", s.Leaflet = "leaflet", s))(B || {}), ue = /* @__PURE__ */ ((s) => (s.MapServer = "MapServer", s.TileServer = "TileServer", s.VectorTileServer = "VectorTileServer", s.ImageServer = "ImageServer", s.FeatureServer = "FeatureServer", s.WMSServer = "WMSServer", s.WMTSServer = "WMTSServer", s.WFSServer = "WFSServer", s.WCSServer = "WCSServer", s.ArcGISMapServer = "arcgis/MapServer", s.ArcGISVectorTileServer = "arcgis/VectorTileServer", s.SceneServer = "SceneServer", s.M3dServer = "M3dServer", s._3DTilesServer = "3DTilesServer", s.TerrainServer = "TerrainServer", s))(ue || {});
function St(s) {
  return s === S.IGSScene;
}
function bt() {
  const s = Object.values(ue), e = [], r = [];
  s.forEach((n) => {
    if (n.includes("/")) {
      const i = n.split("/").pop();
      e.includes(i) || e.push(i);
    } else
      r.push(n);
  }), r.sort((n, i) => i.length - n.length), e.sort((n, i) => i.length - n.length);
  const t = [];
  if (e.length > 0) {
    const n = e.map((i) => ke(i)).join("|");
    t.push(`arcgis/(?:${n})`);
  }
  if (r.length > 0) {
    const n = r.map((i) => ke(i)).join("|");
    t.push(n);
  }
  const a = t.join("|");
  return new RegExp(`/(?:${a})(?:/|$)`, "i");
}
function ke(s) {
  return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
}
const gt = bt(), fe = (s) => {
  s = s || {};
  const e = s.map, { layerId: r, sublayerId: t } = s;
  let a = null;
  if (t) {
    const n = e.findLayerById(r);
    n && (a = n.findSublayerById(t));
  } else
    a = e.findLayerById(r);
  return a;
}, Be = (s) => {
  s = s || {};
  const e = s.map, { layerId: r, sublayerId: t, callback: a } = s;
  let n = fe(s);
  if (n)
    a(n);
  else if (t) {
    const i = fe({ layerId: r, map: e });
    if (i)
      if (i.loaded)
        a(n);
      else {
        const l = () => {
          n = fe(s), i.off(P.layerViewCreated, l), a(n);
        };
        i.on(P.layerViewCreated, l);
      }
    else
      a(n);
  } else
    a(n);
  return n;
}, Re = (s, e, r, t) => {
  let a;
  if (s) {
    const n = ge(s, r);
    if (n ? a = e.getInnerLayer(s.layer.id, s.id) : a = e.getInnerLayer(s.id), a)
      t({
        innerLayer: a,
        layer: s
      });
    else {
      const i = (l) => {
        n ? l.layerView.layer.id === s.layer.id && (a = e.getInnerLayer(s.layer.id, s.id), e.off(P.layerViewCreated, i), t({
          innerLayer: a,
          layer: s
        })) : l.layerView.layer.id === s.id && (e.off(P.layerViewCreated, i), t({
          innerLayer: l.layerView.innerLayer,
          layer: s
        }));
      };
      e.on(P.layerViewCreated, i);
    }
  }
}, qe = (s) => {
  const { layerId: e, sublayerId: r, callback: t, view: a, layer: n } = s, { map: i } = a, l = s.zondy;
  let o;
  n ? (o = n, Re(o, a, l, t)) : Be({
    layerId: e,
    sublayerId: r,
    map: i,
    callback: (c) => {
      o = c, Re(o, a, l, t);
    }
  });
}, ge = (s, e) => (e = e, s instanceof e.layer.SubLayer), vt = (s) => {
  const { layer: e, layerId: r, sublayerId: t, view: a, zondy: n, map: i, callback: l } = s;
  e ? ge(e, n) || e.loaded ? l(e) : qe({
    layer: e,
    view: a,
    zondy: n,
    callback: (o) => {
      l(o.layer);
    }
  }) : Be({
    layerId: r,
    sublayerId: t,
    map: i,
    callback: (o) => {
      o ? ge(o, n) || o.loaded ? l(o) : qe({
        layerId: r,
        sublayerId: t,
        view: a,
        zondy: n,
        callback: (c) => {
          l(c.layer);
        }
      }) : l(o);
    }
  });
}, Qt = (s) => {
  switch (s) {
    case S.IGSTile:
      return "IGS瓦片图层";
    case S.ArcGISTile:
      return "ArcGIS瓦片图层";
    case S.webTile:
      return "网络瓦片图层";
    case S.IGSImageTile:
      return "IGS影像服务瓦片图层";
    case S.IGSMapImage:
      return "IGS地图图片图层";
    case S.ArcGISMapImage:
      return "ArcGIS地图图片图层";
    case S.IGSVectorTile:
      return "IGS矢量瓦片图层";
    case S.ArcGISVectorTile:
      return "ArcGIS矢量瓦片图层";
    case S.IGSImage:
      return "IGS影像服务图层";
    case S.WMS:
      return "WMS图层";
    case S.WMTS:
      return "WMTS图层";
    case S.WFS:
      return "WFS图层";
    case S.IGSFeature:
      return "IGS要素图层";
    case S.graphics:
      return "几何图层";
    case S.GeoJSON:
      return "GeoJSON图层";
    case S.IGSScene:
      return "IGS场景图层";
    case S.M3DModelCache:
      return "M3D模型缓存图层";
    case S.terrain:
      return "地形图层";
    case S.video:
      return "视频图层";
    case S.ISScene:
      return "iServer场景图层";
    case S.S3MModelCache:
      return "S3M模型缓存图层";
    case S.ECharts:
      return "ECharts图层";
    case S.MapV:
      return "MapV图层";
    case $.ArcGISMapImageSub:
      return "ArcGIS地图图片子图层";
    case $.ArcGISVectorTileSub:
      return "ArcGIS矢量瓦片子图层";
    case $.IGSMapImageSub:
      return "IGS地图图片子图层";
    case $.IGSSceneSub:
      return "IGS场景子图层";
    case $.IGSSceneSubLabel:
      return "IGS场景注记子图层";
    case $.IGSSceneSubM3DCache:
      return "IGS场景模型缓存子图层";
    case $.IGSSceneSubMapRef:
      return "IGS场景覆盖物子图层";
    case $.IGSSceneSubTerrian:
      return "IGS场景地形子图层";
    case $.IGSVectorTileSub:
      return "IGS矢量瓦片子图层";
    case $.ISSceneSubS3MCache:
      return "iServer模型缓存子图层";
    case $.WMSSub:
      return "WMS子图层";
    case $.WMTSSub:
      return "WMTS子图层";
    case S.unknown:
    default:
      return "自定义图层";
  }
}, wt = (s) => {
  if (!s) return;
  s.layers.filter((r) => r.type === S.terrain).forEach((r) => {
    s.remove(r);
  });
};
function It(s) {
  if (!s)
    return "";
  const e = Tt(s);
  if (!e)
    return "";
  const r = e.match(gt);
  if (!r)
    return "";
  const t = r[0].replace(/^\/|\/$/g, "");
  return t.startsWith("arcgis/") ? Object.values(ue).find((n) => n === t) || "" : Object.values(ue).find((n) => n === t && !n.includes("/")) || "";
}
function Tt(s) {
  try {
    return new URL(s).pathname;
  } catch {
    return s.startsWith("http://") || s.startsWith("https://") ? "" : s;
  }
}
const Ht = async (s, e, r, t, a = !0) => {
  let n = null;
  const { tiledMap: i, tiledImage: l, tokenKey: o, tokenValue: c, tokenAttachType: m, headers: b } = t;
  let { type: u } = t;
  switch (u || (u = It(t.url)), o && c && !b && m === rt.header && (delete t.tokenAttachType, delete t.tokenKey, delete t.tokenValue, t.headers = { [o]: c }), u) {
    case S.IGSMapImage:
      i ? n = new s.layer.IGSTileLayer({ ...t }) : n = new s.layer.IGSMapImageLayer({ ...t });
      break;
    case S.IGSTile:
      n = new s.layer.IGSTileLayer({ ...t });
      break;
    case S.IGSVectorTile:
      n = new s.layer.IGSVectorTileLayer({ ...t });
      break;
    case S.IGSImage:
      l ? n = new s.layer.IGSImageryTileLayer({ ...t }) : n = new s.layer.IGSImageryLayer({ ...t });
      break;
    case S.IGSImageTile:
      n = new s.layer.IGSImageryTileLayer({ ...t });
      break;
    case S.IGSFeature:
      n = new s.layer.IGSFeatureLayer({ ...t });
      break;
    case S.WMS:
      n = new s.layer.WMSLayer({ ...t });
      break;
    case S.WMTS:
      n = new s.layer.WMTSLayer({ ...t });
      break;
    case S.WFS:
      n = new s.layer.WFSLayer({ ...t });
      break;
    case S.ArcGISMapImage:
      i ? n = new s.layer.ArcGISTileLayer({ ...t }) : n = new s.layer.ArcGISMapImageLayer({ ...t });
      break;
    case S.ArcGISTile:
      n = new s.layer.ArcGISTileLayer({ ...t });
      break;
    case S.ArcGISVectorTile:
      n = new s.layer.ArcGISVectorTileLayer({ ...t });
      break;
    case S.GeoJSON:
      n = new s.layer.GeoJSONLayer({ ...t });
      break;
    case S.IGSScene:
      n = new s.layer.IGSSceneLayer({ ...t });
      break;
    case S.M3DModelCache:
      n = new s.layer.M3DModelCacheLayer({
        ...t
      });
      break;
    case S.cesium3DTilesModelCache:
      n = new s.layer.Cesium3DTilesCacheLayer({ ...t });
      break;
    case S.terrain:
      wt(r), n = new s.layer.TerrainCacheLayer({ ...t });
      break;
  }
  return n && (r.add(n), a && n.once(P.layerViewCreated, () => {
    e.goTo({
      layer: n
    });
  })), n;
}, Y = "rgba(255, 255, 255, 0)", Kt = "rgba(255, 0, 0, 1)", Xt = 2, Se = (s, e) => {
  const { Symbol: r } = e.symbol, { SymbolType: t } = e.enum;
  s instanceof e.symbol.Symbol || (s = r.fromJSON(s));
  const a = s.toJSON();
  switch (s.type) {
    case t.simpleFill:
      a.color = _(a.color), a.outline && (a.outline = { ...a.outline, color: _(a.outline.color) });
      break;
    case t.simpleLine:
      a.color = _(a.color);
      break;
    case t.simpleMarker:
      a.color = _(a.color), a.outline && (a.outline = { ...a.outline, color: _(a.outline.color) });
      break;
    case t.mapgisText:
      a.color = _(a.color), a.borderLineColor = a.borderLineColor ? _(a.borderLineColor) : Y, a.backgroundColor = a.backgroundColor ? _(a.backgroundColor) : Y, a.haloColor = a.haloColor ? _(a.haloColor) : Y, a.textShadowColor = a.textShadowColor ? _(a.textShadowColor) : Y;
      break;
    case t.text:
      a.color = _(a.color), a.borderLineColor = a.borderLineColor ? _(a.borderLineColor) : Y, a.backgroundColor = a.backgroundColor ? _(a.backgroundColor) : Y, a.haloColor = a.haloColor ? _(a.haloColor) : Y;
      break;
    case t.pictureMarker:
      a.color = _(a.color);
      break;
    case t.pictureFill:
      a.outline && (a.outline = { ...a.outline, color: _(a.outline.color) });
      break;
  }
  return a;
}, Yt = () => [
  {
    label: "圆形",
    value: "circle"
  },
  {
    label: "正方形",
    value: "square"
  },
  {
    label: "菱形",
    value: "diamond"
  },
  {
    label: "三角形",
    value: "triangle"
  },
  {
    label: "十字",
    value: "cross"
  },
  {
    label: "X形",
    value: "x"
  }
], Zt = () => [
  {
    label: "实线",
    value: "solid"
  },
  {
    label: "短点线",
    value: "short-dot"
  },
  {
    label: "点线",
    value: "dot"
  },
  {
    label: "短虚线",
    value: "short-dash"
  },
  {
    label: "虚线",
    value: "dash"
  },
  {
    label: "长虚线",
    value: "long-dash"
  }
], zt = () => [
  {
    label: "无填充",
    value: "none"
  },
  {
    label: "实心填充",
    value: "solid"
  },
  {
    label: "正斜线",
    value: "forward-diagonal"
  },
  {
    label: "反斜线",
    value: "backward-diagonal"
  },
  {
    label: "十字交叉",
    value: "cross"
  },
  {
    label: "斜十字",
    value: "diagonal-cross"
  },
  {
    label: "水平线",
    value: "horizontal"
  },
  {
    label: "垂直线",
    value: "vertical"
  }
], _ = (s) => "rgba(" + s.red + "," + s.green + "," + s.blue + "," + s.alpha + ")";
var Lt = /* @__PURE__ */ ((s) => (s.Client = "client", s.Server = "server", s))(Lt || {}), M = /* @__PURE__ */ ((s) => (s.point = "point", s.line = "line", s.polygon = "polygon", s[s.null = null] = "null", s))(M || {});
class se {
  constructor(e) {
    this.layer = e;
  }
  /**
   * 获取几何类型（point/line/polygon）
   */
  getGeometryType() {
    throw new Error("Method 'getGeometryType()' must be implemented in a subclass.");
  }
  /**
   * 获取字段列表
   */
  getFields() {
    throw new Error("Method 'getFields()' must be implemented in a subclass");
  }
  /**
   * 获取某字段最大最小值
   * @param field 指定字段
   */
  getMinMaxValue(e) {
    throw new Error(`Method 'getMinMaxValue()' must be implemented in a subclass. args: field = ${e}`);
  }
  /**
   * 获取某个字段的所有唯一值
   * @param field 指定字段
   * @param options 查询条件
   */
  getUniqueValues(e, r) {
    throw new Error(
      `Method 'queryFeatures()' must be implemented in a subclass. args: field = ${e}; options = ${r}`
    );
  }
  /**
   * 获取图层要素总数
   */
  queryFeaturesCount(e) {
    throw new Error(`Method 'queryFeaturesCount()' must be implemented in a subclass. args: options = ${e}`);
  }
  /**
   * 要素查询
   * @param options 查询选项
   */
  queryFeatures(e) {
    throw new Error(`Method 'queryFeatures()' must be implemented in a subclass. args: options = ${e}`);
  }
  /**
   * 导出属性表
   * @param queryOptions 查询选项
   * @param exportOptions 导出选项
   */
  exportAttributes(e, r) {
    throw new Error(
      `Method 'exportAttributes()' must be implemented in a subclass. args: queryOptions = ${e}; exportOptions = ${r}`
    );
  }
  /**
   * 获取图层统计信息
   */
  queryStatistics(e) {
    throw new Error(`Method 'queryStatistics()' must be implemented in a subclass. args: options = ${e}`);
  }
  /**
   * 获取栅格值(影像图层)
   * @param options 查询选项
   */
  getRasterValue(e) {
    throw new Error(`Method 'getRasterValue()' must be implemented in a subclass. args: options = ${e}`);
  }
}
class $e {
  constructor(e) {
    this.layer = e;
  }
  /**
   * 导出属性表
   * @param queryOptions 查询选项
   * @param exportOptions 导出选项
   */
  exportAttributes(e, r) {
    throw new Error(
      `Method 'exportAttributes()' must be implemented in a subclass. args: queryOptions = ${e}; exportOptions = ${r}`
    );
  }
  /**
   * 多图层要素查询
   * @param queryOptions 查询选项
   */
  queryFeaturesInLayers(e) {
    throw new Error(
      `Method 'queryFeaturesInLayers()' must be implemented in a subclass. args: queryOptions = ${e}`
    );
  }
}
async function Ie(s, e, r) {
  const { f: t } = r;
  let { fileName: a } = r;
  a || (a = `${s.title}_attributes_${Date.now()}.${t}`);
  const n = e.map((l) => l.attributes);
  let i;
  if (t === "json")
    i = new Blob([JSON.stringify({ data: n })]);
  else {
    const l = Ze.parse(n);
    i = new Blob([`\uFEFF${l}`], {
      type: "text/plain;charset=utf-8;"
    });
  }
  await Ne.saveAs(i, a);
}
const { GeometryType: ee } = J.enum;
class Ee extends se {
  constructor(e) {
    super(e), this.layer = e;
  }
  async getGeometryType() {
    const e = this._convertGeometryType(this.layer.geometryType);
    if (e === M.null) {
      const r = await this.layer.queryFeatures();
      if (r != null && r.geometryType)
        return this._convertGeometryType(r == null ? void 0 : r.geometryType);
    }
    return e;
  }
  async getFields() {
    const e = await this.layer.queryFeatures({
      resultRecordCount: 1
    });
    return e == null ? void 0 : e.fields;
  }
  async getMinMaxValue(e) {
    const r = await this.layer.queryFeatures({
      outStatistics: [{ statisticType: "FUNCTION_MIN", onStatisticField: e, outStatisticFieldName: e }]
    }), t = await this.layer.queryFeatures({
      outStatistics: [{ statisticType: "FUNCTION_MAX", onStatisticField: e, outStatisticFieldName: e }]
    }), a = Number(r.features[0].attributes[e]), n = Number(t.features[0].attributes[e]);
    return {
      min: isNaN(a) ? 0 : a,
      max: isNaN(n) ? 0 : n
    };
  }
  async getUniqueValues(e, r) {
    const t = r ? this._convertQueryOptions(r) : null, a = {
      returnStyle: !1,
      outStatistics: [
        { statisticType: "FUNCTION_COUNT", onStatisticField: e, outStatisticFieldName: e + "数量统计" }
      ],
      groupByFieldsForStatistics: e
    }, i = (await this.layer.queryFeatures(
      t ? { ...a, ...t } : a
    )).features.map((l) => l.attributes[e]);
    return [...new Set(i)];
  }
  async queryFeaturesCount(e) {
    return await this.layer.queryFeaturesCount(this._convertQueryOptions(e));
  }
  async queryFeatures(e) {
    return (await this.layer.queryFeatures(this._convertQueryOptions(e))).features;
  }
  async queryStatistics(e) {
    const { outStatistics: r, groupFields: t } = e, a = {
      outStatistics: r,
      groupByFieldsForStatistics: t
    };
    return (await this.layer.queryFeatures(a)).features;
  }
  async exportAttributes(e, r) {
    const t = await this.layer.queryFeatures(this._convertQueryOptions(e));
    await Ie(this.layer, t.features, r);
  }
  /**
   * 转换查询选项
   *
   * @param options 查询选项
   * @returns 转换后的查询选项
   */
  _convertQueryOptions(e) {
    const { geometry: r, distance: t, attributeFilter: a, fieldList: n, featureIds: i, returnCountOnly: l, pageNumber: o, pageSize: c } = e;
    return {
      geometry: r,
      distance: t,
      where: a,
      outfields: n ? n.toString() : void 0,
      objectIds: i ? i.toString() : void 0,
      returnCountOnly: l,
      resultOffset: o && c && (o - 1) * c,
      resultRecordCount: c
    };
  }
  /**
   * 几何类型
   *
   * @param geometryType 原始几何类型
   * @returns 转换后的几何类型
   */
  _convertGeometryType(e) {
    switch (e) {
      case ee.point:
      case ee.multiPoint:
        return M.point;
      case ee.lineString:
      case ee.multiLineString:
        return M.line;
      case ee.polygon:
      case ee.multiPolygon:
        return M.polygon;
    }
    return M.null;
  }
}
class Ft extends se {
  constructor(e) {
    super(e), this.layer = e, this.parentLayer = e.layer, this.parentLayer._igsVersion === "1.0" && this._createIGSFeatureLayerService();
  }
  async getGeometryType() {
    switch (this.layer.geomType) {
      case "Pnt":
        return M.point;
      case "Lin":
        return M.line;
      case "Reg":
        return M.polygon;
    }
    return M.null;
  }
  async getFields() {
    return this.igsFeatureLayerServiceV1 ? await this.igsFeatureLayerServiceV1.getFields() : this.layer.fields.map((e) => ({
      name: e.name,
      alias: e.alias,
      type: e.type
    }));
  }
  async getMinMaxValue(e) {
    var o, c;
    if (this.igsFeatureLayerServiceV1)
      return await this.igsFeatureLayerServiceV1.getMinMaxValue(e);
    const r = {
      layerId: this.layer.id,
      outStatistics: [{ statisticType: "FUNCTION_MIN", onStatisticField: e, outStatisticFieldName: e }]
    }, t = {
      layerId: this.layer.id,
      outStatistics: [{ statisticType: "FUNCTION_MAX", onStatisticField: e, outStatisticFieldName: e }]
    }, a = await this.parentLayer._mapServer.queryFeatures(r), n = await this.parentLayer._mapServer.queryFeatures(t), i = Number((o = a.data.featureSet) == null ? void 0 : o.features[0].attributes[e]), l = Number((c = n.data.featureSet) == null ? void 0 : c.features[0].attributes[e]);
    return {
      min: isNaN(i) ? 0 : i,
      max: isNaN(l) ? 0 : l
    };
  }
  async getUniqueValues(e, r) {
    var o;
    let t;
    if (this.igsFeatureLayerServiceV1)
      return t = await this.igsFeatureLayerServiceV1.getUniqueValues(e, r), t;
    const a = r ? this._convertQueryOptions(r) : void 0, n = {
      layerId: this.layer.id,
      returnStyle: !1,
      /*
       * fix(30627):【图层管理】图层样式，区图层单值专题图在前端配置后显示异常
       * 修改说明: 要素查询时，使用一值一类统计，可以获取某字段下的所有字段值
       * 版权所有: 武汉中地数码科技有限公司
       * 修改人: 杨琨 2025-12-25
       */
      outStatistics: [
        { statisticType: "FUNCTION_COUNT", onStatisticField: e, outStatisticFieldName: e + "数量统计" }
      ],
      groupByFieldsForStatistics: e
    }, i = await this.parentLayer._mapServer.queryFeatures(
      a ? { ...n, ...a } : n
    );
    return t = ((o = i == null ? void 0 : i.data.featureSet) == null ? void 0 : o.features).map((c) => c.attributes[e]), [...new Set(t)];
  }
  async queryFeaturesCount(e) {
    if (this.igsFeatureLayerServiceV1)
      return await this.igsFeatureLayerServiceV1.queryFeaturesCount({ ...e });
    const r = await this._queryFeaturesByMapServer({ ...e, returnCountOnly: !0 });
    return r == null ? void 0 : r.count;
  }
  async queryFeatures(e) {
    var t;
    if (this.igsFeatureLayerServiceV1)
      return await this.igsFeatureLayerServiceV1.queryFeatures({ ...e });
    const r = await this._queryFeaturesByMapServer(e);
    return (t = r == null ? void 0 : r.featureSet) == null ? void 0 : t.features;
  }
  async queryStatistics(e) {
    var t;
    if (this.igsFeatureLayerServiceV1)
      return await this.igsFeatureLayerServiceV1.queryStatistics({ ...e, layerId: this.layer.id });
    const r = await this._queryStatisticsByMapServer(e);
    return (t = r == null ? void 0 : r.featureSet) == null ? void 0 : t.features;
  }
  async exportAttributes(e, r) {
    const t = await this.queryFeatures({ ...e });
    await Ie(this.layer, t, r);
  }
  async _queryFeaturesByMapServer(e) {
    const r = this._convertQueryOptions(e), t = await this.parentLayer._mapServer.queryFeatures(r);
    return t == null ? void 0 : t.data;
  }
  async _queryStatisticsByMapServer(e) {
    const { outStatistics: r, groupFields: t } = e, a = {
      layerId: this.layer.id,
      outStatistics: r,
      groupByFieldsForStatistics: t
    };
    return (await this.parentLayer._mapServer.queryFeatures(a)).data;
  }
  _createIGSFeatureLayerService() {
    const { url: e, mapName: r, headers: t, tokenKey: a, tokenValue: n, tokenAttachType: i } = this.parentLayer, { origin: l } = new URL(e), o = new at({
      url: `${l}/igs/rest/mrfs/docs/${r}`,
      sublayerId: this.layer.id,
      headers: t,
      tokenKey: a,
      tokenValue: n,
      tokenAttachType: i
    });
    this.igsFeatureLayerServiceV1 = new Ee(o);
  }
  /**
   * 转换查询选项
   *
   * @param options 查询选项
   * @returns 转换后的查询选项
   */
  _convertQueryOptions(e) {
    const { geometry: r, distance: t, attributeFilter: a, fieldList: n, featureIds: i, returnCountOnly: l, pageNumber: o, pageSize: c } = e;
    return {
      layerId: this.layer.id,
      geometry: r,
      distance: t,
      returnCountOnly: l,
      where: a,
      outfields: n ? n.toString() : void 0,
      objectIds: i ? i.toString() : void 0,
      resultOffset: o && c && (o - 1) * c,
      resultRecordCount: c
    };
  }
}
const { GeometryType: te } = J.enum;
class Mt extends se {
  constructor(e) {
    super(e), this.layer = e;
  }
  async getGeometryType() {
    switch (this.layer.geometryType) {
      case te.point:
      case te.multiPoint:
        return M.point;
      case te.lineString:
      case te.multiLineString:
        return M.line;
      case te.polygon:
      case te.multiPolygon:
        return M.polygon;
    }
    return M.null;
  }
  async getFields() {
    const e = this.layer._source.features;
    if (!e || !Array.isArray(e)) return [];
    const r = /* @__PURE__ */ new Set();
    return e.forEach((t) => {
      const a = t.attributes || {};
      Object.keys(a).forEach((n) => r.add(n));
    }), Array.from(r).map((t) => {
      var l;
      const a = (l = e.find((o) => {
        var c;
        return ((c = o.attributes) == null ? void 0 : c[t]) !== void 0;
      })) == null ? void 0 : l.attributes[t], n = Object.prototype.toString.call(a);
      let i;
      switch (n) {
        case "[object Number]":
          i = Number.isInteger(a) ? "long" : "double";
          break;
        case "[object String]":
          i = "string";
          break;
        case "[object Boolean]":
          i = "boolean";
          break;
        default:
          i = "unknown";
      }
      return {
        name: t,
        // 默认别名等于字段名
        alias: t,
        type: i
      };
    });
  }
  async getMinMaxValue(e) {
    const r = this.layer._source.features.map((t) => {
      var a;
      return (a = t.attributes) == null ? void 0 : a[e];
    }).filter((t) => typeof t == "number");
    return r.length === 0 ? { min: null, max: null } : {
      min: Math.min(...r),
      max: Math.max(...r)
    };
  }
  async getUniqueValues(e) {
    const r = this.layer._source.features.map((t) => {
      var a;
      return (a = t.attributes) == null ? void 0 : a[e];
    }).filter((t) => t !== void 0);
    return [...new Set(r)];
  }
}
const { GeometryType: xt, OutStatisticType: Z } = J.enum, _e = {
  esriFieldTypeString: "string",
  esriFieldTypeDouble: "double",
  esriFieldTypeSmallInteger: "long",
  esriFieldTypeInteger: "long",
  esriFieldTypeDate: "date",
  esriFieldTypeSingle: "short",
  // 无对应类型的不进行转换
  esriFieldTypeOID: "esriFieldTypeOID",
  esriFieldTypeGlobalID: "esriFieldTypeGlobalID",
  esriFieldTypeGUID: "esriFieldTypeGUID",
  esriFieldTypeGeometry: "esriFieldTypeGeometry",
  esriFieldTypeBlob: "esriFieldTypeBlob",
  esriFieldTypeRaster: "esriFieldTypeRaster",
  esriFieldTypeXML: "esriFieldTypeXML"
};
class Ct extends se {
  constructor(e) {
    super(e), this.layer = e, this.parentLayer = e.layer;
  }
  async getFields() {
    return this.layer.fields.map((e) => ({
      name: e.name,
      alias: e.alias,
      type: this._convertFieldsType(e.type)
    }));
  }
  async getUniqueValues(e, r) {
    var o, c;
    let t;
    const a = r ? this._convertQueryOptions(r) : void 0;
    if (a != null && a.objectIds) {
      const m = r.featureIds.length;
      a.resultRecordCount = m, t = a;
    } else {
      const m = {
        layerId: this.layer.id,
        outStatistics: [
          { statisticType: "FUNCTION_COUNT", onStatisticField: e, outStatisticFieldName: e + "数量统计" }
        ],
        groupByFieldsForStatistics: e
      };
      t = a ? { ...m, ...a } : m;
    }
    const n = await this.parentLayer._mapServer.queryFeatures(t), l = ((c = (o = n == null ? void 0 : n.data) == null ? void 0 : o.featureSet) == null ? void 0 : c.features).map((m) => m.attributes[e]);
    return [...new Set(l)];
  }
  async queryFeaturesCount(e) {
    return (await this._queryFeatures({
      ...e,
      pageSize: 1e5,
      returnCountOnly: !0
    })).count;
  }
  async queryFeatures(e) {
    var t;
    return ((t = (await this._queryFeatures(e)).featureSet) == null ? void 0 : t.features) || [];
  }
  async queryStatistics(e) {
    var t;
    const r = await this._queryStatistics(e);
    return (t = r == null ? void 0 : r.featureSet) == null ? void 0 : t.features;
  }
  async exportAttributes(e, r) {
    const t = await this._queryFeatures(e);
    await Ie(this.layer, t.featureSet.features, r);
  }
  async _queryFeatures(e) {
    var a, n;
    const r = this._convertQueryOptions(e), t = await this.parentLayer._mapServer.queryFeatures(r);
    return (n = (a = t.data) == null ? void 0 : a.featureSet) != null && n.fields && this._convertFieldsType(t.data.featureSet.fields), t.data;
  }
  async _queryStatistics(e) {
    const { outStatistics: r, groupFields: t } = e, a = {
      layerId: this.layer.id,
      outStatistics: r,
      groupByFieldsForStatistics: t
    };
    return (await this.parentLayer._mapServer.queryFeatures(a)).data;
  }
  /**
   * @param geometry 几何转换(如果是圆，要转化成多边形， arcgis不支持圆)
   */
  _convertGeometry(e) {
    switch (e.getType()) {
      case xt.circle:
        return e.toPolygon();
      default:
        return e;
    }
  }
  /**
   * 转换属性过滤条件为ArcGIS地图服务的属性过滤条件
   * @param attributeFilter 属性过滤条件
   * @returns ArcGIS地图服务的属性过滤条件
   */
  _convertAttributeFilter(e) {
    return e.replaceAll("!=", "<>");
  }
  /**
   * 转换查询选项
   *
   * @param options 查询选项
   * @returns 转换后的查询选项
   */
  _convertQueryOptions(e) {
    const { geometry: r, distance: t, attributeFilter: a, fieldList: n, featureIds: i, returnCountOnly: l, pageNumber: o, pageSize: c } = e;
    return {
      layerId: this.layer.id,
      geometry: r ? this._convertGeometry(r) : void 0,
      distance: t,
      where: a ? this._convertAttributeFilter(a) : void 0,
      outFields: n ? n.toString() : "*",
      objectIds: i ? i.toString() : void 0,
      returnCountOnly: l,
      // 查询要素总数时resultOffset会对结果有影响
      resultOffset: l ? 0 : o && c && (o - 1) * c,
      resultRecordCount: c
    };
  }
  /**
   * 字段统计信息转为ArcGIS字段统计信息
   * @param outStatistics igs outStatistics
   */
  _outStatisticsToArcGISOutStatistics(e) {
    return e.map((r) => {
      const { statisticType: t } = r;
      switch (t) {
        case Z.functionSum:
          r.statisticType = "sum";
          break;
        case Z.functionMin:
          r.statisticType = "min";
          break;
        case Z.functionMax:
          r.statisticType = "max";
          break;
        case Z.functionAvg:
          r.statisticType = "avg";
          break;
        case Z.functionStandardDeviation:
          r.statisticType = "stddev";
          break;
        case Z.functionCount:
          r.statisticType = "count";
          break;
        case Z.functionVariance:
          r.statisticType = "var";
          break;
      }
      return r;
    });
  }
  /**
   * ArcGIS字段类型转为IGS字段类型
   * @param fields ArcGIS字段类型
   * @returns 转换后的字段类型
   */
  _convertFieldsType(e) {
    if (e instanceof Array)
      e.forEach((r) => {
        r.type = _e[r.type] || r.type;
      });
    else
      return _e[e] || e;
  }
}
class Vt extends $e {
  constructor(e) {
    super(e), this.layer = e;
  }
  async exportAttributes(e, r) {
    const { geometry: t, distance: a } = e, { f: n = "csv" } = r;
    let { fileName: i } = r;
    i || (i = `${this.layer.title}_attributes_${Date.now()}.${n}`);
    const l = await this.layer._mapServer.queryFeaturesInLayers({
      geometry: t,
      distance: a,
      f: n,
      resultRecordCount: 1e5,
      responseType: "blob"
    });
    await Ne.saveAs(l, i);
  }
  async queryFeaturesInLayers(e) {
    var i;
    const { geometry: r, distance: t, layerDefs: a } = e, n = await this.layer._mapServer.queryFeaturesInLayers({
      geometry: r,
      distance: t,
      layerDefs: a
    });
    return ((i = n == null ? void 0 : n.data) == null ? void 0 : i.layers) || [];
  }
}
class Gt extends se {
  constructor(e) {
    super(e), this.layer = e;
  }
  async getRasterValue(e) {
    const { x: r, y: t } = e;
    return (await this.layer._imageServer.getRasterValue({
      x: Number(r),
      y: Number(t)
    })).data;
  }
}
class kt extends $e {
  constructor(e) {
    super(e), this.layer = e;
  }
  async queryFeaturesInLayers(e) {
    var I;
    const { geometry: r, distance: t, layerDefs: a, imageDisplay: n } = e, i = a == null ? void 0 : a.map((L) => L.layerId), { xmin: l, ymin: o, xmax: c, ymax: m } = this.layer.extent, b = {
      geometry: r,
      mapExtent: `${l},${o},${c},${m}`,
      imageDisplay: n,
      tolerance: t
    };
    i && (b.layers = `visible:${i.toString()}`);
    const u = await this.layer._mapServer.identify(b);
    return ((I = u == null ? void 0 : u.data) == null ? void 0 : I.results) || [];
  }
}
const { LayerType: ae, SubLayerType: Ae } = J.enum;
function Rt(s) {
  switch (s.type) {
    case Ae.IGSMapImageSub:
      return new Ft(s);
    case ae.IGSFeature:
      return new Ee(s);
    case Ae.ArcGISMapImageSub:
      return new Ct(s);
    case ae.GeoJSON:
      return new Mt(s);
    case ae.IGSImage:
      return new Gt(s);
    default:
      return null;
  }
}
function er(s) {
  switch (s.type) {
    case ae.IGSMapImage:
      return new Vt(s);
    case ae.ArcGISMapImage:
      return new kt(s);
    default:
      return null;
  }
}
class Te {
  constructor(e, r, t) {
    const { element: a } = this.createPopup(
      r.content,
      {
        ...r.props,
        closePopup: this.closePopup.bind(this)
      },
      t
    );
    this.instance = {
      position: e,
      options: r,
      element: a
    };
  }
  // 打开弹窗
  openPopup() {
    this.addPopup();
  }
  // 关闭弹窗
  closePopup() {
    try {
      Me(null, this.instance.element), this.instance.element.remove(), this.removePopup();
    } catch {
    }
  }
  /**
   * @description: 渲染弹窗组件并插入div中
   * @param {*} props 弹窗内容
   * @return {*}
   */
  createPopup(e, r, t) {
    let a = e;
    typeof e == "string" && t.appContext.components[e] && (a = t.appContext.components[e]);
    const n = We(a, r);
    n.appContext = n.appContext = {
      ...t.appContext,
      provides: { ...t.provides }
    };
    const i = document.createElement("div");
    return Me(n, i), {
      element: i
    };
  }
}
class qt extends Te {
  constructor(e, r, t, a) {
    super(r, t, a), this.sizeValid = !1, this.Cesium = e.cesium.Cesium, this.viewer = e.cesium.viewer, this.worldCoordinates = this.Cesium.Cartesian3.fromDegrees(
      r.longitude,
      r.latitude,
      r.height || 0
    ), this.addPostRender();
  }
  addPopup() {
    requestAnimationFrame(() => {
      this.instance.element, this.viewer.cesiumWidget.container.appendChild(this.instance.element);
    });
  }
  removePopup() {
    this.viewer.scene.postRender.removeEventListener(this.postRender, this);
  }
  //添加场景事件
  addPostRender() {
    this.viewer.scene.postRender.addEventListener(this.postRender, this);
  }
  postRender() {
    if (!(!this.instance.element || !this.instance.element.style))
      try {
        if (this.checkVisible(this.worldCoordinates)) {
          const r = this.calculatePosition(this.worldCoordinates, this.instance.element, this.instance.options);
          Object.assign(this.instance.element.style, r);
        } else
          this.instance.element.style.display = "none";
      } catch {
      }
  }
  checkVisible(e) {
    try {
      const r = new this.Cesium.BoundingSphere(e, 0);
      return this.viewer.scene.camera.computeVisibility(r) === this.Cesium.Visibility.FULL;
    } catch {
      return new this.Cesium.EllipsoidalOccluder(this.Cesium.Ellipsoid.WGS84, this.viewer.camera.position).isPointVisible(e);
    }
  }
  calculatePosition(e, r, t) {
    if (!r) return { position: "absolute", left: "0px", top: "0px" };
    const a = this.Cesium.SceneTransforms.worldToDrawingBufferCoordinates(this.viewer.scene, e) || new this.Cesium.Cartesian2(0, 0), n = r.getBoundingClientRect();
    let i = 0, l = 0;
    if (this.sizeValid) {
      switch (t.anchor) {
        case "top-left":
          i = a.x, l = a.y;
          break;
        case "top-right":
          i = a.x - n.width, l = a.y;
          break;
        case "center-left":
          i = a.x, l = a.y - n.height / 2;
          break;
        case "center-center":
          i = a.x - n.width / 2, l = a.y - n.height / 2;
          break;
        case "center-right":
          i = a.x - n.width, l = a.y - n.height / 2;
          break;
        case "bottom-left":
          i = a.x, l = a.y - n.height;
          break;
        case "bottom-right":
          i = a.x - n.width, l = a.y - n.height;
          break;
        case "bottom-center":
          i = a.x - n.width / 2, l = a.y - n.height;
          break;
        default:
          i = a.x - n.width / 2, l = a.y;
      }
      return t.offset && (i += t.offset[0], l += t.offset[1]), {
        position: "absolute",
        display: "inline-block",
        left: `${i}px`,
        top: `${l}px`,
        zIndex: 1e3
      };
    } else
      return !this.preWidth && !this.preHeight ? (this.preWidth = n.width, this.preHeight = n.height) : Math.abs(this.preWidth - n.width) < 5 && Math.abs(this.preHeight - n.height) < 5 ? this.sizeValid = !0 : (this.preWidth = n.width, this.preHeight = n.height), {
        position: "absolute"
      };
  }
}
class _t extends Te {
  constructor(e, r, t, a) {
    super(r, t, a), this.mapboxgl = e.mapboxgl.mapboxgl, this.mglMap = e.mapboxgl.mapView.getInnerView();
  }
  addPopup() {
    this.popup = new this.mapboxgl.Popup({
      className: "mapgis-custom-mapboxgl-popup",
      offset: this.instance.options.offset,
      anchor: this.convertAnchor(this.instance.options.anchor)
    }).setLngLat([this.instance.position.longitude, this.instance.position.latitude]).setDOMContent(this.instance.element).addTo(this.mglMap);
  }
  removePopup() {
    this.popup && (this.popup.remove(), this.popup = null);
  }
  convertAnchor(e) {
    switch (e) {
      case "top-left":
        return "top-left";
      case "top-center":
        return "top";
      case "top-right":
        return "top-right";
      case "center-center":
        return "center";
      case "center-left":
        return "left";
      case "center-right":
        return "right";
      case "bottom-left":
        return "bottom-left";
      case "bottom-center":
        return "bottom";
      case "bottom-right":
        return "bottom-right";
      default:
        return "bottom";
    }
  }
}
class At extends Te {
  constructor(e, r, t, a) {
    super(r, t, a), this.L = e.leaflet.L, this.map = e.leaflet.mapView.getInnerView();
  }
  addPopup() {
    this.popup = this.L.popup({
      className: "mapgis-custom-leaflet-popup",
      offset: this.L.point(
        this.instance.options.offset[0],
        // 弹窗底部的三角形尖角有10像素的高度，这个高度未被leaflet计算进offset中，导致弹窗底部的三角形尖角与marker图标重叠
        // 偏移值需要加上弹窗底部的三角形尖角的10像素
        this.instance.options.offset[1] >= 0 ? this.instance.options.offset[1] + 10 : this.instance.options.offset[1] - 10
      )
    }).setLatLng([this.instance.position.latitude, this.instance.position.longitude]).setContent(this.instance.element).addTo(this.map);
  }
  removePopup() {
    this.popup && (this.popup.remove(), this.popup = null);
  }
}
function tr(s, e, r, t, a) {
  switch (s) {
    case B.Cesium:
      return new qt(e, r, t, a);
    case B.MapboxGL:
      return new _t(e, r, t, a);
    case B.Leaflet:
      return new At(e, r, t, a);
    default:
      throw new Error(`Unsupported engine type: ${s}`);
  }
}
const Nt = 96;
function rr(s, e) {
  const { GeometryType: r } = s.enum;
  let t;
  switch (e.type) {
    case r.point:
      t = et([e.coordinates[0], e.coordinates[1]]);
      break;
    case r.circle:
      const { xmax: a, xmin: n, ymax: i, ymin: l } = e.extent;
      t = pe([
        [
          [n, l],
          [a, l],
          [a, i],
          [n, i],
          [n, l]
        ]
      ]);
      break;
    case r.extent:
      t = pe([
        [
          [e.xmin, e.ymin],
          [e.xmax, e.ymin],
          [e.xmax, e.ymax],
          [e.xmin, e.ymax],
          [e.xmin, e.ymin]
        ]
      ]);
      break;
    case r.lineString:
      t = ze(e.coordinates.map((o) => [o[0], o[1]]));
      break;
    case r.polygon:
      t = pe(e.coordinates.map((o) => o));
      break;
  }
  return t;
}
function ar(s, e, r, t, a) {
  const { getMetersPerSpatialReference: n } = s.util;
  let i = 1e-4;
  const l = n(r.spatialReference);
  switch (a) {
    case "pixel":
    default:
      i = Bt(s, e, l, t);
      break;
    case "kilometer":
      i = t * 1e3 / l;
      break;
    case "meter":
      i = t / l;
      break;
    case "centimeter":
      i = t / 100 / l;
      break;
  }
  return i;
}
function sr(s, e, r, t, a) {
  let n = t || 1;
  switch (a) {
    case "kilometer":
      n = be(s, e, t * 1e3, r);
      break;
    case "meter":
      n = be(s, e, t, r);
      break;
    case "centimeter":
      n = be(s, e, t / 100, r);
      break;
    case "pixel":
    default:
      n = t;
      break;
  }
  return n;
}
function be(s, e, r, t) {
  const { getMetersPerSpatialReference: a } = s.util, n = a(t.spatialReference), i = Pe(s, e);
  return r / n / i;
}
function Bt(s, e, r, t) {
  const { getMetersPerSpatialReference: a } = s.util, i = Pe(s, e) * t, l = a(e.view.spatialReference);
  return i * l / r;
}
function Pe(s, e) {
  const { TileInfoUtil: r } = s.util, t = e.view.getScale(), a = e.view.spatialReference;
  return r.scaleToResolution(t, Nt, a);
}
const nr = (s, e, r) => {
  const { GraphicsLayer: t } = J.layer, {
    // 草图捕获配置项
    snapOption: a = {
      //是否自动捕捉顶点重合
      isSnapVertexCoincident: !1,
      // 是否自动捕捉线上的点
      isSnapVertexInLine: !1,
      // 是否自动捕捉平行线
      isSnapParallel: !1,
      // 是否自动捕捉垂线垂点
      isSnapPerpendicular: !1,
      // 是否捕捉正在绘制的图形的边界
      snapSketchGeometry: !1
    },
    elevationMode: n,
    // 草图符号
    sketchStyle: i,
    // 草图是否可编辑
    editable: l = !1,
    // 草图是否进行拓扑检查
    isSimple: o = !1
  } = e || {}, c = n || st.onTheScene, m = new nt({ mode: c });
  let b, u, I, L = null, y = null;
  H(s, () => {
    u == null || u.destroy(), u = null, d();
  }), ce(() => {
    d();
  }), ve(() => {
    u == null || u.destroy(), u = null;
  });
  function d() {
    b = new t(), s.view.graphicsLayers.add(b);
    const f = {
      view: s.view,
      layer: b,
      snapOption: a,
      elevationInfo: {},
      sketchStyle: i,
      editable: l,
      isSimple: o
    };
    switch (s.engine) {
      case B.Leaflet:
        u = new J.leaflet.tool.sketch.SketchEditor(f);
        break;
      case B.Cesium:
        f.elevationInfo = m, u = new J.cesium.tool.sketch.SketchEditor(f);
        break;
      case B.MapboxGL:
        u = new J.mapboxgl.tool.sketch.SketchEditor(f);
    }
    h();
  }
  function h() {
    u.on(de.create, (f) => {
      f.toolEventInfo && (f.toolEventInfo.type, xe.geometryUnsimple), f.state === me.complete && (I = f.feature.geometry, I.id = f.feature.id, L && (L(I), L = null)), f.toolEventInfo && f.toolEventInfo.type === xe.vertexAdd && y && (y(f), y = null);
    }), u.on(de.create, (f) => {
      r && r.createFeature && r.createFeature(f.feature);
    }), u.on(de.update, (f) => {
      f.state === me.start && r && r.selectFeature && r.selectFeature(f.feature), f.state === me.complete && r && r.completeFeature && r.completeFeature(f.feature);
    });
  }
  function k() {
    u == null || u.stop(), u == null || u.setIsShowTip(!1);
  }
  async function V(f, U) {
    return f === G || f === D ? new Promise((N) => {
      f(), L = N;
    }) : new Promise((N) => {
      f(), y = N;
    }).then((N) => (U && U(b, N), new Promise((j) => {
      L = j;
    })));
  }
  function G() {
    u.setIsShowTip(!0), u.start(K.point);
  }
  function R() {
    u.setIsShowTip(!0), u.start(K.polyline);
  }
  const A = () => {
    u.setIsShowTip(!0), u.start(K.polygon);
  };
  function O() {
    u.setIsShowTip(!0), u.start(K.circle);
  }
  function W() {
    u.setIsShowTip(!0), u.start(K.rectangle);
  }
  function Q() {
    u.setIsShowTip(!0), u.start(K.polygon, { vertexNumber: 3 });
  }
  function D() {
    u.setIsShowTip(!0), u.start(K.text);
  }
  function re() {
    u == null || u.remove();
  }
  function g() {
    b == null || b.removeAll();
  }
  function w() {
    return b;
  }
  function v(f) {
    u.setSketchStyle(f);
  }
  function T() {
    return u.getSketchStyle();
  }
  function p(f) {
    u.layer = f;
  }
  function C(f) {
    u.snapOption = f;
  }
  function F(f) {
    u.select(f);
  }
  return {
    getGraphicsLayer: w,
    addPoint: G,
    addPolyline: R,
    addPolygon: A,
    addRectangle: W,
    addCircle: O,
    addTriangle: Q,
    addText: D,
    stopDraw: k,
    asyncDrawWrapper: V,
    removeCurrent: re,
    removeAllDraw: g,
    setSketchStyle: v,
    getSketchStyle: T,
    setSketchLayer: p,
    setSnapOption: C,
    selectFeatureById: F
  };
}, $t = (s) => {
  const { map: e } = s;
  let r = e.layers.items || [];
  const t = Ue(y());
  ce(() => {
    s.on(P.layerViewRemove, n), s.on(P.layerUpdate, i), s.on(P.layerViewCreated, n);
  }), ve(() => {
    s.off(P.layerViewRemove, n), s.off(P.layerUpdate, i), s.off(P.layerViewCreated, n);
  });
  function a() {
    r = e.layers.items, t.value = y();
  }
  function n(d) {
    const { sourceTarget: h } = d;
    L(h) || a();
  }
  function i(d) {
    const { layer: h, sourceTarget: k, updateContent: V } = d;
    let G;
    if (Array.isArray(V)) {
      for (let R = 0; R < V.length; R++)
        if (!L(k)) {
          const A = V[R], { name: O, type: W } = A;
          W === "sublayer-update-content" ? O === "visible" && h.visible && (G = !0) : O === "visible" && (G = !0);
        }
    }
    G && a();
  }
  function l() {
    const d = [];
    return r.forEach((h) => {
      const k = s.getInnerLayer(h);
      d.push(k);
    }), d;
  }
  function o(d) {
    return s.getInnerLayer(d);
  }
  function c(d, h) {
    return s.getInnerLayer(d, h);
  }
  function m(d) {
    return e.findLayerById(d);
  }
  function b(d) {
    e.add(d);
  }
  function u(d) {
    const h = m(d);
    h && e.remove(h);
  }
  function I(d, h) {
    return d.findSublayerById(h);
  }
  function L(d) {
    return s.overlays === d ? !0 : d.parent ? L(d.parent) : !1;
  }
  function y() {
    return h(r, ["id", "url", "type", "title", "visible"]);
    function h(k, V) {
      return k.map((G) => {
        var O, W, Q;
        const R = {};
        for (const D of V)
          D in G && (R[D] = G[D]);
        let A;
        return St(G.type) ? A = (W = (O = G.activeScene) == null ? void 0 : O.sublayers) == null ? void 0 : W.items : A = (Q = G.sublayers) == null ? void 0 : Q.items, A != null && A.length && (R.sublayers = h(A, V)), R;
      });
    }
  }
  return {
    layerList: t,
    allLayers: r,
    addLayer: b,
    removeLayerById: u,
    handleLayerChange: a,
    getAllInnerLayers: l,
    getLayerById: m,
    getInnerLayer: o,
    getSubLayerById: I,
    getInnerLayerByParent: c
  };
}, ne = () => {
  const s = E("zondy", null), e = E("map", null), r = E("sceneViewCesium", null), t = E("mapViewMapboxgl", null), a = E("mapViewLeaflet", null), n = E("Cesium", null), i = E("viewer", null), l = E("mapboxgl", null), o = E("L", null), c = E("view", null), m = E("engine", null), b = x(() => c ? q(c) : r ? q(r) : t ? q(t) : a ? q(a) : null), u = x(() => m ? q(m) : n ? B.Cesium : l ? B.MapboxGL : o ? B.Leaflet : null), I = x(() => u.value === B.Cesium ? "3D" : "2D"), L = x(() => ({
    cesium: {
      Cesium: q(n),
      viewer: q(i),
      sceneView: b.value
    },
    mapboxgl: {
      mapboxgl: q(l),
      mapView: b.value
    },
    leaflet: {
      L: q(o),
      mapView: b.value
    }
  }));
  H(
    () => b.value,
    (h) => {
      y.view = h;
    }
  ), H(
    () => u.value,
    (h) => {
      y.engine = h;
    }
  ), H(
    () => I.value,
    (h) => {
      y.viewMode = h;
    }
  ), H(
    () => L.value,
    (h) => {
      y.engineContext = h;
    }
  );
  const y = De({
    view: b.value,
    engine: u.value,
    engineContext: L.value,
    viewMode: I.value
  });
  function d() {
    return y.engine === B.Cesium ? q(i).container : y.engine === B.MapboxGL ? y.view.getInnerView().getContainer() : y.engine === B.Leaflet ? y.view.getInnerView().getContainer().parentElement : null;
  }
  return { zondy: q(s), map: q(e), viewState: y, getViewContainer: d };
}, ir = (s, e) => {
  const { zondy: r } = ne(), { SymbolType: t } = r.enum, a = ye({
    symbol: Se(s.symbol, r),
    hasFormWrapper: s.hasFormWrapper,
    renderMode: s.renderMode,
    markerTypes: [
      {
        label: "简单标记",
        value: t.simpleMarker
      },
      {
        label: "图片标记",
        value: t.pictureMarker
      }
    ],
    lineTypes: [],
    fillTypes: [
      {
        label: "简单填充",
        value: t.simpleFill
      },
      {
        label: "图片填充",
        value: t.pictureFill
      }
    ],
    textTypes: [
      {
        label: "文字",
        value: t.text
      },
      {
        label: "MapGIS文本",
        value: t.mapgisText
      }
    ]
  });
  H(
    () => s.symbol,
    () => {
      a.symbol = Se(s.symbol, r);
    },
    { deep: !0 }
  );
  const n = x(() => s.hasFormWrapper ? "mapgis-ui-setting-form" : "div"), i = x(() => a.symbol.type === t.simpleMarker || a.symbol.type === t.pictureMarker), l = x(() => i.value && a.symbol.type === t.simpleMarker), o = x(() => i.value && a.symbol.type === t.pictureMarker), c = x(() => a.symbol.type === t.simpleLine), m = x(() => c.value && a.symbol.type === t.simpleLine), b = x(() => a.symbol.type === t.simpleFill || a.symbol.type === t.pictureFill), u = x(() => b.value && a.symbol.type === t.simpleFill), I = x(() => b.value && a.symbol.type === t.pictureFill), L = x(() => a.symbol.type === t.text || a.symbol.type === t.mapgisText), y = x(() => L.value && a.symbol.type === t.text), d = x(() => L.value && a.symbol.type === t.mapgisText);
  function h() {
    const V = r.symbol.Symbol.fromJSON(a.symbol);
    e("change", { symbol: V, symbolJSON: a.symbol });
  }
  function k(V) {
    const G = r.symbol.Symbol.fromJSON({
      ...a.symbol,
      type: V
    });
    a.symbol = Se(G, r), h();
  }
  return {
    ...we(a),
    wrapperComponent: n,
    isMarkerSymbol: i,
    isSimpleMarkerSymbol: l,
    isPictureMarkerSymbol: o,
    isLineSymbol: c,
    isSimpleLineSymbol: m,
    isFillSymbol: b,
    isSimpleFillSymbol: u,
    isPictureFillSymbol: I,
    isTextSymbol: L,
    isSimpleTextSymbol: y,
    isMapGISTextSymbol: d,
    updateSymbol: h,
    updateSymbolType: k
  };
}, Et = () => {
  const { getViewContainer: s } = ne(), e = "map-attribute-table-container";
  function r(o) {
    return Array.from(s().children).find(
      (c) => {
        var m;
        return (m = c.classList) == null ? void 0 : m.contains(o);
      }
    );
  }
  function t(o, c, m) {
    const b = document.createElement(o);
    return b.className = c, m && (b.style.cssText = m), s().appendChild(b), b;
  }
  function a(o) {
    const c = r(o);
    c && s().removeChild(c);
  }
  function n() {
    return r(e);
  }
  function i(o, c) {
    t(
      "div",
      c ? `${e} ${c}` : e,
      o
    );
  }
  function l() {
    a(e);
  }
  return {
    attributeTableClassName: e,
    createAttributeTableElement: i,
    getAttributeTableElement: n,
    destroyAttributeTableElement: l,
    getMapElement: r,
    createMapElement: t,
    destroyMapElement: a
  };
}, z = ye({}), or = (s) => {
  const { getViewContainer: e } = ne(), { getMapElement: r, createAttributeTableElement: t, getAttributeTableElement: a, destroyAttributeTableElement: n } = Et(), i = ye({
    // 查询结果参数
    queryResult: s.queryResult,
    // 视图ID
    viewId: "",
    // 元素ID
    elementId: ""
  }), l = x(() => z[i.viewId] ? z[i.viewId].find((u) => u.id === i.elementId) : null);
  ce(() => {
    i.viewId = e().id, i.elementId = it();
  }), ve(() => {
    m();
  });
  async function o() {
    if (!i.queryResult.inAttributeTable)
      return;
    m(), await je(), t(i.queryResult.style, `mapgis-ui-placement--${i.queryResult.position}`);
    const u = a();
    u && (z[i.viewId] || (z[i.viewId] = []), u.id = i.elementId, z[i.viewId].push(u));
  }
  function c(u) {
    const I = e(), L = a(), y = r("cesium-viewer-statusbar-container") || r("mapboxgl-statusbar-container") || r("leaflet-statusbar-container");
    if (i.queryResult.customAttributeTableMaxHeight)
      return i.queryResult.customAttributeTableMaxHeight({
        viewContainerElement: I,
        tableContainerElement: L,
        tableElement: u
      });
    switch (i.queryResult.position) {
      case "top-center":
      case "top-right":
      case "top-left":
        return L.clientHeight - (u.getBoundingClientRect().top - I.getBoundingClientRect().top);
      case "center-center":
        return I.clientHeight - (u.getBoundingClientRect().top - I.getBoundingClientRect().top) - (I.getBoundingClientRect().bottom - L.getBoundingClientRect().bottom);
      default:
        return I.clientHeight - (u.getBoundingClientRect().top - I.getBoundingClientRect().top) - (y ? y.offsetHeight : 0);
    }
  }
  function m() {
    if (a() && (n(), z[i.viewId]))
      return z[i.viewId].splice(0);
  }
  function b(u) {
    const I = a();
    I && I.setAttribute("style", u);
  }
  return {
    ...we(i),
    attributeTableContainerElement: l,
    tryOpenAttributeTable: o,
    getAttributeTableMaxHeight: c,
    destroyAttributeTable: m,
    updateAttributeTableStyle: b
  };
}, lr = (s, e, r) => {
  const { zondy: t, map: a, viewState: n } = ne(), { RendererType: i, SymbolType: l } = t.enum, o = ye({
    fields: s.fields,
    renderMode: s.renderMode,
    hasFormWrapper: s.hasFormWrapper,
    supportedThemeTypes: [],
    geometryType: M.null,
    renderer: null,
    // 渲染器是否是自己创建的
    isRendererCreatedBySelf: !1
  });
  let c, m;
  const b = x(() => s.hasFormWrapper ? "mapgis-ui-setting-form" : "div"), u = x(() => (p) => o.supportedThemeTypes.includes(p)), I = x(() => (p) => p === i.simple), L = x(() => (p) => p === i.uniqueValue), y = x(() => (p) => p === i.classBreak), d = x(() => (p) => p === i.rank), h = x(() => o.geometryType === M.point), k = x(() => o.geometryType === M.line), V = x(() => o.geometryType === M.polygon);
  H(
    () => s.layer,
    () => {
      w();
    }
  ), ce(() => {
    w();
  });
  function G(p) {
    c = p, o.fields = [], o.geometryType = M.null, o.supportedThemeTypes = [], o.isRendererCreatedBySelf = !1, v();
  }
  function R() {
    const p = t.renderer.BaseRenderer.fromJSON(o.renderer);
    e("rendererChange", { renderer: p, rendererJSON: o.renderer }), c.renderer = p;
  }
  function A() {
    switch (o.geometryType) {
      case M.point:
        return new t.symbol.SimpleMarkerSymbol({
          color: new t.Color(213, 62, 79, 0.9),
          size: 14,
          outline: new t.symbol.SimpleLineSymbol({
            color: new t.Color(255, 255, 255, 1),
            width: 1
          })
        });
      case M.line:
        return new t.symbol.SimpleLineSymbol({
          color: new t.Color(58, 177, 140, 1),
          width: 2
        });
      case M.polygon:
        return new t.symbol.SimpleFillSymbol({
          color: new t.Color(137, 114, 162, 0.9),
          outline: new t.symbol.SimpleLineSymbol({
            color: new t.Color(255, 255, 255, 1),
            width: 1
          })
        });
    }
    return null;
  }
  function O(p) {
    if (!p)
      return !1;
    const C = p.type;
    switch (o.geometryType) {
      case M.point:
        return C === l.simpleMarker || C === l.pictureMarker;
      case M.line:
        return C === l.simpleLine;
      case M.polygon:
        return C === l.simpleFill || C === l.pictureFill;
    }
    return !1;
  }
  function W(p) {
    const C = o.fields.find((F) => p.includes(F.type));
    return C ? C.name : null;
  }
  function Q(p) {
    return m.getUniqueValues(p);
  }
  function D(p) {
    return m.getMinMaxValue(p);
  }
  function re(p) {
    return p.toString().startsWith("rgba") ? p : `rgba(${p.red}, ${p.green}, ${p.blue}, ${p.alpha})`;
  }
  function g(p, C, F, f = "equalInterval") {
    if (F <= 0 || C < p)
      return [];
    const U = [];
    if (f === "equalInterval") {
      const N = (C - p) / F;
      for (let j = 0; j < F; j++) {
        const ie = p + j * N, oe = j === F - 1 ? C : p + (j + 1) * N;
        U.push({
          min: ie,
          max: oe
        });
      }
    }
    return U;
  }
  function w() {
    vt({
      layer: s.layer,
      layerId: "",
      sublayerId: "",
      view: n.view,
      zondy: t,
      map: a,
      callback: (p) => {
        c = p, v();
      }
    });
  }
  async function v() {
    if (c)
      if (m = Rt(c), m) {
        switch ((!o.fields || !o.fields.length) && (o.fields = await m.getFields()), o.geometryType = await m.getGeometryType(), o.geometryType) {
          case M.point:
            o.supportedThemeTypes = [
              i.simple,
              i.uniqueValue,
              i.classBreak,
              i.rank
            ];
            break;
          case M.line:
            o.supportedThemeTypes = [i.simple, i.uniqueValue, i.classBreak];
            break;
          case M.polygon:
            o.supportedThemeTypes = [i.simple, i.uniqueValue, i.classBreak];
            break;
        }
        r && r.checkRendererValid && r.createRenderer && T();
      } else
        o.fields = [], o.geometryType = M.null, o.supportedThemeTypes = [], o.isRendererCreatedBySelf = !1;
  }
  async function T() {
    if (c.renderer && u.value(c.renderer.type) && r.checkRendererValid(c.renderer)) {
      o.renderer = c.renderer.toJSON();
      return;
    }
    const p = await r.createRenderer();
    if (p) {
      o.renderer = p.toJSON(), o.isRendererCreatedBySelf = !0, R();
      return;
    }
    o.renderer = null;
  }
  return {
    ...we(o),
    // 计算属性
    wrapperComponent: b,
    isThemeSupport: u,
    isSimpleTheme: I,
    isUniqueTheme: L,
    isRangeTheme: y,
    isGraduatedSymbolTheme: d,
    isPointGeometryType: h,
    isLineGeometryType: k,
    isPolygonGeometryType: V,
    // 方法
    updateLayer: G,
    updateRenderer: R,
    createRendererSymbol: A,
    isRendererSymbolValid: O,
    getValidFieldNameByType: W,
    getUniqueValuesByFieldName: Q,
    getMinMaxValuesByFieldName: D,
    symbolColor2Rgba: re,
    splitMinMaxValue: g
  };
}, Pt = (s, e) => {
  const { viewState: r } = ne(), { layerList: t, getInnerLayer: a, getLayerById: n, getInnerLayerByParent: i, getSubLayerById: l, handleLayerChange: o } = $t(r.view);
  let c = [];
  const m = x(() => {
    const g = tt(t.value), w = G(
      g,
      s.layerTypes,
      s.sublayerTypes,
      s.filterLayerCallBack
    );
    return y(w);
  });
  H(() => m.value.length, O);
  function b(g, w, v) {
    c = Array.isArray(g) ? g : [g], e("update:value", g), e("change", g, w, v);
  }
  function u() {
    o();
  }
  function I() {
    return R(m.value, c, d);
  }
  function L() {
    return R(m.value, c, d, !0);
  }
  function y(g, w = "") {
    return g.map((v) => {
      var p;
      const T = w ? `${w}-${v.id}` : `${v.id}`;
      return (p = v.sublayers) != null && p.length && (v.sublayers = y(v.sublayers, T)), {
        ...v,
        key: T
      };
    });
  }
  function d(g, w) {
    const v = n(g);
    let T;
    return g === w ? T = a(v) : (T = i(v, w), Array.isArray(T) && (T = T[0])), T;
  }
  function h() {
    return R(m.value, c, V);
  }
  function k() {
    return A(m.value, V);
  }
  function V(g, w) {
    const v = n(g);
    return g === w ? v : l(v, w);
  }
  function G(g, w, v, T, p = 1, C) {
    return g.filter((F) => {
      var j, ie, oe, Le;
      const f = C ?? F.id, U = (j = F.sublayers) == null ? void 0 : j.length;
      if (U && (s.multiple || (F.selectable = !1), F.sublayers = G(
        F.sublayers,
        w,
        v,
        T,
        p + 1,
        f
      )), p > 1)
        return F.visible && v.includes(F.type) && T(f, F.id);
      let N;
      return s.checkStrictly ? N = U ? (ie = F.sublayers) == null ? void 0 : ie.length : w.includes(F.type) : N = w.includes(F.type) || ((oe = F.sublayers) == null ? void 0 : oe.length), F.visible && N && ((Le = F.sublayers) != null && Le.length ? !0 : T(f));
    });
  }
  function R(g, w, v, T = !1, p) {
    var F;
    const C = [];
    for (const f of g) {
      const U = p ?? f.id, N = (F = f.sublayers) == null ? void 0 : F.length;
      N && C.push(...R(f.sublayers, w, v, T, U)), w.includes(f.key) === !T && !N && C.push(v(U, f.id));
    }
    return C;
  }
  function A(g, w, v) {
    var p;
    const T = [];
    for (const C of g) {
      const F = v ?? C.id;
      (p = C.sublayers) != null && p.length && T.push(...A(C.sublayers, w, F)), T.push(w(F, C.id));
    }
    return T;
  }
  function O() {
    c = W(m.value, c);
    const g = s.multiple ? c : c[0] || "";
    e("update:value", g);
  }
  function W(g, w) {
    var T;
    const v = [];
    for (const p of g)
      ((T = p.sublayers) == null ? void 0 : T.length) ? v.push(...W(p.sublayers, w)) : w.includes(p.key) && v.push(p.key);
    return v;
  }
  function Q(g) {
    const w = [], v = (T) => {
      T.forEach((p) => {
        p.sublayers && p.sublayers.length > 0 ? v(p.sublayers) : w.push(p.key);
      });
    };
    return v(g), w;
  }
  function D() {
    const g = R(
      m.value,
      c,
      (v, T) => T,
      !0
    );
    return g || [];
  }
  function re({ target: g }) {
    g.checked ? c = Q(m.value) : c = [], e("update:value", c);
  }
  return {
    treeLayers: m,
    getSelectInnerLayers: I,
    getUnSelectInnerLayers: L,
    getSelectLayers: h,
    getAllLayers: k,
    onChange: b,
    updateLayers: u,
    getUnselectedLayerIds: D,
    toggleCheckAll: re
  };
}, Ot = /* @__PURE__ */ Je({
  name: "MapgisLayerSelect",
  inheritAttrs: !1,
  __name: "layer-select",
  props: ht,
  emits: ft,
  setup(s, { expose: e, emit: r }) {
    const t = s, a = r, n = Qe(), i = dt("layer-select"), l = ({ menuNode: h }) => {
      var k;
      return t.multiple && ((k = o.value) != null && k.length) ? le("div", { class: i.e("dropdown") }, [
        le(
          lt,
          {
            onChange: d,
            style: { marginLeft: "8px" }
          },
          () => le("span", { style: { paddingLeft: "4px" } }, "全选/全不选")
        ),
        le(ut, { style: { margin: "6px 0 6px" } }),
        h
      ]) : h;
    }, {
      treeLayers: o,
      onChange: c,
      getSelectInnerLayers: m,
      getUnSelectInnerLayers: b,
      getSelectLayers: u,
      getAllLayers: I,
      updateLayers: L,
      getUnselectedLayerIds: y,
      toggleCheckAll: d
    } = Pt(t, a);
    return e({
      getSelectInnerLayers: m,
      getUnSelectInnerLayers: b,
      getSelectLayers: u,
      getAllLayers: I,
      updateLayers: L,
      getUnselectedLayerIds: y
    }), (h, k) => {
      const V = He("a-tree-select");
      return Ke(), Xe(V, Ye({
        class: [q(i).b()]
      }, q(n), {
        value: t.value,
        "tree-data": q(o),
        height: t.height,
        fieldNames: t.fieldNames,
        "tree-checkable": t.multiple,
        "max-tag-count": t.maxTagCount,
        "max-tag-text-length": t.maxTagTextLength,
        dropdownMatchSelectWidth: t.dropdownMatchSelectWidth,
        "dropdown-render": l,
        "tree-node-filter-prop": "title",
        onChange: q(c)
      }), null, 16, ["class", "value", "tree-data", "height", "fieldNames", "tree-checkable", "max-tag-count", "max-tag-text-length", "dropdownMatchSelectWidth", "onChange"]);
    };
  }
}), ur = /* @__PURE__ */ ot(Ot, [["__scopeId", "data-v-c8e33e4d"]]);
export {
  Zt as A,
  zt as B,
  ft as C,
  ht as D,
  B as E,
  Pt as F,
  M as L,
  Lt as S,
  nr as a,
  dt as b,
  or as c,
  rr as d,
  ar as e,
  Rt as f,
  Be as g,
  fe as h,
  ge as i,
  Qt as j,
  lr as k,
  vt as l,
  ir as m,
  tr as n,
  $t as o,
  Et as p,
  er as q,
  St as r,
  sr as s,
  Ht as t,
  ne as u,
  ur as v,
  Xt as w,
  Kt as x,
  Y as y,
  Yt as z
};
